enabling thumb only enter user mode in tmr-ints.
usermode breaks rftests.
This commit is contained in:
parent
9f31e40864
commit
8964c60d9a
2
Makefile
2
Makefile
|
@ -70,7 +70,7 @@ NOTHUMB_CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS) \
|
||||||
-I$(TOPDIR)/include \
|
-I$(TOPDIR)/include \
|
||||||
-fno-builtin -ffreestanding -nostdinc -isystem \
|
-fno-builtin -ffreestanding -nostdinc -isystem \
|
||||||
$(gccincdir) -pipe
|
$(gccincdir) -pipe
|
||||||
NOTHUMB_CPPFLAGS_EXTRA = -march=armv4t -mlong-calls -mtune=arm7tdmi-s -DCONFIG_ARM -D__ARM__ #-mthumb-interwork
|
NOTHUMB_CPPFLAGS_EXTRA = -march=armv4t -mlong-calls -mtune=arm7tdmi-s -DCONFIG_ARM -D__ARM__ -mthumb-interwork
|
||||||
|
|
||||||
|
|
||||||
src/isr.o: src/isr.c
|
src/isr.o: src/isr.c
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
# clean the slate ...
|
# clean the slate ...
|
||||||
PLATFORM_LDFLAGS =
|
PLATFORM_LDFLAGS =
|
||||||
PLATFORM_RELFLAGS = -fno-strict-aliasing -fno-common -ffixed-r8 -ffunction-sections -msoft-float
|
PLATFORM_RELFLAGS = -fno-strict-aliasing -fno-common -ffixed-r8 -ffunction-sections -msoft-float
|
||||||
PLATFORM_CPPFLAGS = -march=armv4t -mlong-calls -mtune=arm7tdmi-s -DCONFIG_ARM -D__ARM__ #-mcallee-super-interworking -mthumb -mthumb-interwork
|
PLATFORM_CPPFLAGS = -march=armv4t -mlong-calls -mtune=arm7tdmi-s -DCONFIG_ARM -D__ARM__ -mcallee-super-interworking -mthumb -mthumb-interwork
|
||||||
TEXT_BASE = 0x00400000
|
TEXT_BASE = 0x00400000
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
10
src/start.S
10
src/start.S
|
@ -113,13 +113,13 @@ _begin:
|
||||||
mov sp,r1
|
mov sp,r1
|
||||||
|
|
||||||
// msr cpsr_c,#(USR_MODE | I_BIT | F_BIT)
|
// msr cpsr_c,#(USR_MODE | I_BIT | F_BIT)
|
||||||
// add r1,r1,#usr_stack_size
|
|
||||||
// mov sp,r1
|
|
||||||
|
|
||||||
|
|
||||||
bl _rom_data_init+.-base
|
bl _rom_data_init+.-base
|
||||||
msr cpsr_c,#(SVC_MODE) // turn on interrupts --- for debug only
|
msr cpsr_c,#(SVC_MODE) // turn on interrupts --- for debug only
|
||||||
// swi
|
// msr cpsr_c,#(USR_MODE) // turn on interrupts --- for debug only
|
||||||
|
// add r1,r1,#usr_stack_size
|
||||||
|
// mov sp,r1
|
||||||
|
|
||||||
b main
|
b main
|
||||||
|
|
||||||
_undefined_instruction: .word undefined_instruction
|
_undefined_instruction: .word undefined_instruction
|
||||||
|
|
|
@ -124,8 +124,10 @@ void main(void) {
|
||||||
|
|
||||||
/* go into user mode to handle IRQs */
|
/* go into user mode to handle IRQs */
|
||||||
/* disabling interrupts is now difficult */
|
/* disabling interrupts is now difficult */
|
||||||
asm("msr cpsr_c,#(0x10)");
|
asm(".code 32;"
|
||||||
|
"msr cpsr_c,#(0x10);"
|
||||||
|
".code 16; ");
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
/* sit here and let the interrupts do the work */
|
/* sit here and let the interrupts do the work */
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue