diff --git a/TODO b/TODO index 418a3a2878..65cffeb29d 100644 --- a/TODO +++ b/TODO @@ -20,7 +20,7 @@ NuttX TODO List (Last updated January 6, 2008) (1) ARM/DM320 (arch/arm/src/dm320/) (2) ARM/LPC214x (arch/arm/src/lpc214x/) (4) pjrc-8052 / MCS51 (arch/pjrc-8051/) - (2) z80 (arch/z80/) + (3) z80/z8 (arch/z80/) (7) z16 (arch/z16/) o Task/Scheduler (sched/) @@ -353,13 +353,13 @@ o pjrc-8052 / MCS51 (arch/pjrc-8051/) o z80 (arch/z80) ^^^^^^^^^^^^^^^ - Description: The Has the same problems with interger overflow during compilation - as described for pjrc-8051. At typical cause is code like + Description: The SDCC version the same problems with interger overflow during + compilation as described for pjrc-8051. At typical cause is code like usleep(500*1000) which exceeds the range of a 16-bit integer Status: See pjrc-8051 Priority: See pjrc-8051 - Description: The simulated serial console (configs/z80sim/src/z80_serial.c + + Description: The simulated Z80 serial console (configs/z80sim/src/z80_serial.c + driver/serial.c) does not work. This is because there are no interrupts in the simulation so there is never any serial traffic. @@ -367,6 +367,11 @@ o z80 (arch/z80) Priority: Low -- the simulated console is not critical path and the designs to solve the problem are complex. + Description: ZDS-II Librarian complains that the source for the .obj file + is not in the library. + Status: Open + Priority: Low, thought to be cosmetic. I think this is a consequence of + replacing vs. inserting the library. o z16 (arch/z16) ^^^^^^^^^^^^^^^^ diff --git a/arch/z80/include/types.h b/arch/z80/include/types.h index ade00123a0..5e1a3c42d2 100644 --- a/arch/z80/include/types.h +++ b/arch/z80/include/types.h @@ -33,8 +33,8 @@ * ****************************************************************************/ -/* This file should never be included directed but, rather, - * only indirectly through sys/types.h +/* This file should never be included directed but, rather, only indirectly +* through sys/types.h */ #ifndef __ARCH_TYPES_H @@ -44,6 +44,8 @@ * Included Files ****************************************************************************/ +#include + /**************************************************************************** * Definitions ****************************************************************************/ @@ -52,34 +54,6 @@ * Type Declarations ****************************************************************************/ -#ifndef __ASSEMBLY__ - -/* These are the sizes of the standard SDCC types - * - * For SDCC, sizeof(int) is 16 and sizeof(long) is 32. - * long long and double are not supported. - * - * Generic pointers are 3 bytes in length with the the - * first byte holding data space intformation. - */ - -typedef char sbyte; -typedef unsigned char ubyte; -typedef unsigned char uint8; -typedef unsigned char boolean; -typedef int sint16; -typedef unsigned int uint16; -typedef long sint32; -typedef unsigned long uint32; - -/* This is the size of the interrupt state save returned by - * irqsave() - */ - -typedef uint16 irqstate_t; - -#endif /* __ASSEMBLY__ */ - /**************************************************************************** * Global Function Prototypes ****************************************************************************/ diff --git a/arch/z80/include/z8/irq.h b/arch/z80/include/z8/irq.h index 91a5ffd1ce..27ea9f1c98 100644 --- a/arch/z80/include/z8/irq.h +++ b/arch/z80/include/z8/irq.h @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/z8/irq.h + * arch/z8/include/z8/irq.h * arch/chip/irq.h * * Copyright (C) 2008 Gregory Nutt. All rights reserved. @@ -82,6 +82,18 @@ #define XCPTCONTEXT_REGS (9) #define XCPTCONTEXT_SIZE (2 * XCPTCONTEXT_REGS) +/* The ZDS-II provides built-in operations to test & disable and to restore + * the interrupt state. + * + * irqstate_t irqsave(void); + * void irqrestore(irqstate_t flags); + */ + +#ifdef __ZILOG__ +# define irqsave() TDI() +# define irqrestore(f) RI(f) +#endif + /**************************************************************************** * Public Types ****************************************************************************/ @@ -135,9 +147,6 @@ extern "C" { #define EXTERN extern #endif -EXTERN irqstate_t irqsave(void) __naked; -EXTERN void irqrestore(irqstate_t flags) __naked; - #undef EXTERN #ifdef __cplusplus } diff --git a/arch/z80/include/z8/types.h b/arch/z80/include/z8/types.h new file mode 100644 index 0000000000..97cb72d98d --- /dev/null +++ b/arch/z80/include/z8/types.h @@ -0,0 +1,93 @@ +/**************************************************************************** + * arch/z80/include/z8/types.h + * include/arch/chip/types.h + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/* This file should never be included directed but, rather, only indirectly + * through sys/types.h + */ + +#ifndef __ARCH_CHIP_TYPES_H +#define __ARCH_CHIP_TYPES_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Definitions + ****************************************************************************/ + +/**************************************************************************** + * Type Declarations + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +/* These are the sizes of the types supported by the ZiLOG Z8Encore! compiler: + * + * int - 16-bits + * short - 16-bits + * long - 32-bits + * char - 8-bits + * float - 32-bits + * double - 32-bits + * + * Pointers: + * + * near pointer - 8-bits + * far pointer - 16-bits + * rom pointer - 16-bits + */ + +typedef char sbyte; +typedef unsigned char ubyte; +typedef unsigned char uint8; +typedef unsigned char boolean; +typedef int sint16; +typedef unsigned int uint16; +typedef long sint32; +typedef unsigned long uint32; + +/* This is the size of the interrupt state save returned by irqsave() */ + +typedef uint16 irqstate_t; + +#endif /* __ASSEMBLY__ */ + +/**************************************************************************** + * Global Function Prototypes + ****************************************************************************/ + +#endif /* __ARCH_CHIP_TYPES_H */ diff --git a/arch/z80/include/z80/irq.h b/arch/z80/include/z80/irq.h index 86bdfd273f..f71ed208e4 100644 --- a/arch/z80/include/z80/irq.h +++ b/arch/z80/include/z80/irq.h @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/z80/irq.h + * arch/z80/include/z80/irq.h * arch/chip/irq.h * * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. diff --git a/arch/z80/include/z80/types.h b/arch/z80/include/z80/types.h new file mode 100644 index 0000000000..97efa07611 --- /dev/null +++ b/arch/z80/include/z80/types.h @@ -0,0 +1,86 @@ +/**************************************************************************** + * arch/z80/include/z80/types.h + * include/arch/chip/types.h + * + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/* This file should never be included directed but, rather, only indirectly + * through sys/types.h + */ + +#ifndef __ARCH_CHIP_TYPES_H +#define __ARCH_CHIP_TYPES_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Definitions + ****************************************************************************/ + +/**************************************************************************** + * Type Declarations + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +/* These are the sizes of the standard SDCC types + * + * For SDCC, sizeof(int) is 16 and sizeof(long) is 32. long long and double + * are not supported. + * + * Generic pointers are 3 bytes in length with the first byte holding data + * space information. + */ + +typedef char sbyte; +typedef unsigned char ubyte; +typedef unsigned char uint8; +typedef unsigned char boolean; +typedef int sint16; +typedef unsigned int uint16; +typedef long sint32; +typedef unsigned long uint32; + +/* This is the size of the interrupt state save returned by irqsave() */ + +typedef uint16 irqstate_t; + +#endif /* __ASSEMBLY__ */ + +/**************************************************************************** + * Global Function Prototypes + ****************************************************************************/ + +#endif /* __ARCH_CHIP_TYPES_H */ diff --git a/arch/z80/src/Makefile.zdsii b/arch/z80/src/Makefile.zdsii index afe32ca90a..199293ef36 100644 --- a/arch/z80/src/Makefile.zdsii +++ b/arch/z80/src/Makefile.zdsii @@ -93,9 +93,11 @@ nuttx.linkcmd: $(LINKCMDTEMPLATE) echo " \"`cygpath -w $(TOPDIR)/$${lib}`\", \\" >>nuttx.linkcmd; \ done ; ) @echo " \"${shell cygpath -w $(ARCHSRCDIR)/board/libboard$(LIBEXT)}\", \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/chelpld$(LIBEXT)}\", \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/fpld$(LIBEXT)}\"" >>nuttx.linkcmd - +\ @echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/fpdumyLD$(LIBEXT)}\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/chelpD$(LIBEXT)}\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/csioLDD$(LIBEXT)}\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/zsldevinitdummy.lib$(LIBEXT)}\" \\" >>nuttx.linkcmd + nuttx$(EXEEXT): $(HEAD_AOBJ) board/libboard$(LIBEXT) nuttx.linkcmd @echo "LD: nuttx.hex" @$(LD) $(LDFLAGS) diff --git a/arch/z80/src/z8/chip.h b/arch/z80/src/z8/chip.h new file mode 100644 index 0000000000..90b6dfae28 --- /dev/null +++ b/arch/z80/src/z8/chip.h @@ -0,0 +1,66 @@ +/************************************************************************************ + * arch/z80/src/z80/chip.h + * arch/z80/src/chip/chip.h + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ************************************************************************************/ + +#ifndef __Z8_CHIP_H +#define __Z8_CHIP_H + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +/************************************************************************************ + * Definitions + ************************************************************************************/ + +/************************************************************************************ + * Public Function Prototypes + ************************************************************************************/ + +#ifndef __ASSEMBLY__ +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +#undef EXTERN +#ifdef __cplusplus +} +#endif +#endif + +#endif /* __Z8_CHIP_H */ diff --git a/configs/z8encore000zco/ostest/Make.defs b/configs/z8encore000zco/ostest/Make.defs index 3adff0b38b..030478e3df 100644 --- a/configs/z8encore000zco/ostest/Make.defs +++ b/configs/z8encore000zco/ostest/Make.defs @@ -41,16 +41,17 @@ ZDSINSTALLDIR := C:/Program\ Files/ZiLOG/ZDSII_Z8Encore!_4.10.1 ZDSBINDIR := $(ZDSINSTALLDIR)/bin ZDSSTDINCDIR := $(ZDSINSTALLDIR)/include/std ZDSZILOGINCDIR := $(ZDSINSTALLDIR)/include/zilog +ZDSF46XINCDIR := $(ZDSZILOGINCDIR)/Z8Encore_F642X ZDSSTDLIBDIR := $(ZDSINSTALLDIR)/lib/std ZDSZILOGLIBDIR := $(ZDSINSTALLDIR)/lib/zilog - # These are the same directories but with the directory separator # character swapped as needed by the ZDS-II compiler WTOPDIR := ${shell cygpath -w $(TOPDIR)} WZDSSTDINCDIR := ${shell cygpath -w $(ZDSSTDINCDIR)} WZDSZILOGINCDIR := ${shell cygpath -w $(ZDSZILOGINCDIR)} +WZDSF46XINCDIR := ${shell cygpath -w $(ZDSF46XINCDIR)} WZDSSTDLIBDIR := ${shell cygpath -w $(ZDSSTDLIBDIR)} WZDSZILOGLIBDIR := ${shell cygpath -w $(ZDSZILOGLIBDIR)} @@ -63,15 +64,15 @@ EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} # Assembler definitions ifeq ("${CONFIG_DEBUG}","y") - ARCHASMOPTIMIZATION = -debug + ARCHASMOPTIMIZATION = -debug -sdiopt else - ARCHASMOPTIMIZATION = -nodebug + ARCHASMOPTIMIZATION = -nodebug -sdiopt endif -ARCHASMCPUFLAGS = -cpu:Z16F2811AL -NOigcase -ARCHASMLIST = -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet +ARCHASMCPUFLAGS = -cpu:Z8F6423 -NOigcase -NOrevaa +ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet ARCHASMWARNINGS = -warn -ARCHASMDEFINES = -define:_Z16F2811AL=1 -define:_Z16K_SERIES=1 -define:_Z16F_SERIES=1 \ -define:__ASSEMBLY__ +ARCHASMDEFINES = -define:_Z8F6423=1 -define:_Z8ENCORE_64K_SERIES=1 -define:_Z8ENCORE_F642X=1 \ -define:__ASSEMBLY__ ARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) \ $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) @@ -84,20 +85,19 @@ else ARCHOPTIMIZATION = -nodebug -regvar endif -ARCHCPUFLAGS = -chartype:S -model:L -NOmodsect -cpu:Z16F2811AL -NOgenprint \ +ARCHCPUFLAGS = -chartype:S -model:L -const:RAM -NOoptlink -promote -cpu:Z8F6423 -NOgenprintf \ -asmsw:" $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" -ARCHLIST = -keeplst -NOlist -NOlistinc -NOkeepasm +ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm ARCHPICFLAGS = ARCHWARNINGS = -warn -ARCHDEFINES = -define:_Z16F2811AL -define:_Z16K_SERIES \ - -define:_Z16F_SERIES -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' +ARCHDEFINES = -define:_Z8ENCORE_F642X -define:_Z8F6423 -define:_Z8ENCORE_64K_SERIES +ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR);$(WZDSF46XINCDIR)' ARCHUSRINCLUDES = -usrinc:'.' ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) \ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -CPPDEFINES = -D_Z16F2811AL -D_Z16K_SERIES -D_Z16F_SERIES -D__ASSEMBLY__ +CPPDEFINES = -D_Z8ENCORE_F642X -D_Z8F6423 -D_Z8ENCORE_64K_SERIES -D__ASSEMBLY__ CPPINCLUDES = -I$(TOPDIR)/include CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) diff --git a/configs/z8encore000zco/ostest/ostest.linkcmd b/configs/z8encore000zco/ostest/ostest.linkcmd index 67204eadf6..2084663c79 100755 --- a/configs/z8encore000zco/ostest/ostest.linkcmd +++ b/configs/z8encore000zco/ostest/ostest.linkcmd @@ -35,7 +35,7 @@ -FORMAT=OMF695,INTEL32 -map -maxhexlen=64 -quiet -sort NAME=ascending -unresolved=fatal --warnoverlap -NOxref -warn -debug -NOigcase +-NOwarnoverlap -NOxref -warn -debug -NOigcase -quiet RANGE ROM $000000 : $007FFF RANGE RAM $FFB000 : $FFBFFF @@ -43,50 +43,45 @@ RANGE IODATA $FFC000 : $FFFFFF RANGE EROM $008000 : $01FFFF RANGE ERAM $800000 : $87FFFF -CHANGE NEAR_TEXT=NEAR_DATA -CHANGE FAR_TEXT=FAR_DATA +RANGE ROM $0 : $FFFF +RANGE RDATA $20 : $FF +RANGE EDATA $100 : $EFF +RANGE PRAM FORBIDDEN -ORDER FAR_BSS, FAR_DATA -ORDER NEAR_BSS, NEAR_DATA -COPY NEAR_DATA EROM -COPY FAR_DATA EROM +CHANGE TEXT=EDATA +CHANGE TEXT=FAR_DATA +change NEAR_TXT=NEAR_DATA +change FAR_TXT=FAR_DATA +ORDER FAR_BSS, FAR_DATA +ORDER NEAR_BSS,NEAR_DATA +COPY NEAR_DATA ROM +COPY FAR_DATA ROM -define _0_exit = 0 -define _low_near_romdata = copy base of NEAR_DATA -define _low_neardata = base of NEAR_DATA -define _len_neardata = length of NEAR_DATA -define _low_far_romdata = copy base of FAR_DATA -define _low_fardata = base of FAR_DATA -define _len_fardata = length of FAR_DATA -define _low_nearbss = base of NEAR_BSS -define _len_nearbss = length of NEAR_BSS -define _low_farbss = base of FAR_BSS -define _len_farbss = length of FAR_BSS -define _near_heaptop = highaddr of RAM -define _far_heaptop = highaddr of ERAM -define _far_stack = highaddr of ERAM -define _near_stack = highaddr of RAM -define _near_heapbot = top of RAM -define _far_heapbot = top of ERAM +define _low_near_romdata = copy base of NEAR_DATA +define _low_neardata = base of NEAR_DATA +define _len_neardata = length of NEAR_DATA +define _low_far_romdata = copy base of FAR_DATA +define _low_fardata = base of FAR_DATA +define _len_fardata = length of FAR_DATA +define _low_nearbss = base of NEAR_BSS +define _len_nearbss = length of NEAR_BSS +define _low_farbss = base of FAR_BSS +define _len_farbss = length of FAR_BSS +define _far_heaptop = highaddr of EDATA +define _far_stack = highaddr of EDATA +define _near_stack = highaddr of RDATA +define _far_heapbot = top of EDATA +define _near_heaptop = highaddr of RDATA +define _near_heapbot = top of RDATA +define _low_pramseg = base of PRAMSEG +define _len_pramseg = length of PRAMSEG +define _low_pram_romdata = copy base of PRAMSEG +define _READ_NVDS=$1000 +define _WRITE_NVDS=$10B3 +define _READ_NVDS_GET_STATUS=$1000 +define _WRITE_NVDS_GET_STATUS=$10B3 +/* Set frequency to 18432000 Hz */ +define __user_frequency = 18432000 -define _SYS_CLK_SRC = 2 -define _SYS_CLK_FREQ = 20000000 - -define __EXTCT_INIT_PARAM = $80 -define __EXTCS0_INIT_PARAM = $8012 -define __EXTCS1_INIT_PARAM = $8001 -define __EXTCS2_INIT_PARAM = $0000 -define __EXTCS3_INIT_PARAM = $0000 -define __EXTCS4_INIT_PARAM = $0000 -define __EXTCS5_INIT_PARAM = $0000 - -define __PFAF_INIT_PARAM = $ff -define __PGAF_INIT_PARAM = $ff -define __PDAF_INIT_PARAM = $ff00 -define __PAAF_INIT_PARAM = $0000 -define __PCAF_INIT_PARAM = $0000 -define __PHAF_INIT_PARAM = $0300 -define __PKAF_INIT_PARAM = $0f - -/* arch/z16/src/Makefile will append target, object and library paths below */ +/* arch/z80/src/Makefile.zdsii will append target, object and library paths below */ diff --git a/configs/z8encore000zco/ostest/ostest.zfpproj b/configs/z8encore000zco/ostest/ostest.zfpproj index ade3d73d42..0c65b6ec72 100644 --- a/configs/z8encore000zco/ostest/ostest.zfpproj +++ b/configs/z8encore000zco/ostest/ostest.zfpproj @@ -1,5 +1,5 @@ - -Z16F2811AL + +Z8F6423 @@ -12,7 +12,7 @@ - + @@ -20,31 +20,37 @@ + + - - + + + - + - - + + + + + + - - - - + + + @@ -52,8 +58,6 @@ - - @@ -65,8 +69,9 @@ + + - @@ -81,46 +86,55 @@ - - - - + + + - + + + - + - + - + + + + + + + + + - + @@ -128,24 +142,28 @@ + + - - + + + - + + + + + - - - @@ -153,6 +171,8 @@ + + @@ -160,8 +180,6 @@ - - @@ -173,8 +191,9 @@ + + - @@ -189,39 +208,48 @@ - - - - + + + - + + + - + - + - + + + + + + + + + @@ -235,4 +263,28 @@ + + + +000000000000 +000000000000 +0 + + +000000000000 +000000000000 +0 + + +000000000000 +000000000000 +0 + + +000000000000 +000000000000 +0 + + + \ No newline at end of file diff --git a/configs/z8encore000zco/src/Makefile b/configs/z8encore000zco/src/Makefile index 8291ab20f2..c20d8d6da4 100644 --- a/configs/z8encore000zco/src/Makefile +++ b/configs/z8encore000zco/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# configs/z16f2800100zcog/Makefile +# configs/z8encore000zco/Makefile # # Copyright (C) 2008 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -43,7 +43,7 @@ CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCH ASRCS = AOBJS = $(ASRCS:.S=$(OBJEXT)) -CSRCS = z16f_lowinit.c z16f_leds.c +CSRCS = z8_lowinit.c z8_leds.c COBJS = $(CSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index 4115559a12..7183288cbf 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -226,7 +226,7 @@ /* At present, only the Zilog ZNeo compiler is recognized */ -# ifndef __ZNEO__ +# if !defined(__ZNEO__) && !defined(__EZ8__) # warning "Unrecognized Zilog compiler" # endif @@ -258,24 +258,33 @@ # define reentrant_function -/* Addressing */ +/* Addressing. + * + * Z16F ZNEO: Far is 24-bits; near is 16-bits of address. + * The supported model is (1) all code on ROM, and (2) all data + * and stacks in external (far) RAM. + * Z8Encore!: Far is 16-bits; near is 8-bits of address. + * The supported model is (1) all code on ROM, and (2) all data + * and stacks in internal (far) RAM. + */ -# define FAR _Far -# define NEAR _Near -# define DSEG _Far -# define CODE _Erom - -/* Select the large, 32-bit addressing model */ - -# undef CONFIG_SMALL_MEMORY - -/* Long and int are the same size */ - -# undef CONFIG_LONG_IS_NOT_INT - -/* FAR pointers and int are the same size */ - -# undef CONFIG_PTR_IS_NOT_INT +# ifdef __ZNEO__ +# define FAR _Far +# define NEAR _Near +# define DSEG _Far +# define CODE _Erom +# undef CONFIG_SMALL_MEMORY /* Select the large, 32-bit addressing model */ +# undef CONFIG_LONG_IS_NOT_INT /* Long and int are the same size */ +# undef CONFIG_PTR_IS_NOT_INT /* FAR pointers and int are the same size */ +# else +# define FAR far +# define NEAR near +# define DSEG far +# define CODE rom +# define CONFIG_SMALL_MEMORY 1 /* Select small, 16-bit address model */ +# define CONFIG_LONG_IS_NOT_INT 1 /* Long and int are not the same size */ +# undef CONFIG_PTR_IS_NOT_INT /* FAR pointers and int are the same size */ +# endif /* The Zilog compiler does not support inline functions */ diff --git a/sched/clock_abstime2ticks.c b/sched/clock_abstime2ticks.c index 7cd3eb4951..b93fb8eac8 100644 --- a/sched/clock_abstime2ticks.c +++ b/sched/clock_abstime2ticks.c @@ -1,7 +1,7 @@ /******************************************************************************** * clock_abstime2ticks.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -88,8 +88,8 @@ * ********************************************************************************/ -extern int clock_abstime2ticks(clockid_t clockid, const struct timespec *abstime, - int *ticks) +int clock_abstime2ticks(clockid_t clockid, FAR const struct timespec *abstime, + FAR int *ticks) { struct timespec currtime; struct timespec reltime; diff --git a/sched/clock_internal.h b/sched/clock_internal.h index 3c394520cb..2c298983b0 100644 --- a/sched/clock_internal.h +++ b/sched/clock_internal.h @@ -1,7 +1,7 @@ /******************************************************************************** * clock_internal.h * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -79,9 +79,10 @@ extern void weak_function clock_initialize(void); extern void weak_function clock_timer(void); extern time_t clock_calendar2utc(int year, int month, int day); -extern int clock_abstime2ticks(clockid_t clockid, const struct timespec *abstime, - int *ticks); -extern int clock_time2ticks(const struct timespec *reltime, int *ticks); -extern int clock_ticks2time(int ticks, struct timespec *reltime); +extern int clock_abstime2ticks(clockid_t clockid, + FAR const struct timespec *abstime, + FAR int *ticks); +extern int clock_time2ticks(FAR const struct timespec *reltime, FAR int *ticks); +extern int clock_ticks2time(int ticks, FAR struct timespec *reltime); #endif /* __CLOCK_INTERNAL_H */ diff --git a/sched/clock_ticks2time.c b/sched/clock_ticks2time.c index a7ef5dc9b5..f0218df475 100644 --- a/sched/clock_ticks2time.c +++ b/sched/clock_ticks2time.c @@ -1,7 +1,7 @@ /******************************************************************************** * clock_ticks2time.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -83,7 +83,7 @@ * ********************************************************************************/ -int clock_ticks2time(int ticks, struct timespec *reltime) +int clock_ticks2time(int ticks, FAR struct timespec *reltime) { int remainder; diff --git a/sched/clock_time2ticks.c b/sched/clock_time2ticks.c index 91c5e976c9..5414dfe752 100644 --- a/sched/clock_time2ticks.c +++ b/sched/clock_time2ticks.c @@ -85,7 +85,7 @@ * ********************************************************************************/ -int clock_time2ticks(const struct timespec *reltime, int *ticks) +int clock_time2ticks(FAR const struct timespec *reltime, FAR int *ticks) { sint32 relusec; diff --git a/sched/mq_timedreceive.c b/sched/mq_timedreceive.c index ca4b4aa854..a6cf003389 100644 --- a/sched/mq_timedreceive.c +++ b/sched/mq_timedreceive.c @@ -242,7 +242,7 @@ ssize_t mq_timedreceive(mqd_t mqdes, void *msg, size_t msglen, if (mqdes->msgq->msglist.head == NULL) { - sint32 ticks; + int ticks; /* Convert the timespec to clock ticks. We must have interrupts * disabled here so that this time stays valid until the wait begins. diff --git a/sched/mq_timedsend.c b/sched/mq_timedsend.c index 012bd2ab01..4cd508d3b6 100644 --- a/sched/mq_timedsend.c +++ b/sched/mq_timedsend.c @@ -239,7 +239,7 @@ int mq_timedsend(mqd_t mqdes, const char *msg, size_t msglen, int prio, } else { - sint32 ticks; + int ticks; /* We are not in an interupt handler and the message queue is full. * set up a timed wait for the message queue to become non-full. diff --git a/sched/pthread_condtimedwait.c b/sched/pthread_condtimedwait.c index 78110c624a..0a1bc7ca9b 100644 --- a/sched/pthread_condtimedwait.c +++ b/sched/pthread_condtimedwait.c @@ -132,7 +132,7 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, FAR const struct timespec *abstime) { WDOG_ID wdog; - sint32 ticks; + int ticks; int mypid = (int)getpid(); irqstate_t int_state; int ret = OK;