1
0
Эх сурвалжийг харах

修改了license header,修改了sconscipt,修改了board.c指针的强制转换类型,interrupt.c添加了新的函数。

GFWisshit 4 жил өмнө
parent
commit
ad917d9010

+ 9 - 19
bsp/bm3803/applications/board.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>
@@ -58,7 +48,7 @@ INIT_BOARD_EXPORT(rt_hw_timer_init);
  */
 void rt_hw_board_init(void)
 {
-    rt_system_heap_init((void *)&__bss_end, (void *)&__bss_end + 0x01000000);
+    rt_system_heap_init((void *)&__bss_end, (unsigned char *)&__bss_end + 0x01000000);
     rt_components_board_init();
     rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
 }

+ 8 - 18
bsp/bm3803/applications/board.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 __BOARD_H__
 #define __BOARD_H__

+ 8 - 18
bsp/bm3803/applications/main.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 <stdint.h>
 #include <stdio.h>

+ 8 - 18
bsp/bm3803/drivers/uart.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>

+ 8 - 18
bsp/bm3803/drivers/uart.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 __SERIAL_H__
 #define __SERIAL_H__

+ 8 - 18
bsp/bm3803/drivers/uart_reg.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 SERIAL_REG_H
 #define SERIAL_REG_H

+ 8 - 18
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__

+ 8 - 18
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

+ 16 - 18
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);
+}

+ 9 - 22
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

+ 8 - 18
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>
 

+ 8 - 18
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

+ 8 - 18
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>

+ 8 - 18
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;

+ 0 - 6
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')