summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-05-19 17:54:01 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-05-19 17:54:01 +0000
commit5bbce5453fee636e7fbb087ffee7691edfd25318 (patch)
tree7d1664531a2aab1eaf6ee294b595160e4bb2c25a
parentb72d8f8ca224f9ac84cbc15cbb09577d1a804902 (diff)
downloadnuttx-5bbce5453fee636e7fbb087ffee7691edfd25318.tar.gz
nuttx-5bbce5453fee636e7fbb087ffee7691edfd25318.tar.bz2
nuttx-5bbce5453fee636e7fbb087ffee7691edfd25318.zip
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
-rw-r--r--nuttx/arch/arm/src/common/up_internal.h41
-rw-r--r--nuttx/arch/arm/src/cortexm3/up_context.S (renamed from nuttx/arch/arm/src/lm3s/lm3s_context.S)5
-rw-r--r--nuttx/arch/arm/src/cortexm3/up_hardfault.c (renamed from nuttx/arch/arm/src/lm3s/lm3s_hardfault.c)11
-rw-r--r--nuttx/arch/arm/src/cortexm3/up_svcall.c (renamed from nuttx/arch/arm/src/lm3s/lm3s_svcall.c)9
-rw-r--r--nuttx/arch/arm/src/lm3s/Make.defs10
-rw-r--r--nuttx/arch/arm/src/lm3s/lm3s_internal.h41
-rw-r--r--nuttx/arch/arm/src/lm3s/lm3s_irq.c4
7 files changed, 50 insertions, 71 deletions
diff --git a/nuttx/arch/arm/src/common/up_internal.h b/nuttx/arch/arm/src/common/up_internal.h
index d5c350e1e..2fd44bb93 100644
--- a/nuttx/arch/arm/src/common/up_internal.h
+++ b/nuttx/arch/arm/src/common/up_internal.h
@@ -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);
diff --git a/nuttx/arch/arm/src/lm3s/lm3s_context.S b/nuttx/arch/arm/src/cortexm3/up_context.S
index efef06630..ab3018d6f 100644
--- a/nuttx/arch/arm/src/lm3s/lm3s_context.S
+++ b/nuttx/arch/arm/src/cortexm3/up_context.S
@@ -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
diff --git a/nuttx/arch/arm/src/lm3s/lm3s_hardfault.c b/nuttx/arch/arm/src/cortexm3/up_hardfault.c
index 7a3e60623..fdd405130 100644
--- a/nuttx/arch/arm/src/lm3s/lm3s_hardfault.c
+++ b/nuttx/arch/arm/src/cortexm3/up_hardfault.c
@@ -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);
}
}
diff --git a/nuttx/arch/arm/src/lm3s/lm3s_svcall.c b/nuttx/arch/arm/src/cortexm3/up_svcall.c
index d6c7bf517..3a346881f 100644
--- a/nuttx/arch/arm/src/lm3s/lm3s_svcall.c
+++ b/nuttx/arch/arm/src/cortexm3/up_svcall.c
@@ -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];
diff --git a/nuttx/arch/arm/src/lm3s/Make.defs b/nuttx/arch/arm/src/lm3s/Make.defs
index 3e0ab3488..42bb065d2 100644
--- a/nuttx/arch/arm/src/lm3s/Make.defs
+++ b/nuttx/arch/arm/src/lm3s/Make.defs
@@ -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
diff --git a/nuttx/arch/arm/src/lm3s/lm3s_internal.h b/nuttx/arch/arm/src/lm3s/lm3s_internal.h
index 86d9514d2..0408fe81d 100644
--- a/nuttx/arch/arm/src/lm3s/lm3s_internal.h
+++ b/nuttx/arch/arm/src/lm3s/lm3s_internal.h
@@ -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
****************************************************************************/
@@ -281,27 +261,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
*
* Description:
diff --git a/nuttx/arch/arm/src/lm3s/lm3s_irq.c b/nuttx/arch/arm/src/lm3s/lm3s_irq.c
index 374c4bfc7..a2da7663e 100644
--- a/nuttx/arch/arm/src/lm3s/lm3s_irq.c
+++ b/nuttx/arch/arm/src/lm3s/lm3s_irq.c
@@ -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 */