From d34507ec44db7333c8a81ae23ffd89a05ef3293d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 18 Dec 2007 10:10:24 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@145 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-LPC214x-GCC/Makefile.thumb | 13 +++++++------ demos/ARM7-LPC214x-GCC/board.c | 28 ++++++++++++++++++++++++++-- ports/ARM7-LPC214x/GCC/chcore.c | 27 --------------------------- ports/ARM7-LPC214x/GCC/chcore2.s | 3 ++- ports/ARM7-LPC214x/GCC/crt0.s | 4 ---- 5 files changed, 35 insertions(+), 40 deletions(-) diff --git a/demos/ARM7-LPC214x-GCC/Makefile.thumb b/demos/ARM7-LPC214x-GCC/Makefile.thumb index 518169cd8..4b14088c8 100644 --- a/demos/ARM7-LPC214x-GCC/Makefile.thumb +++ b/demos/ARM7-LPC214x-GCC/Makefile.thumb @@ -67,18 +67,19 @@ ASRC = # List THUMB-mode C sources here # NOTE: If any module is compiled in thumb mode then -mthumb-interwork is # enabled for all modules and that lowers performance. -TSRC = chcore.c \ +TSRC = ../../ports/ARM7-LPC214x/GCC/chcore.c \ + ../../ports/ARM7-LPC214x/GCC/vic.c \ + ../../ports/ARM7-LPC214x/GCC/lpc214x_serial.c \ + ../../ports/ARM7-LPC214x/GCC/lpc214x_ssp.c \ ../../src/chinit.c ../../src/chdebug.c ../../src/chlists.c ../../src/chdelta.c \ ../../src/chschd.c ../../src/chthreads.c ../../src/chsem.c ../../src/chmtx.c \ ../../src/chevents.c ../../src/chmsg.c ../../src/chsleep.c ../../src/chqueues.c \ ../../src/chserial.c \ - ../../ports/ARM7-LPC214x/GCC/vic.c ../../ports/ARM7-LPC214x/GCC/lpc214x_serial.c \ - ../../ports/ARM7-LPC214x/GCC/lpc214x_ssp.c \ ../../src/lib/evtimer.c ../../test/test.c \ - buzzer.c mmcsd.c main.c + board.c buzzer.c mmcsd.c main.c # List ASM source files here -ASMSRC = crt0.s chcore2.s +ASMSRC = ../../ports/ARM7-LPC214x/GCC/crt0.s ../../ports/ARM7-LPC214x/GCC/chcore2.s # List all user directories here UINCDIR = ../../src/include ../../src/lib ../../ports/ARM7-LPC214x/GCC @@ -161,7 +162,7 @@ $(TOBJS) : %.o : %.c $(ASMOBJS) : %.o : %.s @echo - $(AS) -c $(ASFLAGS) $< -o $@ + $(AS) -c $(ASFLAGS) -I . $(INCDIR) $< -o $@ %elf: $(OBJS) @echo diff --git a/demos/ARM7-LPC214x-GCC/board.c b/demos/ARM7-LPC214x-GCC/board.c index d6b92f842..23e642f01 100644 --- a/demos/ARM7-LPC214x-GCC/board.c +++ b/demos/ARM7-LPC214x-GCC/board.c @@ -28,8 +28,32 @@ #include "mmcsd.h" #include "buzzer.h" -extern void IrqHandler(void); -extern void T0IrqHandler(void); +/* + * Non-vectored IRQs handling here. + */ +__attribute__((naked)) +static void IrqHandler(void) { + + chSysIRQEnterI(); + + /* nothing */ + + chSysIRQExitI(); +} + +/* + * Timer 0 IRQ handling here. + */ +__attribute__((naked)) +static void T0IrqHandler(void) { + + chSysIRQEnterI(); + + T0IR = 1; /* Clear interrupt on match MR0. */ + chSysTimerHandlerI(); + + chSysIRQExitI(); +} /* * Hardware initialization goes here. diff --git a/ports/ARM7-LPC214x/GCC/chcore.c b/ports/ARM7-LPC214x/GCC/chcore.c index 11f407627..51ead6542 100644 --- a/ports/ARM7-LPC214x/GCC/chcore.c +++ b/ports/ARM7-LPC214x/GCC/chcore.c @@ -39,33 +39,6 @@ void _IdleThread(void *p) { void chSysPuts(char *msg) { } -/* - * Non-vectored IRQs handling here. - */ -__attribute__((naked, weak)) -void IrqHandler(void) { - - chSysIRQEnterI(); - - /* nothing */ - - chSysIRQExitI(); -} - -/* - * Timer 0 IRQ handling here. - */ -__attribute__((naked, weak)) -void T0IrqHandler(void) { - - chSysIRQEnterI(); - - T0IR = 1; /* Clear interrupt on match MR0. */ - chSysTimerHandlerI(); - - chSysIRQExitI(); -} - /* * Common IRQ exit code, \p chSysIRQExitI() just jumps here. * diff --git a/ports/ARM7-LPC214x/GCC/chcore2.s b/ports/ARM7-LPC214x/GCC/chcore2.s index ee1e6ad55..a31422cea 100644 --- a/ports/ARM7-LPC214x/GCC/chcore2.s +++ b/ports/ARM7-LPC214x/GCC/chcore2.s @@ -32,9 +32,9 @@ .text .code 32 -.balign 4 #ifdef THUMB +.balign 16 .globl chSysLock chSysLock: msr CPSR_c, #MODE_SYS | I_BIT @@ -46,6 +46,7 @@ chSysUnlock: bx lr #endif +.balign 16 .globl chSysSwitchI chSysSwitchI: #ifdef CH_CURRP_REGISTER_CACHE diff --git a/ports/ARM7-LPC214x/GCC/crt0.s b/ports/ARM7-LPC214x/GCC/crt0.s index b58e189e8..27e2eefcf 100644 --- a/ports/ARM7-LPC214x/GCC/crt0.s +++ b/ports/ARM7-LPC214x/GCC/crt0.s @@ -136,8 +136,6 @@ bssloop: mov r1, r0 bl main bl chSysHalt -.weak hwinit -hwinit: bx lr #else add r0, pc, #1 bx r0 @@ -147,8 +145,6 @@ hwinit: bx lr mov r1, r0 bl main bl chSysHalt -.weak hwinit -hwinit: bx lr .code 32 #endif -- cgit v1.2.3