diff options
Diffstat (limited to 'demos/ARM7-LPC214x-GCC')
-rw-r--r-- | demos/ARM7-LPC214x-GCC/Makefile | 2 | ||||
-rw-r--r-- | demos/ARM7-LPC214x-GCC/Makefile.thumb | 4 | ||||
-rw-r--r-- | demos/ARM7-LPC214x-GCC/chcore2.s | 63 | ||||
-rw-r--r-- | demos/ARM7-LPC214x-GCC/crt0.s | 28 | ||||
-rw-r--r-- | demos/ARM7-LPC214x-GCC/main.c | 6 |
5 files changed, 40 insertions, 63 deletions
diff --git a/demos/ARM7-LPC214x-GCC/Makefile b/demos/ARM7-LPC214x-GCC/Makefile index 6c0750add..3698582e7 100644 --- a/demos/ARM7-LPC214x-GCC/Makefile +++ b/demos/ARM7-LPC214x-GCC/Makefile @@ -138,7 +138,7 @@ ifneq ($(TSRC),) # Pure THUMB case, THUMB C code cannot be called by ARM asm code directly
CPFLAGS += -D THUMB
LDFLAGS += -mthumb
- ASFLAGS += -mthumb-interwork -D THUMB -D PURE_THUMB
+ ASFLAGS += -mthumb-interwork -D THUMB -D THUMB_NO_INTERWORKING
endif
endif
diff --git a/demos/ARM7-LPC214x-GCC/Makefile.thumb b/demos/ARM7-LPC214x-GCC/Makefile.thumb index 05a63460d..c08d632f9 100644 --- a/demos/ARM7-LPC214x-GCC/Makefile.thumb +++ b/demos/ARM7-LPC214x-GCC/Makefile.thumb @@ -135,9 +135,9 @@ ifneq ($(TSRC),) ASFLAGS += -mthumb-interwork -D THUMB
else
# Pure THUMB case, THUMB C code cannot be called by ARM asm code directly
- CPFLAGS += -D THUMB
+ CPFLAGS += -D THUMB -D THUMB_NO_INTERWORKING
LDFLAGS += -mthumb
- ASFLAGS += -mthumb-interwork -D THUMB -D PURE_THUMB
+ ASFLAGS += -mthumb-interwork -D THUMB -D THUMB_NO_INTERWORKING
endif
endif
diff --git a/demos/ARM7-LPC214x-GCC/chcore2.s b/demos/ARM7-LPC214x-GCC/chcore2.s index c9ad0c208..a450d9b74 100644 --- a/demos/ARM7-LPC214x-GCC/chcore2.s +++ b/demos/ARM7-LPC214x-GCC/chcore2.s @@ -37,16 +37,15 @@ .globl threadstart
threadstart:
msr CPSR_c, #MODE_SYS
-#ifndef PURE_THUMB
+#ifndef THUMB_NO_INTERWORKING
mov r0, r5
mov lr, pc
bx r4
bl chThdExit
#else
- ldr r0, =.L1
+ add r0, pc, #1
bx r0
.code 16
-.L1:
mov r0, r5
mov lr, pc
bx r4
@@ -68,7 +67,7 @@ AbortHandler: .globl FiqHandler
FiqHandler:
-#ifdef PURE_THUMB
+#ifdef THUMB_NO_INTERWORKING
ldr r0, =chSysHalt
bx r0
#else
@@ -139,80 +138,74 @@ chSysSwitchI: IrqHandler:
sub lr, lr, #4
stmfd sp!, {r0-r3, r12, lr}
-#ifdef PURE_THUMB
- ldr r0, =NonVectoredIrq
- mov lr, pc
+#ifdef THUMB_NO_INTERWORKING
+ add r0, pc, #1
bx r0
.code 16
- mov lr, pc
- bx lr
+ bl NonVectoredIrq
+ b IrqCommon
.code 32
#else
bl NonVectoredIrq
-#endif
b IrqCommon
+#endif
.globl T0IrqHandler
T0IrqHandler:
sub lr, lr, #4
stmfd sp!, {r0-r3, r12, lr}
-#ifdef PURE_THUMB
- ldr r0, =Timer0Irq
- mov lr, pc
+#ifdef THUMB_NO_INTERWORKING
+ add r0, pc, #1
bx r0
.code 16
- mov lr, pc
- bx lr
+ bl Timer0Irq
+ b IrqCommon
.code 32
#else
bl Timer0Irq
-#endif
b IrqCommon
+#endif
.globl UART0IrqHandler
UART0IrqHandler:
sub lr, lr, #4
stmfd sp!, {r0-r3, r12, lr}
-#ifdef PURE_THUMB
- ldr r0, =UART0Irq
- mov lr, pc
+#ifdef THUMB_NO_INTERWORKING
+ add r0, pc, #1
bx r0
.code 16
- mov lr, pc
- bx lr
+ bl UART0Irq
+ b IrqCommon
.code 32
#else
bl UART0Irq
-#endif
b IrqCommon
+#endif
.globl UART1IrqHandler
UART1IrqHandler:
sub lr, lr, #4
stmfd sp!, {r0-r3, r12, lr}
-#ifdef PURE_THUMB
- ldr r0, =UART1Irq
- mov lr, pc
+#ifdef THUMB_NO_INTERWORKING
+ add r0, pc, #1
bx r0
.code 16
- mov lr, pc
- bx lr
+ bl UART1Irq
+ b IrqCommon
.code 32
#else
bl UART1Irq
-#endif
b IrqCommon
+#endif
/*
* Common exit point for all IRQ routines, it performs the rescheduling if
* required.
*/
IrqCommon:
-#ifdef PURE_THUMB
- ldr r0, =chSchRescRequiredI
- mov lr, pc
- bx r0
+#ifdef THUMB_NO_INTERWORKING
.code 16
+ bl chSchRescRequiredI
mov lr, pc
bx lr
.code 32
@@ -233,11 +226,11 @@ IrqCommon: stmfd sp!, {r0, r1} // Push R0=SPSR, R1=LR_IRQ.
// Context switch.
-#ifdef PURE_THUMB
- ldr r0, =chSchDoRescheduleI
- mov lr, pc
+#ifdef THUMB_NO_INTERWORKING
+ add r0, pc, #1
bx r0
.code 16
+ bl chSchDoRescheduleI
mov lr, pc
bx lr
.code 32
diff --git a/demos/ARM7-LPC214x-GCC/crt0.s b/demos/ARM7-LPC214x-GCC/crt0.s index 7bf91e291..a7845036d 100644 --- a/demos/ARM7-LPC214x-GCC/crt0.s +++ b/demos/ARM7-LPC214x-GCC/crt0.s @@ -127,33 +127,23 @@ bssloop: /*
* Application-provided HW initialization routine.
*/
-#ifndef PURE_THUMB
+#ifndef THUMB_NO_INTERWORKING
bl hwinit
-#else
- ldr r0, =hwinit
- mov lr, pc
- bx r0
-.code 16
- mov lr, pc
- bx lr
-.code 32
-#endif
/*
* main(0, NULL).
*/
mov r0, #0
- mov r1, #0
-#ifndef PURE_THUMB
+ mov r1, r0
bl main
bl chSysHalt
#else
- ldr r2, =main
- mov lr, pc
- bx r2
+ add r0, pc, #1
+ bx r0
.code 16
- mov lr, pc
- bx lr
+ bl hwinit
+ mov r0, #0
+ mov r1, r0
+ bl main
+ bl chSysHalt
.code 32
- ldr r2, =chSysHalt
- bx r2
#endif
diff --git a/demos/ARM7-LPC214x-GCC/main.c b/demos/ARM7-LPC214x-GCC/main.c index 1829e6eb6..f84874f78 100644 --- a/demos/ARM7-LPC214x-GCC/main.c +++ b/demos/ARM7-LPC214x-GCC/main.c @@ -136,12 +136,6 @@ int main(int argc, char **argv) { }
/*
- * Allows the other threads to run by lowering the priority, remember,
- * the priority is set to the maximum in the \p chSysInit().
- */
- chThdSetPriority(NORMALPRIO);
-
- /*
* Normal main() activity, in this demo it serves events generated by
* various sources.
*/
|