Move share-able Cortex-M3 file from lm3s subdirectory

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1797 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2009-05-19 17:54:01 +00:00
parent c8095344f4
commit 96e97248a0
7 changed files with 50 additions and 71 deletions

View File

@ -118,6 +118,26 @@ extern uint32 g_heapbase;
#if CONFIG_ARCH_INTERRUPTSTACK > 3
extern uint32 g_userstack;
#endif
/* These 'addresses' of these values are setup by the linker script. They are
* not actual uint32 storage locations! They are only used meaningfully in the
* following way:
*
* - The linker script defines, for example, the symbol_sdata.
* - The declareion extern uint32 _sdata; makes C happy. C will believe
* that the value _sdata is the address of a uint32 variable _data (it is
* not!).
* - We can recoved the linker value then by simply taking the address of
* of _data. like: uint32 *pdata = &_sdata;
*/
extern uint32 _stext; /* Start of .text */
extern uint32 _etext; /* End_1 of .text + .rodata */
extern const uint32 _eronly; /* End+1 of read only section (.text + .rodata) */
extern uint32 _sdata; /* Start of .data */
extern uint32 _edata; /* End+1 of .data */
extern uint32 _sbss; /* Start of .bss */
extern uint32 _ebss; /* End+1 of .bss */
#endif
/****************************************************************************
@ -134,25 +154,28 @@ extern uint32 g_userstack;
extern void up_boot(void);
extern void up_copystate(uint32 *dest, uint32 *src);
extern void up_dataabort(uint32 *regs);
extern void up_decodeirq(uint32 *regs);
#ifdef CONFIG_ARCH_CORTEXM3
extern uint32 *up_doirq(int irq, uint32 *regs);
#else
extern void up_doirq(int irq, uint32 *regs);
#endif
extern void up_fullcontextrestore(uint32 *regs) __attribute__ ((noreturn));
extern void up_irqinitialize(void);
extern void up_prefetchabort(uint32 *regs);
extern int up_saveusercontext(uint32 *regs);
extern void up_sigdeliver(void);
extern void up_syscall(uint32 *regs);
extern int up_timerisr(int irq, uint32 *regs);
extern void up_undefinedinsn(uint32 *regs);
extern void up_lowputc(char ch);
extern void up_puts(const char *str);
extern void up_lowputs(const char *str);
#ifdef CONFIG_ARCH_CORTEXM3
extern uint32 *up_doirq(int irq, uint32 *regs);
extern int up_svcall(int irq, FAR void *context);
extern int up_hardfault(int irq, FAR void *context);
#else
extern void up_doirq(int irq, uint32 *regs);
extern void up_dataabort(uint32 *regs);
extern void up_prefetchabort(uint32 *regs);
extern void up_syscall(uint32 *regs);
extern void up_undefinedinsn(uint32 *regs);
#endif
/* Defined in up_vectors.S */
extern void up_vectorundefinsn(void);

View File

@ -1,6 +1,5 @@
/************************************************************************************
* arch/arm/src/lm3s/lm3s_context.S
* arch/arm/src/chip/lm3s_context.S
* arch/arm/src/cortexm3/up_context.S
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@ -52,7 +51,7 @@
.syntax unified
.thumb
.file "lm3s_context.S"
.file "up_context.S"
/************************************************************************************
* Macros

View File

@ -1,6 +1,5 @@
/****************************************************************************
* arch/arm/src/lm3s/lm3s_hardfault.c
* arch/arm/src/chip/lm3s_hardfault.c
* arch/arm/src/cortexm3/up_hardfault.c
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@ -50,7 +49,7 @@
#include "up_arch.h"
#include "os_internal.h"
#include "nvic.h"
#include "lm3s_internal.h"
#include "up_internal.h"
/****************************************************************************
* Pre-processor Definitions
@ -77,7 +76,7 @@
****************************************************************************/
/****************************************************************************
* Name: lm3s_hardfault
* Name: up_hardfault
*
* Description:
* This is Hard Fault exception handler. It also catches SVC call
@ -85,7 +84,7 @@
*
****************************************************************************/
int lm3s_hardfault(int irq, FAR void *context)
int up_hardfault(int irq, FAR void *context)
{
uint32 *regs = (uint32*)context;
uint16 *pc;
@ -131,7 +130,7 @@ int lm3s_hardfault(int irq, FAR void *context)
if (insn == INSN_SVC0)
{
sllvdbg("Forward SVCall\n");
return lm3s_svcall(LM3S_IRQ_SVCALL, context);
return up_svcall(irq, context);
}
}

