LM32: Fix various compilation errors that I introduced.

This commit is contained in:
Gregory Nutt 2016-11-04 17:37:10 -06:00
parent 5a9d3b20fa
commit 911e5abb2c
11 changed files with 40 additions and 23 deletions

3
arch/misoc/include/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/board
/chip

5
arch/misoc/src/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
/.depend
/Make.dep
/locked.r
/board
/chip

View File

@ -42,6 +42,20 @@
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdint.h>
/****************************************************************************
* 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 * Public Functions

View File

@ -57,6 +57,6 @@ void misoc_lowputs(const char *str)
{ {
while (*str) while (*str)
{ {
up_lowputc(*str++); misoc_lowputc(*str++);
} }
} }

View File

@ -45,7 +45,7 @@
#include <nuttx/irq.h> #include <nuttx/irq.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include "misoc_arch.h" #include "misoc.h"
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions

View File

@ -58,6 +58,6 @@ void misoc_puts(const char *str)
{ {
while (*str) while (*str)
{ {
misoc_putc(*str++); up_putc(*str++);
} }
} }

View File

@ -57,7 +57,7 @@
#include <arch/board/generated/csr.h> #include <arch/board/generated/csr.h>
#include "chip.h" #include "chip.h"
#include "hw/flags.h #include "hw/flags.h"
#include "misoc.h" #include "misoc.h"
/**************************************************************************** /****************************************************************************

View File

@ -38,15 +38,14 @@ HEAD_ASRC = lm32_vectors.S
CMN_ASRCS = CMN_ASRCS =
CMN_CSRCS = misoc_lowputs.c misoc_serial.c misoc_mdelay.c 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 CMN_CSRCS += misoc_puts.c misoc_udelay.c
CHIP_ASRCS = lm32_syscall.S CHIP_ASRCS = lm32_syscall.S
CHIP_CSRCS = lm32_allocateheap.c lm32_assert.c lm32_blocktask.c 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_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_doirq.c lm32_dumpstate.c lm32_exit.c lm32_idle.c
CHIP_CSRCS += lm32_idle.c lm32_initialize.c lm32_initialstate.c CHIP_CSRCS += lm32_initialize.c lm32_initialstate.c lm32_interruptcontext.c
CHIP_CSRCS += lm32_interruptcontext.c lm32_irq.c lm32_releasepending.c CHIP_CSRCS += lm32_irq.c lm32_releasepending.c lm32_releasestack.c
CHIP_CSRCS += lm32_releasestack.c lm32_stackframe.c lm32_swint.c CHIP_CSRCS += lm32_stackframe.c lm32_swint.c lm32_unblocktask.c
CHIP_CSRCS += lm32_unblocktask.c

View File

@ -92,15 +92,6 @@
# endif # endif
#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 * Public Types
****************************************************************************/ ****************************************************************************/
@ -143,6 +134,7 @@ void lm32_irq_initialize(void);
/* Interrupt decode *********************************************************/ /* Interrupt decode *********************************************************/
uint32_t *lm32_decodeirq(uint32_t intstat, uint32_t *regs); uint32_t *lm32_decodeirq(uint32_t intstat, uint32_t *regs);
uint32_t *lm32_doirq(int irq, uint32_t *regs);
/* Software interrupts ******************************************************/ /* Software interrupts ******************************************************/

View File

@ -39,6 +39,11 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdint.h>
#include <debug.h>
#include <arch/irq.h>
#include "chip.h" #include "chip.h"
#include "lm32.h" #include "lm32.h"
@ -69,13 +74,13 @@ uint32_t *lm32_decodeirq(uint32_t intstat, uint32_t *regs)
/* Decode and dispatch interrupts */ /* 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); uint32_t bit = (1 << irq);
/* Is this interrupt pending? */ /* Is this interrupt pending? */
if ((instat & bit) != 0) if ((intstat & bit) != 0)
{ {
/* Yes.. Dispatch the interrupt */ /* Yes.. Dispatch the interrupt */
/* REVIST: Do I need to acknowledge the interrupt first? */ /* 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. * break out of the loop early.
*/ */
instat &= ~bit; intstat &= ~bit;
} }
} }

View File

@ -126,7 +126,6 @@ uint32_t *lm32_doirq(int irq, uint32_t *regs)
/* Unmask the last interrupt (global interrupts are still disabled) */ /* Unmask the last interrupt (global interrupts are still disabled) */
up_enable_irq(irq); up_enable_irq(irq);
#endif
board_autoled_off(LED_INIRQ); board_autoled_off(LED_INIRQ);
return regs; return regs;
} }