From 911e5abb2c7a2eb7a6b4c200871b20390dfab380 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 4 Nov 2016 17:37:10 -0600 Subject: [PATCH] LM32: Fix various compilation errors that I introduced. --- arch/misoc/include/.gitignore | 3 +++ arch/misoc/src/.gitignore | 5 +++++ arch/misoc/src/common/misoc.h | 14 ++++++++++++++ arch/misoc/src/common/misoc_lowputs.c | 2 +- arch/misoc/src/common/misoc_modifyreg32.c | 2 +- arch/misoc/src/common/misoc_puts.c | 2 +- arch/misoc/src/common/misoc_serial.c | 2 +- arch/misoc/src/lm32/Make.defs | 11 +++++------ arch/misoc/src/lm32/lm32.h | 10 +--------- arch/misoc/src/lm32/lm32_decodeirq.c | 11 ++++++++--- arch/misoc/src/lm32/lm32_doirq.c | 1 - 11 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 arch/misoc/include/.gitignore create mode 100644 arch/misoc/src/.gitignore diff --git a/arch/misoc/include/.gitignore b/arch/misoc/include/.gitignore new file mode 100644 index 0000000000..e6460c4a67 --- /dev/null +++ b/arch/misoc/include/.gitignore @@ -0,0 +1,3 @@ +/board +/chip + diff --git a/arch/misoc/src/.gitignore b/arch/misoc/src/.gitignore new file mode 100644 index 0000000000..dfdfc93543 --- /dev/null +++ b/arch/misoc/src/.gitignore @@ -0,0 +1,5 @@ +/.depend +/Make.dep +/locked.r +/board +/chip diff --git a/arch/misoc/src/common/misoc.h b/arch/misoc/src/common/misoc.h index e95a60e5d7..4726759ea5 100644 --- a/arch/misoc/src/common/misoc.h +++ b/arch/misoc/src/common/misoc.h @@ -42,6 +42,20 @@ ****************************************************************************/ #include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Low-level register access */ + +#define getreg8(a) (*(volatile uint8_t *)(a)) +#define putreg8(v,a) (*(volatile uint8_t *)(a) = (v)) +#define getreg16(a) (*(volatile uint16_t *)(a)) +#define putreg16(v,a) (*(volatile uint16_t *)(a) = (v)) +#define getreg32(a) (*(volatile uint32_t *)(a)) +#define putreg32(v,a) (*(volatile uint32_t *)(a) = (v)) /**************************************************************************** * Public Functions diff --git a/arch/misoc/src/common/misoc_lowputs.c b/arch/misoc/src/common/misoc_lowputs.c index d384883816..7b8b962678 100644 --- a/arch/misoc/src/common/misoc_lowputs.c +++ b/arch/misoc/src/common/misoc_lowputs.c @@ -57,6 +57,6 @@ void misoc_lowputs(const char *str) { while (*str) { - up_lowputc(*str++); + misoc_lowputc(*str++); } } diff --git a/arch/misoc/src/common/misoc_modifyreg32.c b/arch/misoc/src/common/misoc_modifyreg32.c index 3e7c2d5419..65eda199ab 100644 --- a/arch/misoc/src/common/misoc_modifyreg32.c +++ b/arch/misoc/src/common/misoc_modifyreg32.c @@ -45,7 +45,7 @@ #include #include -#include "misoc_arch.h" +#include "misoc.h" /**************************************************************************** * Public Functions diff --git a/arch/misoc/src/common/misoc_puts.c b/arch/misoc/src/common/misoc_puts.c index 556c23f829..f048b74795 100644 --- a/arch/misoc/src/common/misoc_puts.c +++ b/arch/misoc/src/common/misoc_puts.c @@ -58,6 +58,6 @@ void misoc_puts(const char *str) { while (*str) { - misoc_putc(*str++); + up_putc(*str++); } } diff --git a/arch/misoc/src/common/misoc_serial.c b/arch/misoc/src/common/misoc_serial.c index af05eb1bb1..c46e83775a 100644 --- a/arch/misoc/src/common/misoc_serial.c +++ b/arch/misoc/src/common/misoc_serial.c @@ -57,7 +57,7 @@ #include #include "chip.h" -#include "hw/flags.h +#include "hw/flags.h" #include "misoc.h" /**************************************************************************** diff --git a/arch/misoc/src/lm32/Make.defs b/arch/misoc/src/lm32/Make.defs index e31fd7f50f..9c0768b2a4 100644 --- a/arch/misoc/src/lm32/Make.defs +++ b/arch/misoc/src/lm32/Make.defs @@ -38,15 +38,14 @@ HEAD_ASRC = lm32_vectors.S CMN_ASRCS = CMN_CSRCS = misoc_lowputs.c misoc_serial.c misoc_mdelay.c -CMN_CSRCS += misoc_modifyreg8.cmisoc_modifyreg16.c misoc_modifyreg32.c +CMN_CSRCS += misoc_modifyreg8.c misoc_modifyreg16.c misoc_modifyreg32.c CMN_CSRCS += misoc_puts.c misoc_udelay.c CHIP_ASRCS = lm32_syscall.S CHIP_CSRCS = lm32_allocateheap.c lm32_assert.c lm32_blocktask.c CHIP_CSRCS += lm32_copystate.c lm32_createstack.c lm32_decodeirq.c -CHIP_CSRCS += lm32_doirq.c lm32_dumpstate.c lm32_dumpstate.c lm32_exit.c -CHIP_CSRCS += lm32_idle.c lm32_initialize.c lm32_initialstate.c -CHIP_CSRCS += lm32_interruptcontext.c lm32_irq.c lm32_releasepending.c -CHIP_CSRCS += lm32_releasestack.c lm32_stackframe.c lm32_swint.c -CHIP_CSRCS += lm32_unblocktask.c +CHIP_CSRCS += lm32_doirq.c lm32_dumpstate.c lm32_exit.c lm32_idle.c +CHIP_CSRCS += lm32_initialize.c lm32_initialstate.c lm32_interruptcontext.c +CHIP_CSRCS += lm32_irq.c lm32_releasepending.c lm32_releasestack.c +CHIP_CSRCS += lm32_stackframe.c lm32_swint.c lm32_unblocktask.c diff --git a/arch/misoc/src/lm32/lm32.h b/arch/misoc/src/lm32/lm32.h index 7b125578f0..eac1fe7651 100644 --- a/arch/misoc/src/lm32/lm32.h +++ b/arch/misoc/src/lm32/lm32.h @@ -92,15 +92,6 @@ # endif #endif -/* Low-level register access */ - -#define getreg8(a) (*(volatile uint8_t *)(a)) -#define putreg8(v,a) (*(volatile uint8_t *)(a) = (v)) -#define getreg16(a) (*(volatile uint16_t *)(a)) -#define putreg16(v,a) (*(volatile uint16_t *)(a) = (v)) -#define getreg32(a) (*(volatile uint32_t *)(a)) -#define putreg32(v,a) (*(volatile uint32_t *)(a) = (v)) - /**************************************************************************** * Public Types ****************************************************************************/ @@ -143,6 +134,7 @@ void lm32_irq_initialize(void); /* Interrupt decode *********************************************************/ uint32_t *lm32_decodeirq(uint32_t intstat, uint32_t *regs); +uint32_t *lm32_doirq(int irq, uint32_t *regs); /* Software interrupts ******************************************************/ diff --git a/arch/misoc/src/lm32/lm32_decodeirq.c b/arch/misoc/src/lm32/lm32_decodeirq.c index 198445deed..1cb792cedf 100644 --- a/arch/misoc/src/lm32/lm32_decodeirq.c +++ b/arch/misoc/src/lm32/lm32_decodeirq.c @@ -39,6 +39,11 @@ #include +#include +#include + +#include + #include "chip.h" #include "lm32.h" @@ -69,13 +74,13 @@ uint32_t *lm32_decodeirq(uint32_t intstat, uint32_t *regs) /* Decode and dispatch interrupts */ - for (irq = 0; irq < MISOC_NINTERRUPTS & instat != 0; i++) + for (irq = 0; irq < MISOC_NINTERRUPTS && intstat != 0; irq++) { uint32_t bit = (1 << irq); /* Is this interrupt pending? */ - if ((instat & bit) != 0) + if ((intstat & bit) != 0) { /* Yes.. Dispatch the interrupt */ /* REVIST: Do I need to acknowledge the interrupt first? */ @@ -87,7 +92,7 @@ uint32_t *lm32_decodeirq(uint32_t intstat, uint32_t *regs) * break out of the loop early. */ - instat &= ~bit; + intstat &= ~bit; } } diff --git a/arch/misoc/src/lm32/lm32_doirq.c b/arch/misoc/src/lm32/lm32_doirq.c index 25cc30e2a0..cf42f4e699 100644 --- a/arch/misoc/src/lm32/lm32_doirq.c +++ b/arch/misoc/src/lm32/lm32_doirq.c @@ -126,7 +126,6 @@ uint32_t *lm32_doirq(int irq, uint32_t *regs) /* Unmask the last interrupt (global interrupts are still disabled) */ up_enable_irq(irq); -#endif board_autoled_off(LED_INIRQ); return regs; }