diff options
Diffstat (limited to 'nuttx/arch/z16/src/common')
-rw-r--r-- | nuttx/arch/z16/src/common/up_allocateheap.c | 21 | ||||
-rw-r--r-- | nuttx/arch/z16/src/common/up_assert.c | 17 | ||||
-rw-r--r-- | nuttx/arch/z16/src/common/up_initialstate.c | 6 | ||||
-rw-r--r-- | nuttx/arch/z16/src/common/up_internal.h | 2 | ||||
-rw-r--r-- | nuttx/arch/z16/src/common/up_stackdump.c | 2 |
5 files changed, 28 insertions, 20 deletions
diff --git a/nuttx/arch/z16/src/common/up_allocateheap.c b/nuttx/arch/z16/src/common/up_allocateheap.c index a73515ac2..de4256cbf 100644 --- a/nuttx/arch/z16/src/common/up_allocateheap.c +++ b/nuttx/arch/z16/src/common/up_allocateheap.c @@ -46,12 +46,25 @@ #include "chip/chip.h" #include "up_internal.h" -#include "up_mem.h" /**************************************************************************** * Private Definitions ****************************************************************************/ +/* Use ZDS-II linker settings to get the unused external RAM and use this + * for the NuttX heap. + */ + +#ifndef CONFIG_HEAP1_BASE + extern _Far unsigned long far_heaptop; + #define CONFIG_HEAP1_BASE ((unsigned long)&far_heaptop) +#endif + +#ifndef CONFIG_HEAP1_END + extern _Far unsigned long far_heapbot; + #define CONFIG_HEAP1_END ((unsigned long)&far_heapbot) +#endif + /**************************************************************************** * Private Data ****************************************************************************/ @@ -76,8 +89,8 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) { - *heap_start = (FAR void*)UP_HEAP1_BASE; - *heap_size = UP_HEAP1_END - UP_HEAP1_BASE; + *heap_start = (FAR void*)CONFIG_HEAP1_BASE; + *heap_size = CONFIG_HEAP1_END - CONFIG_HEAP1_BASE; up_ledon(LED_HEAPALLOCATE); } @@ -93,6 +106,6 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) #if CONFIG_MM_REGIONS > 1 void up_addregion(void) { - mm_addregion((FAR void*)UP_HEAP2_BASE, UP_HEAP2_END - UP_HEAP2_BASE); + mm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_END - CONFIG_HEAP2_BASE); } #endif diff --git a/nuttx/arch/z16/src/common/up_assert.c b/nuttx/arch/z16/src/common/up_assert.c index 4f6b900af..3a6d39ed8 100644 --- a/nuttx/arch/z16/src/common/up_assert.c +++ b/nuttx/arch/z16/src/common/up_assert.c @@ -50,7 +50,6 @@ #include "chip/chip.h" #include "os_internal.h" #include "up_internal.h" -#include "up_mem.h" /**************************************************************************** * Definitions @@ -108,7 +107,7 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */ * Name: up_assert ****************************************************************************/ -void up_assert(const ubyte *filename, int lineno) +void up_assert(void) { #if CONFIG_TASK_NAME_SIZE > 0 _TCB *rtcb = (_TCB*)g_readytorun.head; @@ -117,11 +116,9 @@ void up_assert(const ubyte *filename, int lineno) up_ledon(LED_ASSERTION); #if CONFIG_TASK_NAME_SIZE > 0 - lldbg("Assertion failed at file:%s line: %d task: %s\n", - filename, lineno, rtcb->name); + lldbg("Assertion failed in task: %s\n", rtcb->name); #else - lldbg("Assertion failed at file:%s line: %d\n", - filename, lineno); + lldbg("Assertion failed\n"); #endif up_stackdump(); @@ -133,7 +130,7 @@ void up_assert(const ubyte *filename, int lineno) * Name: up_assert_code ****************************************************************************/ -void up_assert_code(const ubyte *filename, int lineno, int errorcode) +void up_assert_code(int errorcode) { #if CONFIG_TASK_NAME_SIZE > 0 _TCB *rtcb = (_TCB*)g_readytorun.head; @@ -142,11 +139,9 @@ void up_assert_code(const ubyte *filename, int lineno, int errorcode) up_ledon(LED_ASSERTION); #if CONFIG_TASK_NAME_SIZE > 0 - lldbg("Assertion failed at file:%s line: %d task: %s error code: %d\n", - filename, lineno, rtcb->name, errorcode); + lldbg("Assertion failed in task: %s error code: %d\n", rtcb->name, errorcode); #else - lldbg("Assertion failed at file:%s line: %d error code: %d\n", - filename, lineno, errorcode); + lldbg("Assertion failed: %d error code: %d\n", errorcode); #endif up_stackdump(); diff --git a/nuttx/arch/z16/src/common/up_initialstate.c b/nuttx/arch/z16/src/common/up_initialstate.c index d4430f346..acb5c31f1 100644 --- a/nuttx/arch/z16/src/common/up_initialstate.c +++ b/nuttx/arch/z16/src/common/up_initialstate.c @@ -84,8 +84,8 @@ void up_initial_state(_TCB *tcb) memset(&tcb->xcp, 0, sizeof(struct xcptcontext)); #ifndef CONFIG_SUPPRESS_INTERRUPTS - xcp->regs[REG_FLAGS] = Z16F_CNTRL_FLAGS_IRQE << 8; /* IRQE flag will enable interrupts */ + tcb->xcp.regs[REG_FLAGS] = (uint16)(Z16F_CNTRL_FLAGS_IRQE << 8); /* IRQE flag will enable interrupts */ #endif - reg32[REG_SP/2] = (uint32)tcb->adj_stack_ptr; - reg32[REG_PC/2] = (uint32)tcb->start; + reg32[REG_SP/2] = (uint32)tcb->adj_stack_ptr; + reg32[REG_PC/2] = (uint32)tcb->start; } diff --git a/nuttx/arch/z16/src/common/up_internal.h b/nuttx/arch/z16/src/common/up_internal.h index a218a5e35..c09226bf0 100644 --- a/nuttx/arch/z16/src/common/up_internal.h +++ b/nuttx/arch/z16/src/common/up_internal.h @@ -98,7 +98,7 @@ extern chipreg_t *current_regs; extern void up_copystate(FAR chipreg_t *dest, FAR chipreg_t *src); extern void up_doirq(int irq, FAR chipreg_t *regs); -extern void up_fullcontextrestore(FAR chipreg_t *regs); +extern void up_restoreusercontext(FAR chipreg_t *regs); extern void up_irqinitialize(void); extern int up_saveusercontext(FAR chipreg_t *regs); extern void up_sigdeliver(void); diff --git a/nuttx/arch/z16/src/common/up_stackdump.c b/nuttx/arch/z16/src/common/up_stackdump.c index 515e3c30b..354f59a9d 100644 --- a/nuttx/arch/z16/src/common/up_stackdump.c +++ b/nuttx/arch/z16/src/common/up_stackdump.c @@ -70,7 +70,7 @@ /**************************************************************************** * Name: up_getsp ****************************************************************************/ -#warning TO BE PROVIDED +/* To be provided */ /**************************************************************************** * Name: up_stackdump |