From c8e8880d60607d706ac70832efb876dc1ec91ed2 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 12 Feb 2008 14:37:55 +0000 Subject: [PATCH] More z8 compilation changes git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@671 42af7a65-404d-4744-a932-0658087f49c3 --- arch/arm/include/arch.h | 1 - arch/z80/include/z8/irq.h | 10 ++++---- arch/z80/src/Makefile.zdsii | 4 ++-- arch/z80/src/common/up_assert.c | 24 +++++++++++++++++++ arch/z80/src/common/up_sigdeliver.c | 4 ++-- arch/z80/src/z8/Make.defs | 8 +++---- arch/z80/src/z80/Make.defs | 4 ++-- .../src/{common/up_irq.c => z80/z80_irq.c} | 2 +- 8 files changed, 39 insertions(+), 18 deletions(-) rename arch/z80/src/{common/up_irq.c => z80/z80_irq.c} (99%) diff --git a/arch/arm/include/arch.h b/arch/arm/include/arch.h index a64ecb5e96..6f8f0f89ef 100644 --- a/arch/arm/include/arch.h +++ b/arch/arm/include/arch.h @@ -77,4 +77,3 @@ extern "C" { #endif #endif /* __ARCH_ARCH_H */ - diff --git a/arch/z80/include/z8/irq.h b/arch/z80/include/z8/irq.h index 27ea9f1c98..915fa50fa5 100644 --- a/arch/z80/include/z8/irq.h +++ b/arch/z80/include/z8/irq.h @@ -89,11 +89,6 @@ * void irqrestore(irqstate_t flags); */ -#ifdef __ZILOG__ -# define irqsave() TDI() -# define irqrestore(f) RI(f) -#endif - /**************************************************************************** * Public Types ****************************************************************************/ @@ -117,7 +112,7 @@ struct xcptcontext */ #ifndef CONFIG_DISABLE_SIGNALS - void *sigdeliver; /* Actual type is sig_deliver_t */ + CODE void *sigdeliver; /* Actual type is sig_deliver_t */ /* The following retains that state during signal execution */ @@ -147,6 +142,9 @@ extern "C" { #define EXTERN extern #endif +EXTERN irqstate_t irqsave(void); +EXTERN void irqrestore(irqstate_t flags); + #undef EXTERN #ifdef __cplusplus } diff --git a/arch/z80/src/Makefile.zdsii b/arch/z80/src/Makefile.zdsii index c6dcf653c9..afb1b07a15 100644 --- a/arch/z80/src/Makefile.zdsii +++ b/arch/z80/src/Makefile.zdsii @@ -85,12 +85,12 @@ up_mem.h: @echo "" >>up_mem.h @echo "#ifndef CONFIG_HEAP1_BASE" >>up_mem.h @echo " extern far unsigned long far_heapbot;" >>up_mem.h - @echo "# define CONFIG_HEAP1_BASE ((unsigned long)&far_heapbot)" >>up_mem.h + @echo "# define CONFIG_HEAP1_BASE ((uint16)&far_heapbot)" >>up_mem.h @echo "#endif" >>up_mem.h @echo "" >>up_mem.h @echo "#ifndef CONFIG_HEAP1_END" >>up_mem.h @echo " extern far unsigned long far_heaptop;" >>up_mem.h - @echo "# define CONFIG_HEAP1_END ((unsigned long)&far_heaptop)" >>up_mem.h + @echo "# define CONFIG_HEAP1_END ((uint16)&far_heaptop)" >>up_mem.h @echo "#endif" >>up_mem.h @echo "" >>up_mem.h @echo "#endif /* __UP_MEM_H */" >>up_mem.h diff --git a/arch/z80/src/common/up_assert.c b/arch/z80/src/common/up_assert.c index c1e2e4a8cd..b409df425c 100644 --- a/arch/z80/src/common/up_assert.c +++ b/arch/z80/src/common/up_assert.c @@ -109,7 +109,11 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */ * Name: up_assert ****************************************************************************/ +#ifdef CONFIG_HAVE_FILENAME void up_assert(const ubyte *filename, int lineno) +#else +void up_assert(void) +#endif { #if CONFIG_TASK_NAME_SIZE > 0 _TCB *rtcb = (_TCB*)g_readytorun.head; @@ -117,12 +121,20 @@ void up_assert(const ubyte *filename, int lineno) up_ledon(LED_ASSERTION); +#ifdef CONFIG_HAVE_FILENAME #if CONFIG_TASK_NAME_SIZE > 0 lldbg("Assertion failed at file:%s line: %d task: %s\n", filename, lineno, rtcb->name); #else lldbg("Assertion failed at file:%s line: %d\n", filename, lineno); +#endif +#else +#if CONFIG_TASK_NAME_SIZE > 0 + lldbg("Assertion failed: task: %s\n", rtcb->name); +#else + lldbg("Assertion failed\n"); +#endif #endif up_stackdump(); @@ -134,7 +146,11 @@ void up_assert(const ubyte *filename, int lineno) * Name: up_assert_code ****************************************************************************/ +#ifdef CONFIG_HAVE_FILENAME void up_assert_code(const ubyte *filename, int lineno, int errorcode) +#else +void up_assert_code(int errorcode) +#endif { #if CONFIG_TASK_NAME_SIZE > 0 _TCB *rtcb = (_TCB*)g_readytorun.head; @@ -142,12 +158,20 @@ void up_assert_code(const ubyte *filename, int lineno, int errorcode) up_ledon(LED_ASSERTION); +#ifdef CONFIG_HAVE_FILENAME #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); #else lldbg("Assertion failed at file:%s line: %d error code: %d\n", filename, lineno, errorcode); +#endif +#else +#if CONFIG_TASK_NAME_SIZE > 0 + lldbg("Assertion failed: task: %s error code: %d\n", rtcb->name, errorcode); +#else + lldbg("Assertion failed: error code: %d\n", errorcode); +#endif #endif up_stackdump(); diff --git a/arch/z80/src/common/up_sigdeliver.c b/arch/z80/src/common/up_sigdeliver.c index 5f2aab7679..757e5020bc 100644 --- a/arch/z80/src/common/up_sigdeliver.c +++ b/arch/z80/src/common/up_sigdeliver.c @@ -81,8 +81,8 @@ void up_sigdeliver(void) { #ifndef CONFIG_DISABLE_SIGNALS - _TCB *rtcb = (_TCB*)g_readytorun.head; - uint32 regs[XCPTCONTEXT_REGS]; + FAR _TCB *rtcb = (_TCB*)g_readytorun.head; + uint16 regs[XCPTCONTEXT_REGS]; sig_deliver_t sigdeliver; /* Save the errno. This must be preserved throughout the signal handling diff --git a/arch/z80/src/z8/Make.defs b/arch/z80/src/z8/Make.defs index 3c48749d7b..f59279dc11 100644 --- a/arch/z80/src/z8/Make.defs +++ b/arch/z80/src/z8/Make.defs @@ -33,17 +33,17 @@ # ############################################################################ -HEAD_ASRC = z8_head.asm +HEAD_ASRC = #z8_head.asm CMN_ASRCS = CMN_CSRCS = up_initialize.c up_allocateheap.c up_createstack.c \ up_releasestack.c up_interruptcontext.c up_blocktask.c \ up_unblocktask.c up_exit.c up_releasepending.c \ - up_reprioritizertr.c up_copystate.c up_irq.c up_idle.c \ + up_reprioritizertr.c up_copystate.c up_idle.c \ up_assert.c up_mdelay.c up_udelay.c \ up_schedulesigaction.c up_sigdeliver.c \ up_registerdump.c up_usestack.c -CHIP_ASRCS = z8_saveusercontext.asm z8_restoreusercontext.asm -CHIP_CSRCS = +CHIP_ASRCS = #z8_saveusercontext.asm z8_restoreusercontext.asm +CHIP_CSRCS = #z8_initialstate.c z8_irq.c diff --git a/arch/z80/src/z80/Make.defs b/arch/z80/src/z80/Make.defs index ae5bdf56b3..11b0312f9e 100644 --- a/arch/z80/src/z80/Make.defs +++ b/arch/z80/src/z80/Make.defs @@ -39,10 +39,10 @@ CMN_ASRCS = CMN_CSRCS = up_initialize.c up_allocateheap.c up_createstack.c \ up_releasestack.c up_interruptcontext.c up_blocktask.c \ up_unblocktask.c up_exit.c up_releasepending.c \ - up_reprioritizertr.c up_copystate.c up_irq.c up_idle.c \ + up_reprioritizertr.c up_copystate.c up_idle.c \ up_assert.c up_mdelay.c up_udelay.c up_schedulesigaction.c \ up_sigdeliver.c up_registerdump.c up_usestack.c CHIP_ASRCS = z80_saveusercontext.asm z80_restoreusercontext.asm -CHIP_CSRCS = z80_initialstate.c +CHIP_CSRCS = z80_initialstate.c z80_irq.c diff --git a/arch/z80/src/common/up_irq.c b/arch/z80/src/z80/z80_irq.c similarity index 99% rename from arch/z80/src/common/up_irq.c rename to arch/z80/src/z80/z80_irq.c index ef7c8c1c61..5d4e92fe01 100644 --- a/arch/z80/src/common/up_irq.c +++ b/arch/z80/src/z80/z80_irq.c @@ -1,5 +1,5 @@ /**************************************************************************** - * common/up_irq.c + * arch/z80/src/z80/z80_irq.c * * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt