Skip to content

Commit 1bc7b8e

Browse files
committed
[libcpu] Sync to latest version.
1 parent 62a7c59 commit 1bc7b8e

File tree

23 files changed

+417
-25
lines changed

23 files changed

+417
-25
lines changed

libcpu/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ config ARCH_RISCV
8686
config ARCH_IA32
8787
bool
8888

89+
config ARCH_TIDSP
90+
bool
91+
92+
config ARCH_TIDSP_C28X
93+
bool
94+
select ARCH_TIDSP
95+
select ARCH_CPU_STACK_GROWS_UPWARD
96+
8997
config ARCH_HOST_SIMULATOR
9098
bool
9199

libcpu/SConscript

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,37 @@ Import('RTT_ROOT')
22
Import('rtconfig')
33
from building import *
44

5+
arch = rtconfig.ARCH
56
comm = rtconfig.ARCH + '/common'
67
path = rtconfig.ARCH + '/' + rtconfig.CPU
8+
src = []
79
ASFLAGS = ''
810

911
# The set of source files associated with this SConscript file.
1012
if rtconfig.PLATFORM == 'armcc':
11-
src = Glob(path + '/*.c') + Glob(path + '/*_rvds.S') + Glob(comm + '/*.c')
13+
src += Glob(path + '/*.c') + Glob(path + '/*_rvds.S')
14+
src += Glob(comm + '/*.c') + Glob(comm + '/*_rvds.S')
1215

1316
if rtconfig.PLATFORM == 'gcc':
14-
src = Glob(path + '/*.c') + Glob(path + '/*_gcc.S') + Glob(comm + '/*.c') + Glob(path + '/*_init.S')
17+
src += Glob(path + '/*_init.S')
18+
src += Glob(path + '/*.c') + Glob(path + '/*_gcc.S')
19+
src += Glob(comm + '/*.c') + Glob(comm + '/*_gcc.S')
1520

1621
if rtconfig.PLATFORM == 'iar':
17-
src = Glob(path + '/*.c') + Glob(path + '/*_iar.S') + Glob(comm + '/*.c')
22+
src += Glob(path + '/*.c') + Glob(path + '/*_iar.S')
23+
src += Glob(comm + '/*.c') + Glob(comm + '/*_iar.S')
1824

1925
if rtconfig.PLATFORM == 'cl':
20-
src = Glob(path + '/*.c')
26+
src = Glob(path + '/*.c')
2127

2228
if rtconfig.PLATFORM == 'mingw':
23-
src = Glob(path + '/*.c')
29+
src = Glob(path + '/*.c')
2430

2531
if rtconfig.PLATFORM == 'armcc' and rtconfig.ARCH == 'arm' and rtconfig.CPU == 'arm926':
2632
ASFLAGS = ' --cpreproc'
27-
28-
CPPPATH = [RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/' + rtconfig.CPU, RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/common']
33+
34+
CPPPATH = [RTT_ROOT + '/libcpu/' + arch + '/' + rtconfig.CPU, RTT_ROOT + '/libcpu/' + arch + '/common']
35+
2936
group = DefineGroup(rtconfig.CPU.upper(), src, depend = [''], CPPPATH = CPPPATH, ASFLAGS = ASFLAGS)
3037

3138
Return('group')

libcpu/arm/AT91SAM7X/interrupt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void rt_hw_interrupt_umask(int vector)
9191
* @return the old handler
9292
*/
9393
rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
94-
void *param, char *name)
94+
void *param, const char *name)
9595
{
9696
rt_isr_handler_t old_handler = RT_NULL;
9797
if(vector >= 0 && vector < MAX_HANDLERS)

libcpu/arm/am335x/interrupt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void rt_hw_interrupt_ack(int fiq_irq)
158158
* @param old_handler the old interrupt service routine
159159
*/
160160
rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
161-
void *param, char *name)
161+
void *param, const char *name)
162162
{
163163
rt_isr_handler_t old_handler = RT_NULL;
164164

libcpu/arm/arm926/start_rvds.S

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@
2525
; * 2015-06-04 aozima Align stack address to 8 byte.
2626
; */
2727

28-
#include "rt_low_level_init.h"
28+
;#include "rt_low_level_init.h"
29+
UND_STK_SIZE EQU 512
30+
SVC_STK_SIZE EQU 4096
31+
ABT_STK_SIZE EQU 512
32+
IRQ_STK_SIZE EQU 1024
33+
FIQ_STK_SIZE EQU 1024
34+
SYS_STK_SIZE EQU 512
35+
Heap_Size EQU 512
2936

3037
S_FRAME_SIZE EQU (18*4) ;72
3138
;S_SPSR EQU (17*4) ;SPSR

libcpu/arm/cortex-a/interrupt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void rt_hw_interrupt_umask(int vector)
110110
* @param old_handler the old interrupt service routine
111111
*/
112112
rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
113-
void *param, char *name)
113+
void *param, const char *name)
114114
{
115115
rt_isr_handler_t old_handler = RT_NULL;
116116

libcpu/arm/cortex-m0/cpuport.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,22 @@ void rt_hw_hard_fault_exception(struct exception_stack_frame *contex)
114114

115115
while (1);
116116
}
117+
118+
#define SCB_CFSR (*(volatile const unsigned *)0xE000ED28) /* Configurable Fault Status Register */
119+
#define SCB_HFSR (*(volatile const unsigned *)0xE000ED2C) /* HardFault Status Register */
120+
#define SCB_MMAR (*(volatile const unsigned *)0xE000ED34) /* MemManage Fault Address register */
121+
#define SCB_BFAR (*(volatile const unsigned *)0xE000ED38) /* Bus Fault Address Register */
122+
#define SCB_AIRCR (*(volatile unsigned long *)0xE000ED00) /* Reset control Address Register */
123+
#define SCB_RESET_VALUE 0x05FA0004 /* Reset value, write to SCB_AIRCR can reset cpu */
124+
125+
#define SCB_CFSR_MFSR (*(volatile const unsigned char*)0xE000ED28) /* Memory-management Fault Status Register */
126+
#define SCB_CFSR_BFSR (*(volatile const unsigned char*)0xE000ED29) /* Bus Fault Status Register */
127+
#define SCB_CFSR_UFSR (*(volatile const unsigned short*)0xE000ED2A) /* Usage Fault Status Register */
128+
129+
/**
130+
* reset CPU
131+
*/
132+
RT_WEAK void rt_hw_cpu_reset(void)
133+
{
134+
SCB_AIRCR = SCB_RESET_VALUE;//((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |SCB_AIRCR_SYSRESETREQ_Msk);
135+
}

libcpu/arm/cortex-r4/interrupt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void rt_hw_interrupt_umask(int vector)
8686
* @return the old handler
8787
*/
8888
rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
89-
void *param, char *name)
89+
void *param, const char *name)
9090
{
9191
rt_isr_handler_t old_handler = RT_NULL;
9292

libcpu/arm/lpc214x/cpuport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void rt_hw_interrupt_umask(int vector)
137137
* @return old handler
138138
*/
139139
rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
140-
void *param, char *name)
140+
void *param, const char *name)
141141
{
142142
rt_isr_handler_t old_handler = RT_NULL;
143143

libcpu/arm/lpc24xx/interrupt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void rt_hw_interrupt_umask(int vector)
8383
* @return the old handler
8484
*/
8585
rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
86-
void *param, char *name)
86+
void *param, const char *name)
8787
{
8888
rt_isr_handler_t old_handler = RT_NULL;
8989

0 commit comments

Comments
 (0)