summaryrefslogtreecommitdiff
path: root/libcpu
diff options
context:
space:
mode:
authorGFWisshit <[email protected]>2020-10-21 15:08:13 +0800
committerGFWisshit <[email protected]>2020-10-21 15:09:33 +0800
commitad917d90109a8e628ab7ea440acbbfaa8273d780 (patch)
tree00e32b46d7d5af160dc7750694cec7b148895f1d /libcpu
parentc1f4d6c691498287830af97679548d4c83c3ca02 (diff)
修改了license header,修改了sconscipt,修改了board.c指针的强制转换类型,interrupt.c添加了新的函数。
Diffstat (limited to 'libcpu')
-rw-r--r--libcpu/sparc-v8/bm3803/bm3803.h26
-rw-r--r--libcpu/sparc-v8/bm3803/context_gcc.S26
-rw-r--r--libcpu/sparc-v8/bm3803/interrupt.c34
-rw-r--r--libcpu/sparc-v8/bm3803/interrupt.h31
-rw-r--r--libcpu/sparc-v8/bm3803/stack.c26
-rw-r--r--libcpu/sparc-v8/bm3803/start_gcc.S26
-rw-r--r--libcpu/sparc-v8/bm3803/trap.c26
-rw-r--r--libcpu/sparc-v8/bm3803/vector_gcc.S26
-rw-r--r--libcpu/sparc-v8/common/SConscript6
9 files changed, 73 insertions, 154 deletions
diff --git a/libcpu/sparc-v8/bm3803/bm3803.h b/libcpu/sparc-v8/bm3803/bm3803.h
index 4a4c750975..17a9882eb2 100644
--- a/libcpu/sparc-v8/bm3803/bm3803.h
+++ b/libcpu/sparc-v8/bm3803/bm3803.h
@@ -1,22 +1,12 @@
/*
-Copyright 2020 Shenzhen Academy of Aerospace Technology
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Change Logs:
-Date Author Notes
-2020-10-16 Dystopia the first version
-*/
+ * Copyright (c) 2020, Shenzhen Academy of Aerospace Technology
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2020-10-16 Dystopia the first version
+ */
#ifndef __BM3803_H__
#define __BM3803_H__
diff --git a/libcpu/sparc-v8/bm3803/context_gcc.S b/libcpu/sparc-v8/bm3803/context_gcc.S
index 478793588e..c0344a81d5 100644
--- a/libcpu/sparc-v8/bm3803/context_gcc.S
+++ b/libcpu/sparc-v8/bm3803/context_gcc.S
@@ -1,22 +1,12 @@
/*
-Copyright 2020 Shenzhen Academy of Aerospace Technology
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Change Logs:
-Date Author Notes
-2020-10-16 Dystopia the first version
-*/
+ * Copyright (c) 2020, Shenzhen Academy of Aerospace Technology
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2020-10-16 Dystopia the first version
+ */
#define SPARC_PSR_PIL_MASK 0x00000F00
#define SPARC_PSR_ET_MASK 0x00000020
diff --git a/libcpu/sparc-v8/bm3803/interrupt.c b/libcpu/sparc-v8/bm3803/interrupt.c
index 8ce03dd4c0..b3625862b4 100644
--- a/libcpu/sparc-v8/bm3803/interrupt.c
+++ b/libcpu/sparc-v8/bm3803/interrupt.c
@@ -1,22 +1,12 @@
/*
-Copyright 2020 Shenzhen Academy of Aerospace Technology
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Change Logs:
-Date Author Notes
-2020-10-16 Dystopia the first version
-*/
+ * Copyright (c) 2020, Shenzhen Academy of Aerospace Technology
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2020-10-16 Dystopia the first version
+ */
#include <rthw.h>
#include <rtthread.h>
@@ -98,3 +88,11 @@ rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
return old_handler;
}
+
+void rt_hw_interrupt_clear(int vector)
+{
+ if (vector > 0x1F || vector < 0x11)
+ return;
+ volatile struct lregs *regs = (struct lregs *)PREGS;
+ regs->irqclear |= 1 << (vector - 0x10);
+}
diff --git a/libcpu/sparc-v8/bm3803/interrupt.h b/libcpu/sparc-v8/bm3803/interrupt.h
index 5c97d5caa5..666d5268f5 100644
--- a/libcpu/sparc-v8/bm3803/interrupt.h
+++ b/libcpu/sparc-v8/bm3803/interrupt.h
@@ -1,30 +1,17 @@
/*
-Copyright 2020 Shenzhen Academy of Aerospace Technology
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Change Logs:
-Date Author Notes
-2020-10-16 Dystopia the first version
-*/
+ * Copyright (c) 2020, Shenzhen Academy of Aerospace Technology
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2020-10-16 Dystopia the first version
+ * 2020-10-21 Dystopia Add new function
+ */
#ifndef __INTERRUPT_H__
#define __INTERRUPT_H__
-void rt_hw_interrupt_control(int vector, int priority, int route);
-int rt_hw_interrupt_get_active(int fiq_irq);
-void rt_hw_interrupt_ack(int fiq_irq);
-void rt_hw_interrupt_trigger(int vector);
void rt_hw_interrupt_clear(int vector);
#endif
diff --git a/libcpu/sparc-v8/bm3803/stack.c b/libcpu/sparc-v8/bm3803/stack.c
index 70c1b60d8c..2fdc37b539 100644
--- a/libcpu/sparc-v8/bm3803/stack.c
+++ b/libcpu/sparc-v8/bm3803/stack.c
@@ -1,22 +1,12 @@
/*
-Copyright 2020 Shenzhen Academy of Aerospace Technology
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Change Logs:
-Date Author Notes
-2020-10-16 Dystopia the first version
-*/
+ * Copyright (c) 2020, Shenzhen Academy of Aerospace Technology
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2020-10-16 Dystopia the first version
+ */
#include <rtthread.h>
diff --git a/libcpu/sparc-v8/bm3803/start_gcc.S b/libcpu/sparc-v8/bm3803/start_gcc.S
index fd613375c9..0f87aa17db 100644
--- a/libcpu/sparc-v8/bm3803/start_gcc.S
+++ b/libcpu/sparc-v8/bm3803/start_gcc.S
@@ -1,22 +1,12 @@
/*
-Copyright 2020 Shenzhen Academy of Aerospace Technology
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Change Logs:
-Date Author Notes
-2020-10-16 Dystopia the first version
-*/
+ * Copyright (c) 2020, Shenzhen Academy of Aerospace Technology
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2020-10-16 Dystopia the first version
+ */
#define PSR_INIT 0x10C0
#define PREGS 0x80000000
diff --git a/libcpu/sparc-v8/bm3803/trap.c b/libcpu/sparc-v8/bm3803/trap.c
index 545073ed18..b896a0d941 100644
--- a/libcpu/sparc-v8/bm3803/trap.c
+++ b/libcpu/sparc-v8/bm3803/trap.c
@@ -1,22 +1,12 @@
/*
-Copyright 2020 Shenzhen Academy of Aerospace Technology
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Change Logs:
-Date Author Notes
-2020-10-16 Dystopia the first version
-*/
+ * Copyright (c) 2020, Shenzhen Academy of Aerospace Technology
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2020-10-16 Dystopia the first version
+ */
#include <rtthread.h>
#include <rthw.h>
diff --git a/libcpu/sparc-v8/bm3803/vector_gcc.S b/libcpu/sparc-v8/bm3803/vector_gcc.S
index 114fe45536..0d243bee33 100644
--- a/libcpu/sparc-v8/bm3803/vector_gcc.S
+++ b/libcpu/sparc-v8/bm3803/vector_gcc.S
@@ -1,22 +1,12 @@
/*
-Copyright 2020 Shenzhen Academy of Aerospace Technology
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Change Logs:
-Date Author Notes
-2020-10-16 Dystopia the first version
-*/
+ * Copyright (c) 2020, Shenzhen Academy of Aerospace Technology
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2020-10-16 Dystopia the first version
+ */
#define TRAPL(H) mov %g0, %l0; sethi %hi(H), %l4; jmp %l4 + %lo(H); nop;
#define TRAP(H) mov %psr, %l0; sethi %hi(H), %l4; jmp %l4 + %lo(H); nop;
diff --git a/libcpu/sparc-v8/common/SConscript b/libcpu/sparc-v8/common/SConscript
index 9ff30a796b..1e96ff5837 100644
--- a/libcpu/sparc-v8/common/SConscript
+++ b/libcpu/sparc-v8/common/SConscript
@@ -8,16 +8,10 @@ cwd = GetCurrentDir()
src = Glob('*.c') + Glob('*.cpp')
CPPPATH = [cwd]
-if rtconfig.PLATFORM == 'armcc':
- src += Glob('*_rvds.S')
-
if rtconfig.PLATFORM == 'gcc':
src += Glob('*_init.S')
src += Glob('*_gcc.S')
-if rtconfig.PLATFORM == 'iar':
- src += Glob('*_iar.S')
-
group = DefineGroup('cpu', src, depend = [''], CPPPATH = CPPPATH)
Return('group')