diff options
| -rw-r--r-- | demos/ARM7-LPC214x-GCC/Makefile.thumb | 13 | ||||
| -rw-r--r-- | demos/ARM7-LPC214x-GCC/board.c | 28 | ||||
| -rw-r--r-- | ports/ARM7-LPC214x/GCC/chcore.c | 27 | ||||
| -rw-r--r-- | ports/ARM7-LPC214x/GCC/chcore2.s | 3 | ||||
| -rw-r--r-- | 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 @@ -40,33 +40,6 @@ 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.
   *
   * System stack frame structure after a context switch in the
 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
  | 
