diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-02-09 00:11:22 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-02-09 00:11:22 +0000 |
commit | 10c4657704464e36e966873ba091c47ba7ae6db2 (patch) | |
tree | 57987934471725fd776a5ee43ba254cfa2ce58b9 /nuttx/arch/sh/src/m16c | |
parent | 6957b39cd8d76efefad682933430074023842c96 (diff) | |
download | px4-nuttx-10c4657704464e36e966873ba091c47ba7ae6db2.tar.gz px4-nuttx-10c4657704464e36e966873ba091c47ba7ae6db2.tar.bz2 px4-nuttx-10c4657704464e36e966873ba091c47ba7ae6db2.zip |
Adding M16C support
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1486 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/sh/src/m16c')
-rw-r--r-- | nuttx/arch/sh/src/m16c/Make.defs | 6 | ||||
-rw-r--r-- | nuttx/arch/sh/src/m16c/chip.h | 2 | ||||
-rw-r--r-- | nuttx/arch/sh/src/m16c/m16c_head.S | 20 |
3 files changed, 15 insertions, 13 deletions
diff --git a/nuttx/arch/sh/src/m16c/Make.defs b/nuttx/arch/sh/src/m16c/Make.defs index 7c1645c8b..5bb9d73be 100644 --- a/nuttx/arch/sh/src/m16c/Make.defs +++ b/nuttx/arch/sh/src/m16c/Make.defs @@ -38,9 +38,9 @@ HEAD_ASRC = m16c_head.S CMN_ASRCS = CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c \ up_createstack.c up_doirq.c up_exit.c up_idle.c up_initialize.c \ - up_initialstate.c up_interruptcontext.c up_lowputs.c \ - up_mdelay.c up_puts.c up_releasepending.c up_releasestack.c \ - up_reprioritizertr.c up_udelay.c up_unblocktask.c up_usestack.c + up_interruptcontext.c up_lowputs.c up_mdelay.c up_puts.c \ + up_releasepending.c up_releasestack.c up_reprioritizertr.c \ + up_udelay.c up_unblocktask.c up_usestack.c ifneq ($(CONFIG_DISABLE_SIGNALS),y) CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c diff --git a/nuttx/arch/sh/src/m16c/chip.h b/nuttx/arch/sh/src/m16c/chip.h index 580823f1b..89f07c97a 100644 --- a/nuttx/arch/sh/src/m16c/chip.h +++ b/nuttx/arch/sh/src/m16c/chip.h @@ -232,4 +232,4 @@ #define M16C_PUR2 0x003fe /* Pull-up control 2 */ #define M16C_PCR 0x003ff /* Port control */ -#endif /* __ARCH_SH_SRC_M16C_CHIP_H */
\ No newline at end of file +#endif /* __ARCH_SH_SRC_M16C_CHIP_H */ diff --git a/nuttx/arch/sh/src/m16c/m16c_head.S b/nuttx/arch/sh/src/m16c/m16c_head.S index 753f98c20..944493911 100644 --- a/nuttx/arch/sh/src/m16c/m16c_head.S +++ b/nuttx/arch/sh/src/m16c/m16c_head.S @@ -91,12 +91,13 @@ * 0x00400 - DATA Size: Determined by linker * BSS Size: Determined by linker * Idle stack Size: CONFIG_IDLETHREAD_STACKSIZE - * Interrupt stack Size: CONFIG_M16C_ISTACKSIZE + * Interrupt stack Size: CONFIG_ARCH_INTERRUPTSTACK * Heap Size: Everything remaining * 0x00bff - (end+1) */ .data +#if 0 .globl _g_stackbase .type _g_stackbase, object _g_stackbase: @@ -107,16 +108,13 @@ _g_stackbase: .globl _g_istackbase .type _g_istackbase, object _g_istackbase: - .word _enbss+CONFIG_IDLETHREAD_STACKSIZE-4 + .word _enbss+CONFIG_IDLETHREAD_STACKSIZE .size _g_istackbase, .-_g_istackbase - - - * The heap extends from _g_heapbase to the end of RAM. - */ +#endif .globl _g_heapbase .type _g_heapbase, object _g_heapbase: - .word _enbss+CONFIG_IDLETHREAD_STACKSIZE+CONFIG_M16C_ISTACKSIZE + .word _enbss+CONFIG_IDLETHREAD_STACKSIZE+CONFIG_ARCH_INTERRUPTSTACK .size _g_heapbase, .-_g_heapbase /************************************************************************************ @@ -346,9 +344,13 @@ _g_heapbase: .type __start, #function __start: -/* Set the istack pointer */ +/* Set the interrupt and user stack pointers */ - ldc #_enbss, isp /* Set idle thread stack pointer to the end of BSS */ + mov.w #_enbss, R0 + ldc R0, usp /* Set the user stack pointer */ + add.w #CONFIG_IDLETHREAD_STACKSIZE, R0 + ldc R0, isp /* Set interrupt thread stack pointer to the end of BSS */ + fset U /* Set bit 7 (U) to select the user stack pointer */ /* Set BCLK speed. At reset, the processor clock (BLCK) defaults to a divisor of 8. * This sets clock to F1 (divide by 1) on XIN: BCLK = XIN frequency. |