enabling thumb only enter user mode in tmr-ints.

usermode breaks rftests.
This commit is contained in:
Mariano Alvira 2009-04-22 16:04:50 -04:00
parent 9f31e40864
commit 8964c60d9a
4 changed files with 11 additions and 9 deletions

View File

@ -70,7 +70,7 @@ NOTHUMB_CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS) \
-I$(TOPDIR)/include \
-fno-builtin -ffreestanding -nostdinc -isystem \
$(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

View File

@ -26,7 +26,7 @@
# clean the slate ...
PLATFORM_LDFLAGS =
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
#########################################################################

View File

@ -113,13 +113,13 @@ _begin:
mov sp,r1
// msr cpsr_c,#(USR_MODE | I_BIT | F_BIT)
// add r1,r1,#usr_stack_size
// mov sp,r1
bl _rom_data_init+.-base
msr cpsr_c,#(SVC_MODE) // turn on interrupts --- for debug only
// swi
msr cpsr_c,#(SVC_MODE) // turn on interrupts --- for debug only
// msr cpsr_c,#(USR_MODE) // turn on interrupts --- for debug only
// add r1,r1,#usr_stack_size
// mov sp,r1
b main
_undefined_instruction: .word undefined_instruction

View File

@ -124,8 +124,10 @@ void main(void) {
/* go into user mode to handle IRQs */
/* disabling interrupts is now difficult */
asm("msr cpsr_c,#(0x10)");
asm(".code 32;"
"msr cpsr_c,#(0x10);"
".code 16; ");
while(1) {
/* sit here and let the interrupts do the work */
};