View File

@ -1,6 +1,5 @@
/****************************************************************************
* arch/arm/src/lm3s/lm3s_svcall.c
* arch/arm/src/chip/lm3s_svcall.c
* arch/arm/src/cortexm3/up_svcall.c
*
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@ -48,7 +47,7 @@
#include <arch/irq.h>
#include "os_internal.h"
#include "lm3s_internal.h"
#include "up_internal.h"
/****************************************************************************
* Pre-processor Definitions
@ -73,14 +72,14 @@
****************************************************************************/
/****************************************************************************
* Name: lm3s_svcall
* Name: up_svcall
*
* Description:
* This is SVCall exception handler that performs context switching
*
****************************************************************************/
int lm3s_svcall(int irq, FAR void *context)
int up_svcall(int irq, FAR void *context)
{
uint32 *svregs = (uint32*)context;
uint32 *tcbregs = (uint32*)svregs[REG_R1];

View File

@ -35,18 +35,18 @@
HEAD_ASRC = lm3s_vectors.S
CMN_ASRCS =
CMN_ASRCS = up_context.S
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c \
up_createstack.c up_mdelay.c up_udelay.c up_exit.c \
up_idle.c up_initialize.c up_initialstate.c up_interruptcontext.c \
up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c \
up_releasepending.c up_releasestack.c up_reprioritizertr.c \
up_schedulesigaction.c up_sigdeliver.c up_unblocktask.c \
up_usestack.c up_doirq.c
up_usestack.c up_doirq.c up_hardfault.c up_svcall.c
CHIP_ASRCS = lm3s_context.S
CHIP_CSRCS = lm3s_start.c lm3s_syscontrol.c lm3s_irq.c lm3s_svcall.c \
lm3s_hardfault.c lm3s_gpio.c lm3s_gpioirq.c lm3s_timerisr.c lm3s_lowputc.c \
CHIP_ASRCS =
CHIP_CSRCS = lm3s_start.c lm3s_syscontrol.c lm3s_irq.c \
lm3s_gpio.c lm3s_gpioirq.c lm3s_timerisr.c lm3s_lowputc.c \
lm3s_serial.c
ifdef CONFIG_NET

View File

@ -213,26 +213,6 @@ extern "C" {
#define EXTERN extern
#endif
/* These 'addresses' of these values are setup by the linker script. They are
* not actual uint32 storage locations! They are only used meaningfully in the
* following way:
*
* - The linker script defines, for example, the symbol_sdata.
* - The declareion extern uint32 _sdata; makes C happy. C will believe
* that the value _sdata is the address of a uint32 variable _data (it is
* not!).
* - We can recoved the linker value then by simply taking the address of
* of _data. like: uint32 *pdata = &_sdata;
*/
extern uint32 _stext; /* Start of .text */
extern uint32 _etext; /* End_1 of .text + .rodata) */
extern const uint32 _eronly; /* End+1 of read only section (.text + .rodata) */
extern uint32 _sdata; /* Start of .data */
extern uint32 _edata; /* End+1 of .data */
extern uint32 _sbss; /* Start of .bss */
extern uint32 _ebss; /* End+1 of .bss */
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
@ -280,27 +260,6 @@ EXTERN void up_clockconfig(void);
EXTERN int lm3s_configgpio(uint32 cfgset);
/****************************************************************************
* Name: lm3s_svcall
*
* Description:
* This is SVCall exception handler that performs context switching
*
****************************************************************************/
EXTERN int lm3s_svcall(int irq, FAR void *context);
/****************************************************************************
* Name: lm3s_hardfault
*
* Description:
* This is Hard Fault exception handler. It also catches SVC call
* exceptions that are performed in bad contexts.
*
****************************************************************************/
EXTERN int lm3s_hardfault(int irq, FAR void *context);
/****************************************************************************
* Name: lm3s_gpiowrite
*

View File

@ -315,8 +315,8 @@ void up_irqinitialize(void)
* under certain conditions.
*/
irq_attach(LM3S_IRQ_SVCALL, lm3s_svcall);
irq_attach(LM3S_IRQ_HARDFAULT, lm3s_hardfault);
irq_attach(LM3S_IRQ_SVCALL, up_svcall);
irq_attach(LM3S_IRQ_HARDFAULT, up_hardfault);
/* Set the priority of the SVCall interrupt */