diff options
35 files changed, 282 insertions, 165 deletions
diff --git a/nuttx/arch/z80/src/Makefile.sdcc b/nuttx/arch/z80/src/Makefile.sdcc index d5ff3b793..522c8d6f9 100644 --- a/nuttx/arch/z80/src/Makefile.sdcc +++ b/nuttx/arch/z80/src/Makefile.sdcc @@ -94,7 +94,7 @@ $(AOBJS) $(HEAD_OBJ): %$(OBJEXT): %$(ASMEXT) $(COBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) -# This is a kludge to work around some conflicting symbols in libsdcc.liXqueb +# This is a kludge to work around some conflicting symbols in libsdcc.lib $(SDCCLIBDIR)/myz80.lib: $(SDCCLIBDIR)/$(SDCCLIB) @cat $(SDCCLIBDIR)/$(SDCCLIB) | \ diff --git a/nuttx/arch/z80/src/z80/z80_io.c b/nuttx/arch/z80/src/z80/z80_io.c index cddaa6831..bdd55bc6b 100644 --- a/nuttx/arch/z80/src/z80/z80_io.c +++ b/nuttx/arch/z80/src/z80/z80_io.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/z80/z80_io.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -44,9 +44,23 @@ #include "up_internal.h" /**************************************************************************** - * Private Definitions + * Pre-processor Definitions ****************************************************************************/ +#undef ASM +#undef ENDASM +#undef NAKED + +#ifdef CONFIG_SDCC_OLD +# define ASM _asm +# define ENDASM _endasm +# define NAKED +#else +# define ASM __asm +# define ENDASM __endasm +# define NAKED __naked +#endif + /**************************************************************************** * Private Data ****************************************************************************/ @@ -69,11 +83,11 @@ void outp(char p, char c) { - _asm + ASM ld c, 4(ix) ; port ld a, 5(ix) ; value out (c), a - _endasm; + ENDASM; } @@ -85,10 +99,10 @@ void outp(char p, char c) * ****************************************************************************/ -char inp(char p) +char inp(char p) NAKED { - _asm + ASM ld c, 4(ix) ;port in l, (c) - _endasm; + ENDASM; } diff --git a/nuttx/arch/z80/src/z80/z80_irq.c b/nuttx/arch/z80/src/z80/z80_irq.c index 08b426235..87ea7063a 100644 --- a/nuttx/arch/z80/src/z80/z80_irq.c +++ b/nuttx/arch/z80/src/z80/z80_irq.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/z80/z80_irq.c * - * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,14 @@ * Private Definitions ****************************************************************************/ +#ifdef CONFIG_SDCC_OLD +# define ASM _asm +# define ENDASM _endasm +#else +# define ASM __asm +# define ENDASM __endasm +#endif + /**************************************************************************** * Public Data ****************************************************************************/ @@ -80,13 +88,13 @@ volatile chipreg_t *current_regs; irqstate_t irqsave(void) __naked { - _asm + ASM ld a, i ; AF Parity bit holds interrupt state di ; Interrupts are disabled push af ; Return AF in HL pop hl ; ret ; - _endasm; + ENDASM; } /**************************************************************************** @@ -99,7 +107,7 @@ irqstate_t irqsave(void) __naked void irqrestore(irqstate_t flags) __naked { - _asm + ASM di ; Assume disabled pop hl ; HL = return address pop af ; AF Parity bit holds interrupt state @@ -109,5 +117,5 @@ statedisable: push af ; Restore stack push hl ; ret ; and return - _endasm; + ENDASM; } diff --git a/nuttx/configs/xtrs/README.txt b/nuttx/configs/xtrs/README.txt index a4067b3e4..ecd44e4e2 100644 --- a/nuttx/configs/xtrs/README.txt +++ b/nuttx/configs/xtrs/README.txt @@ -50,11 +50,10 @@ Configuring NuttX This configuration performs a simple, minimal OS test using examples/ostest. This can be configurated as follows: - cd tools - ./configure.sh xtrs/ostest - cd - - . ./setenv.sh - + cd tools + ./configure.sh xtrs/ostest + cd - + . ./setenv.sh nsh This configuration file builds NSH (examples/nsh). This @@ -63,10 +62,10 @@ Configuring NuttX This configuration can be selected by: - cd tools - ./configure.sh xtrs/nsh - cd - - . ./setenv.sh + cd tools + ./configure.sh xtrs/nsh + cd - + . ./setenv.sh pashello Configures to use examples/pashello for execution from FLASH @@ -77,10 +76,10 @@ Configuring NuttX This configuration can be selected by: - cd tools - ./configure.sh xtrs/pashello - cd - - . ./setenv.sh + cd tools + ./configure.sh xtrs/pashello + cd - + . ./setenv.sh Building the SDCC toolchain ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -122,11 +121,11 @@ has some compatibilty problems with the older SDCC compiler. For one, you will need to change the Z80 assember name and options in the Make.defs files as follows: --AS = as-z80 -+AS = sdasz80 +-AS = as-z80 ++AS = sdasz80 -- @$(AS) $(ASFLAGS) $2 $1 -+ $(AS) $(ASFLAGS) $1 +- @$(AS) $(ASFLAGS) $2 $1 ++ $(AS) $(ASFLAGS) $1 For another, I had other problems building with that 20091106 that look like compiler bugs. If you are using UBUNTU 9.10, you may have to either @@ -134,6 +133,9 @@ like compiler bugs. If you are using UBUNTU 9.10, you may have to either the older stable releases, or (2) wait for the next stable SDCC release after 2.9.0. +See below: If you wish to continue using the older SDCC toolchain, you +must now also add CONFIG_SDCC_OLD=y to your configuration file. + Newer SDCC Versions ^^^^^^^^^^^^^^^^^^^ @@ -154,4 +156,14 @@ This is the text of bug 3468951 reported on the SourceForge website: sdcc-2.6.0-asz80-symlen.patch is unnecessary, and it and the corresponding section from the README can be removed. -These changes have not yet been incorporated or verified.
\ No newline at end of file +These changes *have* been incorporated but only partially verified. In order +to get a successful compilation, I had to copy stdarg.h out of the SDCC source +(at sdcc/device/include/stdarg.h) to include/nuttx/stdarg.h. + +There are also some library related issues when you get to the final build +that I have not looked into yet. + +If you want to back out these change and continue to use the older toolchain +in your build, simpy define the following in your configuration file: + + CONFIG_SDCC_OLD=y diff --git a/nuttx/configs/xtrs/include/board.h b/nuttx/configs/xtrs/include/board.h index f8f74b219..02ab012f8 100644 --- a/nuttx/configs/xtrs/include/board.h +++ b/nuttx/configs/xtrs/include/board.h @@ -1,5 +1,5 @@ /************************************************************ - * board/board.h + * configs/xtrs/include/board.h * * Copyright (C) 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/xtrs/include/trs80-m3.h b/nuttx/configs/xtrs/include/trs80-m3.h index 4a2a45332..1a23b2d7b 100644 --- a/nuttx/configs/xtrs/include/trs80-m3.h +++ b/nuttx/configs/xtrs/include/trs80-m3.h @@ -1,5 +1,5 @@ /**************************************************************************** - * board/trs80-m3.h + * configs/xtrs/include/trs80-m3.h * * Copyright (C) 2008 Jacques Pelletier. All rights reserved. * Author: Jacques Pelletier diff --git a/nuttx/configs/xtrs/nsh/Make.defs b/nuttx/configs/xtrs/nsh/Make.defs index e1d147dc4..947deb5af 100644 --- a/nuttx/configs/xtrs/nsh/Make.defs +++ b/nuttx/configs/xtrs/nsh/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# configs/xtrs/Make.defs +# configs/xtrs/nsh/Make.defs # # Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> @@ -36,27 +36,38 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") +CROSSDEV = +CC = sdcc +CPP = sdcpp +AR = sdcclib -a + +ifeq ($(CONFIG_SDCC_OLD),y) + +LD = link-z80 +AS = as-z80 +ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent + +else + +LD = sdldz80 +AS = sdasz80 +ARCHCPUFLAGS = -mz80 + +endif + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION = --debug else ARCHOPTIMIZATION = endif -ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent -ARCHPICFLAGS = -ARCHWARNINGS = +ARCHPICFLAGS = +ARCHWARNINGS = ARCHDEFINES = -ARCHINCLUDES = -I. -I$(TOPDIR)/include - -CROSSDEV = -CC = sdcc -CPP = sdcpp -LD = link-z80 -AS = as-z80 -AR = sdcclib -a +ARCHINCLUDES = -I. -I$(TOPDIR)/include CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) ASFLAGS = -x -a -l -o -s diff --git a/nuttx/configs/xtrs/nsh/defconfig b/nuttx/configs/xtrs/nsh/defconfig index 76f4e7fa9..b8bd5d6f2 100644 --- a/nuttx/configs/xtrs/nsh/defconfig +++ b/nuttx/configs/xtrs/nsh/defconfig @@ -1,5 +1,5 @@ ############################################################################ -# sim/xtrs/nsh/defconfig +# configs/xtrs/nsh/defconfig # # Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/xtrs/nsh/setenv.sh b/nuttx/configs/xtrs/nsh/setenv.sh index c59e0abc1..99d45f97a 100755 --- a/nuttx/configs/xtrs/nsh/setenv.sh +++ b/nuttx/configs/xtrs/nsh/setenv.sh @@ -1,5 +1,5 @@ #!/bin/bash -# xtrs/setenv.sh +# configs/xtrs/nsh/setenv.sh # # Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/xtrs/ostest/Make.defs b/nuttx/configs/xtrs/ostest/Make.defs index 773b97d9d..06cc05db0 100644 --- a/nuttx/configs/xtrs/ostest/Make.defs +++ b/nuttx/configs/xtrs/ostest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# configs/xtrs/Make.defs +# configs/xtrs/ostest/Make.defs # # Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> @@ -36,27 +36,38 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") +CROSSDEV = +CC = sdcc +CPP = sdcpp +AR = sdcclib -a + +ifeq ($(CONFIG_SDCC_OLD),y) + +LD = link-z80 +AS = as-z80 +ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent + +else + +LD = sdldz80 +AS = sdasz80 +ARCHCPUFLAGS = -mz80 + +endif + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION = --debug else ARCHOPTIMIZATION = endif -ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent -ARCHPICFLAGS = -ARCHWARNINGS = +ARCHPICFLAGS = +ARCHWARNINGS = ARCHDEFINES = -ARCHINCLUDES = -I. -I$(TOPDIR)/include - -CROSSDEV = -CC = sdcc -CPP = sdcpp -LD = link-z80 -AS = as-z80 -AR = sdcclib -a +ARCHINCLUDES = -I. -I$(TOPDIR)/include CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) ASFLAGS = -x -a -l -o -s diff --git a/nuttx/configs/xtrs/ostest/setenv.sh b/nuttx/configs/xtrs/ostest/setenv.sh index cf7b5d796..73454b772 100755 --- a/nuttx/configs/xtrs/ostest/setenv.sh +++ b/nuttx/configs/xtrs/ostest/setenv.sh @@ -1,5 +1,5 @@ #!/bin/bash -# xtrs/setenv.sh +# configs/xtrs/ostest/setenv.sh # # Copyright (C) 2008 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/xtrs/pashello/Make.defs b/nuttx/configs/xtrs/pashello/Make.defs index 773b97d9d..2c2fb47ce 100644 --- a/nuttx/configs/xtrs/pashello/Make.defs +++ b/nuttx/configs/xtrs/pashello/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# configs/xtrs/Make.defs +# configs/xtrs/pashello/Make.defs # # Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> @@ -36,27 +36,38 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") +CROSSDEV = +CC = sdcc +CPP = sdcpp +AR = sdcclib -a + +ifeq ($(CONFIG_SDCC_OLD),y) + +LD = link-z80 +AS = as-z80 +ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent + +else + +LD = sdldz80 +AS = sdasz80 +ARCHCPUFLAGS = -mz80 + +endif + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION = --debug else ARCHOPTIMIZATION = endif -ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent -ARCHPICFLAGS = -ARCHWARNINGS = +ARCHPICFLAGS = +ARCHWARNINGS = ARCHDEFINES = -ARCHINCLUDES = -I. -I$(TOPDIR)/include - -CROSSDEV = -CC = sdcc -CPP = sdcpp -LD = link-z80 -AS = as-z80 -AR = sdcclib -a +ARCHINCLUDES = -I. -I$(TOPDIR)/include CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) ASFLAGS = -x -a -l -o -s diff --git a/nuttx/configs/xtrs/pashello/setenv.sh b/nuttx/configs/xtrs/pashello/setenv.sh index cf7b5d796..4e2e98e31 100755 --- a/nuttx/configs/xtrs/pashello/setenv.sh +++ b/nuttx/configs/xtrs/pashello/setenv.sh @@ -1,5 +1,5 @@ #!/bin/bash -# xtrs/setenv.sh +# configs/xtrs/pashello/setenv.sh # # Copyright (C) 2008 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/xtrs/src/xtr_irq.c b/nuttx/configs/xtrs/src/xtr_irq.c index 4e17c37bc..72f6c10e2 100644 --- a/nuttx/configs/xtrs/src/xtr_irq.c +++ b/nuttx/configs/xtrs/src/xtr_irq.c @@ -1,5 +1,5 @@ /**************************************************************************** - * board/xtr_irq.c + * configs/xtrs/src/xtr_irq.c * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/xtrs/src/xtr_lowputc.c b/nuttx/configs/xtrs/src/xtr_lowputc.c index 344f22061..8ed166211 100644 --- a/nuttx/configs/xtrs/src/xtr_lowputc.c +++ b/nuttx/configs/xtrs/src/xtr_lowputc.c @@ -1,5 +1,5 @@ /******************************************************************************** - * board/xtr_lowputc.c + * configs/xtrs/src//xtr_lowputc.c * * Copyright (C) 2008 Jacques Pelletier. All rights reserved. * Author: Jacques Pelletier diff --git a/nuttx/configs/xtrs/src/xtr_serial.c b/nuttx/configs/xtrs/src/xtr_serial.c index df76b1e3f..42cffb740 100644 --- a/nuttx/configs/xtrs/src/xtr_serial.c +++ b/nuttx/configs/xtrs/src/xtr_serial.c @@ -1,5 +1,5 @@ /**************************************************************************** - * board/xtr_serial.c + * config/xtrs/src/xtr_serial.c * * Copyright (C) 2008 Jacques Pelletier. All rights reserved. * Author: Jacques Pelletier diff --git a/nuttx/configs/xtrs/src/xtr_timerisr.c b/nuttx/configs/xtrs/src/xtr_timerisr.c index 21a77706f..295bc65d7 100644 --- a/nuttx/configs/xtrs/src/xtr_timerisr.c +++ b/nuttx/configs/xtrs/src/xtr_timerisr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * board/xtr_timerisr.c + * configs/xtrs/src/xtr_timerisr.c * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/z80sim/README.txt b/nuttx/configs/z80sim/README.txt index 2a610899c..3edc6ad71 100644 --- a/nuttx/configs/z80sim/README.txt +++ b/nuttx/configs/z80sim/README.txt @@ -23,11 +23,10 @@ Configuring NuttX This configuration performs a simple, minimal OS test using examples/ostest. This can be configurated as follows: - cd tools - ./configure.sh z80sim/ostest - cd - - . ./setenv.sh - + cd tools + ./configure.sh z80sim/ostest + cd - + . ./setenv.sh nsh This configuration file builds NSH (examples/nsh). This @@ -36,10 +35,10 @@ Configuring NuttX This configuration can be selected by: - cd tools - ./configure.sh z80sim/nsh - cd - - . ./setenv.sh + cd tools + ./configure.sh z80sim/nsh + cd - + . ./setenv.sh pashello Configures to use examples/pashello for execution from FLASH @@ -50,10 +49,10 @@ Configuring NuttX This configuration can be selected by: - cd tools - ./configure.sh z80sim/pashello - cd - - . ./setenv.sh + cd tools + ./configure.sh z80sim/pashello + cd - + . ./setenv.sh Building the SDCC toolchain ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -95,11 +94,11 @@ has some compatibilty problems with the older SDCC compiler. For one, you will need to change the Z80 assember name and options in the Make.defs files as follows: --AS = as-z80 -+AS = sdasz80 +-AS = as-z80 ++AS = sdasz80 -- @$(AS) $(ASFLAGS) $2 $1 -+ $(AS) $(ASFLAGS) $1 +- @$(AS) $(ASFLAGS) $2 $1 ++ $(AS) $(ASFLAGS) $1 For another, I had other problems building with that 20091106 that look like compiler bugs. If you are using UBUNTU 9.10, you may have to either @@ -107,6 +106,9 @@ like compiler bugs. If you are using UBUNTU 9.10, you may have to either the older stable releases, or (2) wait for the next stable SDCC release after 2.9.0. +See below: If you wish to continue using the older SDCC toolchain, you +must now also add CONFIG_SDCC_OLD=y to your configuration file. + Newer SDCC Versions ^^^^^^^^^^^^^^^^^^^ @@ -127,4 +129,14 @@ This is the text of bug 3468951 reported on the SourceForge website: sdcc-2.6.0-asz80-symlen.patch is unnecessary, and it and the corresponding section from the README can be removed. -These changes have not yet been incorporated or verified.
\ No newline at end of file +These changes *have* been incorporated but only partially verified. In order +to get a successful compilation, I had to copy stdarg.h out of the SDCC source +(at sdcc/device/include/stdarg.h) to include/nuttx/stdarg.h. + +There are also some library related issues when you get to the final build +that I have not looked into yet. + +If you want to back out these change and continue to use the older toolchain +in your build, simpy define the following in your configuration file: + + CONFIG_SDCC_OLD=y diff --git a/nuttx/configs/z80sim/include/board.h b/nuttx/configs/z80sim/include/board.h index 5bf8eb82d..f581242cb 100644 --- a/nuttx/configs/z80sim/include/board.h +++ b/nuttx/configs/z80sim/include/board.h @@ -1,5 +1,5 @@ /************************************************************ - * board/board.h + * configs/z80sim/include/board.h * * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/z80sim/nsh/Make.defs b/nuttx/configs/z80sim/nsh/Make.defs index d20096ea1..7bdc9663d 100644 --- a/nuttx/configs/z80sim/nsh/Make.defs +++ b/nuttx/configs/z80sim/nsh/Make.defs @@ -36,27 +36,38 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") +CROSSDEV = +CC = sdcc +CPP = sdcpp +AR = sdcclib -a + +ifeq ($(CONFIG_SDCC_OLD),y) + +LD = link-z80 +AS = as-z80 +ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent + +else + +LD = sdldz80 +AS = sdasz80 +ARCHCPUFLAGS = -mz80 + +endif + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION = --debug else ARCHOPTIMIZATION = endif -ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent -ARCHPICFLAGS = -ARCHWARNINGS = +ARCHPICFLAGS = +ARCHWARNINGS = ARCHDEFINES = -ARCHINCLUDES = -I. -I$(TOPDIR)/include - -CROSSDEV = -CC = sdcc -CPP = sdcpp -LD = link-z80 -AS = as-z80 -AR = sdcclib -a +ARCHINCLUDES = -I. -I$(TOPDIR)/include CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) ASFLAGS = -x -a -l -o -s diff --git a/nuttx/configs/z80sim/nsh/defconfig b/nuttx/configs/z80sim/nsh/defconfig index 9d4d81a74..87195b6e8 100644 --- a/nuttx/configs/z80sim/nsh/defconfig +++ b/nuttx/configs/z80sim/nsh/defconfig @@ -1,5 +1,5 @@ ############################################################################ -# sim/z80sim/nsh/defconfig +# configs/z80sim/nsh/defconfig # # Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/z80sim/nsh/setenv.sh b/nuttx/configs/z80sim/nsh/setenv.sh index fa65934f1..48373b0f2 100755 --- a/nuttx/configs/z80sim/nsh/setenv.sh +++ b/nuttx/configs/z80sim/nsh/setenv.sh @@ -1,5 +1,5 @@ #!/bin/bash -# z80sim/setenv.sh +# configs/z80sim/nsh/setenv.sh # # Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/z80sim/ostest/Make.defs b/nuttx/configs/z80sim/ostest/Make.defs index 0eb90879b..f19ae8dd5 100644 --- a/nuttx/configs/z80sim/ostest/Make.defs +++ b/nuttx/configs/z80sim/ostest/Make.defs @@ -36,27 +36,38 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") +CROSSDEV = +CC = sdcc +CPP = sdcpp +AR = sdcclib -a + +ifeq ($(CONFIG_SDCC_OLD),y) + +LD = link-z80 +AS = as-z80 +ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent + +else + +LD = sdldz80 +AS = sdasz80 +ARCHCPUFLAGS = -mz80 + +endif + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION = --debug else ARCHOPTIMIZATION = endif -ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent -ARCHPICFLAGS = -ARCHWARNINGS = +ARCHPICFLAGS = +ARCHWARNINGS = ARCHDEFINES = -ARCHINCLUDES = -I. -I$(TOPDIR)/include - -CROSSDEV = -CC = sdcc -CPP = sdcpp -LD = link-z80 -AS = as-z80 -AR = sdcclib -a +ARCHINCLUDES = -I. -I$(TOPDIR)/include CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) ASFLAGS = -x -a -l -o -s diff --git a/nuttx/configs/z80sim/ostest/setenv.sh b/nuttx/configs/z80sim/ostest/setenv.sh index fa65934f1..239e35286 100755 --- a/nuttx/configs/z80sim/ostest/setenv.sh +++ b/nuttx/configs/z80sim/ostest/setenv.sh @@ -1,5 +1,5 @@ #!/bin/bash -# z80sim/setenv.sh +# configs/z80sim/ostest/setenv.sh # # Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/z80sim/pashello/Make.defs b/nuttx/configs/z80sim/pashello/Make.defs index b1f2b62cb..0617b8d8a 100644 --- a/nuttx/configs/z80sim/pashello/Make.defs +++ b/nuttx/configs/z80sim/pashello/Make.defs @@ -36,27 +36,38 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") +CROSSDEV = +CC = sdcc +CPP = sdcpp +AR = sdcclib -a + +ifeq ($(CONFIG_SDCC_OLD),y) + +LD = link-z80 +AS = as-z80 +ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent + +else + +LD = sdldz80 +AS = sdasz80 +ARCHCPUFLAGS = -mz80 + +endif + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION = --debug else ARCHOPTIMIZATION = endif -ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent -ARCHPICFLAGS = -ARCHWARNINGS = +ARCHPICFLAGS = +ARCHWARNINGS = ARCHDEFINES = -ARCHINCLUDES = -I. -I$(TOPDIR)/include - -CROSSDEV = -CC = sdcc -CPP = sdcpp -LD = link-z80 -AS = as-z80 -AR = sdcclib -a +ARCHINCLUDES = -I. -I$(TOPDIR)/include CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) ASFLAGS = -x -a -l -o -s diff --git a/nuttx/configs/z80sim/pashello/setenv.sh b/nuttx/configs/z80sim/pashello/setenv.sh index fa65934f1..b9de2b9e0 100755 --- a/nuttx/configs/z80sim/pashello/setenv.sh +++ b/nuttx/configs/z80sim/pashello/setenv.sh @@ -1,5 +1,5 @@ #!/bin/bash -# z80sim/setenv.sh +# configs/z80sim/pashello/setenv.sh # # Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/z80sim/src/z80_irq.c b/nuttx/configs/z80sim/src/z80_irq.c index 0fc5d95de..eb1901d27 100644 --- a/nuttx/configs/z80sim/src/z80_irq.c +++ b/nuttx/configs/z80sim/src/z80_irq.c @@ -1,5 +1,5 @@ /**************************************************************************** - * board/z80_irq.c + * configs/z80sim/src/z80_irq.c * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/z80sim/src/z80_lowputc.c b/nuttx/configs/z80sim/src/z80_lowputc.c index 0909929d7..e23caeb0f 100644 --- a/nuttx/configs/z80sim/src/z80_lowputc.c +++ b/nuttx/configs/z80sim/src/z80_lowputc.c @@ -1,5 +1,5 @@ /******************************************************************************** - * board/z80_lowputc.c + * configs/z80sim/src//z80_lowputc.c * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/z80sim/src/z80_serial.c b/nuttx/configs/z80sim/src/z80_serial.c index d699b4598..1e5d98b29 100644 --- a/nuttx/configs/z80sim/src/z80_serial.c +++ b/nuttx/configs/z80sim/src/z80_serial.c @@ -1,5 +1,5 @@ /**************************************************************************** - * board/z80_serial.c + * configs/z80sim/src/z80_serial.c * * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/configs/z80sim/src/z80_timerisr.c b/nuttx/configs/z80sim/src/z80_timerisr.c index 1bcfda049..e6357e8e0 100644 --- a/nuttx/configs/z80sim/src/z80_timerisr.c +++ b/nuttx/configs/z80sim/src/z80_timerisr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * board/z80_timerisr.c + * configs/z80sim/src/z80_timerisr.c * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/lib/stdio/lib_lowinstream.c b/nuttx/lib/stdio/lib_lowinstream.c index c97a4721f..499a647ea 100644 --- a/nuttx/lib/stdio/lib_lowinstream.c +++ b/nuttx/lib/stdio/lib_lowinstream.c @@ -39,8 +39,6 @@ #include <nuttx/config.h> -#ifdef CONFIG_ARCH_LOWGETC - #include <stdio.h> #include <assert.h> #include <errno.h> @@ -49,6 +47,8 @@ #include "lib_internal.h" +#ifdef CONFIG_ARCH_LOWGETC + /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/nuttx/lib/stdio/lib_sscanf.c b/nuttx/lib/stdio/lib_sscanf.c index c77907711..01c96c21d 100644 --- a/nuttx/lib/stdio/lib_sscanf.c +++ b/nuttx/lib/stdio/lib_sscanf.c @@ -91,13 +91,13 @@ static const char spaces[] = " \t\n\r\f\v"; * ****************************************************************************/ -int sscanf(const char *buf, const char *fmt, ...) +int sscanf(FAR const char *buf, FAR const char *fmt, ...) { va_list ap; int count; va_start(ap, fmt); - count = vsscanf((char*)buf, fmt, ap); + count = vsscanf((FAR char*)buf, fmt, ap); va_end(ap); return count; } @@ -109,15 +109,15 @@ int sscanf(const char *buf, const char *fmt, ...) * ANSI standard vsscanf implementation. * ****************************************************************************/ -int vsscanf(char *buf, const char *s, va_list ap) +int vsscanf(FAR char *buf, FAR const char *s, va_list ap) { int count; int noassign; int width; int base = 10; int lflag; - char *tv; - const char *tc; + FAR char *tv; + FAR const char *tc; char tmp[MAXLN]; lvdbg("vsscanf: buf=\"%s\" fmt=\"%s\"\n", buf, s); diff --git a/nuttx/lib/string/Make.defs b/nuttx/lib/string/Make.defs index 495634a9e..014623eef 100644 --- a/nuttx/lib/string/Make.defs +++ b/nuttx/lib/string/Make.defs @@ -36,13 +36,17 @@ # Add the string C files to the build CSRCS += lib_checkbase.c lib_isbasedigit.c lib_memset.c lib_memchr.c \ - lib_memccpy.c lib_memcpy.c lib_memcmp.c lib_memmove.c lib_skipspace.c \ - lib_strcasecmp.c lib_strcat.c lib_strchr.c lib_strcpy.c lib_strcmp.c \ - lib_strcspn.c lib_strdup.c lib_strerror.c lib_strlen.c lib_strnlen.c \ - lib_strncasecmp.c lib_strncat.c lib_strncmp.c lib_strncpy.c \ - lib_strndup.c lib_strcasestr.c lib_strpbrk.c lib_strrchr.c\ - lib_strspn.c lib_strstr.c lib_strtok.c lib_strtokr.c lib_strtol.c \ - lib_strtoll.c lib_strtoul.c lib_strtoull.c lib_strtod.c + lib_memccpy.c lib_memcpy.c lib_memcmp.c lib_memmove.c lib_skipspace.c \ + lib_strcasecmp.c lib_strcat.c lib_strchr.c lib_strcpy.c lib_strcmp.c \ + lib_strcspn.c lib_strdup.c lib_strerror.c lib_strlen.c lib_strnlen.c \ + lib_strncasecmp.c lib_strncat.c lib_strncmp.c lib_strncpy.c \ + lib_strndup.c lib_strcasestr.c lib_strpbrk.c lib_strrchr.c\ + lib_strspn.c lib_strstr.c lib_strtok.c lib_strtokr.c lib_strtol.c \ + lib_strtoll.c lib_strtoul.c lib_strtoull.c + +ifeq ($(CONFIG_LIBC_FLOATINGPOINT),y) +CSRCS += lib_strtod.c +endif # Add the string directory to the build diff --git a/nuttx/net/recvfrom.c b/nuttx/net/recvfrom.c index 78990fd39..91dbcce81 100644 --- a/nuttx/net/recvfrom.c +++ b/nuttx/net/recvfrom.c @@ -1090,7 +1090,8 @@ static ssize_t tcp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, * 2) if read-ahead buffering is enabled (CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0) * and delay logic is disabled (CONFIG_NET_TCP_RECVDELAY == 0), then we * not want to wait if we already obtained some data from the read-ahead - * buffer. In that case, return now with what we have. + * buffer. In that case, return now with what we have (don't want for more + * because there may be no timeout). */ #if CONFIG_NET_TCP_RECVDELAY == 0 && CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0 diff --git a/nuttx/sched/prctl.c b/nuttx/sched/prctl.c index b340d0ec8..d71a0e174 100644 --- a/nuttx/sched/prctl.c +++ b/nuttx/sched/prctl.c @@ -91,7 +91,7 @@ int prctl(int option, ...) { /* Get the prctl arguments */ - char *name = va_arg(ap, char *); + FAR char *name = va_arg(ap, FAR char *); int pid = va_arg(ap, int); FAR _TCB *tcb; |