From 99cc52c0763dea695fc740ed2dcfaed7468febd5 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 23 Nov 2012 14:13:57 +0000 Subject: Add common Toolchain.defs for AVR/AVR32; Add Toolchain.defs for ARM; Add more toolchain options (from Mike); incdir.sh and .bat now take -s option git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5384 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 10 +- nuttx/arch/arm/Kconfig | 3 + nuttx/arch/arm/src/arm/Kconfig | 35 ++++++ nuttx/arch/arm/src/arm/Toolchain.defs | 146 ++++++++++++++++++++++++++ nuttx/arch/arm/src/armv7-m/Toolchain.defs | 30 +++--- nuttx/arch/avr/Kconfig | 42 +------- nuttx/arch/avr/src/avr/Kconfig | 53 ++++++++++ nuttx/arch/avr/src/avr/Toolchain.defs | 117 +++++++++++++++++++++ nuttx/arch/avr/src/avr32/Kconfig | 3 + nuttx/arch/avr/src/avr32/Toolchain.defs | 63 +++++++++++ nuttx/arch/mips/src/mips32/Toolchain.defs | 38 +++---- nuttx/configs/amber/README.txt | 14 +++ nuttx/configs/amber/hello/Make.defs | 28 +---- nuttx/configs/avr32dev1/README.txt | 12 ++- nuttx/configs/avr32dev1/nsh/Make.defs | 15 +-- nuttx/configs/ea3131/README.txt | 28 ++++- nuttx/configs/ea3131/nsh/Make.defs | 25 +---- nuttx/configs/ea3131/ostest/Make.defs | 25 +---- nuttx/configs/ea3131/pgnsh/Make.defs | 25 +---- nuttx/configs/ea3131/usbserial/Make.defs | 25 +---- nuttx/configs/ea3131/usbstorage/Make.defs | 25 +---- nuttx/configs/ea3152/README.txt | 28 ++++- nuttx/configs/ea3152/ostest/Make.defs | 25 +---- nuttx/configs/micropendous3/README.txt | 16 ++- nuttx/configs/micropendous3/hello/Make.defs | 28 +---- nuttx/configs/mirtoo/README.txt | 15 ++- nuttx/configs/ntosd-dm320/README.txt | 28 ++++- nuttx/configs/ntosd-dm320/nettest/Make.defs | 25 +---- nuttx/configs/ntosd-dm320/nsh/Make.defs | 25 +---- nuttx/configs/ntosd-dm320/ostest/Make.defs | 25 +---- nuttx/configs/ntosd-dm320/poll/Make.defs | 25 +---- nuttx/configs/ntosd-dm320/thttpd/Make.defs | 25 +---- nuttx/configs/ntosd-dm320/udp/Make.defs | 25 +---- nuttx/configs/ntosd-dm320/uip/Make.defs | 25 +---- nuttx/configs/olimex-lpc2378/nsh/Make.defs | 25 +---- nuttx/configs/olimex-lpc2378/ostest/Make.defs | 25 +---- nuttx/configs/stm3220g-eval/README.txt | 33 +++++- nuttx/configs/teensy/README.txt | 16 ++- nuttx/configs/teensy/hello/Make.defs | 28 +---- nuttx/configs/teensy/nsh/Make.defs | 28 +---- nuttx/configs/teensy/usbstorage/Make.defs | 28 +---- nuttx/tools/incdir.bat | 56 +++++++--- nuttx/tools/incdir.sh | 37 +++++-- 43 files changed, 731 insertions(+), 622 deletions(-) create mode 100644 nuttx/arch/arm/src/arm/Kconfig create mode 100644 nuttx/arch/arm/src/arm/Toolchain.defs create mode 100644 nuttx/arch/avr/src/avr/Toolchain.defs create mode 100644 nuttx/arch/avr/src/avr32/Toolchain.defs (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 103c03de3..6fad0d0ba 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3659,6 +3659,8 @@ * configs/cloudctrl: Darcy Gong's CloudController board. This is a small network relay development board. Based on the Shenzhou IV development board design. It is based on the STM32F107VC MCU. + * arch/arm/src/stm32_serial.c and stm32_lowputc.c: Added optional RS-485 + direction bit control. From Freddie Chopin. * Lots of build files: ARMv7-M and MIPS32 Make.defs now include a common Toolchain.defs file that can be used to manage toolchains in a more configurable way. Contributed by Mike Smith @@ -3666,4 +3668,10 @@ Mike's Toolchain.defs. * tools/configure.sh: Adapted to handle paths and setenv.bat files correctly for native Windows builds. - + * More of build files: AVR and AVR32 Make.defs now include a common + Toolchain.defs file that can be used to manage toolchains in a more + configurable way. Contributed by Mike Smith + * tools/incdir.sh and incdir.bat: Add -s option to generate system header + file paths. + * nuttx/arch/arm/src/arm/Toolchain.defs: Add support for more ARM toolchains + (from Mike Smith). diff --git a/nuttx/arch/arm/Kconfig b/nuttx/arch/arm/Kconfig index eb3bfe85b..3233918ca 100644 --- a/nuttx/arch/arm/Kconfig +++ b/nuttx/arch/arm/Kconfig @@ -256,6 +256,9 @@ config DEBUG_HARDFAULT if ARCH_CORTEXM3 || ARCH_CORTEXM4 source arch/arm/src/armv7-m/Kconfig endif +if ARCH_ARM7TDMI || ARCH_ARM926EJS +source arch/arm/src/arm/Kconfig +endif if ARCH_CHIP_C5471 source arch/arm/src/c5471/Kconfig endif diff --git a/nuttx/arch/arm/src/arm/Kconfig b/nuttx/arch/arm/src/arm/Kconfig new file mode 100644 index 000000000..0d08d89a8 --- /dev/null +++ b/nuttx/arch/arm/src/arm/Kconfig @@ -0,0 +1,35 @@ +# +# For a description of the syntax of this configuration file, +# see misc/tools/kconfig-language.txt. +# + +comment "ARM Configuration Options" + +choice + prompt "Toolchain Selection" + default ARM_TOOLCHAIN_CODESOURCERYW if HOST_WINDOWS + default ARM_TOOLCHAIN_GNU_EABI if !HOST_WINDOWS + +config ARM_TOOLCHAIN_BUILDROOT + bool "Buildroot (Cygwin or Linux)" + depends on !WINDOWS_NATIVE + +config ARM_TOOLCHAIN_CODESOURCERYL + bool "CodeSourcery GNU toolchain under Linux" + depends on HOST_LINUX + +config ARM_TOOLCHAIN_CODESOURCERYW + bool "CodeSourcery GNU toolchain under Windows" + depends on HOST_WINDOWS + +config ARM_TOOLCHAIN_DEVKITARM + bool "devkitARM GNU toolchain" + depends on HOST_WINDOWS + +config ARM_TOOLCHAIN_GNU_EABI + bool "Generic GNU EABI toolchain" + ---help--- + This option should work for any modern GNU toolchain (GCC 4.5 or newer) + configured for arm-none-eabi. + +endchoice diff --git a/nuttx/arch/arm/src/arm/Toolchain.defs b/nuttx/arch/arm/src/arm/Toolchain.defs new file mode 100644 index 000000000..defe30b51 --- /dev/null +++ b/nuttx/arch/arm/src/arm/Toolchain.defs @@ -0,0 +1,146 @@ +############################################################################ +# arch/arm/src/armv/Toolchain.defs +# +# Copyright (C) 2012 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. +# +############################################################################ + +# Setup for the selected toolchain + +# +# Handle old-style chip-specific toolchain names in the absence of +# a new-style toolchain specification, force the selection of a single +# toolchain and allow the selected toolchain to be overridden by a +# command-line selection. +# + +ifeq ($(filter y, \ + $(CONFIG_DM320_BUILDROOT) \ + $(CONFIG_LPC313X_BUILDROOT) \ + $(CONFIG_LPC31_BUILDROOT) \ + $(CONFIG_OLIMEX_LPC2378_BUILDROOT) \ + $(CONFIG_ARM_TOOLCHAIN_BUILDROOT) \ + ),y) + CONFIG_ARM_TOOLCHAIN ?= BUILDROOT +endif +ifeq ($(filter y, \ + $(CONFIG_DM320_CODESOURCERYL) \ + $(CONFIG_LPC31_CODESOURCERYL) \ + $(CONFIG_OLIMEX_LPC2378_CODESOURCERYL) \ + $(CONFIG_ARM_TOOLCHAIN_CODESOURCERYL) \ + ),y) + CONFIG_ARM_TOOLCHAIN ?= CODESOURCERYL +endif +ifeq ($(filter y, \ + $(CONFIG_DM320_CODESOURCERYW) \ + $(CONFIG_LPC31_CODESOURCERYW) \ + $(CONFIG_OLIMEX_LPC2378_CODESOURCERYW) \ + $(CONFIG_ARM_TOOLCHAIN_CODESOURCERYW) \ + ),y) + CONFIG_ARM_TOOLCHAIN ?= CODESOURCERYW +endif +ifeq ($(filter y, \ + $(CONFIG_DM320_DEVKITARM) \ + $(CONFIG_LPC31_DEVKITARM) \ + $(CONFIG_OLIMEX_LPC2378_DEVKITARM) \ + $(CONFIG_ARM_TOOLCHAIN_DEVKITARM) \ + ),y) + CONFIG_ARM_TOOLCHAIN ?= DEVKITARM +endif +ifeq ($(filter y, \ + $(CONFIG_ARM_TOOLCHAIN_GNU_EABI) \ + ),y) + CONFIG_ARM_TOOLCHAIN ?= GNU_EABI +endif + +# +# Supported toolchains +# +# TODO - It's likely that all of these toolchains now support the +# CortexM4. Since they are all GCC-based, we could almost +# certainly simplify this further. +# +# Each toolchain definition should set: +# +# CROSSDEV The GNU toolchain triple (command prefix) +# ARCROSSDEV If required, an alternative prefix used when +# invoking ar and nm. +# ARCHCPUFLAGS CPU-specific flags selecting the instruction set +# FPU options, etc. +# MAXOPTIMIZATION The maximum optimization level that results in +# reliable code generation. +# + +# NuttX buildroot under Linux or Cygwin + +ifeq ($(CONFIG_ARM_TOOLCHAIN),BUILDROOT) + CROSSDEV = arm-nuttx-elf- + ARCROSSDEV = arm-nuttx-elf- + MAXOPTIMIZATION = -Os +endif + +# CodeSourcery under Linux + +ifeq ($(CONFIG_ARM_TOOLCHAIN),CODESOURCERYL) + CROSSDEV = arm-none-eabi- + ARCROSSDEV = arm-none-eabi- + MAXOPTIMIZATION = -O2 +endif + +# CodeSourcery under Windows + +ifeq ($(CONFIG_ARM_TOOLCHAIN),CODESOURCERYW) + CROSSDEV = arm-none-eabi- + ARCROSSDEV = arm-none-eabi- + MAXOPTIMIZATION = -O2 + ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y + endif +endif + +# devkitARM under Windows + +ifeq ($(CONFIG_ARM_TOOLCHAIN),DEVKITARM) + CROSSDEV = arm-eabi- + ARCROSSDEV = arm-eabi- + ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y + endif +endif + +# Generic GNU EABI toolchain on OS X, Linux or any typical Posix system + +ifeq ($(CONFIG_ARM_TOOLCHAIN),GNU_EABI) + CROSSDEV = arm-none-eabi- + ARCROSSDEV = arm-none-eabi- + MAXOPTIMIZATION = -O3 +endif + diff --git a/nuttx/arch/arm/src/armv7-m/Toolchain.defs b/nuttx/arch/arm/src/armv7-m/Toolchain.defs index e39d7f414..e214ce8bd 100644 --- a/nuttx/arch/arm/src/armv7-m/Toolchain.defs +++ b/nuttx/arch/arm/src/armv7-m/Toolchain.defs @@ -143,9 +143,9 @@ endif ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),ATOLLIC) CROSSDEV = arm-atollic-eabi- ARCROSSDEV = arm-atollic-eabi- -ifneq ($(CONFIG_WINDOWS_NATIVE),y) - WINTOOL = y -endif + ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y + endif ifeq ($(CONFIG_ARCH_CORTEXM4),y) ifeq ($(CONFIG_ARCH_FPU),y) ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard @@ -192,9 +192,9 @@ endif ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),CODEREDW) CROSSDEV = arm-none-eabi- ARCROSSDEV = arm-none-eabi- -ifneq ($(CONFIG_WINDOWS_NATIVE),y) - WINTOOL = y -endif + ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y + endif ifeq ($(CONFIG_ARCH_CORTEXM4),y) ifeq ($(CONFIG_ARCH_FPU),y) ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard @@ -220,9 +220,9 @@ endif ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),CODESOURCERYW) CROSSDEV = arm-none-eabi- ARCROSSDEV = arm-none-eabi- -ifneq ($(CONFIG_WINDOWS_NATIVE),y) - WINTOOL = y -endif + ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y + endif ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft endif @@ -231,9 +231,9 @@ endif ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),DEVKITARM) CROSSDEV = arm-eabi- ARCROSSDEV = arm-eabi- -ifneq ($(CONFIG_WINDOWS_NATIVE),y) - WINTOOL = y -endif + ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y + endif ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft endif @@ -259,8 +259,8 @@ endif ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),RAISONANCE) CROSSDEV = arm-none-eabi- ARCROSSDEV = arm-none-eabi- -ifneq ($(CONFIG_WINDOWS_NATIVE),y) - WINTOOL = y -endif + ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y + endif ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft endif diff --git a/nuttx/arch/avr/Kconfig b/nuttx/arch/avr/Kconfig index 4ebd26d5f..41b6c72d3 100644 --- a/nuttx/arch/avr/Kconfig +++ b/nuttx/arch/avr/Kconfig @@ -5,43 +5,6 @@ if ARCH_AVR -choice - prompt "Toolchain" - default AVR_BUILDROOT - -config AVR_WINAVR - bool "WinAVR" - ---help--- - For Cygwin development environment on Windows machines, you - can use WinAVR: http://sourceforge.net/projects/winavr/files/ - - It is assumed in some places that WinAVR is installed at - C:/WinAVR. Edit the setenv.sh file if this is not the case. - - WARNING: There is an incompatible version of cygwin.dll in - the WinAVR/bin directory! Make sure that the path to the - correct cygwin.dll file precedes the path to the WinAVR - binaries! - -config AVR_LINUXGCC - bool "Linux GCC" - ---help--- - For Linux, there are widely available avr-gcc packages. On - Ubuntu, use: sudo apt-get install gcc-avr gdb-avr avr-libc - -config AVR_BUILDROOT - bool "Buildroot" - ---help--- - There is a DIY buildroot version for the AVR boards here: - http://sourceforge.net/projects/nuttx/files/buildroot/. See - the following section for details on building this toolchain. - - It is assumed in some places that buildroot toolchain is - available at ../misc/buildroot/build_avr. Edit the setenv.sh - file if this is not the case. - -endchoice - choice prompt "Atmel AVR chip selection" default ARCH_CHIP_AT32UC3B0256 @@ -110,11 +73,16 @@ config ARCH_CHIP default "at32uc3" if ARCH_AT32UC3 source arch/avr/src/common/Kconfig + +if ARCH_FAMILY_AVR source arch/avr/src/avr/Kconfig source arch/avr/src/at90usb/Kconfig source arch/avr/src/atmega/Kconfig +endif +if ARCH_FAMILY_AVR32 source arch/avr/src/avr32/Kconfig source arch/avr/src/at32uc3/Kconfig +endif config AVR_USART0 bool "USART0 specific serial device driver settings" diff --git a/nuttx/arch/avr/src/avr/Kconfig b/nuttx/arch/avr/src/avr/Kconfig index 99228aa2c..3c18452df 100644 --- a/nuttx/arch/avr/src/avr/Kconfig +++ b/nuttx/arch/avr/src/avr/Kconfig @@ -6,4 +6,57 @@ if ARCH_FAMILY_AVR comment "AVR Configuration Options" +choice + prompt "Toolchain" + default AVR_WINAVR if HOST_WINDOWS + default AVR_BUILDROOT if HOST_LINUX + default AVR_CROSSPACK if HOST_OSX + +config AVR_WINAVR + bool "WinAVR" + depends on HOST_WINDOWS + ---help--- + For Cygwin development environment on Windows machines, you + can use WinAVR: http://sourceforge.net/projects/winavr/files/ + + It is assumed in some places that WinAVR is installed at + C:/WinAVR. Edit the setenv.sh file if this is not the case. + + WARNING: There is an incompatible version of cygwin.dll in + the WinAVR/bin directory! Make sure that the path to the + correct cygwin.dll file precedes the path to the WinAVR + binaries! + +config AVR_LINUXGCC + bool "Linux GCC" + depends on HOST_LINUX + ---help--- + For Linux, there are widely available avr-gcc packages. On + Ubuntu, use: sudo apt-get install gcc-avr gdb-avr avr-libc + +config AVR_CROSSPACK + bool "CrossPack-AVR" + depends on HOST_OSX + ---help--- + For OS X, the AVR CrossPack toolchain is supported: + http://www.obdev.at/products/crosspack/index.html + + It is assumed that /usr/local/CrossPack-AVR/bin is on the + user's path. Edit the setenv.sh file if this is not the + case. + +config AVR_BUILDROOT + bool "Buildroot" + depends on HOST_LINUX || HOST_WINDOWS + ---help--- + There is a DIY buildroot version for the AVR boards here: + http://sourceforge.net/projects/nuttx/files/buildroot/. See + the following section for details on building this toolchain. + + It is assumed in some places that buildroot toolchain is + available at ../misc/buildroot/build_avr. Edit the setenv.sh + file if this is not the case. + +endchoice + endif diff --git a/nuttx/arch/avr/src/avr/Toolchain.defs b/nuttx/arch/avr/src/avr/Toolchain.defs new file mode 100644 index 000000000..96eb273f6 --- /dev/null +++ b/nuttx/arch/avr/src/avr/Toolchain.defs @@ -0,0 +1,117 @@ +############################################################################ +# arch/avr/src/avr/Toolchain.defs +# +# Copyright (C) 2012 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. +# +############################################################################ + +# Setup for the selected toolchain + +# +# Handle old-style chip-specific toolchain names in the absence of +# a new-style toolchain specification, force the selection of a single +# toolchain and allow the selected toolchain to be overridden by a +# command-line selection. +# + +ifeq ($(filter y, \ + $(CONFIG_AVR_BUILDROOT) \ + ),y) + CONFIG_AVR_TOOLCHAIN ?= BUILDROOT +endif +ifeq ($(filter y, \ + $(CONFIG_AVR_CROSSPACK) \ + ),y) + CONFIG_AVR_TOOLCHAIN ?= CROSSPACK +endif +ifeq ($(filter y, \ + $(CONFIG_AVR_LINUXGCC) \ + ),y) + CONFIG_AVR_TOOLCHAIN ?= LINUXGCC +endif +ifeq ($(filter y, \ + $(CONFIG_AVR_WINAVR) \ + ),y) + CONFIG_AVR_TOOLCHAIN ?= WINAVR +endif + +# Chip-specific CPU flags + +ifeq ($(CONFIG_ARCH_CHIP_ATMEGA128),y) + ARCHCPUFLAGS += -mmcu=atmega128 +else ifeq ($(CONFIG_ARCH_CHIP_AT90USB646),y) + ARCHCPUFLAGS += -mmcu=at90usb646 +else ifeq ($(CONFIG_ARCH_CHIP_AT90USB647),y) + ARCHCPUFLAGS += -mmcu=at90usb647 +else ifeq ($(CONFIG_ARCH_CHIP_AT90USB1286),y) + ARCHCPUFLAGS += -mmcu=at90usb1286 +else ifeq ($(CONFIG_ARCH_CHIP_AT90USB1287),y) + ARCHCPUFLAGS += -mmcu=at90usb1287 +else + $(error "No valid CONFIG_ARCH_CHIP_ set in the configuration") +endif + +# NuttX buildroot GCC toolchain under Linux or Cygwin + +ifeq ($(CONFIG_AVR_TOOLCHAIN),BUILDROOT) + CROSSDEV = avr-nuttx-elf- + MAXOPTIMIZATION = -O2 + LDFLAGS += -nostartfiles -nodefaultlibs +endif + +# AVR CrossPack under OS X + +ifeq ($(CONFIG_AVR_TOOLCHAIN),CROSSPACK) + CROSSDEV = avr- + MAXOPTIMIZATION = -O2 + LDFLAGS += -nostartfiles -nodefaultlibs +endif + +# GCC toolchain under Linux + +ifeq ($(CONFIG_AVR_TOOLCHAIN),LINUXGCC) + CROSSDEV = avr- + MAXOPTIMIZATION = -O2 + LDFLAGS += -nostartfiles -nodefaultlibs +endif + +# WinAVR toolchain under Windows/Cygwin + +ifeq ($(CONFIG_AVR_TOOLCHAIN),WINAVR) + CROSSDEV = avr- + ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y + endif + MAXOPTIMIZATION = -O2 + LDFLAGS += -nostartfiles -nodefaultlibs +endif + + diff --git a/nuttx/arch/avr/src/avr32/Kconfig b/nuttx/arch/avr/src/avr32/Kconfig index 12cc033cb..2e604cade 100644 --- a/nuttx/arch/avr/src/avr32/Kconfig +++ b/nuttx/arch/avr/src/avr32/Kconfig @@ -6,4 +6,7 @@ if ARCH_FAMILY_AVR32 comment "AVR32 Configuration Options" +# Note - no toolchain selection here as there is only one +# supported toolchain. + endif diff --git a/nuttx/arch/avr/src/avr32/Toolchain.defs b/nuttx/arch/avr/src/avr32/Toolchain.defs new file mode 100644 index 000000000..6a4b1234e --- /dev/null +++ b/nuttx/arch/avr/src/avr32/Toolchain.defs @@ -0,0 +1,63 @@ +############################################################################ +# arch/avr/src/avr32/Toolchain.defs +# +# Copyright (C) 2012 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. +# +############################################################################ + +# Setup for the selected toolchain + +# +# Since all of the supported toolchains are variants of the Atmel-patched +# GCC, the only interesting question to answer here is whether or not +# the build is hosted on Windows, and how to override the configuration. +# + +CROSSDEV = avr32- +ARCHCPUFLAGS = -mpart=uc3b0256 + +ifeq ($(filter y, \ + $(CONFIG_AVR32_AVRTOOLSW) \ + $(CONFIG_HOST_WINDOWS) \ + ),y) + # AVR Tools under Windows + CONFIG_AVR32_TOOLCHAIN ?= AVRTOOLSW +else + CONFIG_AVR32_TOOLCHAIN ?= GNU +endif + +ifeq ($(CONFIG_AVR32_TOOLCHAIN),AVRTOOLSW) + ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y + endif +else + # AVR Tools or avr32-toolchain from https://github.com/jsnyder/avr32-toolchain +endif diff --git a/nuttx/arch/mips/src/mips32/Toolchain.defs b/nuttx/arch/mips/src/mips32/Toolchain.defs index 554e5f044..bd509b86c 100644 --- a/nuttx/arch/mips/src/mips32/Toolchain.defs +++ b/nuttx/arch/mips/src/mips32/Toolchain.defs @@ -42,6 +42,8 @@ # command-line selection. # ifeq ($(filter y, \ + $(CONFIG_PIC32MX_PINGUINOL) \ + $(CONFIG_MIPS32_TOOLCHAIN_PINGUINOL) \ $(CONFIG_MIPS32_TOOLCHAIN_GNU_ELF) \ ),y) CONFIG_MIPS32_TOOLCHAIN ?= GNU_ELF @@ -82,12 +84,6 @@ ifeq ($(filter y, \ ),y) CONFIG_MIPS32_TOOLCHAIN ?= PINGUINOW endif -ifeq ($(filter y, \ - $(CONFIG_PIC32MX_PINGUINOL) \ - $(CONFIG_MIPS32_TOOLCHAIN_PINGUINOL) \ - ),y) - CONFIG_MIPS32_TOOLCHAIN ?= PINGUINOL -endif # # Supported toolchains @@ -104,6 +100,7 @@ endif # # Generic GNU mip32 toolchain on OS X or Linux +# including Pinguino mips-elf toolchain ifeq ($(CONFIG_MIPS32_TOOLCHAIN),GNU_ELF) CROSSDEV = mips-elf- @@ -131,9 +128,9 @@ endif ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPW) CROSSDEV = pic32- # CROSSDEV = xc32- -ifneq ($(CONFIG_WINDOWS_NATIVE),y) - WINTOOL = y -endif + ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y + endif MAXOPTIMIZATION = -O2 ARCHCPUFLAGS = -mprocessor=elf32pic32mx -mno-float -mlong32 -membedded-data ARCHPICFLAGS = -fpic -membedded-pic @@ -158,9 +155,9 @@ endif ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPW_LITE) CROSSDEV = pic32- # CROSSDEV = xc32- -ifneq ($(CONFIG_WINDOWS_NATIVE),y) - WINTOOL = y -endif + ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y + endif # MAXOPTIMIZATION = -O2 ARCHCPUFLAGS = -mprocessor=elf32pic32mx -mno-float -mlong32 -membedded-data ARCHPICFLAGS = -fpic -membedded-pic @@ -183,20 +180,9 @@ endif ifeq ($(CONFIG_MIPS32_TOOLCHAIN),PINGUINOW) CROSSDEV = mips- -ifneq ($(CONFIG_WINDOWS_NATIVE),y) - WINTOOL = y -endif - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mlong32 -membedded-data -msoft-float -march=24kc -EL - ARCHPICFLAGS = -fpic -membedded-pic - LDFLAGS += -nostartfiles -nodefaultlibs - LDSCRIPT = mips-elf-debug.ld -endif - -# Pinguino mips-elf toolchain under OS X or Linux - -ifeq ($(CONFIG_MIPS32_TOOLCHAIN),PINGUINOL) - CROSSDEV = mips-elf- + ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y + endif MAXOPTIMIZATION = -O2 ARCHCPUFLAGS = -mlong32 -membedded-data -msoft-float -march=24kc -EL ARCHPICFLAGS = -fpic -membedded-pic diff --git a/nuttx/configs/amber/README.txt b/nuttx/configs/amber/README.txt index 63fa5d41f..56e31ba7f 100644 --- a/nuttx/configs/amber/README.txt +++ b/nuttx/configs/amber/README.txt @@ -187,6 +187,12 @@ Atmel AVRISP mkII Connection Toolchains ^^^^^^^^^^ +The toolchain may be selected using the mconf tool (via 'make menuconfig'), +by editing the existing configuration file (defconfig), or by overriding +the toolchain on the make commandline with CONFIG_AVR_TOOLCHAIN=. + +The valid values for are BUILDROOT, CROSSPACK, LINUXGCC and WINAVR. + Buildroot: There is a DIY buildroot version for the AVR boards here: @@ -223,6 +229,14 @@ Linux: After configuring NuttX, make sure that CONFIG_AVR_LINUXGCC=y is set in your .config file. +Mac OS X: + + For Mac OS X, the CrossPack for AVR toolchain is available from: + + http://www.obdev.at/products/crosspack/index.html + + This toolchain is functionally equivalent to the Linux GCC toolchain. + Windows Native Toolchains ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/configs/amber/hello/Make.defs b/nuttx/configs/amber/hello/Make.defs index 15c31f192..e7f998dc7 100644 --- a/nuttx/configs/amber/hello/Make.defs +++ b/nuttx/configs/amber/hello/Make.defs @@ -35,33 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_AVR_WINAVR),y) - # WinAVR toolchain under Windows/Cygwin - CROSSDEV = avr- - WINTOOL = y - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mmcu=atmega128 - LDFLAGS += -nostartfiles -nodefaultlibs -endif - -ifeq ($(CONFIG_AVR_LINUXGCC),y) - # GCC toolchain under Linux - CROSSDEV = avr- - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mmcu=atmega128 - LDFLAGS += -nostartfiles -nodefaultlibs -endif - -ifeq ($(CONFIG_AVR_BUILDROOT),y) - # NuttX buildroot GCC toolchain under Linux or Cygwin - CROSSDEV = avr-nuttx-elf- - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mmcu=atmega128 - LDFLAGS += -nostartfiles -nodefaultlibs -endif +include ${TOPDIR}/arch/avr/src/avr/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/avr32dev1/README.txt b/nuttx/configs/avr32dev1/README.txt index 68d019227..37e15dc9b 100644 --- a/nuttx/configs/avr32dev1/README.txt +++ b/nuttx/configs/avr32dev1/README.txt @@ -112,7 +112,7 @@ PA17 and PA23 are avaiable from the AVR32DEV1: Development Environment ^^^^^^^^^^^^^^^^^^^^^^^ - Either Linux or Cygwin on Windows can be used for the development environment. + Linux, Mac OS X or Cygwin on Windows can be used for the development environment. The source has been built only using the GNU toolchain (see below). Other toolchains will likely cause problems. Testing was performed using the Cygwin environment. @@ -140,6 +140,16 @@ WinAVR: AVR32 toolchain as well as the AVR toolchain and various support libraries and header files. +AVR32 Toolchain Builder: + + A third option is to build the toolchain yourself. For OS X and Linux systems, + this Makefile will build a complete gcc-4.4.3 toolchain: + + https://github.com/jsnyder/avr32-toolchain + + By default the toolchain installs into ${HOME}/avr-32-tools- and + the bin subdirectory must be added to your path before compiling. + IDEs ^^^^ diff --git a/nuttx/configs/avr32dev1/nsh/Make.defs b/nuttx/configs/avr32dev1/nsh/Make.defs index aa84884d0..bccb35069 100644 --- a/nuttx/configs/avr32dev1/nsh/Make.defs +++ b/nuttx/configs/avr32dev1/nsh/Make.defs @@ -35,20 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_AVR32_AVRTOOLSW),y) - # AVR Tools under Windows - CROSSDEV = avr32- - WINTOOL = y - ARCHCPUFLAGS = -mpart=uc3b0256 -endif -ifeq ($(CONFIG_AVR32_AVRTOOLSL),y) - # AVR Tools under Linux - CROSSDEV = avr32- - ARCHCPUFLAGS = -mpart=uc3b0256 -endif +include ${TOPDIR}/arch/avr/src/avr32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/ea3131/README.txt b/nuttx/configs/ea3131/README.txt index 2912bf318..fcfc0792f 100644 --- a/nuttx/configs/ea3131/README.txt +++ b/nuttx/configs/ea3131/README.txt @@ -34,8 +34,9 @@ GNU Toolchain Options 1. The CodeSourcery GNU toolchain, 2. The devkitARM GNU toolchain, - 3. Raisonance GNU toolchain, or - 4. The NuttX buildroot Toolchain (see below). + 3. Raisonance GNU toolchain, + 4. The NuttX buildroot Toolchain (see below), or + 5. Any generic arm-none-eabi GNU toolchain. All testing has been conducted using the NuttX buildroot toolchain. However, the make system is setup to default to use the devkitARM toolchain. To use @@ -47,10 +48,16 @@ GNU Toolchain Options CONFIG_LPC31_CODESOURCERYL=y : CodeSourcery under Linux CONFIG_LPC31_DEVKITARM=y : devkitARM under Windows CONFIG_LPC31_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default) + CONFIG_ARM_TOOLCHAIN_GNU_EABI : Generic arm-none-eabi toolchain If you are not using CONFIG_LPC31_BUILDROOT, then you may also have to modify the PATH in the setenv.h file if your make cannot find the tools. + The toolchain may also be set using the mconf utility (make menuconfig) or by + passing CONFIG_ARM_TOOLCHAIN= to make, where is one + of CODESOURCERYW, CODESOURCERYL, DEVKITARM, BUILDROOT or GNU_EABI as described + above. + NOTE: the CodeSourcery (for Windows), devkitARM, and Raisonance toolchains are Windows native toolchains. The CodeSourcey (for Linux) and NuttX buildroot toolchains are Cygwin and/or Linux native toolchains. There are several limitations @@ -87,6 +94,23 @@ GNU Toolchain Options the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM path or will get the wrong version of make. + Generic arm-none-eabi GNU Toolchain + ----------------------------------- + There are a number of toolchain projects providing support for ARMv4/v5 + class processors, including: + + GCC ARM Embedded + https://launchpad.net/gcc-arm-embedded + + Summon ARM Toolchain + https://github.com/esden/summon-arm-toolchain + + Yagarto + http://www.yagarto.de + + Others exist for various Linux distributions, MacPorts, etc. Any version + based on GCC 4.6.3 or later should work. + IDEs ^^^^ diff --git a/nuttx/configs/ea3131/nsh/Make.defs b/nuttx/configs/ea3131/nsh/Make.defs index a061eb22c..1bfd6f4d5 100644 --- a/nuttx/configs/ea3131/nsh/Make.defs +++ b/nuttx/configs/ea3131/nsh/Make.defs @@ -35,30 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_LPC31_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - WINTOOL = y - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_LPC31_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_LPC31_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - WINTOOL = y -endif -ifeq ($(CONFIG_LPC31_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - CROSSDEV = arm-nuttx-elf- - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/ea3131/ostest/Make.defs b/nuttx/configs/ea3131/ostest/Make.defs index ba750e212..9c8780a4a 100644 --- a/nuttx/configs/ea3131/ostest/Make.defs +++ b/nuttx/configs/ea3131/ostest/Make.defs @@ -35,30 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_LPC31_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - WINTOOL = y - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_LPC31_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_LPC31_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - WINTOOL = y -endif -ifeq ($(CONFIG_LPC31_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - CROSSDEV = arm-nuttx-elf- - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/ea3131/pgnsh/Make.defs b/nuttx/configs/ea3131/pgnsh/Make.defs index c142319de..f71a0920e 100644 --- a/nuttx/configs/ea3131/pgnsh/Make.defs +++ b/nuttx/configs/ea3131/pgnsh/Make.defs @@ -35,30 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_LPC31_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - WINTOOL = y - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_LPC31_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_LPC31_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - WINTOOL = y -endif -ifeq ($(CONFIG_LPC31_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - CROSSDEV = arm-nuttx-elf- - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/ea3131/usbserial/Make.defs b/nuttx/configs/ea3131/usbserial/Make.defs index ef64e2615..1b1eb45d5 100644 --- a/nuttx/configs/ea3131/usbserial/Make.defs +++ b/nuttx/configs/ea3131/usbserial/Make.defs @@ -35,30 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_LPC31_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - WINTOOL = y - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_LPC31_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_LPC31_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - WINTOOL = y -endif -ifeq ($(CONFIG_LPC31_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - CROSSDEV = arm-nuttx-elf- - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/ea3131/usbstorage/Make.defs b/nuttx/configs/ea3131/usbstorage/Make.defs index 739360615..7155ccf5c 100644 --- a/nuttx/configs/ea3131/usbstorage/Make.defs +++ b/nuttx/configs/ea3131/usbstorage/Make.defs @@ -35,30 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_LPC31_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - WINTOOL = y - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_LPC31_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_LPC31_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - WINTOOL = y -endif -ifeq ($(CONFIG_LPC31_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - CROSSDEV = arm-nuttx-elf- - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/ea3152/README.txt b/nuttx/configs/ea3152/README.txt index 7aa57e3ae..da57945bd 100644 --- a/nuttx/configs/ea3152/README.txt +++ b/nuttx/configs/ea3152/README.txt @@ -33,8 +33,9 @@ GNU Toolchain Options 1. The CodeSourcery GNU toolchain, 2. The devkitARM GNU toolchain, - 3. Raisonance GNU toolchain, or - 4. The NuttX buildroot Toolchain (see below). + 3. Raisonance GNU toolchain, + 4. The NuttX buildroot Toolchain (see below), or + 5. Any generic arm-none-eabi GNU toolchain. All testing has been conducted using the NuttX buildroot toolchain. However, the make system is setup to default to use the devkitARM toolchain. To use @@ -46,10 +47,16 @@ GNU Toolchain Options CONFIG_LPC31_CODESOURCERYL=y : CodeSourcery under Linux CONFIG_LPC31_DEVKITARM=y : devkitARM under Windows CONFIG_LPC31_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default) + CONFIG_ARM_TOOLCHAIN_GNU_EABI : Generic arm-none-eabi toolchain If you are not using CONFIG_LPC31_BUILDROOT, then you may also have to modify the PATH in the setenv.h file if your make cannot find the tools. + The toolchain may also be set using the mconf utility (make menuconfig) or by + passing CONFIG_ARM_TOOLCHAIN= to make, where is one + of CODESOURCERYW, CODESOURCERYL, DEVKITARM, BUILDROOT or GNU_EABI as described + above. + NOTE: the CodeSourcery (for Windows), devkitARM, and Raisonance toolchains are Windows native toolchains. The CodeSourcey (for Linux) and NuttX buildroot toolchains are Cygwin and/or Linux native toolchains. There are several limitations @@ -85,6 +92,23 @@ GNU Toolchain Options NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM path or will get the wrong version of make. + + Generic arm-none-eabi GNU Toolchain + ----------------------------------- + There are a number of toolchain projects providing support for ARMv4/v5 + class processors, including: + + GCC ARM Embedded + https://launchpad.net/gcc-arm-embedded + + Summon ARM Toolchain + https://github.com/esden/summon-arm-toolchain + + Yagarto + http://www.yagarto.de + + Others exist for various Linux distributions, MacPorts, etc. Any version + based on GCC 4.6.3 or later should work. IDEs ^^^^ diff --git a/nuttx/configs/ea3152/ostest/Make.defs b/nuttx/configs/ea3152/ostest/Make.defs index f69eb5e95..45168938a 100644 --- a/nuttx/configs/ea3152/ostest/Make.defs +++ b/nuttx/configs/ea3152/ostest/Make.defs @@ -35,30 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_LPC31_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - WINTOOL = y - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_LPC31_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_LPC31_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - WINTOOL = y -endif -ifeq ($(CONFIG_LPC31_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - CROSSDEV = arm-nuttx-elf- - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/micropendous3/README.txt b/nuttx/configs/micropendous3/README.txt index 583f1d8d8..1b0f2c8ce 100644 --- a/nuttx/configs/micropendous3/README.txt +++ b/nuttx/configs/micropendous3/README.txt @@ -198,7 +198,13 @@ Toolchains There are several toolchain options. However, testing has been performed using *only* the NuttX buildroot toolchain described below. Therefore, -the NuttX buildroot toolchain is the recommended choice: +the NuttX buildroot toolchain is the recommended choice. + +The toolchain may be selected using the mconf tool (via 'make menuconfig'), +by editing the existing configuration file (defconfig), or by overriding +the toolchain on the make commandline with CONFIG_AVR_TOOLCHAIN=. + +The valid values for are BUILDROOT, CROSSPACK, LINUXGCC and WINAVR. Buildroot: @@ -236,6 +242,14 @@ Linux: After configuring NuttX, make sure that CONFIG_AVR_LINUXGCC=y is set in your .config file. +Mac OS X: + + For Mac OS X, the CrossPack for AVR toolchain is available from: + + http://www.obdev.at/products/crosspack/index.html + + This toolchain is functionally equivalent to the Linux GCC toolchain. + Windows Native Toolchains ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/configs/micropendous3/hello/Make.defs b/nuttx/configs/micropendous3/hello/Make.defs index 69073bb43..a40098fff 100644 --- a/nuttx/configs/micropendous3/hello/Make.defs +++ b/nuttx/configs/micropendous3/hello/Make.defs @@ -35,33 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_AVR_WINAVR),y) - # WinAVR toolchain under Windows/Cygwin - CROSSDEV = avr- - WINTOOL = y - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mmcu=at90usb647 - LDFLAGS += -nostartfiles -nodefaultlibs -endif - -ifeq ($(CONFIG_AVR_LINUXGCC),y) - # GCC toolchain under Linux - CROSSDEV = avr- - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mmcu=at90usb647 - LDFLAGS += -nostartfiles -nodefaultlibs -endif - -ifeq ($(CONFIG_AVR_BUILDROOT),y) - # NuttX buildroot GCC toolchain under Linux or Cygwin - CROSSDEV = avr-nuttx-elf- - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mmcu=at90usb647 - LDFLAGS += -nostartfiles -nodefaultlibs -endif +include ${TOPDIR}/arch/avr/src/avr/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/mirtoo/README.txt b/nuttx/configs/mirtoo/README.txt index 488884ba5..89c137a03 100644 --- a/nuttx/configs/mirtoo/README.txt +++ b/nuttx/configs/mirtoo/README.txt @@ -323,6 +323,12 @@ Additional signals available via Peripheral Pin Selections (PPS) Toolchains ========== + Note that in addition to the configuration options listed below, the + toolchain can be configured using the mconf utility ('make menuconfig') + or by passing CONFIG_MIPS32_TOOLCHAIN= to make, where + is one of GNU_ELF, MICROCHIPL, MICROCHIPW, MICROCHIPL_LITE, + MICROCHIPW_LITE, MICROCHIPOPENL or PINGUINOW as described below. + MPLAB/C32 --------- @@ -376,7 +382,7 @@ Toolchains Note that the tools will have the prefix, mypic32- so, for example, the compiler will be called mypic32-gcc. - Pinguino mips-elf Toolchain + Pinguino mips-elf / Generic mips-elf Toolchain --------------------------- Another option is the mips-elf toolchain used with the Pinguino project. This @@ -390,12 +396,15 @@ Toolchains configurations. Use one of these configuration options to select the Pinguino mips-elf toolchain: - CONFIG_PIC32MX_PINGUINOW - Pinguino mips-elf toolchain for Windows - CONFIG_PIC32MX_PINGUINOL - Pinguino mips toolchain for Linux + CONFIG_PIC32MX_PINGUINOW - Pinguino mips-elf toolchain for Windows + CONFIG_MIPS32_TOOLCHAIN_GNU_ELF - mips-elf toolchain for Linux or OS X And set the path appropriately in the setenv.sh file. These tool configurations are untested -- expect some additional integration issues. Good luck! + This configuration will also work with any generic mips-elf GCC past version + 4.6 or so. + MPLAB/C32 vs MPLABX/X32 ----------------------- diff --git a/nuttx/configs/ntosd-dm320/README.txt b/nuttx/configs/ntosd-dm320/README.txt index 1a6a38e7c..d85e53525 100644 --- a/nuttx/configs/ntosd-dm320/README.txt +++ b/nuttx/configs/ntosd-dm320/README.txt @@ -54,7 +54,8 @@ GNU Toolchain Options 1. The CodeSourcery GNU toolchain, 2. The devkitARM GNU toolchain, 3. Raisonance GNU toolchain, or - 4. The NuttX buildroot Toolchain (see below). + 4. The NuttX buildroot Toolchain (see below), or + 5. Any generic arm-none-eabi GNU toolchain. All testing has been conducted using the NuttX buildroot toolchain. However, the make system is setup to default to use the devkitARM toolchain. To use @@ -65,11 +66,17 @@ GNU Toolchain Options CONFIG_DM320_CODESOURCERYW=y : CodeSourcery under Windows CONFIG_DM320_CODESOURCERYL=y : CodeSourcery under Linux CONFIG_DM320_DEVKITARM=y : devkitARM under Windows - CONFIG_DM320_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default) + CONFIG_DM320_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default) + CONFIG_ARM_TOOLCHAIN_GNU_EABI : Generic arm-none-eabi toolchain If you are not using CONFIG_DM320_BUILDROOT, then you may also have to modify the PATH in the setenv.h file if your make cannot find the tools. + The toolchain may also be set using the mconf utility (make menuconfig) or by + passing CONFIG_ARM_TOOLCHAIN= to make, where is one + of CODESOURCERYW, CODESOURCERYL, DEVKITARM, BUILDROOT or GNU_EABI as described + above. + NOTE: the CodeSourcery (for Windows), devkitARM, and Raisonance toolchains are Windows native toolchains. The CodeSourcey (for Linux) and NuttX buildroot toolchains are Cygwin and/or Linux native toolchains. There are several limitations @@ -105,6 +112,23 @@ GNU Toolchain Options NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM path or will get the wrong version of make. + + Generic arm-none-eabi GNU Toolchain + ----------------------------------- + There are a number of toolchain projects providing support for ARMv4/v5 + class processors, including: + + GCC ARM Embedded + https://launchpad.net/gcc-arm-embedded + + Summon ARM Toolchain + https://github.com/esden/summon-arm-toolchain + + Yagarto + http://www.yagarto.de + + Others exist for various Linux distributions, MacPorts, etc. Any version + based on GCC 4.6.3 or later should work. IDEs ^^^^ diff --git a/nuttx/configs/ntosd-dm320/nettest/Make.defs b/nuttx/configs/ntosd-dm320/nettest/Make.defs index 8c5b7e93b..86dd3f815 100644 --- a/nuttx/configs/ntosd-dm320/nettest/Make.defs +++ b/nuttx/configs/ntosd-dm320/nettest/Make.defs @@ -35,30 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_DM320_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - WINTOOL = y - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_DM320_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_DM320_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - WINTOOL = y -endif -ifeq ($(CONFIG_DM320_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - CROSSDEV = arm-nuttx-elf- - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/ntosd-dm320/nsh/Make.defs b/nuttx/configs/ntosd-dm320/nsh/Make.defs index fa6149406..088dc7976 100644 --- a/nuttx/configs/ntosd-dm320/nsh/Make.defs +++ b/nuttx/configs/ntosd-dm320/nsh/Make.defs @@ -35,30 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_DM320_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - WINTOOL = y - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_DM320_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_DM320_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - WINTOOL = y -endif -ifeq ($(CONFIG_DM320_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - CROSSDEV = arm-nuttx-elf- - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/ntosd-dm320/ostest/Make.defs b/nuttx/configs/ntosd-dm320/ostest/Make.defs index 9b2ab9e5e..9312ae060 100644 --- a/nuttx/configs/ntosd-dm320/ostest/Make.defs +++ b/nuttx/configs/ntosd-dm320/ostest/Make.defs @@ -35,30 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_DM320_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - WINTOOL = y - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_DM320_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_DM320_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - WINTOOL = y -endif -ifeq ($(CONFIG_DM320_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - CROSSDEV = arm-nuttx-elf- - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/ntosd-dm320/poll/Make.defs b/nuttx/configs/ntosd-dm320/poll/Make.defs index 69c20da94..fb208f85c 100644 --- a/nuttx/configs/ntosd-dm320/poll/Make.defs +++ b/nuttx/configs/ntosd-dm320/poll/Make.defs @@ -35,30 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_DM320_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - WINTOOL = y - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_DM320_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_DM320_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - WINTOOL = y -endif -ifeq ($(CONFIG_DM320_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - CROSSDEV = arm-nuttx-elf- - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/ntosd-dm320/thttpd/Make.defs b/nuttx/configs/ntosd-dm320/thttpd/Make.defs index 252416f6b..cc62a030a 100644 --- a/nuttx/configs/ntosd-dm320/thttpd/Make.defs +++ b/nuttx/configs/ntosd-dm320/thttpd/Make.defs @@ -35,30 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_DM320_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - WINTOOL = y - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_DM320_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_DM320_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - WINTOOL = y -endif -ifeq ($(CONFIG_DM320_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - CROSSDEV = arm-nuttx-elf- - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/ntosd-dm320/udp/Make.defs b/nuttx/configs/ntosd-dm320/udp/Make.defs index 0cdb9f05d..1c8893289 100644 --- a/nuttx/configs/ntosd-dm320/udp/Make.defs +++ b/nuttx/configs/ntosd-dm320/udp/Make.defs @@ -35,30 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_DM320_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - WINTOOL = y - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_DM320_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_DM320_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - WINTOOL = y -endif -ifeq ($(CONFIG_DM320_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - CROSSDEV = arm-nuttx-elf- - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/ntosd-dm320/uip/Make.defs b/nuttx/configs/ntosd-dm320/uip/Make.defs index 64bb4494b..6d2a223df 100644 --- a/nuttx/configs/ntosd-dm320/uip/Make.defs +++ b/nuttx/configs/ntosd-dm320/uip/Make.defs @@ -35,30 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_DM320_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - WINTOOL = y - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_DM320_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_DM320_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - WINTOOL = y -endif -ifeq ($(CONFIG_DM320_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - CROSSDEV = arm-nuttx-elf- - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/olimex-lpc2378/nsh/Make.defs b/nuttx/configs/olimex-lpc2378/nsh/Make.defs index 5fba7e214..a7fce92f4 100644 --- a/nuttx/configs/olimex-lpc2378/nsh/Make.defs +++ b/nuttx/configs/olimex-lpc2378/nsh/Make.defs @@ -40,30 +40,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_OLIMEX_LPC2378_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - WINTOOL = y - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_OLIMEX_LPC2378_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_OLIMEX_LPC2378_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - WINTOOL = y -endif -ifeq ($(CONFIG_OLIMEX_LPC2378_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - CROSSDEV = arm-nuttx-elf- - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/olimex-lpc2378/ostest/Make.defs b/nuttx/configs/olimex-lpc2378/ostest/Make.defs index 2c007cd39..2d8218bad 100644 --- a/nuttx/configs/olimex-lpc2378/ostest/Make.defs +++ b/nuttx/configs/olimex-lpc2378/ostest/Make.defs @@ -40,30 +40,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_OLIMEX_LPC2378_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - WINTOOL = y - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_OLIMEX_LPC2378_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_OLIMEX_LPC2378_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - WINTOOL = y -endif -ifeq ($(CONFIG_OLIMEX_LPC2378_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - CROSSDEV = arm-nuttx-elf- - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/stm3220g-eval/README.txt b/nuttx/configs/stm3220g-eval/README.txt index 1e3388e70..8695dbb89 100644 --- a/nuttx/configs/stm3220g-eval/README.txt +++ b/nuttx/configs/stm3220g-eval/README.txt @@ -26,7 +26,7 @@ Contents Development Environment ======================= - Either Linux or Cygwin on Windows can be used for the development environment. + Linux, OS X or Cygwin on Windows can be used for the development environment. The source has been built only using the GNU toolchain (see below). Other toolchains will likely cause problems. Testing was performed using the Cygwin environment because the Raisonance R-Link emulatator and some RIDE7 development tools @@ -43,8 +43,9 @@ GNU Toolchain Options 1. The CodeSourcery GNU toolchain, 2. The Atollic Toolchain, 3. The devkitARM GNU toolchain, - 4. Raisonance GNU toolchain, or - 5. The NuttX buildroot Toolchain (see below). + 4. Raisonance GNU toolchain, + 5. The NuttX buildroot Toolchain (see below), or + 6. Any generic arm-none-eabi GNU toolchain. Most testing has been conducted using the CodeSourcery toolchain for Windows and that is the default toolchain in most configurations. To use the Atollic @@ -59,10 +60,16 @@ GNU Toolchain Options CONFIG_STM32_DEVKITARM=y : devkitARM under Windows CONFIG_STM32_RAISONANCE=y : Raisonance RIDE7 under Windows CONFIG_STM32_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default) + CONFIG_ARMV7M_TOOLCHAIN_GNU_EABI : Generic arm-none-eabi toolchain If you change the default toolchain, then you may also have to modify the PATH in the setenv.h file if your make cannot find the tools. + The toolchain may also be set using the mconf utility (make menuconfig) or by + passing CONFIG_ARMV7M_TOOLCHAIN= to make, where is one + of CODESOURCERYW, CODESOURCERYL, ATOLLOC, DEVKITARM, RAISONANCE, BUILDROOT or + GNU_EABI as described above. + NOTE: the CodeSourcery (for Windows), Atollic, devkitARM, and Raisonance toolchains are Windows native toolchains. The CodeSourcey (for Linux) and NuttX buildroot toolchains are Cygwin and/or Linux native toolchains. There are several limitations @@ -133,6 +140,26 @@ GNU Toolchain Options the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM path or will get the wrong version of make. + Generic arm-none-eabi GNU Toolchain + ----------------------------------- + There are a number of toolchain projects providing support for the Cortex-M + class processors, including: + + GCC ARM Embedded + https://launchpad.net/gcc-arm-embedded + + Thumb2 Newlib Toolchain + https://github.com/EliasOenal/TNT + + Summon ARM Toolchain + https://github.com/esden/summon-arm-toolchain + + Yagarto + http://www.yagarto.de + + Others exist for various Linux distributions, MacPorts, etc. Any version + based on GCC 4.6.3 or later should work. + IDEs ==== diff --git a/nuttx/configs/teensy/README.txt b/nuttx/configs/teensy/README.txt index 30349e1ff..951f4a87e 100644 --- a/nuttx/configs/teensy/README.txt +++ b/nuttx/configs/teensy/README.txt @@ -201,7 +201,13 @@ Toolchains There are several toolchain options. However, testing has been performed using *only* the NuttX buildroot toolchain described below. Therefore, -the NuttX buildroot toolchain is the recommended choice: +the NuttX buildroot toolchain is the recommended choice. + +The toolchain may be selected using the mconf tool (via 'make menuconfig'), +by editing the existing configuration file (defconfig), or by overriding +the toolchain on the make commandline with CONFIG_AVR_TOOLCHAIN=. + +The valid values for are BUILDROOT, CROSSPACK, LINUXGCC and WINAVR. Buildroot: @@ -239,6 +245,14 @@ Linux: After configuring NuttX, make sure that CONFIG_AVR_LINUXGCC=y is set in your .config file. +Mac OS X: + + For Mac OS X, the CrossPack for AVR toolchain is available from: + + http://www.obdev.at/products/crosspack/index.html + + This toolchain is functionally equivalent to the Linux GCC toolchain. + Windows Native Toolchains ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/configs/teensy/hello/Make.defs b/nuttx/configs/teensy/hello/Make.defs index 9c7cb8268..d09279a8d 100644 --- a/nuttx/configs/teensy/hello/Make.defs +++ b/nuttx/configs/teensy/hello/Make.defs @@ -35,33 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_AVR_WINAVR),y) - # WinAVR toolchain under Windows/Cygwin - CROSSDEV = avr- - WINTOOL = y - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mmcu=at90usb1286 - LDFLAGS += -nostartfiles -nodefaultlibs -endif - -ifeq ($(CONFIG_AVR_LINUXGCC),y) - # GCC toolchain under Linux - CROSSDEV = avr- - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mmcu=at90usb1286 - LDFLAGS += -nostartfiles -nodefaultlibs -endif - -ifeq ($(CONFIG_AVR_BUILDROOT),y) - # NuttX buildroot GCC toolchain under Linux or Cygwin - CROSSDEV = avr-nuttx-elf- - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mmcu=at90usb1286 - LDFLAGS += -nostartfiles -nodefaultlibs -endif +include ${TOPDIR}/arch/avr/src/avr/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/teensy/nsh/Make.defs b/nuttx/configs/teensy/nsh/Make.defs index 63c9db51f..e65958cfe 100644 --- a/nuttx/configs/teensy/nsh/Make.defs +++ b/nuttx/configs/teensy/nsh/Make.defs @@ -35,33 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_AVR_WINAVR),y) - # WinAVR toolchain under Windows/Cygwin - CROSSDEV = avr- - WINTOOL = y - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mmcu=at90usb1286 - LDFLAGS += -nostartfiles -nodefaultlibs -endif - -ifeq ($(CONFIG_AVR_LINUXGCC),y) - # GCC toolchain under Linux - CROSSDEV = avr- - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mmcu=at90usb1286 - LDFLAGS += -nostartfiles -nodefaultlibs -endif - -ifeq ($(CONFIG_AVR_BUILDROOT),y) - # NuttX buildroot GCC toolchain under Linux or Cygwin - CROSSDEV = avr-nuttx-elf- - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mmcu=at90usb1286 - LDFLAGS += -nostartfiles -nodefaultlibs -endif +include ${TOPDIR}/arch/avr/src/avr/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/configs/teensy/usbstorage/Make.defs b/nuttx/configs/teensy/usbstorage/Make.defs index 6474a772e..ba3878521 100644 --- a/nuttx/configs/teensy/usbstorage/Make.defs +++ b/nuttx/configs/teensy/usbstorage/Make.defs @@ -35,33 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_AVR_WINAVR),y) - # WinAVR toolchain under Windows/Cygwin - CROSSDEV = avr- - WINTOOL = y - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mmcu=at90usb1286 - LDFLAGS += -nostartfiles -nodefaultlibs -endif - -ifeq ($(CONFIG_AVR_LINUXGCC),y) - # GCC toolchain under Linux - CROSSDEV = avr- - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mmcu=at90usb1286 - LDFLAGS += -nostartfiles -nodefaultlibs -endif - -ifeq ($(CONFIG_AVR_BUILDROOT),y) - # NuttX buildroot GCC toolchain under Linux or Cygwin - CROSSDEV = avr-nuttx-elf- - MAXOPTIMIZATION = -O2 - ARCHCPUFLAGS = -mmcu=at90usb1286 - LDFLAGS += -nostartfiles -nodefaultlibs -endif +include ${TOPDIR}/arch/avr/src/avr/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains diff --git a/nuttx/tools/incdir.bat b/nuttx/tools/incdir.bat index 093c5bd2e..f7383fc9a 100755 --- a/nuttx/tools/incdir.bat +++ b/nuttx/tools/incdir.bat @@ -36,14 +36,21 @@ rem rem Handle command line options set progname=%0 +set pathtype=user :ArgLoop -rem [-d] [-w] [-h]. [-w] and [-d] Ignored for compatibility with incdir.sh +rem [-d] [-w] [-s] [-h]. [-w] and [-d] Ignored for compatibility with incdir.sh if "%1"=="-d" goto :NextArg if "%1"=="-w" goto :NextArg if "%1"=="-h" goto :Usage + +if "%1"=="-s" ( + set pathtype=system + goto :NextArg +) + goto :CheckCompiler :NextArg @@ -97,21 +104,43 @@ if not exist %1 ( ) if "%fmt%"=="zds" goto :GenerateZdsPath +if "%response%"=="" goto :FirstStdPath +if "%pathtype%"=="system" goto :NextStdSystemPath -if "%response"=="" ( - set response=-I "%1" -) else ( - set response=%response% -I "%1" -) +set response=%response% -I "%1" +goto :EndOfDirLoop + +:NextStdSystemPath + +set response=%response% -isystem "%1" +goto :EndOfDirLoop + +:FirstStdPath + +if "%pathtype%"=="system" goto :FirstStdSystemPath +set response=-I "%1" +goto :EndOfDirLoop + +:FirstStdSystemPath + +set response=-isystem "%1" goto :EndOfDirLoop :GenerateZdsPath -if "%response"=="" ( - set response=-usrinc:%1 -) else ( - set response=%response%;%1 -) +if "%response%"=="" goto :FirstZdsPath +set response=%response%;%1 +goto :EndOfDirLoop + +:FirstZdsPath + +if "%pathtype%"=="system" goto :FirstZdsSystemPath +set response=-usrinc:%1 +goto :EndOfDirLoop + +:FirstZdsSystemPath + +set response=-stdinc:%1 :EndOfDirLoop shift @@ -120,7 +149,7 @@ goto :DirLoop :Usage echo %progname% is a tool for flexible generation of include path arguments for a echo variety of different compilers in a variety of compilation environments -echo USAGE: %progname% [-w] [-d] [-h] ^ ^ [^ [^ ...]] +echo USAGE: %progname% [-w] [-d] [-s] [-h] ^ ^ [^ [^ ...]] echo Where: echo ^ echo The full path to your compiler @@ -128,6 +157,9 @@ echo ^ [^ [^ ...]] echo A list of include directories echo -w, -d echo For compatibility with incdir.sh (ignored) +echo -s +echo Generate standard, system header file paths instead of normal user +echo header file paths. echo -h echo Shows this help text and exits. :End diff --git a/nuttx/tools/incdir.sh b/nuttx/tools/incdir.sh index 1e862aae1..af83f8517 100755 --- a/nuttx/tools/incdir.sh +++ b/nuttx/tools/incdir.sh @@ -36,6 +36,7 @@ progname=$0 wintool=n +pathtype=user usage="USAGE: $progname [-w] [-d] [-h] [ [ ...]]" advice="Try '$progname -h' for more information" @@ -47,6 +48,9 @@ while [ ! -z "$1" ]; do -w ) wintool=y ;; + -s ) + pathtype=system + ;; -h ) echo "$progname is a tool for flexible generation of include path arguments for a" echo "variety of different compilers in a variety of compilation environments" @@ -61,6 +65,9 @@ while [ ! -z "$1" ]; do echo " -w" echo " The compiler is a Windows native tool and requires Windows" echo " style pathnames like C:\\Program Files" + echo " -s" + echo " Generate standard, system header file paths instead of normal user" + echo " header file paths." echo " -d" echo " Enable script debug" echo " -h" @@ -158,11 +165,27 @@ exefile=`basename "$compiler"` # a special output format as well as special paths if [ "X$exefile" = "Xez8cc.exe" -o "X$exefile" = "Xzneocc.exe" -o "X$exefile" = "Xez80cc.exe" ]; then - fmt=userinc + fmt=zds else fmt=std fi +# Select system or user header file path command line option + +if [ "X$fmt" = "Xzds" ]; then + if [ "X$pathtype" = "Xsystem" ]; then + cmdarg=-stdinc: + else + cmdarg=-usrinc: + fi +else + if [ "X$pathtype" = "Xsystem" ]; then + cmdarg=-isystem + else + cmdarg=-I + fi +fi + # Now process each directory in the directory list unset response @@ -186,26 +209,26 @@ for dir in $dirlist; do # Handle the output using the selected format - if [ "X$fmt" = "Xuserinc" ]; then + if [ "X$fmt" = "Xzds" ]; then # Treat the first directory differently if [ -z "$response" ]; then - response="-usrinc:'"$path + response="${cmdarg}'"${path} else - response=$response":$path" + response=${response}":${path}" fi else # Treat the first directory differently if [ -z "$response" ]; then - response=-I\"$path\" + response="${cmdarg} \"$path\"" else - response=$response" -I\"$path\"" + response="${response} ${cmdarg} \"$path\"" fi fi done -if [ "X$fmt" = "Xuserinc" ]; then +if [ "X$fmt" = "Xzds" ]; then response=$response"'" fi -- cgit v1.2.3 From 24b649553719312f79127bba841818a43a00fd8a Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 23 Nov 2012 15:49:06 +0000 Subject: Several changes (mostly graphics related) from Petteri Aimonen git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5385 42af7a65-404d-4744-a932-0658087f49c3 --- NxWidgets/ChangeLog.txt | 4 +++- NxWidgets/libnxwidgets/src/cnumericedit.cxx | 8 +++++--- NxWidgets/libnxwidgets/src/ctext.cxx | 3 +++ nuttx/ChangeLog | 6 ++++++ nuttx/arch/arm/src/stm32/chip/stm32_flash.h | 1 + nuttx/arch/arm/src/stm32/stm32_serial.c | 10 +++++----- nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c | 2 +- nuttx/graphics/nxglib/nxglib_splitline.c | 7 +++++-- nuttx/graphics/nxtk/nxtk_filltrapwindow.c | 11 +++++++++-- 9 files changed, 38 insertions(+), 14 deletions(-) (limited to 'nuttx') diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt index f932d5bc2..c3ae00d6a 100644 --- a/NxWidgets/ChangeLog.txt +++ b/NxWidgets/ChangeLog.txt @@ -211,4 +211,6 @@ using the internal work queues from user space. I have decided to implemented user-space work queues (someday) in order to accomplish that functionaliy. Submitted by Petteri Aimonen. - +* NxWidgets:CText and NxWidgets:CNumericEdite: Fix some memory freeing bugs + (from Petteri Aimonen). + \ No newline at end of file diff --git a/NxWidgets/libnxwidgets/src/cnumericedit.cxx b/NxWidgets/libnxwidgets/src/cnumericedit.cxx index e0df014c5..993e86fb8 100644 --- a/NxWidgets/libnxwidgets/src/cnumericedit.cxx +++ b/NxWidgets/libnxwidgets/src/cnumericedit.cxx @@ -158,9 +158,11 @@ CNumericEdit::CNumericEdit(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_ CNumericEdit::~CNumericEdit() { - delete m_label; - delete m_button_minus; - delete m_button_plus; + // CNxWidget destroys all children + + m_label = 0; + m_button_minus = 0; + m_button_plus = 0; } void CNumericEdit::getPreferredDimensions(CRect &rect) const diff --git a/NxWidgets/libnxwidgets/src/ctext.cxx b/NxWidgets/libnxwidgets/src/ctext.cxx index 688031d88..caa0c02e8 100644 --- a/NxWidgets/libnxwidgets/src/ctext.cxx +++ b/NxWidgets/libnxwidgets/src/ctext.cxx @@ -276,11 +276,14 @@ const int CText::getLineTrimmedLength(const int lineNumber) const length--; } while (iterator->moveToPrevious() && (length > 0)); + + delete iterator; return length; } // May occur if data has been horribly corrupted somewhere + delete iterator; return 0; } diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 6fad0d0ba..bf7e05168 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3675,3 +3675,9 @@ file paths. * nuttx/arch/arm/src/arm/Toolchain.defs: Add support for more ARM toolchains (from Mike Smith). + * arch/arm/src/stm32/stm32f40xxx_rcc.c: Enabled FLASH prefetch (from Petteri + Aimonen). + * graphics/nxtk/nxtk_filltrapwindow.c: Correct an offset problem (from + Peterri Aimonen). + * graphics/nxglib/nxglib_splitline.c: Fix error in drawing of near horizontal + lines (from Peterri Aimonen). diff --git a/nuttx/arch/arm/src/stm32/chip/stm32_flash.h b/nuttx/arch/arm/src/stm32/chip/stm32_flash.h index c2e440923..d6fcecc11 100644 --- a/nuttx/arch/arm/src/stm32/chip/stm32_flash.h +++ b/nuttx/arch/arm/src/stm32/chip/stm32_flash.h @@ -110,6 +110,7 @@ # define FLASH_ACR_HLFCYA (1 << 3) /* FLASH half cycle access */ # define FLASH_ACR_PRTFBE (1 << 4) /* FLASH prefetch enable */ #elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) +# define FLASH_ACR_PRFTEN (1 << 8) /* FLASH prefetch enable */ # define FLASH_ACR_ICEN (1 << 9) /* Bit 9: Instruction cache enable */ # define FLASH_ACR_DCEN (1 << 10) /* Bit 10: Data cache enable */ # define FLASH_ACR_ICRST (1 << 11) /* Bit 11: Instruction cache reset */ diff --git a/nuttx/arch/arm/src/stm32/stm32_serial.c b/nuttx/arch/arm/src/stm32/stm32_serial.c index 6c1861ef8..c7f97b25a 100644 --- a/nuttx/arch/arm/src/stm32/stm32_serial.c +++ b/nuttx/arch/arm/src/stm32/stm32_serial.c @@ -101,11 +101,11 @@ */ # if (defined(CONFIG_USART1_RXDMA) && defined(CONFIG_USART1_RS485)) || \ - (defined(CONFIG_USART2_RXDMA) && defined(CONFIG_USART2_RS485)) || \ - (defined(CONFIG_USART3_RXDMA) && defined(CONFIG_USART3_RS485)) || \ - (defined(CONFIG_UART4_RXDMA) && defined(CONFIG_UART4_RS485)) || \ - (defined(CONFIG_UART5_RXDMA) && defined(CONFIG_UART5_RS485)) || \ - (defined(CONFIG_USART6_RXDMA) && defined(CONFIG_USART6_RS485)) \ + (defined(CONFIG_USART2_RXDMA) && defined(CONFIG_USART2_RS485)) || \ + (defined(CONFIG_USART3_RXDMA) && defined(CONFIG_USART3_RS485)) || \ + (defined(CONFIG_UART4_RXDMA) && defined(CONFIG_UART4_RS485)) || \ + (defined(CONFIG_UART5_RXDMA) && defined(CONFIG_UART5_RS485)) || \ + (defined(CONFIG_USART6_RXDMA) && defined(CONFIG_USART6_RS485)) # error "RXDMA and RS-485 cannot be enabled at the same time for the same U[S]ART" # endif diff --git a/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c b/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c index 45980f288..14ee1e754 100644 --- a/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c +++ b/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c @@ -633,7 +633,7 @@ static void stm32_stdclockconfig(void) /* Enable FLASH prefetch, instruction cache, data cache, and 5 wait states */ - regval = (FLASH_ACR_LATENCY_5 | FLASH_ACR_ICEN | FLASH_ACR_DCEN); + regval = (FLASH_ACR_LATENCY_5 | FLASH_ACR_ICEN | FLASH_ACR_DCEN | FLASH_ACR_PRFTEN); putreg32(regval, STM32_FLASH_ACR); /* Select the main PLL as system clock source */ diff --git a/nuttx/graphics/nxglib/nxglib_splitline.c b/nuttx/graphics/nxglib/nxglib_splitline.c index 84892b67e..cbf2d5ff3 100644 --- a/nuttx/graphics/nxglib/nxglib_splitline.c +++ b/nuttx/graphics/nxglib/nxglib_splitline.c @@ -41,6 +41,7 @@ #include #include +#include #include @@ -192,9 +193,11 @@ int nxgl_splitline(FAR struct nxgl_vector_s *vector, /* The final degenerate case */ - if (linewidth == 1) + if (linewidth == 1 && + abs(line.pt2.x - line.pt1.x) < (line.pt2.y - line.pt1.y)) { - /* A line of width 1 is basically a single parallelogram of width 1 */ + /* A close to vertical line of width 1 is basically + * a single parallelogram of width 1 */ traps[1].top.x1 = itob16(line.pt1.x); traps[1].top.x2 = traps[1].top.x1; diff --git a/nuttx/graphics/nxtk/nxtk_filltrapwindow.c b/nuttx/graphics/nxtk/nxtk_filltrapwindow.c index c1032f1e7..55c051ffd 100644 --- a/nuttx/graphics/nxtk/nxtk_filltrapwindow.c +++ b/nuttx/graphics/nxtk/nxtk_filltrapwindow.c @@ -94,6 +94,7 @@ int nxtk_filltrapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoid_s *tra { FAR struct nxtk_framedwindow_s *fwnd = (FAR struct nxtk_framedwindow_s *)hfwnd; struct nxgl_rect_s relclip; + struct nxgl_trapezoid_s reltrap; #ifdef CONFIG_DEBUG if (!hfwnd || !trap || !color) @@ -103,8 +104,14 @@ int nxtk_filltrapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoid_s *tra } #endif - /* Perform the fill, clipping to the client window */ + /* Move the trapezoid from window contents area to window area */ + nxgl_trapoffset(&reltrap, trap, + fwnd->fwrect.pt1.x - fwnd->wnd.bounds.pt1.x, + fwnd->fwrect.pt1.y - fwnd->wnd.bounds.pt1.y); + + /* Perform the fill, clipping to the client window */ nxgl_rectoffset(&relclip, &fwnd->fwrect, -fwnd->wnd.bounds.pt1.x, -fwnd->wnd.bounds.pt1.y); - return nx_filltrapezoid((NXWINDOW)hfwnd, &relclip, trap, color); + + return nx_filltrapezoid((NXWINDOW)hfwnd, &relclip, &reltrap, color); } -- cgit v1.2.3 From 632d7a57b137ee963d58c9853eb9c4b9d66a586e Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 25 Nov 2012 18:00:40 +0000 Subject: Fixe task_exithook() bug; fix timer usage in STM32 OTGFS host driver git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5386 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 6 ++++ nuttx/arch/arm/src/stm32/stm32_otgfshost.c | 53 +++++++++++++++++------------- nuttx/sched/task_exithook.c | 1 + 3 files changed, 37 insertions(+), 23 deletions(-) (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index bf7e05168..f17863557 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3681,3 +3681,9 @@ Peterri Aimonen). * graphics/nxglib/nxglib_splitline.c: Fix error in drawing of near horizontal lines (from Peterri Aimonen). + * sched/task_exithook.c: Missing right bracket with certain conditional + compilation (thanks James Goppert). + * arch/arm/srch/stm32/stm32_otgfshost.c: Replace timeout handling; use + system tick instead of frame counter. The frame counter gets rset to + zero at 0x3fff making it error prone. + diff --git a/nuttx/arch/arm/src/stm32/stm32_otgfshost.c b/nuttx/arch/arm/src/stm32/stm32_otgfshost.c index 02b12ec87..80a9392dc 100644 --- a/nuttx/arch/arm/src/stm32/stm32_otgfshost.c +++ b/nuttx/arch/arm/src/stm32/stm32_otgfshost.c @@ -51,6 +51,7 @@ #include #include +#include #include #include @@ -149,8 +150,8 @@ #define STM32_READY_DELAY 200000 /* In loop counts */ #define STM32_FLUSH_DELAY 200000 /* In loop counts */ -#define STM32_SETUP_DELAY 5000 /* In frames */ -#define STM32_DATANAK_DELAY 5000 /* In frames */ +#define STM32_SETUP_DELAY (5000 / MSEC_PER_TICK) /* 5 seconds in system ticks */ +#define STM32_DATANAK_DELAY (5000 / MSEC_PER_TICK) /* 5 seconds in system ticks */ /* Ever-present MIN/MAX macros */ @@ -305,7 +306,9 @@ static void stm32_chan_wakeup(FAR struct stm32_usbhost_s *priv, /* Control/data transfer logic *************************************************/ static void stm32_transfer_start(FAR struct stm32_usbhost_s *priv, int chidx); +#if 0 /* Not used */ static inline uint16_t stm32_getframe(void); +#endif static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv, FAR const struct usb_ctrlreq_s *req); static int stm32_ctrl_senddata(FAR struct stm32_usbhost_s *priv, @@ -1182,14 +1185,18 @@ static void stm32_transfer_start(FAR struct stm32_usbhost_s *priv, int chidx) * Name: stm32_getframe * * Description: - * Get the current frame number. + * Get the current frame number. The frame number (FRNUM) field increments + * when a new SOF is transmitted on the USB, and is cleared to 0 when it + * reaches 0x3fff. * *******************************************************************************/ +#if 0 /* Not used */ static inline uint16_t stm32_getframe(void) { return (uint16_t)(stm32_getreg(STM32_OTGFS_HFNUM) & OTGFS_HFNUM_FRNUM_MASK); } +#endif /******************************************************************************* * Name: stm32_ctrl_sendsetup @@ -1203,14 +1210,14 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv, FAR const struct usb_ctrlreq_s *req) { FAR struct stm32_chan_s *chan; - uint16_t start; - uint16_t elapsed; + uint32_t start; + uint32_t elapsed; int ret; /* Loop while the device reports NAK (and a timeout is not exceeded */ chan = &priv->chan[priv->ep0out]; - start = stm32_getframe(); + start = clock_systimer(); do { @@ -1258,7 +1265,7 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv, /* Get the elapsed time (in frames) */ - elapsed = stm32_getframe() - start; + elapsed = clock_systimer() - start; } while (elapsed < STM32_SETUP_DELAY); @@ -1367,8 +1374,8 @@ static int stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx, FAR uint8_t *buffer, size_t buflen) { FAR struct stm32_chan_s *chan; - uint16_t start; - uint16_t elapsed; + uint32_t start; + uint32_t elapsed; int ret = OK; /* Loop until the transfer completes (i.e., buflen is decremented to zero) @@ -1379,7 +1386,7 @@ static int stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx, chan->buffer = buffer; chan->buflen = buflen; - start = stm32_getframe(); + start = clock_systimer(); while (chan->buflen > 0) { /* Set up for the wait BEFORE starting the transfer */ @@ -1447,7 +1454,7 @@ static int stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx, * buffer pointer and buffer size will be unaltered. */ - elapsed = stm32_getframe() - start; + elapsed = clock_systimer() - start; if (ret != -EAGAIN || /* Not a NAK condition OR */ elapsed >= STM32_DATANAK_DELAY || /* Timeout has elapsed OR */ chan->buflen != buflen) /* Data has been partially transferred */ @@ -1474,8 +1481,8 @@ static int stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, FAR uint8_t *buffer, size_t buflen) { FAR struct stm32_chan_s *chan; - uint16_t start; - uint16_t elapsed; + uint32_t start; + uint32_t elapsed; size_t xfrlen; int ret = OK; @@ -1484,7 +1491,7 @@ static int stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, */ chan = &priv->chan[chidx]; - start = stm32_getframe(); + start = clock_systimer(); while (buflen > 0) { @@ -1569,7 +1576,7 @@ static int stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx, * buffer pointer and buffer size will be unaltered. */ - elapsed = stm32_getframe() - start; + elapsed = clock_systimer() - start; if (ret != -EAGAIN || /* Not a NAK condition OR */ elapsed >= STM32_DATANAK_DELAY || /* Timeout has elapsed OR */ chan->buflen != xfrlen) /* Data has been partially transferred */ @@ -3540,8 +3547,8 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, { struct stm32_usbhost_s *priv = (struct stm32_usbhost_s *)drvr; uint16_t buflen; - uint16_t start; - uint16_t elapsed; + uint32_t start; + uint32_t elapsed; int retries; int ret; @@ -3573,7 +3580,7 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, /* Get the start time. Loop again until the timeout expires */ - start = stm32_getframe(); + start = clock_systimer(); do { /* Handle the IN data phase (if any) */ @@ -3606,7 +3613,7 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, /* Get the elapsed time (in frames) */ - elapsed = stm32_getframe() - start; + elapsed = clock_systimer() - start; } while (elapsed < STM32_DATANAK_DELAY); } @@ -3623,8 +3630,8 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, { struct stm32_usbhost_s *priv = (struct stm32_usbhost_s *)drvr; uint16_t buflen; - uint16_t start; - uint16_t elapsed; + uint32_t start; + uint32_t elapsed; int retries; int ret; @@ -3658,7 +3665,7 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, /* Get the start time. Loop again until the timeout expires */ - start = stm32_getframe(); + start = clock_systimer(); do { /* Handle the data OUT phase (if any) */ @@ -3693,7 +3700,7 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, /* Get the elapsed time (in frames) */ - elapsed = stm32_getframe() - start; + elapsed = clock_systimer() - start; } while (elapsed < STM32_DATANAK_DELAY); } diff --git a/nuttx/sched/task_exithook.c b/nuttx/sched/task_exithook.c index 6f52ef739..3bde8fb7a 100644 --- a/nuttx/sched/task_exithook.c +++ b/nuttx/sched/task_exithook.c @@ -126,6 +126,7 @@ static inline void task_atexit(FAR _TCB *tcb) tcb->atexitfunc = NULL; } #endif +} #else # define task_atexit(tcb) #endif -- cgit v1.2.3 From 7a88e307e8a013e8f3a99e8fa20f5daf08482d62 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 25 Nov 2012 20:58:39 +0000 Subject: A few native window build updates git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5387 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/Makefile.unix | 12 +++--- nuttx/Makefile.win | 12 +++--- nuttx/TODO | 25 +++++++----- nuttx/arch/z80/src/Makefile.zdsii | 2 +- nuttx/configs/ez80f910200kitg/README.txt | 18 +++++++-- nuttx/configs/ez80f910200kitg/ostest/defconfig | 3 +- nuttx/configs/ez80f910200kitg/ostest/setenv.bat | 50 ------------------------ nuttx/configs/ez80f910200kitg/scripts/setenv.bat | 50 ++++++++++++++++++++++++ nuttx/configs/ez80f910200zco/scripts/setenv.bat | 50 ++++++++++++++++++++++++ nuttx/drivers/Makefile | 32 +++++++-------- nuttx/drivers/analog/Make.defs | 4 +- nuttx/drivers/bch/Make.defs | 2 +- nuttx/drivers/input/Make.defs | 2 +- nuttx/drivers/lcd/Make.defs | 2 +- nuttx/drivers/mmcsd/Make.defs | 2 +- nuttx/drivers/power/Make.defs | 4 +- nuttx/drivers/sensors/Make.defs | 2 +- nuttx/drivers/usbdev/Make.defs | 2 +- nuttx/drivers/usbhost/Make.defs | 4 +- nuttx/drivers/wireless/Make.defs | 6 +-- 20 files changed, 176 insertions(+), 108 deletions(-) delete mode 100644 nuttx/configs/ez80f910200kitg/ostest/setenv.bat create mode 100644 nuttx/configs/ez80f910200kitg/scripts/setenv.bat create mode 100644 nuttx/configs/ez80f910200zco/scripts/setenv.bat (limited to 'nuttx') diff --git a/nuttx/Makefile.unix b/nuttx/Makefile.unix index 78c34c2de..5ecdabb64 100644 --- a/nuttx/Makefile.unix +++ b/nuttx/Makefile.unix @@ -359,7 +359,7 @@ tools/mkdeps$(HOSTEXEEXT): include/apps: Make.defs ifneq ($(APPDIR),) - @echo "LN: include/apps -> $(APPDIR)/include" + @echo "LN: include/apps to $(APPDIR)/include" $(Q) if [ -d $(TOPDIR)/$(APPDIR)/include ]; then \ $(DIRLINK) $(TOPDIR)/$(APPDIR)/include include/apps; \ fi @@ -368,26 +368,26 @@ endif # Link the arch//include directory to include/arch include/arch: Make.defs - @echo "LN: include/arch -> $(ARCH_DIR)/include" + @echo "LN: include/arch to $(ARCH_DIR)/include" $(Q) $(DIRLINK) $(TOPDIR)/$(ARCH_DIR)/include include/arch # Link the configs//include directory to include/arch/board include/arch/board: include/arch Make.defs include/arch - @echo "LN: include/arch/board -> $(BOARD_DIR)/include" + @echo "LN: include/arch/board to $(BOARD_DIR)/include" $(Q) $(DIRLINK) $(TOPDIR)/$(BOARD_DIR)/include include/arch/board # Link the configs//src dir to arch//src/board $(ARCH_SRC)/board: Make.defs - @echo "LN: $(ARCH_SRC)/board -> $(BOARD_DIR)/src" + @echo "LN: $(ARCH_SRC)/board to $(BOARD_DIR)/src" $(Q) $(DIRLINK) $(TOPDIR)/$(BOARD_DIR)/src $(ARCH_SRC)/board # Link arch//include/ to arch//include/chip $(ARCH_SRC)/chip: Make.defs ifneq ($(CONFIG_ARCH_CHIP),) - @echo "LN: $(ARCH_SRC)/chip -> $(ARCH_SRC)/$(CONFIG_ARCH_CHIP)" + @echo "LN: $(ARCH_SRC)/chip to $(ARCH_SRC)/$(CONFIG_ARCH_CHIP)" $(Q) $(DIRLINK) $(TOPDIR)/$(ARCH_SRC)/$(CONFIG_ARCH_CHIP) $(ARCH_SRC)/chip endif @@ -395,7 +395,7 @@ endif include/arch/chip: include/arch Make.defs ifneq ($(CONFIG_ARCH_CHIP),) - @echo "LN: include/arch/chip -> $(ARCH_INC)/$(CONFIG_ARCH_CHIP)" + @echo "LN: include/arch/chip to $(ARCH_INC)/$(CONFIG_ARCH_CHIP)" $(Q) $(DIRLINK) $(TOPDIR)/$(ARCH_INC)/$(CONFIG_ARCH_CHIP) include/arch/chip endif diff --git a/nuttx/Makefile.win b/nuttx/Makefile.win index 6257dbdc8..34da12ad0 100644 --- a/nuttx/Makefile.win +++ b/nuttx/Makefile.win @@ -352,7 +352,7 @@ tools\mkdeps$(HOSTEXEEXT): include\apps: Make.defs ifneq ($(APPDIR),) - @echo "LN: include\apps $(APPDIR)\include" + @echo LN: include\apps $(APPDIR)\include ifeq ($(CONFIG_WINDOWS_MKLINK),y) $(Q) /user:administrator mklink /d include\apps $(APPDIR)\include else @@ -364,7 +364,7 @@ endif # Link the arch\\include directory to include\arch include\arch: Make.defs - @echo "LN: include\arch -> $(ARCH_DIR)\include" + @echo LN: include\arch to $(ARCH_DIR)\include ifeq ($(CONFIG_WINDOWS_MKLINK),y) $(Q) /user:administrator mklink /d include\arch $(TOPDIR)\$(ARCH_DIR)\include else @@ -375,7 +375,7 @@ endif # Link the configs\\include directory to include\arch\board include\arch\board: include\arch Make.defs include\arch - @echo "LN: include\arch\board -> $(BOARD_DIR)\include" + @echo LN: include\arch\board to $(BOARD_DIR)\include ifeq ($(CONFIG_WINDOWS_MKLINK),y) $(Q) /user:administrator mklink /d include\arch\board $(TOPDIR)\$(BOARD_DIR)\include else @@ -386,7 +386,7 @@ endif # Link the configs\\src dir to arch\\src\board $(ARCH_SRC)\board: Make.defs - @echo "LN: $(ARCH_SRC)\board -> $(BOARD_DIR)\src" + @echo LN: $(ARCH_SRC)\board to $(BOARD_DIR)\src ifeq ($(CONFIG_WINDOWS_MKLINK),y) $(Q) /user:administrator mklink /d $(ARCH_SRC)\board $(TOPDIR)\$(BOARD_DIR)\src else @@ -398,7 +398,7 @@ endif $(ARCH_SRC)\chip: Make.defs ifneq ($(CONFIG_ARCH_CHIP),) - @echo "LN: $(ARCH_SRC)\chip -> $(ARCH_SRC)\$(CONFIG_ARCH_CHIP)" + @echo LN: $(ARCH_SRC)\chip to $(ARCH_SRC)\$(CONFIG_ARCH_CHIP) ifeq ($(CONFIG_WINDOWS_MKLINK),y) $(Q) /user:administrator mklink /d $(ARCH_SRC)\chip $(TOPDIR)\$(ARCH_SRC)\$(CONFIG_ARCH_CHIP) else @@ -411,7 +411,7 @@ endif include\arch\chip: include\arch Make.defs ifneq ($(CONFIG_ARCH_CHIP),) - @echo "LN: include\arch\chip -> $(ARCH_INC)\$(CONFIG_ARCH_CHIP)" + @echo LN: include\arch\chip to $(ARCH_INC)\$(CONFIG_ARCH_CHIP) ifeq ($(CONFIG_WINDOWS_MKLINK),y) $(Q) /user:administrator mklink /d include\arch\chip $(TOPDIR)\$(ARCH_INC)\$(CONFIG_ARCH_CHIP) else diff --git a/nuttx/TODO b/nuttx/TODO index 28ffa1387..fcc418a0e 100644 --- a/nuttx/TODO +++ b/nuttx/TODO @@ -1,4 +1,4 @@ -NuttX TODO List (Last updated September 16, 2012) +NuttX TODO List (Last updated November 25, 2012) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This file summarizes known NuttX bugs, limitations, inconsistencies with @@ -895,23 +895,30 @@ o Build system Description: Need a NuttX configuration tool. The number of configuration settings has become quite large and difficult to manage manually. Update: This task is essentially completed. But probably not for - all platforms and all features. When do we know that the the - features is complete and that we can switch to exclusive use of - the tool? + all platforms and all features. When do we know that the feature + is complete and that we can switch to exclusive use of the tool? Status: Open Priority: Medium-low Title: NATIVE WINDOWS BUILD - Description: At present, NuttX builds only under Linux or Cygwin. - Investigate the possibility of a native Windows build using - something like the GNUWin32 tools (coreutils+make+grep+sed+uname). + Description: This effort is underway using MinGW-GCC and GNUWin32 tools + for (coreutils+make+grep+sed+uname). Current status: + + 1. configs/stm32f4discovery/winbuild - builds okay natively + 2. configs/ez80f910200kitg - Can be reconfigured to build natively. + Requires some manual intervention to get a clean build. + See configs/ez80f910200kitg/README.txt. + Status: Open Priority: Low Title: WINDOWS DEPENDENCY GENERATION Description: Dependency generation is currently disabled when a Windows native - toolchain is used. I think that the only issue is that all of the - Windows dependencies needed to be quoted in the Make.dep files. + toolchain is used in a POSIX-like enviornment (like Cygwin). The + issue is that the Windows tool generates dependencies use Windows + path formatting and this fails with the dependency file (Make.dep) + is include). Perhaps the only issue is that all of the Windows + dependencies needed to be quoted in the Make.dep files. Status: Open Priority: Low -- unless some dependency-related build issues is discovered. diff --git a/nuttx/arch/z80/src/Makefile.zdsii b/nuttx/arch/z80/src/Makefile.zdsii index 7a145017c..a3c6639f5 100644 --- a/nuttx/arch/z80/src/Makefile.zdsii +++ b/nuttx/arch/z80/src/Makefile.zdsii @@ -106,7 +106,7 @@ nuttx.linkcmd: $(LINKCMDTEMPLATE) ifeq ($(CONFIG_WINDOWS_NATIVE),y) @echo "$(TOPDIR)\nuttx"= \>>nuttx.linkcmd @echo "$(ARCHSRCDIR)\$(HEAD_OBJ)", \>>nuttx.linkcmd - $(Q) for %%G in ($(LINKLIBS)) do ( echo "$(TOPDIR)\lib\%%G", \>>nuttx.linkcmd ) + $(Q) for %%G in ($(LINKLIBS)) do ( echo "$(TOPDIR)\lib\%%G", \>>nuttx.linkcmd ) @echo "$(ARCHSRCDIR)\board\libboard$(LIBEXT)", \>>nuttx.linkcmd ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) @echo "$(ZDSSTDLIBDIR)\chelprevaaD$(LIBEXT)", \>>nuttx.linkcmd diff --git a/nuttx/configs/ez80f910200kitg/README.txt b/nuttx/configs/ez80f910200kitg/README.txt index 222a25db1..004f607d4 100644 --- a/nuttx/configs/ez80f910200kitg/README.txt +++ b/nuttx/configs/ez80f910200kitg/README.txt @@ -107,8 +107,20 @@ available: CONFIG_APPS_DIR="..\apps" - NOTE: If you need to change the toolchain path used in Make.defs, - you will need to use the short 8.3 filenames to avoid spaces. On - my change C:\PROGRA~1\ is C:\PROGRA~2\ is C:\Program Files (x86)\ + NOTES: + + a. If you need to change the toolchain path used in Make.defs, you + will need to use the short 8.3 filenames to avoid spaces. On my + PC, C:\PROGRA~1\ is is C:\Program Files\ and C:\PROGRA~2\ is + C:\Program Files (x86)\ + b. You can't use setenv.sh in the native Windows environment. Try + scripts/setenv.bat instead. + c. At present, the native Windows build fails at the final link stages. + The failure is due to problems in arch/z80/src/nuttx/linkcmd that + is autogenerated by arch/z80/src/Makefile.zdsii. The basic program + is the spurious spaces and and carrirage returns are generated at + the end of the lines after a line continuation (\ ^M). If these + trailing bad characters are manually eliminated, then the build + will succeed on the next try. Check out any README.txt files in these s. diff --git a/nuttx/configs/ez80f910200kitg/ostest/defconfig b/nuttx/configs/ez80f910200kitg/ostest/defconfig index e061e6289..757916281 100644 --- a/nuttx/configs/ez80f910200kitg/ostest/defconfig +++ b/nuttx/configs/ez80f910200kitg/ostest/defconfig @@ -232,11 +232,10 @@ CONFIG_MMCSD_SDIO=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_LOWLEVEL_CONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART0=y CONFIG_MCU_SERIAL=y -CONFIG_STANDARD_SERIAL=y CONFIG_UART0_SERIAL_CONSOLE=y # CONFIG_NO_SERIAL_CONSOLE is not set diff --git a/nuttx/configs/ez80f910200kitg/ostest/setenv.bat b/nuttx/configs/ez80f910200kitg/ostest/setenv.bat deleted file mode 100644 index f461cf1cc..000000000 --- a/nuttx/configs/ez80f910200kitg/ostest/setenv.bat +++ /dev/null @@ -1,50 +0,0 @@ -@echo off - -rem configs/ez80f810200kitg/ostest/setenv.bat -rem -rem Copyright (C) 2012 Gregory Nutt. All rights reserved. -rem Author: Gregory Nutt -rem -rem Redistribution and use in source and binary forms, with or without -rem modification, are permitted provided that the following conditions -rem are met: -rem -rem 1. Redistributions of source code must retain the above copyright -rem notice, this list of conditions and the following disclaimer. -rem 2. Redistributions in binary form must reproduce the above copyright -rem notice, this list of conditions and the following disclaimer in -rem the documentation and/or other materials provided with the -rem distribution. -rem 3. Neither the name NuttX nor the names of its contributors may be -rem used to endorse or promote products derived from this software -rem without specific prior written permission. -rem -rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -rem POSSIBILITY OF SUCH DAMAGE. - -rem This is the location where I installed in the MinGW compiler. With -rem this configuration, it is recommended that you do NOT install the -rem MSYS tools; they conflict with the GNUWin32 tools. See -rem http://www.mingw.org/ for further info. - -set PATH=C:\MinGW\bin;%PATH% - -rem This is the location where I installed the ZDS-II toolchain. - -set PATH=C:\Program Files (x86)\ZiLOG\ZDSII_eZ80Acclaim!_5.1.1\bin;%PATH% - -rem This is the location where I installed the GNUWin32 tools. See -rem http://gnuwin32.sourceforge.net/. - -set PATH=C:\gnuwin32\bin;%PATH% -echo %PATH% diff --git a/nuttx/configs/ez80f910200kitg/scripts/setenv.bat b/nuttx/configs/ez80f910200kitg/scripts/setenv.bat new file mode 100644 index 000000000..3a1b987b4 --- /dev/null +++ b/nuttx/configs/ez80f910200kitg/scripts/setenv.bat @@ -0,0 +1,50 @@ +@echo off + +rem configs/ez80f810200kitg/scripts/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the ZDS-II toolchain. + +set PATH=C:\Program Files (x86)\ZiLOG\ZDSII_eZ80Acclaim!_5.1.1\bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% +echo %PATH% diff --git a/nuttx/configs/ez80f910200zco/scripts/setenv.bat b/nuttx/configs/ez80f910200zco/scripts/setenv.bat new file mode 100644 index 000000000..88fc6cbf3 --- /dev/null +++ b/nuttx/configs/ez80f910200zco/scripts/setenv.bat @@ -0,0 +1,50 @@ +@echo off + +rem configs/ez80f910200zco/scripts/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the ZDS-II toolchain. + +set PATH=C:\Program Files (x86)\ZiLOG\ZDSII_eZ80Acclaim!_5.1.1\bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% +echo %PATH% diff --git a/nuttx/drivers/Makefile b/nuttx/drivers/Makefile index 13a507823..b2bf1b611 100644 --- a/nuttx/drivers/Makefile +++ b/nuttx/drivers/Makefile @@ -48,22 +48,22 @@ VPATH = . # files to the source file list, add its DEPPATH info, and will add # the appropriate paths to the VPATH variable -include analog/Make.defs -include bch/Make.defs -include input/Make.defs -include lcd/Make.defs -include mmcsd/Make.defs -include mtd/Make.defs -include net/Make.defs -include pipes/Make.defs -include power/Make.defs -include sensors/Make.defs -include sercomm/Make.defs -include serial/Make.defs -include syslog/Make.defs -include usbdev/Make.defs -include usbhost/Make.defs -include wireless/Make.defs +include analog$(DELIM)Make.defs +include bch$(DELIM)Make.defs +include input$(DELIM)Make.defs +include lcd$(DELIM)Make.defs +include mmcsd$(DELIM)Make.defs +include mtd$(DELIM)Make.defs +include net$(DELIM)Make.defs +include pipes$(DELIM)Make.defs +include power$(DELIM)Make.defs +include sensors$(DELIM)Make.defs +include sercomm$(DELIM)Make.defs +include serial$(DELIM)Make.defs +include syslog$(DELIM)Make.defs +include usbdev$(DELIM)Make.defs +include usbhost$(DELIM)Make.defs +include wireless$(DELIM)Make.defs ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) CSRCS += dev_null.c dev_zero.c loop.c diff --git a/nuttx/drivers/analog/Make.defs b/nuttx/drivers/analog/Make.defs index 425193f7e..89cc5bd3f 100644 --- a/nuttx/drivers/analog/Make.defs +++ b/nuttx/drivers/analog/Make.defs @@ -76,12 +76,12 @@ endif ifeq ($(CONFIG_DAC),y) DEPPATH += --dep-path analog VPATH += :analog - CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/analog} + CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)analog} else ifeq ($(CONFIG_ADC),y) DEPPATH += --dep-path analog VPATH += :analog - CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/analog} + CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)analog} endif endif diff --git a/nuttx/drivers/bch/Make.defs b/nuttx/drivers/bch/Make.defs index 2745fcfff..78dfbff30 100644 --- a/nuttx/drivers/bch/Make.defs +++ b/nuttx/drivers/bch/Make.defs @@ -46,7 +46,7 @@ CSRCS += bchlib_setup.c bchlib_teardown.c bchlib_read.c bchlib_write.c \ DEPPATH += --dep-path bch VPATH += :bch -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/bch} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)bch} endif endif diff --git a/nuttx/drivers/input/Make.defs b/nuttx/drivers/input/Make.defs index 8afd76f89..10e6db62f 100644 --- a/nuttx/drivers/input/Make.defs +++ b/nuttx/drivers/input/Make.defs @@ -71,6 +71,6 @@ endif DEPPATH += --dep-path input VPATH += :input -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/input} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)input} endif diff --git a/nuttx/drivers/lcd/Make.defs b/nuttx/drivers/lcd/Make.defs index 8b6d30052..1b445b6a7 100644 --- a/nuttx/drivers/lcd/Make.defs +++ b/nuttx/drivers/lcd/Make.defs @@ -67,6 +67,6 @@ endif DEPPATH += --dep-path lcd VPATH += :lcd -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/lcd} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)lcd} endif diff --git a/nuttx/drivers/mmcsd/Make.defs b/nuttx/drivers/mmcsd/Make.defs index 0ba5efb7f..06e689c75 100644 --- a/nuttx/drivers/mmcsd/Make.defs +++ b/nuttx/drivers/mmcsd/Make.defs @@ -49,7 +49,7 @@ endif DEPPATH += --dep-path mmcsd VPATH += :mmcsd -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/mmcsd} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)mmcsd} endif diff --git a/nuttx/drivers/power/Make.defs b/nuttx/drivers/power/Make.defs index 9e6307ae2..e3452120d 100644 --- a/nuttx/drivers/power/Make.defs +++ b/nuttx/drivers/power/Make.defs @@ -47,7 +47,7 @@ CSRCS += pm_activity.c pm_changestate.c pm_checkstate.c pm_initialize.c pm_regis POWER_DEPPATH := --dep-path power POWER_VPATH := :power -POWER_CFLAGS := ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/power} +POWER_CFLAGS := ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)power} endif @@ -73,7 +73,7 @@ endif POWER_DEPPATH := --dep-path power POWER_VPATH := :power -POWER_CFLAGS := ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/power} +POWER_CFLAGS := ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)power} endif diff --git a/nuttx/drivers/sensors/Make.defs b/nuttx/drivers/sensors/Make.defs index 17750831e..1713edb99 100644 --- a/nuttx/drivers/sensors/Make.defs +++ b/nuttx/drivers/sensors/Make.defs @@ -57,4 +57,4 @@ endif DEPPATH += --dep-path sensors VPATH += :sensors -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/sensors} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)sensors} diff --git a/nuttx/drivers/usbdev/Make.defs b/nuttx/drivers/usbdev/Make.defs index 782c18545..e43693b29 100644 --- a/nuttx/drivers/usbdev/Make.defs +++ b/nuttx/drivers/usbdev/Make.defs @@ -59,5 +59,5 @@ CSRCS += usbdev_trace.c usbdev_trprintf.c DEPPATH += --dep-path usbdev VPATH += :usbdev -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/usbdev} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)usbdev} endif diff --git a/nuttx/drivers/usbhost/Make.defs b/nuttx/drivers/usbhost/Make.defs index 91753ef31..ebb522695 100644 --- a/nuttx/drivers/usbhost/Make.defs +++ b/nuttx/drivers/usbhost/Make.defs @@ -45,7 +45,7 @@ CSRCS += usbhost_enumerate.c usbhost_storage.c usbhost_hidkbd.c # Include add-on USB host driver logic (see misc/drivers) ifeq ($(CONFIG_NET),y) - RTL8187_CSRC := ${shell if [ -f usbhost/rtl8187x.c ]; then echo "rtl8187x.c"; fi} + RTL8187_CSRC := ${shell if [ -f usbhost$(DELIM)rtl8187x.c ]; then echo "rtl8187x.c"; fi} CSRCS += $(RTL8187_CSRC) endif endif @@ -54,4 +54,4 @@ endif DEPPATH += --dep-path usbhost VPATH += :usbhost -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/usbhost} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)usbhost} diff --git a/nuttx/drivers/wireless/Make.defs b/nuttx/drivers/wireless/Make.defs index 86ea90e25..fa8e8acb5 100644 --- a/nuttx/drivers/wireless/Make.defs +++ b/nuttx/drivers/wireless/Make.defs @@ -41,7 +41,7 @@ CSRCS += cc1101.c ISM1_868MHzGFSK100kbps.c ISM2_905MHzGFSK250kbps.c # Include wireless build support -DEPPATH += --dep-path wireless/cc1101 -VPATH += :wireless/cc1101 -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/wireless/cc1101} +DEPPATH += --dep-path wireless$(DELIM)cc1101 +VPATH += :wireless$(DELIM)cc1101 +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)wireless$(DELIM)cc1101} endif -- cgit v1.2.3 From 7d61592105d0a53960d2129f3feee7615ec17833 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 26 Nov 2012 13:22:51 +0000 Subject: STM32 FLASH pre-fetch is no long enabled unless it is so configured git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5388 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 3 +++ nuttx/Makefile.unix | 6 +++--- nuttx/arch/arm/src/stm32/Kconfig | 9 +++++++++ nuttx/arch/arm/src/stm32/stm32f20xxx_rcc.c | 4 ++++ nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c | 4 ++++ 5 files changed, 23 insertions(+), 3 deletions(-) (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index f17863557..5c85d4bb6 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3686,4 +3686,7 @@ * arch/arm/srch/stm32/stm32_otgfshost.c: Replace timeout handling; use system tick instead of frame counter. The frame counter gets rset to zero at 0x3fff making it error prone. + * arch/arm/src/stm32/stm32f20xx_rcc.c and stm32f40xx_rcc.c: Added option + CONFIG_STM32_FLASH_PREFETCH. FLASH prefetch will now only be enabled + if this option is selected. diff --git a/nuttx/Makefile.unix b/nuttx/Makefile.unix index 5ecdabb64..d66c06bd8 100644 --- a/nuttx/Makefile.unix +++ b/nuttx/Makefile.unix @@ -34,9 +34,9 @@ ############################################################################ TOPDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk --include ${TOPDIR}/Make.defs +-include $(TOPDIR)/.config +include $(TOPDIR)/tools/Config.mk +-include $(TOPDIR)/Make.defs # Control build verbosity diff --git a/nuttx/arch/arm/src/stm32/Kconfig b/nuttx/arch/arm/src/stm32/Kconfig index 2807e1a47..99dde3209 100644 --- a/nuttx/arch/arm/src/stm32/Kconfig +++ b/nuttx/arch/arm/src/stm32/Kconfig @@ -689,6 +689,15 @@ endchoice endmenu +config STM32_FLASH_PREFETCH + bool "Enable FLASH Pre-fetch" + depends on STM32_STM32F20XX || STM32_STM32F40XX + default n + ---help--- + Enable FLASH prefetch and F2 and F4 parts (FLASH pre-fetch is always enabled + on F1 parts). Some early revisions of F4 parts do not support FLASH pre-fetch + properly and enabling this option may interfere with ADC accuracy. + choice prompt "JTAG Configuration" default STM32_JTAG_DISABLE diff --git a/nuttx/arch/arm/src/stm32/stm32f20xxx_rcc.c b/nuttx/arch/arm/src/stm32/stm32f20xxx_rcc.c index 335992524..ac72fb60b 100644 --- a/nuttx/arch/arm/src/stm32/stm32f20xxx_rcc.c +++ b/nuttx/arch/arm/src/stm32/stm32f20xxx_rcc.c @@ -631,7 +631,11 @@ static void stm32_stdclockconfig(void) /* Enable FLASH prefetch, instruction cache, data cache, and 5 wait states */ +#ifdef STM32_FLASH_PREFETCH + regval = (FLASH_ACR_LATENCY_5 | FLASH_ACR_ICEN | FLASH_ACR_DCEN | FLASH_ACR_PRFTEN); +#else regval = (FLASH_ACR_LATENCY_5 | FLASH_ACR_ICEN | FLASH_ACR_DCEN); +#endif putreg32(regval, STM32_FLASH_ACR); /* Select the main PLL as system clock source */ diff --git a/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c b/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c index 14ee1e754..c6c0b2382 100644 --- a/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c +++ b/nuttx/arch/arm/src/stm32/stm32f40xxx_rcc.c @@ -633,7 +633,11 @@ static void stm32_stdclockconfig(void) /* Enable FLASH prefetch, instruction cache, data cache, and 5 wait states */ +#ifdef STM32_FLASH_PREFETCH regval = (FLASH_ACR_LATENCY_5 | FLASH_ACR_ICEN | FLASH_ACR_DCEN | FLASH_ACR_PRFTEN); +#else + regval = (FLASH_ACR_LATENCY_5 | FLASH_ACR_ICEN | FLASH_ACR_DCEN); +#endif putreg32(regval, STM32_FLASH_ACR); /* Select the main PLL as system clock source */ -- cgit v1.2.3 From f1883fb2da23a440533ac6869f1fae823da4c5b1 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 26 Nov 2012 15:06:50 +0000 Subject: Misc build fixes, some from Mike some for ez80 native build git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5389 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/arm/src/lpc31xx/lpc31_usbdev.c | 2 +- nuttx/arch/z80/src/Makefile.zdsii | 8 ++++---- nuttx/configs/ez80f910200kitg/ostest/Make.defs | 26 ++++++++---------------- nuttx/configs/ez80f910200kitg/ostest/setenv.sh | 7 +++++-- nuttx/configs/olimex-stm32-p107/nsh/Make.defs | 6 ++++++ nuttx/configs/olimex-stm32-p107/ostest/Make.defs | 6 ++++++ 6 files changed, 30 insertions(+), 25 deletions(-) (limited to 'nuttx') diff --git a/nuttx/arch/arm/src/lpc31xx/lpc31_usbdev.c b/nuttx/arch/arm/src/lpc31xx/lpc31_usbdev.c index 255f28da1..386abb5b8 100644 --- a/nuttx/arch/arm/src/lpc31xx/lpc31_usbdev.c +++ b/nuttx/arch/arm/src/lpc31xx/lpc31_usbdev.c @@ -75,7 +75,7 @@ /* Configuration ***************************************************************/ #ifndef CONFIG_LPC31_USBDEV_EP0_MAXSIZE -# define CONFIG_LPC31_LPC31_USBDEV_EP0_MAXSIZE 64 +# define CONFIG_LPC31_USBDEV_EP0_MAXSIZE 64 #endif #ifndef CONFIG_USBDEV_MAXPOWER diff --git a/nuttx/arch/z80/src/Makefile.zdsii b/nuttx/arch/z80/src/Makefile.zdsii index a3c6639f5..1615763d1 100644 --- a/nuttx/arch/z80/src/Makefile.zdsii +++ b/nuttx/arch/z80/src/Makefile.zdsii @@ -106,7 +106,7 @@ nuttx.linkcmd: $(LINKCMDTEMPLATE) ifeq ($(CONFIG_WINDOWS_NATIVE),y) @echo "$(TOPDIR)\nuttx"= \>>nuttx.linkcmd @echo "$(ARCHSRCDIR)\$(HEAD_OBJ)", \>>nuttx.linkcmd - $(Q) for %%G in ($(LINKLIBS)) do ( echo "$(TOPDIR)\lib\%%G", \>>nuttx.linkcmd ) + $(Q) for %%G in ($(LINKLIBS)) do ( echo "$(TOPDIR)\lib\%%G", \>>nuttx.linkcmd ) @echo "$(ARCHSRCDIR)\board\libboard$(LIBEXT)", \>>nuttx.linkcmd ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) @echo "$(ZDSSTDLIBDIR)\chelprevaaD$(LIBEXT)", \>>nuttx.linkcmd @@ -130,12 +130,12 @@ ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) @echo "$(ZDSZILOGLIBDIR)\uartf91$(LIBEXT)">>nuttx.linkcmd endif else - @echo "\"${shell cygpath -w "$(TOPDIR)/nuttx\"= \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w "$(ARCHSRCDIR)/$(HEAD_OBJ)\", \\" >>nuttx.linkcmd + @echo "\"${shell cygpath -w "$(TOPDIR)/nuttx"}\"= \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w "$(ARCHSRCDIR)/$(HEAD_OBJ)"}\", \\" >>nuttx.linkcmd $(Q) ( for lib in $(LINKLIBS); do \ echo " \"`cygpath -w "$(TOPDIR)/lib/$${lib}"`\", \\" >>nuttx.linkcmd; \ done ; ) - @echo " \"${shell cygpath -w "$(ARCHSRCDIR)/board/libboard$(LIBEXT)\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w "$(ARCHSRCDIR)/board/libboard$(LIBEXT)"}\", \\" >>nuttx.linkcmd ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/chelprevaaD$(LIBEXT)"}\", \\" >>nuttx.linkcmd @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/crtrevaaLDD$(LIBEXT)"}\", \\" >>nuttx.linkcmd diff --git a/nuttx/configs/ez80f910200kitg/ostest/Make.defs b/nuttx/configs/ez80f910200kitg/ostest/Make.defs index 9f787ef1b..607a5adb7 100644 --- a/nuttx/configs/ez80f910200kitg/ostest/Make.defs +++ b/nuttx/configs/ez80f910200kitg/ostest/Make.defs @@ -33,8 +33,8 @@ # ############################################################################ -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/.config +include $(TOPDIR)/tools/Config.mk # These are the directories where the ZDS-II toolchain is installed @@ -140,21 +140,11 @@ LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)configs$(DELIM)ez80f910200kitg$(DELIM)ostest$ # Tool names/pathes CROSSDEV = +CC = ez80cc.exe CPP = gcc -E - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - # PATH varialble should be set - CC = ez80cc.exe - LD = ez80link.exe - AS = ez80asm.exe - AR = ez80lib.exe -else - # Cygwin PATH variable is not sufficient - CC = "$(ZDSBINDIR)$(DELIM)ez80cc.exe" - LD = "$(ZDSBINDIR)$(DELIM)ez80link.exe" - AS = "$(ZDSBINDIR)$(DELIM)ez80asm.exe" - AR = "$(ZDSBINDIR)$(DELIM)ez80lib.exe" -endif +LD = ez80link.exe +AS = ez80asm.exe +AR = ez80lib.exe # File extensions @@ -205,11 +195,11 @@ define PREPROCESS endef define COMPILE - $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} + $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) endef define ASSEMBLE - $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} + $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) endef define ARCHIVE diff --git a/nuttx/configs/ez80f910200kitg/ostest/setenv.sh b/nuttx/configs/ez80f910200kitg/ostest/setenv.sh index ce3ea8b53..42003ccb6 100755 --- a/nuttx/configs/ez80f910200kitg/ostest/setenv.sh +++ b/nuttx/configs/ez80f910200kitg/ostest/setenv.sh @@ -54,7 +54,10 @@ fi TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_5.1.1\bin" # -# Add the path to the toolchain to the PATH varialble +# Add the path to the toolchain to the PATH varialble. NOTE that /bin and /usr/bin +# preceded the toolchain bin directory. This is because the ZDSII bin directory +# includes binaries like make.exe that will interfere with the normal build process +# if we do not give priority to the versions at /bin and /usr/bin. # -export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +export PATH="/bin:/usr/bin:${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/nuttx/configs/olimex-stm32-p107/nsh/Make.defs b/nuttx/configs/olimex-stm32-p107/nsh/Make.defs index 98871a47d..93677479f 100644 --- a/nuttx/configs/olimex-stm32-p107/nsh/Make.defs +++ b/nuttx/configs/olimex-stm32-p107/nsh/Make.defs @@ -37,6 +37,12 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs +ifeq ($(CONFIG_STM32_DFU),y) + LDSCRIPT = ld.script.dfu +else + LDSCRIPT = ld.script +endif + ifeq ($(WINTOOL),y) # Windows-native toolchains DIRLINK = $(TOPDIR)/tools/winlink.sh diff --git a/nuttx/configs/olimex-stm32-p107/ostest/Make.defs b/nuttx/configs/olimex-stm32-p107/ostest/Make.defs index 75f0ed881..7a27f7755 100644 --- a/nuttx/configs/olimex-stm32-p107/ostest/Make.defs +++ b/nuttx/configs/olimex-stm32-p107/ostest/Make.defs @@ -37,6 +37,12 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs +ifeq ($(CONFIG_STM32_DFU),y) + LDSCRIPT = ld.script.dfu +else + LDSCRIPT = ld.script +endif + ifeq ($(WINTOOL),y) # Windows-native toolchains DIRLINK = $(TOPDIR)/tools/winlink.sh -- cgit v1.2.3 From aca95c773056329af4e38f629d43f55b327b1068 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 26 Nov 2012 17:07:34 +0000 Subject: ez80f910200zco/ostest now uses Kconfig git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5390 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 2 + nuttx/arch/z80/src/ez80/Kconfig | 13 +- nuttx/configs/ez80f910200zco/README.txt | 44 ++ nuttx/configs/ez80f910200zco/dhcpd/Make.defs | 105 ++- nuttx/configs/ez80f910200zco/dhcpd/setenv.sh | 31 +- nuttx/configs/ez80f910200zco/httpd/Make.defs | 104 ++- nuttx/configs/ez80f910200zco/httpd/setenv.sh | 33 +- nuttx/configs/ez80f910200zco/nettest/Make.defs | 104 ++- nuttx/configs/ez80f910200zco/nettest/setenv.sh | 31 +- nuttx/configs/ez80f910200zco/nsh/Make.defs | 104 ++- nuttx/configs/ez80f910200zco/nsh/setenv.sh | 33 +- nuttx/configs/ez80f910200zco/ostest/Make.defs | 156 +++-- nuttx/configs/ez80f910200zco/ostest/appconfig | 39 -- nuttx/configs/ez80f910200zco/ostest/defconfig | 788 ++++++++++++----------- nuttx/configs/ez80f910200zco/ostest/setenv.sh | 31 +- nuttx/configs/ez80f910200zco/poll/Make.defs | 104 ++- nuttx/configs/ez80f910200zco/poll/setenv.sh | 31 +- nuttx/configs/z16f2800100zcog/ostest/Make.defs | 95 ++- nuttx/configs/z16f2800100zcog/pashello/Make.defs | 105 ++- nuttx/configs/z8encore000zco/ostest/Make.defs | 116 ++-- nuttx/configs/z8f64200100kit/ostest/Make.defs | 116 ++-- 21 files changed, 1183 insertions(+), 1002 deletions(-) delete mode 100644 nuttx/configs/ez80f910200zco/ostest/appconfig (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 5c85d4bb6..a32577365 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3689,4 +3689,6 @@ * arch/arm/src/stm32/stm32f20xx_rcc.c and stm32f40xx_rcc.c: Added option CONFIG_STM32_FLASH_PREFETCH. FLASH prefetch will now only be enabled if this option is selected. + * confgs/ez80f910200zco/ostest: Now used Kconfig/mconfig configuration + tool. diff --git a/nuttx/arch/z80/src/ez80/Kconfig b/nuttx/arch/z80/src/ez80/Kconfig index 5b6d7e6d2..6bde573f6 100644 --- a/nuttx/arch/z80/src/ez80/Kconfig +++ b/nuttx/arch/z80/src/ez80/Kconfig @@ -87,7 +87,8 @@ config EZ80_MDCDIV int "SCLK Divider" default 0 ---help--- - The value to use for the divider to derive the MII MDC clock from SCLK. Options are 1->4; 2->6; 3->8; 4->10; 5->14; 6->20; and 7->28 + The value to use for the divider to derive the MII MDC clock from SCLK. Options + are 1->4; 2->6; 3->8; 4->10; 5->14; 6->20; and 7->28 config EZ80_TXPOLLTIMERMS int "Tx Poll Milliseconds" @@ -102,4 +103,14 @@ config ARCH_MCFILTER Enables multicast MAC address filtering (not fully implemented) endif + +config ARCH_TIMERHOOK + bool "Timer Hook" + default n + ---help--- + Select this option to enabled a direct call-out from the ez80 timer interrupt + handler. If this is enabled, the ez80 timer interrupt interrupt will call a + user provided function called up_timerhook(). At present, this timer hook is + only used for driving the segment LED on board certain ez80 boards. + endif diff --git a/nuttx/configs/ez80f910200zco/README.txt b/nuttx/configs/ez80f910200zco/README.txt index d39c419e0..bc4e11e27 100644 --- a/nuttx/configs/ez80f910200zco/README.txt +++ b/nuttx/configs/ez80f910200zco/README.txt @@ -93,6 +93,50 @@ ostest This builds the examples/ostest application for execution from FLASH. See examples/README.txt for information about ostest. +- ostest + This builds the examples/ostest application for execution from FLASH. + See examples/README.txt for information about ostest. + + NOTES: + + 1. This configuration uses the mconf-based configuration tool. To + change this configuration using that tool, you should: + + a. Build and install the mconf tool. See nuttx/README.txt and + misc/tools/ + + b. Execute 'make menuconfig' in nuttx/ in order to start the + reconfiguration process. + + 2. By default, this configuration assumes that you are using the + Cygwin environment on Windows. An option is to use the native + CMD.exe window build as described in the top-level README.txt + file. To set up that configuration: + + -CONFIG_WINDOWS_CYGWIN=y + +CONFIG_WINDOWS_NATIVE=y + + And after configuring, make sure that CONFIG_APPS_DIR uses + the back slash character. For example: + + CONFIG_APPS_DIR="..\apps" + + NOTES: + + a. If you need to change the toolchain path used in Make.defs, you + will need to use the short 8.3 filenames to avoid spaces. On my + PC, C:\PROGRA~1\ is is C:\Program Files\ and C:\PROGRA~2\ is + C:\Program Files (x86)\ + b. You can't use setenv.sh in the native Windows environment. Try + scripts/setenv.bat instead. + c. At present, the native Windows build fails at the final link stages. + The failure is due to problems in arch/z80/src/nuttx/linkcmd that + is autogenerated by arch/z80/src/Makefile.zdsii. The basic program + is the spurious spaces and and carrirage returns are generated at + the end of the lines after a line continuation (\ ^M). If these + trailing bad characters are manually eliminated, then the build + will succeed on the next try. + nsh This configuratino builds the NuttShell (NSH). That code can be found in examples/nsh. For more information see: examples/nsh/README.txt diff --git a/nuttx/configs/ez80f910200zco/dhcpd/Make.defs b/nuttx/configs/ez80f910200zco/dhcpd/Make.defs index d8e7d33fe..2999e15d6 100644 --- a/nuttx/configs/ez80f910200zco/dhcpd/Make.defs +++ b/nuttx/configs/ez80f910200zco/dhcpd/Make.defs @@ -68,81 +68,79 @@ WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} # Escaped versions -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} +ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} +EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} +EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} # Assembler definitions ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) -ARCHCPU = eZ80F91 -ARCHCPUDEF = _EZ80F91 -ARCHFAMILY = _EZ80ACCLAIM! +ARCHCPU = eZ80F91 +ARCHCPUDEF = _EZ80F91 +ARCHFAMILY = _EZ80ACCLAIM! endif ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHASMOPTIMIZATION = -debug -NOsdiopt + ARCHASMOPTIMIZATION = -debug -NOsdiopt else - ARCHASMOPTIMIZATION = -nodebug -NOsdiopt + ARCHASMOPTIMIZATION = -nodebug -NOsdiopt endif -ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase -ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet -ARCHASMWARNINGS = -warn -ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' -AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) \ - $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) +ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase +ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet +ARCHASMWARNINGS = -warn +ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ +ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' +EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' +AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -reduceopt + ARCHOPTIMIZATION = -debug -reduceopt else - ARCHOPTIMIZATION = -nodebug -optsize + ARCHOPTIMIZATION = -nodebug -optsize endif -ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ - -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" -ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm -ARCHPICFLAGS = -ARCHWARNINGS = -warn -ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' -ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) - -CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include -CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) +ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ + -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" +ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm +ARCHPICFLAGS = +ARCHWARNINGS = -warn +ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) +ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' +ARCHUSRINCLUDES = -usrinc:'.' +ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + +CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ +CPPINCLUDES = -I$(TOPDIR)/include +CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions -ARFLAGS = -quiet -warn +ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/dhcpd/dhcpd.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/dhcpd/dhcpd.linkcmd # Tool names/pathes -CROSSDEV = -CC = $(ZDSBINDIR)/ez80cc.exe -CPP = gcc -E -LD = $(ZDSBINDIR)/ez80link.exe -AS = $(ZDSBINDIR)/ez80asm.exe -AR = $(ZDSBINDIR)/ez80lib.exe +CROSSDEV = +CC = $(ZDSBINDIR)/ez80cc.exe +CPP = gcc -E +LD = $(ZDSBINDIR)/ez80link.exe +AS = $(ZDSBINDIR)/ez80asm.exe +AR = $(ZDSBINDIR)/ez80lib.exe # File extensions -ASMEXT = .asm -OBJEXT = .obj -LIBEXT = .lib -EXEEXT = .lod -HEXEXT = .hex +ASMEXT = .asm +OBJEXT = .obj +LIBEXT = .lib +EXEEXT = .lod +HEXEXT = .hex # These are the macros that will be used in the NuttX make system # to compile and assembly source files and to insert the resulting @@ -176,7 +174,6 @@ define ARCHIVE done endef endif -endif define CLEAN $(Q) rm -f *.obj *.src *.lib *.hex *.lod *.lst @@ -184,16 +181,16 @@ endef # This is the tool to use for dependencies (i.e., none) -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +MKDEP = $(TOPDIR)/tools/mknulldeps.sh # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh +DIRLINK = $(TOPDIR)/tools/winlink.sh +DIRUNLINK = $(TOPDIR)/tools/unlink.sh # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTLDFLAGS = diff --git a/nuttx/configs/ez80f910200zco/dhcpd/setenv.sh b/nuttx/configs/ez80f910200zco/dhcpd/setenv.sh index 75e873a7f..63367b4d5 100755 --- a/nuttx/configs/ez80f910200zco/dhcpd/setenv.sh +++ b/nuttx/configs/ez80f910200zco/dhcpd/setenv.sh @@ -33,20 +33,31 @@ # # Check how we were executed # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + # -# The ZDS-II toolchain lies outside of the Cygwin "sandbox" and -# attempts to set the PATH variable do not have the desired effect. -# Instead, alias are provided for all of the ZDS-II command line tools. -# Version 5.1.1 installed in the default location is assumed here. +# This is the Cygwin path to location where the XDS-II tools were installed # -ZDSBINDIR="C:/Program\ Files\ \(x86\)/ZiLOG/ZDSII_eZ80Acclaim!_5.1.1/bin" -alias ez80asm="${ZDSBINDIR}/ez80asm.exe" -alias ez80cc="${ZDSBINDIR}/ez80cc.exe" -alias ez80lib="${ZDSBINDIR}/ez80lib.exe" -alias ez80link="${ZDSBINDIR}/ez80link.exe" +TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_5.1.1\bin" +# +# Add the path to the toolchain to the PATH varialble. NOTE that /bin and /usr/bin +# preceded the toolchain bin directory. This is because the ZDSII bin directory +# includes binaries like make.exe that will interfere with the normal build process +# if we do not give priority to the versions at /bin and /usr/bin. +# +export PATH="/bin:/usr/bin:${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +echo "PATH : ${PATH}" diff --git a/nuttx/configs/ez80f910200zco/httpd/Make.defs b/nuttx/configs/ez80f910200zco/httpd/Make.defs index 2a8ffb04f..1c2ef3b61 100644 --- a/nuttx/configs/ez80f910200zco/httpd/Make.defs +++ b/nuttx/configs/ez80f910200zco/httpd/Make.defs @@ -68,81 +68,79 @@ WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} # Escaped versions -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} +ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} +EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} +EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} # Assembler definitions ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) -ARCHCPU = eZ80F91 -ARCHCPUDEF = _EZ80F91 -ARCHFAMILY = _EZ80ACCLAIM! +ARCHCPU = eZ80F91 +ARCHCPUDEF = _EZ80F91 +ARCHFAMILY = _EZ80ACCLAIM! endif ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHASMOPTIMIZATION = -debug -NOsdiopt + ARCHASMOPTIMIZATION = -debug -NOsdiopt else - ARCHASMOPTIMIZATION = -nodebug -NOsdiopt + ARCHASMOPTIMIZATION = -nodebug -NOsdiopt endif -ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase -ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet -ARCHASMWARNINGS = -warn -ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' -AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) \ - $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) +ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase +ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet +ARCHASMWARNINGS = -warn +ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ +ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' +EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' +AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -reduceopt + ARCHOPTIMIZATION = -debug -reduceopt else - ARCHOPTIMIZATION = -nodebug -optsize + ARCHOPTIMIZATION = -nodebug -optsize endif -ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ - -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" -ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm -ARCHPICFLAGS = -ARCHWARNINGS = -warn -ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' -ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) - -CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include -CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) +ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ + -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" +ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm +ARCHPICFLAGS = +ARCHWARNINGS = -warn +ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) +ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' +ARCHUSRINCLUDES = -usrinc:'.' +ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + +CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ +CPPINCLUDES = -I$(TOPDIR)/include +CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions -ARFLAGS = -quiet -warn +ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/httpd/httpd.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/httpd/httpd.linkcmd # Tool names/pathes -CROSSDEV = -CC = $(ZDSBINDIR)/ez80cc.exe -CPP = gcc -E -LD = $(ZDSBINDIR)/ez80link.exe -AS = $(ZDSBINDIR)/ez80asm.exe -AR = $(ZDSBINDIR)/ez80lib.exe +CROSSDEV = +CC = $(ZDSBINDIR)/ez80cc.exe +CPP = gcc -E +LD = $(ZDSBINDIR)/ez80link.exe +AS = $(ZDSBINDIR)/ez80asm.exe +AR = $(ZDSBINDIR)/ez80lib.exe # File extensions -ASMEXT = .asm -OBJEXT = .obj -LIBEXT = .lib -EXEEXT = .lod -HEXEXT = .hex +ASMEXT = .asm +OBJEXT = .obj +LIBEXT = .lib +EXEEXT = .lod +HEXEXT = .hex # These are the macros that will be used in the NuttX make system # to compile and assembly source files and to insert the resulting @@ -183,16 +181,16 @@ endef # This is the tool to use for dependencies (i.e., none) -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +MKDEP = $(TOPDIR)/tools/mknulldeps.sh # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh +DIRLINK = $(TOPDIR)/tools/winlink.sh +DIRUNLINK = $(TOPDIR)/tools/unlink.sh # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTLDFLAGS = diff --git a/nuttx/configs/ez80f910200zco/httpd/setenv.sh b/nuttx/configs/ez80f910200zco/httpd/setenv.sh index 75e873a7f..1abd9c037 100755 --- a/nuttx/configs/ez80f910200zco/httpd/setenv.sh +++ b/nuttx/configs/ez80f910200zco/httpd/setenv.sh @@ -1,5 +1,5 @@ #!/bin/bash -# configs/ez80f910200zco/dhcpd/setenv.sh +# configs/ez80f910200zco/htppd/setenv.sh # # Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -33,20 +33,31 @@ # # Check how we were executed # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + # -# The ZDS-II toolchain lies outside of the Cygwin "sandbox" and -# attempts to set the PATH variable do not have the desired effect. -# Instead, alias are provided for all of the ZDS-II command line tools. -# Version 5.1.1 installed in the default location is assumed here. +# This is the Cygwin path to location where the XDS-II tools were installed # -ZDSBINDIR="C:/Program\ Files\ \(x86\)/ZiLOG/ZDSII_eZ80Acclaim!_5.1.1/bin" -alias ez80asm="${ZDSBINDIR}/ez80asm.exe" -alias ez80cc="${ZDSBINDIR}/ez80cc.exe" -alias ez80lib="${ZDSBINDIR}/ez80lib.exe" -alias ez80link="${ZDSBINDIR}/ez80link.exe" +TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_5.1.1\bin" +# +# Add the path to the toolchain to the PATH varialble. NOTE that /bin and /usr/bin +# preceded the toolchain bin directory. This is because the ZDSII bin directory +# includes binaries like make.exe that will interfere with the normal build process +# if we do not give priority to the versions at /bin and /usr/bin. +# +export PATH="/bin:/usr/bin:${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +echo "PATH : ${PATH}" diff --git a/nuttx/configs/ez80f910200zco/nettest/Make.defs b/nuttx/configs/ez80f910200zco/nettest/Make.defs index 95a5b4201..bfd958568 100644 --- a/nuttx/configs/ez80f910200zco/nettest/Make.defs +++ b/nuttx/configs/ez80f910200zco/nettest/Make.defs @@ -68,81 +68,79 @@ WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} # Escaped versions -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} +ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} +EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} +EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} # Assembler definitions ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) -ARCHCPU = eZ80F91 -ARCHCPUDEF = _EZ80F91 -ARCHFAMILY = _EZ80ACCLAIM! +ARCHCPU = eZ80F91 +ARCHCPUDEF = _EZ80F91 +ARCHFAMILY = _EZ80ACCLAIM! endif ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHASMOPTIMIZATION = -debug -NOsdiopt + ARCHASMOPTIMIZATION = -debug -NOsdiopt else - ARCHASMOPTIMIZATION = -nodebug -NOsdiopt + ARCHASMOPTIMIZATION = -nodebug -NOsdiopt endif -ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase -ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet -ARCHASMWARNINGS = -warn -ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' -AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) \ - $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) +ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase +ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet +ARCHASMWARNINGS = -warn +ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ +ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' +EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' +AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -reduceopt + ARCHOPTIMIZATION = -debug -reduceopt else - ARCHOPTIMIZATION = -nodebug -optsize + ARCHOPTIMIZATION = -nodebug -optsize endif -ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ - -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" -ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm -ARCHPICFLAGS = -ARCHWARNINGS = -warn -ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' -ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) - -CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include -CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) +ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ + -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" +ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm +ARCHPICFLAGS = +ARCHWARNINGS = -warn +ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) +ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' +ARCHUSRINCLUDES = -usrinc:'.' +ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + +CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ +CPPINCLUDES = -I$(TOPDIR)/include +CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions -ARFLAGS = -quiet -warn +ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/nettest/nettest.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/nettest/nettest.linkcmd # Tool names/pathes -CROSSDEV = -CC = $(ZDSBINDIR)/ez80cc.exe -CPP = gcc -E -LD = $(ZDSBINDIR)/ez80link.exe -AS = $(ZDSBINDIR)/ez80asm.exe -AR = $(ZDSBINDIR)/ez80lib.exe +CROSSDEV = +CC = $(ZDSBINDIR)/ez80cc.exe +CPP = gcc -E +LD = $(ZDSBINDIR)/ez80link.exe +AS = $(ZDSBINDIR)/ez80asm.exe +AR = $(ZDSBINDIR)/ez80lib.exe # File extensions -ASMEXT = .asm -OBJEXT = .obj -LIBEXT = .lib -EXEEXT = .lod -HEXEXT = .hex +ASMEXT = .asm +OBJEXT = .obj +LIBEXT = .lib +EXEEXT = .lod +HEXEXT = .hex # These are the macros that will be used in the NuttX make system # to compile and assembly source files and to insert the resulting @@ -183,16 +181,16 @@ endef # This is the tool to use for dependencies (i.e., none) -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +MKDEP = $(TOPDIR)/tools/mknulldeps.sh # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh +DIRLINK = $(TOPDIR)/tools/winlink.sh +DIRUNLINK = $(TOPDIR)/tools/unlink.sh # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTLDFLAGS = diff --git a/nuttx/configs/ez80f910200zco/nettest/setenv.sh b/nuttx/configs/ez80f910200zco/nettest/setenv.sh index 8a0382408..deda4bc07 100755 --- a/nuttx/configs/ez80f910200zco/nettest/setenv.sh +++ b/nuttx/configs/ez80f910200zco/nettest/setenv.sh @@ -33,20 +33,31 @@ # # Check how we were executed # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + # -# The ZDS-II toolchain lies outside of the Cygwin "sandbox" and -# attempts to set the PATH variable do not have the desired effect. -# Instead, alias are provided for all of the ZDS-II command line tools. -# Version 5.1.1 installed in the default location is assumed here. +# This is the Cygwin path to location where the XDS-II tools were installed # -ZDSBINDIR="C:/Program\ Files\ \(x86\)/ZiLOG/ZDSII_eZ80Acclaim!_5.1.1/bin" -alias ez80asm="${ZDSBINDIR}/ez80asm.exe" -alias ez80cc="${ZDSBINDIR}/ez80cc.exe" -alias ez80lib="${ZDSBINDIR}/ez80lib.exe" -alias ez80link="${ZDSBINDIR}/ez80link.exe" +TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_5.1.1\bin" +# +# Add the path to the toolchain to the PATH varialble. NOTE that /bin and /usr/bin +# preceded the toolchain bin directory. This is because the ZDSII bin directory +# includes binaries like make.exe that will interfere with the normal build process +# if we do not give priority to the versions at /bin and /usr/bin. +# +export PATH="/bin:/usr/bin:${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +echo "PATH : ${PATH}" diff --git a/nuttx/configs/ez80f910200zco/nsh/Make.defs b/nuttx/configs/ez80f910200zco/nsh/Make.defs index 978e406b7..3bc219ab9 100644 --- a/nuttx/configs/ez80f910200zco/nsh/Make.defs +++ b/nuttx/configs/ez80f910200zco/nsh/Make.defs @@ -68,81 +68,79 @@ WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} # Escaped versions -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} +ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} +EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} +EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} # Assembler definitions ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) -ARCHCPU = eZ80F91 -ARCHCPUDEF = _EZ80F91 -ARCHFAMILY = _EZ80ACCLAIM! +ARCHCPU = eZ80F91 +ARCHCPUDEF = _EZ80F91 +ARCHFAMILY = _EZ80ACCLAIM! endif ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHASMOPTIMIZATION = -debug -NOsdiopt + ARCHASMOPTIMIZATION = -debug -NOsdiopt else - ARCHASMOPTIMIZATION = -nodebug -NOsdiopt + ARCHASMOPTIMIZATION = -nodebug -NOsdiopt endif -ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase -ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet -ARCHASMWARNINGS = -warn -ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' -AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) \ - $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) +ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase +ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet +ARCHASMWARNINGS = -warn +ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ +ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' +EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' +AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -reduceopt + ARCHOPTIMIZATION = -debug -reduceopt else - ARCHOPTIMIZATION = -nodebug -optsize + ARCHOPTIMIZATION = -nodebug -optsize endif -ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ - -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" -ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm -ARCHPICFLAGS = -ARCHWARNINGS = -warn -ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' -ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) - -CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include -CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) +ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ + -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" +ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm +ARCHPICFLAGS = +ARCHWARNINGS = -warn +ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) +ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' +ARCHUSRINCLUDES = -usrinc:'.' +ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + +CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ +CPPINCLUDES = -I$(TOPDIR)/include +CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions -ARFLAGS = -quiet -warn +ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/nsh/nsh.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/nsh/nsh.linkcmd # Tool names/pathes -CROSSDEV = -CC = $(ZDSBINDIR)/ez80cc.exe -CPP = gcc -E -LD = $(ZDSBINDIR)/ez80link.exe -AS = $(ZDSBINDIR)/ez80asm.exe -AR = $(ZDSBINDIR)/ez80lib.exe +CROSSDEV = +CC = $(ZDSBINDIR)/ez80cc.exe +CPP = gcc -E +LD = $(ZDSBINDIR)/ez80link.exe +AS = $(ZDSBINDIR)/ez80asm.exe +AR = $(ZDSBINDIR)/ez80lib.exe # File extensions -ASMEXT = .asm -OBJEXT = .obj -LIBEXT = .lib -EXEEXT = .lod -HEXEXT = .hex +ASMEXT = .asm +OBJEXT = .obj +LIBEXT = .lib +EXEEXT = .lod +HEXEXT = .hex # These are the macros that will be used in the NuttX make system # to compile and assembly source files and to insert the resulting @@ -183,16 +181,16 @@ endef # This is the tool to use for dependencies (i.e., none) -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +MKDEP = $(TOPDIR)/tools/mknulldeps.sh # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh +DIRLINK = $(TOPDIR)/tools/winlink.sh +DIRUNLINK = $(TOPDIR)/tools/unlink.sh # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTLDFLAGS = diff --git a/nuttx/configs/ez80f910200zco/nsh/setenv.sh b/nuttx/configs/ez80f910200zco/nsh/setenv.sh index 8bfe02b2f..969ec9df2 100755 --- a/nuttx/configs/ez80f910200zco/nsh/setenv.sh +++ b/nuttx/configs/ez80f910200zco/nsh/setenv.sh @@ -1,5 +1,5 @@ #!/bin/bash -# configs/ez80f910200zco/nst/setenv.sh +# configs/ez80f910200zco/nsh/setenv.sh # # Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -33,20 +33,31 @@ # # Check how we were executed # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + # -# The ZDS-II toolchain lies outside of the Cygwin "sandbox" and -# attempts to set the PATH variable do not have the desired effect. -# Instead, alias are provided for all of the ZDS-II command line tools. -# Version 5.1.1 installed in the default location is assumed here. +# This is the Cygwin path to location where the XDS-II tools were installed # -ZDSBINDIR="C:/Program\ Files\ \(x86\)/ZiLOG/ZDSII_eZ80Acclaim!_5.1.1/bin" -alias ez80asm="${ZDSBINDIR}/ez80asm.exe" -alias ez80cc="${ZDSBINDIR}/ez80cc.exe" -alias ez80lib="${ZDSBINDIR}/ez80lib.exe" -alias ez80link="${ZDSBINDIR}/ez80link.exe" +TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_5.1.1\bin" +# +# Add the path to the toolchain to the PATH varialble. NOTE that /bin and /usr/bin +# preceded the toolchain bin directory. This is because the ZDSII bin directory +# includes binaries like make.exe that will interfere with the normal build process +# if we do not give priority to the versions at /bin and /usr/bin. +# +export PATH="/bin:/usr/bin:${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +echo "PATH : ${PATH}" diff --git a/nuttx/configs/ez80f910200zco/ostest/Make.defs b/nuttx/configs/ez80f910200zco/ostest/Make.defs index 1a2759cff..fa60dac05 100644 --- a/nuttx/configs/ez80f910200zco/ostest/Make.defs +++ b/nuttx/configs/ez80f910200zco/ostest/Make.defs @@ -33,51 +33,67 @@ # ############################################################################ -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/.config +include $(TOPDIR)/tools/Config.mk # These are the directories where the ZDS-II toolchain is installed ZDSVERSION := 5.1.1 -ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) ifeq ($(CONFIG_WINDOWS_NATIVE),y) - ZDSBINDIR := $(ZDSINSTALLDIR)\bin - ZDSSTDINCDIR := $(ZDSINSTALLDIR)\include\std - ZDSZILOGINCDIR := $(ZDSINSTALLDIR)\include\zilog - ZDSSTDLIBDIR := $(ZDSINSTALLDIR)\lib\std - ZDSZILOGLIBDIR := $(ZDSINSTALLDIR)\lib\zilog + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) + INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} + ZDSBINDIR := $(INSTALLDIR)\bin + ZDSSTDINCDIR := $(INSTALLDIR)\include\std + ZDSZILOGINCDIR := $(INSTALLDIR)\include\zilog + ZDSSTDLIBDIR := $(INSTALLDIR)\lib\std + ZDSZILOGLIBDIR := $(INSTALLDIR)\lib\zilog + + # CFLAGs + + ARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + EARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y + ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std ZDSZILOGINCDIR := $(INSTALLDIR)/include/zilog ZDSSTDLIBDIR := $(INSTALLDIR)/lib/std ZDSZILOGLIBDIR := $(INSTALLDIR)/lib/zilog -endif -# These are the same directories but with the directory separator -# character swapped as needed by the ZDS-II compiler + # 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)"} + WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} + WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} -WTOPDIR := ${shell cygpath -w "$(TOPDIR)"} -WZDSSTDINCDIR := ${shell cygpath -w "$(ZDSSTDINCDIR)"} -WZDSZILOGINCDIR := ${shell cygpath -w "$(ZDSZILOGINCDIR)"} -WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} -WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} + # Escaped versions -# Escaped versions + ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} + EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} + EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' +endif # Assembler definitions ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) -ARCHCPU = eZ80F91 -ARCHCPUDEF = _EZ80F91 -ARCHFAMILY = _EZ80ACCLAIM! + ARCHCPU = eZ80F91 + ARCHCPUDEF = _EZ80F91 + ARCHFAMILY = _EZ80ACCLAIM! endif ifeq ($(CONFIG_DEBUG_SYMBOLS),y) @@ -90,10 +106,7 @@ ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet ARCHASMWARNINGS = -warn ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' -AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) \ - $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) +AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions @@ -109,14 +122,11 @@ ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm ARCHPICFLAGS = ARCHWARNINGS = -warn ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include +CPPINCLUDES = -I$(TOPDIR)$(DELIM)include CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions @@ -125,16 +135,16 @@ ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/ostest/ostest.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)configs$(DELIM)ez80f910200zco$(DELIM)ostest$(DELIM)ostest.linkcmd # Tool names/pathes CROSSDEV = -CC = $(ZDSBINDIR)/ez80cc.exe +CC = ez80cc.exe CPP = gcc -E -LD = $(ZDSBINDIR)/ez80link.exe -AS = $(ZDSBINDIR)/ez80asm.exe -AR = $(ZDSBINDIR)/ez80lib.exe +LD = ez80link.exe +AS = ez80asm.exe +AR = ez80lib.exe # File extensions @@ -148,51 +158,89 @@ HEXEXT = .hex # to compile and assembly source files and to insert the resulting # object files into an archive +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + define PREPROCESS - @echo "CPP: $1->$2" + @echo CPP: $1->$2 $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 endef define COMPILE - @#echo "CC: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef define ASSEMBLE - @#echo "AS: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) define ARCHIVE - echo "AR: $2"; + echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef + +define CLEAN + $(Q) if exist *.obj (del /f /q *.obj) + $(Q) if exist *.src (del /f /q *.src) + $(Q) if exist *.lib (del /f /q *.lib) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.lod (del /f /q *.lod) + $(Q) if exist *.lst (del /f /q *.lst) +endef + else + +define PREPROCESS + @echo "CPP: $1->$2" + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) +endef + +define ASSEMBLE + $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) +endef + define ARCHIVE $(Q) for __obj in $(2) ; do \ echo "AR: $$__obj"; \ "$(AR)" $(ARFLAGS) $1=-+$$__obj || { echo "$(AR) $1=-+$$__obj FAILED!" ; exit 1 ; } \ done endef -endif define CLEAN $(Q) rm -f *.obj *.src *.lib *.hex *.lod *.lst endef +endif -# This is the tool to use for dependencies (i.e., none) +# Windows native host tool definitions -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe -# ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + # Windows-native host tools -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif diff --git a/nuttx/configs/ez80f910200zco/ostest/appconfig b/nuttx/configs/ez80f910200zco/ostest/appconfig deleted file mode 100644 index 987de079e..000000000 --- a/nuttx/configs/ez80f910200zco/ostest/appconfig +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################ -# configs/ez80f910200zco/ostest/appconfig -# -# Copyright (C) 2011 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. -# -############################################################################ - -# Path to example in apps/examples containing the user_start entry point - -CONFIGURED_APPS += examples/ostest - diff --git a/nuttx/configs/ez80f910200zco/ostest/defconfig b/nuttx/configs/ez80f910200zco/ostest/defconfig index 7ffd452ee..b443fdf93 100644 --- a/nuttx/configs/ez80f910200zco/ostest/defconfig +++ b/nuttx/configs/ez80f910200zco/ostest/defconfig @@ -1,174 +1,177 @@ -############################################################################ -# configs/ez80f910200zco/ostest/defconfig -# -# Copyright (C) 2008-2010 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. -# -############################################################################ -# -# Architecture selection # -CONFIG_ARCH="z80" +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +CONFIG_HOST_LINUX=y +# CONFIG_HOST_OSX is not set +# CONFIG_HOST_WINDOWS is not set +# CONFIG_HOST_OTHER is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="../apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +CONFIG_DEBUG=y +# CONFIG_DEBUG_VERBOSE is not set +# CONFIG_DEBUG_ENABLE is not set + +# +# Subsystem Debug Options +# +# CONFIG_DEBUG_MM is not set +# CONFIG_DEBUG_SCHED is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_DEBUG_LIB is not set +# CONFIG_DEBUG_BINFMT is not set +# CONFIG_DEBUG_GRAPHICS is not set + +# +# Driver Debug Options +# +# CONFIG_DEBUG_ANALOG is not set +# CONFIG_DEBUG_DMA is not set +# CONFIG_DEBUG_SYMBOLS is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set CONFIG_ARCH_Z80=y +CONFIG_ARCH="z80" CONFIG_ARCH_CHIP="ez80" -CONFIG_ARCH_CHIP_EZ80=y -CONFIG_ARCH_CHIP_EZ80F91=y -CONFIG_ARCH_CHIP_EZ80F92=n -CONFIG_ARCH_CHIP_EZ80F93=n -CONFIG_ARCH_BOARD="ez80f910200zco" -CONFIG_ARCH_BOARD_EZ80F910200ZCO=y -CONFIG_ARCH_NOINTC=n -CONFIG_ARCH_IRQPRIO=n CONFIG_BOARD_LOOPSPERMSEC=1250 -CONFIG_ENDIAN_BIG=n -CONFIG_DRAM_SIZE=65536 -CONFIG_ARCH_LEDS=y -CONFIG_ARCH_BUTTONS=n -CONFIG_ARCH_TIMERHOOK=y +# CONFIG_SDIO_DMA is not set +# CONFIG_SDIO_WIDTH_D1_ONLY is not set +# CONFIG_ARCH_CHIP_Z80 is not set +# CONFIG_ARCH_CHIP_Z8F640X is not set +# CONFIG_ARCH_CHIP_Z8F6403 is not set +# CONFIG_ARCH_CHIP_Z8F642X is not set +# CONFIG_ARCH_CHIP_Z8F6423 is not set +CONFIG_ARCH_CHIP_EZ80F91=y +# CONFIG_ARCH_CHIP_EZ80F92 is not set +# CONFIG_ARCH_CHIP_EZ80F93 is not set +CONFIG_ARCH_CHIP_EZ80=y # -# eZ80 specific device driver settings +# ez80 Peripheral Support # CONFIG_EZ80_UART0=y -CONFIG_EZ80_UART1=n -CONFIG_UART0_SERIAL_CONSOLE=y -CONFIG_UART1_SERIAL_CONSOLE=n -CONFIG_UART0_TXBUFSIZE=64 -CONFIG_UART1_TXBUFSIZE=0 -CONFIG_UART0_RXBUFSIZE=192 -CONFIG_UART1_RXBUFSIZE=0 -CONFIG_UART0_BAUD=57600 -CONFIG_UART1_BAUD=57600 -CONFIG_UART0_BITS=0 -CONFIG_UART1_BITS=0 -CONFIG_UART0_PARITY=0 -CONFIG_UART1_PARITY=0 -CONFIG_UART0_2STOP=0 -CONFIG_UART1_2STOP=0 +# CONFIG_EZ80_UART1 is not set +# CONFIG_EZ80_UART2 is not set +# CONFIG_EZ80_EMAC is not set +CONFIG_HAVE_LOWUARTINIT=y +CONFIG_ARCH_TIMERHOOK=y # -# ez80 EMAC +# Architecture Options # -CONFIG_EZ80_EMAC=n -CONFIG_EZ80_FIAD=0x1f -CONFIG_EZ80_PHYAM79C874=y -CONFIG_EZ80_PHYCONFIG=1 -CONFIG_EZ80_RAMADDR=0xf7c000 -CONFIG_EZ80_PKTBUFSIZE=64 -CONFIG_EZ80_NTXPKTBUFS=64 -CONFIG_EZ80_NRXPKTBUFS=64 -CONFIG_EZ80_PKTBUFSIZE=64 -CONFIG_EZ80_MDCDIV=0 -CONFIG_EZ80_TXPOLLTIMERMS=10 -CONFIG_ARCH_MCFILTER=n +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_STACKDUMP is not set # -# General build options +# Board Settings # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_MOTOROLA_SREC=n -CONFIG_RAW_BINARY=n +CONFIG_DRAM_START= +CONFIG_DRAM_SIZE=65536 # -# General OS setup +# Boot options # -CONFIG_USER_ENTRYPOINT="ostest_main" -CONFIG_DEBUG=y -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y -CONFIG_RR_INTERVAL=200 -CONFIG_SCHED_INSTRUMENTATION=n -CONFIG_TASK_NAME_SIZE=0 -CONFIG_START_YEAR=2009 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=28 -CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=y -CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n -CONFIG_SDCLONE_DISABLE=y +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set # -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. +# Board Selection # -# There are certain dependency relationships in these -# features. +# CONFIG_ARCH_BOARD_EZ80F910200KITG is not set +CONFIG_ARCH_BOARD_EZ80F910200ZCO=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="ez80f910200zco" + # -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. +# Common Board Options # -CONFIG_DISABLE_CLOCK=n -CONFIG_DISABLE_POSIX_TIMERS=n -CONFIG_DISABLE_PTHREAD=n -CONFIG_DISABLE_SIGNALS=n -CONFIG_DISABLE_MQUEUE=n -CONFIG_DISABLE_MOUNTPOINT=n -CONFIG_DISABLE_ENVIRON=n -CONFIG_DISABLE_POLL=y +CONFIG_ARCH_HAVE_LEDS=y +CONFIG_ARCH_LEDS=y +CONFIG_ARCH_HAVE_BUTTONS=y +# CONFIG_ARCH_BUTTONS is not set # -# Misc libc settings +# Board-Specific Options # -CONFIG_NOPRINTF_FIELDWIDTH=n # -# Allow for architecture optimized implementations +# RTOS Features # -# The architecture can provide optimized versions of the -# following to improve sysem performance -# -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n +CONFIG_MSEC_PER_TICK=10 +CONFIG_RR_INTERVAL=200 +# CONFIG_SCHED_INSTRUMENTATION is not set +CONFIG_TASK_NAME_SIZE=0 +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2012 +CONFIG_START_MONTH=11 +CONFIG_START_DAY=26 +CONFIG_DEV_CONSOLE=y +CONFIG_DEV_LOWCONSOLE=y +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="ostest_main" +CONFIG_DISABLE_OS_API=y +# CONFIG_DISABLE_CLOCK is not set +# CONFIG_DISABLE_POSIX_TIMERS is not set +# CONFIG_DISABLE_PTHREAD is not set +# CONFIG_DISABLE_SIGNALS is not set +# CONFIG_DISABLE_MQUEUE is not set +# CONFIG_DISABLE_MOUNTPOINT is not set +# CONFIG_DISABLE_ENVIRON is not set +CONFIG_DISABLE_POLL=y # # Sizes of configurable things (0 disables) @@ -179,8 +182,6 @@ CONFIG_NPTHREAD_KEYS=4 CONFIG_NFILE_DESCRIPTORS=8 CONFIG_NFILE_STREAMS=8 CONFIG_NAME_MAX=32 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_NUNGET_CHARS=2 CONFIG_PREALLOC_MQ_MSGS=4 CONFIG_MQ_MAXMSGSIZE=32 CONFIG_MAX_WDOGPARMS=2 @@ -188,235 +189,304 @@ CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=4 # -# Framebuffer driver options -CONFIG_FB_CMAP=n -CONFIG_FB_HWCURSOR=n -CONFIG_FB_HWCURSORIMAGE=n -#CONFIG_FB_HWCURSORSIZE -#CONFIG_FB_TRANSPARENCY +# Stack and heap information +# +# CONFIG_CUSTOM_STACK is not set +CONFIG_IDLETHREAD_STACKSIZE=1024 +CONFIG_USERMAIN_STACKSIZE=1024 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=1024 + +# +# Device Drivers +# +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +CONFIG_MMCSD=y +CONFIG_MMCSD_NSLOTS=1 +# CONFIG_MMCSD_READONLY is not set +# CONFIG_MMCSD_MULTIBLOCK_DISABLE is not set +CONFIG_MMCSD_MMCSUPPORT=y +CONFIG_MMCSD_HAVECARDDETECT=y +CONFIG_MMCSD_SPI=y +CONFIG_MMCSD_SPICLOCK=20000000 +CONFIG_MMCSD_SDIO=y +# CONFIG_SDIO_MUXBUS is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART0=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +CONFIG_UART0_SERIAL_CONSOLE=y +# CONFIG_NO_SERIAL_CONSOLE is not set # -# Filesystem configuration +# UART0 Configuration # -CONFIG_FS_FAT=n -CONFIG_FS_ROMFS=n +CONFIG_UART0_RXBUFSIZE=192 +CONFIG_UART0_TXBUFSIZE=64 +CONFIG_UART0_BAUD=57600 +CONFIG_UART0_BITS=0 +CONFIG_UART0_PARITY=0 +CONFIG_UART0_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set # -# Maintain legacy build behavior (revisit) +# System Logging Device Options # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# System Logging +# +# CONFIG_RAMLOG is not set # -# SPI-based MMC/SD driver +# Networking Support # -CONFIG_MMCSD_NSLOTS=1 -CONFIG_MMCSD_READONLY=n - -# -# TCP/IP and UDP support via uIP -# -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n - -# -# UIP Network Utilities -# -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 - -# -# USB Device Configuration -# -CONFIG_USBDEV=n -CONFIG_USBDEV_ISOCHRONOUS=n -CONFIG_USBDEV_DUALSPEED=n -CONFIG_USBDEV_SELFPOWERED=y -CONFIG_USBDEV_REMOTEWAKEUP=n -CONFIG_USBDEV_MAXPOWER=100 -CONFIG_USBDEV_TRACE=n -CONFIG_USBDEV_TRACE_NRECORDS=128 - -# -# USB Serial Device Configuration -# -CONFIG_PL2303=n -CONFIG_PL2303_EPINTIN=1 -CONFIG_PL2303_EPBULKOUT=2 -CONFIG_PL2303_EPBULKIN=5 -CONFIG_PL2303_NWRREQS=4 -CONFIG_PL2303_NRDREQS=4 -CONFIG_PL2303_VENDORID=0x067b -CONFIG_PL2303_PRODUCTID=0x2303 -CONFIG_PL2303_VENDORSTR="Nuttx" -CONFIG_PL2303_PRODUCTSTR="USBdev Serial" -CONFIG_PL2303_RXBUFSIZE=512 -CONFIG_PL2303_TXBUFSIZE=512 - -# -# USB Storage Device Configuration -# -CONFIG_USBMSC=n -CONFIG_USBMSC_EP0MAXPACKET=64 -CONFIG_USBMSC_EPBULKOUT=2 -CONFIG_USBMSC_EPBULKIN=5 -CONFIG_USBMSC_NRDREQS=2 -CONFIG_USBMSC_NWRREQS=2 -CONFIG_USBMSC_BULKINREQLEN=256 -CONFIG_USBMSC_BULKOUTREQLEN=256 -CONFIG_USBMSC_VENDORID=0x584e -CONFIG_USBMSC_VENDORSTR="NuttX" -CONFIG_USBMSC_PRODUCTID=0x5342 -CONFIG_USBMSC_PRODUCTSTR="USBdev Storage" -CONFIG_USBMSC_VERSIONNO=0x0399 -CONFIG_USBMSC_REMOVABLE=y - -# -CONFIG_NX=n -CONFIG_NX_MULTIUSER=n -CONFIG_NX_NPLANES=1 -CONFIG_NX_DISABLE_1BPP=y -CONFIG_NX_DISABLE_2BPP=y -CONFIG_NX_DISABLE_4BPP=y -CONFIG_NX_DISABLE_8BPP=n -CONFIG_NX_DISABLE_16BPP=y -CONFIG_NX_DISABLE_24BPP=y -CONFIG_NX_DISABLE_32BPP=y -CONFIG_NX_PACKEDMSFIRST=n -CONFIG_NX_MOUSE=y -CONFIG_NX_KBD=y -#CONFIG_NXTK_BORDERWIDTH=4 -#CONFIG_NXTK_BORDERCOLOR1 -#CONFIG_NXTK_BORDERCOLOR2 -CONFIG_NXTK_AUTORAISE=n -CONFIG_NXFONT_SANS23X27=y -CONFIG_NXFONTS_CHARBITS=7 -CONFIG_NX_BLOCKING=y -CONFIG_NX_MXSERVERMSGS=32 -CONFIG_NX_MXCLIENTMSGS=16 - -# -# Settings for examples/poll -CONFIG_EXAMPLES_POLL_NOMAC=y -CONFIG_EXAMPLES_POLL_IPADDR=0x0a000002 -CONFIG_EXAMPLES_POLL_DRIPADDR=0x0a000001 -CONFIG_EXAMPLES_POLL_NETMASK=0xffffff00 - -# -# Settings for examples/uip -CONFIG_EXAMPLES_UIP_IPADDR=0xc0a80080 -CONFIG_EXAMPLES_UIP_DRIPADDR=0xc0a80001 -CONFIG_EXAMPLES_UIP_NETMASK=0xffffff00 -CONFIG_EXAMPLES_UIP_DHCPC=n - -# -# Settings for examples/nettest -CONFIG_EXAMPLES_NETTEST_SERVER=n -CONFIG_EXAMPLES_NETTEST_PERFORMANCE=n -CONFIG_EXAMPLES_NETTEST_NOMAC=n -CONFIG_EXAMPLES_NETTEST_IPADDR=0xc0a80080 -CONFIG_EXAMPLES_NETTEST_DRIPADDR=0xc0a80001 -CONFIG_EXAMPLES_NETTEST_NETMASK=0xffffff00 -CONFIG_EXAMPLES_NETTEST_CLIENTIP=0xc0a8006a - -# -# Settings for examples/ostest +# CONFIG_NET is not set + +# +# File Systems +# + +# +# File system configuration +# +# CONFIG_FS_FAT is not set +# CONFIG_FS_RAMMAP is not set +# CONFIG_FS_NXFFS is not set +# CONFIG_FS_ROMFS is not set + +# +# System Logging +# +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0x00000000 +CONFIG_HEAP2_SIZE=0 +# CONFIG_GRAN is not set + +# +# Binary Formats +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# +CONFIG_STDIO_BUFFER_SIZE=256 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=2 +CONFIG_LIB_HOMEDIR="/" +# CONFIG_LIBM is not set +# CONFIG_NOPRINTF_FIELDWIDTH is not set +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Named Applications +# +# CONFIG_NAMEDAPP is not set + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_NETTEST is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +CONFIG_EXAMPLES_OSTEST=y +# CONFIG_EXAMPLES_OSTEST_BUILTIN is not set CONFIG_EXAMPLES_OSTEST_LOOPS=1 CONFIG_EXAMPLES_OSTEST_STACKSIZE=2048 CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3 +CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000 +CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 +# CONFIG_EXAMPLES_PASHELLO is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WLAN is not set # -# Settings for apps/nshlib -# -CONFIG_NSH_FILEIOSIZE=512 -CONFIG_NSH_STRERROR=n -CONFIG_NSH_LINELEN=64 -CONFIG_NSH_NESTDEPTH=3 -CONFIG_NSH_DISABLESCRIPT=n -CONFIG_NSH_DISABLEBG=n -CONFIG_NSH_ROMFSETC=n -CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 -CONFIG_NSH_ROMFSMOUNTPT="/etc" -CONFIG_NSH_INITSCRIPT="init.d/rcS" -CONFIG_NSH_ROMFSDEVNO=0 -CONFIG_NSH_ROMFSSECTSIZE=64 -CONFIG_NSH_FATDEVNO=1 -CONFIG_NSH_FATSECTSIZE=512 -CONFIG_NSH_FATNSECTORS=1024 -CONFIG_NSH_FATMOUNTPT="/tmp" - -# -# Architecture-specific NSH options -CONFIG_NSH_MMCSDSPIPORTNO=1 -CONFIG_NSH_MMCSDSLOTNO=0 -CONFIG_NSH_MMCSDMINOR=0 - -# -# Settings for examples/nx -# -CONFIG_EXAMPLES_NX_VPLANE=0 -#CONFIG_EXAMPLES_NX_BGCOLOR -#CONFIG_EXAMPLES_NX_COLOR1 -#CONFIG_EXAMPLES_NX_COLOR2 -#CONFIG_EXAMPLES_NX_TBCOLOR -#CONFIG_EXAMPLES_NX_FONTCOLOR -CONFIG_EXAMPLES_NX_BPP=CONFIG_SIM_FBBPP -CONFIG_EXAMPLES_NX_RAWWINDOWS=n -CONFIG_EXAMPLES_NX_STACKSIZE=8192 -CONFIG_EXAMPLES_NX_CLIENTPRIO=80 -CONFIG_EXAMPLES_NX_SERVERPRIO=120 -CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4 - -# -# Settings for examples/mount -CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0" -#CONFIG_EXAMPLES_MOUNT_NSECTORS=2048 -#CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512 -#CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1 - -# -# Settings for examples/wget -# -CONFIG_EXAMPLES_WGET_URL="http://www.nuttx.org/index.html" -CONFIG_EXAMPLES_WGET_NOMAC=y -CONFIG_EXAMPLES_WGET_IPADDR=0x0a000002 -CONFIG_EXAMPLES_WGET_DRIPADDR=0x0a000001 -CONFIG_EXAMPLES_WGET_NETMASK=0xffffff00 +# Interpreters +# # -# Stack and heap information +# Interpreters # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=1024 -CONFIG_USERMAIN_STACKSIZE=1024 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= +# CONFIG_FICL is not set +# CONFIG_PCODE is not set + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# ModBus +# + +# +# FreeModbus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM +# + +# +# System NSH Add-Ons +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set diff --git a/nuttx/configs/ez80f910200zco/ostest/setenv.sh b/nuttx/configs/ez80f910200zco/ostest/setenv.sh index 6150434ef..d8545d5aa 100755 --- a/nuttx/configs/ez80f910200zco/ostest/setenv.sh +++ b/nuttx/configs/ez80f910200zco/ostest/setenv.sh @@ -33,20 +33,31 @@ # # Check how we were executed # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + # -# The ZDS-II toolchain lies outside of the Cygwin "sandbox" and -# attempts to set the PATH variable do not have the desired effect. -# Instead, alias are provided for all of the ZDS-II command line tools. -# Version 5.1.1 installed in the default location is assumed here. +# This is the Cygwin path to location where the XDS-II tools were installed # -ZDSBINDIR="C:/Program\ Files\ \(x86\)/ZiLOG/ZDSII_eZ80Acclaim!_5.1.1/bin" -alias ez80asm="${ZDSBINDIR}/ez80asm.exe" -alias ez80cc="${ZDSBINDIR}/ez80cc.exe" -alias ez80lib="${ZDSBINDIR}/ez80lib.exe" -alias ez80link="${ZDSBINDIR}/ez80link.exe" +TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_5.1.1\bin" +# +# Add the path to the toolchain to the PATH varialble. NOTE that /bin and /usr/bin +# preceded the toolchain bin directory. This is because the ZDSII bin directory +# includes binaries like make.exe that will interfere with the normal build process +# if we do not give priority to the versions at /bin and /usr/bin. +# +export PATH="/bin:/usr/bin:${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +echo "PATH : ${PATH}" diff --git a/nuttx/configs/ez80f910200zco/poll/Make.defs b/nuttx/configs/ez80f910200zco/poll/Make.defs index c9a9a83ea..2d844f742 100644 --- a/nuttx/configs/ez80f910200zco/poll/Make.defs +++ b/nuttx/configs/ez80f910200zco/poll/Make.defs @@ -68,81 +68,79 @@ WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} # Escaped versions -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} +ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} +EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} +EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} # Assembler definitions ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) -ARCHCPU = eZ80F91 -ARCHCPUDEF = _EZ80F91 -ARCHFAMILY = _EZ80ACCLAIM! +ARCHCPU = eZ80F91 +ARCHCPUDEF = _EZ80F91 +ARCHFAMILY = _EZ80ACCLAIM! endif ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHASMOPTIMIZATION = -debug -NOsdiopt + ARCHASMOPTIMIZATION = -debug -NOsdiopt else - ARCHASMOPTIMIZATION = -nodebug -NOsdiopt + ARCHASMOPTIMIZATION = -nodebug -NOsdiopt endif -ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase -ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet -ARCHASMWARNINGS = -warn -ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' -AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) \ - $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) +ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase +ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet +ARCHASMWARNINGS = -warn +ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ +ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' +EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' +AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -reduceopt + ARCHOPTIMIZATION = -debug -reduceopt else - ARCHOPTIMIZATION = -nodebug -optsize + ARCHOPTIMIZATION = -nodebug -optsize endif -ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ - -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" -ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm -ARCHPICFLAGS = -ARCHWARNINGS = -warn -ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' -ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) - -CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include -CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) +ARCHCPUFLAGS = -chartype:S -promote -cpu:$(ARCHCPU) -NOgenprintf -NOmodsect \ + -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" +ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm +ARCHPICFLAGS = +ARCHWARNINGS = -warn +ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) +ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' +ARCHUSRINCLUDES = -usrinc:'.' +ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + +CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ +CPPINCLUDES = -I$(TOPDIR)/include +CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions -ARFLAGS = -quiet -warn +ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/poll/poll.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/poll/poll.linkcmd # Tool names/pathes -CROSSDEV = -CC = $(ZDSBINDIR)/ez80cc.exe -CPP = gcc -E -LD = $(ZDSBINDIR)/ez80link.exe -AS = $(ZDSBINDIR)/ez80asm.exe -AR = $(ZDSBINDIR)/ez80lib.exe +CROSSDEV = +CC = $(ZDSBINDIR)/ez80cc.exe +CPP = gcc -E +LD = $(ZDSBINDIR)/ez80link.exe +AS = $(ZDSBINDIR)/ez80asm.exe +AR = $(ZDSBINDIR)/ez80lib.exe # File extensions -ASMEXT = .asm -OBJEXT = .obj -LIBEXT = .lib -EXEEXT = .lod -HEXEXT = .hex +ASMEXT = .asm +OBJEXT = .obj +LIBEXT = .lib +EXEEXT = .lod +HEXEXT = .hex # These are the macros that will be used in the NuttX make system # to compile and assembly source files and to insert the resulting @@ -183,16 +181,16 @@ endef # This is the tool to use for dependencies (i.e., none) -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +MKDEP = $(TOPDIR)/tools/mknulldeps.sh # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh +DIRLINK = $(TOPDIR)/tools/winlink.sh +DIRUNLINK = $(TOPDIR)/tools/unlink.sh # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTLDFLAGS = diff --git a/nuttx/configs/ez80f910200zco/poll/setenv.sh b/nuttx/configs/ez80f910200zco/poll/setenv.sh index 1628f105b..4370bcb45 100755 --- a/nuttx/configs/ez80f910200zco/poll/setenv.sh +++ b/nuttx/configs/ez80f910200zco/poll/setenv.sh @@ -33,20 +33,31 @@ # # Check how we were executed # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + # -# The ZDS-II toolchain lies outside of the Cygwin "sandbox" and -# attempts to set the PATH variable do not have the desired effect. -# Instead, alias are provided for all of the ZDS-II command line tools. -# Version 5.1.1 installed in the default location is assumed here. +# This is the Cygwin path to location where the XDS-II tools were installed # -ZDSBINDIR="C:/Program\ Files\ \(x86\)/ZiLOG/ZDSII_eZ80Acclaim!_5.1.1/bin" -alias ez80asm="${ZDSBINDIR}/ez80asm.exe" -alias ez80cc="${ZDSBINDIR}/ez80cc.exe" -alias ez80lib="${ZDSBINDIR}/ez80lib.exe" -alias ez80link="${ZDSBINDIR}/ez80link.exe" +TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_5.1.1\bin" +# +# Add the path to the toolchain to the PATH varialble. NOTE that /bin and /usr/bin +# preceded the toolchain bin directory. This is because the ZDSII bin directory +# includes binaries like make.exe that will interfere with the normal build process +# if we do not give priority to the versions at /bin and /usr/bin. +# +export PATH="/bin:/usr/bin:${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +echo "PATH : ${PATH}" diff --git a/nuttx/configs/z16f2800100zcog/ostest/Make.defs b/nuttx/configs/z16f2800100zcog/ostest/Make.defs index e6b5ab4c6..e094f4ce6 100644 --- a/nuttx/configs/z16f2800100zcog/ostest/Make.defs +++ b/nuttx/configs/z16f2800100zcog/ostest/Make.defs @@ -67,74 +67,71 @@ WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} # Escaped versions -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} +ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} +EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} +EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} # Assembler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHASMOPTIMIZATION = -debug + ARCHASMOPTIMIZATION = -debug else - ARCHASMOPTIMIZATION = -nodebug + ARCHASMOPTIMIZATION = -nodebug endif -ARCHASMCPUFLAGS = -cpu:Z16F2811AL -NOigcase -ARCHASMLIST = -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet -ARCHASMWARNINGS = -warn -ARCHASMDEFINES = -define:_Z16F2811AL=1 -define:_Z16K_SERIES=1 -define:_Z16F_SERIES=1 \ -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' -AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) \ - $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) +ARCHASMCPUFLAGS = -cpu:Z16F2811AL -NOigcase +ARCHASMLIST = -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet +ARCHASMWARNINGS = -warn +ARCHASMDEFINES = -define:_Z16F2811AL=1 -define:_Z16K_SERIES=1 -define:_Z16F_SERIES=1 -define:__ASSEMBLY__ +ARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' +AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -NOregvar -reduceopt + ARCHOPTIMIZATION = -debug -NOregvar -reduceopt else - ARCHOPTIMIZATION = -nodebug -regvar + ARCHOPTIMIZATION = -nodebug -regvar endif -ARCHCPUFLAGS = -chartype:S -model:L -NOmodsect -cpu:Z16F2811AL -NOgenprint \ - -asmsw:" $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" -ARCHLIST = -keeplst -NOlist -NOlistinc -NOkeepasm -ARCHPICFLAGS = -ARCHWARNINGS = -warn -ARCHDEFINES = -define:_Z16F2811AL -define:_Z16K_SERIES \ - -define:_Z16F_SERIES -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' -ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) - -CPPDEFINES = -D_Z16F2811AL -D_Z16K_SERIES -D_Z16F_SERIES -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include -CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) +ARCHCPUFLAGS = -chartype:S -model:L -NOmodsect -cpu:Z16F2811AL -NOgenprint \ + -asmsw:" $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" +ARCHLIST = -keeplst -NOlist -NOlistinc -NOkeepasm +ARCHPICFLAGS = +ARCHWARNINGS = -warn +ARCHDEFINES = -define:_Z16F2811AL -define:_Z16K_SERIES -define:_Z16F_SERIES +ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' +ARCHUSRINCLUDES = -usrinc:'.' +ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + +CPPDEFINES = -D_Z16F2811AL -D_Z16K_SERIES -D_Z16F_SERIES -D__ASSEMBLY__ +CPPINCLUDES = -I$(TOPDIR)/include +CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions -ARFLAGS = -quiet -warn +ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/z16f2800100zcog/ostest/ostest.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)/configs/z16f2800100zcog/ostest/ostest.linkcmd # Tool names/pathes -CROSSDEV = -CC = $(ZDSBINDIR)/zneocc.exe -CPP = gcc -E -LD = $(ZDSBINDIR)/zneolink.exe -AS = $(ZDSBINDIR)/zneoasm.exe -AR = $(ZDSBINDIR)/zneolib.exe +CROSSDEV = +CC = $(ZDSBINDIR)/zneocc.exe +CPP = gcc -E +LD = $(ZDSBINDIR)/zneolink.exe +AS = $(ZDSBINDIR)/zneoasm.exe +AR = $(ZDSBINDIR)/zneolib.exe # File extensions -ASMEXT = .asm -OBJEXT = .obj -LIBEXT = .lib -EXEEXT = .hex +ASMEXT = .asm +OBJEXT = .obj +LIBEXT = .lib +EXEEXT = .hex # These are the macros that will be used in the NuttX make system # to compile and assembly source files and to insert the resulting @@ -175,16 +172,16 @@ endef # This is the tool to use for dependencies (i.e., none) -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +MKDEP = $(TOPDIR)/tools/mknulldeps.sh # ZNeo-II cannot follow Cygwin soft links, so we will have to use directory copies -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh +DIRLINK = $(TOPDIR)/tools/winlink.sh +DIRUNLINK = $(TOPDIR)/tools/unlink.sh # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTLDFLAGS = diff --git a/nuttx/configs/z16f2800100zcog/pashello/Make.defs b/nuttx/configs/z16f2800100zcog/pashello/Make.defs index e06d1dc0b..c06dc0d49 100644 --- a/nuttx/configs/z16f2800100zcog/pashello/Make.defs +++ b/nuttx/configs/z16f2800100zcog/pashello/Make.defs @@ -59,82 +59,79 @@ endif # These are the same directories but with the directory separator # character swapped as needed by the ZNeo-II compiler -WTOPDIR := ${shell cygpath -w $(TOPDIR)} -WZDSSTDINCDIR := ${shell cygpath -w $(ZDSSTDINCDIR)} -WZDSZILOGINCDIR := ${shell cygpath -w $(ZDSZILOGINCDIR)} -WZDSSTDLIBDIR := ${shell cygpath -w $(ZDSSTDLIBDIR)} -WZDSZILOGLIBDIR := ${shell cygpath -w $(ZDSZILOGLIBDIR)} +WTOPDIR := ${shell cygpath -w $(TOPDIR)} +WZDSSTDINCDIR := ${shell cygpath -w $(ZDSSTDINCDIR)} +WZDSZILOGINCDIR := ${shell cygpath -w $(ZDSZILOGINCDIR)} +WZDSSTDLIBDIR := ${shell cygpath -w $(ZDSSTDLIBDIR)} +WZDSZILOGLIBDIR := ${shell cygpath -w $(ZDSZILOGLIBDIR)} # Escaped versions -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} +ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} +EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} +EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} # Assembler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHASMOPTIMIZATION = -debug + ARCHASMOPTIMIZATION = -debug else - ARCHASMOPTIMIZATION = -nodebug + ARCHASMOPTIMIZATION = -nodebug endif -ARCHASMCPUFLAGS = -cpu:Z16F2811AL -NOigcase -ARCHASMLIST = -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet -ARCHASMWARNINGS = -warn -ARCHASMDEFINES = -define:_Z16F2811AL=1 -define:_Z16K_SERIES=1 -define:_Z16F_SERIES=1 \ -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' -AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) \ - $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) +ARCHASMCPUFLAGS = -cpu:Z16F2811AL -NOigcase +ARCHASMLIST = -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet +ARCHASMWARNINGS = -warn +ARCHASMDEFINES = -define:_Z16F2811AL=1 -define:_Z16K_SERIES=1 -define:_Z16F_SERIES=1 -define:__ASSEMBLY__ +ARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' +AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -NOregvar -reduceopt + ARCHOPTIMIZATION = -debug -NOregvar -reduceopt else - ARCHOPTIMIZATION = -nodebug -regvar + ARCHOPTIMIZATION = -nodebug -regvar endif -ARCHCPUFLAGS = -chartype:S -model:L -NOmodsect -cpu:Z16F2811AL -NOgenprint \ - -asmsw:" $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" -ARCHLIST = -keeplst -NOlist -NOlistinc -NOkeepasm -ARCHPICFLAGS = -ARCHWARNINGS = -warn -ARCHDEFINES = -define:_Z16F2811AL -define:_Z16K_SERIES \ - -define:_Z16F_SERIES -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' -ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) - -CPPDEFINES = -D_Z16F2811AL -D_Z16K_SERIES -D_Z16F_SERIES -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include -CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) +ARCHCPUFLAGS = -chartype:S -model:L -NOmodsect -cpu:Z16F2811AL -NOgenprint \ + -asmsw:" $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" +ARCHLIST = -keeplst -NOlist -NOlistinc -NOkeepasm +ARCHPICFLAGS = +ARCHWARNINGS = -warn +ARCHDEFINES = -define:_Z16F2811AL -define:_Z16K_SERIES -define:_Z16F_SERIES +ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' +ARCHUSRINCLUDES = -usrinc:'.' +ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + +CPPDEFINES = -D_Z16F2811AL -D_Z16K_SERIES -D_Z16F_SERIES -D__ASSEMBLY__ +CPPINCLUDES = -I$(TOPDIR)/include +CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions -ARFLAGS = -quiet -warn +ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/z16f2800100zcog/pashello/pashello.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)/configs/z16f2800100zcog/pashello/pashello.linkcmd # Tool names/pathes -CROSSDEV = -CC = $(ZDSBINDIR)/zneocc.exe -CPP = gcc -E -LD = $(ZDSBINDIR)/zneolink.exe -AS = $(ZDSBINDIR)/zneoasm.exe -AR = $(ZDSBINDIR)/zneolib.exe +CROSSDEV = +CC = $(ZDSBINDIR)/zneocc.exe +CPP = gcc -E +LD = $(ZDSBINDIR)/zneolink.exe +AS = $(ZDSBINDIR)/zneoasm.exe +AR = $(ZDSBINDIR)/zneolib.exe # File extensions -ASMEXT = .asm -OBJEXT = .obj -LIBEXT = .lib -EXEEXT = .hex +ASMEXT = .asm +OBJEXT = .obj +LIBEXT = .lib +EXEEXT = .hex # These are the macros that will be used in the NuttX make system # to compile and assembly source files and to insert the resulting @@ -175,16 +172,16 @@ endef # This is the tool to use for dependencies (i.e., none) -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +MKDEP = $(TOPDIR)/tools/mknulldeps.sh # ZNeo-II cannot follow Cygwin soft links, so we will have to use directory copies -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh +DIRLINK = $(TOPDIR)/tools/winlink.sh +DIRUNLINK = $(TOPDIR)/tools/unlink.sh # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTLDFLAGS = diff --git a/nuttx/configs/z8encore000zco/ostest/Make.defs b/nuttx/configs/z8encore000zco/ostest/Make.defs index 3991f6867..55e351a79 100644 --- a/nuttx/configs/z8encore000zco/ostest/Make.defs +++ b/nuttx/configs/z8encore000zco/ostest/Make.defs @@ -80,94 +80,92 @@ WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} # Escaped versions -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} +ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} +EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} +EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} # Assembler definitions ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y) -ARCHFAMILYDEF = _Z8ENCORE_F642X -ARCHSERIESDEF = _Z8ENCORE_64K_SERIES -ARCHREVAA = -NOrevaa +ARCHFAMILYDEF = _Z8ENCORE_F642X +ARCHSERIESDEF = _Z8ENCORE_64K_SERIES +ARCHREVAA = -NOrevaa ifeq ($(CONFIG_ARCH_CHIP_Z8F6423),y) -ARCHCPU = Z8F6423 -ARCHCPUDEF = _Z8F6423 +ARCHCPU = Z8F6423 +ARCHCPUDEF = _Z8F6423 endif endif ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) -ARCHFAMILYDEF = _Z8ENCORE_F640X -ARCHSERIESDEF = _Z8ENCORE_640_FAMILY -ARCHREVAA = -revaa +ARCHFAMILYDEF = _Z8ENCORE_F640X +ARCHSERIESDEF = _Z8ENCORE_640_FAMILY +ARCHREVAA = -revaa ifeq ($(CONFIG_ARCH_CHIP_Z8F6403),y) -ARCHCPU = Z8F6403 -ARCHCPUDEF = _Z8F6403 +ARCHCPU = Z8F6403 +ARCHCPUDEF = _Z8F6403 endif endif ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHASMOPTIMIZATION = -debug -sdiopt + ARCHASMOPTIMIZATION = -debug -sdiopt else - ARCHASMOPTIMIZATION = -nodebug -sdiopt + ARCHASMOPTIMIZATION = -nodebug -sdiopt endif -ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase $(ARCHREVAA) -ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet -ARCHASMWARNINGS = -warn -ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHSERIESDEF)=1 -define:$(ARCHFAMILYDEF)=1 \ -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' -AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) \ - $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) +ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase $(ARCHREVAA) +ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet +ARCHASMWARNINGS = -warn +ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHSERIESDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ +ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' +EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' +AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -NOregvar -reduceopt + ARCHOPTIMIZATION = -debug -NOregvar -reduceopt else - ARCHOPTIMIZATION = -nodebug -regvar + ARCHOPTIMIZATION = -nodebug -regvar endif -ARCHCPUFLAGS = -chartype:S -model:L -const:RAM -NOoptlink -promote -cpu:$(ARCHCPU) $(ARCHREVAA) -NOgenprintf \ - -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" -ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm -ARCHPICFLAGS = -ARCHWARNINGS = -warn -ARCHDEFINES = -define:$(ARCHFAMILYDEF) -define:$(ARCHCPUDEF) -define:$(ARCHSERIESDEF) -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR);$(WZDSDEVINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' -ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) - -CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D$(ARCHSERIESDEF) -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include -CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) +ARCHCPUFLAGS = -chartype:S -model:L -const:RAM -NOoptlink -promote -cpu:$(ARCHCPU) $(ARCHREVAA) -NOgenprintf \ + -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" +ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm +ARCHPICFLAGS = +ARCHWARNINGS = -warn +ARCHDEFINES = -define:$(ARCHFAMILYDEF) -define:$(ARCHCPUDEF) -define:$(ARCHSERIESDEF) +ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR);$(WZDSDEVINCDIR)' +ARCHUSRINCLUDES = -usrinc:'.' +ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + +CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D$(ARCHSERIESDEF) -D__ASSEMBLY__ +CPPINCLUDES = -I$(TOPDIR)/include +CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions -ARFLAGS = -quiet -warn +ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/z8encore000zco/ostest/ostest.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)/configs/z8encore000zco/ostest/ostest.linkcmd # Tool names/pathes -CROSSDEV = -CC = $(ZDSBINDIR)/ez8cc.exe -CPP = gcc -E -LD = $(ZDSBINDIR)/ez8link.exe -AS = $(ZDSBINDIR)/ez8asm.exe -AR = $(ZDSBINDIR)/ez8lib.exe +CROSSDEV = +CC = $(ZDSBINDIR)/ez8cc.exe +CPP = gcc -E +LD = $(ZDSBINDIR)/ez8link.exe +AS = $(ZDSBINDIR)/ez8asm.exe +AR = $(ZDSBINDIR)/ez8lib.exe # File extensions -ASMEXT = .asm -OBJEXT = .obj -LIBEXT = .lib -EXEEXT = .hex +ASMEXT = .asm +OBJEXT = .obj +LIBEXT = .lib +EXEEXT = .hex # These are the macros that will be used in the NuttX make system # to compile and assembly source files and to insert the resulting @@ -208,16 +206,16 @@ endef # This is the tool to use for dependencies (i.e., none) -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +MKDEP = $(TOPDIR)/tools/mknulldeps.sh # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh +DIRLINK = $(TOPDIR)/tools/winlink.sh +DIRUNLINK = $(TOPDIR)/tools/unlink.sh # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTLDFLAGS = diff --git a/nuttx/configs/z8f64200100kit/ostest/Make.defs b/nuttx/configs/z8f64200100kit/ostest/Make.defs index 5987934c3..6de98cc87 100644 --- a/nuttx/configs/z8f64200100kit/ostest/Make.defs +++ b/nuttx/configs/z8f64200100kit/ostest/Make.defs @@ -80,94 +80,92 @@ WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} # Escaped versions -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} +ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} +EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} +EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} # Assembler definitions ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y) -ARCHFAMILYDEF = _Z8ENCORE_F642X -ARCHSERIESDEF = _Z8ENCORE_64K_SERIES -ARCHREVAA = -NOrevaa +ARCHFAMILYDEF = _Z8ENCORE_F642X +ARCHSERIESDEF = _Z8ENCORE_64K_SERIES +ARCHREVAA = -NOrevaa ifeq ($(CONFIG_ARCH_CHIP_Z8F6423),y) -ARCHCPU = Z8F6423 -ARCHCPUDEF = _Z8F6423 +ARCHCPU = Z8F6423 +ARCHCPUDEF = _Z8F6423 endif endif ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) -ARCHFAMILYDEF = _Z8ENCORE_F640X -ARCHSERIESDEF = _Z8ENCORE_640_FAMILY -ARCHREVAA = -revaa +ARCHFAMILYDEF = _Z8ENCORE_F640X +ARCHSERIESDEF = _Z8ENCORE_640_FAMILY +ARCHREVAA = -revaa ifeq ($(CONFIG_ARCH_CHIP_Z8F6403),y) -ARCHCPU = Z8F6403 -ARCHCPUDEF = _Z8F6403 +ARCHCPU = Z8F6403 +ARCHCPUDEF = _Z8F6403 endif endif ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHASMOPTIMIZATION = -debug -sdiopt + ARCHASMOPTIMIZATION = -debug -sdiopt else - ARCHASMOPTIMIZATION = -nodebug -sdiopt + ARCHASMOPTIMIZATION = -nodebug -sdiopt endif -ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase $(ARCHREVAA) -ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet -ARCHASMWARNINGS = -warn -ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHSERIESDEF)=1 -define:$(ARCHFAMILYDEF)=1 \ -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' -AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) \ - $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) +ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase $(ARCHREVAA) +ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet +ARCHASMWARNINGS = -warn +ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHSERIESDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ +ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' +EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' +AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -debug -NOregvar -reduceopt + ARCHOPTIMIZATION = -debug -NOregvar -reduceopt else - ARCHOPTIMIZATION = -nodebug -regvar + ARCHOPTIMIZATION = -nodebug -regvar endif -ARCHCPUFLAGS = -chartype:S -model:L -const:RAM -NOoptlink -promote -cpu:$(ARCHCPU) $(ARCHREVAA) -NOgenprintf \ - -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" -ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm -ARCHPICFLAGS = -ARCHWARNINGS = -warn -ARCHDEFINES = -define:$(ARCHFAMILYDEF) -define:$(ARCHCPUDEF) -define:$(ARCHSERIESDEF) -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR);$(WZDSDEVINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' -ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) - -CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D$(ARCHSERIESDEF) -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include -CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) +ARCHCPUFLAGS = -chartype:S -model:L -const:RAM -NOoptlink -promote -cpu:$(ARCHCPU) $(ARCHREVAA) -NOgenprintf \ + -asmsw:" $(ARCHASMCPUFLAGS) $(EARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" +ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm +ARCHPICFLAGS = +ARCHWARNINGS = -warn +ARCHDEFINES = -define:$(ARCHFAMILYDEF) -define:$(ARCHCPUDEF) -define:$(ARCHSERIESDEF) +ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR);$(WZDSDEVINCDIR)' +ARCHUSRINCLUDES = -usrinc:'.' +ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) + +CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D$(ARCHSERIESDEF) -D__ASSEMBLY__ +CPPINCLUDES = -I$(TOPDIR)/include +CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions -ARFLAGS = -quiet -warn +ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/z8f64200100kit/ostest/ostest.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)/configs/z8f64200100kit/ostest/ostest.linkcmd # Tool names/pathes -CROSSDEV = -CC = $(ZDSBINDIR)/ez8cc.exe -CPP = gcc -E -LD = $(ZDSBINDIR)/ez8link.exe -AS = $(ZDSBINDIR)/ez8asm.exe -AR = $(ZDSBINDIR)/ez8lib.exe +CROSSDEV = +CC = $(ZDSBINDIR)/ez8cc.exe +CPP = gcc -E +LD = $(ZDSBINDIR)/ez8link.exe +AS = $(ZDSBINDIR)/ez8asm.exe +AR = $(ZDSBINDIR)/ez8lib.exe # File extensions -ASMEXT = .asm -OBJEXT = .obj -LIBEXT = .lib -EXEEXT = .hex +ASMEXT = .asm +OBJEXT = .obj +LIBEXT = .lib +EXEEXT = .hex # These are the macros that will be used in the NuttX make system # to compile and assembly source files and to insert the resulting @@ -208,16 +206,16 @@ endef # This is the tool to use for dependencies (i.e., none) -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +MKDEP = $(TOPDIR)/tools/mknulldeps.sh # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh +DIRLINK = $(TOPDIR)/tools/winlink.sh +DIRUNLINK = $(TOPDIR)/tools/unlink.sh # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTLDFLAGS = -- cgit v1.2.3 From 285cd255991c1b077d657ea0b3ec376ac67fa5c9 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 26 Nov 2012 18:39:49 +0000 Subject: ez80f910200zco/ostest supports native windows build; other configurations also updated git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5391 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 4 +- nuttx/configs/README.txt | 4 - nuttx/configs/ez80f910200zco/dhcpd/Make.defs | 150 ++++++++++++++++-------- nuttx/configs/ez80f910200zco/httpd/Make.defs | 150 ++++++++++++++++-------- nuttx/configs/ez80f910200zco/nettest/Make.defs | 150 ++++++++++++++++-------- nuttx/configs/ez80f910200zco/nsh/Make.defs | 152 ++++++++++++++++--------- nuttx/configs/ez80f910200zco/ostest/defconfig | 8 +- nuttx/configs/ez80f910200zco/poll/Make.defs | 150 ++++++++++++++++-------- nuttx/configs/ez80f910200zco/src/Makefile | 2 +- 9 files changed, 510 insertions(+), 260 deletions(-) (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index a32577365..4876098ed 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3690,5 +3690,5 @@ CONFIG_STM32_FLASH_PREFETCH. FLASH prefetch will now only be enabled if this option is selected. * confgs/ez80f910200zco/ostest: Now used Kconfig/mconfig configuration - tool. - + tool. Updated to build in native Windows environment. Other ez80f910200zco + build scripts also updated. diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt index b7d9f84d1..b4700433b 100644 --- a/nuttx/configs/README.txt +++ b/nuttx/configs/README.txt @@ -1789,10 +1789,6 @@ configs/pic32mx7mmb Mikroelektronika PIC32MX7 Multimedia Board (MMB). See http://www.mikroe.com/ for further information. - STATUS: Basic OS test configuration is in place, but the board does not boot. - It looks like I will need an ICD3 in order to debug the code (PICkit3 - doesn't work for debug with this board). This effort is temporarily stalled. - configs/pjrc-8051 8051 Microcontroller. This port uses the PJRC 87C52 development system and the SDCC toolchain. This port is not quite ready for prime time. diff --git a/nuttx/configs/ez80f910200zco/dhcpd/Make.defs b/nuttx/configs/ez80f910200zco/dhcpd/Make.defs index 2999e15d6..c914fc263 100644 --- a/nuttx/configs/ez80f910200zco/dhcpd/Make.defs +++ b/nuttx/configs/ez80f910200zco/dhcpd/Make.defs @@ -33,51 +33,67 @@ # ############################################################################ -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/.config +include $(TOPDIR)/tools/Config.mk # These are the directories where the ZDS-II toolchain is installed ZDSVERSION := 5.1.1 -ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) ifeq ($(CONFIG_WINDOWS_NATIVE),y) - ZDSBINDIR := $(ZDSINSTALLDIR)\bin - ZDSSTDINCDIR := $(ZDSINSTALLDIR)\include\std - ZDSZILOGINCDIR := $(ZDSINSTALLDIR)\include\zilog - ZDSSTDLIBDIR := $(ZDSINSTALLDIR)\lib\std - ZDSZILOGLIBDIR := $(ZDSINSTALLDIR)\lib\zilog + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) + INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} + ZDSBINDIR := $(INSTALLDIR)\bin + ZDSSTDINCDIR := $(INSTALLDIR)\include\std + ZDSZILOGINCDIR := $(INSTALLDIR)\include\zilog + ZDSSTDLIBDIR := $(INSTALLDIR)\lib\std + ZDSZILOGLIBDIR := $(INSTALLDIR)\lib\zilog + + # CFLAGs + + ARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + EARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y + ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std ZDSZILOGINCDIR := $(INSTALLDIR)/include/zilog ZDSSTDLIBDIR := $(INSTALLDIR)/lib/std ZDSZILOGLIBDIR := $(INSTALLDIR)/lib/zilog -endif -# These are the same directories but with the directory separator -# character swapped as needed by the ZDS-II compiler + # 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)"} + WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} + WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} -WTOPDIR := ${shell cygpath -w "$(TOPDIR)"} -WZDSSTDINCDIR := ${shell cygpath -w "$(ZDSSTDINCDIR)"} -WZDSZILOGINCDIR := ${shell cygpath -w "$(ZDSZILOGINCDIR)"} -WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} -WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} + # Escaped versions -# Escaped versions + ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} + EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} + EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' +endif # Assembler definitions ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) -ARCHCPU = eZ80F91 -ARCHCPUDEF = _EZ80F91 -ARCHFAMILY = _EZ80ACCLAIM! + ARCHCPU = eZ80F91 + ARCHCPUDEF = _EZ80F91 + ARCHFAMILY = _EZ80ACCLAIM! endif ifeq ($(CONFIG_DEBUG_SYMBOLS),y) @@ -90,8 +106,6 @@ ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet ARCHASMWARNINGS = -warn ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions @@ -108,13 +122,11 @@ ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm ARCHPICFLAGS = ARCHWARNINGS = -warn ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include +CPPINCLUDES = -I$(TOPDIR)$(DELIM)include CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions @@ -123,16 +135,16 @@ ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/dhcpd/dhcpd.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)configs$(DELIM)ez80f910200zco$(DELIM)dhcpd$(DELIM)dhcpd.linkcmd # Tool names/pathes CROSSDEV = -CC = $(ZDSBINDIR)/ez80cc.exe +CC = ez80cc.exe CPP = gcc -E -LD = $(ZDSBINDIR)/ez80link.exe -AS = $(ZDSBINDIR)/ez80asm.exe -AR = $(ZDSBINDIR)/ez80lib.exe +LD = ez80link.exe +AS = ez80asm.exe +AR = ez80lib.exe # File extensions @@ -146,51 +158,89 @@ HEXEXT = .hex # to compile and assembly source files and to insert the resulting # object files into an archive +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + define PREPROCESS - @echo "CPP: $1->$2" + @echo CPP: $1->$2 $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 endef define COMPILE - @#echo "CC: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef define ASSEMBLE - @#echo "AS: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) define ARCHIVE - echo "AR: $2"; + echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef + +define CLEAN + $(Q) if exist *.obj (del /f /q *.obj) + $(Q) if exist *.src (del /f /q *.src) + $(Q) if exist *.lib (del /f /q *.lib) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.lod (del /f /q *.lod) + $(Q) if exist *.lst (del /f /q *.lst) +endef + else + +define PREPROCESS + @echo "CPP: $1->$2" + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) +endef + +define ASSEMBLE + $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) +endef + define ARCHIVE $(Q) for __obj in $(2) ; do \ echo "AR: $$__obj"; \ "$(AR)" $(ARFLAGS) $1=-+$$__obj || { echo "$(AR) $1=-+$$__obj FAILED!" ; exit 1 ; } \ done endef -endif define CLEAN $(Q) rm -f *.obj *.src *.lib *.hex *.lod *.lst endef +endif -# This is the tool to use for dependencies (i.e., none) +# Windows native host tool definitions -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe -# ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + # Windows-native host tools -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif diff --git a/nuttx/configs/ez80f910200zco/httpd/Make.defs b/nuttx/configs/ez80f910200zco/httpd/Make.defs index 1c2ef3b61..5a8af2d34 100644 --- a/nuttx/configs/ez80f910200zco/httpd/Make.defs +++ b/nuttx/configs/ez80f910200zco/httpd/Make.defs @@ -33,51 +33,67 @@ # ############################################################################ -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/.config +include $(TOPDIR)/tools/Config.mk # These are the directories where the ZDS-II toolchain is installed ZDSVERSION := 5.1.1 -ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) ifeq ($(CONFIG_WINDOWS_NATIVE),y) - ZDSBINDIR := $(ZDSINSTALLDIR)\bin - ZDSSTDINCDIR := $(ZDSINSTALLDIR)\include\std - ZDSZILOGINCDIR := $(ZDSINSTALLDIR)\include\zilog - ZDSSTDLIBDIR := $(ZDSINSTALLDIR)\lib\std - ZDSZILOGLIBDIR := $(ZDSINSTALLDIR)\lib\zilog + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) + INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} + ZDSBINDIR := $(INSTALLDIR)\bin + ZDSSTDINCDIR := $(INSTALLDIR)\include\std + ZDSZILOGINCDIR := $(INSTALLDIR)\include\zilog + ZDSSTDLIBDIR := $(INSTALLDIR)\lib\std + ZDSZILOGLIBDIR := $(INSTALLDIR)\lib\zilog + + # CFLAGs + + ARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + EARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y + ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std ZDSZILOGINCDIR := $(INSTALLDIR)/include/zilog ZDSSTDLIBDIR := $(INSTALLDIR)/lib/std ZDSZILOGLIBDIR := $(INSTALLDIR)/lib/zilog -endif -# These are the same directories but with the directory separator -# character swapped as needed by the ZDS-II compiler + # 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)"} + WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} + WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} -WTOPDIR := ${shell cygpath -w "$(TOPDIR)"} -WZDSSTDINCDIR := ${shell cygpath -w "$(ZDSSTDINCDIR)"} -WZDSZILOGINCDIR := ${shell cygpath -w "$(ZDSZILOGINCDIR)"} -WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} -WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} + # Escaped versions -# Escaped versions + ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} + EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} + EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' +endif # Assembler definitions ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) -ARCHCPU = eZ80F91 -ARCHCPUDEF = _EZ80F91 -ARCHFAMILY = _EZ80ACCLAIM! + ARCHCPU = eZ80F91 + ARCHCPUDEF = _EZ80F91 + ARCHFAMILY = _EZ80ACCLAIM! endif ifeq ($(CONFIG_DEBUG_SYMBOLS),y) @@ -90,8 +106,6 @@ ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet ARCHASMWARNINGS = -warn ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions @@ -108,13 +122,11 @@ ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm ARCHPICFLAGS = ARCHWARNINGS = -warn ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include +CPPINCLUDES = -I$(TOPDIR)$(DELIM)include CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions @@ -123,16 +135,16 @@ ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/httpd/httpd.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)configs$(DELIM)ez80f910200zco$(DELIM)httpd$(DELIM)httpd.linkcmd # Tool names/pathes CROSSDEV = -CC = $(ZDSBINDIR)/ez80cc.exe +CC = ez80cc.exe CPP = gcc -E -LD = $(ZDSBINDIR)/ez80link.exe -AS = $(ZDSBINDIR)/ez80asm.exe -AR = $(ZDSBINDIR)/ez80lib.exe +LD = ez80link.exe +AS = ez80asm.exe +AR = ez80lib.exe # File extensions @@ -146,51 +158,89 @@ HEXEXT = .hex # to compile and assembly source files and to insert the resulting # object files into an archive +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + define PREPROCESS - @echo "CPP: $1->$2" + @echo CPP: $1->$2 $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 endef define COMPILE - @#echo "CC: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef define ASSEMBLE - @#echo "AS: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) define ARCHIVE - echo "AR: $2"; + echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef + +define CLEAN + $(Q) if exist *.obj (del /f /q *.obj) + $(Q) if exist *.src (del /f /q *.src) + $(Q) if exist *.lib (del /f /q *.lib) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.lod (del /f /q *.lod) + $(Q) if exist *.lst (del /f /q *.lst) +endef + else + +define PREPROCESS + @echo "CPP: $1->$2" + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) +endef + +define ASSEMBLE + $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) +endef + define ARCHIVE $(Q) for __obj in $(2) ; do \ echo "AR: $$__obj"; \ "$(AR)" $(ARFLAGS) $1=-+$$__obj || { echo "$(AR) $1=-+$$__obj FAILED!" ; exit 1 ; } \ done endef -endif define CLEAN $(Q) rm -f *.obj *.src *.lib *.hex *.lod *.lst endef +endif -# This is the tool to use for dependencies (i.e., none) +# Windows native host tool definitions -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe -# ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + # Windows-native host tools -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif diff --git a/nuttx/configs/ez80f910200zco/nettest/Make.defs b/nuttx/configs/ez80f910200zco/nettest/Make.defs index bfd958568..f5cbc8f80 100644 --- a/nuttx/configs/ez80f910200zco/nettest/Make.defs +++ b/nuttx/configs/ez80f910200zco/nettest/Make.defs @@ -33,51 +33,67 @@ # ############################################################################ -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/.config +include $(TOPDIR)/tools/Config.mk # These are the directories where the ZDS-II toolchain is installed ZDSVERSION := 5.1.1 -ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) ifeq ($(CONFIG_WINDOWS_NATIVE),y) - ZDSBINDIR := $(ZDSINSTALLDIR)\bin - ZDSSTDINCDIR := $(ZDSINSTALLDIR)\include\std - ZDSZILOGINCDIR := $(ZDSINSTALLDIR)\include\zilog - ZDSSTDLIBDIR := $(ZDSINSTALLDIR)\lib\std - ZDSZILOGLIBDIR := $(ZDSINSTALLDIR)\lib\zilog + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) + INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} + ZDSBINDIR := $(INSTALLDIR)\bin + ZDSSTDINCDIR := $(INSTALLDIR)\include\std + ZDSZILOGINCDIR := $(INSTALLDIR)\include\zilog + ZDSSTDLIBDIR := $(INSTALLDIR)\lib\std + ZDSZILOGLIBDIR := $(INSTALLDIR)\lib\zilog + + # CFLAGs + + ARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + EARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y + ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std ZDSZILOGINCDIR := $(INSTALLDIR)/include/zilog ZDSSTDLIBDIR := $(INSTALLDIR)/lib/std ZDSZILOGLIBDIR := $(INSTALLDIR)/lib/zilog -endif -# These are the same directories but with the directory separator -# character swapped as needed by the ZDS-II compiler + # 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)"} + WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} + WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} -WTOPDIR := ${shell cygpath -w "$(TOPDIR)"} -WZDSSTDINCDIR := ${shell cygpath -w "$(ZDSSTDINCDIR)"} -WZDSZILOGINCDIR := ${shell cygpath -w "$(ZDSZILOGINCDIR)"} -WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} -WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} + # Escaped versions -# Escaped versions + ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} + EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} + EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' +endif # Assembler definitions ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) -ARCHCPU = eZ80F91 -ARCHCPUDEF = _EZ80F91 -ARCHFAMILY = _EZ80ACCLAIM! + ARCHCPU = eZ80F91 + ARCHCPUDEF = _EZ80F91 + ARCHFAMILY = _EZ80ACCLAIM! endif ifeq ($(CONFIG_DEBUG_SYMBOLS),y) @@ -90,8 +106,6 @@ ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet ARCHASMWARNINGS = -warn ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions @@ -108,13 +122,11 @@ ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm ARCHPICFLAGS = ARCHWARNINGS = -warn ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include +CPPINCLUDES = -I$(TOPDIR)$(DELIM)include CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions @@ -123,16 +135,16 @@ ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/nettest/nettest.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)configs$(DELIM)ez80f910200zco$(DELIM)nettest$(DELIM)nettest.linkcmd # Tool names/pathes CROSSDEV = -CC = $(ZDSBINDIR)/ez80cc.exe +CC = ez80cc.exe CPP = gcc -E -LD = $(ZDSBINDIR)/ez80link.exe -AS = $(ZDSBINDIR)/ez80asm.exe -AR = $(ZDSBINDIR)/ez80lib.exe +LD = ez80link.exe +AS = ez80asm.exe +AR = ez80lib.exe # File extensions @@ -146,51 +158,89 @@ HEXEXT = .hex # to compile and assembly source files and to insert the resulting # object files into an archive +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + define PREPROCESS - @echo "CPP: $1->$2" + @echo CPP: $1->$2 $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 endef define COMPILE - @#echo "CC: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef define ASSEMBLE - @#echo "AS: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) define ARCHIVE - echo "AR: $2"; + echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef + +define CLEAN + $(Q) if exist *.obj (del /f /q *.obj) + $(Q) if exist *.src (del /f /q *.src) + $(Q) if exist *.lib (del /f /q *.lib) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.lod (del /f /q *.lod) + $(Q) if exist *.lst (del /f /q *.lst) +endef + else + +define PREPROCESS + @echo "CPP: $1->$2" + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) +endef + +define ASSEMBLE + $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) +endef + define ARCHIVE $(Q) for __obj in $(2) ; do \ echo "AR: $$__obj"; \ "$(AR)" $(ARFLAGS) $1=-+$$__obj || { echo "$(AR) $1=-+$$__obj FAILED!" ; exit 1 ; } \ done endef -endif define CLEAN $(Q) rm -f *.obj *.src *.lib *.hex *.lod *.lst endef +endif -# This is the tool to use for dependencies (i.e., none) +# Windows native host tool definitions -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe -# ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + # Windows-native host tools -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif diff --git a/nuttx/configs/ez80f910200zco/nsh/Make.defs b/nuttx/configs/ez80f910200zco/nsh/Make.defs index 3bc219ab9..f0b8aa7c1 100644 --- a/nuttx/configs/ez80f910200zco/nsh/Make.defs +++ b/nuttx/configs/ez80f910200zco/nsh/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# configs/ez80f910200zco/nst/Make.defs +# configs/ez80f910200zco/nsh/Make.defs # # Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -33,51 +33,67 @@ # ############################################################################ -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/.config +include $(TOPDIR)/tools/Config.mk # These are the directories where the ZDS-II toolchain is installed ZDSVERSION := 5.1.1 -ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) ifeq ($(CONFIG_WINDOWS_NATIVE),y) - ZDSBINDIR := $(ZDSINSTALLDIR)\bin - ZDSSTDINCDIR := $(ZDSINSTALLDIR)\include\std - ZDSZILOGINCDIR := $(ZDSINSTALLDIR)\include\zilog - ZDSSTDLIBDIR := $(ZDSINSTALLDIR)\lib\std - ZDSZILOGLIBDIR := $(ZDSINSTALLDIR)\lib\zilog + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) + INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} + ZDSBINDIR := $(INSTALLDIR)\bin + ZDSSTDINCDIR := $(INSTALLDIR)\include\std + ZDSZILOGINCDIR := $(INSTALLDIR)\include\zilog + ZDSSTDLIBDIR := $(INSTALLDIR)\lib\std + ZDSZILOGLIBDIR := $(INSTALLDIR)\lib\zilog + + # CFLAGs + + ARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + EARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y + ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std ZDSZILOGINCDIR := $(INSTALLDIR)/include/zilog ZDSSTDLIBDIR := $(INSTALLDIR)/lib/std ZDSZILOGLIBDIR := $(INSTALLDIR)/lib/zilog -endif -# These are the same directories but with the directory separator -# character swapped as needed by the ZDS-II compiler + # 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)"} + WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} + WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} -WTOPDIR := ${shell cygpath -w "$(TOPDIR)"} -WZDSSTDINCDIR := ${shell cygpath -w "$(ZDSSTDINCDIR)"} -WZDSZILOGINCDIR := ${shell cygpath -w "$(ZDSZILOGINCDIR)"} -WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} -WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} + # Escaped versions -# Escaped versions + ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} + EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} + EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' +endif # Assembler definitions ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) -ARCHCPU = eZ80F91 -ARCHCPUDEF = _EZ80F91 -ARCHFAMILY = _EZ80ACCLAIM! + ARCHCPU = eZ80F91 + ARCHCPUDEF = _EZ80F91 + ARCHFAMILY = _EZ80ACCLAIM! endif ifeq ($(CONFIG_DEBUG_SYMBOLS),y) @@ -90,8 +106,6 @@ ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet ARCHASMWARNINGS = -warn ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions @@ -108,13 +122,11 @@ ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm ARCHPICFLAGS = ARCHWARNINGS = -warn ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include +CPPINCLUDES = -I$(TOPDIR)$(DELIM)include CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions @@ -123,16 +135,16 @@ ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/nsh/nsh.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)configs$(DELIM)ez80f910200zco$(DELIM)nsh$(DELIM)nsh.linkcmd # Tool names/pathes CROSSDEV = -CC = $(ZDSBINDIR)/ez80cc.exe +CC = ez80cc.exe CPP = gcc -E -LD = $(ZDSBINDIR)/ez80link.exe -AS = $(ZDSBINDIR)/ez80asm.exe -AR = $(ZDSBINDIR)/ez80lib.exe +LD = ez80link.exe +AS = ez80asm.exe +AR = ez80lib.exe # File extensions @@ -146,51 +158,89 @@ HEXEXT = .hex # to compile and assembly source files and to insert the resulting # object files into an archive +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + define PREPROCESS - @echo "CPP: $1->$2" + @echo CPP: $1->$2 $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 endef define COMPILE - @#echo "CC: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef define ASSEMBLE - @#echo "AS: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) define ARCHIVE - echo "AR: $2"; + echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef + +define CLEAN + $(Q) if exist *.obj (del /f /q *.obj) + $(Q) if exist *.src (del /f /q *.src) + $(Q) if exist *.lib (del /f /q *.lib) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.lod (del /f /q *.lod) + $(Q) if exist *.lst (del /f /q *.lst) +endef + else + +define PREPROCESS + @echo "CPP: $1->$2" + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) +endef + +define ASSEMBLE + $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) +endef + define ARCHIVE $(Q) for __obj in $(2) ; do \ echo "AR: $$__obj"; \ "$(AR)" $(ARFLAGS) $1=-+$$__obj || { echo "$(AR) $1=-+$$__obj FAILED!" ; exit 1 ; } \ done endef -endif define CLEAN $(Q) rm -f *.obj *.src *.lib *.hex *.lod *.lst endef +endif -# This is the tool to use for dependencies (i.e., none) +# Windows native host tool definitions -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe -# ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + # Windows-native host tools -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif diff --git a/nuttx/configs/ez80f910200zco/ostest/defconfig b/nuttx/configs/ez80f910200zco/ostest/defconfig index b443fdf93..c82a60e3a 100644 --- a/nuttx/configs/ez80f910200zco/ostest/defconfig +++ b/nuttx/configs/ez80f910200zco/ostest/defconfig @@ -8,10 +8,14 @@ CONFIG_NUTTX_NEWCONFIG=y # Build Setup # # CONFIG_EXPERIMENTAL is not set -CONFIG_HOST_LINUX=y +# CONFIG_HOST_LINUX is not set # CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set +CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +# CONFIG_WINDOWS_NATIVE is not set +CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set # # Build Configuration diff --git a/nuttx/configs/ez80f910200zco/poll/Make.defs b/nuttx/configs/ez80f910200zco/poll/Make.defs index 2d844f742..e1eefdd03 100644 --- a/nuttx/configs/ez80f910200zco/poll/Make.defs +++ b/nuttx/configs/ez80f910200zco/poll/Make.defs @@ -33,51 +33,67 @@ # ############################################################################ -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/.config +include $(TOPDIR)/tools/Config.mk # These are the directories where the ZDS-II toolchain is installed ZDSVERSION := 5.1.1 -ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) ifeq ($(CONFIG_WINDOWS_NATIVE),y) - ZDSBINDIR := $(ZDSINSTALLDIR)\bin - ZDSSTDINCDIR := $(ZDSINSTALLDIR)\include\std - ZDSZILOGINCDIR := $(ZDSINSTALLDIR)\include\zilog - ZDSSTDLIBDIR := $(ZDSINSTALLDIR)\lib\std - ZDSZILOGLIBDIR := $(ZDSINSTALLDIR)\lib\zilog + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) + INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} + ZDSBINDIR := $(INSTALLDIR)\bin + ZDSSTDINCDIR := $(INSTALLDIR)\include\std + ZDSZILOGINCDIR := $(INSTALLDIR)\include\zilog + ZDSSTDLIBDIR := $(INSTALLDIR)\lib\std + ZDSZILOGLIBDIR := $(INSTALLDIR)\lib\zilog + + # CFLAGs + + ARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + EARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y + ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std ZDSZILOGINCDIR := $(INSTALLDIR)/include/zilog ZDSSTDLIBDIR := $(INSTALLDIR)/lib/std ZDSZILOGLIBDIR := $(INSTALLDIR)/lib/zilog -endif -# These are the same directories but with the directory separator -# character swapped as needed by the ZDS-II compiler + # 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)"} + WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} + WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} -WTOPDIR := ${shell cygpath -w "$(TOPDIR)"} -WZDSSTDINCDIR := ${shell cygpath -w "$(ZDSSTDINCDIR)"} -WZDSZILOGINCDIR := ${shell cygpath -w "$(ZDSZILOGINCDIR)"} -WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} -WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} + # Escaped versions -# Escaped versions + ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} + EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} + EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' +endif # Assembler definitions ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) -ARCHCPU = eZ80F91 -ARCHCPUDEF = _EZ80F91 -ARCHFAMILY = _EZ80ACCLAIM! + ARCHCPU = eZ80F91 + ARCHCPUDEF = _EZ80F91 + ARCHFAMILY = _EZ80ACCLAIM! endif ifeq ($(CONFIG_DEBUG_SYMBOLS),y) @@ -90,8 +106,6 @@ ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet ARCHASMWARNINGS = -warn ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions @@ -108,13 +122,11 @@ ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm ARCHPICFLAGS = ARCHWARNINGS = -warn ARCHDEFINES = -define:$(ARCHCPUDEF) -define:$(ARCHFAMILYDEF) -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include +CPPINCLUDES = -I$(TOPDIR)$(DELIM)include CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions @@ -123,16 +135,16 @@ ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/ez80f910200zco/poll/poll.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)configs$(DELIM)ez80f910200zco$(DELIM)poll$(DELIM)poll.linkcmd # Tool names/pathes CROSSDEV = -CC = $(ZDSBINDIR)/ez80cc.exe +CC = ez80cc.exe CPP = gcc -E -LD = $(ZDSBINDIR)/ez80link.exe -AS = $(ZDSBINDIR)/ez80asm.exe -AR = $(ZDSBINDIR)/ez80lib.exe +LD = ez80link.exe +AS = ez80asm.exe +AR = ez80lib.exe # File extensions @@ -146,51 +158,89 @@ HEXEXT = .hex # to compile and assembly source files and to insert the resulting # object files into an archive +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + define PREPROCESS - @echo "CPP: $1->$2" + @echo CPP: $1->$2 $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 endef define COMPILE - @#echo "CC: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef define ASSEMBLE - @#echo "AS: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) define ARCHIVE - echo "AR: $2"; + echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef + +define CLEAN + $(Q) if exist *.obj (del /f /q *.obj) + $(Q) if exist *.src (del /f /q *.src) + $(Q) if exist *.lib (del /f /q *.lib) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.lod (del /f /q *.lod) + $(Q) if exist *.lst (del /f /q *.lst) +endef + else + +define PREPROCESS + @echo "CPP: $1->$2" + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) +endef + +define ASSEMBLE + $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) +endef + define ARCHIVE $(Q) for __obj in $(2) ; do \ echo "AR: $$__obj"; \ "$(AR)" $(ARFLAGS) $1=-+$$__obj || { echo "$(AR) $1=-+$$__obj FAILED!" ; exit 1 ; } \ done endef -endif define CLEAN $(Q) rm -f *.obj *.src *.lib *.hex *.lod *.lst endef +endif -# This is the tool to use for dependencies (i.e., none) +# Windows native host tool definitions -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe -# ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + # Windows-native host tools -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif diff --git a/nuttx/configs/ez80f910200zco/src/Makefile b/nuttx/configs/ez80f910200zco/src/Makefile index 216f42290..d9f028f11 100644 --- a/nuttx/configs/ez80f910200zco/src/Makefile +++ b/nuttx/configs/ez80f910200zco/src/Makefile @@ -39,7 +39,7 @@ SCHEDSRCDIR = $(TOPDIR)$(DELIM)sched ARCHSRCDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src ifeq ($(CONFIG_WINDOWS_NATIVE),y) - USRINCLUDES = -usrinc:'.;$(SCHEDSRCDIR);$(ARCHSRCDIR);$(ARCHSRCDIR)\common' + USRINCLUDES = -usrinc:".;$(SCHEDSRCDIR);$(ARCHSRCDIR);$(ARCHSRCDIR)\common" else WSCHEDSRCDIR = ${shell cygpath -w $(SCHEDSRCDIR)} WARCHSRCDIR = ${shell cygpath -w $(ARCHSRCDIR)} -- cgit v1.2.3 From 8c5b57d449bae1b9f5b3b501356e486439f93ae0 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 27 Nov 2012 15:09:12 +0000 Subject: configs/z8f64200100kit/ostest at same level as ez80 configurations; nuttx/arch/arm/src/lpc17xx/lpc17_i2c.cuninitialization fix git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5392 42af7a65-404d-4744-a932-0658087f49c3 --- apps/ChangeLog.txt | 4 +- apps/examples/relays/Makefile | 2 +- apps/netutils/codecs/md5.c | 1 + nuttx/ChangeLog | 5 + nuttx/arch/arm/src/lpc17xx/lpc17_i2c.c | 541 +++++++++++++----------- nuttx/configs/z8f64200100kit/ostest/Make.defs | 176 +++++--- nuttx/configs/z8f64200100kit/ostest/setenv.sh | 35 +- nuttx/configs/z8f64200100kit/scripts/setenv.bat | 50 +++ 8 files changed, 496 insertions(+), 318 deletions(-) create mode 100644 nuttx/configs/z8f64200100kit/scripts/setenv.bat (limited to 'nuttx') diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index c1c5189c4..3d09915c3 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -33,7 +33,7 @@ 6.3 2011-05-15 Gregory Nutt - * apps/interpreter: Add a directory to hold interpreters. The Pascal add- + * apps/interpreter: Add a directory to hold interpreters. The Pascal add- on module now installs and builds under this directory. * apps/interpreter/ficl: Added logic to build Ficl (the "Forth Inspired Command Language"). See http://ficl.sourceforge.net/. @@ -421,4 +421,4 @@ make foreach loops instead of shell loops. * apps/examples/elf/test/*/Makefile: OSX doesn't support install -D, use mkdir -p then install without the -D. From Mike Smith. - + * apps/examples/relays/Makefile: Reduced stack requirement (Darcy Gong). diff --git a/apps/examples/relays/Makefile b/apps/examples/relays/Makefile index 9d7b036d3..8e91ab572 100644 --- a/apps/examples/relays/Makefile +++ b/apps/examples/relays/Makefile @@ -64,7 +64,7 @@ ROOTDEPPATH = --dep-path . APPNAME = relays PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 +STACKSIZE = 512 # Common build diff --git a/apps/netutils/codecs/md5.c b/apps/netutils/codecs/md5.c index bf0394b9d..eb564973f 100644 --- a/apps/netutils/codecs/md5.c +++ b/apps/netutils/codecs/md5.c @@ -82,6 +82,7 @@ # define F4(x, y, z) (y ^ (x | ~z)) /* This is the central step in the MD5 algorithm. */ + # define MD5STEP(f, w, x, y, z, data, s) \ ( w += f(x, y, z) + data, w = w<>(32-s), w += x ) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 4876098ed..9e8ddf44d 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3692,3 +3692,8 @@ * confgs/ez80f910200zco/ostest: Now used Kconfig/mconfig configuration tool. Updated to build in native Windows environment. Other ez80f910200zco build scripts also updated. + * configs/z8f64200100kit/ostest: Update to same level as ez80 configurations. + * nuttx/configs/z8f64200100kit/scripts/setenv.bat: Add support for native + Windows build. + * nuttx/arch/arm/src/lpc17xx/lpc17_i2c.c: Resources not being released when + I2C is uninitialized. diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_i2c.c b/nuttx/arch/arm/src/lpc17xx/lpc17_i2c.c index 48d6fefce..935dbfa0c 100644 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_i2c.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_i2c.c @@ -67,7 +67,6 @@ #include "up_internal.h" #include "os_internal.h" - #include "lpc17_internal.h" #include "lpc17_syscon.h" #include "lpc17_pinconn.h" @@ -79,12 +78,15 @@ #define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 #define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 #endif + #ifndef CONFIG_I2C0_FREQ #define CONFIG_I2C0_FREQ 100000 #endif + #ifndef CONFIG_I2C1_FREQ #define CONFIG_I2C1_FREQ 100000 #endif + #ifndef CONFIG_I2C2_FREQ #define CONFIG_I2C2_FREQ 100000 #endif @@ -93,44 +95,46 @@ * Definitions *******************************************************************************/ -/**************************************************************************** +/******************************************************************************* * Pre-processor Definitions - ****************************************************************************/ + *******************************************************************************/ #define I2C_TIMEOUT ((20 * CLK_TCK) / 1000) /* 20 mS */ -/**************************************************************************** +/******************************************************************************* * Private Data - ****************************************************************************/ + *******************************************************************************/ + struct lpc17_i2cdev_s { - struct i2c_dev_s dev; /* Generic I2C device */ - struct i2c_msg_s msg; /* a single message for legacy read/write */ - unsigned int base; /* Base address of registers */ - uint16_t irqid; /* IRQ for this device */ - - sem_t mutex; /* Only one thread can access at a time */ - sem_t wait; /* Place to wait for state machine completion */ - volatile uint8_t state; /* State of state machine */ - WDOG_ID timeout; /* watchdog to timeout when bus hung */ - - uint16_t wrcnt; /* number of bytes sent to tx fifo */ - uint16_t rdcnt; /* number of bytes read from rx fifo */ + struct i2c_dev_s dev; /* Generic I2C device */ + struct i2c_msg_s msg; /* a single message for legacy read/write */ + unsigned int base; /* Base address of registers */ + uint16_t irqid; /* IRQ for this device */ + + sem_t mutex; /* Only one thread can access at a time */ + sem_t wait; /* Place to wait for state machine completion */ + volatile uint8_t state; /* State of state machine */ + WDOG_ID timeout; /* watchdog to timeout when bus hung */ + + uint16_t wrcnt; /* number of bytes sent to tx fifo */ + uint16_t rdcnt; /* number of bytes read from rx fifo */ }; static struct lpc17_i2cdev_s i2cdevices[3]; -/**************************************************************************** +/******************************************************************************* * Private Functions - ****************************************************************************/ -static int i2c_start (struct lpc17_i2cdev_s *priv); -static void i2c_stop (struct lpc17_i2cdev_s *priv); -static int i2c_interrupt (int irq, FAR void *context); -static void i2c_timeout (int argc, uint32_t arg, ...); + *******************************************************************************/ + +static int i2c_start(struct lpc17_i2cdev_s *priv); +static void i2c_stop(struct lpc17_i2cdev_s *priv); +static int i2c_interrupt(int irq, FAR void *context); +static void i2c_timeout(int argc, uint32_t arg, ...); -/**************************************************************************** +/******************************************************************************* * I2C device operations - ****************************************************************************/ + *******************************************************************************/ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency); static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits); @@ -140,12 +144,12 @@ static int i2c_transfer(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms struct i2c_ops_s lpc17_i2c_ops = { - .setfrequency = i2c_setfrequency, - .setaddress = i2c_setaddress, - .write = i2c_write, - .read = i2c_read, + .setfrequency = i2c_setfrequency, + .setaddress = i2c_setaddress, + .write = i2c_write, + .read = i2c_read, #ifdef CONFIG_I2C_TRANSFER - .transfer = i2c_transfer + .transfer = i2c_transfer #endif }; @@ -159,23 +163,26 @@ struct i2c_ops_s lpc17_i2c_ops = static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) { - struct lpc17_i2cdev_s *priv = (struct lpc17_i2cdev_s *) dev; + struct lpc17_i2cdev_s *priv = (struct lpc17_i2cdev_s *) dev; - if (frequency > 100000) + if (frequency > 100000) { - /* asymetric per 400Khz I2C spec */ - putreg32 ( LPC17_CCLK / (83 + 47) * 47 / frequency, priv->base + LPC17_I2C_SCLH_OFFSET); - putreg32 ( LPC17_CCLK / (83 + 47) * 83 / frequency, priv->base + LPC17_I2C_SCLL_OFFSET); + /* asymetric per 400Khz I2C spec */ + + putreg32(LPC17_CCLK / (83 + 47) * 47 / frequency, priv->base + LPC17_I2C_SCLH_OFFSET); + putreg32(LPC17_CCLK / (83 + 47) * 83 / frequency, priv->base + LPC17_I2C_SCLL_OFFSET); } - else + else { - /* 50/50 mark space ratio */ - putreg32 (LPC17_CCLK / 100 * 50 / frequency, priv->base + LPC17_I2C_SCLH_OFFSET); - putreg32 (LPC17_CCLK / 100 * 50 / frequency, priv->base + LPC17_I2C_SCLL_OFFSET); + /* 50/50 mark space ratio */ + + putreg32(LPC17_CCLK / 100 * 50 / frequency, priv->base + LPC17_I2C_SCLH_OFFSET); + putreg32(LPC17_CCLK / 100 * 50 / frequency, priv->base + LPC17_I2C_SCLL_OFFSET); } - /* FIXME: This function should return the actual selected frequency */ - return frequency; + /* FIXME: This function should return the actual selected frequency */ + + return frequency; } /******************************************************************************* @@ -185,17 +192,18 @@ static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency) * Set the I2C slave address for a subsequent read/write * *******************************************************************************/ + static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) { - struct lpc17_i2cdev_s *priv = (struct lpc17_i2cdev_s *) dev; + struct lpc17_i2cdev_s *priv = (struct lpc17_i2cdev_s *) dev; - DEBUGASSERT(dev != NULL); - DEBUGASSERT(nbits == 7 ); + DEBUGASSERT(dev != NULL); + DEBUGASSERT(nbits == 7 ); - priv->msg.addr = addr<<1; - priv->msg.flags = 0 ; + priv->msg.addr = addr<<1; + priv->msg.flags = 0 ; - return OK; + return OK; } /******************************************************************************* @@ -206,22 +214,23 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits) * frequency and slave address. * *******************************************************************************/ + static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen) { - struct lpc17_i2cdev_s *priv = (struct lpc17_i2cdev_s *) dev; - int ret; + struct lpc17_i2cdev_s *priv = (struct lpc17_i2cdev_s *) dev; + int ret; - DEBUGASSERT (dev != NULL); + DEBUGASSERT(dev != NULL); - priv->wrcnt=0; - priv->rdcnt=0; - priv->msg.addr &= ~0x01; - priv->msg.buffer = (uint8_t*)buffer; - priv->msg.length = buflen; - - ret = i2c_start (priv); + priv->wrcnt = 0; + priv->rdcnt = 0; + priv->msg.addr &= ~0x01; + priv->msg.buffer = (uint8_t*)buffer; + priv->msg.length = buflen; + + ret = i2c_start(priv); - return ret >0 ? OK : -ETIMEDOUT; + return ret > 0 ? OK : -ETIMEDOUT; } /******************************************************************************* @@ -232,22 +241,23 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int bufle * frequency and slave address. * *******************************************************************************/ + static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen) { - struct lpc17_i2cdev_s *priv = (struct lpc17_i2cdev_s *) dev; - int ret; + struct lpc17_i2cdev_s *priv = (struct lpc17_i2cdev_s *) dev; + int ret; - DEBUGASSERT (dev != NULL); + DEBUGASSERT(dev != NULL); - priv->wrcnt=0; - priv->rdcnt=0; - priv->msg.addr |= 0x01; - priv->msg.buffer = buffer; - priv->msg.length = buflen; + priv->wrcnt = 0; + priv->rdcnt = 0; + priv->msg.addr |= 0x01; + priv->msg.buffer = buffer; + priv->msg.length = buflen; - ret = i2c_start (priv); + ret = i2c_start(priv); - return ret >0 ? OK : -ETIMEDOUT; + return ret > 0 ? OK : -ETIMEDOUT; } /******************************************************************************* @@ -257,24 +267,31 @@ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen) * Perform a I2C transfer start * *******************************************************************************/ -static int i2c_start (struct lpc17_i2cdev_s *priv) + +static int i2c_start(struct lpc17_i2cdev_s *priv) { - int ret=-1; - sem_wait (&priv->mutex); - - putreg32(I2C_CONCLR_STAC|I2C_CONCLR_SIC,priv->base+LPC17_I2C_CONCLR_OFFSET); - putreg32(I2C_CONSET_STA,priv->base+LPC17_I2C_CONSET_OFFSET); - - wd_start (priv->timeout, I2C_TIMEOUT, i2c_timeout, 1, (uint32_t)priv); - sem_wait(&priv->wait); - wd_cancel (priv->timeout); - sem_post (&priv->mutex); - - if( priv-> state == 0x18 || priv->state == 0x28) - ret=priv->wrcnt; - else if( priv-> state == 0x50 || priv->state == 0x58) - ret=priv->rdcnt; - return ret; + int ret = -1; + + sem_wait(&priv->mutex); + + putreg32(I2C_CONCLR_STAC|I2C_CONCLR_SIC, priv->base+LPC17_I2C_CONCLR_OFFSET); + putreg32(I2C_CONSET_STA, priv->base+LPC17_I2C_CONSET_OFFSET); + + wd_start(priv->timeout, I2C_TIMEOUT, i2c_timeout, 1, (uint32_t)priv); + sem_wait(&priv->wait); + wd_cancel(priv->timeout); + sem_post(&priv->mutex); + + if (priv-> state == 0x18 || priv->state == 0x28) + { + ret = priv->wrcnt; + } + else if (priv-> state == 0x50 || priv->state == 0x58) + { + ret = priv->rdcnt; + } + + return ret; } /******************************************************************************* @@ -284,11 +301,15 @@ static int i2c_start (struct lpc17_i2cdev_s *priv) * Perform a I2C transfer stop * *******************************************************************************/ -static void i2c_stop (struct lpc17_i2cdev_s *priv) + +static void i2c_stop(struct lpc17_i2cdev_s *priv) { - if(priv->state!=0x38) - putreg32(I2C_CONSET_STO|I2C_CONSET_AA,priv->base+LPC17_I2C_CONSET_OFFSET); - sem_post (&priv->wait); + if (priv->state != 0x38) + { + putreg32(I2C_CONSET_STO|I2C_CONSET_AA,priv->base+LPC17_I2C_CONSET_OFFSET); + } + + sem_post(&priv->wait); } /******************************************************************************* @@ -299,14 +320,14 @@ static void i2c_stop (struct lpc17_i2cdev_s *priv) * *******************************************************************************/ -static void i2c_timeout (int argc, uint32_t arg, ...) +static void i2c_timeout(int argc, uint32_t arg, ...) { - struct lpc17_i2cdev_s *priv = (struct lpc17_i2cdev_s *) arg; + struct lpc17_i2cdev_s *priv = (struct lpc17_i2cdev_s *) arg; - irqstate_t flags = irqsave(); - priv->state = 0xff; - sem_post (&priv->wait); - irqrestore (flags); + irqstate_t flags = irqsave(); + priv->state = 0xff; + sem_post(&priv->wait); + irqrestore(flags); } /******************************************************************************* @@ -317,90 +338,109 @@ static void i2c_timeout (int argc, uint32_t arg, ...) * *******************************************************************************/ -static int i2c_interrupt (int irq, FAR void *context) +static int i2c_interrupt(int irq, FAR void *context) { - struct lpc17_i2cdev_s *priv; + struct lpc17_i2cdev_s *priv; + uint32_t state; + #ifdef CONFIG_LPC17_I2C0 - if (irq == LPC17_IRQ_I2C0) + if (irq == LPC17_IRQ_I2C0) { - priv=&i2cdevices[0]; + priv=&i2cdevices[0]; } - else + else #endif #ifdef CONFIG_LPC17_I2C1 - if (irq == LPC17_IRQ_I2C1) + if (irq == LPC17_IRQ_I2C1) { - priv=&i2cdevices[1]; + priv=&i2cdevices[1]; } - else + else #endif #ifdef CONFIG_LPC17_I2C2 - if (irq == LPC17_IRQ_I2C2) + if (irq == LPC17_IRQ_I2C2) { - priv=&i2cdevices[2]; + priv=&i2cdevices[2]; } else #endif { PANIC(OSERR_INTERNAL); } -/* - * refrence UM10360 19.10.5 - */ - uint32_t state = getreg32(priv->base+LPC17_I2C_STAT_OFFSET); - putreg32(I2C_CONCLR_SIC,priv->base+LPC17_I2C_CONCLR_OFFSET); - priv->state=state; - state &=0xf8; - switch (state) - { - case 0x00: //Bus Error - case 0x20: - case 0x30: - case 0x38: - case 0x48: - i2c_stop(priv); - break; - case 0x08: //START - case 0x10: //Repeat START - putreg32(priv->msg.addr,priv->base+LPC17_I2C_DAT_OFFSET); - putreg32(I2C_CONCLR_STAC,priv->base+LPC17_I2C_CONCLR_OFFSET); - break; - case 0x18: - priv->wrcnt=0; - putreg32(priv->msg.buffer[0],priv->base+LPC17_I2C_DAT_OFFSET); - break; - case 0x28: - priv->wrcnt++; - if(priv->wrcntmsg.length) - putreg32(priv->msg.buffer[priv->wrcnt],priv->base+LPC17_I2C_DAT_OFFSET); - else - i2c_stop(priv); - break; - case 0x40: - priv->rdcnt=-1; - putreg32(I2C_CONSET_AA,priv->base+LPC17_I2C_CONSET_OFFSET); - break; - case 0x50: - priv->rdcnt++; - if(priv->rdcntmsg.length) - priv->msg.buffer[priv->rdcnt]=getreg32(priv->base+LPC17_I2C_BUFR_OFFSET); - if(priv->rdcnt>=priv->msg.length-1) - putreg32(I2C_CONCLR_AAC|I2C_CONCLR_SIC,priv->base+LPC17_I2C_CONCLR_OFFSET); - break; - case 0x58: - i2c_stop(priv); - break; - default: - i2c_stop(priv); - break; - } - return OK; + +/* Reference UM10360 19.10.5 */ + + state = getreg32(priv->base+LPC17_I2C_STAT_OFFSET); + putreg32(I2C_CONCLR_SIC, priv->base+LPC17_I2C_CONCLR_OFFSET); + priv->state = state; + state &= 0xf8; + + switch (state) + { + case 0x00: // Bus Error + case 0x20: + case 0x30: + case 0x38: + case 0x48: + i2c_stop(priv); + break; + + case 0x08: // START + case 0x10: // Repeat START + putreg32(priv->msg.addr, priv->base+LPC17_I2C_DAT_OFFSET); + putreg32(I2C_CONCLR_STAC, priv->base+LPC17_I2C_CONCLR_OFFSET); + break; + + case 0x18: + priv->wrcnt = 0; + putreg32(priv->msg.buffer[0], priv->base+LPC17_I2C_DAT_OFFSET); + break; + + case 0x28: + priv->wrcnt++; + if (priv->wrcntmsg.length) + { + putreg32(priv->msg.buffer[priv->wrcnt],priv->base+LPC17_I2C_DAT_OFFSET); + } + else + { + i2c_stop(priv); + } + break; + + case 0x40: + priv->rdcnt = -1; + putreg32(I2C_CONSET_AA, priv->base+LPC17_I2C_CONSET_OFFSET); + break; + + case 0x50: + priv->rdcnt++; + if (priv->rdcnt < priv->msg.length) + { + priv->msg.buffer[priv->rdcnt] = getreg32(priv->base+LPC17_I2C_BUFR_OFFSET); + } + + if (priv->rdcnt>=priv->msg.length-1) + { + putreg32(I2C_CONCLR_AAC|I2C_CONCLR_SIC, priv->base+LPC17_I2C_CONCLR_OFFSET); + } + break; + + case 0x58: + i2c_stop(priv); + break; + + default: + i2c_stop(priv); + break; + } + + return OK; } -/**************************************************************************** +/******************************************************************************* * Public Functions - ****************************************************************************/ - + *******************************************************************************/ /******************************************************************************* * Name: up_i2cinitialize @@ -412,116 +452,117 @@ static int i2c_interrupt (int irq, FAR void *context) struct i2c_dev_s *up_i2cinitialize(int port) { - struct lpc17_i2cdev_s *priv; + struct lpc17_i2cdev_s *priv; + irqstate_t flags; + uint32_t regval; - if (port>2) + if (port > 2) { - dbg("lpc I2C Only support 0,1,2\n"); - return NULL; + dbg("lpc I2C Only support 0,1,2\n"); + return NULL; } - irqstate_t flags; - uint32_t regval; - - flags = irqsave(); + flags = irqsave(); - priv= &i2cdevices[port]; + priv= &i2cdevices[port]; #ifdef CONFIG_LPC17_I2C0 - if (port==0) + if (port == 0) { - priv= (FAR struct lpc17_i2cdev_s *)&i2cdevices[0]; - priv->base = LPC17_I2C0_BASE; - priv->irqid = LPC17_IRQ_I2C0; - - regval = getreg32(LPC17_SYSCON_PCONP); - regval |= SYSCON_PCONP_PCI2C0; - putreg32(regval, LPC17_SYSCON_PCONP); - - regval = getreg32(LPC17_SYSCON_PCLKSEL0); - regval &= ~SYSCON_PCLKSEL0_I2C0_MASK; - regval |= (SYSCON_PCLKSEL_CCLK << SYSCON_PCLKSEL0_I2C0_SHIFT); - putreg32(regval, LPC17_SYSCON_PCLKSEL0); + priv= (FAR struct lpc17_i2cdev_s *)&i2cdevices[0]; + priv->base = LPC17_I2C0_BASE; + priv->irqid = LPC17_IRQ_I2C0; + + regval = getreg32(LPC17_SYSCON_PCONP); + regval |= SYSCON_PCONP_PCI2C0; + putreg32(regval, LPC17_SYSCON_PCONP); + + regval = getreg32(LPC17_SYSCON_PCLKSEL0); + regval &= ~SYSCON_PCLKSEL0_I2C0_MASK; + regval |= (SYSCON_PCLKSEL_CCLK << SYSCON_PCLKSEL0_I2C0_SHIFT); + putreg32(regval, LPC17_SYSCON_PCLKSEL0); - lpc17_configgpio(GPIO_I2C0_SCL); - lpc17_configgpio(GPIO_I2C0_SDA); + lpc17_configgpio(GPIO_I2C0_SCL); + lpc17_configgpio(GPIO_I2C0_SDA); - putreg32 (LPC17_CCLK/CONFIG_I2C0_FREQ/2, priv->base + LPC17_I2C_SCLH_OFFSET); - putreg32 (LPC17_CCLK/CONFIG_I2C0_FREQ/2, priv->base + LPC17_I2C_SCLL_OFFSET); - + putreg32(LPC17_CCLK/CONFIG_I2C0_FREQ/2, priv->base + LPC17_I2C_SCLH_OFFSET); + putreg32(LPC17_CCLK/CONFIG_I2C0_FREQ/2, priv->base + LPC17_I2C_SCLL_OFFSET); } - else + else #endif #ifdef CONFIG_LPC17_I2C1 - if(port==1) + if (port == 1) { - priv= (FAR struct lpc17_i2cdev_s *)&i2cdevices[1]; - priv->base = LPC17_I2C1_BASE; - priv->irqid = LPC17_IRQ_I2C1; + priv= (FAR struct lpc17_i2cdev_s *)&i2cdevices[1]; + priv->base = LPC17_I2C1_BASE; + priv->irqid = LPC17_IRQ_I2C1; - regval = getreg32(LPC17_SYSCON_PCONP); - regval |= SYSCON_PCONP_PCI2C1; - putreg32(regval, LPC17_SYSCON_PCONP); + regval = getreg32(LPC17_SYSCON_PCONP); + regval |= SYSCON_PCONP_PCI2C1; + putreg32(regval, LPC17_SYSCON_PCONP); - regval = getreg32(LPC17_SYSCON_PCLKSEL1); - regval &= ~SYSCON_PCLKSEL1_I2C1_MASK; - regval |= (SYSCON_PCLKSEL_CCLK << SYSCON_PCLKSEL1_I2C1_SHIFT); - putreg32(regval, LPC17_SYSCON_PCLKSEL1); + regval = getreg32(LPC17_SYSCON_PCLKSEL1); + regval &= ~SYSCON_PCLKSEL1_I2C1_MASK; + regval |= (SYSCON_PCLKSEL_CCLK << SYSCON_PCLKSEL1_I2C1_SHIFT); + putreg32(regval, LPC17_SYSCON_PCLKSEL1); - lpc17_configgpio(GPIO_I2C1_SCL); - lpc17_configgpio(GPIO_I2C1_SDA); + lpc17_configgpio(GPIO_I2C1_SCL); + lpc17_configgpio(GPIO_I2C1_SDA); - putreg32 (LPC17_CCLK/CONFIG_I2C1_FREQ/2, priv->base + LPC17_I2C_SCLH_OFFSET); - putreg32 (LPC17_CCLK/CONFIG_I2C1_FREQ/2, priv->base + LPC17_I2C_SCLL_OFFSET); + putreg32(LPC17_CCLK/CONFIG_I2C1_FREQ/2, priv->base + LPC17_I2C_SCLH_OFFSET); + putreg32(LPC17_CCLK/CONFIG_I2C1_FREQ/2, priv->base + LPC17_I2C_SCLL_OFFSET); } - else + else #endif #ifdef CONFIG_LPC17_I2C2 - if(port==2) + if (port == 2) { - priv= (FAR struct lpc17_i2cdev_s *)&i2cdevices[2]; - priv->base = LPC17_I2C2_BASE; - priv->irqid = LPC17_IRQ_I2C2; - - regval = getreg32(LPC17_SYSCON_PCONP); - regval |= SYSCON_PCONP_PCI2C2; - putreg32(regval, LPC17_SYSCON_PCONP); - - regval = getreg32(LPC17_SYSCON_PCLKSEL1); - regval &= ~SYSCON_PCLKSEL1_I2C2_MASK; - regval |= (SYSCON_PCLKSEL_CCLK << SYSCON_PCLKSEL1_I2C2_SHIFT); - putreg32(regval, LPC17_SYSCON_PCLKSEL1); + priv= (FAR struct lpc17_i2cdev_s *)&i2cdevices[2]; + priv->base = LPC17_I2C2_BASE; + priv->irqid = LPC17_IRQ_I2C2; + + regval = getreg32(LPC17_SYSCON_PCONP); + regval |= SYSCON_PCONP_PCI2C2; + putreg32(regval, LPC17_SYSCON_PCONP); + + regval = getreg32(LPC17_SYSCON_PCLKSEL1); + regval &= ~SYSCON_PCLKSEL1_I2C2_MASK; + regval |= (SYSCON_PCLKSEL_CCLK << SYSCON_PCLKSEL1_I2C2_SHIFT); + putreg32(regval, LPC17_SYSCON_PCLKSEL1); - lpc17_configgpio(GPIO_I2C2_SCL); - lpc17_configgpio(GPIO_I2C2_SDA); + lpc17_configgpio(GPIO_I2C2_SCL); + lpc17_configgpio(GPIO_I2C2_SDA); - putreg32 (LPC17_CCLK/CONFIG_I2C2_FREQ/2, priv->base + LPC17_I2C_SCLH_OFFSET); - putreg32 (LPC17_CCLK/CONFIG_I2C2_FREQ/2, priv->base + LPC17_I2C_SCLL_OFFSET); + putreg32(LPC17_CCLK/CONFIG_I2C2_FREQ/2, priv->base + LPC17_I2C_SCLH_OFFSET); + putreg32(LPC17_CCLK/CONFIG_I2C2_FREQ/2, priv->base + LPC17_I2C_SCLL_OFFSET); } - else + else #endif { - return NULL; + return NULL; } - putreg32(I2C_CONSET_I2EN,priv->base+LPC17_I2C_CONSET_OFFSET); - sem_init (&priv->mutex, 0, 1); - sem_init (&priv->wait, 0, 0); + putreg32(I2C_CONSET_I2EN, priv->base+LPC17_I2C_CONSET_OFFSET); - /* Allocate a watchdog timer */ - priv->timeout = wd_create(); + sem_init(&priv->mutex, 0, 1); + sem_init(&priv->wait, 0, 0); - DEBUGASSERT(priv->timeout != 0); + /* Allocate a watchdog timer */ - /* Attach Interrupt Handler */ - irq_attach (priv->irqid, i2c_interrupt); + priv->timeout = wd_create(); + DEBUGASSERT(priv->timeout != 0); - /* Enable Interrupt Handler */ - up_enable_irq(priv->irqid); + /* Attach Interrupt Handler */ - /* Install our operations */ - priv->dev.ops = &lpc17_i2c_ops; + irq_attach(priv->irqid, i2c_interrupt); - return &priv->dev; + /* Enable Interrupt Handler */ + + up_enable_irq(priv->irqid); + + /* Install our operations */ + + priv->dev.ops = &lpc17_i2c_ops; + return &priv->dev; } /******************************************************************************* @@ -534,12 +575,30 @@ struct i2c_dev_s *up_i2cinitialize(int port) int up_i2cuninitialize(FAR struct i2c_dev_s * dev) { - struct lpc17_i2cdev_s *priv = (struct lpc17_i2cdev_s *) dev; - - putreg32(I2C_CONCLRT_I2ENC,priv->base+LPC17_I2C_CONCLR_OFFSET); - up_disable_irq(priv->irqid); - irq_detach (priv->irqid); - return OK; + struct lpc17_i2cdev_s *priv = (struct lpc17_i2cdev_s *) dev; + + /* Disable I2C */ + + putreg32(I2C_CONCLRT_I2ENC, priv->base+LPC17_I2C_CONCLR_OFFSET); + + /* Reset data structures */ + + sem_destroy(&priv->mutex); + sem_destroy(&priv->wait); + + /* Free the watchdog timer */ + + wd_delete(priv->timeout); + priv->timeout = NULL; + + /* Disable interrupts */ + + up_disable_irq(priv->irqid); + + /* Detach Interrupt Handler */ + + irq_detach(priv->irqid); + return OK; } #endif diff --git a/nuttx/configs/z8f64200100kit/ostest/Make.defs b/nuttx/configs/z8f64200100kit/ostest/Make.defs index 6de98cc87..80a79eca4 100644 --- a/nuttx/configs/z8f64200100kit/ostest/Make.defs +++ b/nuttx/configs/z8f64200100kit/ostest/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/z8f64200100kit/ostest/Make.defs # -# Copyright (C) 2008 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -33,27 +33,37 @@ # ############################################################################ -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/.config +include $(TOPDIR)/tools/Config.mk # These are the directories where the ZDS-II toolchain is installed -ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_Z8Encore!_4.10.1 +ZDSVERSION := 5.0.0 ifeq ($(CONFIG_WINDOWS_NATIVE),y) - ZDSBINDIR := $(ZDSINSTALLDIR)\bin - ZDSSTDINCDIR := $(ZDSINSTALLDIR)\include\std - ZDSZILOGINCDIR := $(ZDSINSTALLDIR)\include\zilog + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZZDSII_Z8Encore!_$(ZDSVERSION) + INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} + ZDSBINDIR := $(INSTALLDIR)\bin + ZDSSTDINCDIR := $(INSTALLDIR)\include\std + ZDSZILOGINCDIR := $(INSTALLDIR)\include\zilog ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y) - ZDSDEVINCDIR := $(ZDSZILOGINCDIR)\Z8Encore_F642X + ZDSDEVINCDIR := $(INSTALLDIR)\Z8Encore_F642X endif ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) - ZDSDEVINCDIR := $(ZDSZILOGINCDIR)\Z8Encore_F640X + ZDSDEVINCDIR := $(INSTALLDIR)\Z8Encore_F640X endif - ZDSSTDLIBDIR := $(ZDSINSTALLDIR)\lib\std - ZDSZILOGLIBDIR := $(ZDSINSTALLDIR)\lib\zilog + ZDSSTDLIBDIR := $(INSTALLDIR)\lib\std + ZDSZILOGLIBDIR := $(INSTALLDIR)\lib\zilog + + # CFLAGs + + ARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + EARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y + ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZZDSII_Z8Encore!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std @@ -66,43 +76,50 @@ ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) endif ZDSSTDLIBDIR := $(INSTALLDIR)/lib/std ZDSZILOGLIBDIR := $(INSTALLDIR)/lib/zilog -endif -# These are the same directories but with the directory separator -# character swapped as needed by the ZDS-II compiler + # 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)"} + WZDSDEVINCDIR := ${shell cygpath -w "$(ZDSDEVINCDIR)"} + WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} + WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} + + # Escaped versions -WTOPDIR := ${shell cygpath -w "$(TOPDIR)"} -WZDSSTDINCDIR := ${shell cygpath -w "$(ZDSSTDINCDIR)"} -WZDSZILOGINCDIR := ${shell cygpath -w "$(ZDSZILOGINCDIR)"} -WZDSDEVINCDIR := ${shell cygpath -w "$(ZDSDEVINCDIR)"} -WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} -WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} + ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} + EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} + EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} -# Escaped versions + # CFLAGs -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' +endif # Assembler definitions ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y) -ARCHFAMILYDEF = _Z8ENCORE_F642X -ARCHSERIESDEF = _Z8ENCORE_64K_SERIES -ARCHREVAA = -NOrevaa + ARCHFAMILYDEF = _Z8ENCORE_F642X + ARCHSERIESDEF = _Z8ENCORE_64K_SERIES + ARCHREVAA = -NOrevaa ifeq ($(CONFIG_ARCH_CHIP_Z8F6423),y) -ARCHCPU = Z8F6423 -ARCHCPUDEF = _Z8F6423 + ARCHCPU = Z8F6423 + ARCHCPUDEF = _Z8F6423 endif endif ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) -ARCHFAMILYDEF = _Z8ENCORE_F640X -ARCHSERIESDEF = _Z8ENCORE_640_FAMILY -ARCHREVAA = -revaa + ARCHFAMILYDEF = _Z8ENCORE_F640X + ARCHSERIESDEF = _Z8ENCORE_640_FAMILY + ARCHREVAA = -revaa ifeq ($(CONFIG_ARCH_CHIP_Z8F6403),y) -ARCHCPU = Z8F6403 -ARCHCPUDEF = _Z8F6403 + ARCHCPU = Z8F6403 + ARCHCPUDEF = _Z8F6403 endif endif @@ -116,8 +133,6 @@ ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase $(ARCHREVAA) ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet ARCHASMWARNINGS = -warn ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHSERIESDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions @@ -135,12 +150,11 @@ ARCHPICFLAGS = ARCHWARNINGS = -warn ARCHDEFINES = -define:$(ARCHFAMILYDEF) -define:$(ARCHCPUDEF) -define:$(ARCHSERIESDEF) ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR);$(WZDSDEVINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D$(ARCHSERIESDEF) -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include +CPPINCLUDES = -I$(TOPDIR)$(DELIM)include CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions @@ -149,73 +163,111 @@ ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/z8f64200100kit/ostest/ostest.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)configs$(DELIM)z8f64200100kit$(DELIM)ostest$(DELIM)ostest.linkcmd # Tool names/pathes CROSSDEV = -CC = $(ZDSBINDIR)/ez8cc.exe +CC = ez8cc.exe CPP = gcc -E -LD = $(ZDSBINDIR)/ez8link.exe -AS = $(ZDSBINDIR)/ez8asm.exe -AR = $(ZDSBINDIR)/ez8lib.exe +LD = ez8link.exe +AS = ez8asm.exe +AR = ez8lib.exe # File extensions ASMEXT = .asm OBJEXT = .obj LIBEXT = .lib -EXEEXT = .hex +EXEXT = .hex # These are the macros that will be used in the NuttX make system # to compile and assembly source files and to insert the resulting # object files into an archive +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + define PREPROCESS - @echo "CPP: $1->$2" + @echo CPP: $1->$2 $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 endef define COMPILE - @#echo "CC: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef define ASSEMBLE - @#echo "AS: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) define ARCHIVE - echo "AR: $2"; + echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef + +define CLEAN + $(Q) if exist *.obj (del /f /q *.obj) + $(Q) if exist *.src (del /f /q *.src) + $(Q) if exist *.lib (del /f /q *.lib) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.lod (del /f /q *.lod) + $(Q) if exist *.lst (del /f /q *.lst) +endef + else + +define PREPROCESS + @echo "CPP: $1->$2" + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) +endef + +define ASSEMBLE + $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) +endef + define ARCHIVE $(Q) for __obj in $(2) ; do \ echo "AR: $$__obj"; \ "$(AR)" $(ARFLAGS) $1=-+$$__obj || { echo "$(AR) $1=-+$$__obj FAILED!" ; exit 1 ; } \ done endef -endif define CLEAN - $(Q) rm -f *.obj *.src *.lib *.hex *.lst + $(Q) rm -f *.obj *.src *.lib *.hex *.lod *.lst endef +endif -# This is the tool to use for dependencies (i.e., none) +# Windows native host tool definitions -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe -# ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + # Windows-native host tools -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif diff --git a/nuttx/configs/z8f64200100kit/ostest/setenv.sh b/nuttx/configs/z8f64200100kit/ostest/setenv.sh index 166ed9e0c..1a135a7d6 100755 --- a/nuttx/configs/z8f64200100kit/ostest/setenv.sh +++ b/nuttx/configs/z8f64200100kit/ostest/setenv.sh @@ -1,7 +1,7 @@ #!/bin/bash -# configs/z8f64200100kit/ostest/setenv.sh +# configs/ez80f910200kitg/ostest/setenv.sh # -# Copyright (C) 2008 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -33,20 +33,31 @@ # # Check how we were executed # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + # -# The ZDS-II toolchain lies outside of the Cygwin "sandbox" and -# attempts to set the PATH variable do not have the desired effect. -# Instead, alias are provided for all of the ZDS-II command line tools. -# Version 4.10.1 installed in the default location is assumed here. +# This is the Cygwin path to location where the XDS-II tools were installed # -ZDSBINDIR="C:/Program\ Files/ZiLOG/ZDSII_Z8Encore!_4.10.1/bin" -alias ez8asm="${ZDSBINDIR}/ez8asm.exe" -alias ez8cc="${ZDSBINDIR}/ez8cc.exe" -alias ez8lib="${ZDSBINDIR}/ez8lib.exe" -alias ez8link="${ZDSBINDIR}/ez8link.exe" +TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/ZiLOG/ZDSII_Z8Encore!_5.0.0/bin" +# +# Add the path to the toolchain to the PATH varialble. NOTE that /bin and /usr/bin +# preceded the toolchain bin directory. This is because the ZDSII bin directory +# includes binaries like make.exe that will interfere with the normal build process +# if we do not give priority to the versions at /bin and /usr/bin. +# +export PATH="/bin:/usr/bin:${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +echo "PATH : ${PATH}" diff --git a/nuttx/configs/z8f64200100kit/scripts/setenv.bat b/nuttx/configs/z8f64200100kit/scripts/setenv.bat new file mode 100644 index 000000000..4281d5b11 --- /dev/null +++ b/nuttx/configs/z8f64200100kit/scripts/setenv.bat @@ -0,0 +1,50 @@ +@echo off + +rem configs/z8f64200100kit/scripts/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the ZDS-II toolchain. + +set PATH=C:\Program Files (x86)\ZiLOG\ZZDSII_Z8Encore!_5.0.0\bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% +echo %PATH% -- cgit v1.2.3 From 3c20b3a3cde677efa2963609d44954bfaf9c19a1 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 27 Nov 2012 16:26:54 +0000 Subject: Add chip ID funcitions for Shenzhou and Cloudctrl boards; Extened NSH ifconfig command and improve DHCPC -- All from Darcy Gong git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5393 42af7a65-404d-4744-a932-0658087f49c3 --- apps/ChangeLog.txt | 2 + apps/netutils/dhcpc/dhcpc.c | 23 ++++++-- apps/nshlib/README.txt | 2 +- apps/nshlib/nsh_netcmds.c | 93 ++++++++++++++++++++++++++++----- apps/nshlib/nsh_netinit.c | 2 +- apps/nshlib/nsh_parse.c | 2 +- nuttx/ChangeLog | 3 ++ nuttx/Documentation/NuttShell.html | 4 +- nuttx/configs/cloudctrl/include/board.h | 11 ++++ nuttx/configs/cloudctrl/src/Makefile | 2 +- nuttx/configs/cloudctrl/src/up_chipid.c | 93 +++++++++++++++++++++++++++++++++ nuttx/configs/shenzhou/include/board.h | 11 ++++ nuttx/configs/shenzhou/src/Makefile | 2 +- nuttx/configs/shenzhou/src/up_chipid.c | 92 ++++++++++++++++++++++++++++++++ 14 files changed, 316 insertions(+), 26 deletions(-) create mode 100644 nuttx/configs/cloudctrl/src/up_chipid.c create mode 100644 nuttx/configs/shenzhou/src/up_chipid.c (limited to 'nuttx') diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index 3d09915c3..0b4f58e77 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -422,3 +422,5 @@ * apps/examples/elf/test/*/Makefile: OSX doesn't support install -D, use mkdir -p then install without the -D. From Mike Smith. * apps/examples/relays/Makefile: Reduced stack requirement (Darcy Gong). + * apps/nshlib and apps/netutils/dhcpc: Extend the NSH ifconfig command plus + various DHCPC improvements(Darcy Gong). diff --git a/apps/netutils/dhcpc/dhcpc.c b/apps/netutils/dhcpc/dhcpc.c index f5e15c8dc..b34320230 100644 --- a/apps/netutils/dhcpc/dhcpc.c +++ b/apps/netutils/dhcpc/dhcpc.c @@ -351,6 +351,7 @@ void *dhcpc_open(const void *macaddr, int maclen) struct dhcpc_state_s *pdhcpc; struct sockaddr_in addr; struct timeval tv; + int ret; ndbg("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", ((uint8_t*)macaddr)[0], ((uint8_t*)macaddr)[1], ((uint8_t*)macaddr)[2], @@ -369,21 +370,24 @@ void *dhcpc_open(const void *macaddr, int maclen) /* Create a UDP socket */ - pdhcpc->sockfd = socket(PF_INET, SOCK_DGRAM, 0); + pdhcpc->sockfd = socket(PF_INET, SOCK_DGRAM, 0); if (pdhcpc->sockfd < 0) { + nvdbg("socket handle %d\n",ret); free(pdhcpc); return NULL; } - /* bind the socket */ + /* Bind the socket */ addr.sin_family = AF_INET; addr.sin_port = HTONS(DHCPC_CLIENT_PORT); addr.sin_addr.s_addr = INADDR_ANY; - if (bind(pdhcpc->sockfd, (struct sockaddr*)&addr, sizeof(struct sockaddr_in)) < 0) + ret = bind(pdhcpc->sockfd, (struct sockaddr*)&addr, sizeof(struct sockaddr_in)); + if (ret < 0) { + nvdbg("bind status %d\n",ret); close(pdhcpc->sockfd); free(pdhcpc); return NULL; @@ -393,8 +397,11 @@ void *dhcpc_open(const void *macaddr, int maclen) tv.tv_sec = 10; tv.tv_usec = 0; - if (setsockopt(pdhcpc->sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(struct timeval)) < 0) + + ret = setsockopt(pdhcpc->sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(struct timeval)); + if (ret < 0) { + nvdbg("setsockopt status %d\n",ret); close(pdhcpc->sockfd); free(pdhcpc); return NULL; @@ -410,9 +417,15 @@ void *dhcpc_open(const void *macaddr, int maclen) void dhcpc_close(void *handle) { - struct dchcpc_state_internal *pdhcpc = (struct dchcpc_state_internal *)handle; + struct dhcpc_state_s *pdhcpc = (struct dhcpc_state_s *)handle; + if (pdhcpc) { + if (pdhcpc->sockfd) + { + close(pdhcpc->sockfd); + } + free(pdhcpc); } } diff --git a/apps/nshlib/README.txt b/apps/nshlib/README.txt index 59f0538f0..bc626e699 100644 --- a/apps/nshlib/README.txt +++ b/apps/nshlib/README.txt @@ -389,7 +389,7 @@ o hexdump Dump data in hexadecimal format from a file or character device. -o ifconfig [nic_name [ip]] [dr|gw|gateway ] [netmask ] [dns ] [hw ] +o ifconfig [nic_name [|dhcp]] [dr|gw|gateway ] [netmask ] [dns ] [hw ] Show the current configuration of the network, for example: diff --git a/apps/nshlib/nsh_netcmds.c b/apps/nshlib/nsh_netcmds.c index d28fe873d..371d30460 100644 --- a/apps/nshlib/nsh_netcmds.c +++ b/apps/nshlib/nsh_netcmds.c @@ -81,10 +81,13 @@ # endif #endif -#ifdef CONFIG_HAVE_GETHOSTBYNAME -# include -#else -# include +#if defined(CONFIG_NSH_DHCPC) || defined(CONFIG_NSH_DNS) +# ifdef CONFIG_HAVE_GETHOSTBYNAME +# include +# else +# include +# endif +# include #endif #include "nsh.h" @@ -568,8 +571,11 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) FAR char *tmp = NULL; FAR char *hw = NULL; FAR char *dns = NULL; - bool badarg=false; - uint8_t mac[6]; + bool badarg = false; + uint8_t mac[IFHWADDRLEN]; +#if defined(CONFIG_NSH_DHCPC) + FAR void *handle; +#endif /* With one or no arguments, ifconfig simply shows the status of ethernet * device: @@ -673,10 +679,23 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) uip_setmacaddr(intf, mac); } - /* Set host ip address */ +#if defined(CONFIG_NSH_DHCPC) + if (!strcmp(hostip, "dhcp")) + { + /* Set DHCP addr */ + + ndbg("DHCPC Mode\n"); + gip = addr.s_addr = 0; + } + else +#endif + { + /* Set host IP address */ + + ndbg("Host IP: %s\n", hostip); + gip = addr.s_addr = inet_addr(hostip); + } - ndbg("Host IP: %s\n", hostip); - gip = addr.s_addr = inet_addr(hostip); uip_sethostaddr(intf, &addr); /* Set gateway */ @@ -688,11 +707,15 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) } else { - ndbg("Gateway: default\n"); - gip = NTOHL(gip); - gip &= ~0x000000ff; - gip |= 0x00000001; - gip = HTONL(gip); + if (gip) + { + ndbg("Gateway: default\n"); + gip = NTOHL(gip); + gip &= ~0x000000ff; + gip |= 0x00000001; + gip = HTONL(gip); + } + addr.s_addr = gip; } @@ -728,6 +751,48 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) resolv_conf(&addr); #endif +#if defined(CONFIG_NSH_DHCPC) + /* Get the MAC address of the NIC */ + + if (!gip) + { + uip_getmacaddr("eth0", mac); + + /* Set up the DHCPC modules */ + + handle = dhcpc_open(&mac, IFHWADDRLEN); + + /* Get an IP address. Note that there is no logic for renewing the IP address in this + * example. The address should be renewed in ds.lease_time/2 seconds. + */ + + if (handle) + { + struct dhcpc_state ds; + + (void)dhcpc_request(handle, &ds); + uip_sethostaddr("eth0", &ds.ipaddr); + + if (ds.netmask.s_addr != 0) + { + uip_setnetmask("eth0", &ds.netmask); + } + + if (ds.default_router.s_addr != 0) + { + uip_setdraddr("eth0", &ds.default_router); + } + + if (ds.dnsaddr.s_addr != 0) + { + resolv_conf(&ds.dnsaddr); + } + + dhcpc_close(handle); + } + } +#endif + return OK; } #endif diff --git a/apps/nshlib/nsh_netinit.c b/apps/nshlib/nsh_netinit.c index bb1c73dff..58d238312 100644 --- a/apps/nshlib/nsh_netinit.c +++ b/apps/nshlib/nsh_netinit.c @@ -156,7 +156,7 @@ int nsh_netinit(void) { struct dhcpc_state ds; (void)dhcpc_request(handle, &ds); - uip_sethostaddr("eth1", &ds.ipaddr); + uip_sethostaddr("eth0", &ds.ipaddr); if (ds.netmask.s_addr != 0) { uip_setnetmask("eth0", &ds.netmask); diff --git a/apps/nshlib/nsh_parse.c b/apps/nshlib/nsh_parse.c index abdf5c321..27068acff 100644 --- a/apps/nshlib/nsh_parse.c +++ b/apps/nshlib/nsh_parse.c @@ -235,7 +235,7 @@ static const struct cmdmap_s g_cmdmap[] = #ifdef CONFIG_NET # ifndef CONFIG_NSH_DISABLE_IFCONFIG - { "ifconfig", cmd_ifconfig, 1, 11, "[nic_name [ip]] [dr|gw|gateway ] [netmask ] [dns ] [hw ]" }, + { "ifconfig", cmd_ifconfig, 1, 11, "[nic_name [|dhcp]] [dr|gw|gateway ] [netmask ] [dns ] [hw ]" }, # endif # ifndef CONFIG_NSH_DISABLE_IFUPDOWN { "ifdown", cmd_ifdown, 2, 2, "" }, diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 9e8ddf44d..810e0eb40 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3697,3 +3697,6 @@ Windows build. * nuttx/arch/arm/src/lpc17xx/lpc17_i2c.c: Resources not being released when I2C is uninitialized. + * cloudctrl/src/up_chipid.c and shenzhou/src/up_chipid.c: Add functions to + get chip ID. Contributed by Darcy Gong. These should not be board-dependent, + but should be in arch/arm/src/stm32 where they can be used from any board. diff --git a/nuttx/Documentation/NuttShell.html b/nuttx/Documentation/NuttShell.html index 1b14f96f6..0b5f7aa11 100644 --- a/nuttx/Documentation/NuttShell.html +++ b/nuttx/Documentation/NuttShell.html @@ -8,7 +8,7 @@

NuttShell (NSH)

-

Last Updated: November 9, 2012

+

Last Updated: November 27, 2012

@@ -1219,7 +1219,7 @@ hexdump <file or device>

Command Syntax:

    -ifconfig [nic_name [ip]] [dr|gw|gateway <dr-address>] [netmask <net-mask>] [dns <dns-address>] [hw <hw-mac>]]
    +ifconfig [nic_name [<ip-address>|dhcp]] [dr|gw|gateway <dr-address>] [netmask <net-mask>] [dns <dns-address>] [hw <hw-mac>]]
     

Synopsis. diff --git a/nuttx/configs/cloudctrl/include/board.h b/nuttx/configs/cloudctrl/include/board.h index 5f5e86ebc..3afdb9cb8 100644 --- a/nuttx/configs/cloudctrl/include/board.h +++ b/nuttx/configs/cloudctrl/include/board.h @@ -406,6 +406,17 @@ EXTERN void relays_resetmodes(uint32_t relays_stat); EXTERN void relays_powermodes(uint32_t relays_stat); #endif +/************************************************************************************ + * Chip ID functions + * + * Description: + * Non-standard functions to obtain chip ID information. + * + ************************************************************************************/ + +EXTERN const char *stm32_getchipid(void); +EXTERN const char *stm32_getchipid_string(void); + #undef EXTERN #if defined(__cplusplus) } diff --git a/nuttx/configs/cloudctrl/src/Makefile b/nuttx/configs/cloudctrl/src/Makefile index 37c944f4d..e04853115 100644 --- a/nuttx/configs/cloudctrl/src/Makefile +++ b/nuttx/configs/cloudctrl/src/Makefile @@ -41,7 +41,7 @@ CFLAGS += -I$(TOPDIR)/sched ASRCS = AOBJS = $(ASRCS:.S=$(OBJEXT)) -CSRCS = up_boot.c up_spi.c +CSRCS = up_boot.c up_spi.c up_chipid.c ifeq ($(CONFIG_HAVE_CXX),y) CSRCS += up_cxxinitialize.c diff --git a/nuttx/configs/cloudctrl/src/up_chipid.c b/nuttx/configs/cloudctrl/src/up_chipid.c new file mode 100644 index 000000000..55018edd4 --- /dev/null +++ b/nuttx/configs/cloudctrl/src/up_chipid.c @@ -0,0 +1,93 @@ +/************************************************************************************ + * configs/cloudctrl/src/up_chipid.c + * arch/arm/src/board/up_chipid.c + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * Darcy Gong + * + * 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. + * + ************************************************************************************/ + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include + +#include + +#include + +#include "up_arch.h" + +/************************************************************************************ + * Definitions + ************************************************************************************/ + +/************************************************************************************ + * Private Functions + ************************************************************************************/ + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +const char *stm32_getchipid(void) +{ + static char cpuid[12]; + int i; + + for (i = 0; i < 12; i++) + { + cpuid[i] = getreg8(0x1ffff7e8+i); + } + + return cpuid; +} + +const char *stm32_getchipid_string(void) +{ + static char cpuid[27]; + int c; + int i; + + for (i = 0, c = 0; i < 12; i++) + { + sprintf(&cpuid[c], "%02X", getreg8(0x1ffff7e8+11-i)); + c += 2; + if (i % 4 == 3) + { + cpuid[c++] = '-'; + } + } + + cpuid[26] = '\0'; + return cpuid; +} diff --git a/nuttx/configs/shenzhou/include/board.h b/nuttx/configs/shenzhou/include/board.h index efc15c73d..7c4d983a1 100644 --- a/nuttx/configs/shenzhou/include/board.h +++ b/nuttx/configs/shenzhou/include/board.h @@ -452,6 +452,17 @@ EXTERN void relays_resetmodes(uint32_t relays_stat); EXTERN void relays_powermodes(uint32_t relays_stat); #endif +/************************************************************************************ + * Chip ID functions + * + * Description: + * Non-standard functions to obtain chip ID information. + * + ************************************************************************************/ + +EXTERN const char *stm32_getchipid(void); +EXTERN const char *stm32_getchipid_string(void); + #undef EXTERN #if defined(__cplusplus) } diff --git a/nuttx/configs/shenzhou/src/Makefile b/nuttx/configs/shenzhou/src/Makefile index b70a6e9ce..28c42c392 100644 --- a/nuttx/configs/shenzhou/src/Makefile +++ b/nuttx/configs/shenzhou/src/Makefile @@ -40,7 +40,7 @@ CFLAGS += -I$(TOPDIR)/sched ASRCS = AOBJS = $(ASRCS:.S=$(OBJEXT)) -CSRCS = up_boot.c up_spi.c up_mmcsd.c +CSRCS = up_boot.c up_spi.c up_mmcsd.c up_chipid.c ifeq ($(CONFIG_HAVE_CXX),y) CSRCS += up_cxxinitialize.c diff --git a/nuttx/configs/shenzhou/src/up_chipid.c b/nuttx/configs/shenzhou/src/up_chipid.c new file mode 100644 index 000000000..e2978e54a --- /dev/null +++ b/nuttx/configs/shenzhou/src/up_chipid.c @@ -0,0 +1,92 @@ +/************************************************************************************ + * configs/shenzhou/src/up_chipid.c + * arch/arm/src/board/up_chipid.c + * + * Copyright (C) 2012 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. + * + ************************************************************************************/ + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include + +#include + +#include + +#include "up_arch.h" + +/************************************************************************************ + * Definitions + ************************************************************************************/ + +/************************************************************************************ + * Private Functions + ************************************************************************************/ + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +const char *stm32_getchipid(void) +{ + static char cpuid[12]; + int i; + + for (i = 0; i < 12; i++) + { + cpuid[i] = getreg8(0x1ffff7e8+i); + } + + return cpuid; +} + +const char *stm32_getchipid_string(void) +{ + static char cpuid[27]; + int c; + int i; + + for (i = 0, c = 0; i < 12; i++) + { + sprintf(&cpuid[c], "%02X", getreg8(0x1ffff7e8+11-i)); + c += 2; + if (i % 4 == 3) + { + cpuid[c++] = '-'; + } + } + + cpuid[26] = '\0'; + return cpuid; +} -- cgit v1.2.3 From 8cad4a664b6745ba30bcc8c08c8754f6a51a6383 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 27 Nov 2012 17:22:32 +0000 Subject: Fix backward conditional compilation in work_queue.c git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5394 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 3 +++ nuttx/configs/z8f64200100kit/ostest/Make.defs | 4 ++-- nuttx/sched/work_thread.c | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 810e0eb40..4b0992680 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3700,3 +3700,6 @@ * cloudctrl/src/up_chipid.c and shenzhou/src/up_chipid.c: Add functions to get chip ID. Contributed by Darcy Gong. These should not be board-dependent, but should be in arch/arm/src/stm32 where they can be used from any board. + * sched/work_thread.c: Fix backward conditional compilation. This might + has caused a memory leadk. From Freddie Chopin. + diff --git a/nuttx/configs/z8f64200100kit/ostest/Make.defs b/nuttx/configs/z8f64200100kit/ostest/Make.defs index 80a79eca4..05c2b1593 100644 --- a/nuttx/configs/z8f64200100kit/ostest/Make.defs +++ b/nuttx/configs/z8f64200100kit/ostest/Make.defs @@ -41,7 +41,7 @@ include $(TOPDIR)/tools/Config.mk ZDSVERSION := 5.0.0 ifeq ($(CONFIG_WINDOWS_NATIVE),y) - ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZZDSII_Z8Encore!_$(ZDSVERSION) + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} ZDSBINDIR := $(INSTALLDIR)\bin ZDSSTDINCDIR := $(INSTALLDIR)\include\std @@ -63,7 +63,7 @@ endif ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y - ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZZDSII_Z8Encore!_$(ZDSVERSION) + ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std diff --git a/nuttx/sched/work_thread.c b/nuttx/sched/work_thread.c index abd86f771..5646b06a1 100644 --- a/nuttx/sched/work_thread.c +++ b/nuttx/sched/work_thread.c @@ -208,10 +208,10 @@ int work_hpthread(int argc, char *argv[]) * that were queued because they could not be freed in that execution * context (for example, if the memory was freed from an interrupt handler). * NOTE: If the work thread is disabled, this clean-up is performed by - * the IDLE thread (at a very, very lower priority). + * the IDLE thread (at a very, very low priority). */ -#ifdef CONFIG_SCHED_LPWORK +#ifndef CONFIG_SCHED_LPWORK sched_garbagecollection(); #endif @@ -236,7 +236,7 @@ int work_lpthread(int argc, char *argv[]) * that were queued because they could not be freed in that execution * context (for example, if the memory was freed from an interrupt handler). * NOTE: If the work thread is disabled, this clean-up is performed by - * the IDLE thread (at a very, very lower priority). + * the IDLE thread (at a very, very low priority). */ sched_garbagecollection(); -- cgit v1.2.3 From 6c26fa6537b1a94defc0c842677f0d812a35b123 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 28 Nov 2012 14:08:09 +0000 Subject: configs/many/Make.defs: Fix typo -wstrict-prototypes; Add Calypso keypad driver (Denis Cariki) git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5395 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 4 + nuttx/arch/arm/src/calypso/Make.defs | 26 +- nuttx/arch/arm/src/calypso/calypso_keypad.c | 370 +++++++++++++++++++++++ nuttx/configs/c5471evm/httpd/Make.defs | 2 +- nuttx/configs/c5471evm/nettest/Make.defs | 2 +- nuttx/configs/c5471evm/nsh/Make.defs | 2 +- nuttx/configs/c5471evm/ostest/Make.defs | 2 +- nuttx/configs/compal_e88/nsh_highram/Make.defs | 2 +- nuttx/configs/compal_e99/nsh_compalram/Make.defs | 2 +- nuttx/configs/compal_e99/nsh_highram/Make.defs | 2 +- nuttx/configs/ez80f910200kitg/ostest/Make.defs | 2 +- nuttx/configs/ez80f910200zco/dhcpd/Make.defs | 2 +- nuttx/configs/ez80f910200zco/httpd/Make.defs | 2 +- nuttx/configs/ez80f910200zco/nettest/Make.defs | 2 +- nuttx/configs/ez80f910200zco/nsh/Make.defs | 2 +- nuttx/configs/ez80f910200zco/ostest/Make.defs | 2 +- nuttx/configs/ez80f910200zco/poll/Make.defs | 2 +- nuttx/configs/m68332evb/Make.defs | 2 +- nuttx/configs/pjrc-8051/Make.defs | 2 +- nuttx/configs/us7032evb1/nsh/Make.defs | 2 +- nuttx/configs/us7032evb1/ostest/Make.defs | 2 +- nuttx/configs/xtrs/nsh/Make.defs | 2 +- nuttx/configs/xtrs/ostest/Make.defs | 2 +- nuttx/configs/xtrs/pashello/Make.defs | 2 +- nuttx/configs/z16f2800100zcog/ostest/Make.defs | 2 +- nuttx/configs/z16f2800100zcog/pashello/Make.defs | 2 +- nuttx/configs/z80sim/nsh/Make.defs | 2 +- nuttx/configs/z80sim/ostest/Make.defs | 2 +- nuttx/configs/z80sim/pashello/Make.defs | 2 +- nuttx/configs/z8encore000zco/ostest/Make.defs | 2 +- nuttx/configs/z8f64200100kit/ostest/Make.defs | 2 +- 31 files changed, 415 insertions(+), 41 deletions(-) create mode 100644 nuttx/arch/arm/src/calypso/calypso_keypad.c (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 4b0992680..170a55453 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3702,4 +3702,8 @@ but should be in arch/arm/src/stm32 where they can be used from any board. * sched/work_thread.c: Fix backward conditional compilation. This might has caused a memory leadk. From Freddie Chopin. + * configs//Make.defs: Fix typo -wstrict-prototypes should be + -Wstrict-prototypes (From Denis Cariki). + * arch/arm/src/calapyso/calypso_keypad.c: Add Calypso keypad driver. From + Denis Cariki. diff --git a/nuttx/arch/arm/src/calypso/Make.defs b/nuttx/arch/arm/src/calypso/Make.defs index db37ef02b..4b53c3b7c 100644 --- a/nuttx/arch/arm/src/calypso/Make.defs +++ b/nuttx/arch/arm/src/calypso/Make.defs @@ -36,22 +36,22 @@ # ############################################################################ -HEAD_ASRC = calypso_head.S +HEAD_ASRC = calypso_head.S -CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S up_vectors.S \ - up_nommuhead.S -CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c \ - up_createstack.c up_dataabort.c up_mdelay.c up_udelay.c up_doirq.c \ - up_exit.c up_idle.c up_initialstate.c up_initialize.c \ - up_interruptcontext.c up_prefetchabort.c up_releasepending.c \ - up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c \ - up_sigdeliver.c up_syscall.c up_unblocktask.c \ - up_undefinedinsn.c up_usestack.c calypso_power.c +CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S up_vectors.S \ + up_nommuhead.S +CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c \ + up_createstack.c up_dataabort.c up_mdelay.c up_udelay.c up_doirq.c \ + up_exit.c up_idle.c up_initialstate.c up_initialize.c \ + up_interruptcontext.c up_prefetchabort.c up_releasepending.c \ + up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c \ + up_sigdeliver.c up_syscall.c up_unblocktask.c \ + up_undefinedinsn.c up_usestack.c calypso_power.c ifeq ($(CONFIG_ELF),y) CMN_CSRCS += up_elf.c endif -CHIP_ASRCS = calypso_lowputc.S -CHIP_CSRCS = calypso_irq.c calypso_timer.c calypso_heap.c \ - calypso_serial.c calypso_spi.c clock.c calypso_uwire.c +CHIP_ASRCS = calypso_lowputc.S +CHIP_CSRCS = calypso_irq.c calypso_timer.c calypso_heap.c calypso_serial.c \ + calypso_spi.c clock.c calypso_uwire.c calypso_armio.c calypso_keypad.c diff --git a/nuttx/arch/arm/src/calypso/calypso_keypad.c b/nuttx/arch/arm/src/calypso/calypso_keypad.c new file mode 100644 index 000000000..aeb16eb4d --- /dev/null +++ b/nuttx/arch/arm/src/calypso/calypso_keypad.c @@ -0,0 +1,370 @@ +/**************************************************************************** + * Driver for Calypso keypad hardware + * + * Copyright (C) 2011 Stefan Richter. All rights reserved. + * Author: Stefan Richter + * + * 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. + * + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +/**************************************************************************** + * HW access + ****************************************************************************/ + +#define BASE_ADDR_ARMIO 0xfffe4800 +#define ARMIO_REG(x) ((void *)BASE_ADDR_ARMIO + (x)) + +enum armio_reg +{ + LATCH_IN = 0x00, + LATCH_OUT = 0x02, + IO_CNTL = 0x04, + CNTL_REG = 0x06, + LOAD_TIM = 0x08, + KBR_LATCH_REG = 0x0a, + KBC_REG = 0x0c, + BUZZ_LIGHT_REG = 0x0e, + LIGHT_LEVEL = 0x10, + BUZZER_LEVEL = 0x12, + GPIO_EVENT_MODE = 0x14, + KBD_GPIO_INT = 0x16, + KBD_GPIO_MASKIT = 0x18, + GPIO_DEBOUNCING = 0x1a, + GPIO_LATCH = 0x1c, +}; + +#define KBD_INT (1 << 0) +#define GPIO_INT (1 << 1) + +/**************************************************************************** + * Decoder functions for matrix and power button + ****************************************************************************/ + +static int btn_dec(uint32_t * btn_state, uint8_t col, uint8_t reg, + char *buf, size_t buflen, size_t * len) +{ + uint8_t diff = (*btn_state ^ reg) & 0x1f; + + while (diff) + { + uint8_t val = diff & ~(diff - 1); + uint8_t sc = val >> 1; + sc |= sc << 2; + sc += col; + sc += (sc & 0x20) ? 0x26 : 0x3f; + + if (reg & val) + { + sc |= 0x20; + } + + /* Check for space in buffer and dispatch */ + + if (*len < buflen) + { + buf[(*len)++] = sc; + } + else + { + break; + } + + /* Only change diff if dispatched/buffer not full */ + + diff ^= val; + } + + /* Store new state of the buttons (but only if they where dispatch) */ + + *btn_state >>= 5; +#ifdef INCLUDE_ALL_COLS + *btn_state |= (reg ^ diff) << 20; +#else + *btn_state |= (reg ^ diff) << 15; +#endif + return diff; +} + +static int pwr_btn_dec(uint32_t * state, uint8_t reg, char *buf, size_t * len) +{ + if (reg) + { + /* Check for pressed power button. If pressed, ignore other + * buttons since it collides with an entire row. + */ + + if (~*state & 0x80000000) + { + buf[0] = 'z'; + *len = 1; + *state |= 0x80000000; + } + + return 1; // break loop in caller + } + else + { + /* Check for released power button. */ + + if (*state & 0x80000000) + { + buf[0] = 'Z'; + *len = 1; + + *state &= 0x7fffffff; + + /* Don't scan others when released; might trigger + * false keystrokes otherwise + */ + + return 1; + } + } + + return 0; // continue with other columns +} + +/**************************************************************************** + * Keypad: Fileops Prototypes and Structures + ****************************************************************************/ + +typedef FAR struct file file_t; + +static int keypad_open(file_t * filep); +static int keypad_close(file_t * filep); +static ssize_t keypad_read(file_t * filep, FAR char *buffer, size_t buflen); +#ifndef CONFIG_DISABLE_POLL +static int keypad_poll(file_t * filep, FAR struct pollfd *fds, bool setup); +#endif + +static const struct file_operations keypad_ops = +{ + keypad_open, /* open */ + keypad_close, /* close */ + keypad_read, /* read */ + 0, /* write */ + 0, /* seek */ + 0, /* ioctl */ +#ifndef CONFIG_DISABLE_POLL + keypad_poll /* poll */ +#endif +}; + +static sem_t kbdsem; + +/**************************************************************************** + * Keypad: Fileops + ****************************************************************************/ + +static int keypad_open(file_t * filep) +{ + register uint16_t reg; + + /* Unmask keypad interrupt */ + reg = readw(ARMIO_REG(KBD_GPIO_MASKIT)); + writew(reg & ~KBD_INT, ARMIO_REG(KBD_GPIO_MASKIT)); + + return OK; +} + +static int keypad_close(file_t * filep) +{ + register uint16_t reg; + + /* Mask keypad interrupt */ + + reg = readw(ARMIO_REG(KBD_GPIO_MASKIT)); + writew(reg | KBD_INT, ARMIO_REG(KBD_GPIO_MASKIT)); + + return OK; +} + +static ssize_t keypad_read(file_t * filep, FAR char *buf, size_t buflen) +{ + static uint32_t btn_state = 0; + register uint16_t reg; + uint16_t col, col_mask; + size_t len = 0; + + if (buf == NULL || buflen < 1) + { + /* Well... nothing to do */ + + return -EINVAL; + } + +retry: + col = 1; + col_mask = 0x1e; + + if (!btn_state) + { + /* Drive all cols low such that all buttons cause events */ + + writew(0, ARMIO_REG(KBC_REG)); + + /* No button currently pressed, use IRQ */ + + reg = readw(ARMIO_REG(KBD_GPIO_MASKIT)); + writew(reg & ~KBD_INT, ARMIO_REG(KBD_GPIO_MASKIT)); + sem_wait(&kbdsem); + } + else + { + writew(0x1f, ARMIO_REG(KBC_REG)); + usleep(80000); + } + + /* Scan columns */ + +#ifdef INCLUDE_ALL_COLS + while (col <= 6) + { +#else + while (col <= 5) + { +#endif + /* Read keypad latch and immediately set new column since + * synchronization takes about 5usec. For the 1st round, the + * interrupt has prepared this and the context switch takes + * long enough to serve as a delay. + */ + + reg = readw(ARMIO_REG(KBR_LATCH_REG)); + writew(col_mask, ARMIO_REG(KBC_REG)); + + /* Turn pressed buttons into 1s */ + + reg = 0x1f & ~reg; + + if (col == 1) + { + /* Power/End switch */ + + if (pwr_btn_dec(&btn_state, reg, buf, &len)) + { + break; + } + } + else + { + /* Non-power switches */ + + if (btn_dec(&btn_state, col, reg, buf, buflen, &len)) + { + break; + } + } + + /* Select next column and respective mask */ + + col_mask = 0x1f & ~(1 << col++); + + /* We have to wait for synchronization of the inputs. The + * processing is too fast if no/few buttons are processed. + */ + + usleep(5); + + /* XXX: usleep seems to suffer hugh overhead. Better this!? + * If nothing else can be done, it's overhead still wastes + * time 'usefully'. + */ + /* sched_yield(); up_udelay(2); */ + } + + /* If we don't have anything to return, retry to avoid EOF */ + + if (!len) + { + goto retry; + } + + return len; +} + +/**************************************************************************** + * Keypad interrupt handler + * mask interrupts + * prepare column drivers for scan + * posts keypad semaphore + ****************************************************************************/ + +inline int calypso_kbd_irq(int irq, uint32_t * regs) +{ + register uint16_t reg; + + /* Mask keypad interrupt */ + + reg = readw(ARMIO_REG(KBD_GPIO_MASKIT)); + writew(reg | KBD_INT, ARMIO_REG(KBD_GPIO_MASKIT)); + + /* Turn off column drivers */ + + writew(0x1f, ARMIO_REG(KBC_REG)); + + /* Let the userspace know */ + + sem_post(&kbdsem); + + return 0; +} + +/**************************************************************************** + * Initialize device, add /dev/... nodes + ****************************************************************************/ + +void up_keypad(void) +{ + /* Semaphore; helps leaving IRQ ctx as soon as possible */ + + sem_init(&kbdsem, 0, 0); + + /* Drive cols low in idle state such that all buttons cause events */ + + writew(0, ARMIO_REG(KBC_REG)); + + (void)register_driver("/dev/keypad", &keypad_ops, 0444, NULL); +} diff --git a/nuttx/configs/c5471evm/httpd/Make.defs b/nuttx/configs/c5471evm/httpd/Make.defs index 45a567ec4..d06299359 100644 --- a/nuttx/configs/c5471evm/httpd/Make.defs +++ b/nuttx/configs/c5471evm/httpd/Make.defs @@ -90,7 +90,7 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/c5471evm/nettest/Make.defs b/nuttx/configs/c5471evm/nettest/Make.defs index 0db0a8dc9..bd7dcf80c 100644 --- a/nuttx/configs/c5471evm/nettest/Make.defs +++ b/nuttx/configs/c5471evm/nettest/Make.defs @@ -90,7 +90,7 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/c5471evm/nsh/Make.defs b/nuttx/configs/c5471evm/nsh/Make.defs index 8d3a3adc1..5feb14400 100644 --- a/nuttx/configs/c5471evm/nsh/Make.defs +++ b/nuttx/configs/c5471evm/nsh/Make.defs @@ -90,7 +90,7 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/c5471evm/ostest/Make.defs b/nuttx/configs/c5471evm/ostest/Make.defs index c83459173..b683df3ec 100644 --- a/nuttx/configs/c5471evm/ostest/Make.defs +++ b/nuttx/configs/c5471evm/ostest/Make.defs @@ -90,7 +90,7 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/compal_e88/nsh_highram/Make.defs b/nuttx/configs/compal_e88/nsh_highram/Make.defs index 2d65c2782..a9454b0ec 100644 --- a/nuttx/configs/compal_e88/nsh_highram/Make.defs +++ b/nuttx/configs/compal_e88/nsh_highram/Make.defs @@ -100,7 +100,7 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/compal_e99/nsh_compalram/Make.defs b/nuttx/configs/compal_e99/nsh_compalram/Make.defs index f93a01f04..61f5a5f6e 100644 --- a/nuttx/configs/compal_e99/nsh_compalram/Make.defs +++ b/nuttx/configs/compal_e99/nsh_compalram/Make.defs @@ -100,7 +100,7 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/compal_e99/nsh_highram/Make.defs b/nuttx/configs/compal_e99/nsh_highram/Make.defs index 2d65c2782..a9454b0ec 100644 --- a/nuttx/configs/compal_e99/nsh_highram/Make.defs +++ b/nuttx/configs/compal_e99/nsh_highram/Make.defs @@ -100,7 +100,7 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/ez80f910200kitg/ostest/Make.defs b/nuttx/configs/ez80f910200kitg/ostest/Make.defs index 607a5adb7..98296a51b 100644 --- a/nuttx/configs/ez80f910200kitg/ostest/Make.defs +++ b/nuttx/configs/ez80f910200kitg/ostest/Make.defs @@ -232,7 +232,7 @@ else HOSTCC = gcc HOSTINCLUDES = -I. - HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = # This is the tool to use for dependencies (i.e., none) diff --git a/nuttx/configs/ez80f910200zco/dhcpd/Make.defs b/nuttx/configs/ez80f910200zco/dhcpd/Make.defs index c914fc263..8671fdd51 100644 --- a/nuttx/configs/ez80f910200zco/dhcpd/Make.defs +++ b/nuttx/configs/ez80f910200zco/dhcpd/Make.defs @@ -232,7 +232,7 @@ else HOSTCC = gcc HOSTINCLUDES = -I. - HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = # This is the tool to use for dependencies (i.e., none) diff --git a/nuttx/configs/ez80f910200zco/httpd/Make.defs b/nuttx/configs/ez80f910200zco/httpd/Make.defs index 5a8af2d34..a07580a32 100644 --- a/nuttx/configs/ez80f910200zco/httpd/Make.defs +++ b/nuttx/configs/ez80f910200zco/httpd/Make.defs @@ -232,7 +232,7 @@ else HOSTCC = gcc HOSTINCLUDES = -I. - HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = # This is the tool to use for dependencies (i.e., none) diff --git a/nuttx/configs/ez80f910200zco/nettest/Make.defs b/nuttx/configs/ez80f910200zco/nettest/Make.defs index f5cbc8f80..d13428a34 100644 --- a/nuttx/configs/ez80f910200zco/nettest/Make.defs +++ b/nuttx/configs/ez80f910200zco/nettest/Make.defs @@ -232,7 +232,7 @@ else HOSTCC = gcc HOSTINCLUDES = -I. - HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = # This is the tool to use for dependencies (i.e., none) diff --git a/nuttx/configs/ez80f910200zco/nsh/Make.defs b/nuttx/configs/ez80f910200zco/nsh/Make.defs index f0b8aa7c1..7a74bc306 100644 --- a/nuttx/configs/ez80f910200zco/nsh/Make.defs +++ b/nuttx/configs/ez80f910200zco/nsh/Make.defs @@ -232,7 +232,7 @@ else HOSTCC = gcc HOSTINCLUDES = -I. - HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = # This is the tool to use for dependencies (i.e., none) diff --git a/nuttx/configs/ez80f910200zco/ostest/Make.defs b/nuttx/configs/ez80f910200zco/ostest/Make.defs index fa60dac05..5d3d4689e 100644 --- a/nuttx/configs/ez80f910200zco/ostest/Make.defs +++ b/nuttx/configs/ez80f910200zco/ostest/Make.defs @@ -232,7 +232,7 @@ else HOSTCC = gcc HOSTINCLUDES = -I. - HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = # This is the tool to use for dependencies (i.e., none) diff --git a/nuttx/configs/ez80f910200zco/poll/Make.defs b/nuttx/configs/ez80f910200zco/poll/Make.defs index e1eefdd03..98ca22533 100644 --- a/nuttx/configs/ez80f910200zco/poll/Make.defs +++ b/nuttx/configs/ez80f910200zco/poll/Make.defs @@ -232,7 +232,7 @@ else HOSTCC = gcc HOSTINCLUDES = -I. - HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = # This is the tool to use for dependencies (i.e., none) diff --git a/nuttx/configs/m68332evb/Make.defs b/nuttx/configs/m68332evb/Make.defs index 6f6ae7ad0..28b7f73a0 100644 --- a/nuttx/configs/m68332evb/Make.defs +++ b/nuttx/configs/m68332evb/Make.defs @@ -77,5 +77,5 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/pjrc-8051/Make.defs b/nuttx/configs/pjrc-8051/Make.defs index 5cf9fadf1..154d36556 100644 --- a/nuttx/configs/pjrc-8051/Make.defs +++ b/nuttx/configs/pjrc-8051/Make.defs @@ -77,7 +77,7 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/us7032evb1/nsh/Make.defs b/nuttx/configs/us7032evb1/nsh/Make.defs index fcda18477..595bcf4fd 100644 --- a/nuttx/configs/us7032evb1/nsh/Make.defs +++ b/nuttx/configs/us7032evb1/nsh/Make.defs @@ -77,6 +77,6 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/us7032evb1/ostest/Make.defs b/nuttx/configs/us7032evb1/ostest/Make.defs index 379342a5d..6fe463388 100644 --- a/nuttx/configs/us7032evb1/ostest/Make.defs +++ b/nuttx/configs/us7032evb1/ostest/Make.defs @@ -77,6 +77,6 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/xtrs/nsh/Make.defs b/nuttx/configs/xtrs/nsh/Make.defs index 2c3e3302f..0eac402ab 100644 --- a/nuttx/configs/xtrs/nsh/Make.defs +++ b/nuttx/configs/xtrs/nsh/Make.defs @@ -87,5 +87,5 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/xtrs/ostest/Make.defs b/nuttx/configs/xtrs/ostest/Make.defs index 5823a1361..ae26822d5 100644 --- a/nuttx/configs/xtrs/ostest/Make.defs +++ b/nuttx/configs/xtrs/ostest/Make.defs @@ -87,5 +87,5 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/xtrs/pashello/Make.defs b/nuttx/configs/xtrs/pashello/Make.defs index 367d2d950..30caae7fd 100644 --- a/nuttx/configs/xtrs/pashello/Make.defs +++ b/nuttx/configs/xtrs/pashello/Make.defs @@ -87,5 +87,5 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/z16f2800100zcog/ostest/Make.defs b/nuttx/configs/z16f2800100zcog/ostest/Make.defs index e094f4ce6..b127a6b7f 100644 --- a/nuttx/configs/z16f2800100zcog/ostest/Make.defs +++ b/nuttx/configs/z16f2800100zcog/ostest/Make.defs @@ -183,5 +183,5 @@ DIRUNLINK = $(TOPDIR)/tools/unlink.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/z16f2800100zcog/pashello/Make.defs b/nuttx/configs/z16f2800100zcog/pashello/Make.defs index c06dc0d49..2ac7aff1e 100644 --- a/nuttx/configs/z16f2800100zcog/pashello/Make.defs +++ b/nuttx/configs/z16f2800100zcog/pashello/Make.defs @@ -183,5 +183,5 @@ DIRUNLINK = $(TOPDIR)/tools/unlink.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/z80sim/nsh/Make.defs b/nuttx/configs/z80sim/nsh/Make.defs index 40d934f1d..11253020e 100644 --- a/nuttx/configs/z80sim/nsh/Make.defs +++ b/nuttx/configs/z80sim/nsh/Make.defs @@ -87,5 +87,5 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/z80sim/ostest/Make.defs b/nuttx/configs/z80sim/ostest/Make.defs index 4905e82a3..d0185b4f9 100644 --- a/nuttx/configs/z80sim/ostest/Make.defs +++ b/nuttx/configs/z80sim/ostest/Make.defs @@ -87,5 +87,5 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/z80sim/pashello/Make.defs b/nuttx/configs/z80sim/pashello/Make.defs index 51bfd1d28..16d3ff342 100644 --- a/nuttx/configs/z80sim/pashello/Make.defs +++ b/nuttx/configs/z80sim/pashello/Make.defs @@ -87,5 +87,5 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/z8encore000zco/ostest/Make.defs b/nuttx/configs/z8encore000zco/ostest/Make.defs index 55e351a79..9f033c20a 100644 --- a/nuttx/configs/z8encore000zco/ostest/Make.defs +++ b/nuttx/configs/z8encore000zco/ostest/Make.defs @@ -217,5 +217,5 @@ DIRUNLINK = $(TOPDIR)/tools/unlink.sh HOSTCC = gcc HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = diff --git a/nuttx/configs/z8f64200100kit/ostest/Make.defs b/nuttx/configs/z8f64200100kit/ostest/Make.defs index 05c2b1593..570fd0f1b 100644 --- a/nuttx/configs/z8f64200100kit/ostest/Make.defs +++ b/nuttx/configs/z8f64200100kit/ostest/Make.defs @@ -259,7 +259,7 @@ else HOSTCC = gcc HOSTINCLUDES = -I. - HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = # This is the tool to use for dependencies (i.e., none) -- cgit v1.2.3 From 18b90c8848ca96919258e7df6dfd33a4ec7708d0 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 28 Nov 2012 15:53:42 +0000 Subject: Verify that z8 targets still build (under Cygwin) git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5396 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/arm/src/calypso/calypso_keypad.c | 1 + nuttx/arch/z80/src/common/up_doirq.c | 3 +- nuttx/arch/z80/src/ez80/switch.h | 5 +- nuttx/arch/z80/src/z8/switch.h | 8 +- nuttx/arch/z80/src/z80/switch.h | 5 +- nuttx/configs/z8encore000zco/README.txt | 57 +++++++- nuttx/configs/z8encore000zco/ostest/Make.defs | 183 ++++++++++++++++-------- nuttx/configs/z8encore000zco/ostest/setenv.sh | 33 +++-- nuttx/configs/z8encore000zco/scripts/setenv.bat | 50 +++++++ nuttx/configs/z8f64200100kit/README.txt | 55 ++++++- nuttx/configs/z8f64200100kit/ostest/Make.defs | 13 +- nuttx/configs/z8f64200100kit/ostest/setenv.sh | 4 +- nuttx/libc/string/lib_memcmp.c | 4 +- nuttx/libc/string/lib_memmove.c | 2 +- 14 files changed, 328 insertions(+), 95 deletions(-) create mode 100644 nuttx/configs/z8encore000zco/scripts/setenv.bat (limited to 'nuttx') diff --git a/nuttx/arch/arm/src/calypso/calypso_keypad.c b/nuttx/arch/arm/src/calypso/calypso_keypad.c index aeb16eb4d..d7f8ec780 100644 --- a/nuttx/arch/arm/src/calypso/calypso_keypad.c +++ b/nuttx/arch/arm/src/calypso/calypso_keypad.c @@ -203,6 +203,7 @@ static int keypad_open(file_t * filep) register uint16_t reg; /* Unmask keypad interrupt */ + reg = readw(ARMIO_REG(KBD_GPIO_MASKIT)); writew(reg & ~KBD_INT, ARMIO_REG(KBD_GPIO_MASKIT)); diff --git a/nuttx/arch/z80/src/common/up_doirq.c b/nuttx/arch/z80/src/common/up_doirq.c index fd871e246..a4bb830fd 100644 --- a/nuttx/arch/z80/src/common/up_doirq.c +++ b/nuttx/arch/z80/src/common/up_doirq.c @@ -84,7 +84,7 @@ FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs) #else if (irq < NR_IRQS) { - FAR chipreg_t *savestate; + DECL_SAVESTATE(); /* Indicate that we have entered IRQ processing logic */ @@ -106,4 +106,3 @@ FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs) return regs; #endif } - diff --git a/nuttx/arch/z80/src/ez80/switch.h b/nuttx/arch/z80/src/ez80/switch.h index de6506490..0bac6aed1 100644 --- a/nuttx/arch/z80/src/ez80/switch.h +++ b/nuttx/arch/z80/src/ez80/switch.h @@ -2,7 +2,7 @@ * arch/z80/src/ez80/switch.h * arch/z80/src/chip/switch.h * - * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -69,6 +69,9 @@ /* The following macro is used when the system enters interrupt handling logic */ +#define DECL_SAVESTATE() \ + FAR chipreg_t *savestate + #define IRQ_ENTER(irq, regs) \ do { \ savestate = (FAR chipreg_t *)current_regs; \ diff --git a/nuttx/arch/z80/src/z8/switch.h b/nuttx/arch/z80/src/z8/switch.h index 7738f2436..45089947c 100644 --- a/nuttx/arch/z80/src/z8/switch.h +++ b/nuttx/arch/z80/src/z8/switch.h @@ -2,7 +2,7 @@ * arch/z80/src/z8/switch.h * arch/z80/src/chip/switch.h * - * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -114,10 +114,8 @@ /* The following macro is used when the system enters interrupt handling logic */ -#define IRQ_SAVE(irq, regs) savestate = (FAR chipreg_t *)current_regs; -#define IRQ_ENTER(irq, regs) current_regs = (regs) - -/* The following macro is used when the system exits interrupt handling logic */ +#define DECL_SAVESTATE() \ + struct z8_irqstate_s savestate #define IRQ_ENTER(irq, regs) \ do { \ diff --git a/nuttx/arch/z80/src/z80/switch.h b/nuttx/arch/z80/src/z80/switch.h index e7f705cfd..3732a32a3 100644 --- a/nuttx/arch/z80/src/z80/switch.h +++ b/nuttx/arch/z80/src/z80/switch.h @@ -2,7 +2,7 @@ * arch/z80/src/z80/switch.h * arch/z80/src/chip/switch.h * - * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -68,6 +68,9 @@ /* The following macro is used when the system enters interrupt handling logic */ +#define DECL_SAVESTATE() \ + FAR chipreg_t *savestate + #define IRQ_ENTER(irq, regs) \ do { \ savestate = (FAR chipreg_t *)current_regs; \ diff --git a/nuttx/configs/z8encore000zco/README.txt b/nuttx/configs/z8encore000zco/README.txt index 9abc06f05..d37ee2302 100644 --- a/nuttx/configs/z8encore000zco/README.txt +++ b/nuttx/configs/z8encore000zco/README.txt @@ -4,7 +4,7 @@ README.txt ZDS-II Compiler Versions ^^^^^^^^^^^^^^^^^^^^^^^^ -4.10.1 +Version 4.10.1 The ZDS-II version 4.10.2 will not compile NuttX. It reports "internal errors" on one of the files, mm/mm_initialize.c. Below is a simple work- around. With this work-around in place, NuttX builds successfully with @@ -23,12 +23,23 @@ ZDS-II Compiler Versions /* Set up global variables */ -4.9.5 +Version 4.9.5 This is the latest tool version listed on the ZiLOG site for the Z8F6403. However, it uses different compiler command line arguments. +Version 5.0.0 + + On November 18, 2012, all of the z8 configurations were converted to use 5.0.0, + but have not been verified on a running target. + + Paths were also updated that are specific to a 32-bit toolchain running on + a 64 bit windows platform. Change to a different toolchain, you will need + to modify the versioning in Make.defs and setenv.sh; if you want to build + on a different platform, you will need to change the path in the ZDS binaries + in those same files. + Other Versions - If you use any version of ZDS-II other than 4.10.1 or if you install ZDS-II + If you use any version of ZDS-II other than 5.0.0 or if you install ZDS-II at any location other than the default location, you will have to modify two files: (1) configs/z8encore000zco/*/setenv.sh and (2) configs/z8encore000zco/*/Make.defs. @@ -57,4 +68,44 @@ available: This builds the examples/ostest application for execution from FLASH. See examples/README.txt for information about ostest. + NOTES: + + 1. This configuration uses the mconf-based configuration tool. To + change this configuration using that tool, you should: + + a. Build and install the mconf tool. See nuttx/README.txt and + misc/tools/ + + b. Execute 'make menuconfig' in nuttx/ in order to start the + reconfiguration process. + + 2. By default, this configuration assumes that you are using the + Cygwin environment on Windows. An option is to use the native + CMD.exe window build as described in the top-level README.txt + file. To set up that configuration: + + -CONFIG_WINDOWS_CYGWIN=y + +CONFIG_WINDOWS_NATIVE=y + + And after configuring, make sure that CONFIG_APPS_DIR uses + the back slash character. For example: + + CONFIG_APPS_DIR="..\apps" + + NOTES: + + a. If you need to change the toolchain path used in Make.defs, you + will need to use the short 8.3 filenames to avoid spaces. On my + PC, C:\PROGRA~1\ is is C:\Program Files\ and C:\PROGRA~2\ is + C:\Program Files (x86)\ + b. You can't use setenv.sh in the native Windows environment. Try + scripts/setenv.bat instead. + c. At present, the native Windows build fails at the final link stages. + The failure is due to problems in arch/z80/src/nuttx/linkcmd that + is autogenerated by arch/z80/src/Makefile.zdsii. The basic program + is the spurious spaces and and carrirage returns are generated at + the end of the lines after a line continuation (\ ^M). If these + trailing bad characters are manually eliminated, then the build + will succeed on the next try. + Check out any README.txt files in these s. diff --git a/nuttx/configs/z8encore000zco/ostest/Make.defs b/nuttx/configs/z8encore000zco/ostest/Make.defs index 9f033c20a..bbb9a9ddc 100644 --- a/nuttx/configs/z8encore000zco/ostest/Make.defs +++ b/nuttx/configs/z8encore000zco/ostest/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/z8encore000zco/ostest/Make.defs # -# Copyright (C) 2008 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -33,27 +33,44 @@ # ############################################################################ -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/.config +include $(TOPDIR)/tools/Config.mk -# These are the directories where the ZDS-II toolchain is installed +# These are the directories where the ZDS-II toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. -ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_Z8Encore!_4.10.1 +ZDSVERSION := 5.0.0 ifeq ($(CONFIG_WINDOWS_NATIVE),y) - ZDSBINDIR := $(ZDSINSTALLDIR)\bin - ZDSSTDINCDIR := $(ZDSINSTALLDIR)\include\std - ZDSZILOGINCDIR := $(ZDSINSTALLDIR)\include\zilog + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) + INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} + ZDSBINDIR := $(INSTALLDIR)\bin + ZDSSTDINCDIR := $(INSTALLDIR)\include\std + ZDSZILOGINCDIR := $(INSTALLDIR)\include\zilog ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y) - ZDSDEVINCDIR := $(ZDSZILOGINCDIR)\Z8Encore_F642X + ZDSDEVINCDIR := $(INSTALLDIR)\Z8Encore_F642X endif ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) - ZDSDEVINCDIR := $(ZDSZILOGINCDIR)\Z8Encore_F640X + ZDSDEVINCDIR := $(INSTALLDIR)\Z8Encore_F640X endif - ZDSSTDLIBDIR := $(ZDSINSTALLDIR)\lib\std - ZDSZILOGLIBDIR := $(ZDSINSTALLDIR)\lib\zilog + ZDSSTDLIBDIR := $(INSTALLDIR)\lib\std + ZDSZILOGLIBDIR := $(INSTALLDIR)\lib\zilog + + # CFLAGs + + ARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + EARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std @@ -66,43 +83,50 @@ ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) endif ZDSSTDLIBDIR := $(INSTALLDIR)/lib/std ZDSZILOGLIBDIR := $(INSTALLDIR)/lib/zilog -endif -# These are the same directories but with the directory separator -# character swapped as needed by the ZDS-II compiler + # 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)"} + WZDSDEVINCDIR := ${shell cygpath -w "$(ZDSDEVINCDIR)"} + WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} + WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} -WTOPDIR := ${shell cygpath -w "$(TOPDIR)"} -WZDSSTDINCDIR := ${shell cygpath -w "$(ZDSSTDINCDIR)"} -WZDSZILOGINCDIR := ${shell cygpath -w "$(ZDSZILOGINCDIR)"} -WZDSDEVINCDIR := ${shell cygpath -w "$(ZDSDEVINCDIR)"} -WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} -WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} + # Escaped versions -# Escaped versions + ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} + EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} + EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' +endif # Assembler definitions ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y) -ARCHFAMILYDEF = _Z8ENCORE_F642X -ARCHSERIESDEF = _Z8ENCORE_64K_SERIES -ARCHREVAA = -NOrevaa + ARCHFAMILYDEF = _Z8ENCORE_F642X + ARCHSERIESDEF = _Z8ENCORE_64K_SERIES + ARCHREVAA = -NOrevaa ifeq ($(CONFIG_ARCH_CHIP_Z8F6423),y) -ARCHCPU = Z8F6423 -ARCHCPUDEF = _Z8F6423 + ARCHCPU = Z8F6423 + ARCHCPUDEF = _Z8F6423 endif endif ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) -ARCHFAMILYDEF = _Z8ENCORE_F640X -ARCHSERIESDEF = _Z8ENCORE_640_FAMILY -ARCHREVAA = -revaa + ARCHFAMILYDEF = _Z8ENCORE_F640X + ARCHSERIESDEF = _Z8ENCORE_640_FAMILY + ARCHREVAA = -revaa ifeq ($(CONFIG_ARCH_CHIP_Z8F6403),y) -ARCHCPU = Z8F6403 -ARCHCPUDEF = _Z8F6403 + ARCHCPU = Z8F6403 + ARCHCPUDEF = _Z8F6403 endif endif @@ -116,8 +140,6 @@ ARCHASMCPUFLAGS = -cpu:$(ARCHCPU) -NOigcase $(ARCHREVAA) ARCHASMLIST = -list -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet ARCHASMWARNINGS = -warn ARCHASMDEFINES = -define:$(ARCHCPUDEF)=1 -define:$(ARCHSERIESDEF)=1 -define:$(ARCHFAMILYDEF)=1 -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions @@ -135,12 +157,11 @@ ARCHPICFLAGS = ARCHWARNINGS = -warn ARCHDEFINES = -define:$(ARCHFAMILYDEF) -define:$(ARCHCPUDEF) -define:$(ARCHSERIESDEF) ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR);$(WZDSDEVINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPDEFINES = -D$(ARCHFAMILYDEF) -D$(ARCHCPUDEF) -D$(ARCHSERIESDEF) -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include +CPPINCLUDES = -I$(TOPDIR)$(DELIM)include CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions @@ -149,16 +170,16 @@ ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/z8encore000zco/ostest/ostest.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)configs$(DELIM)z8encore000zco$(DELIM)ostest$(DELIM)ostest.linkcmd # Tool names/pathes CROSSDEV = -CC = $(ZDSBINDIR)/ez8cc.exe +CC = ez8cc.exe CPP = gcc -E -LD = $(ZDSBINDIR)/ez8link.exe -AS = $(ZDSBINDIR)/ez8asm.exe -AR = $(ZDSBINDIR)/ez8lib.exe +LD = ez8link.exe +AS = ez8asm.exe +AR = ez8lib.exe # File extensions @@ -171,51 +192,89 @@ EXEEXT = .hex # to compile and assembly source files and to insert the resulting # object files into an archive +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + define PREPROCESS - @echo "CPP: $1->$2" + @echo CPP: $1->$2 $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 endef define COMPILE - @#echo "CC: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef define ASSEMBLE - @#echo "AS: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) define ARCHIVE - echo "AR: $2"; + echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef + +define CLEAN + $(Q) if exist *.obj (del /f /q *.obj) + $(Q) if exist *.src (del /f /q *.src) + $(Q) if exist *.lib (del /f /q *.lib) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.lod (del /f /q *.lod) + $(Q) if exist *.lst (del /f /q *.lst) +endef + else + +define PREPROCESS + @echo "CPP: $1->$2" + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) +endef + +define ASSEMBLE + $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) +endef + define ARCHIVE $(Q) for __obj in $(2) ; do \ echo "AR: $$__obj"; \ "$(AR)" $(ARFLAGS) $1=-+$$__obj || { echo "$(AR) $1=-+$$__obj FAILED!" ; exit 1 ; } \ done endef -endif define CLEAN - $(Q) rm -f *.obj *.src *.lib *.hex *.lst + $(Q) rm -f *.obj *.src *.lib *.hex *.lod *.lst endef +endif -# This is the tool to use for dependencies (i.e., none) +# Windows native host tool definitions -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe -# ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + # Windows-native host tools -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif diff --git a/nuttx/configs/z8encore000zco/ostest/setenv.sh b/nuttx/configs/z8encore000zco/ostest/setenv.sh index 5aa816dd9..e866ad740 100755 --- a/nuttx/configs/z8encore000zco/ostest/setenv.sh +++ b/nuttx/configs/z8encore000zco/ostest/setenv.sh @@ -1,7 +1,7 @@ #!/bin/bash # configs/z8encore000zco/ostest/setenv.sh # -# Copyright (C) 2008 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2009, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -33,20 +33,31 @@ # # Check how we were executed # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + # -# The ZDS-II toolchain lies outside of the Cygwin "sandbox" and -# attempts to set the PATH variable do not have the desired effect. -# Instead, alias are provided for all of the ZDS-II command line tools. -# Version 4.10.1 installed in the default location is assumed here. +# This is the Cygwin path to location where the XDS-II tools were installed # -ZDSBINDIR="C:/Program\ Files/ZiLOG/ZDSII_Z8Encore!_4.10.1/bin" -alias ez8asm="${ZDSBINDIR}/ez8asm.exe" -alias ez8cc="${ZDSBINDIR}/ez8cc.exe" -alias ez8lib="${ZDSBINDIR}/ez8lib.exe" -alias ez8link="${ZDSBINDIR}/ez8link.exe" +TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/ZiLOG/ZDSII_Z8Encore!_5.0.0/bin" +# +# Add the path to the toolchain to the PATH varialble. NOTE that /bin and /usr/bin +# preceded the toolchain bin directory. This is because the ZDSII bin directory +# includes binaries like make.exe that will interfere with the normal build process +# if we do not give priority to the versions at /bin and /usr/bin. +# +export PATH="/bin:/usr/bin:${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +echo "PATH : ${PATH}" diff --git a/nuttx/configs/z8encore000zco/scripts/setenv.bat b/nuttx/configs/z8encore000zco/scripts/setenv.bat new file mode 100644 index 000000000..f208a6e8b --- /dev/null +++ b/nuttx/configs/z8encore000zco/scripts/setenv.bat @@ -0,0 +1,50 @@ +@echo off + +rem configs/z8encore000zco/scripts/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the ZDS-II toolchain. + +set PATH=C:\Program Files (x86)\ZiLOG\ZZDSII_Z8Encore!_5.0.0\bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% +echo %PATH% diff --git a/nuttx/configs/z8f64200100kit/README.txt b/nuttx/configs/z8f64200100kit/README.txt index afe647565..1bb70ebb7 100644 --- a/nuttx/configs/z8f64200100kit/README.txt +++ b/nuttx/configs/z8f64200100kit/README.txt @@ -23,12 +23,23 @@ ZDS-II Compiler Versions /* Set up global variables */ -4.9.5 +Version 4.9.5 This is the latest tool version listed on the ZiLOG site for the Z8F6403. However, it uses different compiler command line arguments. +Version 5.0.0 + + On November 18, 2012, all of the z8 configurations were converted to use 5.0.0, + but have not been verified on a running target. + + Paths were also updated that are specific to a 32-bit toolchain running on + a 64 bit windows platform. Change to a different toolchain, you will need + to modify the versioning in Make.defs and setenv.sh; if you want to build + on a different platform, you will need to change the path in the ZDS binaries + in those same files. + Other Versions - If you use any version of ZDS-II other than 4.10.1 or if you install ZDS-II + If you use any version of ZDS-II other than 5.0.0 or if you install ZDS-II at any location other than the default location, you will have to modify two files: (1) configs/z8f64200100kit/*/setenv.sh and (2) configs/z8f64200100kit/*/Make.defs. @@ -57,4 +68,44 @@ available: This builds the examples/ostest application for execution from FLASH. See examples/README.txt for information about ostest. + NOTES: + + 1. This configuration uses the mconf-based configuration tool. To + change this configuration using that tool, you should: + + a. Build and install the mconf tool. See nuttx/README.txt and + misc/tools/ + + b. Execute 'make menuconfig' in nuttx/ in order to start the + reconfiguration process. + + 2. By default, this configuration assumes that you are using the + Cygwin environment on Windows. An option is to use the native + CMD.exe window build as described in the top-level README.txt + file. To set up that configuration: + + -CONFIG_WINDOWS_CYGWIN=y + +CONFIG_WINDOWS_NATIVE=y + + And after configuring, make sure that CONFIG_APPS_DIR uses + the back slash character. For example: + + CONFIG_APPS_DIR="..\apps" + + NOTES: + + a. If you need to change the toolchain path used in Make.defs, you + will need to use the short 8.3 filenames to avoid spaces. On my + PC, C:\PROGRA~1\ is is C:\Program Files\ and C:\PROGRA~2\ is + C:\Program Files (x86)\ + b. You can't use setenv.sh in the native Windows environment. Try + scripts/setenv.bat instead. + c. At present, the native Windows build fails at the final link stages. + The failure is due to problems in arch/z80/src/nuttx/linkcmd that + is autogenerated by arch/z80/src/Makefile.zdsii. The basic program + is the spurious spaces and and carrirage returns are generated at + the end of the lines after a line continuation (\ ^M). If these + trailing bad characters are manually eliminated, then the build + will succeed on the next try. + Check out any README.txt files in these s. diff --git a/nuttx/configs/z8f64200100kit/ostest/Make.defs b/nuttx/configs/z8f64200100kit/ostest/Make.defs index 570fd0f1b..8b58a7346 100644 --- a/nuttx/configs/z8f64200100kit/ostest/Make.defs +++ b/nuttx/configs/z8f64200100kit/ostest/Make.defs @@ -36,7 +36,14 @@ include $(TOPDIR)/.config include $(TOPDIR)/tools/Config.mk -# These are the directories where the ZDS-II toolchain is installed +# These are the directories where the ZDS-II toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. ZDSVERSION := 5.0.0 @@ -63,7 +70,7 @@ endif ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y - ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std @@ -179,7 +186,7 @@ AR = ez8lib.exe ASMEXT = .asm OBJEXT = .obj LIBEXT = .lib -EXEXT = .hex +EXEEXT = .hex # These are the macros that will be used in the NuttX make system # to compile and assembly source files and to insert the resulting diff --git a/nuttx/configs/z8f64200100kit/ostest/setenv.sh b/nuttx/configs/z8f64200100kit/ostest/setenv.sh index 1a135a7d6..b06ae60f9 100755 --- a/nuttx/configs/z8f64200100kit/ostest/setenv.sh +++ b/nuttx/configs/z8f64200100kit/ostest/setenv.sh @@ -1,7 +1,7 @@ #!/bin/bash -# configs/ez80f910200kitg/ostest/setenv.sh +# configs/z8f64200100kit/ostest/setenv.sh # -# Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2009, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without diff --git a/nuttx/libc/string/lib_memcmp.c b/nuttx/libc/string/lib_memcmp.c index e1722a4d8..5434bb847 100644 --- a/nuttx/libc/string/lib_memcmp.c +++ b/nuttx/libc/string/lib_memcmp.c @@ -1,7 +1,7 @@ /************************************************************ * libc/string/lib_memcmp.c * - * Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,7 +50,7 @@ ************************************************************/ #ifndef CONFIG_ARCH_MEMCMP -int memcmp(const void *s1, const void *s2, size_t n) +int memcmp(FAR const void *s1, FAR const void *s2, size_t n) { unsigned char *p1 = (unsigned char *)s1; unsigned char *p2 = (unsigned char *)s2; diff --git a/nuttx/libc/string/lib_memmove.c b/nuttx/libc/string/lib_memmove.c index cbc26fb26..cc8317223 100644 --- a/nuttx/libc/string/lib_memmove.c +++ b/nuttx/libc/string/lib_memmove.c @@ -50,7 +50,7 @@ ************************************************************/ #ifndef CONFIG_ARCH_MEMMOVE -void *memmove(void *dest, const void *src, size_t count) +FAR void *memmove(FAR void *dest, FAR const void *src, size_t count) { char *tmp, *s; if (dest <= src) -- cgit v1.2.3 From afd86a08b5fb4b12ac25c23824e8c9592c5f265c Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 28 Nov 2012 17:50:28 +0000 Subject: z8 configurations all converted to use mconf tool git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5397 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 3 +- nuttx/arch/Kconfig | 6 + nuttx/arch/z80/Kconfig | 30 +- nuttx/arch/z80/src/ez80/Kconfig | 7 - nuttx/arch/z80/src/z8/Kconfig | 13 + nuttx/configs/Kconfig | 14 +- nuttx/configs/ez80f910200kitg/ostest/Make.defs | 11 +- nuttx/configs/ez80f910200zco/dhcpd/Make.defs | 11 +- nuttx/configs/ez80f910200zco/httpd/Make.defs | 11 +- nuttx/configs/ez80f910200zco/nettest/Make.defs | 11 +- nuttx/configs/ez80f910200zco/nsh/Make.defs | 11 +- nuttx/configs/ez80f910200zco/ostest/Make.defs | 11 +- nuttx/configs/ez80f910200zco/poll/Make.defs | 11 +- nuttx/configs/z8encore000zco/ostest/appconfig | 39 -- nuttx/configs/z8encore000zco/ostest/defconfig | 589 ++++++++++++++++++------- nuttx/configs/z8f64200100kit/ostest/appconfig | 39 -- nuttx/configs/z8f64200100kit/ostest/defconfig | 588 +++++++++++++++++------- 17 files changed, 951 insertions(+), 454 deletions(-) delete mode 100644 nuttx/configs/z8encore000zco/ostest/appconfig delete mode 100644 nuttx/configs/z8f64200100kit/ostest/appconfig (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 170a55453..97b5b74a0 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3706,4 +3706,5 @@ -Wstrict-prototypes (From Denis Cariki). * arch/arm/src/calapyso/calypso_keypad.c: Add Calypso keypad driver. From Denis Cariki. - + * z8encore000zco/ostest and z8f64200100kit/ostest: Converted to use Kconfig/ + mconf configuration tool. diff --git a/nuttx/arch/Kconfig b/nuttx/arch/Kconfig index bbe99c17c..5cee40628 100644 --- a/nuttx/arch/Kconfig +++ b/nuttx/arch/Kconfig @@ -117,6 +117,12 @@ config ARCH_STACKDUMP ---help--- Enable to do stack dumps after assertions +config ENDIAN_BIG + bool "Big Endian Architecture" + default n + ---help--- + Select if architecture operates using big-endian byte ordering. + comment "Board Settings" config BOARD_LOOPSPERMSEC diff --git a/nuttx/arch/z80/Kconfig b/nuttx/arch/z80/Kconfig index a2764cb65..12ab5dc0b 100644 --- a/nuttx/arch/z80/Kconfig +++ b/nuttx/arch/z80/Kconfig @@ -13,56 +13,62 @@ config ARCH_CHIP_Z80 ---help--- Classic ZiLOG z80 chip -config ARCH_CHIP_Z8F640X - bool "Z8F640X" - select ARCH_CHIP_Z8 - ---help--- - ZiLOG Z8F640X (z8 Encore) - config ARCH_CHIP_Z8F6403 bool "Z8F6403" select ARCH_CHIP_Z8 + select ARCH_CHIP_Z8F640X + select ENDIAN_BIG + select HAVE_LOWUARTINIT ---help--- ZiLOG Z8F6403 (z8 Encore) -config ARCH_CHIP_Z8F642X - bool "Z8F642X" - select ARCH_CHIP_Z8 - ---help--- - ZiLOG Z8F642X (z8 Encore) - config ARCH_CHIP_Z8F6423 bool "Z8F6423" select ARCH_CHIP_Z8 + select ARCH_CHIP_Z8F642X + select ENDIAN_BIG + select HAVE_LOWUARTINIT ---help--- ZiLOG Z8F6423 (z8 Encore) config ARCH_CHIP_EZ80F91 bool "EZ80F91" select ARCH_CHIP_EZ80 + select HAVE_LOWUARTINIT ---help--- ZiLOG EZ80F91 (ez80 Acclaim) config ARCH_CHIP_EZ80F92 bool "EZ80F92" select ARCH_CHIP_EZ80 + select HAVE_LOWUARTINIT ---help--- ZiLOG EZ80F92 (ez80 Acclaim) config ARCH_CHIP_EZ80F93 bool "EZ80F93" select ARCH_CHIP_EZ80 + select HAVE_LOWUARTINIT ---help--- ZiLOG EZ80F93 (ez80 Acclaim) endchoice +config ARCH_CHIP_Z8F642X + bool + +config ARCH_CHIP_Z8F640X + bool + config ARCH_CHIP_Z8 bool config ARCH_CHIP_EZ80 bool +config HAVE_LOWUARTINIT + bool + config ARCH_CHIP string default "z80" if ARCH_CHIP_Z80 diff --git a/nuttx/arch/z80/src/ez80/Kconfig b/nuttx/arch/z80/src/ez80/Kconfig index 6bde573f6..d257ca285 100644 --- a/nuttx/arch/z80/src/ez80/Kconfig +++ b/nuttx/arch/z80/src/ez80/Kconfig @@ -31,13 +31,6 @@ config EZ80_EMAC endmenu -config HAVE_LOWUARTINIT - bool "Low UART Init" - default y if !EZ80_UART0 && !EZ80_UART1 && !EZ80_UART2 - default n if EZ80_UART0 || EZ80_UART1 || EZ80_UART2 - ---help--- - Provides low-level UART initialization logic as up_lowuartinit (only needed if there is no serial driver). - if EZ80_EMAC config EZ80_FIAD diff --git a/nuttx/arch/z80/src/z8/Kconfig b/nuttx/arch/z80/src/z8/Kconfig index 1f0289f7c..2bf89905e 100644 --- a/nuttx/arch/z80/src/z8/Kconfig +++ b/nuttx/arch/z80/src/z8/Kconfig @@ -4,4 +4,17 @@ # if ARCH_CHIP_Z8 + +# UART0/1 always enabled + +config Z8_UART0 + bool + default y + select ARCH_HAVE_UART0 + +config Z8_UART1 + bool + default y + select ARCH_HAVE_UART1 + endif diff --git a/nuttx/configs/Kconfig b/nuttx/configs/Kconfig index 70b3ed76e..a89e7cdea 100644 --- a/nuttx/configs/Kconfig +++ b/nuttx/configs/Kconfig @@ -573,20 +573,20 @@ config ARCH_BOARD_Z80SIM (verified with version 2.6.0). config ARCH_BOARD_Z8ENCORE000ZCO - bool "ZiLOG z8encore000zco Development Kit" + bool "ZiLOG Z8ENCORE000ZCO Development Kit" depends on ARCH_CHIP_Z8F6403 select ARCH_HAVE_LEDS ---help--- - z8Encore! Microcontroller. This port use the ZiLOG z8encore000zco + z8Encore! Microcontroller. This port use the ZiLOG Z8ENCORE000ZCO development kit, Z8F6403 part, and the Zilog ZDS-II Windows command line tools. The development environment is Cygwin under WinXP. -config ARCH_BOARD_Z8F64200100KI +config ARCH_BOARD_Z8F64200100KIT bool "ZiLOG Z8F64200100KIT Development Kit" - depends on ARCH_CHIP_Z8F642X + depends on ARCH_CHIP_Z8F6423 select ARCH_HAVE_LEDS ---help--- - z8Encore! Microcontroller. This port use the Zilog z8f64200100kit + z8Encore! Microcontroller. This port use the Zilog Z8F64200100KIT development kit, Z8F6423 part, and the Zilog ZDS-II Windows command line tools. The development environment is Cygwin under WinXP. @@ -669,7 +669,7 @@ config ARCH_BOARD default "z16f2800100zcog" if ARCH_BOARD_Z16F2800100ZCOG default "z80sim" if ARCH_BOARD_Z80SIM default "z8encore000zco" if ARCH_BOARD_Z8ENCORE000ZCO - default "z8f64200100kit" if ARCH_BOARD_Z8F64200100KI + default "z8f64200100kit" if ARCH_BOARD_Z8F64200100KIT default "sim" if ARCH_BOARD_SIM default "" if ARCH_BOARD_CUSTOM @@ -902,7 +902,7 @@ endif if ARCH_BOARD_Z8ENCORE000ZCO source "configs/z8encore000zco/Kconfig" endif -if ARCH_BOARD_Z8F64200100KI +if ARCH_BOARD_Z8F64200100KIT source "configs/z8f64200100kit/Kconfig" endif if ARCH_BOARD_SIM diff --git a/nuttx/configs/ez80f910200kitg/ostest/Make.defs b/nuttx/configs/ez80f910200kitg/ostest/Make.defs index 98296a51b..0124684c6 100644 --- a/nuttx/configs/ez80f910200kitg/ostest/Make.defs +++ b/nuttx/configs/ez80f910200kitg/ostest/Make.defs @@ -36,7 +36,14 @@ include $(TOPDIR)/.config include $(TOPDIR)/tools/Config.mk -# These are the directories where the ZDS-II toolchain is installed +# These are the directories where the ZDS-II toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. ZDSVERSION := 5.1.1 @@ -57,7 +64,7 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y - ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std diff --git a/nuttx/configs/ez80f910200zco/dhcpd/Make.defs b/nuttx/configs/ez80f910200zco/dhcpd/Make.defs index 8671fdd51..f227a046c 100644 --- a/nuttx/configs/ez80f910200zco/dhcpd/Make.defs +++ b/nuttx/configs/ez80f910200zco/dhcpd/Make.defs @@ -36,7 +36,14 @@ include $(TOPDIR)/.config include $(TOPDIR)/tools/Config.mk -# These are the directories where the ZDS-II toolchain is installed +# These are the directories where the ZDS-II toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. ZDSVERSION := 5.1.1 @@ -57,7 +64,7 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y - ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std diff --git a/nuttx/configs/ez80f910200zco/httpd/Make.defs b/nuttx/configs/ez80f910200zco/httpd/Make.defs index a07580a32..398a6ec5d 100644 --- a/nuttx/configs/ez80f910200zco/httpd/Make.defs +++ b/nuttx/configs/ez80f910200zco/httpd/Make.defs @@ -36,7 +36,14 @@ include $(TOPDIR)/.config include $(TOPDIR)/tools/Config.mk -# These are the directories where the ZDS-II toolchain is installed +# These are the directories where the ZDS-II toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. ZDSVERSION := 5.1.1 @@ -57,7 +64,7 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y - ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std diff --git a/nuttx/configs/ez80f910200zco/nettest/Make.defs b/nuttx/configs/ez80f910200zco/nettest/Make.defs index d13428a34..02b6a22a2 100644 --- a/nuttx/configs/ez80f910200zco/nettest/Make.defs +++ b/nuttx/configs/ez80f910200zco/nettest/Make.defs @@ -36,7 +36,14 @@ include $(TOPDIR)/.config include $(TOPDIR)/tools/Config.mk -# These are the directories where the ZDS-II toolchain is installed +# These are the directories where the ZDS-II toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. ZDSVERSION := 5.1.1 @@ -57,7 +64,7 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y - ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std diff --git a/nuttx/configs/ez80f910200zco/nsh/Make.defs b/nuttx/configs/ez80f910200zco/nsh/Make.defs index 7a74bc306..6a0c9bb73 100644 --- a/nuttx/configs/ez80f910200zco/nsh/Make.defs +++ b/nuttx/configs/ez80f910200zco/nsh/Make.defs @@ -36,7 +36,14 @@ include $(TOPDIR)/.config include $(TOPDIR)/tools/Config.mk -# These are the directories where the ZDS-II toolchain is installed +# These are the directories where the ZDS-II toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. ZDSVERSION := 5.1.1 @@ -57,7 +64,7 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y - ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std diff --git a/nuttx/configs/ez80f910200zco/ostest/Make.defs b/nuttx/configs/ez80f910200zco/ostest/Make.defs index 5d3d4689e..727c68ba3 100644 --- a/nuttx/configs/ez80f910200zco/ostest/Make.defs +++ b/nuttx/configs/ez80f910200zco/ostest/Make.defs @@ -36,7 +36,14 @@ include $(TOPDIR)/.config include $(TOPDIR)/tools/Config.mk -# These are the directories where the ZDS-II toolchain is installed +# These are the directories where the ZDS-II toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. ZDSVERSION := 5.1.1 @@ -57,7 +64,7 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y - ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std diff --git a/nuttx/configs/ez80f910200zco/poll/Make.defs b/nuttx/configs/ez80f910200zco/poll/Make.defs index 98ca22533..d7ba08ec0 100644 --- a/nuttx/configs/ez80f910200zco/poll/Make.defs +++ b/nuttx/configs/ez80f910200zco/poll/Make.defs @@ -36,7 +36,14 @@ include $(TOPDIR)/.config include $(TOPDIR)/tools/Config.mk -# These are the directories where the ZDS-II toolchain is installed +# These are the directories where the ZDS-II toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. ZDSVERSION := 5.1.1 @@ -57,7 +64,7 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y - ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_eZ80Acclaim!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std diff --git a/nuttx/configs/z8encore000zco/ostest/appconfig b/nuttx/configs/z8encore000zco/ostest/appconfig deleted file mode 100644 index 212b52f72..000000000 --- a/nuttx/configs/z8encore000zco/ostest/appconfig +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################ -# configs/z8encore000zco/ostest/appconfig -# -# Copyright (C) 2011 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. -# -############################################################################ - -# Path to example in apps/examples containing the user_start entry point - -CONFIGURED_APPS += examples/ostest - diff --git a/nuttx/configs/z8encore000zco/ostest/defconfig b/nuttx/configs/z8encore000zco/ostest/defconfig index 05e7c906c..a79355b71 100644 --- a/nuttx/configs/z8encore000zco/ostest/defconfig +++ b/nuttx/configs/z8encore000zco/ostest/defconfig @@ -1,120 +1,161 @@ -############################################################################ -# configs/z8encore000zco/ostest/defconfig -# -# Copyright (C) 2008-2010, 2012 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. -# -############################################################################ -# -# Architecture selection # +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_LINUX is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +# CONFIG_WINDOWS_NATIVE is not set +CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="../apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +CONFIG_DEBUG=y +# CONFIG_DEBUG_VERBOSE is not set +# CONFIG_DEBUG_ENABLE is not set + +# +# Subsystem Debug Options +# +# CONFIG_DEBUG_MM is not set +# CONFIG_DEBUG_SCHED is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_DEBUG_LIB is not set +# CONFIG_DEBUG_BINFMT is not set +# CONFIG_DEBUG_GRAPHICS is not set + +# +# Driver Debug Options +# +# CONFIG_DEBUG_ANALOG is not set +# CONFIG_DEBUG_DMA is not set +# CONFIG_DEBUG_SYMBOLS is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set +CONFIG_ARCH_Z80=y CONFIG_ARCH="z80" -CONFIG_ARCH_Z8=y CONFIG_ARCH_CHIP="z8" -CONFIG_ARCH_CHIP_Z8=y -CONFIG_ARCH_CHIP_Z8F640X=y -CONFIG_ARCH_CHIP_Z8F6403=y -CONFIG_ARCH_CHIP_Z8F642X=n -CONFIG_ARCH_CHIP_Z8F6423=n -CONFIG_ARCH_BOARD="z8encore000zco" -CONFIG_ARCH_BOARD_Z8ENCORE000ZCO=y CONFIG_BOARD_LOOPSPERMSEC=1250 +# CONFIG_ARCH_CHIP_Z80 is not set +CONFIG_ARCH_CHIP_Z8F6403=y +# CONFIG_ARCH_CHIP_Z8F6423 is not set +# CONFIG_ARCH_CHIP_EZ80F91 is not set +# CONFIG_ARCH_CHIP_EZ80F92 is not set +# CONFIG_ARCH_CHIP_EZ80F93 is not set +CONFIG_ARCH_CHIP_Z8F640X=y +CONFIG_ARCH_CHIP_Z8=y +CONFIG_HAVE_LOWUARTINIT=y +CONFIG_Z8_UART0=y +CONFIG_Z8_UART1=y + +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_STACKDUMP is not set CONFIG_ENDIAN_BIG=y + +# +# Board Settings +# CONFIG_DRAM_START=0x0 CONFIG_DRAM_SIZE=65536 -CONFIG_ARCH_LEDS=n + # -# eZ8 specific device driver settings +# Boot options # -CONFIG_UART0_SERIAL_CONSOLE=y -CONFIG_UART1_SERIAL_CONSOLE=n -CONFIG_UART0_TXBUFSIZE=0 -CONFIG_UART1_TXBUFSIZE=0 -CONFIG_UART0_RXBUFSIZE=0 -CONFIG_UART1_RXBUFSIZE=0 -CONFIG_UART0_BAUD=57600 -CONFIG_UART1_BAUD=57600 -CONFIG_UART0_PARITY=0 -CONFIG_UART1_PARITY=0 -CONFIG_UART0_2STOP=0 -CONFIG_UART1_2STOP=0 +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set # -# General build options +# Board Selection # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n +CONFIG_ARCH_BOARD_Z8ENCORE000ZCO=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="z8encore000zco" # -# General OS setup +# Common Board Options # -CONFIG_USER_ENTRYPOINT="ostest_main" -CONFIG_DEBUG=y -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y -CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=n -CONFIG_TASK_NAME_SIZE=0 -CONFIG_START_YEAR=2008 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=17 -CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=y -CONFIG_DEV_CONSOLE=n -CONFIG_DEV_LOWCONSOLE=n -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n -CONFIG_SDCLONE_DISABLE=y +CONFIG_ARCH_HAVE_LEDS=y +# CONFIG_ARCH_LEDS is not set # -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. +# Board-Specific Options # -# There are certain dependency relationships in these -# features. + # -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. +# RTOS Features # +CONFIG_MSEC_PER_TICK=10 +CONFIG_RR_INTERVAL=0 +# CONFIG_SCHED_INSTRUMENTATION is not set +CONFIG_TASK_NAME_SIZE=0 +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2012 +CONFIG_START_MONTH=11 +CONFIG_START_DAY=28 +# CONFIG_DEV_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="ostest_main" +CONFIG_DISABLE_OS_API=y CONFIG_DISABLE_CLOCK=y CONFIG_DISABLE_POSIX_TIMERS=y CONFIG_DISABLE_PTHREAD=y @@ -124,28 +165,6 @@ CONFIG_DISABLE_MOUNTPOINT=y CONFIG_DISABLE_ENVIRON=y CONFIG_DISABLE_POLL=y -# -# Misc libc settings -# -CONFIG_NOPRINTF_FIELDWIDTH=y - -# -# Allow for architecture optimized implementations -# -# The architecture can provide optimized versions of the -# following to improve sysem performance -# -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n - # # Sizes of configurable things (0 disables) # @@ -155,8 +174,6 @@ CONFIG_NPTHREAD_KEYS=0 CONFIG_NFILE_DESCRIPTORS=0 CONFIG_NFILE_STREAMS=0 CONFIG_NAME_MAX=32 -CONFIG_STDIO_BUFFER_SIZE=0 -CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_MQ_MSGS=0 CONFIG_MQ_MAXMSGSIZE=0 CONFIG_MAX_WDOGPARMS=2 @@ -164,67 +181,303 @@ CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 # -# TCP/IP and UDP support via uIP +# Stack and heap information # -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n +# CONFIG_CUSTOM_STACK is not set +CONFIG_IDLETHREAD_STACKSIZE=256 +CONFIG_USERMAIN_STACKSIZE=256 +CONFIG_PTHREAD_STACK_MIN=128 +CONFIG_PTHREAD_STACK_DEFAULT=256 # -# UIP Network Utilities +# Device Drivers +# +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART0=y +CONFIG_ARCH_HAVE_UART1=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +CONFIG_UART0_SERIAL_CONSOLE=y +# CONFIG_UART1_SERIAL_CONSOLE is not set +# CONFIG_NO_SERIAL_CONSOLE is not set + # -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 +# UART0 Configuration +# +CONFIG_UART0_RXBUFSIZE=0 +CONFIG_UART0_TXBUFSIZE=0 +CONFIG_UART0_BAUD=57600 +CONFIG_UART0_BITS=8 +CONFIG_UART0_PARITY=0 +CONFIG_UART0_2STOP=0 # -# Settings for examples/ostest +# UART1 Configuration +# +CONFIG_UART1_RXBUFSIZE=0 +CONFIG_UART1_TXBUFSIZE=0 +CONFIG_UART1_BAUD=57600 +CONFIG_UART1_BITS=8 +CONFIG_UART1_PARITY=0 +CONFIG_UART1_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set + +# +# System Logging Device Options +# + +# +# System Logging +# +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_NET is not set + +# +# File Systems +# + +# +# File system configuration +# +# CONFIG_FS_RAMMAP is not set + +# +# System Logging +# +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0x00000000 +CONFIG_HEAP2_SIZE=0 +# CONFIG_GRAN is not set + +# +# Binary Formats +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# +CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=0 +# CONFIG_LIBM is not set +CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Named Applications +# +# CONFIG_NAMEDAPP is not set + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_NETTEST is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +CONFIG_EXAMPLES_OSTEST=y +# CONFIG_EXAMPLES_OSTEST_BUILTIN is not set CONFIG_EXAMPLES_OSTEST_LOOPS=1 CONFIG_EXAMPLES_OSTEST_STACKSIZE=256 +CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=8 +CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000 +CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 +# CONFIG_EXAMPLES_PASHELLO is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WLAN is not set # -# Settings for apps/nshlib -CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_CMD_SIZE=40 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 +# Interpreters +# # -# Stack and heap information +# Interpreters +# +# CONFIG_FICL is not set +# CONFIG_PCODE is not set + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# ModBus +# + +# +# FreeModbus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=256 -CONFIG_USERMAIN_STACKSIZE=256 -CONFIG_PTHREAD_STACK_MIN=128 -CONFIG_PTHREAD_STACK_DEFAULT=256 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# System NSH Add-Ons # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set diff --git a/nuttx/configs/z8f64200100kit/ostest/appconfig b/nuttx/configs/z8f64200100kit/ostest/appconfig deleted file mode 100644 index e6f0c2375..000000000 --- a/nuttx/configs/z8f64200100kit/ostest/appconfig +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################ -# configs/z8f64200100kit/ostest/appconfig -# -# Copyright (C) 2011 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. -# -############################################################################ - -# Path to example in apps/examples containing the user_start entry point - -CONFIGURED_APPS += examples/ostest - diff --git a/nuttx/configs/z8f64200100kit/ostest/defconfig b/nuttx/configs/z8f64200100kit/ostest/defconfig index bed04a40e..2389a0d34 100644 --- a/nuttx/configs/z8f64200100kit/ostest/defconfig +++ b/nuttx/configs/z8f64200100kit/ostest/defconfig @@ -1,119 +1,161 @@ -############################################################################ -# configs/z8f64200100kit/ostest/defconfig -# -# Copyright (C) 2008, 2010, 2012 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. -# -############################################################################ -# -# Architecture selection # +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_LINUX is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +# CONFIG_WINDOWS_NATIVE is not set +CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="../apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +CONFIG_DEBUG=y +# CONFIG_DEBUG_VERBOSE is not set +# CONFIG_DEBUG_ENABLE is not set + +# +# Subsystem Debug Options +# +# CONFIG_DEBUG_MM is not set +# CONFIG_DEBUG_SCHED is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_DEBUG_LIB is not set +# CONFIG_DEBUG_BINFMT is not set +# CONFIG_DEBUG_GRAPHICS is not set + +# +# Driver Debug Options +# +# CONFIG_DEBUG_ANALOG is not set +# CONFIG_DEBUG_DMA is not set +# CONFIG_DEBUG_SYMBOLS is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set +CONFIG_ARCH_Z80=y CONFIG_ARCH="z80" -CONFIG_ARCH_Z8=y CONFIG_ARCH_CHIP="z8" -CONFIG_ARCH_CHIP_Z8=y -CONFIG_ARCH_CHIP_Z8F640X=n -CONFIG_ARCH_CHIP_Z8F6403=n -CONFIG_ARCH_CHIP_Z8F642X=y -CONFIG_ARCH_CHIP_Z8F6423=y -CONFIG_ARCH_BOARD="z8f64200100kit" -CONFIG_ARCH_BOARD_Z8F64200100KIT=y CONFIG_BOARD_LOOPSPERMSEC=1250 +# CONFIG_ARCH_CHIP_Z80 is not set +# CONFIG_ARCH_CHIP_Z8F6403 is not set +CONFIG_ARCH_CHIP_Z8F6423=y +# CONFIG_ARCH_CHIP_EZ80F91 is not set +# CONFIG_ARCH_CHIP_EZ80F92 is not set +# CONFIG_ARCH_CHIP_EZ80F93 is not set +CONFIG_ARCH_CHIP_Z8F642X=y +CONFIG_ARCH_CHIP_Z8=y +CONFIG_HAVE_LOWUARTINIT=y +CONFIG_Z8_UART0=y +CONFIG_Z8_UART1=y + +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_STACKDUMP is not set CONFIG_ENDIAN_BIG=y + +# +# Board Settings +# +CONFIG_DRAM_START= CONFIG_DRAM_SIZE=65536 -CONFIG_ARCH_LEDS=n + # -# ez8 specific device driver settings +# Boot options # -CONFIG_UART0_SERIAL_CONSOLE=y -CONFIG_UART1_SERIAL_CONSOLE=n -CONFIG_UART0_TXBUFSIZE=0 -CONFIG_UART1_TXBUFSIZE=0 -CONFIG_UART0_RXBUFSIZE=0 -CONFIG_UART1_RXBUFSIZE=0 -CONFIG_UART0_BAUD=57600 -CONFIG_UART1_BAUD=57600 -CONFIG_UART0_PARITY=0 -CONFIG_UART1_PARITY=0 -CONFIG_UART0_2STOP=0 -CONFIG_UART1_2STOP=0 +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set # -# General build options +# Board Selection # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n +CONFIG_ARCH_BOARD_Z8F64200100KIT=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="z8f64200100kit" # -# General OS setup +# Common Board Options # -CONFIG_USER_ENTRYPOINT="ostest_main" -CONFIG_DEBUG=y -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y +CONFIG_ARCH_HAVE_LEDS=y +# CONFIG_ARCH_LEDS is not set + +# +# Board-Specific Options +# + +# +# RTOS Features +# +CONFIG_MSEC_PER_TICK=10 CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=n +# CONFIG_SCHED_INSTRUMENTATION is not set CONFIG_TASK_NAME_SIZE=0 +# CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2008 CONFIG_START_MONTH=2 CONFIG_START_DAY=17 -CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=y -CONFIG_DEV_CONSOLE=n -CONFIG_DEV_LOWCONSOLE=n -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n +# CONFIG_DEV_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set CONFIG_SDCLONE_DISABLE=y - -# -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. -# -# There are certain dependency relationships in these -# features. -# -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. -# +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="ostest_main" +CONFIG_DISABLE_OS_API=y CONFIG_DISABLE_CLOCK=y CONFIG_DISABLE_POSIX_TIMERS=y CONFIG_DISABLE_PTHREAD=y @@ -123,28 +165,6 @@ CONFIG_DISABLE_MOUNTPOINT=y CONFIG_DISABLE_ENVIRON=y CONFIG_DISABLE_POLL=y -# -# Misc libc settings -# -CONFIG_NOPRINTF_FIELDWIDTH=y - -# -# Allow for architecture optimized implementations -# -# The architecture can provide optimized versions of the -# following to improve sysem performance -# -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n - # # Sizes of configurable things (0 disables) # @@ -154,8 +174,6 @@ CONFIG_NPTHREAD_KEYS=0 CONFIG_NFILE_DESCRIPTORS=0 CONFIG_NFILE_STREAMS=0 CONFIG_NAME_MAX=32 -CONFIG_STDIO_BUFFER_SIZE=0 -CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_MQ_MSGS=0 CONFIG_MQ_MAXMSGSIZE=0 CONFIG_MAX_WDOGPARMS=2 @@ -163,67 +181,303 @@ CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 # -# TCP/IP and UDP support via uIP +# Stack and heap information +# +# CONFIG_CUSTOM_STACK is not set +CONFIG_IDLETHREAD_STACKSIZE=256 +CONFIG_USERMAIN_STACKSIZE=256 +CONFIG_PTHREAD_STACK_MIN=128 +CONFIG_PTHREAD_STACK_DEFAULT=256 + # -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n +# Device Drivers +# +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART0=y +CONFIG_ARCH_HAVE_UART1=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +CONFIG_UART0_SERIAL_CONSOLE=y +# CONFIG_UART1_SERIAL_CONSOLE is not set +# CONFIG_NO_SERIAL_CONSOLE is not set # -# UIP Network Utilities +# UART0 Configuration # -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 +CONFIG_UART0_RXBUFSIZE=0 +CONFIG_UART0_TXBUFSIZE=0 +CONFIG_UART0_BAUD=57600 +CONFIG_UART0_BITS=8 +CONFIG_UART0_PARITY=0 +CONFIG_UART0_2STOP=0 # -# Settings for examples/ostest +# UART1 Configuration +# +CONFIG_UART1_RXBUFSIZE=0 +CONFIG_UART1_TXBUFSIZE=0 +CONFIG_UART1_BAUD=57600 +CONFIG_UART1_BITS=8 +CONFIG_UART1_PARITY=0 +CONFIG_UART1_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set + +# +# System Logging Device Options +# + +# +# System Logging +# +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_NET is not set + +# +# File Systems +# + +# +# File system configuration +# +# CONFIG_FS_RAMMAP is not set + +# +# System Logging +# +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0x00000000 +CONFIG_HEAP2_SIZE=0 +# CONFIG_GRAN is not set + +# +# Binary Formats +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# +CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=0 +# CONFIG_LIBM is not set +CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Named Applications +# +# CONFIG_NAMEDAPP is not set + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_NETTEST is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +CONFIG_EXAMPLES_OSTEST=y +# CONFIG_EXAMPLES_OSTEST_BUILTIN is not set CONFIG_EXAMPLES_OSTEST_LOOPS=1 CONFIG_EXAMPLES_OSTEST_STACKSIZE=256 +CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=8 +CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000 +CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 +# CONFIG_EXAMPLES_PASHELLO is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WLAN is not set # -# Settings for apps/nshlib -CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_CMD_SIZE=40 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 +# Interpreters +# # -# Stack and heap information +# Interpreters +# +# CONFIG_FICL is not set +# CONFIG_PCODE is not set + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# ModBus +# + +# +# FreeModbus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=256 -CONFIG_USERMAIN_STACKSIZE=256 -CONFIG_PTHREAD_STACK_MIN=128 -CONFIG_PTHREAD_STACK_DEFAULT=256 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# System NSH Add-Ons # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set -- cgit v1.2.3 From 724d3c4c0dd93354fb02cc64972448e4ea7e00a0 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 29 Nov 2012 13:58:53 +0000 Subject: Patches for NSH disable background, and ARMv7M assembly from Freddie Chopin git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5398 42af7a65-404d-4744-a932-0658087f49c3 --- apps/nshlib/nsh_apps.c | 41 ++++++++++++++++++++++--- nuttx/arch/arm/src/armv7-m/up_exception.S | 4 +-- nuttx/configs/z8encore000zco/scripts/setenv.bat | 2 +- nuttx/configs/z8f64200100kit/scripts/setenv.bat | 2 +- 4 files changed, 41 insertions(+), 8 deletions(-) (limited to 'nuttx') diff --git a/apps/nshlib/nsh_apps.c b/apps/nshlib/nsh_apps.c index e335c2e2c..7dbaf9ba8 100644 --- a/apps/nshlib/nsh_apps.c +++ b/apps/nshlib/nsh_apps.c @@ -122,13 +122,28 @@ int nsh_execapp(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, ret = exec_namedapp(cmd, (FAR const char **)argv); if (ret >= 0) { - /* The application was successfully started (but still blocked because the - * scheduler is locked). If the application was not backgrounded, then we - * need to wait here for the application to exit. + /* The application was successfully started (but still blocked because + * the scheduler is locked). If the application was not backgrounded, + * then we need to wait here for the application to exit. These really + * only works works with the following options: + * + * - CONFIG_NSH_DISABLEBG - Do not run commands in background + * - CONFIG_SCHED_WAITPID - Required to run external commands in + * foreground + * + * These concepts do not apply cleanly to the external applications. */ #ifdef CONFIG_SCHED_WAITPID + + /* CONFIG_SCHED_WAITPID is selected, so we may run the command in + * foreground unless we were specifically requested to run the command + * in background (and running commands in background is enabled). + */ + +# ifndef CONFIG_NSH_DISABLEBG if (vtbl->np.np_bg == false) +# endif /* CONFIG_NSH_DISABLEBG */ { int rc = 0; @@ -155,8 +170,25 @@ int nsh_execapp(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, */ } } +# ifndef CONFIG_NSH_DISABLEBG else -#endif +# endif /* CONFIG_NSH_DISABLEBG */ +#endif /* CONFIG_SCHED_WAITPID */ + + /* We get here if either: + * + * - CONFIG_SCHED_WAITPID is not selected meaning that all commands + * have to be run in background, or + * - CONFIG_SCHED_WAITPID and CONFIG_NSH_DISABLEBG are both selected, but the + * user requested to run the command in background. + * + * NOTE that the case of a) CONFIG_SCHED_WAITPID is not selected and + * b) CONFIG_NSH_DISABLEBG selected cannot be supported. In that event, all + * commands will have to run in background. The waitpid() API must be + * available to support running the command in foreground. + */ + +#if !defined(CONFIG_SCHED_WAITPID) || !defined(CONFIG_NSH_DISABLEBG) { struct sched_param param; sched_getparam(0, ¶m); @@ -168,6 +200,7 @@ int nsh_execapp(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, ret = OK; } +#endif /* !CONFIG_SCHED_WAITPID || !CONFIG_NSH_DISABLEBG */ } sched_unlock(); diff --git a/nuttx/arch/arm/src/armv7-m/up_exception.S b/nuttx/arch/arm/src/armv7-m/up_exception.S index 31d8dbb0c..c9f216027 100644 --- a/nuttx/arch/arm/src/armv7-m/up_exception.S +++ b/nuttx/arch/arm/src/armv7-m/up_exception.S @@ -134,9 +134,9 @@ exception_common: #if CONFIG_ARCH_INTERRUPTSTACK > 3 ldr sp, =g_intstackbase - push r1 /* Save the MSP on the interrupt stack */ + push {r1} /* Save the MSP on the interrupt stack */ bl up_doirq /* R0=IRQ, R1=register save area on stack */ - pop r1 /* Recover R1=main stack pointer */ + pop {r1} /* Recover R1=main stack pointer */ #else msr msp, r1 /* We are using the main stack pointer */ bl up_doirq /* R0=IRQ, R1=register save area on stack */ diff --git a/nuttx/configs/z8encore000zco/scripts/setenv.bat b/nuttx/configs/z8encore000zco/scripts/setenv.bat index f208a6e8b..407cca97f 100644 --- a/nuttx/configs/z8encore000zco/scripts/setenv.bat +++ b/nuttx/configs/z8encore000zco/scripts/setenv.bat @@ -41,7 +41,7 @@ set PATH=C:\MinGW\bin;%PATH% rem This is the location where I installed the ZDS-II toolchain. -set PATH=C:\Program Files (x86)\ZiLOG\ZZDSII_Z8Encore!_5.0.0\bin;%PATH% +set PATH=C:\Program Files (x86)\ZiLOG\ZDSII_Z8Encore!_5.0.0\bin;%PATH% rem This is the location where I installed the GNUWin32 tools. See rem http://gnuwin32.sourceforge.net/. diff --git a/nuttx/configs/z8f64200100kit/scripts/setenv.bat b/nuttx/configs/z8f64200100kit/scripts/setenv.bat index 4281d5b11..e0526d988 100644 --- a/nuttx/configs/z8f64200100kit/scripts/setenv.bat +++ b/nuttx/configs/z8f64200100kit/scripts/setenv.bat @@ -41,7 +41,7 @@ set PATH=C:\MinGW\bin;%PATH% rem This is the location where I installed the ZDS-II toolchain. -set PATH=C:\Program Files (x86)\ZiLOG\ZZDSII_Z8Encore!_5.0.0\bin;%PATH% +set PATH=C:\Program Files (x86)\ZiLOG\ZDSII_Z8Encore!_5.0.0\bin;%PATH% rem This is the location where I installed the GNUWin32 tools. See rem http://gnuwin32.sourceforge.net/. -- cgit v1.2.3 From cdada458a18eaf892b3791e4ace1c42535350495 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 29 Nov 2012 15:24:27 +0000 Subject: z8 configurations will now build in Windows native environment git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5399 42af7a65-404d-4744-a932-0658087f49c3 --- apps/ChangeLog.txt | 2 + nuttx/ChangeLog | 4 ++ nuttx/configs/z16f2800100zcog/scripts/setenv.bat | 50 ++++++++++++++++++++ nuttx/configs/z8encore000zco/ostest/Make.defs | 59 ++++++++++++------------ nuttx/configs/z8encore000zco/src/Makefile | 2 +- nuttx/configs/z8f64200100kit/ostest/Make.defs | 59 ++++++++++++------------ nuttx/configs/z8f64200100kit/src/Makefile | 2 +- 7 files changed, 116 insertions(+), 62 deletions(-) create mode 100644 nuttx/configs/z16f2800100zcog/scripts/setenv.bat (limited to 'nuttx') diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index 0b4f58e77..29a54461a 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -424,3 +424,5 @@ * apps/examples/relays/Makefile: Reduced stack requirement (Darcy Gong). * apps/nshlib and apps/netutils/dhcpc: Extend the NSH ifconfig command plus various DHCPC improvements(Darcy Gong). + * apps/nshlib/nsh_apps.c: Fix compilation errors whenCONFIG_NSH_DISABLEBG=y. + From Freddie Chopin. diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 97b5b74a0..e0ca6c8dc 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3708,3 +3708,7 @@ Denis Cariki. * z8encore000zco/ostest and z8f64200100kit/ostest: Converted to use Kconfig/ mconf configuration tool. + * arch/arm/src/armv7-m/up_exception.S: missing curly braces for push/pop + From Freddie Chopin. + * z8encore000zco/ostest and z8f64200100kit/ostest: Can now be modified to + support the Windows native builds (see corresponding README.txt files). diff --git a/nuttx/configs/z16f2800100zcog/scripts/setenv.bat b/nuttx/configs/z16f2800100zcog/scripts/setenv.bat new file mode 100644 index 000000000..4ee67c97e --- /dev/null +++ b/nuttx/configs/z16f2800100zcog/scripts/setenv.bat @@ -0,0 +1,50 @@ +@echo off + +rem configs/z16f2800100zcog/scripts/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the ZDS-II toolchain. + +set PATH=C:\Program Files (x86)\ZiLOG\ZDSII_ZNEO_5.0.1\bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% +echo %PATH% diff --git a/nuttx/configs/z8encore000zco/ostest/Make.defs b/nuttx/configs/z8encore000zco/ostest/Make.defs index bbb9a9ddc..9ce005260 100644 --- a/nuttx/configs/z8encore000zco/ostest/Make.defs +++ b/nuttx/configs/z8encore000zco/ostest/Make.defs @@ -45,66 +45,66 @@ include $(TOPDIR)/tools/Config.mk # # Your PC may be configured differently. -ZDSVERSION := 5.0.0 +ZDSVERSION = 5.0.0 ifeq ($(CONFIG_WINDOWS_NATIVE),y) - ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) + ZDSINSTALLDIR = C:/PROGRA~2/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} - ZDSBINDIR := $(INSTALLDIR)\bin - ZDSSTDINCDIR := $(INSTALLDIR)\include\std - ZDSZILOGINCDIR := $(INSTALLDIR)\include\zilog + ZDSBINDIR = $(INSTALLDIR)\bin + ZDSSTDINCDIR = $(INSTALLDIR)\include\std + ZDSZILOGINCDIR = $(INSTALLDIR)\include\zilog ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y) - ZDSDEVINCDIR := $(INSTALLDIR)\Z8Encore_F642X + ZDSDEVINCDIR = $(INSTALLDIR)\Z8Encore_F642X endif ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) - ZDSDEVINCDIR := $(INSTALLDIR)\Z8Encore_F640X + ZDSDEVINCDIR = $(INSTALLDIR)\Z8Encore_F640X endif - ZDSSTDLIBDIR := $(INSTALLDIR)\lib\std - ZDSZILOGLIBDIR := $(INSTALLDIR)\lib\zilog + ZDSSTDLIBDIR = $(INSTALLDIR)\lib\std + ZDSZILOGLIBDIR = $(INSTALLDIR)\lib\zilog # CFLAGs ARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) EARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) - ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR);$(ZDSDEVINCDIR) ARCHUSRINCLUDES = -usrinc:. else - WINTOOL := y - ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) + WINTOOL = y + ZDSINSTALLDIR = C:/PROGRA~2/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} - ZDSBINDIR := $(INSTALLDIR)/bin - ZDSSTDINCDIR := $(INSTALLDIR)/include/std - ZDSZILOGINCDIR := $(INSTALLDIR)/include/zilog + ZDSBINDIR = $(INSTALLDIR)/bin + ZDSSTDINCDIR = $(INSTALLDIR)/include/std + ZDSZILOGINCDIR = $(INSTALLDIR)/include/zilog ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y) - ZDSDEVINCDIR := $(ZDSZILOGINCDIR)/Z8Encore_F642X + ZDSDEVINCDIR = $(ZDSZILOGINCDIR)/Z8Encore_F642X endif ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) - ZDSDEVINCDIR := $(ZDSZILOGINCDIR)/Z8Encore_F640X + ZDSDEVINCDIR = $(ZDSZILOGINCDIR)/Z8Encore_F640X endif - ZDSSTDLIBDIR := $(INSTALLDIR)/lib/std - ZDSZILOGLIBDIR := $(INSTALLDIR)/lib/zilog + ZDSSTDLIBDIR = $(INSTALLDIR)/lib/std + ZDSZILOGLIBDIR = $(INSTALLDIR)/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)"} - WZDSDEVINCDIR := ${shell cygpath -w "$(ZDSDEVINCDIR)"} - WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} - WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} + WTOPDIR = ${shell cygpath -w "$(TOPDIR)"} + WZDSSTDINCDIR = ${shell cygpath -w "$(ZDSSTDINCDIR)"} + WZDSZILOGINCDIR = ${shell cygpath -w "$(ZDSZILOGINCDIR)"} + WZDSDEVINCDIR = ${shell cygpath -w "$(ZDSDEVINCDIR)"} + WZDSSTDLIBDIR = ${shell cygpath -w "$(ZDSSTDLIBDIR)"} + WZDSZILOGLIBDIR = ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} # Escaped versions - ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} - EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} - EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} + ETOPDIR = ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} + EZDSSTDINCDIR = ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} + EZDSZILOGINCDIR = ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} # CFLAGs ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' - ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR);$(WZDSDEVINCDIR)' ARCHUSRINCLUDES = -usrinc:'.' endif @@ -156,7 +156,6 @@ ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm ARCHPICFLAGS = ARCHWARNINGS = -warn ARCHDEFINES = -define:$(ARCHFAMILYDEF) -define:$(ARCHCPUDEF) -define:$(ARCHSERIESDEF) -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR);$(WZDSDEVINCDIR)' ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) diff --git a/nuttx/configs/z8encore000zco/src/Makefile b/nuttx/configs/z8encore000zco/src/Makefile index 21117dd53..30a4a6285 100644 --- a/nuttx/configs/z8encore000zco/src/Makefile +++ b/nuttx/configs/z8encore000zco/src/Makefile @@ -39,7 +39,7 @@ SCHEDSRCDIR = $(TOPDIR)$(DELIM)sched ARCHSRCDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src ifeq ($(CONFIG_WINDOWS_NATIVE),y) - USRINCLUDES = -usrinc:'.;$(SCHEDSRCDIR);$(ARCHSRCDIR);$(ARCHSRCDIR)\common' + USRINCLUDES = -usrinc:".;$(SCHEDSRCDIR);$(ARCHSRCDIR);$(ARCHSRCDIR)\common" else WSCHEDSRCDIR = ${shell cygpath -w $(SCHEDSRCDIR)} WARCHSRCDIR = ${shell cygpath -w $(ARCHSRCDIR)} diff --git a/nuttx/configs/z8f64200100kit/ostest/Make.defs b/nuttx/configs/z8f64200100kit/ostest/Make.defs index 8b58a7346..85cb5c401 100644 --- a/nuttx/configs/z8f64200100kit/ostest/Make.defs +++ b/nuttx/configs/z8f64200100kit/ostest/Make.defs @@ -45,66 +45,66 @@ include $(TOPDIR)/tools/Config.mk # # Your PC may be configured differently. -ZDSVERSION := 5.0.0 +ZDSVERSION = 5.0.0 ifeq ($(CONFIG_WINDOWS_NATIVE),y) - ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) + ZDSINSTALLDIR = C:/PROGRA~2/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} - ZDSBINDIR := $(INSTALLDIR)\bin - ZDSSTDINCDIR := $(INSTALLDIR)\include\std - ZDSZILOGINCDIR := $(INSTALLDIR)\include\zilog + ZDSBINDIR = $(INSTALLDIR)\bin + ZDSSTDINCDIR = $(INSTALLDIR)\include\std + ZDSZILOGINCDIR = $(INSTALLDIR)\include\zilog ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y) - ZDSDEVINCDIR := $(INSTALLDIR)\Z8Encore_F642X + ZDSDEVINCDIR = $(INSTALLDIR)\Z8Encore_F642X endif ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) - ZDSDEVINCDIR := $(INSTALLDIR)\Z8Encore_F640X + ZDSDEVINCDIR = $(INSTALLDIR)\Z8Encore_F640X endif - ZDSSTDLIBDIR := $(INSTALLDIR)\lib\std - ZDSZILOGLIBDIR := $(INSTALLDIR)\lib\zilog + ZDSSTDLIBDIR = $(INSTALLDIR)\lib\std + ZDSZILOGLIBDIR = $(INSTALLDIR)\lib\zilog # CFLAGs ARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) EARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) - ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR);$(ZDSDEVINCDIR) ARCHUSRINCLUDES = -usrinc:. else - WINTOOL := y - ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) + WINTOOL = y + ZDSINSTALLDIR = C:/PROGRA~2/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} - ZDSBINDIR := $(INSTALLDIR)/bin - ZDSSTDINCDIR := $(INSTALLDIR)/include/std - ZDSZILOGINCDIR := $(INSTALLDIR)/include/zilog + ZDSBINDIR = $(INSTALLDIR)/bin + ZDSSTDINCDIR = $(INSTALLDIR)/include/std + ZDSZILOGINCDIR = $(INSTALLDIR)/include/zilog ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y) - ZDSDEVINCDIR := $(ZDSZILOGINCDIR)/Z8Encore_F642X + ZDSDEVINCDIR = $(ZDSZILOGINCDIR)/Z8Encore_F642X endif ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) - ZDSDEVINCDIR := $(ZDSZILOGINCDIR)/Z8Encore_F640X + ZDSDEVINCDIR = $(ZDSZILOGINCDIR)/Z8Encore_F640X endif - ZDSSTDLIBDIR := $(INSTALLDIR)/lib/std - ZDSZILOGLIBDIR := $(INSTALLDIR)/lib/zilog + ZDSSTDLIBDIR = $(INSTALLDIR)/lib/std + ZDSZILOGLIBDIR = $(INSTALLDIR)/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)"} - WZDSDEVINCDIR := ${shell cygpath -w "$(ZDSDEVINCDIR)"} - WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} - WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} + WTOPDIR = ${shell cygpath -w "$(TOPDIR)"} + WZDSSTDINCDIR = ${shell cygpath -w "$(ZDSSTDINCDIR)"} + WZDSZILOGINCDIR = ${shell cygpath -w "$(ZDSZILOGINCDIR)"} + WZDSDEVINCDIR = ${shell cygpath -w "$(ZDSDEVINCDIR)"} + WZDSSTDLIBDIR = ${shell cygpath -w "$(ZDSSTDLIBDIR)"} + WZDSZILOGLIBDIR = ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} # Escaped versions - ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} - EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} - EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} + ETOPDIR = ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} + EZDSSTDINCDIR = ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} + EZDSZILOGINCDIR = ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} # CFLAGs ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' - ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR);$(WZDSDEVINCDIR)' ARCHUSRINCLUDES = -usrinc:'.' endif @@ -156,7 +156,6 @@ ARCHLIST = -keeplst -NOlist -NOlistinc -keepasm ARCHPICFLAGS = ARCHWARNINGS = -warn ARCHDEFINES = -define:$(ARCHFAMILYDEF) -define:$(ARCHCPUDEF) -define:$(ARCHSERIESDEF) -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR);$(WZDSDEVINCDIR)' ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) diff --git a/nuttx/configs/z8f64200100kit/src/Makefile b/nuttx/configs/z8f64200100kit/src/Makefile index c9b7a6dc2..21087e6b8 100644 --- a/nuttx/configs/z8f64200100kit/src/Makefile +++ b/nuttx/configs/z8f64200100kit/src/Makefile @@ -39,7 +39,7 @@ SCHEDSRCDIR = $(TOPDIR)$(DELIM)sched ARCHSRCDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src ifeq ($(CONFIG_WINDOWS_NATIVE),y) - USRINCLUDES = -usrinc:'.;$(SCHEDSRCDIR);$(ARCHSRCDIR);$(ARCHSRCDIR)\common' + USRINCLUDES = -usrinc:".;$(SCHEDSRCDIR);$(ARCHSRCDIR);$(ARCHSRCDIR)\common" else WSCHEDSRCDIR = ${shell cygpath -w $(SCHEDSRCDIR)} WARCHSRCDIR = ${shell cygpath -w $(ARCHSRCDIR)} -- cgit v1.2.3 From 83b590b946b88b07b42eb8214ec9a5bed2ed2928 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 29 Nov 2012 16:48:29 +0000 Subject: ZNEO configurations updated to use ZDS-II version 5.0.1 git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5400 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z16/include/z16f/irq.h | 8 +- nuttx/arch/z16/src/Makefile | 30 +++- nuttx/arch/z16/src/common/up_doirq.c | 4 +- nuttx/arch/z16/src/common/up_internal.h | 2 +- nuttx/configs/z16f2800100zcog/README.txt | 32 +++-- nuttx/configs/z16f2800100zcog/ostest/Make.defs | 171 ++++++++++++++-------- nuttx/configs/z16f2800100zcog/ostest/setenv.sh | 34 +++-- nuttx/configs/z16f2800100zcog/pashello/Make.defs | 173 +++++++++++++++-------- nuttx/configs/z16f2800100zcog/pashello/setenv.sh | 36 +++-- nuttx/configs/z8encore000zco/README.txt | 2 +- nuttx/configs/z8f64200100kit/README.txt | 2 +- nuttx/drivers/mmcsd/mmcsd_sdio.c | 3 +- 12 files changed, 339 insertions(+), 158 deletions(-) (limited to 'nuttx') diff --git a/nuttx/arch/z16/include/z16f/irq.h b/nuttx/arch/z16/include/z16f/irq.h index 83b251e81..e470ddfcb 100644 --- a/nuttx/arch/z16/include/z16f/irq.h +++ b/nuttx/arch/z16/include/z16f/irq.h @@ -2,7 +2,7 @@ * arch/z16f/irq.h * arch/chip/irq.h * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -188,8 +188,8 @@ struct xcptcontext /* The following retains that state during signal execution */ - uint32_t saved_pc; /* Saved return address */ - uint16_t saved_i; /* Saved interrupt state */ + uint32_t saved_pc; /* Saved return address */ + uint16_t saved_i; /* Saved interrupt state */ #endif }; #endif @@ -231,7 +231,7 @@ extern "C" { EXTERN intrinsic void EI(void); EXTERN intrinsic void DI(void); EXTERN intrinsic void RI(unsigned short); -EXTERN intrinsic SET_VECTOR(int,void (* func) (void)); +EXTERN intrinsic void SET_VECTOR(int,void (* func) (void)); EXTERN intrinsic unsigned short TDI(void); #ifndef __ZILOG__ diff --git a/nuttx/arch/z16/src/Makefile b/nuttx/arch/z16/src/Makefile index b34d91c68..f209dcaed 100644 --- a/nuttx/arch/z16/src/Makefile +++ b/nuttx/arch/z16/src/Makefile @@ -38,18 +38,29 @@ COMPILER = ${shell basename "$(CC)"} ARCHSRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + USRINCLUDES = -usrinc:'.;$(TOPDIR)/sched;$(ARCHSRCDIR);$(ARCHSRCDIR)/common' +else ifeq ($(COMPILER),zneocc.exe) -WARCHSRCDIR := ${shell cygpath -w $(ARCHSRCDIR)} -USRINCLUDES = -usrinc:'.;$(WTOPDIR)\sched;$(WARCHSRCDIR);$(WARCHSRCDIR)\common' + WARCHSRCDIR := ${shell cygpath -w $(ARCHSRCDIR)} + USRINCLUDES = -usrinc:'.;$(WTOPDIR)\sched;$(WARCHSRCDIR);$(WARCHSRCDIR)\common' else -WARCHSRCDIR = $(ARCHSRCDIR) -USRINCLUDES = -I$(TOPDIR)/sched -I$(ARCHSRCDIR) -I$(ARCHSRCDIR)/common + WARCHSRCDIR = $(ARCHSRCDIR) + USRINCLUDES = -I$(TOPDIR)/sched -I$(ARCHSRCDIR) -I$(ARCHSRCDIR)/common +endif endif + INCLUDES = $(ARCHSTDINCLUDES) $(USRINCLUDES) CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS += -I$(ARCHSRCDIR) + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + LDFLAGS += @"$(ARCHSRCDIR)/nuttx.linkcmd" +else ifeq ($(COMPILER),zneocc.exe) -LDFLAGS += "${shell cygpath -w $(ARCHSRCDIR)/nuttx.linkcmd}" + LDFLAGS += @"${shell cygpath -w $(ARCHSRCDIR)/nuttx.linkcmd}" +endif endif HEAD_ASRC = $(HEAD_SSRC:.S=$(ASMEXT)) @@ -96,6 +107,14 @@ board/libboard$(LIBEXT): ifeq ($(COMPILER),zneocc.exe) nuttx.linkcmd: $(LINKCMDTEMPLATE) $(Q) cp -f $(LINKCMDTEMPLATE) nuttx.linkcmd +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + @echo "$(TOPDIR)\nuttx}"= \>>nuttx.linkcmd + @echo "$(ARCHSRCDIR)\$(HEAD_OBJ)", \>>nuttx.linkcmd + $(Q) for %%G in ($(LINKLIBS)) do ( echo "$(TOPDIR)\lib\%%G", \>>nuttx.linkcmd ) + @echo "$(ARCHSRCDIR)\board\libboard$(LIBEXT)", \>>nuttx.linkcmd + @echo "$(ZDSSTDLIBDIR)\chelpld$(LIBEXT)", \>>nuttx.linkcmd + @echo "$(ZDSSTDLIBDIR)\fpld$(LIBEXT)">>nuttx.linkcmd +else @echo "\"${shell cygpath -w $(TOPDIR)/nuttx}\"= \\" >>nuttx.linkcmd @echo " \"${shell cygpath -w $(ARCHSRCDIR)/$(HEAD_OBJ)}\", \\" >>nuttx.linkcmd $(Q) ( for lib in $(LINKLIBS); do \ @@ -104,6 +123,7 @@ nuttx.linkcmd: $(LINKCMDTEMPLATE) @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 +endif else nuttx.linkcmd: endif diff --git a/nuttx/arch/z16/src/common/up_doirq.c b/nuttx/arch/z16/src/common/up_doirq.c index e8f40fb56..670e6985d 100644 --- a/nuttx/arch/z16/src/common/up_doirq.c +++ b/nuttx/arch/z16/src/common/up_doirq.c @@ -95,7 +95,7 @@ FAR chipreg_t *up_doirq(int irq, FAR chipreg_t *regs) * interrupt level context switches. */ - savestate = (uint32_t*)current_regs; + savestate = (FAR chipreg_t *)current_regs; current_regs = regs; /* Mask and acknowledge the interrupt */ @@ -120,7 +120,9 @@ FAR chipreg_t *up_doirq(int irq, FAR chipreg_t *regs) up_enable_irq(irq); } + up_ledoff(LED_INIRQ); #endif + return ret; } diff --git a/nuttx/arch/z16/src/common/up_internal.h b/nuttx/arch/z16/src/common/up_internal.h index 4d07392d9..2c1968e8d 100644 --- a/nuttx/arch/z16/src/common/up_internal.h +++ b/nuttx/arch/z16/src/common/up_internal.h @@ -105,7 +105,7 @@ typedef void (*up_vector_t)(void); * interrupt processing. */ -extern voltile FAR chipreg_t *current_regs; +extern volatile FAR chipreg_t *current_regs; #endif /**************************************************************************** diff --git a/nuttx/configs/z16f2800100zcog/README.txt b/nuttx/configs/z16f2800100zcog/README.txt index 64f90b9b9..55ed22b10 100644 --- a/nuttx/configs/z16f2800100zcog/README.txt +++ b/nuttx/configs/z16f2800100zcog/README.txt @@ -6,12 +6,14 @@ This is the README file for the NuttX port to the ZiLog ZNEO MCU. ZDS-II Compiler Versions ^^^^^^^^^^^^^^^^^^^^^^^^ -4.10.2 +Version 4.10.2 + The ZDS-II version 4.10.2 will not compile NuttX. It reports "internal errors" on some of the files. Upgrades to ZDS-II are available for download from the Zilog website: http://www.zilog.com/software/zds2.asp -4.11.0 +Version 4.11.0 + NuttX compiles correctly with the newer 4.11.0 version of the ZDS-II toolchain. However, I have found a few issues: @@ -25,17 +27,31 @@ ZDS-II Compiler Versions - The Pascal add-on interpreter includes a large switch statement and exposes another compiler problem. This is reported as incident 81459. -4.11.1 +Version 4.11.1 + As of this writing (30 September 2010), the latest release of ZDS-II for the ZNEO is 4.11.1. It is unknown if this release includes fixes for incidents 81400 and 81459 or not. It is unknown if the code will run without -reduceopt either. (Basically, it compiles with 4.11.1, but is untested with that version). -If you use any version of ZDS-II other than 4.11.1 or if you install ZDS-II -at any location other than the default location, you will have to modify -two files: (1) configs/z16f2800100zcog/*/setenv.sh and (2) -configs/z16f2800100zcog/*/Make.defs. Simply edit these two files, changing -4.11.1 to whatever. +Version 5.0.1 + + On November 29, 2012, all of the z16f configurations were converted to use 5.0.1, + but have not been verified on a running target. + + Paths were also updated that are specific to a 32-bit toolchain running on + a 64 bit windows platform. Change to a different toolchain, you will need + to modify the versioning in Make.defs and setenv.sh; if you want to build + on a different platform, you will need to change the path in the ZDS binaries + in those same files. + +Other Versions + + If you use any version of ZDS-II other than 5.0.1 or if you install ZDS-II + at any location other than the default location, you will have to modify + two files: (1) configs/z16f2800100zcog/*/setenv.sh and (2) + configs/z16f2800100zcog/*/Make.defs. Simply edit these two files, changing + 5.0.1 to whatever. Issues ^^^^^^ diff --git a/nuttx/configs/z16f2800100zcog/ostest/Make.defs b/nuttx/configs/z16f2800100zcog/ostest/Make.defs index b127a6b7f..1cd425063 100644 --- a/nuttx/configs/z16f2800100zcog/ostest/Make.defs +++ b/nuttx/configs/z16f2800100zcog/ostest/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/z16f2800100zcog/ostest/Make.defs # -# Copyright (C) 2008, 2010 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2010, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -33,43 +33,67 @@ # ############################################################################ -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/.config +include $(TOPDIR)/tools/Config.mk -# These are the directories where the ZNeo-II toolchain is installed +# These are the directories where the ZDS-II toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. -ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_ZNEO_4.11.1 +ZDSVERSION = 5.0.1 ifeq ($(CONFIG_WINDOWS_NATIVE),y) - ZDSBINDIR := $(ZDSINSTALLDIR)\bin - ZDSSTDINCDIR := $(ZDSINSTALLDIR)\include\std - ZDSZILOGINCDIR := $(ZDSINSTALLDIR)\include\zilog - ZDSSTDLIBDIR := $(ZDSINSTALLDIR)\lib\std - ZDSZILOGLIBDIR := $(ZDSINSTALLDIR)\lib\zilog + ZDSINSTALLDIR = C:/PROGRA~2/ZiLOG/ZDSII_ZNEO_$(ZDSVERSION) + INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} + ZDSBINDIR = $(INSTALLDIR)\bin + ZDSSTDINCDIR = $(INSTALLDIR)\include\std + ZDSZILOGINCDIR = $(INSTALLDIR)\include\zilog + ZDSSTDLIBDIR = $(INSTALLDIR)\lib\std + ZDSZILOGLIBDIR = $(INSTALLDIR)\lib\zilog + + # CFLAGs + + ARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + EARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHUSRINCLUDES = -usrinc:. else - WINTOOL := y + WINTOOL = y + ZDSINSTALLDIR = C:/PROGRA~2/ZiLOG/ZDSII_ZNEO_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} - ZDSBINDIR := $(INSTALLDIR)/bin - ZDSSTDINCDIR := $(INSTALLDIR)/include/std - ZDSZILOGINCDIR := $(INSTALLDIR)/include/zilog - ZDSSTDLIBDIR := $(INSTALLDIR)/lib/std - ZDSZILOGLIBDIR := $(INSTALLDIR)/lib/zilog -endif + ZDSBINDIR = $(INSTALLDIR)/bin + ZDSSTDINCDIR = $(INSTALLDIR)/include/std + ZDSZILOGINCDIR = $(INSTALLDIR)/include/zilog + ZDSSTDLIBDIR = $(INSTALLDIR)/lib/std + ZDSZILOGLIBDIR = $(INSTALLDIR)/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)"} + WZDSSTDLIBDIR = ${shell cygpath -w "$(ZDSSTDLIBDIR)"} + WZDSZILOGLIBDIR = ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} -# These are the same directories but with the directory separator -# character swapped as needed by the ZNeo-II compiler + # Escaped versions -WTOPDIR := ${shell cygpath -w "$(TOPDIR)"} -WZDSSTDINCDIR := ${shell cygpath -w "$(ZDSSTDINCDIR)"} -WZDSZILOGINCDIR := ${shell cygpath -w "$(ZDSZILOGINCDIR)"} -WZDSSTDLIBDIR := ${shell cygpath -w "$(ZDSSTDLIBDIR)"} -WZDSZILOGLIBDIR := ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} + ETOPDIR = ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} + EZDSSTDINCDIR = ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} + EZDSZILOGINCDIR = ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} -# Escaped versions + # CFLAGs -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' +endif # Assembler definitions @@ -83,7 +107,6 @@ ARCHASMCPUFLAGS = -cpu:Z16F2811AL -NOigcase ARCHASMLIST = -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet ARCHASMWARNINGS = -warn ARCHASMDEFINES = -define:_Z16F2811AL=1 -define:_Z16K_SERIES=1 -define:_Z16F_SERIES=1 -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions @@ -95,18 +118,16 @@ else endif ARCHCPUFLAGS = -chartype:S -model:L -NOmodsect -cpu:Z16F2811AL -NOgenprint \ - -asmsw:" $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" + -asmsw:" $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" ARCHLIST = -keeplst -NOlist -NOlistinc -NOkeepasm ARCHPICFLAGS = ARCHWARNINGS = -warn ARCHDEFINES = -define:_Z16F2811AL -define:_Z16K_SERIES -define:_Z16F_SERIES -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPDEFINES = -D_Z16F2811AL -D_Z16K_SERIES -D_Z16F_SERIES -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include +CPPINCLUDES = -I$(TOPDIR)$(DELIM)include CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions @@ -115,16 +136,16 @@ ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/z16f2800100zcog/ostest/ostest.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)configs$(DELIM)z16f2800100zcog$(DELIM)ostest$(DELIM)ostest.linkcmd # Tool names/pathes CROSSDEV = -CC = $(ZDSBINDIR)/zneocc.exe +CC = zneocc.exe CPP = gcc -E -LD = $(ZDSBINDIR)/zneolink.exe -AS = $(ZDSBINDIR)/zneoasm.exe -AR = $(ZDSBINDIR)/zneolib.exe +LD = zneolink.exe +AS = zneoasm.exe +AR = zneolib.exe # File extensions @@ -137,51 +158,89 @@ EXEEXT = .hex # to compile and assembly source files and to insert the resulting # object files into an archive +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + define PREPROCESS - @echo "CPP: $1->$2" + @echo CPP: $1->$2 $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 endef define COMPILE - @#echo "CC: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef define ASSEMBLE - @#echo "AS: $1" - $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) define ARCHIVE - echo "AR: $2"; + echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef + +define CLEAN + $(Q) if exist *.obj (del /f /q *.obj) + $(Q) if exist *.src (del /f /q *.src) + $(Q) if exist *.lib (del /f /q *.lib) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.lod (del /f /q *.lod) + $(Q) if exist *.lst (del /f /q *.lst) +endef + else + +define PREPROCESS + @echo "CPP: $1->$2" + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) +endef + +define ASSEMBLE + $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) +endef + define ARCHIVE $(Q) for __obj in $(2) ; do \ echo "AR: $$__obj"; \ "$(AR)" $(ARFLAGS) $1=-+$$__obj || { echo "$(AR) $1=-+$$__obj FAILED!" ; exit 1 ; } \ done endef -endif define CLEAN - $(Q) rm -f *.obj *.src *.lib *.hex *.lst + $(Q) rm -f *.obj *.src *.lib *.hex *.lod *.lst endef +endif -# This is the tool to use for dependencies (i.e., none) +# Windows native host tool definitions -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe -# ZNeo-II cannot follow Cygwin soft links, so we will have to use directory copies + # Windows-native host tools -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif diff --git a/nuttx/configs/z16f2800100zcog/ostest/setenv.sh b/nuttx/configs/z16f2800100zcog/ostest/setenv.sh index bddcad2b5..8a696fdcb 100755 --- a/nuttx/configs/z16f2800100zcog/ostest/setenv.sh +++ b/nuttx/configs/z16f2800100zcog/ostest/setenv.sh @@ -1,7 +1,7 @@ #!/bin/bash # configs/z16f2800100zcog/ostest/setenv.sh # -# Copyright (C) 2008, 2010 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2009, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -33,19 +33,31 @@ # # Check how we were executed # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# +# This is the Cygwin path to location where the XDS-II tools were installed +# +TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/ZiLOG/ZDSII_ZNEO_5.0.1/bin" + # -# The ZDS-II toolchain lies outside of the Cygwin "sandbox" and -# attempts to set the PATH variable do not have the desired effect. -# Instead, alias are provided for all of the ZDS-II command line tools. -# Version 4.11.1 installed in the default location is assumed here. +# Add the path to the toolchain to the PATH variable. NOTE that /bin and /usr/bin +# preceded the toolchain bin directory. This is because the ZDSII bin directory +# includes binaries like make.exe that will interfere with the normal build process +# if we do not give priority to the versions at /bin and /usr/bin. # -ZDSBINDIR="C:/Program\ Files/ZiLOG/ZDSII_ZNEO_4.11.1/bin" -alias zneoasm="${ZDSBINDIR}/zneoasm.exe" -alias zneocc="${ZDSBINDIR}/zneocc.exe" -alias zneolib="${ZDSBINDIR}/zneolib.exe" -alias zneolink="${ZDSBINDIR}/zneolink.exe" +export PATH="/bin:/usr/bin:${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +echo "PATH : ${PATH}" diff --git a/nuttx/configs/z16f2800100zcog/pashello/Make.defs b/nuttx/configs/z16f2800100zcog/pashello/Make.defs index 2ac7aff1e..10a5ee689 100644 --- a/nuttx/configs/z16f2800100zcog/pashello/Make.defs +++ b/nuttx/configs/z16f2800100zcog/pashello/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/z16f2800100zcog/pashello/Make.defs # -# Copyright (C) 2008, 2010 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2010, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -33,43 +33,67 @@ # ############################################################################ -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/.config +include $(TOPDIR)/tools/Config.mk -# These are the directories where the ZNeo-II toolchain is installed +# These are the directories where the ZDS-II toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. -ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_ZNEO_4.11.1 +ZDSVERSION = 5.0.1 ifeq ($(CONFIG_WINDOWS_NATIVE),y) - ZDSBINDIR := $(ZDSINSTALLDIR)\bin - ZDSSTDINCDIR := $(ZDSINSTALLDIR)\include\std - ZDSZILOGINCDIR := $(ZDSINSTALLDIR)\include\zilog - ZDSSTDLIBDIR := $(ZDSINSTALLDIR)\lib\std - ZDSZILOGLIBDIR := $(ZDSINSTALLDIR)\lib\zilog + ZDSINSTALLDIR = C:/PROGRA~2/ZiLOG/ZDSII_ZNEO_$(ZDSVERSION) + INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} + ZDSBINDIR = $(INSTALLDIR)\bin + ZDSSTDINCDIR = $(INSTALLDIR)\include\std + ZDSZILOGINCDIR = $(INSTALLDIR)\include\zilog + ZDSSTDLIBDIR = $(INSTALLDIR)\lib\std + ZDSZILOGLIBDIR = $(INSTALLDIR)\lib\zilog + + # CFLAGs + + ARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + EARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR) + ARCHUSRINCLUDES = -usrinc:. else - WINTOOL := y + WINTOOL = y + ZDSINSTALLDIR = C:/PROGRA~2/ZiLOG/ZDSII_ZNEO_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} - ZDSBINDIR := $(INSTALLDIR)/bin - ZDSSTDINCDIR := $(INSTALLDIR)/include/std - ZDSZILOGINCDIR := $(INSTALLDIR)/include/zilog - ZDSSTDLIBDIR := $(INSTALLDIR)/lib/std - ZDSZILOGLIBDIR := $(INSTALLDIR)/lib/zilog -endif + ZDSBINDIR = $(INSTALLDIR)/bin + ZDSSTDINCDIR = $(INSTALLDIR)/include/std + ZDSZILOGINCDIR = $(INSTALLDIR)/include/zilog + ZDSSTDLIBDIR = $(INSTALLDIR)/lib/std + ZDSZILOGLIBDIR = $(INSTALLDIR)/lib/zilog -# These are the same directories but with the directory separator -# character swapped as needed by the ZNeo-II compiler + # 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)} -WZDSSTDLIBDIR := ${shell cygpath -w $(ZDSSTDLIBDIR)} -WZDSZILOGLIBDIR := ${shell cygpath -w $(ZDSZILOGLIBDIR)} + WTOPDIR = ${shell cygpath -w "$(TOPDIR)"} + WZDSSTDINCDIR = ${shell cygpath -w "$(ZDSSTDINCDIR)"} + WZDSZILOGINCDIR = ${shell cygpath -w "$(ZDSZILOGINCDIR)"} + WZDSSTDLIBDIR = ${shell cygpath -w "$(ZDSSTDLIBDIR)"} + WZDSZILOGLIBDIR = ${shell cygpath -w "$(ZDSZILOGLIBDIR)"} -# Escaped versions + # Escaped versions -ETOPDIR := ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} -EZDSSTDINCDIR := ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} -EZDSZILOGINCDIR := ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} + ETOPDIR = ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"} + EZDSSTDINCDIR = ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"} + EZDSZILOGINCDIR = ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"} + + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' +endif # Assembler definitions @@ -83,7 +107,6 @@ ARCHASMCPUFLAGS = -cpu:Z16F2811AL -NOigcase ARCHASMLIST = -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet ARCHASMWARNINGS = -warn ARCHASMDEFINES = -define:_Z16F2811AL=1 -define:_Z16K_SERIES=1 -define:_Z16F_SERIES=1 -define:__ASSEMBLY__ -ARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) # Compiler definitions @@ -95,18 +118,16 @@ else endif ARCHCPUFLAGS = -chartype:S -model:L -NOmodsect -cpu:Z16F2811AL -NOgenprint \ - -asmsw:" $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" + -asmsw:" $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" ARCHLIST = -keeplst -NOlist -NOlistinc -NOkeepasm ARCHPICFLAGS = ARCHWARNINGS = -warn ARCHDEFINES = -define:_Z16F2811AL -define:_Z16K_SERIES -define:_Z16F_SERIES -ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' -ARCHUSRINCLUDES = -usrinc:'.' ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPDEFINES = -D_Z16F2811AL -D_Z16K_SERIES -D_Z16F_SERIES -D__ASSEMBLY__ -CPPINCLUDES = -I$(TOPDIR)/include +CPPINCLUDES = -I$(TOPDIR)$(DELIM)include CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES) # Librarian definitions @@ -115,16 +136,16 @@ ARFLAGS = -quiet -warn # Linker definitions -LINKCMDTEMPLATE = $(TOPDIR)/configs/z16f2800100zcog/pashello/pashello.linkcmd +LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)configs$(DELIM)z16f2800100zcog$(DELIM)pashello$(DELIM)pashello.linkcmd # Tool names/pathes CROSSDEV = -CC = $(ZDSBINDIR)/zneocc.exe +CC = zneocc.exe CPP = gcc -E -LD = $(ZDSBINDIR)/zneolink.exe -AS = $(ZDSBINDIR)/zneoasm.exe -AR = $(ZDSBINDIR)/zneolib.exe +LD = zneolink.exe +AS = zneoasm.exe +AR = zneolib.exe # File extensions @@ -137,51 +158,89 @@ EXEEXT = .hex # to compile and assembly source files and to insert the resulting # object files into an archive +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + define PREPROCESS - @echo "CPP: $1->$2" - @$(CPP) $(CPPFLAGS) $1 -o $2 + @echo CPP: $1->$2 + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 endef define COMPILE - @#echo "CC: $1" - @(wfile=`cygpath -w $1`; $(CC) $(CFLAGS) $$wfile) + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef define ASSEMBLE - @#echo "AS: $1" - @(wfile=`cygpath -w $1`; $(AS) $(AFLAGS) $$wfile) + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) define ARCHIVE - echo "AR: $2"; + echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef + +define CLEAN + $(Q) if exist *.obj (del /f /q *.obj) + $(Q) if exist *.src (del /f /q *.src) + $(Q) if exist *.lib (del /f /q *.lib) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.lod (del /f /q *.lod) + $(Q) if exist *.lst (del /f /q *.lst) +endef + else + +define PREPROCESS + @echo "CPP: $1->$2" + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) +endef + +define ASSEMBLE + $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) +endef + define ARCHIVE $(Q) for __obj in $(2) ; do \ echo "AR: $$__obj"; \ "$(AR)" $(ARFLAGS) $1=-+$$__obj || { echo "$(AR) $1=-+$$__obj FAILED!" ; exit 1 ; } \ done endef -endif define CLEAN - @rm -f *.obj *.src *.lib *.hex *.lst + $(Q) rm -f *.obj *.src *.lib *.hex *.lod *.lst endef +endif -# This is the tool to use for dependencies (i.e., none) +# Windows native host tool definitions -MKDEP = $(TOPDIR)/tools/mknulldeps.sh +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe -# ZNeo-II cannot follow Cygwin soft links, so we will have to use directory copies + # Windows-native host tools -DIRLINK = $(TOPDIR)/tools/winlink.sh -DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else # Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies + + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif diff --git a/nuttx/configs/z16f2800100zcog/pashello/setenv.sh b/nuttx/configs/z16f2800100zcog/pashello/setenv.sh index f957b23cb..2db93c5ef 100755 --- a/nuttx/configs/z16f2800100zcog/pashello/setenv.sh +++ b/nuttx/configs/z16f2800100zcog/pashello/setenv.sh @@ -1,7 +1,7 @@ #!/bin/bash -# z16f2800100zcog/setenv.sh +# configs/z16f2800100zcog/pashello/setenv.sh # -# Copyright (C) 2008, 2010 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2009, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -33,19 +33,31 @@ # # Check how we were executed # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# +# This is the Cygwin path to location where the XDS-II tools were installed +# +TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/ZiLOG/ZDSII_ZNEO_5.0.1/bin" + # -# The ZDS-II toolchain lies outside of the Cygwin "sandbox" and -# attempts to set the PATH variable do not have the desired effect. -# Instead, alias are provided for all of the ZDS-II command line tools. -# Version 4.11.1 installed in the default location is assumed here. +# Add the path to the toolchain to the PATH variable. NOTE that /bin and /usr/bin +# preceded the toolchain bin directory. This is because the ZDSII bin directory +# includes binaries like make.exe that will interfere with the normal build process +# if we do not give priority to the versions at /bin and /usr/bin. # -ZDSBINDIR="C:/Program\ Files/ZiLOG/ZDSII_ZNEO_4.11.1/bin" -alias zneoasm="${ZDSBINDIR}/zneoasm.exe" -alias zneocc="${ZDSBINDIR}/zneocc.exe" -alias zneolib="${ZDSBINDIR}/zneolib.exe" -alias zneolink="${ZDSBINDIR}/zneolink.exe" +export PATH="/bin:/usr/bin:${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +echo "PATH : ${PATH}" diff --git a/nuttx/configs/z8encore000zco/README.txt b/nuttx/configs/z8encore000zco/README.txt index d37ee2302..9ec1b80af 100644 --- a/nuttx/configs/z8encore000zco/README.txt +++ b/nuttx/configs/z8encore000zco/README.txt @@ -29,7 +29,7 @@ Version 4.9.5 Version 5.0.0 - On November 18, 2012, all of the z8 configurations were converted to use 5.0.0, + On November 28, 2012, all of the z8 configurations were converted to use 5.0.0, but have not been verified on a running target. Paths were also updated that are specific to a 32-bit toolchain running on diff --git a/nuttx/configs/z8f64200100kit/README.txt b/nuttx/configs/z8f64200100kit/README.txt index 1bb70ebb7..7356c8e87 100644 --- a/nuttx/configs/z8f64200100kit/README.txt +++ b/nuttx/configs/z8f64200100kit/README.txt @@ -29,7 +29,7 @@ Version 4.9.5 Version 5.0.0 - On November 18, 2012, all of the z8 configurations were converted to use 5.0.0, + On November 28, 2012, all of the z8 configurations were converted to use 5.0.0, but have not been verified on a running target. Paths were also updated that are specific to a 32-bit toolchain running on diff --git a/nuttx/drivers/mmcsd/mmcsd_sdio.c b/nuttx/drivers/mmcsd/mmcsd_sdio.c index 64b045bc2..3caa61583 100644 --- a/nuttx/drivers/mmcsd/mmcsd_sdio.c +++ b/nuttx/drivers/mmcsd/mmcsd_sdio.c @@ -2600,7 +2600,8 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv) * operating condition. CMD 8 is reserved on SD version 1.0 and MMC. * * CMD8 Argument: - * [31:12]: Reserved (shall be set to '0') * [11:8]: Supply Voltage (VHS) 0x1 (Range: 2.7-3.6 V) + * [31:12]: Reserved (shall be set to '0') + * [11:8]: Supply Voltage (VHS) 0x1 (Range: 2.7-3.6 V) * [7:0]: Check Pattern (recommended 0xaa) * CMD8 Response: R7 */ -- cgit v1.2.3 From c9230359ef3da96b4aa2517475eb910e25ea1620 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 29 Nov 2012 18:44:02 +0000 Subject: All ZNEO configurations converted to use the mconf/Kconfig tool git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5401 42af7a65-404d-4744-a932-0658087f49c3 --- apps/ChangeLog.txt | 2 + apps/examples/pashello/Makefile | 30 +- apps/examples/pashello/pashello.c | 4 +- apps/interpreters/Kconfig | 4 +- apps/interpreters/Make.defs | 4 +- apps/interpreters/ficl/Kconfig | 4 +- misc/pascal/nuttx/Makefile | 30 +- nuttx/ChangeLog | 4 + nuttx/arch/Kconfig | 4 + nuttx/arch/arm/Kconfig | 11 +- nuttx/arch/mips/Kconfig | 10 +- nuttx/arch/z16/Kconfig | 11 +- nuttx/arch/z16/src/z16f/Kconfig | 12 + nuttx/configs/Kconfig | 2 +- nuttx/configs/cloudctrl/nsh/defconfig | 4 +- nuttx/configs/ez80f910200kitg/README.txt | 4 +- nuttx/configs/ez80f910200kitg/ostest/defconfig | 4 +- nuttx/configs/ez80f910200zco/README.txt | 4 +- nuttx/configs/ez80f910200zco/ostest/defconfig | 4 +- nuttx/configs/fire-stm32v2/nsh/defconfig | 4 +- nuttx/configs/shenzhou/nsh/defconfig | 4 +- nuttx/configs/shenzhou/nxwm/defconfig | 4 +- nuttx/configs/shenzhou/thttpd/defconfig | 4 +- nuttx/configs/sim/cxxtest/defconfig | 4 +- nuttx/configs/sim/ostest/defconfig | 4 +- nuttx/configs/stm3240g-eval/discover/defconfig | 4 +- nuttx/configs/stm3240g-eval/xmlrpc/defconfig | 4 +- nuttx/configs/stm32f100rc_generic/nsh/defconfig | 4 +- nuttx/configs/stm32f100rc_generic/ostest/defconfig | 4 +- nuttx/configs/stm32f4discovery/cxxtest/defconfig | 4 +- nuttx/configs/stm32f4discovery/elf/defconfig | 4 +- nuttx/configs/stm32f4discovery/nxlines/defconfig | 4 +- nuttx/configs/stm32f4discovery/ostest/defconfig | 4 +- nuttx/configs/stm32f4discovery/winbuild/defconfig | 4 +- nuttx/configs/z16f2800100zcog/README.txt | 66 ++- nuttx/configs/z16f2800100zcog/ostest/appconfig | 39 -- nuttx/configs/z16f2800100zcog/ostest/defconfig | 609 +++++++++++++++------ nuttx/configs/z16f2800100zcog/pashello/defconfig | 601 ++++++++++++++------ nuttx/configs/z8encore000zco/README.txt | 4 +- nuttx/configs/z8encore000zco/ostest/defconfig | 4 +- nuttx/configs/z8f64200100kit/README.txt | 4 +- nuttx/configs/z8f64200100kit/ostest/defconfig | 4 +- nuttx/tools/incdir.sh | 2 +- 43 files changed, 1062 insertions(+), 483 deletions(-) delete mode 100644 nuttx/configs/z16f2800100zcog/ostest/appconfig (limited to 'nuttx') diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index 29a54461a..673838067 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -426,3 +426,5 @@ various DHCPC improvements(Darcy Gong). * apps/nshlib/nsh_apps.c: Fix compilation errors whenCONFIG_NSH_DISABLEBG=y. From Freddie Chopin. + * Rename CONFIG_PCODE and CONFIG_FICL as CONFIG_INTERPRETERS_PCODE and + CONFIG_INTERPRETERS_FICL for consistency with other configuration naming. diff --git a/apps/examples/pashello/Makefile b/apps/examples/pashello/Makefile index 5876b9d2a..bb525c925 100644 --- a/apps/examples/pashello/Makefile +++ b/apps/examples/pashello/Makefile @@ -39,30 +39,38 @@ include $(APPDIR)/Make.defs # Pascal Add-On Example -ASRCS = -CSRCS = pashello.c device.c +ifeq ($(WINTOOL),y) +INCDIROPT = -w +endif +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" \ + "." \ + "$(APPDIR)$(DELIM)interpreters$(DELIM)pcode$(DELIM)include" \ + "$(APPDIR)$(DELIM)interpreters$(DELIM)pcode$(DELIM)insn$(DELIM)include"} + +ASRCS = +CSRCS = pashello.c device.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) + BIN = ..\..\libapps$(LIBEXT) else ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) + BIN = ..\\..\\libapps$(LIBEXT) else - BIN = ../../libapps$(LIBEXT) + BIN = ../../libapps$(LIBEXT) endif endif -ROOTDEPPATH = --dep-path . +ROOTDEPPATH = --dep-path . # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend distclean diff --git a/apps/examples/pashello/pashello.c b/apps/examples/pashello/pashello.c index b8c19b6a4..8f9fc8b22 100644 --- a/apps/examples/pashello/pashello.c +++ b/apps/examples/pashello/pashello.c @@ -43,8 +43,8 @@ #include #include -#include "apps/pcode/insn/pexec.h" -#include "apps/pcode/pedefs.h" +#include "pexec.h" +#include "pedefs.h" #include "pashello.h" /**************************************************************************** diff --git a/apps/interpreters/Kconfig b/apps/interpreters/Kconfig index 34cbf2eee..6e7d1ac4f 100644 --- a/apps/interpreters/Kconfig +++ b/apps/interpreters/Kconfig @@ -7,7 +7,7 @@ comment "Interpreters" source "$APPSDIR/interpreters/ficl/Kconfig" -config PCODE +config INTERPRETERS_PCODE bool "Pascal p-code interpreter" default n ---help--- @@ -16,6 +16,6 @@ config PCODE configuration implies that you have performed the required installation of the Pascal run-time code. -if PCODE +if INTERPRETERS_PCODE endif diff --git a/apps/interpreters/Make.defs b/apps/interpreters/Make.defs index 2fc4b26d4..5d808d5d6 100644 --- a/apps/interpreters/Make.defs +++ b/apps/interpreters/Make.defs @@ -34,10 +34,10 @@ # ############################################################################ -ifeq ($(CONFIG_PCODE),y) +ifeq ($(CONFIG_INTERPRETERS_PCODE),y) CONFIGURED_APPS += interpreters/pcode endif -ifeq ($(CONFIG_FICL),y) +ifeq ($(CONFIG_INTERPRETERS_FICL),y) CONFIGURED_APPS += interpreters/ficl endif diff --git a/apps/interpreters/ficl/Kconfig b/apps/interpreters/ficl/Kconfig index 1860a1591..ba6a7bc35 100644 --- a/apps/interpreters/ficl/Kconfig +++ b/apps/interpreters/ficl/Kconfig @@ -3,7 +3,7 @@ # see misc/tools/kconfig-language.txt. # -config FICL +config INTERPRETERS_FICL bool "Ficl Forth interpreter" default n ---help--- @@ -11,6 +11,6 @@ config FICL apps/interpreters/ficl directory. Use of this configuration assumes that you have performed the required installation of the Ficl run-time code. -if FICL +if INTERPRETERS_FICL endif diff --git a/misc/pascal/nuttx/Makefile b/misc/pascal/nuttx/Makefile index 396fae834..aa041eb23 100644 --- a/misc/pascal/nuttx/Makefile +++ b/misc/pascal/nuttx/Makefile @@ -41,21 +41,21 @@ include $(APPDIR)$(DELIM)Make.defs # Default tools ifeq ($(DIRLINK),) -DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh -DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif ifeq ($(WINTOOL),y) -INCDIROPT = -w + INCDIROPT = -w endif USRINCLUDES = ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(PCODEDIR)$(DELIM)include $(PCODEDIR)$(DELIM)insn$(DELIM)include} COMPILER = ${shell basename $(CC)} ifeq ($(COMPILER),zneocc.exe) -INCLUDES = $(ARCHSTDINCLUDES) $(USRINCLUDES) + INCLUDES = $(ARCHSTDINCLUDES) $(USRINCLUDES) else -INCLUDES = $(ARCHINCLUDES) $(USRINCLUDES) + INCLUDES = $(ARCHINCLUDES) $(USRINCLUDES) endif CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCHDEFINES) @@ -73,14 +73,18 @@ COBJS = $(CSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + BIN = ..\..\libapps$(LIBEXT) +else ifeq ($(WINTOOL),y) - BIN = "${shell cygpath -w $(APPDIR)$(DELIM)libapps$(LIBEXT)}" + BIN = ..\\..\\libapps$(LIBEXT) else - BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" + BIN = ../../libapps$(LIBEXT) +endif endif -ROOTDEPPATH = --dep-path . -PRUNDEPPATH = --dep-path insn$(DELIM)prun +ROOTDEPPATH = --dep-path . +PRUNDEPPATH = --dep-path insn$(DELIM)prun POFFDEPPATH = --dep-path libpoff PASDEPPATH = --dep-path libpas @@ -90,18 +94,10 @@ all: .built .PHONY: context depend clean distclean $(AOBJS): %$(OBJEXT): %.S -ifeq ($(COMPILER),zneocc.exe) - $(call ASSEMBLE, `cygpath -w $<`, $@) -else $(call ASSEMBLE, $<, $@) -endif $(COBJS): %$(OBJEXT): %.c -ifeq ($(COMPILER),zneocc.exe) - $(call COMPILE, `cygpath -w $<`, $@) -else $(call COMPILE, $<, $@) -endif $(APPDIR)$(DELIM)include$(DELIM)pcode: include @$(DIRLINK) $(PCODEDIR)$(DELIM)include $(APPDIR)$(DELIM)include$(DELIM)pcode diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index e0ca6c8dc..f986619a3 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3712,3 +3712,7 @@ From Freddie Chopin. * z8encore000zco/ostest and z8f64200100kit/ostest: Can now be modified to support the Windows native builds (see corresponding README.txt files). + * configures/z16f2800100zcog - All configurations updated to use the ZDS-II + 5.0.1 toolchain. + * configures/z16f2800100zcog - All configurations updated to use Kconfig/mconf + configuration tools. diff --git a/nuttx/arch/Kconfig b/nuttx/arch/Kconfig index 5cee40628..6e55a5744 100644 --- a/nuttx/arch/Kconfig +++ b/nuttx/arch/Kconfig @@ -111,6 +111,10 @@ config ARCH_DMA bool default n +config ARCH_IRQPRIO + bool + default n + config ARCH_STACKDUMP bool "Dump stack on assertions" default n diff --git a/nuttx/arch/arm/Kconfig b/nuttx/arch/arm/Kconfig index 3233918ca..9fa73782d 100644 --- a/nuttx/arch/arm/Kconfig +++ b/nuttx/arch/arm/Kconfig @@ -46,6 +46,7 @@ config ARCH_CHIP_KINETIS bool "Freescale Kinetis" select ARCH_CORTEXM4 select ARCH_HAVE_MPU + select ARCH_IRQPRIO ---help--- Freescale Kinetis Architectures (ARM Cortex-M4) @@ -53,6 +54,7 @@ config ARCH_CHIP_LM3S bool "TI Stellaris" select ARCH_CORTEXM3 select ARCH_HAVE_MPU + select ARCH_IRQPRIO ---help--- TI Stellaris LMS3 architecutres (ARM Cortex-M3) @@ -60,6 +62,7 @@ config ARCH_CHIP_LPC17XX bool "NXP LPC17xx" select ARCH_CORTEXM3 select ARCH_HAVE_MPU + select ARCH_IRQPRIO ---help--- NXP LPC17xx architectures (ARM Cortex-M3) @@ -91,6 +94,7 @@ config ARCH_CHIP_LPC43XX select ARCH_HAVE_CMNVECTOR select ARMV7M_CMNVECTOR select ARCH_HAVE_MPU + select ARCH_IRQPRIO ---help--- NPX LPC43XX architectures (ARM Cortex-M4). @@ -98,6 +102,7 @@ config ARCH_CHIP_SAM3U bool "Atmel AT91SAM3U" select ARCH_CORTEXM3 select ARCH_HAVE_MPU + select ARCH_IRQPRIO ---help--- Atmel AT91SAM3U architectures (ARM Cortex-M3) @@ -222,12 +227,6 @@ config PAGING If set =y in your configation file, this setting will enable the on-demand paging feature as described in http://www.nuttx.org/NuttXDemandPaging.html. -config ARCH_IRQPRIO - bool "Interrupt priority" - default y if ARCH_CORTEXM3 || ARCH_CORTEXM4 - ---help--- - Select if your board supports interrupt prioritization. - config BOARD_LOOPSPERMSEC int "Delay loops per millisecond" default 5000 diff --git a/nuttx/arch/mips/Kconfig b/nuttx/arch/mips/Kconfig index c642f7152..772b6f663 100644 --- a/nuttx/arch/mips/Kconfig +++ b/nuttx/arch/mips/Kconfig @@ -10,6 +10,8 @@ choice config ARCH_CHIP_PIC32MX bool "PIC32MX" + select ARCH_MIPS32 + select ARCH_IRQPRIO ---help--- Microchip PIC32MX320F032H (MIPS32) @@ -17,7 +19,7 @@ endchoice config ARCH_MIPS32 bool - default y if ARCH_CHIP_PIC32MX + default n config ARCH_FAMILY string @@ -27,12 +29,6 @@ config ARCH_CHIP string default "pic32mx" if ARCH_CHIP_PIC32MX -config ARCH_IRQPRIO - bool "Interrupt priority" - default y if ARCH_CHIP_PIC32MX - ---help--- - Select if your board supports interrupt prioritization. - config BOARD_LOOPSPERMSEC int "Delay loops per millisecond" default 5000 diff --git a/nuttx/arch/z16/Kconfig b/nuttx/arch/z16/Kconfig index a806e6ed1..52ea95c29 100644 --- a/nuttx/arch/z16/Kconfig +++ b/nuttx/arch/z16/Kconfig @@ -12,21 +12,29 @@ choice config ARCH_CHIP_Z16F2810 bool "Z16F2810" + select ARCH_CHIP_Z16F + select ARCH_IRQPRIO ---help--- ZiLOG Z16F2810 config ARCH_CHIP_Z16F2811 bool "Z16F2811" + select ARCH_CHIP_Z16F + select ARCH_IRQPRIO ---help--- ZiLOG Z16F2811 config ARCH_CHIP_Z16F3211 - bool "Z16F321" + bool "Z16F3211" + select ARCH_CHIP_Z16F + select ARCH_IRQPRIO ---help--- ZiLOG Z16F321 config ARCH_CHIP_Z16F6411 bool "Z16F6411" + select ARCH_CHIP_Z16F + select ARCH_IRQPRIO ---help--- ZiLOG Z16F6411 @@ -34,7 +42,6 @@ endchoice config ARCH_CHIP_Z16F bool - default y if ARCH_CHIP_Z16F2810 || ARCH_CHIP_Z16F2811 || ARCH_CHIP_Z16F3211 || ARCH_CHIP_Z16F6411 config ARCH_CHIP string diff --git a/nuttx/arch/z16/src/z16f/Kconfig b/nuttx/arch/z16/src/z16f/Kconfig index 826720ee7..5efc061a5 100644 --- a/nuttx/arch/z16/src/z16f/Kconfig +++ b/nuttx/arch/z16/src/z16f/Kconfig @@ -6,4 +6,16 @@ if ARCH_CHIP_Z16F comment "Z16F Configuration Options" +# UART0/1 always enabled + +config Z16F_UART0 + bool + default y + select ARCH_HAVE_UART0 + +config Z16F_UART1 + bool + default y + select ARCH_HAVE_UART1 + endif diff --git a/nuttx/configs/Kconfig b/nuttx/configs/Kconfig index a89e7cdea..bc3759722 100644 --- a/nuttx/configs/Kconfig +++ b/nuttx/configs/Kconfig @@ -555,7 +555,7 @@ config ARCH_BOARD_XTRS config ARCH_BOARD_Z16F2800100ZCOG bool "Zilog Z16F2800100ZCOG Development Kit" - depends on ARCH_CHIP_Z16F281 + depends on ARCH_CHIP_Z16F2811 select ARCH_HAVE_LEDS ---help--- z16f Microcontroller. This port use the ZiLIG z16f2800100zcog diff --git a/nuttx/configs/cloudctrl/nsh/defconfig b/nuttx/configs/cloudctrl/nsh/defconfig index 5547333d8..440cb3e0b 100644 --- a/nuttx/configs/cloudctrl/nsh/defconfig +++ b/nuttx/configs/cloudctrl/nsh/defconfig @@ -569,8 +569,8 @@ CONFIG_EXAMPLES_NSH=y # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/ez80f910200kitg/README.txt b/nuttx/configs/ez80f910200kitg/README.txt index 004f607d4..e314b0fe1 100644 --- a/nuttx/configs/ez80f910200kitg/README.txt +++ b/nuttx/configs/ez80f910200kitg/README.txt @@ -116,8 +116,8 @@ available: b. You can't use setenv.sh in the native Windows environment. Try scripts/setenv.bat instead. c. At present, the native Windows build fails at the final link stages. - The failure is due to problems in arch/z80/src/nuttx/linkcmd that - is autogenerated by arch/z80/src/Makefile.zdsii. The basic program + The failure is due to problems in arch/z80/src/nuttx.linkcmd that + is autogenerated by arch/z80/src/Makefile.zdsii. The basic problem is the spurious spaces and and carrirage returns are generated at the end of the lines after a line continuation (\ ^M). If these trailing bad characters are manually eliminated, then the build diff --git a/nuttx/configs/ez80f910200kitg/ostest/defconfig b/nuttx/configs/ez80f910200kitg/ostest/defconfig index 757916281..0e399cfc7 100644 --- a/nuttx/configs/ez80f910200kitg/ostest/defconfig +++ b/nuttx/configs/ez80f910200kitg/ostest/defconfig @@ -402,8 +402,8 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/ez80f910200zco/README.txt b/nuttx/configs/ez80f910200zco/README.txt index bc4e11e27..1bc9e56b8 100644 --- a/nuttx/configs/ez80f910200zco/README.txt +++ b/nuttx/configs/ez80f910200zco/README.txt @@ -130,8 +130,8 @@ ostest b. You can't use setenv.sh in the native Windows environment. Try scripts/setenv.bat instead. c. At present, the native Windows build fails at the final link stages. - The failure is due to problems in arch/z80/src/nuttx/linkcmd that - is autogenerated by arch/z80/src/Makefile.zdsii. The basic program + The failure is due to problems in arch/z80/src/nuttx.linkcmd that + is autogenerated by arch/z80/src/Makefile.zdsii. The basic problem is the spurious spaces and and carrirage returns are generated at the end of the lines after a line continuation (\ ^M). If these trailing bad characters are manually eliminated, then the build diff --git a/nuttx/configs/ez80f910200zco/ostest/defconfig b/nuttx/configs/ez80f910200zco/ostest/defconfig index c82a60e3a..7597bcfd6 100644 --- a/nuttx/configs/ez80f910200zco/ostest/defconfig +++ b/nuttx/configs/ez80f910200zco/ostest/defconfig @@ -410,8 +410,8 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/fire-stm32v2/nsh/defconfig b/nuttx/configs/fire-stm32v2/nsh/defconfig index f126c51fd..8e371686b 100644 --- a/nuttx/configs/fire-stm32v2/nsh/defconfig +++ b/nuttx/configs/fire-stm32v2/nsh/defconfig @@ -812,8 +812,8 @@ CONFIG_EXAMPLES_USBMSC_DEVPATH3="/dev/mmcsd2" # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/shenzhou/nsh/defconfig b/nuttx/configs/shenzhou/nsh/defconfig index c1e1818a5..4c73b7a6c 100644 --- a/nuttx/configs/shenzhou/nsh/defconfig +++ b/nuttx/configs/shenzhou/nsh/defconfig @@ -569,8 +569,8 @@ CONFIG_EXAMPLES_NSH=y # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/shenzhou/nxwm/defconfig b/nuttx/configs/shenzhou/nxwm/defconfig index a5ccc8bfb..ccc411a4d 100644 --- a/nuttx/configs/shenzhou/nxwm/defconfig +++ b/nuttx/configs/shenzhou/nxwm/defconfig @@ -841,8 +841,8 @@ CONFIG_NAMEDAPP=y # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/shenzhou/thttpd/defconfig b/nuttx/configs/shenzhou/thttpd/defconfig index 82884f4c3..e8f189282 100644 --- a/nuttx/configs/shenzhou/thttpd/defconfig +++ b/nuttx/configs/shenzhou/thttpd/defconfig @@ -741,8 +741,8 @@ CONFIG_EXAMPLES_NSH=y # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/sim/cxxtest/defconfig b/nuttx/configs/sim/cxxtest/defconfig index 1f99a6333..9c1da5494 100644 --- a/nuttx/configs/sim/cxxtest/defconfig +++ b/nuttx/configs/sim/cxxtest/defconfig @@ -361,8 +361,8 @@ CONFIG_EXAMPLES_CXXTEST=y # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/sim/ostest/defconfig b/nuttx/configs/sim/ostest/defconfig index 708c82a79..26d132cd0 100644 --- a/nuttx/configs/sim/ostest/defconfig +++ b/nuttx/configs/sim/ostest/defconfig @@ -351,8 +351,8 @@ CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=8 # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/stm3240g-eval/discover/defconfig b/nuttx/configs/stm3240g-eval/discover/defconfig index d7165573c..aefa05326 100644 --- a/nuttx/configs/stm3240g-eval/discover/defconfig +++ b/nuttx/configs/stm3240g-eval/discover/defconfig @@ -765,8 +765,8 @@ CONFIG_EXAMPLES_DISCOVER_NETMASK=0xffffff00 # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/stm3240g-eval/xmlrpc/defconfig b/nuttx/configs/stm3240g-eval/xmlrpc/defconfig index 308203e27..dd72d6ab3 100644 --- a/nuttx/configs/stm3240g-eval/xmlrpc/defconfig +++ b/nuttx/configs/stm3240g-eval/xmlrpc/defconfig @@ -760,8 +760,8 @@ CONFIG_EXAMPLES_XMLRPC_NETMASK=0xffffff00 # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/stm32f100rc_generic/nsh/defconfig b/nuttx/configs/stm32f100rc_generic/nsh/defconfig index b5698ad18..41bb86592 100644 --- a/nuttx/configs/stm32f100rc_generic/nsh/defconfig +++ b/nuttx/configs/stm32f100rc_generic/nsh/defconfig @@ -490,8 +490,8 @@ CONFIG_EXAMPLES_NSH=y # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/stm32f100rc_generic/ostest/defconfig b/nuttx/configs/stm32f100rc_generic/ostest/defconfig index 92faa7f03..c56503e1f 100644 --- a/nuttx/configs/stm32f100rc_generic/ostest/defconfig +++ b/nuttx/configs/stm32f100rc_generic/ostest/defconfig @@ -478,8 +478,8 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/stm32f4discovery/cxxtest/defconfig b/nuttx/configs/stm32f4discovery/cxxtest/defconfig index 6648d3b13..1b3df6d32 100644 --- a/nuttx/configs/stm32f4discovery/cxxtest/defconfig +++ b/nuttx/configs/stm32f4discovery/cxxtest/defconfig @@ -489,8 +489,8 @@ CONFIG_EXAMPLES_CXXTEST=y # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/stm32f4discovery/elf/defconfig b/nuttx/configs/stm32f4discovery/elf/defconfig index e4702507c..8d98fe696 100644 --- a/nuttx/configs/stm32f4discovery/elf/defconfig +++ b/nuttx/configs/stm32f4discovery/elf/defconfig @@ -485,8 +485,8 @@ CONFIG_EXAMPLES_ELF_DEVPATH="/dev/ram0" # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/stm32f4discovery/nxlines/defconfig b/nuttx/configs/stm32f4discovery/nxlines/defconfig index 286dd55ed..4de3a0922 100644 --- a/nuttx/configs/stm32f4discovery/nxlines/defconfig +++ b/nuttx/configs/stm32f4discovery/nxlines/defconfig @@ -591,8 +591,8 @@ CONFIG_EXAMPLES_NXLINES_BPP=16 # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/stm32f4discovery/ostest/defconfig b/nuttx/configs/stm32f4discovery/ostest/defconfig index da7c8d200..d260a87cb 100644 --- a/nuttx/configs/stm32f4discovery/ostest/defconfig +++ b/nuttx/configs/stm32f4discovery/ostest/defconfig @@ -498,8 +498,8 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/stm32f4discovery/winbuild/defconfig b/nuttx/configs/stm32f4discovery/winbuild/defconfig index e52719f25..311dd075d 100644 --- a/nuttx/configs/stm32f4discovery/winbuild/defconfig +++ b/nuttx/configs/stm32f4discovery/winbuild/defconfig @@ -498,8 +498,8 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/z16f2800100zcog/README.txt b/nuttx/configs/z16f2800100zcog/README.txt index 55ed22b10..0c69c75bc 100644 --- a/nuttx/configs/z16f2800100zcog/README.txt +++ b/nuttx/configs/z16f2800100zcog/README.txt @@ -94,13 +94,75 @@ Where is the specific board configuration that you wish to build. The following board-specific configurations are available: -- ostest +ostest +------ + This builds the examples/ostest application for execution from FLASH. See examples/README.txt for information about ostest. -- pashello + NOTES: + + 1. This configuration uses the mconf-based configuration tool. To + change this configuration using that tool, you should: + + a. Build and install the mconf tool. See nuttx/README.txt and + misc/tools/ + + b. Execute 'make menuconfig' in nuttx/ in order to start the + reconfiguration process. + + 2. By default, this configuration assumes that you are using the + Cygwin environment on Windows. An option is to use the native + CMD.exe window build as described in the top-level README.txt + file. To set up that configuration: + + -CONFIG_WINDOWS_CYGWIN=y + +CONFIG_WINDOWS_NATIVE=y + + And after configuring, make sure that CONFIG_APPS_DIR uses + the back slash character. For example: + + CONFIG_APPS_DIR="..\apps" + + NOTES: + + a. If you need to change the toolchain path used in Make.defs, you + will need to use the short 8.3 filenames to avoid spaces. On my + PC, C:\PROGRA~1\ is is C:\Program Files\ and C:\PROGRA~2\ is + C:\Program Files (x86)\ + b. You can't use setenv.sh in the native Windows environment. Try + scripts/setenv.bat instead. + c. At present, the native Windows build fails at the final link stages. + The failure is due to problems in arch/z16/src/nuttx.linkcmd that + is autogenerated by arch/z16/src/Makefile. The basic problem + is the spurious spaces and and carrirage returns are generated at + the end of the lines after a line continuation (\ ^M). If these + trailing bad characters are manually eliminated, then the build + will succeed on the next try. + +pashello +-------- Configures to use examples/pashello for execution from FLASH See examples/README.txt for information about pashello. + NOTES: + + 1. This configuration uses the mconf-based configuration tool. To + change this configuration using that tool, you should: + + a. Build and install the mconf tool. See nuttx/README.txt and + misc/tools/ + + b. Execute 'make menuconfig' in nuttx/ in order to start the + reconfiguration process. + + 2. The last time I tried building this configuration, there were + a few undefined symbols from the PCODE logic. It might require + a little TLC to get this all working again. + + 3. The native windows build has not been tried with this configuration + but should, in principle, work (see notes for the ostest configuration + above). + Check out any README.txt files in these s. diff --git a/nuttx/configs/z16f2800100zcog/ostest/appconfig b/nuttx/configs/z16f2800100zcog/ostest/appconfig deleted file mode 100644 index a0f5d2462..000000000 --- a/nuttx/configs/z16f2800100zcog/ostest/appconfig +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################ -# configs/z16f2800100zcog/ostest/appconfig -# -# Copyright (C) 2011 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. -# -############################################################################ - -# Path to example in apps/examples containing the user_start entry point - -CONFIGURED_APPS += examples/ostest - diff --git a/nuttx/configs/z16f2800100zcog/ostest/defconfig b/nuttx/configs/z16f2800100zcog/ostest/defconfig index 16f017778..027d6d73c 100644 --- a/nuttx/configs/z16f2800100zcog/ostest/defconfig +++ b/nuttx/configs/z16f2800100zcog/ostest/defconfig @@ -1,150 +1,174 @@ -############################################################################ -# configs/z16f2800100zcog/ostest/defconfig -# -# Copyright (C) 2008-2010 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. -# -############################################################################ -# -# Architecture selection # -CONFIG_ARCH="z16" +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +CONFIG_HOST_LINUX=y +# CONFIG_HOST_OSX is not set +# CONFIG_HOST_WINDOWS is not set +# CONFIG_HOST_OTHER is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="../apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +CONFIG_DEBUG=y +# CONFIG_DEBUG_VERBOSE is not set +# CONFIG_DEBUG_ENABLE is not set + +# +# Subsystem Debug Options +# +# CONFIG_DEBUG_MM is not set +# CONFIG_DEBUG_SCHED is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_DEBUG_LIB is not set +# CONFIG_DEBUG_BINFMT is not set +# CONFIG_DEBUG_GRAPHICS is not set + +# +# Driver Debug Options +# +# CONFIG_DEBUG_ANALOG is not set +# CONFIG_DEBUG_DMA is not set +# CONFIG_DEBUG_SYMBOLS is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set CONFIG_ARCH_Z16=y +# CONFIG_ARCH_Z80 is not set +CONFIG_ARCH="z16" CONFIG_ARCH_CHIP="z16f" -CONFIG_ARCH_CHIP_Z16F=y -CONFIG_ARCH_CHIP_Z16F2810=n -CONFIG_ARCH_CHIP_Z16F2811=y -CONFIG_ARCH_CHIP_Z16F3211=n -CONFIG_ARCH_CHIP_Z16F6411=n -CONFIG_ARCH_BOARD="z16f2800100zcog" -CONFIG_ARCH_BOARD_Z16F2800100ZCOG=y -CONFIG_ARCH_NOINTC=n -CONFIG_ARCH_IRQPRIO=y CONFIG_BOARD_LOOPSPERMSEC=1250 -CONFIG_ENDIAN_BIG=y -CONFIG_DRAM_SIZE=65536 -CONFIG_ARCH_LEDS=y + # -# Z16F specific device driver settings +# Z16 Configuration Options # -CONFIG_UART0_SERIAL_CONSOLE=y -CONFIG_UART1_SERIAL_CONSOLE=n -CONFIG_UART0_TXBUFSIZE=256 -CONFIG_UART1_TXBUFSIZE=256 -CONFIG_UART0_RXBUFSIZE=256 -CONFIG_UART1_RXBUFSIZE=256 -CONFIG_UART0_BAUD=57600 -CONFIG_UART1_BAUD=57600 -CONFIG_UART0_PARITY=0 -CONFIG_UART1_PARITY=0 -CONFIG_UART0_2STOP=0 -CONFIG_UART1_2STOP=0 +# CONFIG_ARCH_CHIP_Z16F2810 is not set +CONFIG_ARCH_CHIP_Z16F2811=y +# CONFIG_ARCH_CHIP_Z16F3211 is not set +# CONFIG_ARCH_CHIP_Z16F6411 is not set +CONFIG_ARCH_CHIP_Z16F=y # -# General build options +# Common Configuration Options # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n # -# General OS setup +# Z16F Configuration Options # -CONFIG_USER_ENTRYPOINT="ostest_main" -CONFIG_DEBUG=y -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y -CONFIG_RR_INTERVAL=200 -CONFIG_SCHED_INSTRUMENTATION=n -CONFIG_TASK_NAME_SIZE=0 -CONFIG_START_YEAR=2008 -CONFIG_START_MONTH=1 -CONFIG_START_DAY=28 -CONFIG_JULIAN_TIME=n -CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n -CONFIG_SDCLONE_DISABLE=y +CONFIG_Z16F_UART0=y +CONFIG_Z16F_UART1=y # -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. +# Architecture Options # -# There are certain dependency relationships in these -# features. +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set +CONFIG_ARCH_IRQPRIO=y +# CONFIG_ARCH_STACKDUMP is not set +CONFIG_ENDIAN_BIG=y + # -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. +# Board Settings # -CONFIG_DISABLE_CLOCK=n -CONFIG_DISABLE_POSIX_TIMERS=n -CONFIG_DISABLE_PTHREAD=n -CONFIG_DISABLE_SIGNALS=n -CONFIG_DISABLE_MQUEUE=n -CONFIG_DISABLE_MOUNTPOINT=n -CONFIG_DISABLE_ENVIRON=n -CONFIG_DISABLE_POLL=y +CONFIG_DRAM_START= +CONFIG_DRAM_SIZE=65536 # -# Misc libc settings +# Boot options # -CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set + +# +# Board Selection +# +CONFIG_ARCH_BOARD_Z16F2800100ZCOG=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="z16f2800100zcog" # -# Allow for architecture optimized implementations +# Common Board Options # -# The architecture can provide optimized versions of the -# following to improve sysem performance +CONFIG_ARCH_HAVE_LEDS=y +CONFIG_ARCH_LEDS=y + +# +# Board-Specific Options # -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n + +# +# RTOS Features +# +CONFIG_MSEC_PER_TICK=10 +CONFIG_RR_INTERVAL=200 +# CONFIG_SCHED_INSTRUMENTATION is not set +CONFIG_TASK_NAME_SIZE=0 +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2012 +CONFIG_START_MONTH=11 +CONFIG_START_DAY=29 +CONFIG_DEV_CONSOLE=y +CONFIG_DEV_LOWCONSOLE=y +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="ostest_main" +CONFIG_DISABLE_OS_API=y +# CONFIG_DISABLE_CLOCK is not set +# CONFIG_DISABLE_POSIX_TIMERS is not set +# CONFIG_DISABLE_PTHREAD is not set +# CONFIG_DISABLE_SIGNALS is not set +# CONFIG_DISABLE_MQUEUE is not set +# CONFIG_DISABLE_MOUNTPOINT is not set +# CONFIG_DISABLE_ENVIRON is not set +CONFIG_DISABLE_POLL=y # # Sizes of configurable things (0 disables) @@ -155,8 +179,6 @@ CONFIG_NPTHREAD_KEYS=4 CONFIG_NFILE_DESCRIPTORS=8 CONFIG_NFILE_STREAMS=8 CONFIG_NAME_MAX=32 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_NUNGET_CHARS=2 CONFIG_PREALLOC_MQ_MSGS=4 CONFIG_MQ_MAXMSGSIZE=32 CONFIG_MAX_WDOGPARMS=2 @@ -164,62 +186,307 @@ CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=4 # -# TCP/IP and UDP support via uIP +# Stack and heap information +# +# CONFIG_CUSTOM_STACK is not set +CONFIG_IDLETHREAD_STACKSIZE=4096 +CONFIG_USERMAIN_STACKSIZE=4096 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=4096 + # -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n +# Device Drivers +# +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART0=y +CONFIG_ARCH_HAVE_UART1=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +CONFIG_UART0_SERIAL_CONSOLE=y +# CONFIG_UART1_SERIAL_CONSOLE is not set +# CONFIG_NO_SERIAL_CONSOLE is not set # -# UIP Network Utilities +# UART0 Configuration # -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 +CONFIG_UART0_RXBUFSIZE=256 +CONFIG_UART0_TXBUFSIZE=256 +CONFIG_UART0_BAUD=57600 +CONFIG_UART0_BITS=8 +CONFIG_UART0_PARITY=0 +CONFIG_UART0_2STOP=0 # -# Settings for examples/nsh -CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_CMD_SIZE=40 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 +# UART1 Configuration +# +CONFIG_UART1_RXBUFSIZE=256 +CONFIG_UART1_TXBUFSIZE=256 +CONFIG_UART1_BAUD=57600 +CONFIG_UART1_BITS=8 +CONFIG_UART1_PARITY=0 +CONFIG_UART1_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set # -# Stack and heap information +# System Logging Device Options # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_USERMAIN_STACKSIZE=4096 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# System Logging +# +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_NET is not set + +# +# File Systems +# + +# +# File system configuration +# +# CONFIG_FS_FAT is not set +# CONFIG_FS_RAMMAP is not set +# CONFIG_FS_NXFFS is not set +# CONFIG_FS_ROMFS is not set + +# +# System Logging +# +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0x00000000 +CONFIG_HEAP2_SIZE=0 +# CONFIG_GRAN is not set + +# +# Binary Formats +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# +CONFIG_STDIO_BUFFER_SIZE=256 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=2 +CONFIG_LIB_HOMEDIR="/" +# CONFIG_LIBM is not set +CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Named Applications +# +# CONFIG_NAMEDAPP is not set + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_NETTEST is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +CONFIG_EXAMPLES_OSTEST=y +# CONFIG_EXAMPLES_OSTEST_BUILTIN is not set +CONFIG_EXAMPLES_OSTEST_LOOPS=1 +CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192 +CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=8 +CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000 +CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 +# CONFIG_EXAMPLES_PASHELLO is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WLAN is not set + +# +# Interpreters # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# ModBus +# + +# +# FreeModbus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM +# + +# +# System NSH Add-Ons +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set diff --git a/nuttx/configs/z16f2800100zcog/pashello/defconfig b/nuttx/configs/z16f2800100zcog/pashello/defconfig index eec7b1575..c9f0d9673 100644 --- a/nuttx/configs/z16f2800100zcog/pashello/defconfig +++ b/nuttx/configs/z16f2800100zcog/pashello/defconfig @@ -1,225 +1,486 @@ -############################################################################ -# configs/z16f2800100zcog/pashello/defconfig -# -# Copyright (C) 2008-2010 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. -# -############################################################################ -# -# Architecture selection # -CONFIG_ARCH="z16" +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +CONFIG_HOST_LINUX=y +# CONFIG_HOST_OSX is not set +# CONFIG_HOST_WINDOWS is not set +# CONFIG_HOST_OTHER is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="../apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +CONFIG_DEBUG=y +# CONFIG_DEBUG_VERBOSE is not set +# CONFIG_DEBUG_ENABLE is not set + +# +# Subsystem Debug Options +# +# CONFIG_DEBUG_MM is not set +# CONFIG_DEBUG_SCHED is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_DEBUG_LIB is not set +# CONFIG_DEBUG_BINFMT is not set +# CONFIG_DEBUG_GRAPHICS is not set + +# +# Driver Debug Options +# +# CONFIG_DEBUG_ANALOG is not set +# CONFIG_DEBUG_DMA is not set +# CONFIG_DEBUG_SYMBOLS is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set CONFIG_ARCH_Z16=y +# CONFIG_ARCH_Z80 is not set +CONFIG_ARCH="z16" CONFIG_ARCH_CHIP="z16f" -CONFIG_ARCH_CHIP_Z16F=y -CONFIG_ARCH_CHIP_Z16F2810=n +CONFIG_BOARD_LOOPSPERMSEC=1250 + +# +# Z16 Configuration Options +# +# CONFIG_ARCH_CHIP_Z16F2810 is not set CONFIG_ARCH_CHIP_Z16F2811=y -CONFIG_ARCH_CHIP_Z16F3211=n -CONFIG_ARCH_CHIP_Z16F6411=n -CONFIG_ARCH_BOARD="z16f2800100zcog" -CONFIG_ARCH_BOARD_Z16F2800100ZCOG=y -CONFIG_ARCH_NOINTC=n +# CONFIG_ARCH_CHIP_Z16F3211 is not set +# CONFIG_ARCH_CHIP_Z16F6411 is not set +CONFIG_ARCH_CHIP_Z16F=y + +# +# Common Configuration Options +# + +# +# Z16F Configuration Options +# +CONFIG_Z16F_UART0=y +CONFIG_Z16F_UART1=y + +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set CONFIG_ARCH_IRQPRIO=y -CONFIG_BOARD_LOOPSPERMSEC=1250 +# CONFIG_ARCH_STACKDUMP is not set CONFIG_ENDIAN_BIG=y + +# +# Board Settings +# +CONFIG_DRAM_START= CONFIG_DRAM_SIZE=65536 -CONFIG_ARCH_LEDS=y + # -# Z16F specific device driver settings +# Boot options # -CONFIG_UART0_SERIAL_CONSOLE=y -CONFIG_UART1_SERIAL_CONSOLE=n -CONFIG_UART0_TXBUFSIZE=256 -CONFIG_UART1_TXBUFSIZE=256 -CONFIG_UART0_RXBUFSIZE=256 -CONFIG_UART1_RXBUFSIZE=256 -CONFIG_UART0_BAUD=57600 -CONFIG_UART1_BAUD=57600 -CONFIG_UART0_PARITY=0 -CONFIG_UART1_PARITY=0 -CONFIG_UART0_2STOP=0 -CONFIG_UART1_2STOP=0 +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set # -# General build options +# Board Selection # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n +CONFIG_ARCH_BOARD_Z16F2800100ZCOG=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="z16f2800100zcog" # -# General OS setup +# Common Board Options # -CONFIG_USER_ENTRYPOINT="pashello_main" -CONFIG_DEBUG=y -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y +CONFIG_ARCH_HAVE_LEDS=y +CONFIG_ARCH_LEDS=y + +# +# Board-Specific Options +# + +# +# RTOS Features +# +CONFIG_MSEC_PER_TICK=10 CONFIG_RR_INTERVAL=200 -CONFIG_SCHED_INSTRUMENTATION=n +# CONFIG_SCHED_INSTRUMENTATION is not set CONFIG_TASK_NAME_SIZE=0 +# CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2008 CONFIG_START_MONTH=1 CONFIG_START_DAY=28 -CONFIG_JULIAN_TIME=n CONFIG_DEV_CONSOLE=y CONFIG_DEV_LOWCONSOLE=y -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set CONFIG_SDCLONE_DISABLE=y +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="pashello_main" +CONFIG_DISABLE_OS_API=y +# CONFIG_DISABLE_CLOCK is not set +# CONFIG_DISABLE_POSIX_TIMERS is not set +# CONFIG_DISABLE_PTHREAD is not set +# CONFIG_DISABLE_SIGNALS is not set +# CONFIG_DISABLE_MQUEUE is not set +# CONFIG_DISABLE_MOUNTPOINT is not set +# CONFIG_DISABLE_ENVIRON is not set +CONFIG_DISABLE_POLL=y # -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. +# Sizes of configurable things (0 disables) # -# There are certain dependency relationships in these -# features. +CONFIG_MAX_TASKS=16 +CONFIG_MAX_TASK_ARGS=4 +CONFIG_NPTHREAD_KEYS=4 +CONFIG_NFILE_DESCRIPTORS=8 +CONFIG_NFILE_STREAMS=8 +CONFIG_NAME_MAX=32 +CONFIG_PREALLOC_MQ_MSGS=4 +CONFIG_MQ_MAXMSGSIZE=32 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=4 +CONFIG_PREALLOC_TIMERS=4 + # -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. +# Stack and heap information # -CONFIG_DISABLE_CLOCK=n -CONFIG_DISABLE_POSIX_TIMERS=n -CONFIG_DISABLE_PTHREAD=n -CONFIG_DISABLE_SIGNALS=n -CONFIG_DISABLE_MQUEUE=n -CONFIG_DISABLE_MOUNTPOINT=n -CONFIG_DISABLE_ENVIRON=n -CONFIG_DISABLE_POLL=y +# CONFIG_CUSTOM_STACK is not set +CONFIG_IDLETHREAD_STACKSIZE=4096 +CONFIG_USERMAIN_STACKSIZE=4096 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=4096 # -# Misc libc settings +# Device Drivers +# +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART0=y +CONFIG_ARCH_HAVE_UART1=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +CONFIG_UART0_SERIAL_CONSOLE=y +# CONFIG_UART1_SERIAL_CONSOLE is not set +# CONFIG_NO_SERIAL_CONSOLE is not set + # -CONFIG_NOPRINTF_FIELDWIDTH=y +# UART0 Configuration +# +CONFIG_UART0_RXBUFSIZE=256 +CONFIG_UART0_TXBUFSIZE=256 +CONFIG_UART0_BAUD=57600 +CONFIG_UART0_BITS=8 +CONFIG_UART0_PARITY=0 +CONFIG_UART0_2STOP=0 # -# Allow for architecture optimized implementations +# UART1 Configuration # -# The architecture can provide optimized versions of the -# following to improve sysem performance +CONFIG_UART1_RXBUFSIZE=256 +CONFIG_UART1_TXBUFSIZE=256 +CONFIG_UART1_BAUD=57600 +CONFIG_UART1_BITS=8 +CONFIG_UART1_PARITY=0 +CONFIG_UART1_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set + +# +# System Logging Device Options # -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n # -# Sizes of configurable things (0 disables) +# System Logging +# +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_NET is not set + +# +# File Systems +# + +# +# File system configuration +# +# CONFIG_FS_FAT is not set +# CONFIG_FS_RAMMAP is not set +# CONFIG_FS_NXFFS is not set +# CONFIG_FS_ROMFS is not set + +# +# System Logging +# +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0x00000000 +CONFIG_HEAP2_SIZE=0 +# CONFIG_GRAN is not set + +# +# Binary Formats +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines # -CONFIG_MAX_TASKS=16 -CONFIG_MAX_TASK_ARGS=4 -CONFIG_NPTHREAD_KEYS=4 -CONFIG_NFILE_DESCRIPTORS=8 -CONFIG_NFILE_STREAMS=8 -CONFIG_NAME_MAX=32 CONFIG_STDIO_BUFFER_SIZE=256 +CONFIG_STDIO_LINEBUFFER=y CONFIG_NUNGET_CHARS=2 -CONFIG_PREALLOC_MQ_MSGS=4 -CONFIG_MQ_MAXMSGSIZE=32 -CONFIG_MAX_WDOGPARMS=2 -CONFIG_PREALLOC_WDOGS=4 -CONFIG_PREALLOC_TIMERS=4 +CONFIG_LIB_HOMEDIR="/" +# CONFIG_LIBM is not set +CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_HAVE_CXX is not set # -# TCP/IP and UDP support via uIP +# Application Configuration # -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n # -# UIP Network Utilities +# Named Applications # -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 +# CONFIG_NAMEDAPP is not set # -# Settings for examples/nsh -CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_CMD_SIZE=40 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_NETTEST is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +# CONFIG_EXAMPLES_OSTEST is not set +CONFIG_EXAMPLES_PASHELLO=y +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WLAN is not set # -# Stack and heap information +# Interpreters +# + +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +CONFIG_INTERPRETERS_PCODE=y + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# ModBus +# + +# +# FreeModbus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_USERMAIN_STACKSIZE=4096 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# System NSH Add-Ons # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set diff --git a/nuttx/configs/z8encore000zco/README.txt b/nuttx/configs/z8encore000zco/README.txt index 9ec1b80af..7ca50db8c 100644 --- a/nuttx/configs/z8encore000zco/README.txt +++ b/nuttx/configs/z8encore000zco/README.txt @@ -101,8 +101,8 @@ available: b. You can't use setenv.sh in the native Windows environment. Try scripts/setenv.bat instead. c. At present, the native Windows build fails at the final link stages. - The failure is due to problems in arch/z80/src/nuttx/linkcmd that - is autogenerated by arch/z80/src/Makefile.zdsii. The basic program + The failure is due to problems in arch/z80/src/nuttx.linkcmd that + is autogenerated by arch/z80/src/Makefile.zdsii. The basic problem is the spurious spaces and and carrirage returns are generated at the end of the lines after a line continuation (\ ^M). If these trailing bad characters are manually eliminated, then the build diff --git a/nuttx/configs/z8encore000zco/ostest/defconfig b/nuttx/configs/z8encore000zco/ostest/defconfig index a79355b71..7ff44faae 100644 --- a/nuttx/configs/z8encore000zco/ostest/defconfig +++ b/nuttx/configs/z8encore000zco/ostest/defconfig @@ -397,8 +397,8 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/configs/z8f64200100kit/README.txt b/nuttx/configs/z8f64200100kit/README.txt index 7356c8e87..b0f224ad8 100644 --- a/nuttx/configs/z8f64200100kit/README.txt +++ b/nuttx/configs/z8f64200100kit/README.txt @@ -101,8 +101,8 @@ available: b. You can't use setenv.sh in the native Windows environment. Try scripts/setenv.bat instead. c. At present, the native Windows build fails at the final link stages. - The failure is due to problems in arch/z80/src/nuttx/linkcmd that - is autogenerated by arch/z80/src/Makefile.zdsii. The basic program + The failure is due to problems in arch/z80/src/nuttx.linkcmd that + is autogenerated by arch/z80/src/Makefile.zdsii. The basic problem is the spurious spaces and and carrirage returns are generated at the end of the lines after a line continuation (\ ^M). If these trailing bad characters are manually eliminated, then the build diff --git a/nuttx/configs/z8f64200100kit/ostest/defconfig b/nuttx/configs/z8f64200100kit/ostest/defconfig index 2389a0d34..1650600cd 100644 --- a/nuttx/configs/z8f64200100kit/ostest/defconfig +++ b/nuttx/configs/z8f64200100kit/ostest/defconfig @@ -397,8 +397,8 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # # Interpreters # -# CONFIG_FICL is not set -# CONFIG_PCODE is not set +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # # Network Utilities diff --git a/nuttx/tools/incdir.sh b/nuttx/tools/incdir.sh index af83f8517..145bfe9bb 100755 --- a/nuttx/tools/incdir.sh +++ b/nuttx/tools/incdir.sh @@ -215,7 +215,7 @@ for dir in $dirlist; do if [ -z "$response" ]; then response="${cmdarg}'"${path} else - response=${response}":${path}" + response=${response}";${path}" fi else # Treat the first directory differently -- cgit v1.2.3 From f63b1d9296232e1c0f0a37d1fc7cdfb87f34946f Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 29 Nov 2012 22:27:22 +0000 Subject: ZNEO now (almost) builds in Windows native environment git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5402 42af7a65-404d-4744-a932-0658087f49c3 --- misc/pascal/nuttx/Makefile | 9 +++++++-- nuttx/ChangeLog | 7 +++++-- nuttx/arch/z16/src/Makefile | 22 +++++++++++++++++++--- nuttx/binfmt/Makefile | 1 + nuttx/configs/ez80f910200kitg/ostest/Make.defs | 2 +- nuttx/configs/ez80f910200zco/dhcpd/Make.defs | 2 +- nuttx/configs/ez80f910200zco/httpd/Make.defs | 2 +- nuttx/configs/ez80f910200zco/nettest/Make.defs | 2 +- nuttx/configs/ez80f910200zco/nsh/Make.defs | 2 +- nuttx/configs/ez80f910200zco/ostest/Make.defs | 2 +- nuttx/configs/ez80f910200zco/poll/Make.defs | 2 +- nuttx/configs/z16f2800100zcog/README.txt | 3 +++ nuttx/configs/z16f2800100zcog/ostest/Make.defs | 2 +- nuttx/configs/z16f2800100zcog/ostest/defconfig | 8 ++++++-- nuttx/configs/z16f2800100zcog/pashello/Make.defs | 2 +- nuttx/configs/z16f2800100zcog/pashello/defconfig | 8 ++++++-- nuttx/configs/z16f2800100zcog/src/Makefile | 2 +- nuttx/configs/z8encore000zco/ostest/Make.defs | 2 +- nuttx/configs/z8f64200100kit/ostest/Make.defs | 2 +- nuttx/drivers/Makefile | 1 + nuttx/syscall/Makefile | 2 ++ 21 files changed, 62 insertions(+), 23 deletions(-) (limited to 'nuttx') diff --git a/misc/pascal/nuttx/Makefile b/misc/pascal/nuttx/Makefile index aa041eb23..cfabb1424 100644 --- a/misc/pascal/nuttx/Makefile +++ b/misc/pascal/nuttx/Makefile @@ -33,10 +33,15 @@ # ############################################################################ -PCODEDIR := ${shell pwd | sed -e 's/ /\\ /g'} - -include $(TOPDIR)/Make.defs include $(APPDIR)$(DELIM)Make.defs +DELIM ?= $(strip /) + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + PCODEDIR := ${shell echo %CD%} +else + PCODEDIR := ${shell pwd | sed -e 's/ /\\ /g'} +endif # Default tools diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index f986619a3..73c873f01 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3712,7 +3712,10 @@ From Freddie Chopin. * z8encore000zco/ostest and z8f64200100kit/ostest: Can now be modified to support the Windows native builds (see corresponding README.txt files). - * configures/z16f2800100zcog - All configurations updated to use the ZDS-II + * configs/z16f2800100zcog - All configurations updated to use the ZDS-II 5.0.1 toolchain. - * configures/z16f2800100zcog - All configurations updated to use Kconfig/mconf + * configs/z16f2800100zcog - All configurations updated to use Kconfig/mconf configuration tools. + * configs/z16f2800100zcog/ostest - Now supports a native Windows build + (other ZNEO configs may also support the native build, but this has not + been verfiied). diff --git a/nuttx/arch/z16/src/Makefile b/nuttx/arch/z16/src/Makefile index f209dcaed..5c0ef42be 100644 --- a/nuttx/arch/z16/src/Makefile +++ b/nuttx/arch/z16/src/Makefile @@ -56,10 +56,10 @@ CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCHD CPPFLAGS += -I$(ARCHSRCDIR) ifeq ($(CONFIG_WINDOWS_NATIVE),y) - LDFLAGS += @"$(ARCHSRCDIR)/nuttx.linkcmd" + LDFLAGS += @"$(ARCHSRCDIR)/nuttx.linkcmd" else ifeq ($(COMPILER),zneocc.exe) - LDFLAGS += @"${shell cygpath -w $(ARCHSRCDIR)/nuttx.linkcmd}" + LDFLAGS += @"${shell cygpath -w $(ARCHSRCDIR)/nuttx.linkcmd}" endif endif @@ -108,7 +108,7 @@ ifeq ($(COMPILER),zneocc.exe) nuttx.linkcmd: $(LINKCMDTEMPLATE) $(Q) cp -f $(LINKCMDTEMPLATE) nuttx.linkcmd ifeq ($(CONFIG_WINDOWS_NATIVE),y) - @echo "$(TOPDIR)\nuttx}"= \>>nuttx.linkcmd + @echo "$(TOPDIR)\nuttx"= \>>nuttx.linkcmd @echo "$(ARCHSRCDIR)\$(HEAD_OBJ)", \>>nuttx.linkcmd $(Q) for %%G in ($(LINKLIBS)) do ( echo "$(TOPDIR)\lib\%%G", \>>nuttx.linkcmd ) @echo "$(ARCHSRCDIR)\board\libboard$(LIBEXT)", \>>nuttx.linkcmd @@ -133,30 +133,42 @@ nuttx$(EXEEXT): $(HEAD_OBJ) board/libboard$(LIBEXT) nuttx.linkcmd $(Q) $(LD) $(LDFLAGS) .depend: Makefile chip/Make.defs $(DEPSRCS) +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + $(Q) if exist board$(DELIM)Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" depend ) +else $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \ fi +endif $(Q) $(MKDEP) --dep-path chip --dep-path common "$(CC)" -- $(CFLAGS) -- $(DEPSRCS) >Make.dep $(Q) touch $@ # This is part of the top-level export target export_head: board/libboard$(LIBEXT) $(HEAD_OBJ) +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + $(Q) if exist "$(EXPORT_DIR)$(DELIM)startup" ( copy $(HEAD_OBJ) "$(EXPORT_DIR)$(DELIM)startup$(DELIM)." /b /y) +else $(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \ cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \ else \ echo "$(EXPORT_DIR)/startup does not exist"; \ exit 1; \ fi +endif # Dependencies depend: .depend clean: +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + $(Q) if exist board$(DELIM)Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ) +else $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ fi +endif ifeq ($(COMPILER),zneocc.exe) $(call DELFILE, nuttx.linkcmd) $(call DELFILE, *.asm) @@ -167,9 +179,13 @@ endif $(call CLEAN) distclean: clean +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + $(Q) if exist board$(DELIM)Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ) +else $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \ fi +endif $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/nuttx/binfmt/Makefile b/nuttx/binfmt/Makefile index 932a5ec13..bda9602ac 100644 --- a/nuttx/binfmt/Makefile +++ b/nuttx/binfmt/Makefile @@ -34,6 +34,7 @@ ############################################################################ -include $(TOPDIR)/Make.defs +DELIM ?= $(strip /) ifeq ($(WINTOOL),y) INCDIROPT = -w diff --git a/nuttx/configs/ez80f910200kitg/ostest/Make.defs b/nuttx/configs/ez80f910200kitg/ostest/Make.defs index 0124684c6..c2aab3c9f 100644 --- a/nuttx/configs/ez80f910200kitg/ostest/Make.defs +++ b/nuttx/configs/ez80f910200kitg/ostest/Make.defs @@ -181,7 +181,7 @@ define ASSEMBLE endef define ARCHIVE - echo AR: $2 + @echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef diff --git a/nuttx/configs/ez80f910200zco/dhcpd/Make.defs b/nuttx/configs/ez80f910200zco/dhcpd/Make.defs index f227a046c..1ad97cffe 100644 --- a/nuttx/configs/ez80f910200zco/dhcpd/Make.defs +++ b/nuttx/configs/ez80f910200zco/dhcpd/Make.defs @@ -181,7 +181,7 @@ define ASSEMBLE endef define ARCHIVE - echo AR: $2 + @echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef diff --git a/nuttx/configs/ez80f910200zco/httpd/Make.defs b/nuttx/configs/ez80f910200zco/httpd/Make.defs index 398a6ec5d..77a5e731c 100644 --- a/nuttx/configs/ez80f910200zco/httpd/Make.defs +++ b/nuttx/configs/ez80f910200zco/httpd/Make.defs @@ -181,7 +181,7 @@ define ASSEMBLE endef define ARCHIVE - echo AR: $2 + @echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef diff --git a/nuttx/configs/ez80f910200zco/nettest/Make.defs b/nuttx/configs/ez80f910200zco/nettest/Make.defs index 02b6a22a2..c0d7c2f1d 100644 --- a/nuttx/configs/ez80f910200zco/nettest/Make.defs +++ b/nuttx/configs/ez80f910200zco/nettest/Make.defs @@ -181,7 +181,7 @@ define ASSEMBLE endef define ARCHIVE - echo AR: $2 + @echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef diff --git a/nuttx/configs/ez80f910200zco/nsh/Make.defs b/nuttx/configs/ez80f910200zco/nsh/Make.defs index 6a0c9bb73..258e8a5dc 100644 --- a/nuttx/configs/ez80f910200zco/nsh/Make.defs +++ b/nuttx/configs/ez80f910200zco/nsh/Make.defs @@ -181,7 +181,7 @@ define ASSEMBLE endef define ARCHIVE - echo AR: $2 + @echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef diff --git a/nuttx/configs/ez80f910200zco/ostest/Make.defs b/nuttx/configs/ez80f910200zco/ostest/Make.defs index 727c68ba3..e61e328bc 100644 --- a/nuttx/configs/ez80f910200zco/ostest/Make.defs +++ b/nuttx/configs/ez80f910200zco/ostest/Make.defs @@ -181,7 +181,7 @@ define ASSEMBLE endef define ARCHIVE - echo AR: $2 + @echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef diff --git a/nuttx/configs/ez80f910200zco/poll/Make.defs b/nuttx/configs/ez80f910200zco/poll/Make.defs index d7ba08ec0..c6cbd4616 100644 --- a/nuttx/configs/ez80f910200zco/poll/Make.defs +++ b/nuttx/configs/ez80f910200zco/poll/Make.defs @@ -181,7 +181,7 @@ define ASSEMBLE endef define ARCHIVE - echo AR: $2 + @echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef diff --git a/nuttx/configs/z16f2800100zcog/README.txt b/nuttx/configs/z16f2800100zcog/README.txt index 0c69c75bc..e12931df2 100644 --- a/nuttx/configs/z16f2800100zcog/README.txt +++ b/nuttx/configs/z16f2800100zcog/README.txt @@ -139,6 +139,9 @@ ostest the end of the lines after a line continuation (\ ^M). If these trailing bad characters are manually eliminated, then the build will succeed on the next try. + d. Hmmm... when last tested, there some missing .obj files in arch/z16/src. + A little additional TLC might be needed to get a reliable Windows + native build. pashello -------- diff --git a/nuttx/configs/z16f2800100zcog/ostest/Make.defs b/nuttx/configs/z16f2800100zcog/ostest/Make.defs index 1cd425063..20565edeb 100644 --- a/nuttx/configs/z16f2800100zcog/ostest/Make.defs +++ b/nuttx/configs/z16f2800100zcog/ostest/Make.defs @@ -174,7 +174,7 @@ define ASSEMBLE endef define ARCHIVE - echo AR: $2 + @echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef diff --git a/nuttx/configs/z16f2800100zcog/ostest/defconfig b/nuttx/configs/z16f2800100zcog/ostest/defconfig index 027d6d73c..f9ed65727 100644 --- a/nuttx/configs/z16f2800100zcog/ostest/defconfig +++ b/nuttx/configs/z16f2800100zcog/ostest/defconfig @@ -8,10 +8,14 @@ CONFIG_NUTTX_NEWCONFIG=y # Build Setup # # CONFIG_EXPERIMENTAL is not set -CONFIG_HOST_LINUX=y +# CONFIG_HOST_LINUX is not set # CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set +CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +# CONFIG_WINDOWS_NATIVE is not set +CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set # # Build Configuration diff --git a/nuttx/configs/z16f2800100zcog/pashello/Make.defs b/nuttx/configs/z16f2800100zcog/pashello/Make.defs index 10a5ee689..e0cfc6e31 100644 --- a/nuttx/configs/z16f2800100zcog/pashello/Make.defs +++ b/nuttx/configs/z16f2800100zcog/pashello/Make.defs @@ -174,7 +174,7 @@ define ASSEMBLE endef define ARCHIVE - echo AR: $2 + @echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef diff --git a/nuttx/configs/z16f2800100zcog/pashello/defconfig b/nuttx/configs/z16f2800100zcog/pashello/defconfig index c9f0d9673..aa0fb0b1a 100644 --- a/nuttx/configs/z16f2800100zcog/pashello/defconfig +++ b/nuttx/configs/z16f2800100zcog/pashello/defconfig @@ -8,10 +8,14 @@ CONFIG_NUTTX_NEWCONFIG=y # Build Setup # # CONFIG_EXPERIMENTAL is not set -CONFIG_HOST_LINUX=y +# CONFIG_HOST_LINUX is not set # CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set +CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +# CONFIG_WINDOWS_NATIVE is not set +CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set # # Build Configuration diff --git a/nuttx/configs/z16f2800100zcog/src/Makefile b/nuttx/configs/z16f2800100zcog/src/Makefile index 097755007..fcb4bac3a 100644 --- a/nuttx/configs/z16f2800100zcog/src/Makefile +++ b/nuttx/configs/z16f2800100zcog/src/Makefile @@ -39,7 +39,7 @@ SCHEDSRCDIR = $(TOPDIR)$(DELIM)sched ARCHSRCDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src ifeq ($(CONFIG_WINDOWS_NATIVE),y) - USRINCLUDES = -usrinc:'.;$(SCHEDSRCDIR);$(ARCHSRCDIR);$(ARCHSRCDIR)\common' + USRINCLUDES = -usrinc:".;$(SCHEDSRCDIR);$(ARCHSRCDIR);$(ARCHSRCDIR)\common" else WSCHEDSRCDIR = ${shell cygpath -w $(SCHEDSRCDIR)} WARCHSRCDIR = ${shell cygpath -w $(ARCHSRCDIR)} diff --git a/nuttx/configs/z8encore000zco/ostest/Make.defs b/nuttx/configs/z8encore000zco/ostest/Make.defs index 9ce005260..e9eacba89 100644 --- a/nuttx/configs/z8encore000zco/ostest/Make.defs +++ b/nuttx/configs/z8encore000zco/ostest/Make.defs @@ -207,7 +207,7 @@ define ASSEMBLE endef define ARCHIVE - echo AR: $2 + @echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef diff --git a/nuttx/configs/z8f64200100kit/ostest/Make.defs b/nuttx/configs/z8f64200100kit/ostest/Make.defs index 85cb5c401..1cc9726aa 100644 --- a/nuttx/configs/z8f64200100kit/ostest/Make.defs +++ b/nuttx/configs/z8f64200100kit/ostest/Make.defs @@ -207,7 +207,7 @@ define ASSEMBLE endef define ARCHIVE - echo AR: $2 + @echo AR: $2 $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) endef diff --git a/nuttx/drivers/Makefile b/nuttx/drivers/Makefile index b2bf1b611..aaaa67bd7 100644 --- a/nuttx/drivers/Makefile +++ b/nuttx/drivers/Makefile @@ -34,6 +34,7 @@ ############################################################################ -include $(TOPDIR)/Make.defs +DELIM ?= $(strip /) ifeq ($(WINTOOL),y) INCDIROPT = -w diff --git a/nuttx/syscall/Makefile b/nuttx/syscall/Makefile index ec2627b46..4556912be 100644 --- a/nuttx/syscall/Makefile +++ b/nuttx/syscall/Makefile @@ -34,6 +34,8 @@ ########################################################################### -include $(TOPDIR)/Make.defs +DELIM ?= $(strip /) + include proxies$(DELIM)Make.defs include stubs$(DELIM)Make.defs -- cgit v1.2.3 From 7f7356cdc914dacae1cec0de2671e026f4f8dd01 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 1 Dec 2012 15:43:51 +0000 Subject: standard keypad inteface and apps/examples/keypadtest from Denis Carikli git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5403 42af7a65-404d-4744-a932-0658087f49c3 --- apps/ChangeLog.txt | 2 + apps/examples/Kconfig | 1 + apps/examples/Make.defs | 4 + apps/examples/Makefile | 4 +- apps/examples/README.txt | 13 +++ apps/examples/keypadtest/Kconfig | 21 ++++ apps/examples/keypadtest/Makefile | 108 +++++++++++++++++++ apps/examples/keypadtest/keypadtest_main.c | 138 +++++++++++++++++++++++++ nuttx/ChangeLog | 3 + nuttx/arch/arm/src/calypso/calypso_keypad.c | 8 ++ nuttx/configs/compal_e99/nsh_highram/appconfig | 3 +- nuttx/configs/compal_e99/nsh_highram/defconfig | 1 + nuttx/graphics/nxglib/nxglib_splitline.c | 3 +- nuttx/include/nuttx/input/keypad.h | 54 ++++++++++ 14 files changed, 358 insertions(+), 5 deletions(-) create mode 100644 apps/examples/keypadtest/Kconfig create mode 100644 apps/examples/keypadtest/Makefile create mode 100644 apps/examples/keypadtest/keypadtest_main.c create mode 100644 nuttx/include/nuttx/input/keypad.h (limited to 'nuttx') diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index 673838067..d6e5de3c1 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -428,3 +428,5 @@ From Freddie Chopin. * Rename CONFIG_PCODE and CONFIG_FICL as CONFIG_INTERPRETERS_PCODE and CONFIG_INTERPRETERS_FICL for consistency with other configuration naming. + * apps/examples/keypadtest: A keypad test example contributed by Denis + Carikli \ No newline at end of file diff --git a/apps/examples/Kconfig b/apps/examples/Kconfig index c0d126ad4..ae5f0a61a 100644 --- a/apps/examples/Kconfig +++ b/apps/examples/Kconfig @@ -17,6 +17,7 @@ source "$APPSDIR/examples/hello/Kconfig" source "$APPSDIR/examples/helloxx/Kconfig" source "$APPSDIR/examples/json/Kconfig" source "$APPSDIR/examples/hidkbd/Kconfig" +source "$APPSDIR/examples/keypadtest/Kconfig" source "$APPSDIR/examples/igmp/Kconfig" source "$APPSDIR/examples/lcdrw/Kconfig" source "$APPSDIR/examples/mm/Kconfig" diff --git a/apps/examples/Make.defs b/apps/examples/Make.defs index 3d95ccb16..91f1331df 100644 --- a/apps/examples/Make.defs +++ b/apps/examples/Make.defs @@ -98,6 +98,10 @@ ifeq ($(CONFIG_EXAMPLES_JSON),y) CONFIGURED_APPS += examples/json endif +ifeq ($(CONFIG_EXAMPLES_KEYPADTEST),y) +CONFIGURED_APPS += examples/keypadtest +endif + ifeq ($(CONFIG_EXAMPLES_LCDRW),y) CONFIGURED_APPS += examples/lcdrw endif diff --git a/apps/examples/Makefile b/apps/examples/Makefile index 9d20e9312..bdbfd4de8 100644 --- a/apps/examples/Makefile +++ b/apps/examples/Makefile @@ -38,7 +38,7 @@ # Sub-directories SUBDIRS = adc buttons can cdcacm composite cxxtest dhcpd discover elf ftpc -SUBDIRS += ftpd hello helloxx hidkbd igmp json lcdrw mm modbus mount +SUBDIRS += ftpd hello helloxx hidkbd igmp json keypadtest lcdrw mm modbus mount SUBDIRS += nettest nsh null nx nxconsole nxffs nxflat nxhello nximage SUBDIRS += nxlines nxtext ostest pashello pipe poll pwm qencoder relays SUBDIRS += rgmp romfs serloop telnetd thttpd tiff touchscreen udp uip @@ -57,7 +57,7 @@ SUBDIRS += usbserial sendmail usbstorage usbterm watchdog wget wgetjson wlan CNTXTDIRS = pwm ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -CNTXTDIRS += adc can cdcacm composite cxxtestdhcpd discover ftpd json +CNTXTDIRS += adc can cdcacm composite cxxtest dhcpd discover ftpd json keypadtest CNTXTDIRS += modbus nettest nxlines relays qencoder telnetd watchdog wgetjson endif diff --git a/apps/examples/README.txt b/apps/examples/README.txt index 1463b0253..e40a63be9 100644 --- a/apps/examples/README.txt +++ b/apps/examples/README.txt @@ -580,6 +580,19 @@ examples/json on 2011-10-10 so I presume that the code is stable and there is no risk of maintaining duplicate logic in the NuttX repository. +examples/keypadtest +^^^^^^^^^^^^^^^^^^^ + + This is a generic keypad test example. It is similar to the USB hidkbd + example, but makes no assumptions about the underlying keyboard interface. + It uses the interfaces of include/nuttx/input/keypad.h. + + CONFIG_EXAMPLES_KEYPADTEST - Selects the keypadtest example (only need + if the mconf/Kconfig tool is used. + + CONFIG_EXAMPLES_KEYPAD_DEVNAME - The name of the keypad device that will + be opened in order to perform the keypad test. Default: "/dev/keypad" + examples/lcdrw ^^^^^^^^^^^^^^ diff --git a/apps/examples/keypadtest/Kconfig b/apps/examples/keypadtest/Kconfig new file mode 100644 index 000000000..9dee80633 --- /dev/null +++ b/apps/examples/keypadtest/Kconfig @@ -0,0 +1,21 @@ +# +# For a description of the syntax of this configuration file, +# see misc/tools/kconfig-language.txt. +# + +config EXAMPLES_KEYPADTEST + bool "Keypad test example program" + default n + ---help--- + Enable the Keypad test example programe + +if EXAMPLES_KEYPADTEST + + config EXAMPLES_KEYPAD_DEVNAME + string "Keypad Device Name" + default "/dev/keypad" + ---help--- + The name of the keypad device that will be opened in order to perform + the keypad test. Default: "/dev/keypad" + +endif diff --git a/apps/examples/keypadtest/Makefile b/apps/examples/keypadtest/Makefile new file mode 100644 index 000000000..3de0556a2 --- /dev/null +++ b/apps/examples/keypadtest/Makefile @@ -0,0 +1,108 @@ +############################################################################ +# apps/examples/keypadtest/Makefile +# +# Copyright (C) 2011-2012 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. +# +############################################################################ + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Keypad Test Example + +ASRCS = +CSRCS = keypadtest_main.c + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + BIN = ..\..\libapps$(LIBEXT) +else +ifeq ($(WINTOOL),y) + BIN = ..\\..\\libapps$(LIBEXT) +else + BIN = ../../libapps$(LIBEXT) +endif +endif + +# helloxx built-in application info + +APPNAME = keypadtest +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +ROOTDEPPATH = --dep-path . + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend distclean + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +.built: $(OBJS) + $(call ARCHIVE, $(BIN), $(OBJS)) + @touch .built + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) + @touch $@ +endif + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + $(call DELFILE, .built) + $(call CLEAN) + +distclean: clean + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + +-include Make.dep diff --git a/apps/examples/keypadtest/keypadtest_main.c b/apps/examples/keypadtest/keypadtest_main.c new file mode 100644 index 000000000..afdc3e08a --- /dev/null +++ b/apps/examples/keypadtest/keypadtest_main.c @@ -0,0 +1,138 @@ +/**************************************************************************** + * examples/keypadtest/keypadtest_main.c + * + * Copyright (C) 2011 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include + +/**************************************************************************** + * Definitions + ****************************************************************************/ +/* Configuration ************************************************************/ + +/* Sanity checking */ + +/* Provide some default values for other configuration settings */ + +#ifndef CONFIG_EXAMPLES_KEYPAD_DEVNAME +# define CONFIG_EXAMPLES_KEYPAD_DEVNAME "/dev/keypad" +#endif + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: keypadtest_main + ****************************************************************************/ + +int keypadtest_main(int argc, char *argv[]) +{ + char buffer[256]; + ssize_t nbytes; + int fd; + int ret; + + /* First, register the keyboard device(s) */ + + printf("keypadtest_main: Register keyboard device\n"); + ret = keypad_kbdinit(); + if (ret != OK) + { + printf("keypadtest_main: Failed to register the KBD class\n"); + fflush(stdout); + return 1; + } + + /* Open the configured keyboard device. */ + + printf("keypadtest_main: Opening device %s\n", CONFIG_EXAMPLES_KEYPAD_DEVNAME); + fd = open(CONFIG_EXAMPLES_KEYPAD_DEVNAME, O_RDONLY); + if (fd < 0) + { + printf("keypadtest_main: open() failed: %d\n", errno); + fflush(stdout); + return 1; + } + + printf("keypadtest_main: Device %s opened\n", CONFIG_EXAMPLES_KEYPAD_DEVNAME); + fflush(stdout); + + /* Loop until there is a read failure */ + + do + { + /* Read a buffer of data */ + + nbytes = read(fd, buffer, 256); + if (nbytes > 0) + { + /* On success, echo the buffer to stdout */ + + (void)write(1, buffer, nbytes); + } + } + while (nbytes >= 0); + + printf("keypadtest_main: Closing device %s: %d\n", CONFIG_EXAMPLES_KEYPAD_DEVNAME, (int)nbytes); + fflush(stdout); + close(fd); + return 0; +} diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 73c873f01..61a5a26d6 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3719,3 +3719,6 @@ * configs/z16f2800100zcog/ostest - Now supports a native Windows build (other ZNEO configs may also support the native build, but this has not been verfiied). + * include/nuttx/input/keypad.h, arch/arm/src/calypso/calypso_keypad.c, and + configs/compal_e99/nsh_highram: First cut at a standard keypad interface + definition. Contributed by Denis Carikli. diff --git a/nuttx/arch/arm/src/calypso/calypso_keypad.c b/nuttx/arch/arm/src/calypso/calypso_keypad.c index d7f8ec780..cdc22b286 100644 --- a/nuttx/arch/arm/src/calypso/calypso_keypad.c +++ b/nuttx/arch/arm/src/calypso/calypso_keypad.c @@ -369,3 +369,11 @@ void up_keypad(void) (void)register_driver("/dev/keypad", &keypad_ops, 0444, NULL); } + +int keypad_kbdinit(void) +{ + calypso_armio(); + up_keypad(); + + return OK; +} diff --git a/nuttx/configs/compal_e99/nsh_highram/appconfig b/nuttx/configs/compal_e99/nsh_highram/appconfig index db5e61236..dfe0be587 100644 --- a/nuttx/configs/compal_e99/nsh_highram/appconfig +++ b/nuttx/configs/compal_e99/nsh_highram/appconfig @@ -40,9 +40,8 @@ CONFIGURED_APPS += nshlib # Path to example in apps/examples -#CONFIGURED_APPS += examples/hello #fails not finding hello_main despite of good config CONFIGURED_APPS += system/poweroff -CONFIGURED_APPS += examples/ostest +CONFIGURED_APPS += examples/keypadtest CONFIGURED_APPS += examples/nxtext CONFIGURED_APPS += examples/nxhello CONFIGURED_APPS += examples/nxlines diff --git a/nuttx/configs/compal_e99/nsh_highram/defconfig b/nuttx/configs/compal_e99/nsh_highram/defconfig index 1f4d54a1c..1d405874e 100644 --- a/nuttx/configs/compal_e99/nsh_highram/defconfig +++ b/nuttx/configs/compal_e99/nsh_highram/defconfig @@ -245,6 +245,7 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIP=0x0a000001 # Settings for examples/nsh CONFIG_NSH_CONSOLE=y CONFIG_NSH_TELNET=n +CONFIG_NSH_DISABLE_HEXDUMP=n CONFIG_NSH_IOBUFFER_SIZE=512 CONFIG_NSH_CMD_SIZE=40 CONFIG_NSH_STACKSIZE=4096 diff --git a/nuttx/graphics/nxglib/nxglib_splitline.c b/nuttx/graphics/nxglib/nxglib_splitline.c index cbf2d5ff3..11658e149 100644 --- a/nuttx/graphics/nxglib/nxglib_splitline.c +++ b/nuttx/graphics/nxglib/nxglib_splitline.c @@ -197,7 +197,8 @@ int nxgl_splitline(FAR struct nxgl_vector_s *vector, abs(line.pt2.x - line.pt1.x) < (line.pt2.y - line.pt1.y)) { /* A close to vertical line of width 1 is basically - * a single parallelogram of width 1 */ + * a single parallelogram of width 1. + */ traps[1].top.x1 = itob16(line.pt1.x); traps[1].top.x2 = traps[1].top.x1; diff --git a/nuttx/include/nuttx/input/keypad.h b/nuttx/include/nuttx/input/keypad.h new file mode 100644 index 000000000..574b421c1 --- /dev/null +++ b/nuttx/include/nuttx/input/keypad.h @@ -0,0 +1,54 @@ +/************************************************************************************ + * include/nuttx/input/keypad.h + * + * Copyright (C) 2012 Denis Carikli. + * Author: Denis Carikli + * + * 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 __INCLUDE_NUTTX_INPUT_KEYPAD_H +#define __INCLUDE_NUTTX_INPUT_KEYPAD_H + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +int keypad_kbdinit(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __INCLUDE_NUTTX_INPUT_KEYPAD_H */ + -- cgit v1.2.3 From b0b339c2425dea83abd2065ed95dca2273011246 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 1 Dec 2012 16:32:03 +0000 Subject: Add one to internal result of random number generator to avoid the value zero, from Freddie Chopin git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5404 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 2 + nuttx/configs/sim/README.txt | 2 +- nuttx/libc/stdlib/lib_rand.c | 173 +++++++++++++++++++++---------------------- 3 files changed, 86 insertions(+), 91 deletions(-) (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 61a5a26d6..62937d4fe 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3722,3 +3722,5 @@ * include/nuttx/input/keypad.h, arch/arm/src/calypso/calypso_keypad.c, and configs/compal_e99/nsh_highram: First cut at a standard keypad interface definition. Contributed by Denis Carikli. + * libc/stdlib/lib_rand.c: Always add one to result congruential generators + to avoid the value zero. Suggested by Freddie Chopin. diff --git a/nuttx/configs/sim/README.txt b/nuttx/configs/sim/README.txt index c8bcb2cd7..032bb39b8 100644 --- a/nuttx/configs/sim/README.txt +++ b/nuttx/configs/sim/README.txt @@ -389,7 +389,7 @@ nx11 NOTES: - 1. If you do not have the call to sim_tcinitializE(0), the build + 1. If you do not have the call to sim_tcinitialize(0), the build will mysteriously fail claiming that is can't find up_tcenter() and up_tcleave(). That is a consequence of the crazy way that the simulation is built and can only be eliminated by calling diff --git a/nuttx/libc/stdlib/lib_rand.c b/nuttx/libc/stdlib/lib_rand.c index cb998fb12..caab36531 100644 --- a/nuttx/libc/stdlib/lib_rand.c +++ b/nuttx/libc/stdlib/lib_rand.c @@ -1,4 +1,4 @@ -/************************************************************ +/**************************************************************************** * libc/stdlib/lib_rand.c * * Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved. @@ -31,25 +31,21 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ -/************************************************************ - * Compilation Switches - ************************************************************/ - -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ #include #include -/************************************************************ - * Definitions - ************************************************************/ +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ #ifndef CONFIG_LIB_RAND_ORDER -#define CONFIG_LIB_RAND_ORDER 1 +# define CONFIG_LIB_RAND_ORDER 1 #endif /* Values needed by the random number generator */ @@ -65,20 +61,16 @@ #define RND3_CONSTP 997783 #if CONFIG_LIB_RAND_ORDER == 1 -# define RND_CONSTP RND1_CONSTP +# define RND_CONSTP RND1_CONSTP #elif CONFIG_LIB_RAND_ORDER == 2 -# define RND_CONSTP RND2_CONSTP +# define RND_CONSTP RND2_CONSTP #else -# define RND_CONSTP RND3_CONSTP +# define RND_CONSTP RND3_CONSTP #endif -/************************************************************ - * Private Type Declarations - ************************************************************/ - -/************************************************************ +/**************************************************************************** * Private Function Prototypes - ************************************************************/ + ****************************************************************************/ static unsigned int nrand(unsigned int nLimit); static double_t frand1(void); @@ -89,132 +81,133 @@ static double_t frand3(void); #endif #endif -/********************************************************** - * Global Constant Data - **********************************************************/ - -/************************************************************ - * Global Variables - ************************************************************/ - -/********************************************************** - * Private Constant Data - **********************************************************/ - -/************************************************************ - * Private Variables - ************************************************************/ +/**************************************************************************** + * Private Data + ****************************************************************************/ -static unsigned long g_nRandInt1; +static unsigned long g_randint1; #if (CONFIG_LIB_RAND_ORDER > 1) -static unsigned long g_nRandInt2; +static unsigned long g_randint2; #if (CONFIG_LIB_RAND_ORDER > 2) -static unsigned long g_nRandInt3; +static unsigned long g_randint3; #endif #endif -/************************************************************ +/**************************************************************************** * Private Functions - ************************************************************/ - + ****************************************************************************/ + static unsigned int nrand(unsigned int nLimit) { - unsigned long nResult; - double_t fRatio; + unsigned long result; + double_t ratio; /* Loop to be sure a legal random number is generated */ - do { - /* Get a random integer in the requested range */ + do + { + /* Get a random integer in the requested range */ + #if (CONFIG_LIB_RAND_ORDER == 1) - fRatio = frand1(); + ratio = frand1(); #elif (CONFIG_LIB_RAND_ORDER == 2) - fRatio = frand2(); + ratio = frand2(); #else - fRatio = frand3(); + ratio = frand3(); #endif - /* Then, produce the return-able value */ - nResult = (unsigned long)(((double_t)nLimit) * fRatio); + /* Then, produce the return-able value */ - } while (nResult >= (unsigned long)nLimit); + result = (unsigned long)(((double_t)nLimit) * ratio); + } + while (result >= (unsigned long)nLimit); - return (unsigned int)nResult; - -} /* end nrand */ + return (unsigned int)result; +} static double_t frand1(void) { - unsigned long nRandInt; + unsigned long randint; + + /* First order congruential generator. One is added to the result of the + * generated value to avoid the value zero which breaks the logic. + */ - /* First order congruential generator */ - nRandInt = (RND1_CONSTK * g_nRandInt1) % RND1_CONSTP; - g_nRandInt1 = nRandInt; + randint = (RND1_CONSTK * g_randint1) % RND1_CONSTP + 1; + g_randint1 = randint; /* Construct an floating point value in the range from 0.0 up to 1.0 */ - return ((double_t)nRandInt) / ((double_t)RND_CONSTP); -} /* end frand */ + return ((double_t)randint) / ((double_t)RND_CONSTP); +} #if (CONFIG_LIB_RAND_ORDER > 1) static double_t frand2(void) { - unsigned long nRandInt; + unsigned long randint; - /* Second order congruential generator */ - nRandInt = (RND2_CONSTK1 * g_nRandInt1 + RND2_CONSTK2 * g_nRandInt2) % - RND2_CONSTP; - g_nRandInt2 = g_nRandInt1; - g_nRandInt1 = nRandInt; + /* Second order congruential generator. One is added to the result of the + * generated value to avoid the value zero which breaks the logic. + */ + + randint = (RND2_CONSTK1 * g_randint1 + + RND2_CONSTK2 * g_randint2) % RND2_CONSTP + 1; + + g_randint2 = g_randint1; + g_randint1 = randint; /* Construct an floating point value in the range from 0.0 up to 1.0 */ - return ((double_t)nRandInt) / ((double_t)RND_CONSTP); -} /* end frand */ + return ((double_t)randint) / ((double_t)RND_CONSTP); + +} #if (CONFIG_LIB_RAND_ORDER > 2) static double_t frand3(void) { - unsigned long nRandInt; + unsigned long randint; + + /* Third order congruential generator. One is added to the result of the + * generated value to avoid the value zero which breaks the logic. + */ + + randint = (RND3_CONSTK1 * g_randint1 + + RND3_CONSTK2 * g_randint2 + + RND3_CONSTK2 * g_randint3) % RND3_CONSTP + 1; - /* Third order congruential generator */ - nRandInt = (RND3_CONSTK1 * g_nRandInt1 + RND3_CONSTK2 * g_nRandInt2 + - RND3_CONSTK2 * g_nRandInt3) % RND3_CONSTP; - g_nRandInt3 = g_nRandInt2; - g_nRandInt2 = g_nRandInt1; - g_nRandInt1 = nRandInt; + g_randint3 = g_randint2; + g_randint2 = g_randint1; + g_randint1 = randint; /* Construct an floating point value in the range from 0.0 up to 1.0 */ - return ((double_t)nRandInt) / ((double_t)RND_CONSTP); -} /* end frand */ + return ((double_t)randint) / ((double_t)RND_CONSTP); +} #endif #endif -/************************************************************ +/**************************************************************************** * Public Functions - ************************************************************/ -/************************************************************ + ****************************************************************************/ + +/**************************************************************************** * Function: srand, rand - ************************************************************/ + ****************************************************************************/ void srand(unsigned int seed) { - g_nRandInt1 = seed; + g_randint1 = seed; #if (CONFIG_LIB_RAND_ORDER > 1) - g_nRandInt2 = seed; + g_randint2 = seed; (void)frand1(); #if (CONFIG_LIB_RAND_ORDER > 2) - g_nRandInt3 = seed; + g_randint3 = seed; (void)frand2(); #endif #endif - -} /* end srand */ +} int rand(void) { return (int)nrand(32768); - -} /* end rand */ - +} -- cgit v1.2.3 From 6fa076a17125a2bf58ac7404fccfcea73494808e Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 1 Dec 2012 18:04:10 +0000 Subject: Correct some errors in lib_rand.c from last check-in git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5405 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/configs/sim/nx11/defconfig | 8 --- nuttx/libc/stdlib/lib_rand.c | 105 ++++++++++++++++++++++++++++----------- 2 files changed, 77 insertions(+), 36 deletions(-) (limited to 'nuttx') diff --git a/nuttx/configs/sim/nx11/defconfig b/nuttx/configs/sim/nx11/defconfig index 46b5cb414..0ac3362be 100644 --- a/nuttx/configs/sim/nx11/defconfig +++ b/nuttx/configs/sim/nx11/defconfig @@ -319,11 +319,3 @@ CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=8192 CONFIG_HEAP_BASE= CONFIG_HEAP_SIZE= - -# -# Maintain legacy build behavior (revisit) -# - -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y diff --git a/nuttx/libc/stdlib/lib_rand.c b/nuttx/libc/stdlib/lib_rand.c index caab36531..465cce47f 100644 --- a/nuttx/libc/stdlib/lib_rand.c +++ b/nuttx/libc/stdlib/lib_rand.c @@ -43,11 +43,17 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* First, second, and thired order congruential generators are supported */ #ifndef CONFIG_LIB_RAND_ORDER # define CONFIG_LIB_RAND_ORDER 1 #endif +#if CONFIG_LIB_RAND_ORDER > 3 +# undef CONFIG_LIB_RAND_ORDER +# define CONFIG_LIB_RAND_ORDER 3 +#endif + /* Values needed by the random number generator */ #define RND1_CONSTK 470001 @@ -60,23 +66,31 @@ #define RND3_CONSTK3 616087 #define RND3_CONSTP 997783 -#if CONFIG_LIB_RAND_ORDER == 1 -# define RND_CONSTP RND1_CONSTP -#elif CONFIG_LIB_RAND_ORDER == 2 -# define RND_CONSTP RND2_CONSTP -#else -# define RND_CONSTP RND3_CONSTP -#endif - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ static unsigned int nrand(unsigned int nLimit); + +/* First order congruential generators */ + +static inline void fgenerate1(void); +#if (CONFIG_LIB_RAND_ORDER == 1) static double_t frand1(void); +#endif + +/* Second order congruential generators */ + #if (CONFIG_LIB_RAND_ORDER > 1) +static inline void fgenerate2(void); +#if (CONFIG_LIB_RAND_ORDER == 2) static double_t frand2(void); +#endif + +/* Third order congruential generators */ + #if (CONFIG_LIB_RAND_ORDER > 2) +static inline void fgenerate3(void); static double_t frand3(void); #endif #endif @@ -112,7 +126,7 @@ static unsigned int nrand(unsigned int nLimit) ratio = frand1(); #elif (CONFIG_LIB_RAND_ORDER == 2) ratio = frand2(); -#else +#else /* if (CONFIG_LIB_RAND_ORDER > 2) */ ratio = frand3(); #endif @@ -125,50 +139,78 @@ static unsigned int nrand(unsigned int nLimit) return (unsigned int)result; } -static double_t frand1(void) +/* First order congruential generators */ + +static inline void fgenerate1(void) { unsigned long randint; - /* First order congruential generator. One is added to the result of the - * generated value to avoid the value zero which breaks the logic. + /* First order congruential generator. One may be added to the result of the + * generated value to avoid the value zero. This would be fatal for the + * first order random number generator. */ - randint = (RND1_CONSTK * g_randint1) % RND1_CONSTP + 1; - g_randint1 = randint; + randint = (RND1_CONSTK * g_randint1) % RND1_CONSTP; + g_randint1 = (randint == 0 ? 1 : randint); +} + +#if (CONFIG_LIB_RAND_ORDER == 1) +static double_t frand1(void) +{ + /* First order congruential generator. */ + + fgenerate1(); /* Construct an floating point value in the range from 0.0 up to 1.0 */ - return ((double_t)randint) / ((double_t)RND_CONSTP); + return ((double_t)g_randint1) / ((double_t)RND1_CONSTP); } +#endif + +/* Second order congruential generators */ #if (CONFIG_LIB_RAND_ORDER > 1) -static double_t frand2(void) +static inline void fgenerate2(void) { unsigned long randint; - /* Second order congruential generator. One is added to the result of the - * generated value to avoid the value zero which breaks the logic. + /* Second order congruential generator. One may be added to the result of the + * generated value to avoid the value zero (I am not sure if this is necessor + * for higher order random number generators or how this may effect the quality + * of the generated numbers). */ randint = (RND2_CONSTK1 * g_randint1 + RND2_CONSTK2 * g_randint2) % RND2_CONSTP + 1; g_randint2 = g_randint1; - g_randint1 = randint; + g_randint1 = (randint == 0 ? 1 : randint); +} - /* Construct an floating point value in the range from 0.0 up to 1.0 */ +#if (CONFIG_LIB_RAND_ORDER == 2) +static double_t frand2(void) +{ + /* Second order congruential generator */ - return ((double_t)randint) / ((double_t)RND_CONSTP); + fgenerate2(); + /* Construct an floating point value in the range from 0.0 up to 1.0 */ + + return ((double_t)g_randint1) / ((double_t)RND2_CONSTP); } +#endif + +/* Third order congruential generators */ #if (CONFIG_LIB_RAND_ORDER > 2) -static double_t frand3(void) +static inline void fgenerate3(void) { unsigned long randint; - /* Third order congruential generator. One is added to the result of the - * generated value to avoid the value zero which breaks the logic. + /* Third order congruential generator. One may be added to the result of the + * generated value to avoid the value zero (I am not sure if this is necessor + * for higher order random number generators or how this may effect the quality + * of the generated numbers). */ randint = (RND3_CONSTK1 * g_randint1 + @@ -177,11 +219,18 @@ static double_t frand3(void) g_randint3 = g_randint2; g_randint2 = g_randint1; - g_randint1 = randint; + g_randint1 = (randint == 0 ? 1 : randint); +} + +static double_t frand3(void) +{ + /* Third order congruential generator */ + + fgenerate3(); /* Construct an floating point value in the range from 0.0 up to 1.0 */ - return ((double_t)randint) / ((double_t)RND_CONSTP); + return ((double_t)g_randint1) / ((double_t)RND3_CONSTP); } #endif #endif @@ -199,10 +248,10 @@ void srand(unsigned int seed) g_randint1 = seed; #if (CONFIG_LIB_RAND_ORDER > 1) g_randint2 = seed; - (void)frand1(); + fgenerate1(); #if (CONFIG_LIB_RAND_ORDER > 2) g_randint3 = seed; - (void)frand2(); + fgenerate2(); #endif #endif } -- cgit v1.2.3 From 3f5c10515649b6925d063ae6e4a1eb3ba0abd8e5 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 1 Dec 2012 18:44:57 +0000 Subject: Another random number generator update git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5406 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/drivers/lcd/ug-2864ambag01.c | 2 +- nuttx/libc/stdlib/lib_rand.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'nuttx') diff --git a/nuttx/drivers/lcd/ug-2864ambag01.c b/nuttx/drivers/lcd/ug-2864ambag01.c index e133f3901..2a47b38eb 100644 --- a/nuttx/drivers/lcd/ug-2864ambag01.c +++ b/nuttx/drivers/lcd/ug-2864ambag01.c @@ -970,7 +970,7 @@ static int ug2864ambag01_setcontrast(struct lcd_dev_s *dev, unsigned int contras */ #if CONFIG_LCD_MAXCONTRAST != 255 - newcontrast = ((contrast << 8) - 1) / CONFIG_LCD_MAXCONTRAST; + scaled = ((contrast << 8) - 1) / CONFIG_LCD_MAXCONTRAST; #else scaled = contrast; #endif diff --git a/nuttx/libc/stdlib/lib_rand.c b/nuttx/libc/stdlib/lib_rand.c index 465cce47f..bbefaee5d 100644 --- a/nuttx/libc/stdlib/lib_rand.c +++ b/nuttx/libc/stdlib/lib_rand.c @@ -175,13 +175,13 @@ static inline void fgenerate2(void) unsigned long randint; /* Second order congruential generator. One may be added to the result of the - * generated value to avoid the value zero (I am not sure if this is necessor + * generated value to avoid the value zero (I am not sure if this is necessary * for higher order random number generators or how this may effect the quality * of the generated numbers). */ randint = (RND2_CONSTK1 * g_randint1 + - RND2_CONSTK2 * g_randint2) % RND2_CONSTP + 1; + RND2_CONSTK2 * g_randint2) % RND2_CONSTP; g_randint2 = g_randint1; g_randint1 = (randint == 0 ? 1 : randint); @@ -208,14 +208,14 @@ static inline void fgenerate3(void) unsigned long randint; /* Third order congruential generator. One may be added to the result of the - * generated value to avoid the value zero (I am not sure if this is necessor + * generated value to avoid the value zero (I am not sure if this is necessary * for higher order random number generators or how this may effect the quality * of the generated numbers). */ randint = (RND3_CONSTK1 * g_randint1 + RND3_CONSTK2 * g_randint2 + - RND3_CONSTK2 * g_randint3) % RND3_CONSTP + 1; + RND3_CONSTK2 * g_randint3) % RND3_CONSTP; g_randint3 = g_randint2; g_randint2 = g_randint1; -- cgit v1.2.3 From d128c03666021694c4d2d969061599014f6515c7 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 2 Dec 2012 17:34:08 +0000 Subject: Fix the fat, flat line bug git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5407 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 3 + nuttx/graphics/nxglib/nxglib_splitline.c | 381 +++++++++++++++++++++++-------- nuttx/include/nuttx/vt100.h | 4 +- nuttx/libc/stdlib/lib_rand.c | 34 ++- nuttx/tools/Makefile.host | 20 +- nuttx/tools/b16.c | 121 ++++++++++ nuttx/tools/cfgparser.c | 2 +- 7 files changed, 451 insertions(+), 114 deletions(-) create mode 100644 nuttx/tools/b16.c (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 62937d4fe..6225ab2fb 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3724,3 +3724,6 @@ definition. Contributed by Denis Carikli. * libc/stdlib/lib_rand.c: Always add one to result congruential generators to avoid the value zero. Suggested by Freddie Chopin. + * tools/b16.c: Fixed precision math conversion utility. + * graphics/nxglib/nxglib_splitlinex.c: Fix the "fat, flat line bug" + diff --git a/nuttx/graphics/nxglib/nxglib_splitline.c b/nuttx/graphics/nxglib/nxglib_splitline.c index 11658e149..fa2ccc1a0 100644 --- a/nuttx/graphics/nxglib/nxglib_splitline.c +++ b/nuttx/graphics/nxglib/nxglib_splitline.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxglib/nxglib_splitline.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -49,12 +50,16 @@ * Pre-Processor Definitions ****************************************************************************/ -#define SMALL_SIN 1966 /* 1966/65536 = 0.03 */ - /**************************************************************************** * Private Types ****************************************************************************/ +struct b16point_s +{ + b16_t x; + b16_t y; +}; + /**************************************************************************** * Private Data ****************************************************************************/ @@ -67,6 +72,12 @@ * Private Functions ****************************************************************************/ +static b16_t nxgl_interpolate(b16_t x, b16_t dy, b16_t dxdy) +{ + b16_t dx = b16mulb16(dy, dxdy); + return x + dx; +} + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -117,15 +128,19 @@ int nxgl_splitline(FAR struct nxgl_vector_s *vector, struct nxgl_vector_s line; nxgl_coord_t iheight; nxgl_coord_t iwidth; - nxgl_coord_t iy; - nxgl_coord_t triheight; - nxgl_coord_t halfheight; - b16_t adjwidth; - b16_t xoffset; - b16_t halfoffset; + nxgl_coord_t iyoffset; + struct b16point_s quad[4]; + b16_t b16xoffset; + b16_t b16yoffset; + b16_t b16dxdy; b16_t angle; + b16_t cosangle; b16_t sinangle; b16_t b16x; + b16_t b16y; + + gvdbg("vector: (%d,%d)->(%d,%d) linewidth: %d\n", + vector->pt1.x, vector->pt1.y, vector->pt2.x, vector->pt2.y, linewidth); /* First, check the linewidth */ @@ -153,7 +168,7 @@ int nxgl_splitline(FAR struct nxgl_vector_s *vector, line.pt2.x = vector->pt1.x; line.pt2.y = vector->pt1.y; } - else + else /* if (vector->pt1.y == vector->pt2.y) */ { /* First degenerate case: The line is horizontal. */ @@ -174,6 +189,10 @@ int nxgl_splitline(FAR struct nxgl_vector_s *vector, rect->pt1.y = vector->pt1.y - (linewidth >> 1); rect->pt2.y = rect->pt1.y + linewidth - 1; + + gvdbg("Horizontal rect: (%d,%d),(%d,%d)\n", + rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y); + return 2; } @@ -188,6 +207,10 @@ int nxgl_splitline(FAR struct nxgl_vector_s *vector, rect->pt1.x = line.pt1.x - (linewidth >> 1); rect->pt2.x = rect->pt1.x + linewidth - 1; + + gvdbg("Vertical rect: (%d,%d),(%d,%d)\n", + rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y); + return 2; } @@ -207,6 +230,11 @@ int nxgl_splitline(FAR struct nxgl_vector_s *vector, traps[1].bot.x1 = itob16(line.pt2.x); traps[1].bot.x2 = traps[1].bot.x1; traps[1].bot.y = line.pt2.y; + + gvdbg("Vertical traps[1]: (%08x,%08x,%d),(%08x,%08x, %d)\n", + traps[1].top.x1, traps[1].top.x2, traps[1].top.y, + traps[1].bot.x1, traps[1].bot.x2, traps[1].bot.y); + return 1; } @@ -226,103 +254,260 @@ int nxgl_splitline(FAR struct nxgl_vector_s *vector, iwidth = line.pt1.x - line.pt2.x + 1; } - /* Triangle height: linewidth * cosA - * Adjusted width: triheight / sinA - * X offset : linewidth * linewidth / adjusted line width + /* Applying the line width to the line results in a rotated, rectangle. + * Get the Y offset from an end of the original thin line to a corner of the fat line. + * + * Angle of line: angle = atan2(iheight, iwidth) + * Y offset from line: b16yoffset = linewidth * cos(angle) + * + * For near verical lines, b16yoffset is be nearly zero. For near horizontal + * lines, b16yOffset is be about the same as linewidth. */ - angle = b16atan2(itob16(iheight), itob16(iwidth)); - triheight = b16toi(linewidth * b16cos(angle) + b16HALF); - halfheight = (triheight >> 1); + angle = b16atan2(itob16(iheight), itob16(iwidth)); + cosangle = b16cos(angle); + b16yoffset = (linewidth * cosangle + 1) >> 1; - /* If the sine of the angle is tiny (i.e., the line is nearly horizontal), - * then we cannot compute the adjusted width. In this case, just use - * the width of the line bounding box. + /* Get the X offset from an end of the original thin line to a corner of the fat line. + * + * For near vertical lines, b16xoffset is about the same as linewidth. For near + * horizontal lines, b16xoffset is nearly zero. */ - sinangle = b16sin(angle); - if (sinangle < SMALL_SIN) - { - adjwidth = itob16(iwidth); - xoffset = 0; - } - else - { - adjwidth = b16divb16(itob16(linewidth), sinangle); - xoffset = itob16(linewidth * linewidth); - xoffset = b16divb16(xoffset, adjwidth); - } + sinangle = b16sin(angle); + b16xoffset = (linewidth * sinangle + 1) >> 1; - halfoffset = (xoffset >> 1); + gvdbg("height: %d width: %d angle: %08x b16yoffset: %08x b16xoffset: %08x\n", + iheight, iwidth, angle, b16yoffset, b16xoffset); - /* Return the top triangle (if there is one). NOTE that the horizontal - * (z) positions are represented with 16 bits of fraction. The vertical - * (y) positions, on the other hand, are integer. - */ + /* Now we know all four points of the rotated rectangle */ - if (triheight > 0) + iyoffset = b16toi(b16yoffset + b16HALF); + if (iyoffset > 0) { + /* Get the Y positions of each point */ + + b16y = itob16(line.pt1.y); + quad[0].y = b16y - b16yoffset; + quad[1].y = b16y + b16yoffset; + + b16y = itob16(line.pt2.y); + quad[2].y = b16y - b16yoffset; + quad[3].y = b16y + b16yoffset; + if (line.pt1.x < line.pt2.x) { - /* Line is going "south east" */ - - b16x = itob16(line.pt1.x) - halfoffset; - iy = line.pt1.y + halfheight; - - traps[0].top.x1 = b16x + xoffset; - traps[0].top.x2 = traps[0].top.x1; - traps[0].top.y = iy - triheight + 1; - traps[0].bot.x1 = b16x; - traps[0].bot.x2 = b16x + adjwidth - b16ONE; - traps[0].bot.y = iy; - - b16x = itob16(line.pt2.x) + halfoffset; - iy = line.pt2.y - halfheight; - - traps[2].top.x1 = b16x - adjwidth + b16ONE; - traps[2].top.x2 = b16x; - traps[2].top.y = iy; - traps[2].bot.x1 = b16x - xoffset; - traps[2].bot.x2 = traps[2].bot.x1; - traps[2].bot.y = iy + triheight - 1; + /* Line is going "south east". Get the X positions of each point */ + + b16x = itob16(line.pt1.x); + quad[0].x = b16x + b16xoffset; + quad[1].x = b16x - b16xoffset; + + b16x = itob16(line.pt2.x); + quad[2].x = b16x + b16xoffset; + quad[3].x = b16x - b16xoffset; + + gvdbg("Southeast: quad (%08x,%08x),(%08x,%08x),(%08x,%08x),(%08x,%08x)\n", + quad[0].x, quad[0].y, quad[1].x, quad[1].y, + quad[2].x, quad[2].y, quad[3].x, quad[3].y); + + /* Now we can form the trapezoids. The top of the first trapezoid + * (triangle) is at quad[0] + */ + + traps[0].top.x1 = quad[0].x; + traps[0].top.x2 = quad[0].x; + traps[0].top.y = b16toi(quad[0].y + b16HALF); + + /* The bottom of the first trapezoid (triangle) may be either at + * quad[1] or quad[2], depending upon orientation. + */ + + if (quad[1]. y < quad[2].y) + { + /* quad[1] is at the bottom left of the triangle. Interpolate + * to get the corresponding point on the right side. + * + * Interpolation is from quad[0] along the line quad[0]->quad[2] + * which as the same slope as the line (positive) + */ + + b16dxdy = itob16(iwidth) / iheight; + + traps[0].bot.x1 = quad[1].x; + traps[0].bot.x2 = nxgl_interpolate(quad[0].x, quad[1].y - quad[0].y, b16dxdy); + traps[0].bot.y = b16toi(quad[1].y + b16HALF); + + /* quad[1] is at the top left of the second trapezoid. quad[2} is + * at the bottom right of the second trapezoid. Interpolate to get + * corresponding point on the left side. + * + * Interpolation is from quad[1] along the line quad[1]->quad[3] + * which as the same slope as the line (positive) + */ + + traps[1].top.x1 = traps[0].bot.x1; + traps[1].top.x2 = traps[0].bot.x2; + traps[1].top.y = traps[0].bot.y; + + traps[1].bot.x1 = nxgl_interpolate(traps[1].top.x1, quad[2].y - quad[1].y, b16dxdy); + traps[1].bot.x2 = quad[2].x; + traps[1].bot.y = b16toi(quad[2].y + b16HALF); + } + else + { + /* quad[2] is at the bottom right of the triangle. Interpolate + * to get the corresponding point on the left side. + * + * Interpolation is from quad[0] along the line quad[0]->quad[1] + * which orthogonal to the slope of the line (and negative) + */ + + b16dxdy = -itob16(iheight) / iwidth; + + traps[0].bot.x1 = nxgl_interpolate(quad[0].x, quad[2].y - quad[0].y, b16dxdy); + traps[0].bot.x2 = quad[2].x; + traps[0].bot.y = b16toi(quad[2].y + b16HALF); + + /* quad[2] is at the top right of the second trapezoid. quad[1} is + * at the bottom left of the second trapezoid. Interpolate to get + * corresponding point on the right side. + * + * Interpolation is from quad[2] along the line quad[2]->quad[3] + * which as the same slope as the previous interpolation. + */ + + traps[1].top.x1 = traps[0].bot.x1; + traps[1].top.x2 = traps[0].bot.x2; + traps[1].top.y = traps[0].bot.y; + + traps[1].bot.x1 = quad[1].x; + traps[1].bot.x2 = nxgl_interpolate(traps[1].top.x2, quad[1].y - quad[2].y, b16dxdy); + traps[1].bot.y = b16toi(quad[1].y + b16HALF); + } + + /* The final trapezond (triangle) at the bottom is new well defined */ + + traps[2].top.x1 = traps[1].bot.x1; + traps[2].top.x2 = traps[1].bot.x2; + traps[2].top.y = traps[1].bot.y; + + traps[2].bot.x1 = quad[3].x; + traps[2].bot.x2 = quad[3].x; + traps[2].bot.y = b16toi(quad[3].y + b16HALF); } else { - /* Line is going "south west" */ - - b16x = itob16(line.pt1.x) + halfoffset; - iy = line.pt1.y + halfheight; - - traps[0].top.x1 = b16x - xoffset; - traps[0].top.x2 = traps[0].top.x1; - traps[0].top.y = iy - triheight + 1; - traps[0].bot.x1 = b16x - adjwidth + b16ONE; - traps[0].bot.x2 = b16x; - traps[0].bot.y = iy; - - b16x = itob16(line.pt2.x) - halfoffset; - iy = line.pt2.y - halfheight; - - traps[2].top.x1 = b16x; - traps[2].top.x2 = b16x + adjwidth - b16ONE; - traps[2].top.y = iy; - traps[2].bot.x1 = b16x + xoffset; - traps[2].bot.x2 = traps[2].bot.x1; - traps[2].bot.y = iy + triheight - 1; + /* Get the X positions of each point */ + + b16x = itob16(line.pt1.x); + quad[0].x = b16x - b16xoffset; + quad[1].x = b16x + b16xoffset; + + b16x = itob16(line.pt2.x); + quad[2].x = b16x - b16xoffset; + quad[3].x = b16x + b16xoffset; + + gvdbg("Southwest: quad (%08x,%08x),(%08x,%08x),(%08x,%08x),(%08x,%08x)\n", + quad[0].x, quad[0].y, quad[1].x, quad[1].y, + quad[2].x, quad[2].y, quad[3].x, quad[3].y); + + /* Now we can form the trapezoids. The top of the first trapezoid + * (triangle) is at quad[0] + */ + + traps[0].top.x1 = quad[0].x; + traps[0].top.x2 = quad[0].x; + traps[0].top.y = b16toi(quad[0].y + b16HALF); + + /* The bottom of the first trapezoid (triangle) may be either at + * quad[1] or quad[2], depending upon orientation. + */ + + if (quad[1].y < quad[2].y) + { + /* quad[1] is at the bottom right of the triangle. Interpolate + * to get the corresponding point on the left side. + * + * Interpolation is from quad[0] along the line quad[0]->quad[2] + * which as the same slope as the line (negative) + */ + + b16dxdy = -itob16(iwidth) / iheight; + + traps[0].bot.x1 = nxgl_interpolate(traps[0].top.x1, quad[1].y - quad[0].y, b16dxdy); + traps[0].bot.x2 = quad[1].x; + traps[0].bot.y = b16toi(quad[1].y + b16HALF); + + /* quad[1] is at the top right of the second trapezoid. quad[2} is + * at the bottom left of the second trapezoid. Interpolate to get + * corresponding point on the right side. + * + * Interpolation is from quad[1] along the line quad[1]->quad[3] + * which as the same slope as the line (negative) + */ + + traps[1].top.x1 = traps[0].bot.x1; + traps[1].top.x2 = traps[0].bot.x2; + traps[1].top.y = traps[0].bot.y; + + traps[1].bot.x1 = quad[2].x; + traps[1].bot.x2 = nxgl_interpolate(traps[1].top.x2, quad[2].y - quad[1].y, b16dxdy); + traps[1].bot.y = b16toi(quad[2].y + b16HALF); + } + else + { + /* quad[2] is at the bottom left of the triangle. Interpolate + * to get the corresponding point on the right side. + * + * Interpolation is from quad[0] along the line quad[0]->quad[1] + * which orthogonal to the slope of the line (and positive) + */ + + b16dxdy = itob16(iheight) / iwidth; + + traps[0].bot.x1 = quad[2].x; + traps[0].bot.x2 = nxgl_interpolate(traps[0].top.x2, quad[2].y - quad[0].y, b16dxdy); + traps[0].bot.y = b16toi(quad[2].y + b16HALF); + + /* quad[2] is at the top left of the second trapezoid. quad[1} is + * at the bottom right of the second trapezoid. Interpolate to get + * corresponding point on the left side. + * + * Interpolation is from quad[2] along the line quad[2]->quad[3] + * which as the same slope as the previous interpolation. + */ + + traps[1].top.x1 = traps[0].bot.x1; + traps[1].top.x2 = traps[0].bot.x2; + traps[1].top.y = traps[0].bot.y; + + traps[1].bot.x1 = nxgl_interpolate(traps[1].top.x1, quad[1].y - quad[2].y, b16dxdy); + traps[1].bot.x2 = quad[1].x; + traps[1].bot.y = b16toi(quad[1].y + b16HALF); + } + + /* The final trapezond (triangle) at the bottom is new well defined */ + + traps[2].top.x1 = traps[1].bot.x1; + traps[2].top.x2 = traps[1].bot.x2; + traps[2].top.y = traps[1].bot.y; + + traps[2].bot.x1 = quad[3].x; + traps[2].bot.x2 = quad[3].x; + traps[2].bot.y = b16toi(quad[3].y + b16HALF); } - /* The center parallelogram is the horizontal edge of each triangle. - * Note the minor inefficency: that horizontal edges are drawn twice. - */ + gvdbg("traps[0]: (%08x,%08x,%d),(%08x,%08x,%d)\n", + traps[0].top.x1, traps[0].top.x2, traps[0].top.y, + traps[0].bot.x1, traps[0].bot.x2, traps[0].bot.y); + gvdbg("traps[1]: (%08x,%08x,%d),(%08x,%08x,%d)\n", + traps[1].top.x1, traps[1].top.x2, traps[1].top.y, + traps[1].bot.x1, traps[1].bot.x2, traps[1].bot.y); + gvdbg("traps[2]: (%08x,%08x,%d),(%08x,%08x,%d)\n", + traps[2].top.x1, traps[2].top.x2, traps[2].top.y, + traps[2].bot.x1, traps[2].bot.x2, traps[2].bot.y); - traps[1].top.x1 = traps[0].bot.x1; - traps[1].top.x2 = traps[0].bot.x2; - traps[1].top.y = traps[0].bot.y; - - traps[1].bot.x1 = traps[2].top.x1; - traps[1].bot.x2 = traps[2].top.x2; - traps[1].bot.y = traps[2].top.y; - return 0; } @@ -330,12 +515,18 @@ int nxgl_splitline(FAR struct nxgl_vector_s *vector, * bottom. Just return the center parallelogram. */ - traps[1].top.x1 = itob16(line.pt1.x) - halfoffset; - traps[1].top.x2 = traps[1].top.x1 + adjwidth - 1; + traps[1].top.x1 = itob16(line.pt1.x - (linewidth >> 1)); + traps[1].top.x2 = traps[1].top.x1 + itob16(linewidth - 1); traps[1].top.y = line.pt1.y; - - traps[1].bot.x1 = itob16(line.pt2.x) - halfoffset; - traps[1].bot.x2 = traps[1].bot.x1 + adjwidth - 1; + + traps[1].bot.x1 = itob16(line.pt2.x - (linewidth >> 1)); + traps[1].bot.x2 = traps[1].bot.x1 + itob16(linewidth - 1); traps[1].bot.y = line.pt2.y; + + gvdbg("Horizontal traps[1]: (%08x,%08x,%d),(%08x,%08x, %d)\n", + traps[1].top.x1, traps[1].top.x2, traps[1].top.y, + traps[1].bot.x1, traps[1].bot.x2, traps[1].bot.y); + return 1; } + diff --git a/nuttx/include/nuttx/vt100.h b/nuttx/include/nuttx/vt100.h index d834f48f0..32344a1de 100644 --- a/nuttx/include/nuttx/vt100.h +++ b/nuttx/include/nuttx/vt100.h @@ -179,8 +179,8 @@ #define VT52_CLEAREOL {ASCII_ESC, 'K'} /* Erase to end of current line */ #define VT52_CLEAREOS {ASCII_ESC, 'J'} /* Erase to end of screen */ -#define VT52_IDENT {ASCII_ESC, 'Z'} /* dentify what the terminal is */ -#define VT52_IDENTRESP {ASCII_ESC, '/', 'Z'} /* Correct response to ident */ +#define VT52_IDENT {ASCII_ESC, 'Z'} /* Identify what the terminal is */ +#define VT52_IDENTRESP {ASCII_ESC, '/', 'Z'} /* Correct response to ident */ /* VT100 Special Key Codes * diff --git a/nuttx/libc/stdlib/lib_rand.c b/nuttx/libc/stdlib/lib_rand.c index bbefaee5d..0faef5d66 100644 --- a/nuttx/libc/stdlib/lib_rand.c +++ b/nuttx/libc/stdlib/lib_rand.c @@ -174,17 +174,22 @@ static inline void fgenerate2(void) { unsigned long randint; - /* Second order congruential generator. One may be added to the result of the - * generated value to avoid the value zero (I am not sure if this is necessary - * for higher order random number generators or how this may effect the quality - * of the generated numbers). - */ + /* Second order congruential generator. */ randint = (RND2_CONSTK1 * g_randint1 + RND2_CONSTK2 * g_randint2) % RND2_CONSTP; g_randint2 = g_randint1; - g_randint1 = (randint == 0 ? 1 : randint); + g_randint1 = randint; + + /* We cannot permit both values to become zero. That would be fatal for the + * second order random number generator. + */ + + if (g_randint2 == 0 && g_randint1 == 0) + { + g_randint2 = 1; + } } #if (CONFIG_LIB_RAND_ORDER == 2) @@ -207,11 +212,7 @@ static inline void fgenerate3(void) { unsigned long randint; - /* Third order congruential generator. One may be added to the result of the - * generated value to avoid the value zero (I am not sure if this is necessary - * for higher order random number generators or how this may effect the quality - * of the generated numbers). - */ + /* Third order congruential generator. */ randint = (RND3_CONSTK1 * g_randint1 + RND3_CONSTK2 * g_randint2 + @@ -219,7 +220,16 @@ static inline void fgenerate3(void) g_randint3 = g_randint2; g_randint2 = g_randint1; - g_randint1 = (randint == 0 ? 1 : randint); + g_randint1 = randint; + + /* We cannot permit all three values to become zero. That would be fatal for the + * third order random number generator. + */ + + if (g_randint3 == 0 && g_randint2 == 0 && g_randint1 == 0) + { + g_randint3 = 1; + } } static double_t frand3(void) diff --git a/nuttx/tools/Makefile.host b/nuttx/tools/Makefile.host index a661424dc..4a46901e6 100644 --- a/nuttx/tools/Makefile.host +++ b/nuttx/tools/Makefile.host @@ -44,11 +44,14 @@ ifneq ($(CONFIG_WINDOWS_NATIVE),y) HOSTCFLAGS += -D HAVE_STRTOK_C endif -all: mkconfig$(HOSTEXEEXT) mkversion$(HOSTEXEEXT) mksyscall$(HOSTEXEEXT) bdf-converter$(HOSTEXEEXT) mksymtab$(HOSTEXEEXT) mkdeps$(HOSTEXEEXT) +all: b16$(HOSTEXEEXT) bdf-converter$(HOSTEXEEXT) cmpconfig$(HOSTEXEEXT) \ + mkconfig$(HOSTEXEEXT) mkdeps$(HOSTEXEEXT) mksymtab$(HOSTEXEEXT) \ + mksyscall$(HOSTEXEEXT) mkversion$(HOSTEXEEXT) default: mkconfig$(HOSTEXEEXT) mksyscall$(HOSTEXEEXT) mkdeps$(HOSTEXEEXT) ifdef HOSTEXEEXT -.PHONY: clean mkconfig mkversion mksyscall bdf-converter mksymtab mkdeps +.PHONY: b16 bdf-converter cmpconfig clean mkconfig mkdeps mksymtab \ + mksyscall mkversion else .PHONY: clean endif @@ -58,6 +61,15 @@ endif HOSTCFLAGS ?= -O2 -Wall -I. HOSTCC ?= gcc +# b16 - Fixed precision math converstion tool + +b16$(HOSTEXEEXT): b16.c + $(Q) $(HOSTCC) $(HOSTCFLAGS) -o b16$(HOSTEXEEXT) b16.c + +ifdef HOSTEXEEXT +b16: b16$(HOSTEXEEXT) +endif + # mkconfig - Convert a .config file into a C config.h file mkconfig$(HOSTEXEEXT): mkconfig.c cfgparser.c @@ -69,8 +81,8 @@ endif # cmpconfig - Compare the contents of two configuration files -cmpconfig: cmpconfig.c - $(Q) $(HOSTCC) $(HOSTCFLAGS) -o cmpconfig cmpconfig.c +cmpconfig$(HOSTEXEEXT): cmpconfig.c + $(Q) $(HOSTCC) $(HOSTCFLAGS) -o cmpconfig$(HOSTEXEEXT) cmpconfig.c ifdef HOSTEXEEXT cmpconfig: cmpconfig$(HOSTEXEEXT) diff --git a/nuttx/tools/b16.c b/nuttx/tools/b16.c new file mode 100644 index 000000000..66d581ffa --- /dev/null +++ b/nuttx/tools/b16.c @@ -0,0 +1,121 @@ +/**************************************************************************** + * tools/b16.c + * + * Copyright (C) 2007-2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static void show_usage(const char *progname) +{ + fprintf(stderr, "\nUSAGE: %s |\n", progname); + fprintf(stderr, "\nWhere:\n"); + fprintf(stderr, " :\n"); + fprintf(stderr, " A b16 fixed precision value in hexadecimal form: E.g., 0x00010000\n"); + fprintf(stderr, " Any value begininning with '0' will assumed by be hexadecimal format\n"); + fprintf(stderr, " :\n"); + fprintf(stderr, " A floating value in standard form: E.g., 5.1\n"); + exit(EXIT_FAILURE); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int main(int argc, char **argv, char **envp) +{ + double fvalue; + unsigned long ulvalue; + long lvalue; + const char *str; + char *endptr; + + /* There must be exactly one argument */ + + if (argc != 2) + { + fprintf(stderr, "\nExpected a single argument\n"); + show_usage(argv[0]); + } + str = argv[1]; + + /* If the value begins with a zero, we will assume that it is a hexadecimal + * representation. + */ + + if (str[0] == '0') + { + endptr = NULL; + ulvalue = strtoul(str, &endptr, 16); + if (!endptr || *endptr != '\0') + { + fprintf(stderr, "\nHexadecimal argument not fully converted\n"); + show_usage(argv[0]); + } + + if (ulvalue >= 0x80000000) + { + lvalue = ~ulvalue + 1; + } + else + { + lvalue = ulvalue; + } + + fvalue = ((double)lvalue) / 65536.0; + printf("0x%08lx -> %10.5f\n", ulvalue, fvalue); + } + else + { + endptr = NULL; + fvalue = strtod(str, &endptr); + if (!endptr || *endptr != '\0') + { + fprintf(stderr, "\nFloating point argument not fully converted\n"); + show_usage(argv[0]); + } + + lvalue = 65536.0 * fvalue; + printf("%10.5f -> 0x%08lx\n", fvalue, lvalue); + } + + return 0; +} diff --git a/nuttx/tools/cfgparser.c b/nuttx/tools/cfgparser.c index b1f189f6f..1a35f7857 100644 --- a/nuttx/tools/cfgparser.c +++ b/nuttx/tools/cfgparser.c @@ -2,7 +2,7 @@ * tools/cfgpaser.c * * Copyright (C) 2007-2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <> + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions -- cgit v1.2.3 From 995d13a48449cf4e153693a6086d77bb14aa809d Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 3 Dec 2012 14:13:23 +0000 Subject: Add dummy Toolchain.defs files for z80 arch family git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5408 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/avr/src/avr32/Toolchain.defs | 5 +++ nuttx/arch/z80/src/ez80/Toolchain.defs | 47 +++++++++++++++++++++ nuttx/arch/z80/src/z8/Toolchain.defs | 47 +++++++++++++++++++++ nuttx/arch/z80/src/z80/Toolchain.defs | 75 +++++++++++++++++++++++++++++++++ nuttx/configs/xtrs/README.txt | 22 +++++++++- nuttx/configs/z80sim/README.txt | 20 +++++++++ 6 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 nuttx/arch/z80/src/ez80/Toolchain.defs create mode 100644 nuttx/arch/z80/src/z8/Toolchain.defs create mode 100644 nuttx/arch/z80/src/z80/Toolchain.defs (limited to 'nuttx') diff --git a/nuttx/arch/avr/src/avr32/Toolchain.defs b/nuttx/arch/avr/src/avr32/Toolchain.defs index 6a4b1234e..b45abadc1 100644 --- a/nuttx/arch/avr/src/avr32/Toolchain.defs +++ b/nuttx/arch/avr/src/avr32/Toolchain.defs @@ -39,6 +39,11 @@ # Since all of the supported toolchains are variants of the Atmel-patched # GCC, the only interesting question to answer here is whether or not # the build is hosted on Windows, and how to override the configuration. +# +# NOTE: There is a logic error in the following: CONFIG_HOST_WINDOWS means +# that we are operating on a Windows platform. But in the case where we +# have an AVR32 toolchain built under Cygwin, the correct setting would be +# GNU, not AVRTOOLSW. # CROSSDEV = avr32- diff --git a/nuttx/arch/z80/src/ez80/Toolchain.defs b/nuttx/arch/z80/src/ez80/Toolchain.defs new file mode 100644 index 000000000..483bc84e7 --- /dev/null +++ b/nuttx/arch/z80/src/ez80/Toolchain.defs @@ -0,0 +1,47 @@ +############################################################################ +# arch/z80/src/ez80/Toolchain.defs +# +# Copyright (C) 2012 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. +# +############################################################################ + +# Setup for the selected toolchain + +# +# The ZiLOG ZDS-II Windows toolchain is the only toolchain available for +# the ez80. +# + +CONFIG_EZ80_TOOLCHAIN ?= ZDSII + +ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y +endif diff --git a/nuttx/arch/z80/src/z8/Toolchain.defs b/nuttx/arch/z80/src/z8/Toolchain.defs new file mode 100644 index 000000000..a5f139eb5 --- /dev/null +++ b/nuttx/arch/z80/src/z8/Toolchain.defs @@ -0,0 +1,47 @@ +############################################################################ +# arch/z80/src/z8/Toolchain.defs +# +# Copyright (C) 2012 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. +# +############################################################################ + +# Setup for the selected toolchain + +# +# The ZiLOG ZDS-II Windows toolchain is the only toolchain available for +# the z8. +# + +CONFIG_Z8_TOOLCHAIN ?= ZDSII + +ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y +endif diff --git a/nuttx/arch/z80/src/z80/Toolchain.defs b/nuttx/arch/z80/src/z80/Toolchain.defs new file mode 100644 index 000000000..9c262f593 --- /dev/null +++ b/nuttx/arch/z80/src/z80/Toolchain.defs @@ -0,0 +1,75 @@ +############################################################################ +# arch/z80/src/z80/Toolchain.defs +# +# Copyright (C) 2012 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. +# +############################################################################ + +# Setup for the selected toolchain + +# +# SDCC is currently the only z80 toolchain supported. See +# http://sdcc.sourceforge.net/. Source and pre-built SDCC binaries can be +# downloaded from the SDCC SourceForge site: +# http://sourceforge.net/projects/sdcc/files/. Pre-built binaries are +# available for Linux, MAC OSX, and for Win32. In addition, SDCC can be +# built to run on Windows as a POSIX toolchain. The various SDCC options are +# selected in the NuttX configuration with: +# +# CONFIG_SDCC_POSIX=y : SDCC for Linux, MAC OSX or Cygwin +# CONFIG_SDCC_WINDOWS=y : SDCC for Win32 +# + +ifeq ($(filter y, \ + $(CONFIG_SDCC_POSIX) \ + ),y) + CONFIG_Z80_TOOLCHAIN ?= POSIX +endif +ifeq ($(filter y, \ + $(CONFIG_SDCC_WINDOWS) \ + ),y) + CONFIG_Z80_TOOLCHAIN ?= WINDOWS +endif + +# SDCC toolchain under Linux, MAC OSX or Cygwin + +ifeq ($(CONFIG_Z80_TOOLCHAIN),POSIX) +endif + +# SDCC toolchain under Windows/Cygwin + +ifeq ($(CONFIG_AVR_TOOLCHAIN),WINAVR) + ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y + endif +endif + + diff --git a/nuttx/configs/xtrs/README.txt b/nuttx/configs/xtrs/README.txt index ecd44e4e2..08f3fbea1 100644 --- a/nuttx/configs/xtrs/README.txt +++ b/nuttx/configs/xtrs/README.txt @@ -12,6 +12,7 @@ Contents o Getting a TRS80 emulator and DOS disks o Loading an executable into xtrs o Configuring NuttX + o SDCC o Building the SDCC toolchain o SDCC Update o Newer SDCC Versions @@ -47,6 +48,7 @@ Configuring NuttX ^^^^^^^^^^^^^^^^^ ostest + This configuration performs a simple, minimal OS test using examples/ostest. This can be configurated as follows: @@ -56,6 +58,7 @@ Configuring NuttX . ./setenv.sh nsh + This configuration file builds NSH (examples/nsh). This configuration is not functional due to issues with use of the simulated serial driver (see the TODO list). @@ -67,7 +70,8 @@ Configuring NuttX cd - . ./setenv.sh - pashello + pashello + Configures to use examples/pashello for execution from FLASH See examples/README.txt for information about pashello. @@ -81,9 +85,25 @@ Configuring NuttX cd - . ./setenv.sh +SDCC +^^^^ + +These z80 configurations all use the SDCC toolchain (http://sdcc.sourceforge.net/). +Source and pre-built SDCC binaries can be downloaded from the SDCC SourceForge +site: http://sourceforge.net/projects/sdcc/files/ . Pre-built binaries are +available for Linux, MAC OSX, and for Win32. Various SDCC options can be +selected with: + + CONFIG_SDCC_POSIX=y : SDCC for Linux, MAC OSX or Cygwin (see below) + CONFIG_SDCC_WINDOWS=y : SDCC for Win32 + Building the SDCC toolchain ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +You may also want to build your own SDCC toolchain. You might want to do this, +for example, if you are running under Cygwin and want a Cygwin compatible +SDCC toolchain. + The SDCC toolchain is built with the standard configure/make/make install sequence. However, some special actions are required to generate libraries compatible with this build. First start with the usual steps diff --git a/nuttx/configs/z80sim/README.txt b/nuttx/configs/z80sim/README.txt index 0dcb1b37d..1d5ae7116 100644 --- a/nuttx/configs/z80sim/README.txt +++ b/nuttx/configs/z80sim/README.txt @@ -12,6 +12,7 @@ Contents ^^^^^^^^ o Configuring NuttX + o SDCC o Building the SDCC toolchain o SDCC Update o Newer SDCC Versions @@ -20,6 +21,7 @@ Configuring NuttX ^^^^^^^^^^^^^^^^^ ostest + This configuration performs a simple, minimal OS test using examples/ostest. This can be configurated as follows: @@ -29,6 +31,7 @@ Configuring NuttX . ./setenv.sh nsh + This configuration file builds NSH (examples/nsh). This configuration is not functional due to issues with use of the simulated serial driver (see the TODO list). @@ -41,6 +44,7 @@ Configuring NuttX . ./setenv.sh pashello + Configures to use examples/pashello for execution from FLASH See examples/README.txt for information about pashello. @@ -54,9 +58,25 @@ Configuring NuttX cd - . ./setenv.sh +SDCC +^^^^ + +These z80 configurations all use the SDCC toolchain (http://sdcc.sourceforge.net/). +Source and pre-built SDCC binaries can be downloaded from the SDCC SourceForge +site: http://sourceforge.net/projects/sdcc/files/ . Pre-built binaries are +available for Linux, MAC OSX, and for Win32. Various SDCC options can be +selected with: + + CONFIG_SDCC_POSIX=y : SDCC for Linux, MAC OSX or Cygwin (see below) + CONFIG_SDCC_WINDOWS=y : SDCC for Win32 + Building the SDCC toolchain ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +You may also want to build your own SDCC toolchain. You might want to do this, +for example, if you are running under Cygwin and want a Cygwin compatible +SDCC toolchain. + The SDCC toolchain is built with the standard configure/make/make install sequence. However, some special actions are required to generate libraries compatible with this build. First start with the usual steps -- cgit v1.2.3 From 66c7e430cf1658f120317e00660aa5c4a8508d3b Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 3 Dec 2012 15:33:24 +0000 Subject: Convert configs/z80sim/ostest to Kconfig/mconf tool git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5409 42af7a65-404d-4744-a932-0658087f49c3 --- misc/tools/README.txt | 8 +- nuttx/ChangeLog | 5 + nuttx/arch/z80/src/z80/Kconfig | 15 + nuttx/arch/z80/src/z80/Toolchain.defs | 14 +- nuttx/configs/Kconfig | 1 + nuttx/configs/xtrs/README.txt | 4 +- nuttx/configs/z80sim/README.txt | 21 +- nuttx/configs/z80sim/ostest/appconfig | 39 --- nuttx/configs/z80sim/ostest/defconfig | 538 ++++++++++++++++++++++++---------- 9 files changed, 443 insertions(+), 202 deletions(-) delete mode 100644 nuttx/configs/z80sim/ostest/appconfig (limited to 'nuttx') diff --git a/misc/tools/README.txt b/misc/tools/README.txt index 47c966921..512d8ebaa 100644 --- a/misc/tools/README.txt +++ b/misc/tools/README.txt @@ -20,13 +20,17 @@ kconfig-frontends General build instructions: cd kconfig-frontends - ./configure + ./configure --program-prefix= make make install + If you do not specify --program-prefix= in the configuration, then the + current kconfig-frontends code will add the prefix kconfig- to the generated + tools. + To suppress the graphical interfaces: - ./configure --disable-gconf --disable-qconf + ./configure --disable-gconf --disable-qconf --program-prefix= make make install diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 6225ab2fb..1401792ba 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3726,4 +3726,9 @@ to avoid the value zero. Suggested by Freddie Chopin. * tools/b16.c: Fixed precision math conversion utility. * graphics/nxglib/nxglib_splitlinex.c: Fix the "fat, flat line bug" + * arch/z80/src/*/Toolchain.defs: Add dummy Toolchain.defs files for the + z80 family. + * configs/z80sim/ostest: Converted to build with the Kconfig/mconf tool. + Current configuration failed to build for me (Ubuntu 12.10, SDCC 3.2.0 + pre-built for Linux) due to a glibc memory corruptionerror in SDCC. diff --git a/nuttx/arch/z80/src/z80/Kconfig b/nuttx/arch/z80/src/z80/Kconfig index a91973167..99c12ae06 100644 --- a/nuttx/arch/z80/src/z80/Kconfig +++ b/nuttx/arch/z80/src/z80/Kconfig @@ -4,4 +4,19 @@ # if ARCH_CHIP_Z80 + +choice + prompt "Toolchain Selection" + default Z80_TOOLCHAIN_SDCCW if HOST_WINDOWS + default Z80_TOOLCHAIN_SDCCL if !HOST_WINDOWS + +config Z80_TOOLCHAIN_SDCCL + bool "SDCC for Linux, MAC OSX, or Cygwin" + +config Z80_TOOLCHAIN_SDCCW + bool "SDCC for Windows" + depends on HOST_WINDOWS + +endchoice + endif diff --git a/nuttx/arch/z80/src/z80/Toolchain.defs b/nuttx/arch/z80/src/z80/Toolchain.defs index 9c262f593..e6ece2b55 100644 --- a/nuttx/arch/z80/src/z80/Toolchain.defs +++ b/nuttx/arch/z80/src/z80/Toolchain.defs @@ -44,19 +44,19 @@ # built to run on Windows as a POSIX toolchain. The various SDCC options are # selected in the NuttX configuration with: # -# CONFIG_SDCC_POSIX=y : SDCC for Linux, MAC OSX or Cygwin -# CONFIG_SDCC_WINDOWS=y : SDCC for Win32 +# CONFIG_Z80_TOOLCHAIN_SDCCL=y : SDCC for Linux, MAC OSX or Cygwin +# CONFIG_Z80_TOOLCHAIN_SDCCW=y : SDCC for Win32 # ifeq ($(filter y, \ - $(CONFIG_SDCC_POSIX) \ + $(CONFIG_Z80_TOOLCHAIN_SDCCL) \ ),y) - CONFIG_Z80_TOOLCHAIN ?= POSIX + CONFIG_Z80_TOOLCHAIN ?= SDCCPOSIX endif ifeq ($(filter y, \ - $(CONFIG_SDCC_WINDOWS) \ + $(CONFIG_Z80_TOOLCHAIN_SDCCW) \ ),y) - CONFIG_Z80_TOOLCHAIN ?= WINDOWS + CONFIG_Z80_TOOLCHAIN ?= SDCCWIN32 endif # SDCC toolchain under Linux, MAC OSX or Cygwin @@ -66,7 +66,7 @@ endif # SDCC toolchain under Windows/Cygwin -ifeq ($(CONFIG_AVR_TOOLCHAIN),WINAVR) +ifeq ($(CONFIG_AVR_TOOLCHAIN),SDCCWIN32) ifneq ($(CONFIG_WINDOWS_NATIVE),y) WINTOOL = y endif diff --git a/nuttx/configs/Kconfig b/nuttx/configs/Kconfig index bc3759722..7adfcee86 100644 --- a/nuttx/configs/Kconfig +++ b/nuttx/configs/Kconfig @@ -565,6 +565,7 @@ config ARCH_BOARD_Z16F2800100ZCOG config ARCH_BOARD_Z80SIM bool "Z80 Instruction Set Simulator" depends on ARCH_CHIP_Z80 + select ARCH_HAVE_UART ---help--- z80 Microcontroller. This port uses a Z80 instruction set simulator. That simulator can be found in the NuttX SVN at diff --git a/nuttx/configs/xtrs/README.txt b/nuttx/configs/xtrs/README.txt index 08f3fbea1..154437f1b 100644 --- a/nuttx/configs/xtrs/README.txt +++ b/nuttx/configs/xtrs/README.txt @@ -94,8 +94,8 @@ site: http://sourceforge.net/projects/sdcc/files/ . Pre-built binaries are available for Linux, MAC OSX, and for Win32. Various SDCC options can be selected with: - CONFIG_SDCC_POSIX=y : SDCC for Linux, MAC OSX or Cygwin (see below) - CONFIG_SDCC_WINDOWS=y : SDCC for Win32 + CONFIG_Z80_TOOLCHAIN_SDCCL=y : SDCC for Linux, MAC OSX or Cygwin (see below) + CONFIG_Z80_TOOLCHAIN_SDCCW=y : SDCC for Win32 Building the SDCC toolchain ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/configs/z80sim/README.txt b/nuttx/configs/z80sim/README.txt index 1d5ae7116..f8bca5b19 100644 --- a/nuttx/configs/z80sim/README.txt +++ b/nuttx/configs/z80sim/README.txt @@ -30,6 +30,23 @@ Configuring NuttX cd - . ./setenv.sh + NOTES: + + 1. This configuration uses the mconf-based configuration tool. To + change this configuration using that tool, you should: + + a. Build and install the mconf tool. See nuttx/README.txt and + misc/tools/ + + b. Execute 'make menuconfig' in nuttx/ in order to start the + reconfiguration process. + + 2. The current configuration is untested. When last attempted + on Ubuntu 12.10 with SDCC 3.2.0, the build failed with the + following internal error: + + *** glibc detected *** sdcclib: malloc(): memory corruption: 0x09f09768 *** + nsh This configuration file builds NSH (examples/nsh). This @@ -67,8 +84,8 @@ site: http://sourceforge.net/projects/sdcc/files/ . Pre-built binaries are available for Linux, MAC OSX, and for Win32. Various SDCC options can be selected with: - CONFIG_SDCC_POSIX=y : SDCC for Linux, MAC OSX or Cygwin (see below) - CONFIG_SDCC_WINDOWS=y : SDCC for Win32 + CONFIG_Z80_TOOLCHAIN_SDCCL=y : SDCC for Linux, MAC OSX or Cygwin (see below) + CONFIG_Z80_TOOLCHAIN_SDCCW=y : SDCC for Win32 Building the SDCC toolchain ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/configs/z80sim/ostest/appconfig b/nuttx/configs/z80sim/ostest/appconfig deleted file mode 100644 index 59f1211b1..000000000 --- a/nuttx/configs/z80sim/ostest/appconfig +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################ -# configs/z80sim/ostest/appconfig -# -# Copyright (C) 2011 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. -# -############################################################################ - -# Path to example in apps/examples containing the user_start entry point - -CONFIGURED_APPS += examples/ostest - diff --git a/nuttx/configs/z80sim/ostest/defconfig b/nuttx/configs/z80sim/ostest/defconfig index d81ae7458..8c2da3614 100644 --- a/nuttx/configs/z80sim/ostest/defconfig +++ b/nuttx/configs/z80sim/ostest/defconfig @@ -1,103 +1,135 @@ -############################################################################ -# configs/z80sim/ostest/defconfig -# -# Copyright (C) 2007-2010, 2012 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. -# -############################################################################ -# -# Architecture selection # -CONFIG_ARCH="z80" +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +CONFIG_HOST_LINUX=y +# CONFIG_HOST_OSX is not set +# CONFIG_HOST_WINDOWS is not set +# CONFIG_HOST_OTHER is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="../apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_SYMBOLS is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set CONFIG_ARCH_Z80=y +CONFIG_ARCH="z80" CONFIG_ARCH_CHIP="z80" +CONFIG_BOARD_LOOPSPERMSEC= CONFIG_ARCH_CHIP_Z80=y -CONFIG_ARCH_BOARD="z80sim" -CONFIG_ARCH_BOARD_Z80SIM=y +# CONFIG_ARCH_CHIP_Z8F6403 is not set +# CONFIG_ARCH_CHIP_Z8F6423 is not set +# CONFIG_ARCH_CHIP_EZ80F91 is not set +# CONFIG_ARCH_CHIP_EZ80F92 is not set +# CONFIG_ARCH_CHIP_EZ80F93 is not set +CONFIG_Z80_TOOLCHAIN_SDCCL=y + +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_IRQPRIO is not set +# CONFIG_ARCH_STACKDUMP is not set +# CONFIG_ENDIAN_BIG is not set + +# +# Board Settings +# +CONFIG_DRAM_START= CONFIG_DRAM_SIZE=65536 # -# Z80sim specific device driver settings +# Boot options # -CONFIG_UART_RXBUFSIZE=0 -CONFIG_UART_TXBUFSIZE=0 +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set # -# General build options +# Board Selection # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n +# CONFIG_ARCH_BOARD_XTRS is not set +CONFIG_ARCH_BOARD_Z80SIM=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="z80sim" # -# General OS setup +# Common Board Options # -CONFIG_USER_ENTRYPOINT="ostest_main" -CONFIG_DEBUG=n -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y + +# +# Board-Specific Options +# + +# +# RTOS Features +# +CONFIG_MSEC_PER_TICK=10 CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=n +# CONFIG_SCHED_INSTRUMENTATION is not set CONFIG_TASK_NAME_SIZE=0 +# CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2007 CONFIG_START_MONTH=2 CONFIG_START_DAY=21 -CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=n -CONFIG_DEV_CONSOLE=n -CONFIG_DEV_LOWCONSOLE=n -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n +# CONFIG_DEV_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set CONFIG_SDCLONE_DISABLE=y - -# -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. -# -# There are certain dependency relationships in these -# features. -# -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. -# +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="ostest_main" +CONFIG_DISABLE_OS_API=y CONFIG_DISABLE_CLOCK=y CONFIG_DISABLE_POSIX_TIMERS=y CONFIG_DISABLE_PTHREAD=y @@ -107,28 +139,6 @@ CONFIG_DISABLE_MOUNTPOINT=y CONFIG_DISABLE_ENVIRON=y CONFIG_DISABLE_POLL=y -# -# Misc libc settings -# -CONFIG_NOPRINTF_FIELDWIDTH=y - -# -# Allow for architecture optimized implementations -# -# The architecture can provide optimized versions of the -# following to improve system performance -# -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n - # # Sizes of configurable things (0 disables) # @@ -138,8 +148,6 @@ CONFIG_NPTHREAD_KEYS=0 CONFIG_NFILE_DESCRIPTORS=0 CONFIG_NFILE_STREAMS=0 CONFIG_NAME_MAX=32 -CONFIG_STDIO_BUFFER_SIZE=0 -CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_MQ_MSGS=0 CONFIG_MQ_MAXMSGSIZE=0 CONFIG_MAX_WDOGPARMS=2 @@ -147,62 +155,292 @@ CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 # -# TCP/IP and UDP support via uIP +# Stack and heap information # -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n +# CONFIG_CUSTOM_STACK is not set +CONFIG_IDLETHREAD_STACKSIZE=1024 +CONFIG_USERMAIN_STACKSIZE=1024 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=1024 # -# UIP Network Utilities +# Device Drivers +# +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +CONFIG_UART_SERIAL_CONSOLE=y +# CONFIG_NO_SERIAL_CONSOLE is not set + # -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 +# UART Configuration +# +CONFIG_UART_RXBUFSIZE=0 +CONFIG_UART_TXBUFSIZE=0 +CONFIG_UART_BAUD=11520 +CONFIG_UART_BITS=8 +CONFIG_UART_PARITY=0 +CONFIG_UART_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set # -# Settings for examples/nsh -CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_CMD_SIZE=40 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 +# System Logging Device Options +# # -# Stack and heap information +# System Logging +# +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_NET is not set + +# +# File Systems +# + +# +# File system configuration +# +# CONFIG_FS_RAMMAP is not set + +# +# System Logging +# +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0x00000000 +CONFIG_HEAP2_SIZE=0 +# CONFIG_GRAN is not set + +# +# Binary Formats +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# +CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=0 +# CONFIG_LIBM is not set +CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Named Applications +# +# CONFIG_NAMEDAPP is not set + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_NETTEST is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +CONFIG_EXAMPLES_OSTEST=y +# CONFIG_EXAMPLES_OSTEST_BUILTIN is not set +CONFIG_EXAMPLES_OSTEST_LOOPS=1 +CONFIG_EXAMPLES_OSTEST_STACKSIZE=1024 +CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=4 +CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000 +CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 +# CONFIG_EXAMPLES_PASHELLO is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WLAN is not set + +# +# Interpreters # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=1024 -CONFIG_USERMAIN_STACKSIZE=1024 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# Interpreters # +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# ModBus +# + +# +# FreeModbus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM +# + +# +# System NSH Add-Ons +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set -- cgit v1.2.3 From c2fa8016606432ac23361d7108f66c58a020d695 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 3 Dec 2012 20:12:59 +0000 Subject: Progress toward a z80 native Windows build -- still needs some work git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5411 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 3 + nuttx/arch/z80/src/Makefile.sdcc | 14 ++-- nuttx/arch/z80/src/z80/Kconfig | 1 + nuttx/configs/pjrc-8051/Make.defs | 2 +- nuttx/configs/xtrs/nsh/Make.defs | 143 ++++++++++++++++++++++++-------- nuttx/configs/xtrs/ostest/Make.defs | 143 ++++++++++++++++++++++++-------- nuttx/configs/xtrs/pashello/Make.defs | 143 ++++++++++++++++++++++++-------- nuttx/configs/z80sim/README.txt | 35 +++++++- nuttx/configs/z80sim/nsh/Make.defs | 143 ++++++++++++++++++++++++-------- nuttx/configs/z80sim/ostest/Make.defs | 143 ++++++++++++++++++++++++-------- nuttx/configs/z80sim/ostest/defconfig | 14 +++- nuttx/configs/z80sim/ostest/setenv.bat | 50 +++++++++++ nuttx/configs/z80sim/ostest/setenv.sh | 45 ---------- nuttx/configs/z80sim/pashello/Make.defs | 143 ++++++++++++++++++++++++-------- nuttx/configs/z80sim/scripts/setenv.bat | 50 +++++++++++ nuttx/configs/z80sim/scripts/setenv.sh | 66 +++++++++++++++ nuttx/tools/Config.mk | 11 ++- 17 files changed, 875 insertions(+), 274 deletions(-) create mode 100644 nuttx/configs/z80sim/ostest/setenv.bat delete mode 100755 nuttx/configs/z80sim/ostest/setenv.sh create mode 100644 nuttx/configs/z80sim/scripts/setenv.bat create mode 100755 nuttx/configs/z80sim/scripts/setenv.sh (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 1401792ba..cd46b5a2e 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3731,4 +3731,7 @@ * configs/z80sim/ostest: Converted to build with the Kconfig/mconf tool. Current configuration failed to build for me (Ubuntu 12.10, SDCC 3.2.0 pre-built for Linux) due to a glibc memory corruptionerror in SDCC. + * configs/z80sim/ostest: Default is now the Windows native build. See + configs/z80sim/README.txt for instructions to convert back to a Linux or + or Cygwin build. diff --git a/nuttx/arch/z80/src/Makefile.sdcc b/nuttx/arch/z80/src/Makefile.sdcc index a8a63c111..91f99d0cf 100644 --- a/nuttx/arch/z80/src/Makefile.sdcc +++ b/nuttx/arch/z80/src/Makefile.sdcc @@ -96,12 +96,12 @@ $(COBJS): %$(OBJEXT): %.c # This is a kludge to work around some conflicting symbols in libsdcc.lib -$(SDCCLIBDIR)/myz80.lib: $(SDCCLIBDIR)/$(SDCCLIB) - $(Q) cat $(SDCCLIBDIR)/$(SDCCLIB) | \ +$(SDCC_LIBDIR)/myz80.lib: $(SDCC_LIBDIR)/$(SDCCLIB) + $(Q) cat $(SDCC_LIBDIR)/$(SDCCLIB) | \ grep -v alloc | grep -v free | grep -v printf | \ grep -v _str | grep -v _mem | grep -v crt0\.o \ > myz80.lib - $(Q) mv -f myz80.lib $(SDCCLIBDIR)/myz80.lib + $(Q) mv -f myz80.lib $(SDCC_LIBDIR)/myz80.lib # Create a header file that contains addressing information needed by the code @@ -143,11 +143,11 @@ board/libboard$(LIBEXT): # This target builds the final executable -pass1.hex: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) +pass1.hex: up_mem.h asm_mem.h $(SDCC_LIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) @echo "LD: pass1.hex" @echo "--" >pass1.lnk # Non-interactive @echo "-k $(BOARDDIR)" >>pass1.lnk # Path to board library - @echo "-k $(SDCCLIBDIR)" >>pass1.lnk # Path to SDCC z80 library + @echo "-k $(SDCC_LIBDIR)" >>pass1.lnk # Path to SDCC z80 library @echo "-l libboard$(LIBEXT)" >>pass1.lnk # Name of board library $(Q) for LIB in $(LINKLIBS); do \ echo "-l $(TOPDIR)/lib/$$LIB" >> pass1.lnk ;\ @@ -176,11 +176,11 @@ endif $(Q) $(MAKE) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) $(Q) $(MAKE) TOPDIR="$(TOPDIR)" $(HEAD_OBJ) -nuttx.hex: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) +nuttx.hex: up_mem.h asm_mem.h $(SDCC_LIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) @echo "LD: nuttx.hex" @echo "--" >nuttx.lnk # Non-interactive @echo "-k $(BOARDDIR)" >>nuttx.lnk # Path to board library - @echo "-k $(SDCCLIBDIR)" >>nuttx.lnk # Path to SDCC z80 library + @echo "-k $(SDCC_LIBDIR)" >>nuttx.lnk # Path to SDCC z80 library @echo "-l libboard$(LIBEXT)" >>nuttx.lnk # Name of board library $(Q) for LIB in $(LINKLIBS); do \ echo "-l $(TOPDIR)/lib/$$LIB" >> nuttx.lnk ;\ diff --git a/nuttx/arch/z80/src/z80/Kconfig b/nuttx/arch/z80/src/z80/Kconfig index 99c12ae06..233b6ec90 100644 --- a/nuttx/arch/z80/src/z80/Kconfig +++ b/nuttx/arch/z80/src/z80/Kconfig @@ -12,6 +12,7 @@ choice config Z80_TOOLCHAIN_SDCCL bool "SDCC for Linux, MAC OSX, or Cygwin" + depends on !WINDOWS_NATIVE config Z80_TOOLCHAIN_SDCCW bool "SDCC for Windows" diff --git a/nuttx/configs/pjrc-8051/Make.defs b/nuttx/configs/pjrc-8051/Make.defs index 154d36556..8dd552990 100644 --- a/nuttx/configs/pjrc-8051/Make.defs +++ b/nuttx/configs/pjrc-8051/Make.defs @@ -66,7 +66,7 @@ EXEEXT = .hex define ASSEMBLE @echo "AS: $1" - @$(AS) $(ASFLAGS) $1 + @$(AS) $(AFLAGS) $1 endef define CLEAN diff --git a/nuttx/configs/xtrs/nsh/Make.defs b/nuttx/configs/xtrs/nsh/Make.defs index 0eac402ab..749b69315 100644 --- a/nuttx/configs/xtrs/nsh/Make.defs +++ b/nuttx/configs/xtrs/nsh/Make.defs @@ -36,56 +36,129 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -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 +# These are the directories where the SDCC toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + SDCC_INSTALLDIR = C:\PROGRA~2\SDCC + SDCC_BINDIR = $(SDCC_INSTALLDIR)\bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)\lib\z80 else + SDCC_INSTALLDIR = /usr/local + SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80 +endif -LD = sdldz80 -AS = sdasz80 -ARCHCPUFLAGS = -mz80 +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 + ARCHOPTIMIZATION = --debug else - ARCHOPTIMIZATION = + ARCHOPTIMIZATION = endif -ARCHPICFLAGS = -ARCHWARNINGS = -ARCHDEFINES = -ARCHINCLUDES = -I. -I$(TOPDIR)/include +ARCHPICFLAGS = +ARCHWARNINGS = +ARCHDEFINES = +ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include + +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = -x -a -l -o -s -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -ASFLAGS = -x -a -l -o -s +SDCCLIB = z80.lib -SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 -SDCCLIB = z80.lib +ASMEXT = .asm +OBJEXT = .o +LIBEXT = .lib +EXEEXT = .cmd -ASMEXT = .asm -OBJEXT = .o -LIBEXT = .lib -EXEEXT = .cmd +# Custom ASSEMBLE definition. The most common toolchain, GCC, uses the +# compiler to assemble files because this has the advantage of running the C +# Pre-Processor against. This is not possible with other SDCC; we need to +# define AS and over-ride the common definition in order to use the assembler +# directly. + +define ASSEMBLE + @echo "AS: $1" + $(Q) $(AS) $(AFLAGS) $2 $1 +endef +# Custom CLEAN definition + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) +define CLEAN + $(Q) if exist *.o (del /f /q *.o) + $(Q) if exist *.asm (del /f /q *.asm) + $(Q) if exist *.rel (del /f /q *.rel) + $(Q) if exist *.lst (del /f /q *.lst) + $(Q) if exist *.rst (del /f /q *.rst) + $(Q) if exist *.sym (del /f /q *.sym) + $(Q) if exist *.adb (del /f /q *.adb) + $(Q) if exist *.lnk (del /f /q *.lnk) + $(Q) if exist *.map (del /f /q *.map) + $(Q) if exist *.mem (del /f /q *.mem) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.cmd (del /f /q *.cmd) +endef +else define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex + $(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd endef +endif + +# Windows native host tool definitions + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe + + # Windows-native host tools + + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else -MKDEP = $(TOPDIR)/tools/mkdeps.sh +# Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # SDCC for Linux, OSX, or Cygwin understands symbolic links. Windows SDCC + # running under Cygwin does not + +ifeq ($(WINTOOL),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif +endif diff --git a/nuttx/configs/xtrs/ostest/Make.defs b/nuttx/configs/xtrs/ostest/Make.defs index ae26822d5..550c70d3c 100644 --- a/nuttx/configs/xtrs/ostest/Make.defs +++ b/nuttx/configs/xtrs/ostest/Make.defs @@ -36,56 +36,129 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -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 +# These are the directories where the SDCC toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + SDCC_INSTALLDIR = C:\PROGRA~2\SDCC + SDCC_BINDIR = $(SDCC_INSTALLDIR)\bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)\lib\z80 else + SDCC_INSTALLDIR = /usr/local + SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80 +endif -LD = sdldz80 -AS = sdasz80 -ARCHCPUFLAGS = -mz80 +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 + ARCHOPTIMIZATION = --debug else - ARCHOPTIMIZATION = + ARCHOPTIMIZATION = endif -ARCHPICFLAGS = -ARCHWARNINGS = -ARCHDEFINES = -ARCHINCLUDES = -I. -I$(TOPDIR)/include +ARCHPICFLAGS = +ARCHWARNINGS = +ARCHDEFINES = +ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include + +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = -x -a -l -o -s -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -ASFLAGS = -x -a -l -o -s +SDCCLIB = z80.lib -SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 -SDCCLIB = z80.lib +ASMEXT = .asm +OBJEXT = .o +LIBEXT = .lib +EXEEXT = .cmd -ASMEXT = .asm -OBJEXT = .o -LIBEXT = .lib -EXEEXT = .cmd +# Custom ASSEMBLE definition. The most common toolchain, GCC, uses the +# compiler to assemble files because this has the advantage of running the C +# Pre-Processor against. This is not possible with other SDCC; we need to +# define AS and over-ride the common definition in order to use the assembler +# directly. + +define ASSEMBLE + @echo "AS: $1" + $(Q) $(AS) $(AFLAGS) $2 $1 +endef +# Custom CLEAN definition + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) +define CLEAN + $(Q) if exist *.o (del /f /q *.o) + $(Q) if exist *.asm (del /f /q *.asm) + $(Q) if exist *.rel (del /f /q *.rel) + $(Q) if exist *.lst (del /f /q *.lst) + $(Q) if exist *.rst (del /f /q *.rst) + $(Q) if exist *.sym (del /f /q *.sym) + $(Q) if exist *.adb (del /f /q *.adb) + $(Q) if exist *.lnk (del /f /q *.lnk) + $(Q) if exist *.map (del /f /q *.map) + $(Q) if exist *.mem (del /f /q *.mem) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.cmd (del /f /q *.cmd) +endef +else define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex + $(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd endef +endif + +# Windows native host tool definitions + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe + + # Windows-native host tools + + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else -MKDEP = $(TOPDIR)/tools/mkdeps.sh +# Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # SDCC for Linux, OSX, or Cygwin understands symbolic links. Windows SDCC + # running under Cygwin does not + +ifeq ($(WINTOOL),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif +endif diff --git a/nuttx/configs/xtrs/pashello/Make.defs b/nuttx/configs/xtrs/pashello/Make.defs index 30caae7fd..409e303c1 100644 --- a/nuttx/configs/xtrs/pashello/Make.defs +++ b/nuttx/configs/xtrs/pashello/Make.defs @@ -36,56 +36,129 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -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 +# These are the directories where the SDCC toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + SDCC_INSTALLDIR = C:\PROGRA~2\SDCC + SDCC_BINDIR = $(SDCC_INSTALLDIR)\bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)\lib\z80 else + SDCC_INSTALLDIR = /usr/local + SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80 +endif -LD = sdldz80 -AS = sdasz80 -ARCHCPUFLAGS = -mz80 +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 + ARCHOPTIMIZATION = --debug else - ARCHOPTIMIZATION = + ARCHOPTIMIZATION = endif -ARCHPICFLAGS = -ARCHWARNINGS = -ARCHDEFINES = -ARCHINCLUDES = -I. -I$(TOPDIR)/include +ARCHPICFLAGS = +ARCHWARNINGS = +ARCHDEFINES = +ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include + +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = -x -a -l -o -s -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -ASFLAGS = -x -a -l -o -s +SDCCLIB = z80.lib -SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 -SDCCLIB = z80.lib +ASMEXT = .asm +OBJEXT = .o +LIBEXT = .lib +EXEEXT = .cmd -ASMEXT = .asm -OBJEXT = .o -LIBEXT = .lib -EXEEXT = .cmd +# Custom ASSEMBLE definition. The most common toolchain, GCC, uses the +# compiler to assemble files because this has the advantage of running the C +# Pre-Processor against. This is not possible with other SDCC; we need to +# define AS and over-ride the common definition in order to use the assembler +# directly. + +define ASSEMBLE + @echo "AS: $1" + $(Q) $(AS) $(AFLAGS) $2 $1 +endef +# Custom CLEAN definition + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) +define CLEAN + $(Q) if exist *.o (del /f /q *.o) + $(Q) if exist *.asm (del /f /q *.asm) + $(Q) if exist *.rel (del /f /q *.rel) + $(Q) if exist *.lst (del /f /q *.lst) + $(Q) if exist *.rst (del /f /q *.rst) + $(Q) if exist *.sym (del /f /q *.sym) + $(Q) if exist *.adb (del /f /q *.adb) + $(Q) if exist *.lnk (del /f /q *.lnk) + $(Q) if exist *.map (del /f /q *.map) + $(Q) if exist *.mem (del /f /q *.mem) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.cmd (del /f /q *.cmd) +endef +else define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex + $(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd endef +endif + +# Windows native host tool definitions + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe + + # Windows-native host tools + + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else -MKDEP = $(TOPDIR)/tools/mkdeps.sh +# Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # SDCC for Linux, OSX, or Cygwin understands symbolic links. Windows SDCC + # running under Cygwin does not + +ifeq ($(WINTOOL),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif +endif diff --git a/nuttx/configs/z80sim/README.txt b/nuttx/configs/z80sim/README.txt index f8bca5b19..c371cdaff 100644 --- a/nuttx/configs/z80sim/README.txt +++ b/nuttx/configs/z80sim/README.txt @@ -41,11 +41,38 @@ Configuring NuttX b. Execute 'make menuconfig' in nuttx/ in order to start the reconfiguration process. - 2. The current configuration is untested. When last attempted - on Ubuntu 12.10 with SDCC 3.2.0, the build failed with the - following internal error: + 2. The default setup for this configuration uses a windows native build. + NOTE that build does *NOT* work build successfully using SDCC 3.2.0: + Windows halts claiming that sdcclib is no long responding. 3.2.0 is + the latest released version as of this writing. This problem has, + apparently been corrected in the repository; a snapshot data 11-23-2012 + (3.2.1) did not have this problem. + + This configuration was last verified sucessfully prior to the + the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run + natively under Cygwin. + + 3. This configuration can be converted to run under Linux (or Cygwin or + OSX), by modifying the configuration file as follows: + + -CONFIG_HOST_WINDOWS=y + -CONFIG_WINDOWS_NATIVE=y + +CONFIG_HOST_LINUX=y + + -CONFIG_Z80_TOOLCHAIN_SDCCW=y + +CONFIG_Z80_TOOLCHAIN_SDCCL=y + + You make also have to change the value of CONFIG_APPS_DIR. You cannot + use the default setenv.bat. Use configs/z80sim/script/setenv.sh instead. + + When last attempted on Ubuntu 12.10 with SDCC 3.2.0 for Linux, the build + failed with the following internal error: + + *** glibc detected *** sdcclib: malloc(): memory corruption: 0x09f09768 *** - *** glibc detected *** sdcclib: malloc(): memory corruption: 0x09f09768 *** + I believe that this is related to the sdcclib error also reported under + windows for SDCC 3.2.0. It can probably also be avoided by updating to + a more recent snapshot. nsh diff --git a/nuttx/configs/z80sim/nsh/Make.defs b/nuttx/configs/z80sim/nsh/Make.defs index 11253020e..a5b325e79 100644 --- a/nuttx/configs/z80sim/nsh/Make.defs +++ b/nuttx/configs/z80sim/nsh/Make.defs @@ -36,56 +36,129 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -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 +# These are the directories where the SDCC toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + SDCC_INSTALLDIR = C:\PROGRA~2\SDCC + SDCC_BINDIR = $(SDCC_INSTALLDIR)\bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)\lib\z80 else + SDCC_INSTALLDIR = /usr/local + SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80 +endif -LD = sdldz80 -AS = sdasz80 -ARCHCPUFLAGS = -mz80 +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 + ARCHOPTIMIZATION = --debug else - ARCHOPTIMIZATION = + ARCHOPTIMIZATION = endif -ARCHPICFLAGS = -ARCHWARNINGS = -ARCHDEFINES = -ARCHINCLUDES = -I. -I$(TOPDIR)/include +ARCHPICFLAGS = +ARCHWARNINGS = +ARCHDEFINES = +ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include + +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = -x -a -l -o -s -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -ASFLAGS = -x -a -l -o -s +SDCCLIB = z80.lib -SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 -SDCCLIB = z80.lib +ASMEXT = .asm +OBJEXT = .o +LIBEXT = .lib +EXEEXT = .hex -ASMEXT = .asm -OBJEXT = .o -LIBEXT = .lib -EXEEXT = .hex +# Custom ASSEMBLE definition. The most common toolchain, GCC, uses the +# compiler to assemble files because this has the advantage of running the C +# Pre-Processor against. This is not possible with other SDCC; we need to +# define AS and over-ride the common definition in order to use the assembler +# directly. + +define ASSEMBLE + @echo "AS: $1" + $(Q) $(AS) $(AFLAGS) $2 $1 +endef +# Custom CLEAN definition + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) +define CLEAN + $(Q) if exist *.o (del /f /q *.o) + $(Q) if exist *.asm (del /f /q *.asm) + $(Q) if exist *.rel (del /f /q *.rel) + $(Q) if exist *.lst (del /f /q *.lst) + $(Q) if exist *.rst (del /f /q *.rst) + $(Q) if exist *.sym (del /f /q *.sym) + $(Q) if exist *.adb (del /f /q *.adb) + $(Q) if exist *.lnk (del /f /q *.lnk) + $(Q) if exist *.map (del /f /q *.map) + $(Q) if exist *.mem (del /f /q *.mem) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.cmd (del /f /q *.cmd) +endef +else define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex + $(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd endef +endif + +# Windows native host tool definitions + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe + + # Windows-native host tools + + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else -MKDEP = $(TOPDIR)/tools/mkdeps.sh +# Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # SDCC for Linux, OSX, or Cygwin understands symbolic links. Windows SDCC + # running under Cygwin does not + +ifeq ($(WINTOOL),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif +endif diff --git a/nuttx/configs/z80sim/ostest/Make.defs b/nuttx/configs/z80sim/ostest/Make.defs index d0185b4f9..54b6d8c45 100644 --- a/nuttx/configs/z80sim/ostest/Make.defs +++ b/nuttx/configs/z80sim/ostest/Make.defs @@ -36,56 +36,129 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -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 +# These are the directories where the SDCC toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + SDCC_INSTALLDIR = C:\PROGRA~2\SDCC + SDCC_BINDIR = $(SDCC_INSTALLDIR)\bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)\lib\z80 else + SDCC_INSTALLDIR = /usr/local + SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80 +endif -LD = sdldz80 -AS = sdasz80 -ARCHCPUFLAGS = -mz80 +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 + ARCHOPTIMIZATION = --debug else - ARCHOPTIMIZATION = + ARCHOPTIMIZATION = endif -ARCHPICFLAGS = -ARCHWARNINGS = -ARCHDEFINES = -ARCHINCLUDES = -I. -I$(TOPDIR)/include +ARCHPICFLAGS = +ARCHWARNINGS = +ARCHDEFINES = +ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include + +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = -x -a -l -o -s -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -ASFLAGS = -x -a -l -o -s +SDCCLIB = z80.lib -SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 -SDCCLIB = z80.lib +ASMEXT = .asm +OBJEXT = .o +LIBEXT = .lib +EXEEXT = .hex -ASMEXT = .asm -OBJEXT = .o -LIBEXT = .lib -EXEEXT = .hex +# Custom ASSEMBLE definition. The most common toolchain, GCC, uses the +# compiler to assemble files because this has the advantage of running the C +# Pre-Processor against. This is not possible with other SDCC; we need to +# define AS and over-ride the common definition in order to use the assembler +# directly. + +define ASSEMBLE + @echo "AS: $1" + $(Q) $(AS) $(AFLAGS) $2 $1 +endef +# Custom CLEAN definition + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) +define CLEAN + $(Q) if exist *.o (del /f /q *.o) + $(Q) if exist *.asm (del /f /q *.asm) + $(Q) if exist *.rel (del /f /q *.rel) + $(Q) if exist *.lst (del /f /q *.lst) + $(Q) if exist *.rst (del /f /q *.rst) + $(Q) if exist *.sym (del /f /q *.sym) + $(Q) if exist *.adb (del /f /q *.adb) + $(Q) if exist *.lnk (del /f /q *.lnk) + $(Q) if exist *.map (del /f /q *.map) + $(Q) if exist *.mem (del /f /q *.mem) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.cmd (del /f /q *.cmd) +endef +else define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex + $(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd endef +endif + +# Windows native host tool definitions + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe + + # Windows-native host tools + + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else -MKDEP = $(TOPDIR)/tools/mkdeps.sh +# Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # SDCC for Linux, OSX, or Cygwin understands symbolic links. Windows SDCC + # running under Cygwin does not + +ifeq ($(WINTOOL),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif +endif diff --git a/nuttx/configs/z80sim/ostest/defconfig b/nuttx/configs/z80sim/ostest/defconfig index 8c2da3614..fa79acd30 100644 --- a/nuttx/configs/z80sim/ostest/defconfig +++ b/nuttx/configs/z80sim/ostest/defconfig @@ -8,15 +8,20 @@ CONFIG_NUTTX_NEWCONFIG=y # Build Setup # # CONFIG_EXPERIMENTAL is not set -CONFIG_HOST_LINUX=y +# CONFIG_HOST_LINUX is not set # CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set +CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_WINDOWS_NATIVE=y +# CONFIG_WINDOWS_CYGWIN is not set +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set +# CONFIG_WINDOWS_MKLINK is not set # # Build Configuration # -# CONFIG_APPS_DIR="../apps" +# CONFIG_APPS_DIR="..\apps" # CONFIG_BUILD_2PASS is not set # @@ -64,7 +69,8 @@ CONFIG_ARCH_CHIP_Z80=y # CONFIG_ARCH_CHIP_EZ80F91 is not set # CONFIG_ARCH_CHIP_EZ80F92 is not set # CONFIG_ARCH_CHIP_EZ80F93 is not set -CONFIG_Z80_TOOLCHAIN_SDCCL=y +# CONFIG_Z80_TOOLCHAIN_SDCCL is not set +CONFIG_Z80_TOOLCHAIN_SDCCW=y # # Architecture Options diff --git a/nuttx/configs/z80sim/ostest/setenv.bat b/nuttx/configs/z80sim/ostest/setenv.bat new file mode 100644 index 000000000..e5c7ff5bf --- /dev/null +++ b/nuttx/configs/z80sim/ostest/setenv.bat @@ -0,0 +1,50 @@ +@echo off + +rem configs/z80sim/ostest/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the SDCC toolchain for windows. + +set PATH=C:\Program Files (x86)\SDCC/bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% +echo %PATH% diff --git a/nuttx/configs/z80sim/ostest/setenv.sh b/nuttx/configs/z80sim/ostest/setenv.sh deleted file mode 100755 index 239e35286..000000000 --- a/nuttx/configs/z80sim/ostest/setenv.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# configs/z80sim/ostest/setenv.sh -# -# 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 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. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - -export SDCC_BIN=/usr/local/bin -export PATH=${SDCC_BIN}:/sbin:/usr/sbin:${PATH_ORIG} - -echo "PATH : ${PATH}" diff --git a/nuttx/configs/z80sim/pashello/Make.defs b/nuttx/configs/z80sim/pashello/Make.defs index 16d3ff342..076aad7ed 100644 --- a/nuttx/configs/z80sim/pashello/Make.defs +++ b/nuttx/configs/z80sim/pashello/Make.defs @@ -36,56 +36,129 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -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 +# These are the directories where the SDCC toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + SDCC_INSTALLDIR = C:\PROGRA~2\SDCC + SDCC_BINDIR = $(SDCC_INSTALLDIR)\bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)\lib\z80 else + SDCC_INSTALLDIR = /usr/local + SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80 +endif -LD = sdldz80 -AS = sdasz80 -ARCHCPUFLAGS = -mz80 +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 + ARCHOPTIMIZATION = --debug else - ARCHOPTIMIZATION = + ARCHOPTIMIZATION = endif -ARCHPICFLAGS = -ARCHWARNINGS = -ARCHDEFINES = -ARCHINCLUDES = -I. -I$(TOPDIR)/include +ARCHPICFLAGS = +ARCHWARNINGS = +ARCHDEFINES = +ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include + +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = -x -a -l -o -s -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -ASFLAGS = -x -a -l -o -s +SDCCLIB = z80.lib -SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 -SDCCLIB = z80.lib +ASMEXT = .asm +OBJEXT = .o +LIBEXT = .lib +EXEEXT = .hex -ASMEXT = .asm -OBJEXT = .o -LIBEXT = .lib -EXEEXT = .hex +# Custom ASSEMBLE definition. The most common toolchain, GCC, uses the +# compiler to assemble files because this has the advantage of running the C +# Pre-Processor against. This is not possible with other SDCC; we need to +# define AS and over-ride the common definition in order to use the assembler +# directly. + +define ASSEMBLE + @echo "AS: $1" + $(Q) $(AS) $(AFLAGS) $2 $1 +endef +# Custom CLEAN definition + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) +define CLEAN + $(Q) if exist *.o (del /f /q *.o) + $(Q) if exist *.asm (del /f /q *.asm) + $(Q) if exist *.rel (del /f /q *.rel) + $(Q) if exist *.lst (del /f /q *.lst) + $(Q) if exist *.rst (del /f /q *.rst) + $(Q) if exist *.sym (del /f /q *.sym) + $(Q) if exist *.adb (del /f /q *.adb) + $(Q) if exist *.lnk (del /f /q *.lnk) + $(Q) if exist *.map (del /f /q *.map) + $(Q) if exist *.mem (del /f /q *.mem) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.cmd (del /f /q *.cmd) +endef +else define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex + $(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd endef +endif + +# Windows native host tool definitions + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe + + # Windows-native host tools + + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative +else -MKDEP = $(TOPDIR)/tools/mkdeps.sh +# Linux/Cygwin host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # SDCC for Linux, OSX, or Cygwin understands symbolic links. Windows SDCC + # running under Cygwin does not + +ifeq ($(WINTOOL),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh +endif +endif diff --git a/nuttx/configs/z80sim/scripts/setenv.bat b/nuttx/configs/z80sim/scripts/setenv.bat new file mode 100644 index 000000000..c266d1e81 --- /dev/null +++ b/nuttx/configs/z80sim/scripts/setenv.bat @@ -0,0 +1,50 @@ +@echo off + +rem configs/z80sim/scripts/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the SDCC toolchain for windows. + +set PATH=C:\Program Files (x86)\SDCC/bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% +echo %PATH% diff --git a/nuttx/configs/z80sim/scripts/setenv.sh b/nuttx/configs/z80sim/scripts/setenv.sh new file mode 100755 index 000000000..ead1e1f5f --- /dev/null +++ b/nuttx/configs/z80sim/scripts/setenv.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# configs/z80sim/ostest/setenv.sh +# +# Copyright (C) 2007, 2008, 2012 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. +# + +if [ "$_" = "$0" ] ; then + echo "You must source this script, not run it!" 1>&2 + exit 1 +fi + +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# +# This is the normal installation directory for SDCC under Linux, OSX +# or Linux: +# +export TOOLCHAIN_BIN=/usr/local/bin + +# +# This is the normal installation directory for SDCC under Windows +# +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/SDCC/bin" + +# +# Add the path to the toolchain to the PATH varialble +# +export PATH="${TOOLCHAIN_BIN}":/sbin:/usr/sbin:${PATH_ORIG} + +echo "PATH : ${PATH}" diff --git a/nuttx/tools/Config.mk b/nuttx/tools/Config.mk index 300df7a6a..9ac93e7d0 100644 --- a/nuttx/tools/Config.mk +++ b/nuttx/tools/Config.mk @@ -134,10 +134,16 @@ endef # ASSEMBLE - Default macro to assemble one assembly language file # Example: $(call ASSEMBLE, in-file, out-file) # +# NOTE that the most common toolchain, GCC, uses the compiler to assemble +# files because this has the advantage of running the C Pre-Processor against +# the assembly language files. This is not possible with other toolchains; +# platforms using those other tools should define AS and over-ride this +# definition in order to use the assembler directly. +# # Depends on these settings defined in board-specific Make.defs file # installed at $(TOPDIR)/Make.defs: # -# CC - By default, the C compiler is used to compile assembly lagnuage +# CC - By default, the C compiler is used to compile assembly language # files # AFLAGS - Options to pass to the C+compiler @@ -164,8 +170,7 @@ endef ifeq ($(CONFIG_WINDOWS_NATIVE),y) define ARCHIVE - @echo "AR: $2" - $(AR) $1 + @echo AR: $2 $(Q) $(AR) $1 $(2) endef else -- cgit v1.2.3 From c0ced89e2d81b660bb965b9382ba3a4ba09d2be8 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 4 Dec 2012 14:34:48 +0000 Subject: README update git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5412 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/configs/z80sim/README.txt | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'nuttx') diff --git a/nuttx/configs/z80sim/README.txt b/nuttx/configs/z80sim/README.txt index c371cdaff..a5fc011a1 100644 --- a/nuttx/configs/z80sim/README.txt +++ b/nuttx/configs/z80sim/README.txt @@ -43,10 +43,15 @@ Configuring NuttX 2. The default setup for this configuration uses a windows native build. NOTE that build does *NOT* work build successfully using SDCC 3.2.0: - Windows halts claiming that sdcclib is no long responding. 3.2.0 is + Windows halts claiming that sdcclib is no longer responding. 3.2.0 is the latest released version as of this writing. This problem has, - apparently been corrected in the repository; a snapshot data 11-23-2012 - (3.2.1) did not have this problem. + apparently been corrected in the repository; a snapshot data Nov 23, + 2012 (3.2.1) did not have this problem. + + As of this writing, the native Windows build still does not work. This + is due to issues in arch/z80/src/Makefile and in the Bash script + arch/z80/src/mkhpbase.sh which, of course, cannot be used in a Windows + CMD.exe shell. These configuration is broken for the time being. This configuration was last verified sucessfully prior to the the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run @@ -71,8 +76,10 @@ Configuring NuttX *** glibc detected *** sdcclib: malloc(): memory corruption: 0x09f09768 *** I believe that this is related to the sdcclib error also reported under - windows for SDCC 3.2.0. It can probably also be avoided by updating to - a more recent snapshot. + windows for SDCC 3.2.0. It may be avoided by updating to a more recent + snapshot. However, a Dec 4, 2012 still shows a similar error: + + *** glibc detected *** sdcclib: free(): invalid next size (fast): 0x0000000001aaaab0 *** nsh -- cgit v1.2.3 From ccae1c4fb2bcc9a71e04a7bf02032a3b90381855 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 5 Dec 2012 15:01:11 +0000 Subject: Progress toward natvie z80 SDCC build -- still issues git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5413 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 3 + nuttx/arch/z80/src/Makefile | 37 +++- nuttx/arch/z80/src/Makefile.sdcc | 258 ---------------------------- nuttx/arch/z80/src/Makefile.sdccl | 290 ++++++++++++++++++++++++++++++++ nuttx/arch/z80/src/Makefile.sdccw | 274 ++++++++++++++++++++++++++++++ nuttx/arch/z80/src/Makefile.zdsii | 221 ------------------------ nuttx/arch/z80/src/Makefile.zdsiil | 173 +++++++++++++++++++ nuttx/arch/z80/src/Makefile.zdsiiw | 156 +++++++++++++++++ nuttx/arch/z80/src/mkhpbase.bat | 45 +++++ nuttx/configs/pjrc-8051/Make.defs | 1 + nuttx/configs/xtrs/nsh/Make.defs | 3 +- nuttx/configs/xtrs/ostest/Make.defs | 3 +- nuttx/configs/xtrs/pashello/Make.defs | 3 +- nuttx/configs/z80sim/nsh/Make.defs | 3 +- nuttx/configs/z80sim/ostest/Make.defs | 3 +- nuttx/configs/z80sim/pashello/Make.defs | 3 +- nuttx/configs/z80sim/src/z80_lowputc.c | 19 +++ 17 files changed, 1004 insertions(+), 491 deletions(-) delete mode 100644 nuttx/arch/z80/src/Makefile.sdcc create mode 100644 nuttx/arch/z80/src/Makefile.sdccl create mode 100644 nuttx/arch/z80/src/Makefile.sdccw delete mode 100644 nuttx/arch/z80/src/Makefile.zdsii create mode 100644 nuttx/arch/z80/src/Makefile.zdsiil create mode 100644 nuttx/arch/z80/src/Makefile.zdsiiw create mode 100755 nuttx/arch/z80/src/mkhpbase.bat (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index cd46b5a2e..ab1412ae2 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3734,4 +3734,7 @@ * configs/z80sim/ostest: Default is now the Windows native build. See configs/z80sim/README.txt for instructions to convert back to a Linux or or Cygwin build. + * arch/z80/src/Makefile.sdccw: Renamed makefiles with extensions zdiil, + zdiiw, sdccl, and sdccw for the ZDS-II vs SDCC compilers and for the + POSIX vs Windows native builds. diff --git a/nuttx/arch/z80/src/Makefile b/nuttx/arch/z80/src/Makefile index 4b02b1f0b..c3e2caea7 100644 --- a/nuttx/arch/z80/src/Makefile +++ b/nuttx/arch/z80/src/Makefile @@ -33,18 +33,43 @@ # ############################################################################ -############################################################################ # Makefile fragments -include $(TOPDIR)/Make.defs -include chip/Make.defs -include board/Make.defs -############################################################################ -# Compiler-Dependent Make -COMPILER = ${shell basename "$(CC)"} +# Compiler-Dependent Make: SDCC or ZiLOG ZDS-II + +COMPILER = ${shell basename "$(CC)"} ifeq ($(COMPILER),sdcc) -include Makefile.sdcc + + # Check for SDCC native windows build + + ifeq ($(CONFIG_WINDOWS_NATIVE),y) + + # SDCC Windows native build + + include Makefile.sdccw + else + + # SDCC in a POSIX environment (Linux, OSX, or Cygwin/MSYS) + + include Makefile.sdccl + endif else -include Makefile.zdsii + + # Check for ZDSII native windows build + + ifeq ($(CONFIG_WINDOWS_NATIVE),y) + + # ZDSII Windows native build + + include Makefile.zdsiiw + else + + # ZDSII in a POSIX environment (Cygwin/MSYS) + + include Makefile.zdsiil + endif endif diff --git a/nuttx/arch/z80/src/Makefile.sdcc b/nuttx/arch/z80/src/Makefile.sdcc deleted file mode 100644 index 91f99d0cf..000000000 --- a/nuttx/arch/z80/src/Makefile.sdcc +++ /dev/null @@ -1,258 +0,0 @@ -############################################################################ -# arch/z80/src/Makefile.sdcc -# -# Copyright (C) 2008, 2011-2012 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. -# -############################################################################ - -############################################################################ -# Tools -# CFLAGS, CPPFLAGS, ASFLAGS, LDFLAGS are set in $(TOPDIR)/Make.defs - -CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(TOPDIR)/sched -CPPFLAGS += -D__ASSEMBLY__ - -############################################################################ -# Files and directories - -# There should be one head source (.asm file) - -HEAD_OBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT)) - -# Assembly sources and objects - -ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS) -AOBJS = $(ASRCS:$(ASMEXT)=$(OBJEXT)) - -# C sources and objects - -CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -# All sources and objcts - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -# Sources that can have dependencies (no .asm files) - -DEPSRCS = $(CSRCS) - -# Directories - -ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src -BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board - -VPATH = chip:common:board - -# Libraries - -LIBGCC = ${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name} - -# Supports dynamic sizing of HEAP. -# -HEAP_BASE = ${shell ./mkhpbase.sh} - -############################################################################ -# Targets - -all: $(HEAD_OBJ) libarch$(LIBEXT) - -.PHONY: board/libboard$(LIBEXT) - -$(AOBJS) $(HEAD_OBJ): %$(OBJEXT): %$(ASMEXT) - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -# This is a kludge to work around some conflicting symbols in libsdcc.lib - -$(SDCC_LIBDIR)/myz80.lib: $(SDCC_LIBDIR)/$(SDCCLIB) - $(Q) cat $(SDCC_LIBDIR)/$(SDCCLIB) | \ - grep -v alloc | grep -v free | grep -v printf | \ - grep -v _str | grep -v _mem | grep -v crt0\.o \ - > myz80.lib - $(Q) mv -f myz80.lib $(SDCC_LIBDIR)/myz80.lib - -# Create a header file that contains addressing information needed by the code - -up_mem.h: - @echo "#ifndef __UP_MEM_H" >up_mem.h - @echo "#define __UP_MEM_H" >>up_mem.h - @echo "" >>up_mem.h - @echo "#include " >>up_mem.h - @echo "" >>up_mem.h - @echo "#define CONFIG_STACK_END $(CONFIG_DRAM_SIZE)" >> up_mem.h - @echo "#define CONFIG_STACK_BASE (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE))" >> up_mem.h - @echo "#define CONFIG_HEAP1_END CONFIG_STACK_BASE" >> up_mem.h - @echo "#define CONFIG_HEAP1_BASE $(HEAP_BASE)" >> up_mem.h - @echo "" >>up_mem.h - @echo "#endif /* __UP_MEM_H */" >>up_mem.h - -asm_mem.h: - @echo " CONFIG_COMPILER_OTHER == 0" > asm_mem.h - @echo " CONFIG_COMPILER_SDCC == 1" >> asm_mem.h -ifeq ($(CC),sdcc) - @echo " CONFIG_COMPILER == 1" >> asm_mem.h -else - @echo " CONFIG_COMPILER == 0" >> asm_mem.h -endif - @echo " CONFIG_STACK_END == ($(CONFIG_DRAM_SIZE) - 1)" >> asm_mem.h - @echo " CONFIG_STACK_BASE == (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE))" >> asm_mem.h - @echo " CONFIG_HEAP1_END == (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE) - 1)" >> asm_mem.h - @echo " CONFIG_HEAP1_BASE == $(HEAP_BASE)" >> asm_mem.h - -# Combine all objects in this directory into a library - -libarch$(LIBEXT): up_mem.h asm_mem.h $(OBJS) - $(call ARCHIVE, $@, $(OBJS)) - -# This builds the libboard library in the board/ subdirectory - -board/libboard$(LIBEXT): - $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES) - -# This target builds the final executable - -pass1.hex: up_mem.h asm_mem.h $(SDCC_LIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) - @echo "LD: pass1.hex" - @echo "--" >pass1.lnk # Non-interactive - @echo "-k $(BOARDDIR)" >>pass1.lnk # Path to board library - @echo "-k $(SDCC_LIBDIR)" >>pass1.lnk # Path to SDCC z80 library - @echo "-l libboard$(LIBEXT)" >>pass1.lnk # Name of board library - $(Q) for LIB in $(LINKLIBS); do \ - echo "-l $(TOPDIR)/lib/$$LIB" >> pass1.lnk ;\ - done - @echo "-l myz80.lib" >>pass1.lnk # Name of SDCC z80 library -ifneq ($(CONFIG_LINKER_START_AREA),) - @echo "-b START=$(CONFIG_LINKER_START_AREA)" >>pass1.lnk # Start of START area -else - @echo "-b START=0" >>pass1.lnk # Start of START area -endif -ifneq ($(CONFIG_LINKER_CODE_AREA),) - @echo "-b _CODE=$(CONFIG_LINKER_CODE_AREA)" >>pass1.lnk # Start of _CODE area -else - @echo "-b _CODE=256" >>pass1.lnk # Start of _CODE area -endif - @echo "-i" >>pass1.lnk # Intel hex format - @echo "-x" >>pass1.lnk # Hexadecimal - @echo "-m" >>pass1.lnk # Generate a map file - @echo "-j" >>pass1.lnk # Generate a symbol file - @echo "pass1.hex" >>pass1.lnk # Path to head object - @echo "$(HEAD_OBJ)" >>pass1.lnk # Path to head object - @echo "-e" >>pass1.lnk # End of script - $(Q) $(LD) -f pass1.lnk - $(Q) rm -f up_mem.h asm_mem.h - $(Q) rm -f up_allocateheap$(OBJEXT) $(HEAD_OBJ) libarch$(LIBEXT) - $(Q) $(MAKE) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) - $(Q) $(MAKE) TOPDIR="$(TOPDIR)" $(HEAD_OBJ) - -nuttx.hex: up_mem.h asm_mem.h $(SDCC_LIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) - @echo "LD: nuttx.hex" - @echo "--" >nuttx.lnk # Non-interactive - @echo "-k $(BOARDDIR)" >>nuttx.lnk # Path to board library - @echo "-k $(SDCC_LIBDIR)" >>nuttx.lnk # Path to SDCC z80 library - @echo "-l libboard$(LIBEXT)" >>nuttx.lnk # Name of board library - $(Q) for LIB in $(LINKLIBS); do \ - echo "-l $(TOPDIR)/lib/$$LIB" >> nuttx.lnk ;\ - done - @echo "-l myz80.lib" >>nuttx.lnk # Name of SDCC z80 library -ifneq ($(CONFIG_LINKER_START_AREA),) - @echo "-b START=$(CONFIG_LINKER_START_AREA)" >>nuttx.lnk # Start of START area -else - @echo "-b START=0" >>nuttx.lnk # Start of START area -endif -ifneq ($(CONFIG_LINKER_CODE_AREA),) - @echo "-b _CODE=$(CONFIG_LINKER_CODE_AREA)" >>nuttx.lnk # Start of _CODE area -else - @echo "-b _CODE=256" >>nuttx.lnk # Start of _CODE area -endif - @echo "-i" >>nuttx.lnk # Intel hex format - @echo "-x" >>nuttx.lnk # Hexadecimal - @echo "-m" >>nuttx.lnk # Generate a map file - @echo "-j" >>nuttx.lnk # Generate a symbol file - @echo "nuttx.hex" >>nuttx.lnk # Path to head object - @echo "$(HEAD_OBJ)" >>nuttx.lnk # Path to head object - @echo "-e" >>nuttx.lnk # End of script - $(Q) $(LD) -f nuttx.lnk - -nuttx$(EXEEXT): pass1.hex nuttx.hex - $(Q) rm -f pass1.* - $(Q) cp -f nuttx.map $(TOPDIR)/. -ifeq ($(EXEEXT),.cmd) - sed s/:00000001FF/:00520001AD/ nuttx.hex | \ - hex2cmd > $(TOPDIR)/nuttx.cmd -else - $(Q) packihx nuttx.hex > $(TOPDIR)/nuttx$(EXEEXT) -endif - -# This is part of the top-level export target - -export_head: board/libboard$(LIBEXT) $(HEAD_OBJ) - $(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \ - cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \ - else \ - echo "$(EXPORT_DIR)/startup does not exist"; \ - exit 1; \ - fi - -# Build dependencies - -.depend: Makefile up_mem.h asm_mem.h chip/Make.defs $(DEPSRCS) - $(Q) if [ -e board/Makefile ]; then \ - $(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \ - fi - $(Q) $(MKDEP) --dep-path chip --dep-path common "$(CC)" -- $(CFLAGS) -- $(DEPSRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(Q) if [ -e board/Makefile ]; then \ - $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ - fi - $(call DELFILE, up_mem.h) - $(call DELFILE, asm_mem.h) - $(call DELFILE, pass1.*) - $(call DELFILE, nuttx.*) - $(call DELFILE, libarch$(LIBEXT)) - $(call CLEAN) - - -distclean: clean - $(Q) if [ -e board/Makefile ]; then \ - $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \ - fi - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - --include Make.dep diff --git a/nuttx/arch/z80/src/Makefile.sdccl b/nuttx/arch/z80/src/Makefile.sdccl new file mode 100644 index 000000000..531fbedf9 --- /dev/null +++ b/nuttx/arch/z80/src/Makefile.sdccl @@ -0,0 +1,290 @@ +############################################################################ +# arch/z80/src/Makefile.sdccl +# +# Copyright (C) 2008, 2011-2012 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. +# +############################################################################ + +############################################################################ +# Tools +# CFLAGS, CPPFLAGS, ASFLAGS, LDFLAGS are set in $(TOPDIR)/Make.defs + +CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(TOPDIR)/sched +CPPFLAGS += -D__ASSEMBLY__ + +############################################################################ +# Files and directories + +# There should be one head source (.asm file) + +HEAD_OBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT)) + +# Assembly sources and objects + +ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS) +AOBJS = $(ASRCS:$(ASMEXT)=$(OBJEXT)) + +# C sources and objects + +CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS) +COBJS = $(CSRCS:.c=$(OBJEXT)) + +# All sources and objcts + +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +# Sources that can have dependencies (no .asm files) + +DEPSRCS = $(CSRCS) + +# Directories + +ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src +BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board + +VPATH = chip:common:board + +# Libraries + +LIBGCC = ${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name} + +# Supports dynamic sizing of HEAP. +# +HEAP_BASE = ${shell ./mkhpbase.sh} + +############################################################################ +# Targets + +all: $(HEAD_OBJ) libarch$(LIBEXT) + +.PHONY: board/libboard$(LIBEXT) pass1.lnk nuttx.lnk + +$(AOBJS) $(HEAD_OBJ): %$(OBJEXT): %$(ASMEXT) + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +# This is a kludge to work around some conflicting symbols in libsdcc.lib + +$(SDCC_LIBDIR)/myz80.lib: $(SDCC_LIBDIR)/$(SDCCLIB) +ifeq ($(CONFIG_SDCC_OLD),y) + $(Q) cat $(SDCC_LIBDIR)\$(SDCCLIB) | \ + grep -v alloc | grep -v free | grep -v printf | \ + grep -v _str | grep -v _mem | grep -v crt0\.o \ + > myz80.lib + $(Q) mv -f myz80.lib $(SDCC_LIBDIR)\myz80.lib +else + $(Q) cp $(SDCC_LIBDIR)\z80.lib $(SDCC_LIBDIR)\myz80.lib + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _calloc.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _malloc.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _realloc.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _free.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib printf_large.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib sprintf.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib vprintf.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib strcpy.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib strlen.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strcat.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strchr.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strcmp.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strcspn.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strncat.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strncmp.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strncpy.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strpbrk.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strrchr.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strspn.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strstr.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strtok.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memchr.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memcmp.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memcpy.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memset.rel +endif + +# Create a header file that contains addressing information needed by the code + +up_mem.h: + @echo "#ifndef __UP_MEM_H" >up_mem.h + @echo "#define __UP_MEM_H" >>up_mem.h + @echo "" >>up_mem.h + @echo "#include " >>up_mem.h + @echo "" >>up_mem.h + @echo "#define CONFIG_STACK_END $(CONFIG_DRAM_SIZE)" >> up_mem.h + @echo "#define CONFIG_STACK_BASE (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE))" >> up_mem.h + @echo "#define CONFIG_HEAP1_END CONFIG_STACK_BASE" >> up_mem.h + @echo "#define CONFIG_HEAP1_BASE $(HEAP_BASE)" >> up_mem.h + @echo "" >>up_mem.h + @echo "#endif /* __UP_MEM_H */" >>up_mem.h + +asm_mem.h: + @echo " CONFIG_COMPILER_OTHER == 0" > asm_mem.h + @echo " CONFIG_COMPILER_SDCC == 1" >> asm_mem.h +ifeq ($(CC),sdcc) + @echo " CONFIG_COMPILER == 1" >> asm_mem.h +else + @echo " CONFIG_COMPILER == 0" >> asm_mem.h +endif + @echo " CONFIG_STACK_END == ($(CONFIG_DRAM_SIZE) - 1)" >> asm_mem.h + @echo " CONFIG_STACK_BASE == (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE))" >> asm_mem.h + @echo " CONFIG_HEAP1_END == (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE) - 1)" >> asm_mem.h + @echo " CONFIG_HEAP1_BASE == $(HEAP_BASE)" >> asm_mem.h + +# Combine all objects in this directory into a library + +libarch$(LIBEXT): up_mem.h asm_mem.h $(OBJS) + $(call ARCHIVE, $@, $(OBJS)) + +# This builds the libboard library in the board/ subdirectory + +board/libboard$(LIBEXT): + $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES) + +# This target builds the final executable + +pass1.lnk: + @echo "LD: pass1.hex" + @echo "--" >pass1.lnk # Non-interactive + @echo "-k $(BOARDDIR)" >>pass1.lnk # Path to board library + @echo "-k $(SDCC_LIBDIR)" >>pass1.lnk # Path to SDCC z80 library + @echo "-l libboard$(LIBEXT)" >>pass1.lnk # Name of board library + $(Q) for LIB in $(LINKLIBS); do \ + echo "-l $(TOPDIR)/lib/$$LIB" >> pass1.lnk ;\ + done + @echo "-l myz80.lib" >>pass1.lnk # Name of SDCC z80 library +ifneq ($(CONFIG_LINKER_START_AREA),) + @echo "-b START=$(CONFIG_LINKER_START_AREA)" >>pass1.lnk # Start of START area +else + @echo "-b START=0" >>pass1.lnk # Start of START area +endif +ifneq ($(CONFIG_LINKER_CODE_AREA),) + @echo "-b _CODE=$(CONFIG_LINKER_CODE_AREA)" >>pass1.lnk # Start of _CODE area +else + @echo "-b _CODE=256" >>pass1.lnk # Start of _CODE area +endif + @echo "-i" >>pass1.lnk # Intel hex format + @echo "-x" >>pass1.lnk # Hexadecimal + @echo "-m" >>pass1.lnk # Generate a map file + @echo "-j" >>pass1.lnk # Generate a symbol file + @echo "pass1.hex" >>pass1.lnk # Path to head object + @echo "$(HEAD_OBJ)" >>pass1.lnk # Path to head object + @echo "-e" >>pass1.lnk # End of script + +pass1.hex: up_mem.h asm_mem.h $(SDCC_LIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) pass1.lnk + @echo "LD: pass1.hex" + $(Q) $(LD) -f pass1.lnk + $(Q) rm -f up_mem.h asm_mem.h + $(Q) rm -f up_allocateheap$(OBJEXT) $(HEAD_OBJ) libarch$(LIBEXT) + $(Q) $(MAKE) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) + $(Q) $(MAKE) TOPDIR="$(TOPDIR)" $(HEAD_OBJ) + +nuttx.lnk: + @echo "--" >nuttx.lnk # Non-interactive + @echo "-k $(BOARDDIR)" >>nuttx.lnk # Path to board library + @echo "-k $(SDCC_LIBDIR)" >>nuttx.lnk # Path to SDCC z80 library + @echo "-l libboard$(LIBEXT)" >>nuttx.lnk # Name of board library + $(Q) for LIB in $(LINKLIBS); do \ + echo "-l $(TOPDIR)/lib/$$LIB" >> nuttx.lnk ;\ + done + @echo "-l myz80.lib" >>nuttx.lnk # Name of SDCC z80 library +ifneq ($(CONFIG_LINKER_START_AREA),) + @echo "-b START=$(CONFIG_LINKER_START_AREA)" >>nuttx.lnk # Start of START area +else + @echo "-b START=0" >>nuttx.lnk # Start of START area +endif +ifneq ($(CONFIG_LINKER_CODE_AREA),) + @echo "-b _CODE=$(CONFIG_LINKER_CODE_AREA)" >>nuttx.lnk # Start of _CODE area +else + @echo "-b _CODE=256" >>nuttx.lnk # Start of _CODE area +endif + @echo "-i" >>nuttx.lnk # Intel hex format + @echo "-x" >>nuttx.lnk # Hexadecimal + @echo "-m" >>nuttx.lnk # Generate a map file + @echo "-j" >>nuttx.lnk # Generate a symbol file + @echo "nuttx.ihx" >>nuttx.lnk # Path to head object + @echo "$(HEAD_OBJ)" >>nuttx.lnk # Path to head object + @echo "-e" >>nuttx.lnk # End of script + +nuttx$(EXEEXT): pass1.hex up_mem.h asm_mem.h $(SDCC_LIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) nuttx.lnk + @echo "LD: nuttx.ihx" + $(Q) $(LD) -f nuttx.lnk + $(Q) rm -f pass1.* + $(Q) cp -f nuttx.map $(TOPDIR)/. +ifeq ($(EXEEXT),.cmd) + sed s/:00000001FF/:00520001AD/ nuttx.ihx | \ + hex2cmd > $(TOPDIR)/nuttx.cmd +else + $(Q) packihx nuttx.ihx > $(TOPDIR)/nuttx$(EXEEXT) +endif + +# This is part of the top-level export target + +export_head: board/libboard$(LIBEXT) $(HEAD_OBJ) + $(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \ + cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \ + else \ + echo "$(EXPORT_DIR)/startup does not exist"; \ + exit 1; \ + fi + +# Build dependencies + +.depend: Makefile up_mem.h asm_mem.h chip/Make.defs $(DEPSRCS) + $(Q) if [ -e board/Makefile ]; then \ + $(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \ + fi + $(Q) $(MKDEP) --dep-path chip --dep-path common "$(CC)" -- $(CFLAGS) -- $(DEPSRCS) >Make.dep + $(Q) touch $@ + +depend: .depend + +clean: + $(Q) if [ -e board/Makefile ]; then \ + $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ + fi + $(call DELFILE, up_mem.h) + $(call DELFILE, asm_mem.h) + $(call DELFILE, pass1.*) + $(call DELFILE, nuttx.*) + $(call DELFILE, libarch$(LIBEXT)) + $(call CLEAN) + + +distclean: clean + $(Q) if [ -e board/Makefile ]; then \ + $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \ + fi + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + +-include Make.dep diff --git a/nuttx/arch/z80/src/Makefile.sdccw b/nuttx/arch/z80/src/Makefile.sdccw new file mode 100644 index 000000000..5841136eb --- /dev/null +++ b/nuttx/arch/z80/src/Makefile.sdccw @@ -0,0 +1,274 @@ +############################################################################ +# arch/z80/src/Makefile.sdccw +# +# Copyright (C) 2008, 2011-2012 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. +# +############################################################################ + +############################################################################ +# Tools +# CFLAGS, CPPFLAGS, ASFLAGS, LDFLAGS are set in $(TOPDIR)\Make.defs + +CFLAGS += -I$(ARCH_SRCDIR)\chip -I$(ARCH_SRCDIR)\common -I$(TOPDIR)\sched +CPPFLAGS += -D__ASSEMBLY__ + +############################################################################ +# Files and directories + +# There should be one head source (.asm file) + +HEAD_OBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT)) + +# Assembly sources and objects + +ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS) +AOBJS = $(ASRCS:$(ASMEXT)=$(OBJEXT)) + +# C sources and objects + +CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS) +COBJS = $(CSRCS:.c=$(OBJEXT)) + +# All sources and objcts + +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +# Sources that can have dependencies (no .asm files) + +DEPSRCS = $(CSRCS) + +# Directories + +ARCH_SRCDIR = $(TOPDIR)\arch\$(CONFIG_ARCH)\src +BOARDDIR = $(TOPDIR)\arch\$(CONFIG_ARCH)\src\board + +VPATH = chip:common:board + +# Libraries + +LIBGCC = ${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name} + +# Supports dynamic sizing of HEAP. +# +HEAP_BASE = ${shell .\mkhpbase.bat} + +############################################################################ +# Targets + +all: $(HEAD_OBJ) libarch$(LIBEXT) + +.PHONY: board\libboard$(LIBEXT) pass1.lnk nuttx.lnk + +$(AOBJS) $(HEAD_OBJ): %$(OBJEXT): %$(ASMEXT) + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +# This is a kludge to work around some conflicting symbols in the SDCC libraries + +$(SDCC_LIBDIR)\myz80.lib: $(SDCC_LIBDIR)\$(SDCCLIB) +ifeq ($(CONFIG_SDCC_OLD),y) + $(Q) cat $(SDCC_LIBDIR)\$(SDCCLIB) | \ + grep -v alloc | grep -v free | grep -v printf | \ + grep -v _str | grep -v _mem | grep -v crt0\.o \ + > myz80.lib + $(Q) mv -f myz80.lib $(SDCC_LIBDIR)\myz80.lib +else + $(Q) cp $(SDCC_LIBDIR)\z80.lib $(SDCC_LIBDIR)\myz80.lib + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _calloc.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _malloc.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _realloc.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _free.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib printf_large.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib sprintf.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib vprintf.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib strcpy.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib strlen.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strcat.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strchr.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strcmp.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strcspn.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strncat.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strncmp.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strncpy.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strpbrk.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strrchr.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strspn.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strstr.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strtok.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memchr.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memcmp.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memcpy.rel + $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memset.rel +endif + +# Create a header file that contains addressing information needed by the code + +up_mem.h: + @echo #ifndef __UP_MEM_H>up_mem.h + @echo #define __UP_MEM_H>>up_mem.h + @echo #include ^>>up_mem.h + @echo #define CONFIG_STACK_END $(CONFIG_DRAM_SIZE)>> up_mem.h + @echo #define CONFIG_STACK_BASE (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE))>> up_mem.h + @echo #define CONFIG_HEAP1_END CONFIG_STACK_BASE>> up_mem.h + @echo #define CONFIG_HEAP1_BASE $(HEAP_BASE)>> up_mem.h + @echo #endif /* __UP_MEM_H */>>up_mem.h + +asm_mem.h: + @echo CONFIG_COMPILER_OTHER == ^0>asm_mem.h + @echo CONFIG_COMPILER_SDCC == ^1>>asm_mem.h +ifeq ($(CC),sdcc) + @echo CONFIG_COMPILER == ^1>>asm_mem.h +else + @echo CONFIG_COMPILER == ^0>>asm_mem.h +endif + @echo CONFIG_STACK_END == ($(CONFIG_DRAM_SIZE) - 1)>>asm_mem.h + @echo CONFIG_STACK_BASE == (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE))>>asm_mem.h + @echo CONFIG_HEAP1_END == (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE) - 1)>>asm_mem.h + @echo CONFIG_HEAP1_BASE == $(HEAP_BASE)>>asm_mem.h + +# Combine all objects in this directory into a library + +libarch$(LIBEXT): up_mem.h asm_mem.h $(OBJS) + $(call ARCHIVE, $@, $(OBJS)) + +# This builds the libboard library in the board\ subdirectory + +board\libboard$(LIBEXT): + $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES) + +# This target builds the final executable + +pass1.lnk: + @echo LD: pass1.lnk + @echo -->pass1.lnk + @echo -k $(BOARDDIR)>>pass1.lnk + @echo -k $(SDCC_LIBDIR)>>pass1.lnk + @echo -l libboard$(LIBEXT)>>pass1.lnk + $(Q) for %%G in ($(LINKLIBS)) do ( echo -l $(TOPDIR)\lib\%%G>> pass1.lnk ) + @echo -l myz80.lib>>pass1.lnk +ifneq ($(CONFIG_LINKER_START_AREA),) + @echo -b START=$(CONFIG_LINKER_START_AREA)>>pass1.lnk +else + @echo -b START=0>>pass1.lnk +endif +ifneq ($(CONFIG_LINKER_CODE_AREA),) + @echo -b _CODE=$(CONFIG_LINKER_CODE_AREA)>>pass1.lnk +else + @echo -b _CODE=256>>pass1.lnk +endif + @echo -i>>pass1.lnk + @echo -x>>pass1.lnk + @echo -m>>pass1.lnk + @echo -j>>pass1.lnk + @echo pass1.hex>>pass1.lnk + @echo $(HEAD_OBJ)>>pass1.lnk + @echo -e>>pass1.lnk + +pass1.hex: up_mem.h asm_mem.h $(SDCC_LIBDIR)\myz80.lib $(HEAD_OBJ) board\libboard$(LIBEXT) pass1.lnk + @echo LD: pass1.hex + $(Q) $(LD) -f pass1.lnk + $(Q) rm -f up_mem.h asm_mem.h + $(Q) rm -f up_allocateheap$(OBJEXT) $(HEAD_OBJ) libarch$(LIBEXT) + $(Q) $(MAKE) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) + $(Q) $(MAKE) TOPDIR="$(TOPDIR)" $(HEAD_OBJ) + +nuttx.lnk: + @echo LD: nuttx.lnk + @echo -->nuttx.lnk + @echo -k $(BOARDDIR)>>nuttx.lnk + @echo -k $(SDCC_LIBDIR)>>nuttx.lnk + @echo -l libboard$(LIBEXT)>>nuttx.lnk + $(Q) for %%G in ($(LINKLIBS)) do ( echo -l $(TOPDIR)\lib\%%G>> nuttx.lnk ) + @echo -l myz80.lib>>nuttx.lnk +ifneq ($(CONFIG_LINKER_START_AREA),) + @echo -b START=$(CONFIG_LINKER_START_AREA)>>nuttx.lnk +else + @echo -b START=0>>nuttx.lnk +endif +ifneq ($(CONFIG_LINKER_CODE_AREA),) + @echo -b _CODE=$(CONFIG_LINKER_CODE_AREA)>>nuttx.lnk +else + @echo -b _CODE=256>>nuttx.lnk +endif + @echo -i>>nuttx.lnk + @echo -x>>nuttx.lnk + @echo -m>>nuttx.lnk + @echo -j>>nuttx.lnk + @echo nuttx.ihx>>nuttx.lnk + @echo $(HEAD_OBJ)>>nuttx.lnk + @echo -e>>nuttx.lnk + +nuttx$(EXEEXT): pass1.hex up_mem.h asm_mem.h $(SDCC_LIBDIR)\myz80.lib $(HEAD_OBJ) board\libboard$(LIBEXT) nuttx.lnk + @echo LD: nuttx.ihx + $(Q) $(LD) -f nuttx.lnk + $(call DELFILE, pass1.*) + $(Q) cp -f nuttx.map $(TOPDIR)\. +ifeq ($(EXEEXT),.cmd) + sed s/:00000001FF/:00520001AD/ nuttx.ihx | \ + hex2cmd > $(TOPDIR)\nuttx.cmd +else + $(Q) packihx nuttx.ihx > $(TOPDIR)\nuttx$(EXEEXT) +endif + +# This is part of the top-level export target + +export_head: board\libboard$(LIBEXT) $(HEAD_OBJ) + $(Q) if not exist board\Makefile ( echo $(EXPORT_DIR)\startup does not exist ) + $(Q) if exist board\Makefile ( cp -f $(HEAD_OBJ) "$(EXPORT_DIR)\startup" ) + +# Build dependencies + +.depend: Makefile up_mem.h asm_mem.h chip\Make.defs $(DEPSRCS) + $(Q) if exist board\Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" depend ) + $(Q) $(MKDEP) --dep-path chip --dep-path common "$(CC)" -- $(CFLAGS) -- $(DEPSRCS) >Make.dep + $(Q) touch $@ + +depend: .depend + +clean: + $(Q) if exist board\Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ) + $(call DELFILE, up_mem.h) + $(call DELFILE, asm_mem.h) + $(call DELFILE, pass1.*) + $(call DELFILE, nuttx.*) + $(call DELFILE, libarch$(LIBEXT)) + $(call CLEAN) + + +distclean: clean + $(Q) if exist board\Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + +-include Make.dep diff --git a/nuttx/arch/z80/src/Makefile.zdsii b/nuttx/arch/z80/src/Makefile.zdsii deleted file mode 100644 index 1615763d1..000000000 --- a/nuttx/arch/z80/src/Makefile.zdsii +++ /dev/null @@ -1,221 +0,0 @@ -############################################################################ -# arch/z80/src/Makefile.zdsii -# -# Copyright (C) 2008, 2011-2012 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. -# -############################################################################ - --include $(TOPDIR)\Make.defs - -############################################################################ -# Tools -SCHEDSRCDIR = $(TOPDIR)$(DELIM)sched -ARCHSRCDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - USRINCLUDES = -usrinc:".;$(SCHEDSRCDIR);$(ARCHSRCDIR);$(ARCHSRCDIR)\common" -else - WSCHEDSRCDIR = ${shell cygpath -w $(SCHEDSRCDIR)} - WARCHSRCDIR = ${shell cygpath -w $(ARCHSRCDIR)} - USRINCLUDES = -usrinc:'.;$(WSCHEDSRCDIR);$(WARCHSRCDIR);$(WARCHSRCDIR)\common' -endif - -INCLUDES = $(ARCHSTDINCLUDES) $(USRINCLUDES) -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -CPPFLAGS += -I$(ARCHSRCDIR) -I$(ZDSSTDINCDIR) -I$(ZDSZILOGINCDIR) -LDFLAGS += @nuttx.linkcmd - -############################################################################ -# Files and directories -ifneq ($(HEAD_SSRC),) -HEAD_GENSRC = $(HEAD_SSRC:.S=$(ASMEXT)) -HEAD_OBJ = $(HEAD_SSRC:.S=$(OBJEXT)) -else -HEAD_OBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT)) -endif - -SSRCS = $(CHIP_SSRCS) $(CMN_SSRCS) -ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS) -GENSRCS = $(SSRCS:.S=$(ASMEXT)) -AOBJS = $(SSRCS:.S=$(OBJEXT)) $(ASRCS:$(ASMEXT)=$(OBJEXT)) - -CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -DEPSRCS = $(SSRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -BOARDDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board - -VPATH = chip:common - -############################################################################ -# Targets - -all: $(HEAD_OBJ) libarch$(LIBEXT) - -.PHONY: board$(DELIM)libboard$(LIBEXT) - -$(HEAD_GENSRC) $(GENSRCS) : %$(ASMEXT): %.S - $(Q) $(CPP) $(CPPFLAGS) $< -o $@.tmp - $(Q) cat $@.tmp | sed -e "s/^#/;/g" > $@ - $(Q) rm $@.tmp - -$(AOBJS) $(HEAD_OBJ): %$(OBJEXT): %$(ASMEXT) - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -libarch$(LIBEXT): $(OBJS) - $(call ARCHIVE, $@, $(OBJS)) - -board$(DELIM)libboard$(LIBEXT): - $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES) - -nuttx.linkcmd: $(LINKCMDTEMPLATE) - $(Q) cp -f $(LINKCMDTEMPLATE) nuttx.linkcmd -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - @echo "$(TOPDIR)\nuttx"= \>>nuttx.linkcmd - @echo "$(ARCHSRCDIR)\$(HEAD_OBJ)", \>>nuttx.linkcmd - $(Q) for %%G in ($(LINKLIBS)) do ( echo "$(TOPDIR)\lib\%%G", \>>nuttx.linkcmd ) - @echo "$(ARCHSRCDIR)\board\libboard$(LIBEXT)", \>>nuttx.linkcmd -ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) - @echo "$(ZDSSTDLIBDIR)\chelprevaaD$(LIBEXT)", \>>nuttx.linkcmd - @echo "$(ZDSSTDLIBDIR)\crtrevaaLDD$(LIBEXT)", \>>nuttx.linkcmd - @echo "$(ZDSSTDLIBDIR)\fprevaaLDD$(LIBEXT)", \>>nuttx.linkcmd - @echo "$(ZDSZILOGLIBDIR)\csiorevaaLDD$(LIBEXT)", \>>nuttx.linkcmd - @echo "$(ZDSZILOGLIBDIR)\zsldevinitdummy$(LIBEXT)">>nuttx.linkcmd -endif -ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y) - @echo "$(ZDSSTDLIBDIR)\chelpD$(LIBEXT)", \>>nuttx.linkcmd - @echo "$(ZDSSTDLIBDIR)\crtLDD$(LIBEXT)", \>>nuttx.linkcmd - @echo "$(ZDSSTDLIBDIR)\fpdumyLD$(LIBEXT)", \>>nuttx.linkcmd - @echo "$(ZDSZILOGLIBDIR)\csioLDD$(LIBEXT)", \>>nuttx.linkcmd - @echo "$(ZDSZILOGLIBDIR)\zsldevinitdummy$(LIBEXT)">>nuttx.linkcmd -endif -ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) - @echo "$(ZDSSTDLIBDIR)\chelp$(LIBEXT)", \>>nuttx.linkcmd - @echo "$(ZDSSTDLIBDIR)\crt$(LIBEXT)", \>>nuttx.linkcmd - @echo "$(ZDSSTDLIBDIR)\fplib$(LIBEXT)", \>>nuttx.linkcmd - @echo "$(ZDSZILOGLIBDIR)\gpio$(LIBEXT)", \>>nuttx.linkcmd - @echo "$(ZDSZILOGLIBDIR)\uartf91$(LIBEXT)">>nuttx.linkcmd -endif -else - @echo "\"${shell cygpath -w "$(TOPDIR)/nuttx"}\"= \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w "$(ARCHSRCDIR)/$(HEAD_OBJ)"}\", \\" >>nuttx.linkcmd - $(Q) ( for lib in $(LINKLIBS); do \ - echo " \"`cygpath -w "$(TOPDIR)/lib/$${lib}"`\", \\" >>nuttx.linkcmd; \ - done ; ) - @echo " \"${shell cygpath -w "$(ARCHSRCDIR)/board/libboard$(LIBEXT)"}\", \\" >>nuttx.linkcmd -ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) - @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/chelprevaaD$(LIBEXT)"}\", \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/crtrevaaLDD$(LIBEXT)"}\", \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/fprevaaLDD$(LIBEXT)"}\", \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w "$(ZDSZILOGLIBDIR)/csiorevaaLDD$(LIBEXT)"}\", \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w "$(ZDSZILOGLIBDIR)/zsldevinitdummy$(LIBEXT)"}\"" >>nuttx.linkcmd -endif -ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y) - @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/chelpD$(LIBEXT)"}\", \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/crtLDD$(LIBEXT)"}\", \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/fpdumyLD$(LIBEXT)"}\", \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w "$(ZDSZILOGLIBDIR)/csioLDD$(LIBEXT)"}\", \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w "$(ZDSZILOGLIBDIR)/zsldevinitdummy$(LIBEXT)"}\"" >>nuttx.linkcmd -endif -ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) - @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/chelp$(LIBEXT)"}\", \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/crt$(LIBEXT)"}\", \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/fplib$(LIBEXT)"}\", \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w "$(ZDSZILOGLIBDIR)/gpio$(LIBEXT)"}\", \\" >>nuttx.linkcmd - @echo " \"${shell cygpath -w "$(ZDSZILOGLIBDIR)/uartf91$(LIBEXT)"}\"" >>nuttx.linkcmd -endif -endif - -nuttx$(EXEEXT): $(HEAD_OBJ) board$(DELIM)libboard$(LIBEXT) nuttx.linkcmd - @echo "LD: nuttx$(EXEEXT)" - $(Q) "$(LD)" $(LDFLAGS) - -.depend: Makefile chip$(DELIM)Make.defs $(DEPSRCS) -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - $(Q) if exist board$(DELIM)Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" depend ) -else - $(Q) if [ -e board$(DELIM)Makefile ]; then \ - $(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \ - fi -endif - $(Q) $(MKDEP) --dep-path chip --dep-path common "$(CC)" -- $(CFLAGS) -- $(DEPSRCS) >Make.dep - $(Q) touch $@ - -# This is part of the top-level export target - -export_head: board$(DELIM)libboard$(LIBEXT) $(HEAD_OBJ) -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - $(Q) if exist "$(EXPORT_DIR)$(DELIM)startup" ( copy $(HEAD_OBJ) "$(EXPORT_DIR)$(DELIM)startup$(DELIM)." /b /y) -else - $(Q) if [ -d "$(EXPORT_DIR)$(DELIM)startup" ]; then \ - cp -f $(HEAD_OBJ) "$(EXPORT_DIR)$(DELIM)startup"; \ - else \ - echo "$(EXPORT_DIR)$(DELIM)startup does not exist"; \ - exit 1; \ - fi -endif - -# Dependencies - -depend: .depend - -clean: -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - $(Q) if exist board$(DELIM)Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ) -else - $(Q) if [ -e board$(DELIM)Makefile ]; then \ - $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ - fi -endif - $(call DELFILE, nuttx.linkcmd) - $(call DELFILE, *.asm) - $(call DELFILE, *.tmp) - $(call DELFILE, *.map) - $(call DELFILE, libarch$(LIBEXT)) - $(call CLEAN) - -distclean: clean -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - $(Q) if exist board$(DELIM)Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ) -else - $(Q) if [ -e board$(DELIM)Makefile ]; then \ - $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \ - fi -endif - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - --include Make.dep diff --git a/nuttx/arch/z80/src/Makefile.zdsiil b/nuttx/arch/z80/src/Makefile.zdsiil new file mode 100644 index 000000000..87ada571f --- /dev/null +++ b/nuttx/arch/z80/src/Makefile.zdsiil @@ -0,0 +1,173 @@ +############################################################################ +# arch/z80/src/Makefile.zdsiil +# +# Copyright (C) 2008, 2011-2012 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. +# +############################################################################ + +-include $(TOPDIR)\Make.defs + +############################################################################ +# Tools +SCHEDSRCDIR = $(TOPDIR)$(DELIM)sched +ARCHSRCDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src + +WSCHEDSRCDIR = ${shell cygpath -w $(SCHEDSRCDIR)} +WARCHSRCDIR = ${shell cygpath -w $(ARCHSRCDIR)} +USRINCLUDES = -usrinc:'.;$(WSCHEDSRCDIR);$(WARCHSRCDIR);$(WARCHSRCDIR)\common' + +INCLUDES = $(ARCHSTDINCLUDES) $(USRINCLUDES) +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS += -I$(ARCHSRCDIR) -I$(ZDSSTDINCDIR) -I$(ZDSZILOGINCDIR) +LDFLAGS += @nuttx.linkcmd + +############################################################################ +# Files and directories +ifneq ($(HEAD_SSRC),) +HEAD_GENSRC = $(HEAD_SSRC:.S=$(ASMEXT)) +HEAD_OBJ = $(HEAD_SSRC:.S=$(OBJEXT)) +else +HEAD_OBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT)) +endif + +SSRCS = $(CHIP_SSRCS) $(CMN_SSRCS) +ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS) +GENSRCS = $(SSRCS:.S=$(ASMEXT)) +AOBJS = $(SSRCS:.S=$(OBJEXT)) $(ASRCS:$(ASMEXT)=$(OBJEXT)) + +CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS) +COBJS = $(CSRCS:.c=$(OBJEXT)) + +DEPSRCS = $(SSRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +BOARDDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board + +VPATH = chip:common + +############################################################################ +# Targets + +all: $(HEAD_OBJ) libarch$(LIBEXT) + +.PHONY: board$(DELIM)libboard$(LIBEXT) + +$(HEAD_GENSRC) $(GENSRCS) : %$(ASMEXT): %.S + $(Q) $(CPP) $(CPPFLAGS) $< -o $@.tmp + $(Q) cat $@.tmp | sed -e "s/^#/;/g" > $@ + $(Q) rm $@.tmp + +$(AOBJS) $(HEAD_OBJ): %$(OBJEXT): %$(ASMEXT) + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +libarch$(LIBEXT): $(OBJS) + $(call ARCHIVE, $@, $(OBJS)) + +board$(DELIM)libboard$(LIBEXT): + $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES) + +nuttx.linkcmd: $(LINKCMDTEMPLATE) + $(Q) cp -f $(LINKCMDTEMPLATE) nuttx.linkcmd + @echo "\"${shell cygpath -w "$(TOPDIR)/nuttx"}\"= \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w "$(ARCHSRCDIR)/$(HEAD_OBJ)"}\", \\" >>nuttx.linkcmd + $(Q) ( for lib in $(LINKLIBS); do \ + echo " \"`cygpath -w "$(TOPDIR)/lib/$${lib}"`\", \\" >>nuttx.linkcmd; \ + done ; ) + @echo " \"${shell cygpath -w "$(ARCHSRCDIR)/board/libboard$(LIBEXT)"}\", \\" >>nuttx.linkcmd +ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) + @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/chelprevaaD$(LIBEXT)"}\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/crtrevaaLDD$(LIBEXT)"}\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/fprevaaLDD$(LIBEXT)"}\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w "$(ZDSZILOGLIBDIR)/csiorevaaLDD$(LIBEXT)"}\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w "$(ZDSZILOGLIBDIR)/zsldevinitdummy$(LIBEXT)"}\"" >>nuttx.linkcmd +endif +ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y) + @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/chelpD$(LIBEXT)"}\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/crtLDD$(LIBEXT)"}\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/fpdumyLD$(LIBEXT)"}\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w "$(ZDSZILOGLIBDIR)/csioLDD$(LIBEXT)"}\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w "$(ZDSZILOGLIBDIR)/zsldevinitdummy$(LIBEXT)"}\"" >>nuttx.linkcmd +endif +ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) + @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/chelp$(LIBEXT)"}\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/crt$(LIBEXT)"}\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w "$(ZDSSTDLIBDIR)/fplib$(LIBEXT)"}\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w "$(ZDSZILOGLIBDIR)/gpio$(LIBEXT)"}\", \\" >>nuttx.linkcmd + @echo " \"${shell cygpath -w "$(ZDSZILOGLIBDIR)/uartf91$(LIBEXT)"}\"" >>nuttx.linkcmd +endif + +nuttx$(EXEEXT): $(HEAD_OBJ) board$(DELIM)libboard$(LIBEXT) nuttx.linkcmd + @echo "LD: nuttx$(EXEEXT)" + $(Q) "$(LD)" $(LDFLAGS) + +.depend: Makefile chip$(DELIM)Make.defs $(DEPSRCS) + $(Q) if [ -e board$(DELIM)Makefile ]; then \ + $(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \ + fi + $(Q) $(MKDEP) --dep-path chip --dep-path common "$(CC)" -- $(CFLAGS) -- $(DEPSRCS) >Make.dep + $(Q) touch $@ + +# This is part of the top-level export target + +export_head: board$(DELIM)libboard$(LIBEXT) $(HEAD_OBJ) + $(Q) if [ -d "$(EXPORT_DIR)$(DELIM)startup" ]; then \ + cp -f $(HEAD_OBJ) "$(EXPORT_DIR)$(DELIM)startup"; \ + else \ + echo "$(EXPORT_DIR)$(DELIM)startup does not exist"; \ + exit 1; \ + fi + +# Dependencies + +depend: .depend + +clean: + $(Q) if [ -e board$(DELIM)Makefile ]; then \ + $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ + fi + $(call DELFILE, nuttx.linkcmd) + $(call DELFILE, *.asm) + $(call DELFILE, *.tmp) + $(call DELFILE, *.map) + $(call DELFILE, libarch$(LIBEXT)) + $(call CLEAN) + +distclean: clean + $(Q) if [ -e board$(DELIM)Makefile ]; then \ + $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \ + fi + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + +-include Make.dep diff --git a/nuttx/arch/z80/src/Makefile.zdsiiw b/nuttx/arch/z80/src/Makefile.zdsiiw new file mode 100644 index 000000000..bf599ecae --- /dev/null +++ b/nuttx/arch/z80/src/Makefile.zdsiiw @@ -0,0 +1,156 @@ +############################################################################ +# arch/z80/src/Makefile.zdsiiw +# +# Copyright (C) 2008, 2011-2012 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. +# +############################################################################ + +-include $(TOPDIR)\Make.defs + +# Tools + +SCHEDSRCDIR = $(TOPDIR)$(DELIM)sched +ARCHSRCDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src +USRINCLUDES = -usrinc:".;$(SCHEDSRCDIR);$(ARCHSRCDIR);$(ARCHSRCDIR)\common" + +INCLUDES = $(ARCHSTDINCLUDES) $(USRINCLUDES) +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS += -I$(ARCHSRCDIR) -I$(ZDSSTDINCDIR) -I$(ZDSZILOGINCDIR) +LDFLAGS += @nuttx.linkcmd + +# Files and directories + +ifneq ($(HEAD_SSRC),) +HEAD_GENSRC = $(HEAD_SSRC:.S=$(ASMEXT)) +HEAD_OBJ = $(HEAD_SSRC:.S=$(OBJEXT)) +else +HEAD_OBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT)) +endif + +SSRCS = $(CHIP_SSRCS) $(CMN_SSRCS) +ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS) +GENSRCS = $(SSRCS:.S=$(ASMEXT)) +AOBJS = $(SSRCS:.S=$(OBJEXT)) $(ASRCS:$(ASMEXT)=$(OBJEXT)) + +CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS) +COBJS = $(CSRCS:.c=$(OBJEXT)) + +DEPSRCS = $(SSRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +BOARDDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board + +VPATH = chip:common + +# Targets + +all: $(HEAD_OBJ) libarch$(LIBEXT) + +.PHONY: board$(DELIM)libboard$(LIBEXT) + +$(HEAD_GENSRC) $(GENSRCS) : %$(ASMEXT): %.S + $(Q) $(CPP) $(CPPFLAGS) $< -o $@.tmp + $(Q) cat $@.tmp | sed -e "s/^#/;/g" > $@ + $(Q) rm $@.tmp + +$(AOBJS) $(HEAD_OBJ): %$(OBJEXT): %$(ASMEXT) + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +libarch$(LIBEXT): $(OBJS) + $(call ARCHIVE, $@, $(OBJS)) + +board$(DELIM)libboard$(LIBEXT): + $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES) + +nuttx.linkcmd: $(LINKCMDTEMPLATE) + $(Q) cp -f $(LINKCMDTEMPLATE) nuttx.linkcmd + @echo "$(TOPDIR)\nuttx"= \>>nuttx.linkcmd + @echo "$(ARCHSRCDIR)\$(HEAD_OBJ)", \>>nuttx.linkcmd + $(Q) for %%G in ($(LINKLIBS)) do ( echo "$(TOPDIR)\lib\%%G", \>>nuttx.linkcmd ) + @echo "$(ARCHSRCDIR)\board\libboard$(LIBEXT)", \>>nuttx.linkcmd +ifeq ($(CONFIG_ARCH_CHIP_Z8F640X),y) + @echo "$(ZDSSTDLIBDIR)\chelprevaaD$(LIBEXT)", \>>nuttx.linkcmd + @echo "$(ZDSSTDLIBDIR)\crtrevaaLDD$(LIBEXT)", \>>nuttx.linkcmd + @echo "$(ZDSSTDLIBDIR)\fprevaaLDD$(LIBEXT)", \>>nuttx.linkcmd + @echo "$(ZDSZILOGLIBDIR)\csiorevaaLDD$(LIBEXT)", \>>nuttx.linkcmd + @echo "$(ZDSZILOGLIBDIR)\zsldevinitdummy$(LIBEXT)">>nuttx.linkcmd +endif +ifeq ($(CONFIG_ARCH_CHIP_Z8F642X),y) + @echo "$(ZDSSTDLIBDIR)\chelpD$(LIBEXT)", \>>nuttx.linkcmd + @echo "$(ZDSSTDLIBDIR)\crtLDD$(LIBEXT)", \>>nuttx.linkcmd + @echo "$(ZDSSTDLIBDIR)\fpdumyLD$(LIBEXT)", \>>nuttx.linkcmd + @echo "$(ZDSZILOGLIBDIR)\csioLDD$(LIBEXT)", \>>nuttx.linkcmd + @echo "$(ZDSZILOGLIBDIR)\zsldevinitdummy$(LIBEXT)">>nuttx.linkcmd +endif +ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) + @echo "$(ZDSSTDLIBDIR)\chelp$(LIBEXT)", \>>nuttx.linkcmd + @echo "$(ZDSSTDLIBDIR)\crt$(LIBEXT)", \>>nuttx.linkcmd + @echo "$(ZDSSTDLIBDIR)\fplib$(LIBEXT)", \>>nuttx.linkcmd + @echo "$(ZDSZILOGLIBDIR)\gpio$(LIBEXT)", \>>nuttx.linkcmd + @echo "$(ZDSZILOGLIBDIR)\uartf91$(LIBEXT)">>nuttx.linkcmd +endif + +nuttx$(EXEEXT): $(HEAD_OBJ) board$(DELIM)libboard$(LIBEXT) nuttx.linkcmd + @echo "LD: nuttx$(EXEEXT)" + $(Q) "$(LD)" $(LDFLAGS) + +.depend: Makefile chip$(DELIM)Make.defs $(DEPSRCS) + $(Q) if exist board$(DELIM)Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" depend ) + $(Q) $(MKDEP) --dep-path chip --dep-path common "$(CC)" -- $(CFLAGS) -- $(DEPSRCS) >Make.dep + $(Q) touch $@ + +# This is part of the top-level export target + +export_head: board$(DELIM)libboard$(LIBEXT) $(HEAD_OBJ) + $(Q) if exist "$(EXPORT_DIR)$(DELIM)startup" ( copy $(HEAD_OBJ) "$(EXPORT_DIR)$(DELIM)startup$(DELIM)." /b /y) + +# Dependencies + +depend: .depend + +clean: + $(Q) if exist board$(DELIM)Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ) + $(call DELFILE, nuttx.linkcmd) + $(call DELFILE, *.asm) + $(call DELFILE, *.tmp) + $(call DELFILE, *.map) + $(call DELFILE, libarch$(LIBEXT)) + $(call CLEAN) + +distclean: clean + $(Q) if exist board$(DELIM)Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + +-include Make.dep diff --git a/nuttx/arch/z80/src/mkhpbase.bat b/nuttx/arch/z80/src/mkhpbase.bat new file mode 100755 index 000000000..8792f73a4 --- /dev/null +++ b/nuttx/arch/z80/src/mkhpbase.bat @@ -0,0 +1,45 @@ +@echo off + +rem arch/z80/src/mkhpbase.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. +rem + +rem +rem This script supports dynamic sizing of HEAP when building with the SDCC +rem toolchain. This script adds up the size of each section of the program. +rem This does not account for the alignment of the _CODE area to 0x0100 (hence +rem the fudge factor 196 is added). +rem +rem -- There must be a better way! --- +rem + +echo (CONFIG_HEAP1_END - 8192) diff --git a/nuttx/configs/pjrc-8051/Make.defs b/nuttx/configs/pjrc-8051/Make.defs index 8dd552990..803455522 100644 --- a/nuttx/configs/pjrc-8051/Make.defs +++ b/nuttx/configs/pjrc-8051/Make.defs @@ -53,6 +53,7 @@ CC = sdcc CPP = sdcpp LD = aslink AS = asx8051 +#AR = sdar -r AR = sdcclib -a CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ diff --git a/nuttx/configs/xtrs/nsh/Make.defs b/nuttx/configs/xtrs/nsh/Make.defs index 749b69315..db67b931c 100644 --- a/nuttx/configs/xtrs/nsh/Make.defs +++ b/nuttx/configs/xtrs/nsh/Make.defs @@ -58,15 +58,16 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp -AR = sdcclib -a ifeq ($(CONFIG_SDCC_OLD),y) LD = link-z80 AS = as-z80 + AR = sdcclib -a ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else LD = sdldz80 AS = sdasz80 + AR = sdar -r ARCHCPUFLAGS = -mz80 endif diff --git a/nuttx/configs/xtrs/ostest/Make.defs b/nuttx/configs/xtrs/ostest/Make.defs index 550c70d3c..355501737 100644 --- a/nuttx/configs/xtrs/ostest/Make.defs +++ b/nuttx/configs/xtrs/ostest/Make.defs @@ -58,15 +58,16 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp -AR = sdcclib -a ifeq ($(CONFIG_SDCC_OLD),y) LD = link-z80 AS = as-z80 + AR = sdcclib -a ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else LD = sdldz80 AS = sdasz80 + AR = sdar -r ARCHCPUFLAGS = -mz80 endif diff --git a/nuttx/configs/xtrs/pashello/Make.defs b/nuttx/configs/xtrs/pashello/Make.defs index 409e303c1..641b9426d 100644 --- a/nuttx/configs/xtrs/pashello/Make.defs +++ b/nuttx/configs/xtrs/pashello/Make.defs @@ -58,15 +58,16 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp -AR = sdcclib -a ifeq ($(CONFIG_SDCC_OLD),y) LD = link-z80 AS = as-z80 + AR = sdcclib -a ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else LD = sdldz80 AS = sdasz80 + AR = sdar -r ARCHCPUFLAGS = -mz80 endif diff --git a/nuttx/configs/z80sim/nsh/Make.defs b/nuttx/configs/z80sim/nsh/Make.defs index a5b325e79..1edd5fdcf 100644 --- a/nuttx/configs/z80sim/nsh/Make.defs +++ b/nuttx/configs/z80sim/nsh/Make.defs @@ -58,15 +58,16 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp -AR = sdcclib -a ifeq ($(CONFIG_SDCC_OLD),y) LD = link-z80 AS = as-z80 + AR = sdcclib -a ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else LD = sdldz80 AS = sdasz80 + AR = sdar -r ARCHCPUFLAGS = -mz80 endif diff --git a/nuttx/configs/z80sim/ostest/Make.defs b/nuttx/configs/z80sim/ostest/Make.defs index 54b6d8c45..91d30a061 100644 --- a/nuttx/configs/z80sim/ostest/Make.defs +++ b/nuttx/configs/z80sim/ostest/Make.defs @@ -58,15 +58,16 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp -AR = sdcclib -a ifeq ($(CONFIG_SDCC_OLD),y) LD = link-z80 AS = as-z80 + AR = sdcclib -a ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else LD = sdldz80 AS = sdasz80 + AR = sdar -r ARCHCPUFLAGS = -mz80 endif diff --git a/nuttx/configs/z80sim/pashello/Make.defs b/nuttx/configs/z80sim/pashello/Make.defs index 076aad7ed..2dca56a0e 100644 --- a/nuttx/configs/z80sim/pashello/Make.defs +++ b/nuttx/configs/z80sim/pashello/Make.defs @@ -58,15 +58,16 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp -AR = sdcclib -a ifeq ($(CONFIG_SDCC_OLD),y) LD = link-z80 AS = as-z80 + AR = sdcclib -a ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else LD = sdldz80 AS = sdasz80 + AR = sdar -r ARCHCPUFLAGS = -mz80 endif diff --git a/nuttx/configs/z80sim/src/z80_lowputc.c b/nuttx/configs/z80sim/src/z80_lowputc.c index e23caeb0f..9b46b4880 100644 --- a/nuttx/configs/z80sim/src/z80_lowputc.c +++ b/nuttx/configs/z80sim/src/z80_lowputc.c @@ -76,6 +76,7 @@ void z80_lowputc(char ch) __naked { +#ifdef CONFIG_SDCC_OLD _asm ld hl, #2 add hl, sp @@ -83,6 +84,15 @@ void z80_lowputc(char ch) __naked out (0xbe), a ret _endasm; +#else + __asm__ ( + "\tld hl, #2\n" + "\tadd hl, sp\n" + "\tld a, (hl)\n" + "\tout (0xbe), a\n" + "\tret\n" + ); +#endif } /******************************************************************************** @@ -94,10 +104,19 @@ void z80_lowputc(char ch) __naked char z80_lowgetc(void) __naked { +#ifdef CONFIG_SDCC_OLD _asm in a, (0xbe) ld l, a ld h, #0 ret _endasm; +#else + __asm__ ( + "\tin a, (0xbe)\n" + "\tld l, a\n" + "\tld h, #0\n" + "\tret\n" + ); +#endif } -- cgit v1.2.3 From 4c98d2e73211a2bde3530c9f1f369efa0d0745e1 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 5 Dec 2012 16:28:33 +0000 Subject: z80sim/ostest now builds okay under Linux with SDCC 3.2.1 git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5414 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z80/src/Makefile.sdccl | 87 +++++++++++++++++++-------------------- nuttx/arch/z80/src/Makefile.sdccw | 75 +++++++++++++++++---------------- nuttx/configs/z80sim/README.txt | 17 -------- 3 files changed, 83 insertions(+), 96 deletions(-) (limited to 'nuttx') diff --git a/nuttx/arch/z80/src/Makefile.sdccl b/nuttx/arch/z80/src/Makefile.sdccl index 531fbedf9..916f85b70 100644 --- a/nuttx/arch/z80/src/Makefile.sdccl +++ b/nuttx/arch/z80/src/Makefile.sdccl @@ -33,14 +33,12 @@ # ############################################################################ -############################################################################ # Tools # CFLAGS, CPPFLAGS, ASFLAGS, LDFLAGS are set in $(TOPDIR)/Make.defs CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(TOPDIR)/sched CPPFLAGS += -D__ASSEMBLY__ -############################################################################ # Files and directories # There should be one head source (.asm file) @@ -81,7 +79,6 @@ LIBGCC = ${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name} # HEAP_BASE = ${shell ./mkhpbase.sh} -############################################################################ # Targets all: $(HEAD_OBJ) libarch$(LIBEXT) @@ -96,40 +93,39 @@ $(COBJS): %$(OBJEXT): %.c # This is a kludge to work around some conflicting symbols in libsdcc.lib -$(SDCC_LIBDIR)/myz80.lib: $(SDCC_LIBDIR)/$(SDCCLIB) +$(TOPDIR)/lib/myz80.lib: $(SDCC_LIBDIR)/$(SDCCLIB) ifeq ($(CONFIG_SDCC_OLD),y) - $(Q) cat $(SDCC_LIBDIR)\$(SDCCLIB) | \ + $(Q) cat $(SDCC_LIBDIR)/$(SDCCLIB) | \ grep -v alloc | grep -v free | grep -v printf | \ grep -v _str | grep -v _mem | grep -v crt0\.o \ - > myz80.lib - $(Q) mv -f myz80.lib $(SDCC_LIBDIR)\myz80.lib + > $(TOPDIR)/lib/myz80.lib else - $(Q) cp $(SDCC_LIBDIR)\z80.lib $(SDCC_LIBDIR)\myz80.lib - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _calloc.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _malloc.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _realloc.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _free.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib printf_large.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib sprintf.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib vprintf.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib strcpy.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib strlen.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strcat.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strchr.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strcmp.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strcspn.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strncat.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strncmp.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strncpy.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strpbrk.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strrchr.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strspn.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strstr.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strtok.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memchr.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memcmp.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memcpy.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memset.rel + $(Q) cp $(SDCC_LIBDIR)/z80.lib $(TOPDIR)/lib/myz80.lib + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _calloc.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _malloc.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _realloc.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _free.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib printf_large.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib sprintf.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib vprintf.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib strcpy.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib strlen.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strcat.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strchr.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strcmp.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strcspn.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strncat.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strncmp.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strncpy.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strpbrk.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strrchr.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strspn.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strstr.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strtok.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _memchr.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _memcmp.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _memcpy.rel + $(Q) sdar d $(TOPDIR)/lib/myz80.lib _memset.rel endif # Create a header file that contains addressing information needed by the code @@ -173,10 +169,10 @@ board/libboard$(LIBEXT): # This target builds the final executable pass1.lnk: - @echo "LD: pass1.hex" + @echo "LD: pass1.ihx" @echo "--" >pass1.lnk # Non-interactive @echo "-k $(BOARDDIR)" >>pass1.lnk # Path to board library - @echo "-k $(SDCC_LIBDIR)" >>pass1.lnk # Path to SDCC z80 library + @echo "-k $(TOPDIR)/lib" >>pass1.lnk # Path to top-level lib-directory @echo "-l libboard$(LIBEXT)" >>pass1.lnk # Name of board library $(Q) for LIB in $(LINKLIBS); do \ echo "-l $(TOPDIR)/lib/$$LIB" >> pass1.lnk ;\ @@ -184,24 +180,25 @@ pass1.lnk: @echo "-l myz80.lib" >>pass1.lnk # Name of SDCC z80 library ifneq ($(CONFIG_LINKER_START_AREA),) @echo "-b START=$(CONFIG_LINKER_START_AREA)" >>pass1.lnk # Start of START area -else - @echo "-b START=0" >>pass1.lnk # Start of START area endif ifneq ($(CONFIG_LINKER_CODE_AREA),) @echo "-b _CODE=$(CONFIG_LINKER_CODE_AREA)" >>pass1.lnk # Start of _CODE area else @echo "-b _CODE=256" >>pass1.lnk # Start of _CODE area +endif +ifneq ($(CONFIG_LINKER_DATA_AREA),) + @echo "-b _CODE=$(CONFIG_LINKER_DATA_AREA)" >>pass1.lnk endif @echo "-i" >>pass1.lnk # Intel hex format @echo "-x" >>pass1.lnk # Hexadecimal @echo "-m" >>pass1.lnk # Generate a map file @echo "-j" >>pass1.lnk # Generate a symbol file - @echo "pass1.hex" >>pass1.lnk # Path to head object + @echo "pass1.ihx" >>pass1.lnk # Path to head object @echo "$(HEAD_OBJ)" >>pass1.lnk # Path to head object @echo "-e" >>pass1.lnk # End of script -pass1.hex: up_mem.h asm_mem.h $(SDCC_LIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) pass1.lnk - @echo "LD: pass1.hex" +pass1.ihx: up_mem.h asm_mem.h $(TOPDIR)/lib/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) pass1.lnk + @echo "LD: pass1.ihx" $(Q) $(LD) -f pass1.lnk $(Q) rm -f up_mem.h asm_mem.h $(Q) rm -f up_allocateheap$(OBJEXT) $(HEAD_OBJ) libarch$(LIBEXT) @@ -211,7 +208,7 @@ pass1.hex: up_mem.h asm_mem.h $(SDCC_LIBDIR)/myz80.lib $(HEAD_OBJ) board/libboar nuttx.lnk: @echo "--" >nuttx.lnk # Non-interactive @echo "-k $(BOARDDIR)" >>nuttx.lnk # Path to board library - @echo "-k $(SDCC_LIBDIR)" >>nuttx.lnk # Path to SDCC z80 library + @echo "-k $(TOPDIR)/lib" >>nuttx.lnk # Path to top-level lib directory @echo "-l libboard$(LIBEXT)" >>nuttx.lnk # Name of board library $(Q) for LIB in $(LINKLIBS); do \ echo "-l $(TOPDIR)/lib/$$LIB" >> nuttx.lnk ;\ @@ -219,13 +216,14 @@ nuttx.lnk: @echo "-l myz80.lib" >>nuttx.lnk # Name of SDCC z80 library ifneq ($(CONFIG_LINKER_START_AREA),) @echo "-b START=$(CONFIG_LINKER_START_AREA)" >>nuttx.lnk # Start of START area -else - @echo "-b START=0" >>nuttx.lnk # Start of START area endif ifneq ($(CONFIG_LINKER_CODE_AREA),) @echo "-b _CODE=$(CONFIG_LINKER_CODE_AREA)" >>nuttx.lnk # Start of _CODE area else @echo "-b _CODE=256" >>nuttx.lnk # Start of _CODE area +endif +ifneq ($(CONFIG_LINKER_DATA_AREA),) + @echo "-b _CODE=$(CONFIG_LINKER_DATA_AREA)" >>nuttx.lnk endif @echo "-i" >>nuttx.lnk # Intel hex format @echo "-x" >>nuttx.lnk # Hexadecimal @@ -235,7 +233,7 @@ endif @echo "$(HEAD_OBJ)" >>nuttx.lnk # Path to head object @echo "-e" >>nuttx.lnk # End of script -nuttx$(EXEEXT): pass1.hex up_mem.h asm_mem.h $(SDCC_LIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) nuttx.lnk +nuttx$(EXEEXT): pass1.ihx up_mem.h asm_mem.h $(TOPDIR)/lib/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) nuttx.lnk @echo "LD: nuttx.ihx" $(Q) $(LD) -f nuttx.lnk $(Q) rm -f pass1.* @@ -288,3 +286,4 @@ distclean: clean $(call DELFILE, .depend) -include Make.dep + diff --git a/nuttx/arch/z80/src/Makefile.sdccw b/nuttx/arch/z80/src/Makefile.sdccw index 5841136eb..4433429bb 100644 --- a/nuttx/arch/z80/src/Makefile.sdccw +++ b/nuttx/arch/z80/src/Makefile.sdccw @@ -96,40 +96,39 @@ $(COBJS): %$(OBJEXT): %.c # This is a kludge to work around some conflicting symbols in the SDCC libraries -$(SDCC_LIBDIR)\myz80.lib: $(SDCC_LIBDIR)\$(SDCCLIB) +$(TOPDIR)\lib\myz80.lib: $(SDCC_LIBDIR)\$(SDCCLIB) ifeq ($(CONFIG_SDCC_OLD),y) $(Q) cat $(SDCC_LIBDIR)\$(SDCCLIB) | \ grep -v alloc | grep -v free | grep -v printf | \ grep -v _str | grep -v _mem | grep -v crt0\.o \ - > myz80.lib - $(Q) mv -f myz80.lib $(SDCC_LIBDIR)\myz80.lib + > $(TOPDIR)\lib\myz80.lib else - $(Q) cp $(SDCC_LIBDIR)\z80.lib $(SDCC_LIBDIR)\myz80.lib - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _calloc.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _malloc.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _realloc.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _free.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib printf_large.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib sprintf.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib vprintf.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib strcpy.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib strlen.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strcat.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strchr.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strcmp.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strcspn.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strncat.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strncmp.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strncpy.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strpbrk.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strrchr.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strspn.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strstr.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _strtok.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memchr.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memcmp.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memcpy.rel - $(Q) sdar d $(SDCC_LIBDIR)\myz80.lib _memset.rel + $(Q) cp $(SDCC_LIBDIR)\z80.lib $(TOPDIR)\lib\myz80.lib + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _calloc.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _malloc.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _realloc.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _free.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib printf_large.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib sprintf.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib vprintf.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib strcpy.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib strlen.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strcat.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strchr.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strcmp.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strcspn.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strncat.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strncmp.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strncpy.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strpbrk.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strrchr.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strspn.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strstr.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strtok.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _memchr.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _memcmp.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _memcpy.rel + $(Q) sdar d $(TOPDIR)\lib\myz80.lib _memset.rel endif # Create a header file that contains addressing information needed by the code @@ -173,7 +172,7 @@ pass1.lnk: @echo LD: pass1.lnk @echo -->pass1.lnk @echo -k $(BOARDDIR)>>pass1.lnk - @echo -k $(SDCC_LIBDIR)>>pass1.lnk + @echo -k $(TOPDIR)\lib>>pass1.lnk @echo -l libboard$(LIBEXT)>>pass1.lnk $(Q) for %%G in ($(LINKLIBS)) do ( echo -l $(TOPDIR)\lib\%%G>> pass1.lnk ) @echo -l myz80.lib>>pass1.lnk @@ -186,17 +185,20 @@ ifneq ($(CONFIG_LINKER_CODE_AREA),) @echo -b _CODE=$(CONFIG_LINKER_CODE_AREA)>>pass1.lnk else @echo -b _CODE=256>>pass1.lnk +endif +ifneq ($(CONFIG_LINKER_DATA_AREA),) + @echo -b _CODE=$(CONFIG_LINKER_DATA_AREA)>>pass1.lnk endif @echo -i>>pass1.lnk @echo -x>>pass1.lnk @echo -m>>pass1.lnk @echo -j>>pass1.lnk - @echo pass1.hex>>pass1.lnk + @echo pass1.ihx>>pass1.lnk @echo $(HEAD_OBJ)>>pass1.lnk @echo -e>>pass1.lnk -pass1.hex: up_mem.h asm_mem.h $(SDCC_LIBDIR)\myz80.lib $(HEAD_OBJ) board\libboard$(LIBEXT) pass1.lnk - @echo LD: pass1.hex +pass1.ihx: up_mem.h asm_mem.h $(TOPDIR)\lib\myz80.lib $(HEAD_OBJ) board\libboard$(LIBEXT) pass1.lnk + @echo LD: pass1.ihx $(Q) $(LD) -f pass1.lnk $(Q) rm -f up_mem.h asm_mem.h $(Q) rm -f up_allocateheap$(OBJEXT) $(HEAD_OBJ) libarch$(LIBEXT) @@ -207,7 +209,7 @@ nuttx.lnk: @echo LD: nuttx.lnk @echo -->nuttx.lnk @echo -k $(BOARDDIR)>>nuttx.lnk - @echo -k $(SDCC_LIBDIR)>>nuttx.lnk + @echo -k $(TOPDIR)\lib>>nuttx.lnk @echo -l libboard$(LIBEXT)>>nuttx.lnk $(Q) for %%G in ($(LINKLIBS)) do ( echo -l $(TOPDIR)\lib\%%G>> nuttx.lnk ) @echo -l myz80.lib>>nuttx.lnk @@ -220,6 +222,9 @@ ifneq ($(CONFIG_LINKER_CODE_AREA),) @echo -b _CODE=$(CONFIG_LINKER_CODE_AREA)>>nuttx.lnk else @echo -b _CODE=256>>nuttx.lnk +endif +ifneq ($(CONFIG_LINKER_DATA_AREA),) + @echo -b _CODE=$(CONFIG_LINKER_DATA_AREA)>>nuttx.lnk endif @echo -i>>nuttx.lnk @echo -x>>nuttx.lnk @@ -229,7 +234,7 @@ endif @echo $(HEAD_OBJ)>>nuttx.lnk @echo -e>>nuttx.lnk -nuttx$(EXEEXT): pass1.hex up_mem.h asm_mem.h $(SDCC_LIBDIR)\myz80.lib $(HEAD_OBJ) board\libboard$(LIBEXT) nuttx.lnk +nuttx$(EXEEXT): pass1.ihx up_mem.h asm_mem.h $(TOPDIR)\lib\myz80.lib $(HEAD_OBJ) board\libboard$(LIBEXT) nuttx.lnk @echo LD: nuttx.ihx $(Q) $(LD) -f nuttx.lnk $(call DELFILE, pass1.*) diff --git a/nuttx/configs/z80sim/README.txt b/nuttx/configs/z80sim/README.txt index a5fc011a1..c85e236ef 100644 --- a/nuttx/configs/z80sim/README.txt +++ b/nuttx/configs/z80sim/README.txt @@ -42,12 +42,6 @@ Configuring NuttX reconfiguration process. 2. The default setup for this configuration uses a windows native build. - NOTE that build does *NOT* work build successfully using SDCC 3.2.0: - Windows halts claiming that sdcclib is no longer responding. 3.2.0 is - the latest released version as of this writing. This problem has, - apparently been corrected in the repository; a snapshot data Nov 23, - 2012 (3.2.1) did not have this problem. - As of this writing, the native Windows build still does not work. This is due to issues in arch/z80/src/Makefile and in the Bash script arch/z80/src/mkhpbase.sh which, of course, cannot be used in a Windows @@ -70,17 +64,6 @@ Configuring NuttX You make also have to change the value of CONFIG_APPS_DIR. You cannot use the default setenv.bat. Use configs/z80sim/script/setenv.sh instead. - When last attempted on Ubuntu 12.10 with SDCC 3.2.0 for Linux, the build - failed with the following internal error: - - *** glibc detected *** sdcclib: malloc(): memory corruption: 0x09f09768 *** - - I believe that this is related to the sdcclib error also reported under - windows for SDCC 3.2.0. It may be avoided by updating to a more recent - snapshot. However, a Dec 4, 2012 still shows a similar error: - - *** glibc detected *** sdcclib: free(): invalid next size (fast): 0x0000000001aaaab0 *** - nsh This configuration file builds NSH (examples/nsh). This -- cgit v1.2.3 From 756aa6b90920d0087ad708c3ad10e091be79e46e Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 7 Dec 2012 16:00:56 +0000 Subject: Patches from Petteri Aimonen + stdbool and rand() changes for Freddie Chopin git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5415 42af7a65-404d-4744-a932-0658087f49c3 --- NxWidgets/ChangeLog.txt | 6 +- NxWidgets/libnxwidgets/include/cnxwidget.hxx | 2 +- NxWidgets/libnxwidgets/src/cscrollingpanel.cxx | 46 +- NxWidgets/nxwm/include/cstartwindow.hxx | 4 +- nuttx/ChangeLog | 23 +- nuttx/arch/8051/include/limits.h | 16 +- nuttx/arch/arm/include/limits.h | 18 +- nuttx/arch/avr/include/avr/limits.h | 18 +- nuttx/arch/avr/include/avr32/limits.h | 18 +- nuttx/arch/hc/include/hc12/limits.h | 19 +- nuttx/arch/hc/include/hcs12/limits.h | 19 +- nuttx/arch/mips/include/limits.h | 18 +- nuttx/arch/rgmp/include/limits.h | 18 +- nuttx/arch/sh/include/m16c/limits.h | 14 +- nuttx/arch/sh/include/sh1/limits.h | 18 +- nuttx/arch/sim/include/limits.h | 18 +- nuttx/arch/x86/include/i486/limits.h | 18 +- nuttx/arch/z16/include/limits.h | 22 +- nuttx/arch/z80/include/ez80/limits.h | 19 +- nuttx/arch/z80/include/z8/limits.h | 16 +- nuttx/arch/z80/include/z80/limits.h | 16 +- nuttx/drivers/mtd/Make.defs | 4 + nuttx/drivers/mtd/at25.c | 708 +++++++++++++++++++++++++ nuttx/drivers/mtd/ftl.c | 31 +- nuttx/graphics/nxtk/nxtk_getwindow.c | 11 +- nuttx/graphics/nxtk/nxtk_subwindowmove.c | 12 +- nuttx/include/cxx/cmath | 3 + nuttx/include/cxx/cstdlib | 1 + nuttx/include/nuttx/fs/fs.h | 2 +- nuttx/include/nuttx/math.h | 8 + nuttx/include/nuttx/mtd.h | 3 +- nuttx/include/stdbool.h | 35 +- nuttx/libc/math/Make.defs | 6 +- nuttx/libc/math/lib_round.c | 40 ++ nuttx/libc/math/lib_roundf.c | 38 ++ nuttx/libc/math/lib_roundl.c | 40 ++ nuttx/libc/stdlib/lib_rand.c | 33 +- nuttx/libxx/Kconfig | 8 + 38 files changed, 1157 insertions(+), 192 deletions(-) create mode 100644 nuttx/drivers/mtd/at25.c create mode 100644 nuttx/libc/math/lib_round.c create mode 100644 nuttx/libc/math/lib_roundf.c create mode 100644 nuttx/libc/math/lib_roundl.c (limited to 'nuttx') diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt index c3ae00d6a..7f7b21247 100644 --- a/NxWidgets/ChangeLog.txt +++ b/NxWidgets/ChangeLog.txt @@ -213,4 +213,8 @@ Submitted by Petteri Aimonen. * NxWidgets:CText and NxWidgets:CNumericEdite: Fix some memory freeing bugs (from Petteri Aimonen). - \ No newline at end of file +* NxWidgets::CScrollingPanel: Usability improvements. It is borderless for now, + because there was no easy way to redraw only the required part of the border. + Contributed by Petteri Aimonen. +* NxWidgets::CNxWidgets and NxWM::CStartWindow: Small changes to make sub- + classing easier (from Petteri Aimonen). diff --git a/NxWidgets/libnxwidgets/include/cnxwidget.hxx b/NxWidgets/libnxwidgets/include/cnxwidget.hxx index 2ca055c1c..dda8efc1d 100644 --- a/NxWidgets/libnxwidgets/include/cnxwidget.hxx +++ b/NxWidgets/libnxwidgets/include/cnxwidget.hxx @@ -1058,7 +1058,7 @@ namespace NXWidgets * @return True if the click was successful. */ - bool click(nxgl_coord_t x, nxgl_coord_t y); + virtual bool click(nxgl_coord_t x, nxgl_coord_t y); /** * Check if the click is a double-click. diff --git a/NxWidgets/libnxwidgets/src/cscrollingpanel.cxx b/NxWidgets/libnxwidgets/src/cscrollingpanel.cxx index d3ee40cf9..b7c507bb2 100644 --- a/NxWidgets/libnxwidgets/src/cscrollingpanel.cxx +++ b/NxWidgets/libnxwidgets/src/cscrollingpanel.cxx @@ -70,11 +70,12 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include #include +#include #include "cwidgetcontrol.hxx" #include "cscrollingpanel.hxx" @@ -113,6 +114,13 @@ CScrollingPanel::CScrollingPanel(CWidgetControl *pWidgetControl, : CNxWidget(pWidgetControl, x, y, width, height, flags, style) { m_widgetControl = pWidgetControl; + + // NOTE: CScrollingPanel is temporarily borderless because there was no + // easy way to redraw only the required part of the border. + + m_flags.permeable = true; + m_flags.borderless = true; + CRect rect; getClientRect(rect); @@ -120,12 +128,10 @@ CScrollingPanel::CScrollingPanel(CWidgetControl *pWidgetControl, m_canvasHeight = rect.getHeight(); m_canvasX = 0; m_canvasY = 0; - + setAllowsVerticalScroll(true); setAllowsHorizontalScroll(true); setContentScrolled(true); - - m_flags.permeable = true; } /** @@ -186,6 +192,24 @@ void CScrollingPanel::scroll(int32_t dx, int32_t dy) CGraphicsPort *port = m_widgetControl->getGraphicsPort(); port->move(getX(), getY(), dx, dy, rect.getWidth(), rect.getHeight()); + if (dx > 0) + { + revealedRects.push_back(CRect(getX(), getY(), dx, rect.getHeight())); + } + else if (dx < 0) + { + revealedRects.push_back(CRect(getX() + rect.getWidth() + dx, getY(), -dx, rect.getHeight())); + } + + if (dy > 0) + { + revealedRects.push_back(CRect(getX(), getY(), rect.getWidth(), dy)); + } + else if (dy < 0) + { + revealedRects.push_back(CRect(getX(), getY() + rect.getHeight() + dy, rect.getWidth(), -dy)); + } + // Adjust the scroll values m_canvasY += dy; @@ -193,12 +217,20 @@ void CScrollingPanel::scroll(int32_t dx, int32_t dy) if (revealedRects.size() > 0) { - // Draw revealed sections + // Draw background to revealed sections + // Children will redraw themselves in moveTo. for (int i = 0; i < revealedRects.size(); ++i) { - drawBorder(port); - drawContents(port); + CRect &rrect = revealedRects[i]; + + gvdbg("Redrawing %d,%d,%d,%d after scroll\n", + rrect.getX(), rrect.getY(), + rrect.getWidth(), rrect.getHeight()); + + port->drawFilledRect(rrect.getX(), rrect.getY(), + rrect.getWidth(), rrect.getHeight(), + getBackgroundColor()); } } } diff --git a/NxWidgets/nxwm/include/cstartwindow.hxx b/NxWidgets/nxwm/include/cstartwindow.hxx index 671b01087..52a67fbd4 100644 --- a/NxWidgets/nxwm/include/cstartwindow.hxx +++ b/NxWidgets/nxwm/include/cstartwindow.hxx @@ -97,8 +97,8 @@ namespace NxWM */ class CStartWindow : public IApplication, - private IApplicationCallback, - private NXWidgets::CWidgetEventHandler + protected IApplicationCallback, + protected NXWidgets::CWidgetEventHandler { protected: /** diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index ab1412ae2..0ec0fdc3d 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3737,4 +3737,25 @@ * arch/z80/src/Makefile.sdccw: Renamed makefiles with extensions zdiil, zdiiw, sdccl, and sdccw for the ZDS-II vs SDCC compilers and for the POSIX vs Windows native builds. - + * nuttx/drivers/mtd/ftl.c: Fix for the flash translation layer. Short + unaligned writes were buggy. From Petteri Aimonen. + * nuttx/libc/math/lib_round*.c: Add rounding functions to the math + library. Contributed by Petteri Aimonen. + * include/cxx/cstdlib: Add stroul(). From Petteri Aimonen. + * arch/*/include/limits.h: Change signed minimum values from, for example, + (-128) to (-127 - 1) to avoid overflows under certain conditions. From + Peterri Aimonen. + * graphics/nxtk/nxtk_subwindowmove.c: Previously it was very difficult to + do e.g. "scroll by dx, dy". When given the full window area, nxtk_subwindowmove + would clip the offset always to 0,0. It makes more sense for it to clip the + source area and not modify the offset. From Petteri Aimonen. + * graphics/nxtk/nxtk_getwindow.c: Clipping would change the offset of returned + data, and caller has no way to know what the new offset would be. This messes + up font drawing when the text is partially out of window, e.g. when scrolling. + Also from Petteri Aimonen. + * include/stdbool.h: Can now be disabled for C++ files if CONFIG_C99_BOOL8 is + defined. CONFIG_C99_BOOL8 indicates (1) that the sizeof(_Bool) is one in both + C and C++, and (2) the the C compiler is C99 and supports the _Bool intrinsic + type. Requested by Freddie Chopin. + * include/stdlib/lib_rand.c: Various additional changes so that the integer + value zero can be returned. Requested by Freddie Chopin. diff --git a/nuttx/arch/8051/include/limits.h b/nuttx/arch/8051/include/limits.h index f3021f6cc..fd8c086aa 100644 --- a/nuttx/arch/8051/include/limits.h +++ b/nuttx/arch/8051/include/limits.h @@ -45,7 +45,7 @@ ************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,17 +59,17 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U -#define INT_MIN (-32768) +#define INT_MIN (-INT_MAX - 1) #define INT_MAX 32767 -#define UINT_MAX 65535 +#define UINT_MAX 65535U /* These change on 32-bit and 64-bit platforms */ -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL @@ -77,8 +77,8 @@ * first byte holding data space information. */ -#define PTR_MIN (-8388608) +#define PTR_MIN (-PTR_MAX - 1) #define PTR_MAX 8388607 -#define UPTR_MAX 16777215 +#define UPTR_MAX 16777215U #endif /* __ARCH_8051_INCLUDE_LIMITS_H */ diff --git a/nuttx/arch/arm/include/limits.h b/nuttx/arch/arm/include/limits.h index 12c92f6cf..640db7e7b 100644 --- a/nuttx/arch/arm/include/limits.h +++ b/nuttx/arch/arm/include/limits.h @@ -45,7 +45,7 @@ ****************************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,28 +59,28 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U -#define INT_MIN (-2147483648) +#define INT_MIN (-INT_MAX - 1) #define INT_MAX 2147483647 -#define UINT_MAX 4294967295 +#define UINT_MAX 4294967295U /* These change on 32-bit and 64-bit platforms */ -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL -#define LLONG_MIN (-9223372036854775808LL) +#define LLONG_MIN (-LLONG_MAX - 1) #define LLONG_MAX 9223372036854775807LL #define ULLONG_MAX 18446744073709551615ULL /* A pointer is 4 bytes */ -#define PTR_MIN (-2147483648) +#define PTR_MIN (-PTR_MAX - 1) #define PTR_MAX 2147483647 -#define UPTR_MAX 4294967295 +#define UPTR_MAX 4294967295U #endif /* __ARCH_ARM_INCLUDE_LIMITS_H */ diff --git a/nuttx/arch/avr/include/avr/limits.h b/nuttx/arch/avr/include/avr/limits.h index 67d66ce7a..db97a9a4a 100644 --- a/nuttx/arch/avr/include/avr/limits.h +++ b/nuttx/arch/avr/include/avr/limits.h @@ -45,7 +45,7 @@ ****************************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,31 +59,31 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U /* Integer is two bytes */ -#define INT_MIN (-32768) +#define INT_MIN (-INT_MAX - 1) #define INT_MAX 32767 -#define UINT_MAX 65535 +#define UINT_MAX 65535U /* These change on 32-bit and 64-bit platforms */ -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL -#define LLONG_MIN (-9223372036854775808LL) +#define LLONG_MIN (-LLONG_MAX - 1) #define LLONG_MAX 9223372036854775807LL #define ULLONG_MAX 18446744073709551615ULL /* A pointer is two bytes */ -#define PTR_MIN (-32768) +#define PTR_MIN (-PTR_MAX - 1) #define PTR_MAX 32767 -#define UPTR_MAX 65535 +#define UPTR_MAX 65535U #endif /* __ARCH_AVR_INCLUDE_AVR_LIMITS_H */ diff --git a/nuttx/arch/avr/include/avr32/limits.h b/nuttx/arch/avr/include/avr32/limits.h index f4fad08ff..ce3dd783d 100644 --- a/nuttx/arch/avr/include/avr32/limits.h +++ b/nuttx/arch/avr/include/avr32/limits.h @@ -45,7 +45,7 @@ ****************************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,31 +59,31 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U /* Integer is four bytes */ -#define INT_MIN (-2147483648) +#define INT_MIN (-INT_MAX - 1) #define INT_MAX 2147483647 -#define UINT_MAX 4294967295 +#define UINT_MAX 4294967295U /* These change on 32-bit and 64-bit platforms */ -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL -#define LLONG_MIN (-9223372036854775808LL) +#define LLONG_MIN (-LLONG_MAX - 1) #define LLONG_MAX 9223372036854775807LL #define ULLONG_MAX 18446744073709551615ULL /* A pointer is four bytes */ -#define PTR_MIN (-2147483648) +#define PTR_MIN (-PTR_MAX - 1) #define PTR_MAX 2147483647 -#define UPTR_MAX 4294967295 +#define UPTR_MAX 4294967295U #endif /* __ARCH_AVR_INCLUDE_AVR32_LIMITS_H */ diff --git a/nuttx/arch/hc/include/hc12/limits.h b/nuttx/arch/hc/include/hc12/limits.h index edb92c7e6..c35148a56 100644 --- a/nuttx/arch/hc/include/hc12/limits.h +++ b/nuttx/arch/hc/include/hc12/limits.h @@ -45,7 +45,7 @@ ****************************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,39 +59,38 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U /* The size of an integer is controlled with the -mshort or -mnoshort GCC * options. GCC will set the pre-defined symbol __INT__ to indicate the size * of an integer */ +#define INT_MIN (-INT_MAX - 1) #if __INT__ == 32 -# define INT_MIN (-2147483648) # define INT_MAX 2147483647 # define UINT_MAX 4294967295 #else -# define INT_MIN (-32768) # define INT_MAX 32767 -# define UINT_MAX 65535 +# define UINT_MAX 65535U #endif /* Long is 4-bytes and long long is 8 bytes in any case */ -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL -#define LLONG_MIN (-9223372036854775808LL) +#define LLONG_MIN (-LLONG_MAX - 1) #define LLONG_MAX 9223372036854775807LL #define ULLONG_MAX 18446744073709551615ULL /* A pointer is 2 bytes */ -#define PTR_MIN (-32768) +#define PTR_MIN (-PTR_MAX - 1) #define PTR_MAX 32767 -#define UPTR_MAX 65535 +#define UPTR_MAX 65535U #endif /* __ARCH_HC_INCLUDE_HC12_LIMITS_H */ diff --git a/nuttx/arch/hc/include/hcs12/limits.h b/nuttx/arch/hc/include/hcs12/limits.h index 597626484..5b10d910f 100644 --- a/nuttx/arch/hc/include/hcs12/limits.h +++ b/nuttx/arch/hc/include/hcs12/limits.h @@ -45,7 +45,7 @@ ****************************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,39 +59,38 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U /* The size of an integer is controlled with the -mshort or -mnoshort GCC * options. GCC will set the pre-defined symbol __INT__ to indicate the size * of an integer */ +#define INT_MIN (-INT_MAX - 1) #if __INT__ == 32 -# define INT_MIN (-2147483648) # define INT_MAX 2147483647 # define UINT_MAX 4294967295 #else -# define INT_MIN (-32768) # define INT_MAX 32767 -# define UINT_MAX 65535 +# define UINT_MAX 65535U #endif /* Long is 4-bytes and long long is 8 bytes in any case */ -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL -#define LLONG_MIN (-9223372036854775808LL) +#define LLONG_MIN (-LLONG_MAX - 1) #define LLONG_MAX 9223372036854775807LL #define ULLONG_MAX 18446744073709551615ULL /* A pointer is 2 bytes */ -#define PTR_MIN (-32768) +#define PTR_MIN (-PTR_MAX - 1) #define PTR_MAX 32767 -#define UPTR_MAX 65535 +#define UPTR_MAX 65535U #endif /* __ARCH_HC_INCLUDE_HCS12_LIMITS_H */ diff --git a/nuttx/arch/mips/include/limits.h b/nuttx/arch/mips/include/limits.h index 4feff7fe1..04001e55c 100644 --- a/nuttx/arch/mips/include/limits.h +++ b/nuttx/arch/mips/include/limits.h @@ -45,7 +45,7 @@ ****************************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,29 +59,29 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U -#define INT_MIN (-2147483648) +#define INT_MIN (-INT_MAX - 1) #define INT_MAX 2147483647 -#define UINT_MAX 4294967295 +#define UINT_MAX 4294967295U /* These change on 32-bit and 64-bit platforms */ -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL -#define LLONG_MIN (-9223372036854775808LL) +#define LLONG_MIN (-LLONG_MAX - 1) #define LLONG_MAX 9223372036854775807LL #define ULLONG_MAX 18446744073709551615ULL /* A pointer is 4 bytes */ -#define PTR_MIN (-2147483648) +#define PTR_MIN (-PTR_MAX - 1) #define PTR_MAX 2147483647 -#define UPTR_MAX 4294967295 +#define UPTR_MAX 4294967295U #endif /* __ARCH_MIPS_INCLUDE_LIMITS_H */ diff --git a/nuttx/arch/rgmp/include/limits.h b/nuttx/arch/rgmp/include/limits.h index fdd8bfd10..a4458e301 100644 --- a/nuttx/arch/rgmp/include/limits.h +++ b/nuttx/arch/rgmp/include/limits.h @@ -45,7 +45,7 @@ ************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,28 +59,28 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U -#define INT_MIN (-2147483648) +#define INT_MIN (-INT_MAX - 1) #define INT_MAX 2147483647 -#define UINT_MAX 4294967295 +#define UINT_MAX 4294967295U /* These change on 32-bit and 64-bit platforms */ -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL -#define LLONG_MIN (-9223372036854775808LL) +#define LLONG_MIN (-LLONG_MAX - 1) #define LLONG_MAX 9223372036854775807LL #define ULLONG_MAX 18446744073709551615ULL /* A pointer is 4 bytes */ -#define PTR_MIN (-2147483648) +#define PTR_MIN (-PTR_MAX - 1) #define PTR_MAX 2147483647 -#define UPTR_MAX 4294967295 +#define UPTR_MAX 4294967295U #endif /* __ARCH_RGMP_INCLUDE_LIMITS_H */ diff --git a/nuttx/arch/sh/include/m16c/limits.h b/nuttx/arch/sh/include/m16c/limits.h index d836522e7..dba3e4fdc 100644 --- a/nuttx/arch/sh/include/m16c/limits.h +++ b/nuttx/arch/sh/include/m16c/limits.h @@ -45,7 +45,7 @@ ****************************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,9 +59,9 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U /* For M16C, type int is 16-bits, the same size as type 'short int' */ @@ -71,18 +71,18 @@ /* For M16C, typle 'long int' is 32-bits */ -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL -#define LLONG_MIN (-9223372036854775808LL) +#define LLONG_MIN (-LLONG_MAX - 1) #define LLONG_MAX 9223372036854775807LL #define ULLONG_MAX 18446744073709551615ULL /* A pointer is 2 bytes */ -#define PTR_MIN (-32768) +#define PTR_MIN (-PTR_MAX - 1) #define PTR_MAX 32767 -#define UPTR_MAX 65535 +#define UPTR_MAX 65535U #endif /* __ARCH_SH_INCLUDE_M16C_LIMITS_H */ diff --git a/nuttx/arch/sh/include/sh1/limits.h b/nuttx/arch/sh/include/sh1/limits.h index ce9085bfb..33c8ebcd3 100644 --- a/nuttx/arch/sh/include/sh1/limits.h +++ b/nuttx/arch/sh/include/sh1/limits.h @@ -45,7 +45,7 @@ ****************************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,30 +59,30 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U /* On SH-1, type 'int' is 32-bits */ -#define INT_MIN (-2147483648) +#define INT_MIN (-INT_MAX - 1) #define INT_MAX 2147483647 -#define UINT_MAX 4294967295 +#define UINT_MAX 4294967295U /* On SH-1, type 'long' is the same size as type 'int', 32-bits */ -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL -#define LLONG_MIN (-9223372036854775808LL) +#define LLONG_MIN (-LLONG_MAX - 1) #define LLONG_MAX 9223372036854775807LL #define ULLONG_MAX 18446744073709551615ULL /* A pointer is 4 bytes */ -#define PTR_MIN (-2147483648) +#define PTR_MIN (-PTR_MAX - 1) #define PTR_MAX 2147483647 -#define UPTR_MAX 4294967295 +#define UPTR_MAX 4294967295U #endif /* __ARCH_SH_INCLUDE_SH1_LIMITS_H */ diff --git a/nuttx/arch/sim/include/limits.h b/nuttx/arch/sim/include/limits.h index 9aa36b1d0..9288cb585 100644 --- a/nuttx/arch/sim/include/limits.h +++ b/nuttx/arch/sim/include/limits.h @@ -45,7 +45,7 @@ ************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,28 +59,28 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U -#define INT_MIN (-2147483648) +#define INT_MIN (-INT_MAX - 1) #define INT_MAX 2147483647 -#define UINT_MAX 4294967295 +#define UINT_MAX 4294967295U /* These change on 32-bit and 64-bit platforms */ -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL -#define LLONG_MIN (-9223372036854775808LL) +#define LLONG_MIN (-LLONG_MAX - 1) #define LLONG_MAX 9223372036854775807LL #define ULLONG_MAX 18446744073709551615ULL /* A pointer is 4 bytes */ -#define PTR_MIN (-2147483648) +#define PTR_MIN (-PTR_MAX - 1) #define PTR_MAX 2147483647 -#define UPTR_MAX 4294967295 +#define UPTR_MAX 4294967295U #endif /* __ARCH_SIM_INCLUDE_LIMITS_H */ diff --git a/nuttx/arch/x86/include/i486/limits.h b/nuttx/arch/x86/include/i486/limits.h index c2a9a620f..aa167a0af 100644 --- a/nuttx/arch/x86/include/i486/limits.h +++ b/nuttx/arch/x86/include/i486/limits.h @@ -45,7 +45,7 @@ ****************************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,28 +59,28 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U -#define INT_MIN (-2147483648) +#define INT_MIN (-INT_MAX - 1) #define INT_MAX 2147483647 -#define UINT_MAX 4294967295 +#define UINT_MAX 4294967295U /* These change on 32-bit and 64-bit platforms */ -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL -#define LLONG_MIN (-9223372036854775808LL) +#define LLONG_MIN (-LLONG_MAX - 1) #define LLONG_MAX 9223372036854775807LL #define ULLONG_MAX 18446744073709551615ULL /* A pointer is 4 bytes */ -#define PTR_MIN (-2147483648) +#define PTR_MIN (-PTR_MAX - 1) #define PTR_MAX 2147483647 -#define UPTR_MAX 4294967295 +#define UPTR_MAX 4294967295U #endif /* __ARCH_X86_INCLUDE_I486_LIMITS_H */ diff --git a/nuttx/arch/z16/include/limits.h b/nuttx/arch/z16/include/limits.h index 55ee7a2c5..6601c4737 100644 --- a/nuttx/arch/z16/include/limits.h +++ b/nuttx/arch/z16/include/limits.h @@ -45,7 +45,7 @@ ****************************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,26 +59,26 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U -#define INT_MIN (-2147483648) +#define INT_MIN (-INT_MAX - 1) #define INT_MAX 2147483647 -#define UINT_MAX 4294967295 +#define UINT_MAX 4294967295U -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL -#define LLONG_MIN (-2147483648L) -#define LLONG_MAX 2147483647L -#define ULLONG_MAX 4294967295UL +#define LLONG_MIN (-LLONG_MAX - 1) +#define LLONG_MAX 2147483647LL +#define ULLONG_MAX 4294967295ULL /* A pointer is 4 bytes */ -#define PTR_MIN (-2147483648) +#define PTR_MIN (-PTR_MAX - 1) #define PTR_MAX 2147483647 -#define UPTR_MAX 4294967295 +#define UPTR_MAX 4294967295U #endif /* __ARCH_Z16_INCLUDE_LIMITS_H */ diff --git a/nuttx/arch/z80/include/ez80/limits.h b/nuttx/arch/z80/include/ez80/limits.h index 1dfa2afee..9e27b14e6 100644 --- a/nuttx/arch/z80/include/ez80/limits.h +++ b/nuttx/arch/z80/include/ez80/limits.h @@ -45,7 +45,7 @@ ****************************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,17 +59,17 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U -#define INT_MIN (-32768) +#define INT_MIN (-INT_MAX - 1) #define INT_MAX 32767 -#define UINT_MAX 65535 +#define UINT_MAX 65535U /* These change on 32-bit and 64-bit platforms */ -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL @@ -80,14 +80,13 @@ * ADL mode - 24 bits */ +#define PTR_MIN (-PTR_MAX - 1) #ifdef CONFIG_EZ80_Z80MODE -#define PTR_MIN (-32768) #define PTR_MAX 32767 -#define UPTR_MAX 65535 +#define UPTR_MAX 65535U #else -#define PTR_MIN (-8388608) #define PTR_MAX 8388607 -#define UPTR_MAX 16777215 +#define UPTR_MAX 16777215U #endif #endif /* __ARCH_Z80_INCLUDE_EZ80_LIMITS_H */ diff --git a/nuttx/arch/z80/include/z8/limits.h b/nuttx/arch/z80/include/z8/limits.h index 94614ee25..724d8c98d 100644 --- a/nuttx/arch/z80/include/z8/limits.h +++ b/nuttx/arch/z80/include/z8/limits.h @@ -45,7 +45,7 @@ ****************************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,24 +59,24 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U -#define INT_MIN (-32768) +#define INT_MIN (-INT_MAX - 1) #define INT_MAX 32767 -#define UINT_MAX 65535 +#define UINT_MAX 65535U /* These change on 32-bit and 64-bit platforms */ -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL /* A pointer is 2 bytes */ -#define PTR_MIN (-32768) +#define PTR_MIN (-PTR_MAX - 1) #define PTR_MAX 32767 -#define UPTR_MAX 65535 +#define UPTR_MAX 65535U #endif /* __ARCH_Z80_INCLUDE_Z8_LIMITS_H */ diff --git a/nuttx/arch/z80/include/z80/limits.h b/nuttx/arch/z80/include/z80/limits.h index ff5770442..f1a1c1e17 100644 --- a/nuttx/arch/z80/include/z80/limits.h +++ b/nuttx/arch/z80/include/z80/limits.h @@ -45,7 +45,7 @@ ****************************************************************************/ #define CHAR_BIT 8 -#define SCHAR_MIN (-128) +#define SCHAR_MIN (-SCHAR_MAX - 1) #define SCHAR_MAX 127 #define UCHAR_MAX 255 @@ -59,24 +59,24 @@ #define CHAR_MAX SCHAR_MAX #endif -#define SHRT_MIN (-32768) +#define SHRT_MIN (-SHRT_MAX - 1) #define SHRT_MAX 32767 -#define USHRT_MAX 65535 +#define USHRT_MAX 65535U -#define INT_MIN (-32768) +#define INT_MIN (-INT_MAX - 1) #define INT_MAX 32767 -#define UINT_MAX 65535 +#define UINT_MAX 65535U /* These change on 32-bit and 64-bit platforms */ -#define LONG_MIN (-2147483648L) +#define LONG_MIN (-LONG_MAX - 1) #define LONG_MAX 2147483647L #define ULONG_MAX 4294967295UL /* A pointer is 2 bytes */ -#define PTR_MIN (-32768) +#define PTR_MIN (-PTR_MAX - 1) #define PTR_MAX 32767 -#define UPTR_MAX 65535 +#define UPTR_MAX 65535U #endif /* __ARCH_Z80_INCLUDE_Z80_LIMITS_H */ diff --git a/nuttx/drivers/mtd/Make.defs b/nuttx/drivers/mtd/Make.defs index 258e77ec9..7db7592d4 100644 --- a/nuttx/drivers/mtd/Make.defs +++ b/nuttx/drivers/mtd/Make.defs @@ -51,6 +51,10 @@ ifeq ($(CONFIG_MTD_W25),y) CSRCS += w25.c endif +ifeq ($(CONFIG_MTD_AT25),y) +CSRCS += at25.c +endif + # Include MTD driver support DEPPATH += --dep-path mtd diff --git a/nuttx/drivers/mtd/at25.c b/nuttx/drivers/mtd/at25.c new file mode 100644 index 000000000..e35b794a5 --- /dev/null +++ b/nuttx/drivers/mtd/at25.c @@ -0,0 +1,708 @@ +/************************************************************************************ + * drivers/mtd/at25.c + * Driver for SPI-based AT25DF321 (32Mbit) flash. + * + * Copyright (C) 2009-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * Petteri Aimonen + * + * 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. + * + ************************************************************************************/ + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/************************************************************************************ + * Pre-processor Definitions + ************************************************************************************/ + +#ifndef CONFIG_AT25_SPIMODE +# define CONFIG_AT25_SPIMODE SPIDEV_MODE0 +#endif + +/* AT25 Registers *******************************************************************/ +/* Indentification register values */ + +#define AT25_MANUFACTURER 0x1F +#define AT25_AT25DF321_TYPE 0x47 /* 32 M-bit */ + +/* AT25DF321 capacity is 4,194,304 bytes: + * (64 sectors) * (65,536 bytes per sector) + * (16384 pages) * (256 bytes per page) + */ + +#define AT25_AT25DF321_SECTOR_SHIFT 12 /* Sector size 1 << 12 = 4096 */ +#define AT25_AT25DF321_NSECTORS 1024 +#define AT25_AT25DF321_PAGE_SHIFT 9 /* Page size 1 << 9 = 512 */ +#define AT25_AT25DF321_NPAGES 8192 + +/* Instructions */ +/* Command Value N Description Addr Dummy Data */ +#define AT25_WREN 0x06 /* 1 Write Enable 0 0 0 */ +#define AT25_WRDI 0x04 /* 1 Write Disable 0 0 0 */ +#define AT25_RDID 0x9f /* 1 Read Identification 0 0 1-3 */ +#define AT25_RDSR 0x05 /* 1 Read Status Register 0 0 >=1 */ +#define AT25_WRSR 0x01 /* 1 Write Status Register 0 0 1 */ +#define AT25_READ 0x03 /* 1 Read Data Bytes 3 0 >=1 */ +#define AT25_FAST_READ 0x0b /* 1 Higher speed read 3 1 >=1 */ +#define AT25_PP 0x02 /* 1 Page Program 3 0 1-256 */ +#define AT25_SE 0x20 /* 1 Sector Erase 3 0 0 */ +#define AT25_BE 0xc7 /* 1 Bulk Erase 0 0 0 */ +#define AT25_DP 0xb9 /* 2 Deep power down 0 0 0 */ +#define AT25_RES 0xab /* 2 Read Electronic Signature 0 3 >=1 */ + +/* Status register bit definitions */ + +#define AT25_SR_WIP (1 << 0) /* Bit 0: Write in progress bit */ +#define AT25_SR_WEL (1 << 1) /* Bit 1: Write enable latch bit */ +#define AT25_SR_EPE (1 << 5) /* Bit 5: Erase/program error */ +#define AT25_SR_UNPROT 0x00 /* Global unprotect command */ + +#define AT25_DUMMY 0xa5 + +/************************************************************************************ + * Private Types + ************************************************************************************/ + +/* This type represents the state of the MTD device. The struct mtd_dev_s + * must appear at the beginning of the definition so that you can freely + * cast between pointers to struct mtd_dev_s and struct at25_dev_s. + */ + +struct at25_dev_s +{ + struct mtd_dev_s mtd; /* MTD interface */ + FAR struct spi_dev_s *dev; /* Saved SPI interface instance */ + uint8_t sectorshift; /* 16 or 18 */ + uint8_t pageshift; /* 8 */ + uint16_t nsectors; /* 128 or 64 */ + uint32_t npages; /* 32,768 or 65,536 */ +}; + +/************************************************************************************ + * Private Function Prototypes + ************************************************************************************/ + +/* Helpers */ + +static void at25_lock(FAR struct spi_dev_s *dev); +static inline void at25_unlock(FAR struct spi_dev_s *dev); +static inline int at25_readid(struct at25_dev_s *priv); +static void at25_waitwritecomplete(struct at25_dev_s *priv); +static void at25_writeenable(struct at25_dev_s *priv); +static inline void at25_sectorerase(struct at25_dev_s *priv, off_t offset); +static inline int at25_bulkerase(struct at25_dev_s *priv); +static inline void at25_pagewrite(struct at25_dev_s *priv, FAR const uint8_t *buffer, + off_t offset); + +/* MTD driver methods */ + +static int at25_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks); +static ssize_t at25_bread(FAR struct mtd_dev_s *dev, off_t startblock, + size_t nblocks, FAR uint8_t *buf); +static ssize_t at25_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, + size_t nblocks, FAR const uint8_t *buf); +static ssize_t at25_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, + FAR uint8_t *buffer); +static int at25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg); + +/************************************************************************************ + * Private Data + ************************************************************************************/ + +/************************************************************************************ + * Private Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: at25_lock + ************************************************************************************/ + +static void at25_lock(FAR struct spi_dev_s *dev) +{ + /* On SPI busses where there are multiple devices, it will be necessary to + * lock SPI to have exclusive access to the busses for a sequence of + * transfers. The bus should be locked before the chip is selected. + * + * This is a blocking call and will not return until we have exclusiv access to + * the SPI buss. We will retain that exclusive access until the bus is unlocked. + */ + + (void)SPI_LOCK(dev, true); + + /* After locking the SPI bus, the we also need call the setfrequency, setbits, and + * setmode methods to make sure that the SPI is properly configured for the device. + * If the SPI buss is being shared, then it may have been left in an incompatible + * state. + */ + + SPI_SETMODE(dev, CONFIG_AT25_SPIMODE); + SPI_SETBITS(dev, 8); + (void)SPI_SETFREQUENCY(dev, 20000000); +} + +/************************************************************************************ + * Name: at25_unlock + ************************************************************************************/ + +static inline void at25_unlock(FAR struct spi_dev_s *dev) +{ + (void)SPI_LOCK(dev, false); +} + +/************************************************************************************ + * Name: at25_readid + ************************************************************************************/ + +static inline int at25_readid(struct at25_dev_s *priv) +{ + uint16_t manufacturer; + uint16_t memory; + uint16_t version; + + fvdbg("priv: %p\n", priv); + + /* Lock the SPI bus, configure the bus, and select this FLASH part. */ + + at25_lock(priv->dev); + SPI_SELECT(priv->dev, SPIDEV_FLASH, true); + + /* Send the "Read ID (RDID)" command and read the first three ID bytes */ + + (void)SPI_SEND(priv->dev, AT25_RDID); + manufacturer = SPI_SEND(priv->dev, AT25_DUMMY); + memory = SPI_SEND(priv->dev, AT25_DUMMY); + + /* Deselect the FLASH and unlock the bus */ + + SPI_SELECT(priv->dev, SPIDEV_FLASH, false); + at25_unlock(priv->dev); + + fvdbg("manufacturer: %02x memory: %02x\n", + manufacturer, memory); + + /* Check for a valid manufacturer and memory type */ + + if (manufacturer == AT25_MANUFACTURER && memory == AT25_AT25DF321_TYPE) + { + priv->sectorshift = AT25_AT25DF321_SECTOR_SHIFT; + priv->nsectors = AT25_AT25DF321_NSECTORS; + priv->pageshift = AT25_AT25DF321_PAGE_SHIFT; + priv->npages = AT25_AT25DF321_NPAGES; + return OK; + } + + return -ENODEV; +} + +/************************************************************************************ + * Name: at25_waitwritecomplete + ************************************************************************************/ + +static void at25_waitwritecomplete(struct at25_dev_s *priv) +{ + uint8_t status; + + /* Are we the only device on the bus? */ + +#ifdef CONFIG_SPI_OWNBUS + + /* Select this FLASH part */ + + SPI_SELECT(priv->dev, SPIDEV_FLASH, true); + + /* Send "Read Status Register (RDSR)" command */ + + (void)SPI_SEND(priv->dev, AT25_RDSR); + + /* Loop as long as the memory is busy with a write cycle */ + + do + { + /* Send a dummy byte to generate the clock needed to shift out the status */ + + status = SPI_SEND(priv->dev, AT25_DUMMY); + } + while ((status & AT25_SR_WIP) != 0); + + /* Deselect the FLASH */ + + SPI_SELECT(priv->dev, SPIDEV_FLASH, false); + +#else + + /* Loop as long as the memory is busy with a write cycle */ + + do + { + /* Select this FLASH part */ + + SPI_SELECT(priv->dev, SPIDEV_FLASH, true); + + /* Send "Read Status Register (RDSR)" command */ + + (void)SPI_SEND(priv->dev, AT25_RDSR); + + /* Send a dummy byte to generate the clock needed to shift out the status */ + + status = SPI_SEND(priv->dev, AT25_DUMMY); + + /* Deselect the FLASH */ + + SPI_SELECT(priv->dev, SPIDEV_FLASH, false); + + /* Given that writing could take up to few tens of milliseconds, and erasing + * could take more. The following short delay in the "busy" case will allow + * other peripherals to access the SPI bus. + */ + + if ((status & AT25_SR_WIP) != 0) + { + at25_unlock(priv->dev); + usleep(10000); + at25_lock(priv->dev); + } + } + while ((status & AT25_SR_WIP) != 0); +#endif + + if (status & AT25_SR_EPE) + { + fdbg("Write error, status: 0x%02x\n", status); + } + + fvdbg("Complete, status: 0x%02x\n", status); +} + +/************************************************************************************ + * Name: at25_writeenable + ************************************************************************************/ + +static void at25_writeenable(struct at25_dev_s *priv) +{ + SPI_SELECT(priv->dev, SPIDEV_FLASH, true); + (void)SPI_SEND(priv->dev, AT25_WREN); + SPI_SELECT(priv->dev, SPIDEV_FLASH, false); + fvdbg("Enabled\n"); +} + +/************************************************************************************ + * Name: at25_sectorerase + ************************************************************************************/ + +static inline void at25_sectorerase(struct at25_dev_s *priv, off_t sector) +{ + off_t offset = sector << priv->sectorshift; + + fvdbg("sector: %08lx\n", (long)sector); + + /* Wait for any preceding write to complete. We could simplify things by + * perform this wait at the end of each write operation (rather than at + * the beginning of ALL operations), but have the wait first will slightly + * improve performance. + */ + + at25_waitwritecomplete(priv); + + /* Send write enable instruction */ + + at25_writeenable(priv); + + /* Select this FLASH part */ + + SPI_SELECT(priv->dev, SPIDEV_FLASH, true); + + /* Send the "Sector Erase (SE)" instruction */ + + (void)SPI_SEND(priv->dev, AT25_SE); + + /* Send the sector offset high byte first. For all of the supported + * parts, the sector number is completely contained in the first byte + * and the values used in the following two bytes don't really matter. + */ + + (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); + (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); + (void)SPI_SEND(priv->dev, offset & 0xff); + + /* Deselect the FLASH */ + + SPI_SELECT(priv->dev, SPIDEV_FLASH, false); + fvdbg("Erased\n"); +} + +/************************************************************************************ + * Name: at25_bulkerase + ************************************************************************************/ + +static inline int at25_bulkerase(struct at25_dev_s *priv) +{ + fvdbg("priv: %p\n", priv); + + /* Wait for any preceding write to complete. We could simplify things by + * perform this wait at the end of each write operation (rather than at + * the beginning of ALL operations), but have the wait first will slightly + * improve performance. + */ + + at25_waitwritecomplete(priv); + + /* Send write enable instruction */ + + at25_writeenable(priv); + + /* Select this FLASH part */ + + SPI_SELECT(priv->dev, SPIDEV_FLASH, true); + + /* Send the "Bulk Erase (BE)" instruction */ + + (void)SPI_SEND(priv->dev, AT25_BE); + + /* Deselect the FLASH */ + + SPI_SELECT(priv->dev, SPIDEV_FLASH, false); + fvdbg("Return: OK\n"); + return OK; +} + +/************************************************************************************ + * Name: at25_pagewrite + ************************************************************************************/ + +static inline void at25_pagewrite(struct at25_dev_s *priv, FAR const uint8_t *buffer, + off_t page) +{ + off_t offset = page << 8; + + fvdbg("page: %08lx offset: %08lx\n", (long)page, (long)offset); + + /* Wait for any preceding write to complete. We could simplify things by + * perform this wait at the end of each write operation (rather than at + * the beginning of ALL operations), but have the wait first will slightly + * improve performance. + */ + + at25_waitwritecomplete(priv); + + /* Enable the write access to the FLASH */ + + at25_writeenable(priv); + + /* Select this FLASH part */ + + SPI_SELECT(priv->dev, SPIDEV_FLASH, true); + + /* Send "Page Program (PP)" command */ + + (void)SPI_SEND(priv->dev, AT25_PP); + + /* Send the page offset high byte first. */ + + (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); + (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); + (void)SPI_SEND(priv->dev, offset & 0xff); + + /* Then write the specified number of bytes */ + + SPI_SNDBLOCK(priv->dev, buffer, 256); + + /* Deselect the FLASH: Chip Select high */ + + SPI_SELECT(priv->dev, SPIDEV_FLASH, false); + fvdbg("Written\n"); +} + +/************************************************************************************ + * Name: at25_erase + ************************************************************************************/ + +static int at25_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks) +{ + FAR struct at25_dev_s *priv = (FAR struct at25_dev_s *)dev; + size_t blocksleft = nblocks; + + fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks); + + /* Lock access to the SPI bus until we complete the erase */ + + at25_lock(priv->dev); + while (blocksleft-- > 0) + { + /* Erase each sector */ + + at25_sectorerase(priv, startblock); + startblock++; + } + + at25_unlock(priv->dev); + return (int)nblocks; +} + +/************************************************************************************ + * Name: at25_bread + ************************************************************************************/ + +static ssize_t at25_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, + FAR uint8_t *buffer) +{ + FAR struct at25_dev_s *priv = (FAR struct at25_dev_s *)dev; + ssize_t nbytes; + + fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks); + + /* On this device, we can handle the block read just like the byte-oriented read */ + + nbytes = at25_read(dev, startblock << priv->pageshift, nblocks << priv->pageshift, buffer); + if (nbytes > 0) + { + return nbytes >> priv->pageshift; + } + + return (int)nbytes; +} + +/************************************************************************************ + * Name: at25_bwrite + ************************************************************************************/ + +static ssize_t at25_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, + FAR const uint8_t *buffer) +{ + FAR struct at25_dev_s *priv = (FAR struct at25_dev_s *)dev; + size_t blocksleft = nblocks; + + fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks); + + /* Lock the SPI bus and write each page to FLASH */ + + at25_lock(priv->dev); + while (blocksleft-- > 0) + { + at25_pagewrite(priv, buffer, startblock * 2); + at25_pagewrite(priv, buffer + 256, startblock * 2 + 1); + buffer += 1 << priv->pageshift; + startblock++; + } + + at25_unlock(priv->dev); + return nblocks; +} + +/************************************************************************************ + * Name: at25_read + ************************************************************************************/ + +static ssize_t at25_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, + FAR uint8_t *buffer) +{ + FAR struct at25_dev_s *priv = (FAR struct at25_dev_s *)dev; + + fvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes); + + /* Wait for any preceding write to complete. We could simplify things by + * perform this wait at the end of each write operation (rather than at + * the beginning of ALL operations), but have the wait first will slightly + * improve performance. + */ + + at25_waitwritecomplete(priv); + + /* Lock the SPI bus and select this FLASH part */ + + at25_lock(priv->dev); + SPI_SELECT(priv->dev, SPIDEV_FLASH, true); + + /* Send "Read from Memory " instruction */ + + (void)SPI_SEND(priv->dev, AT25_READ); + + /* Send the page offset high byte first. */ + + (void)SPI_SEND(priv->dev, (offset >> 16) & 0xff); + (void)SPI_SEND(priv->dev, (offset >> 8) & 0xff); + (void)SPI_SEND(priv->dev, offset & 0xff); + + /* Then read all of the requested bytes */ + + SPI_RECVBLOCK(priv->dev, buffer, nbytes); + + /* Deselect the FLASH and unlock the SPI bus */ + + SPI_SELECT(priv->dev, SPIDEV_FLASH, false); + at25_unlock(priv->dev); + + fvdbg("return nbytes: %d\n", (int)nbytes); + return nbytes; +} + +/************************************************************************************ + * Name: at25_ioctl + ************************************************************************************/ + +static int at25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) +{ + FAR struct at25_dev_s *priv = (FAR struct at25_dev_s *)dev; + int ret = -EINVAL; /* Assume good command with bad parameters */ + + fvdbg("cmd: %d \n", cmd); + + switch (cmd) + { + case MTDIOC_GEOMETRY: + { + FAR struct mtd_geometry_s *geo = (FAR struct mtd_geometry_s *)((uintptr_t)arg); + if (geo) + { + /* Populate the geometry structure with information need to know + * the capacity and how to access the device. + * + * NOTE: that the device is treated as though it where just an array + * of fixed size blocks. That is most likely not true, but the client + * will expect the device logic to do whatever is necessary to make it + * appear so. + */ + + geo->blocksize = (1 << priv->pageshift); + geo->erasesize = (1 << priv->sectorshift); + geo->neraseblocks = priv->nsectors; + ret = OK; + + fvdbg("blocksize: %d erasesize: %d neraseblocks: %d\n", + geo->blocksize, geo->erasesize, geo->neraseblocks); + } + } + break; + + case MTDIOC_BULKERASE: + { + /* Erase the entire device */ + + at25_lock(priv->dev); + ret = at25_bulkerase(priv); + at25_unlock(priv->dev); + } + break; + + case MTDIOC_XIPBASE: + default: + ret = -ENOTTY; /* Bad command */ + break; + } + + fvdbg("return %d\n", ret); + return ret; +} + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: at25_initialize + * + * Description: + * Create an initialize MTD device instance. MTD devices are not registered + * in the file system, but are created as instances that can be bound to + * other functions (such as a block or character driver front end). + * + ************************************************************************************/ + +FAR struct mtd_dev_s *at25_initialize(FAR struct spi_dev_s *dev) +{ + FAR struct at25_dev_s *priv; + int ret; + + fvdbg("dev: %p\n", dev); + + /* Allocate a state structure (we allocate the structure instead of using + * a fixed, static allocation so that we can handle multiple FLASH devices. + * The current implementation would handle only one FLASH part per SPI + * device (only because of the SPIDEV_FLASH definition) and so would have + * to be extended to handle multiple FLASH parts on the same SPI bus. + */ + + priv = (FAR struct at25_dev_s *)kmalloc(sizeof(struct at25_dev_s)); + if (priv) + { + /* Initialize the allocated structure */ + + priv->mtd.erase = at25_erase; + priv->mtd.bread = at25_bread; + priv->mtd.bwrite = at25_bwrite; + priv->mtd.read = at25_read; + priv->mtd.ioctl = at25_ioctl; + priv->dev = dev; + + /* Deselect the FLASH */ + + SPI_SELECT(dev, SPIDEV_FLASH, false); + + /* Identify the FLASH chip and get its capacity */ + + ret = at25_readid(priv); + if (ret != OK) + { + /* Unrecognized! Discard all of that work we just did and return NULL */ + + fdbg("Unrecognized\n"); + kfree(priv); + priv = NULL; + } + + /* Unprotect all sectors */ + + at25_writeenable(priv); + SPI_SELECT(priv->dev, SPIDEV_FLASH, true); + (void)SPI_SEND(priv->dev, AT25_WRSR); + (void)SPI_SEND(priv->dev, AT25_SR_UNPROT); + SPI_SELECT(priv->dev, SPIDEV_FLASH, false); + } + + /* Return the implementation-specific state structure as the MTD device */ + + fvdbg("Return %p\n", priv); + return (FAR struct mtd_dev_s *)priv; +} diff --git a/nuttx/drivers/mtd/ftl.c b/nuttx/drivers/mtd/ftl.c index cdb35aa5c..6cf8f0317 100644 --- a/nuttx/drivers/mtd/ftl.c +++ b/nuttx/drivers/mtd/ftl.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/mtd/ftl.c * - * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -229,6 +229,10 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer, remaining = nblocks; if (alignedblock > startblock) { + /* Check if the write is shorter than to the end of the erase block */ + + bool short_write = (remaining < (alignedblock - startblock)); + /* Read the full erase block into the buffer */ rwblock = startblock & ~mask; @@ -252,9 +256,19 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer, /* Copy the user data at the end of the buffered erase block */ offset = (startblock & mask) * dev->geo.blocksize; - nbytes = dev->geo.erasesize - offset; + + if (short_write) + { + nbytes = remaining * dev->geo.blocksize; + } + else + { + nbytes = dev->geo.erasesize - offset; + } + fvdbg("Copy %d bytes into erase block=%d at offset=%d\n", nbytes, eraseblock, offset); + memcpy(dev->eblock + offset, buffer, nbytes); /* And write the erase back to flash */ @@ -268,8 +282,16 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer, /* Then update for amount written */ - remaining -= dev->blkper - (startblock & mask); - buffer += nbytes; + if (short_write) + { + remaining = 0; + } + else + { + remaining -= dev->blkper - (startblock & mask); + } + + buffer += nbytes; } /* How handle full erase pages in the middle */ @@ -290,6 +312,7 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer, fvdbg("Write %d bytes into erase block=%d at offset=0\n", dev->geo.erasesize, alignedblock); + nxfrd = MTD_BWRITE(dev->mtd, alignedblock, dev->blkper, buffer); if (nxfrd != dev->blkper) { diff --git a/nuttx/graphics/nxtk/nxtk_getwindow.c b/nuttx/graphics/nxtk/nxtk_getwindow.c index 121c7702a..c91f2d22f 100644 --- a/nuttx/graphics/nxtk/nxtk_getwindow.c +++ b/nuttx/graphics/nxtk/nxtk_getwindow.c @@ -110,12 +110,15 @@ int nxtk_getwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect, } #endif - /* Clip the rectangle so that it lies within the sub-window bounds - * then move the rectangle to that it is relative to the containing - * window. + /* Move the rectangle to that it is relative to the containing + * window. If part of the rectangle lies outside the window, + * it will contain garbage data, but the contained area will be + * valid. */ - nxtk_subwindowclip(fwnd, &getrect, rect, &fwnd->fwrect); + nxgl_rectoffset(&getrect, rect, + fwnd->fwrect.pt1.x - fwnd->wnd.bounds.pt1.x, + fwnd->fwrect.pt1.y - fwnd->wnd.bounds.pt1.y); /* Then get it */ diff --git a/nuttx/graphics/nxtk/nxtk_subwindowmove.c b/nuttx/graphics/nxtk/nxtk_subwindowmove.c index a6fd9f5dd..3c2bb7f37 100644 --- a/nuttx/graphics/nxtk/nxtk_subwindowmove.c +++ b/nuttx/graphics/nxtk/nxtk_subwindowmove.c @@ -112,21 +112,19 @@ void nxtk_subwindowmove(FAR struct nxtk_framedwindow_s *fwnd, nxgl_rectintersect(&abssrc, &abssrc, &fwnd->fwrect); - /* Clip the offset so that the source rectangle does not move out of the - * the client sub-window. - */ + /* Clip the source rectangle so that destination area is within the window. */ destoffset->x = srcoffset->x; if (destoffset->x < 0) { if (abssrc.pt1.x + destoffset->x < bounds->pt1.x) { - destoffset->x = bounds->pt1.x - abssrc.pt1.x; + abssrc.pt1.x = bounds->pt1.x - destoffset->x; } } else if (abssrc.pt2.x + destoffset->x > bounds->pt2.x) { - destoffset->x = bounds->pt2.x - abssrc.pt2.x; + abssrc.pt2.x = bounds->pt2.x - destoffset->x; } destoffset->y = srcoffset->y; @@ -134,12 +132,12 @@ void nxtk_subwindowmove(FAR struct nxtk_framedwindow_s *fwnd, { if (abssrc.pt1.y + destoffset->y < bounds->pt1.y) { - destoffset->y = bounds->pt1.y - abssrc.pt1.y; + abssrc.pt1.y = bounds->pt1.y - destoffset->y; } } else if (abssrc.pt2.y + destoffset->y > bounds->pt2.y) { - destoffset->y = bounds->pt2.y - abssrc.pt2.y; + abssrc.pt2.y = bounds->pt2.y - destoffset->y; } diff --git a/nuttx/include/cxx/cmath b/nuttx/include/cxx/cmath index 55c7c1dcc..b30d5548b 100644 --- a/nuttx/include/cxx/cmath +++ b/nuttx/include/cxx/cmath @@ -69,6 +69,7 @@ namespace std using ::log10f; using ::log2f; using ::modff; + using ::roundf; using ::powf; using ::sinf; using ::sinhf; @@ -95,6 +96,7 @@ namespace std using ::log10; using ::log2; using ::modf; + using ::round; using ::pow; using ::sin; using ::sinh; @@ -121,6 +123,7 @@ namespace std using ::log10l; using ::log2l; using ::modfl; + using ::roundl; using ::powl; using ::sinl; using ::sinhl; diff --git a/nuttx/include/cxx/cstdlib b/nuttx/include/cxx/cstdlib index 522f3fdb1..1bf8ed9da 100644 --- a/nuttx/include/cxx/cstdlib +++ b/nuttx/include/cxx/cstdlib @@ -70,6 +70,7 @@ namespace std #endif using ::strtol; + using ::strtoul; using ::strtod; using ::malloc; diff --git a/nuttx/include/nuttx/fs/fs.h b/nuttx/include/nuttx/fs/fs.h index aab4ae4be..1759310bc 100644 --- a/nuttx/include/nuttx/fs/fs.h +++ b/nuttx/include/nuttx/fs/fs.h @@ -176,7 +176,7 @@ struct mountpt_operations int (*statfs)(FAR struct inode *mountpt, FAR struct statfs *buf); - /* Operations on pathes */ + /* Operations on paths */ int (*unlink)(FAR struct inode *mountpt, FAR const char *relpath); int (*mkdir)(FAR struct inode *mountpt, FAR const char *relpath, mode_t mode); diff --git a/nuttx/include/nuttx/math.h b/nuttx/include/nuttx/math.h index 160926d07..aaadb9c91 100644 --- a/nuttx/include/nuttx/math.h +++ b/nuttx/include/nuttx/math.h @@ -141,6 +141,14 @@ double floor (double x); long double floorl(long double x); #endif +float roundf(float x); +#if CONFIG_HAVE_DOUBLE +double round (double x); +#endif +#ifdef CONFIG_HAVE_LONG_DOUBLE +long double roundl(long double x); +#endif + float fabsf (float x); #if CONFIG_HAVE_DOUBLE double fabs (double x); diff --git a/nuttx/include/nuttx/mtd.h b/nuttx/include/nuttx/mtd.h index 44582c412..ff48d313f 100644 --- a/nuttx/include/nuttx/mtd.h +++ b/nuttx/include/nuttx/mtd.h @@ -220,7 +220,6 @@ EXTERN FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_dev_s *dev); EXTERN FAR struct mtd_dev_s *sst25_initialize(FAR struct spi_dev_s *dev); - /**************************************************************************** * Name: w25_initialize * @@ -233,6 +232,8 @@ EXTERN FAR struct mtd_dev_s *sst25_initialize(FAR struct spi_dev_s *dev); EXTERN FAR struct mtd_dev_s *w25_initialize(FAR struct spi_dev_s *dev); +EXTERN FAR struct mtd_dev_s *at25_initialize(FAR struct spi_dev_s *dev); + #undef EXTERN #ifdef __cplusplus } diff --git a/nuttx/include/stdbool.h b/nuttx/include/stdbool.h index f11219912..9c16aee29 100644 --- a/nuttx/include/stdbool.h +++ b/nuttx/include/stdbool.h @@ -42,10 +42,33 @@ #include +/* If CONFIG_ARCH_STDBOOL_H is set, then the archecture will provide its own + * stdbool.h file. In this case, this header file will simply re-direct to + * the architecture-specfiic stdbool.h header file. + */ + #ifdef CONFIG_ARCH_STDBOOL_H # include + +/* NuttX will insist that the sizeof(bool) is 8-bits. The sizeof of _Bool + * used by any specific compiler is implementation specific: It can vary from + * compiler-to-compiler and even vary between different versions of the same + * compiler. Compilers seems to be converging to sizeof(_Bool) == 1. If that + * is true for your compiler, you should define CONFIG_C99_BOOL8 in your NuttX + * configuration for better standards compatibility. + * + * CONFIG_C99_BOOL8 - Means (1) your C++ compiler has sizeof(_Bool) == 8, + * (2) your C compiler supports the C99 _Bool intrinsic type, and (2) that + * the C99 _Bool type also has size 1. + */ + #else + + /* nuttx/compiler.h may also define or undefine CONFIG_C99_BOOL8 */ + # include + +#if !defined(__cplusplus) || !defined(CONFIG_C99_BOOL8) # include /**************************************************************************** @@ -58,10 +81,15 @@ * NOTE: Under C99 'bool' is required to be defined to be the intrinsic type * _Bool. However, in this NuttX context, we need backward compatibility * to pre-C99 standards where _Bool is not an intrinsic type. Hence, we - * use _Bool8 as the underlying type. + * use _Bool8 as the underlying type (unless CONFIG_C99_BOOL8 is defined) */ -#define bool _Bool8 +#ifdef CONFIG_C99_BOOL8 +# define bool _Bool +#else +# define bool _Bool8 +#endif + #define true 1 #define false 0 @@ -83,7 +111,10 @@ * as the underlying type. */ +#ifndef CONFIG_C99_BOOL8 typedef uint8_t _Bool8; +#endif +#endif /* __cplusplus && CONFIG_C99_BOOL8 */ #endif /* CONFIG_ARCH_STDBOOL_H */ #endif /* __INCLUDE_STDBOOL_H */ diff --git a/nuttx/libc/math/Make.defs b/nuttx/libc/math/Make.defs index bc6a265f0..ece25f4e5 100644 --- a/nuttx/libc/math/Make.defs +++ b/nuttx/libc/math/Make.defs @@ -40,17 +40,17 @@ ifeq ($(CONFIG_LIBM),y) CSRCS += lib_acosf.c lib_asinf.c lib_atan2f.c lib_atanf.c lib_ceilf.c lib_cosf.c CSRCS += lib_coshf.c lib_expf.c lib_fabsf.c lib_floorf.c lib_fmodf.c lib_frexpf.c CSRCS += lib_ldexpf.c lib_logf.c lib_log10f.c lib_log2f.c lib_modff.c lib_powf.c -CSRCS += lib_sinf.c lib_sinhf.c lib_sqrtf.c lib_tanf.c lib_tanhf.c +CSRCS += lib_roundf.c lib_sinf.c lib_sinhf.c lib_sqrtf.c lib_tanf.c lib_tanhf.c CSRCS += lib_acos.c lib_asin.c lib_atan.c lib_atan2.c lib_ceil.c lib_cos.c CSRCS += lib_cosh.c lib_exp.c lib_fabs.c lib_floor.c lib_fmod.c lib_frexp.c CSRCS += lib_ldexp.c lib_log.c lib_log10.c lib_log2.c lib_modf.c lib_pow.c -CSRCS += lib_sin.c lib_sinh.c lib_sqrt.c lib_tan.c lib_tanh.c +CSRCS += lib_round.c lib_sin.c lib_sinh.c lib_sqrt.c lib_tan.c lib_tanh.c CSRCS += lib_acosl.c lib_asinl.c lib_atan2l.c lib_atanl.c lib_ceill.c lib_cosl.c CSRCS += lib_coshl.c lib_expl.c lib_fabsl.c lib_floorl.c lib_fmodl.c lib_frexpl.c CSRCS += lib_ldexpl.c lib_logl.c lib_log10l.c lib_log2l.c lib_modfl.c lib_powl.c -CSRCS += lib_sinl.c lib_sinhl.c lib_sqrtl.c lib_tanl.c lib_tanhl.c +CSRCS += lib_roundl.c lib_sinl.c lib_sinhl.c lib_sqrtl.c lib_tanl.c lib_tanhl.c CSRCS += lib_libexpi.c lib_libsqrtapprox.c diff --git a/nuttx/libc/math/lib_round.c b/nuttx/libc/math/lib_round.c new file mode 100644 index 000000000..6191cee5b --- /dev/null +++ b/nuttx/libc/math/lib_round.c @@ -0,0 +1,40 @@ +/************************************************************************ + * lib/math/lib_round.c + * + * This file is a part of NuttX: + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * (C) 2012 Petteri Aimonen + * + ************************************************************************/ + +/************************************************************************ + * Included Files + ************************************************************************/ + +#include +#include + +#include + +/************************************************************************ + * Public Functions + ************************************************************************/ + +#ifdef CONFIG_HAVE_DOUBLE +double round(double x) +{ + double f = modf(x, &x); + if (x <= 0.0 && f <= -0.5) + { + x -= 1.0; + } + + if (x >= 0.0 && f >= 0.5) + { + x += 1.0; + } + + return x; +} +#endif diff --git a/nuttx/libc/math/lib_roundf.c b/nuttx/libc/math/lib_roundf.c new file mode 100644 index 000000000..145cf3df6 --- /dev/null +++ b/nuttx/libc/math/lib_roundf.c @@ -0,0 +1,38 @@ +/************************************************************************ + * lib/math/lib_roundf.c + * + * This file is a part of NuttX: + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * (C) 2012 Petteri Aimonen + * + ************************************************************************/ + +/************************************************************************ + * Included Files + ************************************************************************/ + +#include +#include + +#include + +/************************************************************************ + * Public Functions + ************************************************************************/ + +float roundf(float x) +{ + float f = modff(x, &x); + if (x <= 0.0f && f <= -0.5f) + { + x -= 1.0f; + } + + if (x >= 0.0f && f >= 0.5f) + { + x += 1.0f; + } + + return x; +} diff --git a/nuttx/libc/math/lib_roundl.c b/nuttx/libc/math/lib_roundl.c new file mode 100644 index 000000000..b2ddba670 --- /dev/null +++ b/nuttx/libc/math/lib_roundl.c @@ -0,0 +1,40 @@ +/************************************************************************ + * lib/math/lib_round.c + * + * This file is a part of NuttX: + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * (C) 2012 Petteri Aimonen + * + ************************************************************************/ + +/************************************************************************ + * Included Files + ************************************************************************/ + +#include +#include + +#include + +/************************************************************************ + * Public Functions + ************************************************************************/ + +#ifdef CONFIG_HAVE_LONG_DOUBLE +long double roundl(long double x) +{ + long double f = modfl(x, &x); + if (x <= 0.0 && f <= -0.5) + { + x -= 1.0; + } + + if (x >= 0.0 && f >= 0.5) + { + x += 1.0; + } + + return x; +} +#endif diff --git a/nuttx/libc/stdlib/lib_rand.c b/nuttx/libc/stdlib/lib_rand.c index 0faef5d66..453a4537a 100644 --- a/nuttx/libc/stdlib/lib_rand.c +++ b/nuttx/libc/stdlib/lib_rand.c @@ -74,7 +74,7 @@ static unsigned int nrand(unsigned int nLimit); /* First order congruential generators */ -static inline void fgenerate1(void); +static inline unsigned long fgenerate1(void); #if (CONFIG_LIB_RAND_ORDER == 1) static double_t frand1(void); #endif @@ -82,7 +82,7 @@ static double_t frand1(void); /* Second order congruential generators */ #if (CONFIG_LIB_RAND_ORDER > 1) -static inline void fgenerate2(void); +static inline unsigned long fgenerate2(void); #if (CONFIG_LIB_RAND_ORDER == 2) static double_t frand2(void); #endif @@ -90,7 +90,7 @@ static double_t frand2(void); /* Third order congruential generators */ #if (CONFIG_LIB_RAND_ORDER > 2) -static inline void fgenerate3(void); +static inline unsigned long fgenerate3(void); static double_t frand3(void); #endif #endif @@ -141,7 +141,7 @@ static unsigned int nrand(unsigned int nLimit) /* First order congruential generators */ -static inline void fgenerate1(void) +static inline unsigned long fgenerate1(void) { unsigned long randint; @@ -152,6 +152,7 @@ static inline void fgenerate1(void) randint = (RND1_CONSTK * g_randint1) % RND1_CONSTP; g_randint1 = (randint == 0 ? 1 : randint); + return randint; } #if (CONFIG_LIB_RAND_ORDER == 1) @@ -159,18 +160,18 @@ static double_t frand1(void) { /* First order congruential generator. */ - fgenerate1(); + unsigned long randint = fgenerate1(); /* Construct an floating point value in the range from 0.0 up to 1.0 */ - return ((double_t)g_randint1) / ((double_t)RND1_CONSTP); + return ((double_t)randint) / ((double_t)RND1_CONSTP); } #endif /* Second order congruential generators */ #if (CONFIG_LIB_RAND_ORDER > 1) -static inline void fgenerate2(void) +static inline unsigned long fgenerate2(void) { unsigned long randint; @@ -190,6 +191,8 @@ static inline void fgenerate2(void) { g_randint2 = 1; } + + return randint; } #if (CONFIG_LIB_RAND_ORDER == 2) @@ -197,18 +200,18 @@ static double_t frand2(void) { /* Second order congruential generator */ - fgenerate2(); + unsigned long randint = fgenerate2(); /* Construct an floating point value in the range from 0.0 up to 1.0 */ - return ((double_t)g_randint1) / ((double_t)RND2_CONSTP); + return ((double_t)randint) / ((double_t)RND2_CONSTP); } #endif /* Third order congruential generators */ #if (CONFIG_LIB_RAND_ORDER > 2) -static inline void fgenerate3(void) +static inline unsigned long fgenerate3(void) { unsigned long randint; @@ -230,17 +233,19 @@ static inline void fgenerate3(void) { g_randint3 = 1; } + + return randint; } static double_t frand3(void) { /* Third order congruential generator */ - fgenerate3(); + unsigned long randint = fgenerate3(); /* Construct an floating point value in the range from 0.0 up to 1.0 */ - return ((double_t)g_randint1) / ((double_t)RND3_CONSTP); + return ((double_t)randint) / ((double_t)RND3_CONSTP); } #endif #endif @@ -258,10 +263,10 @@ void srand(unsigned int seed) g_randint1 = seed; #if (CONFIG_LIB_RAND_ORDER > 1) g_randint2 = seed; - fgenerate1(); + (void)fgenerate1(); #if (CONFIG_LIB_RAND_ORDER > 2) g_randint3 = seed; - fgenerate2(); + (void)fgenerate2(); #endif #endif } diff --git a/nuttx/libxx/Kconfig b/nuttx/libxx/Kconfig index 8b5fc42e8..9c78342c2 100644 --- a/nuttx/libxx/Kconfig +++ b/nuttx/libxx/Kconfig @@ -5,6 +5,14 @@ comment "Basic CXX Support" +config C99_BOOL8 + bool "sizeof(_Bool) is 8-bits" + default n + ---help--- + This setting means (1) your C++ compiler has sizeof(_Bool) == 8, (2) + your C compiler supports the C99 _Bool intrinsic type, and (2) that + the C99 _Bool type also has size 1. + config HAVE_CXX bool "Have C++ compiler" default n -- cgit v1.2.3 From cb393b2757e7afaae1616fd6abd6aed984786650 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 7 Dec 2012 19:02:57 +0000 Subject: Redesign z80 build so that mkhpbase.sh bash script is not needed; remove support for older SDCC toolchains; Re-verify z80 build on Linux git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5416 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z80/src/Makefile.sdccl | 155 +++++++-------------- nuttx/arch/z80/src/Makefile.sdccw | 146 +++++-------------- nuttx/arch/z80/src/common/up_arch.h | 6 +- nuttx/arch/z80/src/common/up_internal.h | 6 +- nuttx/arch/z80/src/mkhpbase.bat | 45 ------ nuttx/arch/z80/src/mkhpbase.sh | 109 --------------- nuttx/arch/z80/src/z80/up_mem.h | 75 ++++++++++ nuttx/arch/z80/src/z80/z80_head.asm | 21 +++ nuttx/arch/z80/src/z80/z80_io.c | 24 +--- nuttx/arch/z80/src/z80/z80_irq.c | 16 +-- nuttx/configs/xtrs/README.txt | 61 +------- nuttx/configs/xtrs/nsh/Make.defs | 18 +-- nuttx/configs/xtrs/ostest/Make.defs | 18 +-- nuttx/configs/xtrs/pashello/Make.defs | 18 +-- nuttx/configs/xtrs/sdcc-2.6.0-asz80-symlen.patch | 11 -- nuttx/configs/z80sim/README.txt | 72 +--------- nuttx/configs/z80sim/nsh/Make.defs | 18 +-- nuttx/configs/z80sim/ostest/Make.defs | 18 +-- nuttx/configs/z80sim/pashello/Make.defs | 18 +-- nuttx/configs/z80sim/sdcc-2.6.0-asz80-symlen.patch | 11 -- nuttx/configs/z80sim/src/z80_lowputc.c | 19 --- 21 files changed, 231 insertions(+), 654 deletions(-) delete mode 100755 nuttx/arch/z80/src/mkhpbase.bat delete mode 100755 nuttx/arch/z80/src/mkhpbase.sh create mode 100644 nuttx/arch/z80/src/z80/up_mem.h delete mode 100644 nuttx/configs/xtrs/sdcc-2.6.0-asz80-symlen.patch delete mode 100644 nuttx/configs/z80sim/sdcc-2.6.0-asz80-symlen.patch (limited to 'nuttx') diff --git a/nuttx/arch/z80/src/Makefile.sdccl b/nuttx/arch/z80/src/Makefile.sdccl index 916f85b70..d4cf28a45 100644 --- a/nuttx/arch/z80/src/Makefile.sdccl +++ b/nuttx/arch/z80/src/Makefile.sdccl @@ -75,15 +75,11 @@ VPATH = chip:common:board LIBGCC = ${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name} -# Supports dynamic sizing of HEAP. -# -HEAP_BASE = ${shell ./mkhpbase.sh} - # Targets all: $(HEAD_OBJ) libarch$(LIBEXT) -.PHONY: board/libboard$(LIBEXT) pass1.lnk nuttx.lnk +.PHONY: board/libboard$(LIBEXT) nuttx.lnk $(AOBJS) $(HEAD_OBJ): %$(OBJEXT): %$(ASMEXT) $(call ASSEMBLE, $<, $@) @@ -93,72 +89,46 @@ $(COBJS): %$(OBJEXT): %.c # This is a kludge to work around some conflicting symbols in libsdcc.lib -$(TOPDIR)/lib/myz80.lib: $(SDCC_LIBDIR)/$(SDCCLIB) -ifeq ($(CONFIG_SDCC_OLD),y) - $(Q) cat $(SDCC_LIBDIR)/$(SDCCLIB) | \ - grep -v alloc | grep -v free | grep -v printf | \ - grep -v _str | grep -v _mem | grep -v crt0\.o \ - > $(TOPDIR)/lib/myz80.lib -else - $(Q) cp $(SDCC_LIBDIR)/z80.lib $(TOPDIR)/lib/myz80.lib - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _calloc.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _malloc.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _realloc.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _free.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib printf_large.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib sprintf.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib vprintf.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib strcpy.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib strlen.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strcat.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strchr.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strcmp.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strcspn.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strncat.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strncmp.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strncpy.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strpbrk.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strrchr.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strspn.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strstr.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _strtok.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _memchr.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _memcmp.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _memcpy.rel - $(Q) sdar d $(TOPDIR)/lib/myz80.lib _memset.rel -endif - -# Create a header file that contains addressing information needed by the code - -up_mem.h: - @echo "#ifndef __UP_MEM_H" >up_mem.h - @echo "#define __UP_MEM_H" >>up_mem.h - @echo "" >>up_mem.h - @echo "#include " >>up_mem.h - @echo "" >>up_mem.h - @echo "#define CONFIG_STACK_END $(CONFIG_DRAM_SIZE)" >> up_mem.h - @echo "#define CONFIG_STACK_BASE (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE))" >> up_mem.h - @echo "#define CONFIG_HEAP1_END CONFIG_STACK_BASE" >> up_mem.h - @echo "#define CONFIG_HEAP1_BASE $(HEAP_BASE)" >> up_mem.h - @echo "" >>up_mem.h - @echo "#endif /* __UP_MEM_H */" >>up_mem.h +$(TOPDIR)/lib/$(SDCCLIB): $(SDCC_LIBDIR)/$(SDCCLIB) + $(Q) cp $(SDCC_LIBDIR)/$(SDCCLIB) $(TOPDIR)/lib/$(SDCCLIB) + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _calloc.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _malloc.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _realloc.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _free.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) printf_large.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) sprintf.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) vprintf.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) strcpy.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) strlen.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strcat.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strchr.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strcmp.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strcspn.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strncat.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strncmp.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strncpy.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strpbrk.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strrchr.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strspn.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strstr.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strtok.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _memchr.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _memcmp.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _memcpy.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _memset.rel + +# Create a header file that contains addressing information needed by the +# assemlby language start-up code. Locate the IDLE thread stack at the +# end of RAM. The heap then extends from s__HEAP to the bottom of the +# IDLE thread stack asm_mem.h: - @echo " CONFIG_COMPILER_OTHER == 0" > asm_mem.h - @echo " CONFIG_COMPILER_SDCC == 1" >> asm_mem.h -ifeq ($(CC),sdcc) - @echo " CONFIG_COMPILER == 1" >> asm_mem.h -else - @echo " CONFIG_COMPILER == 0" >> asm_mem.h -endif @echo " CONFIG_STACK_END == ($(CONFIG_DRAM_SIZE) - 1)" >> asm_mem.h @echo " CONFIG_STACK_BASE == (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE))" >> asm_mem.h - @echo " CONFIG_HEAP1_END == (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE) - 1)" >> asm_mem.h - @echo " CONFIG_HEAP1_BASE == $(HEAP_BASE)" >> asm_mem.h # Combine all objects in this directory into a library -libarch$(LIBEXT): up_mem.h asm_mem.h $(OBJS) +libarch$(LIBEXT): asm_mem.h $(OBJS) $(call ARCHIVE, $@, $(OBJS)) # This builds the libboard library in the board/ subdirectory @@ -168,43 +138,6 @@ board/libboard$(LIBEXT): # This target builds the final executable -pass1.lnk: - @echo "LD: pass1.ihx" - @echo "--" >pass1.lnk # Non-interactive - @echo "-k $(BOARDDIR)" >>pass1.lnk # Path to board library - @echo "-k $(TOPDIR)/lib" >>pass1.lnk # Path to top-level lib-directory - @echo "-l libboard$(LIBEXT)" >>pass1.lnk # Name of board library - $(Q) for LIB in $(LINKLIBS); do \ - echo "-l $(TOPDIR)/lib/$$LIB" >> pass1.lnk ;\ - done - @echo "-l myz80.lib" >>pass1.lnk # Name of SDCC z80 library -ifneq ($(CONFIG_LINKER_START_AREA),) - @echo "-b START=$(CONFIG_LINKER_START_AREA)" >>pass1.lnk # Start of START area -endif -ifneq ($(CONFIG_LINKER_CODE_AREA),) - @echo "-b _CODE=$(CONFIG_LINKER_CODE_AREA)" >>pass1.lnk # Start of _CODE area -else - @echo "-b _CODE=256" >>pass1.lnk # Start of _CODE area -endif -ifneq ($(CONFIG_LINKER_DATA_AREA),) - @echo "-b _CODE=$(CONFIG_LINKER_DATA_AREA)" >>pass1.lnk -endif - @echo "-i" >>pass1.lnk # Intel hex format - @echo "-x" >>pass1.lnk # Hexadecimal - @echo "-m" >>pass1.lnk # Generate a map file - @echo "-j" >>pass1.lnk # Generate a symbol file - @echo "pass1.ihx" >>pass1.lnk # Path to head object - @echo "$(HEAD_OBJ)" >>pass1.lnk # Path to head object - @echo "-e" >>pass1.lnk # End of script - -pass1.ihx: up_mem.h asm_mem.h $(TOPDIR)/lib/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) pass1.lnk - @echo "LD: pass1.ihx" - $(Q) $(LD) -f pass1.lnk - $(Q) rm -f up_mem.h asm_mem.h - $(Q) rm -f up_allocateheap$(OBJEXT) $(HEAD_OBJ) libarch$(LIBEXT) - $(Q) $(MAKE) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) - $(Q) $(MAKE) TOPDIR="$(TOPDIR)" $(HEAD_OBJ) - nuttx.lnk: @echo "--" >nuttx.lnk # Non-interactive @echo "-k $(BOARDDIR)" >>nuttx.lnk # Path to board library @@ -213,7 +146,18 @@ nuttx.lnk: $(Q) for LIB in $(LINKLIBS); do \ echo "-l $(TOPDIR)/lib/$$LIB" >> nuttx.lnk ;\ done - @echo "-l myz80.lib" >>nuttx.lnk # Name of SDCC z80 library + @echo "-l $(SDCCLIB)" >>nuttx.lnk # Name of SDCC z80 library +ifneq ($(CONFIG_LINKER_CODE_AREA),) + @echo "-b _CODE=$(CONFIG_LINKER_CODE_AREA)" >>nuttx.lnk # Start of _CODE area +else + @echo "-b _CODE=0x0200" >>nuttx.lnk # Start of _CODE area +endif +ifneq ($(CONFIG_LINKER_DATA_AREA),) + @echo "-b _CODE=$(CONFIG_LINKER_DATA_AREA)" >>nuttx.lnk +else + @echo "-b _DATA=0x8000" >>nuttx.lnk # Start of _DATA area +endif + ifneq ($(CONFIG_LINKER_START_AREA),) @echo "-b START=$(CONFIG_LINKER_START_AREA)" >>nuttx.lnk # Start of START area endif @@ -233,10 +177,9 @@ endif @echo "$(HEAD_OBJ)" >>nuttx.lnk # Path to head object @echo "-e" >>nuttx.lnk # End of script -nuttx$(EXEEXT): pass1.ihx up_mem.h asm_mem.h $(TOPDIR)/lib/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) nuttx.lnk +nuttx$(EXEEXT): asm_mem.h $(TOPDIR)/lib/$(SDCCLIB) $(HEAD_OBJ) board/libboard$(LIBEXT) nuttx.lnk @echo "LD: nuttx.ihx" $(Q) $(LD) -f nuttx.lnk - $(Q) rm -f pass1.* $(Q) cp -f nuttx.map $(TOPDIR)/. ifeq ($(EXEEXT),.cmd) sed s/:00000001FF/:00520001AD/ nuttx.ihx | \ @@ -257,7 +200,7 @@ export_head: board/libboard$(LIBEXT) $(HEAD_OBJ) # Build dependencies -.depend: Makefile up_mem.h asm_mem.h chip/Make.defs $(DEPSRCS) +.depend: Makefile asm_mem.h chip/Make.defs $(DEPSRCS) $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \ fi @@ -270,9 +213,7 @@ clean: $(Q) if [ -e board/Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ fi - $(call DELFILE, up_mem.h) $(call DELFILE, asm_mem.h) - $(call DELFILE, pass1.*) $(call DELFILE, nuttx.*) $(call DELFILE, libarch$(LIBEXT)) $(call CLEAN) diff --git a/nuttx/arch/z80/src/Makefile.sdccw b/nuttx/arch/z80/src/Makefile.sdccw index 4433429bb..0cd7b4757 100644 --- a/nuttx/arch/z80/src/Makefile.sdccw +++ b/nuttx/arch/z80/src/Makefile.sdccw @@ -33,16 +33,13 @@ # ############################################################################ -############################################################################ # Tools # CFLAGS, CPPFLAGS, ASFLAGS, LDFLAGS are set in $(TOPDIR)\Make.defs CFLAGS += -I$(ARCH_SRCDIR)\chip -I$(ARCH_SRCDIR)\common -I$(TOPDIR)\sched CPPFLAGS += -D__ASSEMBLY__ -############################################################################ # Files and directories - # There should be one head source (.asm file) HEAD_OBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT)) @@ -77,16 +74,11 @@ VPATH = chip:common:board LIBGCC = ${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name} -# Supports dynamic sizing of HEAP. -# -HEAP_BASE = ${shell .\mkhpbase.bat} - -############################################################################ # Targets all: $(HEAD_OBJ) libarch$(LIBEXT) -.PHONY: board\libboard$(LIBEXT) pass1.lnk nuttx.lnk +.PHONY: board\libboard$(LIBEXT) nuttx.lnk $(AOBJS) $(HEAD_OBJ): %$(OBJEXT): %$(ASMEXT) $(call ASSEMBLE, $<, $@) @@ -96,69 +88,46 @@ $(COBJS): %$(OBJEXT): %.c # This is a kludge to work around some conflicting symbols in the SDCC libraries -$(TOPDIR)\lib\myz80.lib: $(SDCC_LIBDIR)\$(SDCCLIB) -ifeq ($(CONFIG_SDCC_OLD),y) - $(Q) cat $(SDCC_LIBDIR)\$(SDCCLIB) | \ - grep -v alloc | grep -v free | grep -v printf | \ - grep -v _str | grep -v _mem | grep -v crt0\.o \ - > $(TOPDIR)\lib\myz80.lib -else - $(Q) cp $(SDCC_LIBDIR)\z80.lib $(TOPDIR)\lib\myz80.lib - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _calloc.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _malloc.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _realloc.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _free.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib printf_large.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib sprintf.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib vprintf.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib strcpy.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib strlen.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strcat.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strchr.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strcmp.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strcspn.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strncat.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strncmp.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strncpy.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strpbrk.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strrchr.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strspn.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strstr.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _strtok.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _memchr.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _memcmp.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _memcpy.rel - $(Q) sdar d $(TOPDIR)\lib\myz80.lib _memset.rel -endif - -# Create a header file that contains addressing information needed by the code - -up_mem.h: - @echo #ifndef __UP_MEM_H>up_mem.h - @echo #define __UP_MEM_H>>up_mem.h - @echo #include ^>>up_mem.h - @echo #define CONFIG_STACK_END $(CONFIG_DRAM_SIZE)>> up_mem.h - @echo #define CONFIG_STACK_BASE (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE))>> up_mem.h - @echo #define CONFIG_HEAP1_END CONFIG_STACK_BASE>> up_mem.h - @echo #define CONFIG_HEAP1_BASE $(HEAP_BASE)>> up_mem.h - @echo #endif /* __UP_MEM_H */>>up_mem.h +$(TOPDIR)\lib\$(SDCCLIB): $(SDCC_LIBDIR)\$(SDCCLIB) + $(Q) cp $(SDCC_LIBDIR)\$(SDCCLIB) $(TOPDIR)\lib\$(SDCCLIB) + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _calloc.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _malloc.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _realloc.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _free.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) printf_large.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) sprintf.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) vprintf.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) strcpy.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) strlen.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _strcat.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _strchr.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _strcmp.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _strcspn.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _strncat.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _strncmp.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _strncpy.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _strpbrk.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _strrchr.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _strspn.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _strstr.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _strtok.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _memchr.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _memcmp.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _memcpy.rel + $(Q) sdar d $(TOPDIR)\lib\$(SDCCLIB) _memset.rel + +# Create a header file that contains addressing information needed by the +# assemlby language start-up code. Locate the IDLE thread stack at the +# end of RAM. The heap then extends from s__HEAP to the bottom of the +# IDLE thread stack asm_mem.h: - @echo CONFIG_COMPILER_OTHER == ^0>asm_mem.h - @echo CONFIG_COMPILER_SDCC == ^1>>asm_mem.h -ifeq ($(CC),sdcc) - @echo CONFIG_COMPILER == ^1>>asm_mem.h -else - @echo CONFIG_COMPILER == ^0>>asm_mem.h -endif @echo CONFIG_STACK_END == ($(CONFIG_DRAM_SIZE) - 1)>>asm_mem.h @echo CONFIG_STACK_BASE == (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE))>>asm_mem.h - @echo CONFIG_HEAP1_END == (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE) - 1)>>asm_mem.h - @echo CONFIG_HEAP1_BASE == $(HEAP_BASE)>>asm_mem.h # Combine all objects in this directory into a library -libarch$(LIBEXT): up_mem.h asm_mem.h $(OBJS) +libarch$(LIBEXT): asm_mem.h $(OBJS) $(call ARCHIVE, $@, $(OBJS)) # This builds the libboard library in the board\ subdirectory @@ -168,43 +137,6 @@ board\libboard$(LIBEXT): # This target builds the final executable -pass1.lnk: - @echo LD: pass1.lnk - @echo -->pass1.lnk - @echo -k $(BOARDDIR)>>pass1.lnk - @echo -k $(TOPDIR)\lib>>pass1.lnk - @echo -l libboard$(LIBEXT)>>pass1.lnk - $(Q) for %%G in ($(LINKLIBS)) do ( echo -l $(TOPDIR)\lib\%%G>> pass1.lnk ) - @echo -l myz80.lib>>pass1.lnk -ifneq ($(CONFIG_LINKER_START_AREA),) - @echo -b START=$(CONFIG_LINKER_START_AREA)>>pass1.lnk -else - @echo -b START=0>>pass1.lnk -endif -ifneq ($(CONFIG_LINKER_CODE_AREA),) - @echo -b _CODE=$(CONFIG_LINKER_CODE_AREA)>>pass1.lnk -else - @echo -b _CODE=256>>pass1.lnk -endif -ifneq ($(CONFIG_LINKER_DATA_AREA),) - @echo -b _CODE=$(CONFIG_LINKER_DATA_AREA)>>pass1.lnk -endif - @echo -i>>pass1.lnk - @echo -x>>pass1.lnk - @echo -m>>pass1.lnk - @echo -j>>pass1.lnk - @echo pass1.ihx>>pass1.lnk - @echo $(HEAD_OBJ)>>pass1.lnk - @echo -e>>pass1.lnk - -pass1.ihx: up_mem.h asm_mem.h $(TOPDIR)\lib\myz80.lib $(HEAD_OBJ) board\libboard$(LIBEXT) pass1.lnk - @echo LD: pass1.ihx - $(Q) $(LD) -f pass1.lnk - $(Q) rm -f up_mem.h asm_mem.h - $(Q) rm -f up_allocateheap$(OBJEXT) $(HEAD_OBJ) libarch$(LIBEXT) - $(Q) $(MAKE) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) - $(Q) $(MAKE) TOPDIR="$(TOPDIR)" $(HEAD_OBJ) - nuttx.lnk: @echo LD: nuttx.lnk @echo -->nuttx.lnk @@ -212,7 +144,7 @@ nuttx.lnk: @echo -k $(TOPDIR)\lib>>nuttx.lnk @echo -l libboard$(LIBEXT)>>nuttx.lnk $(Q) for %%G in ($(LINKLIBS)) do ( echo -l $(TOPDIR)\lib\%%G>> nuttx.lnk ) - @echo -l myz80.lib>>nuttx.lnk + @echo -l $(SDCCLIB)>>nuttx.lnk ifneq ($(CONFIG_LINKER_START_AREA),) @echo -b START=$(CONFIG_LINKER_START_AREA)>>nuttx.lnk else @@ -234,10 +166,9 @@ endif @echo $(HEAD_OBJ)>>nuttx.lnk @echo -e>>nuttx.lnk -nuttx$(EXEEXT): pass1.ihx up_mem.h asm_mem.h $(TOPDIR)\lib\myz80.lib $(HEAD_OBJ) board\libboard$(LIBEXT) nuttx.lnk +nuttx$(EXEEXT): asm_mem.h $(TOPDIR)\lib\$(SDCCLIB) $(HEAD_OBJ) board\libboard$(LIBEXT) nuttx.lnk @echo LD: nuttx.ihx $(Q) $(LD) -f nuttx.lnk - $(call DELFILE, pass1.*) $(Q) cp -f nuttx.map $(TOPDIR)\. ifeq ($(EXEEXT),.cmd) sed s/:00000001FF/:00520001AD/ nuttx.ihx | \ @@ -254,7 +185,7 @@ export_head: board\libboard$(LIBEXT) $(HEAD_OBJ) # Build dependencies -.depend: Makefile up_mem.h asm_mem.h chip\Make.defs $(DEPSRCS) +.depend: Makefile asm_mem.h chip\Make.defs $(DEPSRCS) $(Q) if exist board\Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" depend ) $(Q) $(MKDEP) --dep-path chip --dep-path common "$(CC)" -- $(CFLAGS) -- $(DEPSRCS) >Make.dep $(Q) touch $@ @@ -263,14 +194,11 @@ depend: .depend clean: $(Q) if exist board\Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ) - $(call DELFILE, up_mem.h) $(call DELFILE, asm_mem.h) - $(call DELFILE, pass1.*) $(call DELFILE, nuttx.*) $(call DELFILE, libarch$(LIBEXT)) $(call CLEAN) - distclean: clean $(Q) if exist board\Makefile ( $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ) $(call DELFILE, Make.dep) diff --git a/nuttx/arch/z80/src/common/up_arch.h b/nuttx/arch/z80/src/common/up_arch.h index 99087bb08..43c750e4e 100644 --- a/nuttx/arch/z80/src/common/up_arch.h +++ b/nuttx/arch/z80/src/common/up_arch.h @@ -33,8 +33,8 @@ * ************************************************************************************/ -#ifndef __UP_ARCH_H -#define __UP_ARCH_H +#ifndef __ARCH_Z80_SRC_COMMON_UP_ARCH_H +#define __ARCH_Z80_SRC_COMMON_UP_ARCH_H /************************************************************************************ * Included Files @@ -49,4 +49,4 @@ * Definitions ************************************************************************************/ -#endif /* __UP_ARCH_H */ +#endif /* __ARCH_Z80_SRC_COMMON_UP_ARCH_H */ diff --git a/nuttx/arch/z80/src/common/up_internal.h b/nuttx/arch/z80/src/common/up_internal.h index 960061a80..1989f99d0 100644 --- a/nuttx/arch/z80/src/common/up_internal.h +++ b/nuttx/arch/z80/src/common/up_internal.h @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __UP_INTERNAL_H -#define __UP_INTERNAL_H +#ifndef __ARCH_Z80_SRC_COMMON_UP_INTERNAL_H +#define __ARCH_Z80_SRC_COMMON_UP_INTERNAL_H /**************************************************************************** * Conditional Compilation @@ -209,4 +209,4 @@ EXTERN void up_stackdump(void); #endif #endif -#endif /* __UP_INTERNAL_H */ +#endif /* __ARCH_Z80_SRC_COMMON_UP_INTERNAL_H */ diff --git a/nuttx/arch/z80/src/mkhpbase.bat b/nuttx/arch/z80/src/mkhpbase.bat deleted file mode 100755 index 8792f73a4..000000000 --- a/nuttx/arch/z80/src/mkhpbase.bat +++ /dev/null @@ -1,45 +0,0 @@ -@echo off - -rem arch/z80/src/mkhpbase.bat -rem -rem Copyright (C) 2012 Gregory Nutt. All rights reserved. -rem Author: Gregory Nutt -rem -rem Redistribution and use in source and binary forms, with or without -rem modification, are permitted provided that the following conditions -rem are met: -rem -rem 1. Redistributions of source code must retain the above copyright -rem notice, this list of conditions and the following disclaimer. -rem 2. Redistributions in binary form must reproduce the above copyright -rem notice, this list of conditions and the following disclaimer in -rem the documentation and/or other materials provided with the -rem distribution. -rem 3. Neither the name NuttX nor the names of its contributors may be -rem used to endorse or promote products derived from this software -rem without specific prior written permission. -rem -rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -rem POSSIBILITY OF SUCH DAMAGE. -rem - -rem -rem This script supports dynamic sizing of HEAP when building with the SDCC -rem toolchain. This script adds up the size of each section of the program. -rem This does not account for the alignment of the _CODE area to 0x0100 (hence -rem the fudge factor 196 is added). -rem -rem -- There must be a better way! --- -rem - -echo (CONFIG_HEAP1_END - 8192) diff --git a/nuttx/arch/z80/src/mkhpbase.sh b/nuttx/arch/z80/src/mkhpbase.sh deleted file mode 100755 index 1d7acb7d5..000000000 --- a/nuttx/arch/z80/src/mkhpbase.sh +++ /dev/null @@ -1,109 +0,0 @@ -#/bin/sh -############################################################################ -# arch/z80/src/mkhpbase.sh -# -# 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 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. -# -############################################################################ -# -# This script supports dynamic sizing of HEAP when building with the SDCC -# toolchain. This script adds up the size of each section of the program. -# This does not account for the alignment of the _CODE area to 0x0100 (hence -# the fudge factor 196 is added). -# -# -- There must be a better way! --- -# -#set -x - -MAPFILE=pass1.map - -# Verify that pass1.map exists - -if [ -e ${MAPFILE} ]; then - - # The map file exists, get a list of the sizes of each section - # This works for SDCC 2.7.0 - - list=`cat ${MAPFILE} | grep "bytes" | sed -e 's/[ \t][ \t]*/ /g' | cut -d' ' -f3` - - # If this is SDCC version 2.6.0, then the list will be empty - - if [ -z "${list}" ]; then - - # This works for SDCC 2.6.0 - - list=`cat ${MAPFILE} | grep "SIZE" | sed -e 's/[ \t][ \t]*/ /g' | cut -d' ' -f3` - fi - - # Did we successfully create the list of section sizes? - - if [ ! -z "${list}" ]; then - unset result - first=yes - - # Examine each size in the list - - for size in ${list}; do - - # Skip over zero-length sizes - - if [ "${size}" != "0000" ]; then - - # Each hex size must be prefixed with "0x". The - # First size must also include a left parenthesis - - if [ -z "$first" ]; then - result="${result} + 0x${size}" - else - result="(0x${size}" - unset first - fi - fi - done - - # Add a fudge factor to guarantee no overlap between the code and - # the heap and close the expression with a left parenthesis - - echo "${result} + 196)" - else - - # We could not parse the map file. Try to generate some meaningful error - - echo "#\"Makefile: Could not parse map file\"" - exit 1 - fi -else - # pass1.map does not yet exist. In this case, just output a valid, default heap size - - echo "(CONFIG_HEAP1_END - 8192)" -fi - - diff --git a/nuttx/arch/z80/src/z80/up_mem.h b/nuttx/arch/z80/src/z80/up_mem.h new file mode 100644 index 000000000..9273d3f89 --- /dev/null +++ b/nuttx/arch/z80/src/z80/up_mem.h @@ -0,0 +1,75 @@ +/************************************************************************************ + * common/sdcc.h + * + * Copyright (C) 2012 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 nuttx.lnk__ARCH_Z80_SRC_COMMON_UP_MEM_H +#define nuttx.lnk__ARCH_Z80_SRC_COMMON_UP_MEM_H + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include + +/************************************************************************************ + * Pre-processor Definitions + ************************************************************************************/ + +/* Locate the IDLE thread stack at the end of RAM. */ + +#define CONFIG_STACK_END CONFIG_DRAM_SIZE +#define CONFIG_STACK_BASE (CONFIG_STACK_END - CONFIG_IDLETHREAD_STACKSIZE) + +/* The heap then extends from the linker determined beginning of the heap (s__HEAP). + * to the bottom of the IDLE thread stack. NOTE: The symbol s__HEAP is not + * accessible from C because it does not begin with the _ character. g_heapbase + * is defined in z80_head.asm to provide that value to the C code. + */ + +#define CONFIG_HEAP1_END CONFIG_STACK_BASE +#define CONFIG_HEAP1_BASE g_heapbase + +/************************************************************************************ + * Public variables + ************************************************************************************/ + +/* This is the bottom of the heap as provided by the linker symbol s__HEAP. NOTE: + * The symbol s__HEAP is not accessible from C because it does not begin with the _ + * character. g_heapbase is defined in z80_head.asm to provide that value to the C + * code. + */ + +extern const uint16_t g_heapbase; + +#endif /* nuttx.lnk__ARCH_Z80_SRC_COMMON_UP_MEM_H */ diff --git a/nuttx/arch/z80/src/z80/z80_head.asm b/nuttx/arch/z80/src/z80/z80_head.asm index 828a29d77..1bdc6061f 100644 --- a/nuttx/arch/z80/src/z80/z80_head.asm +++ b/nuttx/arch/z80/src/z80/z80_head.asm @@ -265,10 +265,13 @@ nointenable:: .area _HOME .area _CODE + .area _INITIALIZER .area _GSINIT .area _GSFINAL .area _DATA + .area _INITIALIZED + .area _BSEG .area _BSS .area _HEAP @@ -278,6 +281,24 @@ nointenable:: .area _GSINIT gsinit:: + ld bc, #l__INITIALIZER + ld a, b + or a, c + jr Z, gsinit_next + ld de, #s__INITIALIZED + ld hl, #s__INITIALIZER + ldir +gsinit_next: + .area _GSFINAL ret +;************************************************************************** +; The start of the heap (SDCC only). Note that is actually resides in +; the _CODE area (which may be FLASH or ROM) +;************************************************************************** + + .area _CODE +_g_heapbase:: + .dw #s__HEAP + diff --git a/nuttx/arch/z80/src/z80/z80_io.c b/nuttx/arch/z80/src/z80/z80_io.c index bdd55bc6b..1db636d30 100644 --- a/nuttx/arch/z80/src/z80/z80_io.c +++ b/nuttx/arch/z80/src/z80/z80_io.c @@ -47,20 +47,6 @@ * 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 ****************************************************************************/ @@ -83,11 +69,11 @@ void outp(char p, char c) { - ASM + __asm ld c, 4(ix) ; port ld a, 5(ix) ; value out (c), a - ENDASM; + __endasm; } @@ -99,10 +85,10 @@ void outp(char p, char c) * ****************************************************************************/ -char inp(char p) NAKED +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 87ea7063a..be5fba4a9 100644 --- a/nuttx/arch/z80/src/z80/z80_irq.c +++ b/nuttx/arch/z80/src/z80/z80_irq.c @@ -48,14 +48,6 @@ * Private Definitions ****************************************************************************/ -#ifdef CONFIG_SDCC_OLD -# define ASM _asm -# define ENDASM _endasm -#else -# define ASM __asm -# define ENDASM __endasm -#endif - /**************************************************************************** * Public Data ****************************************************************************/ @@ -88,13 +80,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; } /**************************************************************************** @@ -107,7 +99,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 @@ -117,5 +109,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 154437f1b..02409de73 100644 --- a/nuttx/configs/xtrs/README.txt +++ b/nuttx/configs/xtrs/README.txt @@ -97,6 +97,8 @@ selected with: CONFIG_Z80_TOOLCHAIN_SDCCL=y : SDCC for Linux, MAC OSX or Cygwin (see below) CONFIG_Z80_TOOLCHAIN_SDCCW=y : SDCC for Win32 +SDCC versions 3.2.0 or higher are recommended. + Building the SDCC toolchain ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -128,62 +130,3 @@ and install SDCC: sudo make install -SDCC Update -^^^^^^^^^^^ - -I have had some problems building sdcc-2.6.0 on my current UBUNTU -release (9.10). I had other problems building sdcc-2.9.0 on UBUNTU 9.10. -I suspect that the newer gcc toolchains are causing problems for these -older SDCC releases. - -A 20091106 snapshot did build with no major problems on UBUNTU 9.10, but -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) $(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 -(1) downgrade your GCC compiler to a version 3.x compiler and use one of -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 -^^^^^^^^^^^^^^^^^^^ - -This is the text of bug 3468951 reported on the SourceForge website: - -"Some obsolete stuff in z80sim port," (submitted by Philipp Klaus Krause): - - The simz80 port needs a few updates to work well with current sdcc versions, - and has some unecessary stuff: - - * The linker name for Make.defs should be sdldz80 - * The assembler name for Make.defs should be sdasz80 - * _asm and _endasm in z80_io.c and z80_irq.c should be replaced by __asm - and __endasm - * The --stack-auto --int-long-reent --float-reent options or Make.defs should - be removed, as they have no effect on sdcc's z80 port - * The current assembler AFAIK can handle long symbol names, so the - sdcc-2.6.0-asz80-symlen.patch is unnecessary, and it and the corresponding - section from the README can be removed. - -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/nsh/Make.defs b/nuttx/configs/xtrs/nsh/Make.defs index db67b931c..d56a65dbe 100644 --- a/nuttx/configs/xtrs/nsh/Make.defs +++ b/nuttx/configs/xtrs/nsh/Make.defs @@ -58,18 +58,10 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp - -ifeq ($(CONFIG_SDCC_OLD),y) - LD = link-z80 - AS = as-z80 - AR = sdcclib -a - ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent -else - LD = sdldz80 - AS = sdasz80 - AR = sdar -r - ARCHCPUFLAGS = -mz80 -endif +LD = sdldz80 +AS = sdasz80 +AR = sdar -r +ARCHCPUFLAGS = -mz80 ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION = --debug @@ -84,7 +76,7 @@ ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -AFLAGS = -x -a -l -o -s +AFLAGS = -x -a -l -o -s -g SDCCLIB = z80.lib diff --git a/nuttx/configs/xtrs/ostest/Make.defs b/nuttx/configs/xtrs/ostest/Make.defs index 355501737..777491f62 100644 --- a/nuttx/configs/xtrs/ostest/Make.defs +++ b/nuttx/configs/xtrs/ostest/Make.defs @@ -58,18 +58,10 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp - -ifeq ($(CONFIG_SDCC_OLD),y) - LD = link-z80 - AS = as-z80 - AR = sdcclib -a - ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent -else - LD = sdldz80 - AS = sdasz80 - AR = sdar -r - ARCHCPUFLAGS = -mz80 -endif +LD = sdldz80 +AS = sdasz80 +AR = sdar -r +ARCHCPUFLAGS = -mz80 ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION = --debug @@ -84,7 +76,7 @@ ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -AFLAGS = -x -a -l -o -s +AFLAGS = -x -a -l -o -s -g SDCCLIB = z80.lib diff --git a/nuttx/configs/xtrs/pashello/Make.defs b/nuttx/configs/xtrs/pashello/Make.defs index 641b9426d..3e57e7861 100644 --- a/nuttx/configs/xtrs/pashello/Make.defs +++ b/nuttx/configs/xtrs/pashello/Make.defs @@ -58,18 +58,10 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp - -ifeq ($(CONFIG_SDCC_OLD),y) - LD = link-z80 - AS = as-z80 - AR = sdcclib -a - ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent -else - LD = sdldz80 - AS = sdasz80 - AR = sdar -r - ARCHCPUFLAGS = -mz80 -endif +LD = sdldz80 +AS = sdasz80 +AR = sdar -r +ARCHCPUFLAGS = -mz80 ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION = --debug @@ -84,7 +76,7 @@ ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -AFLAGS = -x -a -l -o -s +AFLAGS = -x -a -l -o -s -g SDCCLIB = z80.lib diff --git a/nuttx/configs/xtrs/sdcc-2.6.0-asz80-symlen.patch b/nuttx/configs/xtrs/sdcc-2.6.0-asz80-symlen.patch deleted file mode 100644 index d91c18d98..000000000 --- a/nuttx/configs/xtrs/sdcc-2.6.0-asz80-symlen.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- sdcc/as/z80/asm.h 2007-12-30 16:49:53.000000000 -0600 -+++ sdcc.orig/as/z80/asm.h 2007-12-30 16:49:14.000000000 -0600 -@@ -65,7 +65,7 @@ - #define RTTERM ')' /* Right expression delimeter */ - - #ifdef SDK --#define NCPS 80 /* characters per symbol */ -+#define NCPS 32 /* characters per symbol */ - #else /* SDK */ - #define NCPS 8 /* Chars. per symbol */ - #endif /* SDK */ diff --git a/nuttx/configs/z80sim/README.txt b/nuttx/configs/z80sim/README.txt index c85e236ef..37db83533 100644 --- a/nuttx/configs/z80sim/README.txt +++ b/nuttx/configs/z80sim/README.txt @@ -42,10 +42,7 @@ Configuring NuttX reconfiguration process. 2. The default setup for this configuration uses a windows native build. - As of this writing, the native Windows build still does not work. This - is due to issues in arch/z80/src/Makefile and in the Bash script - arch/z80/src/mkhpbase.sh which, of course, cannot be used in a Windows - CMD.exe shell. These configuration is broken for the time being. + As of this writing, the native Windows build still does not work. This configuration was last verified sucessfully prior to the the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run @@ -104,6 +101,8 @@ selected with: CONFIG_Z80_TOOLCHAIN_SDCCL=y : SDCC for Linux, MAC OSX or Cygwin (see below) CONFIG_Z80_TOOLCHAIN_SDCCW=y : SDCC for Win32 +SDCC versions 3.2.0 or higher are recommended. + Building the SDCC toolchain ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -120,12 +119,6 @@ compatible with this build. First start with the usual steps cd sdcc ./configure -But before making, we need to apply a patch to the SDCC 2.6.0 source -so that the z80 assembler can handle long symbol names - - Apply sdcc-2.6.0-asz80-symlen.patch - cd sdcc/device/lib - Then make the SDCC binaries cd sdcc @@ -135,62 +128,3 @@ and install SDCC: sudo make install -SDCC Update -^^^^^^^^^^^ - -I have had some problems building sdcc-2.6.0 on my current UBUNTU -release (9.10). I had other problems building sdcc-2.9.0 on UBUNTU 9.10. -I suspect that the newer gcc toolchains are causing problems for these -older SDCC releases. - -A 20091106 snapshot did build with no major problems on UBUNTU 9.10, but -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) $(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 -(1) downgrade your GCC compiler to a version 3.x compiler and use one of -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 -^^^^^^^^^^^^^^^^^^^ - -This is the text of bug 3468951 reported on the SourceForge website: - -"Some obsolete stuff in z80sim port," (submitted by Philipp Klaus Krause): - - The simz80 port needs a few updates to work well with current sdcc versions, - and has some unecessary stuff: - - * The linker name for Make.defs should be sdldz80 - * The assembler name for Make.defs should be sdasz80 - * _asm and _endasm in z80_io.c and z80_irq.c should be replaced by __asm - and __endasm - * The --stack-auto --int-long-reent --float-reent options or Make.defs should - be removed, as they have no effect on sdcc's z80 port - * The current assembler AFAIK can handle long symbol names, so the - sdcc-2.6.0-asz80-symlen.patch is unnecessary, and it and the corresponding - section from the README can be removed. - -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/nsh/Make.defs b/nuttx/configs/z80sim/nsh/Make.defs index 1edd5fdcf..4aa82ae71 100644 --- a/nuttx/configs/z80sim/nsh/Make.defs +++ b/nuttx/configs/z80sim/nsh/Make.defs @@ -58,18 +58,10 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp - -ifeq ($(CONFIG_SDCC_OLD),y) - LD = link-z80 - AS = as-z80 - AR = sdcclib -a - ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent -else - LD = sdldz80 - AS = sdasz80 - AR = sdar -r - ARCHCPUFLAGS = -mz80 -endif +LD = sdldz80 +AS = sdasz80 +AR = sdar -r +ARCHCPUFLAGS = -mz80 ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION = --debug @@ -84,7 +76,7 @@ ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -AFLAGS = -x -a -l -o -s +AFLAGS = -x -a -l -o -s -g SDCCLIB = z80.lib diff --git a/nuttx/configs/z80sim/ostest/Make.defs b/nuttx/configs/z80sim/ostest/Make.defs index 91d30a061..be0fc2470 100644 --- a/nuttx/configs/z80sim/ostest/Make.defs +++ b/nuttx/configs/z80sim/ostest/Make.defs @@ -58,18 +58,10 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp - -ifeq ($(CONFIG_SDCC_OLD),y) - LD = link-z80 - AS = as-z80 - AR = sdcclib -a - ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent -else - LD = sdldz80 - AS = sdasz80 - AR = sdar -r - ARCHCPUFLAGS = -mz80 -endif +LD = sdldz80 +AS = sdasz80 +AR = sdar -r +ARCHCPUFLAGS = -mz80 ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION = --debug @@ -84,7 +76,7 @@ ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -AFLAGS = -x -a -l -o -s +AFLAGS = -x -a -l -o -s -g SDCCLIB = z80.lib diff --git a/nuttx/configs/z80sim/pashello/Make.defs b/nuttx/configs/z80sim/pashello/Make.defs index 2dca56a0e..05ece7666 100644 --- a/nuttx/configs/z80sim/pashello/Make.defs +++ b/nuttx/configs/z80sim/pashello/Make.defs @@ -58,18 +58,10 @@ endif CROSSDEV = CC = sdcc CPP = sdcpp - -ifeq ($(CONFIG_SDCC_OLD),y) - LD = link-z80 - AS = as-z80 - AR = sdcclib -a - ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent -else - LD = sdldz80 - AS = sdasz80 - AR = sdar -r - ARCHCPUFLAGS = -mz80 -endif +LD = sdldz80 +AS = sdasz80 +AR = sdar -r +ARCHCPUFLAGS = -mz80 ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION = --debug @@ -84,7 +76,7 @@ ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -AFLAGS = -x -a -l -o -s +AFLAGS = -x -a -l -o -s -g SDCCLIB = z80.lib diff --git a/nuttx/configs/z80sim/sdcc-2.6.0-asz80-symlen.patch b/nuttx/configs/z80sim/sdcc-2.6.0-asz80-symlen.patch deleted file mode 100644 index d91c18d98..000000000 --- a/nuttx/configs/z80sim/sdcc-2.6.0-asz80-symlen.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- sdcc/as/z80/asm.h 2007-12-30 16:49:53.000000000 -0600 -+++ sdcc.orig/as/z80/asm.h 2007-12-30 16:49:14.000000000 -0600 -@@ -65,7 +65,7 @@ - #define RTTERM ')' /* Right expression delimeter */ - - #ifdef SDK --#define NCPS 80 /* characters per symbol */ -+#define NCPS 32 /* characters per symbol */ - #else /* SDK */ - #define NCPS 8 /* Chars. per symbol */ - #endif /* SDK */ diff --git a/nuttx/configs/z80sim/src/z80_lowputc.c b/nuttx/configs/z80sim/src/z80_lowputc.c index 9b46b4880..9bfe266c1 100644 --- a/nuttx/configs/z80sim/src/z80_lowputc.c +++ b/nuttx/configs/z80sim/src/z80_lowputc.c @@ -76,15 +76,6 @@ void z80_lowputc(char ch) __naked { -#ifdef CONFIG_SDCC_OLD - _asm - ld hl, #2 - add hl, sp - ld a, (hl) - out (0xbe), a - ret - _endasm; -#else __asm__ ( "\tld hl, #2\n" "\tadd hl, sp\n" @@ -92,7 +83,6 @@ void z80_lowputc(char ch) __naked "\tout (0xbe), a\n" "\tret\n" ); -#endif } /******************************************************************************** @@ -104,19 +94,10 @@ void z80_lowputc(char ch) __naked char z80_lowgetc(void) __naked { -#ifdef CONFIG_SDCC_OLD - _asm - in a, (0xbe) - ld l, a - ld h, #0 - ret - _endasm; -#else __asm__ ( "\tin a, (0xbe)\n" "\tld l, a\n" "\tld h, #0\n" "\tret\n" ); -#endif } -- cgit v1.2.3 From 10bda33ba37efe6797d8e91b27ca5312be9d92d6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 7 Dec 2012 20:45:07 +0000 Subject: Verify redesigned Z80 build on native Windows git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5417 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z80/src/Makefile.sdccl | 20 +--- nuttx/arch/z80/src/Makefile.sdccw | 9 +- nuttx/arch/z80/src/z80/z80_head.asm | 180 +++++++++++++++--------------- nuttx/arch/z80/src/z80/z80_rom.asm | 217 ++++++++++++++++++++---------------- 4 files changed, 216 insertions(+), 210 deletions(-) (limited to 'nuttx') diff --git a/nuttx/arch/z80/src/Makefile.sdccl b/nuttx/arch/z80/src/Makefile.sdccl index d4cf28a45..3ccf2e33e 100644 --- a/nuttx/arch/z80/src/Makefile.sdccl +++ b/nuttx/arch/z80/src/Makefile.sdccl @@ -40,7 +40,6 @@ CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(TOPDIR)/sched CPPFLAGS += -D__ASSEMBLY__ # Files and directories - # There should be one head source (.asm file) HEAD_OBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT)) @@ -87,7 +86,7 @@ $(AOBJS) $(HEAD_OBJ): %$(OBJEXT): %$(ASMEXT) $(COBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) -# This is a kludge to work around some conflicting symbols in libsdcc.lib +# This is a kludge to work around some conflicting symbols in the SDCC libraries $(TOPDIR)/lib/$(SDCCLIB): $(SDCC_LIBDIR)/$(SDCCLIB) $(Q) cp $(SDCC_LIBDIR)/$(SDCCLIB) $(TOPDIR)/lib/$(SDCCLIB) @@ -123,8 +122,8 @@ $(TOPDIR)/lib/$(SDCCLIB): $(SDCC_LIBDIR)/$(SDCCLIB) # IDLE thread stack asm_mem.h: - @echo " CONFIG_STACK_END == ($(CONFIG_DRAM_SIZE) - 1)" >> asm_mem.h - @echo " CONFIG_STACK_BASE == (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE))" >> asm_mem.h + @echo " CONFIG_STACK_END == ($(CONFIG_DRAM_SIZE) - 1)" >> asm_mem.h + @echo " CONFIG_STACK_BASE == (CONFIG_STACK_END - $(CONFIG_IDLETHREAD_STACKSIZE))" >> asm_mem.h # Combine all objects in this directory into a library @@ -139,6 +138,7 @@ board/libboard$(LIBEXT): # This target builds the final executable nuttx.lnk: + @echo "LD: nuttx.lnk" @echo "--" >nuttx.lnk # Non-interactive @echo "-k $(BOARDDIR)" >>nuttx.lnk # Path to board library @echo "-k $(TOPDIR)/lib" >>nuttx.lnk # Path to top-level lib directory @@ -157,18 +157,6 @@ ifneq ($(CONFIG_LINKER_DATA_AREA),) else @echo "-b _DATA=0x8000" >>nuttx.lnk # Start of _DATA area endif - -ifneq ($(CONFIG_LINKER_START_AREA),) - @echo "-b START=$(CONFIG_LINKER_START_AREA)" >>nuttx.lnk # Start of START area -endif -ifneq ($(CONFIG_LINKER_CODE_AREA),) - @echo "-b _CODE=$(CONFIG_LINKER_CODE_AREA)" >>nuttx.lnk # Start of _CODE area -else - @echo "-b _CODE=256" >>nuttx.lnk # Start of _CODE area -endif -ifneq ($(CONFIG_LINKER_DATA_AREA),) - @echo "-b _CODE=$(CONFIG_LINKER_DATA_AREA)" >>nuttx.lnk -endif @echo "-i" >>nuttx.lnk # Intel hex format @echo "-x" >>nuttx.lnk # Hexadecimal @echo "-m" >>nuttx.lnk # Generate a map file diff --git a/nuttx/arch/z80/src/Makefile.sdccw b/nuttx/arch/z80/src/Makefile.sdccw index 0cd7b4757..3c36439d9 100644 --- a/nuttx/arch/z80/src/Makefile.sdccw +++ b/nuttx/arch/z80/src/Makefile.sdccw @@ -145,18 +145,15 @@ nuttx.lnk: @echo -l libboard$(LIBEXT)>>nuttx.lnk $(Q) for %%G in ($(LINKLIBS)) do ( echo -l $(TOPDIR)\lib\%%G>> nuttx.lnk ) @echo -l $(SDCCLIB)>>nuttx.lnk -ifneq ($(CONFIG_LINKER_START_AREA),) - @echo -b START=$(CONFIG_LINKER_START_AREA)>>nuttx.lnk -else - @echo -b START=0>>nuttx.lnk -endif ifneq ($(CONFIG_LINKER_CODE_AREA),) @echo -b _CODE=$(CONFIG_LINKER_CODE_AREA)>>nuttx.lnk else - @echo -b _CODE=256>>nuttx.lnk + @echo -b _CODE=0x0200>>nuttx.lnk endif ifneq ($(CONFIG_LINKER_DATA_AREA),) @echo -b _CODE=$(CONFIG_LINKER_DATA_AREA)>>nuttx.lnk +else + @echo -b _DATA=0x8000>>nuttx.lnk endif @echo -i>>nuttx.lnk @echo -x>>nuttx.lnk diff --git a/nuttx/arch/z80/src/z80/z80_head.asm b/nuttx/arch/z80/src/z80/z80_head.asm index 1bdc6061f..7074461c2 100644 --- a/nuttx/arch/z80/src/z80/z80_head.asm +++ b/nuttx/arch/z80/src/z80/z80_head.asm @@ -1,7 +1,7 @@ ;************************************************************************** ; arch/z80/src/z80/z80_head.asm ; -; Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. +; Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. ; Author: Gregory Nutt ; ; Redistribution and use in source and binary forms, with or without @@ -92,70 +92,70 @@ ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #1 ; 1 = Z80_RST1 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #1 ; 1 = Z80_RST1 + jr _up_rstcommon ; Remaining RST handling is common .org 0x0010 ; RST 2 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #2 ; 2 = Z80_RST2 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #2 ; 2 = Z80_RST2 + jr _up_rstcommon ; Remaining RST handling is common .org 0x0018 ; RST 3 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #3 ; 1 = Z80_RST3 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #3 ; 1 = Z80_RST3 + jr _up_rstcommon ; Remaining RST handling is common .org 0x0020 ; RST 4 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #4 ; 1 = Z80_RST4 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #4 ; 1 = Z80_RST4 + jr _up_rstcommon ; Remaining RST handling is common .org 0x0028 ; RST 5 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #5 ; 1 = Z80_RST5 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #5 ; 1 = Z80_RST5 + jr _up_rstcommon ; Remaining RST handling is common .org 0x0030 ; RST 6 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #6 ; 1 = Z80_RST6 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #6 ; 1 = Z80_RST6 + jr _up_rstcommon ; Remaining RST handling is common .org 0x0038 ; Int mode 1 / RST 7 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #7 ; 7 = Z80_RST7 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #7 ; 7 = Z80_RST7 + jr _up_rstcommon ; Remaining RST handling is common ;************************************************************************** ; NMI interrupt handler ;************************************************************************** - .org 0x0066 + .org 0x0066 retn ;************************************************************************** @@ -166,7 +166,7 @@ _up_reset: ; Set up the stack pointer at the location determined the Makefile ; and stored in asm_mem.h - ld SP, #CONFIG_STACK_END ; Set stack pointer + ld SP, #CONFIG_STACK_END ; Set stack pointer ; Performed initialization unique to the SDCC toolchain @@ -179,8 +179,8 @@ _up_reset: ; NuttX will never return, but just in case... _up_halt:: - halt ; We should never get here - jp _up_halt + halt ; We should never get here + jp _up_halt ;************************************************************************** ; Common Interrupt handler @@ -195,98 +195,98 @@ _up_rstcommon:: ; ; IRQ number is in A - push hl ; Offset 6: HL - ld hl, #(3*2) ; HL is the value of the stack pointer before - add hl, sp ; the interrupt occurred - push hl ; Offset 5: Stack pointer - push iy ; Offset 4: IY - push ix ; Offset 3: IX - push de ; Offset 2: DE - push bc ; Offset 1: BC - - ld b, a ; Save the reset number in B - ld a, i ; Parity bit holds interrupt state - push af ; Offset 0: I with interrupt state in parity + push hl ; Offset 6: HL + ld hl, #(3*2) ; HL is the value of the stack pointer before + add hl, sp ; the interrupt occurred + push hl ; Offset 5: Stack pointer + push iy ; Offset 4: IY + push ix ; Offset 3: IX + push de ; Offset 2: DE + push bc ; Offset 1: BC + + ld b, a ; Save the reset number in B + ld a, i ; Parity bit holds interrupt state + push af ; Offset 0: I with interrupt state in parity di - ; Call the interrupt decode logic. SP points to the beggining of the reg structure + ; Call the interrupt decode logic. SP points to the beginning of the reg structure - ld hl, #0 ; Argument #2 is the beginning of the reg structure - add hl, sp ; - push hl ; Place argument #2 at the top of stack - push bc ; Argument #1 is the Reset number - inc sp ; (make byte sized) + ld hl, #0 ; Argument #2 is the beginning of the reg structure + add hl, sp ; + push hl ; Place argument #2 at the top of stack + push bc ; Argument #1 is the Reset number + inc sp ; (make byte sized) call _up_doirq ; Decode the IRQ ; On return, HL points to the beginning of the reg structure to restore ; Note that (1) the arguments pushed on the stack are not popped, and (2) the ; original stack pointer is lost. In the normal case (no context switch), - ; HL will contain the value of the SP before the arguments wer pushed. + ; HL will contain the value of the SP before the arguments were pushed. - ld sp, hl ; Use the new stack pointer + ld sp, hl ; Use the new stack pointer ; Restore registers. HL points to the beginning of the reg structure to restore - ex af, af' ; Select alternate AF - pop af ; Offset 0: AF' = I with interrupt state in carry - ex af, af' ; Restore original AF - pop bc ; Offset 1: BC - pop de ; Offset 2: DE - pop ix ; Offset 3: IX - pop iy ; Offset 4: IY - exx ; Use alternate BC/DE/HL - ld hl, #-2 ; Offset of SP to account for ret addr on stack - pop de ; Offset 5: HL' = Stack pointer after return - add hl, de ; HL = Stack pointer value before return - exx ; Restore original BC/DE/HL - pop hl ; Offset 6: HL - pop af ; Offset 7: AF + ex af, af' ; Select alternate AF + pop af ; Offset 0: AF' = I with interrupt state in carry + ex af, af' ; Restore original AF + pop bc ; Offset 1: BC + pop de ; Offset 2: DE + pop ix ; Offset 3: IX + pop iy ; Offset 4: IY + exx ; Use alternate BC/DE/HL + ld hl, #-2 ; Offset of SP to account for ret addr on stack + pop de ; Offset 5: HL' = Stack pointer after return + add hl, de ; HL = Stack pointer value before return + exx ; Restore original BC/DE/HL + pop hl ; Offset 6: HL + pop af ; Offset 7: AF ; Restore the stack pointer - exx ; Use alternate BC/DE/HL - ld sp, hl ; Set SP = saved stack pointer value before return - exx ; Restore original BC/DE/HL + exx ; Use alternate BC/DE/HL + ld sp, hl ; Set SP = saved stack pointer value before return + exx ; Restore original BC/DE/HL ; Restore interrupt state - ex af, af' ; Recover interrupt state - jp po, nointenable ; Odd parity, IFF2=0, means disabled - ex af, af' ; Restore AF (before enabling interrupts) - ei ; yes + ex af, af' ; Recover interrupt state + jp po, nointenable ; Odd parity, IFF2=0, means disabled + ex af, af' ; Restore AF (before enabling interrupts) + ei ; yes reti nointenable:: - ex af, af' ; Restore AF + ex af, af' ; Restore AF reti ;************************************************************************** ; Ordering of segments for the linker (SDCC only) ;************************************************************************** - .area _HOME - .area _CODE + .area _HOME + .area _CODE .area _INITIALIZER - .area _GSINIT - .area _GSFINAL + .area _GSINIT + .area _GSFINAL - .area _DATA + .area _DATA .area _INITIALIZED .area _BSEG - .area _BSS - .area _HEAP + .area _BSS + .area _HEAP ;************************************************************************** ; Global data initialization logic (SDCC only) ;************************************************************************** - .area _GSINIT + .area _GSINIT gsinit:: - ld bc, #l__INITIALIZER - ld a, b - or a, c - jr Z, gsinit_next - ld de, #s__INITIALIZED - ld hl, #s__INITIALIZER + ld bc, #l__INITIALIZER + ld a, b + or a, c + jr Z, gsinit_next + ld de, #s__INITIALIZED + ld hl, #s__INITIALIZER ldir gsinit_next: @@ -300,5 +300,5 @@ gsinit_next: .area _CODE _g_heapbase:: - .dw #s__HEAP + .dw #s__HEAP diff --git a/nuttx/arch/z80/src/z80/z80_rom.asm b/nuttx/arch/z80/src/z80/z80_rom.asm index d3bc13530..70e698bf0 100644 --- a/nuttx/arch/z80/src/z80/z80_rom.asm +++ b/nuttx/arch/z80/src/z80/z80_rom.asm @@ -1,7 +1,7 @@ ;************************************************************************** ; arch/z80/src/z80/z80_rom.asm ; -; Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. +; Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. ; Author: Gregory Nutt ; ; Redistribution and use in source and binary forms, with or without @@ -42,7 +42,7 @@ ; Register save area layout - XCPT_I == 0 ; Offset 0: Saved I w/interrupt state in parity + XCPT_I == 0 ; Offset 0: Saved I w/interrupt state in carry XCPT_BC == 2 ; Offset 1: Saved BC register XCPT_DE == 4 ; Offset 2: Saved DE register XCPT_IX == 6 ; Offset 3: Saved IX register @@ -71,7 +71,7 @@ _up_reset: ; Set up the stack pointer at the location determined the Makefile ; and stored in asm_mem.h - ld SP, #CONFIG_STACK_END ; Set stack pointer + ld SP, #CONFIG_STACK_END ; Set stack pointer ; Performed initialization unique to the SDCC toolchain @@ -79,9 +79,9 @@ _up_reset: ; Copy the reset vectors - ld hl, #_up_rstvectors ; code for RAM - ld de, #0x4000 ; move it here - ld bc, #3*7 ; 7 vectors / 3 bytes each + ld hl, #_up_rstvectors ; code for RAM + ld de, #0x4000 ; move it here + ld bc, #3*7 ; 7 vectors / 3 bytes each ldir ; Then start NuttX @@ -91,19 +91,19 @@ _up_reset: ; NuttX will never return, but just in case... _up_halt:: - halt ; We should never get here - jp _up_halt + halt ; We should never get here + jp _up_halt ; Data to copy to address 0x4000 _up_rstvectors: - jp _up_rst1 ; 0x4000 : RST 1 - jp _up_rst2 ; 0x4003 : RST 2 - jp _up_rst3 ; 0x4006 : RST 3 - jp _up_rst4 ; 0x4009 : RST 4 - jp _up_rst5 ; 0x400c : RST 5 - jp _up_rst6 ; 0x400f : RST 6 - jp _up_rst7 ; 0x4012 : RST 7 + jp _up_rst1 ; 0x4000 : RST 1 + jp _up_rst2 ; 0x4003 : RST 2 + jp _up_rst3 ; 0x4006 : RST 3 + jp _up_rst4 ; 0x4009 : RST 4 + jp _up_rst5 ; 0x400c : RST 5 + jp _up_rst6 ; 0x400f : RST 6 + jp _up_rst7 ; 0x4012 : RST 7 ;************************************************************************** ; Other reset handlers @@ -119,61 +119,61 @@ _up_rstvectors: ; ;************************************************************************** -_up_rst1: ; RST 1 +_up_rst1: ; RST 1 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #1 ; 1 = Z80_RST1 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #1 ; 1 = Z80_RST1 + jr _up_rstcommon ; Remaining RST handling is common -_up_rst2: ; RST 2 +_up_rst2: ; RST 2 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #2 ; 2 = Z80_RST2 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #2 ; 2 = Z80_RST2 + jr _up_rstcommon ; Remaining RST handling is common -_up_rst3: ; RST 3 +_up_rst3: ; RST 3 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #3 ; 1 = Z80_RST3 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #3 ; 1 = Z80_RST3 + jr _up_rstcommon ; Remaining RST handling is common -_up_rst4: ; RST 4 +_up_rst4: ; RST 4 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #4 ; 1 = Z80_RST4 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #4 ; 1 = Z80_RST4 + jr _up_rstcommon ; Remaining RST handling is common -_up_rst5: ; RST 5 +_up_rst5: ; RST 5 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #5 ; 1 = Z80_RST5 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #5 ; 1 = Z80_RST5 + jr _up_rstcommon ; Remaining RST handling is common -_up_rst6: ; RST 6 +_up_rst6: ; RST 6 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #6 ; 1 = Z80_RST6 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #6 ; 1 = Z80_RST6 + jr _up_rstcommon ; Remaining RST handling is common -_up_rst7: ; RST 7 +_up_rst7: ; RST 7 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #7 ; 7 = Z80_RST7 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #7 ; 7 = Z80_RST7 + jr _up_rstcommon ; Remaining RST handling is common ;************************************************************************** ; Common Interrupt handler @@ -188,27 +188,27 @@ _up_rstcommon: ; ; IRQ number is in A - push hl ; Offset 6: HL - ld hl, #(3*2) ; HL is the value of the stack pointer before - add hl, sp ; the interrupt occurred - push hl ; Offset 5: Stack pointer - push iy ; Offset 4: IY - push ix ; Offset 3: IX - push de ; Offset 2: DE - push bc ; Offset 1: BC - - ld b, a ; Save the reset number in B - ld a, i ; Parity bit holds interrupt state - push af ; Offset 0: I with interrupt state in parity + push hl ; Offset 6: HL + ld hl, #(3*2) ; HL is the value of the stack pointer before + add hl, sp ; the interrupt occurred + push hl ; Offset 5: Stack pointer + push iy ; Offset 4: IY + push ix ; Offset 3: IX + push de ; Offset 2: DE + push bc ; Offset 1: BC + + ld b, a ; Save the reset number in B + ld a, i ; Parity bit holds interrupt state + push af ; Offset 0: I with interrupt state in parity di ; Call the interrupt decode logic. SP points to the beginning of the reg structure - ld hl, #0 ; Argument #2 is the beginning of the reg structure - add hl, sp ; - push hl ; Place argument #2 at the top of stack - push bc ; Argument #1 is the Reset number - inc sp ; (make byte sized) + ld hl, #0 ; Argument #2 is the beginning of the reg structure + add hl, sp ; + push hl ; Place argument #2 at the top of stack + push bc ; Argument #1 is the Reset number + inc sp ; (make byte sized) call _up_doirq ; Decode the IRQ ; On return, HL points to the beginning of the reg structure to restore @@ -216,61 +216,82 @@ _up_rstcommon: ; original stack pointer is lost. In the normal case (no context switch), ; HL will contain the value of the SP before the arguments were pushed. - ld sp, hl ; Use the new stack pointer + ld sp, hl ; Use the new stack pointer ; Restore registers. HL points to the beginning of the reg structure to restore - ex af, af' ; Select alternate AF - pop af ; Offset 0: AF' = I with interrupt state in parity - ex af, af' ; Restore original AF - pop bc ; Offset 1: BC - pop de ; Offset 2: DE - pop ix ; Offset 3: IX - pop iy ; Offset 4: IY - exx ; Use alternate BC/DE/HL - ld hl, #-2 ; Offset of SP to account for ret addr on stack - pop de ; Offset 5: HL' = Stack pointer after return - add hl, de ; HL = Stack pointer value before return - exx ; Restore original BC/DE/HL - pop hl ; Offset 6: HL - pop af ; Offset 7: AF + ex af, af' ; Select alternate AF + pop af ; Offset 0: AF' = I with interrupt state in carry + ex af, af' ; Restore original AF + pop bc ; Offset 1: BC + pop de ; Offset 2: DE + pop ix ; Offset 3: IX + pop iy ; Offset 4: IY + exx ; Use alternate BC/DE/HL + ld hl, #-2 ; Offset of SP to account for ret addr on stack + pop de ; Offset 5: HL' = Stack pointer after return + add hl, de ; HL = Stack pointer value before return + exx ; Restore original BC/DE/HL + pop hl ; Offset 6: HL + pop af ; Offset 7: AF ; Restore the stack pointer - exx ; Use alternate BC/DE/HL - ld sp, hl ; Set SP = saved stack pointer value before return - exx ; Restore original BC/DE/HL + exx ; Use alternate BC/DE/HL + ld sp, hl ; Set SP = saved stack pointer value before return + exx ; Restore original BC/DE/HL ; Restore interrupt state - ex af, af' ; Recover interrupt state - jp po, nointenable ; Odd parity, IFF2=0, means disabled - ex af, af' ; Restore AF (before enabling interrupts) - ei ; yes + ex af, af' ; Recover interrupt state + jp po, nointenable ; Odd parity, IFF2=0, means disabled + ex af, af' ; Restore AF (before enabling interrupts) + ei ; yes reti nointenable:: - ex af, af' ; Restore AF + ex af, af' ; Restore AF reti ;************************************************************************** ; Ordering of segments for the linker (SDCC only) ;************************************************************************** - .area _HOME - .area _CODE - .area _GSINIT - .area _GSFINAL + .area _HOME + .area _CODE + .area _INITIALIZER + .area _GSINIT + .area _GSFINAL - .area _DATA - .area _BSS - .area _HEAP + .area _DATA + .area _INITIALIZED + .area _BSEG + .area _BSS + .area _HEAP ;************************************************************************** ; Global data initialization logic (SDCC only) ;************************************************************************** - .area _GSINIT + .area _GSINIT gsinit:: + ld bc, #l__INITIALIZER + ld a, b + or a, c + jr Z, gsinit_next + ld de, #s__INITIALIZED + ld hl, #s__INITIALIZER + ldir +gsinit_next: + .area _GSFINAL ret +;************************************************************************** +; The start of the heap (SDCC only). Note that is actually resides in +; the _CODE area (which may be FLASH or ROM) +;************************************************************************** + + .area _CODE +_g_heapbase:: + .dw #s__HEAP + -- cgit v1.2.3 From 2ca319a5cfdc404c9ce167c3f3672db1950cc199 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 7 Dec 2012 22:02:51 +0000 Subject: configs/z80sim/nsh and pashello converted to kconfig-frontends and Windows native build git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5418 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 5 + nuttx/configs/xtrs/README.txt | 40 +- nuttx/configs/xtrs/src/xtr_serial.c | 48 +-- nuttx/configs/z80sim/README.txt | 102 ++++-- nuttx/configs/z80sim/nsh/appconfig | 44 --- nuttx/configs/z80sim/nsh/defconfig | 604 ++++++++++++++++++++++--------- nuttx/configs/z80sim/nsh/setenv.bat | 50 +++ nuttx/configs/z80sim/nsh/setenv.sh | 45 --- nuttx/configs/z80sim/pashello/appconfig | 43 --- nuttx/configs/z80sim/pashello/defconfig | 541 +++++++++++++++++++-------- nuttx/configs/z80sim/pashello/setenv.bat | 50 +++ nuttx/configs/z80sim/pashello/setenv.sh | 45 --- nuttx/configs/z80sim/src/z80_serial.c | 48 +-- 13 files changed, 1098 insertions(+), 567 deletions(-) delete mode 100644 nuttx/configs/z80sim/nsh/appconfig create mode 100644 nuttx/configs/z80sim/nsh/setenv.bat delete mode 100755 nuttx/configs/z80sim/nsh/setenv.sh delete mode 100644 nuttx/configs/z80sim/pashello/appconfig create mode 100644 nuttx/configs/z80sim/pashello/setenv.bat delete mode 100755 nuttx/configs/z80sim/pashello/setenv.sh (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 0ec0fdc3d..37dbc3076 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3759,3 +3759,8 @@ type. Requested by Freddie Chopin. * include/stdlib/lib_rand.c: Various additional changes so that the integer value zero can be returned. Requested by Freddie Chopin. + * arch/z80/src/Makefile.sdcc*, z80/up_mem.h: Redesign Z80 build so that it + no longer depends on Bash scripts. + * configs/z80sim/nsh and pashello: Converted to (1) used the kconfig-frontends + configuration tool, and (2) to build natively under Windows. The NSH + configuration is verified; the pashello configuration needs a more TLC. diff --git a/nuttx/configs/xtrs/README.txt b/nuttx/configs/xtrs/README.txt index 02409de73..dae8a51ba 100644 --- a/nuttx/configs/xtrs/README.txt +++ b/nuttx/configs/xtrs/README.txt @@ -12,10 +12,10 @@ Contents o Getting a TRS80 emulator and DOS disks o Loading an executable into xtrs o Configuring NuttX + o Reconfiguring NuttX + o Reconfiguring for Linux, OSX, or Cygwin o SDCC o Building the SDCC toolchain - o SDCC Update - o Newer SDCC Versions Getting a TRS80 emulator and DOS disks ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -85,6 +85,42 @@ Configuring NuttX cd - . ./setenv.sh +Reconfiguring NuttX +^^^^^^^^^^^^^^^^^^^ + +These configurations all use the kconfig-frontends, mconf-based configuration +tool. To change this configuration using that tool, you should: + + a. Build and install the mconf tool. See nuttx/README.txt and + misc/tools/README.txt + + b. Execute 'make menuconfig' in nuttx/ in order to start the reconfiguration + process. + +Reconfiguring for Linux, OSX, or Cygwin +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +All of the z80 configurations in this this directory are set up to build in a +Windows CMD.exe shell. This configuration requires the MinGW host compiler +and severl GNUWin32 tools (see discussion in the top-level NuttX/README.txt +file). + +These configurations can be converted to run under Linux (or Cygwin or OSX), +by modifying the configuration file as follows: + + -CONFIG_HOST_WINDOWS=y + -CONFIG_WINDOWS_NATIVE=y + +CONFIG_HOST_LINUX=y + + -CONFIG_Z80_TOOLCHAIN_SDCCW=y + +CONFIG_Z80_TOOLCHAIN_SDCCL=y + +You may need to first manually change the CONFIG_APPS_DIR="..\apps" definition +in the .config file because the backslash may upset some Unix-based tools. + +You cannot use the default setenv.bat in these Unix-like enviroments because +that is a Windows batch file. Use configs/z80sim/script/setenv.sh instead. + SDCC ^^^^ diff --git a/nuttx/configs/xtrs/src/xtr_serial.c b/nuttx/configs/xtrs/src/xtr_serial.c index 42cffb740..1a84abee5 100644 --- a/nuttx/configs/xtrs/src/xtr_serial.c +++ b/nuttx/configs/xtrs/src/xtr_serial.c @@ -104,18 +104,18 @@ * Private Function Prototypes ****************************************************************************/ -static int up_setup(struct uart_dev_s *dev); -static void up_shutdown(struct uart_dev_s *dev); -static int up_attach(struct uart_dev_s *dev); -static void up_detach(struct uart_dev_s *dev); -static int up_ioctl(struct file *filep, int cmd, unsigned long arg); -static int up_receive(struct uart_dev_s *dev, uint32_t *status); -static void up_rxint(struct uart_dev_s *dev, bool enable); -static bool up_rxavailable(struct uart_dev_s *dev); -static void up_send(struct uart_dev_s *dev, int ch); -static void up_txint(struct uart_dev_s *dev, bool enable); -static bool up_txready(struct uart_dev_s *dev); -static bool up_txempty(struct uart_dev_s *dev); +static int up_setup(FAR struct uart_dev_s *dev); +static void up_shutdown(FAR struct uart_dev_s *dev); +static int up_attach(FAR struct uart_dev_s *dev); +static void up_detach(FAR struct uart_dev_s *dev); +static int up_ioctl(FAR struct file *filep, int cmd, unsigned long arg); +static int up_receive(FAR struct uart_dev_s *dev, unsigned int *status); +static void up_rxint(FAR struct uart_dev_s *dev, bool enable); +static bool up_rxavailable(FAR struct uart_dev_s *dev); +static void up_send(FAR struct uart_dev_s *dev, int ch); +static void up_txint(FAR struct uart_dev_s *dev, bool enable); +static bool up_txready(FAR struct uart_dev_s *dev); +static bool up_txempty(FAR struct uart_dev_s *dev); /**************************************************************************** * Private Variables @@ -185,7 +185,7 @@ static uart_dev_t g_uartport = * ****************************************************************************/ -static int up_setup(struct uart_dev_s *dev) +static int up_setup(FAR struct uart_dev_s *dev) { outp(RESET, 0); outp(CONTROL, ctrl); @@ -203,7 +203,7 @@ static int up_setup(struct uart_dev_s *dev) * ****************************************************************************/ -static void up_shutdown(struct uart_dev_s *dev) +static void up_shutdown(FAR struct uart_dev_s *dev) { } @@ -222,7 +222,7 @@ static void up_shutdown(struct uart_dev_s *dev) * ****************************************************************************/ -static int up_attach(struct uart_dev_s *dev) +static int up_attach(FAR struct uart_dev_s *dev) { // SDCC complains here // *((void (*)()) XMIT_INT_VECTOR) = rs232_xmitisr; @@ -246,7 +246,7 @@ static int up_attach(struct uart_dev_s *dev) * ****************************************************************************/ -static void up_detach(struct uart_dev_s *dev) +static void up_detach(FAR struct uart_dev_s *dev) { outp(WRINTMASK, *(char *)WRINTMASK_SHADOW &= ~(MASK_ERR_INT | MASK_RECV_INT | MASK_XMIT_INT)); *((int *) XMIT_INT_VECTOR) = 0x35fa; @@ -261,7 +261,7 @@ static void up_detach(struct uart_dev_s *dev) * ****************************************************************************/ -static int up_ioctl(struct file *filep, int cmd, unsigned long arg) +static int up_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { *get_errno_ptr() = ENOTTY; return ERROR; @@ -277,7 +277,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) * ****************************************************************************/ -static int up_receive(struct uart_dev_s *dev, uint32_t *status) +static int up_receive(FAR struct uart_dev_s *dev, unsigned int *status) { // uint8_t ch = z80_lowputc(); @@ -293,7 +293,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) * ****************************************************************************/ -static void up_rxint(struct uart_dev_s *dev, bool enable) +static void up_rxint(FAR struct uart_dev_s *dev, bool enable) { } @@ -305,7 +305,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) * ****************************************************************************/ -static bool up_rxavailable(struct uart_dev_s *dev) +static bool up_rxavailable(FAR struct uart_dev_s *dev) { return true; } @@ -318,7 +318,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) * ****************************************************************************/ -static void up_send(struct uart_dev_s *dev, int ch) +static void up_send(FAR struct uart_dev_s *dev, int ch) { z80_lowputc(ch); } @@ -331,7 +331,7 @@ static void up_send(struct uart_dev_s *dev, int ch) * ****************************************************************************/ -static void up_txint(struct uart_dev_s *dev, bool enable) +static void up_txint(FAR struct uart_dev_s *dev, bool enable) { } @@ -343,7 +343,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) * ****************************************************************************/ -static bool up_txready(struct uart_dev_s *dev) +static bool up_txready(FAR struct uart_dev_s *dev) { return true; } @@ -356,7 +356,7 @@ static bool up_txready(struct uart_dev_s *dev) * ****************************************************************************/ -static bool up_txempty(struct uart_dev_s *dev) +static bool up_txempty(FAR struct uart_dev_s *dev) { return true; } diff --git a/nuttx/configs/z80sim/README.txt b/nuttx/configs/z80sim/README.txt index 37db83533..0580b684c 100644 --- a/nuttx/configs/z80sim/README.txt +++ b/nuttx/configs/z80sim/README.txt @@ -12,10 +12,10 @@ Contents ^^^^^^^^ o Configuring NuttX + o Reconfiguring NuttX + o Reconfiguring for Linux, OSX, or Cygwin o SDCC o Building the SDCC toolchain - o SDCC Update - o Newer SDCC Versions Configuring NuttX ^^^^^^^^^^^^^^^^^ @@ -32,35 +32,19 @@ Configuring NuttX NOTES: - 1. This configuration uses the mconf-based configuration tool. To - change this configuration using that tool, you should: - - a. Build and install the mconf tool. See nuttx/README.txt and - misc/tools/ - - b. Execute 'make menuconfig' in nuttx/ in order to start the - reconfiguration process. + 1. This configuration uses the mconf-based configuration tool. See the + "Reconfiguring" section below for information about changing this + configuration. 2. The default setup for this configuration uses a windows native build. - As of this writing, the native Windows build still does not work. + See the section entitled "Reconfiguring for Linux, OSX, or Cygwin" + which will give you the steps you would need to do to convert this + configuration to build in other, Unix-like environments. - This configuration was last verified sucessfully prior to the + 3. This configuration was last verified sucessfully prior to the the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run natively under Cygwin. - 3. This configuration can be converted to run under Linux (or Cygwin or - OSX), by modifying the configuration file as follows: - - -CONFIG_HOST_WINDOWS=y - -CONFIG_WINDOWS_NATIVE=y - +CONFIG_HOST_LINUX=y - - -CONFIG_Z80_TOOLCHAIN_SDCCW=y - +CONFIG_Z80_TOOLCHAIN_SDCCL=y - - You make also have to change the value of CONFIG_APPS_DIR. You cannot - use the default setenv.bat. Use configs/z80sim/script/setenv.sh instead. - nsh This configuration file builds NSH (examples/nsh). This @@ -74,7 +58,22 @@ Configuring NuttX cd - . ./setenv.sh - pashello + NOTES: + + 1. This configuration uses the mconf-based configuration tool. See the + "Reconfiguring" section below for information about changing this + configuration. + + 2. The default setup for this configuration uses a windows native build. + See the section entitled "Reconfiguring for Linux, OSX, or Cygwin" + which will give you the steps you would need to do to convert this + configuration to build in other, Unix-like environments. + + 3. This configuration was last verified sucessfully prior to the + the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run + natively under Cygwin. + + pashello Configures to use examples/pashello for execution from FLASH See examples/README.txt for information about pashello. @@ -89,6 +88,57 @@ Configuring NuttX cd - . ./setenv.sh + NOTES: + + 1. This configuration uses the mconf-based configuration tool. See the + "Reconfiguring" section below for information about changing this + configuration. + + 2. The default setup for this configuration uses a windows native build. + See the section entitled "Reconfiguring for Linux, OSX, or Cygwin" + which will give you the steps you would need to do to convert this + configuration to build in other, Unix-like environments. + + 3. This configuration was last verified sucessfully prior to the + the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run + natively under Cygwin. + +Reconfiguring NuttX +^^^^^^^^^^^^^^^^^^^ + +These configurations all use the kconfig-frontends, mconf-based configuration +tool. To change this configuration using that tool, you should: + + a. Build and install the mconf tool. See nuttx/README.txt and + misc/tools/README.txt + + b. Execute 'make menuconfig' in nuttx/ in order to start the reconfiguration + process. + +Reconfiguring for Linux, OSX, or Cygwin +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +All of the z80 configurations in this this directory are set up to build in a +Windows CMD.exe shell. This configuration requires the MinGW host compiler +and severl GNUWin32 tools (see discussion in the top-level NuttX/README.txt +file). + +These configurations can be converted to run under Linux (or Cygwin or OSX), +by modifying the configuration file as follows: + + -CONFIG_HOST_WINDOWS=y + -CONFIG_WINDOWS_NATIVE=y + +CONFIG_HOST_LINUX=y + + -CONFIG_Z80_TOOLCHAIN_SDCCW=y + +CONFIG_Z80_TOOLCHAIN_SDCCL=y + +You may need to first manually change the CONFIG_APPS_DIR="..\apps" definition +in the .config file because the backslash may upset some Unix-based tools. + +You cannot use the default setenv.bat in these Unix-like enviroments because +that is a Windows batch file. Use configs/z80sim/script/setenv.sh instead. + SDCC ^^^^ diff --git a/nuttx/configs/z80sim/nsh/appconfig b/nuttx/configs/z80sim/nsh/appconfig deleted file mode 100644 index 22298ecda..000000000 --- a/nuttx/configs/z80sim/nsh/appconfig +++ /dev/null @@ -1,44 +0,0 @@ -############################################################################ -# configs/z80sim/nsh/appconfig -# -# Copyright (C) 2011-2012 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. -# -############################################################################ - -# Path to example in apps/examples containing the user_start entry point - -CONFIGURED_APPS += examples/nsh - -# The NSH Library - -CONFIGURED_APPS += system/readline -CONFIGURED_APPS += nshlib - diff --git a/nuttx/configs/z80sim/nsh/defconfig b/nuttx/configs/z80sim/nsh/defconfig index c86b0edc1..d3fd60706 100644 --- a/nuttx/configs/z80sim/nsh/defconfig +++ b/nuttx/configs/z80sim/nsh/defconfig @@ -1,134 +1,151 @@ -############################################################################ -# configs/z80sim/nsh/defconfig -# -# Copyright (C) 2007-2010 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. -# -############################################################################ -# -# Architecture selection # -CONFIG_ARCH="z80" +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_LINUX is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +CONFIG_WINDOWS_NATIVE=y +# CONFIG_WINDOWS_CYGWIN is not set +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set +# CONFIG_WINDOWS_MKLINK is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="..\apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_SYMBOLS is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set CONFIG_ARCH_Z80=y +CONFIG_ARCH="z80" CONFIG_ARCH_CHIP="z80" +CONFIG_BOARD_LOOPSPERMSEC= CONFIG_ARCH_CHIP_Z80=y -CONFIG_ARCH_BOARD="z80sim" -CONFIG_ARCH_BOARD_Z80SIM=y +# CONFIG_ARCH_CHIP_Z8F6403 is not set +# CONFIG_ARCH_CHIP_Z8F6423 is not set +# CONFIG_ARCH_CHIP_EZ80F91 is not set +# CONFIG_ARCH_CHIP_EZ80F92 is not set +# CONFIG_ARCH_CHIP_EZ80F93 is not set +# CONFIG_Z80_TOOLCHAIN_SDCCL is not set +CONFIG_Z80_TOOLCHAIN_SDCCW=y + +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_IRQPRIO is not set +# CONFIG_ARCH_STACKDUMP is not set +# CONFIG_ENDIAN_BIG is not set + +# +# Board Settings +# +CONFIG_DRAM_START= CONFIG_DRAM_SIZE=65536 # -# Z80sim specific device driver settings +# Boot options # -CONFIG_UART_RXBUFSIZE=64 -CONFIG_UART_TXBUFSIZE=64 +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set # -# General build options +# Board Selection # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n +# CONFIG_ARCH_BOARD_XTRS is not set +CONFIG_ARCH_BOARD_Z80SIM=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="z80sim" # -# General OS setup +# Common Board Options # -CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_DEBUG=n -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y -CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=n -CONFIG_TASK_NAME_SIZE=0 -CONFIG_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=21 -CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=n -CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=n -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n -CONFIG_SDCLONE_DISABLE=y +CONFIG_NSH_MMCSDMINOR=0 # -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. +# Board-Specific Options # -# There are certain dependency relationships in these -# features. + # -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. +# RTOS Features # -CONFIG_DISABLE_CLOCK=n +CONFIG_MSEC_PER_TICK=10 +CONFIG_RR_INTERVAL=0 +# CONFIG_SCHED_INSTRUMENTATION is not set +CONFIG_TASK_NAME_SIZE=0 +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2012 +CONFIG_START_MONTH=12 +CONFIG_START_DAY=7 +CONFIG_DEV_CONSOLE=y +# CONFIG_DEV_LOWCONSOLE is not set +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_DISABLE_OS_API=y +# CONFIG_DISABLE_CLOCK is not set CONFIG_DISABLE_POSIX_TIMERS=y CONFIG_DISABLE_PTHREAD=y -CONFIG_DISABLE_SIGNALS=n +# CONFIG_DISABLE_SIGNALS is not set CONFIG_DISABLE_MQUEUE=y CONFIG_DISABLE_MOUNTPOINT=y CONFIG_DISABLE_ENVIRON=y CONFIG_DISABLE_POLL=y -# -# Misc libc settings -# -CONFIG_NOPRINTF_FIELDWIDTH=y - -# -# Allow for architecture optimized implementations -# -# The architecture can provide optimized versions of the -# following to improve sysem performance -# -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n - # # Sizes of configurable things (0 disables) # @@ -138,8 +155,6 @@ CONFIG_NPTHREAD_KEYS=0 CONFIG_NFILE_DESCRIPTORS=6 CONFIG_NFILE_STREAMS=6 CONFIG_NAME_MAX=32 -CONFIG_STDIO_BUFFER_SIZE=0 -CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_MQ_MSGS=0 CONFIG_MQ_MAXMSGSIZE=0 CONFIG_MAX_WDOGPARMS=2 @@ -147,77 +162,340 @@ CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 # -# TCP/IP and UDP support via uIP +# Stack and heap information +# +# CONFIG_CUSTOM_STACK is not set +CONFIG_IDLETHREAD_STACKSIZE=1024 +CONFIG_USERMAIN_STACKSIZE=1024 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=1024 + +# +# Device Drivers +# +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +# CONFIG_UART_SERIAL_CONSOLE is not set +CONFIG_NO_SERIAL_CONSOLE=y + +# +# UART Configuration +# +CONFIG_UART_RXBUFSIZE=64 +CONFIG_UART_TXBUFSIZE=64 +CONFIG_UART_BAUD=11520 +CONFIG_UART_BITS=8 +CONFIG_UART_PARITY=0 +CONFIG_UART_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set + +# +# System Logging Device Options +# + +# +# System Logging +# +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_NET is not set + +# +# File Systems # -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n # -# UIP Network Utilities +# File system configuration # -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 +# CONFIG_FS_RAMMAP is not set # -# Settings for examples/nsh +# System Logging # +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0x00000000 +CONFIG_HEAP2_SIZE=0 +# CONFIG_GRAN is not set + +# +# Binary Formats +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# +CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=0 +# CONFIG_LIBM is not set +CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_C99_BOOL8 is not set +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Named Applications +# +# CONFIG_NAMEDAPP is not set + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_NETTEST is not set +CONFIG_EXAMPLES_NSH=y +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +# CONFIG_EXAMPLES_OSTEST is not set +# CONFIG_EXAMPLES_PASHELLO is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WLAN is not set + +# +# Interpreters +# + +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# ModBus +# + +# +# FreeModbus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +CONFIG_NSH_LIBRARY=y + +# +# Disable Individual commands +# +# CONFIG_NSH_DISABLE_CAT is not set +# CONFIG_NSH_DISABLE_CD is not set +# CONFIG_NSH_DISABLE_CP is not set +# CONFIG_NSH_DISABLE_DD is not set +# CONFIG_NSH_DISABLE_ECHO is not set +# CONFIG_NSH_DISABLE_EXEC is not set +# CONFIG_NSH_DISABLE_EXIT is not set +# CONFIG_NSH_DISABLE_FREE is not set +# CONFIG_NSH_DISABLE_GET is not set +# CONFIG_NSH_DISABLE_HELP is not set +# CONFIG_NSH_DISABLE_HEXDUMP is not set +# CONFIG_NSH_DISABLE_IFCONFIG is not set +# CONFIG_NSH_DISABLE_KILL is not set +# CONFIG_NSH_DISABLE_LOSETUP is not set +# CONFIG_NSH_DISABLE_LS is not set +# CONFIG_NSH_DISABLE_MB is not set +# CONFIG_NSH_DISABLE_MKDIR is not set +# CONFIG_NSH_DISABLE_MKFATFS is not set +# CONFIG_NSH_DISABLE_MKFIFO is not set +# CONFIG_NSH_DISABLE_MKRD is not set +# CONFIG_NSH_DISABLE_MH is not set +# CONFIG_NSH_DISABLE_MOUNT is not set +# CONFIG_NSH_DISABLE_MW is not set +# CONFIG_NSH_DISABLE_NSFMOUNT is not set +# CONFIG_NSH_DISABLE_PS is not set +# CONFIG_NSH_DISABLE_PING is not set +# CONFIG_NSH_DISABLE_PUT is not set +# CONFIG_NSH_DISABLE_PWD is not set +# CONFIG_NSH_DISABLE_RM is not set +# CONFIG_NSH_DISABLE_RMDIR is not set +# CONFIG_NSH_DISABLE_SET is not set +# CONFIG_NSH_DISABLE_SH is not set +# CONFIG_NSH_DISABLE_SLEEP is not set +# CONFIG_NSH_DISABLE_TEST is not set +# CONFIG_NSH_DISABLE_UMOUNT is not set +# CONFIG_NSH_DISABLE_UNSET is not set +# CONFIG_NSH_DISABLE_USLEEP is not set +# CONFIG_NSH_DISABLE_WGET is not set +# CONFIG_NSH_DISABLE_XD is not set +CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_FILEIOSIZE=1024 -CONFIG_NSH_STRERROR=n CONFIG_NSH_LINELEN=40 CONFIG_NSH_NESTDEPTH=3 -CONFIG_NSH_DISABLESCRIPT=n -CONFIG_NSH_DISABLEBG=n -CONFIG_NSH_ROMFSETC=n +# CONFIG_NSH_DISABLESCRIPT is not set +# CONFIG_NSH_DISABLEBG is not set CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 -CONFIG_NSH_ROMFSMOUNTPT="/etc" -CONFIG_NSH_INITSCRIPT="init.d/rcS" -CONFIG_NSH_ROMFSDEVNO=0 -CONFIG_NSH_ROMFSSECTSIZE=64 -CONFIG_NSH_FATDEVNO=1 -CONFIG_NSH_FATSECTSIZE=512 -CONFIG_NSH_FATNSECTORS=1024 -CONFIG_NSH_FATMOUNTPT="/tmp" +# CONFIG_NSH_CONDEV is not set +# CONFIG_NSH_ARCHINIT is not set # -# Stack and heap information +# NxWidgets/NxWM # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=1024 -CONFIG_USERMAIN_STACKSIZE=1024 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# System NSH Add-Ons # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# readline() +# +CONFIG_SYSTEM_READLINE=y +CONFIG_READLINE_ECHO=y + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set diff --git a/nuttx/configs/z80sim/nsh/setenv.bat b/nuttx/configs/z80sim/nsh/setenv.bat new file mode 100644 index 000000000..9ce941938 --- /dev/null +++ b/nuttx/configs/z80sim/nsh/setenv.bat @@ -0,0 +1,50 @@ +@echo off + +rem configs/z80sim/nsh/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the SDCC toolchain for windows. + +set PATH=C:\Program Files (x86)\SDCC/bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% +echo %PATH% diff --git a/nuttx/configs/z80sim/nsh/setenv.sh b/nuttx/configs/z80sim/nsh/setenv.sh deleted file mode 100755 index 48373b0f2..000000000 --- a/nuttx/configs/z80sim/nsh/setenv.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# configs/z80sim/nsh/setenv.sh -# -# 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 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. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - -export SDCC_BIN=/usr/local/bin -export PATH=${SDCC_BIN}:/sbin:/usr/sbin:${PATH_ORIG} - -echo "PATH : ${PATH}" diff --git a/nuttx/configs/z80sim/pashello/appconfig b/nuttx/configs/z80sim/pashello/appconfig deleted file mode 100644 index 38d7b91f8..000000000 --- a/nuttx/configs/z80sim/pashello/appconfig +++ /dev/null @@ -1,43 +0,0 @@ -############################################################################ -# configs/z80sim/pashello/appconfig -# -# Copyright (C) 2011 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. -# -############################################################################ - -# Path to example in apps/examples containing the user_start entry point - -CONFIGURED_APPS += examples/pashello - -# Path to the Pascal p-code runtime interpreter module - -CONFIGURED_APPS += interpreters/pcode - diff --git a/nuttx/configs/z80sim/pashello/defconfig b/nuttx/configs/z80sim/pashello/defconfig index 655c87408..1d9eb7a0e 100644 --- a/nuttx/configs/z80sim/pashello/defconfig +++ b/nuttx/configs/z80sim/pashello/defconfig @@ -1,103 +1,141 @@ -############################################################################ -# configs/z80sim/pashello/defconfig -# -# Copyright (C) 2007-2010 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. -# -############################################################################ -# -# Architecture selection # -CONFIG_ARCH="z80" +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_LINUX is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +CONFIG_WINDOWS_NATIVE=y +# CONFIG_WINDOWS_CYGWIN is not set +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set +# CONFIG_WINDOWS_MKLINK is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="..\apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_SYMBOLS is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set CONFIG_ARCH_Z80=y +CONFIG_ARCH="z80" CONFIG_ARCH_CHIP="z80" +CONFIG_BOARD_LOOPSPERMSEC= CONFIG_ARCH_CHIP_Z80=y -CONFIG_ARCH_BOARD="z80sim" -CONFIG_ARCH_BOARD_Z80SIM=y +# CONFIG_ARCH_CHIP_Z8F6403 is not set +# CONFIG_ARCH_CHIP_Z8F6423 is not set +# CONFIG_ARCH_CHIP_EZ80F91 is not set +# CONFIG_ARCH_CHIP_EZ80F92 is not set +# CONFIG_ARCH_CHIP_EZ80F93 is not set +# CONFIG_Z80_TOOLCHAIN_SDCCL is not set +CONFIG_Z80_TOOLCHAIN_SDCCW=y + +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_IRQPRIO is not set +# CONFIG_ARCH_STACKDUMP is not set +# CONFIG_ENDIAN_BIG is not set + +# +# Board Settings +# +CONFIG_DRAM_START= CONFIG_DRAM_SIZE=65536 # -# Z80sim specific device driver settings +# Boot options # -CONFIG_UART_RXBUFSIZE=0 -CONFIG_UART_TXBUFSIZE=0 +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set # -# General build options +# Board Selection # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n +# CONFIG_ARCH_BOARD_XTRS is not set +CONFIG_ARCH_BOARD_Z80SIM=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="z80sim" # -# General OS setup +# Common Board Options # -CONFIG_USER_ENTRYPOINT="pashello_main" -CONFIG_DEBUG=n -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y -CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=n -CONFIG_TASK_NAME_SIZE=0 -CONFIG_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=21 -CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=n -CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=n -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n -CONFIG_SDCLONE_DISABLE=y # -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. +# Board-Specific Options # -# There are certain dependency relationships in these -# features. + # -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. +# RTOS Features # +CONFIG_MSEC_PER_TICK=10 +CONFIG_RR_INTERVAL=0 +# CONFIG_SCHED_INSTRUMENTATION is not set +CONFIG_TASK_NAME_SIZE=0 +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2012 +CONFIG_START_MONTH=12 +CONFIG_START_DAY=7 +CONFIG_DEV_CONSOLE=y +# CONFIG_DEV_LOWCONSOLE is not set +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="pashello_main" +CONFIG_DISABLE_OS_API=y CONFIG_DISABLE_CLOCK=y CONFIG_DISABLE_POSIX_TIMERS=y CONFIG_DISABLE_PTHREAD=y @@ -107,28 +145,6 @@ CONFIG_DISABLE_MOUNTPOINT=y CONFIG_DISABLE_ENVIRON=y CONFIG_DISABLE_POLL=y -# -# Misc libc settings -# -CONFIG_NOPRINTF_FIELDWIDTH=y - -# -# Allow for architecture optimized implementations -# -# The architecture can provide optimized versions of the -# following to improve sysem performance -# -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n - # # Sizes of configurable things (0 disables) # @@ -138,8 +154,6 @@ CONFIG_NPTHREAD_KEYS=0 CONFIG_NFILE_DESCRIPTORS=4 CONFIG_NFILE_STREAMS=4 CONFIG_NAME_MAX=32 -CONFIG_STDIO_BUFFER_SIZE=0 -CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_MQ_MSGS=0 CONFIG_MQ_MAXMSGSIZE=0 CONFIG_MAX_WDOGPARMS=2 @@ -147,62 +161,287 @@ CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 # -# TCP/IP and UDP support via uIP +# Stack and heap information # -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n +# CONFIG_CUSTOM_STACK is not set +CONFIG_IDLETHREAD_STACKSIZE=1024 +CONFIG_USERMAIN_STACKSIZE=1024 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=1024 # -# UIP Network Utilities +# Device Drivers +# +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +# CONFIG_UART_SERIAL_CONSOLE is not set +CONFIG_NO_SERIAL_CONSOLE=y + +# +# UART Configuration # -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 +CONFIG_UART_RXBUFSIZE=0 +CONFIG_UART_TXBUFSIZE=0 +CONFIG_UART_BAUD=11520 +CONFIG_UART_BITS=8 +CONFIG_UART_PARITY=0 +CONFIG_UART_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set # -# Settings for examples/nsh -CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_CMD_SIZE=40 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 +# System Logging Device Options +# # -# Stack and heap information +# System Logging # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=1024 -CONFIG_USERMAIN_STACKSIZE=1024 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_NET is not set + +# +# File Systems +# + +# +# File system configuration +# +# CONFIG_FS_RAMMAP is not set # -# Maintain legacy build behavior (revisit) +# System Logging # +# CONFIG_SYSLOG is not set -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0x00000000 +CONFIG_HEAP2_SIZE=0 +# CONFIG_GRAN is not set + +# +# Binary Formats +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# +CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=0 +# CONFIG_LIBM is not set +CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_C99_BOOL8 is not set +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Named Applications +# +# CONFIG_NAMEDAPP is not set + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_NETTEST is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +# CONFIG_EXAMPLES_OSTEST is not set +CONFIG_EXAMPLES_PASHELLO=y +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WLAN is not set + +# +# Interpreters +# + +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +CONFIG_INTERPRETERS_PCODE=y + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# ModBus +# + +# +# FreeModbus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM +# + +# +# System NSH Add-Ons +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set diff --git a/nuttx/configs/z80sim/pashello/setenv.bat b/nuttx/configs/z80sim/pashello/setenv.bat new file mode 100644 index 000000000..59c372ddd --- /dev/null +++ b/nuttx/configs/z80sim/pashello/setenv.bat @@ -0,0 +1,50 @@ +@echo off + +rem configs/z80sim/pashello/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the SDCC toolchain for windows. + +set PATH=C:\Program Files (x86)\SDCC/bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% +echo %PATH% diff --git a/nuttx/configs/z80sim/pashello/setenv.sh b/nuttx/configs/z80sim/pashello/setenv.sh deleted file mode 100755 index b9de2b9e0..000000000 --- a/nuttx/configs/z80sim/pashello/setenv.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# configs/z80sim/pashello/setenv.sh -# -# 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 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. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - -export SDCC_BIN=/usr/local/bin -export PATH=${SDCC_BIN}:/sbin:/usr/sbin:${PATH_ORIG} - -echo "PATH : ${PATH}" diff --git a/nuttx/configs/z80sim/src/z80_serial.c b/nuttx/configs/z80sim/src/z80_serial.c index 1e5d98b29..27d685093 100644 --- a/nuttx/configs/z80sim/src/z80_serial.c +++ b/nuttx/configs/z80sim/src/z80_serial.c @@ -70,18 +70,18 @@ * Private Function Prototypes ****************************************************************************/ -static int up_setup(struct uart_dev_s *dev); -static void up_shutdown(struct uart_dev_s *dev); -static int up_attach(struct uart_dev_s *dev); -static void up_detach(struct uart_dev_s *dev); -static int up_ioctl(struct file *filep, int cmd, unsigned long arg); -static int up_receive(struct uart_dev_s *dev, uint32_t *status); -static void up_rxint(struct uart_dev_s *dev, bool enable); -static bool up_rxavailable(struct uart_dev_s *dev); -static void up_send(struct uart_dev_s *dev, int ch); -static void up_txint(struct uart_dev_s *dev, bool enable); -static bool up_txready(struct uart_dev_s *dev); -static bool up_txempty(struct uart_dev_s *dev); +static int up_setup(FAR struct uart_dev_s *dev); +static void up_shutdown(FAR struct uart_dev_s *dev); +static int up_attach(FAR struct uart_dev_s *dev); +static void up_detach(FAR struct uart_dev_s *dev); +static int up_ioctl(FAR struct file *filep, int cmd, unsigned long arg); +static int up_receive(FAR struct uart_dev_s *dev, unsigned int *status); +static void up_rxint(FAR struct uart_dev_s *dev, bool enable); +static bool up_rxavailable(FAR struct uart_dev_s *dev); +static void up_send(FAR struct uart_dev_s *dev, int ch); +static void up_txint(FAR struct uart_dev_s *dev, bool enable); +static bool up_txready(FAR struct uart_dev_s *dev); +static bool up_txempty(FAR struct uart_dev_s *dev); /**************************************************************************** * Private Variables @@ -151,7 +151,7 @@ static uart_dev_t g_uartport = * ****************************************************************************/ -static int up_setup(struct uart_dev_s *dev) +static int up_setup(FAR struct uart_dev_s *dev) { return OK; } @@ -165,7 +165,7 @@ static int up_setup(struct uart_dev_s *dev) * ****************************************************************************/ -static void up_shutdown(struct uart_dev_s *dev) +static void up_shutdown(FAR struct uart_dev_s *dev) { } @@ -184,7 +184,7 @@ static void up_shutdown(struct uart_dev_s *dev) * ****************************************************************************/ -static int up_attach(struct uart_dev_s *dev) +static int up_attach(FAR struct uart_dev_s *dev) { return OK; } @@ -199,7 +199,7 @@ static int up_attach(struct uart_dev_s *dev) * ****************************************************************************/ -static void up_detach(struct uart_dev_s *dev) +static void up_detach(FAR struct uart_dev_s *dev) { } @@ -211,7 +211,7 @@ static void up_detach(struct uart_dev_s *dev) * ****************************************************************************/ -static int up_ioctl(struct file *filep, int cmd, unsigned long arg) +static int up_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { *get_errno_ptr() = ENOTTY; return ERROR; @@ -227,7 +227,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) * ****************************************************************************/ -static int up_receive(struct uart_dev_s *dev, uint32_t *status) +static int up_receive(FAR struct uart_dev_s *dev, unsigned int *status) { uint8_t ch = z80_lowgetc(); *status = 0; @@ -242,7 +242,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) * ****************************************************************************/ -static void up_rxint(struct uart_dev_s *dev, bool enable) +static void up_rxint(FAR struct uart_dev_s *dev, bool enable) { } @@ -254,7 +254,7 @@ static void up_rxint(struct uart_dev_s *dev, bool enable) * ****************************************************************************/ -static bool up_rxavailable(struct uart_dev_s *dev) +static bool up_rxavailable(FAR struct uart_dev_s *dev) { return true; } @@ -267,7 +267,7 @@ static bool up_rxavailable(struct uart_dev_s *dev) * ****************************************************************************/ -static void up_send(struct uart_dev_s *dev, int ch) +static void up_send(FAR struct uart_dev_s *dev, int ch) { z80_lowputc(ch); } @@ -280,7 +280,7 @@ static void up_send(struct uart_dev_s *dev, int ch) * ****************************************************************************/ -static void up_txint(struct uart_dev_s *dev, bool enable) +static void up_txint(FAR struct uart_dev_s *dev, bool enable) { } @@ -292,7 +292,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) * ****************************************************************************/ -static bool up_txready(struct uart_dev_s *dev) +static bool up_txready(FAR struct uart_dev_s *dev) { return true; } @@ -305,7 +305,7 @@ static bool up_txready(struct uart_dev_s *dev) * ****************************************************************************/ -static bool up_txempty(struct uart_dev_s *dev) +static bool up_txempty(FAR struct uart_dev_s *dev) { return true; } -- cgit v1.2.3 From c5d9112de113f09613684d58f1b41fdf0c36def6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 8 Dec 2012 16:37:43 +0000 Subject: Add tools/link.bat, unlink.bat, and copydir.bat git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5419 42af7a65-404d-4744-a932-0658087f49c3 --- misc/pascal/nuttx/Makefile | 2 +- nuttx/ChangeLog | 4 + nuttx/Documentation/NuttX.html | 4 +- nuttx/Documentation/NuttxPortingGuide.html | 2 +- nuttx/configs/amber/hello/Make.defs | 2 +- nuttx/configs/avr32dev1/nsh/Make.defs | 2 +- nuttx/configs/avr32dev1/ostest/Make.defs | 2 +- nuttx/configs/cloudctrl/nsh/Make.defs | 2 +- nuttx/configs/demo9s12ne64/ostest/Make.defs | 2 +- nuttx/configs/ea3131/nsh/Make.defs | 2 +- nuttx/configs/ea3131/ostest/Make.defs | 2 +- nuttx/configs/ea3131/pgnsh/Make.defs | 2 +- nuttx/configs/ea3131/usbserial/Make.defs | 2 +- nuttx/configs/ea3131/usbstorage/Make.defs | 2 +- nuttx/configs/ea3152/ostest/Make.defs | 2 +- nuttx/configs/eagle100/httpd/Make.defs | 2 +- nuttx/configs/eagle100/nettest/Make.defs | 2 +- nuttx/configs/eagle100/nsh/Make.defs | 2 +- nuttx/configs/eagle100/nxflat/Make.defs | 2 +- nuttx/configs/eagle100/ostest/Make.defs | 2 +- nuttx/configs/eagle100/thttpd/Make.defs | 2 +- nuttx/configs/ekk-lm3s9b96/nsh/Make.defs | 2 +- nuttx/configs/ekk-lm3s9b96/ostest/Make.defs | 2 +- nuttx/configs/ez80f910200kitg/ostest/Make.defs | 2 +- nuttx/configs/ez80f910200zco/dhcpd/Make.defs | 2 +- nuttx/configs/ez80f910200zco/httpd/Make.defs | 2 +- nuttx/configs/ez80f910200zco/nettest/Make.defs | 2 +- nuttx/configs/ez80f910200zco/nsh/Make.defs | 2 +- nuttx/configs/ez80f910200zco/ostest/Make.defs | 2 +- nuttx/configs/ez80f910200zco/poll/Make.defs | 2 +- nuttx/configs/fire-stm32v2/nsh/Make.defs | 2 +- nuttx/configs/hymini-stm32v/buttons/Make.defs | 2 +- nuttx/configs/hymini-stm32v/nsh/Make.defs | 2 +- nuttx/configs/hymini-stm32v/nsh2/Make.defs | 2 +- nuttx/configs/hymini-stm32v/nx/Make.defs | 2 +- nuttx/configs/hymini-stm32v/nxlines/Make.defs | 2 +- nuttx/configs/hymini-stm32v/usbserial/Make.defs | 2 +- nuttx/configs/hymini-stm32v/usbstorage/Make.defs | 2 +- nuttx/configs/kwikstik-k40/ostest/Make.defs | 2 +- nuttx/configs/lincoln60/nsh/Make.defs | 2 +- nuttx/configs/lincoln60/ostest/Make.defs | 2 +- nuttx/configs/lm3s6432-s2e/nsh/Make.defs | 2 +- nuttx/configs/lm3s6432-s2e/ostest/Make.defs | 2 +- nuttx/configs/lm3s6965-ek/nsh/Make.defs | 2 +- nuttx/configs/lm3s6965-ek/nx/Make.defs | 2 +- nuttx/configs/lm3s6965-ek/ostest/Make.defs | 2 +- nuttx/configs/lm3s8962-ek/nsh/Make.defs | 2 +- nuttx/configs/lm3s8962-ek/nx/Make.defs | 2 +- nuttx/configs/lm3s8962-ek/ostest/Make.defs | 2 +- nuttx/configs/lpc4330-xplorer/nsh/Make.defs | 2 +- nuttx/configs/lpc4330-xplorer/ostest/Make.defs | 2 +- nuttx/configs/lpcxpresso-lpc1768/dhcpd/Make.defs | 2 +- nuttx/configs/lpcxpresso-lpc1768/nsh/Make.defs | 2 +- nuttx/configs/lpcxpresso-lpc1768/nx/Make.defs | 2 +- nuttx/configs/lpcxpresso-lpc1768/ostest/Make.defs | 2 +- nuttx/configs/lpcxpresso-lpc1768/thttpd/Make.defs | 2 +- .../lpcxpresso-lpc1768/usbstorage/Make.defs | 2 +- nuttx/configs/mbed/hidkbd/Make.defs | 2 +- nuttx/configs/mbed/nsh/Make.defs | 2 +- nuttx/configs/mcu123-lpc214x/composite/Make.defs | 2 +- nuttx/configs/mcu123-lpc214x/nsh/Make.defs | 2 +- nuttx/configs/mcu123-lpc214x/ostest/Make.defs | 2 +- nuttx/configs/mcu123-lpc214x/usbserial/Make.defs | 2 +- nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs | 2 +- nuttx/configs/micropendous3/hello/Make.defs | 2 +- nuttx/configs/mirtoo/nsh/Make.defs | 2 +- nuttx/configs/mirtoo/nxffs/Make.defs | 2 +- nuttx/configs/mirtoo/ostest/Make.defs | 2 +- nuttx/configs/ne64badge/ostest/Make.defs | 2 +- nuttx/configs/ntosd-dm320/nettest/Make.defs | 2 +- nuttx/configs/ntosd-dm320/nsh/Make.defs | 2 +- nuttx/configs/ntosd-dm320/ostest/Make.defs | 2 +- nuttx/configs/ntosd-dm320/poll/Make.defs | 2 +- nuttx/configs/ntosd-dm320/thttpd/Make.defs | 2 +- nuttx/configs/ntosd-dm320/udp/Make.defs | 2 +- nuttx/configs/ntosd-dm320/uip/Make.defs | 2 +- nuttx/configs/nucleus2g/nsh/Make.defs | 2 +- nuttx/configs/nucleus2g/ostest/Make.defs | 2 +- nuttx/configs/nucleus2g/usbserial/Make.defs | 2 +- nuttx/configs/nucleus2g/usbstorage/Make.defs | 2 +- nuttx/configs/olimex-lpc1766stk/ftpc/Make.defs | 2 +- nuttx/configs/olimex-lpc1766stk/hidkbd/Make.defs | 2 +- nuttx/configs/olimex-lpc1766stk/nettest/Make.defs | 2 +- nuttx/configs/olimex-lpc1766stk/nsh/Make.defs | 2 +- nuttx/configs/olimex-lpc1766stk/nx/Make.defs | 2 +- nuttx/configs/olimex-lpc1766stk/ostest/Make.defs | 2 +- .../configs/olimex-lpc1766stk/slip-httpd/Make.defs | 2 +- nuttx/configs/olimex-lpc1766stk/thttpd/Make.defs | 2 +- .../configs/olimex-lpc1766stk/usbserial/Make.defs | 2 +- .../configs/olimex-lpc1766stk/usbstorage/Make.defs | 2 +- nuttx/configs/olimex-lpc1766stk/wlan/Make.defs | 2 +- nuttx/configs/olimex-lpc2378/nsh/Make.defs | 2 +- nuttx/configs/olimex-lpc2378/ostest/Make.defs | 2 +- nuttx/configs/olimex-stm32-p107/nsh/Make.defs | 2 +- nuttx/configs/olimex-stm32-p107/ostest/Make.defs | 2 +- nuttx/configs/olimex-strp711/nettest/Make.defs | 2 +- nuttx/configs/olimex-strp711/nsh/Make.defs | 2 +- nuttx/configs/olimex-strp711/ostest/Make.defs | 2 +- nuttx/configs/pcblogic-pic32mx/nsh/Make.defs | 2 +- nuttx/configs/pcblogic-pic32mx/ostest/Make.defs | 2 +- nuttx/configs/pic32-starterkit/nsh/Make.defs | 2 +- nuttx/configs/pic32-starterkit/nsh2/Make.defs | 2 +- nuttx/configs/pic32-starterkit/ostest/Make.defs | 2 +- nuttx/configs/pic32mx7mmb/nsh/Make.defs | 2 +- nuttx/configs/pic32mx7mmb/ostest/Make.defs | 2 +- nuttx/configs/qemu-i486/nsh/Make.defs | 2 +- nuttx/configs/qemu-i486/ostest/Make.defs | 2 +- nuttx/configs/sam3u-ek/knsh/Make.defs | 2 +- nuttx/configs/sam3u-ek/nsh/Make.defs | 2 +- nuttx/configs/sam3u-ek/nx/Make.defs | 2 +- nuttx/configs/sam3u-ek/ostest/Make.defs | 2 +- nuttx/configs/sam3u-ek/touchscreen/Make.defs | 2 +- nuttx/configs/shenzhou/nsh/Make.defs | 2 +- nuttx/configs/shenzhou/nxwm/Make.defs | 2 +- nuttx/configs/shenzhou/thttpd/Make.defs | 2 +- nuttx/configs/stm3210e-eval/RIDE/Make.defs | 2 +- nuttx/configs/stm3210e-eval/buttons/Make.defs | 2 +- nuttx/configs/stm3210e-eval/composite/Make.defs | 2 +- nuttx/configs/stm3210e-eval/nsh/Make.defs | 2 +- nuttx/configs/stm3210e-eval/nsh2/Make.defs | 2 +- nuttx/configs/stm3210e-eval/nx/Make.defs | 2 +- nuttx/configs/stm3210e-eval/nxconsole/Make.defs | 2 +- nuttx/configs/stm3210e-eval/nxlines/Make.defs | 2 +- nuttx/configs/stm3210e-eval/nxtext/Make.defs | 2 +- nuttx/configs/stm3210e-eval/ostest/Make.defs | 2 +- nuttx/configs/stm3210e-eval/pm/Make.defs | 2 +- nuttx/configs/stm3210e-eval/usbserial/Make.defs | 2 +- nuttx/configs/stm3210e-eval/usbstorage/Make.defs | 2 +- nuttx/configs/stm3220g-eval/dhcpd/Make.defs | 2 +- nuttx/configs/stm3220g-eval/nettest/Make.defs | 2 +- nuttx/configs/stm3220g-eval/nsh/Make.defs | 2 +- nuttx/configs/stm3220g-eval/nsh2/Make.defs | 2 +- nuttx/configs/stm3220g-eval/nxwm/Make.defs | 2 +- nuttx/configs/stm3220g-eval/ostest/Make.defs | 2 +- nuttx/configs/stm3220g-eval/telnetd/Make.defs | 2 +- nuttx/configs/stm3240g-eval/dhcpd/Make.defs | 2 +- nuttx/configs/stm3240g-eval/discover/Make.defs | 2 +- nuttx/configs/stm3240g-eval/nettest/Make.defs | 2 +- nuttx/configs/stm3240g-eval/nsh/Make.defs | 2 +- nuttx/configs/stm3240g-eval/nsh2/Make.defs | 2 +- nuttx/configs/stm3240g-eval/nxconsole/Make.defs | 2 +- nuttx/configs/stm3240g-eval/nxwm/Make.defs | 2 +- nuttx/configs/stm3240g-eval/ostest/Make.defs | 2 +- nuttx/configs/stm3240g-eval/telnetd/Make.defs | 2 +- nuttx/configs/stm3240g-eval/webserver/Make.defs | 2 +- nuttx/configs/stm3240g-eval/xmlrpc/Make.defs | 2 +- nuttx/configs/stm32f100rc_generic/nsh/Make.defs | 2 +- nuttx/configs/stm32f100rc_generic/ostest/Make.defs | 2 +- nuttx/configs/stm32f4discovery/cxxtest/Make.defs | 2 +- nuttx/configs/stm32f4discovery/elf/Make.defs | 2 +- nuttx/configs/stm32f4discovery/nsh/Make.defs | 2 +- nuttx/configs/stm32f4discovery/nxlines/Make.defs | 2 +- nuttx/configs/stm32f4discovery/ostest/Make.defs | 2 +- nuttx/configs/stm32f4discovery/pm/Make.defs | 2 +- nuttx/configs/sure-pic32mx/nsh/Make.defs | 2 +- nuttx/configs/sure-pic32mx/ostest/Make.defs | 2 +- nuttx/configs/sure-pic32mx/usbnsh/Make.defs | 2 +- nuttx/configs/teensy/hello/Make.defs | 2 +- nuttx/configs/teensy/nsh/Make.defs | 2 +- nuttx/configs/teensy/usbstorage/Make.defs | 2 +- nuttx/configs/twr-k60n512/nsh/Make.defs | 2 +- nuttx/configs/twr-k60n512/ostest/Make.defs | 2 +- nuttx/configs/ubw32/nsh/Make.defs | 2 +- nuttx/configs/ubw32/ostest/Make.defs | 2 +- nuttx/configs/vsn/nsh/Make.defs | 2 +- nuttx/configs/xtrs/nsh/Make.defs | 16 +++- nuttx/configs/xtrs/ostest/Make.defs | 16 +++- nuttx/configs/xtrs/pashello/Make.defs | 16 +++- nuttx/configs/z16f2800100zcog/ostest/Make.defs | 2 +- nuttx/configs/z16f2800100zcog/pashello/Make.defs | 2 +- nuttx/configs/z80sim/nsh/Make.defs | 16 +++- nuttx/configs/z80sim/ostest/Make.defs | 16 +++- nuttx/configs/z80sim/pashello/Make.defs | 16 +++- nuttx/configs/z80sim/pashello/defconfig | 4 +- nuttx/configs/z8encore000zco/ostest/Make.defs | 2 +- nuttx/configs/z8f64200100kit/ostest/Make.defs | 2 +- nuttx/tools/README.txt | 28 ++++-- nuttx/tools/copydir.bat | 102 +++++++++++++++++++++ nuttx/tools/copydir.sh | 102 +++++++++++++++++++++ nuttx/tools/link.bat | 89 ++++++++++++++++++ nuttx/tools/unlink.bat | 71 ++++++++++++++ nuttx/tools/winlink.sh | 102 --------------------- 182 files changed, 636 insertions(+), 300 deletions(-) create mode 100755 nuttx/tools/copydir.bat create mode 100755 nuttx/tools/copydir.sh create mode 100755 nuttx/tools/link.bat create mode 100755 nuttx/tools/unlink.bat delete mode 100755 nuttx/tools/winlink.sh (limited to 'nuttx') diff --git a/misc/pascal/nuttx/Makefile b/misc/pascal/nuttx/Makefile index cfabb1424..66a34b1b7 100644 --- a/misc/pascal/nuttx/Makefile +++ b/misc/pascal/nuttx/Makefile @@ -111,7 +111,7 @@ $(APPDIR)$(DELIM)include$(DELIM)pcode$(DELIM)insn: $(APPDIR)$(DELIM)include$(DEL @$(DIRLINK) $(PCODEDIR)$(DELIM)insn$(DELIM)include $(APPDIR)$(DELIM)include$(DELIM)pcode$(DELIM)insn .built: $(APPDIR)$(DELIM)include$(DELIM)pcode $(APPDIR)$(DELIM)include$(DELIM)pcode$(DELIM)insn $(OBJS) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built context: $(APPDIR)$(DELIM)include$(DELIM)pcode $(APPDIR)$(DELIM)include$(DELIM)pcode$(DELIM)insn diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 37dbc3076..0bf9ec971 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3764,3 +3764,7 @@ * configs/z80sim/nsh and pashello: Converted to (1) used the kconfig-frontends configuration tool, and (2) to build natively under Windows. The NSH configuration is verified; the pashello configuration needs a more TLC. + * tools/copydir.sh: Rename tools/winlink.sh to tools/copydir.sh + * tools/link.bat, unlink.bat, and copydir.bat: Add Windows counterparts + to the link.sh, unlink.sh, and copydir.sh Bash scripts. + diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index 154e5aa2b..49f48d2d6 100644 --- a/nuttx/Documentation/NuttX.html +++ b/nuttx/Documentation/NuttX.html @@ -2957,7 +2957,7 @@ avr, m68k, m68hc11, m68hc12, m9s12, blackfin, m32c, h8, and SuperH ports.

NOTE: In this environment, it should be possible to use the NTFS mklink command to create links. - This should only require a minor modification to the build scripts (see tools/winlink.sh script). + This should only require a minor modification to the build scripts (see tools/copydir.sh script).

  • Dependencies @@ -3057,7 +3057,7 @@ if [ -x "$WINELOADER" ]; then exec "$WINELOADER" "$appname" "$@"; fi NOTE: One of the members on the NuttX forum reported that they successful built NuttX using such a GNUWin32-based, Windows native environment. They reported that the only necessary change was to the use the NTFS mklink command to create links - (see tools/winlink.sh script). + (see tools/copydir.sh script).

    diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html index 50cc0ace5..c3f6286df 100644 --- a/nuttx/Documentation/NuttxPortingGuide.html +++ b/nuttx/Documentation/NuttxPortingGuide.html @@ -1264,6 +1264,7 @@ tools/ |-- configure.sh |-- cfgparser.c |-- cfgparser.h +|-- copydir.sh |-- define.sh |-- incdir.sh |-- indent.sh @@ -1278,7 +1279,6 @@ tools/ |-- mkversion.c |-- unlink.sh |-- version.sh -|-- winlink.sh `-- zipme.sh diff --git a/nuttx/configs/amber/hello/Make.defs b/nuttx/configs/amber/hello/Make.defs index e7f998dc7..f99ad6d5b 100644 --- a/nuttx/configs/amber/hello/Make.defs +++ b/nuttx/configs/amber/hello/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/avr/src/avr/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/avr32dev1/nsh/Make.defs b/nuttx/configs/avr32dev1/nsh/Make.defs index bccb35069..85705a297 100644 --- a/nuttx/configs/avr32dev1/nsh/Make.defs +++ b/nuttx/configs/avr32dev1/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/avr/src/avr32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/avr32dev1/ostest/Make.defs b/nuttx/configs/avr32dev1/ostest/Make.defs index ab8c9cd36..8dc6b8f40 100644 --- a/nuttx/configs/avr32dev1/ostest/Make.defs +++ b/nuttx/configs/avr32dev1/ostest/Make.defs @@ -52,7 +52,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/cloudctrl/nsh/Make.defs b/nuttx/configs/cloudctrl/nsh/Make.defs index 2b5302947..872fd450c 100644 --- a/nuttx/configs/cloudctrl/nsh/Make.defs +++ b/nuttx/configs/cloudctrl/nsh/Make.defs @@ -47,7 +47,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/demo9s12ne64/ostest/Make.defs b/nuttx/configs/demo9s12ne64/ostest/Make.defs index e6fdb9952..ca00a0858 100644 --- a/nuttx/configs/demo9s12ne64/ostest/Make.defs +++ b/nuttx/configs/demo9s12ne64/ostest/Make.defs @@ -57,7 +57,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ea3131/nsh/Make.defs b/nuttx/configs/ea3131/nsh/Make.defs index 1bfd6f4d5..50ba85e25 100644 --- a/nuttx/configs/ea3131/nsh/Make.defs +++ b/nuttx/configs/ea3131/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ea3131/ostest/Make.defs b/nuttx/configs/ea3131/ostest/Make.defs index 9c8780a4a..1a70009f1 100644 --- a/nuttx/configs/ea3131/ostest/Make.defs +++ b/nuttx/configs/ea3131/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ea3131/pgnsh/Make.defs b/nuttx/configs/ea3131/pgnsh/Make.defs index f71a0920e..c36788bfe 100644 --- a/nuttx/configs/ea3131/pgnsh/Make.defs +++ b/nuttx/configs/ea3131/pgnsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ea3131/usbserial/Make.defs b/nuttx/configs/ea3131/usbserial/Make.defs index 1b1eb45d5..bb6814ea5 100644 --- a/nuttx/configs/ea3131/usbserial/Make.defs +++ b/nuttx/configs/ea3131/usbserial/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ea3131/usbstorage/Make.defs b/nuttx/configs/ea3131/usbstorage/Make.defs index 7155ccf5c..f12e55a75 100644 --- a/nuttx/configs/ea3131/usbstorage/Make.defs +++ b/nuttx/configs/ea3131/usbstorage/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ea3152/ostest/Make.defs b/nuttx/configs/ea3152/ostest/Make.defs index 45168938a..d8ac0ef43 100644 --- a/nuttx/configs/ea3152/ostest/Make.defs +++ b/nuttx/configs/ea3152/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/eagle100/httpd/Make.defs b/nuttx/configs/eagle100/httpd/Make.defs index ef5b28ede..d1d9bb75a 100644 --- a/nuttx/configs/eagle100/httpd/Make.defs +++ b/nuttx/configs/eagle100/httpd/Make.defs @@ -64,7 +64,7 @@ ifeq ($(CROSSDEV),arm-nuttx-elf-) MAXOPTIMIZATION = -Os else WINTOOL = y - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft diff --git a/nuttx/configs/eagle100/nettest/Make.defs b/nuttx/configs/eagle100/nettest/Make.defs index ac9e7853b..d1e90251a 100644 --- a/nuttx/configs/eagle100/nettest/Make.defs +++ b/nuttx/configs/eagle100/nettest/Make.defs @@ -64,7 +64,7 @@ ifeq ($(CROSSDEV),arm-nuttx-elf-) MAXOPTIMIZATION = -Os else WINTOOL = y - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft diff --git a/nuttx/configs/eagle100/nsh/Make.defs b/nuttx/configs/eagle100/nsh/Make.defs index 3bc31ce77..f563efd5a 100644 --- a/nuttx/configs/eagle100/nsh/Make.defs +++ b/nuttx/configs/eagle100/nsh/Make.defs @@ -64,7 +64,7 @@ ifeq ($(CROSSDEV),arm-nuttx-elf-) MAXOPTIMIZATION = -Os else WINTOOL = y - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft diff --git a/nuttx/configs/eagle100/nxflat/Make.defs b/nuttx/configs/eagle100/nxflat/Make.defs index 2c8aa9c44..937cba0d8 100644 --- a/nuttx/configs/eagle100/nxflat/Make.defs +++ b/nuttx/configs/eagle100/nxflat/Make.defs @@ -67,7 +67,7 @@ ifeq ($(CROSSDEV),arm-nuttx-elf-) MAXOPTIMIZATION = -Os else WINTOOL = y - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft diff --git a/nuttx/configs/eagle100/ostest/Make.defs b/nuttx/configs/eagle100/ostest/Make.defs index 4eb37853b..c9c7146a7 100644 --- a/nuttx/configs/eagle100/ostest/Make.defs +++ b/nuttx/configs/eagle100/ostest/Make.defs @@ -64,7 +64,7 @@ ifeq ($(CROSSDEV),arm-nuttx-elf-) MAXOPTIMIZATION = -Os else WINTOOL = y - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft diff --git a/nuttx/configs/eagle100/thttpd/Make.defs b/nuttx/configs/eagle100/thttpd/Make.defs index dbdfddf1b..ac1471bbc 100644 --- a/nuttx/configs/eagle100/thttpd/Make.defs +++ b/nuttx/configs/eagle100/thttpd/Make.defs @@ -67,7 +67,7 @@ ifeq ($(CROSSDEV),arm-nuttx-elf-) MAXOPTIMIZATION = -Os else WINTOOL = y - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft diff --git a/nuttx/configs/ekk-lm3s9b96/nsh/Make.defs b/nuttx/configs/ekk-lm3s9b96/nsh/Make.defs index 930c50d2b..5735a5e07 100644 --- a/nuttx/configs/ekk-lm3s9b96/nsh/Make.defs +++ b/nuttx/configs/ekk-lm3s9b96/nsh/Make.defs @@ -40,7 +40,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ekk-lm3s9b96/ostest/Make.defs b/nuttx/configs/ekk-lm3s9b96/ostest/Make.defs index 1aa37e6df..e018d3f47 100644 --- a/nuttx/configs/ekk-lm3s9b96/ostest/Make.defs +++ b/nuttx/configs/ekk-lm3s9b96/ostest/Make.defs @@ -40,7 +40,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ez80f910200kitg/ostest/Make.defs b/nuttx/configs/ez80f910200kitg/ostest/Make.defs index c2aab3c9f..601d754f9 100644 --- a/nuttx/configs/ez80f910200kitg/ostest/Make.defs +++ b/nuttx/configs/ez80f910200kitg/ostest/Make.defs @@ -248,6 +248,6 @@ else # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif diff --git a/nuttx/configs/ez80f910200zco/dhcpd/Make.defs b/nuttx/configs/ez80f910200zco/dhcpd/Make.defs index 1ad97cffe..144400c64 100644 --- a/nuttx/configs/ez80f910200zco/dhcpd/Make.defs +++ b/nuttx/configs/ez80f910200zco/dhcpd/Make.defs @@ -248,6 +248,6 @@ else # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif diff --git a/nuttx/configs/ez80f910200zco/httpd/Make.defs b/nuttx/configs/ez80f910200zco/httpd/Make.defs index 77a5e731c..6cc369d97 100644 --- a/nuttx/configs/ez80f910200zco/httpd/Make.defs +++ b/nuttx/configs/ez80f910200zco/httpd/Make.defs @@ -248,6 +248,6 @@ else # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif diff --git a/nuttx/configs/ez80f910200zco/nettest/Make.defs b/nuttx/configs/ez80f910200zco/nettest/Make.defs index c0d7c2f1d..13bf4476e 100644 --- a/nuttx/configs/ez80f910200zco/nettest/Make.defs +++ b/nuttx/configs/ez80f910200zco/nettest/Make.defs @@ -248,6 +248,6 @@ else # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif diff --git a/nuttx/configs/ez80f910200zco/nsh/Make.defs b/nuttx/configs/ez80f910200zco/nsh/Make.defs index 258e8a5dc..550e1cf03 100644 --- a/nuttx/configs/ez80f910200zco/nsh/Make.defs +++ b/nuttx/configs/ez80f910200zco/nsh/Make.defs @@ -248,6 +248,6 @@ else # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif diff --git a/nuttx/configs/ez80f910200zco/ostest/Make.defs b/nuttx/configs/ez80f910200zco/ostest/Make.defs index e61e328bc..51d40c0bb 100644 --- a/nuttx/configs/ez80f910200zco/ostest/Make.defs +++ b/nuttx/configs/ez80f910200zco/ostest/Make.defs @@ -248,6 +248,6 @@ else # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif diff --git a/nuttx/configs/ez80f910200zco/poll/Make.defs b/nuttx/configs/ez80f910200zco/poll/Make.defs index c6cbd4616..5149161fe 100644 --- a/nuttx/configs/ez80f910200zco/poll/Make.defs +++ b/nuttx/configs/ez80f910200zco/poll/Make.defs @@ -248,6 +248,6 @@ else # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif diff --git a/nuttx/configs/fire-stm32v2/nsh/Make.defs b/nuttx/configs/fire-stm32v2/nsh/Make.defs index 6022fac75..61d07af04 100644 --- a/nuttx/configs/fire-stm32v2/nsh/Make.defs +++ b/nuttx/configs/fire-stm32v2/nsh/Make.defs @@ -47,7 +47,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/hymini-stm32v/buttons/Make.defs b/nuttx/configs/hymini-stm32v/buttons/Make.defs index 73ad7f66e..68006d271 100644 --- a/nuttx/configs/hymini-stm32v/buttons/Make.defs +++ b/nuttx/configs/hymini-stm32v/buttons/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/hymini-stm32v/nsh/Make.defs b/nuttx/configs/hymini-stm32v/nsh/Make.defs index bb92fd59f..2aea64f3d 100644 --- a/nuttx/configs/hymini-stm32v/nsh/Make.defs +++ b/nuttx/configs/hymini-stm32v/nsh/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/hymini-stm32v/nsh2/Make.defs b/nuttx/configs/hymini-stm32v/nsh2/Make.defs index 6ba30422e..8fb688745 100644 --- a/nuttx/configs/hymini-stm32v/nsh2/Make.defs +++ b/nuttx/configs/hymini-stm32v/nsh2/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/hymini-stm32v/nx/Make.defs b/nuttx/configs/hymini-stm32v/nx/Make.defs index 7af7f8246..28518874c 100644 --- a/nuttx/configs/hymini-stm32v/nx/Make.defs +++ b/nuttx/configs/hymini-stm32v/nx/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/hymini-stm32v/nxlines/Make.defs b/nuttx/configs/hymini-stm32v/nxlines/Make.defs index 9f00a4939..d4e01da7a 100644 --- a/nuttx/configs/hymini-stm32v/nxlines/Make.defs +++ b/nuttx/configs/hymini-stm32v/nxlines/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/hymini-stm32v/usbserial/Make.defs b/nuttx/configs/hymini-stm32v/usbserial/Make.defs index c514e9b53..0ed8654fd 100644 --- a/nuttx/configs/hymini-stm32v/usbserial/Make.defs +++ b/nuttx/configs/hymini-stm32v/usbserial/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/hymini-stm32v/usbstorage/Make.defs b/nuttx/configs/hymini-stm32v/usbstorage/Make.defs index a3b6d5595..d68ed325a 100644 --- a/nuttx/configs/hymini-stm32v/usbstorage/Make.defs +++ b/nuttx/configs/hymini-stm32v/usbstorage/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/kwikstik-k40/ostest/Make.defs b/nuttx/configs/kwikstik-k40/ostest/Make.defs index 45d30d320..8a6d8d2e5 100644 --- a/nuttx/configs/kwikstik-k40/ostest/Make.defs +++ b/nuttx/configs/kwikstik-k40/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lincoln60/nsh/Make.defs b/nuttx/configs/lincoln60/nsh/Make.defs index 6d8029367..a419832df 100644 --- a/nuttx/configs/lincoln60/nsh/Make.defs +++ b/nuttx/configs/lincoln60/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lincoln60/ostest/Make.defs b/nuttx/configs/lincoln60/ostest/Make.defs index 6c8db3531..cd67cb29b 100644 --- a/nuttx/configs/lincoln60/ostest/Make.defs +++ b/nuttx/configs/lincoln60/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lm3s6432-s2e/nsh/Make.defs b/nuttx/configs/lm3s6432-s2e/nsh/Make.defs index e39eb4447..aaaed140b 100644 --- a/nuttx/configs/lm3s6432-s2e/nsh/Make.defs +++ b/nuttx/configs/lm3s6432-s2e/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lm3s6432-s2e/ostest/Make.defs b/nuttx/configs/lm3s6432-s2e/ostest/Make.defs index 94285fc78..32bbc2801 100644 --- a/nuttx/configs/lm3s6432-s2e/ostest/Make.defs +++ b/nuttx/configs/lm3s6432-s2e/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lm3s6965-ek/nsh/Make.defs b/nuttx/configs/lm3s6965-ek/nsh/Make.defs index b25c1be62..6aaec391b 100644 --- a/nuttx/configs/lm3s6965-ek/nsh/Make.defs +++ b/nuttx/configs/lm3s6965-ek/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lm3s6965-ek/nx/Make.defs b/nuttx/configs/lm3s6965-ek/nx/Make.defs index 0b0e668f9..a39737c2e 100644 --- a/nuttx/configs/lm3s6965-ek/nx/Make.defs +++ b/nuttx/configs/lm3s6965-ek/nx/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lm3s6965-ek/ostest/Make.defs b/nuttx/configs/lm3s6965-ek/ostest/Make.defs index 8dcc94b3f..8b4af6486 100644 --- a/nuttx/configs/lm3s6965-ek/ostest/Make.defs +++ b/nuttx/configs/lm3s6965-ek/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lm3s8962-ek/nsh/Make.defs b/nuttx/configs/lm3s8962-ek/nsh/Make.defs index fc7216f22..f464bbdc0 100644 --- a/nuttx/configs/lm3s8962-ek/nsh/Make.defs +++ b/nuttx/configs/lm3s8962-ek/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lm3s8962-ek/nx/Make.defs b/nuttx/configs/lm3s8962-ek/nx/Make.defs index bab1ab565..a79386a9f 100644 --- a/nuttx/configs/lm3s8962-ek/nx/Make.defs +++ b/nuttx/configs/lm3s8962-ek/nx/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lm3s8962-ek/ostest/Make.defs b/nuttx/configs/lm3s8962-ek/ostest/Make.defs index c19c7e91f..f91228471 100644 --- a/nuttx/configs/lm3s8962-ek/ostest/Make.defs +++ b/nuttx/configs/lm3s8962-ek/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lpc4330-xplorer/nsh/Make.defs b/nuttx/configs/lpc4330-xplorer/nsh/Make.defs index 49cec5552..acdff005a 100644 --- a/nuttx/configs/lpc4330-xplorer/nsh/Make.defs +++ b/nuttx/configs/lpc4330-xplorer/nsh/Make.defs @@ -59,7 +59,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lpc4330-xplorer/ostest/Make.defs b/nuttx/configs/lpc4330-xplorer/ostest/Make.defs index 49cec5552..acdff005a 100644 --- a/nuttx/configs/lpc4330-xplorer/ostest/Make.defs +++ b/nuttx/configs/lpc4330-xplorer/ostest/Make.defs @@ -59,7 +59,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lpcxpresso-lpc1768/dhcpd/Make.defs b/nuttx/configs/lpcxpresso-lpc1768/dhcpd/Make.defs index 0f6b8914a..c20ecb142 100644 --- a/nuttx/configs/lpcxpresso-lpc1768/dhcpd/Make.defs +++ b/nuttx/configs/lpcxpresso-lpc1768/dhcpd/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lpcxpresso-lpc1768/nsh/Make.defs b/nuttx/configs/lpcxpresso-lpc1768/nsh/Make.defs index 84cec7399..a0b7d2867 100644 --- a/nuttx/configs/lpcxpresso-lpc1768/nsh/Make.defs +++ b/nuttx/configs/lpcxpresso-lpc1768/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lpcxpresso-lpc1768/nx/Make.defs b/nuttx/configs/lpcxpresso-lpc1768/nx/Make.defs index 4e17bd90a..0d7b86e64 100644 --- a/nuttx/configs/lpcxpresso-lpc1768/nx/Make.defs +++ b/nuttx/configs/lpcxpresso-lpc1768/nx/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lpcxpresso-lpc1768/ostest/Make.defs b/nuttx/configs/lpcxpresso-lpc1768/ostest/Make.defs index ad40aa69b..3c977c787 100644 --- a/nuttx/configs/lpcxpresso-lpc1768/ostest/Make.defs +++ b/nuttx/configs/lpcxpresso-lpc1768/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lpcxpresso-lpc1768/thttpd/Make.defs b/nuttx/configs/lpcxpresso-lpc1768/thttpd/Make.defs index b9ba57b0d..7727b3117 100644 --- a/nuttx/configs/lpcxpresso-lpc1768/thttpd/Make.defs +++ b/nuttx/configs/lpcxpresso-lpc1768/thttpd/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/lpcxpresso-lpc1768/usbstorage/Make.defs b/nuttx/configs/lpcxpresso-lpc1768/usbstorage/Make.defs index bb63eeec7..122c94fc7 100644 --- a/nuttx/configs/lpcxpresso-lpc1768/usbstorage/Make.defs +++ b/nuttx/configs/lpcxpresso-lpc1768/usbstorage/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/mbed/hidkbd/Make.defs b/nuttx/configs/mbed/hidkbd/Make.defs index 58652c1ef..1cfb29e86 100644 --- a/nuttx/configs/mbed/hidkbd/Make.defs +++ b/nuttx/configs/mbed/hidkbd/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/mbed/nsh/Make.defs b/nuttx/configs/mbed/nsh/Make.defs index 0c6292e35..9eb0cb279 100644 --- a/nuttx/configs/mbed/nsh/Make.defs +++ b/nuttx/configs/mbed/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/mcu123-lpc214x/composite/Make.defs b/nuttx/configs/mcu123-lpc214x/composite/Make.defs index 28dbf3157..be934cb41 100644 --- a/nuttx/configs/mcu123-lpc214x/composite/Make.defs +++ b/nuttx/configs/mcu123-lpc214x/composite/Make.defs @@ -71,7 +71,7 @@ ifeq ($(CROSSDEV),arm-nuttx-elf-) MAXOPTIMIZATION = -Os else WINTOOL = y - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/mcu123-lpc214x/nsh/Make.defs b/nuttx/configs/mcu123-lpc214x/nsh/Make.defs index d9ae7e305..0ebe367a9 100644 --- a/nuttx/configs/mcu123-lpc214x/nsh/Make.defs +++ b/nuttx/configs/mcu123-lpc214x/nsh/Make.defs @@ -71,7 +71,7 @@ ifeq ($(CROSSDEV),arm-nuttx-elf-) MAXOPTIMIZATION = -Os else WINTOOL = y - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/mcu123-lpc214x/ostest/Make.defs b/nuttx/configs/mcu123-lpc214x/ostest/Make.defs index 76b9e7abb..222f56dc6 100644 --- a/nuttx/configs/mcu123-lpc214x/ostest/Make.defs +++ b/nuttx/configs/mcu123-lpc214x/ostest/Make.defs @@ -71,7 +71,7 @@ ifeq ($(CROSSDEV),arm-nuttx-elf-) MAXOPTIMIZATION = -Os else WINTOOL = y - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs b/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs index 5490d690f..a470ef8e7 100644 --- a/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs +++ b/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs @@ -71,7 +71,7 @@ ifeq ($(CROSSDEV),arm-nuttx-elf-) MAXOPTIMIZATION = -Os else WINTOOL = y - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs b/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs index 408d19c23..a645e237b 100644 --- a/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs +++ b/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs @@ -71,7 +71,7 @@ ifeq ($(CROSSDEV),arm-nuttx-elf-) MAXOPTIMIZATION = -Os else WINTOOL = y - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/micropendous3/hello/Make.defs b/nuttx/configs/micropendous3/hello/Make.defs index a40098fff..bce07fab0 100644 --- a/nuttx/configs/micropendous3/hello/Make.defs +++ b/nuttx/configs/micropendous3/hello/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/avr/src/avr/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/mirtoo/nsh/Make.defs b/nuttx/configs/mirtoo/nsh/Make.defs index 51193893c..bccebc6e9 100644 --- a/nuttx/configs/mirtoo/nsh/Make.defs +++ b/nuttx/configs/mirtoo/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/mirtoo/nxffs/Make.defs b/nuttx/configs/mirtoo/nxffs/Make.defs index 6bc3bee80..0eda67887 100644 --- a/nuttx/configs/mirtoo/nxffs/Make.defs +++ b/nuttx/configs/mirtoo/nxffs/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/mirtoo/ostest/Make.defs b/nuttx/configs/mirtoo/ostest/Make.defs index eb04d0196..e24cd7dd5 100644 --- a/nuttx/configs/mirtoo/ostest/Make.defs +++ b/nuttx/configs/mirtoo/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ne64badge/ostest/Make.defs b/nuttx/configs/ne64badge/ostest/Make.defs index 870313d73..e52d9d804 100644 --- a/nuttx/configs/ne64badge/ostest/Make.defs +++ b/nuttx/configs/ne64badge/ostest/Make.defs @@ -57,7 +57,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ntosd-dm320/nettest/Make.defs b/nuttx/configs/ntosd-dm320/nettest/Make.defs index 86dd3f815..9d2521850 100644 --- a/nuttx/configs/ntosd-dm320/nettest/Make.defs +++ b/nuttx/configs/ntosd-dm320/nettest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ntosd-dm320/nsh/Make.defs b/nuttx/configs/ntosd-dm320/nsh/Make.defs index 088dc7976..aba759407 100644 --- a/nuttx/configs/ntosd-dm320/nsh/Make.defs +++ b/nuttx/configs/ntosd-dm320/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ntosd-dm320/ostest/Make.defs b/nuttx/configs/ntosd-dm320/ostest/Make.defs index 9312ae060..8aaae829e 100644 --- a/nuttx/configs/ntosd-dm320/ostest/Make.defs +++ b/nuttx/configs/ntosd-dm320/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ntosd-dm320/poll/Make.defs b/nuttx/configs/ntosd-dm320/poll/Make.defs index fb208f85c..48e8149ed 100644 --- a/nuttx/configs/ntosd-dm320/poll/Make.defs +++ b/nuttx/configs/ntosd-dm320/poll/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ntosd-dm320/thttpd/Make.defs b/nuttx/configs/ntosd-dm320/thttpd/Make.defs index cc62a030a..08f156070 100644 --- a/nuttx/configs/ntosd-dm320/thttpd/Make.defs +++ b/nuttx/configs/ntosd-dm320/thttpd/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ntosd-dm320/udp/Make.defs b/nuttx/configs/ntosd-dm320/udp/Make.defs index 1c8893289..e72666b90 100644 --- a/nuttx/configs/ntosd-dm320/udp/Make.defs +++ b/nuttx/configs/ntosd-dm320/udp/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ntosd-dm320/uip/Make.defs b/nuttx/configs/ntosd-dm320/uip/Make.defs index 6d2a223df..72fa6dd6b 100644 --- a/nuttx/configs/ntosd-dm320/uip/Make.defs +++ b/nuttx/configs/ntosd-dm320/uip/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/nucleus2g/nsh/Make.defs b/nuttx/configs/nucleus2g/nsh/Make.defs index 7510cef3e..86cbd013e 100644 --- a/nuttx/configs/nucleus2g/nsh/Make.defs +++ b/nuttx/configs/nucleus2g/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/nucleus2g/ostest/Make.defs b/nuttx/configs/nucleus2g/ostest/Make.defs index 1c4ebf8a9..1851a03d3 100644 --- a/nuttx/configs/nucleus2g/ostest/Make.defs +++ b/nuttx/configs/nucleus2g/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/nucleus2g/usbserial/Make.defs b/nuttx/configs/nucleus2g/usbserial/Make.defs index 8cd4b0cc4..3973652ac 100644 --- a/nuttx/configs/nucleus2g/usbserial/Make.defs +++ b/nuttx/configs/nucleus2g/usbserial/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/nucleus2g/usbstorage/Make.defs b/nuttx/configs/nucleus2g/usbstorage/Make.defs index 659a5142e..8675a12e4 100644 --- a/nuttx/configs/nucleus2g/usbstorage/Make.defs +++ b/nuttx/configs/nucleus2g/usbstorage/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-lpc1766stk/ftpc/Make.defs b/nuttx/configs/olimex-lpc1766stk/ftpc/Make.defs index ce5508390..e1492bebf 100644 --- a/nuttx/configs/olimex-lpc1766stk/ftpc/Make.defs +++ b/nuttx/configs/olimex-lpc1766stk/ftpc/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-lpc1766stk/hidkbd/Make.defs b/nuttx/configs/olimex-lpc1766stk/hidkbd/Make.defs index c882ce94f..feb7065d4 100644 --- a/nuttx/configs/olimex-lpc1766stk/hidkbd/Make.defs +++ b/nuttx/configs/olimex-lpc1766stk/hidkbd/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-lpc1766stk/nettest/Make.defs b/nuttx/configs/olimex-lpc1766stk/nettest/Make.defs index e1c96eb6b..3a125842d 100644 --- a/nuttx/configs/olimex-lpc1766stk/nettest/Make.defs +++ b/nuttx/configs/olimex-lpc1766stk/nettest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-lpc1766stk/nsh/Make.defs b/nuttx/configs/olimex-lpc1766stk/nsh/Make.defs index 3312b63cd..c3d0831f2 100644 --- a/nuttx/configs/olimex-lpc1766stk/nsh/Make.defs +++ b/nuttx/configs/olimex-lpc1766stk/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-lpc1766stk/nx/Make.defs b/nuttx/configs/olimex-lpc1766stk/nx/Make.defs index 5eb7bbbb7..d2cfc4050 100644 --- a/nuttx/configs/olimex-lpc1766stk/nx/Make.defs +++ b/nuttx/configs/olimex-lpc1766stk/nx/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-lpc1766stk/ostest/Make.defs b/nuttx/configs/olimex-lpc1766stk/ostest/Make.defs index f9b164deb..fa63ea799 100644 --- a/nuttx/configs/olimex-lpc1766stk/ostest/Make.defs +++ b/nuttx/configs/olimex-lpc1766stk/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-lpc1766stk/slip-httpd/Make.defs b/nuttx/configs/olimex-lpc1766stk/slip-httpd/Make.defs index b7f9c37fd..e5fd73132 100644 --- a/nuttx/configs/olimex-lpc1766stk/slip-httpd/Make.defs +++ b/nuttx/configs/olimex-lpc1766stk/slip-httpd/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-lpc1766stk/thttpd/Make.defs b/nuttx/configs/olimex-lpc1766stk/thttpd/Make.defs index 32d0530bd..acef11b6e 100644 --- a/nuttx/configs/olimex-lpc1766stk/thttpd/Make.defs +++ b/nuttx/configs/olimex-lpc1766stk/thttpd/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-lpc1766stk/usbserial/Make.defs b/nuttx/configs/olimex-lpc1766stk/usbserial/Make.defs index 8658c457a..e0cd16c1b 100644 --- a/nuttx/configs/olimex-lpc1766stk/usbserial/Make.defs +++ b/nuttx/configs/olimex-lpc1766stk/usbserial/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-lpc1766stk/usbstorage/Make.defs b/nuttx/configs/olimex-lpc1766stk/usbstorage/Make.defs index 1d8990cb5..adb4067f0 100644 --- a/nuttx/configs/olimex-lpc1766stk/usbstorage/Make.defs +++ b/nuttx/configs/olimex-lpc1766stk/usbstorage/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-lpc1766stk/wlan/Make.defs b/nuttx/configs/olimex-lpc1766stk/wlan/Make.defs index 07bb91c09..f99c88f53 100644 --- a/nuttx/configs/olimex-lpc1766stk/wlan/Make.defs +++ b/nuttx/configs/olimex-lpc1766stk/wlan/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-lpc2378/nsh/Make.defs b/nuttx/configs/olimex-lpc2378/nsh/Make.defs index a7fce92f4..b21261fd6 100644 --- a/nuttx/configs/olimex-lpc2378/nsh/Make.defs +++ b/nuttx/configs/olimex-lpc2378/nsh/Make.defs @@ -44,7 +44,7 @@ include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-lpc2378/ostest/Make.defs b/nuttx/configs/olimex-lpc2378/ostest/Make.defs index 2d8218bad..b144104b3 100644 --- a/nuttx/configs/olimex-lpc2378/ostest/Make.defs +++ b/nuttx/configs/olimex-lpc2378/ostest/Make.defs @@ -44,7 +44,7 @@ include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-stm32-p107/nsh/Make.defs b/nuttx/configs/olimex-stm32-p107/nsh/Make.defs index 93677479f..968177254 100644 --- a/nuttx/configs/olimex-stm32-p107/nsh/Make.defs +++ b/nuttx/configs/olimex-stm32-p107/nsh/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-stm32-p107/ostest/Make.defs b/nuttx/configs/olimex-stm32-p107/ostest/Make.defs index 7a27f7755..174878c7a 100644 --- a/nuttx/configs/olimex-stm32-p107/ostest/Make.defs +++ b/nuttx/configs/olimex-stm32-p107/ostest/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-strp711/nettest/Make.defs b/nuttx/configs/olimex-strp711/nettest/Make.defs index f14c07894..e870ae150 100644 --- a/nuttx/configs/olimex-strp711/nettest/Make.defs +++ b/nuttx/configs/olimex-strp711/nettest/Make.defs @@ -71,7 +71,7 @@ ifeq ($(CROSSDEV),arm-nuttx-elf-) MAXOPTIMIZATION = -Os else WINTOOL = y - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-strp711/nsh/Make.defs b/nuttx/configs/olimex-strp711/nsh/Make.defs index a16447aec..616b13948 100644 --- a/nuttx/configs/olimex-strp711/nsh/Make.defs +++ b/nuttx/configs/olimex-strp711/nsh/Make.defs @@ -71,7 +71,7 @@ ifeq ($(CROSSDEV),arm-nuttx-elf-) MAXOPTIMIZATION = -Os else WINTOOL = y - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/olimex-strp711/ostest/Make.defs b/nuttx/configs/olimex-strp711/ostest/Make.defs index a4fe11a02..6af29537b 100644 --- a/nuttx/configs/olimex-strp711/ostest/Make.defs +++ b/nuttx/configs/olimex-strp711/ostest/Make.defs @@ -71,7 +71,7 @@ ifeq ($(CROSSDEV),arm-nuttx-elf-) MAXOPTIMIZATION = -Os else WINTOOL = y - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/pcblogic-pic32mx/nsh/Make.defs b/nuttx/configs/pcblogic-pic32mx/nsh/Make.defs index 1c709c1f8..33d80d61b 100644 --- a/nuttx/configs/pcblogic-pic32mx/nsh/Make.defs +++ b/nuttx/configs/pcblogic-pic32mx/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/pcblogic-pic32mx/ostest/Make.defs b/nuttx/configs/pcblogic-pic32mx/ostest/Make.defs index ee8661d91..f7e9d8c9e 100644 --- a/nuttx/configs/pcblogic-pic32mx/ostest/Make.defs +++ b/nuttx/configs/pcblogic-pic32mx/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/pic32-starterkit/nsh/Make.defs b/nuttx/configs/pic32-starterkit/nsh/Make.defs index 7e4f5d43e..3bd11e722 100644 --- a/nuttx/configs/pic32-starterkit/nsh/Make.defs +++ b/nuttx/configs/pic32-starterkit/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/pic32-starterkit/nsh2/Make.defs b/nuttx/configs/pic32-starterkit/nsh2/Make.defs index 4d29bc904..9f280f51e 100644 --- a/nuttx/configs/pic32-starterkit/nsh2/Make.defs +++ b/nuttx/configs/pic32-starterkit/nsh2/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/pic32-starterkit/ostest/Make.defs b/nuttx/configs/pic32-starterkit/ostest/Make.defs index 942ec383f..28a451f19 100644 --- a/nuttx/configs/pic32-starterkit/ostest/Make.defs +++ b/nuttx/configs/pic32-starterkit/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/pic32mx7mmb/nsh/Make.defs b/nuttx/configs/pic32mx7mmb/nsh/Make.defs index cf3bd8db2..5690aaa7b 100644 --- a/nuttx/configs/pic32mx7mmb/nsh/Make.defs +++ b/nuttx/configs/pic32mx7mmb/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/pic32mx7mmb/ostest/Make.defs b/nuttx/configs/pic32mx7mmb/ostest/Make.defs index 808f12193..c20a749dd 100644 --- a/nuttx/configs/pic32mx7mmb/ostest/Make.defs +++ b/nuttx/configs/pic32mx7mmb/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/qemu-i486/nsh/Make.defs b/nuttx/configs/qemu-i486/nsh/Make.defs index dd518a5af..4fb1ba3a2 100644 --- a/nuttx/configs/qemu-i486/nsh/Make.defs +++ b/nuttx/configs/qemu-i486/nsh/Make.defs @@ -46,7 +46,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/qemu-i486/ostest/Make.defs b/nuttx/configs/qemu-i486/ostest/Make.defs index 7bec9327b..7e0b3ae46 100644 --- a/nuttx/configs/qemu-i486/ostest/Make.defs +++ b/nuttx/configs/qemu-i486/ostest/Make.defs @@ -46,7 +46,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/sam3u-ek/knsh/Make.defs b/nuttx/configs/sam3u-ek/knsh/Make.defs index f387da600..f875f2b4e 100644 --- a/nuttx/configs/sam3u-ek/knsh/Make.defs +++ b/nuttx/configs/sam3u-ek/knsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/sam3u-ek/nsh/Make.defs b/nuttx/configs/sam3u-ek/nsh/Make.defs index b4313cdec..24f57c201 100644 --- a/nuttx/configs/sam3u-ek/nsh/Make.defs +++ b/nuttx/configs/sam3u-ek/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/sam3u-ek/nx/Make.defs b/nuttx/configs/sam3u-ek/nx/Make.defs index 67b0191f4..71f8506ae 100644 --- a/nuttx/configs/sam3u-ek/nx/Make.defs +++ b/nuttx/configs/sam3u-ek/nx/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/sam3u-ek/ostest/Make.defs b/nuttx/configs/sam3u-ek/ostest/Make.defs index ff119f6cd..cc61f116d 100644 --- a/nuttx/configs/sam3u-ek/ostest/Make.defs +++ b/nuttx/configs/sam3u-ek/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/sam3u-ek/touchscreen/Make.defs b/nuttx/configs/sam3u-ek/touchscreen/Make.defs index 749ffbbc3..436d316c8 100644 --- a/nuttx/configs/sam3u-ek/touchscreen/Make.defs +++ b/nuttx/configs/sam3u-ek/touchscreen/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/shenzhou/nsh/Make.defs b/nuttx/configs/shenzhou/nsh/Make.defs index 3e7ef5db7..7e42b0763 100644 --- a/nuttx/configs/shenzhou/nsh/Make.defs +++ b/nuttx/configs/shenzhou/nsh/Make.defs @@ -47,7 +47,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/shenzhou/nxwm/Make.defs b/nuttx/configs/shenzhou/nxwm/Make.defs index c162ebdd1..cfcec0835 100644 --- a/nuttx/configs/shenzhou/nxwm/Make.defs +++ b/nuttx/configs/shenzhou/nxwm/Make.defs @@ -47,7 +47,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/shenzhou/thttpd/Make.defs b/nuttx/configs/shenzhou/thttpd/Make.defs index c8658035b..7b06f4282 100644 --- a/nuttx/configs/shenzhou/thttpd/Make.defs +++ b/nuttx/configs/shenzhou/thttpd/Make.defs @@ -47,7 +47,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3210e-eval/RIDE/Make.defs b/nuttx/configs/stm3210e-eval/RIDE/Make.defs index 8a53198e2..93068399e 100644 --- a/nuttx/configs/stm3210e-eval/RIDE/Make.defs +++ b/nuttx/configs/stm3210e-eval/RIDE/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3210e-eval/buttons/Make.defs b/nuttx/configs/stm3210e-eval/buttons/Make.defs index 0a14d2d94..dda7d6785 100644 --- a/nuttx/configs/stm3210e-eval/buttons/Make.defs +++ b/nuttx/configs/stm3210e-eval/buttons/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3210e-eval/composite/Make.defs b/nuttx/configs/stm3210e-eval/composite/Make.defs index 7af8b7593..35bfbd642 100644 --- a/nuttx/configs/stm3210e-eval/composite/Make.defs +++ b/nuttx/configs/stm3210e-eval/composite/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3210e-eval/nsh/Make.defs b/nuttx/configs/stm3210e-eval/nsh/Make.defs index 08c8415c0..5559c7839 100644 --- a/nuttx/configs/stm3210e-eval/nsh/Make.defs +++ b/nuttx/configs/stm3210e-eval/nsh/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3210e-eval/nsh2/Make.defs b/nuttx/configs/stm3210e-eval/nsh2/Make.defs index cd5caf8f5..d0d8d3c71 100644 --- a/nuttx/configs/stm3210e-eval/nsh2/Make.defs +++ b/nuttx/configs/stm3210e-eval/nsh2/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3210e-eval/nx/Make.defs b/nuttx/configs/stm3210e-eval/nx/Make.defs index c6c2db5b3..8f06d7734 100644 --- a/nuttx/configs/stm3210e-eval/nx/Make.defs +++ b/nuttx/configs/stm3210e-eval/nx/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3210e-eval/nxconsole/Make.defs b/nuttx/configs/stm3210e-eval/nxconsole/Make.defs index 730545d3f..6076214c6 100644 --- a/nuttx/configs/stm3210e-eval/nxconsole/Make.defs +++ b/nuttx/configs/stm3210e-eval/nxconsole/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3210e-eval/nxlines/Make.defs b/nuttx/configs/stm3210e-eval/nxlines/Make.defs index 0ff741f41..2dd040f25 100644 --- a/nuttx/configs/stm3210e-eval/nxlines/Make.defs +++ b/nuttx/configs/stm3210e-eval/nxlines/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3210e-eval/nxtext/Make.defs b/nuttx/configs/stm3210e-eval/nxtext/Make.defs index 9fdbf2ad9..e6a4fb60e 100644 --- a/nuttx/configs/stm3210e-eval/nxtext/Make.defs +++ b/nuttx/configs/stm3210e-eval/nxtext/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3210e-eval/ostest/Make.defs b/nuttx/configs/stm3210e-eval/ostest/Make.defs index 258fd1a59..9cab57494 100644 --- a/nuttx/configs/stm3210e-eval/ostest/Make.defs +++ b/nuttx/configs/stm3210e-eval/ostest/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3210e-eval/pm/Make.defs b/nuttx/configs/stm3210e-eval/pm/Make.defs index 64706c888..740e7cebd 100644 --- a/nuttx/configs/stm3210e-eval/pm/Make.defs +++ b/nuttx/configs/stm3210e-eval/pm/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3210e-eval/usbserial/Make.defs b/nuttx/configs/stm3210e-eval/usbserial/Make.defs index 3690b3695..e3722a6f3 100644 --- a/nuttx/configs/stm3210e-eval/usbserial/Make.defs +++ b/nuttx/configs/stm3210e-eval/usbserial/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3210e-eval/usbstorage/Make.defs b/nuttx/configs/stm3210e-eval/usbstorage/Make.defs index 98843f3c5..639d07810 100644 --- a/nuttx/configs/stm3210e-eval/usbstorage/Make.defs +++ b/nuttx/configs/stm3210e-eval/usbstorage/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3220g-eval/dhcpd/Make.defs b/nuttx/configs/stm3220g-eval/dhcpd/Make.defs index 22bab8f55..ab00824b0 100644 --- a/nuttx/configs/stm3220g-eval/dhcpd/Make.defs +++ b/nuttx/configs/stm3220g-eval/dhcpd/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3220g-eval/nettest/Make.defs b/nuttx/configs/stm3220g-eval/nettest/Make.defs index 2a324e0ac..d5a5bda1c 100644 --- a/nuttx/configs/stm3220g-eval/nettest/Make.defs +++ b/nuttx/configs/stm3220g-eval/nettest/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3220g-eval/nsh/Make.defs b/nuttx/configs/stm3220g-eval/nsh/Make.defs index 1f5077cd7..f0eebdbe8 100644 --- a/nuttx/configs/stm3220g-eval/nsh/Make.defs +++ b/nuttx/configs/stm3220g-eval/nsh/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3220g-eval/nsh2/Make.defs b/nuttx/configs/stm3220g-eval/nsh2/Make.defs index 39b6b5d66..9f0c85dd6 100644 --- a/nuttx/configs/stm3220g-eval/nsh2/Make.defs +++ b/nuttx/configs/stm3220g-eval/nsh2/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3220g-eval/nxwm/Make.defs b/nuttx/configs/stm3220g-eval/nxwm/Make.defs index 11048e4c5..e8c2ecf65 100644 --- a/nuttx/configs/stm3220g-eval/nxwm/Make.defs +++ b/nuttx/configs/stm3220g-eval/nxwm/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3220g-eval/ostest/Make.defs b/nuttx/configs/stm3220g-eval/ostest/Make.defs index 4484f5451..07761fb16 100644 --- a/nuttx/configs/stm3220g-eval/ostest/Make.defs +++ b/nuttx/configs/stm3220g-eval/ostest/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3220g-eval/telnetd/Make.defs b/nuttx/configs/stm3220g-eval/telnetd/Make.defs index d82089843..4b9b46ea9 100644 --- a/nuttx/configs/stm3220g-eval/telnetd/Make.defs +++ b/nuttx/configs/stm3220g-eval/telnetd/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3240g-eval/dhcpd/Make.defs b/nuttx/configs/stm3240g-eval/dhcpd/Make.defs index 51075db66..7c6e9d640 100644 --- a/nuttx/configs/stm3240g-eval/dhcpd/Make.defs +++ b/nuttx/configs/stm3240g-eval/dhcpd/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3240g-eval/discover/Make.defs b/nuttx/configs/stm3240g-eval/discover/Make.defs index c1da1e5bf..39700e67c 100644 --- a/nuttx/configs/stm3240g-eval/discover/Make.defs +++ b/nuttx/configs/stm3240g-eval/discover/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3240g-eval/nettest/Make.defs b/nuttx/configs/stm3240g-eval/nettest/Make.defs index 6d7d099ea..24021f178 100644 --- a/nuttx/configs/stm3240g-eval/nettest/Make.defs +++ b/nuttx/configs/stm3240g-eval/nettest/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3240g-eval/nsh/Make.defs b/nuttx/configs/stm3240g-eval/nsh/Make.defs index 38b5479d3..3028607d1 100644 --- a/nuttx/configs/stm3240g-eval/nsh/Make.defs +++ b/nuttx/configs/stm3240g-eval/nsh/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3240g-eval/nsh2/Make.defs b/nuttx/configs/stm3240g-eval/nsh2/Make.defs index 368baf7ea..9c2515516 100644 --- a/nuttx/configs/stm3240g-eval/nsh2/Make.defs +++ b/nuttx/configs/stm3240g-eval/nsh2/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3240g-eval/nxconsole/Make.defs b/nuttx/configs/stm3240g-eval/nxconsole/Make.defs index 8a4ec7709..4658f3dc8 100644 --- a/nuttx/configs/stm3240g-eval/nxconsole/Make.defs +++ b/nuttx/configs/stm3240g-eval/nxconsole/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3240g-eval/nxwm/Make.defs b/nuttx/configs/stm3240g-eval/nxwm/Make.defs index 60f8e223e..c9382eefd 100644 --- a/nuttx/configs/stm3240g-eval/nxwm/Make.defs +++ b/nuttx/configs/stm3240g-eval/nxwm/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3240g-eval/ostest/Make.defs b/nuttx/configs/stm3240g-eval/ostest/Make.defs index 810a48baa..bbd9b8c5f 100644 --- a/nuttx/configs/stm3240g-eval/ostest/Make.defs +++ b/nuttx/configs/stm3240g-eval/ostest/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3240g-eval/telnetd/Make.defs b/nuttx/configs/stm3240g-eval/telnetd/Make.defs index 11000a4f9..1d7c60a56 100644 --- a/nuttx/configs/stm3240g-eval/telnetd/Make.defs +++ b/nuttx/configs/stm3240g-eval/telnetd/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3240g-eval/webserver/Make.defs b/nuttx/configs/stm3240g-eval/webserver/Make.defs index cd13c24e9..6e71770ef 100644 --- a/nuttx/configs/stm3240g-eval/webserver/Make.defs +++ b/nuttx/configs/stm3240g-eval/webserver/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm3240g-eval/xmlrpc/Make.defs b/nuttx/configs/stm3240g-eval/xmlrpc/Make.defs index 8c99420ad..eb2aa8887 100644 --- a/nuttx/configs/stm3240g-eval/xmlrpc/Make.defs +++ b/nuttx/configs/stm3240g-eval/xmlrpc/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm32f100rc_generic/nsh/Make.defs b/nuttx/configs/stm32f100rc_generic/nsh/Make.defs index 9ba5b8f99..51efb62ca 100644 --- a/nuttx/configs/stm32f100rc_generic/nsh/Make.defs +++ b/nuttx/configs/stm32f100rc_generic/nsh/Make.defs @@ -42,7 +42,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm32f100rc_generic/ostest/Make.defs b/nuttx/configs/stm32f100rc_generic/ostest/Make.defs index b14abfb34..43e3b07af 100644 --- a/nuttx/configs/stm32f100rc_generic/ostest/Make.defs +++ b/nuttx/configs/stm32f100rc_generic/ostest/Make.defs @@ -42,7 +42,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm32f4discovery/cxxtest/Make.defs b/nuttx/configs/stm32f4discovery/cxxtest/Make.defs index 60af5b155..4bf1662b9 100644 --- a/nuttx/configs/stm32f4discovery/cxxtest/Make.defs +++ b/nuttx/configs/stm32f4discovery/cxxtest/Make.defs @@ -56,7 +56,7 @@ EXTRA_LIBS = -lsupc++ ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm32f4discovery/elf/Make.defs b/nuttx/configs/stm32f4discovery/elf/Make.defs index 463f6920d..5fc535dff 100644 --- a/nuttx/configs/stm32f4discovery/elf/Make.defs +++ b/nuttx/configs/stm32f4discovery/elf/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm32f4discovery/nsh/Make.defs b/nuttx/configs/stm32f4discovery/nsh/Make.defs index e5035cbdc..8e75d971e 100644 --- a/nuttx/configs/stm32f4discovery/nsh/Make.defs +++ b/nuttx/configs/stm32f4discovery/nsh/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm32f4discovery/nxlines/Make.defs b/nuttx/configs/stm32f4discovery/nxlines/Make.defs index 7d6d53469..bd561d7a4 100644 --- a/nuttx/configs/stm32f4discovery/nxlines/Make.defs +++ b/nuttx/configs/stm32f4discovery/nxlines/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/stm32f4discovery/ostest/Make.defs b/nuttx/configs/stm32f4discovery/ostest/Make.defs index 480529117..7b807abdb 100644 --- a/nuttx/configs/stm32f4discovery/ostest/Make.defs +++ b/nuttx/configs/stm32f4discovery/ostest/Make.defs @@ -112,7 +112,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native host tools - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh else diff --git a/nuttx/configs/stm32f4discovery/pm/Make.defs b/nuttx/configs/stm32f4discovery/pm/Make.defs index 75a81aea6..c0296ea67 100644 --- a/nuttx/configs/stm32f4discovery/pm/Make.defs +++ b/nuttx/configs/stm32f4discovery/pm/Make.defs @@ -41,7 +41,7 @@ LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/sure-pic32mx/nsh/Make.defs b/nuttx/configs/sure-pic32mx/nsh/Make.defs index 836ec0ac7..c15ab4f81 100644 --- a/nuttx/configs/sure-pic32mx/nsh/Make.defs +++ b/nuttx/configs/sure-pic32mx/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/sure-pic32mx/ostest/Make.defs b/nuttx/configs/sure-pic32mx/ostest/Make.defs index 8dbc884b9..b2bb45150 100644 --- a/nuttx/configs/sure-pic32mx/ostest/Make.defs +++ b/nuttx/configs/sure-pic32mx/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/sure-pic32mx/usbnsh/Make.defs b/nuttx/configs/sure-pic32mx/usbnsh/Make.defs index 791750fe6..6a2ea6ef7 100644 --- a/nuttx/configs/sure-pic32mx/usbnsh/Make.defs +++ b/nuttx/configs/sure-pic32mx/usbnsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/teensy/hello/Make.defs b/nuttx/configs/teensy/hello/Make.defs index d09279a8d..c71f98240 100644 --- a/nuttx/configs/teensy/hello/Make.defs +++ b/nuttx/configs/teensy/hello/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/avr/src/avr/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/teensy/nsh/Make.defs b/nuttx/configs/teensy/nsh/Make.defs index e65958cfe..8a119d9fd 100644 --- a/nuttx/configs/teensy/nsh/Make.defs +++ b/nuttx/configs/teensy/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/avr/src/avr/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/teensy/usbstorage/Make.defs b/nuttx/configs/teensy/usbstorage/Make.defs index ba3878521..da316dd26 100644 --- a/nuttx/configs/teensy/usbstorage/Make.defs +++ b/nuttx/configs/teensy/usbstorage/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/avr/src/avr/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/twr-k60n512/nsh/Make.defs b/nuttx/configs/twr-k60n512/nsh/Make.defs index 99ef12d47..9d692b8dd 100644 --- a/nuttx/configs/twr-k60n512/nsh/Make.defs +++ b/nuttx/configs/twr-k60n512/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/twr-k60n512/ostest/Make.defs b/nuttx/configs/twr-k60n512/ostest/Make.defs index efa53b08a..93c7bba86 100644 --- a/nuttx/configs/twr-k60n512/ostest/Make.defs +++ b/nuttx/configs/twr-k60n512/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ubw32/nsh/Make.defs b/nuttx/configs/ubw32/nsh/Make.defs index e8c0fcbb3..ae0e44ae4 100644 --- a/nuttx/configs/ubw32/nsh/Make.defs +++ b/nuttx/configs/ubw32/nsh/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/ubw32/ostest/Make.defs b/nuttx/configs/ubw32/ostest/Make.defs index dc4a35838..54276acf7 100644 --- a/nuttx/configs/ubw32/ostest/Make.defs +++ b/nuttx/configs/ubw32/ostest/Make.defs @@ -39,7 +39,7 @@ include ${TOPDIR}/arch/mips/src/mips32/Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/vsn/nsh/Make.defs b/nuttx/configs/vsn/nsh/Make.defs index 273a01dab..19889b113 100644 --- a/nuttx/configs/vsn/nsh/Make.defs +++ b/nuttx/configs/vsn/nsh/Make.defs @@ -45,7 +45,7 @@ endif ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" diff --git a/nuttx/configs/xtrs/nsh/Make.defs b/nuttx/configs/xtrs/nsh/Make.defs index d56a65dbe..40812c451 100644 --- a/nuttx/configs/xtrs/nsh/Make.defs +++ b/nuttx/configs/xtrs/nsh/Make.defs @@ -131,6 +131,16 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) # Windows-native host tools MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative + + # Use NTFS links or directory copies + +ifeq ($(CONFIG_WINDOWS_MKLINK),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.bat +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.bat +endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.bat + else # Linux/Cygwin host tool definitions @@ -148,10 +158,10 @@ else # running under Cygwin does not ifeq ($(WINTOOL),y) - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh - DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh else DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh - DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + endif diff --git a/nuttx/configs/xtrs/ostest/Make.defs b/nuttx/configs/xtrs/ostest/Make.defs index 777491f62..525616e7e 100644 --- a/nuttx/configs/xtrs/ostest/Make.defs +++ b/nuttx/configs/xtrs/ostest/Make.defs @@ -131,6 +131,16 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) # Windows-native host tools MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative + + # Use NTFS links or directory copies + +ifeq ($(CONFIG_WINDOWS_MKLINK),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.bat +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.bat +endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.bat + else # Linux/Cygwin host tool definitions @@ -148,10 +158,10 @@ else # running under Cygwin does not ifeq ($(WINTOOL),y) - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh - DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh else DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh - DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + endif diff --git a/nuttx/configs/xtrs/pashello/Make.defs b/nuttx/configs/xtrs/pashello/Make.defs index 3e57e7861..a3677fc3e 100644 --- a/nuttx/configs/xtrs/pashello/Make.defs +++ b/nuttx/configs/xtrs/pashello/Make.defs @@ -131,6 +131,16 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) # Windows-native host tools MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative + + # Use NTFS links or directory copies + +ifeq ($(CONFIG_WINDOWS_MKLINK),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.bat +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.bat +endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.bat + else # Linux/Cygwin host tool definitions @@ -148,10 +158,10 @@ else # running under Cygwin does not ifeq ($(WINTOOL),y) - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh - DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh else DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh - DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + endif diff --git a/nuttx/configs/z16f2800100zcog/ostest/Make.defs b/nuttx/configs/z16f2800100zcog/ostest/Make.defs index 20565edeb..eb706f5cd 100644 --- a/nuttx/configs/z16f2800100zcog/ostest/Make.defs +++ b/nuttx/configs/z16f2800100zcog/ostest/Make.defs @@ -241,6 +241,6 @@ else # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif diff --git a/nuttx/configs/z16f2800100zcog/pashello/Make.defs b/nuttx/configs/z16f2800100zcog/pashello/Make.defs index e0cfc6e31..311aa6578 100644 --- a/nuttx/configs/z16f2800100zcog/pashello/Make.defs +++ b/nuttx/configs/z16f2800100zcog/pashello/Make.defs @@ -241,6 +241,6 @@ else # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif diff --git a/nuttx/configs/z80sim/nsh/Make.defs b/nuttx/configs/z80sim/nsh/Make.defs index 4aa82ae71..6ecde586b 100644 --- a/nuttx/configs/z80sim/nsh/Make.defs +++ b/nuttx/configs/z80sim/nsh/Make.defs @@ -131,6 +131,16 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) # Windows-native host tools MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative + + # Use NTFS links or directory copies + +ifeq ($(CONFIG_WINDOWS_MKLINK),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.bat +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.bat +endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.bat + else # Linux/Cygwin host tool definitions @@ -148,10 +158,10 @@ else # running under Cygwin does not ifeq ($(WINTOOL),y) - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh - DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh else DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh - DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + endif diff --git a/nuttx/configs/z80sim/ostest/Make.defs b/nuttx/configs/z80sim/ostest/Make.defs index be0fc2470..1efd34983 100644 --- a/nuttx/configs/z80sim/ostest/Make.defs +++ b/nuttx/configs/z80sim/ostest/Make.defs @@ -131,6 +131,16 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) # Windows-native host tools MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative + + # Use NTFS links or directory copies + +ifeq ($(CONFIG_WINDOWS_MKLINK),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.bat +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.bat +endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.bat + else # Linux/Cygwin host tool definitions @@ -148,10 +158,10 @@ else # running under Cygwin does not ifeq ($(WINTOOL),y) - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh - DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh else DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh - DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + endif diff --git a/nuttx/configs/z80sim/pashello/Make.defs b/nuttx/configs/z80sim/pashello/Make.defs index 05ece7666..09c84ffcb 100644 --- a/nuttx/configs/z80sim/pashello/Make.defs +++ b/nuttx/configs/z80sim/pashello/Make.defs @@ -131,6 +131,16 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) # Windows-native host tools MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative + + # Use NTFS links or directory copies + +ifeq ($(CONFIG_WINDOWS_MKLINK),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.bat +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.bat +endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.bat + else # Linux/Cygwin host tool definitions @@ -148,10 +158,10 @@ else # running under Cygwin does not ifeq ($(WINTOOL),y) - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh - DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh else DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh - DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + endif diff --git a/nuttx/configs/z80sim/pashello/defconfig b/nuttx/configs/z80sim/pashello/defconfig index 1d9eb7a0e..19d255464 100644 --- a/nuttx/configs/z80sim/pashello/defconfig +++ b/nuttx/configs/z80sim/pashello/defconfig @@ -205,8 +205,8 @@ CONFIG_NO_SERIAL_CONSOLE=y # # UART Configuration # -CONFIG_UART_RXBUFSIZE=0 -CONFIG_UART_TXBUFSIZE=0 +CONFIG_UART_RXBUFSIZE=64 +CONFIG_UART_TXBUFSIZE=64 CONFIG_UART_BAUD=11520 CONFIG_UART_BITS=8 CONFIG_UART_PARITY=0 diff --git a/nuttx/configs/z8encore000zco/ostest/Make.defs b/nuttx/configs/z8encore000zco/ostest/Make.defs index e9eacba89..f18b3dda9 100644 --- a/nuttx/configs/z8encore000zco/ostest/Make.defs +++ b/nuttx/configs/z8encore000zco/ostest/Make.defs @@ -274,6 +274,6 @@ else # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif diff --git a/nuttx/configs/z8f64200100kit/ostest/Make.defs b/nuttx/configs/z8f64200100kit/ostest/Make.defs index 1cc9726aa..278f724c3 100644 --- a/nuttx/configs/z8f64200100kit/ostest/Make.defs +++ b/nuttx/configs/z8f64200100kit/ostest/Make.defs @@ -274,6 +274,6 @@ else # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies - DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)winlink.sh + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh endif diff --git a/nuttx/tools/README.txt b/nuttx/tools/README.txt index 68b85dc4f..2b9ac61f4 100644 --- a/nuttx/tools/README.txt +++ b/nuttx/tools/README.txt @@ -369,8 +369,11 @@ incdir.bat that context: MinGW-GCC. link.sh -winlink.sh +link.bat +copydir.sh +copydir.bat unlink.sh +unlink.bat ---------- Different file system have different capabilities for symbolic links. @@ -390,18 +393,25 @@ unlink.sh default. link.sh is a bash script that performs a normal, Linux-style symbolic link; unlink.sh is a do-it-all unlinking script. - But if you are building under cygwin using a Windows native toolchain, - then you will need something like the following in you Make.defs file: + But if you are building under cygwin using a Windows native toolchain + within a POSIX framework (such as Cygwin), then you will need something + like the following in you Make.defs file: - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = (TOPDIR)/tools/unlink.sh - winlink.sh will copy the whole directory instead of linking it. + copydir.sh will copy the whole directory instead of linking it. - NOTE: I have been told that some NuttX users have been able to build - successfully using the GnuWin32 tools and modifying the link.sh - script so that it uses the NTFS mklink command. But I have never - tried that + Finally, if you are running in a pure native Windows environment with + a CMD.exe shell, then you will need something like this: + + DIRLINK = $(TOPDIR)/tools/copydir.bat + DIRUNLINK = (TOPDIR)/tools/unlink.bat + + Note that this will copy directories. ;ink.bat might also be used in + this case. link.bat will attempt to create a symbolic link using the + NTFS mklink.exe command instead of copying files. That logic, however, + has not been verified as of this writing. mkimage.sh ---------- diff --git a/nuttx/tools/copydir.bat b/nuttx/tools/copydir.bat new file mode 100755 index 000000000..2857c415f --- /dev/null +++ b/nuttx/tools/copydir.bat @@ -0,0 +1,102 @@ +@echo off + +rem tools/copydir.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. +rem + +rem +rem NuttX uses symbolic links to configure platform-specific directories into +rem the build system. This works great except for when a Windows native +rem toolchain is used in a Cygwin environment. In that case, symbolic +rem links do not work correctly when accessed from the Windows native toolchain; +rem rather, just look link files with the extension .lnk +rem +rem In this environment, the build system will work around this using this script +rem as a replacement for the 'ln' command. This scrpt will simply copy the +rem directory into the expected positiion. +rem + +set src=%1 +set dest=%2 + +rem Verify that arguments were provided + +if "%src%"=="" goto :MissingSrc +if "%dest%"=="" goto :MissingDest +goto CheckSrc + +:MissingSrc + +echo Missing ^ and ^ arguments +goto :ShowUsage + +:MissingDest + +echo Missing ^ arguments +goto :ShowUsage + +rem Verify that a directory exists at the source path + +:CheckSrc + +if exist %src% goto :CheckDest + +echo No directory at %src% +goto :ShowUsage + +:CheckDest + +rem If something already exists at the destination path, remove it + +if not exist %dest% goto :CopyDir + +rmdir /q /s %dest% +if errorlevel 1 ( + echo Failed to remove existing object at %dest% + goto :ShowUsage +) + +rem Copy the directory + +:CopyDir + +xcopy %src% %dest% /c /q /s /e /y /i +echo FAKELNK > %dest%\.fakelnk +goto :End + +:ShowUsage +echo USAGE: %0 ^ ^ +echo Where: +echo ^ is the source directory to be copied +echo ^ is the destination directory to be created + +:End diff --git a/nuttx/tools/copydir.sh b/nuttx/tools/copydir.sh new file mode 100755 index 000000000..5d9f79002 --- /dev/null +++ b/nuttx/tools/copydir.sh @@ -0,0 +1,102 @@ +#!/bin/bash +############################################################################ +# tools/copydir.sh +# +# 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. +# +############################################################################ +# +# NuttX uses symbolic links to configure platform-specific directories into +# the build system. This works great except for when a Windows native +# toolchain is used in a Cygwin environment. In that case, symbolic +# links do not work correctly when accessed from the Windows native toolchain; +# rather, just look link files with the extension .lnk +# +# In this environment, the build system will work around this using this script +# as a replacement for the 'ln' command. This scrpt will simply copy the +# directory into the expected positiion. +# +#set -x + +src=$1 +dest=$2 + +# Verify that arguments were provided + +if [ -z "${src}" -o -z "${dest}" ]; then + echo "Missing src and/or dest arguments" + exit 1 +fi + +# Check if something already exists at the destination path replace it with +# the new link (which might be different). Note that we check for the +# the link (-h) before we check for existence (-e) because a bad link will +# report that it does not exist. + +if [ -h "${dest}" ]; then + rm -f "${dest}" +else + + # If the path exists and is a directory that contains the "fake link" + # mark, then treat it like a soft link (i.e., remove the directory) + + if [ -d "${dest}" -a -f "${dest}/.fakelnk" ]; then + rm -rf "${dest}" + else + + # Does anything exist at the destination path? + + if [ -e "${dest}" ]; then + + # It is something else (like a file) or directory that does + # not contain the "fake link" mark + + echo "${dest} already exists but is not a symbolic link" + exit 1 + fi + fi +fi + + +# Verify that a directory exists at the source path + +if [ ! -d "${src}" ]; then + echo "No directory at ${src}" + exit 1 +fi + +# Copy the directory + +cp -a "${src}" "${dest}" || \ + { echo "Failed to create link: $dest" ; rm -rf ${dest} ; exit 1 ; } +touch "${dest}/.fakelnk" || \ + { echo "Failed to touch ${dest}/.fakelnk" ; rm -rf ${dest} ; exit 1 ; } + diff --git a/nuttx/tools/link.bat b/nuttx/tools/link.bat new file mode 100755 index 000000000..434574ee3 --- /dev/null +++ b/nuttx/tools/link.bat @@ -0,0 +1,89 @@ +@echo off + +rem tools/link.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. +rem + +set src=%1 +set link=%2 + +rem Verify that arguments were provided + +if "%src%"=="" goto :MissingSrc +if "%link%"=="" goto :MissingLink +goto CheckSrc + +:MissingSrc + +echo Missing ^ and ^ arguments +goto :ShowUsage + +:MissingLink + +echo Missing ^ arguments +goto :ShowUsage + +rem Verify that a directory exists at the source path + +:CheckSrc + +if exist %src% goto :CheckLink + +echo No directory at %src% +goto :ShowUsage + +:CheckLink + +rem If something already exists at the destination path, remove it + +if not exist %link% goto :MkLink + +rmdir /q /s %link% +if errorlevel 1 ( + echo Failed to remove existing object at %link% + goto :ShowUsage +) + +rem Copy the directory + +:MkLink + +/user:administrator mklink /d %src% %link% +goto :End + +:ShowUsage +echo USAGE: %0 ^ ^ +echo Where: +echo ^ is the source directory to be linked +echo ^ is the link to be created + +:End diff --git a/nuttx/tools/unlink.bat b/nuttx/tools/unlink.bat new file mode 100755 index 000000000..25e83bb9f --- /dev/null +++ b/nuttx/tools/unlink.bat @@ -0,0 +1,71 @@ +@echo off + +rem tools/unlink.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. +rem + +rem Verify that arguments were provided + +set link=%1 +if "%link%"=="" goto :MissingArgument + +rem Check if something already exists at the link path + +if exist "%link%" goto :LinkExists + +echo %link% does not exist +goto :ShowUsage + +rem %link% make be a symbolic link or it may be a copied director (with +rem a .fakelnk file in it). It really does not matter which: We do the +rem same thing in either case + +:LinkExists + +rmdir /q /s %link% +if errorlevel 1 ( + echo Failed to remove existing object at %link% + goto :ShowUsage +) + +goto :End + +:MissingArgument + +echo Missing Argument + +:ShowUsage +echo USAGE: %0 ^ +echo Where: +echo ^ is the linked (or copied) directory to be removed + +:End diff --git a/nuttx/tools/winlink.sh b/nuttx/tools/winlink.sh deleted file mode 100755 index f79eda2bd..000000000 --- a/nuttx/tools/winlink.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash -############################################################################ -# tools/winlink.sh -# -# 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. -# -############################################################################ -# -# NuttX uses symbolic links to configure platform-specific directories into -# the build system. This works great except for when a Windows native -# toolchain is used in a Cygwin environment. In that case, symbolic -# links do not work correctly when accessed from the Windows native toolchain; -# rather, just look link files with the extension .lnk -# -# In this environment, the build system will work around this using this script -# as a replacement for the 'ln' command. This scrpt will simply copy the -# directory into the expected positiion. -# -#set -x - -src=$1 -dest=$2 - -# Verify that arguments were provided - -if [ -z "${src}" -o -z "${dest}" ]; then - echo "Missing src and/or dest arguments" - exit 1 -fi - -# Check if something already exists at the destination path replace it with -# the new link (which might be different). Note that we check for the -# the link (-h) before we check for existence (-e) because a bad link will -# report that it does not exist. - -if [ -h "${dest}" ]; then - rm -f "${dest}" -else - - # If the path exists and is a directory that contains the "fake link" - # mark, then treat it like a soft link (i.e., remove the directory) - - if [ -d "${dest}" -a -f "${dest}/.fakelnk" ]; then - rm -rf "${dest}" - else - - # Does anything exist at the destination path? - - if [ -e "${dest}" ]; then - - # It is something else (like a file) or directory that does - # not contain the "fake link" mark - - echo "${dest} already exists but is not a symbolic link" - exit 1 - fi - fi -fi - - -# Verify that a directory exists at the source path - -if [ ! -d "${src}" ]; then - echo "No directory at ${src}" - exit 1 -fi - -# Copy the directory - -cp -a "${src}" "${dest}" || \ - { echo "Failed to create link: $dest" ; rm -rf ${dest} ; exit 1 ; } -touch "${dest}/.fakelnk" || \ - { echo "Failed to touch ${dest}/.fakelnk" ; rm -rf ${dest} ; exit 1 ; } - -- cgit v1.2.3 From 9ba1a8f55d7224dfa2ca260bad6891b8222e96fb Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 8 Dec 2012 21:31:43 +0000 Subject: Fixes for configs/z80sim/pashello Windows native build git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5420 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z80/src/z80/up_mem.h | 6 +++--- nuttx/configs/z80sim/README.txt | 25 ++++++++++++++----------- nuttx/configs/z80sim/nsh/defconfig | 2 +- nuttx/configs/z80sim/ostest/defconfig | 2 +- nuttx/configs/z80sim/pashello/defconfig | 4 ++-- 5 files changed, 21 insertions(+), 18 deletions(-) (limited to 'nuttx') diff --git a/nuttx/arch/z80/src/z80/up_mem.h b/nuttx/arch/z80/src/z80/up_mem.h index 9273d3f89..a12b52656 100644 --- a/nuttx/arch/z80/src/z80/up_mem.h +++ b/nuttx/arch/z80/src/z80/up_mem.h @@ -33,8 +33,8 @@ * ************************************************************************************/ -#ifndef nuttx.lnk__ARCH_Z80_SRC_COMMON_UP_MEM_H -#define nuttx.lnk__ARCH_Z80_SRC_COMMON_UP_MEM_H +#ifndef __ARCH_Z80_SRC_COMMON_UP_MEM_H +#define __ARCH_Z80_SRC_COMMON_UP_MEM_H /************************************************************************************ * Included Files @@ -72,4 +72,4 @@ extern const uint16_t g_heapbase; -#endif /* nuttx.lnk__ARCH_Z80_SRC_COMMON_UP_MEM_H */ +#endif /* __ARCH_Z80_SRC_COMMON_UP_MEM_H */ diff --git a/nuttx/configs/z80sim/README.txt b/nuttx/configs/z80sim/README.txt index 0580b684c..8b90f3095 100644 --- a/nuttx/configs/z80sim/README.txt +++ b/nuttx/configs/z80sim/README.txt @@ -25,10 +25,11 @@ Configuring NuttX This configuration performs a simple, minimal OS test using examples/ostest. This can be configurated as follows: + 1) From a POSIX window: cd tools - ./configure.sh z80sim/ostest - cd - - . ./setenv.sh + ./configure.sh z80sim/pashello + 2) From a CMD.exe window + setenv.bat NOTES: @@ -43,7 +44,7 @@ Configuring NuttX 3. This configuration was last verified sucessfully prior to the the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run - natively under Cygwin. + natively under Cygwin. The current build requires ca. 3.2.1 SDCC. nsh @@ -53,10 +54,11 @@ Configuring NuttX This configuration can be selected by: + 1) From a POSIX window: cd tools - ./configure.sh z80sim/nsh - cd - - . ./setenv.sh + ./configure.sh z80sim/pashello + 2) From a CMD.exe window + setenv.bat NOTES: @@ -71,7 +73,7 @@ Configuring NuttX 3. This configuration was last verified sucessfully prior to the the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run - natively under Cygwin. + natively under Cygwin.nsh/defconfig:CONFIG_BOARD_LOOPSPERMSEC pashello @@ -83,10 +85,11 @@ Configuring NuttX This configuration can be selected by: + 1) From a POSIX window: cd tools ./configure.sh z80sim/pashello - cd - - . ./setenv.sh + 2) From a CMD.exe window + setenv.bat NOTES: @@ -101,7 +104,7 @@ Configuring NuttX 3. This configuration was last verified sucessfully prior to the the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run - natively under Cygwin. + natively under Cygwin.nsh/defconfig:CONFIG_BOARD_LOOPSPERMSEC Reconfiguring NuttX ^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/configs/z80sim/nsh/defconfig b/nuttx/configs/z80sim/nsh/defconfig index d3fd60706..ff9a90344 100644 --- a/nuttx/configs/z80sim/nsh/defconfig +++ b/nuttx/configs/z80sim/nsh/defconfig @@ -62,7 +62,7 @@ CONFIG_WINDOWS_NATIVE=y CONFIG_ARCH_Z80=y CONFIG_ARCH="z80" CONFIG_ARCH_CHIP="z80" -CONFIG_BOARD_LOOPSPERMSEC= +CONFIG_BOARD_LOOPSPERMSEC=100 CONFIG_ARCH_CHIP_Z80=y # CONFIG_ARCH_CHIP_Z8F6403 is not set # CONFIG_ARCH_CHIP_Z8F6423 is not set diff --git a/nuttx/configs/z80sim/ostest/defconfig b/nuttx/configs/z80sim/ostest/defconfig index fa79acd30..0697d8bba 100644 --- a/nuttx/configs/z80sim/ostest/defconfig +++ b/nuttx/configs/z80sim/ostest/defconfig @@ -62,7 +62,7 @@ CONFIG_WINDOWS_NATIVE=y CONFIG_ARCH_Z80=y CONFIG_ARCH="z80" CONFIG_ARCH_CHIP="z80" -CONFIG_BOARD_LOOPSPERMSEC= +CONFIG_BOARD_LOOPSPERMSEC=100 CONFIG_ARCH_CHIP_Z80=y # CONFIG_ARCH_CHIP_Z8F6403 is not set # CONFIG_ARCH_CHIP_Z8F6423 is not set diff --git a/nuttx/configs/z80sim/pashello/defconfig b/nuttx/configs/z80sim/pashello/defconfig index 19d255464..b0ff5ce16 100644 --- a/nuttx/configs/z80sim/pashello/defconfig +++ b/nuttx/configs/z80sim/pashello/defconfig @@ -62,7 +62,7 @@ CONFIG_WINDOWS_NATIVE=y CONFIG_ARCH_Z80=y CONFIG_ARCH="z80" CONFIG_ARCH_CHIP="z80" -CONFIG_BOARD_LOOPSPERMSEC= +CONFIG_BOARD_LOOPSPERMSEC=100 CONFIG_ARCH_CHIP_Z80=y # CONFIG_ARCH_CHIP_Z8F6403 is not set # CONFIG_ARCH_CHIP_Z8F6423 is not set @@ -142,7 +142,7 @@ CONFIG_DISABLE_PTHREAD=y CONFIG_DISABLE_SIGNALS=y CONFIG_DISABLE_MQUEUE=y CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_DISABLE_ENVIRON=y +# CONFIG_DISABLE_ENVIRON is not set CONFIG_DISABLE_POLL=y # -- cgit v1.2.3 From 93683ae1b56bc740d1377e76507162a6f00018ea Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 8 Dec 2012 23:21:34 +0000 Subject: configs/xtrs/ostest converted to kconfig-frontend and Windows native git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5421 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 3 + nuttx/arch/z80/src/Makefile.sdccl | 3 + nuttx/arch/z80/src/Makefile.sdccw | 3 + nuttx/arch/z80/src/ez80/Kconfig | 9 + nuttx/arch/z80/src/z8/Kconfig | 9 + nuttx/arch/z80/src/z80/Kconfig | 42 ++- nuttx/configs/Kconfig | 1 + nuttx/configs/xtrs/README.txt | 30 +- nuttx/configs/xtrs/ostest/appconfig | 39 --- nuttx/configs/xtrs/ostest/defconfig | 552 +++++++++++++++++++++++--------- nuttx/configs/xtrs/ostest/setenv.bat | 54 ++++ nuttx/configs/xtrs/ostest/setenv.sh | 45 --- nuttx/configs/xtrs/scripts/setenv.sh | 72 +++++ nuttx/configs/xtrs/src/xtr_lowputc.c | 24 +- nuttx/configs/xtrs/src/xtrs_head.asm | 240 +++++++------- nuttx/configs/z80sim/README.txt | 5 + nuttx/configs/z80sim/nsh/defconfig | 2 +- nuttx/configs/z80sim/ostest/defconfig | 2 +- nuttx/configs/z80sim/pashello/defconfig | 2 +- nuttx/drivers/serial/Kconfig | 30 +- 20 files changed, 782 insertions(+), 385 deletions(-) delete mode 100644 nuttx/configs/xtrs/ostest/appconfig create mode 100644 nuttx/configs/xtrs/ostest/setenv.bat delete mode 100755 nuttx/configs/xtrs/ostest/setenv.sh create mode 100755 nuttx/configs/xtrs/scripts/setenv.sh (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 0bf9ec971..e77c70e8f 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3767,4 +3767,7 @@ * tools/copydir.sh: Rename tools/winlink.sh to tools/copydir.sh * tools/link.bat, unlink.bat, and copydir.bat: Add Windows counterparts to the link.sh, unlink.sh, and copydir.sh Bash scripts. + * configs/z80sim/pashello: Now builds correctly. + * configs/xtrs/ostest: Converted to (1) used the kconfig-frontends + configuration tool, and (2) to build natively under Windows. diff --git a/nuttx/arch/z80/src/Makefile.sdccl b/nuttx/arch/z80/src/Makefile.sdccl index 3ccf2e33e..cbb3f8656 100644 --- a/nuttx/arch/z80/src/Makefile.sdccl +++ b/nuttx/arch/z80/src/Makefile.sdccl @@ -147,6 +147,9 @@ nuttx.lnk: echo "-l $(TOPDIR)/lib/$$LIB" >> nuttx.lnk ;\ done @echo "-l $(SDCCLIB)" >>nuttx.lnk # Name of SDCC z80 library +ifneq ($(CONFIG_LINKER_HOME_AREA),) + @echo "-b _HOME=$(CONFIG_LINKER_HOME_AREA)" >>nuttx.lnk # Start of _HOME area +endif ifneq ($(CONFIG_LINKER_CODE_AREA),) @echo "-b _CODE=$(CONFIG_LINKER_CODE_AREA)" >>nuttx.lnk # Start of _CODE area else diff --git a/nuttx/arch/z80/src/Makefile.sdccw b/nuttx/arch/z80/src/Makefile.sdccw index 3c36439d9..372786a87 100644 --- a/nuttx/arch/z80/src/Makefile.sdccw +++ b/nuttx/arch/z80/src/Makefile.sdccw @@ -145,6 +145,9 @@ nuttx.lnk: @echo -l libboard$(LIBEXT)>>nuttx.lnk $(Q) for %%G in ($(LINKLIBS)) do ( echo -l $(TOPDIR)\lib\%%G>> nuttx.lnk ) @echo -l $(SDCCLIB)>>nuttx.lnk +ifneq ($(CONFIG_LINKER_HOME_AREA),) + @echo -b _HOME=$(CONFIG_LINKER_HOME_AREA)>>nuttx.lnk +endif ifneq ($(CONFIG_LINKER_CODE_AREA),) @echo -b _CODE=$(CONFIG_LINKER_CODE_AREA)>>nuttx.lnk else diff --git a/nuttx/arch/z80/src/ez80/Kconfig b/nuttx/arch/z80/src/ez80/Kconfig index d257ca285..76cdd5f9f 100644 --- a/nuttx/arch/z80/src/ez80/Kconfig +++ b/nuttx/arch/z80/src/ez80/Kconfig @@ -31,6 +31,15 @@ config EZ80_EMAC endmenu +# The ZiLOG ZDS-II Windows toolchain is the only toolchain available for +# the ez80. +# + +config EZ80_TOOLCHAIN_ZDSII + bool + default y if ARCH_CHIP_EZ80 + default n if !ARCH_CHIP_EZ80 + if EZ80_EMAC config EZ80_FIAD diff --git a/nuttx/arch/z80/src/z8/Kconfig b/nuttx/arch/z80/src/z8/Kconfig index 2bf89905e..79bb5eb5c 100644 --- a/nuttx/arch/z80/src/z8/Kconfig +++ b/nuttx/arch/z80/src/z8/Kconfig @@ -17,4 +17,13 @@ config Z8_UART1 default y select ARCH_HAVE_UART1 +# The ZiLOG ZDS-II Windows toolchain is the only toolchain available for +# the ez80. +# + +config Z8_TOOLCHAIN_ZDSII + bool + default y if ARCH_CHIP_Z8 + default n if !ARCH_CHIP_Z8 + endif diff --git a/nuttx/arch/z80/src/z80/Kconfig b/nuttx/arch/z80/src/z80/Kconfig index 233b6ec90..8bebdfae2 100644 --- a/nuttx/arch/z80/src/z80/Kconfig +++ b/nuttx/arch/z80/src/z80/Kconfig @@ -6,18 +6,50 @@ if ARCH_CHIP_Z80 choice - prompt "Toolchain Selection" - default Z80_TOOLCHAIN_SDCCW if HOST_WINDOWS - default Z80_TOOLCHAIN_SDCCL if !HOST_WINDOWS + prompt "Toolchain Selection" + default Z80_TOOLCHAIN_SDCCW if HOST_WINDOWS + default Z80_TOOLCHAIN_SDCCL if !HOST_WINDOWS config Z80_TOOLCHAIN_SDCCL bool "SDCC for Linux, MAC OSX, or Cygwin" depends on !WINDOWS_NATIVE config Z80_TOOLCHAIN_SDCCW - bool "SDCC for Windows" - depends on HOST_WINDOWS + bool "SDCC for Windows" + depends on HOST_WINDOWS endchoice +config LINKER_HOME_AREA + hex "Start of _HOME area" + default 0x0000 + ---help--- + Start of the linker HOME area. Default: 0x0000 + +config LINKER_CODE_AREA + hex "Start of _CODE area" + default 0x0200 + ---help--- + Start of the linker _CODE area. Default: 0x0200 + +config LINKER_DATA_AREA + hex "Start of _DATA area" + default 0x8000 + ---help--- + Start of the linker _DATA area. Default: 0x8000 + +config LINKER_ROM_AT_0000 + bool "ROM at 0x0000" + default n + ---help--- + Some architectures may have ROM located at address zero. In this + case, a special version of the "head" file must be used. + +config ARCH_HAVEHEAD + bool "Board-specific Head File" + default n + ---help--- + Use a board-specific version of the "head" file in the + configs//src directory + endif diff --git a/nuttx/configs/Kconfig b/nuttx/configs/Kconfig index 7adfcee86..50e1cc600 100644 --- a/nuttx/configs/Kconfig +++ b/nuttx/configs/Kconfig @@ -548,6 +548,7 @@ config ARCH_BOARD_VSN config ARCH_BOARD_XTRS bool "XTRS TRS80 Model 3 emulation" depends on ARCH_CHIP_Z80 + select ARCH_HAVE_UART ---help--- TRS80 Model 3. This port uses a vintage computer based on the Z80. An emulator for this computer is available to run TRS80 programs on a diff --git a/nuttx/configs/xtrs/README.txt b/nuttx/configs/xtrs/README.txt index dae8a51ba..9f94ed9ad 100644 --- a/nuttx/configs/xtrs/README.txt +++ b/nuttx/configs/xtrs/README.txt @@ -52,10 +52,29 @@ Configuring NuttX This configuration performs a simple, minimal OS test using examples/ostest. This can be configurated as follows: + 1) From a POSIX window: cd tools - ./configure.sh xtrs/ostest - cd - - . ./setenv.sh + ./configure.sh z80sim/pashello + 2) From a CMD.exe window + setenv.bat + + The setenv.bat will need to be updated to include the PATH to the XTRS + hex2cmd program. + + NOTES: + + 1. This configuration uses the mconf-based configuration tool. See the + "Reconfiguring" section below for information about changing this + configuration. + + 2. The default setup for this configuration uses a windows native build. + See the section entitled "Reconfiguring for Linux, OSX, or Cygwin" + which will give you the steps you would need to do to convert this + configuration to build in other, Unix-like environments. + + 3. This configuration was last verified sucessfully prior to the + the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run + natively under Cygwin. The current build requires ca. 3.2.1 SDCC. nsh @@ -118,8 +137,13 @@ by modifying the configuration file as follows: You may need to first manually change the CONFIG_APPS_DIR="..\apps" definition in the .config file because the backslash may upset some Unix-based tools. +This configuration will require a recent version of SDCC (ca. 3.2.1) for Linux +or custom built for Cygwin (see below). + You cannot use the default setenv.bat in these Unix-like enviroments because that is a Windows batch file. Use configs/z80sim/script/setenv.sh instead. +setenv.sh must include the path to the installation location of SDCC (probably +/usr/local/bin). SDCC ^^^^ diff --git a/nuttx/configs/xtrs/ostest/appconfig b/nuttx/configs/xtrs/ostest/appconfig deleted file mode 100644 index d99892985..000000000 --- a/nuttx/configs/xtrs/ostest/appconfig +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################ -# configs/xtrs/ostest/appconfig -# -# Copyright (C) 2011 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. -# -############################################################################ - -# Path to example in apps/examples containing the user_start entry point - -CONFIGURED_APPS += examples/ostest - diff --git a/nuttx/configs/xtrs/ostest/defconfig b/nuttx/configs/xtrs/ostest/defconfig index 0104deb2c..32a7711fc 100644 --- a/nuttx/configs/xtrs/ostest/defconfig +++ b/nuttx/configs/xtrs/ostest/defconfig @@ -1,107 +1,146 @@ -############################################################################ -# configs/xtrs/ostest/defconfig -# -# Copyright (C) 2008-2010, 2012 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. -# -############################################################################ -# -# Architecture selection # -CONFIG_ARCH="z80" +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_LINUX is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +CONFIG_WINDOWS_NATIVE=y +# CONFIG_WINDOWS_CYGWIN is not set +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set +# CONFIG_WINDOWS_MKLINK is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="..\apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_SYMBOLS is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set CONFIG_ARCH_Z80=y +CONFIG_ARCH="z80" CONFIG_ARCH_CHIP="z80" +CONFIG_BOARD_LOOPSPERMSEC=100 CONFIG_ARCH_CHIP_Z80=y -CONFIG_ARCH_BOARD="xtrs" -CONFIG_ARCH_BOARD_XTRS=y +# CONFIG_ARCH_CHIP_Z8F6403 is not set +# CONFIG_ARCH_CHIP_Z8F6423 is not set +# CONFIG_ARCH_CHIP_EZ80F91 is not set +# CONFIG_ARCH_CHIP_EZ80F92 is not set +# CONFIG_ARCH_CHIP_EZ80F93 is not set +# CONFIG_Z80_TOOLCHAIN_SDCCL is not set +CONFIG_Z80_TOOLCHAIN_SDCCW=y +CONFIG_LINKER_HOME_AREA=0x5200 +CONFIG_LINKER_CODE_AREA=0x5300 +CONFIG_LINKER_DATA_AREA=0x8000 +CONFIG_LINKER_ROM_AT_0000=y +# CONFIG_ARCH_HAVEHEAD is not set + +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_IRQPRIO is not set +# CONFIG_ARCH_STACKDUMP is not set +# CONFIG_ENDIAN_BIG is not set + +# +# Board Settings +# +CONFIG_DRAM_START= CONFIG_DRAM_SIZE=65536 # -# xtrs specific device driver settings +# Boot options # -CONFIG_UART_RXBUFSIZE=256 -CONFIG_UART_TXBUFSIZE=256 +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set # -# General build options +# Board Selection # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n +CONFIG_ARCH_BOARD_XTRS=y +# CONFIG_ARCH_BOARD_Z80SIM is not set +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="xtrs" -CONFIG_LINKER_START_AREA=0x5200 -CONFIG_LINKER_CODE_AREA=0x5300 -CONFIG_LINKER_ROM_AT_0000=y +# +# Common Board Options +# # -# General OS setup +# Board-Specific Options # -CONFIG_USER_ENTRYPOINT="ostest_main" -CONFIG_DEBUG=n -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y + +# +# RTOS Features +# +CONFIG_MSEC_PER_TICK=10 CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=n +# CONFIG_SCHED_INSTRUMENTATION is not set CONFIG_TASK_NAME_SIZE=0 +# CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2008 CONFIG_START_MONTH=2 CONFIG_START_DAY=21 -CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=n -CONFIG_DEV_CONSOLE=n -CONFIG_DEV_LOWCONSOLE=n -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n +# CONFIG_DEV_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set CONFIG_SDCLONE_DISABLE=y - -# -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. -# -# There are certain dependency relationships in these -# features. -# -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. -# +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="ostest_main" +CONFIG_DISABLE_OS_API=y CONFIG_DISABLE_CLOCK=y CONFIG_DISABLE_POSIX_TIMERS=y CONFIG_DISABLE_PTHREAD=y @@ -111,28 +150,6 @@ CONFIG_DISABLE_MOUNTPOINT=y CONFIG_DISABLE_ENVIRON=y CONFIG_DISABLE_POLL=y -# -# Misc libc settings -# -CONFIG_NOPRINTF_FIELDWIDTH=y - -# -# Allow for architecture optimized implementations -# -# The architecture can provide optimized versions of the -# following to improve sysem performance -# -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n - # # Sizes of configurable things (0 disables) # @@ -142,8 +159,6 @@ CONFIG_NPTHREAD_KEYS=0 CONFIG_NFILE_DESCRIPTORS=0 CONFIG_NFILE_STREAMS=0 CONFIG_NAME_MAX=32 -CONFIG_STDIO_BUFFER_SIZE=0 -CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_MQ_MSGS=0 CONFIG_MQ_MAXMSGSIZE=0 CONFIG_MAX_WDOGPARMS=2 @@ -151,62 +166,293 @@ CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 # -# TCP/IP and UDP support via uIP +# Stack and heap information # -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n +# CONFIG_CUSTOM_STACK is not set +CONFIG_IDLETHREAD_STACKSIZE=1024 +CONFIG_USERMAIN_STACKSIZE=1024 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=1024 # -# UIP Network Utilities +# Device Drivers +# +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +CONFIG_UART_SERIAL_CONSOLE=y +# CONFIG_NO_SERIAL_CONSOLE is not set + # -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 +# UART Configuration +# +CONFIG_UART_RXBUFSIZE=64 +CONFIG_UART_TXBUFSIZE=64 +CONFIG_UART_BAUD=115200 +CONFIG_UART_BITS=8 +CONFIG_UART_PARITY=0 +CONFIG_UART_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set # -# Settings for examples/nsh -CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_CMD_SIZE=40 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 +# System Logging Device Options +# # -# Stack and heap information +# System Logging # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=1024 -CONFIG_USERMAIN_STACKSIZE=1024 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_NET is not set + +# +# File Systems +# + +# +# File system configuration +# +# CONFIG_FS_RAMMAP is not set # -# Maintain legacy build behavior (revisit) +# System Logging # +# CONFIG_SYSLOG is not set -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0x00000000 +CONFIG_HEAP2_SIZE=0 +# CONFIG_GRAN is not set + +# +# Binary Formats +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# +CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=0 +# CONFIG_LIBM is not set +CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_C99_BOOL8 is not set +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Named Applications +# +# CONFIG_NAMEDAPP is not set + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_NETTEST is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +CONFIG_EXAMPLES_OSTEST=y +# CONFIG_EXAMPLES_OSTEST_BUILTIN is not set +CONFIG_EXAMPLES_OSTEST_LOOPS=1 +CONFIG_EXAMPLES_OSTEST_STACKSIZE=1024 +CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=4 +CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000 +CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 +# CONFIG_EXAMPLES_PASHELLO is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WLAN is not set + +# +# Interpreters +# + +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# ModBus +# + +# +# FreeModbus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM +# + +# +# System NSH Add-Ons +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set diff --git a/nuttx/configs/xtrs/ostest/setenv.bat b/nuttx/configs/xtrs/ostest/setenv.bat new file mode 100644 index 000000000..38822dcc2 --- /dev/null +++ b/nuttx/configs/xtrs/ostest/setenv.bat @@ -0,0 +1,54 @@ +@echo off + +rem configs/xtrs/ostest/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the SDCC toolchain for windows. + +set PATH=C:\Program Files (x86)\SDCC/bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% + +rem This is the location where the XTRS hex2cmd program is available +rem set PATH=????:%PATH% + +echo %PATH% diff --git a/nuttx/configs/xtrs/ostest/setenv.sh b/nuttx/configs/xtrs/ostest/setenv.sh deleted file mode 100755 index 73454b772..000000000 --- a/nuttx/configs/xtrs/ostest/setenv.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# configs/xtrs/ostest/setenv.sh -# -# 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. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - -export SDCC_BIN=/usr/local/bin -export PATH=${SDCC_BIN}:/sbin:/usr/sbin:${PATH_ORIG} - -echo "PATH : ${PATH}" diff --git a/nuttx/configs/xtrs/scripts/setenv.sh b/nuttx/configs/xtrs/scripts/setenv.sh new file mode 100755 index 000000000..8dc863ba5 --- /dev/null +++ b/nuttx/configs/xtrs/scripts/setenv.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# configs/xtrs/ostest/setenv.sh +# +# Copyright (C) 2012 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. +# + +if [ "$_" = "$0" ] ; then + echo "You must source this script, not run it!" 1>&2 + exit 1 +fi + +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# +# This is the normal installation directory for SDCC under Linux, OSX +# or Linux: +# +export TOOLCHAIN_BIN=/usr/local/bin + +# +# This is the normal installation directory for SDCC under Windows +# +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/SDCC/bin" + +# +# Add the path to the toolchain to the PATH varialble +# +export PATH="${TOOLCHAIN_BIN}":/sbin:/usr/sbin:${PATH_ORIG} + +# +# This is the location where the XTRS hex2cmd program is available +# +# export HEX2CMD_BIN=???? +# export PATH="${HEX2CMD_BIN}":${PATH} + +echo "PATH : ${PATH}" diff --git a/nuttx/configs/xtrs/src/xtr_lowputc.c b/nuttx/configs/xtrs/src/xtr_lowputc.c index 8ed166211..60f4db049 100644 --- a/nuttx/configs/xtrs/src/xtr_lowputc.c +++ b/nuttx/configs/xtrs/src/xtr_lowputc.c @@ -53,7 +53,7 @@ /* Includes trs80-m3.h for assembler call addresses */ -#include +#include /******************************************************************************** * Definitions @@ -81,13 +81,13 @@ void z80_lowputc(char ch) __naked { - _asm - ld hl, #2 - add hl, sp - ld a, (hl) - call _TRS80_M3_VDCHAR ;0x0033 + __asm + ld hl, #2 + add hl, sp + ld a, (hl) + call _TRS80_M3_VDCHAR ;0x0033 ret - _endasm; + __endasm; } /******************************************************************************** @@ -96,10 +96,10 @@ void z80_lowputc(char ch) __naked char z80_lowgetc(void) __naked { - _asm - call _TRS80_M3_KBDSCN ;0x002b - ld l, a - ld h, #0 + __asm + call _TRS80_M3_KBDSCN ;0x002b + ld l, a + ld h, #0 ret - _endasm; + __endasm; } diff --git a/nuttx/configs/xtrs/src/xtrs_head.asm b/nuttx/configs/xtrs/src/xtrs_head.asm index bd7156f59..c2122898e 100644 --- a/nuttx/configs/xtrs/src/xtrs_head.asm +++ b/nuttx/configs/xtrs/src/xtrs_head.asm @@ -1,7 +1,7 @@ ;************************************************************************** ; configs/xtrs/src/xtrs_head.asm ; -; Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. +; Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. ; Author: Gregory Nutt ; ; Redistribution and use in source and binary forms, with or without @@ -42,15 +42,15 @@ ; Register save area layout - XCPT_I == 0 ; Offset 0: Saved I w/interrupt state in parity - XCPT_BC == 2 ; Offset 1: Saved BC register - XCPT_DE == 4 ; Offset 2: Saved DE register - XCPT_IX == 6 ; Offset 3: Saved IX register - XCPT_IY == 8 ; Offset 4: Saved IY register - XCPT_SP == 10 ; Offset 5: Offset to SP at time of interrupt - XCPT_HL == 12 ; Offset 6: Saved HL register - XCPT_AF == 14 ; Offset 7: Saved AF register - XCPT_PC == 16 ; Offset 8: Offset to PC at time of interrupt + XCPT_I == 0 ; Offset 0: Saved I w/interrupt state in parity + XCPT_BC == 2 ; Offset 1: Saved BC register + XCPT_DE == 4 ; Offset 2: Saved DE register + XCPT_IX == 6 ; Offset 3: Saved IX register + XCPT_IY == 8 ; Offset 4: Saved IY register + XCPT_SP == 10 ; Offset 5: Offset to SP at time of interrupt + XCPT_HL == 12 ; Offset 6: Saved HL register + XCPT_AF == 14 ; Offset 7: Saved AF register + XCPT_PC == 16 ; Offset 8: Offset to PC at time of interrupt ; Default stack base (needs to be fixed) @@ -60,8 +60,8 @@ ; Global symbols used ;************************************************************************** - .globl _os_start ; OS entry point - .globl _up_doirq ; Interrupt decoding logic + .globl _os_start ; OS entry point + .globl _up_doirq ; Interrupt decoding logic ;************************************************************************** ; System start logic @@ -71,39 +71,39 @@ _up_reset: ; Set up the stack pointer at the location determined the Makefile ; and stored in asm_mem.h - ld SP, #CONFIG_STACK_END ; Set stack pointer + ld SP, #CONFIG_STACK_END ; Set stack pointer ; Performed initialization unique to the SDCC toolchain - call gsinit ; Initialize the data section + call gsinit ; Initialize the data section ; Copy the reset vectors - ld hl, #_up_rstvectors ; code for RAM - ld de, #0x4000 ; move it here - ld bc, #3*7 ; 7 vectors / 3 bytes each + ld hl, #_up_rstvectors ; code for RAM + ld de, #0x4000 ; move it here + ld bc, #3*7 ; 7 vectors / 3 bytes each ldir ; Then start NuttX - call _os_start ; jump to the OS entry point + call _os_start ; jump to the OS entry point ; NuttX will never return, but just in case... _up_halt:: - halt ; We should never get here - jp _up_halt + halt ; We should never get here + jp _up_halt ; Data to copy to address 0x4000 _up_rstvectors: - jp _up_rst1 ; 0x4000 : RST 1 - jp _up_rst2 ; 0x4003 : RST 2 - jp _up_rst3 ; 0x4006 : RST 3 - jp _up_rst4 ; 0x4009 : RST 4 - jp _up_rst5 ; 0x400c : RST 5 - jp _up_rst6 ; 0x400f : RST 6 - jp _up_rst7 ; 0x4012 : RST 7 + jp _up_rst1 ; 0x4000 : RST 1 + jp _up_rst2 ; 0x4003 : RST 2 + jp _up_rst3 ; 0x4006 : RST 3 + jp _up_rst4 ; 0x4009 : RST 4 + jp _up_rst5 ; 0x400c : RST 5 + jp _up_rst6 ; 0x400f : RST 6 + jp _up_rst7 ; 0x4012 : RST 7 ;************************************************************************** ; Other reset handlers @@ -119,61 +119,61 @@ _up_rstvectors: ; ;************************************************************************** -_up_rst1: ; RST 1 +_up_rst1: ; RST 1 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #1 ; 1 = Z80_RST1 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #1 ; 1 = Z80_RST1 + jr _up_rstcommon ; Remaining RST handling is common -_up_rst2: ; RST 2 +_up_rst2: ; RST 2 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #2 ; 2 = Z80_RST2 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #2 ; 2 = Z80_RST2 + jr _up_rstcommon ; Remaining RST handling is common -_up_rst3: ; RST 3 +_up_rst3: ; RST 3 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #3 ; 1 = Z80_RST3 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #3 ; 1 = Z80_RST3 + jr _up_rstcommon ; Remaining RST handling is common -_up_rst4: ; RST 4 +_up_rst4: ; RST 4 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #4 ; 1 = Z80_RST4 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #4 ; 1 = Z80_RST4 + jr _up_rstcommon ; Remaining RST handling is common -_up_rst5: ; RST 5 +_up_rst5: ; RST 5 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #5 ; 1 = Z80_RST5 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #5 ; 1 = Z80_RST5 + jr _up_rstcommon ; Remaining RST handling is common -_up_rst6: ; RST 6 +_up_rst6: ; RST 6 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #6 ; 1 = Z80_RST6 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #6 ; 1 = Z80_RST6 + jr _up_rstcommon ; Remaining RST handling is common -_up_rst7: ; RST 7 +_up_rst7: ; RST 7 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. - ; Offset 8: Return PC is already on the stack - push af ; Offset 7: AF (retaining flags) - ld a, #7 ; 7 = Z80_RST7 - jr _up_rstcommon ; Remaining RST handling is common + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #7 ; 7 = Z80_RST7 + jr _up_rstcommon ; Remaining RST handling is common ;************************************************************************** ; Common Interrupt handler @@ -188,27 +188,27 @@ _up_rstcommon: ; ; IRQ number is in A - push hl ; Offset 6: HL - ld hl, #(3*2) ; HL is the value of the stack pointer before - add hl, sp ; the interrupt occurred - push hl ; Offset 5: Stack pointer - push iy ; Offset 4: IY - push ix ; Offset 3: IX - push de ; Offset 2: DE - push bc ; Offset 1: BC - - ld b, a ; Save the reset number in B - ld a, i ; Parity bit holds interrupt state - push af ; Offset 0: I with interrupt state in parity + push hl ; Offset 6: HL + ld hl, #(3*2) ; HL is the value of the stack pointer before + add hl, sp ; the interrupt occurred + push hl ; Offset 5: Stack pointer + push iy ; Offset 4: IY + push ix ; Offset 3: IX + push de ; Offset 2: DE + push bc ; Offset 1: BC + + ld b, a ; Save the reset number in B + ld a, i ; Parity bit holds interrupt state + push af ; Offset 0: I with interrupt state in parity di ; Call the interrupt decode logic. SP points to the beggining of the reg structure - ld hl, #0 ; Argument #2 is the beginning of the reg structure - add hl, sp ; - push hl ; Place argument #2 at the top of stack - push bc ; Argument #1 is the Reset number - inc sp ; (make byte sized) + ld hl, #0 ; Argument #2 is the beginning of the reg structure + add hl, sp ; + push hl ; Place argument #2 at the top of stack + push bc ; Argument #1 is the Reset number + inc sp ; (make byte sized) call _up_doirq ; Decode the IRQ ; On return, HL points to the beginning of the reg structure to restore @@ -216,61 +216,81 @@ _up_rstcommon: ; original stack pointer is lost. In the normal case (no context switch), ; HL will contain the value of the SP before the arguments wer pushed. - ld sp, hl ; Use the new stack pointer + ld sp, hl ; Use the new stack pointer ; Restore registers. HL points to the beginning of the reg structure to restore - ex af, af' ; Select alternate AF - pop af ; Offset 0: AF' = I with interrupt state in parity - ex af, af' ; Restore original AF - pop bc ; Offset 1: BC - pop de ; Offset 2: DE - pop ix ; Offset 3: IX - pop iy ; Offset 4: IY - exx ; Use alternate BC/DE/HL - ld hl, #-2 ; Offset of SP to account for ret addr on stack - pop de ; Offset 5: HL' = Stack pointer after return - add hl, de ; HL = Stack pointer value before return - exx ; Restore original BC/DE/HL - pop hl ; Offset 6: HL - pop af ; Offset 7: AF + ex af, af' ; Select alternate AF + pop af ; Offset 0: AF' = I with interrupt state in parity + ex af, af' ; Restore original AF + pop bc ; Offset 1: BC + pop de ; Offset 2: DE + pop ix ; Offset 3: IX + pop iy ; Offset 4: IY + exx ; Use alternate BC/DE/HL + ld hl, #-2 ; Offset of SP to account for ret addr on stack + pop de ; Offset 5: HL' = Stack pointer after return + add hl, de ; HL = Stack pointer value before return + exx ; Restore original BC/DE/HL + pop hl ; Offset 6: HL + pop af ; Offset 7: AF ; Restore the stack pointer - exx ; Use alternate BC/DE/HL - ld sp, hl ; Set SP = saved stack pointer value before return - exx ; Restore original BC/DE/HL + exx ; Use alternate BC/DE/HL + ld sp, hl ; Set SP = saved stack pointer value before return + exx ; Restore original BC/DE/HL ; Restore interrupt state - ex af, af' ; Recover interrupt state - jp po, nointenable ; Odd parity, IFF2=0, means disabled - ex af, af' ; Restore AF (before enabling interrupts) - ei ; yes + ex af, af' ; Recover interrupt state + jp po, nointenable ; Odd parity, IFF2=0, means disabled + ex af, af' ; Restore AF (before enabling interrupts) + ei ; yes reti nointenable:: - ex af, af' ; Restore AF + ex af, af' ; Restore AF reti ;************************************************************************** ; Ordering of segments for the linker (SDCC only) ;************************************************************************** - .area _HOME - .area _CODE - .area _GSINIT - .area _GSFINAL + .area _HOME + .area _CODE + .area _INITIALIZER + .area _GSINIT + .area _GSFINAL - .area _DATA - .area _BSS - .area _HEAP + .area _DATA + .area _INITIALIZED + .area _BSEG + .area _BSS + .area _HEAP ;************************************************************************** ; Global data initialization logic (SDCC only) ;************************************************************************** - .area _GSINIT + .area _GSINIT gsinit:: + ld bc, #l__INITIALIZER + ld a, b + or a, c + jr Z, gsinit_next + ld de, #s__INITIALIZED + ld hl, #s__INITIALIZER + ldir +gsinit_next: + .area _GSFINAL ret +;************************************************************************** +; The start of the heap (SDCC only). Note that is actually resides in +; the _CODE area (which may be FLASH or ROM) +;************************************************************************** + + .area _CODE +_g_heapbase:: + .dw #s__HEAP diff --git a/nuttx/configs/z80sim/README.txt b/nuttx/configs/z80sim/README.txt index 8b90f3095..50e2c7028 100644 --- a/nuttx/configs/z80sim/README.txt +++ b/nuttx/configs/z80sim/README.txt @@ -139,8 +139,13 @@ by modifying the configuration file as follows: You may need to first manually change the CONFIG_APPS_DIR="..\apps" definition in the .config file because the backslash may upset some Unix-based tools. +This configuration will require a recent version of SDCC (ca. 3.2.1) for Linux +or custom built for Cygwin (see below). + You cannot use the default setenv.bat in these Unix-like enviroments because that is a Windows batch file. Use configs/z80sim/script/setenv.sh instead. +setenv.sh must include the path to the installation location of SDCC (probably +/usr/local/bin). SDCC ^^^^ diff --git a/nuttx/configs/z80sim/nsh/defconfig b/nuttx/configs/z80sim/nsh/defconfig index ff9a90344..5b21b97bf 100644 --- a/nuttx/configs/z80sim/nsh/defconfig +++ b/nuttx/configs/z80sim/nsh/defconfig @@ -208,7 +208,7 @@ CONFIG_NO_SERIAL_CONSOLE=y # CONFIG_UART_RXBUFSIZE=64 CONFIG_UART_TXBUFSIZE=64 -CONFIG_UART_BAUD=11520 +CONFIG_UART_BAUD=115200 CONFIG_UART_BITS=8 CONFIG_UART_PARITY=0 CONFIG_UART_2STOP=0 diff --git a/nuttx/configs/z80sim/ostest/defconfig b/nuttx/configs/z80sim/ostest/defconfig index 0697d8bba..656f71fd1 100644 --- a/nuttx/configs/z80sim/ostest/defconfig +++ b/nuttx/configs/z80sim/ostest/defconfig @@ -207,7 +207,7 @@ CONFIG_UART_SERIAL_CONSOLE=y # CONFIG_UART_RXBUFSIZE=0 CONFIG_UART_TXBUFSIZE=0 -CONFIG_UART_BAUD=11520 +CONFIG_UART_BAUD=115200 CONFIG_UART_BITS=8 CONFIG_UART_PARITY=0 CONFIG_UART_2STOP=0 diff --git a/nuttx/configs/z80sim/pashello/defconfig b/nuttx/configs/z80sim/pashello/defconfig index b0ff5ce16..16124f39b 100644 --- a/nuttx/configs/z80sim/pashello/defconfig +++ b/nuttx/configs/z80sim/pashello/defconfig @@ -207,7 +207,7 @@ CONFIG_NO_SERIAL_CONSOLE=y # CONFIG_UART_RXBUFSIZE=64 CONFIG_UART_TXBUFSIZE=64 -CONFIG_UART_BAUD=11520 +CONFIG_UART_BAUD=115200 CONFIG_UART_BITS=8 CONFIG_UART_PARITY=0 CONFIG_UART_2STOP=0 diff --git a/nuttx/drivers/serial/Kconfig b/nuttx/drivers/serial/Kconfig index 43869fdec..3dfd23dd1 100644 --- a/nuttx/drivers/serial/Kconfig +++ b/nuttx/drivers/serial/Kconfig @@ -422,7 +422,7 @@ config UART_TXBUFSIZE config UART_BAUD int "baud rate" - default 11520 + default 115200 help The configured BAUD of the UART. @@ -465,7 +465,7 @@ config UART0_TXBUFSIZE config UART0_BAUD int "baud rate" - default 11520 + default 115200 help The configured BAUD of the UART. @@ -508,7 +508,7 @@ config USART0_TXBUFSIZE config USART0_BAUD int "baud rate" - default 11520 + default 115200 help The configured BAUD of the USART. @@ -551,7 +551,7 @@ config UART1_TXBUFSIZE config UART1_BAUD int "baud rate" - default 11520 + default 115200 help The configured BAUD of the UART. @@ -594,7 +594,7 @@ config USART1_TXBUFSIZE config USART1_BAUD int "baud rate" - default 11520 + default 115200 help The configured BAUD of the USART. @@ -637,7 +637,7 @@ config UART2_TXBUFSIZE config UART2_BAUD int "baud rate" - default 11520 + default 115200 help The configured BAUD of the UART. @@ -680,7 +680,7 @@ config USART2_TXBUFSIZE config USART2_BAUD int "baud rate" - default 11520 + default 115200 help The configured BAUD of the USART. @@ -723,7 +723,7 @@ config UART3_TXBUFSIZE config UART3_BAUD int "baud rate" - default 11520 + default 115200 help The configured BAUD of the UART. @@ -766,7 +766,7 @@ config USART3_TXBUFSIZE config USART3_BAUD int "baud rate" - default 11520 + default 115200 help The configured BAUD of the USART. @@ -809,7 +809,7 @@ config UART4_TXBUFSIZE config UART4_BAUD int "baud rate" - default 11520 + default 115200 help The configured BAUD of the UART. @@ -852,7 +852,7 @@ config USART4_TXBUFSIZE config USART4_BAUD int "baud rate" - default 11520 + default 115200 help The configured BAUD of the USART. @@ -895,7 +895,7 @@ config UART5_TXBUFSIZE config UART5_BAUD int "baud rate" - default 11520 + default 115200 help The configured BAUD of the UART. @@ -938,7 +938,7 @@ config USART5_TXBUFSIZE config USART5_BAUD int "baud rate" - default 11520 + default 115200 help The configured BAUD of the USART. @@ -981,7 +981,7 @@ config USART6_TXBUFSIZE config USART6_BAUD int "baud rate" - default 11520 + default 115200 help The configured BAUD of the USART. @@ -1024,7 +1024,7 @@ config UART6_TXBUFSIZE config UART6_BAUD int "baud rate" - default 11520 + default 115200 help The configured BAUD of the UART. -- cgit v1.2.3 From 200ce6d7ff301e68d6b90ac40a22866190b4c80b Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 9 Dec 2012 17:34:53 +0000 Subject: configs/xtrs/nsh and pashello now use kconfig-frontends and build Windows native git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5422 42af7a65-404d-4744-a932-0658087f49c3 --- apps/nshlib/nsh_consolemain.c | 8 +- apps/nshlib/nsh_dbgcmds.c | 3 +- nuttx/ChangeLog | 7 +- nuttx/configs/cloudctrl/nsh/defconfig | 3 +- nuttx/configs/ez80f910200kitg/ostest/defconfig | 3 +- nuttx/configs/ez80f910200zco/ostest/defconfig | 3 +- nuttx/configs/fire-stm32v2/nsh/defconfig | 3 +- nuttx/configs/shenzhou/nsh/defconfig | 3 +- nuttx/configs/shenzhou/nxwm/defconfig | 3 +- nuttx/configs/shenzhou/thttpd/defconfig | 3 +- nuttx/configs/sim/cxxtest/defconfig | 3 +- nuttx/configs/sim/ostest/defconfig | 3 +- nuttx/configs/stm3240g-eval/discover/defconfig | 3 +- nuttx/configs/stm3240g-eval/xmlrpc/defconfig | 3 +- nuttx/configs/stm32f100rc_generic/nsh/defconfig | 3 +- nuttx/configs/stm32f100rc_generic/ostest/defconfig | 3 +- nuttx/configs/stm32f4discovery/cxxtest/defconfig | 3 +- nuttx/configs/stm32f4discovery/elf/defconfig | 3 +- nuttx/configs/stm32f4discovery/nxlines/defconfig | 3 +- nuttx/configs/stm32f4discovery/ostest/defconfig | 3 +- nuttx/configs/stm32f4discovery/winbuild/defconfig | 3 +- nuttx/configs/xtrs/README.txt | 56 +- nuttx/configs/xtrs/nsh/appconfig | 44 -- nuttx/configs/xtrs/nsh/defconfig | 611 +++++++++++++++------ nuttx/configs/xtrs/nsh/setenv.bat | 54 ++ nuttx/configs/xtrs/nsh/setenv.sh | 45 -- nuttx/configs/xtrs/ostest/defconfig | 6 +- nuttx/configs/xtrs/pashello/appconfig | 43 -- nuttx/configs/xtrs/pashello/defconfig | 551 +++++++++++++------ nuttx/configs/xtrs/pashello/setenv.bat | 54 ++ nuttx/configs/xtrs/pashello/setenv.sh | 45 -- nuttx/configs/xtrs/src/xtr_serial.c | 3 +- nuttx/configs/z16f2800100zcog/ostest/defconfig | 3 +- nuttx/configs/z16f2800100zcog/pashello/defconfig | 3 +- nuttx/configs/z80sim/README.txt | 4 +- nuttx/configs/z80sim/nsh/defconfig | 11 +- nuttx/configs/z80sim/ostest/defconfig | 12 +- nuttx/configs/z80sim/pashello/defconfig | 17 +- nuttx/configs/z8encore000zco/ostest/defconfig | 3 +- nuttx/configs/z8f64200100kit/ostest/defconfig | 3 +- nuttx/drivers/loop.c | 2 +- nuttx/drivers/serial/Kconfig | 6 +- nuttx/drivers/serial/serial.c | 4 +- nuttx/libc/string/lib_strcasestr.c | 4 +- nuttx/libc/string/lib_strstr.c | 4 +- nuttx/sched/Kconfig | 6 - nuttx/sched/prctl.c | 6 + 47 files changed, 1079 insertions(+), 593 deletions(-) delete mode 100644 nuttx/configs/xtrs/nsh/appconfig create mode 100644 nuttx/configs/xtrs/nsh/setenv.bat delete mode 100755 nuttx/configs/xtrs/nsh/setenv.sh delete mode 100644 nuttx/configs/xtrs/pashello/appconfig create mode 100644 nuttx/configs/xtrs/pashello/setenv.bat delete mode 100755 nuttx/configs/xtrs/pashello/setenv.sh (limited to 'nuttx') diff --git a/apps/nshlib/nsh_consolemain.c b/apps/nshlib/nsh_consolemain.c index 6b51be470..f05447a64 100644 --- a/apps/nshlib/nsh_consolemain.c +++ b/apps/nshlib/nsh_consolemain.c @@ -160,11 +160,11 @@ int nsh_consolemain(int argc, char *argv[]) } } - /* Clean up */ + /* Clean up. We do not get here, but this is necessary to keep some + * compilers happy. But others will complain that this code is not + * reachable. + */ nsh_exit(&pstate->cn_vtbl, 0); - - /* We do not get here, but this is necessary to keep some compilers happy */ - return OK; } diff --git a/apps/nshlib/nsh_dbgcmds.c b/apps/nshlib/nsh_dbgcmds.c index 5463e0f5a..85a4ccb9c 100644 --- a/apps/nshlib/nsh_dbgcmds.c +++ b/apps/nshlib/nsh_dbgcmds.c @@ -103,7 +103,7 @@ int mem_parse(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv, pcvalue++; lvalue = (unsigned long)strtol(pcvalue, NULL, 16); - if (lvalue > 0xffffffff) + if (lvalue > 0xffffffffL) { return -EINVAL; } @@ -131,6 +131,7 @@ int mem_parse(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv, { mem->dm_count = 1; } + return OK; } diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index e77c70e8f..ffa2e719f 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3768,6 +3768,9 @@ * tools/link.bat, unlink.bat, and copydir.bat: Add Windows counterparts to the link.sh, unlink.sh, and copydir.sh Bash scripts. * configs/z80sim/pashello: Now builds correctly. - * configs/xtrs/ostest: Converted to (1) used the kconfig-frontends - configuration tool, and (2) to build natively under Windows. + * configs/xtrs/ostest, nsh, and pashello: Converted to (1) used the kconfig- + frontends configuration tool, and (2) to build natively under Windows. + * drivers/serial/Kconfig and sched/Kconfig: Two names for same configuration: + CONFIG_LOWLEVEL_CONSOLE is bogus and CONFIG_DEV_LOWCONSOLE is in the wrong + Kconfig file. Moved to drivers/serial/Kconfig replacing CONFIG_LOWLEVEL_CONSOLE. diff --git a/nuttx/configs/cloudctrl/nsh/defconfig b/nuttx/configs/cloudctrl/nsh/defconfig index 440cb3e0b..fbb5e8c13 100644 --- a/nuttx/configs/cloudctrl/nsh/defconfig +++ b/nuttx/configs/cloudctrl/nsh/defconfig @@ -264,7 +264,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=9 CONFIG_START_DAY=8 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -356,7 +355,7 @@ CONFIG_MMCSD_SPICLOCK=12500000 # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/ez80f910200kitg/ostest/defconfig b/nuttx/configs/ez80f910200kitg/ostest/defconfig index 0e399cfc7..d8be31a97 100644 --- a/nuttx/configs/ez80f910200kitg/ostest/defconfig +++ b/nuttx/configs/ez80f910200kitg/ostest/defconfig @@ -153,7 +153,6 @@ CONFIG_START_YEAR=2009 CONFIG_START_MONTH=2 CONFIG_START_DAY=25 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -232,7 +231,7 @@ CONFIG_MMCSD_SDIO=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -CONFIG_LOWLEVEL_CONSOLE=y +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART0=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/ez80f910200zco/ostest/defconfig b/nuttx/configs/ez80f910200zco/ostest/defconfig index 7597bcfd6..977dda1dc 100644 --- a/nuttx/configs/ez80f910200zco/ostest/defconfig +++ b/nuttx/configs/ez80f910200zco/ostest/defconfig @@ -156,7 +156,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=11 CONFIG_START_DAY=26 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -235,7 +234,7 @@ CONFIG_MMCSD_SDIO=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART0=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/fire-stm32v2/nsh/defconfig b/nuttx/configs/fire-stm32v2/nsh/defconfig index 8e371686b..2fb623a0d 100644 --- a/nuttx/configs/fire-stm32v2/nsh/defconfig +++ b/nuttx/configs/fire-stm32v2/nsh/defconfig @@ -257,7 +257,6 @@ CONFIG_START_YEAR=2011 CONFIG_START_MONTH=7 CONFIG_START_DAY=5 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -366,7 +365,7 @@ CONFIG_ENC28J60_FREQUENCY=20000000 # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART1=y CONFIG_ARCH_HAVE_USART2=y diff --git a/nuttx/configs/shenzhou/nsh/defconfig b/nuttx/configs/shenzhou/nsh/defconfig index 4c73b7a6c..36f8e40fc 100644 --- a/nuttx/configs/shenzhou/nsh/defconfig +++ b/nuttx/configs/shenzhou/nsh/defconfig @@ -264,7 +264,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=9 CONFIG_START_DAY=8 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -356,7 +355,7 @@ CONFIG_MMCSD_SPICLOCK=12500000 # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/shenzhou/nxwm/defconfig b/nuttx/configs/shenzhou/nxwm/defconfig index ccc411a4d..86d17c3ee 100644 --- a/nuttx/configs/shenzhou/nxwm/defconfig +++ b/nuttx/configs/shenzhou/nxwm/defconfig @@ -265,7 +265,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=9 CONFIG_START_DAY=26 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -370,7 +369,7 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/shenzhou/thttpd/defconfig b/nuttx/configs/shenzhou/thttpd/defconfig index e8f189282..ccbcf9ab2 100644 --- a/nuttx/configs/shenzhou/thttpd/defconfig +++ b/nuttx/configs/shenzhou/thttpd/defconfig @@ -251,7 +251,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=9 CONFIG_START_DAY=8 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -343,7 +342,7 @@ CONFIG_MMCSD_SPICLOCK=12500000 # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/sim/cxxtest/defconfig b/nuttx/configs/sim/cxxtest/defconfig index 9c1da5494..648a92851 100644 --- a/nuttx/configs/sim/cxxtest/defconfig +++ b/nuttx/configs/sim/cxxtest/defconfig @@ -127,7 +127,6 @@ CONFIG_START_YEAR=2007 CONFIG_START_MONTH=2 CONFIG_START_DAY=27 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set CONFIG_MUTEX_TYPES=y # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -198,7 +197,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set # CONFIG_STANDARD_SERIAL is not set # CONFIG_USBDEV is not set diff --git a/nuttx/configs/sim/ostest/defconfig b/nuttx/configs/sim/ostest/defconfig index 26d132cd0..aece17569 100644 --- a/nuttx/configs/sim/ostest/defconfig +++ b/nuttx/configs/sim/ostest/defconfig @@ -127,7 +127,6 @@ CONFIG_START_YEAR=2007 CONFIG_START_MONTH=2 CONFIG_START_DAY=27 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set CONFIG_MUTEX_TYPES=y # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -197,7 +196,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set # CONFIG_STANDARD_SERIAL is not set # CONFIG_USBDEV is not set diff --git a/nuttx/configs/stm3240g-eval/discover/defconfig b/nuttx/configs/stm3240g-eval/discover/defconfig index aefa05326..152486d1b 100644 --- a/nuttx/configs/stm3240g-eval/discover/defconfig +++ b/nuttx/configs/stm3240g-eval/discover/defconfig @@ -284,7 +284,6 @@ CONFIG_START_YEAR=2011 CONFIG_START_MONTH=12 CONFIG_START_DAY=6 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -363,7 +362,7 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART3=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm3240g-eval/xmlrpc/defconfig b/nuttx/configs/stm3240g-eval/xmlrpc/defconfig index dd72d6ab3..6b4c9af70 100644 --- a/nuttx/configs/stm3240g-eval/xmlrpc/defconfig +++ b/nuttx/configs/stm3240g-eval/xmlrpc/defconfig @@ -284,7 +284,6 @@ CONFIG_START_YEAR=2011 CONFIG_START_MONTH=12 CONFIG_START_DAY=6 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -355,7 +354,7 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART3=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm32f100rc_generic/nsh/defconfig b/nuttx/configs/stm32f100rc_generic/nsh/defconfig index 41bb86592..a0228a3de 100644 --- a/nuttx/configs/stm32f100rc_generic/nsh/defconfig +++ b/nuttx/configs/stm32f100rc_generic/nsh/defconfig @@ -240,7 +240,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=11 CONFIG_START_DAY=1 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -319,7 +318,7 @@ CONFIG_RTC=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm32f100rc_generic/ostest/defconfig b/nuttx/configs/stm32f100rc_generic/ostest/defconfig index c56503e1f..0041feb50 100644 --- a/nuttx/configs/stm32f100rc_generic/ostest/defconfig +++ b/nuttx/configs/stm32f100rc_generic/ostest/defconfig @@ -239,7 +239,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=11 CONFIG_START_DAY=1 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -310,7 +309,7 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm32f4discovery/cxxtest/defconfig b/nuttx/configs/stm32f4discovery/cxxtest/defconfig index 1b3df6d32..6487742cf 100644 --- a/nuttx/configs/stm32f4discovery/cxxtest/defconfig +++ b/nuttx/configs/stm32f4discovery/cxxtest/defconfig @@ -244,7 +244,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=11 CONFIG_START_DAY=2 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -316,7 +315,7 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm32f4discovery/elf/defconfig b/nuttx/configs/stm32f4discovery/elf/defconfig index 8d98fe696..b6c3ac593 100644 --- a/nuttx/configs/stm32f4discovery/elf/defconfig +++ b/nuttx/configs/stm32f4discovery/elf/defconfig @@ -242,7 +242,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=10 CONFIG_START_DAY=26 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -313,7 +312,7 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm32f4discovery/nxlines/defconfig b/nuttx/configs/stm32f4discovery/nxlines/defconfig index 4de3a0922..8609993ea 100644 --- a/nuttx/configs/stm32f4discovery/nxlines/defconfig +++ b/nuttx/configs/stm32f4discovery/nxlines/defconfig @@ -260,7 +260,6 @@ CONFIG_START_YEAR=2011 CONFIG_START_MONTH=12 CONFIG_START_DAY=6 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -349,7 +348,7 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm32f4discovery/ostest/defconfig b/nuttx/configs/stm32f4discovery/ostest/defconfig index d260a87cb..b29622c8e 100644 --- a/nuttx/configs/stm32f4discovery/ostest/defconfig +++ b/nuttx/configs/stm32f4discovery/ostest/defconfig @@ -259,7 +259,6 @@ CONFIG_START_YEAR=2009 CONFIG_START_MONTH=9 CONFIG_START_DAY=21 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -330,7 +329,7 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm32f4discovery/winbuild/defconfig b/nuttx/configs/stm32f4discovery/winbuild/defconfig index 311dd075d..ac8a18c9b 100644 --- a/nuttx/configs/stm32f4discovery/winbuild/defconfig +++ b/nuttx/configs/stm32f4discovery/winbuild/defconfig @@ -259,7 +259,6 @@ CONFIG_START_YEAR=2009 CONFIG_START_MONTH=9 CONFIG_START_DAY=21 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -330,7 +329,7 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/xtrs/README.txt b/nuttx/configs/xtrs/README.txt index 9f94ed9ad..1a63d3a90 100644 --- a/nuttx/configs/xtrs/README.txt +++ b/nuttx/configs/xtrs/README.txt @@ -54,9 +54,10 @@ Configuring NuttX 1) From a POSIX window: cd tools - ./configure.sh z80sim/pashello + ./configure.sh xtrs/ostest 2) From a CMD.exe window setenv.bat + make The setenv.bat will need to be updated to include the PATH to the XTRS hex2cmd program. @@ -72,9 +73,7 @@ Configuring NuttX which will give you the steps you would need to do to convert this configuration to build in other, Unix-like environments. - 3. This configuration was last verified sucessfully prior to the - the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run - natively under Cygwin. The current build requires ca. 3.2.1 SDCC. + 3. The current build requires ca. 3.2.1 SDCC. nsh @@ -84,10 +83,33 @@ Configuring NuttX This configuration can be selected by: + 1) From a POSIX window: cd tools ./configure.sh xtrs/nsh - cd - - . ./setenv.sh + 2) From a CMD.exe window + setenv.bat + make + + The setenv.bat will need to be updated to include the PATH to the XTRS + hex2cmd program. + + NOTES: + + 1. This configuration uses the mconf-based configuration tool. See the + "Reconfiguring" section below for information about changing this + configuration. + + 2. The default setup for this configuration uses a windows native build. + See the section entitled "Reconfiguring for Linux, OSX, or Cygwin" + which will give you the steps you would need to do to convert this + configuration to build in other, Unix-like environments. + + 3. The current build requires ca. 3.2.1 SDCC. + + 4. This configuration depends on configs/xtrs/src/xtrs_serial.c which + is incomplete. At compile time, the following symbols are undefined: + + ctrl, baud, rs232_xmtisr, rs232_recvisr, ch pashello @@ -99,10 +121,28 @@ Configuring NuttX This configuration can be selected by: + 1) From a POSIX window: cd tools ./configure.sh xtrs/pashello - cd - - . ./setenv.sh + 2) From a CMD.exe window + setenv.bat + make + + The setenv.bat will need to be updated to include the PATH to the XTRS + hex2cmd program. + + NOTES: + + 1. This configuration uses the mconf-based configuration tool. See the + "Reconfiguring" section below for information about changing this + configuration. + + 2. The default setup for this configuration uses a windows native build. + See the section entitled "Reconfiguring for Linux, OSX, or Cygwin" + which will give you the steps you would need to do to convert this + configuration to build in other, Unix-like environments. + + 3. The current build requires ca. 3.2.1 SDCC. Reconfiguring NuttX ^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/configs/xtrs/nsh/appconfig b/nuttx/configs/xtrs/nsh/appconfig deleted file mode 100644 index ef9401691..000000000 --- a/nuttx/configs/xtrs/nsh/appconfig +++ /dev/null @@ -1,44 +0,0 @@ -############################################################################ -# configs/xtrs/nsh/appconfig -# -# Copyright (C) 2011-2012 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. -# -############################################################################ - -# Path to example in apps/examples containing the user_start entry point - -CONFIGURED_APPS += examples/nsh - -# The NSH Library - -CONFIGURED_APPS += system/readline -CONFIGURED_APPS += nshlib - diff --git a/nuttx/configs/xtrs/nsh/defconfig b/nuttx/configs/xtrs/nsh/defconfig index dc4e59556..cc3d4da2f 100644 --- a/nuttx/configs/xtrs/nsh/defconfig +++ b/nuttx/configs/xtrs/nsh/defconfig @@ -1,137 +1,153 @@ -############################################################################ -# configs/xtrs/nsh/defconfig -# -# Copyright (C) 2007-2010, 2012 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. -# -############################################################################ -# -# Architecture selection # -CONFIG_ARCH="z80" -CONFIG_ARCH_Z80=y -CONFIG_ARCH_CHIP="z80" -CONFIG_ARCH_CHIP_Z80=y -CONFIG_ARCH_BOARD="xtrs" -CONFIG_ARCH_BOARD_XTRS=y -CONFIG_DRAM_SIZE=65536 +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_LINUX is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +CONFIG_WINDOWS_NATIVE=y +# CONFIG_WINDOWS_CYGWIN is not set +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set +# CONFIG_WINDOWS_MKLINK is not set # -# Z80sim specific device driver settings +# Build Configuration # -CONFIG_UART_RXBUFSIZE=256 -CONFIG_UART_TXBUFSIZE=256 +# CONFIG_APPS_DIR="..\apps" +# CONFIG_BUILD_2PASS is not set # -# General build options +# Binary Output Formats # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set -CONFIG_LINKER_START_AREA=0x5200 +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_SYMBOLS is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set +CONFIG_ARCH_Z80=y +CONFIG_ARCH="z80" +CONFIG_ARCH_CHIP="z80" +CONFIG_BOARD_LOOPSPERMSEC=100 +CONFIG_ARCH_CHIP_Z80=y +# CONFIG_ARCH_CHIP_Z8F6403 is not set +# CONFIG_ARCH_CHIP_Z8F6423 is not set +# CONFIG_ARCH_CHIP_EZ80F91 is not set +# CONFIG_ARCH_CHIP_EZ80F92 is not set +# CONFIG_ARCH_CHIP_EZ80F93 is not set +CONFIG_Z80_TOOLCHAIN_SDCCW=y +CONFIG_LINKER_HOME_AREA=0x5200 CONFIG_LINKER_CODE_AREA=0x5300 +CONFIG_LINKER_DATA_AREA=0x8000 CONFIG_LINKER_ROM_AT_0000=y +# CONFIG_ARCH_HAVEHEAD is not set # -# General OS setup +# Architecture Options # -CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_DEBUG=n -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y -CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=n -CONFIG_TASK_NAME_SIZE=0 -CONFIG_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=21 -CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=n -CONFIG_DEV_CONSOLE=n -CONFIG_DEV_LOWCONSOLE=n -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n -CONFIG_SDCLONE_DISABLE=y +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_IRQPRIO is not set +# CONFIG_ARCH_STACKDUMP is not set +# CONFIG_ENDIAN_BIG is not set # -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. +# Board Settings # -# There are certain dependency relationships in these -# features. +CONFIG_DRAM_START=0x0000 +CONFIG_DRAM_SIZE=65536 + # -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. +# Boot options # -CONFIG_DISABLE_CLOCK=n -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_DISABLE_PTHREAD=y -CONFIG_DISABLE_SIGNALS=n -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_DISABLE_ENVIRON=y -CONFIG_DISABLE_POLL=y +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set # -# Misc libc settings +# Board Selection # -CONFIG_NOPRINTF_FIELDWIDTH=y +CONFIG_ARCH_BOARD_XTRS=y +# CONFIG_ARCH_BOARD_Z80SIM is not set +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="xtrs" # -# Allow for architecture optimized implementations +# Common Board Options # -# The architecture can provide optimized versions of the -# following to improve sysem performance +CONFIG_NSH_MMCSDMINOR=0 + +# +# Board-Specific Options # -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n + +# +# RTOS Features +# +CONFIG_MSEC_PER_TICK=10 +CONFIG_RR_INTERVAL=0 +# CONFIG_SCHED_INSTRUMENTATION is not set +CONFIG_TASK_NAME_SIZE=0 +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2012 +CONFIG_START_MONTH=12 +CONFIG_START_DAY=9 +CONFIG_DEV_CONSOLE=y +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_DISABLE_OS_API=y +# CONFIG_DISABLE_CLOCK is not set +CONFIG_DISABLE_POSIX_TIMERS=y +CONFIG_DISABLE_PTHREAD=y +# CONFIG_DISABLE_SIGNALS is not set +CONFIG_DISABLE_MQUEUE=y +CONFIG_DISABLE_MOUNTPOINT=y +CONFIG_DISABLE_ENVIRON=y +CONFIG_DISABLE_POLL=y # # Sizes of configurable things (0 disables) @@ -142,8 +158,6 @@ CONFIG_NPTHREAD_KEYS=0 CONFIG_NFILE_DESCRIPTORS=6 CONFIG_NFILE_STREAMS=6 CONFIG_NAME_MAX=32 -CONFIG_STDIO_BUFFER_SIZE=0 -CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_MQ_MSGS=0 CONFIG_MQ_MAXMSGSIZE=0 CONFIG_MAX_WDOGPARMS=2 @@ -151,77 +165,340 @@ CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 # -# TCP/IP and UDP support via uIP +# Stack and heap information +# +# CONFIG_CUSTOM_STACK is not set +CONFIG_IDLETHREAD_STACKSIZE=1024 +CONFIG_USERMAIN_STACKSIZE=1024 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=1024 + +# +# Device Drivers +# +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +# CONFIG_DEV_LOWCONSOLE is not set +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +# CONFIG_UART_SERIAL_CONSOLE is not set +CONFIG_NO_SERIAL_CONSOLE=y + +# +# UART Configuration +# +CONFIG_UART_RXBUFSIZE=64 +CONFIG_UART_TXBUFSIZE=64 +CONFIG_UART_BAUD=115200 +CONFIG_UART_BITS=8 +CONFIG_UART_PARITY=0 +CONFIG_UART_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set + +# +# System Logging Device Options +# + +# +# System Logging +# +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_NET is not set + +# +# File Systems +# + +# +# File system configuration +# +# CONFIG_FS_RAMMAP is not set + +# +# System Logging +# +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0x00000000 +CONFIG_HEAP2_SIZE=0 +# CONFIG_GRAN is not set + +# +# Binary Formats # -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set # -# UIP Network Utilities +# Library Routines # -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 +CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=0 +# CONFIG_LIBM is not set +CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set # -# Settings for examples/nsh +# Basic CXX Support # +# CONFIG_C99_BOOL8 is not set +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Named Applications +# +# CONFIG_NAMEDAPP is not set + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_NETTEST is not set +CONFIG_EXAMPLES_NSH=y +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +# CONFIG_EXAMPLES_OSTEST is not set +# CONFIG_EXAMPLES_PASHELLO is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WLAN is not set + +# +# Interpreters +# + +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# ModBus +# + +# +# FreeModbus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +CONFIG_NSH_LIBRARY=y + +# +# Disable Individual commands +# +# CONFIG_NSH_DISABLE_CAT is not set +# CONFIG_NSH_DISABLE_CD is not set +# CONFIG_NSH_DISABLE_CP is not set +# CONFIG_NSH_DISABLE_DD is not set +# CONFIG_NSH_DISABLE_ECHO is not set +# CONFIG_NSH_DISABLE_EXEC is not set +# CONFIG_NSH_DISABLE_EXIT is not set +# CONFIG_NSH_DISABLE_FREE is not set +# CONFIG_NSH_DISABLE_GET is not set +# CONFIG_NSH_DISABLE_HELP is not set +# CONFIG_NSH_DISABLE_HEXDUMP is not set +# CONFIG_NSH_DISABLE_IFCONFIG is not set +# CONFIG_NSH_DISABLE_KILL is not set +# CONFIG_NSH_DISABLE_LOSETUP is not set +# CONFIG_NSH_DISABLE_LS is not set +# CONFIG_NSH_DISABLE_MB is not set +# CONFIG_NSH_DISABLE_MKDIR is not set +# CONFIG_NSH_DISABLE_MKFATFS is not set +# CONFIG_NSH_DISABLE_MKFIFO is not set +# CONFIG_NSH_DISABLE_MKRD is not set +# CONFIG_NSH_DISABLE_MH is not set +# CONFIG_NSH_DISABLE_MOUNT is not set +# CONFIG_NSH_DISABLE_MW is not set +# CONFIG_NSH_DISABLE_NSFMOUNT is not set +# CONFIG_NSH_DISABLE_PS is not set +# CONFIG_NSH_DISABLE_PING is not set +# CONFIG_NSH_DISABLE_PUT is not set +# CONFIG_NSH_DISABLE_PWD is not set +# CONFIG_NSH_DISABLE_RM is not set +# CONFIG_NSH_DISABLE_RMDIR is not set +# CONFIG_NSH_DISABLE_SET is not set +# CONFIG_NSH_DISABLE_SH is not set +# CONFIG_NSH_DISABLE_SLEEP is not set +# CONFIG_NSH_DISABLE_TEST is not set +# CONFIG_NSH_DISABLE_UMOUNT is not set +# CONFIG_NSH_DISABLE_UNSET is not set +# CONFIG_NSH_DISABLE_USLEEP is not set +# CONFIG_NSH_DISABLE_WGET is not set +# CONFIG_NSH_DISABLE_XD is not set +CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_FILEIOSIZE=1024 -CONFIG_NSH_STRERROR=n CONFIG_NSH_LINELEN=40 CONFIG_NSH_NESTDEPTH=3 -CONFIG_NSH_DISABLESCRIPT=n -CONFIG_NSH_DISABLEBG=n -CONFIG_NSH_ROMFSETC=n +# CONFIG_NSH_DISABLESCRIPT is not set +# CONFIG_NSH_DISABLEBG is not set CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 -CONFIG_NSH_ROMFSMOUNTPT="/etc" -CONFIG_NSH_INITSCRIPT="init.d/rcS" -CONFIG_NSH_ROMFSDEVNO=0 -CONFIG_NSH_ROMFSSECTSIZE=64 -CONFIG_NSH_FATDEVNO=1 -CONFIG_NSH_FATSECTSIZE=512 -CONFIG_NSH_FATNSECTORS=1024 -CONFIG_NSH_FATMOUNTPT="/tmp" +# CONFIG_NSH_CONDEV is not set +# CONFIG_NSH_ARCHINIT is not set # -# Stack and heap information +# NxWidgets/NxWM +# + +# +# System NSH Add-Ons +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=1024 -CONFIG_USERMAIN_STACKSIZE=1024 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# FLASH Program Installation # +# CONFIG_SYSTEM_INSTALL is not set -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# readline() +# +CONFIG_SYSTEM_READLINE=y +CONFIG_READLINE_ECHO=y + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set diff --git a/nuttx/configs/xtrs/nsh/setenv.bat b/nuttx/configs/xtrs/nsh/setenv.bat new file mode 100644 index 000000000..0df2ba4b6 --- /dev/null +++ b/nuttx/configs/xtrs/nsh/setenv.bat @@ -0,0 +1,54 @@ +@echo off + +rem configs/xtrs/nsh/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the SDCC toolchain for windows. + +set PATH=C:\Program Files (x86)\SDCC/bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% + +rem This is the location where the XTRS hex2cmd program is available +rem set PATH=????:%PATH% + +echo %PATH% diff --git a/nuttx/configs/xtrs/nsh/setenv.sh b/nuttx/configs/xtrs/nsh/setenv.sh deleted file mode 100755 index 99d45f97a..000000000 --- a/nuttx/configs/xtrs/nsh/setenv.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# configs/xtrs/nsh/setenv.sh -# -# 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 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. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - -export SDCC_BIN=/usr/local/bin -export PATH=${SDCC_BIN}:/sbin:/usr/sbin:${PATH_ORIG} - -echo "PATH : ${PATH}" diff --git a/nuttx/configs/xtrs/ostest/defconfig b/nuttx/configs/xtrs/ostest/defconfig index 32a7711fc..cf87886a2 100644 --- a/nuttx/configs/xtrs/ostest/defconfig +++ b/nuttx/configs/xtrs/ostest/defconfig @@ -69,7 +69,6 @@ CONFIG_ARCH_CHIP_Z80=y # CONFIG_ARCH_CHIP_EZ80F91 is not set # CONFIG_ARCH_CHIP_EZ80F92 is not set # CONFIG_ARCH_CHIP_EZ80F93 is not set -# CONFIG_Z80_TOOLCHAIN_SDCCL is not set CONFIG_Z80_TOOLCHAIN_SDCCW=y CONFIG_LINKER_HOME_AREA=0x5200 CONFIG_LINKER_CODE_AREA=0x5300 @@ -89,7 +88,7 @@ CONFIG_LINKER_ROM_AT_0000=y # # Board Settings # -CONFIG_DRAM_START= +CONFIG_DRAM_START=0x0000 CONFIG_DRAM_SIZE=65536 # @@ -129,7 +128,6 @@ CONFIG_START_YEAR=2008 CONFIG_START_MONTH=2 CONFIG_START_DAY=21 # CONFIG_DEV_CONSOLE is not set -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -199,7 +197,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/xtrs/pashello/appconfig b/nuttx/configs/xtrs/pashello/appconfig deleted file mode 100644 index 7cb5a7cf2..000000000 --- a/nuttx/configs/xtrs/pashello/appconfig +++ /dev/null @@ -1,43 +0,0 @@ -############################################################################ -# configs/xtrs/pashello/appconfig -# -# Copyright (C) 2011 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. -# -############################################################################ - -# Path to example in apps/examples containing the user_start entry point - -CONFIGURED_APPS += examples/pashello - -# Path to the Pascal p-code runtime interpreter module - -CONFIGURED_APPS += interpreters/pcode - diff --git a/nuttx/configs/xtrs/pashello/defconfig b/nuttx/configs/xtrs/pashello/defconfig index 52d4e6b83..d0b5d8245 100644 --- a/nuttx/configs/xtrs/pashello/defconfig +++ b/nuttx/configs/xtrs/pashello/defconfig @@ -1,138 +1,154 @@ -############################################################################ -# configs/xtrs/pashello/defconfig -# -# Copyright (C) 2008-2010, 2012 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. -# -############################################################################ -# -# Architecture selection # -CONFIG_ARCH="z80" +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_LINUX is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +CONFIG_WINDOWS_NATIVE=y +# CONFIG_WINDOWS_CYGWIN is not set +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set +# CONFIG_WINDOWS_MKLINK is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="..\apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_SYMBOLS is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set CONFIG_ARCH_Z80=y +CONFIG_ARCH="z80" CONFIG_ARCH_CHIP="z80" +CONFIG_BOARD_LOOPSPERMSEC=100 CONFIG_ARCH_CHIP_Z80=y -CONFIG_ARCH_BOARD="xtrs" -CONFIG_ARCH_BOARD_XTRS=y -CONFIG_DRAM_SIZE=65536 +# CONFIG_ARCH_CHIP_Z8F6403 is not set +# CONFIG_ARCH_CHIP_Z8F6423 is not set +# CONFIG_ARCH_CHIP_EZ80F91 is not set +# CONFIG_ARCH_CHIP_EZ80F92 is not set +# CONFIG_ARCH_CHIP_EZ80F93 is not set +# CONFIG_Z80_TOOLCHAIN_SDCCL is not set +CONFIG_Z80_TOOLCHAIN_SDCCW=y +CONFIG_LINKER_HOME_AREA=0x5200 +CONFIG_LINKER_CODE_AREA=0x5300 +CONFIG_LINKER_DATA_AREA=0x8000 +CONFIG_LINKER_ROM_AT_0000=y +# CONFIG_ARCH_HAVEHEAD is not set # -# xtrs specific device driver settings +# Architecture Options # -CONFIG_UART_RXBUFSIZE=256 -CONFIG_UART_TXBUFSIZE=256 +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_IRQPRIO is not set +# CONFIG_ARCH_STACKDUMP is not set +# CONFIG_ENDIAN_BIG is not set # -# General build options +# Board Settings # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n +CONFIG_DRAM_START=0x0000 +CONFIG_DRAM_SIZE=65536 -CONFIG_LINKER_START_AREA=0x5200 -CONFIG_LINKER_CODE_AREA=0x5300 -CONFIG_LINKER_ROM_AT_0000=y +# +# Boot options +# +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set # -# General OS setup +# Board Selection # -CONFIG_USER_ENTRYPOINT="pashello_main" -CONFIG_DEBUG=n -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y -CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=n -CONFIG_TASK_NAME_SIZE=0 -CONFIG_START_YEAR=2008 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=21 -CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=n -CONFIG_DEV_CONSOLE=n -CONFIG_DEV_LOWCONSOLE=n -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n -CONFIG_SDCLONE_DISABLE=y +CONFIG_ARCH_BOARD_XTRS=y +# CONFIG_ARCH_BOARD_Z80SIM is not set +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="xtrs" # -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. +# Common Board Options # -# There are certain dependency relationships in these -# features. + # -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. +# Board-Specific Options # + +# +# RTOS Features +# +CONFIG_MSEC_PER_TICK=10 +CONFIG_RR_INTERVAL=0 +# CONFIG_SCHED_INSTRUMENTATION is not set +CONFIG_TASK_NAME_SIZE=0 +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2012 +CONFIG_START_MONTH=12 +CONFIG_START_DAY=9 +CONFIG_DEV_CONSOLE=y +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="pashello_main" +CONFIG_DISABLE_OS_API=y CONFIG_DISABLE_CLOCK=y CONFIG_DISABLE_POSIX_TIMERS=y CONFIG_DISABLE_PTHREAD=y CONFIG_DISABLE_SIGNALS=y CONFIG_DISABLE_MQUEUE=y CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_DISABLE_ENVIRON=y +# CONFIG_DISABLE_ENVIRON is not set CONFIG_DISABLE_POLL=y -# -# Misc libc settings -# -CONFIG_NOPRINTF_FIELDWIDTH=y - -# -# Allow for architecture optimized implementations -# -# The architecture can provide optimized versions of the -# following to improve sysem performance -# -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n - # # Sizes of configurable things (0 disables) # @@ -142,8 +158,6 @@ CONFIG_NPTHREAD_KEYS=0 CONFIG_NFILE_DESCRIPTORS=4 CONFIG_NFILE_STREAMS=4 CONFIG_NAME_MAX=32 -CONFIG_STDIO_BUFFER_SIZE=0 -CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_MQ_MSGS=0 CONFIG_MQ_MAXMSGSIZE=0 CONFIG_MAX_WDOGPARMS=2 @@ -151,62 +165,287 @@ CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 # -# TCP/IP and UDP support via uIP +# Stack and heap information +# +# CONFIG_CUSTOM_STACK is not set +CONFIG_IDLETHREAD_STACKSIZE=1024 +CONFIG_USERMAIN_STACKSIZE=1024 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=1024 + +# +# Device Drivers +# +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +CONFIG_DEV_LOWCONSOLE=y +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART=y +CONFIG_MCU_SERIAL=y +CONFIG_UART_SERIAL_CONSOLE=y +# CONFIG_NO_SERIAL_CONSOLE is not set + # -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n +# UART Configuration +# +CONFIG_UART_RXBUFSIZE=64 +CONFIG_UART_TXBUFSIZE=64 +CONFIG_UART_BAUD=115200 +CONFIG_UART_BITS=8 +CONFIG_UART_PARITY=0 +CONFIG_UART_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set # -# UIP Network Utilities +# System Logging Device Options # -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 # -# Settings for examples/nsh -CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_CMD_SIZE=40 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 +# System Logging +# +# CONFIG_RAMLOG is not set # -# Stack and heap information +# Networking Support +# +# CONFIG_NET is not set + +# +# File Systems # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=1024 -CONFIG_USERMAIN_STACKSIZE=1024 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# File system configuration # +# CONFIG_FS_RAMMAP is not set -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# System Logging +# +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0x00000000 +CONFIG_HEAP2_SIZE=0 +# CONFIG_GRAN is not set + +# +# Binary Formats +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# +CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=0 +CONFIG_LIB_HOMEDIR="/" +# CONFIG_LIBM is not set +CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_C99_BOOL8 is not set +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Named Applications +# +# CONFIG_NAMEDAPP is not set + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_NETTEST is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +# CONFIG_EXAMPLES_OSTEST is not set +CONFIG_EXAMPLES_PASHELLO=y +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WLAN is not set + +# +# Interpreters +# + +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +CONFIG_INTERPRETERS_PCODE=y + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# ModBus +# + +# +# FreeModbus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM +# + +# +# System NSH Add-Ons +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set diff --git a/nuttx/configs/xtrs/pashello/setenv.bat b/nuttx/configs/xtrs/pashello/setenv.bat new file mode 100644 index 000000000..fbedd244a --- /dev/null +++ b/nuttx/configs/xtrs/pashello/setenv.bat @@ -0,0 +1,54 @@ +@echo off + +rem configs/xtrs/pashello/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the SDCC toolchain for windows. + +set PATH=C:\Program Files (x86)\SDCC/bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% + +rem This is the location where the XTRS hex2cmd program is available +rem set PATH=????:%PATH% + +echo %PATH% diff --git a/nuttx/configs/xtrs/pashello/setenv.sh b/nuttx/configs/xtrs/pashello/setenv.sh deleted file mode 100755 index 4e2e98e31..000000000 --- a/nuttx/configs/xtrs/pashello/setenv.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# configs/xtrs/pashello/setenv.sh -# -# 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. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - -export SDCC_BIN=/usr/local/bin -export PATH=${SDCC_BIN}:/sbin:/usr/sbin:${PATH_ORIG} - -echo "PATH : ${PATH}" diff --git a/nuttx/configs/xtrs/src/xtr_serial.c b/nuttx/configs/xtrs/src/xtr_serial.c index 1a84abee5..eb6846179 100644 --- a/nuttx/configs/xtrs/src/xtr_serial.c +++ b/nuttx/configs/xtrs/src/xtr_serial.c @@ -55,12 +55,13 @@ #include #include #include +#include #include "up_arch.h" #include "os_internal.h" #include "up_internal.h" -#ifdef USE_SERIAL_DRIVER +#ifdef USE_SERIALDRIVER /**************************************************************************** * Definitions diff --git a/nuttx/configs/z16f2800100zcog/ostest/defconfig b/nuttx/configs/z16f2800100zcog/ostest/defconfig index f9ed65727..defd3d5ef 100644 --- a/nuttx/configs/z16f2800100zcog/ostest/defconfig +++ b/nuttx/configs/z16f2800100zcog/ostest/defconfig @@ -153,7 +153,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=11 CONFIG_START_DAY=29 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -223,7 +222,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART0=y CONFIG_ARCH_HAVE_UART1=y diff --git a/nuttx/configs/z16f2800100zcog/pashello/defconfig b/nuttx/configs/z16f2800100zcog/pashello/defconfig index aa0fb0b1a..f3067a9e7 100644 --- a/nuttx/configs/z16f2800100zcog/pashello/defconfig +++ b/nuttx/configs/z16f2800100zcog/pashello/defconfig @@ -153,7 +153,6 @@ CONFIG_START_YEAR=2008 CONFIG_START_MONTH=1 CONFIG_START_DAY=28 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -223,7 +222,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART0=y CONFIG_ARCH_HAVE_UART1=y diff --git a/nuttx/configs/z80sim/README.txt b/nuttx/configs/z80sim/README.txt index 50e2c7028..595a17783 100644 --- a/nuttx/configs/z80sim/README.txt +++ b/nuttx/configs/z80sim/README.txt @@ -27,7 +27,7 @@ Configuring NuttX 1) From a POSIX window: cd tools - ./configure.sh z80sim/pashello + ./configure.sh z80sim/ostest 2) From a CMD.exe window setenv.bat @@ -56,7 +56,7 @@ Configuring NuttX 1) From a POSIX window: cd tools - ./configure.sh z80sim/pashello + ./configure.sh z80sim/nsh 2) From a CMD.exe window setenv.bat diff --git a/nuttx/configs/z80sim/nsh/defconfig b/nuttx/configs/z80sim/nsh/defconfig index 5b21b97bf..1f8edacb1 100644 --- a/nuttx/configs/z80sim/nsh/defconfig +++ b/nuttx/configs/z80sim/nsh/defconfig @@ -69,8 +69,12 @@ CONFIG_ARCH_CHIP_Z80=y # CONFIG_ARCH_CHIP_EZ80F91 is not set # CONFIG_ARCH_CHIP_EZ80F92 is not set # CONFIG_ARCH_CHIP_EZ80F93 is not set -# CONFIG_Z80_TOOLCHAIN_SDCCL is not set CONFIG_Z80_TOOLCHAIN_SDCCW=y +CONFIG_LINKER_HOME_AREA=0x0000 +CONFIG_LINKER_CODE_AREA=0x0200 +CONFIG_LINKER_DATA_AREA=0x8000 +# CONFIG_LINKER_ROM_AT_0000 is not set +# CONFIG_ARCH_HAVEHEAD is not set # # Architecture Options @@ -84,7 +88,7 @@ CONFIG_Z80_TOOLCHAIN_SDCCW=y # # Board Settings # -CONFIG_DRAM_START= +CONFIG_DRAM_START=0x0000 CONFIG_DRAM_SIZE=65536 # @@ -125,7 +129,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=12 CONFIG_START_DAY=7 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -195,7 +198,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/z80sim/ostest/defconfig b/nuttx/configs/z80sim/ostest/defconfig index 656f71fd1..a961d550d 100644 --- a/nuttx/configs/z80sim/ostest/defconfig +++ b/nuttx/configs/z80sim/ostest/defconfig @@ -69,8 +69,12 @@ CONFIG_ARCH_CHIP_Z80=y # CONFIG_ARCH_CHIP_EZ80F91 is not set # CONFIG_ARCH_CHIP_EZ80F92 is not set # CONFIG_ARCH_CHIP_EZ80F93 is not set -# CONFIG_Z80_TOOLCHAIN_SDCCL is not set CONFIG_Z80_TOOLCHAIN_SDCCW=y +CONFIG_LINKER_HOME_AREA=0x0000 +CONFIG_LINKER_CODE_AREA=0x0200 +CONFIG_LINKER_DATA_AREA=0x8000 +# CONFIG_LINKER_ROM_AT_0000 is not set +# CONFIG_ARCH_HAVEHEAD is not set # # Architecture Options @@ -84,7 +88,7 @@ CONFIG_Z80_TOOLCHAIN_SDCCW=y # # Board Settings # -CONFIG_DRAM_START= +CONFIG_DRAM_START=0x0000 CONFIG_DRAM_SIZE=65536 # @@ -124,7 +128,6 @@ CONFIG_START_YEAR=2007 CONFIG_START_MONTH=2 CONFIG_START_DAY=21 # CONFIG_DEV_CONSOLE is not set -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -194,7 +197,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART=y CONFIG_MCU_SERIAL=y @@ -289,6 +292,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # # Basic CXX Support # +# CONFIG_C99_BOOL8 is not set # CONFIG_HAVE_CXX is not set # diff --git a/nuttx/configs/z80sim/pashello/defconfig b/nuttx/configs/z80sim/pashello/defconfig index 16124f39b..a8d565ce2 100644 --- a/nuttx/configs/z80sim/pashello/defconfig +++ b/nuttx/configs/z80sim/pashello/defconfig @@ -69,8 +69,12 @@ CONFIG_ARCH_CHIP_Z80=y # CONFIG_ARCH_CHIP_EZ80F91 is not set # CONFIG_ARCH_CHIP_EZ80F92 is not set # CONFIG_ARCH_CHIP_EZ80F93 is not set -# CONFIG_Z80_TOOLCHAIN_SDCCL is not set CONFIG_Z80_TOOLCHAIN_SDCCW=y +CONFIG_LINKER_HOME_AREA=0x0000 +CONFIG_LINKER_CODE_AREA=0x0200 +CONFIG_LINKER_DATA_AREA=0x8000 +# CONFIG_LINKER_ROM_AT_0000 is not set +# CONFIG_ARCH_HAVEHEAD is not set # # Architecture Options @@ -84,7 +88,7 @@ CONFIG_Z80_TOOLCHAIN_SDCCW=y # # Board Settings # -CONFIG_DRAM_START= +CONFIG_DRAM_START=0x0000 CONFIG_DRAM_SIZE=65536 # @@ -124,7 +128,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=12 CONFIG_START_DAY=7 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -194,13 +197,12 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART=y CONFIG_MCU_SERIAL=y -CONFIG_STANDARD_SERIAL=y -# CONFIG_UART_SERIAL_CONSOLE is not set -CONFIG_NO_SERIAL_CONSOLE=y +CONFIG_UART_SERIAL_CONSOLE=y +# CONFIG_NO_SERIAL_CONSOLE is not set # # UART Configuration @@ -272,6 +274,7 @@ CONFIG_HEAP2_SIZE=0 CONFIG_STDIO_BUFFER_SIZE=0 CONFIG_STDIO_LINEBUFFER=y CONFIG_NUNGET_CHARS=0 +CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBM is not set CONFIG_NOPRINTF_FIELDWIDTH=y # CONFIG_LIBC_FLOATINGPOINT is not set diff --git a/nuttx/configs/z8encore000zco/ostest/defconfig b/nuttx/configs/z8encore000zco/ostest/defconfig index 7ff44faae..b098c682b 100644 --- a/nuttx/configs/z8encore000zco/ostest/defconfig +++ b/nuttx/configs/z8encore000zco/ostest/defconfig @@ -144,7 +144,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=11 CONFIG_START_DAY=28 # CONFIG_DEV_CONSOLE is not set -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -214,7 +213,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART0=y CONFIG_ARCH_HAVE_UART1=y diff --git a/nuttx/configs/z8f64200100kit/ostest/defconfig b/nuttx/configs/z8f64200100kit/ostest/defconfig index 1650600cd..caa685419 100644 --- a/nuttx/configs/z8f64200100kit/ostest/defconfig +++ b/nuttx/configs/z8f64200100kit/ostest/defconfig @@ -144,7 +144,6 @@ CONFIG_START_YEAR=2008 CONFIG_START_MONTH=2 CONFIG_START_DAY=17 # CONFIG_DEV_CONSOLE is not set -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -214,7 +213,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART0=y CONFIG_ARCH_HAVE_UART1=y diff --git a/nuttx/drivers/loop.c b/nuttx/drivers/loop.c index df96da59f..b5b5d82d8 100644 --- a/nuttx/drivers/loop.c +++ b/nuttx/drivers/loop.c @@ -215,7 +215,7 @@ static ssize_t loop_read(FAR struct inode *inode, unsigned char *buffer, size_t start_sector, unsigned int nsectors) { FAR struct loop_struct_s *dev; - size_t nbytesread; + ssize_t nbytesread; off_t offset; int ret; diff --git a/nuttx/drivers/serial/Kconfig b/nuttx/drivers/serial/Kconfig index 3dfd23dd1..a1e0dff49 100644 --- a/nuttx/drivers/serial/Kconfig +++ b/nuttx/drivers/serial/Kconfig @@ -3,10 +3,12 @@ # see misc/tools/kconfig-language.txt. # -config LOWLEVEL_CONSOLE +config DEV_LOWCONSOLE bool "Low-level console support" default n depends on ARCH_LOWPUTC + ---help--- + Use the simple, low-level, write-only serial console driver (minimal support) config 16550_UART bool "16550 UART Chip support" @@ -317,7 +319,7 @@ config STANDARD_SERIAL bool "Enable standard \"upper-half\" serial driver" default y if MCU_SERIAL default n if !MCU_SERIAL - depends on !LOWLEVEL_CONSOLE + depends on !DEV_LOWCONSOLE ---help--- Enable the standard, upper-half serial driver used by most MCU serial peripherals. diff --git a/nuttx/drivers/serial/serial.c b/nuttx/drivers/serial/serial.c index 9ffcd75dc..9708eb5bc 100644 --- a/nuttx/drivers/serial/serial.c +++ b/nuttx/drivers/serial/serial.c @@ -232,7 +232,9 @@ static int uart_putxmitchar(FAR uart_dev_t *dev, int ch) } } - /* We won't get here */ + /* We won't get here. Some compilers may complain that this code is + * unreachable. + */ return OK; } diff --git a/nuttx/libc/string/lib_strcasestr.c b/nuttx/libc/string/lib_strcasestr.c index 5a8d53bee..7f17a686d 100644 --- a/nuttx/libc/string/lib_strcasestr.c +++ b/nuttx/libc/string/lib_strcasestr.c @@ -127,7 +127,9 @@ FAR char *strcasestr(FAR const char *str, FAR const char *substr) candidate++; } - /* Won't get here, but some compilers might complain */ + /* Won't get here, but some compilers might complain. Others might complain + * about this code being unreachable too. + */ return NULL; } diff --git a/nuttx/libc/string/lib_strstr.c b/nuttx/libc/string/lib_strstr.c index 02f4809d2..7a60a680d 100644 --- a/nuttx/libc/string/lib_strstr.c +++ b/nuttx/libc/string/lib_strstr.c @@ -97,7 +97,9 @@ char *strstr(const char *str, const char *substr) candidate++; } - /* Won't get here, but some compilers might complain */ + /* Won't get here, but some compilers might complain. Other compilers + * might complain about this code being unreachable too. + */ return NULL; } diff --git a/nuttx/sched/Kconfig b/nuttx/sched/Kconfig index 4a3e87745..ab0de5b47 100644 --- a/nuttx/sched/Kconfig +++ b/nuttx/sched/Kconfig @@ -57,12 +57,6 @@ config DEV_CONSOLE Set if architecture-specific logic provides /dev/console. Enables stdout, stderr, stdin. -config DEV_LOWCONSOLE - bool "enable low-level serial console" - default n - ---help--- - Use the simple, low-level, write-only serial console driver (minimul support) - config MUTEX_TYPES: bool "Enable mutex types" default n diff --git a/nuttx/sched/prctl.c b/nuttx/sched/prctl.c index d71a0e174..3db83d3d7 100644 --- a/nuttx/sched/prctl.c +++ b/nuttx/sched/prctl.c @@ -157,8 +157,14 @@ int prctl(int option, ...) goto errout; } + /* Not reachable unless CONFIG_TASK_NAME_SIZE is > 0. NOTE: This might + * change if additional commands are supported. + */ + +#if CONFIG_TASK_NAME_SIZE > 0 va_end(ap); return OK; +#endif errout: va_end(ap); -- cgit v1.2.3 From 50909ac4e225c152e48e7e423f4489b65c2d70d4 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 9 Dec 2012 18:20:49 +0000 Subject: Some initial changes for 8051 build update git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5423 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/8051/src/Makefile | 205 ++-------------------------- nuttx/arch/8051/src/Makefile.sdccl | 273 +++++++++++++++++++++++++++++++++++++ nuttx/configs/pjrc-8051/Make.defs | 146 ++++++++++++++++---- nuttx/configs/pjrc-8051/setenv.sh | 32 ++++- 4 files changed, 427 insertions(+), 229 deletions(-) create mode 100644 nuttx/arch/8051/src/Makefile.sdccl (limited to 'nuttx') diff --git a/nuttx/arch/8051/src/Makefile b/nuttx/arch/8051/src/Makefile index 61e40d84b..867024b62 100644 --- a/nuttx/arch/8051/src/Makefile +++ b/nuttx/arch/8051/src/Makefile @@ -33,203 +33,22 @@ # ############################################################################ --include $(TOPDIR)/Make.defs - -CFLAGS += -I$(TOPDIR)/sched -ASFLAGS = -x -j -g -l -s -p -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -D__ASSEMBLY__ - -SSRCS = -ASRCS = $(SSRCS:.S=$(ASMEXT)) -AOBJS = $(ASRCS:$(ASMEXT)=$(OBJEXT)) -CSRCS = up_initialize.c up_idle.c up_interruptcontext.c \ - up_initialstate.c up_unblocktask.c up_blocktask.c \ - up_releasepending.c up_reprioritizertr.c \ - up_exit.c up_assert.c up_allocateheap.c \ - up_irq.c up_savecontext.c up_restorecontext.c \ - up_timerisr.c up_putc.c up_debug.c up_delay.c -COBJS = $(CSRCS:.c=$(OBJEXT)) -SRCS = $(SSRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -SDCCLIBDIR = /usr/local/share/sdcc/lib/large-stack-auto -SDCCPATH = -L$(SDCCLIBDIR) -SDCCLIBS = -llibfloat.lib -llibint.lib -lliblong.lib -llibmysdcc.lib -lmcs51.lib - -LINKSSRCS = up_head.S -LINKASRCS = $(LINKSSRCS:.S=$(ASMEXT)) -LINKOBJS = $(LINKASRCS:$(ASMEXT)=$(OBJEXT)) -LINKLIBS ?= -LIBPATHS = -L"$(TOPDIR)/lib" -LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS))) - -TESTSRCS = up_irqtest.c -TESTOBJS = $(TESTSRCS:.c=$(OBJEXT)) -TESTLINKOBJS = up_head$(OBJEXT) -TESTEXTRAOBJS = up_savecontext$(OBJEXT) up_restorecontext$(OBJEXT) - -BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board - -IRAM_SIZE = 0x100 -DEF_STACK_BASE = 0x24 -LDFLAGS += --model-large --nostdlib \ - --data-loc $(DEF_STACK_BASE) --iram-size $(IRAM_SIZE) \ - --code-loc 0x2100 --code-size 0x5f40 \ - --xram-loc $(IRAM_SIZE) --xram-size 0x1f00 - -DEPSRCS = $(SRCS) $(LINKSSRCS) - -HEAP1_BASE = ${shell \ - if [ -e pass1.mem ]; then \ - cat pass1.mem | grep "EXTERNAL RAM" | \ - sed -e "s/[ ][ ]*/ /g" | cut -d' ' -f5 ; \ - else \ - echo $(IRAM_SIZE) ; \ - fi \ - } -DEF_HEAP2_BASE = 0x6000 -HEAP2_BASE = ${shell \ - if [ -e pass1.mem ]; then \ - cat pass1.mem | grep "ROM/EPROM/FLASH" | \ - sed -e "s/[ ][ ]*/ /g" | cut -d' ' -f4 ; \ - else \ - echo $(DEF_HEAP2_BASE) ; \ - fi \ - } -STACK_BASE = ${shell \ - if [ -e pass1.mem ]; then \ - cat pass1.mem | grep "Stack starts" | \ - cut -d' ' -f4 ; \ - else \ - echo $(DEF_STACK_BASE) ; \ - fi \ - } - -all: up_head$(OBJEXT) libarch$(LIBEXT) - -.PHONY: board/libboard$(LIBEXT) - -$(ASRCS) $(LINKASRCS): %$(ASMEXT): %.S - $(CPP) -P $(CPPFLAGS) $< -o $@ - -$(AOBJS) $(LINKOBJS): $(ASRCS) $(LINKASRCS) - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(TESTOBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -# Create a header file that contains addressing information needed by the code - -pass1.mem: +# Makefile fragments -up_mem.h: pass1.mem - @echo "#ifndef __ARCH_MEM_H" >up_mem.h - @echo "#define __ARCH_MEM_H" >>up_mem.h - @echo "" >>up_mem.h - @echo "#define UP_DEFAULT_STACK_BASE $(DEF_STACK_BASE)" >>up_mem.h - @echo "#define UP_DEFAULT_HEAP1_BASE $(IRAM_SIZE)" >> up_mem.h - @echo "#define UP_DEFAULT_HEAP2_BASE $(DEF_HEAP2_BASE)" >> up_mem.h - @echo "" >>up_mem.h - @echo "#define UP_STACK_BASE $(STACK_BASE)" >>up_mem.h - @echo "#if UP_STACK_BASE > UP_DEFAULT_STACK_BASE" >>up_mem.h - @echo "# error \"Stack overlap: $(DEF_STACK_BASE) < $(STACK_BASE)\"" >>up_mem.h - @echo "#elif UP_STACK_BASE < UP_DEFAULT_STACK_BASE" >>up_mem.h - @echo "# warning \"Wasted stack: $(DEF_STACK_BASE) > $(STACK_BASE)\"" >>up_mem.h - @echo "#endif" >>up_mem.h - @echo "" >>up_mem.h - @echo "#define UP_HEAP1_BASE $(HEAP1_BASE)" >> up_mem.h - @echo "#define UP_HEAP1_END 0x2000" >> up_mem.h - @echo "" >>up_mem.h - @echo "#define UP_HEAP2_BASE $(HEAP2_BASE)" >> up_mem.h - @echo "#define UP_HEAP2_END 0x8000" >> up_mem.h - @echo "" >>up_mem.h - @echo "#endif /* __ARCH_MEM_H */" >>up_mem.h - -# Combine all objects in this directory into a library - -libarch$(LIBEXT): up_mem.h $(OBJS) - $(call ARCHIVE, $@, $(OBJS)) - -# This is a kludge to work around some conflicting symbols in libsdcc.liXqueb - -$(SDCCLIBDIR)/libmysdcc.lib: $(SDCCLIBDIR)/libsdcc.lib - $(Q) cat $(SDCCLIBDIR)/libsdcc.lib | \ - grep -v calloc | grep -v malloc | grep -v realloc | \ - grep -v free | grep -v vprintf | grep -v _strncpy | \ - grep -v _strchr | grep -v _strlen | grep -v _strcmp | \ - grep -v _strcpy | grep -v _memcmp | grep -v _memcpy | \ - grep -v _memset \ - > libmysdcc.lib - $(Q) mv -f libmysdcc.lib $(SDCCLIBDIR)/libmysdcc.lib - -# This builds the libboard library in the board/ subdirectory - -board/libboard$(LIBEXT): - $(Q) $(MAKE) -C board TOPDIR=$(TOPDIR) libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES) - -# This target builds the final executable - -pass1.hex: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) board/libboard$(LIBEXT) - @echo "LD: $@" - $(Q) "$(CC)" $(LDFLAGS) $(LIBPATHS) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \ - $(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@ - $(Q) rm -f up_mem.h - $(Q) rm -f up_allocateheap$(OBJEXT) libarch$(LIBEXT) - $(Q) $(MAKE) TOPDIR=$(TOPDIR) libarch$(LIBEXT) - -nuttx.hex: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) - @echo "LD: $@" - $(Q) "$(CC)" $(LDFLAGS) $(LIBPATHS) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \ - $(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@ - -nuttx$(EXEEXT): pass1.hex nuttx.hex - $(Q) rm -f pass1.* - $(Q) packihx nuttx.hex > $(TOPDIR)/nuttx$(EXEEXT) - $(Q) cp -f nuttx.map $(TOPDIR)/. - -# This is part of the top-level export target - -export_head: board/libboard$(LIBEXT) p_head$(OBJEXT) - $(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \ - cp -f up_head$(OBJEXT) "$(EXPORT_DIR)/startup"; \ - else \ - echo "$(EXPORT_DIR)/startup does not exist"; \ - exit 1; \ - fi - -# This target builds a test program to verify interrupt context switching. irqtest is -# a PHONY target that just sets upt the up_irqtest build correctly - -up_irqtest.hex: $(TESTOBJS) - $(Q) "$(CC)" $(LDFLAGS) -L. $(SDCCPATH) $(TESTLINKOBJS) $(TESTOBJS) $(TESTEXTRAOBJS) $(SDCCLIBS) -o $@ - -irqtest: - $(Q) $(MAKE) TOPDIR=../../.. up_irqtest.hex +-include $(TOPDIR)/Make.defs +-include chip/Make.defs +-include board/Make.defs -# Build dependencies +# Check for SDCC native windows build -.depend: Makefile up_mem.h $(DEPSRCS) - $(Q) if [ -e board/Makefile ]; then \ - $(MAKE) -C board TOPDIR=$(TOPDIR) depend ; \ - fi - $(Q) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ +ifeq ($(CONFIG_WINDOWS_NATIVE),y) -depend: .depend + # SDCC Windows native build -clean: - $(Q) if [ -e board/Makefile ]; then \ - $(MAKE) -C board TOPDIR=$(TOPDIR) clean ; \ - fi - $(call DELFILE, libarch$(LIBEXT)) - $(call DELFILE, up_mem.h) - $(call CLEAN) + include Makefile.sdccw +else -distclean: clean - $(Q) if [ -e board/Makefile ]; then \ - $(MAKE) -C board TOPDIR=$(TOPDIR) distclean ; \ - fi - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) + # SDCC in a POSIX environment (Linux, OSX, or Cygwin/MSYS) --include Make.dep + include Makefile.sdccl +endif diff --git a/nuttx/arch/8051/src/Makefile.sdccl b/nuttx/arch/8051/src/Makefile.sdccl new file mode 100644 index 000000000..e90ef23e9 --- /dev/null +++ b/nuttx/arch/8051/src/Makefile.sdccl @@ -0,0 +1,273 @@ +############################################################################ +# arch/8051/src/Makefile.sdccl +# +# Copyright (C) 2007, 2008, 2011-2012 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. +# +############################################################################ + +-include $(TOPDIR)/Make.defs + +# Tools +# CFLAGS, CPPFLAGS, ASFLAGS, LDFLAGS are set in $(TOPDIR)/Make.defs + +CFLAGS += -I$(TOPDIR)/sched +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -D__ASSEMBLY__ + +LDFLAGS += --model-large --nostdlib --data-loc $(DEF_STACK_BASE) \ + --iram-size $(IRAM_SIZE) --code-loc 0x2100 --code-size 0x5f40 \ + --xram-loc $(IRAM_SIZE) --xram-size 0x1f00 + +# Files and directories +# There should be one head source (.asm file) + +HEAD_SSRC = up_head.S +HEAD_ASRC = $(HEAD_SSRC:.S=$(ASMEXT)) +HEAD_OBJ = $(HEAD_ASRC:$(ASMEXT)=$(OBJEXT)) + +# Assembly sources and objects + +SSRCS = +ASRCS = $(SSRCS:.S=$(ASMEXT)) +AOBJS = $(ASRCS:$(ASMEXT)=$(OBJEXT)) + +# C sources and objects + +CSRCS = up_initialize.c up_idle.c up_interruptcontext.c up_initialstate.c \ + up_unblocktask.c up_blocktask.c up_releasepending.c \ + up_reprioritizertr.c up_exit.c up_assert.c up_allocateheap.c \ + up_irq.c up_savecontext.c up_restorecontext.c up_timerisr.c up_putc.c \ + up_debug.c up_delay.c +COBJS = $(CSRCS:.c=$(OBJEXT)) + +# All sources and objcts + +SRCS = $(SSRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +DEPSRCS = $(SRCS) $(HEAD_SSRC) + +# Board path + +BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board + +# Source path + +VPATH = chip:common:board + +# Libraries + +SDCCLIBS = -llibfloat.lib -llibint.lib -lliblong.lib -llibmysdcc.lib -lmcs51.lib + +LINKLIBS ?= +LIBPATHS = -L"$(TOPDIR)/lib" +LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS))) + +# Test sources + +TESTSRCS = up_irqtest.c +TESTOBJS = $(TESTSRCS:.c=$(OBJEXT)) +TESTLINKOBJS = up_head$(OBJEXT) +TESTEXTRAOBJS = up_savecontext$(OBJEXT) up_restorecontext$(OBJEXT) + +# Memory + +HEAP1_BASE = ${shell \ + if [ -e pass1.mem ]; then \ + cat pass1.mem | grep "EXTERNAL RAM" | \ + sed -e "s/[ ][ ]*/ /g" | cut -d' ' -f5 ; \ + else \ + echo $(IRAM_SIZE) ; \ + fi \ + } +DEF_HEAP2_BASE = 0x6000 +HEAP2_BASE = ${shell \ + if [ -e pass1.mem ]; then \ + cat pass1.mem | grep "ROM/EPROM/FLASH" | \ + sed -e "s/[ ][ ]*/ /g" | cut -d' ' -f4 ; \ + else \ + echo $(DEF_HEAP2_BASE) ; \ + fi \ + } +STACK_BASE = ${shell \ + if [ -e pass1.mem ]; then \ + cat pass1.mem | grep "Stack starts" | \ + cut -d' ' -f4 ; \ + else \ + echo $(DEF_STACK_BASE) ; \ + fi \ + } + +# Targets + +all: up_head$(OBJEXT) libarch$(LIBEXT) + +.PHONY: board/libboard$(LIBEXT) + +$(ASRCS) $(HEAD_ASRC): %$(ASMEXT): %.S + $(CPP) -P $(CPPFLAGS) $< -o $@ + +$(AOBJS) $(HEAD_OBJ): $(ASRCS) $(HEAD_ASRC) + $(call ASSEMBLE, $<, $@) + +$(COBJS) $(TESTOBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +# This is a kludge to work around some conflicting symbols in the SDCC libraries + +$(TOPDIR)/lib/$(SDCCLIB): $(SDCC_LIBDIR)/$(SDCCLIB) + $(Q) cp $(SDCC_LIBDIR)/$(SDCCLIB) $(TOPDIR)/lib/$(SDCCLIB) + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _calloc.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _malloc.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _realloc.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _free.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) printf_large.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) sprintf.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) vprintf.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) strcpy.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) strlen.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strcat.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strchr.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strcmp.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strcspn.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strncat.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strncmp.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strncpy.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strpbrk.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strrchr.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strspn.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strstr.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _strtok.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _memchr.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _memcmp.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _memcpy.rel + $(Q) sdar d $(TOPDIR)/lib/$(SDCCLIB) _memset.rel + +# Create a header file that contains addressing information needed by the code + +up_mem.h: pass1.mem + @echo "#ifndef __ARCH_MEM_H" >up_mem.h + @echo "#define __ARCH_MEM_H" >>up_mem.h + @echo "" >>up_mem.h + @echo "#define UP_DEFAULT_STACK_BASE $(DEF_STACK_BASE)" >>up_mem.h + @echo "#define UP_DEFAULT_HEAP1_BASE $(IRAM_SIZE)" >> up_mem.h + @echo "#define UP_DEFAULT_HEAP2_BASE $(DEF_HEAP2_BASE)" >> up_mem.h + @echo "" >>up_mem.h + @echo "#define UP_STACK_BASE $(STACK_BASE)" >>up_mem.h + @echo "#if UP_STACK_BASE > UP_DEFAULT_STACK_BASE" >>up_mem.h + @echo "# error \"Stack overlap: $(DEF_STACK_BASE) < $(STACK_BASE)\"" >>up_mem.h + @echo "#elif UP_STACK_BASE < UP_DEFAULT_STACK_BASE" >>up_mem.h + @echo "# warning \"Wasted stack: $(DEF_STACK_BASE) > $(STACK_BASE)\"" >>up_mem.h + @echo "#endif" >>up_mem.h + @echo "" >>up_mem.h + @echo "#define UP_HEAP1_BASE $(HEAP1_BASE)" >> up_mem.h + @echo "#define UP_HEAP1_END 0x2000" >> up_mem.h + @echo "" >>up_mem.h + @echo "#define UP_HEAP2_BASE $(HEAP2_BASE)" >> up_mem.h + @echo "#define UP_HEAP2_END 0x8000" >> up_mem.h + @echo "" >>up_mem.h + @echo "#endif /* __ARCH_MEM_H */" >>up_mem.h + +# Combine all objects in this directory into a library + +libarch$(LIBEXT): up_mem.h $(OBJS) + $(call ARCHIVE, $@, $(OBJS)) + +# This builds the libboard library in the board/ subdirectory + +board/libboard$(LIBEXT): + $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES) + +# This target builds the final executable + +pass1.hex: up_mem.h $(TOPDIR)/lib/$(SDCCLIB) $(HEAD_OBJ) board/libboard$(LIBEXT) + @echo "LD: $@" + $(Q) "$(CC)" $(LDFLAGS) $(LIBPATHS) -L$(BOARDDIR) $(SDCCPATH) $(HEAD_OBJ) \ + $(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@ + $(Q) rm -f up_mem.h + $(Q) rm -f up_allocateheap$(OBJEXT) libarch$(LIBEXT) + $(Q) $(MAKE) TOPDIR=$(TOPDIR) libarch$(LIBEXT) + +nuttx.hex: up_mem.h $(TOPDIR)/lib/$(SDCCLIB) $(HEAD_OBJ) + @echo "LD: $@" + $(Q) "$(CC)" $(LDFLAGS) $(LIBPATHS) -L$(BOARDDIR) $(SDCCPATH) $(HEAD_OBJ) \ + $(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@ + +nuttx$(EXEEXT): pass1.hex nuttx.hex + $(Q) rm -f pass1.* + $(Q) packihx nuttx.hex > $(TOPDIR)/nuttx$(EXEEXT) + $(Q) cp -f nuttx.map $(TOPDIR)/. + +# This is part of the top-level export target + +export_head: board/libboard$(LIBEXT) p_head$(OBJEXT) + $(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \ + cp -f up_head$(OBJEXT) "$(EXPORT_DIR)/startup"; \ + else \ + echo "$(EXPORT_DIR)/startup does not exist"; \ + exit 1; \ + fi + +# This target builds a test program to verify interrupt context switching. irqtest is +# a PHONY target that just sets upt the up_irqtest build correctly + +up_irqtest.hex: $(TESTOBJS) + $(Q) "$(CC)" $(LDFLAGS) -L. $(SDCCPATH) $(TESTLINKOBJS) $(TESTOBJS) $(TESTEXTRAOBJS) $(SDCCLIBS) -o $@ + +irqtest: + $(Q) $(MAKE) TOPDIR=../../.. up_irqtest.hex + +# Build dependencies + +.depend: Makefile up_mem.h $(DEPSRCS) + $(Q) if [ -e board/Makefile ]; then \ + $(MAKE) -C board TOPDIR=$(TOPDIR) depend ; \ + fi + $(Q) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ + +depend: .depend + +clean: + $(Q) if [ -e board/Makefile ]; then \ + $(MAKE) -C board TOPDIR=$(TOPDIR) clean ; \ + fi + $(call DELFILE, libarch$(LIBEXT)) + $(call DELFILE, up_mem.h) + $(call CLEAN) + +distclean: clean + $(Q) if [ -e board/Makefile ]; then \ + $(MAKE) -C board TOPDIR=$(TOPDIR) distclean ; \ + fi + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + +-include Make.dep diff --git a/nuttx/configs/pjrc-8051/Make.defs b/nuttx/configs/pjrc-8051/Make.defs index 803455522..d4716dedc 100644 --- a/nuttx/configs/pjrc-8051/Make.defs +++ b/nuttx/configs/pjrc-8051/Make.defs @@ -36,49 +36,135 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk +# These are the directories where the SDCC toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + SDCC_INSTALLDIR = C:\PROGRA~2\SDCC + SDCC_BINDIR = $(SDCC_INSTALLDIR)\bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)\lib\large-stack-auto +else + SDCC_INSTALLDIR = /usr/local + SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/large-stack-auto +endif + +CROSSDEV = +CC = sdcc +CPP = sdcpp +LD = sdld +AS = sdas8051 +AR = sdar -r + +IRAM_SIZE = 0x100 +DEF_STACK_BASE = 0x24 + ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = --debug + ARCHOPTIMIZATION = --debug else - ARCHOPTIMIZATION = + ARCHOPTIMIZATION = endif -ARCHCPUFLAGS = -mmcs51 --stack-auto --model-large --int-long-reent --float-reent -ARCHPICFLAGS = -ARCHWARNINGS = -ARCHDEFINES = -ARCHINCLUDES = -I. -I$(TOPDIR)/include - -CROSSDEV = -CC = sdcc -CPP = sdcpp -LD = aslink -AS = asx8051 -#AR = sdar -r -AR = sdcclib -a - -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) - -ASMEXT = .asm -OBJEXT = .rel -LIBEXT = .lib -EXEEXT = .hex +ARCHCPUFLAGS = -mmcs51 --stack-auto --model-large --int-long-reent --float-reent +ARCHPICFLAGS = +ARCHWARNINGS = +ARCHDEFINES = +ARCHINCLUDES = -I. -I$(TOPDIR)/include + +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = -x -j -g -l -s -p + +SDCCLIB = libsdcc.lib + +ASMEXT = .asm +OBJEXT = .rel +LIBEXT = .lib +EXEEXT = .hex + +# Custom ASSEMBLE definition. The most common toolchain, GCC, uses the +# compiler to assemble files because this has the advantage of running the C +# Pre-Processor against. This is not possible with other SDCC; we need to +# define AS and over-ride the common definition in order to use the assembler +# directly. define ASSEMBLE @echo "AS: $1" @$(AS) $(AFLAGS) $1 endef +# Custom CLEAN definition + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) define CLEAN - @rm -f *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex + $(Q) if exist *.o (del /f /q *.o) + $(Q) if exist *.asm (del /f /q *.asm) + $(Q) if exist *.rel (del /f /q *.rel) + $(Q) if exist *.lst (del /f /q *.lst) + $(Q) if exist *.rst (del /f /q *.rst) + $(Q) if exist *.sym (del /f /q *.sym) + $(Q) if exist *.adb (del /f /q *.adb) + $(Q) if exist *.lnk (del /f /q *.lnk) + $(Q) if exist *.map (del /f /q *.map) + $(Q) if exist *.mem (del /f /q *.mem) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.cmd (del /f /q *.cmd) endef +else +define CLEAN + $(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd +endef +endif -MKDEP = $(TOPDIR)/tools/mkdeps.sh +# Windows native host tool definitions -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe + # Windows-native host tools + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative + + # Use NTFS links or directory copies + +ifeq ($(CONFIG_WINDOWS_MKLINK),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.bat +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.bat +endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.bat + +else + +# Linux/Cygwin host tool definitions + + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # SDCC for Linux, OSX, or Cygwin understands symbolic links. Windows SDCC + # running under Cygwin does not + +ifeq ($(WINTOOL),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh +endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + +endif diff --git a/nuttx/configs/pjrc-8051/setenv.sh b/nuttx/configs/pjrc-8051/setenv.sh index d71c234ba..621bb27b1 100755 --- a/nuttx/configs/pjrc-8051/setenv.sh +++ b/nuttx/configs/pjrc-8051/setenv.sh @@ -1,7 +1,7 @@ #!/bin/bash -# pjrc-8051/setenv.sh +# configs/pjrc-8051/setenv.sh # -# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. +# Copyright (C) 2007-2008, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -32,14 +32,34 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi -export SDCC_BIN=/usr/local/bin -export PATH=${SDCC_BIN}:/sbin:/usr/sbin:${PATH_ORIG} +# +# This is the normal installation directory for SDCC under Linux, OSX +# or Linux: +# +export TOOLCHAIN_BIN=/usr/local/bin +# +# This is the normal installation directory for SDCC under Windows +# +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/SDCC/bin" + +# +# Add the path to the toolchain to the PATH varialble +# +export PATH="${TOOLCHAIN_BIN}":/sbin:/usr/sbin:${PATH_ORIG} echo "PATH : ${PATH}" -- cgit v1.2.3 From 8cb01b42d0c247d9532e1946abf79386f91a931a Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 9 Dec 2012 19:07:01 +0000 Subject: README update git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5424 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/configs/pjrc-8051/README.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'nuttx') diff --git a/nuttx/configs/pjrc-8051/README.txt b/nuttx/configs/pjrc-8051/README.txt index dae92b59b..46084f5d3 100644 --- a/nuttx/configs/pjrc-8051/README.txt +++ b/nuttx/configs/pjrc-8051/README.txt @@ -35,3 +35,20 @@ Then cd sdcc make install +Status +^^^^^^ + +On December 9, 2012, I made updates so that the 8051 port could use the +newest SDCC toolchain (a pre-3.2.1 at that time). However, when I attempted +to build the PJRC-8051 configuration, I got type incompatibility errors +from sched/os_bringup.c. + +I have not been successful working around those bugs and I believe that +these are 8051-related bugs in the SDCC toolchain. This needs to be +revisited with a later version of SDCC. + +This configuration was last successfully built and tested with a ca. +2.6.0 SDCC release. Support for that older toolchain was removed in +NuttX revision -r5423. If you wanted to used those older toolchains, +you would need to revert to a pre-r5423 revision. + -- cgit v1.2.3 From 2b1f75ced63fb51305a97a4f6c9c73141f2689cd Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 10 Dec 2012 17:03:34 +0000 Subject: Add header files for z180 git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5425 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 2 + nuttx/arch/z80/include/z180/arch.h | 77 +++++++ nuttx/arch/z80/include/z180/chip.h | 428 +++++++++++++++++++++++++++++++++++ nuttx/arch/z80/include/z180/io.h | 85 +++++++ nuttx/arch/z80/include/z180/irq.h | 152 +++++++++++++ nuttx/arch/z80/include/z180/limits.h | 82 +++++++ nuttx/arch/z80/include/z180/types.h | 99 ++++++++ nuttx/configs/pjrc-8051/README.txt | 3 +- nuttx/net/net_poll.c | 2 + 9 files changed, 929 insertions(+), 1 deletion(-) create mode 100644 nuttx/arch/z80/include/z180/arch.h create mode 100644 nuttx/arch/z80/include/z180/chip.h create mode 100644 nuttx/arch/z80/include/z180/io.h create mode 100644 nuttx/arch/z80/include/z180/irq.h create mode 100644 nuttx/arch/z80/include/z180/limits.h create mode 100644 nuttx/arch/z80/include/z180/types.h (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index ffa2e719f..128738373 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3773,4 +3773,6 @@ * drivers/serial/Kconfig and sched/Kconfig: Two names for same configuration: CONFIG_LOWLEVEL_CONSOLE is bogus and CONFIG_DEV_LOWCONSOLE is in the wrong Kconfig file. Moved to drivers/serial/Kconfig replacing CONFIG_LOWLEVEL_CONSOLE. + * arch/z80/include/z180: Add header files for z180 chips. Initial versions + are just clones of z80 header files. diff --git a/nuttx/arch/z80/include/z180/arch.h b/nuttx/arch/z80/include/z180/arch.h new file mode 100644 index 000000000..9e2197522 --- /dev/null +++ b/nuttx/arch/z80/include/z180/arch.h @@ -0,0 +1,77 @@ +/**************************************************************************** + * arch/z80/arch.h + * arch/chip/arch.h + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/* This file should never be included directed but, rather, only indirectly + * through nuttx/arch.h (via arch/arch.h) + */ + +#ifndef __ARCH_Z80_INCLUDE_Z180_ARCH_H +#define __ARCH_Z80_INCLUDE_Z180_ARCH_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/**************************************************************************** + * Public Variables + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __ARCH_Z80_INCLUDE_Z180_ARCH_H */ + diff --git a/nuttx/arch/z80/include/z180/chip.h b/nuttx/arch/z80/include/z180/chip.h new file mode 100644 index 000000000..b31c69bcf --- /dev/null +++ b/nuttx/arch/z80/include/z180/chip.h @@ -0,0 +1,428 @@ +/**************************************************************************** + * arch/z80/include/z180/chip.h + * arch/chip/io.h + * + * Copyright (C) 2012 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 __ARCH_Z80_INCLUDE_Z180_CHIP_H +#define __ARCH_Z80_INCLUDE_Z180_CHIP_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Z800180 + * + * The 8-bit Z80180 MPU provides the benefits of reduced system costs and + * also provides full backward compatibility with existing ZiLOG Z80 devices. + * Reduced system costs are obtained by incorporating several key system + * functions on-chip with the CPU. These key functions include I/O devices + * such as DMA, UART, and timer channels. Also included on-chip are wait- + * state generators, a clock oscillator, and an interrupt controller. The + * Z80180 MPU is housed in 80-pin QFP, 68-pin PLCC, and 64-pin DIP packages. + * + * Z80180 Features + * + * Enhanced Z80 CPU + * 1 MB MMU + * 2 DMA channels* + * 2 UARTs* (up to 512 Kbps) + * Two 16-Bit Timers + * Clock Serial I/O + * On-Chip Oscillator + * Power-Down Mode* + * Divide-by-One/Divide-by-Two/Multiply-by-Two Clock Options* + * Programmable Driver Strength for EMI Tuning + * + * * Enhanced on the Z8S180 and Z8L180 MPUs + */ + +#if defined(CONFIG_Z180_CHIP_Z8018006VSG) || /* 68-pin PLCC */ \ + defined(CONFIG_Z180_CHIP_Z8018010VSG) || /* 68-pin PLCC */ \ + defined(CONFIG_Z180_CHIP_Z8018008VSG) || /* 68-pin PLCC */ \ + defined(CONFIG_Z180_CHIP_Z8018010FSG) || /* 80-pin QFP (11 pins N/C) */ \ + defined(CONFIG_Z180_CHIP_Z8018008VEG) || /* 68-pin PLCC */ \ + defined(CONFIG_Z180_CHIP_Z8018006VEG) /* 68-pin PLCC */ + +# undef HAVE_Z8S180 /* Not Z8S180 (5V) or Z8L180 (3.3V) core */ +# define HAVE ROM 0 /* No on-chip ROM */ +# define HAVE_SERIALIO 1 /* Have clocked serial I/O */ +# undef HAVE_WDT /* No Watchdog timer */ +# define HAVE_NTIMERS16 2 /* Two (2) 16-bit timers */ +# define HAVE_NCTCS 0 /* No Counter/Timers (CTCs) */ +# define HAVE_NDMA 2 /* Two (2) DMA channels */ +# define HAVE_NUARTS 2 /* Two (2) UARTs (up to 512 Kbps) */ +# define HAVE_NSCC 0 /* No serial communication controller */ +# define HAVE_NESCC 0 /* No Enhanced Serial Communication Controllers */ +# undef HAVE_16550 /* No 16550 MIMIC */ +# define HAVE_NIOLINES 0 /* No I/O lines */ +# define HAVE_NPAR8 0 /* No 8-bit parallel ports */ +# undef HAVE_IEEE1284 /* No bidirectional centronics interface (IEEE 1284) */ + +#elif defined(CONFIG_Z180_CHIP_Z8018006PSG) || /* 64-pin DIP 6 MHz 5V */ \ + defined(CONFIG_Z180_CHIP_Z8018008FSG) || /* 80-pin QFP (11 pins N/C) 8MHz 5V */ \ + defined(CONFIG_Z180_CHIP_Z8018010PSG) || /* 64-pin DIP 10MHz 5V */ \ + defined(CONFIG_Z180_CHIP_Z8018006PEG) || /* 64-pin DIP 6MHz 5V */ \ + defined(CONFIG_Z180_CHIP_Z8018010VEG) || /* 68-pin PLCC 10MHz 5V*/ \ + defined(CONFIG_Z180_CHIP_Z8018010PEG) || /* 64-pin DIP 10MHz 5V*/ \ + defined(CONFIG_Z180_CHIP_Z8018008PSG) || /* 64-pin DIP 8MHz 5V */ \ + defined(CONFIG_Z180_CHIP_Z8018006FSG) /* 80-pin QFP (11 pins N/C) 6MHz 5V */ + +# undef HAVE_Z8S180 /* Not Z8S180 (5V) or Z8L180 (3.3V) core */ +# define HAVE ROM 0 /* No on-chip ROM */ +# undef HAVE_SERIALIO /* No clocked serial I/O ? */ +# undef HAVE_WDT /* No Watchdog timer */ +# define HAVE_NTIMERS16 2 /* Two (2) 16-bit timers */ +# define HAVE_NCTCS 0 /* No Counter/Timers (CTCs) */ +# define HAVE_NDMA 2 /* Two (2) DMA channels */ +# define HAVE_NUARTS 2 /* Two (2) UARTs (up to 512 Kbps) */ +# define HAVE_NSCC 0 /* No serial communication controller */ +# define HAVE_NESCC 0 /* No Enhanced Serial Communication Controllers */ +# undef HAVE_16550 /* No 16550 MIMIC */ +# define HAVE_NIOLINES 0 /* No I/O lines */ +# define HAVE_NPAR8 0 /* No 8-bit parallel ports */ +# undef HAVE_IEEE1284 /* No bidirectional centronics interface (IEEE 1284) */ + +#elif defined(CONFIG_Z180_CHIP_Z8018000XSO) + defined(CONFIG_Z180_CHIP_Z8018010FEG) + defined(CONFIG_Z180_CHIP_Z8018000WSO) + defined(CONFIG_Z180_CHIP_Z8018008PEG) + +# undef HAVE_Z8S180 /* Not Z8S180 (5V) or Z8L180 (3.3V) core */ +# define HAVE ROM 0 /* No on-chip ROM */ +# define HAVE_SERIALIO 1 /* Have clocked serial I/O */ +# undef HAVE_WDT /* No Watchdog timer */ +# define HAVE_NTIMERS16 2 /* Two (2) 16-bit timers */ +# define HAVE_NCTCS 0 /* No Counter/Timers (CTCs) */ +# define HAVE_NDMA 2 /* Two (2) DMA channels */ +# define HAVE_NUARTS 2 /* Two (2) UARTs (up to 512 Kbps) */ +# define HAVE_NSCC 0 /* No serial communication controller */ +# define HAVE_NESCC 0 /* No Enhanced Serial Communication Controllers */ +# undef HAVE_16550 /* No 16550 MIMIC */ +# define HAVE_NIOLINES 0 /* No I/O lines */ +# define HAVE_NPAR8 0 /* No 8-bit parallel ports */ +# undef HAVE_IEEE1284 /* No bidirectional centronics interface (IEEE 1284) */ + +/* Z80181 + * + * The Z80181 SAC Smart Access Controller is an 8-bit CMOS microprocessor that + * combines a Z180-compatible MPU, one channel of the Z85C30 Serial Communications + * Controller, a Z80 CTC, two 8-bit general-purpose parallel ports, and two Chip + * Select signals, into a single 100-pin Quad Flat Pack package. + * + * Z80181 Features + * + * Enhanced Z80 CPU + * 1 MB MMU + * 2 DMAs + * 2 UARTs + * Two 16-Bit Timers + * Clock Serial I/O + * 1 Channel SCC + * 1 8-Bit Counter/Timer + * 16 I/O Lines + * Emulation Mode + */ + +#elif defined(CONFIG_Z180_CHIP_Z8018110FEG) /* 100 QFP */ + +# undef HAVE_Z8S180 /* Not Z8S180 (5V) or Z8L180 (3.3V) core */ +# define HAVE ROM 0 /* No on-chip ROM */ +# define HAVE_SERIALIO 1 /* Have clocked serial I/O */ +# undef HAVE_WDT /* No Watchdog timer */ +# define HAVE_NTIMERS16 2 /* Two (2) 16-bit timers */ +# define HAVE_NCTCS 1 /* One (1) 8-bit counter/timer */ +# define HAVE_NDMA 2 /* Two (2) DMA channels */ +# define HAVE_NUARTS 2 /* Two (2) UARTs (up to 512 Kbps) */ +# define HAVE_NSCC 1 /* One (1) Z85C30 serial communication controller */ +# define HAVE_NESCC 0 /* No Enhanced Serial Communication Controllers */ +# undef HAVE_16550 /* No 16550 MIMIC */ +# define HAVE_NIOLINES 16 /* Sixteen (16) I/O lines */ +# define HAVE_NPAR8 0 /* No 8-bit parallel ports */ +# undef HAVE_IEEE1284 /* No bidirectional centronics interface (IEEE 1284) */ + +/* Z80182 + * + * The Z80182 and Z8L182 MPUs are smart peripheral controller ICs for modems, fax, + * voice messaging, and other communications applications. It uses the Z80180 + * microprocessor linked with two channels of the industry-standard Z85230 ESCC, + * 24 bits of parallel I/O, and a 16550 MIMIC for direct connection to the IBM PC, + * XT, or AT bus + * + * Z80182 Features + * + * Enhanced Z80 CPU + * 1 MB MMU + * 2 DMAs + * 2 UARTs (up to 512 Kbps) + * Two 16-Bit Timers + * Clock Serial I/O + * Power-Down Mode + * Divide-by-One/Divide-by-Two/Multiply-by-Two Clock Options + * Enhanced Serial Communication Controller (ESCC) (2 Channels) with 32-Bit CRC + * 16550 MIMIC + * 24 Parallel I/O + * 3.3 V and 5 V Version + */ + +#elif defined(CONFIG_Z180_CHIP_Z8018233FSG) || /* 100-pin QFP */ \ + defined(CONFIG_Z180_CHIP_Z8018220AEG) || /* 100-pin LQFP 20MHz 5V */ \ + defined(CONFIG_Z180_CHIP_Z8018216FSG) || /* 100-pin QFP 16MHz 5V */ \ + defined(CONFIG_Z180_CHIP_Z8018216ASG) || /* 100-pin LQFP */ \ + defined(CONFIG_Z180_CHIP_Z8018233ASG) /* 100-pin LQFP 33MHz 5V */ + +# undef HAVE_Z8S180 /* Not Z8S180 (5V) or Z8L180 (3.3V) core */ +# define HAVE ROM 0 /* No on-chip ROM */ +# define HAVE_SERIALIO 1 /* Have clocked serial I/O */ +# undef HAVE_WDT /* No Watchdog timer */ +# define HAVE_NTIMERS16 2 /* Two (2) 16-bit timers ? */ +# define HAVE_NCTCS 0 /* No Counter/Timers (CTCs) */ +# define HAVE_NDMA 2 /* Two (2) DMA channels */ +# define HAVE_NUARTS 2 /* Two (2) UARTs (up to 512 Kbps) */ +# define HAVE_NSCC 0 /* No Z85C30 serial communication controller */ +# define HAVE_NESCC 2 /* Two (2) Z85230 Enhanced Serial Communication Controllers */ +# define HAVE_16550 1 /* Have 16550 MIMIC */ +# define HAVE_NIOLINES 0 /* No I/O lines */ +# define HAVE_NPAR8 3 /* Three (3) 8-bit parallel ports (24-bit) */ +# undef HAVE_IEEE1284 /* No bidirectional centronics interface (IEEE 1284) */ + +/* Z80195 + * + * The Z80195 MPU is a smart peripheral controller device designed for general data + * communications applications, and architected specifically to accommodate all + * input and output (I/O) requirements for serial and parallel connectivity. + * Combining a high-performance CPU core with a variety of system and I/O + * resources, the Z80195 is useful in a broad range of applications. + * + * Z80195 Features + * + * Enhanced Z80 CPU + * 1 MB MMU + * 2 DMAs + * 2 UARTs (up to 512 Kbps) + * Two 16-Bit Timers + * 4 Counter/Timers + * Clock Serial I/O + * Power-Down Mode + * 32 K ROM (185) + * 1 Ch ESCC + * IEEE 1284 Bi-Directional Centronics Parallel Port + * 7 or 24 Bits of I/O + */ + +#elif defined(CONFIG_Z180_CHIP_Z8019520FSG) || /* 100-pin QFP 20MHz 5V */ \ + defined(CONFIG_Z180_CHIP_Z8019533FSG) /* 100-pin QFP 33MHz 5V */ + +# undef HAVE_Z8S180 /* No Z8S180 (5V) or Z8L180 (3.3V) core */ +# undef HAVE ROM 0 /* No 32KB on-chip ROM (z80185 only) */ +# define HAVE_SERIALIO 1 /* Have clocked serial I/O */ +# defube HAVE_WDT 1 /* Have Watchdog timer */ +# define HAVE_NTIMERS16 2 /* Two (2) 16-bit counter/timers */ +# define HAVE_NCTCS 4 /* Four (4) Counter/Timers (CTCs) */ +# define HAVE_NDMA 2 /* Two (2) DMA channels */ +# define HAVE_NUARTS 2 /* Two (2) UARTs (up to 512 Kbps) */ +# define HAVE_NSCC 0 /* No Z85C30 serial communication controller */ +# define HAVE_NESCC 1 /* One (1) Enhanced Serial Communication Controllers (EMSCC) */ +# undef HAVE_16550 /* No 16550 MIMIC */ +# define HAVE_NIOLINES 0 /* No I/O lines */ +# define HAVE_NPAR8 2 /* Two (s) 8-bit parallel ports (or 17-bit IEEE 1284) */ +# define HAVE_IEEE1284 1 /* Have bidirectional centronics interface (IEEE 1284) */ + +/* Z8L180 + * + * The enhanced Z8S180/Z8L180 significantly improves on previous Z80180 models, + * while still providing full backward compatibility with existing ZiLOG Z80 + * devices. The Z8S180/Z8L180 now offers faster execution speeds, power-saving + * modes, and EMI noise reduction. + * + * Z8L180 Features + * + * Enhanced Z80 CPU + * 1 MB MMU + * 2 DMAs* + * 2 UARTs* (up to 512 Kbps) + * Two 16-Bit Timers + * Clock Serial I/O + * On-Chip Oscillator + * Power-Down Mode* + * Divide-by-One/Divide-by-Two/Multiply-by-Two Clock Options* + * Programmable Driver Strength for EMI Tuning + * + * * Enhanced on the Z8S180 and Z8L180 MPUs. + */ + +#elif defined(CONFIG_Z180_CHIP_Z8L18020VSG) || /* 69-pin PLCC */ \ + defined(CONFIG_Z180_CHIP_Z8L18020FSG) || /* 80-pin GFP 20MHz 3.3V */ \ + defined(CONFIG_Z180_CHIP_Z8L18020PSG) + +# define HAVE_Z8S180 1 /* Uses Z8S180 (5V) or Z8L180 (3.3V) core */ +# define HAVE ROM 0 /* No on-chip ROM */ +# define HAVE_SERIALIO 1 /* Have clocked serial I/O */ +# undef HAVE_WDT /* No Watchdog timer */ +# define HAVE_NTIMERS16 2 /* Two (2) 16-bit timers */ +# define HAVE_NCTCS 0 /* No Counter/Timers (CTCs) */ +# define HAVE_NDMA 2 /* Two (2) DMA channels */ +# define HAVE_NUARTS 2 /* Two (2) UARTs (up to 512 Kbps) */ +# define HAVE_NSCC 0 /* No serial communication controller */ +# define HAVE_NESCC 0 /* No Enhanced Serial Communication Controllers */ +# undef HAVE_16550 /* No 16550 MIMIC */ +# define HAVE_NIOLINES 0 /* No I/O lines */ +# define HAVE_NPAR8 0 /* No 8-bit parallel ports */ +# undef HAVE_IEEE1284 /* No bidirectional centronics interface (IEEE 1284) */ + +/* Z8L182 + * + * The Z80182/Z8L182 is a smart peripheral controller IC for modem (in particular + * V. Fast applications), fax, voice messaging and other communications + * applications. It uses the Z80180 microprocessor (Z8S180 MPU core) linked with + * two channels of the industry standard Z85230 ESCC (Enhanced Serial + * Communications Controller), 24 bits of parallel I/O, and a 16550 MIMIC for + * direct connection to the IBM PC, XT, AT bus. + * + * Z8L182 Features + * + * Enhanced Z80 CPU + * 1 MB MMU + * 2 DMAs + * 2 UARTs (up to 512 Kbps) + * Two 16-Bit Timers + * Clock Serial I/O + * Power-Down Mode + * Divide-by-One/Divide-by-Two/Multiply-by-Two Clock Options + * ESCC (2 Channels) with 32-Bit CRC + * 16550 MIMIC + * 24 Parallel I/O + * 3.3 V and 5 V Version + */ + +#elif defined(CONFIG_Z180_CHIP_Z8L18220ASG) || /* 100-pin LQFP */ \ + defined(CONFIG_Z180_CHIP_Z8L18220FSG) || /* 100-pin QFP 20MHz 3.3V */ \ + defined(CONFIG_Z180_CHIP_Z8L18220AEG) + +# define HAVE_Z8S180 1 /* Uses Z8S180 (5V) or Z8L180 (3.3V) core */ +# define HAVE ROM 0 /* No on-chip ROM */ +# define HAVE_SERIALIO 1 /* Have clocked serial I/O */ +# undef HAVE_WDT /* No Watchdog timer */ +# define HAVE_NTIMERS16 2 /* Two (2) 16-bit timers ? */ +# define HAVE_NCTCS 0 /* No Counter/Timers (CTCs) */ +# define HAVE_NDMA 2 /* Two (2) DMA channels */ +# define HAVE_NUARTS 2 /* Two (2) UARTs (up to 512 Kbps) */ +# define HAVE_NSCC 0 /* No Z85C30 serial communication controller */ +# define HAVE_NESCC 2 /* Two (2) Z85230 Enhanced Serial Communication Controllers */ +# define HAVE_16550 1 /* Have 16550 MIMIC */ +# define HAVE_NIOLINES 0 /* No I/O lines */ +# define HAVE_NPAR8 3 /* Three (3) 8-bit parallel ports (24-bit) */ +# undef HAVE_IEEE1284 /* No bidirectional centronics interface (IEEE 1284) */ + +/* Z8SL180 + * + * The enhanced Z8S180/Z8L180 significantly improves on previous Z80180 models, + * while still providing full backward compatibility with existing ZiLOG Z80 + * devices. The Z8S180/Z8L180 now offers faster execution speeds, power-saving + * modes, and EMI noise reduction.This enhanced Z180 design also incorporates + * additional feature enhancements to the ASCIs, DMAs, and STANDBY mode power + * consumption. With the addition of ESCC-like Baud Rate Generators (BRGs), the + * two ASCIs offer the flexibility and capability to transfer data + * asynchronously at rates of up to 512 Kbps. + * + * Z8S180 Features + * + * External Memory - 1 + * Voltage Range - 5.0V + * Communications Controller - CSIO, UART + * Other Features - 1MB MMU, 2xDMA’s, 2xUARTs + * Speed (MHz) - 20, 10, 33 + * Core / CPU Used - Z180 + * Pin Count - 64, 68, 80 + * Timers - 2 + * I/O - Clock Serial + * Package - DIP, PLCC, QFP + */ + +#elif defined(CONFIG_Z180_CHIP_Z8S18020VSG) || /* 68-pin PLCC */ \ + defined(CONFIG_Z180_CHIP_Z8S18020VSG1960) || /* 68-pin PLCC */ \ + defined(CONFIG_Z180_CHIP_Z8S18033VSG) || /* 68-pin PLCC */ \ + defined(CONFIG_Z180_CHIP_Z8S18010FSG) || /* 80-pin QFP */ \ + defined(CONFIG_Z180_CHIP_Z8S18010VEG) || /* 68-pin PLCC */ \ + defined(CONFIG_Z180_CHIP_Z8S18020VEG) || /* 68-pin PLCC */ \ + defined(CONFIG_Z180_CHIP_Z8S18010VSG) || /* 68-pin PLCC */ \ + defined(CONFIG_Z180_CHIP_Z8S18020PSG) || /* 64-pin DIP 10Mhz 5V */ \ + defined(CONFIG_Z180_CHIP_Z8S18033FSG) || /* 80-pin QFP 33MHz 5V */ \ + defined(CONFIG_Z180_CHIP_Z8S18033FEG) || /* 80-pin QFP 33MHz 5V */ \ + defined(CONFIG_Z180_CHIP_Z8S18020FSG) || /* 80-pin QFP 20MHz 5V */ \ + defined(CONFIG_Z180_CHIP_Z8S18033VEG) || /* 68-pin PLCC 33MHz 5V */ \ + defined(CONFIG_Z180_CHIP_Z8S18010PSG) || /* 64-pin DIP 10MHz 5V */ \ + defined(CONFIG_Z180_CHIP_Z8S18020FEG) || \ + defined(CONFIG_Z180_CHIP_Z8S18010PEG) || \ + defined(CONFIG_Z180_CHIP_Z8S18010FEG + +# define HAVE_Z8S180 1 /* Uses Z8S180 (5V) or Z8L180 (3.3V) core */ +# define HAVE ROM 0 /* No on-chip ROM */ +# define HAVE_SERIALIO 1 /* Have clocked serial I/O */ +# undef HAVE_WDT /* No Watchdog timer */ +# define HAVE_NTIMERS16 2 /* Two (2) 16-bit timers */ +# define HAVE_NCTCS 0 /* No Counter/Timers (CTCs) */ +# define HAVE_NDMA 2 /* Two (2) DMA channels */ +# define HAVE_NUARTS 2 /* Two (2) UARTs (up to 512 Kbps) */ +# define HAVE_NSCC 0 /* No serial communication controller */ +# define HAVE_NESCC 0 /* No Enhanced Serial Communication Controllers */ +# undef HAVE_16550 /* No 16550 MIMIC */ +# define HAVE_NIOLINES 0 /* No I/O lines */ +# define HAVE_NPAR8 0 /* No 8-bit parallel ports */ +# undef HAVE_IEEE1284 /* No bidirectional centronics interface (IEEE 1284) */ + +#else +# error "Unrecognized/undefined Z180 chip" +#endif + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/**************************************************************************** + * Inline functions + ****************************************************************************/ + +/**************************************************************************** + * Public Variables + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#endif /* __ARCH_Z80_INCLUDE_Z180_CHIP_H */ diff --git a/nuttx/arch/z80/include/z180/io.h b/nuttx/arch/z80/include/z180/io.h new file mode 100644 index 000000000..a80a6b420 --- /dev/null +++ b/nuttx/arch/z80/include/z180/io.h @@ -0,0 +1,85 @@ +/**************************************************************************** + * arch/z80/include/z80/io.h + * arch/chip/io.h + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/* This file should never be included directed but, rather, only indirectly + * through arch/io.h + */ + +#ifndef __ARCH_Z80_INCLUDE_Z180_IO_H +#define __ARCH_Z80_INCLUDE_Z180_IO_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/**************************************************************************** + * Inline functions + ****************************************************************************/ + +/**************************************************************************** + * Public Variables + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifndef __ASSEMBLY__ +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +EXTERN void outp(char p, char c); +EXTERN char inp(char p); + +#undef EXTERN +#ifdef __cplusplus +} +#endif +#endif + +#endif /* __ARCH_Z80_INCLUDE_Z180_IO_H */ diff --git a/nuttx/arch/z80/include/z180/irq.h b/nuttx/arch/z80/include/z180/irq.h new file mode 100644 index 000000000..3f058591f --- /dev/null +++ b/nuttx/arch/z80/include/z180/irq.h @@ -0,0 +1,152 @@ +/**************************************************************************** + * arch/z80/include/z180/irq.h + * arch/chip/irq.h + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/* This file should never be included directed but, rather, only indirectly + * through nuttx/irq.h (via arch/irq.h) + */ + +#ifndef __ARCH_Z80_INCLUDE_Z180_IRQ_H +#define __ARCH_Z80_INCLUDE_Z180_IRQ_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#ifndef __ASSEMBLY__ +# include +#endif + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Z180 Interrupts */ + +#define Z180_RST0 (0) +#define Z180_RST1 (1) +#define Z180_RST2 (2) +#define Z180_RST3 (3) +#define Z180_RST4 (4) +#define Z180_RST5 (5) +#define Z180_RST6 (6) +#define Z180_RST7 (7) + +#define Z180_IRQ_SYSTIMER Z180_RST7 +#define NR_IRQS (8) + +/* IRQ Stack Frame Format + * + * This stack frame is created on each interrupt. These registers are stored + * in the TCB to many context switches. + */ + +#define XCPT_I (0) /* Offset 0: Saved I w/interrupt state in carry */ +#define XCPT_BC (1) /* Offset 1: Saved BC register */ +#define XCPT_DE (2) /* Offset 2: Saved DE register */ +#define XCPT_IX (3) /* Offset 3: Saved IX register */ +#define XCPT_IY (4) /* Offset 4: Saved IY register */ +#define XCPT_SP (5) /* Offset 5: Offset to SP at time of interrupt */ +#define XCPT_HL (6) /* Offset 6: Saved HL register */ +#define XCPT_AF (7) /* Offset 7: Saved AF register */ +#define XCPT_PC (8) /* Offset 8: Offset to PC at time of interrupt */ + +#define XCPTCONTEXT_REGS (9) +#define XCPTCONTEXT_SIZE (2 * XCPTCONTEXT_REGS) + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +/* This is the type of the register save array */ + +typedef uint16_t chipreg_t; + +/* This struct defines the way the registers are stored. */ + +struct xcptcontext +{ + /* Register save area */ + + chipreg_t regs[XCPTCONTEXT_REGS]; + + /* The following function pointer is non-zero if there + * are pending signals to be processed. + */ + +#ifndef CONFIG_DISABLE_SIGNALS + CODE void *sigdeliver; /* Actual type is sig_deliver_t */ + + /* The following retains that state during signal execution */ + + uint16_t saved_pc; /* Saved return address */ + uint16_t saved_i; /* Saved interrupt state */ +#endif +}; +#endif + +/**************************************************************************** + * Inline functions + ****************************************************************************/ + +/**************************************************************************** + * Public Variables + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifndef __ASSEMBLY__ +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +EXTERN irqstate_t irqsave(void) __naked; +EXTERN void irqrestore(irqstate_t flags) __naked; + +#undef EXTERN +#ifdef __cplusplus +} +#endif +#endif + +#endif /* __ARCH_Z80_INCLUDE_Z180_IRQ_H */ + diff --git a/nuttx/arch/z80/include/z180/limits.h b/nuttx/arch/z80/include/z180/limits.h new file mode 100644 index 000000000..a70118448 --- /dev/null +++ b/nuttx/arch/z80/include/z180/limits.h @@ -0,0 +1,82 @@ +/**************************************************************************** + * arch/z80/include/z180/limits.h + * + * Copyright (C) 2012 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 __ARCH_Z80_INCLUDE_Z180_LIMITS_H +#define __ARCH_Z80_INCLUDE_Z180_LIMITS_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define CHAR_BIT 8 +#define SCHAR_MIN (-SCHAR_MAX - 1) +#define SCHAR_MAX 127 +#define UCHAR_MAX 255 + +/* These could be different on machines where char is unsigned */ + +#ifdef __CHAR_UNSIGNED__ +#define CHAR_MIN 0 +#define CHAR_MAX UCHAR_MAX +#else +#define CHAR_MIN SCHAR_MIN +#define CHAR_MAX SCHAR_MAX +#endif + +#define SHRT_MIN (-SHRT_MAX - 1) +#define SHRT_MAX 32767 +#define USHRT_MAX 65535U + +#define INT_MIN (-INT_MAX - 1) +#define INT_MAX 32767 +#define UINT_MAX 65535U + +/* These change on 32-bit and 64-bit platforms */ + +#define LONG_MIN (-LONG_MAX - 1) +#define LONG_MAX 2147483647L +#define ULONG_MAX 4294967295UL + +/* A pointer is 2 bytes */ + +#define PTR_MIN (-PTR_MAX - 1) +#define PTR_MAX 32767 +#define UPTR_MAX 65535U + +#endif /* __ARCH_Z80_INCLUDE_Z180_LIMITS_H */ diff --git a/nuttx/arch/z80/include/z180/types.h b/nuttx/arch/z80/include/z180/types.h new file mode 100644 index 000000000..0de51cab1 --- /dev/null +++ b/nuttx/arch/z80/include/z180/types.h @@ -0,0 +1,99 @@ +/**************************************************************************** + * arch/z80/include/z180/types.h + * include/arch/chip/types.h + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/* This file should never be included directed but, rather, only indirectly + * through sys/types.h + */ + +#ifndef __ARC_Z80_INCLUDE_Z180_TYPES_H +#define __ARC_Z80_INCLUDE_Z180_TYPES_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Type Declarations + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +/* These are the sizes of the standard integer types. NOTE that these type + * names have a leading underscore character. This file will be included + * (indirectly) by include/stdint.h and typedef'ed to the final name without + * the underscore character. This roundabout way of doings things allows + * the stdint.h to be removed from the include/ directory in the event that + * the user prefers to use the definitions provided by their toolchain header + * files + * + * 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 signed char _int8_t; +typedef unsigned char _uint8_t; + +typedef signed int _int16_t; +typedef unsigned int _uint16_t; + +typedef signed long _int32_t; +typedef unsigned long _uint32_t; + +/* A pointer is 2 bytes */ + +typedef signed int _intptr_t; +typedef unsigned int _uintptr_t; + +/* This is the size of the interrupt state save returned by irqsave() */ + +typedef _uint16_t irqstate_t; + +#endif /* __ASSEMBLY__ */ + +/**************************************************************************** + * Global Function Prototypes + ****************************************************************************/ + +#endif /* __ARC_Z80_INCLUDE_Z180_TYPES_H */ diff --git a/nuttx/configs/pjrc-8051/README.txt b/nuttx/configs/pjrc-8051/README.txt index 46084f5d3..c9c44327e 100644 --- a/nuttx/configs/pjrc-8051/README.txt +++ b/nuttx/configs/pjrc-8051/README.txt @@ -41,7 +41,8 @@ Status On December 9, 2012, I made updates so that the 8051 port could use the newest SDCC toolchain (a pre-3.2.1 at that time). However, when I attempted to build the PJRC-8051 configuration, I got type incompatibility errors -from sched/os_bringup.c. +from sched/os_bringup.c. From what I gather by googling, this is a compiler +bug related to the --stack-auto option. I have not been successful working around those bugs and I believe that these are 8051-related bugs in the SDCC toolchain. This needs to be diff --git a/nuttx/net/net_poll.c b/nuttx/net/net_poll.c index ca594c10f..815c6a71d 100644 --- a/nuttx/net/net_poll.c +++ b/nuttx/net/net_poll.c @@ -141,6 +141,7 @@ static uint16_t poll_interrupt(struct uip_driver_s *dev, FAR void *conn, sem_post(fds->sem); } } + return flags; } #endif /* HAVE_NETPOLL */ @@ -219,6 +220,7 @@ static inline int net_pollsetup(FAR struct socket *psock, struct pollfd *fds) sem_post(fds->sem); } } + uip_unlock(flags); return OK; -- cgit v1.2.3 From 5f72f975b378b95e04ca99973da43ce4227960ce Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 10 Dec 2012 18:40:01 +0000 Subject: Add source files for z180 git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5426 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 2 + nuttx/Documentation/README.html | 6 +- nuttx/README.txt | 3 +- nuttx/arch/z80/Kconfig | 318 +++++++++++++++++++++ nuttx/arch/z80/include/arch.h | 24 +- nuttx/arch/z80/include/io.h | 22 +- nuttx/arch/z80/include/irq.h | 16 +- nuttx/arch/z80/include/limits.h | 10 +- nuttx/arch/z80/include/serial.h | 8 +- nuttx/arch/z80/include/syscall.h | 16 +- nuttx/arch/z80/include/types.h | 6 +- nuttx/arch/z80/include/z180/chip.h | 122 ++++---- nuttx/arch/z80/include/z80/chip.h | 92 ++++++ nuttx/arch/z80/src/z180/Kconfig | 55 ++++ nuttx/arch/z80/src/z180/Make.defs | 55 ++++ nuttx/arch/z80/src/z180/README.txt | 49 ++++ nuttx/arch/z80/src/z180/Toolchain.defs | 75 +++++ nuttx/arch/z80/src/z180/chip.h | 54 ++++ nuttx/arch/z80/src/z180/switch.h | 166 +++++++++++ nuttx/arch/z80/src/z180/up_mem.h | 75 +++++ nuttx/arch/z80/src/z180/z180_copystate.c | 78 +++++ nuttx/arch/z80/src/z180/z180_head.asm | 304 ++++++++++++++++++++ nuttx/arch/z80/src/z180/z180_initialstate.c | 91 ++++++ nuttx/arch/z80/src/z180/z180_io.c | 94 ++++++ nuttx/arch/z80/src/z180/z180_irq.c | 113 ++++++++ nuttx/arch/z80/src/z180/z180_registerdump.c | 91 ++++++ .../arch/z80/src/z180/z180_restoreusercontext.asm | 104 +++++++ nuttx/arch/z80/src/z180/z180_rom.asm | 297 +++++++++++++++++++ nuttx/arch/z80/src/z180/z180_saveusercontext.asm | 143 +++++++++ nuttx/arch/z80/src/z180/z180_schedulesigaction.c | 192 +++++++++++++ nuttx/arch/z80/src/z180/z180_sigdeliver.c | 139 +++++++++ nuttx/arch/z80/src/z80/chip.h | 52 +--- 32 files changed, 2698 insertions(+), 174 deletions(-) create mode 100644 nuttx/arch/z80/include/z80/chip.h create mode 100644 nuttx/arch/z80/src/z180/Kconfig create mode 100644 nuttx/arch/z80/src/z180/Make.defs create mode 100644 nuttx/arch/z80/src/z180/README.txt create mode 100644 nuttx/arch/z80/src/z180/Toolchain.defs create mode 100644 nuttx/arch/z80/src/z180/chip.h create mode 100644 nuttx/arch/z80/src/z180/switch.h create mode 100644 nuttx/arch/z80/src/z180/up_mem.h create mode 100644 nuttx/arch/z80/src/z180/z180_copystate.c create mode 100644 nuttx/arch/z80/src/z180/z180_head.asm create mode 100644 nuttx/arch/z80/src/z180/z180_initialstate.c create mode 100644 nuttx/arch/z80/src/z180/z180_io.c create mode 100644 nuttx/arch/z80/src/z180/z180_irq.c create mode 100644 nuttx/arch/z80/src/z180/z180_registerdump.c create mode 100644 nuttx/arch/z80/src/z180/z180_restoreusercontext.asm create mode 100644 nuttx/arch/z80/src/z180/z180_rom.asm create mode 100644 nuttx/arch/z80/src/z180/z180_saveusercontext.asm create mode 100644 nuttx/arch/z80/src/z180/z180_schedulesigaction.c create mode 100644 nuttx/arch/z80/src/z180/z180_sigdeliver.c (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 128738373..7a2a2cbff 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3775,4 +3775,6 @@ Kconfig file. Moved to drivers/serial/Kconfig replacing CONFIG_LOWLEVEL_CONSOLE. * arch/z80/include/z180: Add header files for z180 chips. Initial versions are just clones of z80 header files. + * arch/z80/src/z180: Add source files for z180 chips. Initial versions + are just clones of z80 source files. diff --git a/nuttx/Documentation/README.html b/nuttx/Documentation/README.html index 771c605c7..ef1803143 100644 --- a/nuttx/Documentation/README.html +++ b/nuttx/Documentation/README.html @@ -46,8 +46,10 @@ | | | `- src/ | | | `-README.txt | | |- z80/ - | | | `- src/ - | | | `- z80/README.txt + | | | |- src/z80 + | | | | `- README.txt + | | | `- src/z180 + | | | `- README.txt | | `- README.txt | |- configs/ | | |- amber/ diff --git a/nuttx/README.txt b/nuttx/README.txt index a133f209a..c94947279 100644 --- a/nuttx/README.txt +++ b/nuttx/README.txt @@ -749,7 +749,8 @@ nuttx | | `-README.txt | `- z80/ | | `- src/ - | | `- z80/README.txt + | | |- z80/README.txt + | | `- z180/README.txt | `- README.txt |- configs/ | |- amber/ diff --git a/nuttx/arch/z80/Kconfig b/nuttx/arch/z80/Kconfig index 12ab5dc0b..a04ecdedd 100644 --- a/nuttx/arch/z80/Kconfig +++ b/nuttx/arch/z80/Kconfig @@ -13,6 +13,324 @@ config ARCH_CHIP_Z80 ---help--- Classic ZiLOG z80 chip +config ARCH_CHIP_Z8018006VSG + bool "Z8018006VSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + ---help--- + Z180: 68-pin PLCC Z80180 + +config ARCH_CHIP_Z8018010VSG + bool "Z8018010VSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + ---help--- + Z180: 68-pin PLCC Z80180 + +config ARCH_CHIP_Z8018008VSG + bool "Z8018008VSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + ---help--- + Z180: 68-pin PLCC Z80180 + +config ARCH_CHIP_Z8018010FSG + bool "Z8018010FSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + ---help--- + Z180: 80-pin QFP (11 pins N/C) Z80180 + +config ARCH_CHIP_Z8018008VEG + bool "Z8018008VEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + ---help--- + Z180: 68-pin PLCC Z80180 + +config ARCH_CHIP_Z8018006VEG + bool "Z8018006VEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + ---help--- + Z180: 68-pin PLCC Z80180 + +config ARCH_CHIP_Z8018006PSG + bool "Z8018006PSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + ---help--- + Z180: 64-pin DIP 6 MHz 5V Z80180 + +config ARCH_CHIP_Z8018008FSG + bool "Z8018008FSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + ---help--- + Z180: 80-pin QFP (11 pins N/C) 8MHz 5V Z80180 + +config ARCH_CHIP_Z8018010PSG + bool "Z8018010PSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + ---help--- + Z180: 64-pin DIP 10MHz 5V Z80180 + +config ARCH_CHIP_Z8018006PEG + bool "Z8018006PEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + ---help--- + Z180: 64-pin DIP 6MHz 5V Z80180 + +config ARCH_CHIP_Z8018010VEG + bool "Z8018010VEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + ---help--- + 68-pin PLCC 10MHz 5V Z80180 + +config ARCH_CHIP_Z8018010PEG + bool "Z8018010PEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + ---help--- + Z180: 64-pin DIP 10MHz 5V Z80180 + +config ARCH_CHIP_Z8018008PSG + bool "Z8018008PSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + ---help--- + Z180: 64-pin DIP 8MHz 5V Z80180 + +config ARCH_CHIP_Z8018006FSG + bool "Z8018006FSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + ---help--- + 80-pin QFP (11 pins N/C) 6MHz 5V Z80180 + +config ARCH_CHIP_Z8018000XSO + bool "Z8018000XSO" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + +config ARCH_CHIP_Z8018010FEG + bool "Z8018010FEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + +config ARCH_CHIP_Z8018000WSO + bool "Z8018000WSO" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + +config ARCH_CHIP_Z8018008PEG + bool "Z8018008PEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80180 + +config ARCH_CHIP_Z8018110FEG + bool "Z8018110FEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80181 + ---help--- + Z180: 100-pin QFP Z80181 + +config ARCH_CHIP_Z8018233FSG + bool "Z8018233FSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80182 + ---help--- + 100-pin QFP Z80182 + +config ARCH_CHIP_Z8018220AEG + bool "Z8018220AEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80182 + ---help--- + Z180: 100-pin LQFP 20MHz 5V Z80182 + +config ARCH_CHIP_Z8018216FSG + bool "Z8018216FSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80182 + ---help--- + Z180: 100-pin QFP 16MHz 5V Z80182 + +config ARCH_CHIP_Z8018216ASG + bool "Z8018216ASG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80182 + ---help--- + Z180: 100-pin LQFP Z80182 + +config ARCH_CHIP_Z8018233ASG + bool "Z8018233ASG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80182 + ---help--- + Z180: 100-pin LQFP 33MHz 5V Z80182 + +config ARCH_CHIP_Z8019520FSG + bool "Z8019520FSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80195 + ---help--- + Z180: 100-pin QFP 20MHz 5V Z80195 + +config ARCH_CHIP_Z8019533FSG + bool "Z8019533FSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z80195 + ---help--- + Z180: 100-pin QFP 33MHz 5V Z80195 + +config ARCH_CHIP_Z8L18020VSG + bool "Z8L18020VSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8L180 + ---help--- + Z180: 68-pinn PLCC Z8L180 + +config ARCH_CHIP_Z8L18020FSG + bool "Z8L18020FSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8L180 + ---help--- + Z180: 80-pin GFP 20MHz 3.3V Z8L180 + +config ARCH_CHIP_Z8L18020PSG + bool "Z8L18020PSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8L180 + +config ARCH_CHIP_Z8L18220ASG + bool "Z8L18220ASG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8L182 + ---help--- + Z180: 100-pin LQFP Z8L182 + +config ARCH_CHIP_Z8L18220FSG + bool "Z8L18220FSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8L182 + ---help--- + 100-pin QFP 20MHz 3.3V Z8L182 + +config ARCH_CHIP_Z8L18220AEG + bool "Z8L18220AEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8L182 + +config ARCH_CHIP_Z8S18020VSG + bool "Z8S18020VSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + ---help--- + Z180: 68-pin PLCC Z8S180 + +config ARCH_CHIP_Z8S18020VSG1960 + bool "Z8S18020VSG1960" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + ---help--- + Z180: 68-pin PLCC Z8S180 + +config ARCH_CHIP_Z8S18033VSG + bool "Z8S18033VSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + ---help--- + Z180: 68-pin PLCC Z8S180 + +config ARCH_CHIP_Z8S18010FSG + bool "Z8S18010FSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + ---help--- + 80-pin QFP Z8S180 + +config ARCH_CHIP_Z8S18010VEG + bool "Z8S18010VEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + ---help--- + Z180: 68-pin PLCC Z8S180 + +config ARCH_CHIP_Z8S18020VEG + bool "Z8S18020VEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + ---help--- + Z180: 68-pin PLCC Z8S180 + +config ARCH_CHIP_Z8S18010VSG + bool "Z8S18010VSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + ---help--- + Z180: 68-pin PLCC Z8S180 + +config ARCH_CHIP_Z8S18020PSG + bool "Z8S18020PSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + ---help--- + 64-pin DIP 10Mhz 5V Z8S180 + +config ARCH_CHIP_Z8S18033FSG + bool "Z8S18033FSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + ---help--- + Z180: 80-pin QFP 33MHz 5V Z8S180 + +config ARCH_CHIP_Z8S18033FEG + bool "Z8S18033FEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + ---help--- + Z180: 80-pin QFP 33MHz 5V Z8S180 + +config ARCH_CHIP_Z8S18020FSG + bool "Z8S18020FSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + ---help--- + 80-pin QFP 20MHz 5V Z8S180 + +config ARCH_CHIP_Z8S18033VEG + bool "Z8S18033VEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + ---help--- + Z180: 68-pin PLCC 33MHz 5V Z8S180 + +config ARCH_CHIP_Z8S18010PSG + bool "Z8S18010PSG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + ---help--- + 64-pin DIP 10MHz 5V Z8S180 + +config ARCH_CHIP_Z8S18020FEG + bool "Z8S18020FEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + +config ARCH_CHIP_Z8S18010PEG + bool "Z8S18010PEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + +config ARCH_CHIP_Z8S18010FEG + bool "Z8S18010FEG" + select ARCH_CHIP_Z180 + select ARCH_CHIP_Z8S180 + config ARCH_CHIP_Z8F6403 bool "Z8F6403" select ARCH_CHIP_Z8 diff --git a/nuttx/arch/z80/include/arch.h b/nuttx/arch/z80/include/arch.h index 112fcde3a..0a0673e03 100644 --- a/nuttx/arch/z80/include/arch.h +++ b/nuttx/arch/z80/include/arch.h @@ -33,12 +33,12 @@ * ****************************************************************************/ -/* This file should never be included directed but, rather, - * only indirectly through nuttx/arch.h +/* This file should never be included directed but, rather, only indirectly + * through nuttx/arch.h */ -#ifndef __ARCH_ARCH_H -#define __ARCH_ARCH_H +#ifndef __ARCH_Z80_INCLUDE_ARCH_H +#define __ARCH_Z80_INCLUDE_ARCH_H /**************************************************************************** * Included Files @@ -47,7 +47,7 @@ #include /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** @@ -66,17 +66,5 @@ * Public Function Prototypes ****************************************************************************/ -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern -#endif - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* __ARCH_ARCH_H */ +#endif /* __ARCH_Z80_INCLUDE_ARCH_H */ diff --git a/nuttx/arch/z80/include/io.h b/nuttx/arch/z80/include/io.h index dacc0bc5b..e07a071d9 100644 --- a/nuttx/arch/z80/include/io.h +++ b/nuttx/arch/z80/include/io.h @@ -34,8 +34,8 @@ * ****************************************************************************/ -#ifndef __ARCH_IO_H -#define __ARCH_IO_H +#ifndef __ARCH_Z80_INCLUDE_IO_H +#define __ARCH_Z80_INCLUDE_IO_H /**************************************************************************** * Included Files @@ -44,7 +44,7 @@ #include /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** @@ -59,18 +59,4 @@ * 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 /* __ARCH_IO_H */ +#endif /* __ARCH_Z80_INCLUDE_IO_H */ diff --git a/nuttx/arch/z80/include/irq.h b/nuttx/arch/z80/include/irq.h index a617540a9..7d482df49 100644 --- a/nuttx/arch/z80/include/irq.h +++ b/nuttx/arch/z80/include/irq.h @@ -48,7 +48,7 @@ #include /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** @@ -63,19 +63,5 @@ * 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 /* __ARCH_Z80_INCLUDE_IRQ_H */ diff --git a/nuttx/arch/z80/include/limits.h b/nuttx/arch/z80/include/limits.h index 3cfd65dc6..3013ec8f4 100644 --- a/nuttx/arch/z80/include/limits.h +++ b/nuttx/arch/z80/include/limits.h @@ -33,17 +33,17 @@ * ****************************************************************************/ -#ifndef __ARCH_LIMITS_H -#define __ARCH_LIMITS_H +#ifndef __ARCH_Z80_INCLUDE_LIMITS_H +#define __ARCH_Z80_INCLUDE_LIMITS_H /**************************************************************************** - * Included Files + * Pre-processor Definitions ****************************************************************************/ #include /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ -#endif /* __ARCH_LIMITS_H */ +#endif /* __ARCH_Z80_INCLUDE_LIMITS_H */ diff --git a/nuttx/arch/z80/include/serial.h b/nuttx/arch/z80/include/serial.h index 2688c045f..2997cd4fa 100644 --- a/nuttx/arch/z80/include/serial.h +++ b/nuttx/arch/z80/include/serial.h @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __ARCH_Z80_INCLUDE_SERIAL_TYPES_H -#define __ARCH_Z80_INCLUDE_SERIAL_TYPES_H +#ifndef __ARCH_Z80_INCLUDE_SERIAL_H +#define __ARCH_Z80_INCLUDE_SERIAL_H /**************************************************************************** * Included Files @@ -43,7 +43,7 @@ #include /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** @@ -54,4 +54,4 @@ * Public Functions ****************************************************************************/ -#endif /* __ARCH_Z80_INCLUDE_SERIAL_TYPES_H */ +#endif /* __ARCH_Z80_INCLUDE_SERIAL_H */ diff --git a/nuttx/arch/z80/include/syscall.h b/nuttx/arch/z80/include/syscall.h index b1894ca34..bc9ebbb11 100644 --- a/nuttx/arch/z80/include/syscall.h +++ b/nuttx/arch/z80/include/syscall.h @@ -45,7 +45,7 @@ ****************************************************************************/ /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** @@ -64,19 +64,5 @@ * 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 /* __ARCH_Z80_INCLUDE_SYSCALL_H */ diff --git a/nuttx/arch/z80/include/types.h b/nuttx/arch/z80/include/types.h index 5b2b5ff16..5e6a90342 100644 --- a/nuttx/arch/z80/include/types.h +++ b/nuttx/arch/z80/include/types.h @@ -37,8 +37,8 @@ * through sys/types.h */ -#ifndef __ARCH_TYPES_H -#define __ARCH_TYPES_H +#ifndef __ARCH_Z80_INCLUDE_TYPES_H +#define __ARCH_Z80_INCLUDE_TYPES_H /**************************************************************************** * Included Files @@ -58,4 +58,4 @@ * Global Function Prototypes ****************************************************************************/ -#endif /* __ARCH_TYPES_H */ +#endif /* __ARCH_Z80_INCLUDE_TYPES_H */ diff --git a/nuttx/arch/z80/include/z180/chip.h b/nuttx/arch/z80/include/z180/chip.h index b31c69bcf..f2e140a10 100644 --- a/nuttx/arch/z80/include/z180/chip.h +++ b/nuttx/arch/z80/include/z180/chip.h @@ -41,10 +41,36 @@ * Included Files ****************************************************************************/ +#ifndef __ASSEMBLY__ +# include +#endif + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* Bits in the Z80 FLAGS register ***************************************************/ + +#define Z180_C_FLAG 0x01 /* Bit 0: Carry flag */ +#define Z180_N_FLAG 0x02 /* Bit 1: Add/Subtract flag */ +#define Z180_PV_FLAG 0x04 /* Bit 2: Parity/Overflow flag */ +#define Z180_H_FLAG 0x10 /* Bit 4: Half carry flag */ +#define Z180_Z_FLAG 0x40 /* Bit 5: Zero flag */ +#define Z180_S_FLAG 0x80 /* Bit 7: Sign flag */ + +/* Register access macros ***********************************************************/ + +#ifndef __ASSEMBLY__ + +# define getreg8(a) (*(volatile uint8_t *)(a)) +# define putreg8(v,a) (*(volatile uint8_t *)(a) = (v)) +# define getreg16(a) (*(volatile uint16_t *)(a)) +# define putreg16(v,a) (*(volatile uint16_t *)(a) = (v)) +# define getreg32(a) (*(volatile uint32_t *)(a)) +# define putreg32(v,a) (*(volatile uint32_t *)(a) = (v)) + +#endif + /* Z800180 * * The 8-bit Z80180 MPU provides the benefits of reduced system costs and @@ -71,12 +97,12 @@ * * Enhanced on the Z8S180 and Z8L180 MPUs */ -#if defined(CONFIG_Z180_CHIP_Z8018006VSG) || /* 68-pin PLCC */ \ - defined(CONFIG_Z180_CHIP_Z8018010VSG) || /* 68-pin PLCC */ \ - defined(CONFIG_Z180_CHIP_Z8018008VSG) || /* 68-pin PLCC */ \ - defined(CONFIG_Z180_CHIP_Z8018010FSG) || /* 80-pin QFP (11 pins N/C) */ \ - defined(CONFIG_Z180_CHIP_Z8018008VEG) || /* 68-pin PLCC */ \ - defined(CONFIG_Z180_CHIP_Z8018006VEG) /* 68-pin PLCC */ +#if defined(CONFIG_ARCH_CHIP_Z8018006VSG) || /* 68-pin PLCC */ \ + defined(CONFIG_ARCH_CHIP_Z8018010VSG) || /* 68-pin PLCC */ \ + defined(CONFIG_ARCH_CHIP_Z8018008VSG) || /* 68-pin PLCC */ \ + defined(CONFIG_ARCH_CHIP_Z8018010FSG) || /* 80-pin QFP (11 pins N/C) */ \ + defined(CONFIG_ARCH_CHIP_Z8018008VEG) || /* 68-pin PLCC */ \ + defined(CONFIG_ARCH_CHIP_Z8018006VEG) /* 68-pin PLCC */ # undef HAVE_Z8S180 /* Not Z8S180 (5V) or Z8L180 (3.3V) core */ # define HAVE ROM 0 /* No on-chip ROM */ @@ -93,14 +119,14 @@ # define HAVE_NPAR8 0 /* No 8-bit parallel ports */ # undef HAVE_IEEE1284 /* No bidirectional centronics interface (IEEE 1284) */ -#elif defined(CONFIG_Z180_CHIP_Z8018006PSG) || /* 64-pin DIP 6 MHz 5V */ \ - defined(CONFIG_Z180_CHIP_Z8018008FSG) || /* 80-pin QFP (11 pins N/C) 8MHz 5V */ \ - defined(CONFIG_Z180_CHIP_Z8018010PSG) || /* 64-pin DIP 10MHz 5V */ \ - defined(CONFIG_Z180_CHIP_Z8018006PEG) || /* 64-pin DIP 6MHz 5V */ \ - defined(CONFIG_Z180_CHIP_Z8018010VEG) || /* 68-pin PLCC 10MHz 5V*/ \ - defined(CONFIG_Z180_CHIP_Z8018010PEG) || /* 64-pin DIP 10MHz 5V*/ \ - defined(CONFIG_Z180_CHIP_Z8018008PSG) || /* 64-pin DIP 8MHz 5V */ \ - defined(CONFIG_Z180_CHIP_Z8018006FSG) /* 80-pin QFP (11 pins N/C) 6MHz 5V */ +#elif defined(CONFIG_ARCH_CHIP_Z8018006PSG) || /* 64-pin DIP 6 MHz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8018008FSG) || /* 80-pin QFP (11 pins N/C) 8MHz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8018010PSG) || /* 64-pin DIP 10MHz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8018006PEG) || /* 64-pin DIP 6MHz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8018010VEG) || /* 68-pin PLCC 10MHz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8018010PEG) || /* 64-pin DIP 10MHz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8018008PSG) || /* 64-pin DIP 8MHz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8018006FSG) /* 80-pin QFP (11 pins N/C) 6MHz 5V */ # undef HAVE_Z8S180 /* Not Z8S180 (5V) or Z8L180 (3.3V) core */ # define HAVE ROM 0 /* No on-chip ROM */ @@ -117,10 +143,10 @@ # define HAVE_NPAR8 0 /* No 8-bit parallel ports */ # undef HAVE_IEEE1284 /* No bidirectional centronics interface (IEEE 1284) */ -#elif defined(CONFIG_Z180_CHIP_Z8018000XSO) - defined(CONFIG_Z180_CHIP_Z8018010FEG) - defined(CONFIG_Z180_CHIP_Z8018000WSO) - defined(CONFIG_Z180_CHIP_Z8018008PEG) +#elif defined(CONFIG_ARCH_CHIP_Z8018000XSO) + defined(CONFIG_ARCH_CHIP_Z8018010FEG) + defined(CONFIG_ARCH_CHIP_Z8018000WSO) + defined(CONFIG_ARCH_CHIP_Z8018008PEG) # undef HAVE_Z8S180 /* Not Z8S180 (5V) or Z8L180 (3.3V) core */ # define HAVE ROM 0 /* No on-chip ROM */ @@ -158,7 +184,7 @@ * Emulation Mode */ -#elif defined(CONFIG_Z180_CHIP_Z8018110FEG) /* 100 QFP */ +#elif defined(CONFIG_ARCH_CHIP_Z8018110FEG) /* 100-pin QFP */ # undef HAVE_Z8S180 /* Not Z8S180 (5V) or Z8L180 (3.3V) core */ # define HAVE ROM 0 /* No on-chip ROM */ @@ -199,11 +225,11 @@ * 3.3 V and 5 V Version */ -#elif defined(CONFIG_Z180_CHIP_Z8018233FSG) || /* 100-pin QFP */ \ - defined(CONFIG_Z180_CHIP_Z8018220AEG) || /* 100-pin LQFP 20MHz 5V */ \ - defined(CONFIG_Z180_CHIP_Z8018216FSG) || /* 100-pin QFP 16MHz 5V */ \ - defined(CONFIG_Z180_CHIP_Z8018216ASG) || /* 100-pin LQFP */ \ - defined(CONFIG_Z180_CHIP_Z8018233ASG) /* 100-pin LQFP 33MHz 5V */ +#elif defined(CONFIG_ARCH_CHIP_Z8018233FSG) || /* 100-pin QFP */ \ + defined(CONFIG_ARCH_CHIP_Z8018220AEG) || /* 100-pin LQFP 20MHz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8018216FSG) || /* 100-pin QFP 16MHz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8018216ASG) || /* 100-pin LQFP */ \ + defined(CONFIG_ARCH_CHIP_Z8018233ASG) /* 100-pin LQFP 33MHz 5V */ # undef HAVE_Z8S180 /* Not Z8S180 (5V) or Z8L180 (3.3V) core */ # define HAVE ROM 0 /* No on-chip ROM */ @@ -244,8 +270,8 @@ * 7 or 24 Bits of I/O */ -#elif defined(CONFIG_Z180_CHIP_Z8019520FSG) || /* 100-pin QFP 20MHz 5V */ \ - defined(CONFIG_Z180_CHIP_Z8019533FSG) /* 100-pin QFP 33MHz 5V */ +#elif defined(CONFIG_ARCH_CHIP_Z8019520FSG) || /* 100-pin QFP 20MHz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8019533FSG) /* 100-pin QFP 33MHz 5V */ # undef HAVE_Z8S180 /* No Z8S180 (5V) or Z8L180 (3.3V) core */ # undef HAVE ROM 0 /* No 32KB on-chip ROM (z80185 only) */ @@ -285,9 +311,9 @@ * * Enhanced on the Z8S180 and Z8L180 MPUs. */ -#elif defined(CONFIG_Z180_CHIP_Z8L18020VSG) || /* 69-pin PLCC */ \ - defined(CONFIG_Z180_CHIP_Z8L18020FSG) || /* 80-pin GFP 20MHz 3.3V */ \ - defined(CONFIG_Z180_CHIP_Z8L18020PSG) +#elif defined(CONFIG_ARCH_CHIP_Z8L18020VSG) || /* 68-pinn PLCC */ \ + defined(CONFIG_ARCH_CHIP_Z8L18020FSG) || /* 80-pin GFP 20MHz 3.3V */ \ + defined(CONFIG_ARCH_CHIP_Z8L18020PSG) # define HAVE_Z8S180 1 /* Uses Z8S180 (5V) or Z8L180 (3.3V) core */ # define HAVE ROM 0 /* No on-chip ROM */ @@ -329,9 +355,9 @@ * 3.3 V and 5 V Version */ -#elif defined(CONFIG_Z180_CHIP_Z8L18220ASG) || /* 100-pin LQFP */ \ - defined(CONFIG_Z180_CHIP_Z8L18220FSG) || /* 100-pin QFP 20MHz 3.3V */ \ - defined(CONFIG_Z180_CHIP_Z8L18220AEG) +#elif defined(CONFIG_ARCH_CHIP_Z8L18220ASG) || /* 100-pin LQFP */ \ + defined(CONFIG_ARCH_CHIP_Z8L18220FSG) || /* 100-pin QFP 20MHz 3.3V */ \ + defined(CONFIG_ARCH_CHIP_Z8L18220AEG) # define HAVE_Z8S180 1 /* Uses Z8S180 (5V) or Z8L180 (3.3V) core */ # define HAVE ROM 0 /* No on-chip ROM */ @@ -373,22 +399,22 @@ * Package - DIP, PLCC, QFP */ -#elif defined(CONFIG_Z180_CHIP_Z8S18020VSG) || /* 68-pin PLCC */ \ - defined(CONFIG_Z180_CHIP_Z8S18020VSG1960) || /* 68-pin PLCC */ \ - defined(CONFIG_Z180_CHIP_Z8S18033VSG) || /* 68-pin PLCC */ \ - defined(CONFIG_Z180_CHIP_Z8S18010FSG) || /* 80-pin QFP */ \ - defined(CONFIG_Z180_CHIP_Z8S18010VEG) || /* 68-pin PLCC */ \ - defined(CONFIG_Z180_CHIP_Z8S18020VEG) || /* 68-pin PLCC */ \ - defined(CONFIG_Z180_CHIP_Z8S18010VSG) || /* 68-pin PLCC */ \ - defined(CONFIG_Z180_CHIP_Z8S18020PSG) || /* 64-pin DIP 10Mhz 5V */ \ - defined(CONFIG_Z180_CHIP_Z8S18033FSG) || /* 80-pin QFP 33MHz 5V */ \ - defined(CONFIG_Z180_CHIP_Z8S18033FEG) || /* 80-pin QFP 33MHz 5V */ \ - defined(CONFIG_Z180_CHIP_Z8S18020FSG) || /* 80-pin QFP 20MHz 5V */ \ - defined(CONFIG_Z180_CHIP_Z8S18033VEG) || /* 68-pin PLCC 33MHz 5V */ \ - defined(CONFIG_Z180_CHIP_Z8S18010PSG) || /* 64-pin DIP 10MHz 5V */ \ - defined(CONFIG_Z180_CHIP_Z8S18020FEG) || \ - defined(CONFIG_Z180_CHIP_Z8S18010PEG) || \ - defined(CONFIG_Z180_CHIP_Z8S18010FEG +#elif defined(CONFIG_ARCH_CHIP_Z8S18020VSG) || /* 68-pin PLCC */ \ + defined(CONFIG_ARCH_CHIP_Z8S18020VSG1960) || /* 68-pin PLCC */ \ + defined(CONFIG_ARCH_CHIP_Z8S18033VSG) || /* 68-pin PLCC */ \ + defined(CONFIG_ARCH_CHIP_Z8S18010FSG) || /* 80-pin QFP */ \ + defined(CONFIG_ARCH_CHIP_Z8S18010VEG) || /* 68-pin PLCC */ \ + defined(CONFIG_ARCH_CHIP_Z8S18020VEG) || /* 68-pin PLCC */ \ + defined(CONFIG_ARCH_CHIP_Z8S18010VSG) || /* 68-pin PLCC */ \ + defined(CONFIG_ARCH_CHIP_Z8S18020PSG) || /* 64-pin DIP 10Mhz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8S18033FSG) || /* 80-pin QFP 33MHz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8S18033FEG) || /* 80-pin QFP 33MHz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8S18020FSG) || /* 80-pin QFP 20MHz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8S18033VEG) || /* 68-pin PLCC 33MHz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8S18010PSG) || /* 64-pin DIP 10MHz 5V */ \ + defined(CONFIG_ARCH_CHIP_Z8S18020FEG) || \ + defined(CONFIG_ARCH_CHIP_Z8S18010PEG) || \ + defined(CONFIG_ARCH_CHIP_Z8S18010FEG # define HAVE_Z8S180 1 /* Uses Z8S180 (5V) or Z8L180 (3.3V) core */ # define HAVE ROM 0 /* No on-chip ROM */ diff --git a/nuttx/arch/z80/include/z80/chip.h b/nuttx/arch/z80/include/z80/chip.h new file mode 100644 index 000000000..9f77e395c --- /dev/null +++ b/nuttx/arch/z80/include/z80/chip.h @@ -0,0 +1,92 @@ +/************************************************************************************ + * arch/z80/include/z80/chip.h + * arch/z80/include/chip/chip.h + * + * Copyright (C) 2007-2009 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 __ARCH_Z80_SRC_Z80_CHIP_H +#define __ARCH_Z80_SRC_Z80_CHIP_H + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#ifndef __ASSEMBLY__ +# include +#endif + +/************************************************************************************ + * Pre-processor Definitions + ************************************************************************************/ + +/* Bits in the Z80 FLAGS register ***************************************************/ + +#define Z80_C_FLAG 0x01 /* Bit 0: Carry flag */ +#define Z80_N_FLAG 0x02 /* Bit 1: Add/Subtract flag */ +#define Z80_PV_FLAG 0x04 /* Bit 2: Parity/Overflow flag */ +#define Z80_H_FLAG 0x10 /* Bit 4: Half carry flag */ +#define Z80_Z_FLAG 0x40 /* Bit 5: Zero flag */ +#define Z80_S_FLAG 0x80 /* Bit 7: Sign flag */ + +/* Register access macros ***********************************************************/ + +#ifndef __ASSEMBLY__ + +# define getreg8(a) (*(volatile uint8_t *)(a)) +# define putreg8(v,a) (*(volatile uint8_t *)(a) = (v)) +# define getreg16(a) (*(volatile uint16_t *)(a)) +# define putreg16(v,a) (*(volatile uint16_t *)(a) = (v)) +# define getreg32(a) (*(volatile uint32_t *)(a)) +# define putreg32(v,a) (*(volatile uint32_t *)(a) = (v)) + +#endif + +/************************************************************************************ + * 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 /* __ARCH_Z80_SRC_Z80_CHIP_H */ diff --git a/nuttx/arch/z80/src/z180/Kconfig b/nuttx/arch/z80/src/z180/Kconfig new file mode 100644 index 000000000..4eafa8da8 --- /dev/null +++ b/nuttx/arch/z80/src/z180/Kconfig @@ -0,0 +1,55 @@ +# +# For a description of the syntax of this configuration file, +# see misc/tools/kconfig-language.txt. +# + +if ARCH_CHIP_Z180 + +choice + prompt "Toolchain Selection" + default Z180_TOOLCHAIN_SDCCW if HOST_WINDOWS + default Z180_TOOLCHAIN_SDCCL if !HOST_WINDOWS + +config Z180_TOOLCHAIN_SDCCL + bool "SDCC for Linux, MAC OSX, or Cygwin" + depends on !WINDOWS_NATIVE + +config Z180_TOOLCHAIN_SDCCW + bool "SDCC for Windows" + depends on HOST_WINDOWS + +endchoice + +config LINKER_HOME_AREA + hex "Start of _HOME area" + default 0x0000 + ---help--- + Start of the linker HOME area. Default: 0x0000 + +config LINKER_CODE_AREA + hex "Start of _CODE area" + default 0x0200 + ---help--- + Start of the linker _CODE area. Default: 0x0200 + +config LINKER_DATA_AREA + hex "Start of _DATA area" + default 0x8000 + ---help--- + Start of the linker _DATA area. Default: 0x8000 + +config LINKER_ROM_AT_0000 + bool "ROM at 0x0000" + default n + ---help--- + Some architectures may have ROM located at address zero. In this + case, a special version of the "head" file must be used. + +config ARCH_HAVEHEAD + bool "Board-specific Head File" + default n + ---help--- + Use a board-specific version of the "head" file in the + configs//src directory + +endif diff --git a/nuttx/arch/z80/src/z180/Make.defs b/nuttx/arch/z80/src/z180/Make.defs new file mode 100644 index 000000000..d371a5d22 --- /dev/null +++ b/nuttx/arch/z80/src/z180/Make.defs @@ -0,0 +1,55 @@ +############################################################################ +# arch/z80/src/z180/Make.defs +# +# Copyright (C) 2012 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. +# +############################################################################ + +ifeq ($(CONFIG_ARCH_HAVEHEAD),) +ifeq ($(CONFIG_LINKER_ROM_AT_0000),y) +HEAD_ASRC = z180_rom.asm +else +HEAD_ASRC = z180_head.asm +endif +endif + +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_idle.c up_assert.c up_doirq.c \ + up_mdelay.c up_udelay.c up_usestack.c + +CHIP_ASRCS = z180_saveusercontext.asm z180_restoreusercontext.asm +CHIP_CSRCS = z180_initialstate.c z180_io.c z180_irq.c z180_copystate.c \ + z180_schedulesigaction.c z180_sigdeliver.c \ + z180_registerdump.c + diff --git a/nuttx/arch/z80/src/z180/README.txt b/nuttx/arch/z80/src/z180/README.txt new file mode 100644 index 000000000..c06164cdd --- /dev/null +++ b/nuttx/arch/z80/src/z180/README.txt @@ -0,0 +1,49 @@ +arch/z80/src/z180 +^^^^^^^^^^^^^^^^^ + +The arch/z80 directories contain files to support a variety of 8-bit architectures +from ZiLOG (and spin-architectures such as the Rabbit2000). The arch/z80/src/z180 +sub-directory contains logic unique to the classic Z180 family of chips. + +Files in this directory include: + +z180_head.asm + This is the main entry point into the Z180 program. This includes the + handler for the RESET, power-up interrupt vector and address zero and all + RST interrupts. + +z180_rom.asm + Some architectures may have ROM located at address zero. In this case, a + special version of the "head" logic must be used. This special "head" + file is probably board-specific and, hence, belongs in the board-specific + configs//src directory. This file may, however, be used as + a model for such a board-specific file. + + z180_rom.S is enabled by specifying CONFIG_LINKER_ROM_AT_0000 in the + configuration file. + + A board specific version in the configs//src directory can be + used by: + + 1. Define CONFIG_ARCH_HAVEHEAD + 2. Add the board-specific head file, say .asm, to + configs//src + 3. Add a file called Make.defs in the configs//src directory + containing the line: HEAD_ASRC = .asm + +Make.defs + This is the standard makefile fragment that must be provided in all + chip directories. This fragment identifies the chip-specific file to + be used in building libarch. + +chip.h + This is the standard header file that must be provided in all chip + directories. + +z180_initialstate.c, z180_copystate.c, z180_restoreusercontext.asm, and +z180_saveusercontext.asm, switch + These files implement the Z180 context switching logic + +z180_schedulesigaction.c and z180_sigdeliver.c + These files implement Z180 signal handling. + diff --git a/nuttx/arch/z80/src/z180/Toolchain.defs b/nuttx/arch/z80/src/z180/Toolchain.defs new file mode 100644 index 000000000..3979f3f0e --- /dev/null +++ b/nuttx/arch/z80/src/z180/Toolchain.defs @@ -0,0 +1,75 @@ +############################################################################ +# arch/z80/src/z180/Toolchain.defs +# +# Copyright (C) 2012 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. +# +############################################################################ + +# Setup for the selected toolchain + +# +# SDCC is currently the only z180 toolchain supported. See +# http://sdcc.sourceforge.net/. Source and pre-built SDCC binaries can be +# downloaded from the SDCC SourceForge site: +# http://sourceforge.net/projects/sdcc/files/. Pre-built binaries are +# available for Linux, MAC OSX, and for Win32. In addition, SDCC can be +# built to run on Windows as a POSIX toolchain. The various SDCC options are +# selected in the NuttX configuration with: +# +# CONFIG_Z180_TOOLCHAIN_SDCCL=y : SDCC for Linux, MAC OSX or Cygwin +# CONFIG_Z180_TOOLCHAIN_SDCCW=y : SDCC for Win32 +# + +ifeq ($(filter y, \ + $(CONFIG_Z180_TOOLCHAIN_SDCCL) \ + ),y) + CONFIG_Z180_TOOLCHAIN ?= SDCCPOSIX +endif +ifeq ($(filter y, \ + $(CONFIG_Z180_TOOLCHAIN_SDCCW) \ + ),y) + CONFIG_Z180_TOOLCHAIN ?= SDCCWIN32 +endif + +# SDCC toolchain under Linux, MAC OSX or Cygwin + +ifeq ($(CONFIG_Z180_TOOLCHAIN),POSIX) +endif + +# SDCC toolchain under Windows/Cygwin + +ifeq ($(CONFIG_AVR_TOOLCHAIN),SDCCWIN32) + ifneq ($(CONFIG_WINDOWS_NATIVE),y) + WINTOOL = y + endif +endif + + diff --git a/nuttx/arch/z80/src/z180/chip.h b/nuttx/arch/z80/src/z180/chip.h new file mode 100644 index 000000000..b766654f6 --- /dev/null +++ b/nuttx/arch/z80/src/z180/chip.h @@ -0,0 +1,54 @@ +/************************************************************************************ + * arch/z80/src/z180/chip.h + * arch/z80/src/chip/chip.h + * + * Copyright (C) 2012 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 __ARCH_Z80_SRC_Z180_CHIP_H +#define __ARCH_Z80_SRC_Z180_CHIP_H + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include + +/************************************************************************************ + * Pre-processor Definitions + ************************************************************************************/ + +/************************************************************************************ + * Public Function Prototypes + ************************************************************************************/ + +#endif /* __ARCH_Z80_SRC_Z180_CHIP_H */ diff --git a/nuttx/arch/z80/src/z180/switch.h b/nuttx/arch/z80/src/z180/switch.h new file mode 100644 index 000000000..38054e4b8 --- /dev/null +++ b/nuttx/arch/z80/src/z180/switch.h @@ -0,0 +1,166 @@ +/************************************************************************************ + * arch/z80/src/z180/switch.h + * arch/z80/src/chip/switch.h + * + * Copyright (C) 2012 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 __ARCH_Z80_SRC_Z180_SWITCH_H +#define __ARCH_Z80_SRC_Z180_SWITCH_H + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include +#include + +#include "up_internal.h" + +/************************************************************************************ + * Pre-processor Definitions + ************************************************************************************/ + +/* Macros for portability *********************************************************** + * + * Common logic in arch/z80/src/common is customized for the z180 context switching + * logic via the following macros. + */ + +/* Initialize the IRQ state */ + +#define INIT_IRQCONTEXT() current_regs = NULL + +/* IN_INTERRUPT returns true if the system is currently operating in the interrupt + * context. IN_INTERRUPT is the inline equivalent of up_interrupt_context(). + */ + +#define IN_INTERRUPT() (current_regs != NULL) + +/* The following macro is used when the system enters interrupt handling logic */ + +#define DECL_SAVESTATE() \ + FAR chipreg_t *savestate + +#define IRQ_ENTER(irq, regs) \ + do { \ + savestate = (FAR chipreg_t *)current_regs; \ + current_regs = (regs); \ + } while (0) + +/* The following macro is used when the system exits interrupt handling logic */ + +#define IRQ_LEAVE(irq) current_regs = savestate + +/* The following macro is used to sample the interrupt state (as a opaque handle) */ + +#define IRQ_STATE() (current_regs) + +/* Save the current IRQ context in the specified TCB */ + +#define SAVE_IRQCONTEXT(tcb) z180_copystate((tcb)->xcp.regs, (FAR chipreg_t*)current_regs) + +/* Set the current IRQ context to the state specified in the TCB */ + +#define SET_IRQCONTEXT(tcb) z180_copystate((FAR chipreg_t*)current_regs, (tcb)->xcp.regs) + +/* Save the user context in the specified TCB. User context saves can be simpler + * because only those registers normally saved in a C called need be stored. + */ + +#define SAVE_USERCONTEXT(tcb) z180_saveusercontext((tcb)->xcp.regs) + +/* Restore the full context -- either a simple user state save or the full, + * IRQ state save. + */ + +#define RESTORE_USERCONTEXT(tcb) z180_restoreusercontext((tcb)->xcp.regs) + +/* Dump the current machine registers */ + +#define _REGISTER_DUMP() z180_registerdump() + +/************************************************************************************ + * Public Types + ************************************************************************************/ + +/************************************************************************************ + * Public Variables + ************************************************************************************/ + +#ifndef __ASSEMBLY__ +/* This holds a references to the current interrupt level register storage structure. + * If is non-NULL only during interrupt processing. + */ + +extern volatile chipreg_t *current_regs; +#endif + +/************************************************************************************ + * Public Function Prototypes + ************************************************************************************/ + +#ifndef __ASSEMBLY__ +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +/* Defined in z180_copystate.c */ + +EXTERN void z180_copystate(FAR chipreg_t *dest, FAR const chipreg_t *src); + +/* Defined in z180_saveusercontext.asm */ + +EXTERN int z180_saveusercontext(FAR chipreg_t *regs); + +/* Defined in z180_restoreusercontext.asm */ + +EXTERN void z180_restoreusercontext(FAR chipreg_t *regs); + +/* Defined in z180_sigsetup.c */ + +EXTERN void z180_sigsetup(FAR _TCB *tcb, sig_deliver_t sigdeliver, FAR chipreg_t *regs); + +/* Defined in z180_registerdump.c */ + +EXTERN void z180_registerdump(void); + +#undef EXTERN +#ifdef __cplusplus +} +#endif +#endif + +#endif /* __ARCH_Z80_SRC_Z180_SWITCH_H */ diff --git a/nuttx/arch/z80/src/z180/up_mem.h b/nuttx/arch/z80/src/z180/up_mem.h new file mode 100644 index 000000000..e414c547c --- /dev/null +++ b/nuttx/arch/z80/src/z180/up_mem.h @@ -0,0 +1,75 @@ +/************************************************************************************ + * common/sdcc.h + * + * Copyright (C) 2012 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 __ARCH_Z180_SRC_COMMON_UP_MEM_H +#define __ARCH_Z180_SRC_COMMON_UP_MEM_H + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include + +/************************************************************************************ + * Pre-processor Definitions + ************************************************************************************/ + +/* Locate the IDLE thread stack at the end of RAM. */ + +#define CONFIG_STACK_END CONFIG_DRAM_SIZE +#define CONFIG_STACK_BASE (CONFIG_STACK_END - CONFIG_IDLETHREAD_STACKSIZE) + +/* The heap then extends from the linker determined beginning of the heap (s__HEAP). + * to the bottom of the IDLE thread stack. NOTE: The symbol s__HEAP is not + * accessible from C because it does not begin with the _ character. g_heapbase + * is defined in z180_head.asm to provide that value to the C code. + */ + +#define CONFIG_HEAP1_END CONFIG_STACK_BASE +#define CONFIG_HEAP1_BASE g_heapbase + +/************************************************************************************ + * Public variables + ************************************************************************************/ + +/* This is the bottom of the heap as provided by the linker symbol s__HEAP. NOTE: + * The symbol s__HEAP is not accessible from C because it does not begin with the _ + * character. g_heapbase is defined in z180_head.asm to provide that value to the C + * code. + */ + +extern const uint16_t g_heapbase; + +#endif /* __ARCH_Z180_SRC_COMMON_UP_MEM_H */ diff --git a/nuttx/arch/z80/src/z180/z180_copystate.c b/nuttx/arch/z80/src/z180/z180_copystate.c new file mode 100644 index 000000000..a088f8d40 --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_copystate.c @@ -0,0 +1,78 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_copystate.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include "chip/switch.h" +#include "os_internal.h" +#include "up_internal.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: z180_copystate + ****************************************************************************/ + +/* Maybe a little faster than most memcpy's */ + +void z180_copystate(FAR chipreg_t *dest, FAR const chipreg_t *src) +{ + int i; + for (i = 0; i < XCPTCONTEXT_REGS; i++) + { + *dest++ = *src++; + } +} + diff --git a/nuttx/arch/z80/src/z180/z180_head.asm b/nuttx/arch/z80/src/z180/z180_head.asm new file mode 100644 index 000000000..ca064160a --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_head.asm @@ -0,0 +1,304 @@ +;************************************************************************** +; arch/z80/src/z180/z180_head.asm +; +; Copyright (C) 2012 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. +; +;************************************************************************** + + .title NuttX for the Z180 + .module z180_head + +;************************************************************************** +; Constants +;************************************************************************** + + ; Register save area layout + + XCPT_I == 0 ; Offset 0: Saved I w/interrupt state in carry + XCPT_BC == 2 ; Offset 1: Saved BC register + XCPT_DE == 4 ; Offset 2: Saved DE register + XCPT_IX == 6 ; Offset 3: Saved IX register + XCPT_IY == 8 ; Offset 4: Saved IY register + XCPT_SP == 10 ; Offset 5: Offset to SP at time of interrupt + XCPT_HL == 12 ; Offset 6: Saved HL register + XCPT_AF == 14 ; Offset 7: Saved AF register + XCPT_PC == 16 ; Offset 8: Offset to PC at time of interrupt + + ; Default stack base (needs to be fixed) + + .include "asm_mem.h" + +;************************************************************************** +; Global symbols used +;************************************************************************** + + .globl _os_start ; OS entry point + .globl _up_doirq ; Interrupt decoding logic + +;************************************************************************** +; Reset entry point +;************************************************************************** + + .area _HEADER (ABS) + .org 0x0000 + + di ; Disable interrupts + im 1 ; Set interrupt mode 1 + jr _up_reset ; And boot the system + +;************************************************************************** +; Other reset handlers +; +; Interrupt mode 1 behavior: +; +; 1. M1 cycle: 7 ticks +; Acknowledge interrupt and decrements SP +; 2. M2 cycle: 3 ticks +; Writes the MS byte of the PC onto the stack and decrements SP +; 3. M3 cycle: 3 ticks +; Writes the LS byte of the PC onto the stack and sets the PC to 0x0038. +; +;************************************************************************** + + .org 0x0008 ; RST 1 + + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #1 ; 1 = Z180_RST1 + jr _up_rstcommon ; Remaining RST handling is common + + .org 0x0010 ; RST 2 + + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #2 ; 2 = Z180_RST2 + jr _up_rstcommon ; Remaining RST handling is common + + .org 0x0018 ; RST 3 + + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #3 ; 1 = Z180_RST3 + jr _up_rstcommon ; Remaining RST handling is common + + .org 0x0020 ; RST 4 + + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #4 ; 1 = Z180_RST4 + jr _up_rstcommon ; Remaining RST handling is common + + .org 0x0028 ; RST 5 + + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #5 ; 1 = Z180_RST5 + jr _up_rstcommon ; Remaining RST handling is common + + .org 0x0030 ; RST 6 + + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #6 ; 1 = Z180_RST6 + jr _up_rstcommon ; Remaining RST handling is common + + .org 0x0038 ; Int mode 1 / RST 7 + + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #7 ; 7 = Z180_RST7 + jr _up_rstcommon ; Remaining RST handling is common + +;************************************************************************** +; NMI interrupt handler +;************************************************************************** + + .org 0x0066 + retn + +;************************************************************************** +; System start logic +;************************************************************************** + +_up_reset: + ; Set up the stack pointer at the location determined the Makefile + ; and stored in asm_mem.h + + ld SP, #CONFIG_STACK_END ; Set stack pointer + + ; Performed initialization unique to the SDCC toolchain + + call gsinit ; Initialize the data section + + ; Then start NuttX + + call _os_start ; jump to the OS entry point + + ; NuttX will never return, but just in case... + +_up_halt:: + halt ; We should never get here + jp _up_halt + +;************************************************************************** +; Common Interrupt handler +;************************************************************************** + +_up_rstcommon:: + ; Create a register frame. SP points to top of frame + 4, pushes + ; decrement the stack pointer. Already have + ; + ; Offset 8: Return PC is already on the stack + ; Offset 7: AF (retaining flags) + ; + ; IRQ number is in A + + push hl ; Offset 6: HL + ld hl, #(3*2) ; HL is the value of the stack pointer before + add hl, sp ; the interrupt occurred + push hl ; Offset 5: Stack pointer + push iy ; Offset 4: IY + push ix ; Offset 3: IX + push de ; Offset 2: DE + push bc ; Offset 1: BC + + ld b, a ; Save the reset number in B + ld a, i ; Parity bit holds interrupt state + push af ; Offset 0: I with interrupt state in parity + di + + ; Call the interrupt decode logic. SP points to the beginning of the reg structure + + ld hl, #0 ; Argument #2 is the beginning of the reg structure + add hl, sp ; + push hl ; Place argument #2 at the top of stack + push bc ; Argument #1 is the Reset number + inc sp ; (make byte sized) + call _up_doirq ; Decode the IRQ + + ; On return, HL points to the beginning of the reg structure to restore + ; Note that (1) the arguments pushed on the stack are not popped, and (2) the + ; original stack pointer is lost. In the normal case (no context switch), + ; HL will contain the value of the SP before the arguments were pushed. + + ld sp, hl ; Use the new stack pointer + + ; Restore registers. HL points to the beginning of the reg structure to restore + + ex af, af' ; Select alternate AF + pop af ; Offset 0: AF' = I with interrupt state in carry + ex af, af' ; Restore original AF + pop bc ; Offset 1: BC + pop de ; Offset 2: DE + pop ix ; Offset 3: IX + pop iy ; Offset 4: IY + exx ; Use alternate BC/DE/HL + ld hl, #-2 ; Offset of SP to account for ret addr on stack + pop de ; Offset 5: HL' = Stack pointer after return + add hl, de ; HL = Stack pointer value before return + exx ; Restore original BC/DE/HL + pop hl ; Offset 6: HL + pop af ; Offset 7: AF + + ; Restore the stack pointer + + exx ; Use alternate BC/DE/HL + ld sp, hl ; Set SP = saved stack pointer value before return + exx ; Restore original BC/DE/HL + + ; Restore interrupt state + + ex af, af' ; Recover interrupt state + jp po, nointenable ; Odd parity, IFF2=0, means disabled + ex af, af' ; Restore AF (before enabling interrupts) + ei ; yes + reti +nointenable:: + ex af, af' ; Restore AF + reti + +;************************************************************************** +; Ordering of segments for the linker (SDCC only) +;************************************************************************** + + .area _HOME + .area _CODE + .area _INITIALIZER + .area _GSINIT + .area _GSFINAL + + .area _DATA + .area _INITIALIZED + .area _BSEG + .area _BSS + .area _HEAP + +;************************************************************************** +; Global data initialization logic (SDCC only) +;************************************************************************** + + .area _GSINIT +gsinit:: + ld bc, #l__INITIALIZER + ld a, b + or a, c + jr Z, gsinit_next + ld de, #s__INITIALIZED + ld hl, #s__INITIALIZER + ldir +gsinit_next: + + .area _GSFINAL + ret + +;************************************************************************** +; The start of the heap (SDCC only). Note that is actually resides in +; the _CODE area (which may be FLASH or ROM) +;************************************************************************** + + .area _CODE +_g_heapbase:: + .dw #s__HEAP + diff --git a/nuttx/arch/z80/src/z180/z180_initialstate.c b/nuttx/arch/z80/src/z180/z180_initialstate.c new file mode 100644 index 000000000..8d0211261 --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_initialstate.c @@ -0,0 +1,91 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_initialstate.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "chip/chip.h" +#include "up_internal.h" +#include "up_arch.h" + +/**************************************************************************** + * Private Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_initial_state + * + * Description: + * A new thread is being started and a new TCB + * has been created. This function is called to initialize + * the processor specific portions of the new TCB. + * + * This function must setup the initial architecture registers + * and/or stack so that execution will begin at tcb->start + * on the next context switch. + * + ****************************************************************************/ + +void up_initial_state(_TCB *tcb) +{ + struct xcptcontext *xcp = &tcb->xcp; + + /* Initialize the initial exception register context structure */ + + memset(xcp, 0, sizeof(struct xcptcontext)); +#ifndef CONFIG_SUPPRESS_INTERRUPTS + xcp->regs[XCPT_I] = Z180_PV_FLAG; /* Parity flag will enable interrupts */ +#endif + xcp->regs[XCPT_SP] = (chipreg_t)tcb->adj_stack_ptr; + xcp->regs[XCPT_PC] = (chipreg_t)tcb->start; +} diff --git a/nuttx/arch/z80/src/z180/z180_io.c b/nuttx/arch/z80/src/z180/z180_io.c new file mode 100644 index 000000000..7e738c953 --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_io.c @@ -0,0 +1,94 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_io.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +/* #include */ + +#include "up_internal.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: outb + * + * Description: + * Output byte c on port p + * + ****************************************************************************/ + +void outp(char p, char c) +{ + __asm + ld c, 4(ix) ; port + ld a, 5(ix) ; value + out (c), a + __endasm; +} + + +/**************************************************************************** + * Name: inpb + * + * Description: + * Input byte from port p + * + ****************************************************************************/ + +char inp(char p) __naked +{ + __asm + ld c, 4(ix) ;port + in l, (c) + __endasm; +} diff --git a/nuttx/arch/z80/src/z180/z180_irq.c b/nuttx/arch/z80/src/z180/z180_irq.c new file mode 100644 index 000000000..929f38d6a --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_irq.c @@ -0,0 +1,113 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_irq.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include + +#include "chip/switch.h" +#include "up_internal.h" + +/**************************************************************************** + * Private Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* This holds a references to the current interrupt level register storage + * structure. If is non-NULL only during interrupt processing. + */ + +volatile chipreg_t *current_regs; + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: irqsave + * + * Description: + * Disable all interrupts; return previous interrupt state + * + ****************************************************************************/ + +irqstate_t irqsave(void) __naked +{ + __asm + ld a, i ; AF Parity bit holds interrupt state + di ; Interrupts are disabled + push af ; Return AF in HL + pop hl ; + ret ; + __endasm; +} + +/**************************************************************************** + * Name: irqrestore + * + * Description: + * Restore previous interrupt state + * + ****************************************************************************/ + +void irqrestore(irqstate_t flags) __naked +{ + __asm + di ; Assume disabled + pop hl ; HL = return address + pop af ; AF Parity bit holds interrupt state + jp po, statedisable + ei +statedisable: + push af ; Restore stack + push hl ; + ret ; and return + __endasm; +} diff --git a/nuttx/arch/z80/src/z180/z180_registerdump.c b/nuttx/arch/z80/src/z180/z180_registerdump.c new file mode 100644 index 000000000..2ccfc2f99 --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_registerdump.c @@ -0,0 +1,91 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_registerdump.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include +#include + +#include "chip/switch.h" +#include "os_internal.h" +#include "up_internal.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Output debug info if stack dump is selected -- even if + * debug is not selected. + */ + +#ifdef CONFIG_ARCH_STACKDUMP +# undef lldbg +# define lldbg lib_lowprintf +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: z180_registerdump + ****************************************************************************/ + +#ifdef CONFIG_ARCH_STACKDUMP +static void z180_registerdump(void) +{ + if (current_regs) + { + lldbg("AF: %04x I: %04x\n", + current_regs[XCPT_AF], current_regs[XCPT_I]); + lldbg("BC: %04x DE: %04x HL: %04x\n", + current_regs[XCPT_BC], current_regs[XCPT_DE], current_regs[XCPT_HL]); + lldbg("IX: %04x IY: %04x\n", + current_regs[XCPT_IX], current_regs[XCPT_IY]); + lldbg("SP: %04x PC: %04x\n" + current_regs[XCPT_SP], current_regs[XCPT_PC]); + } +} +#endif diff --git a/nuttx/arch/z80/src/z180/z180_restoreusercontext.asm b/nuttx/arch/z80/src/z180/z180_restoreusercontext.asm new file mode 100644 index 000000000..fd2a70c1f --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_restoreusercontext.asm @@ -0,0 +1,104 @@ +;************************************************************************** +; arch/z80/src/z180/z180_restoreusercontext.asm +; +; Copyright (C) 2012 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. +; +;************************************************************************** + + ; Register save area layout + + .globl XCPT_I ; Offset 0: Saved I w/interrupt state in carry + .globl XCPT_BC ; Offset 1: Saved BC register + .globl XCPT_DE ; Offset 2: Saved DE register + .globl XCPT_IX ; Offset 3: Saved IX register + .globl XCPT_IY ; Offset 4: Saved IY register + .globl XCPT_SP ; Offset 5: Offset to SP at time of interrupt + .globl XCPT_HL ; Offset 6: Saved HL register + .globl XCPT_AF ; Offset 7: Saved AF register + .globl XCPT_PC ; Offset 8: Offset to PC at time of interrupt + +;************************************************************************** +; z180_restoreusercontext +;************************************************************************** + + .area _CODE +_z180_restoreusercontext: + ; On entry, stack contains return address (not used), then address + ; of the register save structure + + ; Discard the return address, we won't be returning + + pop hl + + ; Get the address of the beginning of the state save area. Each + ; pop will increment to the next element of the structure + + pop hl ; BC = Address of save structure + ld sp, hl ; SP points to top of storage area + + ; Disable interrupts while we muck with the alternative registers. The + ; Correct interrupt state will be restore below + + di + + ; Restore registers. HL points to the beginning of the reg structure to restore + + ex af, af' ; Select alternate AF + pop af ; Offset 0: AF' = I with interrupt state in parity + ex af, af' ; Restore original AF + pop bc ; Offset 1: BC + pop de ; Offset 2: DE + pop ix ; Offset 3: IX + pop iy ; Offset 4: IY + exx ; Use alternate BC/DE/HL + pop hl ; Offset 5: HL' = Stack pointer after return + exx ; Restore original BC/DE/HL + pop hl ; Offset 6: HL + pop af ; Offset 7: AF + + ; Restore the stack pointer + + exx ; Use alternate BC/DE/HL + pop de ; DE' = return address + ld sp, hl ; Set SP = saved stack pointer value before return + push de ; Save return address for ret instruction + exx ; Restore original BC/DE/HL + + ; Restore interrupt state + + ex af, af' ; Recover interrupt state + jp po, noinrestore ; Odd parity, IFF2=0, means disabled + ex af, af' ; Restore AF (before enabling interrupts) + ei ; yes.. Enable interrupts + ret ; and return +noinrestore: + ex af, af' ; Restore AF + ret ; Return with interrupts disabled diff --git a/nuttx/arch/z80/src/z180/z180_rom.asm b/nuttx/arch/z80/src/z180/z180_rom.asm new file mode 100644 index 000000000..c27574f4e --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_rom.asm @@ -0,0 +1,297 @@ +;************************************************************************** +; arch/z80/src/z180/z180_rom.asm +; +; Copyright (C) 2012 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. +; +;************************************************************************** + + .title NuttX for the Z180 + .module z180_head + +;************************************************************************** +; Constants +;************************************************************************** + + ; Register save area layout + + XCPT_I == 0 ; Offset 0: Saved I w/interrupt state in carry + XCPT_BC == 2 ; Offset 1: Saved BC register + XCPT_DE == 4 ; Offset 2: Saved DE register + XCPT_IX == 6 ; Offset 3: Saved IX register + XCPT_IY == 8 ; Offset 4: Saved IY register + XCPT_SP == 10 ; Offset 5: Offset to SP at time of interrupt + XCPT_HL == 12 ; Offset 6: Saved HL register + XCPT_AF == 14 ; Offset 7: Saved AF register + XCPT_PC == 16 ; Offset 8: Offset to PC at time of interrupt + + ; Default stack base (needs to be fixed) + + .include "asm_mem.h" + +;************************************************************************** +; Global symbols used +;************************************************************************** + + .globl _os_start ; OS entry point + .globl _up_doirq ; Interrupt decoding logic + +;************************************************************************** +; System start logic +;************************************************************************** + +_up_reset: + ; Set up the stack pointer at the location determined the Makefile + ; and stored in asm_mem.h + + ld SP, #CONFIG_STACK_END ; Set stack pointer + + ; Performed initialization unique to the SDCC toolchain + + call gsinit ; Initialize the data section + + ; Copy the reset vectors + + ld hl, #_up_rstvectors ; code for RAM + ld de, #0x4000 ; move it here + ld bc, #3*7 ; 7 vectors / 3 bytes each + ldir + + ; Then start NuttX + + call _os_start ; jump to the OS entry point + + ; NuttX will never return, but just in case... + +_up_halt:: + halt ; We should never get here + jp _up_halt + + ; Data to copy to address 0x4000 + +_up_rstvectors: + jp _up_rst1 ; 0x4000 : RST 1 + jp _up_rst2 ; 0x4003 : RST 2 + jp _up_rst3 ; 0x4006 : RST 3 + jp _up_rst4 ; 0x4009 : RST 4 + jp _up_rst5 ; 0x400c : RST 5 + jp _up_rst6 ; 0x400f : RST 6 + jp _up_rst7 ; 0x4012 : RST 7 + +;************************************************************************** +; Other reset handlers +; +; Interrupt mode 1 behavior: +; +; 1. M1 cycle: 7 ticks +; Acknowledge interrupt and decrements SP +; 2. M2 cycle: 3 ticks +; Writes the MS byte of the PC onto the stack and decrements SP +; 3. M3 cycle: 3 ticks +; Writes the LS byte of the PC onto the stack and sets the PC to 0x0038. +; +;************************************************************************** + +_up_rst1: ; RST 1 + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #1 ; 1 = Z180_RST1 + jr _up_rstcommon ; Remaining RST handling is common + +_up_rst2: ; RST 2 + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #2 ; 2 = Z180_RST2 + jr _up_rstcommon ; Remaining RST handling is common + +_up_rst3: ; RST 3 + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #3 ; 1 = Z180_RST3 + jr _up_rstcommon ; Remaining RST handling is common + +_up_rst4: ; RST 4 + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #4 ; 1 = Z180_RST4 + jr _up_rstcommon ; Remaining RST handling is common + +_up_rst5: ; RST 5 + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #5 ; 1 = Z180_RST5 + jr _up_rstcommon ; Remaining RST handling is common + +_up_rst6: ; RST 6 + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #6 ; 1 = Z180_RST6 + jr _up_rstcommon ; Remaining RST handling is common + +_up_rst7: ; RST 7 + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #7 ; 7 = Z180_RST7 + jr _up_rstcommon ; Remaining RST handling is common + +;************************************************************************** +; Common Interrupt handler +;************************************************************************** + +_up_rstcommon: + ; Create a register frame. SP points to top of frame + 4, pushes + ; decrement the stack pointer. Already have + ; + ; Offset 8: Return PC is already on the stack + ; Offset 7: AF (retaining flags) + ; + ; IRQ number is in A + + push hl ; Offset 6: HL + ld hl, #(3*2) ; HL is the value of the stack pointer before + add hl, sp ; the interrupt occurred + push hl ; Offset 5: Stack pointer + push iy ; Offset 4: IY + push ix ; Offset 3: IX + push de ; Offset 2: DE + push bc ; Offset 1: BC + + ld b, a ; Save the reset number in B + ld a, i ; Parity bit holds interrupt state + push af ; Offset 0: I with interrupt state in parity + di + + ; Call the interrupt decode logic. SP points to the beginning of the reg structure + + ld hl, #0 ; Argument #2 is the beginning of the reg structure + add hl, sp ; + push hl ; Place argument #2 at the top of stack + push bc ; Argument #1 is the Reset number + inc sp ; (make byte sized) + call _up_doirq ; Decode the IRQ + + ; On return, HL points to the beginning of the reg structure to restore + ; Note that (1) the arguments pushed on the stack are not popped, and (2) the + ; original stack pointer is lost. In the normal case (no context switch), + ; HL will contain the value of the SP before the arguments were pushed. + + ld sp, hl ; Use the new stack pointer + + ; Restore registers. HL points to the beginning of the reg structure to restore + + ex af, af' ; Select alternate AF + pop af ; Offset 0: AF' = I with interrupt state in carry + ex af, af' ; Restore original AF + pop bc ; Offset 1: BC + pop de ; Offset 2: DE + pop ix ; Offset 3: IX + pop iy ; Offset 4: IY + exx ; Use alternate BC/DE/HL + ld hl, #-2 ; Offset of SP to account for ret addr on stack + pop de ; Offset 5: HL' = Stack pointer after return + add hl, de ; HL = Stack pointer value before return + exx ; Restore original BC/DE/HL + pop hl ; Offset 6: HL + pop af ; Offset 7: AF + + ; Restore the stack pointer + + exx ; Use alternate BC/DE/HL + ld sp, hl ; Set SP = saved stack pointer value before return + exx ; Restore original BC/DE/HL + + ; Restore interrupt state + + ex af, af' ; Recover interrupt state + jp po, nointenable ; Odd parity, IFF2=0, means disabled + ex af, af' ; Restore AF (before enabling interrupts) + ei ; yes + reti +nointenable:: + ex af, af' ; Restore AF + reti + +;************************************************************************** +; Ordering of segments for the linker (SDCC only) +;************************************************************************** + + .area _HOME + .area _CODE + .area _INITIALIZER + .area _GSINIT + .area _GSFINAL + + .area _DATA + .area _INITIALIZED + .area _BSEG + .area _BSS + .area _HEAP + +;************************************************************************** +; Global data initialization logic (SDCC only) +;************************************************************************** + + .area _GSINIT +gsinit:: + ld bc, #l__INITIALIZER + ld a, b + or a, c + jr Z, gsinit_next + ld de, #s__INITIALIZED + ld hl, #s__INITIALIZER + ldir +gsinit_next: + + .area _GSFINAL + ret + +;************************************************************************** +; The start of the heap (SDCC only). Note that is actually resides in +; the _CODE area (which may be FLASH or ROM) +;************************************************************************** + + .area _CODE +_g_heapbase:: + .dw #s__HEAP + diff --git a/nuttx/arch/z80/src/z180/z180_saveusercontext.asm b/nuttx/arch/z80/src/z180/z180_saveusercontext.asm new file mode 100644 index 000000000..31c9ef8ce --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_saveusercontext.asm @@ -0,0 +1,143 @@ +;************************************************************************* +; arch/z80/src/z180/z180_saveusercontext.asm +; +; Copyright (C) 2012 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. +; +;************************************************************************* + +;************************************************************************* +; Constants +;************************************************************************* + + ; Register save area layout + + .globl XCPT_I ; Offset 0: Saved I w/interrupt state in parity + .globl XCPT_BC ; Offset 1: Saved BC register + .globl XCPT_DE ; Offset 2: Saved DE register + .globl XCPT_IX ; Offset 3: Saved IX register + .globl XCPT_IY ; Offset 4: Saved IY register + .globl XCPT_SP ; Offset 5: Offset to SP at time of interrupt + .globl XCPT_HL ; Offset 6: Saved HL register + .globl XCPT_AF ; Offset 7: Saved AF register + .globl XCPT_PC ; Offset 8: Offset to PC at time of interrupt + + ; Stack frame + + FRAME_IY == 0 ; Location of IY on the stack + FRAME_IX == 2 ; Location of IX on the stack + FRAME_RET == 4 ; Location of return address on the stack + FRAME_REGS == 6 ; Location of reg save area on stack + + SP_OFFSET == 6 + +;************************************************************************* +; Name: z180_saveusercontext +;************************************************************************* + + .area _CODE +_z180_saveusercontext: + ; Set up a stack frame + + push ix ; Save IX and IY + push iy + ld ix, #0 + add ix, sp ; IX = stack frame + + ; Fetch the address of the save area + + ld e, FRAME_REGS(ix) ; HL = save area address + ld d, FRAME_REGS+1(ix) ; + ld iy, #0 + add iy, de ; IY = save area address + + ; Then save the registers + + ; Save the current interrupt state at offset 0 + + ld a, i ; Get interrupt state + push af + pop hl + ld XCPT_I(iy), l ; Offset 0: I w/interrupt state in parity + ld XCPT_I+1(iy), h + + ; Save BC at offset 1 + + ld XCPT_BC(iy), c ; Offset 1: BC + ld XCPT_BC+1(iy), b + + ; DE is not preserved (offset 2) + + ; Save IX at offset 3 + + ld l, FRAME_IX(ix) ; HL = Saved alue of IX + ld h, FRAME_IX+1(ix) ; + ld XCPT_IX(iy), l ; Offset 3: IX + ld XCPT_IX+1(iy), h ; + + ; Save IY at offset 4 + + ld l, FRAME_IY(ix) ; HL = Saved value of IY + ld h, FRAME_IY+1(ix) ; + ld XCPT_IY(iy), l ; Offset 4: IY + ld XCPT_IY+1(iy), h + + ; Save that stack pointer as it would be upon return in offset 5 + + ld hl, #SP_OFFSET ; Value of stack pointer on return + add hl, sp + ld XCPT_SP(iy), l ; Offset 5 SP + ld XCPT_SP+1(iy), h + + ; HL is saved as the value 1 at offset 6 + + xor a ; A = 0 + ld XCPT_HL+1(iy), a ; Offset 2: HL on return (=1) + inc a ; A = 1 + ld XCPT_HL(iy), a ; + + ; AF is not preserved (offset 7) + + ; Save the return address in offset 8 + + ld l, FRAME_RET(ix) ; HL = Saved return address + ld h, FRAME_RET+1(ix) ; + ld XCPT_PC(iy), l ; Offset 8: PC + ld XCPT_PC+1(iy), h + + ; Return the value 0 + + xor a ; HL = return value of zero + ld l, a + ld h, a + + pop iy + pop ix + ret diff --git a/nuttx/arch/z80/src/z180/z180_schedulesigaction.c b/nuttx/arch/z80/src/z180/z180_schedulesigaction.c new file mode 100644 index 000000000..3d9bbe55b --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_schedulesigaction.c @@ -0,0 +1,192 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_schedulesigaction.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include + +#include "chip/switch.h" +#include "os_internal.h" +#include "up_internal.h" + +#ifndef CONFIG_DISABLE_SIGNALS + +/**************************************************************************** + * Private Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: z180_sigsetup + ****************************************************************************/ + +static void z180_sigsetup(FAR _TCB *tcb, sig_deliver_t sigdeliver, FAR chipreg_t *regs) +{ + /* Save the return address and interrupt state. These will be restored by + * the signal trampoline after the signals have been delivered. + */ + + tcb->xcp.sigdeliver = sigdeliver; + tcb->xcp.saved_pc = regs[XCPT_PC]; + tcb->xcp.saved_i = regs[XCPT_I]; + + /* Then set up to vector to the trampoline with interrupts disabled */ + + regs[XCPT_PC] = (chipreg_t)up_sigdeliver; + regs[XCPT_I] = 0; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_schedule_sigaction + * + * Description: + * This function is called by the OS when one or more + * signal handling actions have been queued for execution. + * The architecture specific code must configure things so + * that the 'igdeliver' callback is executed on the thread + * specified by 'tcb' as soon as possible. + * + * This function may be called from interrupt handling logic. + * + * This operation should not cause the task to be unblocked + * nor should it cause any immediate execution of sigdeliver. + * Typically, a few cases need to be considered: + * + * (1) This function may be called from an interrupt handler + * During interrupt processing, all xcptcontext structures + * should be valid for all tasks. That structure should + * be modified to invoke sigdeliver() either on return + * from (this) interrupt or on some subsequent context + * switch to the recipient task. + * (2) If not in an interrupt handler and the tcb is NOT + * the currently executing task, then again just modify + * the saved xcptcontext structure for the recipient + * task so it will invoke sigdeliver when that task is + * later resumed. + * (3) If not in an interrupt handler and the tcb IS the + * currently executing task -- just call the signal + * handler now. + * + ****************************************************************************/ + +void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver) +{ + dbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver); + + /* Refuse to handle nested signal actions */ + + if (tcb->xcp.sigdeliver == NULL) + { + irqstate_t flags; + + /* Make sure that interrupts are disabled */ + + flags = irqsave(); + + /* First, handle some special cases when the signal is being delivered + * to the currently executing task. + */ + + if (tcb == (FAR _TCB*)g_readytorun.head) + { + /* CASE 1: We are not in an interrupt handler and a task is + * signalling itself for some reason. + */ + + if (!IN_INTERRUPT()) + { + /* In this case just deliver the signal now. */ + + sigdeliver(tcb); + } + + /* CASE 2: We are in an interrupt handler AND the interrupted task + * is the same as the one that must receive the signal, then we + * will have to modify the return state as well as the state in + * the TCB. + */ + + else + { + /* Set up to vector to the trampoline with interrupts disabled. */ + + z180_sigsetup(tcb, sigdeliver, IRQ_STATE()); + + /* And make sure that the saved context in the TCB + * is the same as the interrupt return context. + */ + + SAVE_IRQCONTEXT(tcb); + } + } + + /* Otherwise, we are (1) signaling a task is not running from an interrupt + * handler or (2) we are not in an interrupt handler and the running task + * is signalling some non-running task. + */ + + else + { + /* Set up to vector to the trampoline with interrupts disabled. */ + + z180_sigsetup(tcb, sigdeliver, tcb->xcp.regs); + } + + irqrestore(flags); + } +} + +#endif /* CONFIG_DISABLE_SIGNALS */ + diff --git a/nuttx/arch/z80/src/z180/z180_sigdeliver.c b/nuttx/arch/z80/src/z180/z180_sigdeliver.c new file mode 100644 index 000000000..281cfcf6a --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_sigdeliver.c @@ -0,0 +1,139 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_sigdeliver.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +#include "chip/switch.h" +#include "os_internal.h" +#include "up_internal.h" + +#ifndef CONFIG_DISABLE_SIGNALS + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_sigdeliver + * + * Description: + * This is the a signal handling trampoline. When a signal action was + * posted. The task context was mucked with and forced to branch to this + * location with interrupts disabled. + * + ****************************************************************************/ + +void up_sigdeliver(void) +{ +#ifndef CONFIG_DISABLE_SIGNALS + FAR _TCB *rtcb = (_TCB*)g_readytorun.head; + chipreg_t regs[XCPTCONTEXT_REGS]; + sig_deliver_t sigdeliver; + + /* Save the errno. This must be preserved throughout the signal handling + * so that the user code final gets the correct errno value (probably + * EINTR). + */ + + int saved_errno = rtcb->pterrno; + + up_ledon(LED_SIGNAL); + + sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); + ASSERT(rtcb->xcp.sigdeliver != NULL); + + /* Save the real return state on the stack. */ + + z180_copystate(regs, rtcb->xcp.regs); + regs[XCPT_PC] = rtcb->xcp.saved_pc; + regs[XCPT_I] = rtcb->xcp.saved_i; + + /* Get a local copy of the sigdeliver function pointer. We do this so + * that we can nullify the sigdeliver function pointer in the TCB and + * accept more signal deliveries while processing the current pending + * signals. + */ + + sigdeliver = rtcb->xcp.sigdeliver; + rtcb->xcp.sigdeliver = NULL; + + /* Then restore the task interrupt state. */ + + irqrestore(regs[XCPT_I]); + + /* Deliver the signals */ + + sigdeliver(rtcb); + + /* Output any debug messages BEFORE restoring errno (because they may + * alter errno), then disable interrupts again and restore the original + * errno that is needed by the user logic (it is probably EINTR). + */ + + sdbg("Resuming\n"); + (void)irqsave(); + rtcb->pterrno = saved_errno; + + /* Then restore the correct state for this thread of execution. */ + + up_ledoff(LED_SIGNAL); + z180_restoreusercontext(regs); +#endif +} + +#endif /* CONFIG_DISABLE_SIGNALS */ diff --git a/nuttx/arch/z80/src/z80/chip.h b/nuttx/arch/z80/src/z80/chip.h index e80b2b231..a216d71ef 100644 --- a/nuttx/arch/z80/src/z80/chip.h +++ b/nuttx/arch/z80/src/z80/chip.h @@ -1,6 +1,6 @@ /************************************************************************************ - * z80/chip.h - * chip/chip.h + * arch/z80/src/z80/chip.h + * arch/z80/src/chip/chip.h * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -34,59 +34,21 @@ * ************************************************************************************/ -#ifndef __Z80_CHIP_H -#define __Z80_CHIP_H +#ifndef __ARCH_Z80_SRC_Z80_CHIP_H +#define __ARCH_Z80_SRC_Z80_CHIP_H /************************************************************************************ * Included Files ************************************************************************************/ -#ifndef __ASSEMBLY__ -# include -#endif +#include /************************************************************************************ - * Definitions + * Pre-processor Definitions ************************************************************************************/ -/* Bits in the Z80 FLAGS register ***************************************************/ - -#define Z80_C_FLAG 0x01 /* Bit 0: Carry flag */ -#define Z80_N_FLAG 0x02 /* Bit 1: Add/Subtract flag */ -#define Z80_PV_FLAG 0x04 /* Bit 2: Parity/Overflow flag */ -#define Z80_H_FLAG 0x10 /* Bit 4: Half carry flag */ -#define Z80_Z_FLAG 0x40 /* Bit 5: Zero flag */ -#define Z80_S_FLAG 0x80 /* Bit 7: Sign flag */ - -/* Register access macros ***********************************************************/ - -#ifndef __ASSEMBLY__ - -# define getreg8(a) (*(volatile uint8_t *)(a)) -# define putreg8(v,a) (*(volatile uint8_t *)(a) = (v)) -# define getreg16(a) (*(volatile uint16_t *)(a)) -# define putreg16(v,a) (*(volatile uint16_t *)(a) = (v)) -# define getreg32(a) (*(volatile uint32_t *)(a)) -# define putreg32(v,a) (*(volatile uint32_t *)(a) = (v)) - -#endif - /************************************************************************************ * 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 /* __Z80_CHIP_H */ +#endif /* __ARCH_Z80_SRC_Z80_CHIP_H */ -- cgit v1.2.3 From 97ddd5100fa54b3c49e0aae002ec2883b01b3b41 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 10 Dec 2012 22:39:18 +0000 Subject: Add arch/z80/src/z180/z180_iomap.h git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5427 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z80/Kconfig | 26 +++ nuttx/arch/z80/include/z180/chip.h | 16 +- nuttx/arch/z80/include/z80/chip.h | 13 -- nuttx/arch/z80/src/z180/z180_iomap.h | 378 +++++++++++++++++++++++++++++++++++ 4 files changed, 406 insertions(+), 27 deletions(-) create mode 100644 nuttx/arch/z80/src/z180/z180_iomap.h (limited to 'nuttx') diff --git a/nuttx/arch/z80/Kconfig b/nuttx/arch/z80/Kconfig index a04ecdedd..91aedba8f 100644 --- a/nuttx/arch/z80/Kconfig +++ b/nuttx/arch/z80/Kconfig @@ -378,6 +378,30 @@ config ARCH_CHIP_Z8F642X config ARCH_CHIP_Z8F640X bool +config ARCH_CHIP_Z180 + bool + +config ARCH_CHIP_Z80180 + bool + +config ARCH_CHIP_Z80181 + bool + +config ARCH_CHIP_Z80182 + bool + +config ARCH_CHIP_Z80195 + bool + +config ARCH_CHIP_Z8L180 + bool + +config ARCH_CHIP_Z8L182 + bool + +config ARCH_CHIP_Z8S180 + bool + config ARCH_CHIP_Z8 bool @@ -390,11 +414,13 @@ config HAVE_LOWUARTINIT config ARCH_CHIP string default "z80" if ARCH_CHIP_Z80 + default "z180" if ARCH_CHIP_Z180 default "z8" if ARCH_CHIP_Z8 default "ez80" if ARCH_CHIP_EZ80 source "arch/z80/src/common/Kconfig" source "arch/z80/src/z80/Kconfig" +source "arch/z80/src/z180/Kconfig" source "arch/z80/src/z8/Kconfig" source "arch/z80/src/ez80/Kconfig" diff --git a/nuttx/arch/z80/include/z180/chip.h b/nuttx/arch/z80/include/z180/chip.h index f2e140a10..22a3cee37 100644 --- a/nuttx/arch/z80/include/z180/chip.h +++ b/nuttx/arch/z80/include/z180/chip.h @@ -49,7 +49,7 @@ * Pre-processor Definitions ****************************************************************************/ -/* Bits in the Z80 FLAGS register ***************************************************/ +/* Bits in the Z180 FLAGS register ******************************************/ #define Z180_C_FLAG 0x01 /* Bit 0: Carry flag */ #define Z180_N_FLAG 0x02 /* Bit 1: Add/Subtract flag */ @@ -58,19 +58,7 @@ #define Z180_Z_FLAG 0x40 /* Bit 5: Zero flag */ #define Z180_S_FLAG 0x80 /* Bit 7: Sign flag */ -/* Register access macros ***********************************************************/ - -#ifndef __ASSEMBLY__ - -# define getreg8(a) (*(volatile uint8_t *)(a)) -# define putreg8(v,a) (*(volatile uint8_t *)(a) = (v)) -# define getreg16(a) (*(volatile uint16_t *)(a)) -# define putreg16(v,a) (*(volatile uint16_t *)(a) = (v)) -# define getreg32(a) (*(volatile uint32_t *)(a)) -# define putreg32(v,a) (*(volatile uint32_t *)(a) = (v)) - -#endif - +/* Z180 Chip Definitions ****************************************************/ /* Z800180 * * The 8-bit Z80180 MPU provides the benefits of reduced system costs and diff --git a/nuttx/arch/z80/include/z80/chip.h b/nuttx/arch/z80/include/z80/chip.h index 9f77e395c..5c0c61166 100644 --- a/nuttx/arch/z80/include/z80/chip.h +++ b/nuttx/arch/z80/include/z80/chip.h @@ -58,19 +58,6 @@ #define Z80_Z_FLAG 0x40 /* Bit 5: Zero flag */ #define Z80_S_FLAG 0x80 /* Bit 7: Sign flag */ -/* Register access macros ***********************************************************/ - -#ifndef __ASSEMBLY__ - -# define getreg8(a) (*(volatile uint8_t *)(a)) -# define putreg8(v,a) (*(volatile uint8_t *)(a) = (v)) -# define getreg16(a) (*(volatile uint16_t *)(a)) -# define putreg16(v,a) (*(volatile uint16_t *)(a) = (v)) -# define getreg32(a) (*(volatile uint32_t *)(a)) -# define putreg32(v,a) (*(volatile uint32_t *)(a) = (v)) - -#endif - /************************************************************************************ * Public Function Prototypes ************************************************************************************/ diff --git a/nuttx/arch/z80/src/z180/z180_iomap.h b/nuttx/arch/z80/src/z180/z180_iomap.h new file mode 100644 index 000000000..d887b317b --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_iomap.h @@ -0,0 +1,378 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_iomap.h + * + * Copyright (C) 2012 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 __ARCH_Z80_SRC_Z180_Z180_IOMAP_H +#define __ARCH_Z80_SRC_Z180_Z180_IOMAP_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + + /* Z180 Register Bit addresses **********************************************/ + +#define Z180_ASCI0_CNTLA 0x00 /* ASCI Control Register A Ch 0 */ +#define Z180_ASCI1_CNTLA 0x01 /* ASCI Control Register A Ch 1 */ +#define Z180_ASCI0_CNTLB 0x02 /* ASCI Control Register B Ch 0 */ +#define Z180_ASCI1_CNTLB 0x03 /* ASCI Control Register B Ch 1 */ +#define Z180_ASCI0_STAT 0x04 /* ASCI Status Register Ch 0 */ +#define Z180_ASCI1_STAT 0x05 /* ASCI Status Register Ch 1 */ +#define Z180_ASCI0_TDR 0x06 /* ASCI Transmit Data Register Ch 0 */ +#define Z180_ASCI1_TDR 0x07 /* ASCI Transmit Data Register Ch 1 */ +#define Z180_ASCI0_RDR 0x08 /* ASCI Receive Data Register Ch 0 */ +#define Z180_ASCI1_RDR 0x09 /* ASCI Receive Data Register Ch 1 */ + +#define Z180_CSIO_CNTR 0x0a /* CSI/O Control Register */ +#define Z180_CSIO_TRD 0x0b /* Transmit/Receive Data Register */ + +#define Z180_TMR0_DRL 0x0c /* Timer Data Register Ch 0 L */ +#define Z180_TMR0_DRH 0x0d /* Data Register Ch 0 H */ +#define Z180_TMR0_RLDRL 0x0e /* Reload Register Ch 0 L */ +#define Z180_TMR0_RLDRH 0x0f /* Reload Register Ch 0 H */ +#define Z180_TMR_TCR 0x10 /* Timer Control Register */ + +#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ +# define Z180_ASCI0_ASEXT 0x12 /* ASCI Extension Control Register */ +# define Z180_ASCI1_ASEXT 0x13 /* ASCI Extension Control Register */ +#endif + +#define Z180_TMR1_DRL 0x14 /* Data Register Ch 1 L */ +#define Z180_TMR1_DRH 0x15 /* Data Register Ch 1 H */ +#define Z180_TMR1_RLDRL 0x16 /* Reload Register Ch 1 L */ +#define Z180_TMR1_RLDRH 0x17 /* Reload Register Ch 1 H */ + +#define Z180_FRC 0x18 /* Free Running Counter */ + +#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ +# define Z180_ASCI0_ASTCL 0x1a /* ASCI Time Constant Low */ +# define Z180_ASCI0_ASTCH 0x1b /* ASCI Time Constant High */ +# define Z180_ASCI1_ASTCL 0x1c /* ASCI Time Constant Low */ +# define Z180_ASCI1_ASTCH 0x1d /* ASCI Time Constant High */ + +# define Z180_CMR 0x1e /* Clock Multiplier Register */ +# define Z180_CCR 0x1f /* CPU Control Register */ +#endif + +#define Z180_DMA_SAR0L 0x20 /* DMA Source Address Register Ch 0L */ +#define Z180_DMA_SAR0H 0x21 /* DMA Source Address Register Ch 0H */ +#define Z180_DMA_SAR0B 0x22 /* DMA Source Address Register Ch 0B */ +#define Z180_DMA_DAR0L 0x23 /* DMA Destination Address Register Ch 0L */ +#define Z180_DMA_DAR0H 0x24 /* DMA Destination Address Register Ch 0H */ +#define Z180_DMA_DAR0B 0x25 /* DMA Destination Address Register Ch 0B */ +#define Z180_DMA_BCR0L 0x26 /* DMA Byte Count Register Ch 0L */ +#define Z180_DMA_BCR0H 0x27 /* DMA Byte Count Register Ch 0H */ +#define Z180_DMA_MAR1L 0x28 /* DMA Memory Address Register Ch 1L */ +#define Z180_DMA_MAR1H 0x29 /* DMA Memory Address Register Ch 1H */ +#define Z180_DMA_MAR1B 0x2a /* DMA Memory Address Register Ch 1B */ +#define Z180_DMA_IAR1L 0x2b /* DMA I/0 Address Register Ch 1L */ +#define Z180_DMA_IAR1H 0x2c /* DMA I/0 Address Register Ch 1H */ +#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ +# define Z180_DMA_IAR1B 0x2d /* DMA I/O Address Register Ch 1B */ +#endif +#define Z180_DMA_BCR1L 0x2e /* DMA Byte Count Register Ch 1L */ +#define Z180_DMA_BCR1H 0x2f /* DMA Byte Count Register Ch 1H */ +#define Z180_DMA_DSTAT 0x30 /* DMA Status Register */ +#define Z180_DMA_DMODE 0x31 /* DMA Mode Register */ +#define Z180_DMA_DCNTL 0x32 /* DMA/WAIT Control Register */ + +#define Z180_INT_IL 0x33 /* IL Register (Interrupt Vector Low Register) */ +#define Z180_INT_ITC 0x34 /* INT/TRAP Control Register */ + +#define Z180_RCR 0x36 /* Refresh Control Register */ + +#define Z180_MMU_CBR 0x38 /* MMU Common Base Register */ +#define Z180_MMU_BBR 0x39 /* MMU Bank Base Register */ +#define Z180_MMU_CBAR 0x3a /* MMU Common/Bank Area Register */ + +#define Z180_OMCR 0x3e /* Operation Mode Control Register */ +#define Z180_ICR 0x3f /* I/O Control Register */ + +/* Z180 Register Bit definitions ********************************************/ + +/* ASCI Control Register A 0 (CNTLA0: 0x00) */ +/* ASCI Control Register A 1 (CNTLA1: 0x01) */ + +#define ASCI_CNTRLA_MPE (0x80) /* Bit 7: Multi-Processor Mode Enable */ +#define ASCI_CNTRLA_RE (0x40) /* Bit 6: Receiver Enab */ +#define ASCI_CNTRLA_TE (0x20) /* Bit 5: Transmitter Enable */ +#define ASCI_CNTRLA_RTS0 (0x10) /* Bit 4: Request to Send Channel 0 (ASCI0 only) */ +#define ASCI_CNTRLA_CKA1D (0x10) /* Bit 4: CKA1 Clock Disable (ASCI1 only) */ +#define ASCI_CNTRLA_MPBR (0x08) /* Bit 3: Multiprocessor Bit Receive */ +#define ASCI_CNTRLA_EFR (0x08) /* Bit 3: Error Flag Reset */ +#define ASCI_CNTRLA_MOD2 (0x04) /* Bit 2: 8 bit data */ +#define ASCI_CNTRLA_MOD1 (0x02) /* Bit 1: Parity enabled */ +#define ASCI_CNTRLA_MOD0 (0x01) /* Bit 0: Parity enabled */ + +/* ASCI Control Register B 0 (CNTLB0: 0x02) */ +/* ASCI Control Register B 1 (CNTLB1: 0x03) */ + +#define ASCI_CNTRLB_MPBT (0x80) /* Bit 7: Multiprocessor Bit Transmit */ +#define ASCI_CNTRLB_MP (0x40) /* Bit 6: Multiprocessor Mode */ +#define ASCI_CNTRLB_CTS (0x20) /* Bit 5: Clear to Send */ +#define ASCI_CNTRLB_PS (0x20) /* Bit 5: Prescale */ +#define ASCI_CNTRLB_PEO (0x10) /* Bit 4: Parity Even Odd */ +#define ASCI_CNTRLB_DR (0x08) /* Bit 3: Divide Ratio */ + +#define ASCI_CNTRLB_SS_SHIFT (0) /* Bits 0-2: Source/Speed Select */ +#define ASCI_CNTRLB_SS_MASK (7 << ASCI_CNTRLB_SS_SHIFT) +# define ASCI_CNTRLB_SS_DIV1 (0 << ASCI_CNTRLB_SS_SHIFT) /* Divide Ratio: 1 */ +# define ASCI_CNTRLB_SS_DIV2 (1 << ASCI_CNTRLB_SS_SHIFT) /* Divide Ratio: 2 */ +# define ASCI_CNTRLB_SS_DIV4 (2 << ASCI_CNTRLB_SS_SHIFT) /* Divide Ratio: 4 */ +# define ASCI_CNTRLB_SS_DIV8 (3 << ASCI_CNTRLB_SS_SHIFT) /* Divide Ratio: 8 */ +# define ASCI_CNTRLB_SS_DIV16 (4 << ASCI_CNTRLB_SS_SHIFT) /* Divide Ratio: 16 */ +# define ASCI_CNTRLB_SS_DIV32 (5 << ASCI_CNTRLB_SS_SHIFT) /* Divide Ratio: 32 */ +# define ASCI_CNTRLB_SS_DIV64 (6 << ASCI_CNTRLB_SS_SHIFT) /* Divide Ratio: 64 */ +# define ASCI_CNTRLB_SS_EXT (7 << ASCI_CNTRLB_SS_SHIFT) /* External clock */ + +/* ASCI Status Register 0 (STAT0: 0x04) */ +/* ASCI Status Register 1 (STAT1: 0x05) */ + +#define ASCI_STAT_RFRF (0x80) /* Bit 7: Receive Data Register Full */ +#define ASCI_STAT_OVRN (0x40) /* Bit 6: Overrun Error */ +#define ASCI_STAT_PE (0x20) /* Bit 5: Parity Error */ +#define ASCI_STAT_FE (0x10) /* Bit 4: Framing Error */ +#define ASCI_STAT_RIE (0x08) /* Bit 3: Receive Interrupt Enable */ +#define ASCI_STAT_DCD0 (0x04) /* Bit 2: Data Carrier Detect (ASCI0 only) */ +#define ASCI_STAT_CTS1E (0x04) /* Bit 2: Channel 1 CTS Enable (ASCI1 only) */ +#define ASCI_STAT_TDRE (0x02) /* Bit 1: Transmit Data Register Empty */ +#define ASCI_STAT_TIE (0x01) /* Bit 0: Transmit Interrupt Enable */ + +/* ASCI Transmit Data Register Ch. 0 (TDR0: 0x06) - 8-bit data */ +/* ASCI Transmit Data Register Ch. 1 (TDR1: 0x07) - 8-bit data */ +/* ASCI Receive Data Register Ch. 0 (RDR0: 0x08) - 8-bit data */ +/* ASCI Receive Data Register Ch. 1 (RDR0: 0x09) - 8-bit data */ + +/* CSI/O Control/Status Register (CNTR: 0x0a) */ + +#define CSIO_CNTR_EF (0x80) /* Bit 7: End Flag */ +#define CSIO_CNTR_EIE (0x40) /* Bit 6: End Interrupt Enable */ +#define CSIO_CNTR_RE (0x20) /* Bit 5: Receive Enable */ +#define CSIO_CNTR_TE (0x10) /* Bit 4: Transmit Enable */ +#define CSIO_CNTR_SS_SHIFT (0) /* Bits 0-2: Speed Select */ +#define CSIO_CNTR_SS_MASK (7 << CSIO_CNTR_SS_SHIFT) +# define CSIO_CNTR_DIV20 (0 << CSIO_CNTR_SS_SHIFT) /* Divide Ratio: 20 Baud: 200000 */ +# define CSIO_CNTR_DIV40 (1 << CSIO_CNTR_SS_SHIFT) /* Divide Ratio: 40 Baud: 100000 */ +# define CSIO_CNTR_DIV80 (2 << CSIO_CNTR_SS_SHIFT) /* Divide Ratio: 80 Baud: 50000 */ +# define CSIO_CNTR_DIV160 (3 << CSIO_CNTR_SS_SHIFT) /* Divide Ratio: 160 Baud: 25000 */ +# define CSIO_CNTR_DIV320 (4 << CSIO_CNTR_SS_SHIFT) /* Divide Ratio: 320 Baud: 12500 */ +# define CSIO_CNTR_DIV640 (5 << CSIO_CNTR_SS_SHIFT) /* Divide Ratio: 640 Baud: 6250 */ +# define CSIO_CNTR_DIV1280 (6 << CSIO_CNTR_SS_SHIFT) /* Divide Ratio: 1280 Baud: 3125 */ +# define CSIO_CNTR_EXT (7 << CSIO_CNTR_SS_SHIFT) /* External Clock input (less than 20) */ + /* Baud at Phi = 4 MHz */ + +/* CSI/O Transmit/Receive Register (TRDR: 0x0b) -- 8-bit data */ +/* Timer Data Register 0L (TMDR0L: 0x0c) -- 8-bit data */ +/* Timer Data Register 0H (TMDR0H: 0x0d) -- 8-bit data */ +/* Timer Reload Register Channel 0L (RLDR0L: 0x0e) -- 8-bit data */ +/* Timer Reload Register Channel 0H (RLDR0H: 0x0f) -- 8-bit data */ + +/* Timer Control Register (TCR: 0x10) */ + +#define TMR_TCR_TIF1 (0x80) /* Bit 7: Timer 1 Interrupt Flag */ +#define TMR_TCR_TIF0 (0x40) /* Bit 6: Timer 0 Interrupt Flag */ +#define TMR_TCR_TIE1 (0x20) /* Bit 5: Timer 1 Interrupt Enable */ +#define TMR_TCR_TIE0 (0x10) /* Bit 4: Timer 0 Interrupt Enable */ +#define TMR_TCR_TOC1 (0x08) /* Bit 3: Timer 1 Output Control */ +#define TMR_TCR_TOC0 (0x04) /* Bit 2: Timer 0 Output Control */ +#define TMR_TCR_TDE1 (0x02) /* Bit 1: Timer 1 Down Count Enable */ +#define TMR_TCR_TDE0 (0x01) /* Bit 0: Timer 0 Down Count Enable */ + +/* ASCI0 Extension Control Register (I/O Address: 0x12) (Z8S180/L180-Class Processors Only) */ +/* ASCI1 Extension Control Register (I/O Address: 0x13) (Z8S180/L180-Class Processors Only) */ + +#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ +# define ASCI_ASEXT_RDRF (0x80) /* Bit 7: RDRF Interrupt Inhibit */ +# define ASCI0_ASEXT_DCD0 (0x80) /* Bit 6: DCD0 advisory to SW (ASCI0 only) */ +# define ASCI0_ASEXT_CTS0 (0x80) /* Bit 5: CTS0 advisory to SW (ASCI0 only) */ +# define ASCI_ASEXT_X1BC (0x80) /* Bit 4: CKA0 is bit clock */ +# define ASCI_ASEXT_BRG (0x80) /* Bit 3: Enable 16-bit BRG counter */ +# define ASCI_ASEXT_BRKEN (0x80) /* Bit 2: Break Feature Enable */ +# define ASCI_ASEXT_BRKDET (0x80) /* Bit 1: Break Detect */ +# define ASCI_ASEXT_SNDBRK (0x80) /* Bit 0: Send Break */ +#endif + +/* Timer Data Register 1L (TMDR1L: 0x14) -- 8-bit data */ +/* Timer Data Register 1H (TMDR1H: 0x15) -- 8-bit data */ +/* Timer Reload Register Channel 1L (RLDR1L: 0x16) -- 8-bit data */ +/* Timer Reload Register Channel 1H (RLDR1H: 0x17) -- 8-bit data */ +/* Free Running counter (FRC: 0x18) -- 8-bit data */ + +/* ASCI0 Time Constant Low Register (I/O Address: 0x1a) (Z8S180/L180-Class Processors Only) -- 8-bit data */ +/* ASCI0 Time Constant High Register (I/O Address: 0x1b) (Z8S180/L180-Class Processors Only) -- 8-bit data */ +/* ASCI1 Time Constant Low Register (I/O Address: 0x1c) (Z8S180/L180-Class Processors Only) -- 8-bit data */ +/* ASCI1 Time Constant High Register (I/O Address: 0x1d) (Z8S180/L180-Class Processors Only) -- 8-bit data */ + +/* Clock Multiplier Register (CMR: 0x1e) (Z8S180/L180-Class Processors Only) */ + +#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ +# define CMR_CMM (0x80) /* Bit 7: X2 Clock Multiplier Mode */ +#endif + +/* CPU Control Register (CCR: 0x1f) (Z8S180/L180-Class Processors Only) */ + +#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ +# define CCR_XTAL_DIV (0x80) /* Bit 7: Clock Divide */ +# define CCR_STBYIDLE (0x48) /* Bits 3 & 6: STANDBY/IDLE mode */ +# define CCR_NOSTDBY (0x00) /* No STANDBY */ +# define CCR_IDLE (0x08) /* IDLE after SLEEP */ +# define CCR_STBY (0x40) /* STANDBY after SLEEP */ +# define CCR_STBY64 (0x48) /* STANDBY after SLEEP 64 Cycle Exit */ +# define CCR_BREXT (0x20) /* Bit 5: STANDBY/IDLE exit on BUSREQ */ +# define CCR_LNPHI (0x10) /* Bit 4: 33% Drive on EXTPHI Clock */ +# define CCR_LNIO (0x04) /* Bit 2: 33% Drive on certain external I/O */ +# define CCR_LNCPUCTLR (0x02) /* Bit 1: 33% Drive on CPU control signals */ +# define LNADDATA (0x01) /* Bit 0: 33% drive on A10–A0, D7–D0 */ +#endif + +/* DMA Destination Address Register Channel 0 (DAR0 I/O Address 0x23 to 0x25) -- 8-bit data */ +/*DMA Byte Count Register Channel 0 (BCR0 I/O Address = 0x26 to 0x27) -- 8-bit data */ +/* DMA Memory Address Register Channel 1 (MAR1: I/O Address = 0x28 to 0x2a) -- 8-bit data */ +/* DMA I/O Address Register Channel 1 (IAR1: I/O Address = 0x2b to 0x2c) -- 8-bit data */ + +/* DMA I/O Address Register Ch. 1 (IAR1B: 0x2d) (Z8S180/L180-Class Processor Only) */ + +#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ +# define IAR1B_ALTCH (0x80) /* Bit 7: Alternating Channels */ +# define IAR1B_CURRCH (0x40) /* Bit 6: Currently selected DMA channel */ +# define IAR1B_TOUT (0x08) /* Bit 3: TOUT/DREQ is TOUT Out */ +# define IAR1B_IO_SHIFT (0) /* Bits 0-2: I/O selection*/ +# define IAR1B_IO_MASK (3 << IAR1B_IO_SHIFT) +# define IAR1B_IO_TOUT (0 << IAR1B_IO_SHIFT) /* DMA1 ext TOUT */ +# define IAR1B_IO_DREQ (0 << IAR1B_IO_SHIFT) /* DMA1 ext DREQ */ +# define IAR1B_IO_ASCI0 (1 << IAR1B_IO_SHIFT) /* DMA1 ASCI0 */ +# define IAR1B_IO_ASCI1 (2 << IAR1B_IO_SHIFT) /* DMA1 ASCI1 */ +# define IAR1B_IO_ESCC (3 << IAR1B_IO_SHIFT) /* DMA1 ESCC */ +# define IAR1B_IO_PIA (7 << IAR1B_IO_SHIFT) /* DMA1 PIA27-20 (P1284) */ +#endif + +/* DMA Byte Count Register Channel 1 (BCR1: I/O Address = 0x2e to 0x2f) -- 8-bit data */ + +/* DMA Status Register (DSTAT: 0x30) */ + +#define DSTAT_DE1 (0x80) /* Bit 7: Enable Channel 1 */ +#define DSTAT_DE0 (0x40) /* Bit 6: Enable Channel 0 */ +#define DSTAT_DWE1 (0x20) /* Bit 5: Bit Write Enable 1 */ +#define DSTAT_DWE0 (0x10) /* Bit 4: Bit Write Enable 0 */ +#define DSTAT_DIE1 (0x08) /* Bit 3: DMA Interrupt Enable Channel 1 */ +#define DSTAT_DIE0 (0x04) /* Bit 2: DMA Interrupt Enable Channel 0 */ +#define DSTAT_DME (0x01) /* Bit 0: DMA Main Enable */ + +/* DMA Mode Register (DMODE: 0x31) */ + +#define DMODE_DM_SHIFT (4) /* Bits 4-5: Destination Mode Channel 0 */ +#define DMODE_DM_MASK (3 << DMODE_DM_SHIFT) +# define DMODE_DM_MEMINCR (0 << DMODE_DM_SHIFT) /* Memory with address increment */ +# define DMODE_DM_MEMDECR (1 << DMODE_DM_SHIFT) /* Memory with address decrement */ +# define DMODE_DM_MEM (2 << DMODE_DM_SHIFT) /* Memory with fixed address */ +# define DMODE_DM_IO (3 << DMODE_DM_SHIFT) /* I/O */ +#define DMODE_SM_SHIFT (2) /* Bits 2-3: Source Mode Channel */ +#define DMODE_SM_MASK (3 << DMODE_SM_SHIFT) +# define DMODE_SM_MEMINCR (0 << DMODE_SM_SHIFT) /* Memory with address increment */ +# define DMODE_SM_MEMDECR (1 << DMODE_SM_SHIFT) /* Memory with address decrement */ +# define DMODE_SM_MEM (2 << DMODE_SM_SHIFT) /* Memory with fixed address */ +# define DMODE_SM_IO (3 << DMODE_SM_SHIFT) /* I/O */ +#define DMODE_MMODE (0x01) /* Bit 0: DMA Memory Mode Channel 0 */ + +/* DMA/WAIT Control Register (DCNTL: 0x32) */ + +#define DCNTL_MWI_SHIFT (6) /* Bits 6-7: Memory Wait Insertion */ +#define DCNTL_MWI_MASK (3 << DCNTL_MWI_SHIFT) +#define DCNTL_IWI_SHIFT (4) /* Bits 4-5: Wait Insertion */ +#define DCNTL_IWI_MASK (3 << DCNTL_IWI_SHIFT) +#define DCNTL_DMS_SHIFT (4) /* Bits 2-3: DMA Request Sense */ +#define DCNTL_DMS_MASK (3 << DCNTL_DMS_SHIFT) +# define DCNTL_DMS_DREQ0 (1 << DCNTL_DMS_SHIFT) +# define DCNTL_DMS_DREQ1 (2 << DCNTL_DMS_SHIFT) +#define DCNTL_DIM_SHIFT (0) /* Bits 0-1: DMA Channel 1 I/O and Memory Mode */ +#define DCNTL_DIM_MASK (3 << DCNTL_DIM_SHIFT) +# define DCNTL_DIM_M2IOI (0 << DCNTL_DIM_SHIFT) /* Memory to I/O, increment MARI */ +# define DCNTL_DIM_M2IOD (1 << DCNTL_DIM_SHIFT) /* Memory to I/O, decrement MARI */ +# define DCNTL_DIM_IO2MI (2 << DCNTL_DIM_SHIFT) /* I/O to memory, increment MARI */ +# define DCNTL_DIM_IO2MD (3 << DCNTL_DIM_SHIFT) /* I/O to memory, decrement MARI */ + +/* Interrupt Vector Low Register (IL: 0x33) */ + +#define IL_SHIFT (5) /* Bits 5-7: 3-bits of vector interrupt table address */ +#define IL_MASK (7 << IL_SHIFT) + +/* INT/TRAP Control Register (ITC: 0x34) */ + +#define ITC_TRAP (0x80) /* Bit 7: Undefined opcode fetch */ +#define ITC_UFO (0x40) /* Bit 6: Undefined fetch object */ +#define ITC_ITE_SHIFT (0) /* Bits 0-2: Interrupt enable bits */ +#define ITC_ITE_MASK (7 << ITC_ITE_SHIFT) +# define ITC_ITE0 (1 << ITC_ITE_SHIFT) +# define ITC_ITE1 (2 << ITC_ITE_SHIFT) +# define ITC_ITE2 (4 << ITC_ITE_SHIFT) + +/* Refresh Control Register (RCR: 0x36) */ + +#define RCR_REFE (0x80) /* Bit 7: Refresh Enable */ +#define RCR_REFW (0x40) /* Bit 6: Refresh Wait */ +#define RCR_CYC_SHIFT (0) /* Bits 0-1: Cycle Interval */ +#define RCR_CYC_MASK (3 << RCR_CYC_SHIFT) +# define RCR_CYC0 (1 << RCR_CYC_SHIFT) +# define RCR_CYC1 (2 << RCR_CYC_SHIFT) + +/* MMU Common Base Register (CBR: 0x38) - 8-bit base address of Common Area 1 */ +/* MMU Bank Base Register (BBR: 0x39) - 8-bit address of Bank area */ + +/* MMU Common/Bank Area Register (CBAR: 0x3a) */ + +#define CBAR_CA_SHIFT (4) /* Bits 4-7: Low address for Common Area 1 */ +#define CBAR_CA_MASK (15 << CBAR_CA_SHIFT) +#define CBAR_BA_SHIFT (0) /* Bits 0-3: Low address for Bank Area */ +#define CBAR_BA_MASK (15 << CBAR_BA_SHIFT) + +/* Operation Mode Control Register (OMCR: 0x3e) */ + +#define OMCR_M1E (0x80) /* Bit 7: M1 Enable */ +#define OMCR_M1TE (0x40) /* Bit 6: M1 Temporary Enable */ +#define OMCR_IOC (0x20) /* Bit 5: Controls the timing of the IORQ and RD signals */ + +/* I/O Control Register (ICR: 0x3f) */ + +#define ICR_IOA_SHIFT (6) /* Bits 6-7: Internal I/O address bits */ +#define ICR_IOA_MASK (3 << ICR_IOA_SHIFT) +# define ICR_IOA6 (1 << ICR_IOA_SHIFT) +# define ICR_IOA7 (2 << ICR_IOA_SHIFT) +#define ICR_IOSTP (0x20) /* Bit 5: Enable I/O stop mode */ + +#endif /* __ARCH_Z80_SRC_Z180_Z180_IOMAP_H */ -- cgit v1.2.3 From 7978ac907ba023c523f51244f6da2882a1455b2e Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 11 Dec 2012 18:04:04 +0000 Subject: Add support for the Z180 MMU and generic hooks for processes git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5428 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 3 + nuttx/Documentation/NuttxPortingGuide.html | 5 +- nuttx/Documentation/README.html | 5 +- nuttx/README.txt | 2 +- nuttx/arch/Kconfig | 9 + nuttx/arch/z80/Kconfig | 54 +++- nuttx/arch/z80/include/z180/irq.h | 83 ++++-- nuttx/arch/z80/src/z180/Kconfig | 101 ++++++- nuttx/arch/z80/src/z180/Make.defs | 25 +- nuttx/arch/z80/src/z180/z180_head.asm | 16 +- nuttx/arch/z80/src/z180/z180_mmu.c | 405 ++++++++++++++++++++++++++++ nuttx/arch/z80/src/z180/z180_mmu.h | 149 ++++++++++ nuttx/arch/z80/src/z180/z180_mmu.txt | 114 ++++++++ nuttx/binfmt/Kconfig | 5 + nuttx/configs/README.txt | 3 + nuttx/configs/pic32-starterkit/src/up_spi.c | 4 +- nuttx/configs/pic32mx7mmb/src/up_spi.c | 4 +- nuttx/include/nuttx/arch.h | 170 +++++++++--- nuttx/mm/mm_graninit.c | 1 - nuttx/sched/Kconfig | 10 +- 20 files changed, 1057 insertions(+), 111 deletions(-) create mode 100644 nuttx/arch/z80/src/z180/z180_mmu.c create mode 100644 nuttx/arch/z80/src/z180/z180_mmu.h create mode 100644 nuttx/arch/z80/src/z180/z180_mmu.txt (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 7a2a2cbff..7e3b2a43f 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3777,4 +3777,7 @@ are just clones of z80 header files. * arch/z80/src/z180: Add source files for z180 chips. Initial versions are just clones of z80 source files. + * include/nuttx/arch.h: Add address environment control interfaces (for use + with CPUs the provide MCUs and support process-like address environments). + * arch/z80/src/z180/z180_mmu.*: Add MMU support for z180 tasks. diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html index c3f6286df..0ed46cba1 100644 --- a/nuttx/Documentation/NuttxPortingGuide.html +++ b/nuttx/Documentation/NuttxPortingGuide.html @@ -12,7 +12,7 @@

    NuttX RTOS Porting Guide

    -

    Last Updated: October 30, 2012

    +

    Last Updated: December 11, 2012

    @@ -3697,6 +3697,9 @@ void (*notify)(FAR struct pm_callback_s *cb, enum pm_state_e pmstate);
  • CONFIG_ARCH_IRQPRIO: Define if the architecture supports prioritization of interrupts and the up_prioritize_irq() API.
  • +
  • CONFIG_ADDRENV: + The CPU supports an MMU and CPU port supports provision of address + environments for tasks (making the, perhaps, processes).
  • diff --git a/nuttx/Documentation/README.html b/nuttx/Documentation/README.html index ef1803143..7dd23ac3d 100644 --- a/nuttx/Documentation/README.html +++ b/nuttx/Documentation/README.html @@ -8,7 +8,7 @@

    NuttX README Files

    -

    Last Updated: October 27, 2012

    +

    Last Updated: December 11, 2012

    @@ -49,7 +49,8 @@ | | | |- src/z80 | | | | `- README.txt | | | `- src/z180 - | | | `- README.txt + | | | |- README.txt + | | | `- z180_mmu.txt | | `- README.txt | |- configs/ | | |- amber/ diff --git a/nuttx/README.txt b/nuttx/README.txt index c94947279..55f42339c 100644 --- a/nuttx/README.txt +++ b/nuttx/README.txt @@ -750,7 +750,7 @@ nuttx | `- z80/ | | `- src/ | | |- z80/README.txt - | | `- z180/README.txt + | | `- z180/README.txt, z180_mmu.txt | `- README.txt |- configs/ | |- amber/ diff --git a/nuttx/arch/Kconfig b/nuttx/arch/Kconfig index 6e55a5744..f19228143 100644 --- a/nuttx/arch/Kconfig +++ b/nuttx/arch/Kconfig @@ -9,6 +9,7 @@ choice config ARCH_8051 bool "8051" + select CUSTOM_STACK ---help--- Intel 8051 architectures and derivaties @@ -115,6 +116,14 @@ config ARCH_IRQPRIO bool default n +config CUSTOM_STACK + bool + default n + +config ADDRENV + bool + default n + config ARCH_STACKDUMP bool "Dump stack on assertions" default n diff --git a/nuttx/arch/z80/Kconfig b/nuttx/arch/z80/Kconfig index 91aedba8f..4dcc8255e 100644 --- a/nuttx/arch/z80/Kconfig +++ b/nuttx/arch/z80/Kconfig @@ -17,6 +17,7 @@ config ARCH_CHIP_Z8018006VSG bool "Z8018006VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z80180 @@ -24,6 +25,7 @@ config ARCH_CHIP_Z8018010VSG bool "Z8018010VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z80180 @@ -31,6 +33,7 @@ config ARCH_CHIP_Z8018008VSG bool "Z8018008VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z80180 @@ -38,6 +41,7 @@ config ARCH_CHIP_Z8018010FSG bool "Z8018010FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 80-pin QFP (11 pins N/C) Z80180 @@ -45,6 +49,7 @@ config ARCH_CHIP_Z8018008VEG bool "Z8018008VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z80180 @@ -52,6 +57,7 @@ config ARCH_CHIP_Z8018006VEG bool "Z8018006VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z80180 @@ -59,6 +65,7 @@ config ARCH_CHIP_Z8018006PSG bool "Z8018006PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 64-pin DIP 6 MHz 5V Z80180 @@ -66,6 +73,7 @@ config ARCH_CHIP_Z8018008FSG bool "Z8018008FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 80-pin QFP (11 pins N/C) 8MHz 5V Z80180 @@ -73,6 +81,7 @@ config ARCH_CHIP_Z8018010PSG bool "Z8018010PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 64-pin DIP 10MHz 5V Z80180 @@ -80,6 +89,7 @@ config ARCH_CHIP_Z8018006PEG bool "Z8018006PEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 64-pin DIP 6MHz 5V Z80180 @@ -87,6 +97,7 @@ config ARCH_CHIP_Z8018010VEG bool "Z8018010VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- 68-pin PLCC 10MHz 5V Z80180 @@ -94,6 +105,7 @@ config ARCH_CHIP_Z8018010PEG bool "Z8018010PEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 64-pin DIP 10MHz 5V Z80180 @@ -101,6 +113,7 @@ config ARCH_CHIP_Z8018008PSG bool "Z8018008PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 64-pin DIP 8MHz 5V Z80180 @@ -108,33 +121,39 @@ config ARCH_CHIP_Z8018006FSG bool "Z8018006FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- - 80-pin QFP (11 pins N/C) 6MHz 5V Z80180 + Z180: 80-pin QFP (11 pins N/C) 6MHz 5V Z80180 config ARCH_CHIP_Z8018000XSO bool "Z8018000XSO" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV config ARCH_CHIP_Z8018010FEG bool "Z8018010FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV config ARCH_CHIP_Z8018000WSO bool "Z8018000WSO" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV config ARCH_CHIP_Z8018008PEG bool "Z8018008PEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV config ARCH_CHIP_Z8018110FEG bool "Z8018110FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80181 + select ADDRENV ---help--- Z180: 100-pin QFP Z80181 @@ -142,6 +161,7 @@ config ARCH_CHIP_Z8018233FSG bool "Z8018233FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 + select ADDRENV ---help--- 100-pin QFP Z80182 @@ -149,6 +169,7 @@ config ARCH_CHIP_Z8018220AEG bool "Z8018220AEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 + select ADDRENV ---help--- Z180: 100-pin LQFP 20MHz 5V Z80182 @@ -156,6 +177,7 @@ config ARCH_CHIP_Z8018216FSG bool "Z8018216FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 + select ADDRENV ---help--- Z180: 100-pin QFP 16MHz 5V Z80182 @@ -163,6 +185,7 @@ config ARCH_CHIP_Z8018216ASG bool "Z8018216ASG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 + select ADDRENV ---help--- Z180: 100-pin LQFP Z80182 @@ -170,6 +193,7 @@ config ARCH_CHIP_Z8018233ASG bool "Z8018233ASG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 + select ADDRENV ---help--- Z180: 100-pin LQFP 33MHz 5V Z80182 @@ -177,6 +201,7 @@ config ARCH_CHIP_Z8019520FSG bool "Z8019520FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80195 + select ADDRENV ---help--- Z180: 100-pin QFP 20MHz 5V Z80195 @@ -184,6 +209,7 @@ config ARCH_CHIP_Z8019533FSG bool "Z8019533FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80195 + select ADDRENV ---help--- Z180: 100-pin QFP 33MHz 5V Z80195 @@ -191,6 +217,7 @@ config ARCH_CHIP_Z8L18020VSG bool "Z8L18020VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L180 + select ADDRENV ---help--- Z180: 68-pinn PLCC Z8L180 @@ -198,6 +225,7 @@ config ARCH_CHIP_Z8L18020FSG bool "Z8L18020FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L180 + select ADDRENV ---help--- Z180: 80-pin GFP 20MHz 3.3V Z8L180 @@ -205,11 +233,13 @@ config ARCH_CHIP_Z8L18020PSG bool "Z8L18020PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L180 + select ADDRENV config ARCH_CHIP_Z8L18220ASG bool "Z8L18220ASG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L182 + select ADDRENV ---help--- Z180: 100-pin LQFP Z8L182 @@ -217,6 +247,7 @@ config ARCH_CHIP_Z8L18220FSG bool "Z8L18220FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L182 + select ADDRENV ---help--- 100-pin QFP 20MHz 3.3V Z8L182 @@ -224,11 +255,13 @@ config ARCH_CHIP_Z8L18220AEG bool "Z8L18220AEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L182 + select ADDRENV config ARCH_CHIP_Z8S18020VSG bool "Z8S18020VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z8S180 @@ -236,6 +269,7 @@ config ARCH_CHIP_Z8S18020VSG1960 bool "Z8S18020VSG1960" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z8S180 @@ -243,6 +277,7 @@ config ARCH_CHIP_Z8S18033VSG bool "Z8S18033VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z8S180 @@ -250,6 +285,7 @@ config ARCH_CHIP_Z8S18010FSG bool "Z8S18010FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- 80-pin QFP Z8S180 @@ -257,6 +293,7 @@ config ARCH_CHIP_Z8S18010VEG bool "Z8S18010VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z8S180 @@ -264,6 +301,7 @@ config ARCH_CHIP_Z8S18020VEG bool "Z8S18020VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z8S180 @@ -271,6 +309,7 @@ config ARCH_CHIP_Z8S18010VSG bool "Z8S18010VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z8S180 @@ -278,6 +317,7 @@ config ARCH_CHIP_Z8S18020PSG bool "Z8S18020PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- 64-pin DIP 10Mhz 5V Z8S180 @@ -285,6 +325,7 @@ config ARCH_CHIP_Z8S18033FSG bool "Z8S18033FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 80-pin QFP 33MHz 5V Z8S180 @@ -292,6 +333,7 @@ config ARCH_CHIP_Z8S18033FEG bool "Z8S18033FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 80-pin QFP 33MHz 5V Z8S180 @@ -299,13 +341,15 @@ config ARCH_CHIP_Z8S18020FSG bool "Z8S18020FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- - 80-pin QFP 20MHz 5V Z8S180 + Z180: 80-pin QFP 20MHz 5V Z8S180 config ARCH_CHIP_Z8S18033VEG bool "Z8S18033VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 68-pin PLCC 33MHz 5V Z8S180 @@ -313,23 +357,27 @@ config ARCH_CHIP_Z8S18010PSG bool "Z8S18010PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- - 64-pin DIP 10MHz 5V Z8S180 + Z180: 64-pin DIP 10MHz 5V Z8S180 config ARCH_CHIP_Z8S18020FEG bool "Z8S18020FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV config ARCH_CHIP_Z8S18010PEG bool "Z8S18010PEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV config ARCH_CHIP_Z8S18010FEG bool "Z8S18010FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV config ARCH_CHIP_Z8F6403 bool "Z8F6403" diff --git a/nuttx/arch/z80/include/z180/irq.h b/nuttx/arch/z80/include/z180/irq.h index 3f058591f..a72cf4708 100644 --- a/nuttx/arch/z80/include/z180/irq.h +++ b/nuttx/arch/z80/include/z180/irq.h @@ -55,17 +55,17 @@ /* Z180 Interrupts */ -#define Z180_RST0 (0) -#define Z180_RST1 (1) -#define Z180_RST2 (2) -#define Z180_RST3 (3) -#define Z180_RST4 (4) -#define Z180_RST5 (5) -#define Z180_RST6 (6) -#define Z180_RST7 (7) +#define Z180_RST0 (0) +#define Z180_RST1 (1) +#define Z180_RST2 (2) +#define Z180_RST3 (3) +#define Z180_RST4 (4) +#define Z180_RST5 (5) +#define Z180_RST6 (6) +#define Z180_RST7 (7) #define Z180_IRQ_SYSTIMER Z180_RST7 -#define NR_IRQS (8) +#define NR_IRQS (8) /* IRQ Stack Frame Format * @@ -73,18 +73,33 @@ * in the TCB to many context switches. */ -#define XCPT_I (0) /* Offset 0: Saved I w/interrupt state in carry */ -#define XCPT_BC (1) /* Offset 1: Saved BC register */ -#define XCPT_DE (2) /* Offset 2: Saved DE register */ -#define XCPT_IX (3) /* Offset 3: Saved IX register */ -#define XCPT_IY (4) /* Offset 4: Saved IY register */ -#define XCPT_SP (5) /* Offset 5: Offset to SP at time of interrupt */ -#define XCPT_HL (6) /* Offset 6: Saved HL register */ -#define XCPT_AF (7) /* Offset 7: Saved AF register */ -#define XCPT_PC (8) /* Offset 8: Offset to PC at time of interrupt */ - -#define XCPTCONTEXT_REGS (9) -#define XCPTCONTEXT_SIZE (2 * XCPTCONTEXT_REGS) +#define XCPT_I (0) /* Offset 0: Saved I w/interrupt state in carry */ +#define XCPT_BC (1) /* Offset 1: Saved BC register */ +#define XCPT_DE (2) /* Offset 2: Saved DE register */ +#define XCPT_IX (3) /* Offset 3: Saved IX register */ +#define XCPT_IY (4) /* Offset 4: Saved IY register */ +#define XCPT_SP (5) /* Offset 5: Offset to SP at time of interrupt */ +#define XCPT_HL (6) /* Offset 6: Saved HL register */ +#define XCPT_AF (7) /* Offset 7: Saved AF register */ +#define XCPT_PC (8) /* Offset 8: Offset to PC at time of interrupt */ + +#define XCPTCONTEXT_REGS (9) +#define XCPTCONTEXT_SIZE (2 * XCPTCONTEXT_REGS) + +/* Interrupt vectors (offsets) for Z180 internal interrupts */ + +#define Z180_INT1_VECTOR 0x00 /* External /INT1 */ +#define Z180_INT2_VECTOR 0x02 /* External /INT2 */ +#define Z180_PRT0_VECTOR 0x04 /* PRT channel 0 */ +#define Z180_PRT1_VECTOR 0x06 /* PRT channel 1 */ +#define Z180_DMA0_VECTOR 0x08 /* DMA channel 0 */ +#define Z180_DMA1_VECTOR 0x0a /* DMA Channel 1 */ +#define Z180_CSIO_VECTOR 0x0c /* Clocked serial I/O */ +#define Z180_ASCI0_VECTOR 0x0e /* Async channel 0 */ +#define Z180_ASCI1_VECTOR 0x10 /* Async channel 1 */ +#define Z180_INCAP_VECTOR 0x12 /* Input capture */ +#define Z180_OUTCMP_VECTOR 0x14 /* Output compare */ +#define Z180_TIMOV_VECTOR 0x16 /* Timer overflow */ /**************************************************************************** * Public Types @@ -96,10 +111,34 @@ typedef uint16_t chipreg_t; -/* This struct defines the way the registers are stored. */ +/* Common Area 1 holds the code and data that is unique to a particular task + * and shared by all pthreads created from that task. Each task will then + * have its own copy of struct z180_cbr_s. This structure is created with + * a reference count of one when the task is created. + * + * When the task creates additional threads, the reference count is + * incremented and the CBR value is shared. When each thread exits, the + * reference count id decremented. When the reference count is decremented, + * the physical memory underlying the CBR is finally released. + */ + +struct z180_cbr_s +{ + uint8_t cbr; /* The CBR value used by the thread */ + uint8_t crefs; /* The number of threads sharing this CBR value */ + uint8_t pages; /* The number of 4KB pages of physical memory in the allocation */ +}; + +/* This struct defines the way the registers and z180-state information are + * stored. + */ struct xcptcontext { + /* CBR allocation */ + + FAR struct z180_cbr_s *cbr; + /* Register save area */ chipreg_t regs[XCPTCONTEXT_REGS]; diff --git a/nuttx/arch/z80/src/z180/Kconfig b/nuttx/arch/z80/src/z180/Kconfig index 4eafa8da8..58abbd6f2 100644 --- a/nuttx/arch/z80/src/z180/Kconfig +++ b/nuttx/arch/z80/src/z180/Kconfig @@ -21,30 +21,115 @@ config Z180_TOOLCHAIN_SDCCW endchoice config LINKER_HOME_AREA - hex "Start of _HOME area" + hex "Physical start of _HOME area" default 0x0000 ---help--- - Start of the linker HOME area. Default: 0x0000 + Physical address of the start of the linker HOME area. Default: 0x0000 config LINKER_CODE_AREA - hex "Start of _CODE area" + hex "Physical start of _CODE area" default 0x0200 ---help--- - Start of the linker _CODE area. Default: 0x0200 + Physical address of the start of the linker _CODE area. Default: 0x0200 config LINKER_DATA_AREA - hex "Start of _DATA area" + hex "Physical start of _DATA area" default 0x8000 ---help--- - Start of the linker _DATA area. Default: 0x8000 + Physical address of the start of the linker _DATA area. Default: 0x8000 config LINKER_ROM_AT_0000 - bool "ROM at 0x0000" + bool "ROM at Physical 0x0000" default n ---help--- - Some architectures may have ROM located at address zero. In this + Some architectures may have ROM located at physical address zero. In this case, a special version of the "head" file must be used. +config Z180_BANKAREA_VIRTBASE + hex "Virtual Start of Bank Area" + default 0x8000 + ---help--- + This setting provides the virtual address of the start of the Bank Area. + NOTE that 0x0000 <= Z180_BANKAREA_BASE <= Z180_COMMONAREA_BASE is required! + Default: 0x8000 + + NuttX Memory Organization: + + Common Area 0: This area holds the common NuttX code that is + directly call-able from all application threads. Common Area + always starts at virtual address 0x0000 and extends to the + Bank Area + + Base Area: This area holds the common NuttX data (including the + share-able heap) that is accessible from all applications and + extends to Common Area 1. + + NOTE: That is execution from RAM, the common NuttX code and + data may be contiguous and lie in the same region (either + Common Area 0 or the Bank Area). The two regions above would + apply in a ROM'ed system, where Common Area 1 is ROM and the + Base Area is RAM. + + Common Area 1: This area holds the code and data that is unique + to a particular task. his area extends to the end of the virtual + address space. All tasks share the same virtual Common Area 2 + virtual address (but each has a unique mapping to different, + underlying physical addresses). + +config Z180_BANKAREA_PHYSBASE + hex "Physical Start of Bank Area" + default 0x08000 + ---help--- + This setting provides the physical address of the start of the Bank Area. + Default: 0x08000 + +config Z180_COMMON1AREA_VIRTBASE + hex "Virtual Start of Common Area 1" + default 0xc000 + ---help--- + This setting provides the virtual address of the start of the Common + Area 1. NOTE that 0x0000 <= Z180_BANKAREA_BASE <= Z180_COMMONAREA_BASE + is required! Default: 0xc000 + + NuttX Memory Organization: + + Common Area 0: This area holds the common NuttX code that is + directly call-able from all application threads. Common Area + always starts at virtual address 0x0000 and extends to the + Bank Area + + Base Area: This area holds the common NuttX data (including the + share-able heap) that is accessible from all applications and + extends to Common Area 1. + + NOTE: That is execution from RAM, the common NuttX code and + data may be contiguous and lie in the same region (either + Common Area 0 or the Bank Area). The two regions above would + apply in a ROM'ed system, where Common Area 1 is ROM and the + Base Area is RAM. + + Common Area 1: This area holds the code and data that is unique + to a particular task. his area extends to the end of the virtual + address space. All tasks share the same virtual Common Area 2 + virtual address (but each has a unique mapping to different, + underlying physical addresses). + +config Z180_PHYSHEAP_START + hex "Physical Start of Free Memory" + default 0x0c000 + ---help--- + This setting provides the physical address of the start of free physical + memory that will be used to allocate memory for tasks (Common Area 1). + Default: 0x0c000 + +config Z180_PHYSHEAP_END + hex "Physical End(+1) of Free Memory" + default 0x100000 + ---help--- + This setting provides the physical address of the end(+1) of free physical + memory that will be used to allocate memory for tasks (Common Area 1). + Default: 0x100000 + config ARCH_HAVEHEAD bool "Board-specific Head File" default n diff --git a/nuttx/arch/z80/src/z180/Make.defs b/nuttx/arch/z80/src/z180/Make.defs index d371a5d22..069f36204 100644 --- a/nuttx/arch/z80/src/z180/Make.defs +++ b/nuttx/arch/z80/src/z180/Make.defs @@ -35,21 +35,20 @@ ifeq ($(CONFIG_ARCH_HAVEHEAD),) ifeq ($(CONFIG_LINKER_ROM_AT_0000),y) -HEAD_ASRC = z180_rom.asm +HEAD_ASRC = z180_rom.asm else -HEAD_ASRC = z180_head.asm +HEAD_ASRC = z180_head.asm endif endif -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_idle.c up_assert.c up_doirq.c \ - up_mdelay.c up_udelay.c up_usestack.c - -CHIP_ASRCS = z180_saveusercontext.asm z180_restoreusercontext.asm -CHIP_CSRCS = z180_initialstate.c z180_io.c z180_irq.c z180_copystate.c \ - z180_schedulesigaction.c z180_sigdeliver.c \ - z180_registerdump.c +CMN_ASRCS = +CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_createstack.c +CMN_CSRCS += up_doirq.c up_exit.c up_idle.c up_initialize.c +CMN_CSRCS += up_interruptcontext.c up_mdelay.c up_releasepending.c +CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_unblocktask.c +CMN_CSRCS += up_udelay.c up_usestack.c +CHIP_ASRCS = z180_restoreusercontext.asm z180_saveusercontext.asm +CHIP_CSRCS = z180_copystate.c z180_initialstate.c z180_io.c z180_irq.c +CHIP_CSRCS += z180_mmu.c z180_registerdump.c z180_schedulesigaction.c +CHIP_CSRCS += z180_sigdeliver.c diff --git a/nuttx/arch/z80/src/z180/z180_head.asm b/nuttx/arch/z80/src/z180/z180_head.asm index ca064160a..ddd0283e9 100644 --- a/nuttx/arch/z80/src/z180/z180_head.asm +++ b/nuttx/arch/z80/src/z180/z180_head.asm @@ -60,8 +60,9 @@ ; Global symbols used ;************************************************************************** - .globl _os_start ; OS entry point - .globl _up_doirq ; Interrupt decoding logic + .globl _os_start ; OS entry point + .globl _up_doirq ; Interrupt decoding logic + .globl z180_mmu_lowinit ; MMU initialization logic ;************************************************************************** ; Reset entry point @@ -70,9 +71,9 @@ .area _HEADER (ABS) .org 0x0000 - di ; Disable interrupts - im 1 ; Set interrupt mode 1 - jr _up_reset ; And boot the system + di ; Disable interrupts + im 1 ; Set interrupt mode 1 + jr _up_reset ; And boot the system ;************************************************************************** ; Other reset handlers @@ -168,6 +169,11 @@ _up_reset: ld SP, #CONFIG_STACK_END ; Set stack pointer + ; Configure the MMU so that things will lie at the addresses that we + ; expect them to + + call z180_mmu_lowinit ; Initialize the MMU + ; Performed initialization unique to the SDCC toolchain call gsinit ; Initialize the data section diff --git a/nuttx/arch/z80/src/z180/z180_mmu.c b/nuttx/arch/z80/src/z180/z180_mmu.c new file mode 100644 index 000000000..c71f59755 --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_mmu.c @@ -0,0 +1,405 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_mmu.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/* See arch/z80/src/z180/z180_mmu.txt for additional information */ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include "z180_mmu.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* Configuration ************************************************************/ + +#ifndef CONFIG_ADDRENV +# warning "OS address environment support is required (CONFIG_ADDRENV)" +#endif + +#ifndef CONFIG_GRAN +# warning "This file requires the granual allocator (CONFIG_GRAN)" +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +#ifndef CONFIG_GRAN_SINGLE +static GRAN_HANDLE g_physhandle; +#endif +static struct z180_cbr_s g_cbrs[CONFIG_MAX_TASKS]; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: z180_mmu_findcbr + * + * Description: + * Find an unused struture in g_cbrs (i.e., one with reference count == 0). + * If a structure is found, its reference count is set to one and a pointer + * to the structure is returned. + * + ****************************************************************************/ + +static FAR struct z180_cbr_s *z180_mmu_findcbr(void) +{ + int i; + + for (i = 0; i < CONFIG_MAX_TASKS; i++) + { + FAR struct z180_cbr_s *cbr = &g_cbrs[i]; + if (cbr->crefs == 0) + { + cbr->crefs = 1; + return cbr; + } + } + + return NULL; +} + +/**************************************************************************** + * Name: z180_mmu_freecbr + * + * Description: + * Free a struture in g_cbrs by setting its reference count to 0; + * + ****************************************************************************/ + +#define z180_mmu_freecbr(cbr) (cbr)->crefs = 0 + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: z180_mmu_lowinit + * + * Description: + * Low-level, power-up initialization of the z180 MMU. this must be + * called very early in the boot process to get the basic operating + * memory configuration correct. This function does *not* perform all + * necessray MMU initialization... only the basics needed at power-up. + * z180_mmu_init() must be called later to complete the entire MMU + * initialization. + * + ****************************************************************************/ + +void z180_mmu_lowinit(void) __naked +{ + __asm + ld c, #Z180_MMU_CBR ; port + ld a, #Z180_CBAR_VALUE ; value + out (c), a + + ld c, #Z180_MMU_BBR ; port + ld a, #Z180_BBR_VALUE ; value + out (c), a + __endasm; +} + +/**************************************************************************** + * Name: z180_mmu_init + * + * Description: + * Perform higher level initializatin of the MMU and physical memory + * memory management logic. + * + ****************************************************************************/ + +int z180_mmu_init(void) +{ + /* Here we use the granule allocator as a page allocator. We lie and + * say that 1 page is 1 byte. + */ + +#ifdef CONFIG_GRAN_SINGLE +return gran_initialize((FAR void *)Z180_PHYSHEAP_STARTPAGE, + Z180_PHYSHEAP_NPAGES, 0, 0); +#else +g_physhandle = gran_initialize((FAR void *)Z180_PHYSHEAP_STARTPAGE, + Z180_PHYSHEAP_NPAGES, 0, 0); +return g_physhandle ? OK : -ENOMEM; +#endif +} + +/**************************************************************************** + * Name: up_addrenv_create + * + * Description: + * This function is called from the binary loader logic when a new + * task is created in RAM in order to instantiate an address environment for + * the task. + * + * Input Parameters: + * tcb - The TCB of the task needing the address environment. + * envsize - The size (in bytes) of the address environment needed by the + * task. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +int up_addrenv_create(FAR _TCB *tcb, size_t envsize) +{ + FAR struct z180_cbr_s *cbr; + irqstate_t flags; + uintptr_t alloc; + unsigned int npages; + int ret; + + /* Make sure that there is no address environment in place on this TCB */ + + DEBUGASSERT(tcb->xcp.cbr == NULL); + + /* Convert the size from bytes to numbers of pages */ + + npages = PHYS_ALIGNUP(envsize); + if (npages < 1) + { + /* No address environment... but I suppose that is not an error */ + + sdbg("ERROR: npages is zero\n"); + return OK; + } + + /* Allocate a structure in the common .bss to hold information about the + * task's address environment. NOTE that this is not a part of the TCB, + * but rather a break-away structure that can be shared by the task as + * well as other threads. That is necessary because the life of the + * address of environment might be longer than the life of the task. + */ + + flags = irqsave(); + cbr = z180_mmu_findcbr(); + if (!cbr) + { + sdbg("ERROR: No free CBR structures\n"); + ret = -ENOMEM; + goto errout_with_irq + } + + /* Now allocate the physical memory to back up the address environment */ + + +#ifdef CONFIG_GRAN_SINGLE + alloc = (uintptr_t)gran_alloc(npages); +#else + alloc = (uintptr_t)gran_alloc(g_physhandle, npages); +#endif + if (!alloc) + { + sdbg("ERROR: Failed to allocate %d pages\n", npages); + ret = -ENOMEM; + goto errout_with_cbr; + } + + /* Save the information in the CBR structure. Note that alloc is in + * 4KB pages, already in the right form for the CBR. + */ + + DEBUGASSERT(alloc <= 0xff); + + cbr->cbr = alloc; + cbr->pages = npages; + tcb->xcp.cbr = cbr; + + irqrestore(flags); + return OK; + +errout_with_cbr: + z180_mmu_freecbr(cbr); + +errout_with_irq: + irqrestore(flags); + return ret; +} + +/**************************************************************************** + * Name: up_addrenv_clone + * + * Description: + * This function is called from the core scheduler logic when a thread + * is created that needs to share the address ennvironment of its parent + * task. In this case, the parent's address environment needs to be + * "cloned" for the child. + * + * Input Parameters: + * ptcb - The TCB of the parent task that has the address environment. + * ctcb - The TCB of the child thread needing the address environment. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +int up_addrenv_clone(FAR const _TCB *ptcb, FAR _TCB *ctcb) +{ + irqstate_t flags; + + /* Make sure that the child has no address environment. It is okay if + * if the parent does not have one. + */ + + DEBUGASSERT(ctcb->xcp.cbr == NULL); + + flags = irqsave(); + if (ptcb->xcp.cbr) + { + /* Clone the CBR by incrementing the reference counting and saving a + * copy in the child thread's TCB. + */ + + ptcb->xcp.cbr.crefs++; + ctcb->xcp.cbr = ptcb->xcp.cbr; + } + + irqrestore(flags); + return OK; +} +#endif + +/**************************************************************************** + * Name: up_addrenv_instantiate + * + * Description: + * After an address environment has been established for a task (via + * up_addrenv_create(). This function may be called to to instantiate + * that address environment in the virtual address space. this might be + * necessary, for example, to load the code for the task from a file or + * to access address environment private data. + * + * Input Parameters: + * tcb - The TCB of the task or thread whose the address environment will + * be instantiated. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +int up_addrenv_instantiate(FAR _TCB *tcb) +{ + irqstate_t flags; + + /* Check if the task has an address environment. */ + + flags = irqsave(); + if (tcb->xcp.cbr) + { + /* Yes... write the CBR value into CBR register */ + + outp(Z180_MMU_CBR, tcb->xcp.cbr.cbr); + /* Clone the CBR by incrementing the reference counting and saving a + * copy in the child thread's TCB. + */ + + ptcb->xcp.cbr.crefs++; + ctcb->xcp.cbr = ptcb->xcp.cbr; + } + + irqrestore(flags); + return OK; +} +#endif + +/**************************************************************************** + * Name: up_addrenv_release + * + * Description: + * This function is called when a task or thread exits in order to release + * its reference to an address environment. When there are no further + * references to an address environment, that address environment should + * be destroyed. + * + * Input Parameters: + * tcb - The TCB of the task or thread whose the address environment will + * be released. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +int up_addrenv_release(FAR _TCB *tcb) +{ + FAR struct z180_cbr_s *cbr; + irqstate_t flags; + + /* Check if the task has an address environment. */ + + flags = irqsave(); + cbr = tcb->xcp.cbr; + if (cbr) + { + /* Nullify the reference to the CBR structgure and decrement the number + * of references on the CBR. + */ + + tcb->xcp.cbr = NULL; + + /* If the reference count would decrement to zero, then free the CBR + * structure. + */ + + if (cbr->crefs <= 1) + { + z180_mmu_freecbr(cbr); + } + else + { + /* Otherwise, just decrement the reference count */ + + cbr->crefs--; + } + } + + irqrestore(flags); + return OK; +} +#endif + diff --git a/nuttx/arch/z80/src/z180/z180_mmu.h b/nuttx/arch/z80/src/z180/z180_mmu.h new file mode 100644 index 000000000..1a4c03406 --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_mmu.h @@ -0,0 +1,149 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_mmu.h + * + * Copyright (C) 2012 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 __ARCH_Z80_SRC_Z180_Z180_MMU_H +#define __ARCH_Z80_SRC_Z180_Z180_MMU_H + +/* See arch/z80/src/z180/z180_mmu.txt for additional information */ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "z180_iomap.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* Configuration ************************************************************/ + +/* Virtual addresses */ + +#ifndef CONFIG_Z180_BANKAREA_VIRTBASE +# warning "Assuming Bank Area at virtual address 0x8000" +# define CONFIG_Z180_BANKAREA_VIRTBASE 0x8000 +#endif + +#ifndef CONFIG_Z180_COMMON1AREA_VIRTBASE +# warning "Assuming Common Area 1 at virtual address 0xc000" +# define CONFIG_Z180_COMMON1AREA_VIRTBASE 0xc000 +#endif + +#if CONFIG_Z180_BANKAREA_VIRTBASE > CONFIG_Z180_COMMON1AREA_VIRTBASE +# error "CONFIG_Z180_BANKAREA_VIRTBASE > CONFIG_Z180_COMMON1AREA_VIRTBASE" +#endif + +/* Physical addresses */ + +#ifndef CONFIG_Z180_BANKAREA_PHYSBASE +# warning "Assuming Bank Area 1 at physical address 0x080000" +# define CONFIG_Z180_BANKAREA_PHYSBASE 0x08000 +#endif + +#ifndef CONFIG_Z180_PHYSHEAP_START +# warning "Assuming physical heap starts at physical address 0x0c000" +# define CONFIG_Z180_PHYSHEAP_START 0x0c000 +#endif + +#ifndef CONFIG_Z180_PHYSHEAP_END +# warning "Assuming physical heap ends at physical address 0x100000" +# define CONFIG_Z180_PHYSHEAP_END 0x100000 +#endif + +#if CONFIG_Z180_BANKAREA_PHYSBASE > CONFIG_Z180_PHYSHEAP_START +# error "CONFIG_Z180_BANKAREA_PHYSBASE > CONFIG_Z180_PHYSHEAP_START" +#endif + +#if CONFIG_Z180_PHYSHEAP_START > CONFIG_Z180_PHYSHEAP_END +# error "CONFIG_Z180_PHYSHEAP_START > CONFIG_Z180_PHYSHEAP_END" +#endif + +/* Each page is 4KB */ + +#define Z180_PAGESHIFT (12) +#define Z180_PAGESIZE (1 << Z180_PAGESHIFT) +#define Z180_PAGEMASK (Z180_PAGESIZE - 1) +#define PHYS_ALIGN(phys) ((phys) >> Z180_PAGESHIFT) +#define PHYS_ALIGNUP(phys) (((phys) + Z180_PAGEMASK) >> Z180_PAGESHIFT) + +/* Physical pages */ + +#define Z180_BANKAREA_PHYSPAGE PHYS_ALIGN(CONFIG_Z180_BANKAREA_PHYSBASE) +#define Z180_PHYSHEAP_STARTPAGE PHYS_ALIGN(CONFIG_Z180_PHYSHEAP_START) +#define Z180_PHYSHEAP_ENDPAGE PHYS_ALIGN(CONFIG_Z180_PHYSHEAP_END) +#define Z180_PHYSHEAP_NPAGES (Z180_PHYSHEAP_ENDPAGE - Z180_PHYSHEAP_STARTPAGE + 1) + +/* MMU register values */ + +#define Z180_CBAR_VALUE \ + ((((CONFIG_Z180_BANKAREA_VIRTBASE >> 12) & 0x0f) << CBAR_BA_SHIFT) \ + (((CONFIG_Z180_COMMON1AREA_VIRTBASE >> 12) & 0x0f) << CBAR_CA_SHIFT)) + +#define Z180_BBR_VALUE \ + ((CONFIG_Z180_BANKAREA_PHYSBASE >> 12) & 0xff) + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: z180_mmu_lowinit + * + * Description: + * Low-level, power-up initialization of the z180 MMU. this must be + * called very early in the boot process to get the basic operating + * memory configuration correct. This function does *not* perform all + * necessray MMU initialization... only the basics needed at power-up. + * z180_mmu_init() must be called later to complete the entire MMU + * initialization. + * + ****************************************************************************/ + +void z180_mmu_lowinit(void) __naked; + +/**************************************************************************** + * Name: z180_mmu_init + * + * Description: + * Perform higher level initializatin of the MMU and physical memory + * memory management logic. + * + ****************************************************************************/ + +void z180_mmu_init(void); + +#endif /* __ARCH_Z80_SRC_Z180_Z180_MMU_H */ diff --git a/nuttx/arch/z80/src/z180/z180_mmu.txt b/nuttx/arch/z80/src/z180/z180_mmu.txt new file mode 100644 index 000000000..e12f41e9b --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_mmu.txt @@ -0,0 +1,114 @@ +The MMU translates every memory address from 16 to 20 bits. The MMU uses +three internal control registers. On reset the MMU gives a straight logical +to physical mapping, simulating the Z80 and, of course, limiting the address +space to 64k. + +Logical Address Spaces +====================== + +The 64KB CPU logical address space is interpreted by the MMU as consisting +of up to three separate logical address areas: + + Common Area 0, + Bank Area, and + Common Area 1. + +Common 0, if it exists, always starts at logical address 0000 and runs up +to the Bank Area. The Bank Area then runs to the start of Common Area 1. + +Registers +========= + +CBAR (Comman/Bank Area Register) + + CBAR is an 8 bit I/O port that can be accessed by the processor's OUT and + IN instructions. The lower 4-bits of CBAR (BA) specify the starting logical + address of the Bank Area, and the upper 4-bits (CA) give the start of + Common Area 1. These bits determine the upper four bits of the 16-bit + address. If CBAR were 0xa8, then the Base Area starts at logical address + 0x8000 and Common Area 1 starts at logical address 0xa000. This gives a + mapping granualarity of 4Kb in the logical address space. + + The CA and BA fields of CBAR may be freely programmed subject only to the + restriction that CA may never be less than BA. + +BBAR (Base Area Bank Register) + + BBR specifies the starting physical address of the base area (the logical + start address is in CBAR). + +CBR (Common Bank Register) + + CBR provides the same information for Common Area 1. + +Both the BBAR and the CBR specify the upper 8-bits of the 20-bit physical +address in the mapping. Hence, mapping is performed with a granularity of +4Kb in the physical address space. + +Physical to Logical Address Mapping +=================================== + +A simple formula gives the translation from logical to physical address for +the Bank Area: + + Physical = Logical + (BBR * 4096) + +The same formula gives Common Area 1: + + Physical = Logical + (CBR * 4096) + +Reset Configuration +=================== + +On reset, the CBAR is set to 0xf0, and CBR and BBR are set to 0x00. This +maps logical to physical with no translation; the Bank Area starts at +logical address 0x0000 and Common 1 at 0xf000. The Bank Area starts at +phsycial address 0x00000 (BBR=0), as does Common Area 1 (CBR=0). If the +logical address is 0x1000, then the MMU allocates this to the Bank Area +and adds the physical base of bank to it (0x00000), giving a translated +address of 0x01000. Similarly, logical 0xf800 is in Common Area 1, and +translates to 0x0f800. + +Configurations +============== + +You can divide the logical address space into one, two, or three areas. + +1) Three areas: + + CBAR:CA > CBAR:BA > 0x0000 + +2a) Two areas (Bank Area and Common Area 1): + + CBAR:CA > CBAR:BA = 0x0000 + +2a) Two areas (Common Area 0 and Common Area 1): + + CBAR:CA = CBAR:BA > 0x0000 + +3) One area (Common Area 1): + + CBAR:CA = CBAR:BA = 0x0000 + +NuttX Memory Organization +========================= + +Common Area 0: This area holds the common NuttX code that is directly +call-able from all application threads. Common Area always starts at +logical address 0x0000 and extends to the Bank Area + +Base Area: This area holds the common NuttX data (including the share- +able heap) that is accessible from all applications and extends to +Common Area 1. + +NOTE: That is execution from RAM, the common NuttX code and data may +be contiguous and lie in the same areas (either Common Area 0 or the +Bank Area). The two areas above would apply in a ROM'ed system, where +Common Area 1 is ROM and the Base Area is RAM. + +Common Area 1: This area holds the code and data that is unique to +a particular task. This area extends to the end of the logical address +space. All tasks share the same logical Common Area 2 logical address +(in the CBAR), but each has a unique mapping to different, underlying +physical addresses. Each task will then have its own, unique CBR value +that must be restored with each context switch to the task. diff --git a/nuttx/binfmt/Kconfig b/nuttx/binfmt/Kconfig index ae02c276a..cbf909327 100644 --- a/nuttx/binfmt/Kconfig +++ b/nuttx/binfmt/Kconfig @@ -15,6 +15,7 @@ if !BINFMT_DISABLE config NXFLAT bool "Enable the NXFLAT Binary Format" default n + select PIC ---help--- Enable support for the NXFLAT binary format. Default: n @@ -34,6 +35,10 @@ endif endif +config PIC + bool + default n + config BINFMT_CONSTRUCTORS bool "C++ Static Constructor Support" default n diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt index b4700433b..23f5e4380 100644 --- a/nuttx/configs/README.txt +++ b/nuttx/configs/README.txt @@ -160,6 +160,9 @@ defconfig -- This is a configuration file similar to the Linux CONFIG_ARCH_IRQPRIO Define if the architecture suports prioritizaton of interrupts and the up_prioritize_irq() API. + CONFIG_ADDRENV + The CPU supports an MMU and CPU port supports provision of address + environments for tasks (making the, perhaps, processes). Some architectures require a description of the RAM configuration: diff --git a/nuttx/configs/pic32-starterkit/src/up_spi.c b/nuttx/configs/pic32-starterkit/src/up_spi.c index 52d46af89..42e7c4b9c 100644 --- a/nuttx/configs/pic32-starterkit/src/up_spi.c +++ b/nuttx/configs/pic32-starterkit/src/up_spi.c @@ -154,7 +154,7 @@ int pic32mx_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #endif #endif -#ifdef CONFIG_PIC31MX_SPI1 +#ifdef CONFIG_PIC32MX_SPI1 void pic31mx_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); @@ -176,7 +176,7 @@ int pic31mx_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #endif #endif -#ifdef CONFIG_PIC31MX_SPI3 +#ifdef CONFIG_PIC32MX_SPI3 void pic32mx_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); diff --git a/nuttx/configs/pic32mx7mmb/src/up_spi.c b/nuttx/configs/pic32mx7mmb/src/up_spi.c index a15881868..add2b2d65 100644 --- a/nuttx/configs/pic32mx7mmb/src/up_spi.c +++ b/nuttx/configs/pic32mx7mmb/src/up_spi.c @@ -192,7 +192,7 @@ int pic32mx_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #endif #endif -#ifdef CONFIG_PIC31MX_SPI2 +#ifdef CONFIG_PIC32MX_SPI2 void pic31mx_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); @@ -215,7 +215,7 @@ int pic31mx_spi2cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #endif #endif -#ifdef CONFIG_PIC31MX_SPI3 +#ifdef CONFIG_PIC32MX_SPI3 void pic32mx_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); diff --git a/nuttx/include/nuttx/arch.h b/nuttx/include/nuttx/arch.h index c836a7557..54c234d8d 100644 --- a/nuttx/include/nuttx/arch.h +++ b/nuttx/include/nuttx/arch.h @@ -67,10 +67,8 @@ typedef CODE void (*sig_deliver_t)(FAR _TCB *tcb); ****************************************************************************/ #ifdef __cplusplus -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern +extern "C" +{ #endif /**************************************************************************** @@ -98,7 +96,7 @@ extern "C" { * ****************************************************************************/ -EXTERN void up_initialize(void); +void up_initialize(void); /**************************************************************************** * Name: up_idle @@ -114,7 +112,7 @@ EXTERN void up_initialize(void); * ****************************************************************************/ -EXTERN void up_idle(void); +void up_idle(void); /**************************************************************************** * Name: up_initial_state @@ -130,7 +128,7 @@ EXTERN void up_idle(void); * ****************************************************************************/ -EXTERN void up_initial_state(FAR _TCB *tcb); +void up_initial_state(FAR _TCB *tcb); /**************************************************************************** * Name: up_create_stack @@ -155,7 +153,7 @@ EXTERN void up_initial_state(FAR _TCB *tcb); ****************************************************************************/ #ifndef CONFIG_CUSTOM_STACK -EXTERN int up_create_stack(FAR _TCB *tcb, size_t stack_size); +int up_create_stack(FAR _TCB *tcb, size_t stack_size); #endif /**************************************************************************** @@ -180,7 +178,7 @@ EXTERN int up_create_stack(FAR _TCB *tcb, size_t stack_size); ****************************************************************************/ #ifndef CONFIG_CUSTOM_STACK -EXTERN int up_use_stack(FAR _TCB *tcb, FAR void *stack, size_t stack_size); +int up_use_stack(FAR _TCB *tcb, FAR void *stack, size_t stack_size); #endif /**************************************************************************** @@ -193,7 +191,7 @@ EXTERN int up_use_stack(FAR _TCB *tcb, FAR void *stack, size_t stack_size); ****************************************************************************/ #ifndef CONFIG_CUSTOM_STACK -EXTERN void up_release_stack(FAR _TCB *dtcb); +void up_release_stack(FAR _TCB *dtcb); #endif /**************************************************************************** @@ -216,7 +214,7 @@ EXTERN void up_release_stack(FAR _TCB *dtcb); * ****************************************************************************/ -EXTERN void up_unblock_task(FAR _TCB *tcb); +void up_unblock_task(FAR _TCB *tcb); /**************************************************************************** * Name: up_block_task @@ -242,7 +240,7 @@ EXTERN void up_unblock_task(FAR _TCB *tcb); * ****************************************************************************/ -EXTERN void up_block_task(FAR _TCB *tcb, tstate_t task_state); +void up_block_task(FAR _TCB *tcb, tstate_t task_state); /**************************************************************************** * Name: up_release_pending @@ -261,7 +259,7 @@ EXTERN void up_block_task(FAR _TCB *tcb, tstate_t task_state); * ****************************************************************************/ -EXTERN void up_release_pending(void); +void up_release_pending(void); /**************************************************************************** * Name: up_reprioritize_rtr @@ -287,7 +285,7 @@ EXTERN void up_release_pending(void); * ****************************************************************************/ -EXTERN void up_reprioritize_rtr(FAR _TCB *tcb, uint8_t priority); +void up_reprioritize_rtr(FAR _TCB *tcb, uint8_t priority); /**************************************************************************** * Name: _exit @@ -349,7 +347,7 @@ EXTERN void up_reprioritize_rtr(FAR _TCB *tcb, uint8_t priority); ****************************************************************************/ #ifndef CONFIG_DISABLE_SIGNALS -EXTERN void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver); +void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver); #endif /**************************************************************************** @@ -363,7 +361,7 @@ EXTERN void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver); ****************************************************************************/ #ifndef CONFIG_HEAP_BASE -EXTERN void up_allocate_heap(FAR void **heap_start, size_t *heap_size); +void up_allocate_heap(FAR void **heap_start, size_t *heap_size); #endif /**************************************************************************** @@ -382,6 +380,95 @@ EXTERN void up_allocate_heap(FAR void **heap_start, size_t *heap_size); # define up_getpicbase(ppicbase) #endif +/**************************************************************************** + * Name: up_addrenv_create + * + * Description: + * This function is called from the binary loader logic when a new + * task is created in RAM in order to instantiate an address environment for + * the task. + * + * Input Parameters: + * tcb - The TCB of the task needing the address environment. + * envsize - The size (in bytes) of the address environment needed by the + * task. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +int up_addrenv_create(FAR _TCB *tcb, size_t envsize); +#endif + +/**************************************************************************** + * Name: up_addrenv_clone + * + * Description: + * This function is called from the core scheduler logic when a thread + * is created that needs to share the address ennvironment of its parent + * task. In this case, the parent's address environment needs to be + * "cloned" for the child. + * + * Input Parameters: + * ptcb - The TCB of the parent task that has the address environment. + * ctcb - The TCB of the child thread needing the address environment. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +int up_addrenv_clone(FAR const _TCB *ptcb, FAR _TCB *ctcb); +#endif + +/**************************************************************************** + * Name: up_addrenv_instantiate + * + * Description: + * After an address environment has been established for a task (via + * up_addrenv_create(). This function may be called to to instantiate + * that address environment in the virtual address space. this might be + * necessary, for example, to load the code for the task from a file or + * to access address environment private data. + * + * Input Parameters: + * tcb - The TCB of the task or thread whose the address environment will + * be instantiated. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +int up_addrenv_instantiate(FAR _TCB *tcb); +#endif + +/**************************************************************************** + * Name: up_addrenv_release + * + * Description: + * This function is called when a task or thread exits in order to release + * its reference to an address environment. When there are no further + * references to an address environment, that address environment should + * be destroyed. + * + * Input Parameters: + * tcb - The TCB of the task or thread whose the address environment will + * be released. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +int up_addrenv_release(FAR _TCB *tcb); +#endif + /**************************************************************************** * Name: up_interrupt_context * @@ -391,7 +478,7 @@ EXTERN void up_allocate_heap(FAR void **heap_start, size_t *heap_size); * ****************************************************************************/ -EXTERN bool up_interrupt_context(void); +bool up_interrupt_context(void); /**************************************************************************** * Name: up_enable_irq @@ -413,7 +500,7 @@ EXTERN bool up_interrupt_context(void); ****************************************************************************/ #ifndef CONFIG_ARCH_NOINTC -EXTERN void up_enable_irq(int irq); +void up_enable_irq(int irq); #endif /**************************************************************************** @@ -431,7 +518,7 @@ EXTERN void up_enable_irq(int irq); ****************************************************************************/ #ifndef CONFIG_ARCH_NOINTC -EXTERN void up_disable_irq(int irq); +void up_disable_irq(int irq); #endif /**************************************************************************** @@ -446,7 +533,7 @@ EXTERN void up_disable_irq(int irq); ****************************************************************************/ #ifdef CONFIG_ARCH_IRQPRIO -EXTERN int up_prioritize_irq(int irq, int priority); +int up_prioritize_irq(int irq, int priority); #endif /**************************************************************************** @@ -483,7 +570,7 @@ EXTERN int up_prioritize_irq(int irq, int priority); ****************************************************************************/ #ifdef CONFIG_ARCH_ROMGETC -EXTERN char up_romgetc(FAR const char *ptr); +char up_romgetc(FAR const char *ptr); #else # define up_romgetc(ptr) (*ptr) #endif @@ -497,8 +584,8 @@ EXTERN char up_romgetc(FAR const char *ptr); * ***************************************************************************/ -EXTERN void up_mdelay(unsigned int milliseconds); -EXTERN void up_udelay(useconds_t microseconds); +void up_mdelay(unsigned int milliseconds); +void up_udelay(useconds_t microseconds); /**************************************************************************** * Name: up_cxxinitialize @@ -517,7 +604,7 @@ EXTERN void up_udelay(useconds_t microseconds); ***************************************************************************/ #if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) -EXTERN void up_cxxinitialize(void); +void up_cxxinitialize(void); #endif /**************************************************************************** @@ -537,7 +624,7 @@ EXTERN void up_cxxinitialize(void); * ****************************************************************************/ -EXTERN void sched_process_timer(void); +void sched_process_timer(void); /**************************************************************************** * Name: irq_dispatch @@ -549,7 +636,7 @@ EXTERN void sched_process_timer(void); * ***************************************************************************/ -EXTERN void irq_dispatch(int irq, FAR void *context); +void irq_dispatch(int irq, FAR void *context); /**************************************************************************** * Board-specific button interfaces exported by the board-specific logic @@ -571,7 +658,7 @@ EXTERN void irq_dispatch(int irq, FAR void *context); ****************************************************************************/ #ifdef CONFIG_ARCH_BUTTONS -EXTERN void up_buttoninit(void); +void up_buttoninit(void); #endif /**************************************************************************** @@ -592,7 +679,7 @@ EXTERN void up_buttoninit(void); ****************************************************************************/ #ifdef CONFIG_ARCH_BUTTONS -EXTERN uint8_t up_buttons(void); +uint8_t up_buttons(void); #endif /**************************************************************************** @@ -613,7 +700,7 @@ EXTERN uint8_t up_buttons(void); ****************************************************************************/ #ifdef CONFIG_ARCH_IRQBUTTONS -EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler); +xcpt_t up_irqbutton(int id, xcpt_t irqhandler); #endif /************************************************************************************ @@ -625,17 +712,17 @@ EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler); ************************************************************************************/ #ifdef CONFIG_ARCH_RELAYS -EXTERN void up_relaysinit(void); -EXTERN void relays_setstat(int relays, bool stat); -EXTERN bool relays_getstat(int relays); -EXTERN void relays_setstats(uint32_t relays_stat); -EXTERN uint32_t relays_getstats(void); -EXTERN void relays_onoff(int relays, uint32_t mdelay); -EXTERN void relays_onoffs(uint32_t relays_stat, uint32_t mdelay); -EXTERN void relays_resetmode(int relays); -EXTERN void relays_powermode(int relays); -EXTERN void relays_resetmodes(uint32_t relays_stat); -EXTERN void relays_powermodes(uint32_t relays_stat); +void up_relaysinit(void); +void relays_setstat(int relays, bool stat); +bool relays_getstat(int relays); +void relays_setstats(uint32_t relays_stat); +uint32_t relays_getstats(void); +void relays_onoff(int relays, uint32_t mdelay); +void relays_onoffs(uint32_t relays_stat, uint32_t mdelay); +void relays_resetmode(int relays); +void relays_powermode(int relays); +void relays_resetmodes(uint32_t relays_stat); +void relays_powermodes(uint32_t relays_stat); #endif /**************************************************************************** @@ -650,9 +737,8 @@ EXTERN void relays_powermodes(uint32_t relays_stat); * ****************************************************************************/ -EXTERN int up_putc(int ch); +int up_putc(int ch); -#undef EXTERN #ifdef __cplusplus } #endif diff --git a/nuttx/mm/mm_graninit.c b/nuttx/mm/mm_graninit.c index e43839ad6..54b729988 100644 --- a/nuttx/mm/mm_graninit.c +++ b/nuttx/mm/mm_graninit.c @@ -74,7 +74,6 @@ FAR struct gran_s *g_graninfo; * Perfrom common GRAN initialization. * * Input Parameters: - * info - Private granule data structure pointer * heapstart - Start of the granule allocation heap * heapsize - Size of heap in bytes * log2gran - Log base 2 of the size of one granule. 0->1 byte, diff --git a/nuttx/sched/Kconfig b/nuttx/sched/Kconfig index ab0de5b47..afb35c1c0 100644 --- a/nuttx/sched/Kconfig +++ b/nuttx/sched/Kconfig @@ -40,7 +40,7 @@ config JULIAN_TIME config START_YEAR int "start year" - default 2010 + default 2013 config START_MONTH int "start month" @@ -384,14 +384,6 @@ config PREALLOC_TIMERS comment "Stack and heap information" -config CUSTOM_STACK - bool "Enable custom stack" - default n - ---help--- - The up_ implementation will handle all stack operations outside of the - nuttx model. This is necessary for certain architectures that have - have hardware stacks (such as the 8051 family). - config IDLETHREAD_STACKSIZE int "Idle thread stack size" default 1024 -- cgit v1.2.3 From b09b1b66b02ca5bd8241050b21d7030bec344d4a Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 11 Dec 2012 21:42:15 +0000 Subject: configs/p112: Add a configuration for the Z180 P112 board git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5429 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 2 + nuttx/Documentation/README.html | 2 + nuttx/README.txt | 2 + nuttx/arch/z80/src/common/up_doirq.c | 1 + nuttx/arch/z80/src/common/up_initialize.c | 8 + nuttx/arch/z80/src/common/up_internal.h | 6 + nuttx/arch/z80/src/z180/Kconfig | 13 + nuttx/arch/z80/src/z180/switch.h | 103 +++++- nuttx/arch/z80/src/z180/z180_mmu.c | 71 ++-- nuttx/arch/z80/src/z180/z180_mmu.h | 6 +- nuttx/arch/z80/src/z180/z180_registerdump.c | 2 + nuttx/configs/Kconfig | 28 ++ nuttx/configs/README.txt | 27 +- nuttx/configs/p112/Kconfig | 4 + nuttx/configs/p112/README.txt | 26 ++ nuttx/configs/p112/include/board.h | 60 ++++ nuttx/configs/p112/ostest/Make.defs | 167 +++++++++ nuttx/configs/p112/ostest/defconfig | 530 ++++++++++++++++++++++++++++ nuttx/configs/p112/ostest/setenv.bat | 50 +++ nuttx/configs/p112/scripts/setenv.bat | 50 +++ nuttx/configs/p112/scripts/setenv.sh | 66 ++++ nuttx/configs/p112/src/Makefile | 77 ++++ nuttx/configs/z80sim/src/Makefile | 2 +- nuttx/include/nuttx/arch.h | 26 +- nuttx/sched/Kconfig | 8 +- nuttx/sched/env_internal.h | 2 +- nuttx/sched/pthread_create.c | 63 ++-- nuttx/sched/sched_releasetcb.c | 6 + 28 files changed, 1332 insertions(+), 76 deletions(-) create mode 100644 nuttx/configs/p112/Kconfig create mode 100644 nuttx/configs/p112/README.txt create mode 100644 nuttx/configs/p112/include/board.h create mode 100644 nuttx/configs/p112/ostest/Make.defs create mode 100644 nuttx/configs/p112/ostest/defconfig create mode 100644 nuttx/configs/p112/ostest/setenv.bat create mode 100644 nuttx/configs/p112/scripts/setenv.bat create mode 100755 nuttx/configs/p112/scripts/setenv.sh create mode 100644 nuttx/configs/p112/src/Makefile (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 7e3b2a43f..11e8b200b 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3780,4 +3780,6 @@ * include/nuttx/arch.h: Add address environment control interfaces (for use with CPUs the provide MCUs and support process-like address environments). * arch/z80/src/z180/z180_mmu.*: Add MMU support for z180 tasks. + * configs/p112: Add very basic board support and an examples/ostest + configuration for the venerable P112 board. diff --git a/nuttx/Documentation/README.html b/nuttx/Documentation/README.html index 7dd23ac3d..281b738b8 100644 --- a/nuttx/Documentation/README.html +++ b/nuttx/Documentation/README.html @@ -150,6 +150,8 @@ | | | |- include/README.txt | | | |- src/README.txt | | | `- README.txt + | | |- p112/ + | | | `- README.txt | | |- pcblogic-pic32mx/ | | | `- README.txt | | |- pic32-starterkit/ diff --git a/nuttx/README.txt b/nuttx/README.txt index 55f42339c..9ad499d3f 100644 --- a/nuttx/README.txt +++ b/nuttx/README.txt @@ -849,6 +849,8 @@ nuttx | | |- include/README.txt | | |- src/README.txt | | `- README.txt + | |- p112/ + | | `- README.txt | |- pcblogic-pic32mx/ | | `- README.txt | |- pic32-starterkit/ diff --git a/nuttx/arch/z80/src/common/up_doirq.c b/nuttx/arch/z80/src/common/up_doirq.c index a4bb830fd..4b57f8f7b 100644 --- a/nuttx/arch/z80/src/common/up_doirq.c +++ b/nuttx/arch/z80/src/common/up_doirq.c @@ -102,6 +102,7 @@ FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs) IRQ_LEAVE(irq); } + up_ledoff(LED_INIRQ); return regs; #endif diff --git a/nuttx/arch/z80/src/common/up_initialize.c b/nuttx/arch/z80/src/common/up_initialize.c index 1ae927831..e0b46f7ec 100644 --- a/nuttx/arch/z80/src/common/up_initialize.c +++ b/nuttx/arch/z80/src/common/up_initialize.c @@ -145,6 +145,14 @@ void up_initialize(void) up_timerinit(); #endif + /* Initialize the CPU for those that use it (only for the Z180). This + * needs to be done before any tasks are created). + */ + +#if CONFIG_ADDRENV + (void)up_mmuinit(); +#endif + /* Register devices */ #if CONFIG_NFILE_DESCRIPTORS > 0 diff --git a/nuttx/arch/z80/src/common/up_internal.h b/nuttx/arch/z80/src/common/up_internal.h index 1989f99d0..3adb02a39 100644 --- a/nuttx/arch/z80/src/common/up_internal.h +++ b/nuttx/arch/z80/src/common/up_internal.h @@ -117,6 +117,12 @@ EXTERN FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs); EXTERN void up_sigdeliver(void); +/* Defined in CPU-specific logic (only for Z180) */ + +#if CONFIG_ADDRENV +int up_mmuinit(void); +#endif + /* Defined in up_allocateheap.c */ #if CONFIG_MM_REGIONS > 1 diff --git a/nuttx/arch/z80/src/z180/Kconfig b/nuttx/arch/z80/src/z180/Kconfig index 58abbd6f2..3082e69cb 100644 --- a/nuttx/arch/z80/src/z180/Kconfig +++ b/nuttx/arch/z80/src/z180/Kconfig @@ -137,4 +137,17 @@ config ARCH_HAVEHEAD Use a board-specific version of the "head" file in the configs//src directory +menu "Z180 Peripheral Support" + +config Z180_UART0 + bool "UART0" + default n + select ARCH_HAVE_UART0 + +config Z180_UART1 + bool "UART1" + default n + select ARCH_HAVE_UART1 + +endmenu endif diff --git a/nuttx/arch/z80/src/z180/switch.h b/nuttx/arch/z80/src/z180/switch.h index 38054e4b8..aa33bd1e1 100644 --- a/nuttx/arch/z80/src/z180/switch.h +++ b/nuttx/arch/z80/src/z180/switch.h @@ -44,6 +44,7 @@ #include #include +#include "z180_iomap.h" #include "up_internal.h" /************************************************************************************ @@ -58,56 +59,116 @@ /* Initialize the IRQ state */ -#define INIT_IRQCONTEXT() current_regs = NULL +#define INIT_IRQCONTEXT() \ + current_regs = NULL /* IN_INTERRUPT returns true if the system is currently operating in the interrupt * context. IN_INTERRUPT is the inline equivalent of up_interrupt_context(). */ -#define IN_INTERRUPT() (current_regs != NULL) +#define IN_INTERRUPT() \ + (current_regs != NULL) -/* The following macro is used when the system enters interrupt handling logic */ +/* The following macro declares the variables need by IRQ_ENTER and IRQ_LEAVE. + * These variables are used to support nested interrupts. + * + * - savestate holds the previous value of current_state. + * - savecpr holds the previous value of current_cpr. + * + * TODO: I think this logic is bad... I do not thing that this will really + * handle nested interrupts correctly. What if we are nested and then a + * context switch occurs? current_regs will not be updated correctly! + */ #define DECL_SAVESTATE() \ - FAR chipreg_t *savestate + FAR chipreg_t *savestate; \ + uint8_t savecbr; -#define IRQ_ENTER(irq, regs) \ - do { \ - savestate = (FAR chipreg_t *)current_regs; \ - current_regs = (regs); \ - } while (0) +/* The following macro is used when the system enters interrupt handling logic. + * The entry values of current_regs and current_cbr and stored in local variables. + * Then current_regs and current_cbr are set to the values of the interrupted + * task. + */ -/* The following macro is used when the system exits interrupt handling logic */ +#define IRQ_ENTER(irq, regs) \ + do \ + { \ + savestate = (FAR chipreg_t *)current_regs; \ + savecbr = current_cbr; \ + current_regs = (regs); \ + current_cbr = inp(Z180_MMU_CBR); \ + } \ + while (0) + +/* The following macro is used when the system exits interrupt handling logic. + * The value of current_regs is restored. If we are not processing a nested + * interrupt (meaning that we going to return to the user task), then also + * set the MMU's CBR register. + */ -#define IRQ_LEAVE(irq) current_regs = savestate +#define IRQ_LEAVE(irq) \ + do \ + { \ + current_regs = savestate; \ + if (current_regs) \ + { \ + current_cbr = savecbr; \ + } \ + else \ + { \ + outp(Z180_MMU_CBR, savecbr); \ + } \ + } /* The following macro is used to sample the interrupt state (as a opaque handle) */ -#define IRQ_STATE() (current_regs) +#define IRQ_STATE() \ + (current_regs) /* Save the current IRQ context in the specified TCB */ -#define SAVE_IRQCONTEXT(tcb) z180_copystate((tcb)->xcp.regs, (FAR chipreg_t*)current_regs) +#define SAVE_IRQCONTEXT(tcb) \ + z180_copystate((tcb)->xcp.regs, (FAR chipreg_t*)current_regs) /* Set the current IRQ context to the state specified in the TCB */ -#define SET_IRQCONTEXT(tcb) z180_copystate((FAR chipreg_t*)current_regs, (tcb)->xcp.regs) +#define SET_IRQCONTEXT(tcb) \ + do \ + { \ + if ((tcb)->xcp.cbr.cbr) \ + { \ + current_cbr = (tcb)->xcp.cbr->cbr); \ + } \ + z180_copystate((FAR chipreg_t*)current_regs, (tcb)->xcp.regs); \ + } \ + while (0) /* Save the user context in the specified TCB. User context saves can be simpler * because only those registers normally saved in a C called need be stored. */ -#define SAVE_USERCONTEXT(tcb) z180_saveusercontext((tcb)->xcp.regs) +#define SAVE_USERCONTEXT(tcb) \ + z180_saveusercontext((tcb)->xcp.regs) /* Restore the full context -- either a simple user state save or the full, * IRQ state save. */ -#define RESTORE_USERCONTEXT(tcb) z180_restoreusercontext((tcb)->xcp.regs) +#define RESTORE_USERCONTEXT(tcb) \ + do \ + { \ + if ((tcb)->xcp.cbr.cbr) \ + { \ + outp(Z180_MMU_CBR, (tcb)->xcp.cbr->cbr); \ + } \ + z180_restoreusercontext((tcb)->xcp.regs); \ + } \ + while (0) /* Dump the current machine registers */ -#define _REGISTER_DUMP() z180_registerdump() +#define _REGISTER_DUMP() \ + z180_registerdump() /************************************************************************************ * Public Types @@ -123,6 +184,14 @@ */ extern volatile chipreg_t *current_regs; + +/* This holds the value of the MMU's CBR register. This value is set to the + * interrupted tasks's CBR on interrupt entry, changed to the new task's CBR if + * an interrrupt level context switch occurs, and restored on interrupt exit. In + * this way, the CBR is always correct on interrupt exit. + */ + +extern uint8_t current_cbr; #endif /************************************************************************************ diff --git a/nuttx/arch/z80/src/z180/z180_mmu.c b/nuttx/arch/z80/src/z180/z180_mmu.c index c71f59755..076d91bef 100644 --- a/nuttx/arch/z80/src/z180/z180_mmu.c +++ b/nuttx/arch/z80/src/z180/z180_mmu.c @@ -120,15 +120,21 @@ static FAR struct z180_cbr_s *z180_mmu_findcbr(void) * called very early in the boot process to get the basic operating * memory configuration correct. This function does *not* perform all * necessray MMU initialization... only the basics needed at power-up. - * z180_mmu_init() must be called later to complete the entire MMU + * up_mmuinit() must be called later to complete the entire MMU * initialization. * ****************************************************************************/ void z180_mmu_lowinit(void) __naked { + /* Set the CBAR register to set up the virtual address of the Bank Area and + * Common Area 1. Set the BBR register to set up the physical mapping for + * the Bank Area (the physical mapping for Common Area 1 will not be done + * until the first task is started. + */ + __asm - ld c, #Z180_MMU_CBR ; port + ld c, #Z180_MMU_CBAR ; port ld a, #Z180_CBAR_VALUE ; value out (c), a @@ -139,15 +145,15 @@ void z180_mmu_lowinit(void) __naked } /**************************************************************************** - * Name: z180_mmu_init + * Name: up_mmuinit * * Description: - * Perform higher level initializatin of the MMU and physical memory + * Perform higher level initialization of the MMU and physical memory * memory management logic. * ****************************************************************************/ -int z180_mmu_init(void) +int up_mmuinit(void) { /* Here we use the granule allocator as a page allocator. We lie and * say that 1 page is 1 byte. @@ -257,7 +263,7 @@ errout_with_irq: } /**************************************************************************** - * Name: up_addrenv_clone + * Name: up_addrenv_share * * Description: * This function is called from the core scheduler logic when a thread @@ -274,8 +280,7 @@ errout_with_irq: * ****************************************************************************/ -#ifdef CONFIG_ADDRENV -int up_addrenv_clone(FAR const _TCB *ptcb, FAR _TCB *ctcb) +int up_addrenv_share(FAR const _TCB *ptcb, FAR _TCB *ctcb) { irqstate_t flags; @@ -299,7 +304,6 @@ int up_addrenv_clone(FAR const _TCB *ptcb, FAR _TCB *ctcb) irqrestore(flags); return OK; } -#endif /**************************************************************************** * Name: up_addrenv_instantiate @@ -316,35 +320,55 @@ int up_addrenv_clone(FAR const _TCB *ptcb, FAR _TCB *ctcb) * be instantiated. * * Returned Value: - * Zero (OK) on success; a negated errno value on failure. + * A handle that may be used with up_addrenv_restore() to restore the + * address environment before up_addrenv_instantiate() was called. * ****************************************************************************/ -#ifdef CONFIG_ADDRENV -int up_addrenv_instantiate(FAR _TCB *tcb) +FAR void *up_addrenv_instantiate(FAR _TCB *tcb) { + uint8_t oldcbr; irqstate_t flags; - /* Check if the task has an address environment. */ + /* Get the current CBR value from the CBR register */ flags = irqsave(); + cbr = inp(Z180_MMU_CBR); + + /* Check if the task has an address environment. */ + if (tcb->xcp.cbr) { - /* Yes... write the CBR value into CBR register */ + /* Yes.. Write the new CBR value into CBR register */ outp(Z180_MMU_CBR, tcb->xcp.cbr.cbr); - /* Clone the CBR by incrementing the reference counting and saving a - * copy in the child thread's TCB. - */ - - ptcb->xcp.cbr.crefs++; - ctcb->xcp.cbr = ptcb->xcp.cbr; } irqrestore(flags); - return OK; + return (FAR void *)cbr; +} + +/**************************************************************************** + * Name: up_addrenv_restore + * + * Description: + * Restore an address environment using a handle previously returned by + * up_addrenv_instantiate(). + * + * Input Parameters: + * handle - A handle previously returned by up_addrenv_instantiate. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +int up_addrenv_restore(FAR void *handle) +{ + /* Restore the CBR value */ + + outp(Z180_MMU_CBR, (uint8_t)handle); } -#endif /**************************************************************************** * Name: up_addrenv_release @@ -364,7 +388,6 @@ int up_addrenv_instantiate(FAR _TCB *tcb) * ****************************************************************************/ -#ifdef CONFIG_ADDRENV int up_addrenv_release(FAR _TCB *tcb) { FAR struct z180_cbr_s *cbr; @@ -401,5 +424,3 @@ int up_addrenv_release(FAR _TCB *tcb) irqrestore(flags); return OK; } -#endif - diff --git a/nuttx/arch/z80/src/z180/z180_mmu.h b/nuttx/arch/z80/src/z180/z180_mmu.h index 1a4c03406..74463427a 100644 --- a/nuttx/arch/z80/src/z180/z180_mmu.h +++ b/nuttx/arch/z80/src/z180/z180_mmu.h @@ -128,7 +128,7 @@ * called very early in the boot process to get the basic operating * memory configuration correct. This function does *not* perform all * necessray MMU initialization... only the basics needed at power-up. - * z180_mmu_init() must be called later to complete the entire MMU + * up_mmuinit() must be called later to complete the entire MMU * initialization. * ****************************************************************************/ @@ -136,7 +136,7 @@ void z180_mmu_lowinit(void) __naked; /**************************************************************************** - * Name: z180_mmu_init + * Name: up_mmuinit * * Description: * Perform higher level initializatin of the MMU and physical memory @@ -144,6 +144,6 @@ void z180_mmu_lowinit(void) __naked; * ****************************************************************************/ -void z180_mmu_init(void); +void up_mmuinit(void); #endif /* __ARCH_Z80_SRC_Z180_Z180_MMU_H */ diff --git a/nuttx/arch/z80/src/z180/z180_registerdump.c b/nuttx/arch/z80/src/z180/z180_registerdump.c index 2ccfc2f99..65ae791db 100644 --- a/nuttx/arch/z80/src/z180/z180_registerdump.c +++ b/nuttx/arch/z80/src/z180/z180_registerdump.c @@ -86,6 +86,8 @@ static void z180_registerdump(void) current_regs[XCPT_IX], current_regs[XCPT_IY]); lldbg("SP: %04x PC: %04x\n" current_regs[XCPT_SP], current_regs[XCPT_PC]); + lldbg("CBAR: %02x BBR: %02x CBR: %02x\n" + inp(Z180_MMU_CBAR), inp(Z180_MMU_BBR), inp(Z180_MMU_CBR)); } } #endif diff --git a/nuttx/configs/Kconfig b/nuttx/configs/Kconfig index 50e1cc600..bba1444c4 100644 --- a/nuttx/configs/Kconfig +++ b/nuttx/configs/Kconfig @@ -346,6 +346,33 @@ config ARCH_BOARD_OLIMEX_STM32P107 Linux or Cygwin. See the http://www.olimex.com for further information. This board features the STMicro STM32F107VC MCU +config ARCH_BOARD_P112 + bool "P112 Z180-based platform" + depends on ARCH_CHIP_Z8018216FSG + ---help--- + The P112 is notable because it was the first of the hobbyist single board + computers to reach the production stage. The P112 hobbyist computers + were relatively widespread and inspired other hobbyist centered home brew + computing projects such as N8VEM home brew computing project. The P112 + project still maintains many devoted enthusiasts and has an online + repository of software and other information. + + The P112 computer originated as a commercial product of "D-X Designs Pty + Ltd" of Australia. They describe the computer as "The P112 is a stand-alone + 8-bit CPU board. Typically running CP/M (tm) or a similar operating system, + it provides a Z80182 (Z-80 upgrade) CPU with up to 1MB of memory, serial, + parallel and diskette IO, and realtime clock, in a 3.5-inch drive form factor. + Powered solely from 5V, it draws 150mA (nominal: not including disk drives) + with a 16MHz CPU clock. Clock speeds up to 24.576MHz are possible." + + The P112 board was last available new in 1996 by Dave Brooks. In late 2004 + on the Usenet Newsgroup comp.os.cpm, talk about making another run of P112 + boards was discussed. David Griffith decided to produce additional P112 kits + with Dave Brooks blessing and the assistance of others. In addition Terry + Gulczynski makes additional P112 derivative hobbyist home brew computers. + Hal Bower was very active in the mid 1990's on the P112 project and ported + the "Banked/Portable BIOS". + config ARCH_BOARD_PCBLOGICPIC32MX bool "PIC32MX board from PCB Logic Design Co" depends on ARCH_CHIP_PIC32MX460F512L @@ -647,6 +674,7 @@ config ARCH_BOARD default "olimex-lpc2378" if ARCH_BOARD_OLIMEXLPC2378 default "olimex-stm32-p107" if ARCH_BOARD_OLIMEX_STM32P107 default "olimex-strp711" if ARCH_BOARD_OLIMEX_STRP711 + default "p112" if ARCH_BOARD_P112 default "pcblogic-pic32mx" if ARCH_BOARD_PCBLOGICPIC32MX default "pic32-starterkit" if ARCH_BOARD_PIC32_STARTERKIT default "pic32mx7mmb" if ARCH_BOARD_PIC32_PIC32MX7MMB diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt index 23f5e4380..e7f73f945 100644 --- a/nuttx/configs/README.txt +++ b/nuttx/configs/README.txt @@ -1780,14 +1780,36 @@ configs/pcblogic-pic32mx STATUS: Code complete but testing has been stalled due to tool related problems (PICkit 2 does not work with the PIC32). -configs/pic32-starterkit +configs/p112 + The P112 is notable because it was the first of the hobbyist single board + computers to reach the production stage. The P112 hobbyist computers + were relatively widespread and inspired other hobbyist centered home brew + computing projects such as N8VEM home brew computing project. The P112 + project still maintains many devoted enthusiasts and has an online + repository of software and other information. + + The P112 computer originated as a commercial product of "D-X Designs Pty + Ltd" of Australia. They describe the computer as "The P112 is a stand-alone + 8-bit CPU board. Typically running CP/M (tm) or a similar operating system, + it provides a Z80182 (Z-80 upgrade) CPU with up to 1MB of memory, serial, + parallel and diskette IO, and realtime clock, in a 3.5-inch drive form factor. + Powered solely from 5V, it draws 150mA (nominal: not including disk drives) + with a 16MHz CPU clock. Clock speeds up to 24.576MHz are possible." + + The P112 board was last available new in 1996 by Dave Brooks. In late 2004 + on the Usenet Newsgroup comp.os.cpm, talk about making another run of P112 + boards was discussed. David Griffith decided to produce additional P112 kits + with Dave Brooks blessing and the assistance of others. In addition Terry + Gulczynski makes additional P112 derivative hobbyist home brew computers. + Hal Bower was very active in the mid 1990's on the P112 project and ported + the "Banked/Portable BIOS". +configs/pic32-starterkit This directory contains the port of NuttX to the Microchip PIC32 Ethernet Starter Kit (DM320004) with the Multimedia Expansion Board (MEB, DM320005). See www.microchip.com for further information. configs/pic32mx7mmb - This directory will (eventually) contain the port of NuttX to the Mikroelektronika PIC32MX7 Multimedia Board (MMB). See http://www.mikroe.com/ for further information. @@ -1797,7 +1819,6 @@ configs/pjrc-8051 and the SDCC toolchain. This port is not quite ready for prime time. configs/qemu-i486 - Port of NuttX to QEMU in i486 mode. This port will also run on real i486 hardwared (Google the Bifferboard). diff --git a/nuttx/configs/p112/Kconfig b/nuttx/configs/p112/Kconfig new file mode 100644 index 000000000..ae2bf3130 --- /dev/null +++ b/nuttx/configs/p112/Kconfig @@ -0,0 +1,4 @@ +# +# For a description of the syntax of this configuration file, +# see misc/tools/kconfig-language.txt. +# diff --git a/nuttx/configs/p112/README.txt b/nuttx/configs/p112/README.txt new file mode 100644 index 000000000..6b6f5964d --- /dev/null +++ b/nuttx/configs/p112/README.txt @@ -0,0 +1,26 @@ +P112 README +^^^^^^^^^^^ + +The P112 is notable because it was the first of the hobbyist single board +computers to reach the production stage. The P112 hobbyist computers +were relatively widespread and inspired other hobbyist centered home brew +computing projects such as N8VEM home brew computing project. The P112 +project still maintains many devoted enthusiasts and has an online +repository of software and other information. + +The P112 computer originated as a commercial product of "D-X Designs Pty +Ltd" of Australia. They describe the computer as "The P112 is a stand-alone +8-bit CPU board. Typically running CP/M (tm) or a similar operating system, +it provides a Z80182 (Z-80 upgrade) CPU with up to 1MB of memory, serial, +parallel and diskette IO, and realtime clock, in a 3.5-inch drive form factor. +Powered solely from 5V, it draws 150mA (nominal: not including disk drives) +with a 16MHz CPU clock. Clock speeds up to 24.576MHz are possible." + +The P112 board was last available new in 1996 by Dave Brooks. In late 2004 +on the Usenet Newsgroup comp.os.cpm, talk about making another run of P112 +boards was discussed. David Griffith decided to produce additional P112 kits +with Dave Brooks blessing and the assistance of others. In addition Terry +Gulczynski makes additional P112 derivative hobbyist home brew computers. +Hal Bower was very active in the mid 1990's on the P112 project and ported +the "Banked/Portable BIOS". + diff --git a/nuttx/configs/p112/include/board.h b/nuttx/configs/p112/include/board.h new file mode 100644 index 000000000..55077709d --- /dev/null +++ b/nuttx/configs/p112/include/board.h @@ -0,0 +1,60 @@ +/************************************************************ + * configs/p112/include/board.h + * + * Copyright (C) 2012 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 __CONFIGS_P112_INCLUDE_BOARD_H +#define __CONFIGS_P112_INCLUDE_BOARD_H + +/************************************************************ + * Included Files + ************************************************************/ + +/************************************************************ + * Definitions + ************************************************************/ + +/************************************************************ + * Public Functions + ************************************************************/ + +#if defined(__cplusplus) +extern "C" +{ +#endif + +#if defined(__cplusplus) +} +#endif + +#endif /* __CONFIGS_P112_INCLUDE_BOARD_H */ diff --git a/nuttx/configs/p112/ostest/Make.defs b/nuttx/configs/p112/ostest/Make.defs new file mode 100644 index 000000000..e64c7b5dd --- /dev/null +++ b/nuttx/configs/p112/ostest/Make.defs @@ -0,0 +1,167 @@ +############################################################################ +# configs/p112/ostest/Make.defs +# +# Copyright (C) 2012 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. +# +############################################################################ + +include ${TOPDIR}/.config +include ${TOPDIR}/tools/Config.mk + +# These are the directories where the SDCC toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + SDCC_INSTALLDIR = C:\PROGRA~2\SDCC + SDCC_BINDIR = $(SDCC_INSTALLDIR)\bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)\lib\z180 +else + SDCC_INSTALLDIR = /usr/local + SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z180 +endif + +CROSSDEV = +CC = sdcc +CPP = sdcpp +LD = sdldz80 +AS = sdasz80 +AR = sdar -r +ARCHCPUFLAGS = -mz180 + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + ARCHOPTIMIZATION = --debug +else + ARCHOPTIMIZATION = +endif + +ARCHPICFLAGS = +ARCHWARNINGS = +ARCHDEFINES = +ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include + +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = -x -a -l -o -s -g + +SDCCLIB = z180.lib + +ASMEXT = .asm +OBJEXT = .o +LIBEXT = .lib +EXEEXT = .hex + +# Custom ASSEMBLE definition. The most common toolchain, GCC, uses the +# compiler to assemble files because this has the advantage of running the C +# Pre-Processor against. This is not possible with other SDCC; we need to +# define AS and over-ride the common definition in order to use the assembler +# directly. + +define ASSEMBLE + @echo "AS: $1" + $(Q) $(AS) $(AFLAGS) $2 $1 +endef + +# Custom CLEAN definition + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) +define CLEAN + $(Q) if exist *.o (del /f /q *.o) + $(Q) if exist *.asm (del /f /q *.asm) + $(Q) if exist *.rel (del /f /q *.rel) + $(Q) if exist *.lst (del /f /q *.lst) + $(Q) if exist *.rst (del /f /q *.rst) + $(Q) if exist *.sym (del /f /q *.sym) + $(Q) if exist *.adb (del /f /q *.adb) + $(Q) if exist *.lnk (del /f /q *.lnk) + $(Q) if exist *.map (del /f /q *.map) + $(Q) if exist *.mem (del /f /q *.mem) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.cmd (del /f /q *.cmd) +endef +else +define CLEAN + $(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd +endef +endif + +# Windows native host tool definitions + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe + + # Windows-native host tools + + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative + + # Use NTFS links or directory copies + +ifeq ($(CONFIG_WINDOWS_MKLINK),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.bat +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.bat +endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.bat + +else + +# Linux/Cygwin host tool definitions + + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # SDCC for Linux, OSX, or Cygwin understands symbolic links. Windows SDCC + # running under Cygwin does not + +ifeq ($(WINTOOL),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh +endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + +endif diff --git a/nuttx/configs/p112/ostest/defconfig b/nuttx/configs/p112/ostest/defconfig new file mode 100644 index 000000000..2cdc13ba5 --- /dev/null +++ b/nuttx/configs/p112/ostest/defconfig @@ -0,0 +1,530 @@ +# +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_LINUX is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +CONFIG_WINDOWS_NATIVE=y +# CONFIG_WINDOWS_CYGWIN is not set +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set +# CONFIG_WINDOWS_MKLINK is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="..\apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_SYMBOLS is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set +CONFIG_ARCH_Z80=y +CONFIG_ARCH="z80" +CONFIG_ARCH_CHIP="z180" +CONFIG_BOARD_LOOPSPERMSEC=100 +# CONFIG_ARCH_CHIP_Z80 is not set +# CONFIG_ARCH_CHIP_Z8018006VSG is not set +# CONFIG_ARCH_CHIP_Z8018010VSG is not set +# CONFIG_ARCH_CHIP_Z8018008VSG is not set +# CONFIG_ARCH_CHIP_Z8018010FSG is not set +# CONFIG_ARCH_CHIP_Z8018008VEG is not set +# CONFIG_ARCH_CHIP_Z8018006VEG is not set +# CONFIG_ARCH_CHIP_Z8018006PSG is not set +# CONFIG_ARCH_CHIP_Z8018008FSG is not set +# CONFIG_ARCH_CHIP_Z8018010PSG is not set +# CONFIG_ARCH_CHIP_Z8018006PEG is not set +# CONFIG_ARCH_CHIP_Z8018010VEG is not set +# CONFIG_ARCH_CHIP_Z8018010PEG is not set +# CONFIG_ARCH_CHIP_Z8018008PSG is not set +# CONFIG_ARCH_CHIP_Z8018006FSG is not set +# CONFIG_ARCH_CHIP_Z8018000XSO is not set +# CONFIG_ARCH_CHIP_Z8018010FEG is not set +# CONFIG_ARCH_CHIP_Z8018000WSO is not set +# CONFIG_ARCH_CHIP_Z8018008PEG is not set +# CONFIG_ARCH_CHIP_Z8018110FEG is not set +# CONFIG_ARCH_CHIP_Z8018233FSG is not set +# CONFIG_ARCH_CHIP_Z8018220AEG is not set +CONFIG_ARCH_CHIP_Z8018216FSG=y +# CONFIG_ARCH_CHIP_Z8018216ASG is not set +# CONFIG_ARCH_CHIP_Z8018233ASG is not set +# CONFIG_ARCH_CHIP_Z8019520FSG is not set +# CONFIG_ARCH_CHIP_Z8019533FSG is not set +# CONFIG_ARCH_CHIP_Z8L18020VSG is not set +# CONFIG_ARCH_CHIP_Z8L18020FSG is not set +# CONFIG_ARCH_CHIP_Z8L18020PSG is not set +# CONFIG_ARCH_CHIP_Z8L18220ASG is not set +# CONFIG_ARCH_CHIP_Z8L18220FSG is not set +# CONFIG_ARCH_CHIP_Z8L18220AEG is not set +# CONFIG_ARCH_CHIP_Z8S18020VSG is not set +# CONFIG_ARCH_CHIP_Z8S18020VSG1960 is not set +# CONFIG_ARCH_CHIP_Z8S18033VSG is not set +# CONFIG_ARCH_CHIP_Z8S18010FSG is not set +# CONFIG_ARCH_CHIP_Z8S18010VEG is not set +# CONFIG_ARCH_CHIP_Z8S18020VEG is not set +# CONFIG_ARCH_CHIP_Z8S18010VSG is not set +# CONFIG_ARCH_CHIP_Z8S18020PSG is not set +# CONFIG_ARCH_CHIP_Z8S18033FSG is not set +# CONFIG_ARCH_CHIP_Z8S18033FEG is not set +# CONFIG_ARCH_CHIP_Z8S18020FSG is not set +# CONFIG_ARCH_CHIP_Z8S18033VEG is not set +# CONFIG_ARCH_CHIP_Z8S18010PSG is not set +# CONFIG_ARCH_CHIP_Z8S18020FEG is not set +# CONFIG_ARCH_CHIP_Z8S18010PEG is not set +# CONFIG_ARCH_CHIP_Z8S18010FEG is not set +# CONFIG_ARCH_CHIP_Z8F6403 is not set +# CONFIG_ARCH_CHIP_Z8F6423 is not set +# CONFIG_ARCH_CHIP_EZ80F91 is not set +# CONFIG_ARCH_CHIP_EZ80F92 is not set +# CONFIG_ARCH_CHIP_EZ80F93 is not set +CONFIG_ARCH_CHIP_Z180=y +CONFIG_ARCH_CHIP_Z80182=y +CONFIG_LINKER_HOME_AREA=0x0000 +CONFIG_LINKER_CODE_AREA=0x0200 +CONFIG_LINKER_DATA_AREA=0x8000 +# CONFIG_LINKER_ROM_AT_0000 is not set +# CONFIG_ARCH_HAVEHEAD is not set +# CONFIG_Z180_TOOLCHAIN_SDCCL is not set +CONFIG_Z180_TOOLCHAIN_SDCCW=y +CONFIG_Z180_BANKAREA_VIRTBASE=0x8000 +CONFIG_Z180_BANKAREA_PHYSBASE=0x08000 +CONFIG_Z180_COMMON1AREA_VIRTBASE=0xc000 +CONFIG_Z180_PHYSHEAP_START=0x0c000 +CONFIG_Z180_PHYSHEAP_END=0x100000 + +# +# Z180 Peripheral Support +# +CONFIG_Z180_UART0=y +CONFIG_Z180_UART1=y + +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_IRQPRIO is not set +# CONFIG_CUSTOM_STACK is not set +CONFIG_ADDRENV=y +# CONFIG_ARCH_STACKDUMP is not set +# CONFIG_ENDIAN_BIG is not set + +# +# Board Settings +# +CONFIG_DRAM_START=0x0000 +CONFIG_DRAM_SIZE=65536 + +# +# Boot options +# +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set + +# +# Board Selection +# +CONFIG_ARCH_BOARD_P112=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="p112" + +# +# Common Board Options +# + +# +# Board-Specific Options +# + +# +# RTOS Features +# +CONFIG_MSEC_PER_TICK=10 +CONFIG_RR_INTERVAL=0 +# CONFIG_SCHED_INSTRUMENTATION is not set +CONFIG_TASK_NAME_SIZE=0 +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2007 +CONFIG_START_MONTH=2 +CONFIG_START_DAY=21 +# CONFIG_DEV_CONSOLE is not set +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="ostest_main" +CONFIG_DISABLE_OS_API=y +CONFIG_DISABLE_CLOCK=y +CONFIG_DISABLE_POSIX_TIMERS=y +CONFIG_DISABLE_PTHREAD=y +CONFIG_DISABLE_SIGNALS=y +CONFIG_DISABLE_MQUEUE=y +CONFIG_DISABLE_MOUNTPOINT=y +CONFIG_DISABLE_ENVIRON=y +CONFIG_DISABLE_POLL=y + +# +# Sizes of configurable things (0 disables) +# +CONFIG_MAX_TASKS=8 +CONFIG_MAX_TASK_ARGS=4 +CONFIG_NPTHREAD_KEYS=0 +CONFIG_NFILE_DESCRIPTORS=0 +CONFIG_NFILE_STREAMS=0 +CONFIG_NAME_MAX=32 +CONFIG_PREALLOC_MQ_MSGS=0 +CONFIG_MQ_MAXMSGSIZE=0 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=4 +CONFIG_PREALLOC_TIMERS=0 + +# +# Stack and heap information +# +CONFIG_IDLETHREAD_STACKSIZE=1024 +CONFIG_USERMAIN_STACKSIZE=1024 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=1024 + +# +# Device Drivers +# +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +CONFIG_DEV_LOWCONSOLE=y +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART0=y +CONFIG_ARCH_HAVE_UART1=y +CONFIG_MCU_SERIAL=y +CONFIG_UART0_SERIAL_CONSOLE=y +# CONFIG_UART1_SERIAL_CONSOLE is not set +# CONFIG_NO_SERIAL_CONSOLE is not set + +# +# UART0 Configuration +# +CONFIG_UART0_RXBUFSIZE=64 +CONFIG_UART0_TXBUFSIZE=64 +CONFIG_UART0_BAUD=115200 +CONFIG_UART0_BITS=8 +CONFIG_UART0_PARITY=0 +CONFIG_UART0_2STOP=0 + +# +# UART1 Configuration +# +CONFIG_UART1_RXBUFSIZE=64 +CONFIG_UART1_TXBUFSIZE=64 +CONFIG_UART1_BAUD=115200 +CONFIG_UART1_BITS=8 +CONFIG_UART1_PARITY=0 +CONFIG_UART1_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set + +# +# System Logging Device Options +# + +# +# System Logging +# +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_NET is not set + +# +# File Systems +# + +# +# File system configuration +# +# CONFIG_FS_RAMMAP is not set + +# +# System Logging +# +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0x00000000 +CONFIG_HEAP2_SIZE=0 +# CONFIG_GRAN is not set + +# +# Binary Formats +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_PIC is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# +CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=0 +# CONFIG_LIBM is not set +CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_C99_BOOL8 is not set +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Named Applications +# +# CONFIG_NAMEDAPP is not set + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_NETTEST is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +CONFIG_EXAMPLES_OSTEST=y +# CONFIG_EXAMPLES_OSTEST_BUILTIN is not set +CONFIG_EXAMPLES_OSTEST_LOOPS=1 +CONFIG_EXAMPLES_OSTEST_STACKSIZE=1024 +CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=4 +CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000 +CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 +# CONFIG_EXAMPLES_PASHELLO is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WLAN is not set + +# +# Interpreters +# + +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# ModBus +# + +# +# FreeModbus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM +# + +# +# System NSH Add-Ons +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set diff --git a/nuttx/configs/p112/ostest/setenv.bat b/nuttx/configs/p112/ostest/setenv.bat new file mode 100644 index 000000000..19ca1ef57 --- /dev/null +++ b/nuttx/configs/p112/ostest/setenv.bat @@ -0,0 +1,50 @@ +@echo off + +rem configs/p112/ostest/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the SDCC toolchain for windows. + +set PATH=C:\Program Files (x86)\SDCC/bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% +echo %PATH% diff --git a/nuttx/configs/p112/scripts/setenv.bat b/nuttx/configs/p112/scripts/setenv.bat new file mode 100644 index 000000000..dc214445f --- /dev/null +++ b/nuttx/configs/p112/scripts/setenv.bat @@ -0,0 +1,50 @@ +@echo off + +rem configs/p112/scripts/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the SDCC toolchain for windows. + +set PATH=C:\Program Files (x86)\SDCC/bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% +echo %PATH% diff --git a/nuttx/configs/p112/scripts/setenv.sh b/nuttx/configs/p112/scripts/setenv.sh new file mode 100755 index 000000000..c55027d62 --- /dev/null +++ b/nuttx/configs/p112/scripts/setenv.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# configs/p112/ostest/setenv.sh +# +# Copyright (C) 2007, 2008, 2012 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. +# + +if [ "$_" = "$0" ] ; then + echo "You must source this script, not run it!" 1>&2 + exit 1 +fi + +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# +# This is the normal installation directory for SDCC under Linux, OSX +# or Linux: +# +export TOOLCHAIN_BIN=/usr/local/bin + +# +# This is the normal installation directory for SDCC under Windows +# +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/SDCC/bin" + +# +# Add the path to the toolchain to the PATH varialble +# +export PATH="${TOOLCHAIN_BIN}":/sbin:/usr/sbin:${PATH_ORIG} + +echo "PATH : ${PATH}" diff --git a/nuttx/configs/p112/src/Makefile b/nuttx/configs/p112/src/Makefile new file mode 100644 index 000000000..087e1ab2b --- /dev/null +++ b/nuttx/configs/p112/src/Makefile @@ -0,0 +1,77 @@ +############################################################################ +# configs/p112/src/Makefile +# +# Copyright (C) 2012 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. +# +############################################################################ + +-include $(TOPDIR)/Make.defs + +CFLAGS += -I$(TOPDIR)$(DELIM)sched +CFLAGS += -I$(TOPDIR)$(DELIM)arch$(DELIM)z80$(DELIM)src$(DELIM)common +CFLAGS += -I$(TOPDIR)$(DELIM)arch$(DELIM)z80$(DELIM)src$(DELIM)z180 + +ASRCS = +AOBJS = $(ASRCS:$(ASMEXT)=$(OBJEXT)) +CSRCS = +COBJS = $(CSRCS:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +CFLAGS += -I $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src + +all: libboard$(LIBEXT) + +$(AOBJS): %$(OBJEXT): %$(ASMEXT) + $(call ASSEMBLE, $<, $@) + +$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +libboard$(LIBEXT): $(OBJS) + $(call ARCHIVE, $@, $(OBJS)) + +.depend: Makefile $(SRCS) + $(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ + +depend: .depend + +clean: + $(call DELFILE, libboard$(LIBEXT)) + $(call CLEAN) + +distclean: clean + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + +-include Make.dep diff --git a/nuttx/configs/z80sim/src/Makefile b/nuttx/configs/z80sim/src/Makefile index 99d557850..9ace92912 100644 --- a/nuttx/configs/z80sim/src/Makefile +++ b/nuttx/configs/z80sim/src/Makefile @@ -36,7 +36,7 @@ -include $(TOPDIR)/Make.defs CFLAGS += -I$(TOPDIR)$(DELIM)sched -CFLAGS += -I$(TOPDIR)$(DELIM)arch$(DELIM)z80$(DELIM)src$(DELIM)common -I$(TOPDIR)$(DELIM)arch$(DELIM)z80$(DELIM)src$(DELIM)z80 +CFLAGS += -I$(TOPDIR)$(DELIM)arch$(DELIM)z80$(DELIM)src$(DELIM)common CFLAGS += -I$(TOPDIR)$(DELIM)arch$(DELIM)z80$(DELIM)src$(DELIM)z80 ASRCS = diff --git a/nuttx/include/nuttx/arch.h b/nuttx/include/nuttx/arch.h index 54c234d8d..7c444602e 100644 --- a/nuttx/include/nuttx/arch.h +++ b/nuttx/include/nuttx/arch.h @@ -403,7 +403,7 @@ int up_addrenv_create(FAR _TCB *tcb, size_t envsize); #endif /**************************************************************************** - * Name: up_addrenv_clone + * Name: up_addrenv_share * * Description: * This function is called from the core scheduler logic when a thread @@ -421,7 +421,7 @@ int up_addrenv_create(FAR _TCB *tcb, size_t envsize); ****************************************************************************/ #ifdef CONFIG_ADDRENV -int up_addrenv_clone(FAR const _TCB *ptcb, FAR _TCB *ctcb); +int up_addrenv_share(FAR const _TCB *ptcb, FAR _TCB *ctcb); #endif /**************************************************************************** @@ -439,12 +439,32 @@ int up_addrenv_clone(FAR const _TCB *ptcb, FAR _TCB *ctcb); * be instantiated. * * Returned Value: + * A handle that may be used with up_addrenv_restore() to restore the + * address environment before up_addrenv_instantiate() was called. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +FAR void *up_addrenv_instantiate(FAR _TCB *tcb); +#endif + +/**************************************************************************** + * Name: up_addrenv_restore + * + * Description: + * Restore an address environment using a handle previously returned by + * up_addrenv_instantiate(). + * + * Input Parameters: + * handle - A handle previously returned by up_addrenv_instantiate. + * + * Returned Value: * Zero (OK) on success; a negated errno value on failure. * ****************************************************************************/ #ifdef CONFIG_ADDRENV -int up_addrenv_instantiate(FAR _TCB *tcb); +int up_addrenv_restore(FAR void *handle); #endif /**************************************************************************** diff --git a/nuttx/sched/Kconfig b/nuttx/sched/Kconfig index afb35c1c0..bfaec3b5d 100644 --- a/nuttx/sched/Kconfig +++ b/nuttx/sched/Kconfig @@ -22,7 +22,13 @@ config SCHED_INSTRUMENTATION bool "Monitor system performance" default n ---help--- - enables instrumentation in scheduler to monitor system performance. + Enables instrumentation in scheduler to monitor system performance. + If enabled, then the board-specific logic must provide the following + functions (see include/sched.h): + + void sched_note_start(FAR _TCB *tcb); + void sched_note_stop(FAR _TCB *tcb); + void sched_note_switch(FAR _TCB *pFromTcb, FAR _TCB *pToTcb); config TASK_NAME_SIZE int "Maximum task name size" diff --git a/nuttx/sched/env_internal.h b/nuttx/sched/env_internal.h index a6205d658..5370da059 100644 --- a/nuttx/sched/env_internal.h +++ b/nuttx/sched/env_internal.h @@ -80,7 +80,7 @@ EXTERN int env_dup(FAR _TCB *ptcb); EXTERN int env_share(FAR _TCB *ptcb); EXTERN int env_release(FAR _TCB *ptcb); -/* functions used internally the environment handling logic */ +/* functions used internally by the environment handling logic */ EXTERN FAR char *env_findvar(environ_t *envp, const char *pname); EXTERN int env_removevar(environ_t *envp, char *pvar); diff --git a/nuttx/sched/pthread_create.c b/nuttx/sched/pthread_create.c index 5fdf3b88d..dc2db2916 100644 --- a/nuttx/sched/pthread_create.c +++ b/nuttx/sched/pthread_create.c @@ -246,7 +246,7 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, { FAR _TCB *ptcb; FAR join_t *pjoin; - int status; + int ret; int priority; #if CONFIG_RR_INTERVAL > 0 int policy; @@ -268,13 +268,27 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, return ENOMEM; } + /* Share the address environment of the parent task. NOTE: Only tasks + * created throught the nuttx/binfmt loaders may have an address + * environment. + */ + +#ifdef CONFIG_ADDRENV + ret = up_addrenv_share((FAR const _TCB *)g_readytorun.head, ptcb); + if (ret < 0) + { + sched_releasetcb(ptcb); + return -ret; + } +#endif + /* Associate file descriptors with the new task */ - status = sched_setuppthreadfiles(ptcb); - if (status != OK) + ret = sched_setuppthreadfiles(ptcb); + if (ret != OK) { sched_releasetcb(ptcb); - return status; + return ret; } /* Share the parent's envionment */ @@ -292,8 +306,8 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, /* Allocate the stack for the TCB */ - status = up_create_stack(ptcb, attr->stacksize); - if (status != OK) + ret = up_create_stack(ptcb, attr->stacksize); + if (ret != OK) { sched_releasetcb(ptcb); sched_free(pjoin); @@ -310,8 +324,8 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, /* Get the priority for this thread. */ struct sched_param param; - status = sched_getparam(0, ¶m); - if (status == OK) + ret = sched_getparam(0, ¶m); + if (ret == OK) { priority = param.sched_priority; } @@ -348,11 +362,9 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, /* Initialize the task control block */ - status = task_schedsetup(ptcb, priority, pthread_start, - (main_t)start_routine); - if (status != OK) + ret = task_schedsetup(ptcb, priority, pthread_start, (main_t)start_routine); + if (ret != OK) { - sched_releasetcb(ptcb); sched_free(pjoin); return EBUSY; @@ -390,21 +402,21 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, /* Initialize the semaphores in the join structure to zero. */ - status = sem_init(&pjoin->data_sem, 0, 0); - if (status == OK) + ret = sem_init(&pjoin->data_sem, 0, 0); + if (ret == OK) { - status = sem_init(&pjoin->exit_sem, 0, 0); + ret = sem_init(&pjoin->exit_sem, 0, 0); } /* Activate the task */ sched_lock(); - if (status == OK) + if (ret == OK) { - status = task_activate(ptcb); + ret = task_activate(ptcb); } - if (status == OK) + if (ret == OK) { /* Wait for the task to actually get running and to register * its join_t @@ -414,8 +426,15 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, /* Return the thread information to the caller */ - if (thread) *thread = (pthread_t)pid; - if (!pjoin->started) status = ERROR; + if (thread) + { + *thread = (pthread_t)pid; + } + + if (!pjoin->started) + { + ret = EINVAL; + } sched_unlock(); (void)sem_destroy(&pjoin->data_sem); @@ -428,8 +447,8 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, (void)sem_destroy(&pjoin->exit_sem); sched_releasetcb(ptcb); sched_free(pjoin); - return EIO; + ret = EIO; } - return OK; + return ret; } diff --git a/nuttx/sched/sched_releasetcb.c b/nuttx/sched/sched_releasetcb.c index 21837262d..0557c829b 100644 --- a/nuttx/sched/sched_releasetcb.c +++ b/nuttx/sched/sched_releasetcb.c @@ -171,6 +171,12 @@ int sched_releasetcb(FAR _TCB *tcb) (void)env_release(tcb); + /* Release this thread's reference to the address environment */ + +#ifdef CONFIG_ADDRENV + ret = up_addrenv_release(tcb); +#endif + /* And, finally, release the TCB itself */ sched_free(tcb); -- cgit v1.2.3 From 7eb340179101119bfef9b16c09f919fdeaa8a41e Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 11 Dec 2012 22:51:20 +0000 Subject: Fix some early z180 compile errors git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5430 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z80/include/z180/chip.h | 2 +- nuttx/arch/z80/src/z180/switch.h | 13 ++++++++----- nuttx/arch/z80/src/z180/z180_head.asm | 4 ++-- nuttx/arch/z80/src/z180/z180_irq.c | 8 ++++++++ nuttx/arch/z80/src/z180/z180_mmu.c | 20 ++++++++++++++------ nuttx/arch/z80/src/z180/z180_mmu.h | 16 +++++++--------- nuttx/configs/p112/ostest/defconfig | 4 +++- nuttx/include/debug.h | 25 ++++++++++--------------- nuttx/include/nuttx/compiler.h | 2 +- nuttx/mm/mm_graninit.c | 1 - 10 files changed, 54 insertions(+), 41 deletions(-) (limited to 'nuttx') diff --git a/nuttx/arch/z80/include/z180/chip.h b/nuttx/arch/z80/include/z180/chip.h index 22a3cee37..3844b2800 100644 --- a/nuttx/arch/z80/include/z180/chip.h +++ b/nuttx/arch/z80/include/z180/chip.h @@ -402,7 +402,7 @@ defined(CONFIG_ARCH_CHIP_Z8S18010PSG) || /* 64-pin DIP 10MHz 5V */ \ defined(CONFIG_ARCH_CHIP_Z8S18020FEG) || \ defined(CONFIG_ARCH_CHIP_Z8S18010PEG) || \ - defined(CONFIG_ARCH_CHIP_Z8S18010FEG + defined(CONFIG_ARCH_CHIP_Z8S18010FEG) # define HAVE_Z8S180 1 /* Uses Z8S180 (5V) or Z8L180 (3.3V) core */ # define HAVE ROM 0 /* No on-chip ROM */ diff --git a/nuttx/arch/z80/src/z180/switch.h b/nuttx/arch/z80/src/z180/switch.h index aa33bd1e1..ae80f4f76 100644 --- a/nuttx/arch/z80/src/z180/switch.h +++ b/nuttx/arch/z80/src/z180/switch.h @@ -42,7 +42,9 @@ ************************************************************************************/ #include + #include +#include #include "z180_iomap.h" #include "up_internal.h" @@ -112,13 +114,14 @@ current_regs = savestate; \ if (current_regs) \ { \ - current_cbr = savecbr; \ + current_cbr = savecbr; \ } \ else \ { \ outp(Z180_MMU_CBR, savecbr); \ } \ - } + } \ + while (0) /* The following macro is used to sample the interrupt state (as a opaque handle) */ @@ -135,9 +138,9 @@ #define SET_IRQCONTEXT(tcb) \ do \ { \ - if ((tcb)->xcp.cbr.cbr) \ + if ((tcb)->xcp.cbr) \ { \ - current_cbr = (tcb)->xcp.cbr->cbr); \ + current_cbr = (tcb)->xcp.cbr->cbr; \ } \ z180_copystate((FAR chipreg_t*)current_regs, (tcb)->xcp.regs); \ } \ @@ -157,7 +160,7 @@ #define RESTORE_USERCONTEXT(tcb) \ do \ { \ - if ((tcb)->xcp.cbr.cbr) \ + if ((tcb)->xcp.cbr) \ { \ outp(Z180_MMU_CBR, (tcb)->xcp.cbr->cbr); \ } \ diff --git a/nuttx/arch/z80/src/z180/z180_head.asm b/nuttx/arch/z80/src/z180/z180_head.asm index ddd0283e9..cb370ffda 100644 --- a/nuttx/arch/z80/src/z180/z180_head.asm +++ b/nuttx/arch/z80/src/z180/z180_head.asm @@ -62,7 +62,7 @@ .globl _os_start ; OS entry point .globl _up_doirq ; Interrupt decoding logic - .globl z180_mmu_lowinit ; MMU initialization logic + .globl _z180_mmu_lowinit ; MMU initialization logic ;************************************************************************** ; Reset entry point @@ -172,7 +172,7 @@ _up_reset: ; Configure the MMU so that things will lie at the addresses that we ; expect them to - call z180_mmu_lowinit ; Initialize the MMU + call _z180_mmu_lowinit ; Initialize the MMU ; Performed initialization unique to the SDCC toolchain diff --git a/nuttx/arch/z80/src/z180/z180_irq.c b/nuttx/arch/z80/src/z180/z180_irq.c index 929f38d6a..d5d625b33 100644 --- a/nuttx/arch/z80/src/z180/z180_irq.c +++ b/nuttx/arch/z80/src/z180/z180_irq.c @@ -58,6 +58,14 @@ volatile chipreg_t *current_regs; +/* This holds the value of the MMU's CBR register. This value is set to the + * interrupted tasks's CBR on interrupt entry, changed to the new task's CBR if + * an interrrupt level context switch occurs, and restored on interrupt exit. In + * this way, the CBR is always correct on interrupt exit. + */ + +uint8_t current_cbr; + /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/nuttx/arch/z80/src/z180/z180_mmu.c b/nuttx/arch/z80/src/z180/z180_mmu.c index 076d91bef..e24b22b8e 100644 --- a/nuttx/arch/z80/src/z180/z180_mmu.c +++ b/nuttx/arch/z80/src/z180/z180_mmu.c @@ -41,8 +41,15 @@ #include -#include +#include +#include +#include + +#include +#include + +#include "up_internal.h" #include "z180_mmu.h" /**************************************************************************** @@ -223,7 +230,7 @@ int up_addrenv_create(FAR _TCB *tcb, size_t envsize) { sdbg("ERROR: No free CBR structures\n"); ret = -ENOMEM; - goto errout_with_irq + goto errout_with_irq; } /* Now allocate the physical memory to back up the address environment */ @@ -297,7 +304,7 @@ int up_addrenv_share(FAR const _TCB *ptcb, FAR _TCB *ctcb) * copy in the child thread's TCB. */ - ptcb->xcp.cbr.crefs++; + ptcb->xcp.cbr->crefs++; ctcb->xcp.cbr = ptcb->xcp.cbr; } @@ -333,7 +340,7 @@ FAR void *up_addrenv_instantiate(FAR _TCB *tcb) /* Get the current CBR value from the CBR register */ flags = irqsave(); - cbr = inp(Z180_MMU_CBR); + oldcbr = inp(Z180_MMU_CBR); /* Check if the task has an address environment. */ @@ -341,11 +348,11 @@ FAR void *up_addrenv_instantiate(FAR _TCB *tcb) { /* Yes.. Write the new CBR value into CBR register */ - outp(Z180_MMU_CBR, tcb->xcp.cbr.cbr); + outp(Z180_MMU_CBR, tcb->xcp.cbr->cbr); } irqrestore(flags); - return (FAR void *)cbr; + return (FAR void *)oldcbr; } /**************************************************************************** @@ -368,6 +375,7 @@ int up_addrenv_restore(FAR void *handle) /* Restore the CBR value */ outp(Z180_MMU_CBR, (uint8_t)handle); + return OK; } /**************************************************************************** diff --git a/nuttx/arch/z80/src/z180/z180_mmu.h b/nuttx/arch/z80/src/z180/z180_mmu.h index 74463427a..69ee13cc5 100644 --- a/nuttx/arch/z80/src/z180/z180_mmu.h +++ b/nuttx/arch/z80/src/z180/z180_mmu.h @@ -109,12 +109,10 @@ /* MMU register values */ -#define Z180_CBAR_VALUE \ - ((((CONFIG_Z180_BANKAREA_VIRTBASE >> 12) & 0x0f) << CBAR_BA_SHIFT) \ - (((CONFIG_Z180_COMMON1AREA_VIRTBASE >> 12) & 0x0f) << CBAR_CA_SHIFT)) - -#define Z180_BBR_VALUE \ - ((CONFIG_Z180_BANKAREA_PHYSBASE >> 12) & 0xff) +#define Z180_CBAR_BA_VALUE (((CONFIG_Z180_BANKAREA_VIRTBASE >> 12) & 0x0f) << CBAR_BA_SHIFT) +#define Z180_CBAR_CA_VALUE (((CONFIG_Z180_COMMON1AREA_VIRTBASE >> 12) & 0x0f) << CBAR_CA_SHIFT) +#define Z180_CBAR_VALUE (Z180_CBAR_BA_VALUE | Z180_CBAR_CA_VALUE) +#define Z180_BBR_VALUE ((CONFIG_Z180_BANKAREA_PHYSBASE >> 12) & 0xff) /**************************************************************************** * Public Functions @@ -139,11 +137,11 @@ void z180_mmu_lowinit(void) __naked; * Name: up_mmuinit * * Description: - * Perform higher level initializatin of the MMU and physical memory - * memory management logic. + * Perform higher level initialization of the MMU and physical memory + * memory management logic. More correctly prototypes in up_internal.h. * ****************************************************************************/ -void up_mmuinit(void); +int up_mmuinit(void); #endif /* __ARCH_Z80_SRC_Z180_Z180_MMU_H */ diff --git a/nuttx/configs/p112/ostest/defconfig b/nuttx/configs/p112/ostest/defconfig index 2cdc13ba5..62162f37e 100644 --- a/nuttx/configs/p112/ostest/defconfig +++ b/nuttx/configs/p112/ostest/defconfig @@ -332,7 +332,9 @@ CONFIG_MM_REGIONS=1 CONFIG_ARCH_HAVE_HEAP2=y CONFIG_HEAP2_BASE=0x00000000 CONFIG_HEAP2_SIZE=0 -# CONFIG_GRAN is not set +CONFIG_GRAN=y +CONFIG_GRAN_SINGLE=y +# CONFIG_GRAN_INTR is not set # # Binary Formats diff --git a/nuttx/include/debug.h b/nuttx/include/debug.h index 1f8c7d7ca..aa5efd432 100644 --- a/nuttx/include/debug.h +++ b/nuttx/include/debug.h @@ -571,12 +571,9 @@ * Public Function Prototypes ****************************************************************************/ -#undef EXTERN #if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern +extern "C" +{ #endif /* These low-level debug APIs are provided by the NuttX library. If the @@ -585,21 +582,20 @@ extern "C" { * or the other of the following. */ -EXTERN int lib_rawprintf(FAR const char *format, ...); +int lib_rawprintf(FAR const char *format, ...); #ifdef CONFIG_ARCH_LOWPUTC -EXTERN int lib_lowprintf(FAR const char *format, ...); +int lib_lowprintf(FAR const char *format, ...); #endif /* Dump a buffer of data */ -EXTERN void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer, - unsigned int buflen); +void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer, unsigned int buflen); /* Enable or disable debug output */ #ifdef CONFIG_DEBUG_ENABLE -EXTERN void dbg_enable(bool enable); +void dbg_enable(bool enable); #endif /* If the cross-compiler's pre-processor does not support variable length @@ -608,23 +604,22 @@ EXTERN void dbg_enable(bool enable); #ifndef CONFIG_CPP_HAVE_VARARGS #ifdef CONFIG_DEBUG -EXTERN int dbg(const char *format, ...); +int dbg(const char *format, ...); # ifdef CONFIG_ARCH_LOWPUTC -EXTERN int lldbg(const char *format, ...); +int lldbg(const char *format, ...); # endif # ifdef CONFIG_DEBUG_VERBOSE -EXTERN int vdbg(const char *format, ...); +int vdbg(const char *format, ...); # ifdef CONFIG_ARCH_LOWPUTC -EXTERN int llvdbg(const char *format, ...); +int llvdbg(const char *format, ...); # endif #endif #endif /* CONFIG_DEBUG */ #endif /* CONFIG_CPP_HAVE_VARARGS */ -#undef EXTERN #if defined(__cplusplus) } #endif diff --git a/nuttx/include/nuttx/compiler.h b/nuttx/include/nuttx/compiler.h index f700e539d..091e66765 100644 --- a/nuttx/include/nuttx/compiler.h +++ b/nuttx/include/nuttx/compiler.h @@ -262,7 +262,7 @@ * external RAM. */ -#if defined(__z80) || defined(__gbz80) +#if defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_gbz80) # define FAR # define NEAR # define CODE diff --git a/nuttx/mm/mm_graninit.c b/nuttx/mm/mm_graninit.c index 54b729988..8f811c65f 100644 --- a/nuttx/mm/mm_graninit.c +++ b/nuttx/mm/mm_graninit.c @@ -206,7 +206,6 @@ gran_common_initialize(FAR void *heapstart, size_t heapsize, uint8_t log2gran, #ifdef CONFIG_GRAN_SINGLE int gran_initialize(FAR void *heapstart, size_t heapsize, uint8_t log2gran, uint8_t log2align) -int gran_initialize(FAR void *heapstart, size_t heapsize, uint8_t log2gran) { g_graninfo = gran_common_initialize(heapstart, heapsize, log2gran, log2align); -- cgit v1.2.3 From 092c435c46d11b5ebaae6112a39ef12c9a1965c2 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 12 Dec 2012 00:07:15 +0000 Subject: Fix typo in z80-family Makefiles git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5431 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z80/src/Makefile.sdccl | 2 +- nuttx/arch/z80/src/Makefile.sdccw | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'nuttx') diff --git a/nuttx/arch/z80/src/Makefile.sdccl b/nuttx/arch/z80/src/Makefile.sdccl index cbb3f8656..1ddd8da62 100644 --- a/nuttx/arch/z80/src/Makefile.sdccl +++ b/nuttx/arch/z80/src/Makefile.sdccl @@ -156,7 +156,7 @@ else @echo "-b _CODE=0x0200" >>nuttx.lnk # Start of _CODE area endif ifneq ($(CONFIG_LINKER_DATA_AREA),) - @echo "-b _CODE=$(CONFIG_LINKER_DATA_AREA)" >>nuttx.lnk + @echo "-b _DATA=$(CONFIG_LINKER_DATA_AREA)" >>nuttx.lnk else @echo "-b _DATA=0x8000" >>nuttx.lnk # Start of _DATA area endif diff --git a/nuttx/arch/z80/src/Makefile.sdccw b/nuttx/arch/z80/src/Makefile.sdccw index 372786a87..6d0f17e8a 100644 --- a/nuttx/arch/z80/src/Makefile.sdccw +++ b/nuttx/arch/z80/src/Makefile.sdccw @@ -154,7 +154,7 @@ else @echo -b _CODE=0x0200>>nuttx.lnk endif ifneq ($(CONFIG_LINKER_DATA_AREA),) - @echo -b _CODE=$(CONFIG_LINKER_DATA_AREA)>>nuttx.lnk + @echo -b _DATA=$(CONFIG_LINKER_DATA_AREA)>>nuttx.lnk else @echo -b _DATA=0x8000>>nuttx.lnk endif -- cgit v1.2.3 From a71e9d8104137b52bbb3c81d3ae155eb5c450fc9 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 12 Dec 2012 16:38:50 +0000 Subject: Add z180 interrupt vectors git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5432 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z80/include/z180/irq.h | 100 ++++++++++--- nuttx/arch/z80/src/z180/Make.defs | 8 + nuttx/arch/z80/src/z180/z180_head.asm | 130 ++-------------- nuttx/arch/z80/src/z180/z180_rom.asm | 133 +++-------------- nuttx/arch/z80/src/z180/z180_romvectors.asm | 89 +++++++++++ nuttx/arch/z80/src/z180/z180_vectcommon.asm | 223 ++++++++++++++++++++++++++++ nuttx/arch/z80/src/z180/z180_vectors.asm | 90 +++++++++++ 7 files changed, 520 insertions(+), 253 deletions(-) create mode 100644 nuttx/arch/z80/src/z180/z180_romvectors.asm create mode 100644 nuttx/arch/z80/src/z180/z180_vectcommon.asm create mode 100644 nuttx/arch/z80/src/z180/z180_vectors.asm (limited to 'nuttx') diff --git a/nuttx/arch/z80/include/z180/irq.h b/nuttx/arch/z80/include/z180/irq.h index a72cf4708..6fbeaf5b5 100644 --- a/nuttx/arch/z80/include/z180/irq.h +++ b/nuttx/arch/z80/include/z180/irq.h @@ -54,18 +54,85 @@ ****************************************************************************/ /* Z180 Interrupts */ +/* Resets */ + /* RST 0 is the power-up interrupt vector */ +#define Z180_RST1 (0) /* RST 1 */ +#define Z180_RST2 (1) /* RST 2 */ +#define Z180_RST3 (2) /* RST 3 */ +#define Z180_RST4 (3) /* RST 4 */ +#define Z180_RST5 (4) /* RST 5 */ +#define Z180_RST6 (5) /* RST 6 */ +#define Z180_RST7 (6) /* RST 7 */ + +/* TRAP Interrupt + * + * The Z8X180 generates a non-maskable TRAP interrupt when an undefined Op + * Code fetch occurs. When a TRAP interrupt occurs the Z8X180 operates as + * follows: + * + * 1. The TRAP bit in the Interrupt TRAP/Control (ITC) register is set to 1. + * 2. The current PC (Program Counter) is saved on the stack. + * 3. The Z8X180 vectors to logical address 0 (which may or may not be the + * same as reset which vectors to physical address 0x00000). + * + * The state of the UFO (Undefined Fetch Object) bit in ITC allows TRAP + * manipulation software to correctly adjust the stacked PC, depending on + * whether the second or third byte of the Op Code generated the TRAP. If + * UFO is 0, the starting address of the invalid instruction is equal to + * the stacked PC-1. If UFO is 1, the starting address of the invalid + * instruction is equal to the stacked PC-2. + */ + +#define Z180_TRAP (7) + +/* INT0 + * + * INT0 (only) has 3 different software programmable interrupt response + * modes—Mode 0, Mode 1 and Mode 2. + * + * - INT0 Mode 0. During the interrupt acknowledge cycle, an instruction + * is fetched from the data bus (DO–D7) at the rising edge of T3. + * + * - INT0 Mode 1. The PC is stacked and instruction execution restarts at + * logical address 0x0038. + * + * - INT0 Mode 2. The restart address is obtained by reading the contents + * of a table residing in memory. The vector table consists of up to + * 128 two-byte restart addresses stored in low byte, high byte order. + * + * This is similar to normal vector mode interrupts (like INT1 and 2): + * The 256-bit table address comes from I, however the lower-order 8 + * bits of the vector is fetched from the data bus. + */ + +#define Z180_INT0 (8) + +/* Vector Interrupts + * + * Normal vector interrupts use a vector table with 16 entries (2 bytes + * per entry). Each entry holds the address of the interrupt handler. + * + * The vector table address is determined by 11-bits from the I and IL + * registers. The vector table must be aligned on 32-byte address + * boundaries. + * - Traps vector to logic address 0x0000 which may or may not be the same + * as the RST 0. + * - INT0 +/* Interrupt vectors (offsets) for Z180 internal interrupts */ -#define Z180_RST0 (0) -#define Z180_RST1 (1) -#define Z180_RST2 (2) -#define Z180_RST3 (3) -#define Z180_RST4 (4) -#define Z180_RST5 (5) -#define Z180_RST6 (6) -#define Z180_RST7 (7) +#define Z180_INT1 (9) /* Vector offset 0: External /INT1 */ +#define Z180_INT2 (10) /* Vector offset 2: External /INT2 */ +#define Z180_PRT0 (11) /* Vector offset 4: PRT channel 0 */ +#define Z180_PRT1 (12) /* Vector offset 6: PRT channel 1 */ +#define Z180_DMA0 (13) /* Vector offset 8: DMA channel 0 */ +#define Z180_DMA1 (14) /* Vector offset 10: DMA Channel 1 */ +#define Z180_CSIO (15) /* Vector offset 12: Clocked serial I/O */ +#define Z180_ASCI0 (16) /* Vector offset 14: Async channel 0 */ +#define Z180_ASCI1 (18) /* Vector offset 16: Async channel 1 */ +#define Z180_UNUSED (19) /* Vector offset 18-20: unused */ #define Z180_IRQ_SYSTIMER Z180_RST7 -#define NR_IRQS (8) +#define NR_IRQS (20) /* IRQ Stack Frame Format * @@ -86,21 +153,6 @@ #define XCPTCONTEXT_REGS (9) #define XCPTCONTEXT_SIZE (2 * XCPTCONTEXT_REGS) -/* Interrupt vectors (offsets) for Z180 internal interrupts */ - -#define Z180_INT1_VECTOR 0x00 /* External /INT1 */ -#define Z180_INT2_VECTOR 0x02 /* External /INT2 */ -#define Z180_PRT0_VECTOR 0x04 /* PRT channel 0 */ -#define Z180_PRT1_VECTOR 0x06 /* PRT channel 1 */ -#define Z180_DMA0_VECTOR 0x08 /* DMA channel 0 */ -#define Z180_DMA1_VECTOR 0x0a /* DMA Channel 1 */ -#define Z180_CSIO_VECTOR 0x0c /* Clocked serial I/O */ -#define Z180_ASCI0_VECTOR 0x0e /* Async channel 0 */ -#define Z180_ASCI1_VECTOR 0x10 /* Async channel 1 */ -#define Z180_INCAP_VECTOR 0x12 /* Input capture */ -#define Z180_OUTCMP_VECTOR 0x14 /* Output compare */ -#define Z180_TIMOV_VECTOR 0x16 /* Timer overflow */ - /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/nuttx/arch/z80/src/z180/Make.defs b/nuttx/arch/z80/src/z180/Make.defs index 069f36204..f196c45d7 100644 --- a/nuttx/arch/z80/src/z180/Make.defs +++ b/nuttx/arch/z80/src/z180/Make.defs @@ -49,6 +49,14 @@ CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_unblocktask.c CMN_CSRCS += up_udelay.c up_usestack.c CHIP_ASRCS = z180_restoreusercontext.asm z180_saveusercontext.asm +CHIP_ASRCS += z180_vectcommon.asm + +ifeq ($(CONFIG_LINKER_ROM_AT_0000),y) +CHIP_ASRCS += z180_romvectors.asm +else +CHIP_ASRCS += z180_vectors.asm +endif + CHIP_CSRCS = z180_copystate.c z180_initialstate.c z180_io.c z180_irq.c CHIP_CSRCS += z180_mmu.c z180_registerdump.c z180_schedulesigaction.c CHIP_CSRCS += z180_sigdeliver.c diff --git a/nuttx/arch/z80/src/z180/z180_head.asm b/nuttx/arch/z80/src/z180/z180_head.asm index cb370ffda..2ecbefe24 100644 --- a/nuttx/arch/z80/src/z180/z180_head.asm +++ b/nuttx/arch/z80/src/z180/z180_head.asm @@ -40,18 +40,6 @@ ; Constants ;************************************************************************** - ; Register save area layout - - XCPT_I == 0 ; Offset 0: Saved I w/interrupt state in carry - XCPT_BC == 2 ; Offset 1: Saved BC register - XCPT_DE == 4 ; Offset 2: Saved DE register - XCPT_IX == 6 ; Offset 3: Saved IX register - XCPT_IY == 8 ; Offset 4: Saved IY register - XCPT_SP == 10 ; Offset 5: Offset to SP at time of interrupt - XCPT_HL == 12 ; Offset 6: Saved HL register - XCPT_AF == 14 ; Offset 7: Saved AF register - XCPT_PC == 16 ; Offset 8: Offset to PC at time of interrupt - ; Default stack base (needs to be fixed) .include "asm_mem.h" @@ -61,8 +49,9 @@ ;************************************************************************** .globl _os_start ; OS entry point - .globl _up_doirq ; Interrupt decoding logic + .globl _up_vectcommon ; Common interrupt handling logic .globl _z180_mmu_lowinit ; MMU initialization logic + .globl s__HEAP ; Start of the heap ;************************************************************************** ; Reset entry point @@ -77,16 +66,6 @@ ;************************************************************************** ; Other reset handlers -; -; Interrupt mode 1 behavior: -; -; 1. M1 cycle: 7 ticks -; Acknowledge interrupt and decrements SP -; 2. M2 cycle: 3 ticks -; Writes the MS byte of the PC onto the stack and decrements SP -; 3. M3 cycle: 3 ticks -; Writes the LS byte of the PC onto the stack and sets the PC to 0x0038. -; ;************************************************************************** .org 0x0008 ; RST 1 @@ -95,8 +74,8 @@ ; common reset handling logic. ; Offset 8: Return PC is already on the stack push af ; Offset 7: AF (retaining flags) - ld a, #1 ; 1 = Z180_RST1 - jr _up_rstcommon ; Remaining RST handling is common + ld a, #0 ; 0 = Z180_RST1 + jp _up_vectcommon ; Remaining RST handling is common .org 0x0010 ; RST 2 @@ -104,8 +83,8 @@ ; common reset handling logic. ; Offset 8: Return PC is already on the stack push af ; Offset 7: AF (retaining flags) - ld a, #2 ; 2 = Z180_RST2 - jr _up_rstcommon ; Remaining RST handling is common + ld a, #1 ; 1 = Z180_RST2 + jp _up_vectcommon ; Remaining RST handling is common .org 0x0018 ; RST 3 @@ -113,8 +92,8 @@ ; common reset handling logic. ; Offset 8: Return PC is already on the stack push af ; Offset 7: AF (retaining flags) - ld a, #3 ; 1 = Z180_RST3 - jr _up_rstcommon ; Remaining RST handling is common + ld a, #2 ; 2 = Z180_RST3 + jp _up_vectcommon ; Remaining RST handling is common .org 0x0020 ; RST 4 @@ -122,8 +101,8 @@ ; common reset handling logic. ; Offset 8: Return PC is already on the stack push af ; Offset 7: AF (retaining flags) - ld a, #4 ; 1 = Z180_RST4 - jr _up_rstcommon ; Remaining RST handling is common + ld a, #3 ; 3 = Z180_RST4 + jp _up_vectcommon ; Remaining RST handling is common .org 0x0028 ; RST 5 @@ -131,8 +110,8 @@ ; common reset handling logic. ; Offset 8: Return PC is already on the stack push af ; Offset 7: AF (retaining flags) - ld a, #5 ; 1 = Z180_RST5 - jr _up_rstcommon ; Remaining RST handling is common + ld a, #4 ; 4 = Z180_RST5 + jp _up_vectcommon ; Remaining RST handling is common .org 0x0030 ; RST 6 @@ -140,8 +119,8 @@ ; common reset handling logic. ; Offset 8: Return PC is already on the stack push af ; Offset 7: AF (retaining flags) - ld a, #6 ; 1 = Z180_RST6 - jr _up_rstcommon ; Remaining RST handling is common + ld a, #5 ; 5 = Z180_RST6 + jp _up_vectcommon ; Remaining RST handling is common .org 0x0038 ; Int mode 1 / RST 7 @@ -149,8 +128,8 @@ ; common reset handling logic. ; Offset 8: Return PC is already on the stack push af ; Offset 7: AF (retaining flags) - ld a, #7 ; 7 = Z180_RST7 - jr _up_rstcommon ; Remaining RST handling is common + ld a, #6 ; 6 = Z180_RST7 + jp _up_vectcommon ; Remaining RST handling is common ;************************************************************************** ; NMI interrupt handler @@ -188,83 +167,6 @@ _up_halt:: halt ; We should never get here jp _up_halt -;************************************************************************** -; Common Interrupt handler -;************************************************************************** - -_up_rstcommon:: - ; Create a register frame. SP points to top of frame + 4, pushes - ; decrement the stack pointer. Already have - ; - ; Offset 8: Return PC is already on the stack - ; Offset 7: AF (retaining flags) - ; - ; IRQ number is in A - - push hl ; Offset 6: HL - ld hl, #(3*2) ; HL is the value of the stack pointer before - add hl, sp ; the interrupt occurred - push hl ; Offset 5: Stack pointer - push iy ; Offset 4: IY - push ix ; Offset 3: IX - push de ; Offset 2: DE - push bc ; Offset 1: BC - - ld b, a ; Save the reset number in B - ld a, i ; Parity bit holds interrupt state - push af ; Offset 0: I with interrupt state in parity - di - - ; Call the interrupt decode logic. SP points to the beginning of the reg structure - - ld hl, #0 ; Argument #2 is the beginning of the reg structure - add hl, sp ; - push hl ; Place argument #2 at the top of stack - push bc ; Argument #1 is the Reset number - inc sp ; (make byte sized) - call _up_doirq ; Decode the IRQ - - ; On return, HL points to the beginning of the reg structure to restore - ; Note that (1) the arguments pushed on the stack are not popped, and (2) the - ; original stack pointer is lost. In the normal case (no context switch), - ; HL will contain the value of the SP before the arguments were pushed. - - ld sp, hl ; Use the new stack pointer - - ; Restore registers. HL points to the beginning of the reg structure to restore - - ex af, af' ; Select alternate AF - pop af ; Offset 0: AF' = I with interrupt state in carry - ex af, af' ; Restore original AF - pop bc ; Offset 1: BC - pop de ; Offset 2: DE - pop ix ; Offset 3: IX - pop iy ; Offset 4: IY - exx ; Use alternate BC/DE/HL - ld hl, #-2 ; Offset of SP to account for ret addr on stack - pop de ; Offset 5: HL' = Stack pointer after return - add hl, de ; HL = Stack pointer value before return - exx ; Restore original BC/DE/HL - pop hl ; Offset 6: HL - pop af ; Offset 7: AF - - ; Restore the stack pointer - - exx ; Use alternate BC/DE/HL - ld sp, hl ; Set SP = saved stack pointer value before return - exx ; Restore original BC/DE/HL - - ; Restore interrupt state - - ex af, af' ; Recover interrupt state - jp po, nointenable ; Odd parity, IFF2=0, means disabled - ex af, af' ; Restore AF (before enabling interrupts) - ei ; yes - reti -nointenable:: - ex af, af' ; Restore AF - reti - ;************************************************************************** ; Ordering of segments for the linker (SDCC only) ;************************************************************************** diff --git a/nuttx/arch/z80/src/z180/z180_rom.asm b/nuttx/arch/z80/src/z180/z180_rom.asm index c27574f4e..8a7a62a54 100644 --- a/nuttx/arch/z80/src/z180/z180_rom.asm +++ b/nuttx/arch/z80/src/z180/z180_rom.asm @@ -40,18 +40,6 @@ ; Constants ;************************************************************************** - ; Register save area layout - - XCPT_I == 0 ; Offset 0: Saved I w/interrupt state in carry - XCPT_BC == 2 ; Offset 1: Saved BC register - XCPT_DE == 4 ; Offset 2: Saved DE register - XCPT_IX == 6 ; Offset 3: Saved IX register - XCPT_IY == 8 ; Offset 4: Saved IY register - XCPT_SP == 10 ; Offset 5: Offset to SP at time of interrupt - XCPT_HL == 12 ; Offset 6: Saved HL register - XCPT_AF == 14 ; Offset 7: Saved AF register - XCPT_PC == 16 ; Offset 8: Offset to PC at time of interrupt - ; Default stack base (needs to be fixed) .include "asm_mem.h" @@ -60,8 +48,10 @@ ; Global symbols used ;************************************************************************** - .globl _os_start ; OS entry point - .globl _up_doirq ; Interrupt decoding logic + .globl _os_start ; OS entry point + .globl _up_vectcommon ; Common interrupt handling logic + .globl _z180_mmu_lowinit ; MMU initialization logic + .globl s__HEAP ; Start of the heap ;************************************************************************** ; System start logic @@ -107,16 +97,6 @@ _up_rstvectors: ;************************************************************************** ; Other reset handlers -; -; Interrupt mode 1 behavior: -; -; 1. M1 cycle: 7 ticks -; Acknowledge interrupt and decrements SP -; 2. M2 cycle: 3 ticks -; Writes the MS byte of the PC onto the stack and decrements SP -; 3. M3 cycle: 3 ticks -; Writes the LS byte of the PC onto the stack and sets the PC to 0x0038. -; ;************************************************************************** _up_rst1: ; RST 1 @@ -124,133 +104,56 @@ _up_rst1: ; RST 1 ; common reset handling logic. ; Offset 8: Return PC is already on the stack push af ; Offset 7: AF (retaining flags) - ld a, #1 ; 1 = Z180_RST1 - jr _up_rstcommon ; Remaining RST handling is common + ld a, #0 ; 0 = Z180_RST1 + jp _up_vectcommon ; Remaining RST handling is common _up_rst2: ; RST 2 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack push af ; Offset 7: AF (retaining flags) - ld a, #2 ; 2 = Z180_RST2 - jr _up_rstcommon ; Remaining RST handling is common + ld a, #1 ; 1 = Z180_RST2 + jp _up_vectcommon ; Remaining RST handling is common _up_rst3: ; RST 3 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack push af ; Offset 7: AF (retaining flags) - ld a, #3 ; 1 = Z180_RST3 - jr _up_rstcommon ; Remaining RST handling is common + ld a, #2 ; 2 = Z180_RST3 + jp _up_vectcommon ; Remaining RST handling is common _up_rst4: ; RST 4 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack push af ; Offset 7: AF (retaining flags) - ld a, #4 ; 1 = Z180_RST4 - jr _up_rstcommon ; Remaining RST handling is common + ld a, #3 ; 3 = Z180_RST4 + jp _up_vectcommon ; Remaining RST handling is common _up_rst5: ; RST 5 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack push af ; Offset 7: AF (retaining flags) - ld a, #5 ; 1 = Z180_RST5 - jr _up_rstcommon ; Remaining RST handling is common + ld a, #4 ; 4 = Z180_RST5 + jp _up_vectcommon ; Remaining RST handling is common _up_rst6: ; RST 6 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack push af ; Offset 7: AF (retaining flags) - ld a, #6 ; 1 = Z180_RST6 - jr _up_rstcommon ; Remaining RST handling is common + ld a, #5 ; 5 = Z180_RST6 + jp _up_vectcommon ; Remaining RST handling is common _up_rst7: ; RST 7 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack push af ; Offset 7: AF (retaining flags) - ld a, #7 ; 7 = Z180_RST7 - jr _up_rstcommon ; Remaining RST handling is common - -;************************************************************************** -; Common Interrupt handler -;************************************************************************** - -_up_rstcommon: - ; Create a register frame. SP points to top of frame + 4, pushes - ; decrement the stack pointer. Already have - ; - ; Offset 8: Return PC is already on the stack - ; Offset 7: AF (retaining flags) - ; - ; IRQ number is in A - - push hl ; Offset 6: HL - ld hl, #(3*2) ; HL is the value of the stack pointer before - add hl, sp ; the interrupt occurred - push hl ; Offset 5: Stack pointer - push iy ; Offset 4: IY - push ix ; Offset 3: IX - push de ; Offset 2: DE - push bc ; Offset 1: BC - - ld b, a ; Save the reset number in B - ld a, i ; Parity bit holds interrupt state - push af ; Offset 0: I with interrupt state in parity - di - - ; Call the interrupt decode logic. SP points to the beginning of the reg structure - - ld hl, #0 ; Argument #2 is the beginning of the reg structure - add hl, sp ; - push hl ; Place argument #2 at the top of stack - push bc ; Argument #1 is the Reset number - inc sp ; (make byte sized) - call _up_doirq ; Decode the IRQ - - ; On return, HL points to the beginning of the reg structure to restore - ; Note that (1) the arguments pushed on the stack are not popped, and (2) the - ; original stack pointer is lost. In the normal case (no context switch), - ; HL will contain the value of the SP before the arguments were pushed. - - ld sp, hl ; Use the new stack pointer - - ; Restore registers. HL points to the beginning of the reg structure to restore - - ex af, af' ; Select alternate AF - pop af ; Offset 0: AF' = I with interrupt state in carry - ex af, af' ; Restore original AF - pop bc ; Offset 1: BC - pop de ; Offset 2: DE - pop ix ; Offset 3: IX - pop iy ; Offset 4: IY - exx ; Use alternate BC/DE/HL - ld hl, #-2 ; Offset of SP to account for ret addr on stack - pop de ; Offset 5: HL' = Stack pointer after return - add hl, de ; HL = Stack pointer value before return - exx ; Restore original BC/DE/HL - pop hl ; Offset 6: HL - pop af ; Offset 7: AF - - ; Restore the stack pointer - - exx ; Use alternate BC/DE/HL - ld sp, hl ; Set SP = saved stack pointer value before return - exx ; Restore original BC/DE/HL - - ; Restore interrupt state - - ex af, af' ; Recover interrupt state - jp po, nointenable ; Odd parity, IFF2=0, means disabled - ex af, af' ; Restore AF (before enabling interrupts) - ei ; yes - reti -nointenable:: - ex af, af' ; Restore AF - reti + ld a, #6 ; 6 = Z180_RST7 + jp _up_vectcommon ; Remaining RST handling is common ;************************************************************************** ; Ordering of segments for the linker (SDCC only) diff --git a/nuttx/arch/z80/src/z180/z180_romvectors.asm b/nuttx/arch/z80/src/z180/z180_romvectors.asm new file mode 100644 index 000000000..2871be2bb --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_romvectors.asm @@ -0,0 +1,89 @@ +;************************************************************************** +; arch/z80/src/z180/z180_romvectors.asm +; +; Copyright (C) 2012 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. +; +;************************************************************************** + + .title NuttX for the Z180 + .module z180_romvectors + +;************************************************************************** +; Constants +;************************************************************************** + +;************************************************************************** +; Global symbols used +;************************************************************************** + + .globl _up_int1 ; Vector offset 0: External /INT1 + .globl _up_int2 ; Vector offset 2: External /INT2 + .globl _up_prt0 ; Vector offset 4: PRT channel 0 + .globl _up_prt1 ; Vector offset 6: PRT channel 1 + .globl _up_dma0 ; Vector offset 8: DMA channel 0 + .globl _up_dma1 ; Vector offset 8: DMA channel 1 + .globl _up_csio ; Vector offset 12: Clocked serial I/O + .globl _up_asci0 ; Vector offset 14: Async channel 0 + .globl _up_asci1 ; Vector offset 16: Async channel 1 + .globl _up_unused ; Vector offset 18: Unused + .globl _up_unused ; Vector offset 20: Unused + .globl _up_unused ; Vector offset 22: Unused + .globl _up_unused ; Vector offset 24: Unused + .globl _up_unused ; Vector offset 26: Unused + .globl _up_unused ; Vector offset 28: Unused + .globl _up_unused ; Vector offset 30: Unused + +;************************************************************************** +; Interrupt Vector Table +;************************************************************************** + +; The start of the _VECTORS area must be set by the linker to lie at some +; 32-byte-aligned address + + .area _VECTORS + +_up_vectors:: + .dw up_int1 ; Vector offset 0: External /INT1 + .dw up_int2 ; Vector offset 2: External /INT2 + .dw up_prt0 ; Vector offset 4: PRT channel 0 + .dw up_prt1 ; Vector offset 6: PRT channel 1 + .dw up_dma0 ; Vector offset 8: DMA channel 0 + .dw up_dma1 ; Vector offset 8: DMA channel 1 + .dw up_csio ; Vector offset 12: Clocked serial I/O + .dw up_asci0 ; Vector offset 14: Async channel 0 + .dw up_asci1 ; Vector offset 16: Async channel 1 + .dw up_unused ; Vector offset 18: Unused + .dw up_unused ; Vector offset 20: Unused + .dw up_unused ; Vector offset 22: Unused + .dw up_unused ; Vector offset 24: Unused + .dw up_unused ; Vector offset 26: Unused + .dw up_unused ; Vector offset 28: Unused + .dw up_unused ; Vector offset 30: Unused \ No newline at end of file diff --git a/nuttx/arch/z80/src/z180/z180_vectcommon.asm b/nuttx/arch/z80/src/z180/z180_vectcommon.asm new file mode 100644 index 000000000..300ad2f31 --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_vectcommon.asm @@ -0,0 +1,223 @@ +;************************************************************************** +; arch/z80/src/z180/z180_vectcommon.asm +; +; Copyright (C) 2012 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. +; +;************************************************************************** + + .title NuttX for the Z180 + .module z180_vectcommon + +;************************************************************************** +; Constants +;************************************************************************** + + ; Register save area layout + + XCPT_I == 0 ; Offset 0: Saved I w/interrupt state in carry + XCPT_BC == 2 ; Offset 1: Saved BC register + XCPT_DE == 4 ; Offset 2: Saved DE register + XCPT_IX == 6 ; Offset 3: Saved IX register + XCPT_IY == 8 ; Offset 4: Saved IY register + XCPT_SP == 10 ; Offset 5: Offset to SP at time of interrupt + XCPT_HL == 12 ; Offset 6: Saved HL register + XCPT_AF == 14 ; Offset 7: Saved AF register + XCPT_PC == 16 ; Offset 8: Offset to PC at time of interrupt + +;************************************************************************** +; Global symbols used +;************************************************************************** + + .globl _up_doirq ; Interrupt decoding logic + + +;************************************************************************** +; Vector Handlers +;************************************************************************** + + .area _CODE + +up_int1:: ; Vector offset 0: External /INT1 + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #9 ; 9 = Z180_INT1 + jr _up_vectcommon ; Remaining RST handling is common + +up_int2:: ; Vector offset 2: External /INT2 + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #10 ; 10 = Z180_INT2 + jr _up_vectcommon ; Remaining RST handling is common + +up_prt0:: ; Vector offset 4: PRT channel 0 + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #11 ; 11 = Z180_PRT0 + jr _up_vectcommon ; Remaining RST handling is common + +up_prt1:: ; Vector offset 6: PRT channel 1 + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #12 ; 12 = Z180_PRT1 + jr _up_vectcommon ; Remaining RST handling is common + +up_dma0:: ; Vector offset 8: DMA channel 0 + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #13 ; 13 = Z180_DMA0 + jr _up_vectcommon ; Remaining RST handling is common + +up_dma1:: ; Vector offset 8: DMA channel 1 + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #14 ; 14 = Z180_DMA1 + jr _up_vectcommon ; Remaining RST handling is common + +up_csio:: ; Vector offset 12: Clocked serial I/O + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #15 ; 15 = Z180_CSIO + jr _up_vectcommon ; Remaining RST handling is common + +up_asci0:: ; Vector offset 14: Async channel 0 + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #16 ; 16 = Z180_ASCI0 + jr _up_vectcommon ; Remaining RST handling is common + +up_asci1:: ; Vector offset 16: Async channel 1 + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #17 ; 17 = Z180_ASCI1 + jr _up_vectcommon ; Remaining RST handling is common + +up_unused:: ; Vector offset 18: Unused + ; Save AF on the stack, set the interrupt number and jump to the + ; common reset handling logic. + ; Offset 8: Return PC is already on the stack + push af ; Offset 7: AF (retaining flags) + ld a, #18 ; 18 = Z180_UNUSED + jr _up_vectcommon ; Remaining RST handling is common + +;************************************************************************** +; Common Interrupt handler +;************************************************************************** + +_up_vectcommon:: + ; Create a register frame. SP points to top of frame + 4, pushes + ; decrement the stack pointer. Already have + ; + ; Offset 8: Return PC is already on the stack + ; Offset 7: AF (retaining flags) + ; + ; IRQ number is in A + + push hl ; Offset 6: HL + ld hl, #(3*2) ; HL is the value of the stack pointer before + add hl, sp ; the interrupt occurred + push hl ; Offset 5: Stack pointer + push iy ; Offset 4: IY + push ix ; Offset 3: IX + push de ; Offset 2: DE + push bc ; Offset 1: BC + + ld b, a ; Save the reset number in B + ld a, i ; Parity bit holds interrupt state + push af ; Offset 0: I with interrupt state in parity + di + + ; Call the interrupt decode logic. SP points to the beginning of the reg structure + + ld hl, #0 ; Argument #2 is the beginning of the reg structure + add hl, sp ; + push hl ; Place argument #2 at the top of stack + push bc ; Argument #1 is the Reset number + inc sp ; (make byte sized) + call _up_doirq ; Decode the IRQ + + ; On return, HL points to the beginning of the reg structure to restore + ; Note that (1) the arguments pushed on the stack are not popped, and (2) the + ; original stack pointer is lost. In the normal case (no context switch), + ; HL will contain the value of the SP before the arguments were pushed. + + ld sp, hl ; Use the new stack pointer + + ; Restore registers. HL points to the beginning of the reg structure to restore + + ex af, af' ; Select alternate AF + pop af ; Offset 0: AF' = I with interrupt state in carry + ex af, af' ; Restore original AF + pop bc ; Offset 1: BC + pop de ; Offset 2: DE + pop ix ; Offset 3: IX + pop iy ; Offset 4: IY + exx ; Use alternate BC/DE/HL + ld hl, #-2 ; Offset of SP to account for ret addr on stack + pop de ; Offset 5: HL' = Stack pointer after return + add hl, de ; HL = Stack pointer value before return + exx ; Restore original BC/DE/HL + pop hl ; Offset 6: HL + pop af ; Offset 7: AF + + ; Restore the stack pointer + + exx ; Use alternate BC/DE/HL + ld sp, hl ; Set SP = saved stack pointer value before return + exx ; Restore original BC/DE/HL + + ; Restore interrupt state + + ex af, af' ; Recover interrupt state + jp po, nointenable ; Odd parity, IFF2=0, means disabled + ex af, af' ; Restore AF (before enabling interrupts) + ei ; yes + reti +nointenable:: + ex af, af' ; Restore AF + reti diff --git a/nuttx/arch/z80/src/z180/z180_vectors.asm b/nuttx/arch/z80/src/z180/z180_vectors.asm new file mode 100644 index 000000000..cd544b926 --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_vectors.asm @@ -0,0 +1,90 @@ +;************************************************************************** +; arch/z80/src/z180/z180_vectors.asm +; +; Copyright (C) 2012 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. +; +;************************************************************************** + + .title NuttX for the Z180 + .module z180_vectors + +;************************************************************************** +; Constants +;************************************************************************** + +;************************************************************************** +; Global symbols used +;************************************************************************** + + .globl _up_int1 ; Vector offset 0: External /INT1 + .globl _up_int2 ; Vector offset 2: External /INT2 + .globl _up_prt0 ; Vector offset 4: PRT channel 0 + .globl _up_prt1 ; Vector offset 6: PRT channel 1 + .globl _up_dma0 ; Vector offset 8: DMA channel 0 + .globl _up_dma1 ; Vector offset 8: DMA channel 1 + .globl _up_csio ; Vector offset 12: Clocked serial I/O + .globl _up_asci0 ; Vector offset 14: Async channel 0 + .globl _up_asci1 ; Vector offset 16: Async channel 1 + .globl _up_unused ; Vector offset 18: Unused + .globl _up_unused ; Vector offset 20: Unused + .globl _up_unused ; Vector offset 22: Unused + .globl _up_unused ; Vector offset 24: Unused + .globl _up_unused ; Vector offset 26: Unused + .globl _up_unused ; Vector offset 28: Unused + .globl _up_unused ; Vector offset 30: Unused + +;************************************************************************** +; Interrupt Vector Table +;************************************************************************** + +; The Vector Table is located at address 0x0040, between the RST vectors +; and the NMI vector + + .area _VECTORS (ABS) + .org 0x0040 + +_up_vectors:: + .dw up_int1 ; Vector offset 0: External /INT1 + .dw up_int2 ; Vector offset 2: External /INT2 + .dw up_prt0 ; Vector offset 4: PRT channel 0 + .dw up_prt1 ; Vector offset 6: PRT channel 1 + .dw up_dma0 ; Vector offset 8: DMA channel 0 + .dw up_dma1 ; Vector offset 8: DMA channel 1 + .dw up_csio ; Vector offset 12: Clocked serial I/O + .dw up_asci0 ; Vector offset 14: Async channel 0 + .dw up_asci1 ; Vector offset 16: Async channel 1 + .dw up_unused ; Vector offset 18: Unused + .dw up_unused ; Vector offset 20: Unused + .dw up_unused ; Vector offset 22: Unused + .dw up_unused ; Vector offset 24: Unused + .dw up_unused ; Vector offset 26: Unused + .dw up_unused ; Vector offset 28: Unused + .dw up_unused ; Vector offset 30: Unused \ No newline at end of file -- cgit v1.2.3 From e9e7bacfa20e2756fa13bee1067beb77ae543578 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 12 Dec 2012 17:06:47 +0000 Subject: Add z180 interrupt initialization logic git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5433 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z80/include/z180/irq.h | 6 +-- nuttx/arch/z80/src/z180/z180_irq.c | 64 ++++++++++++++++++++++++++++- nuttx/arch/z80/src/z180/z180_romvectors.asm | 38 ++++++++--------- nuttx/arch/z80/src/z180/z180_vectcommon.asm | 21 +++++----- nuttx/arch/z80/src/z180/z180_vectors.asm | 38 ++++++++--------- 5 files changed, 106 insertions(+), 61 deletions(-) (limited to 'nuttx') diff --git a/nuttx/arch/z80/include/z180/irq.h b/nuttx/arch/z80/include/z180/irq.h index 6fbeaf5b5..1d0c27cb4 100644 --- a/nuttx/arch/z80/include/z180/irq.h +++ b/nuttx/arch/z80/include/z180/irq.h @@ -111,14 +111,10 @@ * * Normal vector interrupts use a vector table with 16 entries (2 bytes * per entry). Each entry holds the address of the interrupt handler. - * * The vector table address is determined by 11-bits from the I and IL * registers. The vector table must be aligned on 32-byte address * boundaries. - * - Traps vector to logic address 0x0000 which may or may not be the same - * as the RST 0. - * - INT0 -/* Interrupt vectors (offsets) for Z180 internal interrupts */ + */ #define Z180_INT1 (9) /* Vector offset 0: External /INT1 */ #define Z180_INT2 (10) /* Vector offset 2: External /INT2 */ diff --git a/nuttx/arch/z80/src/z180/z180_irq.c b/nuttx/arch/z80/src/z180/z180_irq.c index d5d625b33..96a691c4c 100644 --- a/nuttx/arch/z80/src/z180/z180_irq.c +++ b/nuttx/arch/z80/src/z180/z180_irq.c @@ -38,10 +38,16 @@ ****************************************************************************/ #include + +#include + #include #include -#include "chip/switch.h" +#include + +#include "switch.h" +#include "z180_iomap.h" #include "up_internal.h" /**************************************************************************** @@ -66,6 +72,12 @@ volatile chipreg_t *current_regs; uint8_t current_cbr; +/* The interrupt vector table is exported by z180_vectors.asm or + * z180_romvectors.asm with the name up_vectors: + */ + +extern uintptr_t up_vectors[16]; + /**************************************************************************** * Private Data ****************************************************************************/ @@ -74,6 +86,22 @@ uint8_t current_cbr; * Private Functions ****************************************************************************/ +/**************************************************************************** + * Name: z180_seti + * + * Description: + * Input byte from port p + * + ****************************************************************************/ + +static void z180_seti(uint8_t value) __naked +{ + __asm + ld a, 4(ix) ;value + ld l, a + __endasm; +} + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -119,3 +147,37 @@ statedisable: ret ; and return __endasm; } + +/**************************************************************************** + * Name: up_irqinitialize + * + * Description: + * Initialize and enable interrupts + * + ****************************************************************************/ + +void up_irqinitialize(void) +{ + uint16_t vectaddr = (uint16_t)up_vectors; + uint8_t regval; + + /* Initialize the I and IL registers so that the interrupt vector table + * is used. + */ + + regval = (uint8_t)(vectaddr >> 8); + z180_seti(regval); + + regval = (uint8_t)(vectaddr & IL_MASK); + outp(Z180_INT_IL, regval); + + /* Disable external interrupts */ + + outp(Z180_INT_ITC, 0); + + /* And finally, enable interrupts (including the timer) */ + +#ifndef CONFIG_SUPPRESS_INTERRUPTS + irqrestore(Z180_C_FLAG); +#endif +} diff --git a/nuttx/arch/z80/src/z180/z180_romvectors.asm b/nuttx/arch/z80/src/z180/z180_romvectors.asm index 2871be2bb..b4ca907cb 100644 --- a/nuttx/arch/z80/src/z180/z180_romvectors.asm +++ b/nuttx/arch/z80/src/z180/z180_romvectors.asm @@ -54,12 +54,6 @@ .globl _up_asci0 ; Vector offset 14: Async channel 0 .globl _up_asci1 ; Vector offset 16: Async channel 1 .globl _up_unused ; Vector offset 18: Unused - .globl _up_unused ; Vector offset 20: Unused - .globl _up_unused ; Vector offset 22: Unused - .globl _up_unused ; Vector offset 24: Unused - .globl _up_unused ; Vector offset 26: Unused - .globl _up_unused ; Vector offset 28: Unused - .globl _up_unused ; Vector offset 30: Unused ;************************************************************************** ; Interrupt Vector Table @@ -71,19 +65,19 @@ .area _VECTORS _up_vectors:: - .dw up_int1 ; Vector offset 0: External /INT1 - .dw up_int2 ; Vector offset 2: External /INT2 - .dw up_prt0 ; Vector offset 4: PRT channel 0 - .dw up_prt1 ; Vector offset 6: PRT channel 1 - .dw up_dma0 ; Vector offset 8: DMA channel 0 - .dw up_dma1 ; Vector offset 8: DMA channel 1 - .dw up_csio ; Vector offset 12: Clocked serial I/O - .dw up_asci0 ; Vector offset 14: Async channel 0 - .dw up_asci1 ; Vector offset 16: Async channel 1 - .dw up_unused ; Vector offset 18: Unused - .dw up_unused ; Vector offset 20: Unused - .dw up_unused ; Vector offset 22: Unused - .dw up_unused ; Vector offset 24: Unused - .dw up_unused ; Vector offset 26: Unused - .dw up_unused ; Vector offset 28: Unused - .dw up_unused ; Vector offset 30: Unused \ No newline at end of file + .dw _up_int1 ; Vector offset 0: External /INT1 + .dw _up_int2 ; Vector offset 2: External /INT2 + .dw _up_prt0 ; Vector offset 4: PRT channel 0 + .dw _up_prt1 ; Vector offset 6: PRT channel 1 + .dw _up_dma0 ; Vector offset 8: DMA channel 0 + .dw _up_dma1 ; Vector offset 8: DMA channel 1 + .dw _up_csio ; Vector offset 12: Clocked serial I/O + .dw _up_asci0 ; Vector offset 14: Async channel 0 + .dw _up_asci1 ; Vector offset 16: Async channel 1 + .dw _up_unused ; Vector offset 18: Unused + .dw _up_unused ; Vector offset 20: Unused + .dw _up_unused ; Vector offset 22: Unused + .dw _up_unused ; Vector offset 24: Unused + .dw _up_unused ; Vector offset 26: Unused + .dw _up_unused ; Vector offset 28: Unused + .dw _up_unused ; Vector offset 30: Unused diff --git a/nuttx/arch/z80/src/z180/z180_vectcommon.asm b/nuttx/arch/z80/src/z180/z180_vectcommon.asm index 300ad2f31..c7d9a608a 100644 --- a/nuttx/arch/z80/src/z180/z180_vectcommon.asm +++ b/nuttx/arch/z80/src/z180/z180_vectcommon.asm @@ -58,14 +58,13 @@ .globl _up_doirq ; Interrupt decoding logic - ;************************************************************************** ; Vector Handlers ;************************************************************************** .area _CODE -up_int1:: ; Vector offset 0: External /INT1 +_up_int1:: ; Vector offset 0: External /INT1 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack @@ -73,7 +72,7 @@ up_int1:: ; Vector offset 0: External /INT1 ld a, #9 ; 9 = Z180_INT1 jr _up_vectcommon ; Remaining RST handling is common -up_int2:: ; Vector offset 2: External /INT2 +_up_int2:: ; Vector offset 2: External /INT2 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack @@ -81,7 +80,7 @@ up_int2:: ; Vector offset 2: External /INT2 ld a, #10 ; 10 = Z180_INT2 jr _up_vectcommon ; Remaining RST handling is common -up_prt0:: ; Vector offset 4: PRT channel 0 +_up_prt0:: ; Vector offset 4: PRT channel 0 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack @@ -89,7 +88,7 @@ up_prt0:: ; Vector offset 4: PRT channel 0 ld a, #11 ; 11 = Z180_PRT0 jr _up_vectcommon ; Remaining RST handling is common -up_prt1:: ; Vector offset 6: PRT channel 1 +_up_prt1:: ; Vector offset 6: PRT channel 1 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack @@ -97,7 +96,7 @@ up_prt1:: ; Vector offset 6: PRT channel 1 ld a, #12 ; 12 = Z180_PRT1 jr _up_vectcommon ; Remaining RST handling is common -up_dma0:: ; Vector offset 8: DMA channel 0 +_up_dma0:: ; Vector offset 8: DMA channel 0 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack @@ -105,7 +104,7 @@ up_dma0:: ; Vector offset 8: DMA channel 0 ld a, #13 ; 13 = Z180_DMA0 jr _up_vectcommon ; Remaining RST handling is common -up_dma1:: ; Vector offset 8: DMA channel 1 +_up_dma1:: ; Vector offset 8: DMA channel 1 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack @@ -113,7 +112,7 @@ up_dma1:: ; Vector offset 8: DMA channel 1 ld a, #14 ; 14 = Z180_DMA1 jr _up_vectcommon ; Remaining RST handling is common -up_csio:: ; Vector offset 12: Clocked serial I/O +_up_csio:: ; Vector offset 12: Clocked serial I/O ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack @@ -121,7 +120,7 @@ up_csio:: ; Vector offset 12: Clocked serial I/O ld a, #15 ; 15 = Z180_CSIO jr _up_vectcommon ; Remaining RST handling is common -up_asci0:: ; Vector offset 14: Async channel 0 +_up_asci0:: ; Vector offset 14: Async channel 0 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack @@ -129,7 +128,7 @@ up_asci0:: ; Vector offset 14: Async channel 0 ld a, #16 ; 16 = Z180_ASCI0 jr _up_vectcommon ; Remaining RST handling is common -up_asci1:: ; Vector offset 16: Async channel 1 +_up_asci1:: ; Vector offset 16: Async channel 1 ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack @@ -137,7 +136,7 @@ up_asci1:: ; Vector offset 16: Async channel 1 ld a, #17 ; 17 = Z180_ASCI1 jr _up_vectcommon ; Remaining RST handling is common -up_unused:: ; Vector offset 18: Unused +_up_unused:: ; Vector offset 18: Unused ; Save AF on the stack, set the interrupt number and jump to the ; common reset handling logic. ; Offset 8: Return PC is already on the stack diff --git a/nuttx/arch/z80/src/z180/z180_vectors.asm b/nuttx/arch/z80/src/z180/z180_vectors.asm index cd544b926..3bda5c470 100644 --- a/nuttx/arch/z80/src/z180/z180_vectors.asm +++ b/nuttx/arch/z80/src/z180/z180_vectors.asm @@ -54,12 +54,6 @@ .globl _up_asci0 ; Vector offset 14: Async channel 0 .globl _up_asci1 ; Vector offset 16: Async channel 1 .globl _up_unused ; Vector offset 18: Unused - .globl _up_unused ; Vector offset 20: Unused - .globl _up_unused ; Vector offset 22: Unused - .globl _up_unused ; Vector offset 24: Unused - .globl _up_unused ; Vector offset 26: Unused - .globl _up_unused ; Vector offset 28: Unused - .globl _up_unused ; Vector offset 30: Unused ;************************************************************************** ; Interrupt Vector Table @@ -72,19 +66,19 @@ .org 0x0040 _up_vectors:: - .dw up_int1 ; Vector offset 0: External /INT1 - .dw up_int2 ; Vector offset 2: External /INT2 - .dw up_prt0 ; Vector offset 4: PRT channel 0 - .dw up_prt1 ; Vector offset 6: PRT channel 1 - .dw up_dma0 ; Vector offset 8: DMA channel 0 - .dw up_dma1 ; Vector offset 8: DMA channel 1 - .dw up_csio ; Vector offset 12: Clocked serial I/O - .dw up_asci0 ; Vector offset 14: Async channel 0 - .dw up_asci1 ; Vector offset 16: Async channel 1 - .dw up_unused ; Vector offset 18: Unused - .dw up_unused ; Vector offset 20: Unused - .dw up_unused ; Vector offset 22: Unused - .dw up_unused ; Vector offset 24: Unused - .dw up_unused ; Vector offset 26: Unused - .dw up_unused ; Vector offset 28: Unused - .dw up_unused ; Vector offset 30: Unused \ No newline at end of file + .dw _up_int1 ; Vector offset 0: External /INT1 + .dw _up_int2 ; Vector offset 2: External /INT2 + .dw _up_prt0 ; Vector offset 4: PRT channel 0 + .dw _up_prt1 ; Vector offset 6: PRT channel 1 + .dw _up_dma0 ; Vector offset 8: DMA channel 0 + .dw _up_dma1 ; Vector offset 8: DMA channel 1 + .dw _up_csio ; Vector offset 12: Clocked serial I/O + .dw _up_asci0 ; Vector offset 14: Async channel 0 + .dw _up_asci1 ; Vector offset 16: Async channel 1 + .dw _up_unused ; Vector offset 18: Unused + .dw _up_unused ; Vector offset 20: Unused + .dw _up_unused ; Vector offset 22: Unused + .dw _up_unused ; Vector offset 24: Unused + .dw _up_unused ; Vector offset 26: Unused + .dw _up_unused ; Vector offset 28: Unused + .dw _up_unused ; Vector offset 30: Unused \ No newline at end of file -- cgit v1.2.3 From b922099dc28728d2a5e255dc580a968324187965 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 13 Dec 2012 18:13:22 +0000 Subject: Add special register definitions needed for z80181 and z80182 git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5434 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z80/include/z180/chip.h | 24 ++ nuttx/arch/z80/src/z180/z180_iomap.h | 421 +++++++++++++++++++++++++---------- nuttx/configs/p112/README.txt | 107 ++++++++- nuttx/configs/xtrs/src/xtr_irq.c | 8 +- nuttx/configs/z80sim/src/z80_irq.c | 6 +- 5 files changed, 448 insertions(+), 118 deletions(-) (limited to 'nuttx') diff --git a/nuttx/arch/z80/include/z180/chip.h b/nuttx/arch/z80/include/z180/chip.h index 3844b2800..1127e4e00 100644 --- a/nuttx/arch/z80/include/z180/chip.h +++ b/nuttx/arch/z80/include/z180/chip.h @@ -93,6 +93,9 @@ defined(CONFIG_ARCH_CHIP_Z8018006VEG) /* 68-pin PLCC */ # undef HAVE_Z8S180 /* Not Z8S180 (5V) or Z8L180 (3.3V) core */ +# define HAVE_Z8X180 1 /* Z8x180 registers */ +# undef HAVE_Z8X181 /* Z8x181 registers */ +# undef HAVE_Z8X182 /* Z8x182 registers */ # define HAVE ROM 0 /* No on-chip ROM */ # define HAVE_SERIALIO 1 /* Have clocked serial I/O */ # undef HAVE_WDT /* No Watchdog timer */ @@ -117,6 +120,9 @@ defined(CONFIG_ARCH_CHIP_Z8018006FSG) /* 80-pin QFP (11 pins N/C) 6MHz 5V */ # undef HAVE_Z8S180 /* Not Z8S180 (5V) or Z8L180 (3.3V) core */ +# define HAVE_Z8X180 1 /* Z8x180 registers */ +# undef HAVE_Z8X181 /* Z8x181 registers */ +# undef HAVE_Z8X182 /* Z8x182 registers */ # define HAVE ROM 0 /* No on-chip ROM */ # undef HAVE_SERIALIO /* No clocked serial I/O ? */ # undef HAVE_WDT /* No Watchdog timer */ @@ -137,6 +143,9 @@ defined(CONFIG_ARCH_CHIP_Z8018008PEG) # undef HAVE_Z8S180 /* Not Z8S180 (5V) or Z8L180 (3.3V) core */ +# define HAVE_Z8X180 1 /* Z8x180 registers */ +# undef HAVE_Z8X181 /* Z8x181 registers */ +# undef HAVE_Z8X182 /* Z8x182 registers */ # define HAVE ROM 0 /* No on-chip ROM */ # define HAVE_SERIALIO 1 /* Have clocked serial I/O */ # undef HAVE_WDT /* No Watchdog timer */ @@ -175,6 +184,9 @@ #elif defined(CONFIG_ARCH_CHIP_Z8018110FEG) /* 100-pin QFP */ # undef HAVE_Z8S180 /* Not Z8S180 (5V) or Z8L180 (3.3V) core */ +# undef HAVE_Z8X180 /* Z8x180 registers */ +# define HAVE_Z8X181 1 /* Z8x181 registers */ +# undef HAVE_Z8X182 /* Z8x182 registers */ # define HAVE ROM 0 /* No on-chip ROM */ # define HAVE_SERIALIO 1 /* Have clocked serial I/O */ # undef HAVE_WDT /* No Watchdog timer */ @@ -220,6 +232,9 @@ defined(CONFIG_ARCH_CHIP_Z8018233ASG) /* 100-pin LQFP 33MHz 5V */ # undef HAVE_Z8S180 /* Not Z8S180 (5V) or Z8L180 (3.3V) core */ +# undef HAVE_Z8X180 /* Z8x180 registers */ +# undef HAVE_Z8X181 /* Z8x181 registers */ +# define HAVE_Z8X182 1 /* Z8x182 registers */ # define HAVE ROM 0 /* No on-chip ROM */ # define HAVE_SERIALIO 1 /* Have clocked serial I/O */ # undef HAVE_WDT /* No Watchdog timer */ @@ -304,6 +319,9 @@ defined(CONFIG_ARCH_CHIP_Z8L18020PSG) # define HAVE_Z8S180 1 /* Uses Z8S180 (5V) or Z8L180 (3.3V) core */ +# define HAVE_Z8X180 1 /* Z8x180 registers */ +# undef HAVE_Z8X181 /* Z8x181 registers */ +# undef HAVE_Z8X182 /* Z8x182 registers */ # define HAVE ROM 0 /* No on-chip ROM */ # define HAVE_SERIALIO 1 /* Have clocked serial I/O */ # undef HAVE_WDT /* No Watchdog timer */ @@ -348,6 +366,9 @@ defined(CONFIG_ARCH_CHIP_Z8L18220AEG) # define HAVE_Z8S180 1 /* Uses Z8S180 (5V) or Z8L180 (3.3V) core */ +# undef HAVE_Z8X180 /* Z8x180 registers */ +# undef HAVE_Z8X181 /* Z8x181 registers */ +# define HAVE_Z8X182 1 /* Z8x182 registers */ # define HAVE ROM 0 /* No on-chip ROM */ # define HAVE_SERIALIO 1 /* Have clocked serial I/O */ # undef HAVE_WDT /* No Watchdog timer */ @@ -405,6 +426,9 @@ defined(CONFIG_ARCH_CHIP_Z8S18010FEG) # define HAVE_Z8S180 1 /* Uses Z8S180 (5V) or Z8L180 (3.3V) core */ +# define HAVE_Z8X180 1 /* Z8x180 registers */ +# undef HAVE_Z8X181 /* Z8x181 registers */ +# undef HAVE_Z8X182 /* Z8x182 registers */ # define HAVE ROM 0 /* No on-chip ROM */ # define HAVE_SERIALIO 1 /* Have clocked serial I/O */ # undef HAVE_WDT /* No Watchdog timer */ diff --git a/nuttx/arch/z80/src/z180/z180_iomap.h b/nuttx/arch/z80/src/z180/z180_iomap.h index d887b317b..c4c996f81 100644 --- a/nuttx/arch/z80/src/z180/z180_iomap.h +++ b/nuttx/arch/z80/src/z180/z180_iomap.h @@ -1,4 +1,4 @@ -/**************************************************************************** +/************************************************************************************ * arch/z80/src/z180/z180_iomap.h * * Copyright (C) 2012 Gregory Nutt. All rights reserved. @@ -31,101 +31,260 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ****************************************************************************/ + ************************************************************************************/ #ifndef __ARCH_Z80_SRC_Z180_Z180_IOMAP_H #define __ARCH_Z80_SRC_Z180_Z180_IOMAP_H -/**************************************************************************** +/************************************************************************************ * Included Files - ****************************************************************************/ + ************************************************************************************/ #include -/**************************************************************************** +/************************************************************************************ * Pre-processor Definitions - ****************************************************************************/ - - /* Z180 Register Bit addresses **********************************************/ - -#define Z180_ASCI0_CNTLA 0x00 /* ASCI Control Register A Ch 0 */ -#define Z180_ASCI1_CNTLA 0x01 /* ASCI Control Register A Ch 1 */ -#define Z180_ASCI0_CNTLB 0x02 /* ASCI Control Register B Ch 0 */ -#define Z180_ASCI1_CNTLB 0x03 /* ASCI Control Register B Ch 1 */ -#define Z180_ASCI0_STAT 0x04 /* ASCI Status Register Ch 0 */ -#define Z180_ASCI1_STAT 0x05 /* ASCI Status Register Ch 1 */ -#define Z180_ASCI0_TDR 0x06 /* ASCI Transmit Data Register Ch 0 */ -#define Z180_ASCI1_TDR 0x07 /* ASCI Transmit Data Register Ch 1 */ -#define Z180_ASCI0_RDR 0x08 /* ASCI Receive Data Register Ch 0 */ -#define Z180_ASCI1_RDR 0x09 /* ASCI Receive Data Register Ch 1 */ - -#define Z180_CSIO_CNTR 0x0a /* CSI/O Control Register */ -#define Z180_CSIO_TRD 0x0b /* Transmit/Receive Data Register */ - -#define Z180_TMR0_DRL 0x0c /* Timer Data Register Ch 0 L */ -#define Z180_TMR0_DRH 0x0d /* Data Register Ch 0 H */ -#define Z180_TMR0_RLDRL 0x0e /* Reload Register Ch 0 L */ -#define Z180_TMR0_RLDRH 0x0f /* Reload Register Ch 0 H */ -#define Z180_TMR_TCR 0x10 /* Timer Control Register */ - -#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ -# define Z180_ASCI0_ASEXT 0x12 /* ASCI Extension Control Register */ -# define Z180_ASCI1_ASEXT 0x13 /* ASCI Extension Control Register */ + ************************************************************************************/ +/* Configuration ********************************************************************/ + +/* These registers may be relocated to multiples of 0x40 by setting the IO Control + * Register (ICR). Relocatable to 0x40-0x7f, or 0x80-0xbf. The configuration setting, + * CONFIG_Z180_SFROFFSET, indicates that offset (but is not fully supported yet!) + */ + +#ifdef CONFIG_Z180_SFROFFSET +# define SFR_OFFSET CONFIG_Z180_SFROFFSET +#else +# define SFR_OFFSET 0 #endif -#define Z180_TMR1_DRL 0x14 /* Data Register Ch 1 L */ -#define Z180_TMR1_DRH 0x15 /* Data Register Ch 1 H */ -#define Z180_TMR1_RLDRL 0x16 /* Reload Register Ch 1 L */ -#define Z180_TMR1_RLDRH 0x17 /* Reload Register Ch 1 H */ +/* Z180 Register Bit addresses ******************************************************/ +/* ASCI Registers */ -#define Z180_FRC 0x18 /* Free Running Counter */ +#define Z180_ASCI0_CNTLA (SFR_OFFSET+0x00) /* ASCI Control Register A Ch 0 */ +#define Z180_ASCI1_CNTLA (SFR_OFFSET+0x01) /* ASCI Control Register A Ch 1 */ +#define Z180_ASCI0_CNTLB (SFR_OFFSET+0x02) /* ASCI Control Register B Ch 0 */ +#define Z180_ASCI1_CNTLB (SFR_OFFSET+0x03) /* ASCI Control Register B Ch 1 */ +#define Z180_ASCI0_STAT (SFR_OFFSET+0x04) /* ASCI Status Register Ch 0 */ +#define Z180_ASCI1_STAT (SFR_OFFSET+0x05) /* ASCI Status Register Ch 1 */ +#define Z180_ASCI0_TDR (SFR_OFFSET+0x06) /* ASCI Transmit Data Register Ch 0 */ +#define Z180_ASCI1_TDR (SFR_OFFSET+0x07) /* ASCI Transmit Data Register Ch 1 */ +#define Z180_ASCI0_RDR (SFR_OFFSET+0x08) /* ASCI Receive Data Register Ch 0 */ +#define Z180_ASCI1_RDR (SFR_OFFSET+0x09) /* ASCI Receive Data Register Ch 1 */ + +#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ +# define Z180_ASCI0_ASEXT (SFR_OFFSET+0x12) /* ASCI Extension Control Register */ +# define Z180_ASCI1_ASEXT (SFR_OFFSET+0x13) /* ASCI Extension Control Register */ +#endif #ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ -# define Z180_ASCI0_ASTCL 0x1a /* ASCI Time Constant Low */ -# define Z180_ASCI0_ASTCH 0x1b /* ASCI Time Constant High */ -# define Z180_ASCI1_ASTCL 0x1c /* ASCI Time Constant Low */ -# define Z180_ASCI1_ASTCH 0x1d /* ASCI Time Constant High */ +# define Z180_ASCI0_ASTCL (SFR_OFFSET+0x1a) /* ASCI Time Constant Low */ +# define Z180_ASCI0_ASTCH (SFR_OFFSET+0x1b) /* ASCI Time Constant High */ +# define Z180_ASCI1_ASTCL (SFR_OFFSET+0x1c) /* ASCI Time Constant Low */ +# define Z180_ASCI1_ASTCH (SFR_OFFSET+0x1d) /* ASCI Time Constant High */ +#endif -# define Z180_CMR 0x1e /* Clock Multiplier Register */ -# define Z180_CCR 0x1f /* CPU Control Register */ +/* CSI/O Registers */ + +#define Z180_CSIO_CNTR (SFR_OFFSET+0x0a) /* CSI/O Control Register */ +#define Z180_CSIO_TRD (SFR_OFFSET+0x0b) /* Transmit/Receive Data Register */ + +/* Timer Registers */ + +#define Z180_TMR0_DRL (SFR_OFFSET+0x0c) /* Timer Data Register Ch 0 L */ +#define Z180_TMR0_DRH (SFR_OFFSET+0x0d) /* Data Register Ch 0 H */ +#define Z180_TMR0_RLDRL (SFR_OFFSET+0x0e) /* Reload Register Ch 0 L */ +#define Z180_TMR0_RLDRH (SFR_OFFSET+0x0f) /* Reload Register Ch 0 H */ +#define Z180_TMR_TCR (SFR_OFFSET+0x10) /* Timer Control Register */ + +#define Z180_TMR1_DRL (SFR_OFFSET+0x14) /* Data Register Ch 1 L */ +#define Z180_TMR1_DRH (SFR_OFFSET+0x15) /* Data Register Ch 1 H */ +#define Z180_TMR1_RLDRL (SFR_OFFSET+0x16) /* Reload Register Ch 1 L */ +#define Z180_TMR1_RLDRH (SFR_OFFSET+0x17) /* Reload Register Ch 1 H */ + +#define Z180_FRC (SFR_OFFSET+0x18) /* Free Running Counter */ + +/* DMA Registers */ + +#define Z180_DMA_SAR0L (SFR_OFFSET+0x20) /* DMA Source Address Register Ch 0L */ +#define Z180_DMA_SAR0H (SFR_OFFSET+0x21) /* DMA Source Address Register Ch 0H */ +#define Z180_DMA_SAR0B (SFR_OFFSET+0x22) /* DMA Source Address Register Ch 0B */ +#define Z180_DMA_DAR0L (SFR_OFFSET+0x23) /* DMA Destination Address Register Ch 0L */ +#define Z180_DMA_DAR0H (SFR_OFFSET+0x24) /* DMA Destination Address Register Ch 0H */ +#define Z180_DMA_DAR0B (SFR_OFFSET+0x25) /* DMA Destination Address Register Ch 0B */ +#define Z180_DMA_BCR0L (SFR_OFFSET+0x26) /* DMA Byte Count Register Ch 0L */ +#define Z180_DMA_BCR0H (SFR_OFFSET+0x27) /* DMA Byte Count Register Ch 0H */ +#define Z180_DMA_MAR1L (SFR_OFFSET+0x28) /* DMA Memory Address Register Ch 1L */ +#define Z180_DMA_MAR1H (SFR_OFFSET+0x29) /* DMA Memory Address Register Ch 1H */ +#define Z180_DMA_MAR1B (SFR_OFFSET+0x2a) /* DMA Memory Address Register Ch 1B */ +#define Z180_DMA_IAR1L (SFR_OFFSET+0x2b) /* DMA I/0 Address Register Ch 1L */ +#define Z180_DMA_IAR1H (SFR_OFFSET+0x2c) /* DMA I/0 Address Register Ch 1H */ +#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ +# define Z180_DMA_IAR1B (SFR_OFFSET+0x2d) /* DMA I/O Address Register Ch 1B */ #endif +#define Z180_DMA_BCR1L (SFR_OFFSET+0x2e) /* DMA Byte Count Register Ch 1L */ +#define Z180_DMA_BCR1H (SFR_OFFSET+0x2f) /* DMA Byte Count Register Ch 1H */ +#define Z180_DMA_DSTAT (SFR_OFFSET+0x30) /* DMA Status Register */ +#define Z180_DMA_DMODE (SFR_OFFSET+0x31) /* DMA Mode Register */ +#define Z180_DMA_DCNTL (SFR_OFFSET+0x32) /* DMA/WAIT Control Register */ + +/* System Control Registers */ -#define Z180_DMA_SAR0L 0x20 /* DMA Source Address Register Ch 0L */ -#define Z180_DMA_SAR0H 0x21 /* DMA Source Address Register Ch 0H */ -#define Z180_DMA_SAR0B 0x22 /* DMA Source Address Register Ch 0B */ -#define Z180_DMA_DAR0L 0x23 /* DMA Destination Address Register Ch 0L */ -#define Z180_DMA_DAR0H 0x24 /* DMA Destination Address Register Ch 0H */ -#define Z180_DMA_DAR0B 0x25 /* DMA Destination Address Register Ch 0B */ -#define Z180_DMA_BCR0L 0x26 /* DMA Byte Count Register Ch 0L */ -#define Z180_DMA_BCR0H 0x27 /* DMA Byte Count Register Ch 0H */ -#define Z180_DMA_MAR1L 0x28 /* DMA Memory Address Register Ch 1L */ -#define Z180_DMA_MAR1H 0x29 /* DMA Memory Address Register Ch 1H */ -#define Z180_DMA_MAR1B 0x2a /* DMA Memory Address Register Ch 1B */ -#define Z180_DMA_IAR1L 0x2b /* DMA I/0 Address Register Ch 1L */ -#define Z180_DMA_IAR1H 0x2c /* DMA I/0 Address Register Ch 1H */ #ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ -# define Z180_DMA_IAR1B 0x2d /* DMA I/O Address Register Ch 1B */ +# define Z180_CMR (SFR_OFFSET+0x1e) /* Clock Multiplier Register */ #endif -#define Z180_DMA_BCR1L 0x2e /* DMA Byte Count Register Ch 1L */ -#define Z180_DMA_BCR1H 0x2f /* DMA Byte Count Register Ch 1H */ -#define Z180_DMA_DSTAT 0x30 /* DMA Status Register */ -#define Z180_DMA_DMODE 0x31 /* DMA Mode Register */ -#define Z180_DMA_DCNTL 0x32 /* DMA/WAIT Control Register */ -#define Z180_INT_IL 0x33 /* IL Register (Interrupt Vector Low Register) */ -#define Z180_INT_ITC 0x34 /* INT/TRAP Control Register */ +#if defined(HAVE_Z8S180) || defined(HAVE_Z8X182) +# define Z180_CCR (SFR_OFFSET+0x1f) /* CPU Control Register */ +#endif + +#define Z180_INT_IL (SFR_OFFSET+0x33) /* IL Register (Interrupt Vector Low Register) */ +#define Z180_INT_ITC (SFR_OFFSET+0x34) /* INT/TRAP Control Register */ + +#define Z180_RCR (SFR_OFFSET+0x36) /* Refresh Control Register */ + +#define Z180_MMU_CBR (SFR_OFFSET+0x38) /* MMU Common Base Register */ +#define Z180_MMU_BBR (SFR_OFFSET+0x39) /* MMU Bank Base Register */ +#define Z180_MMU_CBAR (SFR_OFFSET+0x3a) /* MMU Common/Bank Area Register */ + +#define Z180_OMCR (SFR_OFFSET+0x3e) /* Operation Mode Control Register */ +#define Z180_ICR (SFR_OFFSET+0x3f) /* I/O Control Register */ + +/* The following registers are not relocatable */ +/* Registers unique to Z8x181 class CPUs */ + +#ifdef HAVE_Z8X181 -#define Z180_RCR 0x36 /* Refresh Control Register */ +/* PIA Registers */ -#define Z180_MMU_CBR 0x38 /* MMU Common Base Register */ -#define Z180_MMU_BBR 0x39 /* MMU Bank Base Register */ -#define Z180_MMU_CBAR 0x3a /* MMU Common/Bank Area Register */ +# define Z181_PIA1_DDR 0xe0 /* PIA1 Data Direction Register */ +# define Z181_PIA1_DP 0xe1 /* PIA1 Data Port */ +# define Z181_PIA2_DDR 0xe2 /* PIA2 Data Direction Register */ +# define Z181_PIA1_DP 0xe3 /* PIA2 Data Register */ -#define Z180_OMCR 0x3e /* Operation Mode Control Register */ -#define Z180_ICR 0x3f /* I/O Control Register */ +/* CTC Registers */ -/* Z180 Register Bit definitions ********************************************/ +# define Z181_CTC0 0xe4 /* CTC Channel 0 Control Register */ +# define Z181_CTC1 0xe5 /* CTC Channel 1 Control Register */ +# define Z181_CTC2 0xe6 /* CTC Channel 2 Control Register */ +# define Z181_CTC3 0xe7 /* CTC Channel 3 Control Register */ +/* SCC Registers */ + +# define Z181_SCC_CR 0xe8 /* SCC Control Register */ +# define Z181_SCC_DR 0xe9 /* SCC Data Register */ + +/* System Control Registers */ + +# define Z181_RAM_UBR 0xea /* RAM Upper Boundary Address Register */ +# define Z181_RAM_LBR 0xeb /* RAM Lower Boundary Address Register*/ +# define Z181_ROM_BR 0xec /* ROM Address Boundary Register */ +# define Z181_SCR 0xed /* System Configuration Register */ +#endif + +/* Registers unique to Z8x182 class CPUs */ + +#ifdef HAVE_Z8X182 +# define Z182_WSGCS 0xd8 /* WSG Chip Select Register */ +# define Z182_ENH182 0xd9 /* Z80182 Enhancements Register */ +# define Z182_INTEDGE 0xdf /* Interrupt Edge/Pin MUX Control */ +# define Z182_PINMUX 0xdf /* Interrupt Edge/Pin MUX Control */ + +/* PIA Registers */ + +# define Z182_PA_DDR 0xed /* PA Data Direction Register */ +# define Z182_PA_DR 0xee /* PA Data Register */ +# define Z182_PB_DDR 0xe4 /* PB Data Direction Register */ +# define Z182_PB_DR 0xe5 /* PB Data Register */ +# define Z182_PC_DDR 0xdd /* PC Data Direction Register */ +# define Z182_PC_DR 0xde /* PC Data Register */ + +/* ESCC Registers */ + +# define Z182_ESCCA_CR 0xe0 /* ESCC Chan A Control Register */ +# define Z182_ESCCA_DR 0xe1 /* ESCC Chan A Data Register */ +# define Z182_ESCCB_CR 0xe2 /* ESCC Chan B Control Register */ +# define Z182_ESCCB_DR 0xe3 /* ESCC Chan B Data Register */ + +/* System Control Registers */ + +# define Z182_RAM_UBR 0xe6 /* RAMUBR RAM Upper Boundary Register */ +# define Z182_RAM_LBR 0xe7 /* RAMLBR RAM Lower Boundary Register */ +# define Z182_ROM_BR 0xe8 /* ROM Address Boundary Register */ +# define Z182_SCR 0xef /* System Configuration Register */ + +/* 16550 MIMIC Registers */ + +# define Z182_MIMIC_FCR 0xe9 /* FIFO Control Register */ +# define Z182_MIMIC_MM 0xe9 /* MM register */ +# define Z182_MIMIC_RTTC 0xea /* Receive Timeout Time Constant */ +# define Z182_MIMIC_TTTC 0xeb /* Transmit Timeout Time Constant */ +# define Z182_MIMIC_FSCR 0xec /* FIFO Status and Control */ +# define Z182_MIMIC_RBR 0xf0 /* Receive Buffer Register */ +# define Z182_MIMIC_THR 0xf0 /* Transmit Holding Register */ +# define Z182_MIMIC_IER 0xf1 /* Interrupt Enable Register */ +# define Z182_MIMIC_LCR 0xf3 /* Line Control Register */ +# define Z182_MIMIC_MCR 0xf4 /* Modem Control Register */ +# define Z182_MIMIC_LSR 0xf5 /* Line Status Register */ +# define Z182_MIMIC_MSR 0xf6 /* Modem Status Register */ +# define Z182_MIMIC_SCR 0xf7 /* Scratch Register */ +# define Z182_MIMIC_DLL 0xf8 /* Divisor Latch (LSByte) */ +# define Z182_MIMIC_DLM 0xf9 /* Divisor Latch (MSByte) */ +# define Z182_MIMIC_TTCR 0xfa /* Transmit Time Constant */ +# define Z182_MIMIC_RTCR 0xfb /* Receive Time Constant */ +# define Z182_MIMIC_IVEC 0xfc /* Interrupt Vector */ +# define Z182_MIMIC_IE 0xfd /* Interrupt Enable */ + +# define Z182_MIMIC_IUSIP 0xfe /* Interrupt Under-Service/Interrupt Pending */ +# define Z182_MIMIC_MMC 0xff /* MIMIC Master Control Register */ + +/* Some of the MIMIC registers are accessible to memory-mapped addresses */ + +# define Z182_MIMIC_RBR_ADDR 0x0000 /* Receive Buffer Register */ +# define Z182_MIMIC_DLL_ADDR 0x0000 /* Divisor Latch (LSByte) */ +# define Z182_MIMIC_THR_ADDR 0x0000 /* Transmit Holding Register */ +# define Z182_MIMIC_DLM_ADDR 0x0001 /* Divisor Latch (MSByte) */ +# define Z182_MIMIC_IER_ADDR 0x0001 /* Interrupt Enable Register */ +# define Z182_MIMIC_IIR_ADDR 0x0002 /* Interrupt Identification */ +# define Z182_MIMIC_FCR_ADDR 0x0002 /* FIFO Control Register */ +# define Z182_MIMIC_LCR_ADDR 0x0003 /* Line Control Register */ +# define Z182_MIMIC_MCR_ADDR 0x0004 /* Modem Control Register */ +# define Z182_MIMIC_LSR_ADDR 0x0005 /* Line Status Register */ +# define Z182_MIMIC_MSR_ADDR 0x0006 /* Modem Status Register */ +# define Z182_MIMIC_SCR_ADDR 0x0007 /* Scratch Register */ +#endif + +/* [E]SCC Internal Register Definitions */ + +#define Z18X_SCC_RR0 0x00 +#define Z18X_SCC_RR1 0x01 +#define Z18X_SCC_RR2 0x02 +#define Z18X_SCC_RR3 0x03 +#define Z18X_SCC_RR6 0x06 +#define Z18X_SCC_RR7 0x07 +#define Z18X_SCC_RR10 0x0a +#define Z18X_SCC_RR12 0x0c +#define Z18X_SCC_RR13 0x0d +#define Z18X_SCC_RR15 0x0f + +#define Z18X_SCC_WR0 0x00 +#define Z18X_SCC_WR1 0x01 +#define Z18X_SCC_WR2 0x02 +#define Z18X_SCC_WR3 0x03 +#define Z18X_SCC_WR4 0x04 +#define Z18X_SCC_WR5 0x05 +#define Z18X_SCC_WR6 0x06 +#define Z18X_SCC_WR7 0x07 +#define Z18X_SCC_WR9 0x09 +#define Z18X_SCC_WR10 0x0a +#define Z18X_SCC_WR11 0x0b +#define Z18X_SCC_WR12 0x0c +#define Z18X_SCC_WR13 0x0d +#define Z18X_SCC_WR14 0x0e +#define Z18X_SCC_WR15 0x0f + +/* Z180 Register Bit definitions ****************************************************/ +/* ASCI Registers *******************************************************************/ /* ASCI Control Register A 0 (CNTLA0: 0x00) */ /* ASCI Control Register A 1 (CNTLA1: 0x01) */ @@ -179,6 +338,26 @@ /* ASCI Receive Data Register Ch. 0 (RDR0: 0x08) - 8-bit data */ /* ASCI Receive Data Register Ch. 1 (RDR0: 0x09) - 8-bit data */ +/* ASCI0 Extension Control Register (I/O Address: 0x12) (Z8S180/L180-Class Processors Only) */ +/* ASCI1 Extension Control Register (I/O Address: 0x13) (Z8S180/L180-Class Processors Only) */ + +#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ +# define ASCI_ASEXT_RDRF (0x80) /* Bit 7: RDRF Interrupt Inhibit */ +# define ASCI0_ASEXT_DCD0 (0x80) /* Bit 6: DCD0 advisory to SW (ASCI0 only) */ +# define ASCI0_ASEXT_CTS0 (0x80) /* Bit 5: CTS0 advisory to SW (ASCI0 only) */ +# define ASCI_ASEXT_X1BC (0x80) /* Bit 4: CKA0 is bit clock */ +# define ASCI_ASEXT_BRG (0x80) /* Bit 3: Enable 16-bit BRG counter */ +# define ASCI_ASEXT_BRKEN (0x80) /* Bit 2: Break Feature Enable */ +# define ASCI_ASEXT_BRKDET (0x80) /* Bit 1: Break Detect */ +# define ASCI_ASEXT_SNDBRK (0x80) /* Bit 0: Send Break */ +#endif + +/* ASCI0 Time Constant Low Register (I/O Address: 0x1a) (Z8S180/L180-Class Processors Only) -- 8-bit data */ +/* ASCI0 Time Constant High Register (I/O Address: 0x1b) (Z8S180/L180-Class Processors Only) -- 8-bit data */ +/* ASCI1 Time Constant Low Register (I/O Address: 0x1c) (Z8S180/L180-Class Processors Only) -- 8-bit data */ +/* ASCI1 Time Constant High Register (I/O Address: 0x1d) (Z8S180/L180-Class Processors Only) -- 8-bit data */ + +/* CSI/O Registers ******************************************************************/ /* CSI/O Control/Status Register (CNTR: 0x0a) */ #define CSIO_CNTR_EF (0x80) /* Bit 7: End Flag */ @@ -196,8 +375,9 @@ # define CSIO_CNTR_DIV1280 (6 << CSIO_CNTR_SS_SHIFT) /* Divide Ratio: 1280 Baud: 3125 */ # define CSIO_CNTR_EXT (7 << CSIO_CNTR_SS_SHIFT) /* External Clock input (less than 20) */ /* Baud at Phi = 4 MHz */ - /* CSI/O Transmit/Receive Register (TRDR: 0x0b) -- 8-bit data */ + +/* Timer Registers ******************************************************************/ /* Timer Data Register 0L (TMDR0L: 0x0c) -- 8-bit data */ /* Timer Data Register 0H (TMDR0H: 0x0d) -- 8-bit data */ /* Timer Reload Register Channel 0L (RLDR0L: 0x0e) -- 8-bit data */ @@ -214,55 +394,15 @@ #define TMR_TCR_TDE1 (0x02) /* Bit 1: Timer 1 Down Count Enable */ #define TMR_TCR_TDE0 (0x01) /* Bit 0: Timer 0 Down Count Enable */ -/* ASCI0 Extension Control Register (I/O Address: 0x12) (Z8S180/L180-Class Processors Only) */ -/* ASCI1 Extension Control Register (I/O Address: 0x13) (Z8S180/L180-Class Processors Only) */ - -#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ -# define ASCI_ASEXT_RDRF (0x80) /* Bit 7: RDRF Interrupt Inhibit */ -# define ASCI0_ASEXT_DCD0 (0x80) /* Bit 6: DCD0 advisory to SW (ASCI0 only) */ -# define ASCI0_ASEXT_CTS0 (0x80) /* Bit 5: CTS0 advisory to SW (ASCI0 only) */ -# define ASCI_ASEXT_X1BC (0x80) /* Bit 4: CKA0 is bit clock */ -# define ASCI_ASEXT_BRG (0x80) /* Bit 3: Enable 16-bit BRG counter */ -# define ASCI_ASEXT_BRKEN (0x80) /* Bit 2: Break Feature Enable */ -# define ASCI_ASEXT_BRKDET (0x80) /* Bit 1: Break Detect */ -# define ASCI_ASEXT_SNDBRK (0x80) /* Bit 0: Send Break */ -#endif - /* Timer Data Register 1L (TMDR1L: 0x14) -- 8-bit data */ /* Timer Data Register 1H (TMDR1H: 0x15) -- 8-bit data */ /* Timer Reload Register Channel 1L (RLDR1L: 0x16) -- 8-bit data */ /* Timer Reload Register Channel 1H (RLDR1H: 0x17) -- 8-bit data */ /* Free Running counter (FRC: 0x18) -- 8-bit data */ -/* ASCI0 Time Constant Low Register (I/O Address: 0x1a) (Z8S180/L180-Class Processors Only) -- 8-bit data */ -/* ASCI0 Time Constant High Register (I/O Address: 0x1b) (Z8S180/L180-Class Processors Only) -- 8-bit data */ -/* ASCI1 Time Constant Low Register (I/O Address: 0x1c) (Z8S180/L180-Class Processors Only) -- 8-bit data */ -/* ASCI1 Time Constant High Register (I/O Address: 0x1d) (Z8S180/L180-Class Processors Only) -- 8-bit data */ - -/* Clock Multiplier Register (CMR: 0x1e) (Z8S180/L180-Class Processors Only) */ - -#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ -# define CMR_CMM (0x80) /* Bit 7: X2 Clock Multiplier Mode */ -#endif - -/* CPU Control Register (CCR: 0x1f) (Z8S180/L180-Class Processors Only) */ - -#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ -# define CCR_XTAL_DIV (0x80) /* Bit 7: Clock Divide */ -# define CCR_STBYIDLE (0x48) /* Bits 3 & 6: STANDBY/IDLE mode */ -# define CCR_NOSTDBY (0x00) /* No STANDBY */ -# define CCR_IDLE (0x08) /* IDLE after SLEEP */ -# define CCR_STBY (0x40) /* STANDBY after SLEEP */ -# define CCR_STBY64 (0x48) /* STANDBY after SLEEP 64 Cycle Exit */ -# define CCR_BREXT (0x20) /* Bit 5: STANDBY/IDLE exit on BUSREQ */ -# define CCR_LNPHI (0x10) /* Bit 4: 33% Drive on EXTPHI Clock */ -# define CCR_LNIO (0x04) /* Bit 2: 33% Drive on certain external I/O */ -# define CCR_LNCPUCTLR (0x02) /* Bit 1: 33% Drive on CPU control signals */ -# define LNADDATA (0x01) /* Bit 0: 33% drive on A10–A0, D7–D0 */ -#endif - +/* DMA Registers ********************************************************************/ /* DMA Destination Address Register Channel 0 (DAR0 I/O Address 0x23 to 0x25) -- 8-bit data */ -/*DMA Byte Count Register Channel 0 (BCR0 I/O Address = 0x26 to 0x27) -- 8-bit data */ +/* DMA Byte Count Register Channel 0 (BCR0 I/O Address = 0x26 to 0x27) -- 8-bit data */ /* DMA Memory Address Register Channel 1 (MAR1: I/O Address = 0x28 to 0x2a) -- 8-bit data */ /* DMA I/O Address Register Channel 1 (IAR1: I/O Address = 0x2b to 0x2c) -- 8-bit data */ @@ -327,6 +467,29 @@ # define DCNTL_DIM_IO2MI (2 << DCNTL_DIM_SHIFT) /* I/O to memory, increment MARI */ # define DCNTL_DIM_IO2MD (3 << DCNTL_DIM_SHIFT) /* I/O to memory, decrement MARI */ +/* System Control Registers *********************************************************/ +/* Clock Multiplier Register (CMR: 0x1e) (Z8S180/L180-Class Processors Only) */ + +#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ +# define CMR_CMM (0x80) /* Bit 7: X2 Clock Multiplier Mode */ +#endif + +/* CPU Control Register (CCR: 0x1f) (Z8S180/L180-Class Processors Only) */ + +#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ +# define CCR_XTAL_DIV (0x80) /* Bit 7: Clock Divide */ +# define CCR_STBYIDLE (0x48) /* Bits 3 & 6: STANDBY/IDLE mode */ +# define CCR_NOSTDBY (0x00) /* No STANDBY */ +# define CCR_IDLE (0x08) /* IDLE after SLEEP */ +# define CCR_STBY (0x40) /* STANDBY after SLEEP */ +# define CCR_STBY64 (0x48) /* STANDBY after SLEEP 64 Cycle Exit */ +# define CCR_BREXT (0x20) /* Bit 5: STANDBY/IDLE exit on BUSREQ */ +# define CCR_LNPHI (0x10) /* Bit 4: 33% Drive on EXTPHI Clock */ +# define CCR_LNIO (0x04) /* Bit 2: 33% Drive on certain external I/O */ +# define CCR_LNCPUCTLR (0x02) /* Bit 1: 33% Drive on CPU control signals */ +# define LNADDATA (0x01) /* Bit 0: 33% drive on A10-A0, D7-D0 */ +#endif + /* Interrupt Vector Low Register (IL: 0x33) */ #define IL_SHIFT (5) /* Bits 5-7: 3-bits of vector interrupt table address */ @@ -375,4 +538,34 @@ # define ICR_IOA7 (2 << ICR_IOA_SHIFT) #define ICR_IOSTP (0x20) /* Bit 5: Enable I/O stop mode */ +/* Registers unique to Z8x181 class CPUs ********************************************/ + +#ifdef HAVE_Z8X181 +/* To be provided */ + +/* PIA Registers */ + +/* CTC Registers */ + +/* SCC Registers */ + +/* System Control Registers */ + +#endif + +/* Registers unique to Z8x182 class CPUs ********************************************/ + +#ifdef HAVE_Z8X182 +/* To be provided */ + +/* PIA Registers */ + +/* ESCC Registers */ + +/* System Control Registers */ + +/* 16550 MIMIC Registers */ + +#endif + #endif /* __ARCH_Z80_SRC_Z180_Z180_IOMAP_H */ diff --git a/nuttx/configs/p112/README.txt b/nuttx/configs/p112/README.txt index 6b6f5964d..70beeceac 100644 --- a/nuttx/configs/p112/README.txt +++ b/nuttx/configs/p112/README.txt @@ -1,5 +1,5 @@ P112 README -^^^^^^^^^^^ +=========== The P112 is notable because it was the first of the hobbyist single board computers to reach the production stage. The P112 hobbyist computers @@ -24,3 +24,108 @@ Gulczynski makes additional P112 derivative hobbyist home brew computers. Hal Bower was very active in the mid 1990's on the P112 project and ported the "Banked/Portable BIOS". +Pin Configuration +================= + +The P112 is based on the 5V Z8018216FSG running at 16MHz. The Z8018216FSG +comes in a 100-pin QFP package: + +PIN NAME + 1 /INT0 INT0, pulled up, J1 DIN48 pin 13C + 2 /INT1/PC6 FINTR, Floppy disk controller + 3 /INT2/PC7 PINTR1, Floppy disk controller + 4 ST ST, to AEN of Floppy disk controller + 5 A0 A0-A12 Common memory bus + ... + 17 A12 " " + 18 VSS --- + 19 A13 A13-A17 Common memory bus + ... + 23 A17 " " + 24 A18/TOUT A18 Common memory bus + 25 VDD --- + 26 A19 A19 Common memory bus + 27 D0 D0-D4 Common memory bus + ... + 30 D3 " " + + 31 D4 D4-D7 Common memory bus + ... + 34 D7 " " + 35 /RTS0/PB0 RTS0, 20-pin P14, pin 3 + 36 /CTS0/PB1 CTS0, pulled high (U16), 20-pin P14, pin 4 + 37 /DCD0/PB2 DCD0, pulled high (U16), 20-pin P14, pin 10 + 38 TXA0/PB3 TXA0, 20-pin P14, pin 8 + 39 RXA0/PB4 RXA0, pulled high (U17), 20-pin P14, pin 2 + 40 TXA1/PB5 TXA1, 20-pin P14, pin 1 + 41 RXA1/PB6 RXA1, pulled high (U17), 20-pin P14, pin 9 + 42 RXS//CTS1/PB7 CTS1, pulled high (U17), 20-pin P14, pin 7 + 43 CKA0//DREQ0 /DREQ0, DMA Request Select, 5-pin P2, pin 2 + 44 VSS --- + 45 CKA1//TEND0 /TEND0, J1 DIN48 pin 14A + 46 TXS//DTR//REQB//HINTR DTRB, 20-pin P14, pin 6 + 47 CKS//W//REQB//HTXRDY SIORQ, DMA Request Select, 5-pin P2, pin 5 (may be DREQ 0 or DREQ1) + 48 /DREQ1 /DREQ1, DMA Request Select, 5-pin P2, pin 4 + 49 VDD --- + 50 /TEND1//RTSB//HRXRDY NB /TEND1 = RTSB, 20-pin P14, pin 5; J1 DIN48 pin 14B + + 51 /RAMCS /RAMCS, Chip select logic (U11B); also J1 DIN48 pin 9B + 52 /ROMCS /ROMCS, Chip select logic (P2); also J1 DIN48 pin 12B + 53 EV1 Grounded + 54 EV2 Grounded + 55 PA0/HD0 IO, U6 DS1202 Serial Timekeeping chip + 56 PA1/HD1 CLK, U6 DS1202 Serial Timekeeping chip + 57 PA2/HD2 /RST, U6 DS1202 Serial Timekeeping chip + 58 PA3/HD3 N/C + 59 PA4/HD4 N/C + 60 PA5/HD5 U12 NMF0512S, Isolated 1W regulated single output DC/DC converter + 61 PA6/HD6 DSR, U7 LT1133, Advanced Low Power 5V RS232 Driver/Receiver + 62 PA7/HD7 RTS, U7 LT1133, Advanced Low Power 5V RS232 Driver/Receiver + 63 /W//REQA/PC5 WREQA, N/C + 64 /DTR//REQA/PC3 DTRA, U7 LT1133, Advanced Low Power 5V RS232 Driver/Receiver + 65 /MWR/PC2//RTSA /MWR, Common memory bus signal + 66 /CTSA/PC1 CTSA, U7 LT1133, Advanced Low Power 5V RS232 Driver/Receiver + 67 /DCDA/PC0 DCDA, U7 LT1133, Advanced Low Power 5V RS232 Driver/Receiver + 68 /SYNCA/PC4 SYNCA, U7 LT1133, Advanced Low Power 5V RS232 Driver/Receiver + 69 /RTXCA ? + 70 VSS --- + 71 /IOCS/IEO /IOCS, Logic circuit with M1, generates LIVE which conditions inputs + to the floppy disk controller + 72 IEI IEI, J1 DIN48 pin 14C + 73 VDD --- + 74 RXDA RXDA, U7 LT1133, Advanced Low Power 5V RS232 Driver/Receiver + 75 /TRXCA ? + 76 TXDA TXDA, U7 LT1133, Advanced Low Power 5V RS232 Driver/Receiver + 77 /DCDB//HRD DCDB, pulled high (U16), 20-pin P14, pin 12 + 78 /CTSB//HWR DCDB, pulled high (U17), 20-pin P14, pin 11 + 79 TXDB//HDDIS TXDB, 20-pin P14, pin 14 + 80 /TRXCB/HA0 TRXCB, pulled high (U17), 20-pin P14, pin 15 + + 81 RXDB/HA1 RXDB, pulled high (U16), 20-pin P14, pin 16 + 82 /RTXCB/HA2 RTXCB, pulled high (U17), 20-pin P14, pin 17 + 83 /SYNCB//HCS SYNCB, pulled high (U16), 20-pin P14, pin 18 + 84 /HALT ? + 85 /RFSH ? + 86 /IORQ /IORQ, J1 DIN48 pin 12A + 87 /MRD//MREQ /MRD, Common memory bus signal + 88 E E, Conditions inputs to floppy disk controller; also J1 DIN48 pin 13B + 89 /M1 /M1, Logic circuit with /IOCS, generates LIVE which conditions inputs + to the floppy disk controller; also J1 DIN48 pin 11A + 90 /WR /WR, Common memory bus; Conditions inputs to floppy disk controller; + also J1 DIN48 pin 12C + 91 /RD /RD, J1 DIN48 pin 11C + 92 PHI PHI, J1 DIN48 pin 15B + 93 VSS --- + 94 XTAL 16 MHz XTAL + 95 EXTAL 16 MHz XTAL + 96 /WAIT /WAIT, J1 DIN48 pin 11B + 97 /BUSACK ? + 98 /BUSREQ /BUSREQ, Pulled high + 99 /RESET /RST (to lots of places) +100 /NMI /NMI, Pulled high + +P112 Serial Console +=================== + +The serial console is proved by U7 LT1133, Advanced Low Power 5V RS232 Driver/Receiver +that connects to the P112 via the Z85230 ESCC channel A. diff --git a/nuttx/configs/xtrs/src/xtr_irq.c b/nuttx/configs/xtrs/src/xtr_irq.c index 72f6c10e2..e72c0be3b 100644 --- a/nuttx/configs/xtrs/src/xtr_irq.c +++ b/nuttx/configs/xtrs/src/xtr_irq.c @@ -71,7 +71,7 @@ void up_irqinitialize(void) { - /* Attach the timer interrupt -- There is not special timer interrupt + /* Attach the timer interrupt -- There is no special timer interrupt * enable in the simulation so it must be enabled here before interrupts * are enabled. * @@ -97,10 +97,12 @@ void up_irqinitialize(void) * ****************************************************************************/ +#ifndef CONFIG_ARCH_NOINTC void up_disable_irq(int irq) { irqrestore(0); } +#endif /**************************************************************************** * Name: up_enable_irq @@ -110,7 +112,9 @@ void up_disable_irq(int irq) * ****************************************************************************/ +#ifndef CONFIG_ARCH_NOINTC void up_enable_irq(int irq) { - irqrestore(true); + irqrestore(Z80_C_FLAG); } +#endif diff --git a/nuttx/configs/z80sim/src/z80_irq.c b/nuttx/configs/z80sim/src/z80_irq.c index eb1901d27..c7566f6d3 100644 --- a/nuttx/configs/z80sim/src/z80_irq.c +++ b/nuttx/configs/z80sim/src/z80_irq.c @@ -97,10 +97,12 @@ void up_irqinitialize(void) * ****************************************************************************/ +#ifndef CONFIG_ARCH_NOINTC void up_disable_irq(int irq) { irqrestore(0); } +#endif /**************************************************************************** * Name: up_enable_irq @@ -110,7 +112,9 @@ void up_disable_irq(int irq) * ****************************************************************************/ +#ifndef CONFIG_ARCH_NOINTC void up_enable_irq(int irq) { - irqrestore(true); + irqrestore(Z80_C_FLAG); } +#endif -- cgit v1.2.3 From 7dcb78d3c4563ce9394b5b9d6a74bcd31177e8b6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 13 Dec 2012 21:49:11 +0000 Subject: Finsh Z80181/182 register bit definition git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5435 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z80/src/z180/z180_iomap.h | 471 +++++++++++++++++++++++++++++------ nuttx/configs/p112/README.txt | 3 +- 2 files changed, 396 insertions(+), 78 deletions(-) (limited to 'nuttx') diff --git a/nuttx/arch/z80/src/z180/z180_iomap.h b/nuttx/arch/z80/src/z180/z180_iomap.h index c4c996f81..4a695f95d 100644 --- a/nuttx/arch/z80/src/z180/z180_iomap.h +++ b/nuttx/arch/z80/src/z180/z180_iomap.h @@ -164,10 +164,10 @@ /* CTC Registers */ -# define Z181_CTC0 0xe4 /* CTC Channel 0 Control Register */ -# define Z181_CTC1 0xe5 /* CTC Channel 1 Control Register */ -# define Z181_CTC2 0xe6 /* CTC Channel 2 Control Register */ -# define Z181_CTC3 0xe7 /* CTC Channel 3 Control Register */ +# define Z181_CTC0 0xe4 /* CTC Channel 0 Control/Vector Register */ +# define Z181_CTC1 0xe5 /* CTC Channel 1 Control/Vector Register */ +# define Z181_CTC2 0xe6 /* CTC Channel 2 Control/Vector Register */ +# define Z181_CTC3 0xe7 /* CTC Channel 3 Control/Vector Register */ /* SCC Registers */ @@ -177,7 +177,7 @@ /* System Control Registers */ # define Z181_RAM_UBR 0xea /* RAM Upper Boundary Address Register */ -# define Z181_RAM_LBR 0xeb /* RAM Lower Boundary Address Register*/ +# define Z181_RAM_LBR 0xeb /* RAM Lower Boundary Address Register */ # define Z181_ROM_BR 0xec /* ROM Address Boundary Register */ # define Z181_SCR 0xed /* System Configuration Register */ #endif @@ -185,58 +185,57 @@ /* Registers unique to Z8x182 class CPUs */ #ifdef HAVE_Z8X182 -# define Z182_WSGCS 0xd8 /* WSG Chip Select Register */ -# define Z182_ENH182 0xd9 /* Z80182 Enhancements Register */ -# define Z182_INTEDGE 0xdf /* Interrupt Edge/Pin MUX Control */ -# define Z182_PINMUX 0xdf /* Interrupt Edge/Pin MUX Control */ +# define Z182_WSGCS 0xd8 /* WSG Chip Select Register */ +# define Z182_ENH182 0xd9 /* Z80182 Enhancements Register */ +# define Z182_INTEDGE 0xdf /* Interrupt Edge/Pin MUX Control */ /* PIA Registers */ -# define Z182_PA_DDR 0xed /* PA Data Direction Register */ -# define Z182_PA_DR 0xee /* PA Data Register */ -# define Z182_PB_DDR 0xe4 /* PB Data Direction Register */ -# define Z182_PB_DR 0xe5 /* PB Data Register */ -# define Z182_PC_DDR 0xdd /* PC Data Direction Register */ -# define Z182_PC_DR 0xde /* PC Data Register */ +# define Z182_PA_DDR 0xed /* PA Data Direction Register */ +# define Z182_PA_DR 0xee /* PA Data Register */ +# define Z182_PB_DDR 0xe4 /* PB Data Direction Register */ +# define Z182_PB_DR 0xe5 /* PB Data Register */ +# define Z182_PC_DDR 0xdd /* PC Data Direction Register */ +# define Z182_PC_DR 0xde /* PC Data Register */ /* ESCC Registers */ -# define Z182_ESCCA_CR 0xe0 /* ESCC Chan A Control Register */ -# define Z182_ESCCA_DR 0xe1 /* ESCC Chan A Data Register */ -# define Z182_ESCCB_CR 0xe2 /* ESCC Chan B Control Register */ -# define Z182_ESCCB_DR 0xe3 /* ESCC Chan B Data Register */ +# define Z182_ESCCA_CR 0xe0 /* ESCC Chan A Control Register */ +# define Z182_ESCCA_DR 0xe1 /* ESCC Chan A Data Register */ +# define Z182_ESCCB_CR 0xe2 /* ESCC Chan B Control Register */ +# define Z182_ESCCB_DR 0xe3 /* ESCC Chan B Data Register */ /* System Control Registers */ -# define Z182_RAM_UBR 0xe6 /* RAMUBR RAM Upper Boundary Register */ -# define Z182_RAM_LBR 0xe7 /* RAMLBR RAM Lower Boundary Register */ -# define Z182_ROM_BR 0xe8 /* ROM Address Boundary Register */ -# define Z182_SCR 0xef /* System Configuration Register */ +# define Z182_RAM_UBR 0xe6 /* RAMUBR RAM Upper Boundary Register */ +# define Z182_RAM_LBR 0xe7 /* RAMLBR RAM Lower Boundary Register */ +# define Z182_ROM_BR 0xe8 /* ROM Address Boundary Register */ +# define Z182_SCR 0xef /* System Configuration Register */ /* 16550 MIMIC Registers */ -# define Z182_MIMIC_FCR 0xe9 /* FIFO Control Register */ -# define Z182_MIMIC_MM 0xe9 /* MM register */ -# define Z182_MIMIC_RTTC 0xea /* Receive Timeout Time Constant */ -# define Z182_MIMIC_TTTC 0xeb /* Transmit Timeout Time Constant */ -# define Z182_MIMIC_FSCR 0xec /* FIFO Status and Control */ -# define Z182_MIMIC_RBR 0xf0 /* Receive Buffer Register */ -# define Z182_MIMIC_THR 0xf0 /* Transmit Holding Register */ -# define Z182_MIMIC_IER 0xf1 /* Interrupt Enable Register */ -# define Z182_MIMIC_LCR 0xf3 /* Line Control Register */ -# define Z182_MIMIC_MCR 0xf4 /* Modem Control Register */ -# define Z182_MIMIC_LSR 0xf5 /* Line Status Register */ -# define Z182_MIMIC_MSR 0xf6 /* Modem Status Register */ -# define Z182_MIMIC_SCR 0xf7 /* Scratch Register */ -# define Z182_MIMIC_DLL 0xf8 /* Divisor Latch (LSByte) */ -# define Z182_MIMIC_DLM 0xf9 /* Divisor Latch (MSByte) */ -# define Z182_MIMIC_TTCR 0xfa /* Transmit Time Constant */ -# define Z182_MIMIC_RTCR 0xfb /* Receive Time Constant */ -# define Z182_MIMIC_IVEC 0xfc /* Interrupt Vector */ -# define Z182_MIMIC_IE 0xfd /* Interrupt Enable */ - -# define Z182_MIMIC_IUSIP 0xfe /* Interrupt Under-Service/Interrupt Pending */ -# define Z182_MIMIC_MMC 0xff /* MIMIC Master Control Register */ +# define Z182_MIMIC_FCR 0xe9 /* FIFO Control Register */ +# define Z182_MIMIC_MM 0xe9 /* MM register */ +# define Z182_MIMIC_RTTC 0xea /* Receive Timeout Time Constant */ +# define Z182_MIMIC_TTTC 0xeb /* Transmit Timeout Time Constant */ +# define Z182_MIMIC_FSCR 0xec /* FIFO Status and Control */ +# define Z182_MIMIC_RBR 0xf0 /* Receive Buffer Register */ +# define Z182_MIMIC_THR 0xf0 /* Transmit Holding Register */ +# define Z182_MIMIC_IER 0xf1 /* Interrupt Enable Register */ +# define Z182_MIMIC_LCR 0xf3 /* Line Control Register */ +# define Z182_MIMIC_MCR 0xf4 /* Modem Control Register */ +# define Z182_MIMIC_LSR 0xf5 /* Line Status Register */ +# define Z182_MIMIC_MSR 0xf6 /* Modem Status Register */ +# define Z182_MIMIC_SCR 0xf7 /* Scratch Register */ +# define Z182_MIMIC_DLL 0xf8 /* Divisor Latch (LSByte) */ +# define Z182_MIMIC_DLM 0xf9 /* Divisor Latch (MSByte) */ +# define Z182_MIMIC_TTCR 0xfa /* Transmit Time Constant */ +# define Z182_MIMIC_RTCR 0xfb /* Receive Time Constant */ +# define Z182_MIMIC_IVEC 0xfc /* Interrupt Vector */ +# define Z182_MIMIC_IE 0xfd /* Interrupt Enable */ + +# define Z182_MIMIC_IUSIP 0xfe /* Interrupt Under-Service/Interrupt Pending */ +# define Z182_MIMIC_MMC 0xff /* MIMIC Master Control Register */ /* Some of the MIMIC registers are accessible to memory-mapped addresses */ @@ -255,33 +254,47 @@ #endif /* [E]SCC Internal Register Definitions */ +/* Read Registers. The SCC contains eight read registers. To read the contents + * of a register (rather than RR0), the program must first initialize a pointer + * to WR0 in exactly the same manner as a write operation. The next I/O read + * cycle will place the contents of the selected read registers onto the data bus + */ + +#define Z18X_SCC_RR0 0x00 /* Transmit and Receive buffer status and external status */ +#define Z18X_SCC_RR1 0x01 /* Special Receive Condition status */ +#define Z18X_SCC_RR2 0x02 /* Interrupt vector (modified if VIS Bit in WR9 is set) */ +#define Z18X_SCC_RR3 0x03 /* Interrupt pending bits */ +#define Z18X_SCC_RR6 0x06 /* SDLC FIFO byte counter lower byte (only when enabled) */ +#define Z18X_SCC_RR7 0x07 /* SDLC FIFO byte count and status (only when enabled) */ +#define Z18X_SCC_RR8 0x08 /* Receive buffer */ +#define Z18X_SCC_RR10 0x0a /* Miscellaneous status bits */ +#define Z18X_SCC_RR12 0x0c /* Lower byte of baud rate generator time constant */ +#define Z18X_SCC_RR13 0x0d /* Upper byte of baud rate generator time constant */ +#define Z18X_SCC_RR15 0x0f /* External Status interrupt information */ + +/* Write Registers. The SCC contains fifteen write registers that are programmed + * to configure the operating modes of the channel. With the exception of WR0, programming + * the write registers is a two step operation. The first operation is a pointer written to + * WR0 that points to the selected register. The second operation is the actual contro + * word that is written into the register to configure the SCC channel + */ -#define Z18X_SCC_RR0 0x00 -#define Z18X_SCC_RR1 0x01 -#define Z18X_SCC_RR2 0x02 -#define Z18X_SCC_RR3 0x03 -#define Z18X_SCC_RR6 0x06 -#define Z18X_SCC_RR7 0x07 -#define Z18X_SCC_RR10 0x0a -#define Z18X_SCC_RR12 0x0c -#define Z18X_SCC_RR13 0x0d -#define Z18X_SCC_RR15 0x0f - -#define Z18X_SCC_WR0 0x00 -#define Z18X_SCC_WR1 0x01 -#define Z18X_SCC_WR2 0x02 -#define Z18X_SCC_WR3 0x03 -#define Z18X_SCC_WR4 0x04 -#define Z18X_SCC_WR5 0x05 -#define Z18X_SCC_WR6 0x06 -#define Z18X_SCC_WR7 0x07 -#define Z18X_SCC_WR9 0x09 -#define Z18X_SCC_WR10 0x0a -#define Z18X_SCC_WR11 0x0b -#define Z18X_SCC_WR12 0x0c -#define Z18X_SCC_WR13 0x0d -#define Z18X_SCC_WR14 0x0e -#define Z18X_SCC_WR15 0x0f +#define Z18X_SCC_WR0 0x00 /* Register Pointers, various initialization commands */ +#define Z18X_SCC_WR1 0x01 /* Transmit and Receive interrupt enables, WAIT/DMA commands */ +#define Z18X_SCC_WR2 0x02 /* Interrupt Vector */ +#define Z18X_SCC_WR3 0x03 /* Receive parameters and control modes */ +#define Z18X_SCC_WR4 0x04 /* Transmit and Receive modes and parameters */ +#define Z18X_SCC_WR5 0x05 /* Transmit parameters and control modes */ +#define Z18X_SCC_WR6 0x06 /* Sync Character or SDLC address */ +#define Z18X_SCC_WR7 0x07 /* Sync Character or SDLC flag */ +#define Z18X_SCC_WR8 0x08 /* Transmit buffer */ +#define Z18X_SCC_WR9 0x09 /* Master Interrupt control and reset commands */ +#define Z18X_SCC_WR10 0x0a /* Miscellaneous transmit and receive control bits */ +#define Z18X_SCC_WR11 0x0b /* Clock mode controls for receive and transmit */ +#define Z18X_SCC_WR12 0x0c /* Lower byte of baud rate generator */ +#define Z18X_SCC_WR13 0x0d /* Upper byte of baud rate generator */ +#define Z18X_SCC_WR14 0x0e /* Miscellaneous control bits */ +#define Z18X_SCC_WR15 0x0f /* External status interrupt enable control */ /* Z180 Register Bit definitions ****************************************************/ /* ASCI Registers *******************************************************************/ @@ -541,31 +554,335 @@ /* Registers unique to Z8x181 class CPUs ********************************************/ #ifdef HAVE_Z8X181 -/* To be provided */ - /* PIA Registers */ +/* PIAn Data Direction and Data Registers */ + +# define PIA(n) (1 << (n)) /* CTC Registers */ +/* CTC Channel Control/Vector Registers */ +/* Control Bit Definitions */ -/* SCC Registers */ +# define CTC_IE (0x80) /* Bit 7: Interrupt Enable */ +# define CTC_MODE (0x40) /* Bit 6: Mode bit */ +# define CTC_PF (0x20) /* Bit 5: Pre-scaler factor */ +# define CTC_CTES (0x10) /* Bit 4: Clock/Trigger Edge Selector */ +# define CTC_TT (0x08) /* Bit 3: Timer Trigger */ +# define CTC_TC (0x04) /* Bit 2: Time Constant */ +# define CTC_SR (0x02) /* Bit 1: Software Reset */ + +/* Vector Bit Definitions */ + +# define CTC_CHAN_SHIFT (1) /* Bits 1-2: Channel Identifier */ +# define CTC_CHAN_MASK (3 << CTC_CHAN_SHIFT) +# define CTC_VECT_SHIFT (3) /* Bits 3-7: Vector word */ +# define CTC_VECT_MASK (31 << CTC_VECT_SHIFT) + +# define CTC_CNTRL (0x01) /* Bit 0: 0=Vector 1=Control */ + +/* SCC Registers -- See interface description below */ /* System Control Registers */ +/* RAM Upper Boundary Address Register -- 8-bit address (A12-A19) */ +/* RAM Lower Boundary Address Register -- 8-bit address (A12-A19) */ +/* ROM Address Boundary Register -- 8-bit address (A12-A19) */ + +/* System Configuration Register */ + +#define SCR_DCCONFIG (0x40) /* Bit 6: Daisy Chain Configuration */ +#define SCR_ROMCSDIS (0x20) /* Bit 5: Disable /ROMCS */ +#define SCR_REME (0x04) /* Bit 2: ROM Emulator Mode */ +#define SCR_PIA1_CTIO (0x01) /* Bit 0: PIA1 Functions as I/O port or CTC's I/O Pins */ #endif /* Registers unique to Z8x182 class CPUs ********************************************/ #ifdef HAVE_Z8X182 -/* To be provided */ - /* PIA Registers */ +/* Pn Data Direction and Data Register */ -/* ESCC Registers */ +# define PIA(n) (1 << (n)) + +/* ESCC Registers -- See interface description below */ /* System Control Registers */ +# define SCR_PCSEL (0x80) /* Bit 7: Port C Select */ +# define SCR_PB57SEL (0x40) /* Bit 6: Port PB7-PB5 Selec */ +# define SCR_PB04SEL (0x20) /* Bit 5: Port PB4-PB0 Select */ +# define SCR_DOUT (0x10) /* Bit 4: Data Out */ +# define SCR_ROMDIS (0x08) /* Bit 3: Disable ROMs */ +# define SCR_TRIMUX (0x04) /* Bit 2: Tri-Muxed Pins */ +# define SCR_MIMIC (0x02) /* Bit 1: ESCC/MIMIC */ +# define SCR_DC (0x01) /* Bit 0: Daisy Chain */ + /* 16550 MIMIC Registers */ +/* To be provided */ + +#endif +/* [E]SCC Internal Register Definitions *********************************************/ +/* Read Registers */ + +/* RR0: Transmit and Receive buffer status and external status */ + +#define RR0_BA (0x80) /* Bit 7: Break/abort*/ +#define RR0_TXUEOM (0x40) /* Bit 6: Tx Underrun/EOM*/ +#define RR0_CTS (0x20) /* Bit 5: CTS */ +#define RR0_SH (0x10) /* Bit4: Sync/Hunt */ +#define RR0_DCD (0x08) /* Bit 3: DCD */ +#define RR0_TXBE (0x04) /* Bit 2: Tx Buffer Empty */ +#define RR0_ZC (0x02) /* Bit 1: Zero Count*/ +#define RR0_RXA (0x01) /* Bit 0: Rx Character Available */ + +/* RR1: Special Receive Condition status */ + +#define RR0_EOF (0x80) /* Bit 7: End of Frame (SDLC)*/ +#define RR0_CRCFE (0x40) /* Bit 6: CRC/Framing Error */ +#define RR0_RXOE (0x20) /* Bit 5: Rx Overrun Error */ +#define RR0_PE (0x10) /* Bit 4: Parity Error */ +#define RR0_RES0 (0x08) /* Bit 3: Residue Code 0 */ +#define RR0_RES1 (0x04) /* Bit 2: Residue Code 1 */ +#define RR0_RES2 (0x02) /* Bit 1: Residue Code 2 */ +#define RR0_ALL (0x01) /* Bit 0: All Sent*/ + +/* RR2: Interrupt vector (modified if VIS Bit in WR9 is set) -- 8-bit vector value */ + +/* RR3: Interrupt pending bits */ + +#define RR3_RX (0x20) /* Bit 5: Rx IP */ +#define RR3_TX (0x10) /* Bit 4: Tx IP */ +#define RR3_EXT (0x08) /* Bit 3: Ext/Status IP */ + +/* RR6: SDLC FIFO byte counter lower byte (only when enabled) -- 8-bit counter value */ +/* RR7: SDLC FIFO byte count and status (only when enabled) */ + +#define RR7_BC_SHIFT (0) /* Bits 0-5 : Upper 6-bits of counter */ +#define RR7_BC_MASK (0x3f << RR7_BC_SHIFT) +#define RR7_FDA (0x40) /* Bit 6: FIFO Available Status */ +#define RR7_FOS (0x80) /* Bit 7: FIFO Overflow Status */ + +/* RR8: Receive buffer */ +/* RR10: Miscellaneous status bits */ + +#define RR10_1MISS (0x80) /* Bit 7: One Clock Missing */ +#define RR10_2MISS (0x40) /* Bit 6: Two Clocks Mising */ +#define RR10_SEND (0x10) /* Bit 4: Loop Sending */ +#define RR10_ON (0x02) /* Bit 1: On Loop */ + +/* RR12: Lower byte of baud rate generator time constant -- 8-bit time constant value */ +/* RR13: Upper byte of baud rate generator time constant -- 8-bit time constant value */ + +/* RR15: External Status interrupt information */ + +#define RR15_BAIE (0x80) /* Bit 7: Break/Abort IE */ +#define RR15_TXUEOMIE (0x40) /* Bit 6: Tx Underrun/EOM IE */ +#define RR15_CTSIE (0x20) /* Bit 5: CTS IE */ +#define RR15_SHIE (0x10) /* Bit 4: Sync/Hunt IE */ +#define RR15_DCDIE (0x08) /* Bit 3: DCD IE */ +#ifdef HAVE_Z8X182 /* ESCC only */ +# define RR15_SDLCIE (0x04) /* Bit 2: SDLC Status FIFO Enable */ +#endif +#define RR15_ZCIE (0x02) /* Bit 1: Zero Count IE */ + +/* Write Registers */ + +/* WR0: Register Pointers, various initialization commands */ + +#define WR0_CMD1_SHIFT (6) /* Bits 6-7: Command */ +#define WR0_CMD1_MASK (3 << WR0_CMD1_SHIFT); +# define WR0_CMD1_NULL (0 << WR0_CMD1_SHIFT); /* Null Code */ +# define WR0_CMD1_RXCRCRST (1 << WR0_CMD1_SHIFT); /* Reset Rx CRC Checker */ +# define WR0_CMD1_TXCRCRST (2 << WR0_CMD1_SHIFT); /* Reset Tx CRC Generator */ +# define WR0_CMD1_TXURRST (3 << WR0_CMD1_SHIFT); /* Reset Tx Underrun/EOM Latch */ +#define WR0_CMD2_SHIFT (3) /* Bits 3-5: Command */ +#define WR0_CMD2_MASK (3 << WR0_CMD2_SHIFT); +# define WR0_CMD2_NULL (0 << WR0_CMD2_SHIFT); /* Null Code */ +# define WR0_CMD2_HP (1 << WR0_CMD2_SHIFT); /* Point High */ +# define WR0_CMD2_EXTRST (2 << WR0_CMD2_SHIFT); /* Reset Ext/Status Interrupts */ +# define WR0_CMD2_ABORT (3 << WR0_CMD2_SHIFT); /* Send Abort (SDLC) */ +# define WR0_CMD2_ENRX (4 << WR0_CMD2_SHIFT); /* Enable Int on Next Rx Character */ +# define WR0_CMD2_TXPRST (5 << WR0_CMD2_SHIFT); /* Reset Tx Int Pending */ +# define WR0_CMD2_ERRRST (6 << WR0_CMD2_SHIFT); /* Error Reset */ +# define WR0_CMD2_IUSRST (7 << WR0_CMD2_SHIFT); /* Reset Highest IUS */ +#define WR0_REG_SHIFT (0) /* Bits 0-2 : Register address */ +#define WR0_REG_MASK (7 << WR0_REG_SHIFT); + +/* WR1: Transmit and Receive interrupt enables, WAIT/DMA commands */ + +#define WR1_WDMAEN (0x80) /* Bit 7: WAIT/DMA Request Enable */ +#define WR1_WDMAFN (0x40) /* Bit : /WAIT/DMA Request Function */ +#define WR1_WDMAXFR (0x20) /* Bit : WAIT/DMA Request On Receive//Transmit */ +#define WR1_CMD_SHIFT (3) /* Bits 3-4: Command */ +#define WR1_CMD_MASK (3 << WR1_CMD_SHIFT) +# define WR1_CMD_RXDIS (0 << WR1_CMD_SHIFT) /* Rx Int Disable */ +# define WR1_CMD_RXINT1ST (1 << WR1_CMD_SHIFT) /* Rx Int On First Character or Special Condition */ +# define WR1_CMD_RXINTALL (2 << WR1_CMD_SHIFT) /* Int On All Rx Characters or Special Condition */ +# define WR1_CMD_RXINTSPEC (3 << WR1_CMD_SHIFT) /* Rx Int On Special Condition Only */ +#define WR1_PSPEC (0x04) /* Bit 2: Parity is Special Condition */ +#define WR1_TXIE (0x02) /* Bit 1: Tx Int Enable */ +#define WR1_EXTIE (0x01) /* Bit 0: Ext Int Enable */ + +/* WR2: Interrupt Vector -- 8-bit interrupt vector */ + +/* WR3: Receive parameters and control modes */ + +#define WR3_BPC_SHIFT (6) /* Bit 6-7: Bits/character */ +#define WR3_BPC_MASK (3 << WR3_BPC_SHIFT) +# define WR3_BPC_5 (0 << WR3_BPC_SHIFT) /* Rx 5 Bits/Character */ +# define WR3_BPC_7 (1 << WR3_BPC_SHIFT) /* Rx 7 Bits/Character */ +# define WR3_BPC_6 (2 << WR3_BPC_SHIFT) /* Rx 6 Bits/Character */ +# define WR3_BPC_8 (3 << WR3_BPC_SHIFT) /* Rx 8 Bits/Character */ +#define WR3_AE (0x20) /* Bit 5: Auto Enables */ +#define WR3_EHM (0x10) /* Bit 4: Enter Hunt Mode */ +#define WR3_RXCRCEN (0x08) /* Bit 3: Rx CRC Enable */ +#define WR3_ASM (0x04) /* Bit 2: Address Search Mode (SDLC) */ +#define WR3_SCLI (0x02) /* Bit 1: Sync Character Load Inhibit */ +#define WR3_RXEN (0x01) /* Bit 0: Rx Enable */ + +/* WR4: Transmit and Receive modes and parameters */ + +#define WR4_CM_SHIFT (6) /* Bits 6-7: X1 Clock Mode */ +#define WR4_CM_MASK (3 << WR4_CM_SHIFT) +# define WR4_CM_X1 (0 << WR4_CM_SHIFT) /* X1 Clock Mode */ +# define WR4_CM_X16 (1 << WR4_CM_SHIFT) /* X16 Clock Mode */ +# define WR4_CM_X32 (2 << WR4_CM_SHIFT) /* X32 Clock Mode */ +# define WR4_CM_X64 (3 << WR4_CM_SHIFT) /* X64 Clock Mode */ +#define WR4_SM_SHIFT (4) /* Bits 4-5: Sync mode */ +#define WR4_SM_MASK (3 << WR4_SM_SHIFT) +# define WR4_SM_8BIT (0 << WR4_SM_SHIFT) /* 8-Bit Sync Character */ +# define WR4_SM_16BIT (1 << WR4_SM_SHIFT) /* 16-Bit Sync Character */ +# define WR4_SM_SDLC (2 << WR4_SM_SHIFT) /* SDLC Mode (01111110 Flag) */ +# define WR4_SM_EXT (3 << WR4_SM_SHIFT) /* External Sync Mode */ +#define WR4_SB_SHIFT (2) /* Bits 2-3: Sync mode enables */ +#define WR4_SB_MASK (3 << WR4_SB_SHIFT) +# define WR4_SB_SME (0 << WR4_SB_SHIFT) /* Sync Modes Enable */ +# define WR4_SB_STOP1 (1 << WR4_SB_SHIFT) /* 1 Stop Bit/Character */ +# define WR4_SB_STOP1p5 (2 << WR4_SB_SHIFT) /* 1 1/2 Stop Bits/Character */ +# define WR4_SB_STOP2 (3 << WR4_SB_SHIFT) /* 2 Stop Bits/Character */ +#define WR4_PEO (0x02) /* Bit 1: Parity EVEN//ODD */ +#define WR4_PEN (0x01) /* Bit : Parity Enable */ + +/* WR5: Transmit parameters and control modes */ + +#define WR5_DTR (0x80) /* Bit 7: DTR */ +#define WR5_TXBITS_SHIFT (5) /* Bits 5-6: Number of Tx bits */ +#define WR5_TXBITS_MASK (3 << WR5_TXBITS_SHIFT) +# define WR5_TXBITS_5 (0 << WR5_TXBITS_SHIFT) /* Tx 5 Bits(Or Less)/Character */ +# define WR5_TXBITS_7 (1 << WR5_TXBITS_SHIFT) /* Tx 7 Bits/Character */ +# define WR5_TXBITS_6 (2 << WR5_TXBITS_SHIFT) /* Tx 6 Bits/Character */ +# define WR5_TXBITS_8 (3 << WR5_TXBITS_SHIFT) /* Tx 8 Bits/Character */ +#define WR5_SENDBRK (0x10) /* Bit 4: Send Break */ +#define WR5_TXEN (0x08) /* Bit 3: Tx Enable */ +#define WR5_CRC16 (0x04) /* Bit 2: /SDLC/CRC-16 */ +#define WR5_RTS (0x02) /* Bit 1: RTS */ +#define WR5_TXCRCEN (0x01) /* Bit 0: Tx CRC Enable */ + +/* WR6: Sync Character or SDLC address -- 8-bit Monosync, Bisync, or SDLC value */ +/* WR7: Sync Character or SDLC flag -- 8-bit Monosync, Bisync, or SDLC value */ + +#define WR7_SDLC_SYNC (0x7e) + +#ifdef HAVE_Z8X182 /* ESCC only */ +# define WR7P_CRC32EN (0x80) /* Bit 7: 32-bit CRC Enable */ +# define WR7P_EXTRDEN (0x40) /* Bit 6: Extended Read Enable */ +# define WR7P_TXFLVL (0x20) /* Bit 5: Tx FIFO Int Level */ +# define WR7P_TMODE (0x10) /* Bit 4: DTR/REQ Timing Mode */ +# define WR7P_RXFLVL (0x08) /* Bit 3: Rx FIFO Int Level */ +# define WR7P_AUTORTS (0x04) /* Bit 2: Auto RTS Deactivation */ +# define WR7P_AUTOEOM (0x02) /* Bit 1: Auto EOM Reset */ +# define WR7P_AUTOTX (0x01) /* Bit 0: Auto Tx Flag */ +#endif + +/* WR8: Transmit buffer */ + +/* WR9: Master Interrupt control and reset commands */ + +#define WR9_RST_SHIFT (6) /* Bits 6-7: Resets */ +#define WR9_RST_MASK (3 << WR9_RST_SHIFT) +# define WR9_RST_NONE (0 << WR9_RST_SHIFT) /* No Reset */ +# define WR9_RST_CHAN (2 << WR9_RST_SHIFT) /* Channel Reset */ +# define WR9_RST_HWRST (3 << WR9_RST_SHIFT) /* Force Hardware Reset */ +#ifdef HAVE_Z8X182 /* ESCC only */ +# define WR9_INTACKEN (0x20) /* Bit 5: Software INTACK Enable */ +#endif +#define WR9_SHL (0x10) /* Bit 4: Status High//Status Low */ +#define WR9_MIE (0x08) /* Bit 3: MIE */ +#define WR9_DLC (0x04) /* Bit 2: DLC */ +#define WR9_NV (0x02) /* Bit 1: NV */ +#define WR9_VIS (0x01) /* Bit 0: VIS */ + +/* WR10: Miscellaneous transmit and receive control bits */ + +#define WR10_CRCPRE (0x80) /* Bit 7: CRC Preset I/O */ +#define WR10_NRZFM_SHIFT (5) /* Bits 5-6: NRZ/FM */ +#define WR10_NRZFM_MASK (3 << WR10_NRZFM_SHIFT) +# define WR10_NRZ (0 << WR10_NRZFM_SHIFT) /* NRZ */ +# define WR10_NRZI (1 << WR10_NRZFM_SHIFT) /* NRZI */ +# define WR10_FM1 (2 << WR10_NRZFM_SHIFT) /* FM1 (Transition = 1) */ +# define WR10_FM0 (3 << WR10_NRZFM_SHIFT) /* FM0 (Transition = 0) */ +#define WR10_ACTPOLL (0x10) /* Bit 4: Go Active On Poll */ +#define WR10_IDLE (0x08) /* Bit 3: Mark/Flag Idle */ +#define WR10_URABORT (0x04) /* Bit 2: Abort/Flag On Underrun */ +#define WR10_LOOP (0x02) /* Bit 1: Loop Mode */ +#define WR10_68SYNC (0x01) /* Bit 0: 6-Bit//8-Bit Sync */ + +/* WR11: Clock mode controls for receive and transmit */ + +#define WR11_XTAL (0x80) /* Bit 7: /RTxC Xtal//No Xtal */ +#define WR11_RCLK_SHIFT (5) /* Bits 5-6: Receive Clock */ +#define WR11_RCLK_MASK (3 << WR11_RCLK_SHIFT) +# define WR11_RCLK_RTXC (0 << WR11_RCLK_SHIFT) /* Receive Clock = /RTxC Pin */ +# define WR11_RCLK_TRXC (1 << WR11_RCLK_SHIFT) /* Receive Clock = /TRxC Pin */ +# define WR11_RCLK_BRG (2 << WR11_RCLK_SHIFT) /* Receive Clock = BR Generator Output */ +# define WR11_RCLK_DPLL (3 << WR11_RCLK_SHIFT) /* Receive Clock = DPLL Output */ +#define WR11_TCLK_SHIFT (3) /* Bits 3-4: Transmit Clock */ +#define WR11_TCLK_MASK (3 << WR11_TCLK_SHIFT) +# define WR11_TCLK_RTXC (0 << WR11_TCLK_SHIFT) /* Transmit Clock = /RTxC Pin */ +# define WR11_TCLK_TRXC (1 << WR11_TCLK_SHIFT) /* Transmit Clock = /TRxC Pin */ +# define WR11_TCLK_BRG (2 << WR11_TCLK_SHIFT) /* Transmit Clock = BR Generator Output */ +# define WR11_TCLK_DPLL (3 << WR11_TCLK_SHIFT) /* Transmit Clock = DPLL Output */ +#define WR11_TRXCIO (0x04) /* Bit 2: /TRxC O/I */ +#define WR11_TRXCO_SHIFT (0) /* Bits 0-1 : /TRxC Out */ +#define WR11_TRXO_MASK (3 << WR11_TRXCO_SHIFT) +# define WR11_TRXO_XTAL (0 << WR11_TRXCO_SHIFT) /* /TRxC Out = Xtal Output */ +# define WR11_TRXO_TCLK (1 << WR11_TRXCO_SHIFT) /* /TRxC Out = Transmit Clock */ +# define WR11_TRXO_BRG (2 << WR11_TRXCO_SHIFT) /* /TRxC Out = BR Generator Output */ +# define WR11_TRXO_DPLL (3 << WR11_TRXCO_SHIFT) /* /TRxC Out = DPLL Output */ + +/* WR12: Lower byte of baud rate generator -- 8-bit time constant value */ +/* WR13: Upper byte of baud rate generator -- 8-bit time constant value */ + +/* WR14: Miscellaneous control bits */ + +#define WR14_CMD_SHIFT (5) /* Bits 5-7: Command */ +#define WR14_CMD_MASK (7 << WR14_CMD_SHIFT) +# define WR14_CMD_NULL (0 << WR14_CMD_SHIFT) /* Null Command */ +# define WR14_CMD_ESM (1 << WR14_CMD_SHIFT) /* Enter Search Mode */ +# define WR14_CMD_RMCLK (2 << WR14_CMD_SHIFT) /* Reset Missing Clock */ +# define WR14_CMD_DPLLDIS (3 << WR14_CMD_SHIFT) /* Disable DPLL */ +# define WR14_CMD_SRCBRG (4 << WR14_CMD_SHIFT) /* Set Source = BR Generator */ +# define WR14_CMD_SRCRTXC (5 << WR14_CMD_SHIFT) /* Set Source = /RTxC */ +# define WR14_CMD_FM (6 << WR14_CMD_SHIFT) /* Set FM Mode */ +# define WR14_CMD_NRZI (7 << WR14_CMD_SHIFT) /* Set NRZI Mode */ +#define WR14_LPBK (0x10) /* Bit 4: Local Loopback */ +#define WR14_AUTOECHO (0x08) /* Bit 3: Auto Echo */ +#define WR14_DTRREQ (0x04) /* Bit 2: /DTR/Request Function */ +#define WR14_BRGSRC (0x02) /* Bit 1: BR Generator Source */ +#define WR14_BRGEN (0x01) /* Bit 0: BR Generator Enable */ + +/* WR15: External status interrupt enable control */ + +#define WR15_BAIE (0x80) /* Bit 7: Break/Abort IE */ +#define WR15_TXUEOMIE (0x40) /* Bit 6: Tx Underrun/EOM IE */ +#define WR15_CTSIS (0x20) /* Bit 5: CTS IE */ +#define WR15_SHIE (0x10) /* Bit 4: Sync/Hunt IE */ +#define WR15_DCDIE (0x08) /* Bit 3: DCD IE */ +#define WR15_FIFOEN (0x04) /* Bit 2: SDLC FIFO Enable */ +#define WR15_ZCIE (0x02) /* Bit 1: Zero Count IE */ +#ifdef HAVE_Z8X182 /* ESCC only */ +# define WR15_WR7PEN (0x01) /* Bit 0: WR7' SDLC Feature Enable */ #endif #endif /* __ARCH_Z80_SRC_Z180_Z180_IOMAP_H */ diff --git a/nuttx/configs/p112/README.txt b/nuttx/configs/p112/README.txt index 70beeceac..265024cca 100644 --- a/nuttx/configs/p112/README.txt +++ b/nuttx/configs/p112/README.txt @@ -127,5 +127,6 @@ PIN NAME P112 Serial Console =================== -The serial console is proved by U7 LT1133, Advanced Low Power 5V RS232 Driver/Receiver +The UARTs are not used on the P112 board (the UART signals are avaiable off-board through P14). +The serial console is provided by U7 LT1133, Advanced Low Power 5V RS232 Driver/Receiver that connects to the P112 via the Z85230 ESCC channel A. -- cgit v1.2.3 From 9ef2bd0745ecb8cf4c4544acfb84144906648972 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 14 Dec 2012 15:32:26 +0000 Subject: Add framework for z180 SCC driver git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5436 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z80/src/z180/Kconfig | 326 +++++++++++++- nuttx/arch/z80/src/z180/Make.defs | 12 +- nuttx/arch/z80/src/z180/z180_config.h | 140 ++++++ nuttx/arch/z80/src/z180/z180_iomap.h | 34 +- nuttx/arch/z80/src/z180/z180_lowscc.c | 135 ++++++ nuttx/arch/z80/src/z180/z180_modifiyreg8.c | 82 ++++ nuttx/arch/z80/src/z180/z180_scc.c | 697 +++++++++++++++++++++++++++++ 7 files changed, 1402 insertions(+), 24 deletions(-) create mode 100644 nuttx/arch/z80/src/z180/z180_config.h create mode 100644 nuttx/arch/z80/src/z180/z180_lowscc.c create mode 100644 nuttx/arch/z80/src/z180/z180_modifiyreg8.c create mode 100644 nuttx/arch/z80/src/z180/z180_scc.c (limited to 'nuttx') diff --git a/nuttx/arch/z80/src/z180/Kconfig b/nuttx/arch/z80/src/z180/Kconfig index 3082e69cb..d00fa643b 100644 --- a/nuttx/arch/z80/src/z180/Kconfig +++ b/nuttx/arch/z80/src/z180/Kconfig @@ -142,12 +142,334 @@ menu "Z180 Peripheral Support" config Z180_UART0 bool "UART0" default n - select ARCH_HAVE_UART0 + ---help--- + Select to enable a serial port on UART0. On the Z8x182, bits 0-4 of + port B will not be available if ASCI channel 0 is selected. config Z180_UART1 bool "UART1" default n - select ARCH_HAVE_UART1 + ---help--- + Select to enable a serial port on UART1. On the Z8x182, bits 5-7 of + port B will not be available if ASCI channel 0 is selected. + +config Z180_SCC + bool "SCC" + default n + depends on ARCH_CHIP_Z8L181 + ---help--- + Select to enable a serial port on the SCC + +config Z180_ESCCA + bool "ESCC Channel A" + default n + depends on ARCH_CHIP_Z8L182 && !Z180_PORTC + ---help--- + Select to enable a serial port on ESCC Channel A. Not available + if port C is selected. + +config Z180_ESCCB + bool "ESCC Channel B" + default n + depends on ARCH_CHIP_Z8L182 && !Z180_MIMIC + ---help--- + Select to enable a serial port on ESCC Channel B + +config Z180_TMR1 + bool "Timer 1" + default n + ---help--- + Select to enable a Timer 1 (Timer 0 is used by NuttX as the system timer) + +# config Z180_DMA0 +# bool "DMA0" +# default n +# ---help--- +# Select to enable support for DMA0 +# +# config Z180_DMA1 +# bool "DMA1" +# default n +# ---help--- +# Select to enable support for DMA1 + +config Z180_PORTA + bool "PORT A" + default n + depends on ARCH_CHIP_Z8L181 || ARCH_CHIP_Z8L182 || !Z180_CTC + ---help--- + Select to enable a Port A (called PIA1 on the Z8x181) + +config Z180_PORTB + bool "PORT B" + default n + depends on ARCH_CHIP_Z8L181 || ARCH_CHIP_Z8L182 + ---help--- + Select to enable a Port B (called PIA2 on the Z8x181). On the Z8x182, + Bits 5-7 will not be available if ASCI channel 1 is used; Bits 0-4 will + not be available if ASCI channel 0 is used. + +config Z180_PORTC + bool "PORT C" + default n + depends on ARCH_CHIP_Z8L182 && !Z180_ESCCA + ---help--- + Select to enable a Port C. Not available if ESCC channel A is selected. + +config Z180_CTC + bool "CTC" + default n + depends on ARCH_CHIP_Z8L181 + ---help--- + Select to enable the Counter/Timer (CTC) + +config Z180_MIMIC + bool "16550 MIMIC" + default n + depends on ARCH_CHIP_Z8L182 && !Z180_ESCCB + ---help--- + Select to enable the 16550 MIMIC + +endmenu + +choice + prompt "Serial console" + default NO_SERIAL_CONSOLE + +config Z180_UART0_SERIAL_CONSOLE + bool "UART0" + depends on Z180_UART0 + +config Z180_UART1_SERIAL_CONSOLE + bool "UART1" + depends on Z180_UART1 + +config Z180_SCC_SERIAL_CONSOLE + bool "SCC" + depends on Z180_SCC + +config Z180_ESCCA_SERIAL_CONSOLE + bool "ESCC Channel A" + depends on Z180_ESCCA + +config Z180_ESCCB_SERIAL_CONSOLE + bool "ESCC Channel B" + depends on Z180_ESCCB + +endchoice + +menu "UART0 Configuration" + depends on Z180_UART0 + +config Z180_UART0_RXBUFSIZE + int "Receive Buffer Size" + default 64 + help + Characters are buffered as they are received. This specifies + the size of the receive buffer. + +config Z180_UART0_TXBUFSIZE + int "Transmit Buffer Size" + default 64 + help + Characters are buffered before being sent. This specifies + the size of the transmit buffer. + +config Z180_UART0_BAUD + int "Baud Rate" + default 9600 + help + The configured BAUD of the SCC. + +config Z180_UART0_BITS + int "Character Size" + default 8 + help + The number of bits in one character. Must be either 5, 6, 7, or 8. + +config Z180_UART0_PARITY + int "Parity Setting" + default 0 + help + 0=no parity, 1=odd parity, 2=even parity + +config Z180_UART0_2STOP + int "use 2 stop bits" + default 0 + help + 1=Two stop bits + +endmenu + +menu "UART1 Configuration" + depends on Z180_UART1 + +config Z180_UART1_RXBUFSIZE + int "Receive Buffer Size" + default 64 + help + Characters are buffered as they are received. This specifies + the size of the receive buffer. + +config Z180_UART1_TXBUFSIZE + int "Transmit Buffer Size" + default 64 + help + Characters are buffered before being sent. This specifies + the size of the transmit buffer. + +config Z180_UART1_BAUD + int "Baud Rate" + default 9600 + help + The configured BAUD of the SCC. + +config Z180_UART1_BITS + int "Character Size" + default 8 + help + The number of bits in one character. Must be either 5, 6, 7, or 8. + +config Z180_UART1_PARITY + int "Parity Setting" + default 0 + help + 0=no parity, 1=odd parity, 2=even parity + +config Z180_UART1_2STOP + int "use 2 stop bits" + default 0 + help + 1=Two stop bits + +endmenu + +menu "SCC Configuration" + depends on Z180_SCC + +config Z180_SCC_RXBUFSIZE + int "Receive Buffer Size" + default 64 + help + Characters are buffered as they are received. This specifies + the size of the receive buffer. + +config Z180_SCC_TXBUFSIZE + int "Transmit Buffer Size" + default 64 + help + Characters are buffered before being sent. This specifies + the size of the transmit buffer. + +config Z180_SCC_BAUD + int "Baud Rate" + default 9600 + help + The configured BAUD of the SCC. + +config Z180_SCC_BITS + int "Character Size" + default 8 + help + The number of bits in one character. Must be either 5, 6, 7, or 8. + +config Z180_SCC_PARITY + int "Parity Setting" + default 0 + help + 0=no parity, 1=odd parity, 2=even parity + +config Z180_SCC_2STOP + int "use 2 stop bits" + default 0 + help + 1=Two stop bits + +endmenu + +menu "ESCC Channel A Configuration" + depends on Z180_ESCCA + +config Z180_ESCCA_RXBUFSIZE + int "Receive Buffer Size" + default 64 + help + Characters are buffered as they are received. This specifies + the size of the receive buffer. + +config Z180_ESCCA_TXBUFSIZE + int "Transmit Buffer Size" + default 64 + help + Characters are buffered before being sent. This specifies + the size of the transmit buffer. + +config Z180_ESCCA_BAUD + int "Baud Rate" + default 9600 + help + The configured BAUD of the SCC. + +config Z180_ESCCA_BITS + int "Character Size" + default 8 + help + The number of bits in one character. Must be either 5, 6, 7, or 8. + +config Z180_ESCCA_PARITY + int "Parity Setting" + default 0 + help + 0=no parity, 1=odd parity, 2=even parity + +config Z180_ESCCA_2STOP + int "use 2 stop bits" + default 0 + help + 1=Two stop bits + +endmenu + +menu "ESCC Channel B Configuration" + depends on Z180_ESCCB + +config Z180_ESCCB_RXBUFSIZE + int "Receive Buffer Size" + default 64 + help + Characters are buffered as they are received. This specifies + the size of the receive buffer. + +config Z180_ESCCB_TXBUFSIZE + int "Transmit Buffer Size" + default 64 + help + Characters are buffered before being sent. This specifies + the size of the transmit buffer. + +config Z180_ESCCB_BAUD + int "Baud Rate" + default 9600 + help + The configured BAUD of the SCC. + +config Z180_ESCCB_BITS + int "Character Size" + default 8 + help + The number of bits in one character. Must be either 5, 6, 7, or 8. + +config Z180_ESCCB_PARITY + int "Parity Setting" + default 0 + help + 0=no parity, 1=odd parity, 2=even parity + +config Z180_ESCCB_2STOP + int "use 2 stop bits" + default 0 + help + 1=Two stop bits endmenu endif diff --git a/nuttx/arch/z80/src/z180/Make.defs b/nuttx/arch/z80/src/z180/Make.defs index f196c45d7..a50c67f39 100644 --- a/nuttx/arch/z80/src/z180/Make.defs +++ b/nuttx/arch/z80/src/z180/Make.defs @@ -41,14 +41,14 @@ HEAD_ASRC = z180_head.asm endif endif -CMN_ASRCS = -CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_createstack.c +CMN_ASRCS = +CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_createstack.c CMN_CSRCS += up_doirq.c up_exit.c up_idle.c up_initialize.c CMN_CSRCS += up_interruptcontext.c up_mdelay.c up_releasepending.c CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_unblocktask.c CMN_CSRCS += up_udelay.c up_usestack.c -CHIP_ASRCS = z180_restoreusercontext.asm z180_saveusercontext.asm +CHIP_ASRCS = z180_restoreusercontext.asm z180_saveusercontext.asm CHIP_ASRCS += z180_vectcommon.asm ifeq ($(CONFIG_LINKER_ROM_AT_0000),y) @@ -57,6 +57,6 @@ else CHIP_ASRCS += z180_vectors.asm endif -CHIP_CSRCS = z180_copystate.c z180_initialstate.c z180_io.c z180_irq.c -CHIP_CSRCS += z180_mmu.c z180_registerdump.c z180_schedulesigaction.c -CHIP_CSRCS += z180_sigdeliver.c +CHIP_CSRCS = z180_copystate.c z180_initialstate.c z180_io.c z180_irq.c +CHIP_CSRCS += z180_modifiyreg8.c z180_mmu.c z180_registerdump.c +CHIP_CSRCS += z180_schedulesigaction.c z180_sigdeliver.c diff --git a/nuttx/arch/z80/src/z180/z180_config.h b/nuttx/arch/z80/src/z180/z180_config.h new file mode 100644 index 000000000..9f5bb9589 --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_config.h @@ -0,0 +1,140 @@ +/************************************************************************************ + * arch/z80/src/z180/z180_config.h + * + * Copyright (C) 2012 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 __ARCH_Z80_SRC_Z180_Z180_CONFIG_H +#define __ARCH_Z80_SRC_Z180_Z180_CONFIG_H + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include + +#include + +/************************************************************************************ + * Pre-processor Definitions + ************************************************************************************/ +/* Verify that selected features match the capability of the selected CPU */ + +#ifndef HAVE_Z8X181 +# undef CONFIG_Z180_SCC +# undef CONFIG_Z180_CTC +#endif + +#ifndef HAVE_Z8X182 +# undef CONFIG_Z180_ESCCA +# undef CONFIG_Z180_ESCCB +# undef CONFIG_Z180_PORTC +# undef CONFIG_Z180_MIMIC +#endif + +#if !defined(HAVE_Z8X181) && !defined(HAVE_Z8X182) +# undef CONFIG_Z180_PORTA +# undef CONFIG_Z180_PORTB +#endif + +/* Are any UARTs enabled? */ + +#undef HAVE_SERIAL +#if defined(CONFIG_Z180_UART0) || defined(CONFIG_Z180_UART1) || \ + defined(CONFIG_Z180_SCC) || defined(CONFIG_Z180_ESCCA) || \ + defined(CONFIG_Z180_ESCCB) +# define HAVE_SERIAL 1 +#endif + +/* Make sure all features are disabled for disabled UARTs/[E]SCC channels. This + * simplifies checking later. + */ + +#ifndef CONFIG_Z180_UART0 +# undef CONFIG_Z180_UART0_SERIAL_CONSOLE +#endif + +#ifndef CONFIG_Z180_UART1 +# undef CONFIG_Z180_UART1_SERIAL_CONSOLE +#endif + +#ifndef CONFIG_Z180_SCC +# undef CONFIG_SCC_SERIAL_CONSOLE +#endif + +#ifndef CONFIG_Z180_ESCCA +# undef CONFIG_Z180_ESCCA_SERIAL_CONSOLE +#endif + +#ifndef CONFIG_Z180_ESCCA +# undef CONFIG_Z180_ESCCB_SERIAL_CONSOLE +#endif + +/* Is there a serial console? There should be at most one defined. */ + +#if defined(CONFIG_Z180_UART0_SERIAL_CONSOLE) +# undef CONFIG_Z180_UART1_SERIAL_CONSOLE +# undef CONFIG_Z180_SCC_SERIAL_CONSOLE +# undef CONFIG_Z180_ESCCA_SERIAL_CONSOLE +# undef CONFIG_Z180_ESCCB_SERIAL_CONSOLE +# define HAVE_SERIAL_CONSOLE 1 +#elif defined(CONFIG_Z180_UART1_SERIAL_CONSOLE) +# undef CONFIG_Z180_SCC_SERIAL_CONSOLE +# undef CONFIG_Z180_ESCCA_SERIAL_CONSOLE +# undef CONFIG_Z180_ESCCB_SERIAL_CONSOLE +# define HAVE_SERIAL_CONSOLE 1 +#elif defined(CONFIG_Z180_ESCC_SERIAL_CONSOLE) +# undef CONFIG_Z180_ESCCA_SERIAL_CONSOLE +# undef CONFIG_Z180_ESCCB_SERIAL_CONSOLE +# define HAVE_SERIAL_CONSOLE 1 +#elif defined(CONFIG_Z180_ESCCA_SERIAL_CONSOLE) +# undef CONFIG_Z180_ESCCB_SERIAL_CONSOLE +# define HAVE_SERIAL_CONSOLE 1 +#elif defined(CONFIG_Z180_ESCCB_SERIAL_CONSOLE) +# define HAVE_SERIAL_CONSOLE 1 +#else +# undef HAVE_SERIAL_CONSOLE +#endif + +/************************************************************************************ + * Public Types + ************************************************************************************/ + +/************************************************************************************ + * Public Data + ************************************************************************************/ + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +#endif /* __ARCH_Z80_SRC_Z180_Z180_CONFIG_H */ diff --git a/nuttx/arch/z80/src/z180/z180_iomap.h b/nuttx/arch/z80/src/z180/z180_iomap.h index 4a695f95d..c429fe7d3 100644 --- a/nuttx/arch/z80/src/z180/z180_iomap.h +++ b/nuttx/arch/z80/src/z180/z180_iomap.h @@ -106,24 +106,26 @@ /* DMA Registers */ -#define Z180_DMA_SAR0L (SFR_OFFSET+0x20) /* DMA Source Address Register Ch 0L */ -#define Z180_DMA_SAR0H (SFR_OFFSET+0x21) /* DMA Source Address Register Ch 0H */ -#define Z180_DMA_SAR0B (SFR_OFFSET+0x22) /* DMA Source Address Register Ch 0B */ -#define Z180_DMA_DAR0L (SFR_OFFSET+0x23) /* DMA Destination Address Register Ch 0L */ -#define Z180_DMA_DAR0H (SFR_OFFSET+0x24) /* DMA Destination Address Register Ch 0H */ -#define Z180_DMA_DAR0B (SFR_OFFSET+0x25) /* DMA Destination Address Register Ch 0B */ -#define Z180_DMA_BCR0L (SFR_OFFSET+0x26) /* DMA Byte Count Register Ch 0L */ -#define Z180_DMA_BCR0H (SFR_OFFSET+0x27) /* DMA Byte Count Register Ch 0H */ -#define Z180_DMA_MAR1L (SFR_OFFSET+0x28) /* DMA Memory Address Register Ch 1L */ -#define Z180_DMA_MAR1H (SFR_OFFSET+0x29) /* DMA Memory Address Register Ch 1H */ -#define Z180_DMA_MAR1B (SFR_OFFSET+0x2a) /* DMA Memory Address Register Ch 1B */ -#define Z180_DMA_IAR1L (SFR_OFFSET+0x2b) /* DMA I/0 Address Register Ch 1L */ -#define Z180_DMA_IAR1H (SFR_OFFSET+0x2c) /* DMA I/0 Address Register Ch 1H */ +#define Z180_DMA0_SARL (SFR_OFFSET+0x20) /* DMA Source Address Register Ch 0L */ +#define Z180_DMA0_SARH (SFR_OFFSET+0x21) /* DMA Source Address Register Ch 0H */ +#define Z180_DMA0_SARB (SFR_OFFSET+0x22) /* DMA Source Address Register Ch 0B */ +#define Z180_DMA0_DARL (SFR_OFFSET+0x23) /* DMA Destination Address Register Ch 0L */ +#define Z180_DMA0_DARH (SFR_OFFSET+0x24) /* DMA Destination Address Register Ch 0H */ +#define Z180_DMA0_DARB (SFR_OFFSET+0x25) /* DMA Destination Address Register Ch 0B */ +#define Z180_DMA0_BCRL (SFR_OFFSET+0x26) /* DMA Byte Count Register Ch 0L */ +#define Z180_DMA0_BCRH (SFR_OFFSET+0x27) /* DMA Byte Count Register Ch 0H */ + +#define Z180_DMA1_MARL (SFR_OFFSET+0x28) /* DMA Memory Address Register Ch 1L */ +#define Z180_DMA1_MARH (SFR_OFFSET+0x29) /* DMA Memory Address Register Ch 1H */ +#define Z180_DMA1_MARB (SFR_OFFSET+0x2a) /* DMA Memory Address Register Ch 1B */ +#define Z180_DMA1_IARL (SFR_OFFSET+0x2b) /* DMA I/0 Address Register Ch 1L */ +#define Z180_DMA1_IARH (SFR_OFFSET+0x2c) /* DMA I/0 Address Register Ch 1H */ #ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ -# define Z180_DMA_IAR1B (SFR_OFFSET+0x2d) /* DMA I/O Address Register Ch 1B */ +# define Z180_DMA1_IARB (SFR_OFFSET+0x2d) /* DMA I/O Address Register Ch 1B */ #endif -#define Z180_DMA_BCR1L (SFR_OFFSET+0x2e) /* DMA Byte Count Register Ch 1L */ -#define Z180_DMA_BCR1H (SFR_OFFSET+0x2f) /* DMA Byte Count Register Ch 1H */ +#define Z180_DMA1_BCRL (SFR_OFFSET+0x2e) /* DMA Byte Count Register Ch 1L */ +#define Z180_DMA1_BCRH (SFR_OFFSET+0x2f) /* DMA Byte Count Register Ch 1H */ + #define Z180_DMA_DSTAT (SFR_OFFSET+0x30) /* DMA Status Register */ #define Z180_DMA_DMODE (SFR_OFFSET+0x31) /* DMA Mode Register */ #define Z180_DMA_DCNTL (SFR_OFFSET+0x32) /* DMA/WAIT Control Register */ diff --git a/nuttx/arch/z80/src/z180/z180_lowscc.c b/nuttx/arch/z80/src/z180/z180_lowscc.c new file mode 100644 index 000000000..b44414d55 --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_lowscc.c @@ -0,0 +1,135 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_loweruart.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include +#include + +#include "chip/chip.h" +#include "common/up_internal.h" +#include "z80_config.h" + +#ifdef USE_LOWUARTINIT + +/**************************************************************************** + * Private Definitions + ****************************************************************************/ + +/* Select UART parameters for the selected console */ + +#if defined(CONFIG_Z180_SCC_SERIAL_CONSOLE) +# define CONSOLE_CR Z181_SCC_CR +# define CONSOLE_DR Z181_SCC_DR +# define CONSOLE_BAUD CONFIG_Z180_SCC_BAUD +# define CONSOLE_BITS CONFIG_Z180_SCC_BITS +# define CONSOLE_2STOP CONFIG_Z180_SCC_2STOP +# define CONSOLE_PARITY CONFIG_Z180_SCC_PARITY + +#elif defined(CONFIG_Z180_ESCCB_SERIAL_CONSOLE) +# define CONSOLE_CR Z182_ESCCA_CR +# define CONSOLE_DR Z182_ESCCA_DR +# define CONSOLE_BAUD CONFIG_Z180_ESCCA_BAUD +# define CONSOLE_BITS CONFIG_Z180_ESCCA_BITS +# define CONSOLE_2STOP CONFIG_Z180_ESCCA_2STOP +# define CONSOLE_PARITY CONFIG_Z180_ESCCA_PARITY + +#elif defined(CONFIG_Z180_ESCCB_SERIAL_CONSOLE) +# define CONSOLE_CR Z182_ESCCB_CR +# define CONSOLE_DR Z182_ESCCB_DR +# define CONSOLE_BAUD CONFIG_Z180_ESCCB_BAUD +# define CONSOLE_BITS CONFIG_Z180_ESCCB_BITS +# define CONSOLE_PARITY CONFIG_Z180_ESCCB_PARITY +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#if defined(HAVE_SERIAL_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) +static void z180_setbaud(void) +{ +#warning "Missing logic" +} +#endif /* HAVE_SERIAL_CONSOLE && !CONFIG_SUPPRESS_UART_CONFIG */ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_lowuartinit + ****************************************************************************/ + +void up_lowuartinit(void) +{ +#ifdef HAVE_SERIAL +#warning "Missing logic" + + /* Configure for usage of {E]SCC channels (whether or not we have a console) */ + +#ifdef CONFIG_Z180_SCC +#warning "Missing logic" +#endif + +#ifdef CONFIG_Z180_ESCCA +#warning "Missing logic" +#endif + +#ifdef CONFIG_Z180_ESCCB +#warning "Missing logic" +#endif + + /* Configure the console for immediate usage */ + +#if defined(HAVE_SERIAL_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) +#warning "Missing logic" +#endif /* HAVE_SERIAL_CONSOLE && !CONFIG_SUPPRESS_UART_CONFIG */ +#endif /* HAVE_SERIAL */ +} + +#endif /* USE_LOWUARTINIT */ diff --git a/nuttx/arch/z80/src/z180/z180_modifiyreg8.c b/nuttx/arch/z80/src/z180/z180_modifiyreg8.c new file mode 100644 index 000000000..f5494a6b4 --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_modifiyreg8.c @@ -0,0 +1,82 @@ +/**************************************************************************** + * arch/arm/src/common/up_modifyreg8.c + * + * Copyright (C) 2009 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: modifyreg8 + * + * Description: + * Atomically modify the specified bits in a I/O register + * + ****************************************************************************/ + +void modifyreg8(uint16_t addr, uint8_t clearbits, uint8_t setbits) +{ + irqstate_t flags; + uint8_t regval; + + flags = irqsave(); + regval = inp(addr); + regval &= ~clearbits; + regval |= setbits; + outp(regval, addr); + irqrestore(flags); +} diff --git a/nuttx/arch/z80/src/z180/z180_scc.c b/nuttx/arch/z80/src/z180/z180_scc.c new file mode 100644 index 000000000..b15183bda --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_scc.c @@ -0,0 +1,697 @@ +/**************************************************************************** + * arch/z80/src/ez08/z180_scc.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "chip/chip.h" +#include "os_internal.h" +#include "up_internal.h" + +#ifdef USE_SERIALDRIVER + +/**************************************************************************** + * Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +struct z180_dev_s +{ + uint32_t baud; /* Configured baud */ + uint8_t cr; /* [E]SCC control register */ + uint8_t dr; /* [E]SCC data register */ + uint8_t irq; /* IRQ associated with this [E]SCC */ + uint8_t parity; /* 0=none, 1=odd, 2=even */ + uint8_t bits; /* Number of bits (7 or 8) */ + bool stopbits2; /* true: Configure with 2 (vs 1) */ +}; + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static int z180_setup(struct uart_dev_s *dev); +static void z180_shutdown(struct uart_dev_s *dev); +static int z180_attach(struct uart_dev_s *dev); +static void z180_detach(struct uart_dev_s *dev); +static int z180_interrrupt(int irq, void *context); +static int z180_ioctl(struct file *filep, int cmd, unsigned long arg); +static int z180_receive(struct uart_dev_s *dev, unsigned int *status); +static void z180_rxint(struct uart_dev_s *dev, bool enable); +static bool z180_rxavailable(struct uart_dev_s *dev); +static void z180_send(struct uart_dev_s *dev, int ch); +static void z180_txint(struct uart_dev_s *dev, bool enable); +static bool z180_txready(struct uart_dev_s *dev); +static bool z180_txempty(struct uart_dev_s *dev); + +/**************************************************************************** + * Private Variables + ****************************************************************************/ + +struct uart_ops_s g_uart_ops = +{ + z180_setup, /* setup */ + z180_shutdown, /* shutdown */ + z180_attach, /* attach */ + z180_detach, /* detach */ + z180_ioctl, /* ioctl */ + z180_receive, /* receive */ + z180_rxint, /* rxint */ + z180_rxavailable, /* rxavailable */ + z180_send, /* send */ + z180_txint, /* txint */ + z180_txready, /* txready */ + z180_txempty /* txempty */ +}; + +/* I/O buffers */ + +#ifdef CONFIG_Z180_SCC +static char g_scc_rxbuffer[CONFIG_Z180_SCC_RXBUFSIZE]; +static char g_scc_txbuffer[CONFIG_Z180_SCC_TXBUFSIZE]; +#endif +#ifdef CONFIG_Z180_ESCCA +static char g_escca_rxbuffer[CONFIG_Z180_ESCCA_RXBUFSIZE]; +static char g_escca_txbuffer[CONFIG_Z180_ESCCA_TXBUFSIZE]; +#endif +#ifdef CONFIG_Z180_ESCCB +static char g_esccb_rxbuffer[CONFIG_Z180_ESCCB_RXBUFSIZE]; +static char g_esccb_txbuffer[CONFIG_Z180_ESCCB_TXBUFSIZE]; +#endif + +/* This describes the state of the SCC port. */ + +#ifdef CONFIG_Z180_SCC +static const struct z180_dev_s g_scc_priv = +{ + CONFIG_Z180_SCC_BAUD, /* baud */ + Z181_SCC_CR, /* cr */ + Z181_SCC_DR, /* dr */ + Z180_SCC_IRQ, /* irq */ + CONFIG_Z180_SCC_PARITY, /* parity */ + CONFIG_Z180_SCC_BITS, /* bits */ + CONFIG_Z180_SCC_2STOP /* stopbits2 */ +}; + +static uart_dev_t g_scc_port = +{ + 0, /* open_count */ + false, /* xmitwaiting */ + false, /* recvwaiting */ +#ifdef CONFIG_Z180_SCC_SERIAL_CONSOLE + true, /* isconsole */ +#else + false, /* isconsole */ +#endif + { 0 }, /* closesem */ + { 0 }, /* xmitsem */ + { 0 }, /* recvsem */ + { + { 0 }, /* xmit.sem */ + 0, /* xmit.head */ + 0, /* xmit.tail */ + CONFIG_Z180_SCC_TXBUFSIZE, /* xmit.size */ + g_scc_txbuffer, /* xmit.buffer */ + }, + { + { 0 }, /* recv.sem */ + 0, /* recv.head */ + 0, /* recv.tail */ + CONFIG_Z180_SCC_RXBUFSIZE, /* recv.size */ + g_scc_rxbuffer, /* recv.buffer */ + }, + &g_uart_ops, /* ops */ + &g_scc_priv, /* priv */ +}; +#endif + +/* This describes the state of the ESCC Channel A port. */ + +#ifdef CONFIG_Z180_ESCCA +static const struct z180_dev_s g_escca_priv = +{ + CONFIG_Z180_ESCCA_BAUD, /* baud */ + Z182_ESCCA_CR, /* cr */ + Z182_ESCCA_DR, /* dr */ + Z180_UART1_IRQ, /* irq */ + CONFIG_Z180_ESCCA_PARITY, /* parity */ + CONFIG_Z180_ESCCA_BITS, /* bits */ + CONFIG_Z180_ESCCA_2STOP /* stopbits2 */ +}; + +static uart_dev_t g_escca_port = +{ + 0, /* open_count */ + false, /* xmitwaiting */ + false, /* recvwaiting */ +#ifdef CONFIG_Z180_ESCCA_SERIAL_CONSOLE + true, /* isconsole */ +#else + false, /* isconsole */ +#endif + { 0 }, /* closesem */ + { 0 }, /* xmitsem */ + { 0 }, /* recvsem */ + { + { 0 }, /* xmit.sem */ + 0, /* xmit.head */ + 0, /* xmit.tail */ + CONFIG_Z180_ESCCA_TXBUFSIZE, /* xmit.size */ + g_escca_txbuffer, /* xmit.buffer */ + }, + { + { 0 }, /* recv.sem */ + 0, /* recv.head */ + 0, /* recv.tail */ + CONFIG_Z180_ESCCA_RXBUFSIZE, /* recv.size */ + g_escca_rxbuffer, /* recv.buffer */ + }, + &g_uart_ops, /* ops */ + &g_escca_priv, /* priv */ +}; +#endif + +/* This describes the state of the ESCC Channel B port. */ + +#ifdef CONFIG_Z180_ESCCB +static const struct z180_dev_s g_esccb_priv = +{ + CONFIG_Z180_ESCCB_BAUD, /* baud */ + Z182_ESCCB_CR, /* cr */ + Z182_ESCCB_DR, /* dr */ + Z180_UART1_IRQ, /* irq */ + CONFIG_Z180_ESCCB_PARITY, /* parity */ + CONFIG_Z180_ESCCB_BITS, /* bits */ + CONFIG_Z180_ESCCB_2STOP /* stopbits2 */ +}; + +static uart_dev_t g_escca_port = +{ + 0, /* open_count */ + false, /* xmitwaiting */ + false, /* recvwaiting */ +#ifdef CONFIG_Z180_ESCCA_SERIAL_CONSOLE + true, /* isconsole */ +#else + false, /* isconsole */ +#endif + { 0 }, /* closesem */ + { 0 }, /* xmitsem */ + { 0 }, /* recvsem */ + { + { 0 }, /* xmit.sem */ + 0, /* xmit.head */ + 0, /* xmit.tail */ + CONFIG_Z180_ESCCA_TXBUFSIZE, /* xmit.size */ + g_escca_txbuffer, /* xmit.buffer */ + }, + { + { 0 }, /* recv.sem */ + 0, /* recv.head */ + 0, /* recv.tail */ + CONFIG_Z180_ESCCA_RXBUFSIZE, /* recv.size */ + g_escca_rxbuffer, /* recv.buffer */ + }, + &g_uart_ops, /* ops */ + &g_escca_priv, /* priv */ +}; +#endif + +/* Now, which one with be tty0/console and which tty1? NOTE: SCC and ESCCA/B and + * mutually exclusive. + */ + +#undef CONSOLE_DEV +#undef TTYS0_DEV +#undef TTYS1_DEV + +#if defined(CONFIG_Z180_SCC_SERIAL_CONSOLE) +# define CONSOLE_DEV g_scc_port +# define TTYS0_DEV g_scc_port +#elif defined(CONFIG_Z180_SCC) +# define TTYS0_DEV g_scc_port + +#elif defined(CONFIG_Z180_ESCCA_SERIAL_CONSOLE) +# define CONSOLE_DEV g_escca_port +# define TTYS0_DEV g_escca_port +# if defined(CONFIG_Z180_ESCCB) +# define TTYS1_DEV g_esccb_port +# endif + +#elif defined(CONFIG_Z180_ESCCB_SERIAL_CONSOLE) +# define CONSOLE_DEV g_esccb_port +# define TTYS0_DEV g_esccb_port +# if defined(CONFIG_Z180_ESCCA) +# define TTYS1_DEV g_escca_port +# endif + +#elif defined(CONFIG_Z180_ESCCA) +# define TTYS0_DEV g_escca_port +# if defined(CONFIG_Z180_ESCCB) +# define TTYS1_DEV g_esccb_port +# endif + +#elif defined(CONFIG_Z180_ESCCB) +# define TTYS0_DEV g_esccb_port +#endif + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: z180_serialin + ****************************************************************************/ + +static inline uint8_t z180_serialin(struct z180_dev_s *priv, uint8_t regaddr) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_serialout + ****************************************************************************/ + +static inline void z180_serialout(struct z180_dev_s *priv, uint8_t regaddr, + uint8_t value) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_disableuartint + ****************************************************************************/ + +static inline void z180_disableuartint(struct z180_dev_s *priv) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_restoreuartint + ****************************************************************************/ + +static inline void z180_restoreuartint(struct z180_dev_s *priv, uint8_t bits) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_waittxready + ****************************************************************************/ + +static inline void z180_waittxready(struct z180_dev_s *priv) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_setbaud + ****************************************************************************/ + +static inline void z180_setbaud(struct z180_dev_s *priv, uint24_t baud) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_setup + * + * Description: + * Configure the UART baud, bits, parity, fifos, etc. This method is called + * the first time that the serial port is opened. + * + ****************************************************************************/ + +static int z180_setup(struct uart_dev_s *dev) +{ +#ifndef CONFIG_SUPPRESS_UART_CONFIG +# warning "Missing logic" +#endif + return OK; +} + +/**************************************************************************** + * Name: z180_shutdown + * + * Description: + * Disable the UART. This method is called when the serial port is closed + * + ****************************************************************************/ + +static void z180_shutdown(struct uart_dev_s *dev) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_attach + * + * Description: + * Configure the UART to operation in interrupt driven mode. This method is + * called when the serial port is opened. Normally, this is just after the + * the setup() method is called, however, the serial console may operate in + * a non-interrupt driven mode during the boot phase. + * + * RX and TX interrupts are not enabled when by the attach method (unless the + * hardware supports multiple levels of interrupt enabling). The RX and TX + * interrupts are not enabled until the txint() and rxint() methods are called. + * + ****************************************************************************/ + +static int z180_attach(struct uart_dev_s *dev) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_detach + * + * Description: + * Detach UART interrupts. This method is called when the serial port is + * closed normally just before the shutdown method is called. The exception + * is the serial console which is never shutdown. + * + ****************************************************************************/ + +static void z180_detach(struct uart_dev_s *dev) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_interrrupt + * + * Description: + * This is the UART interrupt handler. It will be invoked + * when an interrupt received on the 'irq' It should call + * uart_transmitchars or uart_receivechar to perform the + * appropriate data transfers. The interrupt handling logic\ + * must be able to map the 'irq' number into the approprite + * uart_dev_s structure in order to call these functions. + * + ****************************************************************************/ + +static int z180_interrrupt(int irq, void *context) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_ioctl + * + * Description: + * All ioctl calls will be routed through this method + * + ****************************************************************************/ + +static int z180_ioctl(struct file *filep, int cmd, unsigned long arg) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_receive + * + * Description: + * Called (usually) from the interrupt level to receive one character from + * the UART. Error bits associated with the receipt are provided in the + * the return 'status'. + * + ****************************************************************************/ + +static int z180_receive(struct uart_dev_s *dev, unsigned int *status) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_rxint + * + * Description: + * Call to enable or disable RX interrupts + * + ****************************************************************************/ + +static void z180_rxint(struct uart_dev_s *dev, bool enable) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_rxavailable + * + * Description: + * Return true if the receive fifo is not empty + * + ****************************************************************************/ + +static bool z180_rxavailable(struct uart_dev_s *dev) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_send + * + * Description: + * This method will send one byte on the UART + * + ****************************************************************************/ + +static void z180_send(struct uart_dev_s *dev, int ch) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_txint + * + * Description: + * Call to enable or disable TX interrupts + * + ****************************************************************************/ + +static void z180_txint(struct uart_dev_s *dev, bool enable) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_txready + * + * Description: + * Return true if the tranmsit fifo is not full + * + ****************************************************************************/ + +static bool z180_txready(struct uart_dev_s *dev) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Name: z180_txempty + * + * Description: + * Return true if the transmit fifo is empty + * + ****************************************************************************/ + +static bool z180_txempty(struct uart_dev_s *dev) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_serialinit + * + * Description: + * Register serial console and serial ports. + * + ****************************************************************************/ + +void up_serialinit(void) +{ + uint8_t regval; + + /* Make sure that all UART interrupts are disabled */ +#warning "Missing logic" + + /* Configure for usage of [E]SCC channels */ + +#ifdef CONFIG_Z180_SCC +# warning "Missing logic" +#endif + +#ifdef CONFIG_Z180_ESCCA +# warning "Missing logic" +#endif + +#ifdef CONFIG_Z180_ESCCB +# warning "Missing logic" +#endif + + /* If there is a console, then configure the console now */ + +#ifdef CONSOLE_DEV + CONSOLE_DEV.isconsole = true; + z180_setup(&CONSOLE_DEV); +#endif + + /* Register console and tty devices */ + +#ifdef CONSOLE_DEV + (void)uart_register("/dev/console", &CONSOLE_DEV); +#endif + (void)uart_register("/dev/ttyS0", &TTYS0_DEV); +#ifdef TTYS1_DEV + (void)uart_register("/dev/ttyS1", &TTYS1_DEV); +#endif +} + +/**************************************************************************** + * Name: up_putc + * + * Description: + * Provide priority, low-level access to support OS debug + * writes + * + ****************************************************************************/ + +int up_putc(int ch) +{ +#ifdef CONSOLE_DEV +#warning "Missing logic" + z180_disableuartint(priv); + + /* Check for LF */ + + if (ch == '\n') + { + /* Output CR before LF*/ +#warning "Missing logic" + + } + + /* Output the character */ + +#warning "Missing logic" + + /* Wait for the character to be sent before re-enabling interrupts */ + +#warning "Missing logic" + return ch; +#endif +} + +#else /* USE_SERIALDRIVER */ + +/**************************************************************************** + * Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Private Variables + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: z180_putc + ****************************************************************************/ + +static void z180_putc(int ch) +{ +#warning "Missing logic" +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_putc + ****************************************************************************/ + +int up_putc(int ch) +{ + /* Check for LF */ + + if (ch == '\n') + { + /* Output CR before LF */ + + z180_putc('\r'); + } + + /* Output character */ + + z180_putc(ch); + return ch; +} + +#endif /* USE_SERIALDRIVER */ -- cgit v1.2.3 From 67b2e69b2335d009840b0bd065b2e53cf0352ad7 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 14 Dec 2012 19:15:07 +0000 Subject: More z180 serial logic git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5437 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z80/Kconfig | 60 +++++++++- nuttx/arch/z80/src/common/up_initialize.c | 4 +- nuttx/arch/z80/src/common/up_internal.h | 12 +- nuttx/arch/z80/src/ez80/ez80_lowuart.c | 8 +- nuttx/arch/z80/src/z180/Kconfig | 16 +-- nuttx/arch/z80/src/z180/Make.defs | 4 +- nuttx/arch/z80/src/z180/z180_config.h | 27 ++++- nuttx/arch/z80/src/z180/z180_iomap.h | 10 +- nuttx/arch/z80/src/z180/z180_lowscc.c | 61 +++++++--- nuttx/arch/z80/src/z180/z180_lowserial.c | 112 +++++++++++++++++++ nuttx/arch/z80/src/z180/z180_lowuart.c | 148 +++++++++++++++++++++++++ nuttx/arch/z80/src/z180/z180_scc.c | 78 ++----------- nuttx/arch/z80/src/z180/z180_serial.h | 109 ++++++++++++++++++ nuttx/arch/z80/src/z8/z8_lowuart.c | 8 +- nuttx/configs/ez80f910200kitg/ostest/defconfig | 2 +- nuttx/configs/ez80f910200zco/dhcpd/defconfig | 2 +- nuttx/configs/ez80f910200zco/httpd/defconfig | 2 +- nuttx/configs/ez80f910200zco/nettest/defconfig | 2 +- nuttx/configs/ez80f910200zco/nsh/defconfig | 2 +- nuttx/configs/ez80f910200zco/ostest/defconfig | 2 +- nuttx/configs/ez80f910200zco/poll/defconfig | 2 +- nuttx/configs/p112/ostest/defconfig | 48 ++++---- nuttx/configs/z8encore000zco/ostest/defconfig | 2 +- nuttx/configs/z8f64200100kit/ostest/defconfig | 2 +- 24 files changed, 560 insertions(+), 163 deletions(-) create mode 100644 nuttx/arch/z80/src/z180/z180_lowserial.c create mode 100644 nuttx/arch/z80/src/z180/z180_lowuart.c create mode 100644 nuttx/arch/z80/src/z180/z180_serial.h (limited to 'nuttx') diff --git a/nuttx/arch/z80/Kconfig b/nuttx/arch/z80/Kconfig index 4dcc8255e..7e39a3f8e 100644 --- a/nuttx/arch/z80/Kconfig +++ b/nuttx/arch/z80/Kconfig @@ -18,6 +18,7 @@ config ARCH_CHIP_Z8018006VSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 68-pin PLCC Z80180 @@ -26,6 +27,7 @@ config ARCH_CHIP_Z8018010VSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 68-pin PLCC Z80180 @@ -34,6 +36,7 @@ config ARCH_CHIP_Z8018008VSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 68-pin PLCC Z80180 @@ -42,6 +45,7 @@ config ARCH_CHIP_Z8018010FSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 80-pin QFP (11 pins N/C) Z80180 @@ -50,6 +54,7 @@ config ARCH_CHIP_Z8018008VEG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 68-pin PLCC Z80180 @@ -58,6 +63,7 @@ config ARCH_CHIP_Z8018006VEG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 68-pin PLCC Z80180 @@ -66,6 +72,7 @@ config ARCH_CHIP_Z8018006PSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 64-pin DIP 6 MHz 5V Z80180 @@ -74,6 +81,7 @@ config ARCH_CHIP_Z8018008FSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 80-pin QFP (11 pins N/C) 8MHz 5V Z80180 @@ -82,6 +90,7 @@ config ARCH_CHIP_Z8018010PSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 64-pin DIP 10MHz 5V Z80180 @@ -90,6 +99,7 @@ config ARCH_CHIP_Z8018006PEG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 64-pin DIP 6MHz 5V Z80180 @@ -98,6 +108,7 @@ config ARCH_CHIP_Z8018010VEG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- 68-pin PLCC 10MHz 5V Z80180 @@ -106,6 +117,7 @@ config ARCH_CHIP_Z8018010PEG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 64-pin DIP 10MHz 5V Z80180 @@ -114,6 +126,7 @@ config ARCH_CHIP_Z8018008PSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 64-pin DIP 8MHz 5V Z80180 @@ -122,6 +135,7 @@ config ARCH_CHIP_Z8018006FSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 80-pin QFP (11 pins N/C) 6MHz 5V Z80180 @@ -130,30 +144,35 @@ config ARCH_CHIP_Z8018000XSO select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT config ARCH_CHIP_Z8018010FEG bool "Z8018010FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT config ARCH_CHIP_Z8018000WSO bool "Z8018000WSO" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT config ARCH_CHIP_Z8018008PEG bool "Z8018008PEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 select ADDRENV + select HAVE_LOWSERIALINIT config ARCH_CHIP_Z8018110FEG bool "Z8018110FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80181 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 100-pin QFP Z80181 @@ -162,6 +181,7 @@ config ARCH_CHIP_Z8018233FSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- 100-pin QFP Z80182 @@ -170,6 +190,7 @@ config ARCH_CHIP_Z8018220AEG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 100-pin LQFP 20MHz 5V Z80182 @@ -178,6 +199,7 @@ config ARCH_CHIP_Z8018216FSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 100-pin QFP 16MHz 5V Z80182 @@ -186,6 +208,7 @@ config ARCH_CHIP_Z8018216ASG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 100-pin LQFP Z80182 @@ -194,6 +217,7 @@ config ARCH_CHIP_Z8018233ASG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 100-pin LQFP 33MHz 5V Z80182 @@ -202,6 +226,7 @@ config ARCH_CHIP_Z8019520FSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80195 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 100-pin QFP 20MHz 5V Z80195 @@ -210,6 +235,7 @@ config ARCH_CHIP_Z8019533FSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z80195 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 100-pin QFP 33MHz 5V Z80195 @@ -218,6 +244,7 @@ config ARCH_CHIP_Z8L18020VSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 68-pinn PLCC Z8L180 @@ -226,6 +253,7 @@ config ARCH_CHIP_Z8L18020FSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 80-pin GFP 20MHz 3.3V Z8L180 @@ -234,12 +262,14 @@ config ARCH_CHIP_Z8L18020PSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L180 select ADDRENV + select HAVE_LOWSERIALINIT config ARCH_CHIP_Z8L18220ASG bool "Z8L18220ASG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L182 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 100-pin LQFP Z8L182 @@ -248,6 +278,7 @@ config ARCH_CHIP_Z8L18220FSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L182 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- 100-pin QFP 20MHz 3.3V Z8L182 @@ -256,12 +287,14 @@ config ARCH_CHIP_Z8L18220AEG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L182 select ADDRENV + select HAVE_LOWSERIALINIT config ARCH_CHIP_Z8S18020VSG bool "Z8S18020VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 68-pin PLCC Z8S180 @@ -270,6 +303,7 @@ config ARCH_CHIP_Z8S18020VSG1960 select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 68-pin PLCC Z8S180 @@ -278,6 +312,7 @@ config ARCH_CHIP_Z8S18033VSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 68-pin PLCC Z8S180 @@ -286,6 +321,7 @@ config ARCH_CHIP_Z8S18010FSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- 80-pin QFP Z8S180 @@ -294,6 +330,7 @@ config ARCH_CHIP_Z8S18010VEG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 68-pin PLCC Z8S180 @@ -302,6 +339,7 @@ config ARCH_CHIP_Z8S18020VEG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 68-pin PLCC Z8S180 @@ -310,6 +348,7 @@ config ARCH_CHIP_Z8S18010VSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 68-pin PLCC Z8S180 @@ -318,6 +357,7 @@ config ARCH_CHIP_Z8S18020PSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- 64-pin DIP 10Mhz 5V Z8S180 @@ -326,6 +366,7 @@ config ARCH_CHIP_Z8S18033FSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 80-pin QFP 33MHz 5V Z8S180 @@ -334,6 +375,7 @@ config ARCH_CHIP_Z8S18033FEG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 80-pin QFP 33MHz 5V Z8S180 @@ -342,6 +384,7 @@ config ARCH_CHIP_Z8S18020FSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 80-pin QFP 20MHz 5V Z8S180 @@ -350,6 +393,7 @@ config ARCH_CHIP_Z8S18033VEG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 68-pin PLCC 33MHz 5V Z8S180 @@ -358,6 +402,7 @@ config ARCH_CHIP_Z8S18010PSG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT ---help--- Z180: 64-pin DIP 10MHz 5V Z8S180 @@ -366,25 +411,28 @@ config ARCH_CHIP_Z8S18020FEG select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT config ARCH_CHIP_Z8S18010PEG bool "Z8S18010PEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT config ARCH_CHIP_Z8S18010FEG bool "Z8S18010FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 select ADDRENV + select HAVE_LOWSERIALINIT config ARCH_CHIP_Z8F6403 bool "Z8F6403" select ARCH_CHIP_Z8 select ARCH_CHIP_Z8F640X select ENDIAN_BIG - select HAVE_LOWUARTINIT + select HAVE_LOWSERIALINIT ---help--- ZiLOG Z8F6403 (z8 Encore) @@ -393,28 +441,28 @@ config ARCH_CHIP_Z8F6423 select ARCH_CHIP_Z8 select ARCH_CHIP_Z8F642X select ENDIAN_BIG - select HAVE_LOWUARTINIT + select HAVE_LOWSERIALINIT ---help--- ZiLOG Z8F6423 (z8 Encore) config ARCH_CHIP_EZ80F91 bool "EZ80F91" select ARCH_CHIP_EZ80 - select HAVE_LOWUARTINIT + select HAVE_LOWSERIALINIT ---help--- ZiLOG EZ80F91 (ez80 Acclaim) config ARCH_CHIP_EZ80F92 bool "EZ80F92" select ARCH_CHIP_EZ80 - select HAVE_LOWUARTINIT + select HAVE_LOWSERIALINIT ---help--- ZiLOG EZ80F92 (ez80 Acclaim) config ARCH_CHIP_EZ80F93 bool "EZ80F93" select ARCH_CHIP_EZ80 - select HAVE_LOWUARTINIT + select HAVE_LOWSERIALINIT ---help--- ZiLOG EZ80F93 (ez80 Acclaim) @@ -456,7 +504,7 @@ config ARCH_CHIP_Z8 config ARCH_CHIP_EZ80 bool -config HAVE_LOWUARTINIT +config HAVE_LOWSERIALINIT bool config ARCH_CHIP diff --git a/nuttx/arch/z80/src/common/up_initialize.c b/nuttx/arch/z80/src/common/up_initialize.c index e0b46f7ec..652a7cc88 100644 --- a/nuttx/arch/z80/src/common/up_initialize.c +++ b/nuttx/arch/z80/src/common/up_initialize.c @@ -161,8 +161,8 @@ void up_initialize(void) /* Initialize the serial device driver */ -#ifdef USE_LOWUARTINIT - up_lowuartinit(); +#ifdef USE_LOWSERIALINIT + up_lowserialinit(); #endif /* Initialize the console device driver */ diff --git a/nuttx/arch/z80/src/common/up_internal.h b/nuttx/arch/z80/src/common/up_internal.h index 3adb02a39..def13b546 100644 --- a/nuttx/arch/z80/src/common/up_internal.h +++ b/nuttx/arch/z80/src/common/up_internal.h @@ -70,14 +70,14 @@ #if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) # undef USE_SERIALDRIVER -# ifdef CONFIG_HAVE_LOWUARTINIT -# define USE_LOWUARTINIT 1 +# ifdef CONFIG_HAVE_LOWSERIALINIT +# define USE_LOWSERIALINIT 1 # else -# undef USE_LOWUARTINIT +# undef USE_LOWSERIALINIT # endif #elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0 # define USE_SERIALDRIVER 1 -# undef USE_LOWUARTINIT +# undef USE_LOWSERIALINIT #endif /**************************************************************************** @@ -105,8 +105,8 @@ extern "C" { EXTERN void up_irqinitialize(void); EXTERN int up_timerisr(int irq, FAR chipreg_t *regs); -#ifdef USE_LOWUARTINIT -EXTERN void up_lowuartinit(void); +#ifdef USE_LOWSERIALINIT +EXTERN void up_lowserialinit(void); #endif /* Defined in up_doirq.c */ diff --git a/nuttx/arch/z80/src/ez80/ez80_lowuart.c b/nuttx/arch/z80/src/ez80/ez80_lowuart.c index cc535530d..a67bf7539 100644 --- a/nuttx/arch/z80/src/ez80/ez80_lowuart.c +++ b/nuttx/arch/z80/src/ez80/ez80_lowuart.c @@ -49,7 +49,7 @@ #include "chip/chip.h" #include "common/up_internal.h" -#ifdef USE_LOWUARTINIT +#ifdef USE_LOWSERIALINIT /**************************************************************************** * Private Definitions @@ -176,10 +176,10 @@ static void ez80_setbaud(void) ****************************************************************************/ /**************************************************************************** - * Name: up_lowuartinit + * Name: up_lowserialinit ****************************************************************************/ -void up_lowuartinit(void) +void up_lowserialinit(void) { #ifdef HAVE_SERIAL uint8_t regval; @@ -253,4 +253,4 @@ void up_lowuartinit(void) #endif /* HAVE_SERIAL */ } -#endif /* USE_LOWUARTINIT */ +#endif /* USE_LOWSERIALINIT */ diff --git a/nuttx/arch/z80/src/z180/Kconfig b/nuttx/arch/z80/src/z180/Kconfig index d00fa643b..34297f7a7 100644 --- a/nuttx/arch/z80/src/z180/Kconfig +++ b/nuttx/arch/z80/src/z180/Kconfig @@ -156,14 +156,14 @@ config Z180_UART1 config Z180_SCC bool "SCC" default n - depends on ARCH_CHIP_Z8L181 + depends on ARCH_CHIP_Z80181 || ARCH_CHIP_Z8L181 ---help--- Select to enable a serial port on the SCC config Z180_ESCCA bool "ESCC Channel A" default n - depends on ARCH_CHIP_Z8L182 && !Z180_PORTC + depends on ARCH_CHIP_Z80182 || ARCH_CHIP_Z8L182 ---help--- Select to enable a serial port on ESCC Channel A. Not available if port C is selected. @@ -171,7 +171,7 @@ config Z180_ESCCA config Z180_ESCCB bool "ESCC Channel B" default n - depends on ARCH_CHIP_Z8L182 && !Z180_MIMIC + depends on (ARCH_CHIP_Z80182 || ARCH_CHIP_Z8L182) && !Z180_MIMIC ---help--- Select to enable a serial port on ESCC Channel B @@ -196,14 +196,14 @@ config Z180_TMR1 config Z180_PORTA bool "PORT A" default n - depends on ARCH_CHIP_Z8L181 || ARCH_CHIP_Z8L182 || !Z180_CTC + depends on (ARCH_CHIP_Z80181 || ARCH_CHIP_Z8L181 || ARCH_CHIP_Z80182 || ARCH_CHIP_Z8L182) && !Z180_CTC ---help--- Select to enable a Port A (called PIA1 on the Z8x181) config Z180_PORTB bool "PORT B" default n - depends on ARCH_CHIP_Z8L181 || ARCH_CHIP_Z8L182 + depends on ARCH_CHIP_Z80181 || ARCH_CHIP_Z8L181 || ARCH_CHIP_Z80182 || ARCH_CHIP_Z8L182 ---help--- Select to enable a Port B (called PIA2 on the Z8x181). On the Z8x182, Bits 5-7 will not be available if ASCI channel 1 is used; Bits 0-4 will @@ -212,21 +212,21 @@ config Z180_PORTB config Z180_PORTC bool "PORT C" default n - depends on ARCH_CHIP_Z8L182 && !Z180_ESCCA + depends on (ARCH_CHIP_Z80182 || ARCH_CHIP_Z8L182) && !Z180_ESCCA ---help--- Select to enable a Port C. Not available if ESCC channel A is selected. config Z180_CTC bool "CTC" default n - depends on ARCH_CHIP_Z8L181 + depends on ARCH_CHIP_Z80181 || ARCH_CHIP_Z8L181 ---help--- Select to enable the Counter/Timer (CTC) config Z180_MIMIC bool "16550 MIMIC" default n - depends on ARCH_CHIP_Z8L182 && !Z180_ESCCB + depends on ARCH_CHIP_Z80182 || ARCH_CHIP_Z8L182 ---help--- Select to enable the 16550 MIMIC diff --git a/nuttx/arch/z80/src/z180/Make.defs b/nuttx/arch/z80/src/z180/Make.defs index a50c67f39..7b495e693 100644 --- a/nuttx/arch/z80/src/z180/Make.defs +++ b/nuttx/arch/z80/src/z180/Make.defs @@ -58,5 +58,5 @@ CHIP_ASRCS += z180_vectors.asm endif CHIP_CSRCS = z180_copystate.c z180_initialstate.c z180_io.c z180_irq.c -CHIP_CSRCS += z180_modifiyreg8.c z180_mmu.c z180_registerdump.c -CHIP_CSRCS += z180_schedulesigaction.c z180_sigdeliver.c +CHIP_CSRCS += z180_lowscc.c z180_lowserial.c z180_modifiyreg8.c z180_mmu.c +CHIP_CSRCS += z180_registerdump.c z180_schedulesigaction.c z180_sigdeliver.c diff --git a/nuttx/arch/z80/src/z180/z180_config.h b/nuttx/arch/z80/src/z180/z180_config.h index 9f5bb9589..65815c21b 100644 --- a/nuttx/arch/z80/src/z180/z180_config.h +++ b/nuttx/arch/z80/src/z180/z180_config.h @@ -68,10 +68,18 @@ /* Are any UARTs enabled? */ +#undef HAVE_UART +#undef HAVE_SCC #undef HAVE_SERIAL -#if defined(CONFIG_Z180_UART0) || defined(CONFIG_Z180_UART1) || \ - defined(CONFIG_Z180_SCC) || defined(CONFIG_Z180_ESCCA) || \ + +#if defined(CONFIG_Z180_UART0) || defined(CONFIG_Z180_UART1) +# define HAVE_UART 1 +# define HAVE_SERIAL 1 +#endif + +#if defined(CONFIG_Z180_SCC) || defined(CONFIG_Z180_ESCCA) || \ defined(CONFIG_Z180_ESCCB) +# define HAVE_SCC 1 # define HAVE_SERIAL 1 #endif @@ -101,28 +109,39 @@ /* Is there a serial console? There should be at most one defined. */ +#undef HAVE_UART_CONSOLE +#undef HAVE_SCC_CONSOLE +#undef HAVE_SERIAL_CONSOLE + #if defined(CONFIG_Z180_UART0_SERIAL_CONSOLE) # undef CONFIG_Z180_UART1_SERIAL_CONSOLE # undef CONFIG_Z180_SCC_SERIAL_CONSOLE # undef CONFIG_Z180_ESCCA_SERIAL_CONSOLE # undef CONFIG_Z180_ESCCB_SERIAL_CONSOLE +# define HAVE_UART_CONSOLE 1 # define HAVE_SERIAL_CONSOLE 1 + #elif defined(CONFIG_Z180_UART1_SERIAL_CONSOLE) # undef CONFIG_Z180_SCC_SERIAL_CONSOLE # undef CONFIG_Z180_ESCCA_SERIAL_CONSOLE # undef CONFIG_Z180_ESCCB_SERIAL_CONSOLE +# define HAVE_UART_CONSOLE 1 # define HAVE_SERIAL_CONSOLE 1 + #elif defined(CONFIG_Z180_ESCC_SERIAL_CONSOLE) # undef CONFIG_Z180_ESCCA_SERIAL_CONSOLE # undef CONFIG_Z180_ESCCB_SERIAL_CONSOLE +# define HAVE_SCC_CONSOLE 1 # define HAVE_SERIAL_CONSOLE 1 + #elif defined(CONFIG_Z180_ESCCA_SERIAL_CONSOLE) # undef CONFIG_Z180_ESCCB_SERIAL_CONSOLE +# define HAVE_SCC_CONSOLE 1 # define HAVE_SERIAL_CONSOLE 1 + #elif defined(CONFIG_Z180_ESCCB_SERIAL_CONSOLE) +# define HAVE_SCC_CONSOLE 1 # define HAVE_SERIAL_CONSOLE 1 -#else -# undef HAVE_SERIAL_CONSOLE #endif /************************************************************************************ diff --git a/nuttx/arch/z80/src/z180/z180_iomap.h b/nuttx/arch/z80/src/z180/z180_iomap.h index c429fe7d3..8717ae814 100644 --- a/nuttx/arch/z80/src/z180/z180_iomap.h +++ b/nuttx/arch/z80/src/z180/z180_iomap.h @@ -629,13 +629,13 @@ /* RR0: Transmit and Receive buffer status and external status */ -#define RR0_BA (0x80) /* Bit 7: Break/abort*/ -#define RR0_TXUEOM (0x40) /* Bit 6: Tx Underrun/EOM*/ +#define RR0_BA (0x80) /* Bit 7: Break/abort */ +#define RR0_TXUEOM (0x40) /* Bit 6: Tx Underrun/EOM */ #define RR0_CTS (0x20) /* Bit 5: CTS */ -#define RR0_SH (0x10) /* Bit4: Sync/Hunt */ +#define RR0_SH (0x10) /* Bit 4: Sync/Hunt */ #define RR0_DCD (0x08) /* Bit 3: DCD */ #define RR0_TXBE (0x04) /* Bit 2: Tx Buffer Empty */ -#define RR0_ZC (0x02) /* Bit 1: Zero Count*/ +#define RR0_ZC (0x02) /* Bit 1: Zero Count */ #define RR0_RXA (0x01) /* Bit 0: Rx Character Available */ /* RR1: Special Receive Condition status */ @@ -647,7 +647,7 @@ #define RR0_RES0 (0x08) /* Bit 3: Residue Code 0 */ #define RR0_RES1 (0x04) /* Bit 2: Residue Code 1 */ #define RR0_RES2 (0x02) /* Bit 1: Residue Code 2 */ -#define RR0_ALL (0x01) /* Bit 0: All Sent*/ +#define RR0_ALL (0x01) /* Bit 0: All Sent */ /* RR2: Interrupt vector (modified if VIS Bit in WR9 is set) -- 8-bit vector value */ diff --git a/nuttx/arch/z80/src/z180/z180_lowscc.c b/nuttx/arch/z80/src/z180/z180_lowscc.c index b44414d55..e5d5171c1 100644 --- a/nuttx/arch/z80/src/z180/z180_lowscc.c +++ b/nuttx/arch/z80/src/z180/z180_lowscc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/z80/src/z180/z180_loweruart.c + * arch/z80/src/z180/z180_lowscc.c * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -48,9 +48,9 @@ #include "chip/chip.h" #include "common/up_internal.h" -#include "z80_config.h" +#include "z180_config.h" -#ifdef USE_LOWUARTINIT +#if defined(USE_LOWSERIALINIT) && defined(HAVE_SCC) /**************************************************************************** * Private Definitions @@ -66,7 +66,7 @@ # define CONSOLE_2STOP CONFIG_Z180_SCC_2STOP # define CONSOLE_PARITY CONFIG_Z180_SCC_PARITY -#elif defined(CONFIG_Z180_ESCCB_SERIAL_CONSOLE) +#elif defined(CONFIG_Z180_ESCCA_SERIAL_CONSOLE) # define CONSOLE_CR Z182_ESCCA_CR # define CONSOLE_DR Z182_ESCCA_DR # define CONSOLE_BAUD CONFIG_Z180_ESCCA_BAUD @@ -90,24 +90,34 @@ * Private Functions ****************************************************************************/ -#if defined(HAVE_SERIAL_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) -static void z180_setbaud(void) +/**************************************************************************** + * Name: z180_scc_setbaud + * + * Description: + * + ****************************************************************************/ + +#if defined(HAVE_SCC_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) +static void z180_scc_setbaud(void) { #warning "Missing logic" } -#endif /* HAVE_SERIAL_CONSOLE && !CONFIG_SUPPRESS_UART_CONFIG */ +#endif /* HAVE_SCC_CONSOLE && !CONFIG_SUPPRESS_UART_CONFIG */ /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** - * Name: up_lowuartinit + * Name: z180_scc_lowinit + * + * Description: + * Called early in the boot sequence to initialize the [E]SCC channel(s) + * ****************************************************************************/ -void up_lowuartinit(void) +void z180_scc_lowinit(void) { -#ifdef HAVE_SERIAL #warning "Missing logic" /* Configure for usage of {E]SCC channels (whether or not we have a console) */ @@ -126,10 +136,33 @@ void up_lowuartinit(void) /* Configure the console for immediate usage */ -#if defined(HAVE_SERIAL_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) +#if defined(HAVE_SCC_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) #warning "Missing logic" -#endif /* HAVE_SERIAL_CONSOLE && !CONFIG_SUPPRESS_UART_CONFIG */ -#endif /* HAVE_SERIAL */ +#endif /* HAVE_SCC_CONSOLE && !CONFIG_SUPPRESS_UART_CONFIG */ } -#endif /* USE_LOWUARTINIT */ +/**************************************************************************** + * Name: z180_putc + * + * Description: + * Low-level character output + * + ****************************************************************************/ + +#ifdef HAVE_SCC_CONSOLE +void z180_putc(uint8_t ch) __naked +{ + __asm +txbe: + in0 a,(CONSOLE_CR) ; Read RR0 + bit 2, a ; Bit 2, Tx buffer empty? + jr z, txbe ; No, wait until the Tx buffer is empty + + ld a, 4(ix) ; Character to output + out (CONSOLE_DR), a ; Send it + ret + __endasm; +} +#endif + +#endif /* USE_LOWSERIALINIT && HAVE_SCC*/ diff --git a/nuttx/arch/z80/src/z180/z180_lowserial.c b/nuttx/arch/z80/src/z180/z180_lowserial.c new file mode 100644 index 000000000..5382c56cd --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_lowserial.c @@ -0,0 +1,112 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_lowserial.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "common/up_internal.h" + +#include "z180_config.h" +#include "z180_serial.h" + +#ifdef HAVE_SERIAL + +/**************************************************************************** + * Private Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_lowserialinit + * + * Description: + * Called early in the boot sequence to initialize the serial ports + * + ****************************************************************************/ + +#ifdef USE_LOWSERIALINIT +void up_lowserialinit(void) +{ + /* Initialize UART and [E]SCC serial devices */ + + z180_uart_lowinit(); + z180_scc_lowinit(); +} +#endif + +/**************************************************************************** + * Name: up_putc/up_lowputc + * + * Description: + * Low-level console output + * + ****************************************************************************/ + +#ifdef USE_SERIALDRIVER +int up_lowputc(int ch) +#else +int up_putc(int ch) +#endif +{ + /* Check for LF */ + + if (ch == '\n') + { + /* Output CR before LF */ + + z180_putc('\r'); + } + + /* Output the character */ + + z180_putc(ch); + return ch; +} + +#endif /* HAVE_SERIAL */ diff --git a/nuttx/arch/z80/src/z180/z180_lowuart.c b/nuttx/arch/z80/src/z180/z180_lowuart.c new file mode 100644 index 000000000..493a793cd --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_lowuart.c @@ -0,0 +1,148 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_lowuart.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include +#include + +#include "chip/chip.h" +#include "common/up_internal.h" +#include "z180_config.h" + +#if defined(USE_LOWSERIALINIT) && defined(HAVE_UART) + +/**************************************************************************** + * Private Definitions + ****************************************************************************/ + +/* Select UART parameters for the selected console */ + +#if defined(CONFIG_Z180_UART0_SERIAL_CONSOLE) +# define CONSOLE_CR Z181_UART0_CR +# define CONSOLE_DR Z181_UART0_DR +# define CONSOLE_BAUD CONFIG_Z180_UART0_BAUD +# define CONSOLE_BITS CONFIG_Z180_UART0_BITS +# define CONSOLE_2STOP CONFIG_Z180_UART0_2STOP +# define CONSOLE_PARITY CONFIG_Z180_UART0_PARITY + +#elif defined(CONFIG_Z180_UART1_SERIAL_CONSOLE) +# define CONSOLE_CR Z182_UART1_CR +# define CONSOLE_DR Z182_UART1_DR +# define CONSOLE_BAUD CONFIG_Z180_UART1_BAUD +# define CONSOLE_BITS CONFIG_Z180_UART1_BITS +# define CONSOLE_2STOP CONFIG_Z180_UART1_2STOP +# define CONSOLE_PARITY CONFIG_Z180_UART1_PARITY +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: z180_uart_setbaud + * + * Description: + * + ****************************************************************************/ + +#if defined(HAVE_UART_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) +static void z180_uart_setbaud(void) +{ +#warning "Missing logic" +} +#endif /* HAVE_UART_CONSOLE && !CONFIG_SUPPRESS_UART_CONFIG */ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: z180_uart_lowinit + * + * Description: + * Called early in the boot sequence to initialize the [E]SCC channel(s) + * + ****************************************************************************/ + +void z180_uart_lowinit(void) +{ +#warning "Missing logic" + + /* Configure for usage of {E]SCC channels (whether or not we have a console) */ + +#ifdef CONFIG_Z180_UART0 +#warning "Missing logic" +#endif + +#ifdef CONFIG_Z180_UART1 +#warning "Missing logic" +#endif + + /* Configure the console for immediate usage */ + +#if defined(HAVE_UART_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) +#warning "Missing logic" +#endif /* HAVE_UART0_CONSOLE && !CONFIG_SUPPRESS_UART_CONFIG */ +} + +/**************************************************************************** + * Name: z180_putc + * + * Description: + * Low-level character output + * + ****************************************************************************/ + +#ifdef HAVE_UART_CONSOLE +void z180_putc(uint8_t ch) +{ +#warning "Missing logic" +} +#endif + +#endif /* USE_LOWSERIALINIT && HAVE_UART*/ diff --git a/nuttx/arch/z80/src/z180/z180_scc.c b/nuttx/arch/z80/src/z180/z180_scc.c index b15183bda..2ac08f7f1 100644 --- a/nuttx/arch/z80/src/z180/z180_scc.c +++ b/nuttx/arch/z80/src/z180/z180_scc.c @@ -58,6 +58,9 @@ #include "os_internal.h" #include "up_internal.h" +#include "z180_config.h" +#include "z180_serial.h" + #ifdef USE_SERIALDRIVER /**************************************************************************** @@ -619,79 +622,12 @@ void up_serialinit(void) int up_putc(int ch) { #ifdef CONSOLE_DEV -#warning "Missing logic" - z180_disableuartint(priv); - - /* Check for LF */ - - if (ch == '\n') - { - /* Output CR before LF*/ -#warning "Missing logic" - - } + /* Disable [E]SCC interrupts and perform the low-level output */ - /* Output the character */ - -#warning "Missing logic" - - /* Wait for the character to be sent before re-enabling interrupts */ - -#warning "Missing logic" + z180_disableuartint(priv); + up_lowputc(ch); + z180_restoreuartint(priv); return ch; #endif } - -#else /* USE_SERIALDRIVER */ - -/**************************************************************************** - * Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: z180_putc - ****************************************************************************/ - -static void z180_putc(int ch) -{ -#warning "Missing logic" -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_putc - ****************************************************************************/ - -int up_putc(int ch) -{ - /* Check for LF */ - - if (ch == '\n') - { - /* Output CR before LF */ - - z180_putc('\r'); - } - - /* Output character */ - - z180_putc(ch); - return ch; -} - #endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/z80/src/z180/z180_serial.h b/nuttx/arch/z80/src/z180/z180_serial.h new file mode 100644 index 000000000..31248eb51 --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_serial.h @@ -0,0 +1,109 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_serial.h + * + * Copyright (C) 2012 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 __ARCH_Z80_SRC_Z180_Z180_SERIAL_H +#define __ARCH_Z80_SRC_Z180_Z180_SERIAL_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "up_internal.h" +#include "z180_config.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + + /**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: z180_uart_lowinit + * + * Description: + * Called early in the boot sequence to initialize the UART(s) + * + ****************************************************************************/ + +#ifdef HAVE_UART +void z180_uart_lowinit(void); +#else +# define z180_uart_lowinit() +#endif + +/**************************************************************************** + * Name: z180_scc_lowinit + * + * Description: + * Called early in the boot sequence to initialize the [E]SCC channel(s) + * + ****************************************************************************/ + +#ifdef HAVE_SCC +void z180_scc_lowinit(void); +#else +# define z180_scc_lowinit() +#endif + +/**************************************************************************** + * Name: z180_putc + * + * Description: + * Low-level character output + * + ****************************************************************************/ + +void z180_putc(uint8_t ch) __naked; + +/**************************************************************************** + * Name: up_putc/up_lowputc + * + * Description: + * Low-level console output + * + ****************************************************************************/ + +#ifdef USE_SERIALDRIVER +int up_lowputc(int ch); +#else +int up_putc(int ch); +# define up_lowputc(ch) up_putc(ch) +#endif + +#endif /* __ARCH_Z80_SRC_Z180_Z180_SERIAL_H */ diff --git a/nuttx/arch/z80/src/z8/z8_lowuart.c b/nuttx/arch/z80/src/z8/z8_lowuart.c index 07832572c..cf3f9b324 100644 --- a/nuttx/arch/z80/src/z8/z8_lowuart.c +++ b/nuttx/arch/z80/src/z8/z8_lowuart.c @@ -49,7 +49,7 @@ #include "chip/chip.h" #include "common/up_internal.h" -#ifdef USE_LOWUARTINIT +#ifdef USE_LOWSERIALINIT extern uint32_t get_freq(void); @@ -70,10 +70,10 @@ extern uint32_t get_freq(void); ****************************************************************************/ /**************************************************************************** - * Name: z8_lowuartinit + * Name: up_lowserialinit ****************************************************************************/ -void up_lowuartinit(void) +void up_lowserialinit(void) { uint32_t freq = get_freq(); uint16_t brg; @@ -127,4 +127,4 @@ void up_lowuartinit(void) putreg8(0xc0, U1CTL0); /* Transmit enable, Receive enable, no Parity, 1 Stop bit */ #endif } -#endif /* USE_LOWUARTINIT */ \ No newline at end of file +#endif /* USE_LOWSERIALINIT */ diff --git a/nuttx/configs/ez80f910200kitg/ostest/defconfig b/nuttx/configs/ez80f910200kitg/ostest/defconfig index d8be31a97..50efbfdaf 100644 --- a/nuttx/configs/ez80f910200kitg/ostest/defconfig +++ b/nuttx/configs/ez80f910200kitg/ostest/defconfig @@ -99,7 +99,7 @@ CONFIG_EZ80_UART0=y # CONFIG_EZ80_UART1 is not set # CONFIG_EZ80_UART2 is not set # CONFIG_EZ80_EMAC is not set -CONFIG_HAVE_LOWUARTINIT=y +CONFIG_HAVE_LOWSERIALINIT=y # # Architecture Options diff --git a/nuttx/configs/ez80f910200zco/dhcpd/defconfig b/nuttx/configs/ez80f910200zco/dhcpd/defconfig index 37a256d5e..95baadc13 100644 --- a/nuttx/configs/ez80f910200zco/dhcpd/defconfig +++ b/nuttx/configs/ez80f910200zco/dhcpd/defconfig @@ -115,7 +115,7 @@ CONFIG_START_YEAR=2009 CONFIG_START_MONTH=3 CONFIG_START_DAY=14 CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=y +CONFIG_HAVE_LOWSERIALINIT=y CONFIG_DEV_CONSOLE=y CONFIG_DEV_LOWCONSOLE=y CONFIG_MUTEX_TYPES=n diff --git a/nuttx/configs/ez80f910200zco/httpd/defconfig b/nuttx/configs/ez80f910200zco/httpd/defconfig index 0cf4c33aa..6a910ee0b 100644 --- a/nuttx/configs/ez80f910200zco/httpd/defconfig +++ b/nuttx/configs/ez80f910200zco/httpd/defconfig @@ -115,7 +115,7 @@ CONFIG_START_YEAR=2009 CONFIG_START_MONTH=3 CONFIG_START_DAY=14 CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=y +CONFIG_HAVE_LOWSERIALINIT=y CONFIG_DEV_CONSOLE=y CONFIG_DEV_LOWCONSOLE=y CONFIG_MUTEX_TYPES=n diff --git a/nuttx/configs/ez80f910200zco/nettest/defconfig b/nuttx/configs/ez80f910200zco/nettest/defconfig index 9f7d438be..22cf35a0c 100644 --- a/nuttx/configs/ez80f910200zco/nettest/defconfig +++ b/nuttx/configs/ez80f910200zco/nettest/defconfig @@ -115,7 +115,7 @@ CONFIG_START_YEAR=2009 CONFIG_START_MONTH=3 CONFIG_START_DAY=14 CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=y +CONFIG_HAVE_LOWSERIALINIT=y CONFIG_DEV_CONSOLE=y CONFIG_DEV_LOWCONSOLE=y CONFIG_MUTEX_TYPES=n diff --git a/nuttx/configs/ez80f910200zco/nsh/defconfig b/nuttx/configs/ez80f910200zco/nsh/defconfig index 804a4563f..8ad3930ff 100644 --- a/nuttx/configs/ez80f910200zco/nsh/defconfig +++ b/nuttx/configs/ez80f910200zco/nsh/defconfig @@ -115,7 +115,7 @@ CONFIG_START_YEAR=2009 CONFIG_START_MONTH=3 CONFIG_START_DAY=14 CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=y +CONFIG_HAVE_LOWSERIALINIT=y CONFIG_DEV_CONSOLE=y CONFIG_DEV_LOWCONSOLE=n CONFIG_MUTEX_TYPES=n diff --git a/nuttx/configs/ez80f910200zco/ostest/defconfig b/nuttx/configs/ez80f910200zco/ostest/defconfig index 977dda1dc..3a1352333 100644 --- a/nuttx/configs/ez80f910200zco/ostest/defconfig +++ b/nuttx/configs/ez80f910200zco/ostest/defconfig @@ -99,7 +99,7 @@ CONFIG_EZ80_UART0=y # CONFIG_EZ80_UART1 is not set # CONFIG_EZ80_UART2 is not set # CONFIG_EZ80_EMAC is not set -CONFIG_HAVE_LOWUARTINIT=y +CONFIG_HAVE_LOWSERIALINIT=y CONFIG_ARCH_TIMERHOOK=y # diff --git a/nuttx/configs/ez80f910200zco/poll/defconfig b/nuttx/configs/ez80f910200zco/poll/defconfig index 316d150d0..82cea4fcf 100644 --- a/nuttx/configs/ez80f910200zco/poll/defconfig +++ b/nuttx/configs/ez80f910200zco/poll/defconfig @@ -115,7 +115,7 @@ CONFIG_START_YEAR=2009 CONFIG_START_MONTH=3 CONFIG_START_DAY=14 CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=y +CONFIG_HAVE_LOWSERIALINIT=y CONFIG_DEV_CONSOLE=y CONFIG_DEV_LOWCONSOLE=y CONFIG_MUTEX_TYPES=n diff --git a/nuttx/configs/p112/ostest/defconfig b/nuttx/configs/p112/ostest/defconfig index 62162f37e..eb02fe6bc 100644 --- a/nuttx/configs/p112/ostest/defconfig +++ b/nuttx/configs/p112/ostest/defconfig @@ -119,6 +119,7 @@ CONFIG_ARCH_CHIP_Z8018216FSG=y # CONFIG_ARCH_CHIP_EZ80F93 is not set CONFIG_ARCH_CHIP_Z180=y CONFIG_ARCH_CHIP_Z80182=y +CONFIG_HAVE_LOWSERIALINIT=y CONFIG_LINKER_HOME_AREA=0x0000 CONFIG_LINKER_CODE_AREA=0x0200 CONFIG_LINKER_DATA_AREA=0x8000 @@ -135,8 +136,25 @@ CONFIG_Z180_PHYSHEAP_END=0x100000 # # Z180 Peripheral Support # -CONFIG_Z180_UART0=y -CONFIG_Z180_UART1=y +# CONFIG_Z180_UART0 is not set +# CONFIG_Z180_UART1 is not set +CONFIG_Z180_ESCCA=y +# CONFIG_Z180_ESCCB is not set +# CONFIG_Z180_TMR1 is not set +# CONFIG_Z180_PORTA is not set +# CONFIG_Z180_PORTB is not set +# CONFIG_Z180_MIMIC is not set +CONFIG_Z180_ESCCA_SERIAL_CONSOLE=y + +# +# ESCC Channel A Configuration +# +CONFIG_Z180_ESCCA_RXBUFSIZE=64 +CONFIG_Z180_ESCCA_TXBUFSIZE=64 +CONFIG_Z180_ESCCA_BAUD=9600 +CONFIG_Z180_ESCCA_BITS=8 +CONFIG_Z180_ESCCA_PARITY=0 +CONFIG_Z180_ESCCA_2STOP=0 # # Architecture Options @@ -261,32 +279,6 @@ CONFIG_DEV_NULL=y CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set -CONFIG_ARCH_HAVE_UART0=y -CONFIG_ARCH_HAVE_UART1=y -CONFIG_MCU_SERIAL=y -CONFIG_UART0_SERIAL_CONSOLE=y -# CONFIG_UART1_SERIAL_CONSOLE is not set -# CONFIG_NO_SERIAL_CONSOLE is not set - -# -# UART0 Configuration -# -CONFIG_UART0_RXBUFSIZE=64 -CONFIG_UART0_TXBUFSIZE=64 -CONFIG_UART0_BAUD=115200 -CONFIG_UART0_BITS=8 -CONFIG_UART0_PARITY=0 -CONFIG_UART0_2STOP=0 - -# -# UART1 Configuration -# -CONFIG_UART1_RXBUFSIZE=64 -CONFIG_UART1_TXBUFSIZE=64 -CONFIG_UART1_BAUD=115200 -CONFIG_UART1_BITS=8 -CONFIG_UART1_PARITY=0 -CONFIG_UART1_2STOP=0 # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set # CONFIG_WIRELESS is not set diff --git a/nuttx/configs/z8encore000zco/ostest/defconfig b/nuttx/configs/z8encore000zco/ostest/defconfig index b098c682b..7d9b227f4 100644 --- a/nuttx/configs/z8encore000zco/ostest/defconfig +++ b/nuttx/configs/z8encore000zco/ostest/defconfig @@ -88,7 +88,7 @@ CONFIG_ARCH_CHIP_Z8F6403=y # CONFIG_ARCH_CHIP_EZ80F93 is not set CONFIG_ARCH_CHIP_Z8F640X=y CONFIG_ARCH_CHIP_Z8=y -CONFIG_HAVE_LOWUARTINIT=y +CONFIG_HAVE_LOWSERIALINIT=y CONFIG_Z8_UART0=y CONFIG_Z8_UART1=y diff --git a/nuttx/configs/z8f64200100kit/ostest/defconfig b/nuttx/configs/z8f64200100kit/ostest/defconfig index caa685419..a34952987 100644 --- a/nuttx/configs/z8f64200100kit/ostest/defconfig +++ b/nuttx/configs/z8f64200100kit/ostest/defconfig @@ -88,7 +88,7 @@ CONFIG_ARCH_CHIP_Z8F6423=y # CONFIG_ARCH_CHIP_EZ80F93 is not set CONFIG_ARCH_CHIP_Z8F642X=y CONFIG_ARCH_CHIP_Z8=y -CONFIG_HAVE_LOWUARTINIT=y +CONFIG_HAVE_LOWSERIALINIT=y CONFIG_Z8_UART0=y CONFIG_Z8_UART1=y -- cgit v1.2.3 From a202ca65d16c057a010c4291a79b5a55002f425c Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 15 Dec 2012 15:03:35 +0000 Subject: Add z180 system timer git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5438 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z80/Kconfig | 49 ++++++++++ nuttx/arch/z80/src/z180/Kconfig | 5 +- nuttx/arch/z80/src/z180/Make.defs | 1 + nuttx/arch/z80/src/z180/z180_config.h | 88 ++++++++++++++++-- nuttx/arch/z80/src/z180/z180_iomap.h | 38 ++++---- nuttx/arch/z80/src/z180/z180_lowscc.c | 39 +------- nuttx/arch/z80/src/z180/z180_lowuart.c | 35 +------ nuttx/arch/z80/src/z180/z180_serial.h | 10 +- nuttx/arch/z80/src/z180/z180_timerisr.c | 157 ++++++++++++++++++++++++++++++++ nuttx/configs/p112/include/board.h | 8 +- nuttx/configs/p112/ostest/defconfig | 4 +- nuttx/configs/xtrs/nsh/defconfig | 2 +- nuttx/configs/xtrs/ostest/defconfig | 2 +- nuttx/configs/xtrs/pashello/defconfig | 2 +- nuttx/configs/xtrs/src/xtr_irq.c | 30 ------ nuttx/configs/z80sim/nsh/defconfig | 2 +- nuttx/configs/z80sim/ostest/defconfig | 2 +- nuttx/configs/z80sim/pashello/defconfig | 2 +- nuttx/configs/z80sim/src/z80_irq.c | 30 ------ 19 files changed, 341 insertions(+), 165 deletions(-) create mode 100644 nuttx/arch/z80/src/z180/z180_timerisr.c (limited to 'nuttx') diff --git a/nuttx/arch/z80/Kconfig b/nuttx/arch/z80/Kconfig index 7e39a3f8e..b8b20c6f9 100644 --- a/nuttx/arch/z80/Kconfig +++ b/nuttx/arch/z80/Kconfig @@ -10,6 +10,7 @@ choice config ARCH_CHIP_Z80 bool "Classic z80" + select ARCH_NOINTC ---help--- Classic ZiLOG z80 chip @@ -17,6 +18,7 @@ config ARCH_CHIP_Z8018006VSG bool "Z8018006VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -26,6 +28,7 @@ config ARCH_CHIP_Z8018010VSG bool "Z8018010VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -35,6 +38,7 @@ config ARCH_CHIP_Z8018008VSG bool "Z8018008VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -44,6 +48,7 @@ config ARCH_CHIP_Z8018010FSG bool "Z8018010FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -53,6 +58,7 @@ config ARCH_CHIP_Z8018008VEG bool "Z8018008VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -62,6 +68,7 @@ config ARCH_CHIP_Z8018006VEG bool "Z8018006VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -71,6 +78,7 @@ config ARCH_CHIP_Z8018006PSG bool "Z8018006PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -80,6 +88,7 @@ config ARCH_CHIP_Z8018008FSG bool "Z8018008FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -89,6 +98,7 @@ config ARCH_CHIP_Z8018010PSG bool "Z8018010PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -98,6 +108,7 @@ config ARCH_CHIP_Z8018006PEG bool "Z8018006PEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -107,6 +118,7 @@ config ARCH_CHIP_Z8018010VEG bool "Z8018010VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -116,6 +128,7 @@ config ARCH_CHIP_Z8018010PEG bool "Z8018010PEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -125,6 +138,7 @@ config ARCH_CHIP_Z8018008PSG bool "Z8018008PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -134,6 +148,7 @@ config ARCH_CHIP_Z8018006FSG bool "Z8018006FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -143,6 +158,7 @@ config ARCH_CHIP_Z8018000XSO bool "Z8018000XSO" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT @@ -150,6 +166,7 @@ config ARCH_CHIP_Z8018010FEG bool "Z8018010FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT @@ -157,6 +174,7 @@ config ARCH_CHIP_Z8018000WSO bool "Z8018000WSO" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT @@ -164,6 +182,7 @@ config ARCH_CHIP_Z8018008PEG bool "Z8018008PEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT @@ -171,6 +190,7 @@ config ARCH_CHIP_Z8018110FEG bool "Z8018110FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80181 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -180,6 +200,7 @@ config ARCH_CHIP_Z8018233FSG bool "Z8018233FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -189,6 +210,7 @@ config ARCH_CHIP_Z8018220AEG bool "Z8018220AEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -198,6 +220,7 @@ config ARCH_CHIP_Z8018216FSG bool "Z8018216FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -207,6 +230,7 @@ config ARCH_CHIP_Z8018216ASG bool "Z8018216ASG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -216,6 +240,7 @@ config ARCH_CHIP_Z8018233ASG bool "Z8018233ASG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -225,6 +250,7 @@ config ARCH_CHIP_Z8019520FSG bool "Z8019520FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80195 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -234,6 +260,7 @@ config ARCH_CHIP_Z8019533FSG bool "Z8019533FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80195 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -243,6 +270,7 @@ config ARCH_CHIP_Z8L18020VSG bool "Z8L18020VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -252,6 +280,7 @@ config ARCH_CHIP_Z8L18020FSG bool "Z8L18020FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -261,6 +290,7 @@ config ARCH_CHIP_Z8L18020PSG bool "Z8L18020PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT @@ -268,6 +298,7 @@ config ARCH_CHIP_Z8L18220ASG bool "Z8L18220ASG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L182 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -277,6 +308,7 @@ config ARCH_CHIP_Z8L18220FSG bool "Z8L18220FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L182 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -286,6 +318,7 @@ config ARCH_CHIP_Z8L18220AEG bool "Z8L18220AEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L182 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT @@ -293,6 +326,7 @@ config ARCH_CHIP_Z8S18020VSG bool "Z8S18020VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -302,6 +336,7 @@ config ARCH_CHIP_Z8S18020VSG1960 bool "Z8S18020VSG1960" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -311,6 +346,7 @@ config ARCH_CHIP_Z8S18033VSG bool "Z8S18033VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -320,6 +356,7 @@ config ARCH_CHIP_Z8S18010FSG bool "Z8S18010FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -329,6 +366,7 @@ config ARCH_CHIP_Z8S18010VEG bool "Z8S18010VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -338,6 +376,7 @@ config ARCH_CHIP_Z8S18020VEG bool "Z8S18020VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -347,6 +386,7 @@ config ARCH_CHIP_Z8S18010VSG bool "Z8S18010VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -356,6 +396,7 @@ config ARCH_CHIP_Z8S18020PSG bool "Z8S18020PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -365,6 +406,7 @@ config ARCH_CHIP_Z8S18033FSG bool "Z8S18033FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -374,6 +416,7 @@ config ARCH_CHIP_Z8S18033FEG bool "Z8S18033FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -383,6 +426,7 @@ config ARCH_CHIP_Z8S18020FSG bool "Z8S18020FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -392,6 +436,7 @@ config ARCH_CHIP_Z8S18033VEG bool "Z8S18033VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -401,6 +446,7 @@ config ARCH_CHIP_Z8S18010PSG bool "Z8S18010PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT ---help--- @@ -410,6 +456,7 @@ config ARCH_CHIP_Z8S18020FEG bool "Z8S18020FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT @@ -417,6 +464,7 @@ config ARCH_CHIP_Z8S18010PEG bool "Z8S18010PEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT @@ -424,6 +472,7 @@ config ARCH_CHIP_Z8S18010FEG bool "Z8S18010FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ARCH_NOINTC select ADDRENV select HAVE_LOWSERIALINIT diff --git a/nuttx/arch/z80/src/z180/Kconfig b/nuttx/arch/z80/src/z180/Kconfig index 34297f7a7..160c66b50 100644 --- a/nuttx/arch/z80/src/z180/Kconfig +++ b/nuttx/arch/z80/src/z180/Kconfig @@ -175,11 +175,12 @@ config Z180_ESCCB ---help--- Select to enable a serial port on ESCC Channel B -config Z180_TMR1 +config Z180_PRT1 bool "Timer 1" default n ---help--- - Select to enable a Timer 1 (Timer 0 is used by NuttX as the system timer) + Select to enable a Programmable Reload Timer 1 (PRT1, PRT0 is used + by NuttX as the system timer) # config Z180_DMA0 # bool "DMA0" diff --git a/nuttx/arch/z80/src/z180/Make.defs b/nuttx/arch/z80/src/z180/Make.defs index 7b495e693..24d2cb64a 100644 --- a/nuttx/arch/z80/src/z180/Make.defs +++ b/nuttx/arch/z80/src/z180/Make.defs @@ -60,3 +60,4 @@ endif CHIP_CSRCS = z180_copystate.c z180_initialstate.c z180_io.c z180_irq.c CHIP_CSRCS += z180_lowscc.c z180_lowserial.c z180_modifiyreg8.c z180_mmu.c CHIP_CSRCS += z180_registerdump.c z180_schedulesigaction.c z180_sigdeliver.c +CHIP_CSRCS += z180_timerisr.c diff --git a/nuttx/arch/z80/src/z180/z180_config.h b/nuttx/arch/z80/src/z180/z180_config.h index 65815c21b..556973a75 100644 --- a/nuttx/arch/z80/src/z180/z180_config.h +++ b/nuttx/arch/z80/src/z180/z180_config.h @@ -44,6 +44,8 @@ #include +#include "up_internal.h" + /************************************************************************************ * Pre-processor Definitions ************************************************************************************/ @@ -103,7 +105,7 @@ # undef CONFIG_Z180_ESCCA_SERIAL_CONSOLE #endif -#ifndef CONFIG_Z180_ESCCA +#ifndef CONFIG_Z180_ESCCB # undef CONFIG_Z180_ESCCB_SERIAL_CONSOLE #endif @@ -114,34 +116,106 @@ #undef HAVE_SERIAL_CONSOLE #if defined(CONFIG_Z180_UART0_SERIAL_CONSOLE) +# define HAVE_UART_CONSOLE 1 +# define HAVE_SERIAL_CONSOLE 1 + + /* Disable other console selections */ + # undef CONFIG_Z180_UART1_SERIAL_CONSOLE # undef CONFIG_Z180_SCC_SERIAL_CONSOLE # undef CONFIG_Z180_ESCCA_SERIAL_CONSOLE # undef CONFIG_Z180_ESCCB_SERIAL_CONSOLE + + /* If we are not using the serial driver, then the serial console is all + * that we will support. + */ + +# ifndef USE_SERIALDRIVER +# undef CONFIG_Z180_UART1 +# undef CONFIG_Z180_SCC +# undef CONFIG_Z180_ESCCA +# undef CONFIG_Z180_ESCCB +# endif + +#elif defined(CONFIG_Z180_UART1_SERIAL_CONSOLE) # define HAVE_UART_CONSOLE 1 # define HAVE_SERIAL_CONSOLE 1 -#elif defined(CONFIG_Z180_UART1_SERIAL_CONSOLE) + /* Disable other console selections */ + # undef CONFIG_Z180_SCC_SERIAL_CONSOLE # undef CONFIG_Z180_ESCCA_SERIAL_CONSOLE # undef CONFIG_Z180_ESCCB_SERIAL_CONSOLE -# define HAVE_UART_CONSOLE 1 + + /* If we are not using the serial driver, then the serial console is all + * that we will support. + */ + +# ifndef USE_SERIALDRIVER +# undef CONFIG_Z180_UART0 +# undef CONFIG_Z180_SCC +# undef CONFIG_Z180_ESCCA +# undef CONFIG_Z180_ESCCB +# endif + +#elif defined(CONFIG_Z180_SCC_SERIAL_CONSOLE) +# define HAVE_SCC_CONSOLE 1 # define HAVE_SERIAL_CONSOLE 1 -#elif defined(CONFIG_Z180_ESCC_SERIAL_CONSOLE) + /* Disable other console selections */ + # undef CONFIG_Z180_ESCCA_SERIAL_CONSOLE # undef CONFIG_Z180_ESCCB_SERIAL_CONSOLE -# define HAVE_SCC_CONSOLE 1 -# define HAVE_SERIAL_CONSOLE 1 + + /* If we are not using the serial driver, then the serial console is all + * that we will support. + */ + +# ifndef USE_SERIALDRIVER +# undef CONFIG_Z180_UART0 +# undef CONFIG_Z180_UART1 +# undef CONFIG_Z180_ESCCA +# undef CONFIG_Z180_ESCCB +# endif #elif defined(CONFIG_Z180_ESCCA_SERIAL_CONSOLE) -# undef CONFIG_Z180_ESCCB_SERIAL_CONSOLE # define HAVE_SCC_CONSOLE 1 # define HAVE_SERIAL_CONSOLE 1 + /* Disable other console selections */ + +# undef CONFIG_Z180_ESCCB_SERIAL_CONSOLE + + /* If we are not using the serial driver, then the serial console is all + * that we will support. + */ + +# ifndef USE_SERIALDRIVER +# undef CONFIG_Z180_UART0 +# undef CONFIG_Z180_UART1 +# undef CONFIG_Z180_SCC +# undef CONFIG_Z180_ESCCB +# endif + + /* If we are not using the serial driver, then the serial console is all + * that we will support. + */ + #elif defined(CONFIG_Z180_ESCCB_SERIAL_CONSOLE) # define HAVE_SCC_CONSOLE 1 # define HAVE_SERIAL_CONSOLE 1 + + /* If we are not using the serial driver, then the serial console is all + * that we will support. + */ + +# ifndef USE_SERIALDRIVER +# undef CONFIG_Z180_UART0 +# undef CONFIG_Z180_UART1 +# undef CONFIG_Z180_SCC +# undef CONFIG_Z180_ESCCA +# endif + #endif /************************************************************************************ diff --git a/nuttx/arch/z80/src/z180/z180_iomap.h b/nuttx/arch/z80/src/z180/z180_iomap.h index 8717ae814..f2e9d5915 100644 --- a/nuttx/arch/z80/src/z180/z180_iomap.h +++ b/nuttx/arch/z80/src/z180/z180_iomap.h @@ -89,18 +89,18 @@ #define Z180_CSIO_CNTR (SFR_OFFSET+0x0a) /* CSI/O Control Register */ #define Z180_CSIO_TRD (SFR_OFFSET+0x0b) /* Transmit/Receive Data Register */ -/* Timer Registers */ +/* Programmable Reload Timer (PTR) Registers */ -#define Z180_TMR0_DRL (SFR_OFFSET+0x0c) /* Timer Data Register Ch 0 L */ -#define Z180_TMR0_DRH (SFR_OFFSET+0x0d) /* Data Register Ch 0 H */ -#define Z180_TMR0_RLDRL (SFR_OFFSET+0x0e) /* Reload Register Ch 0 L */ -#define Z180_TMR0_RLDRH (SFR_OFFSET+0x0f) /* Reload Register Ch 0 H */ -#define Z180_TMR_TCR (SFR_OFFSET+0x10) /* Timer Control Register */ +#define Z180_PRT0_DRL (SFR_OFFSET+0x0c) /* Timer Data Register Ch 0 L */ +#define Z180_PRT0_DRH (SFR_OFFSET+0x0d) /* Data Register Ch 0 H */ +#define Z180_PRT0_RLDRL (SFR_OFFSET+0x0e) /* Reload Register Ch 0 L */ +#define Z180_PRT0_RLDRH (SFR_OFFSET+0x0f) /* Reload Register Ch 0 H */ +#define Z180_PRT_TCR (SFR_OFFSET+0x10) /* Timer Control Register */ -#define Z180_TMR1_DRL (SFR_OFFSET+0x14) /* Data Register Ch 1 L */ -#define Z180_TMR1_DRH (SFR_OFFSET+0x15) /* Data Register Ch 1 H */ -#define Z180_TMR1_RLDRL (SFR_OFFSET+0x16) /* Reload Register Ch 1 L */ -#define Z180_TMR1_RLDRH (SFR_OFFSET+0x17) /* Reload Register Ch 1 H */ +#define Z180_PRT1_DRL (SFR_OFFSET+0x14) /* Data Register Ch 1 L */ +#define Z180_PRT1_DRH (SFR_OFFSET+0x15) /* Data Register Ch 1 H */ +#define Z180_PRT1_RLDRL (SFR_OFFSET+0x16) /* Reload Register Ch 1 L */ +#define Z180_PRT1_RLDRH (SFR_OFFSET+0x17) /* Reload Register Ch 1 H */ #define Z180_FRC (SFR_OFFSET+0x18) /* Free Running Counter */ @@ -398,16 +398,16 @@ /* Timer Reload Register Channel 0L (RLDR0L: 0x0e) -- 8-bit data */ /* Timer Reload Register Channel 0H (RLDR0H: 0x0f) -- 8-bit data */ -/* Timer Control Register (TCR: 0x10) */ +/* Programmable Reload Timer (PTR) Control Register (TCR: 0x10) */ -#define TMR_TCR_TIF1 (0x80) /* Bit 7: Timer 1 Interrupt Flag */ -#define TMR_TCR_TIF0 (0x40) /* Bit 6: Timer 0 Interrupt Flag */ -#define TMR_TCR_TIE1 (0x20) /* Bit 5: Timer 1 Interrupt Enable */ -#define TMR_TCR_TIE0 (0x10) /* Bit 4: Timer 0 Interrupt Enable */ -#define TMR_TCR_TOC1 (0x08) /* Bit 3: Timer 1 Output Control */ -#define TMR_TCR_TOC0 (0x04) /* Bit 2: Timer 0 Output Control */ -#define TMR_TCR_TDE1 (0x02) /* Bit 1: Timer 1 Down Count Enable */ -#define TMR_TCR_TDE0 (0x01) /* Bit 0: Timer 0 Down Count Enable */ +#define PRT_TCR_TIF1 (0x80) /* Bit 7: Timer 1 Interrupt Flag */ +#define PRT_TCR_TIF0 (0x40) /* Bit 6: Timer 0 Interrupt Flag */ +#define PRT_TCR_TIE1 (0x20) /* Bit 5: Timer 1 Interrupt Enable */ +#define PRT_TCR_TIE0 (0x10) /* Bit 4: Timer 0 Interrupt Enable */ +#define PRT_TCR_TOC1 (0x08) /* Bit 3: Timer 1 Output Control */ +#define PRT_TCR_TOC0 (0x04) /* Bit 2: Timer 0 Output Control */ +#define PRT_TCR_TDE1 (0x02) /* Bit 1: Timer 1 Down Count Enable */ +#define PRT_TCR_TDE0 (0x01) /* Bit 0: Timer 0 Down Count Enable */ /* Timer Data Register 1L (TMDR1L: 0x14) -- 8-bit data */ /* Timer Data Register 1H (TMDR1H: 0x15) -- 8-bit data */ diff --git a/nuttx/arch/z80/src/z180/z180_lowscc.c b/nuttx/arch/z80/src/z180/z180_lowscc.c index e5d5171c1..f729355c6 100644 --- a/nuttx/arch/z80/src/z180/z180_lowscc.c +++ b/nuttx/arch/z80/src/z180/z180_lowscc.c @@ -90,20 +90,6 @@ * Private Functions ****************************************************************************/ -/**************************************************************************** - * Name: z180_scc_setbaud - * - * Description: - * - ****************************************************************************/ - -#if defined(HAVE_SCC_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) -static void z180_scc_setbaud(void) -{ -#warning "Missing logic" -} -#endif /* HAVE_SCC_CONSOLE && !CONFIG_SUPPRESS_UART_CONFIG */ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -112,34 +98,19 @@ static void z180_scc_setbaud(void) * Name: z180_scc_lowinit * * Description: - * Called early in the boot sequence to initialize the [E]SCC channel(s) + * Called early in the boot sequence to initialize the [E]SCC console + * channel (only). * ****************************************************************************/ +#ifdef USE_LOWSERIALINIT void z180_scc_lowinit(void) { -#warning "Missing logic" - - /* Configure for usage of {E]SCC channels (whether or not we have a console) */ - -#ifdef CONFIG_Z180_SCC -#warning "Missing logic" -#endif - -#ifdef CONFIG_Z180_ESCCA -#warning "Missing logic" -#endif - -#ifdef CONFIG_Z180_ESCCB +#ifdef HAVE_SCC_CONSOLE #warning "Missing logic" #endif - - /* Configure the console for immediate usage */ - -#if defined(HAVE_SCC_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) -#warning "Missing logic" -#endif /* HAVE_SCC_CONSOLE && !CONFIG_SUPPRESS_UART_CONFIG */ } +#endif /**************************************************************************** * Name: z180_putc diff --git a/nuttx/arch/z80/src/z180/z180_lowuart.c b/nuttx/arch/z80/src/z180/z180_lowuart.c index 493a793cd..308e01980 100644 --- a/nuttx/arch/z80/src/z180/z180_lowuart.c +++ b/nuttx/arch/z80/src/z180/z180_lowuart.c @@ -83,20 +83,6 @@ * Private Functions ****************************************************************************/ -/**************************************************************************** - * Name: z180_uart_setbaud - * - * Description: - * - ****************************************************************************/ - -#if defined(HAVE_UART_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) -static void z180_uart_setbaud(void) -{ -#warning "Missing logic" -} -#endif /* HAVE_UART_CONSOLE && !CONFIG_SUPPRESS_UART_CONFIG */ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -105,30 +91,19 @@ static void z180_uart_setbaud(void) * Name: z180_uart_lowinit * * Description: - * Called early in the boot sequence to initialize the [E]SCC channel(s) + * Called early in the boot sequence to initialize the uart console + * channel (only). * ****************************************************************************/ +#ifdef USE_LOWSERIALINIT void z180_uart_lowinit(void) { -#warning "Missing logic" - - /* Configure for usage of {E]SCC channels (whether or not we have a console) */ - -#ifdef CONFIG_Z180_UART0 -#warning "Missing logic" -#endif - -#ifdef CONFIG_Z180_UART1 +#ifdef HAVE_UART_CONSOLE #warning "Missing logic" #endif - - /* Configure the console for immediate usage */ - -#if defined(HAVE_UART_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) -#warning "Missing logic" -#endif /* HAVE_UART0_CONSOLE && !CONFIG_SUPPRESS_UART_CONFIG */ } +#endif /**************************************************************************** * Name: z180_putc diff --git a/nuttx/arch/z80/src/z180/z180_serial.h b/nuttx/arch/z80/src/z180/z180_serial.h index 31248eb51..0b0e12d79 100644 --- a/nuttx/arch/z80/src/z180/z180_serial.h +++ b/nuttx/arch/z80/src/z180/z180_serial.h @@ -57,11 +57,12 @@ * Name: z180_uart_lowinit * * Description: - * Called early in the boot sequence to initialize the UART(s) + * Called early in the boot sequence to initialize the uart console + * channel (only). * ****************************************************************************/ -#ifdef HAVE_UART +#if defined(HAVE_UART) && defined(USE_LOWSERIALINIT) void z180_uart_lowinit(void); #else # define z180_uart_lowinit() @@ -71,11 +72,12 @@ void z180_uart_lowinit(void); * Name: z180_scc_lowinit * * Description: - * Called early in the boot sequence to initialize the [E]SCC channel(s) + * Called early in the boot sequence to initialize the [E]SCC console + * channel (only). * ****************************************************************************/ -#ifdef HAVE_SCC +#if defined(HAVE_SCC) && defined(USE_LOWSERIALINIT) void z180_scc_lowinit(void); #else # define z180_scc_lowinit() diff --git a/nuttx/arch/z80/src/z180/z180_timerisr.c b/nuttx/arch/z80/src/z180/z180_timerisr.c new file mode 100644 index 000000000..ceb7efb5f --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_timerisr.c @@ -0,0 +1,157 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_timerisr.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "clock_internal.h" +#include "up_internal.h" + +#include "chip.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* "The Z180 contains a two channel 16-bit Programmable Reload Timer. Each + * PRT channel contains a 16-bit down counter and a 16-bit reload register." + * Channel 0 is dedicated as the system timer. + */ + +/* "The PRT input clock for both channels is equal to the system clock + * divided by 20." + */ + +#define Z180_PRT_CLOCK (Z180_SYSCLOCK / 20) + +/* The data Register "(TMDR) is decremented once every twenty clocks. When + * TMDR counts down to 0, it is automatically reloaded with the value + * contained in the Reload Register (RLDR)." + */ + +#define A180_PRT0_RELOAD (Z180_PRT_CLOCK / CLK_TCK) + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Global Functions + ****************************************************************************/ + +/**************************************************************************** + * Function: up_timerisr + * + * Description: + * The timer ISR will perform a variety of services for various portions + * of the systems. + * + ****************************************************************************/ + +int up_timerisr(int irq, chipreg_t *regs) +{ + volatile uint8_t regval; + + /* "When TMDR0 decrements to 0, TIF0 is set to 1. This generates an interrupt + * request if enabled by TIE0 = 1. TIF0 is reset to 0 when TCR is read and + * the higher or lower byte of TMDR0 is read." + */ + + regval = inp(Z180_PRT_TCR); + regval = inp(Z180_PRT0_DRL); + regval = inp(Z180_PRT0_DRH); + + /* Process timer interrupt */ + + sched_process_timer(); + return 0; +} + +/**************************************************************************** + * Function: up_timerinit + * + * Description: + * This function is called during start-up to initialize the timer + * interrupt. + * + ****************************************************************************/ + +void up_timerinit(void) +{ + uint8_t regval; + + /* Configure PRT0 to interrupt at the requested rate */ + /* First stop PRT0 and disable interrupts */ + + regval = inp(Z180_PRT_TCR); + regval &= (PRT_TCR_TIF0|PRT_TCR_TIE0|PRT_TCR_TDE0); + outp(Z180_PRT_TCR, regval); + + /* Set the timer reload value so that the timer will interrupt at the + * desired frequency. "For writing, the TMDR down counting must be + * inhibited using the TDE (Timer Down Count Enable) bits in the TCR + * (Timer Control Register). Then, any or both higher and lower bytes of + * TMDR can be freely written (and read) in any order." + */ + + outp(Z180_PRT0_RLDRL, (A180_PRT0_RELOAD & 0xff)); + outp(Z180_PRT0_RLDRH, (A180_PRT0_RELOAD >> 8)); + + /* Enable down-counting */ + + regval |= PRT_TCR_TDE0; + outp(Z180_PRT_TCR, regval); + + /* Attach the timer interrupt vector */ + + (void)irq_attach(Z180_PRT0, (xcpt_t)up_timerisr); + + /* And enable the timer interrupt */ + + regval |= PRT_TCR_TIE0; + outp(Z180_PRT_TCR, regval); +} diff --git a/nuttx/configs/p112/include/board.h b/nuttx/configs/p112/include/board.h index 55077709d..35a8011c1 100644 --- a/nuttx/configs/p112/include/board.h +++ b/nuttx/configs/p112/include/board.h @@ -41,8 +41,14 @@ ************************************************************/ /************************************************************ - * Definitions + * Pre-processor Definitions ************************************************************/ +/* The Z180 is driven by a 16MHz crystal. The system clock + * is equal to the crystal frequency. + */ + +#define Z180_BOARD_XTAL 16000000 /* 16 MHz */ +#define Z180_SYSCLOCK Z180_BOARD_XTAL /* 16 MHz */ /************************************************************ * Public Functions diff --git a/nuttx/configs/p112/ostest/defconfig b/nuttx/configs/p112/ostest/defconfig index eb02fe6bc..c30adcf22 100644 --- a/nuttx/configs/p112/ostest/defconfig +++ b/nuttx/configs/p112/ostest/defconfig @@ -140,7 +140,7 @@ CONFIG_Z180_PHYSHEAP_END=0x100000 # CONFIG_Z180_UART1 is not set CONFIG_Z180_ESCCA=y # CONFIG_Z180_ESCCB is not set -# CONFIG_Z180_TMR1 is not set +# CONFIG_Z180_PRT1 is not set # CONFIG_Z180_PORTA is not set # CONFIG_Z180_PORTB is not set # CONFIG_Z180_MIMIC is not set @@ -159,7 +159,7 @@ CONFIG_Z180_ESCCA_2STOP=0 # # Architecture Options # -# CONFIG_ARCH_NOINTC is not set +CONFIG_ARCH_NOINTC=y # CONFIG_ARCH_DMA is not set # CONFIG_ARCH_IRQPRIO is not set # CONFIG_CUSTOM_STACK is not set diff --git a/nuttx/configs/xtrs/nsh/defconfig b/nuttx/configs/xtrs/nsh/defconfig index cc3d4da2f..8730ebab7 100644 --- a/nuttx/configs/xtrs/nsh/defconfig +++ b/nuttx/configs/xtrs/nsh/defconfig @@ -79,7 +79,7 @@ CONFIG_LINKER_ROM_AT_0000=y # # Architecture Options # -# CONFIG_ARCH_NOINTC is not set +CONFIG_ARCH_NOINTC=y # CONFIG_ARCH_DMA is not set # CONFIG_ARCH_IRQPRIO is not set # CONFIG_ARCH_STACKDUMP is not set diff --git a/nuttx/configs/xtrs/ostest/defconfig b/nuttx/configs/xtrs/ostest/defconfig index cf87886a2..a0a100bcf 100644 --- a/nuttx/configs/xtrs/ostest/defconfig +++ b/nuttx/configs/xtrs/ostest/defconfig @@ -79,7 +79,7 @@ CONFIG_LINKER_ROM_AT_0000=y # # Architecture Options # -# CONFIG_ARCH_NOINTC is not set +CONFIG_ARCH_NOINTC=y # CONFIG_ARCH_DMA is not set # CONFIG_ARCH_IRQPRIO is not set # CONFIG_ARCH_STACKDUMP is not set diff --git a/nuttx/configs/xtrs/pashello/defconfig b/nuttx/configs/xtrs/pashello/defconfig index d0b5d8245..d23c50716 100644 --- a/nuttx/configs/xtrs/pashello/defconfig +++ b/nuttx/configs/xtrs/pashello/defconfig @@ -80,7 +80,7 @@ CONFIG_LINKER_ROM_AT_0000=y # # Architecture Options # -# CONFIG_ARCH_NOINTC is not set +CONFIG_ARCH_NOINTC=y # CONFIG_ARCH_DMA is not set # CONFIG_ARCH_IRQPRIO is not set # CONFIG_ARCH_STACKDUMP is not set diff --git a/nuttx/configs/xtrs/src/xtr_irq.c b/nuttx/configs/xtrs/src/xtr_irq.c index e72c0be3b..1180149cd 100644 --- a/nuttx/configs/xtrs/src/xtr_irq.c +++ b/nuttx/configs/xtrs/src/xtr_irq.c @@ -88,33 +88,3 @@ void up_irqinitialize(void) irqrestore(Z80_C_FLAG); #endif } - -/**************************************************************************** - * Name: up_disable_irq - * - * Description: - * Disable the IRQ specified by 'irq' - * - ****************************************************************************/ - -#ifndef CONFIG_ARCH_NOINTC -void up_disable_irq(int irq) -{ - irqrestore(0); -} -#endif - -/**************************************************************************** - * Name: up_enable_irq - * - * Description: - * Enable the IRQ specified by 'irq' - * - ****************************************************************************/ - -#ifndef CONFIG_ARCH_NOINTC -void up_enable_irq(int irq) -{ - irqrestore(Z80_C_FLAG); -} -#endif diff --git a/nuttx/configs/z80sim/nsh/defconfig b/nuttx/configs/z80sim/nsh/defconfig index 1f8edacb1..fb9fac546 100644 --- a/nuttx/configs/z80sim/nsh/defconfig +++ b/nuttx/configs/z80sim/nsh/defconfig @@ -79,7 +79,7 @@ CONFIG_LINKER_DATA_AREA=0x8000 # # Architecture Options # -# CONFIG_ARCH_NOINTC is not set +CONFIG_ARCH_NOINTC=y # CONFIG_ARCH_DMA is not set # CONFIG_ARCH_IRQPRIO is not set # CONFIG_ARCH_STACKDUMP is not set diff --git a/nuttx/configs/z80sim/ostest/defconfig b/nuttx/configs/z80sim/ostest/defconfig index a961d550d..d3410d52d 100644 --- a/nuttx/configs/z80sim/ostest/defconfig +++ b/nuttx/configs/z80sim/ostest/defconfig @@ -79,7 +79,7 @@ CONFIG_LINKER_DATA_AREA=0x8000 # # Architecture Options # -# CONFIG_ARCH_NOINTC is not set +CONFIG_ARCH_NOINTC=y # CONFIG_ARCH_DMA is not set # CONFIG_ARCH_IRQPRIO is not set # CONFIG_ARCH_STACKDUMP is not set diff --git a/nuttx/configs/z80sim/pashello/defconfig b/nuttx/configs/z80sim/pashello/defconfig index a8d565ce2..e7dee626c 100644 --- a/nuttx/configs/z80sim/pashello/defconfig +++ b/nuttx/configs/z80sim/pashello/defconfig @@ -79,7 +79,7 @@ CONFIG_LINKER_DATA_AREA=0x8000 # # Architecture Options # -# CONFIG_ARCH_NOINTC is not set +CONFIG_ARCH_NOINTC=y # CONFIG_ARCH_DMA is not set # CONFIG_ARCH_IRQPRIO is not set # CONFIG_ARCH_STACKDUMP is not set diff --git a/nuttx/configs/z80sim/src/z80_irq.c b/nuttx/configs/z80sim/src/z80_irq.c index c7566f6d3..7611dc29e 100644 --- a/nuttx/configs/z80sim/src/z80_irq.c +++ b/nuttx/configs/z80sim/src/z80_irq.c @@ -88,33 +88,3 @@ void up_irqinitialize(void) irqrestore(Z80_C_FLAG); #endif } - -/**************************************************************************** - * Name: up_disable_irq - * - * Description: - * Disable the IRQ specified by 'irq' - * - ****************************************************************************/ - -#ifndef CONFIG_ARCH_NOINTC -void up_disable_irq(int irq) -{ - irqrestore(0); -} -#endif - -/**************************************************************************** - * Name: up_enable_irq - * - * Description: - * Enable the IRQ specified by 'irq' - * - ****************************************************************************/ - -#ifndef CONFIG_ARCH_NOINTC -void up_enable_irq(int irq) -{ - irqrestore(Z80_C_FLAG); -} -#endif -- cgit v1.2.3 From 8fc05d82fc7e1258cff333dcdebfb718820d0d48 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 15 Dec 2012 16:03:45 +0000 Subject: Documentation update git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5439 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/Documentation/NuttX.html | 143 +++++++++++++++++++++++++++++++---------- nuttx/README.txt | 10 +-- nuttx/configs/README.txt | 3 + nuttx/configs/p112/README.txt | 3 + 4 files changed, 117 insertions(+), 42 deletions(-) (limited to 'nuttx') diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index 49f48d2d6..d8d393a7c 100644 --- a/nuttx/Documentation/NuttX.html +++ b/nuttx/Documentation/NuttX.html @@ -8,7 +8,7 @@

    NuttX RTOS

    -

    Last Updated: November 5, 2012

    +

    Last Updated: December 15, 2012

    @@ -1234,12 +1234,13 @@ svn checkout -r5313 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code -
  • Zilog +
  • ZiLOG
  • @@ -2774,6 +2775,35 @@ BFD_ASSERT (*plt_offset != (bfd_vma) -1);
      + + + + Zilog Z180. + + + +
      + +

      + P112. + The P112 is a hobbyist single board computer based on a 16MHz Z80182 with up to 1MB of memory, serial, +parallel and diskette IO, and realtime clock, in a 3.5-inch drive form factor.. + The P112 computer originated as a commercial product of "D-X Designs Pty Ltd"[ of Australia. +

      +

      + Dave Brooks was successfully funded through Kickstarter for and another run of P112 boards in November of 2012. + In addition Terry Gulczynski makes additional P112 derivative hobbyist home brew computers. +

      +
        +

        + STATUS: + Most of the NuttX is in port for both the Z80182 and for the P112 board. + Boards from Kickstarter project will not be available, however, until the first quarter of 2013. + So it will be some time before this port is verified on hardware. +

        +
          + + @@ -2842,7 +2872,7 @@ avr, m68k, m68hc11, m68hc12, m9s12, blackfin, m32c, h8, and SuperH ports. - Linux + GNU make + GCC/binutils + Linux + GNU make + GCC/binutils for Linux @@ -2866,7 +2896,7 @@ avr, m68k, m68hc11, m68hc12, m9s12, blackfin, m32c, h8, and SuperH ports. - Linux + GNU make + SDCC + Linux + GNU make + SDCC for Linux @@ -2885,7 +2915,7 @@ avr, m68k, m68hc11, m68hc12, m9s12, blackfin, m32c, h8, and SuperH ports. - Cygwin + GNU make + GCC/binutils + Windows with Cygwin + GNU make + GCC/binutils (custom built under Cygwin) @@ -2893,10 +2923,8 @@ avr, m68k, m68hc11, m68hc12, m9s12, blackfin, m32c, h8, and SuperH ports.

          This combination works well too. - It works just as well as the native Linux environment except - that compilation and build times are a little longer. - The custom NuttX buildroot referenced above may be build in - the Cygwin environment as well. + It works just as well as the native Linux environment except that compilation and build times are a little longer. + The custom NuttX buildroot referenced above may be build in the Cygwin environment as well.

          @@ -2904,7 +2932,7 @@ avr, m68k, m68hc11, m68hc12, m9s12, blackfin, m32c, h8, and SuperH ports. - Cygwin + GNU make + SDCC + Windows with Cygwin + GNU make + SDCC (custom built under Cygwin) @@ -2919,7 +2947,7 @@ avr, m68k, m68hc11, m68hc12, m9s12, blackfin, m32c, h8, and SuperH ports. - Cygwin + GNU make + Windows Native Toolchain + Windows with Cygwin + GNU make + Windows Native Toolchain @@ -2975,15 +3003,65 @@ avr, m68k, m68hc11, m68hc12, m9s12, blackfin, m32c, h8, and SuperH ports.

          Supported Windows Native Toolchains. - At present, only the Zilog Z16F, z8Encore, and eZ80Acclaim ports use a non-GCC native Windows - toolchain(the Zilog ZDS-II toolchain). - Support for Windows native GCC toolchains (CodeSourcery and devkitARM) is currently implemented - for the NXP LPC214x, STMicro STR71x, and Luminary LMS6918 ARM ports. - (but could easily be extended to any other GCC-based platform with a small effort). + At present, the following Windows native toolchains are in use: +

            +
          1. GCC built for Windows (such as CodeSourcery, Atollic, devkitARM, etc.),
          2. +
          3. SDCC built for Windows,
          4. +
          5. the ZiLOG XDS-II toolchain for Z16F, z8Encore, and eZ80Acclaim parts.
          6. +

          + + + + Windows Native (CMD.exe) + GNUWin32 (including GNU make) + MinGW Host GCC compiler + Windows Native Toolchain + + +
          + +

          + Build support has been added to support building natively in a Windes CMD.exe rather than in a POSIX-like environment. +

          +

          + This build: +

          +
            +
          1. Uses all Windows style paths
          2. +
          3. Uses primarily Windows batch commands from cmd.exe, with
          4. +
          5. A few extensions from GNUWin32
          6. +
          +

          + This capability first appeared in NuttX-6.24 and should still be considered a work in progress because: (1) it has not been verfied on all targets and tools, and (2) still lacks some of the creature-comforts of the more mature environments. + The windows native build logic initiatiated if CONFIG_WINDOWS_NATIVE=y is defined in the NuttX configuration file: +

          +

          + At present, this build environment also requires: +

          +
            +
          • + CMD.exe Shell. + The build must be performed in a Windows CMD.execmd shell that comes with Windows. + I prefer the ConEmu command shell which can be downloaded from: + http://code.google.com/p/conemu-maximus5/ +
          • +
          • + GNUWin32. + The build still relies on some Unix-like commands. + I usethe GNUWin32 tools that can be downloaded from http://gnuwin32.sourceforge.net/. + See the top-level nuttx/README.txt file for some download, build, and installation notes. +
          • +
          • + MinGW-GCC. + MinGW-GCC is used to compiler the C tools in the nuttx/tools directory that are neede by the build. + MinGW-GCC can be downloaded from http://www.mingw.org/. + If you are using GNUWin32, then it is recommendedthe you not install the optional MSYS components as there may be conflicts. +
          • + + + @@ -3028,8 +3106,7 @@ if [ -x "$WINELOADER" ]; then exec "$WINELOADER" "$appname" "$@"; fi - Other Environments? - Windows Native make + Windows Native Toolchain? + Other Environments? @@ -3046,19 +3123,15 @@ if [ -x "$WINELOADER" ]; then exec "$WINELOADER" "$appname" "$@"; fi modification of the Make system would be required.

            - GNUWin32. - For example, with suitable make system changes, it should be possible to - use native GNU tools (such as those from - GNUWin32) - to build NuttX. - However, that environment has not been used as of this writing. -

            -

            - NOTE: One of the members on the NuttX forum - reported that they successful built NuttX using such a GNUWin32-based, Windows native environment. - They reported that the only necessary change was to the use the NTFS mklink command to create links - (see tools/copydir.sh script). -

            + MSYS. + I have not used MSYS but what I gather from talking with NuttX users is that MSYS can be used as an alternative to Cygwin in any of the above Cygwin environments. + This is not surprising since MSYS is based on an older version of Cygwin (cygwin-1.3). + MSYS has been modified, however, to interoperate in the Windows environment better than Cygwin and that may be of value to some users. +

            +

            + MSYS, however, cannot be used with the native Windows NuttX build because it will invoke the MSYS bash shell instead of the CMD.exe shell. + Use GNUWin32 in the native Windows build envionment. +

            diff --git a/nuttx/README.txt b/nuttx/README.txt index 9ad499d3f..b9210277e 100644 --- a/nuttx/README.txt +++ b/nuttx/README.txt @@ -499,16 +499,14 @@ Native Windows Build -------------------- The beginnings of a Windows native build are in place but still not full - usable as of this writing. The windows native build logic is currently - separate and must be started by: - - make -f Makefile.win + usable as of this writing. The windows native build logic initiatiated + if CONFIG_WINDOWS_NATIVE=y is defined in the NuttX configuration file: This build: - Uses all Windows style paths - Uses primarily Windows batch commands from cmd.exe, with - - A few extensions from GNUWin32 (or MSYS is you prefer) + - A few extensions from GNUWin32 In this build, you cannot use a Cygwin or MSYS shell. Rather the build must be performed in a Windows CMD shell. Here is a better shell than than the @@ -517,8 +515,6 @@ Native Windows Build Build Tools. The build still relies on some Unix-like commands. I use the GNUWin32 tools that can be downloaded from http://gnuwin32.sourceforge.net/. - The MSYS tools are probably also a option but are likely lower performance - since they are based on Cygwin 1.3. Host Compiler: I use the MingGW compiler which can be downloaded from http://www.mingw.org/. If you are using GNUWin32, then it is recommended diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt index e7f73f945..21aace2af 100644 --- a/nuttx/configs/README.txt +++ b/nuttx/configs/README.txt @@ -1804,6 +1804,9 @@ configs/p112 Hal Bower was very active in the mid 1990's on the P112 project and ported the "Banked/Portable BIOS". + Dave Brooks was successfully funded through Kickstarter for and another + run of P112 boards in November of 2012. + configs/pic32-starterkit This directory contains the port of NuttX to the Microchip PIC32 Ethernet Starter Kit (DM320004) with the Multimedia Expansion Board (MEB, DM320005). diff --git a/nuttx/configs/p112/README.txt b/nuttx/configs/p112/README.txt index 265024cca..7f49ffe90 100644 --- a/nuttx/configs/p112/README.txt +++ b/nuttx/configs/p112/README.txt @@ -24,6 +24,9 @@ Gulczynski makes additional P112 derivative hobbyist home brew computers. Hal Bower was very active in the mid 1990's on the P112 project and ported the "Banked/Portable BIOS". +Dave Brooks was successfully funded through Kickstarter for and another +run of P112 boards in November of 2012. + Pin Configuration ================= -- cgit v1.2.3 From 14a896b20509dfc4657778fa21246cffb2ec2b55 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 16 Dec 2012 21:15:27 +0000 Subject: Add basic hooks to support a PATH variable (more is needed) git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5440 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 9 ++ nuttx/TODO | 28 +++- nuttx/binfmt/Kconfig | 16 ++ nuttx/binfmt/Makefile | 16 +- nuttx/binfmt/binfmt_exepath.c | 285 ++++++++++++++++++++++++++++++++++++ nuttx/configs/sim/ostest/defconfig | 21 ++- nuttx/include/nuttx/binfmt/binfmt.h | 112 ++++++++++++-- nuttx/sched/env_clearenv.c | 2 - nuttx/sched/env_release.c | 4 +- nuttx/sched/os_bringup.c | 19 +++ nuttx/sched/os_start.c | 4 +- 11 files changed, 485 insertions(+), 31 deletions(-) create mode 100644 nuttx/binfmt/binfmt_exepath.c (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 11e8b200b..c61b28f69 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3782,4 +3782,13 @@ * arch/z80/src/z180/z180_mmu.*: Add MMU support for z180 tasks. * configs/p112: Add very basic board support and an examples/ostest configuration for the venerable P112 board. + * sched/os_bringup.c: If CONFIG_PATH_INITIAL is defined, then the initial + environment of the task started by os_bringup() will have the PATH + environment variable defined to be that string. + * binfmt/binfmt_exepath.c: If CONFIG_BINFMT_EXEPATH is defined, then this + file will be built. In contains logic to search for regular files at + the absolutes paths found in the current PATH environment variable + setting. This is untested and not yet hooked into the binfmt exec() + logic on initial check-in + diff --git a/nuttx/TODO b/nuttx/TODO index fcc418a0e..85a89b41f 100644 --- a/nuttx/TODO +++ b/nuttx/TODO @@ -35,12 +35,12 @@ nuttx/ (4) ARM/STM32 (arch/arm/src/stm32/) (3) AVR (arch/avr) (0) Intel x86 (arch/x86) - (4) 8051 / MCS51 (arch/8051/) + (5) 8051 / MCS51 (arch/8051/) (3) MIPS/PIC32 (arch/mips) (1) Hitachi/Renesas SH-1 (arch/sh/src/sh1) (4) Renesas M16C/26 (arch/sh/src/m16c) (10) z80/z8/ez80 (arch/z80/) - (8) z16 (arch/z16/) + (9) z16 (arch/z16/) (1) mc68hc1x (arch/hc) apps/ @@ -1505,6 +1505,16 @@ o 8051 / MCS51 (arch/8051/) Status: Open Priority: Low -- only because there as so many other issues with 8051 + Title: 8051 BUILD BROKEN + Description: The last time I tried to build the pjrc-8051 configurtion using + the SDCC 3.2.1 toolchain (for Windows). I got compilation + errors in sched/os_bringup.c. It complained about type + mis-matches. What I gather from Googling, this is a problem + with the --stack-auto option. At any rate, this problem will + need to be fixed if you want to resurrect the 8051 NuttX port. + Status: Open + Priority: Low -- I don't think anyone uses the 8051 port. + o MIPS/PIC32(arch/mips) ^^^^^^^^^^^^^^^^^^^^^ @@ -1833,9 +1843,17 @@ o z16 (arch/z16) Internal Error(0503) On line 2504 of "MMCSD\MMCSD_SDIO.C" File , Args(562,46) - Status: Open. Recommended workaround: remove mmcsd_sdio.c from - drivers/mmcsd/Make.defs. There is no SDIO support for the Z16 anyway - Priority: Low + Status: Open. Recommended workaround: remove mmcsd_sdio.c from + drivers/mmcsd/Make.defs. There is no SDIO support for the Z16 anyway + Priority: Low + + Title: NATIVE BUILD PROBLEMS + Description: When last tested (ca.12/12), there were some missing .obj files in + arch/z16/src. A little additional TLC will be needed to get a + reliable Windows native build. As of this writing, the Cygwin + based build has not been re-verified. + Status: Open + Priority: Low -- I don't think anyone uses the Z16 port. o mc68hc1x (arch/hc) ^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/binfmt/Kconfig b/nuttx/binfmt/Kconfig index cbf909327..495bd050f 100644 --- a/nuttx/binfmt/Kconfig +++ b/nuttx/binfmt/Kconfig @@ -12,6 +12,22 @@ config BINFMT_DISABLE if !BINFMT_DISABLE +config BINFMT_EXEPATH + bool "Support PATH variable" + default n + depends on !DISABLE_ENVIRON + ---help--- + Use the contents of the PATH environment variable to locate executable + files. Default: n + +config PATH_INITIAL + string "Initial PATH Value" + default "" + depends on BINFMT_EXEPATH + ---help--- + The initial value of the PATH variable. This is the colon-separated + list of absolute paths. E.g., "/bin:/usr/bin:/sbin" + config NXFLAT bool "Enable the NXFLAT Binary Format" default n diff --git a/nuttx/binfmt/Makefile b/nuttx/binfmt/Makefile index bda9602ac..8ec0d877c 100644 --- a/nuttx/binfmt/Makefile +++ b/nuttx/binfmt/Makefile @@ -43,15 +43,19 @@ CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(TOPDIR)$(DELIM)sched"} # Basic BINFMT source files -BINFMT_ASRCS = -BINFMT_CSRCS = binfmt_globals.c binfmt_register.c binfmt_unregister.c \ - binfmt_loadmodule.c binfmt_unloadmodule.c binfmt_execmodule.c \ - binfmt_exec.c binfmt_dumpmodule.c +BINFMT_ASRCS = +BINFMT_CSRCS = binfmt_globals.c binfmt_register.c binfmt_unregister.c +BINFMT_CSRCS += binfmt_loadmodule.c binfmt_unloadmodule.c binfmt_execmodule.c +BINFMT_CSRCS += binfmt_exec.c binfmt_dumpmodule.c + +ifeq ($(CONFIG_BINFMT_EXEPATH),y) +BINFMT_CSRCS += binfmt_exepath.c +endif # Symbol table source files -BINFMT_CSRCS += symtab_findbyname.c symtab_findbyvalue.c \ - symtab_findorderedbyname.c symtab_findorderedbyvalue.c +BINFMT_CSRCS += symtab_findbyname.c symtab_findbyvalue.c +BINFMT_CSRCS += symtab_findorderedbyname.c symtab_findorderedbyvalue.c # Add configured binary modules diff --git a/nuttx/binfmt/binfmt_exepath.c b/nuttx/binfmt/binfmt_exepath.c new file mode 100644 index 000000000..c81588975 --- /dev/null +++ b/nuttx/binfmt/binfmt_exepath.c @@ -0,0 +1,285 @@ +/**************************************************************************** + * binfmt/binfmt_exepath.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#if !defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_BINFMT_EXEPATH) + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +struct exepath_s +{ + FAR char *next; /* Pointer to the next (unterminated) value in the PATH variable */ + char path[1]; +}; +#define SIZEOF_EXEPATH_S(n) (sizeof(struct exepath_s) + (n) - 1) + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: exepath_init + * + * Description: + * Initialize for the traversal of each value in the PATH variable. The + * usage is sequence is as follows: + * + * 1) Call exepath_init() to initialze for the traversal. exepath_init() + * will return an opaque handle that can then be provided to + * exepath_next() and exepath_release(). + * 2) Call exepath_next() repeatedly to examine every file that lies + * in the directories of the PATH variable + * 3) Call exepath_release() to free resources set aside by exepath_init(). + * + * Input Parameters: + * None + * + * Returned Value: + * On success, exepath_init() return a non-NULL, opaque handle that may + * subsequently be used in calls to exepath_next() and exepath_release(). + * On error, a NULL handle value will be returned. The most likely cause + * of an error would be that the there is no value associated with the + * PATH variable. + * + ****************************************************************************/ + +EXEPATH_HANDLE exepath_init(void) +{ + FAR struct exepath_s *exepath; + FAR char *path; + + /* Get the value of the PATH variable */ + + path = getenv("PATH"); + if (!path) + { + /* getenv() will return a NULL value if the PATH variable does not + * exist in the environment. + */ + + return (EXEPATH_HANDLE)NULL; + } + + /* Allocate a container for the PATH variable contents */ + + exepath = (FAR struct exepath_s *)kmalloc(SIZEOF_EXEPATH_S(strlen(path) + 1)); + if (!exepath) + { + /* Ooops.. we are out of memory */ + + return (EXEPATH_HANDLE)NULL; + } + + /* Populate the container */ + + strcpy(exepath->path, path); + exepath->next = exepath->path; + + /* And return the containing cast to an opaque handle */ + + return (EXEPATH_HANDLE)exepath; +} + + /**************************************************************************** + * Name: exepath_next + * + * Description: + * Traverse all possible values in the PATH variable in attempt to find + * the full path to an executable file when only a relative path is + * provided. + * + * Input Parameters: + * handle - The handle value returned by exepath_init + * relpath - The relative path to the file to be found. + * + * Returned Value: + * On success, a non-NULL pointer to a null-terminated string is provided. + * This is the full path to a file that exists in the file system. This + * function will verify that the file exists (but will not verify that it + * is marked executable). + * + * NOTE: The string pointer return in the success case points to allocated + * memory. This memory must be freed by the called by calling kfree(). + * + * NULL is returned if no path is found to any file with the provided + * 'relpath' from any absolute path in the file variable. In this case, + * there is no point in calling exepath_next() further; exepath_release() + * must be called to release resources set aside by expath_init(). + * + ****************************************************************************/ + +FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath) +{ + FAR struct exepath_s *exepath = (FAR struct exepath_s *)handle; + struct stat buf; + FAR char *endptr; + FAR char *path; + FAR char *fullpath; + int pathlen; + int ret; + + /* Verify that a value handle and relative path were provided */ + + DEBUGASSERT(exepath && relpath); + DEBUGASSERT(relpath[0] != '\0' && relpath[0] != '/'); + + /* Loop until (1) we find a file with this relative path from one of the + * absolute paths in the PATH variable, or (2) all of the absolute paths + * in the PATH variable have been considered. + */ + + for (;;) + { + /* Make sure that exepath->next points to the beginning of a string */ + + path = exepath->next; + if (*path == '\0') + { + /* If it points to a NULL it means that either (1) the PATH varialbe + * is empty, or (2) we have already examined all of the paths in the + * path variable. + */ + + return (FAR char *)NULL; + } + + /* Okay... 'path' points to the beginning of the string. The string may + * be termined either with (1) ':' which separates the path from the + * next path in the list, or (2) NUL which marks the end of the list. + */ + + endptr = strchr(path, ':'); + if (!endptr) + { + /* If strchr returns NUL it means that ':' does not appear in the + * string. Therefore, this must be the final path in the PATH + * variable content. + */ + + endptr = &path[strlen(path)]; + exepath->next = endptr; + DEBUGASSERT(*endptr == '\0'); + } + else + { + DEBUGASSERT(*endptr == ':'); + exepath->next = endptr + 1; + *endptr = '\0'; + } + + pathlen = strlen(path) + strlen(relpath) + 2; + fullpath = (FAR char *)kmalloc(pathlen); + if (!fullpath) + { + /* Failed to allocate memory */ + + return (FAR char *)NULL; + } + + /* Construct the full path */ + + sprintf(fullpath, "%s/%s", path, relpath); + + /* Verify that a regular file exists at this path */ + + ret = stat(fullpath, &buf);; + if (ret == OK && S_ISREG(buf.st_mode)) + { + return fullpath; + } + + /* Failed to stat the file. Just free the allocated memory and + * continue to try the next path. + */ + + kfree(fullpath); + } + + /* We will not get here */ +} + +/**************************************************************************** + * Name: exepath_release + * + * Description: + * Release all resources set aside by exepath_release when the handle value + * was created. The handle value is invalid on return from this function. + * Attempts to all exepath_next() or exepath_release() with such a 'stale' + * handle will result in undefined (i.e., not good) behavior. + * + * Input Parameters: + * handle - The handle value returned by exepath_init + * + * Returned Value: + * None + * + ****************************************************************************/ + +void exepath_release(EXEPATH_HANDLE handle) +{ + kfree(handle); +} + +#endif /* !CONFIG_BINFMT_DISABLE && CONFIG_BINFMT_EXEPATH */ + diff --git a/nuttx/configs/sim/ostest/defconfig b/nuttx/configs/sim/ostest/defconfig index aece17569..beee30639 100644 --- a/nuttx/configs/sim/ostest/defconfig +++ b/nuttx/configs/sim/ostest/defconfig @@ -8,6 +8,10 @@ CONFIG_NUTTX_NEWCONFIG=y # Build Setup # # CONFIG_EXPERIMENTAL is not set +CONFIG_HOST_LINUX=y +# CONFIG_HOST_OSX is not set +# CONFIG_HOST_WINDOWS is not set +# CONFIG_HOST_OTHER is not set # # Build Configuration @@ -83,7 +87,11 @@ CONFIG_BOARD_LOOPSPERMSEC=100 # # CONFIG_ARCH_NOINTC is not set # CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_IRQPRIO is not set +# CONFIG_CUSTOM_STACK is not set +# CONFIG_ADDRENV is not set # CONFIG_ARCH_STACKDUMP is not set +# CONFIG_ENDIAN_BIG is not set # # Board Settings @@ -165,7 +173,6 @@ CONFIG_PREALLOC_TIMERS=8 # # Stack and heap information # -# CONFIG_CUSTOM_STACK is not set CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 @@ -250,8 +257,10 @@ CONFIG_MM_REGIONS=1 # Binary Formats # # CONFIG_BINFMT_DISABLE is not set +# CONFIG_BINFMT_EXEPATH is not set # CONFIG_NXFLAT is not set # CONFIG_ELF is not set +# CONFIG_PIC is not set # CONFIG_SYMTAB_ORDEREDBYNAME is not set # @@ -274,9 +283,12 @@ CONFIG_ARCH_LOWPUTC=y CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_C99_BOOL8 is not set # CONFIG_HAVE_CXX is not set -# CONFIG_HAVE_CXXINITIALIZE is not set -# CONFIG_CXX_NEWLONG is not set # # Application Configuration @@ -302,6 +314,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_EXAMPLES_HELLOXX is not set # CONFIG_EXAMPLES_JSON is not set # CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set # CONFIG_EXAMPLES_IGMP is not set # CONFIG_EXAMPLES_LCDRW is not set # CONFIG_EXAMPLES_MM is not set @@ -323,6 +336,8 @@ CONFIG_EXAMPLES_OSTEST=y CONFIG_EXAMPLES_OSTEST_LOOPS=100 CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192 CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=8 +CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000 +CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_PASHELLO is not set # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POLL is not set diff --git a/nuttx/include/nuttx/binfmt/binfmt.h b/nuttx/include/nuttx/binfmt/binfmt.h index 49ab37264..80c0e7c7b 100644 --- a/nuttx/include/nuttx/binfmt/binfmt.h +++ b/nuttx/include/nuttx/binfmt/binfmt.h @@ -54,6 +54,14 @@ /**************************************************************************** * Public Types ****************************************************************************/ +/* EXEPATH_HANDLE is an opaque handle used to traverse the absolute paths + * assigned to the PATH environment variable. + */ + +#if !defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_BINFMT_EXEPATH) +typedef FAR void *EXEPATH_HANDLE; +#endif + /* The type of one C++ constructor or destructor */ typedef FAR void (*binfmt_ctor_t)(void); @@ -100,12 +108,9 @@ struct binfmt_s * Public Data ****************************************************************************/ -#undef EXTERN #if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern +extern "C" +{ #endif /**************************************************************************** @@ -125,7 +130,7 @@ extern "C" { * ****************************************************************************/ -EXTERN int register_binfmt(FAR struct binfmt_s *binfmt); +int register_binfmt(FAR struct binfmt_s *binfmt); /**************************************************************************** * Name: unregister_binfmt @@ -140,7 +145,7 @@ EXTERN int register_binfmt(FAR struct binfmt_s *binfmt); * ****************************************************************************/ -EXTERN int unregister_binfmt(FAR struct binfmt_s *binfmt); +int unregister_binfmt(FAR struct binfmt_s *binfmt); /**************************************************************************** * Name: load_module @@ -156,7 +161,7 @@ EXTERN int unregister_binfmt(FAR struct binfmt_s *binfmt); * ****************************************************************************/ -EXTERN int load_module(FAR struct binary_s *bin); +int load_module(FAR struct binary_s *bin); /**************************************************************************** * Name: unload_module @@ -177,7 +182,7 @@ EXTERN int load_module(FAR struct binary_s *bin); * ****************************************************************************/ -EXTERN int unload_module(FAR const struct binary_s *bin); +int unload_module(FAR const struct binary_s *bin); /**************************************************************************** * Name: exec_module @@ -192,7 +197,7 @@ EXTERN int unload_module(FAR const struct binary_s *bin); * ****************************************************************************/ -EXTERN int exec_module(FAR const struct binary_s *bin, int priority); +int exec_module(FAR const struct binary_s *bin, int priority); /**************************************************************************** * Name: exec @@ -214,8 +219,91 @@ EXTERN int exec_module(FAR const struct binary_s *bin, int priority); * ****************************************************************************/ -EXTERN int exec(FAR const char *filename, FAR const char **argv, - FAR const struct symtab_s *exports, int nexports); +int exec(FAR const char *filename, FAR const char **argv, + FAR const struct symtab_s *exports, int nexports); + +/**************************************************************************** + * Name: exepath_init + * + * Description: + * Initialize for the traversal of each value in the PATH variable. The + * usage is sequence is as follows: + * + * 1) Call exepath_init() to initialze for the traversal. exepath_init() + * will return an opaque handle that can then be provided to + * exepath_next() and exepath_release(). + * 2) Call exepath_next() repeatedly to examine every file that lies + * in the directories of the PATH variable + * 3) Call exepath_release() to free resources set aside by exepath_init(). + * + * Input Parameters: + * None + * + * Returned Value: + * On success, exepath_init() return a non-NULL, opaque handle that may + * subsequently be used in calls to exepath_next() and exepath_release(). + * On error, a NULL handle value will be returned. The most likely cause + * of an error would be that the there is no value associated with the + * PATH variable. + * + ****************************************************************************/ + +#if !defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_BINFMT_EXEPATH) +EXEPATH_HANDLE exepath_init(void); +#endif + + /**************************************************************************** + * Name: exepath_next + * + * Description: + * Traverse all possible values in the PATH variable in attempt to find + * the full path to an executable file when only a relative path is + * provided. + * + * Input Parameters: + * handle - The handle value returned by exepath_init + * relpath - The relative path to the file to be found. + * + * Returned Value: + * On success, a non-NULL pointer to a null-terminated string is provided. + * This is the full path to a file that exists in the file system. This + * function will verify that the file exists (but will not verify that it + * is marked executable). + * + * NOTE: The string pointer return in the success case points to allocated + * memory. This memory must be freed by the called by calling kfree(). + * + * NULL is returned if no path is found to any file with the provided + * 'relpath' from any absolute path in the file variable. In this case, + * there is no point in calling exepath_next() further; exepath_release() + * must be called to release resources set aside by expath_init(). + * + ****************************************************************************/ + +#if !defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_BINFMT_EXEPATH) +FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath); +#endif + +/**************************************************************************** + * Name: exepath_release + * + * Description: + * Release all resources set aside by exepath_release when the handle value + * was created. The handle value is invalid on return from this function. + * Attempts to all exepath_next() or exepath_release() with such a 'stale' + * handle will result in undefined (i.e., not good) behavior. + * + * Input Parameters: + * handle - The handle value returned by exepath_init + * + * Returned Value: + * None + * + ****************************************************************************/ + +#if !defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_BINFMT_EXEPATH) +void exepath_release(EXEPATH_HANDLE handle); +#endif #undef EXTERN #if defined(__cplusplus) diff --git a/nuttx/sched/env_clearenv.c b/nuttx/sched/env_clearenv.c index 7fe97a911..75890f3bc 100644 --- a/nuttx/sched/env_clearenv.c +++ b/nuttx/sched/env_clearenv.c @@ -79,5 +79,3 @@ int clearenv(void) #endif /* CONFIG_DISABLE_ENVIRON */ - - diff --git a/nuttx/sched/env_release.c b/nuttx/sched/env_release.c index 83e65dbb5..8bc8d2205 100644 --- a/nuttx/sched/env_release.c +++ b/nuttx/sched/env_release.c @@ -94,11 +94,11 @@ int env_release(FAR _TCB *ptcb) { /* Check the reference count on the environment structure */ - if ( envp->ev_crefs <= 1) + if (envp->ev_crefs <= 1) { /* Decrementing the reference count will destroy the environment */ - sched_free( envp ); /* plain free() should be fine here */ + sched_free(envp); } else { diff --git a/nuttx/sched/os_bringup.c b/nuttx/sched/os_bringup.c index ec6152891..e0a236bbe 100644 --- a/nuttx/sched/os_bringup.c +++ b/nuttx/sched/os_bringup.c @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -129,6 +130,17 @@ int os_bringup(void) #endif int init_taskid; + /* Setup up the initial environment for the idle task. At present, this + * may consist of only the initial PATH variable. The PATH variable is + * (probably) not used by the IDLE task. However, the environment + * containing the PATH variable will be inherited by all of the threads + * created by the IDLE task. + */ + +#if !defined(CONFIG_DISABLE_ENVIRON) && defined(CONFIG_PATH_INITIAL) + (void)setenv("PATH", CONFIG_PATH_INITIAL, 1); +#endif + /* Start the page fill worker kernel thread that will resolve page faults. * This should always be the first thread started because it may have to * resolve page faults in other threads @@ -190,5 +202,12 @@ int os_bringup(void) (main_t)CONFIG_USER_ENTRYPOINT, (const char **)NULL); #endif ASSERT(init_taskid != ERROR); + + /* We an save a few bytes by discarding the IDLE thread's environment. */ + +#if !defined(CONFIG_DISABLE_ENVIRON) && defined(CONFIG_PATH_INITIAL) + (void)clearenv(); +#endif + return OK; } diff --git a/nuttx/sched/os_start.c b/nuttx/sched/os_start.c index c0b16236d..a53ac2aa8 100644 --- a/nuttx/sched/os_start.c +++ b/nuttx/sched/os_start.c @@ -426,7 +426,9 @@ void os_start(void) lib_initialize(); } - /* Create stdout, stderr, stdin */ + /* Create stdout, stderr, stdin on the IDLE task. These will be + * inherited by all of the threads created by the IDLE task. + */ (void)sched_setupidlefiles(&g_idletcb); -- cgit v1.2.3 From fe4bf6f555a1a453c16a7c671cef3625902d2991 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 17 Dec 2012 14:43:31 +0000 Subject: Integrate PATH traversal logic and binary format logic git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5441 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 4 +- nuttx/Documentation/NuttXBinfmt.html | 139 +++++++++++++++++++++++++++-- nuttx/Documentation/NuttxPortingGuide.html | 8 +- nuttx/binfmt/binfmt_dumpmodule.c | 2 +- nuttx/binfmt/binfmt_exepath.c | 6 +- nuttx/binfmt/binfmt_loadmodule.c | 125 +++++++++++++++++++++----- nuttx/include/nuttx/binfmt/binfmt.h | 19 ++-- 7 files changed, 260 insertions(+), 43 deletions(-) (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index c61b28f69..c932a1f2d 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3790,5 +3790,5 @@ the absolutes paths found in the current PATH environment variable setting. This is untested and not yet hooked into the binfmt exec() logic on initial check-in - - + * binfmt/binfmt_loadmodule.c: load_module() will now traverse the PATH + variable to locate files from their relative path. diff --git a/nuttx/Documentation/NuttXBinfmt.html b/nuttx/Documentation/NuttXBinfmt.html index 71c5b0a00..830a05caa 100644 --- a/nuttx/Documentation/NuttXBinfmt.html +++ b/nuttx/Documentation/NuttXBinfmt.html @@ -8,7 +8,7 @@

            NuttX Binary Loader

            -

            Last Updated: October 30, 2012

            +

            Last Updated: December 17, 2012

            @@ -141,7 +141,7 @@ struct binary_s { /* Information provided to the loader to load and bind a module */ - FAR const char *filename; /* Full path to the binary to be loaded */ + FAR const char *filename; /* Full path to the binary to be loaded1 */ FAR const char **argv; /* Argument list */ FAR const struct symtab_s *exports; /* Table of exported symbols */ int nexports; /* The number of symbols in exports[] */ @@ -164,6 +164,14 @@ struct binary_s };
          +

            + 1The filename must be the full, absolute path to the file to be executed unless CONFIG_BINFMT_EXEPATH is defined. + In that case, filename may be a relative path; + a set of candidate absolute paths will be generated using the PATH environment variable and load_module() will attempt to load each file that is found at those absolute paths. +

          + +

          +

          Where the types binfmt_ctor_t and binfmt_dtor_t define the type of one C++ constructor or destructor:

          @@ -175,15 +183,31 @@ typedef FAR void (*binfmt_dtor_t)(void);

          2.3 Binary Loader Function Interfaces

          +

          + Binary format management: +

          +

          + Basic module management: +

          + +

          + PATH traversal logic: +

          +

          2.3.1 register_binfmt()

          @@ -224,7 +248,15 @@ int load_module(FAR struct binary_s *bin);

        Description:

          -Load a module into memory, bind it to an exported symbol take, and prep the module for execution. +

          + Load a module into memory, bind it to an exported symbol take, and prep the module for execution. +

          +

          + load_module() will use the filename field in the struct binary_s in order to locate the module to be loaded from the file system. + The filename must be the full, absolute path to the file to be executed unless CONFIG_BINFMT_EXEPATH is defined. + In that case, filename may be a relative path; + a set of candidate absolute paths will be generated using the PATH environment variable and load_module() will attempt to load each file that is found at those absolute paths. +

        Returned Value:

          @@ -281,21 +313,110 @@ int exec(FAR const char *filename, FAR const char **argv,

        Description:

          -This is a convenience function that wraps load_ and exec_module() into one call. + This is a convenience function that wraps load_ and exec_module() into one call.

        Input Parameters:

          -
        • filename: Fulll path to the binary to be loaded.
        • +
        • filename: Full path to the binary to be loaded.
        • argv: Argument list.
        • exports: Table of exported symbols.
        • exports: The number of symbols in exports.

        Returned Value:

          -This is an end-user function, so it follows the normal convention: -Returns 0 (OK) on success. -On failure, it returns -1 (ERROR) with errno set appropriately. + This is an end-user function, so it follows the normal convention: + Returns 0 (OK) on success. + On failure, it returns -1 (ERROR) with errno set appropriately. +
        + +

        2.3.8 exepath_init()

        +

        Function Prototype:

        +
          +#include <:nuttx/binfmt/binfmt.h>
          +#ifdef CONFIG_BINFMT_EXEPATH
          +EXEPATH_HANDLE exepath_init(void);
          +#endif
          +
        +

        Description:

        +
          +

          + Initialize for the traversal of each value in the PATH variable. + The usage is sequence is as follows: +

          +
            +
          1. + Call exepath_init() to initialize for the traversal. + exepath_init() will return an opaque handle that can then be provided to exepath_next() and exepath_release(). +
          2. +
          3. + Call exepath_next() repeatedly to examine every file that lies in the directories of the PATH variable. +
          4. +
          5. + Call exepath_release() to free resources set aside by exepath_init(). +
          6. +
          +
        +

        Input Parameters: None

        +

        Returned Value:

        +
          + On success, exepath_init() return a non-NULL, opaque handle that may subsequently be used in calls to exepath_next() and exepath_release(). + On error, a NULL handle value will be returned. + The most likely cause of an error would be that the there is no value associated with the PATH variable. +
        + +

        2.3.9 exepath_next()

        +

        Function Prototype:

        +
          +#include <:nuttx/binfmt/binfmt.h>
          +#ifdef CONFIG_BINFMT_EXEPATH
          +FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath);
          +#endif
          +
        +

        Description:

        +
          + Traverse all possible values in the PATH variable in attempt to find the full path to an executable file when only a relative path is provided. +
        +

        Input Parameters:

        +
          +
        • handle: The handle value returned by exepath_init().
        • +
        • relpath: The relative path to the file to be found.
        • +
        +

        Returned Value:

        +
          +

          + On success, a non-NULL pointer to a null-terminated string is provided. + This is the full path to a file that exists in the file system. + This function will verify that the file exists (but will not verify that it is marked executable). +

          +

          + NOTE: The string pointer return in the success case points to allocated memory. + This memory must be freed by the called by calling kfree(). +

          +

          + NULLrelpath from any absolute path in the PATH variable. + In this case, there is no point in calling exepath_next() further; exepath_release() must be called to release resources set aside by expath_init(). +

          +
        + +

        2.3.10- exepath_release()

        +

        Function Prototype:

        +
          +#include <:nuttx/binfmt/binfmt.h>
          +#ifdef CONFIG_BINFMT_EXEPATH
          +void exepath_release(EXEPATH_HANDLE handle);
          +#endif
          +
        +

        Description:

        +
          + Release all resources set aside by exepath_init when the handle value was created. + The handle value is invalid on return from this function. + Attempts to all exepath_next() or exepath_release() with such a stale handle will result in undefined (i.e., not good) behavior. +
        +

        Input Parameters:

        +
          +
        • handle: The handle value returned by exepath_init().
        +

        Returned Value: None

        diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html index 0ed46cba1..5361a2866 100644 --- a/nuttx/Documentation/NuttxPortingGuide.html +++ b/nuttx/Documentation/NuttxPortingGuide.html @@ -12,7 +12,7 @@

        NuttX RTOS Porting Guide

        -

        Last Updated: December 11, 2012

        +

        Last Updated: December 17, 2012

        @@ -4163,6 +4163,12 @@ build CONFIG_BINFMT_DISABLE: By default, support for loadable binary formats is built. This logic may be suppressed be defining this setting. +
      • + CONFIG_BINFMT_EXEPATH: Use the contents of the PATH environment variable to locate executable files. Default: n +
      • +
      • + CONFIG_PATH_INITIAL: The initial value of the PATH variable. This is the colon-separated list of absolute paths. E.g., "/bin:/usr/bin:/sbin" +
      • CONFIG_BINFMT_CONSTRUCTORS: Build in support for C++ constructors in loaded modules.
      • diff --git a/nuttx/binfmt/binfmt_dumpmodule.c b/nuttx/binfmt/binfmt_dumpmodule.c index 40cbe4b21..cd52136b0 100644 --- a/nuttx/binfmt/binfmt_dumpmodule.c +++ b/nuttx/binfmt/binfmt_dumpmodule.c @@ -70,7 +70,7 @@ ***********************************************************************/ /*********************************************************************** - * Name: load_module + * Name: dump_module * * Description: * Load a module into memory and prep it for execution. diff --git a/nuttx/binfmt/binfmt_exepath.c b/nuttx/binfmt/binfmt_exepath.c index c81588975..24903e26d 100644 --- a/nuttx/binfmt/binfmt_exepath.c +++ b/nuttx/binfmt/binfmt_exepath.c @@ -85,7 +85,7 @@ struct exepath_s * Initialize for the traversal of each value in the PATH variable. The * usage is sequence is as follows: * - * 1) Call exepath_init() to initialze for the traversal. exepath_init() + * 1) Call exepath_init() to initialize for the traversal. exepath_init() * will return an opaque handle that can then be provided to * exepath_next() and exepath_release(). * 2) Call exepath_next() repeatedly to examine every file that lies @@ -163,7 +163,7 @@ EXEPATH_HANDLE exepath_init(void) * memory. This memory must be freed by the called by calling kfree(). * * NULL is returned if no path is found to any file with the provided - * 'relpath' from any absolute path in the file variable. In this case, + * 'relpath' from any absolute path in the PATH variable. In this case, * there is no point in calling exepath_next() further; exepath_release() * must be called to release resources set aside by expath_init(). * @@ -263,7 +263,7 @@ FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath) * Name: exepath_release * * Description: - * Release all resources set aside by exepath_release when the handle value + * Release all resources set aside by exepath_init() when the handle value * was created. The handle value is invalid on return from this function. * Attempts to all exepath_next() or exepath_release() with such a 'stale' * handle will result in undefined (i.e., not good) behavior. diff --git a/nuttx/binfmt/binfmt_loadmodule.c b/nuttx/binfmt/binfmt_loadmodule.c index e87075aa9..8a691edc7 100644 --- a/nuttx/binfmt/binfmt_loadmodule.c +++ b/nuttx/binfmt/binfmt_loadmodule.c @@ -43,6 +43,7 @@ #include #include +#include #include #include "binfmt_internal.h" @@ -65,6 +66,57 @@ * Private Functions ****************************************************************************/ +/**************************************************************************** + * Name: load_absmodule + * + * Description: + * Load a module into memory, bind it to an exported symbol take, and + * prep the module for execution. bin->filename is known to be an absolute + * path to the file to be loaded. + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * failure. + * + ****************************************************************************/ + +static int load_absmodule(FAR struct binary_s *bin) +{ + FAR struct binfmt_s *binfmt; + int ret = -ENOENT; + + bdbg("Loading %s\n", bin->filename); + + /* Disabling pre-emption should be sufficient protection while accessing + * the list of registered binary format handlers. + */ + + sched_lock(); + + /* Traverse the list of registered binary format handlers. Stop + * when either (1) a handler recognized and loads the format, or + * (2) no handler recognizes the format. + */ + + for (binfmt = g_binfmts; binfmt; binfmt = binfmt->next) + { + /* Use this handler to try to load the format */ + + ret = binfmt->load(bin); + if (ret == OK) + { + /* Successfully loaded -- break out with ret == 0 */ + + bvdbg("Successfully loaded module %s\n", bin->filename); + dump_module(bin); + break; + } + } + + sched_unlock(); + return ret; +} + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -85,42 +137,72 @@ int load_module(FAR struct binary_s *bin) { - FAR struct binfmt_s *binfmt; - int ret = -ENOENT; + int ret = -EINVAL; + + /* Verify that we were provided something to work with */ #ifdef CONFIG_DEBUG if (bin && bin->filename) #endif { - bdbg("Loading %s\n", bin->filename); - - /* Disabling pre-emption should be sufficient protection while - * accessing the list of registered binary format handlers. + /* Were we given a relative path? Or an absolute path to the file to + * be loaded. */ - sched_lock(); +#ifdef CONFIG_BINFMT_EXEPATH + if (bin->filename[0] == '/') + { + FAR const char *relpath; + FAR char *fullpath; + EXEPATH_HANDLE handle; - /* Traverse the list of registered binary format handlers. Stop - * when either (1) a handler recognized and loads the format, or - * (2) no handler recognizes the format. - */ + /* Set aside the relative path */ - for (binfmt = g_binfmts; binfmt; binfmt = binfmt->next) - { - /* Use this handler to try to load the format */ + relpath = bin->filename; + ret = -ENOENT; + + /* Initialize to traverse the PATH variable */ - ret = binfmt->load(bin); - if (ret == OK) + handle = exepath_init(); + if (handle) { - /* Successfully loaded -- break out with ret == 0 */ + /* Get the next absolute file path */ - bvdbg("Successfully loaded module %s\n", bin->filename); - dump_module(bin); - break; + while ((fullpath = exepath_next(handle, relpath))) + { + /* Try to load the file at this path */ + + bin->filename = fullpath; + ret = load_absmodule(bin); + + /* Free the allocated fullpath */ + + kfree(fullpath); + + /* Break out of the loop with ret == OK on success */ + + if (ret == OK) + { + break; + } + } } + + /* Restore the relative path. This is not needed for anything + * but debug output after the file has been loaded. + */ + + bin->filename = relpath; } + else +#endif + { + /* We already have the one and only absolute path to the file to + * be loaded. + */ - sched_unlock(); + ret = load_absmodule(bin); + } } /* This is an end-user function. Return failures via errno */ @@ -131,6 +213,7 @@ int load_module(FAR struct binary_s *bin) errno = -ret; return ERROR; } + return OK; } diff --git a/nuttx/include/nuttx/binfmt/binfmt.h b/nuttx/include/nuttx/binfmt/binfmt.h index 80c0e7c7b..200823bb8 100644 --- a/nuttx/include/nuttx/binfmt/binfmt.h +++ b/nuttx/include/nuttx/binfmt/binfmt.h @@ -67,14 +67,21 @@ typedef FAR void *EXEPATH_HANDLE; typedef FAR void (*binfmt_ctor_t)(void); typedef FAR void (*binfmt_dtor_t)(void); -/* This describes the file to be loaded */ +/* This describes the file to be loaded. + * + * NOTE: The 'filename' must be the full, absolute path to the file to be + * executed unless CONFIG_BINFMT_EXEPATH is defined. In that case, + * 'filename' may be a relative path; a set of candidate absolute paths + * will be generated using the PATH environment variable and load_module() + * will attempt to load each file that is found at those absolute paths. + */ struct symtab_s; struct binary_s { /* Information provided to the loader to load and bind a module */ - FAR const char *filename; /* Full path to the binary to be loaded */ + FAR const char *filename; /* Full path to the binary to be loaded (See NOTE above) */ FAR const char **argv; /* Argument list */ FAR const struct symtab_s *exports; /* Table of exported symbols */ int nexports; /* The number of symbols in exports[] */ @@ -229,7 +236,7 @@ int exec(FAR const char *filename, FAR const char **argv, * Initialize for the traversal of each value in the PATH variable. The * usage is sequence is as follows: * - * 1) Call exepath_init() to initialze for the traversal. exepath_init() + * 1) Call exepath_init() to initialize for the traversal. exepath_init() * will return an opaque handle that can then be provided to * exepath_next() and exepath_release(). * 2) Call exepath_next() repeatedly to examine every file that lies @@ -252,7 +259,7 @@ int exec(FAR const char *filename, FAR const char **argv, EXEPATH_HANDLE exepath_init(void); #endif - /**************************************************************************** +/**************************************************************************** * Name: exepath_next * * Description: @@ -274,7 +281,7 @@ EXEPATH_HANDLE exepath_init(void); * memory. This memory must be freed by the called by calling kfree(). * * NULL is returned if no path is found to any file with the provided - * 'relpath' from any absolute path in the file variable. In this case, + * 'relpath' from any absolute path in the PATH variable. In this case, * there is no point in calling exepath_next() further; exepath_release() * must be called to release resources set aside by expath_init(). * @@ -288,7 +295,7 @@ FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath); * Name: exepath_release * * Description: - * Release all resources set aside by exepath_release when the handle value + * Release all resources set aside by exepath_init() when the handle value * was created. The handle value is invalid on return from this function. * Attempts to all exepath_next() or exepath_release() with such a 'stale' * handle will result in undefined (i.e., not good) behavior. -- cgit v1.2.3 From 8ae8d43ae254c55a8eaa9c48d38ca8dfa63987be Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 18 Dec 2012 16:15:27 +0000 Subject: Restructre address environment interfaces in preparation for incorporation into binfmt/ logic git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5442 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/Documentation/NuttXBinfmt.html | 14 +- nuttx/Documentation/NuttxPortingGuide.html | 259 +++++++++++++++++++++++++++-- nuttx/arch/z80/include/z180/arch.h | 23 +++ nuttx/arch/z80/src/z180/z180_mmu.c | 253 ++++++++++++++++++++-------- nuttx/include/nuttx/arch.h | 144 +++++++++++++--- nuttx/include/nuttx/binfmt/binfmt.h | 4 +- 6 files changed, 584 insertions(+), 113 deletions(-) (limited to 'nuttx') diff --git a/nuttx/Documentation/NuttXBinfmt.html b/nuttx/Documentation/NuttXBinfmt.html index 830a05caa..9c9fd3a51 100644 --- a/nuttx/Documentation/NuttXBinfmt.html +++ b/nuttx/Documentation/NuttXBinfmt.html @@ -164,13 +164,13 @@ struct binary_s };
      -

        - 1The filename must be the full, absolute path to the file to be executed unless CONFIG_BINFMT_EXEPATH is defined. - In that case, filename may be a relative path; - a set of candidate absolute paths will be generated using the PATH environment variable and load_module() will attempt to load each file that is found at those absolute paths. -

      - -

      +
        +

        + 1The filename must be the full, absolute path to the file to be executed unless CONFIG_BINFMT_EXEPATH is defined. + In that case, filename may be a relative path; + a set of candidate absolute paths will be generated using the PATH environment variable and load_module() will attempt to load each file that is found at those absolute paths. +

        +

      Where the types binfmt_ctor_t and binfmt_dtor_t define the type of one C++ constructor or destructor: diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html index 5361a2866..526892d3e 100644 --- a/nuttx/Documentation/NuttxPortingGuide.html +++ b/nuttx/Documentation/NuttxPortingGuide.html @@ -12,7 +12,7 @@

      NuttX RTOS Porting Guide

      -

      Last Updated: December 17, 2012

      +

      Last Updated: December 18, 2012

      @@ -92,7 +92,8 @@ 4.1.17 up_enable_irq()
      4.1.18 up_prioritize_irq()
      4.1.19 up_putc()
      - 4.1.20 System Time and Clock + 4.1.20 System Time and Clock
      + 4.1.21 Address Environments
    4.2 APIs Exported by NuttX to Architecture-Specific Logic
      @@ -1622,7 +1623,7 @@ The system can be re-made subsequently by just typing make. is defined.

      -

      Inputs:

      +

      Input Parameters:

      • tcb: The TCB of new task. @@ -1658,7 +1659,7 @@ The system can be re-made subsequently by just typing make. is defined.

        -

        Inputs:

        +

        Input Parameters:

        • tcb: The TCB of new task. @@ -1694,7 +1695,7 @@ The system can be re-made subsequently by just typing make. function is called.

          -

          Inputs: +

          Input Parameters:

          • tcb: Refers to the tcb to be unblocked. This tcb is in one of the waiting tasks lists. It must be moved to @@ -1715,7 +1716,7 @@ The system can be re-made subsequently by just typing make. logic. Interrupts will always be disabled when this function is called. -

            Inputs:

            +

            Input Parameters:

            • tcb: Refers to a task in the ready-to-run list (normally the task at the head of the list). It most be @@ -1771,7 +1772,7 @@ The system can be re-made subsequently by just typing make. function is called.

              -

              Inputs:

              +

              Input Parameters:

              • tcb: The TCB of the task that has been reprioritized @@ -2110,6 +2111,236 @@ else To retrieve that variable use:

                +

                4.1.21 Address Environments

                + +

                + CPUs that support memory management units (MMUs) may provide address environments within which tasks and their child threads execute. + The configuration indicates the CPUs ability to support address environments by setting the configuration varabile CONFIG_ADDRENV=y. + These address environments are created only when tasks are created via exec() or exec_module() (see include/nuttx/binfmt/binfmt.h). +

                +

                + When CONFIG_ADDRENV=y is set in the board configuration, the CPU-specific logic must provide a set of interfaces as defined in the header file include/nuttx/arch.h. + These interfaces are listed below and described in detail in the following paragraphs. +

                +

                + The CPU-specific logic must provide two categories in interfaces: +

                +
                  +
                1. +

                  + Binary Loader Support. + These are low-level interfaces used in binfmt/ to instantiate tasks with address environments. + These interfaces all operate on type task_addrenv_t which is an abstract representation of a asks's address environment and must be defined in arch/arch.h if CONFIG_ADDRENVM is defined. + These low-level interfaces include: +

                  + +
                2. +
                3. +

                  + Tasking Support. + Other interfaces must be provided to support higher-level interfaces used by the NuttX tasking logic. + These interfaces are* used by the functions in sched/ and all operate on the TCB which as been assigned an address environment by up_addrenv_assign(). +

                  +
                    +
                  • + 4.1.21.7 up_addrenv_share(): + Clone the address environment assigned to one TCB to another. + This operation is done when a pthread is created that share's the same address environment. +
                  • +
                  • + 4.1.21.8 up_addrenv_release(): + ARelease the TCBs reference to an address environment when a task/thread exits. +
                  • +
                  +
                4. +
                + + +

                4.1.21.1 up_addrenv_create()

                +

                Prototype:

                +
                  + int up_addrenv_create(size_t envsize, FAR task_addrenv_t *addrenv); +
                +

                Description:

                +
                  + This function is called from the binary loader logic when a new task is created in order to instantiate an address environment for the task. + up_addrenv_create() is essentially the allocator of the physical memory for the new task. +
                +

                Input Parameters:

                +
                  +
                • envsize: The size (in bytes) of the address environment needed by the task.
                • +
                • addrenv: The location to return the representation of the task address environment.
                • +
                +

                Returned Value:

                +
                  + Zero (OK) on success; a negated errno value on failure. +
                + +

                4.1.21.2 up_addrenv_vaddr()

                +

                Prototype:

                +

                  + int up_addrenv_vaddr(FAR task_addrenv_t addrenv, FAR void **vaddr); +
                +

                Description:

                +
                  + Return the virtual address associated with the newly create address environment. + This function is used by the binary loaders in order get an address that can be used to initialize the new task. +
                +

                Input Parameters:

                +
                  +
                • addrenv: The representation of the task address environment previously returned by up_addrenv_create.
                • +
                • vaddr: The location to return the virtual address.
                • +
                +

                Returned Value:

                +
                  + Zero (OK) on success; a negated errno value on failure. +
                + +

                4.1.21.3 up_addrenv_select()

                +

                Prototype:

                +

                  + int up_addrenv_select(task_addrenv_t addrenv, hw_addrenv_t *oldenv); +
                +

                Description:

                +
                  + After an address environment has been established for a task (via up_addrenv_create()), this function may be called to to instantiate that address environment in the virtual address space. + This might be necessary, for example, to load the code for the task from a file or to access address environment private data. +
                +

                Input Parameters:

                +
                  +
                • addrenv: The representation of the task address environment previously returned by up_addrenv_create.
                • +
                • oldenv: + The address environment that was in place before up_addrenv_select() was called. + This may be used with up_addrenv_restore() to restore the original address environment that was in place before up_addrenv_select() was called. + Note that this may be a task agnostic, hardware representation that is different from task_addrenv_t. +
                • +
                +

                Returned Value:

                +
                  + Zero (OK) on success; a negated errno value on failure. +
                + +

                4.1.21.4 up_addrenv_restore()

                +

                Prototype:

                +

                  + int up_addrenv_restore(hw_addrenv_t oldenv); +
                +

                Description:

                +
                  + After an address environment has been temporarilty instantiated by up_addrenv_select, + this function may be called to to restore the original address environment. +
                +

                Input Parameters:

                +
                  +
                • oldenv: The hardware representation of the address environment previously returned by up_addrenv_select().
                • +
                +

                Returned Value:

                +
                  + Zero (OK) on success; a negated errno value on failure. +
                + +

                4.1.21.5 up_addrenv_destroy()

                +

                Prototype:

                +

                  + int up_addrenv_destroy(task_addrenv_t addrenv); +
                +

                Description:

                +
                  + Called from the binary loader loader during error handling to destroy the address environment previously created by up_addrenv_create(). +
                +

                Input Parameters:

                +
                  +
                • addrenv: The representation of the task address environment previously returned by up_addrenv_create.
                • +
                +

                Returned Value:

                +
                  + Zero (OK) on success; a negated errno value on failure. +
                + +

                4.1.21.6 up_addrenv_assign()

                +

                Prototype:

                +

                  + int up_addrenv_assign(task_addrenv_t addrenv, FAR _TCB *tcb); +
                +

                Description:

                +
                  + Assign an address environment to a TCB. +
                +

                Input Parameters:

                +
                  +
                • addrenv: The representation of the task address environment previously returned by up_addrenv_create.
                • +
                • tcb: The TCB of the task to receive the address environment.
                • +
                +

                Returned Value:

                +
                  + Zero (OK) on success; a negated errno value on failure. +
                + +

                4.1.21.7 up_addrenv_share()

                +

                Prototype:

                +

                  + int up_addrenv_share(FAR const _TCB *ptcb, FAR _TCB *ctcb); +
                +

                Description:

                +
                  + This function is called from the core scheduler logic when a thread is created that needs to share the address ennvironment of its parent task. + In this case, the parent's address environment needs to be "cloned" for the child thread. +
                +

                Input Parameters:

                +
                  +
                • ptcb: The TCB of the parent task that has the address environment.
                • +
                • ctcb: The TCB of the child thread needing the address environment.
                • +
                +

                Returned Value:

                +
                  + Zero (OK) on success; a negated errno value on failure. +
                + +

                4.1.21.8 up_addrenv_release()

                +

                Prototype:

                +

                  + int up_addrenv_release(FAR _TCB *tcb); +
                +

                Description:

                +
                  + This function is called when a task or thread exits in order to release its reference to an address environment. + When there are no furtherreferences to an address environment, that address environment should + be destroyed. +
                +

                Input Parameters:

                +
                  +
                • tcb: The TCB of the task or thread whose the address environment will be released.
                • +
                +

                Returned Value:

                +
                  + Zero (OK) on success; a negated errno value on failure. +
                +

                4.2 APIs Exported by NuttX to Architecture-Specific Logic

                These are standard interfaces that are exported by the OS @@ -3470,7 +3701,7 @@ extern void up_ledoff(int led); All PM interfaces are declared in the file include/nuttx/power/pm.h.

                -

                6.4.2.1 pm_initialize()

                +

                6.4.2.1 pm_initialize()

                Function Prototype:

                   #include <nuttx/power/pm.h>
                  @@ -3487,7 +3718,7 @@ None
                   None
                   

                  -

                  6.4.2.2 pm_register()

                  +

                  6.4.2.2 pm_register()

                  Function Prototype:

                     #include <nuttx/power/pm.h>
                    @@ -3507,7 +3738,7 @@ int pm_register(FAR struct pm_callback_s *callbacks);
                     Zero (OK) on success; otherwise a negater errno value is returned.
                     

                    -

                    6.4.2.3 pm_activity()

                    +

                    6.4.2.3 pm_activity()

                    Function Prototype:

                       #include <nuttx/power/pm.h>
                      @@ -3534,7 +3765,7 @@ void pm_activity(int priority);
                         This function may be called from an interrupt handler (this is the ONLY PM function that may be called from an interrupt handler!).
                       

                      -

                      6.4.2.4 pm_checkstate()

                      +

                      6.4.2.4 pm_checkstate()

                      Function Prototype:

                         #include <nuttx/power/pm.h>
                        @@ -3561,7 +3792,7 @@ enum pm_state_e pm_checkstate(void);
                           The recommended power management state.
                         

                        -

                        6.4.2.5 pm_changestate()

                        +

                        6.4.2.5 pm_changestate()

                        Function Prototype:

                           #include <nuttx/power/pm.h>
                          @@ -3596,7 +3827,7 @@ enum pm_state_e pm_checkstate(void);
                             These callback functions can be used to provide power management information to the driver.
                           

                          -

                          6.4.3.1 prepare()

                          +

                          6.4.3.1 prepare()

                          Function Prototype:

                             int (*prepare)(FAR struct pm_callback_s *cb, enum pm_state_e pmstate);
                            @@ -3624,7 +3855,7 @@ int (*prepare)(FAR struct pm_callback_s *cb, enum pm_state_e pmstate);
                                consumption modes!
                             

                            -

                            6.4.3.1 notify()

                            +

                            6.4.3.1 notify()

                            Function Prototype:

                               #include <nuttx/power/pm.h>
                              diff --git a/nuttx/arch/z80/include/z180/arch.h b/nuttx/arch/z80/include/z180/arch.h
                              index 9e2197522..d7cf82a26 100644
                              --- a/nuttx/arch/z80/include/z180/arch.h
                              +++ b/nuttx/arch/z80/include/z180/arch.h
                              @@ -45,6 +45,12 @@
                                * Included Files
                                ****************************************************************************/
                               
                              +#include 
                              +
                              +#include 
                              +
                              +#include 
                              +
                               /****************************************************************************
                                * Pre-processor Definitions
                                ****************************************************************************/
                              @@ -52,6 +58,23 @@
                               /****************************************************************************
                                * Public Types
                                ****************************************************************************/
                              +/* The z180 address environment is represented in hardware as the 8-bit
                              + * Common Base Register (CBR).  CBR specifies the base address (on 4KB
                              + * boundaries) used to generate a 20-bit physical address for Common Area 1
                              + * accesses.  CBR is the upper 8-bits of the 20-bit address; the lower 14-bits
                              + * of the base address are implicitly zero (hence the 4KB boundary alignment).
                              + */
                              +
                              +#ifdef CONFIG_ADDRENV
                              +typedef uint8_t hw_addrenv_t;
                              +
                              +/* At the task-level, the z180 address environment is represented as struct
                              + * z180_cbr_s which is defined in irq.h.
                              + */
                              +
                              +struct z180_cbr_s;
                              +typedef FAR struct z180_cbr_s *task_addrenv_t;
                              +#endif
                               
                               /****************************************************************************
                                * Public Variables
                              diff --git a/nuttx/arch/z80/src/z180/z180_mmu.c b/nuttx/arch/z80/src/z180/z180_mmu.c
                              index e24b22b8e..5f9b26be2 100644
                              --- a/nuttx/arch/z80/src/z180/z180_mmu.c
                              +++ b/nuttx/arch/z80/src/z180/z180_mmu.c
                              @@ -79,7 +79,7 @@ static struct z180_cbr_s g_cbrs[CONFIG_MAX_TASKS];
                                ****************************************************************************/
                               
                               /****************************************************************************
                              - * Name: z180_mmu_findcbr
                              + * Name: z180_mmu_alloccbr
                                *
                                * Description:
                                *   Find an unused struture in g_cbrs (i.e., one with reference count == 0).
                              @@ -88,7 +88,7 @@ static struct z180_cbr_s g_cbrs[CONFIG_MAX_TASKS];
                                *
                                ****************************************************************************/
                               
                              -static FAR struct z180_cbr_s *z180_mmu_findcbr(void)
                              +static inline FAR struct z180_cbr_s *z180_mmu_alloccbr(void)
                               {
                                 int i;
                               
                              @@ -176,25 +176,54 @@ return g_physhandle ? OK : -ENOMEM;
                               #endif
                               }
                               
                              +/****************************************************************************
                              + * Address Environment Interfaces
                              + *
                              + * Low-level interfaces used in binfmt/ to instantiate tasks with address
                              + * environments.  These interfaces all operate on task_addrenv_t which is an
                              + * abstract representation of the address environment and must be provided
                              + * by arch/arch.h is CONFIG_ADDRENV is defined.
                              + *
                              + *   up_addrenv_create  - Create an address environment
                              + *   up_addrenv_vaddr   - Returns the virtual base address of the address
                              + *                        environment
                              + *   up_addrenv_select  - Instantiate an address environment
                              + *   up_addrenv_destroy - Destroy an address environment.
                              + *   up_addrenv_assign  - Assign an address environment to a TCB
                              + *
                              + * Higher-level interfaces used by the tasking logic.  These interfaces are
                              + * used by the functions in sched/ and all operate on the TCB which as been
                              + * assigned an address environment by up_addrenv_assign().
                              + *
                              + *   up_addrenv_share   - Clone the address environment assigned to one TCB
                              + *                        to another.  This operation is done when a pthread
                              + *                        is created that share's the same address
                              + *                        environment.
                              + *   up_addrenv_release - Release the TCBs reference to an address
                              + *                        environment when a task/thread exists.
                              + *
                              + ****************************************************************************/
                               /****************************************************************************
                                * Name: up_addrenv_create
                                *
                                * Description:
                                *   This function is called from the binary loader logic when a new
                              - *   task is created in RAM in order to instantiate an address environment for
                              - *   the task.
                              + *   task is created in order to instantiate an address environment for the
                              + *   task.  up_addrenv_create is essentially the allocator of the physical
                              + *   memory for the new task.
                                *
                                * Input Parameters:
                              - *   tcb - The TCB of the task needing the address environment.
                                *   envsize - The size (in bytes) of the address environment needed by the
                                *     task.
                              + *   addrenv - The location to return the representation of the task address
                              + *     environment.
                                *
                                * Returned Value:
                                *   Zero (OK) on success; a negated errno value on failure.
                                *
                                ****************************************************************************/
                               
                              -int up_addrenv_create(FAR _TCB *tcb, size_t envsize)
                              +int up_addrenv_create(size_t envsize, FAR task_addrenv_t *addrenv)
                               {
                                 FAR struct z180_cbr_s *cbr;
                                 irqstate_t flags;
                              @@ -202,10 +231,6 @@ int up_addrenv_create(FAR _TCB *tcb, size_t envsize)
                                 unsigned int npages;
                                 int ret;
                               
                              -  /* Make sure that there is no address environment in place on this TCB */
                              -
                              -  DEBUGASSERT(tcb->xcp.cbr == NULL);
                              -
                                 /* Convert the size from bytes to numbers of pages */
                               
                                 npages = PHYS_ALIGNUP(envsize);
                              @@ -225,7 +250,7 @@ int up_addrenv_create(FAR _TCB *tcb, size_t envsize)
                                  */
                               
                                 flags = irqsave();
                              -  cbr = z180_mmu_findcbr();
                              +  cbr = z180_mmu_alloccbr();
                                 if (!cbr)
                                   {
                                     sdbg("ERROR: No free CBR structures\n");
                              @@ -235,7 +260,6 @@ int up_addrenv_create(FAR _TCB *tcb, size_t envsize)
                               
                                 /* Now allocate the physical memory to back up the address environment */
                               
                              -
                               #ifdef CONFIG_GRAN_SINGLE
                                 alloc = (uintptr_t)gran_alloc(npages);
                               #else
                              @@ -254,9 +278,9 @@ int up_addrenv_create(FAR _TCB *tcb, size_t envsize)
                               
                                 DEBUGASSERT(alloc <= 0xff);
                               
                              -  cbr->cbr     = alloc;
                              -  cbr->pages   = npages;
                              -  tcb->xcp.cbr = cbr;
                              +  cbr->cbr     = (uint8_t)alloc;
                              +  cbr->pages   = (uint8_t)npages;
                              +  *addrenv     = (task_addrenv_t)cbr;
                               
                                 irqrestore(flags);
                                 return OK;
                              @@ -270,111 +294,204 @@ errout_with_irq:
                               }
                               
                               /****************************************************************************
                              - * Name: up_addrenv_share
                              + * Name: up_addrenv_vaddr
                                *
                                * Description:
                              - *   This function is called from the core scheduler logic when a thread
                              - *   is created that needs to share the address ennvironment of its parent
                              - *   task.  In this case, the parent's address environment needs to be
                              - *   "cloned" for the child.
                              + *   Return the virtual address associated with the newly create address
                              + *   environment.  This function is used by the binary loaders in order
                              + *   get an address that can be used to initialize the new task..
                                *
                                * Input Parameters:
                              - *   ptcb - The TCB of the parent task that has the address environment.
                              - *   ctcb - The TCB of the child thread needing the address environment.
                              + *   addrenv - The representation of the task address environment previously
                              + *      returned by up_addrenv_create.
                              + *   vaddr - The location to return the virtual address.
                                *
                                * Returned Value:
                                *   Zero (OK) on success; a negated errno value on failure.
                                *
                                ****************************************************************************/
                               
                              -int up_addrenv_share(FAR const _TCB *ptcb, FAR _TCB *ctcb)
                              +int up_addrenv_vaddr(FAR task_addrenv_t addrenv, FAR void **vaddr)
                              +{
                              +  return CONFIG_Z180_COMMON1AREA_VIRTBASE;
                              +}
                              +
                              +/****************************************************************************
                              + * Name: up_addrenv_select
                              + *
                              + * Description:
                              + *   After an address environment has been established for a task (via
                              + *   up_addrenv_create()), this function may be called to to instantiate
                              + *   that address environment in the virtual address space.  This might be
                              + *   necessary, for example, to load the code for the task from a file or
                              + *   to access address environment private data.
                              + *
                              + * Input Parameters:
                              + *   addrenv - The representation of the task address environment previously
                              + *     returned by up_addrenv_create.
                              + *   oldenv
                              + *     The address environment that was in place before up_addrenv_select().
                              + *     This may be used with up_addrenv_restore() to restore the original
                              + *     address environment that was in place before up_addrenv_select() was
                              + *     called.  Note that this may be a task agnostic, hardware
                              + *     representation that is different from task_addrenv_t.
                              + *
                              + * Returned Value:
                              + *   Zero (OK) on success; a negated errno value on failure.
                              + *
                              + ****************************************************************************/
                              +
                              +int up_addrenv_select(task_addrenv_t addrenv, hw_addrenv_t *oldenv)
                               {
                              +  FAR struct z180_cbr_s *cbr = (FAR struct z180_cbr_s *)addrenv;
                                 irqstate_t flags;
                               
                              -  /* Make sure that the child has no address environment.  It is okay if
                              -   * if the parent does not have one.
                              -   */
                              +  DEBUGASSERT(cbr && oldenv);
                               
                              -  DEBUGASSERT(ctcb->xcp.cbr == NULL);
                              +  /* Return the current CBR value from the CBR register */
                               
                                 flags = irqsave();
                              -  if (ptcb->xcp.cbr)
                              -    {
                              -      /* Clone the CBR by incrementing the reference counting and saving a
                              -       * copy in the child thread's TCB.
                              -       */
                              +  *oldenv = (hw_addrenv_t)inp(Z180_MMU_CBR);
                               
                              -      ptcb->xcp.cbr->crefs++;
                              -      ctcb->xcp.cbr = ptcb->xcp.cbr;
                              -    }
                              +  /* Write the new CBR value into CBR register */
                               
                              +  outp(Z180_MMU_CBR, cbr->cbr);
                                 irqrestore(flags);
                                 return OK;
                               }
                               
                               /****************************************************************************
                              - * Name: up_addrenv_instantiate
                              + * Name: up_addrenv_restore
                                *
                                * Description:
                              - *   After an address environment has been established for a task (via
                              - *   up_addrenv_create().  This function may be called to to instantiate
                              - *   that address environment in the virtual address space.  this might be
                              - *   necessary, for example, to load the code for the task from a file or
                              - *   to access address environment private data.
                              + *   After an address environment has been temporarilty instantiated by
                              + *   up_addrenv_select, this function may be called to to restore the
                              + *   original address environment.
                                *
                                * Input Parameters:
                              - *   tcb - The TCB of the task or thread whose the address environment will
                              - *     be instantiated.
                              + *   oldenv - The hardware representation of the address environment
                              + *     previously returned by up_addrenv_select.
                                *
                                * Returned Value:
                              - *   A handle that may be used with up_addrenv_restore() to restore the
                              - *   address environment before up_addrenv_instantiate() was called.
                              + *   Zero (OK) on success; a negated errno value on failure.
                                *
                                ****************************************************************************/
                               
                              -FAR void *up_addrenv_instantiate(FAR _TCB *tcb)
                              +int up_addrenv_restore(hw_addrenv_t oldenv)
                               {
                              -  uint8_t oldcbr;
                              -  irqstate_t flags;
                              +  outp(Z180_MMU_CBR, (uint8_t)oldenv);
                              +  return OK;
                              +}
                               
                              -  /* Get the current CBR value from the CBR register */
                              +/****************************************************************************
                              + * Name: up_addrenv_destroy
                              + *
                              + * Description:
                              + *   Called from the binary loader loader during error handling to destroy
                              + *   the address environment previously created by up_addrenv_create().
                              + *
                              + * Input Parameters:
                              + *   addrenv - The representation of the task address environment previously
                              + *     returned by up_addrenv_create.
                              + *
                              + * Returned Value:
                              + *   Zero (OK) on success; a negated errno value on failure.
                              + *
                              + ****************************************************************************/
                               
                              -  flags = irqsave();
                              -  oldcbr = inp(Z180_MMU_CBR);
                              +int up_addrenv_destroy(task_addrenv_t addrenv)
                              +{
                              +  FAR struct z180_cbr_s *cbr = (FAR struct z180_cbr_s *)addrenv;
                               
                              -  /* Check if the task has an address environment. */
                              +  DEBUGASSERT(cbr);
                               
                              -  if (tcb->xcp.cbr)
                              -    {
                              -      /* Yes.. Write the new CBR value into CBR register */
                              +  /* Free the physical address space backing up the mapping */
                               
                              -      outp(Z180_MMU_CBR, tcb->xcp.cbr->cbr);
                              -    }
                              +#ifdef CONFIG_GRAN_SINGLE
                              +  gran_free((FAR void *)cbr->cbr, cbr->pages);
                              +#else
                              +  gran_free(g_physhandle, (FAR void *)cbr->cbr, cbr->pages);
                              +#endif
                               
                              -  irqrestore(flags);
                              -  return (FAR void *)oldcbr;
                              +  /* And make the CBR structure available for re-use */
                              +
                              +  z180_mmu_freecbr(cbr);
                              +  return OK;
                               }
                               
                               /****************************************************************************
                              - * Name: up_addrenv_restore
                              + * Name: up_addrenv_assign
                                *
                                * Description:
                              - *   Restore an address environment using a handle previously returned by
                              - *   up_addrenv_instantiate().
                              + *   Assign an address environment to a TCB.
                                *
                                * Input Parameters:
                              - *   handle - A handle previously returned by up_addrenv_instantiate.
                              + *   addrenv - The representation of the task address environment previously
                              + *     returned by up_addrenv_create.
                              + *   tcb - The TCB of the task to receive the address environment.
                                *
                                * Returned Value:
                                *   Zero (OK) on success; a negated errno value on failure.
                                *
                                ****************************************************************************/
                               
                              -int up_addrenv_restore(FAR void *handle)
                              +int up_addrenv_assign(task_addrenv_t addrenv, FAR _TCB *tcb)
                               {
                              -  /* Restore the CBR value */
                              +  FAR struct z180_cbr_s *cbr = (FAR struct z180_cbr_s *)addrenv;
                              +  int ret;
                              +
                              +  /* Make sure that there is no address environment in place on this TCB */
                               
                              -  outp(Z180_MMU_CBR, (uint8_t)handle);
                              +  DEBUGASSERT(cbr && tcb->xcp.cbr == NULL);
                              +
                              +  /* Save the CBR strucure in the TCB.  This is an atomic operation so no
                              +   * special precautions should be needed.
                              +   */
                              +
                              +  tcb->xcp.cbr = cbr;
                              +  return OK;
                              +}
                              +
                              +/****************************************************************************
                              + * Name: up_addrenv_share
                              + *
                              + * Description:
                              + *   This function is called from the core scheduler logic when a thread
                              + *   is created that needs to share the address ennvironment of its parent
                              + *   task.  In this case, the parent's address environment needs to be
                              + *   "cloned" for the child.
                              + *
                              + * Input Parameters:
                              + *   ptcb - The TCB of the parent task that has the address environment.
                              + *   ctcb - The TCB of the child thread needing the address environment.
                              + *
                              + * Returned Value:
                              + *   Zero (OK) on success; a negated errno value on failure.
                              + *
                              + ****************************************************************************/
                              +
                              +int up_addrenv_share(FAR const _TCB *ptcb, FAR _TCB *ctcb)
                              +{
                              +  irqstate_t flags;
                              +
                              +  /* Make sure that the child has no address environment.  It is okay if
                              +   * if the parent does not have one.
                              +   */
                              +
                              +  DEBUGASSERT(ctcb->xcp.cbr == NULL);
                              +
                              +  flags = irqsave();
                              +  if (ptcb->xcp.cbr)
                              +    {
                              +      /* Clone the CBR by incrementing the reference counting and saving a
                              +       * copy in the child thread's TCB.
                              +       */
                              +
                              +      ptcb->xcp.cbr->crefs++;
                              +      ctcb->xcp.cbr = ptcb->xcp.cbr;
                              +    }
                              +
                              +  irqrestore(flags);
                                 return OK;
                               }
                               
                              @@ -407,7 +524,7 @@ int up_addrenv_release(FAR _TCB *tcb)
                                 cbr   = tcb->xcp.cbr;
                                 if (cbr)
                                   {
                              -      /* Nullify the reference to the CBR structgure and decrement the number
                              +      /* Nullify the reference to the CBR structure and decrement the number
                                      * of references on the CBR.
                                      */
                               
                              @@ -419,7 +536,7 @@ int up_addrenv_release(FAR _TCB *tcb)
                               
                                     if (cbr->crefs <= 1)
                                       {
                              -          z180_mmu_freecbr(cbr);
                              +          up_addrenv_destroy(cbr);
                                       }
                                     else
                                       {
                              diff --git a/nuttx/include/nuttx/arch.h b/nuttx/include/nuttx/arch.h
                              index 7c444602e..8b4b10ade 100644
                              --- a/nuttx/include/nuttx/arch.h
                              +++ b/nuttx/include/nuttx/arch.h
                              @@ -46,6 +46,7 @@
                               #include 
                               #include 
                               #include 
                              +
                               #include 
                               
                               /****************************************************************************
                              @@ -380,18 +381,48 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size);
                               #  define up_getpicbase(ppicbase)
                               #endif
                               
                              +/****************************************************************************
                              + * Address Environment Interfaces
                              + *
                              + * Low-level interfaces used in binfmt/ to instantiate tasks with address
                              + * environments.  These interfaces all operate on type task_addrenv_t which
                              + * is an abstract representation of a task's address environment and must be
                              + * defined in arch/arch.h if CONFIG_ADDRENV is defined.
                              + *
                              + *   up_addrenv_create  - Create an address environment
                              + *   up_addrenv_vaddr   - Returns the virtual base address of the address
                              + *                        environment
                              + *   up_addrenv_select  - Instantiate an address environment
                              + *   up_addrenv_restore - Restore an address environment
                              + *   up_addrenv_destroy - Destroy an address environment.
                              + *   up_addrenv_assign  - Assign an address environment to a TCB
                              + *
                              + * Higher-level interfaces used by the tasking logic.  These interfaces are
                              + * used by the functions in sched/ and all operate on the TCB which as been
                              + * assigned an address environment by up_addrenv_assign().
                              + *
                              + *   up_addrenv_share   - Clone the address environment assigned to one TCB
                              + *                        to another.  This operation is done when a pthread
                              + *                        is created that share's the same address
                              + *                        environment.
                              + *   up_addrenv_release - Release the TCBs reference to an address
                              + *                        environment when a task/thread exits.
                              + *
                              + ****************************************************************************/
                               /****************************************************************************
                                * Name: up_addrenv_create
                                *
                                * Description:
                                *   This function is called from the binary loader logic when a new
                              - *   task is created in RAM in order to instantiate an address environment for
                              - *   the task.
                              + *   task is created in order to instantiate an address environment for the
                              + *   task.  up_addrenv_create is essentially the allocator of the physical
                              + *   memory for the new task.
                                *
                                * Input Parameters:
                              - *   tcb - The TCB of the task needing the address environment.
                                *   envsize - The size (in bytes) of the address environment needed by the
                                *     task.
                              + *   addrenv - The location to return the representation of the task address
                              + *     environment.
                                *
                                * Returned Value:
                                *   Zero (OK) on success; a negated errno value on failure.
                              @@ -399,21 +430,21 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size);
                                ****************************************************************************/
                               
                               #ifdef CONFIG_ADDRENV
                              -int up_addrenv_create(FAR _TCB *tcb, size_t envsize);
                              +int up_addrenv_create(size_t envsize, FAR task_addrenv_t *addrenv);
                               #endif
                               
                               /****************************************************************************
                              - * Name: up_addrenv_share
                              + * Name: up_addrenv_vaddr
                                *
                                * Description:
                              - *   This function is called from the core scheduler logic when a thread
                              - *   is created that needs to share the address ennvironment of its parent
                              - *   task.  In this case, the parent's address environment needs to be
                              - *   "cloned" for the child.
                              + *   Return the virtual address associated with the newly create address
                              + *   environment.  This function is used by the binary loaders in order
                              + *   get an address that can be used to initialize the new task.
                                *
                                * Input Parameters:
                              - *   ptcb - The TCB of the parent task that has the address environment.
                              - *   ctcb - The TCB of the child thread needing the address environment.
                              + *   addrenv - The representation of the task address environment previously
                              + *      returned by up_addrenv_create.
                              + *   vaddr - The location to return the virtual address.
                                *
                                * Returned Value:
                                *   Zero (OK) on success; a negated errno value on failure.
                              @@ -421,11 +452,11 @@ int up_addrenv_create(FAR _TCB *tcb, size_t envsize);
                                ****************************************************************************/
                               
                               #ifdef CONFIG_ADDRENV
                              -int up_addrenv_share(FAR const _TCB *ptcb, FAR _TCB *ctcb);
                              +int up_addrenv_vaddr(FAR task_addrenv_t addrenv, FAR void **vaddr);
                               #endif
                               
                               /****************************************************************************
                              - * Name: up_addrenv_instantiate
                              + * Name: up_addrenv_select
                                *
                                * Description:
                                *   After an address environment has been established for a task (via
                              @@ -435,28 +466,97 @@ int up_addrenv_share(FAR const _TCB *ptcb, FAR _TCB *ctcb);
                                *   to access address environment private data.
                                *
                                * Input Parameters:
                              - *   tcb - The TCB of the task or thread whose the address environment will
                              - *     be instantiated.
                              + *   addrenv - The representation of the task address environment previously
                              + *     returned by up_addrenv_create.
                              + *   oldenv
                              + *     The address environment that was in place before up_addrenv_select().
                              + *     This may be used with up_addrenv_restore() to restore the original
                              + *     address environment that was in place before up_addrenv_select() was
                              + *     called.  Note that this may be a task agnostic, hardware
                              + *     representation that is different from task_addrenv_t.
                                *
                                * Returned Value:
                              - *   A handle that may be used with up_addrenv_restore() to restore the
                              - *   address environment before up_addrenv_instantiate() was called.
                              + *   Zero (OK) on success; a negated errno value on failure.
                                *
                                ****************************************************************************/
                               
                               #ifdef CONFIG_ADDRENV
                              -FAR void *up_addrenv_instantiate(FAR _TCB *tcb);
                              +int up_addrenv_select(task_addrenv_t addrenv, hw_addrenv_t *oldenv);
                               #endif
                               
                               /****************************************************************************
                                * Name: up_addrenv_restore
                                *
                                * Description:
                              - *   Restore an address environment using a handle previously returned by
                              - *   up_addrenv_instantiate().
                              + *   After an address environment has been temporarilty instantiated by
                              + *   up_addrenv_select, this function may be called to to restore the
                              + *   original address environment.
                              + *
                              + * Input Parameters:
                              + *   oldenv - The hardware representation of the address environment
                              + *     previously returned by up_addrenv_select.
                              + *
                              + * Returned Value:
                              + *   Zero (OK) on success; a negated errno value on failure.
                              + *
                              + ****************************************************************************/
                              +
                              +#ifdef CONFIG_ADDRENV
                              +int up_addrenv_restore(hw_addrenv_t oldenv);
                              +#endif
                              +
                              +/****************************************************************************
                              + * Name: up_addrenv_destroy
                              + *
                              + * Description:
                              + *   Called from the binary loader loader during error handling to destroy
                              + *   the address environment previously created by up_addrenv_create().
                              + *
                              + * Input Parameters:
                              + *   addrenv - The representation of the task address environment previously
                              + *     returned by up_addrenv_create.
                              + *
                              + * Returned Value:
                              + *   Zero (OK) on success; a negated errno value on failure.
                              + *
                              + ****************************************************************************/
                              +
                              +#ifdef CONFIG_ADDRENV
                              +int up_addrenv_destroy(task_addrenv_t addrenv);
                              +#endif
                              +
                              +/****************************************************************************
                              + * Name: up_addrenv_assign
                              + *
                              + * Description:
                              + *   Assign an address environment to a TCB.
                              + *
                              + * Input Parameters:
                              + *   addrenv - The representation of the task address environment previously
                              + *     returned by up_addrenv_create.
                              + *   tcb - The TCB of the task to receive the address environment.
                              + *
                              + * Returned Value:
                              + *   Zero (OK) on success; a negated errno value on failure.
                              + *
                              + ****************************************************************************/
                              +
                              +#ifdef CONFIG_ADDRENV
                              +int up_addrenv_assign(task_addrenv_t addrenv, FAR _TCB *tcb);
                              +#endif
                              +
                              +/****************************************************************************
                              + * Name: up_addrenv_share
                              + *
                              + * Description:
                              + *   This function is called from the core scheduler logic when a thread
                              + *   is created that needs to share the address ennvironment of its parent
                              + *   task.  In this case, the parent's address environment needs to be
                              + *   "cloned" for the child.
                                *
                                * Input Parameters:
                              - *   handle - A handle previously returned by up_addrenv_instantiate.
                              + *   ptcb - The TCB of the parent task that has the address environment.
                              + *   ctcb - The TCB of the child thread needing the address environment.
                                *
                                * Returned Value:
                                *   Zero (OK) on success; a negated errno value on failure.
                              @@ -464,7 +564,7 @@ FAR void *up_addrenv_instantiate(FAR _TCB *tcb);
                                ****************************************************************************/
                               
                               #ifdef CONFIG_ADDRENV
                              -int up_addrenv_restore(FAR void *handle);
                              +int up_addrenv_share(FAR const _TCB *ptcb, FAR _TCB *ctcb);
                               #endif
                               
                               /****************************************************************************
                              diff --git a/nuttx/include/nuttx/binfmt/binfmt.h b/nuttx/include/nuttx/binfmt/binfmt.h
                              index 200823bb8..2e2c6dda8 100644
                              --- a/nuttx/include/nuttx/binfmt/binfmt.h
                              +++ b/nuttx/include/nuttx/binfmt/binfmt.h
                              @@ -69,7 +69,7 @@ typedef FAR void (*binfmt_dtor_t)(void);
                               
                               /* This describes the file to be loaded.
                                *
                              - * NOTE: The 'filename' must be the full, absolute path to the file to be
                              + * NOTE 1: The 'filename' must be the full, absolute path to the file to be
                                * executed unless CONFIG_BINFMT_EXEPATH is defined.  In that case,
                                * 'filename' may be a relative path; a set of candidate absolute paths
                                * will be generated using the PATH environment variable and load_module()
                              @@ -81,7 +81,7 @@ struct binary_s
                               {
                                 /* Information provided to the loader to load and bind a module */
                               
                              -  FAR const char *filename;            /* Full path to the binary to be loaded (See NOTE above) */
                              +  FAR const char *filename;            /* Full path to the binary to be loaded (See NOTE 1 above) */
                                 FAR const char **argv;               /* Argument list */
                                 FAR const struct symtab_s *exports;  /* Table of exported symbols */
                                 int nexports;                        /* The number of symbols in exports[] */
                              -- 
                              cgit v1.2.3
                              
                              
                              From 56a650461894d8ab541277010e93fd5ca75f9f0d Mon Sep 17 00:00:00 2001
                              From: patacongo 
                              Date: Wed, 19 Dec 2012 17:54:26 +0000
                              Subject: Incorporate address environment interfaces in binfmt/ logic
                              
                              git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5443 42af7a65-404d-4744-a932-0658087f49c3
                              ---
                               apps/examples/nxflat/Makefile              |   2 +-
                               nuttx/ChangeLog                            |   7 +
                               nuttx/Documentation/NuttxPortingGuide.html |   8 +-
                               nuttx/arch/arm/src/lm3s/lm3s_ssi.c         |   5 +
                               nuttx/binfmt/binfmt_dumpmodule.c           |   3 +
                               nuttx/binfmt/binfmt_execmodule.c           |  45 +++++-
                               nuttx/binfmt/binfmt_unloadmodule.c         |  39 ++++-
                               nuttx/binfmt/elf.c                         |  23 ++-
                               nuttx/binfmt/libelf/Make.defs              |   6 +-
                               nuttx/binfmt/libelf/libelf.h               |  85 ++++++++++-
                               nuttx/binfmt/libelf/libelf_addrenv.c       | 176 ++++++++++++++++++++++
                               nuttx/binfmt/libelf/libelf_bind.c          |  36 ++++-
                               nuttx/binfmt/libelf/libelf_load.c          |  35 ++++-
                               nuttx/binfmt/libelf/libelf_read.c          |   6 +-
                               nuttx/binfmt/libelf/libelf_unload.c        |  13 +-
                               nuttx/binfmt/libnxflat/Make.defs           |   6 +-
                               nuttx/binfmt/libnxflat/libnxflat.h         | 136 +++++++++++++++++
                               nuttx/binfmt/libnxflat/libnxflat_addrenv.c | 234 +++++++++++++++++++++++++++++
                               nuttx/binfmt/libnxflat/libnxflat_bind.c    | 128 +++++++++++++++-
                               nuttx/binfmt/libnxflat/libnxflat_load.c    |  56 +++++--
                               nuttx/binfmt/libnxflat/libnxflat_unload.c  |  19 +--
                               nuttx/binfmt/nxflat.c                      |  23 ++-
                               nuttx/configs/eagle100/httpd/setenv.sh     |  26 +++-
                               nuttx/configs/eagle100/nettest/setenv.sh   |  26 +++-
                               nuttx/configs/eagle100/nsh/setenv.sh       |  26 +++-
                               nuttx/configs/eagle100/nxflat/setenv.sh    |  26 +++-
                               nuttx/include/nuttx/binfmt/binfmt.h        |  17 +++
                               nuttx/include/nuttx/binfmt/elf.h           |  46 +++++-
                               nuttx/include/nuttx/binfmt/nxflat.h        |  39 ++++-
                               nuttx/include/nuttx/sched.h                |  32 +++-
                               30 files changed, 1225 insertions(+), 104 deletions(-)
                               create mode 100644 nuttx/binfmt/libelf/libelf_addrenv.c
                               create mode 100644 nuttx/binfmt/libnxflat/libnxflat.h
                               create mode 100644 nuttx/binfmt/libnxflat/libnxflat_addrenv.c
                              
                              (limited to 'nuttx')
                              
                              diff --git a/apps/examples/nxflat/Makefile b/apps/examples/nxflat/Makefile
                              index 344ee9c6d..94092bd39 100644
                              --- a/apps/examples/nxflat/Makefile
                              +++ b/apps/examples/nxflat/Makefile
                              @@ -76,7 +76,7 @@ $(COBJS): %$(OBJEXT): %.c
                               headers:
                               	@$(MAKE) -C tests TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV)
                               
                              -.built: $(OBJS)
                              +.built: headers $(OBJS)
                               	$(call ARCHIVE, $(BIN), $(OBJS))
                               	@touch .built
                               
                              diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
                              index c932a1f2d..1296076b6 100644
                              --- a/nuttx/ChangeLog
                              +++ b/nuttx/ChangeLog
                              @@ -3792,3 +3792,10 @@
                               	  logic on initial check-in
                               	* binfmt/binfmt_loadmodule.c: load_module() will now traverse the PATH
                               	  variable to locate files from their relative path.
                              +	* include/nuttx/arch.h and arch/z80/src/z180/z180_mmu.c:  Restructure the
                              +	  address environment interfaces so that they will better integrate with
                              +	  binfmt/.
                              +	* binfmt/libelf/*, binfmt/libnxflat/* and other files:  Integrate the
                              +	  address environment interfaces.  If CONFIG_ADDRENV=y, then binfmt/
                              +	  will now create an address environment for new tasks (instead of
                              +	  just malloc'ing the task memory).
                              diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html
                              index 526892d3e..0408f82ac 100644
                              --- a/nuttx/Documentation/NuttxPortingGuide.html
                              +++ b/nuttx/Documentation/NuttxPortingGuide.html
                              @@ -2130,7 +2130,7 @@ else
                                   

                              Binary Loader Support. These are low-level interfaces used in binfmt/ to instantiate tasks with address environments. - These interfaces all operate on type task_addrenv_t which is an abstract representation of a asks's address environment and must be defined in arch/arch.h if CONFIG_ADDRENVM is defined. + These interfaces all operate on type task_addrenv_t which is an abstract representation of a asks's address environment and must be defined in arch/arch.h if CONFIG_ADDRENV is defined. These low-level interfaces include:

                                @@ -2174,7 +2174,7 @@ else
                              • 4.1.21.8 up_addrenv_release(): - ARelease the TCBs reference to an address environment when a task/thread exits. + Release the TCB's reference to an address environment when a task/thread exits.
                              @@ -3930,7 +3930,9 @@ void (*notify)(FAR struct pm_callback_s *cb, enum pm_state_e pmstate); up_prioritize_irq() API.
                            • CONFIG_ADDRENV: The CPU supports an MMU and CPU port supports provision of address - environments for tasks (making the, perhaps, processes).
                            • + environments for tasks (making the, perhaps, processes). + In this case, the CPU-specific logic must provide a set of address environment interfaces as defined in the Address Environments paragraph. +

                            diff --git a/nuttx/arch/arm/src/lm3s/lm3s_ssi.c b/nuttx/arch/arm/src/lm3s/lm3s_ssi.c index c756e2b6a..8d1987992 100644 --- a/nuttx/arch/arm/src/lm3s/lm3s_ssi.c +++ b/nuttx/arch/arm/src/lm3s/lm3s_ssi.c @@ -209,8 +209,11 @@ static inline void ssi_putreg(struct lm3s_ssidev_s *priv, unsigned int offset, static uint32_t ssi_disable(struct lm3s_ssidev_s *priv); static void ssi_enable(struct lm3s_ssidev_s *priv, uint32_t enable); + +#ifndef CONFIG_SSI_POLLWAIT static void ssi_semtake(sem_t *sem); #define ssi_semgive(s) sem_post(s); +#endif /* SSI data transfer */ @@ -446,6 +449,7 @@ static void ssi_enable(struct lm3s_ssidev_s *priv, uint32_t enable) * ****************************************************************************/ +#ifndef CONFIG_SSI_POLLWAIT static void ssi_semtake(sem_t *sem) { int ret; @@ -456,6 +460,7 @@ static void ssi_semtake(sem_t *sem) while (ret < 0 && errno == EINTR); DEBUGASSERT(ret == 0); } +#endif /**************************************************************************** * Name: ssi_txnull, ssi_txuint16, and ssi_txuint8 diff --git a/nuttx/binfmt/binfmt_dumpmodule.c b/nuttx/binfmt/binfmt_dumpmodule.c index cd52136b0..d320bc830 100644 --- a/nuttx/binfmt/binfmt_dumpmodule.c +++ b/nuttx/binfmt/binfmt_dumpmodule.c @@ -95,6 +95,9 @@ int dump_module(FAR const struct binary_s *bin) #ifdef CONFIG_BINFMT_CONSTRUCTORS bdbg(" ctors: %p nctors=%d\n", bin->ctors, bin->nctors); bdbg(" dtors: %p ndtors=%d\n", bin->dtors, bin->ndtors); +#endif +#ifdef CONFIG_ADDRENV + bdbg(" addrenv: %p\n", bin->addrenv); #endif bdbg(" stacksize: %d\n", bin->stacksize); } diff --git a/nuttx/binfmt/binfmt_execmodule.c b/nuttx/binfmt/binfmt_execmodule.c index 37f445966..400451c40 100644 --- a/nuttx/binfmt/binfmt_execmodule.c +++ b/nuttx/binfmt/binfmt_execmodule.c @@ -86,11 +86,26 @@ ****************************************************************************/ #ifdef CONFIG_BINFMT_CONSTRUCTORS -static inline void exec_ctors(FAR const struct binary_s *binp) +static inline int exec_ctors(FAR const struct binary_s *binp) { binfmt_ctor_t *ctor = binp->ctors; +#ifdef CONFIG_ADDRENV + hw_addrenv_t oldenv; + int ret; +#endif int i; + /* Instantiate the address enviroment containing the constructors */ + +#ifdef CONFIG_ADDRENV + ret = up_addrenv_select(binp->addrenv, &oldenv); + if (ret < 0) + { + bdbg("up_addrenv_select() failed: %d\n", ret); + return ret; + } +#endif + /* Execute each constructor */ for (i = 0; i < binp->nctors; i++) @@ -100,6 +115,14 @@ static inline void exec_ctors(FAR const struct binary_s *binp) (*ctor)(); ctor++; } + + /* Restore the address enviroment */ + +#ifdef CONFIG_ADDRENV + return up_addrenv_restore(oldenv); +#else + return OK; +#endif } #endif @@ -190,6 +213,18 @@ int exec_module(FAR const struct binary_s *binp, int priority) up_initial_state(tcb); #endif + /* Assign the address environment to the task */ + +#ifdef CONFIG_ADDRENV + ret = up_addrenv_assign(binp->addrenv, tcb); + if (ret < 0) + { + err = -ret; + bdbg("up_addrenv_assign() failed: %d\n", ret); + goto errout_with_stack; + } +#endif + /* Get the assigned pid before we start the task */ pid = tcb->pid; @@ -197,7 +232,13 @@ int exec_module(FAR const struct binary_s *binp, int priority) /* Execute all of the C++ static constructors */ #ifdef CONFIG_BINFMT_CONSTRUCTORS - exec_ctors(binp); + ret = exec_ctors(binp); + if (ret < 0) + { + err = -ret; + bdbg("exec_ctors() failed: %d\n", ret); + goto errout_with_stack; + } #endif /* Then activate the task at the provided priority */ diff --git a/nuttx/binfmt/binfmt_unloadmodule.c b/nuttx/binfmt/binfmt_unloadmodule.c index 52243fcf7..a0050481c 100644 --- a/nuttx/binfmt/binfmt_unloadmodule.c +++ b/nuttx/binfmt/binfmt_unloadmodule.c @@ -86,8 +86,23 @@ static inline void exec_dtors(FAR const struct binary_s *binp) { binfmt_dtor_t *dtor = binp->dtors; +#ifdef CONFIG_ADDRENV + hw_addrenv_t oldenv; + int ret; +#endif int i; + /* Instantiate the address enviroment containing the destructors */ + +#ifdef CONFIG_ADDRENV + ret = up_addrenv_select(binp->addrenv, &oldenv); + if (ret < 0) + { + bdbg("up_addrenv_select() failed: %d\n", ret); + return ret; + } +#endif + /* Execute each destructor */ for (i = 0; i < binp->ndtors; i++) @@ -97,6 +112,14 @@ static inline void exec_dtors(FAR const struct binary_s *binp) (*dtor)(); dtor++; } + + /* Restore the address enviroment */ + +#ifdef CONFIG_ADDRENV + return up_addrenv_restore(oldenv); +#else + return OK; +#endif } #endif @@ -125,15 +148,23 @@ static inline void exec_dtors(FAR const struct binary_s *binp) int unload_module(FAR const struct binary_s *binp) { +#ifdef CONFIG_BINFMT_CONSTRUCTORS + int ret; +#endif int i; if (binp) { - /* Execute C++ desctructors */ #ifdef CONFIG_BINFMT_CONSTRUCTORS - exec_dtors(binp); + ret = exec_dtors(binp); + if (ret < 0) + { + bdbg("exec_ctors() failed: %d\n", ret); + set_errno(-ret); + return ERROR; + } #endif /* Unmap mapped address spaces */ @@ -155,6 +186,10 @@ int unload_module(FAR const struct binary_s *binp) free(binp->alloc[i]); } } + + /* Notice that the address environment is not destroyed. This should + * happen automatically when the task exits. + */ } return OK; diff --git a/nuttx/binfmt/elf.c b/nuttx/binfmt/elf.c index ea1e7b0ca..bcebf13ca 100644 --- a/nuttx/binfmt/elf.c +++ b/nuttx/binfmt/elf.c @@ -215,9 +215,22 @@ static int elf_loadbinary(struct binary_s *binp) /* Return the load information */ binp->entrypt = (main_t)(loadinfo.elfalloc + loadinfo.ehdr.e_entry); - binp->alloc[0] = (FAR void *)loadinfo.elfalloc; binp->stacksize = CONFIG_ELF_STACKSIZE; + /* Add the ELF allocation to the alloc[] only if there is no address + * enironment. If there is an address environment, it will automatically + * be freed when the function exits + * + * REVISIT: If the module is loaded then unloaded, wouldn't this cause + * a memory leak? + */ + +#ifdef CONFIG_ADDRENV +# warning "REVISIT" +#else + binp->alloc[0] = (FAR void *)loadinfo.elfalloc; +#endif + #ifdef CONFIG_BINFMT_CONSTRUCTORS /* Save information about constructors. NOTE: desctructors are not * yet supported. @@ -232,6 +245,14 @@ static int elf_loadbinary(struct binary_s *binp) binp->ndtors = loadinfo.ndtors; #endif +#ifdef CONFIG_ADDRENV + /* Save the address environment. This will be needed when the module is + * executed for the up_addrenv_assign() call. + */ + + binp->addrenv = loadinfo.addrenv; +#endif + elf_dumpbuffer("Entry code", (FAR const uint8_t*)binp->entrypt, MIN(loadinfo.allocsize - loadinfo.ehdr.e_entry, 512)); diff --git a/nuttx/binfmt/libelf/Make.defs b/nuttx/binfmt/libelf/Make.defs index c8857c3f7..93d95a23c 100644 --- a/nuttx/binfmt/libelf/Make.defs +++ b/nuttx/binfmt/libelf/Make.defs @@ -41,9 +41,9 @@ BINFMT_CSRCS += elf.c # ELF library -BINFMT_CSRCS += libelf_bind.c libelf_init.c libelf_iobuffer.c libelf_load.c \ - libelf_read.c libelf_sections.c libelf_symbols.c libelf_uninit.c \ - libelf_unload.c libelf_verify.c +BINFMT_CSRCS += libelf_bind.c libelf_init.c libelf_addrenv.c libelf_iobuffer.c +BINFMT_CSRCS += libelf_load.c libelf_read.c libelf_sections.c libelf_symbols.c +BINFMT_CSRCS += libelf_uninit.c libelf_unload.c libelf_verify.c ifeq ($(CONFIG_BINFMT_CONSTRUCTORS),y) BINFMT_CSRCS += libelf_ctors.c libelf_dtors.c diff --git a/nuttx/binfmt/libelf/libelf.h b/nuttx/binfmt/libelf/libelf.h index 5b0be9ab0..04c9144f6 100644 --- a/nuttx/binfmt/libelf/libelf.h +++ b/nuttx/binfmt/libelf/libelf.h @@ -45,6 +45,7 @@ #include #include +#include #include /**************************************************************************** @@ -74,7 +75,11 @@ int elf_verifyheader(FAR const Elf32_Ehdr *header); * Name: elf_read * * Description: - * Read 'readsize' bytes from the object file at 'offset' + * Read 'readsize' bytes from the object file at 'offset'. The data is + * read into 'buffer.' If 'buffer' is part of the ELF address environment, + * then the caller is responsibile for assuring that that address + * environment is in place before calling this function (i.e., that + * elf_addrenv_select() has been called if CONFIG_ADDRENV=y). * * Returned Value: * 0 (OK) is returned on success and a negated errno is returned on @@ -255,4 +260,82 @@ int elf_loadctors(FAR struct elf_loadinfo_s *loadinfo); int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo); #endif +/**************************************************************************** + * Name: elf_addrenv_alloc + * + * Description: + * Allocate memory for the ELF image (elfalloc). If CONFIG_ADDRENV=n, + * elfalloc will be allocated using kzalloc(). If CONFIG_ADDRENV-y, then + * elfalloc will be allocated using up_addrenv_create(). In either case, + * there will be a unique instance of elfalloc (and stack) for each + * instance of a process. + * + * Input Parameters: + * loadinfo - Load state information + * envsize - The size (in bytes) of the address environment needed for the + * ELF image. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +int elf_addrenv_alloc(FAR struct elf_loadinfo_s *loadinfo, size_t envsize); + +/**************************************************************************** + * Name: elf_addrenv_select + * + * Description: + * Temporarity select the task's address environemnt. + * + * Input Parameters: + * loadinfo - Load state information + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +# define elf_addrenv_select(l) up_addrenv_select((l)->addrenv, &(l)->oldenv) +#endif + +/**************************************************************************** + * Name: elf_addrenv_restore + * + * Description: + * Restore the address environment before elf_addrenv_select() was called.. + * + * Input Parameters: + * loadinfo - Load state information + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +# define elf_addrenv_restore(l) up_addrenv_restore((l)->oldenv) +#endif + +/**************************************************************************** + * Name: elf_addrenv_free + * + * Description: + * Release the address environment previously created by + * elf_addrenv_alloc(). This function is called only under certain error + * conditions after the the module has been loaded but not yet started. + * After the module has been started, the address environment will + * automatically be freed when the module exits. + * + * Input Parameters: + * loadinfo - Load state information + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void elf_addrenv_free(FAR struct elf_loadinfo_s *loadinfo); + #endif /* __BINFMT_LIBELF_LIBELF_H */ diff --git a/nuttx/binfmt/libelf/libelf_addrenv.c b/nuttx/binfmt/libelf/libelf_addrenv.c new file mode 100644 index 000000000..28cc0e108 --- /dev/null +++ b/nuttx/binfmt/libelf/libelf_addrenv.c @@ -0,0 +1,176 @@ +/**************************************************************************** + * binfmt/libelf/libelf_addrenv.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +#include "libelf.h" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Constant Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: elf_addrenv_create + * + * Description: + * Allocate memory for the ELF image (elfalloc). If CONFIG_ADDRENV=n, + * elfalloc will be allocated using kzalloc(). If CONFIG_ADDRENV-y, then + * elfalloc will be allocated using up_addrenv_create(). In either case, + * there will be a unique instance of elfalloc (and stack) for each + * instance of a process. + * + * Input Parameters: + * loadinfo - Load state information + * envsize - The size (in bytes) of the address environment needed for the + * ELF image. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +int elf_addrenv_create(FAR struct elf_loadinfo_s *loadinfo, size_t envsize) +{ +#ifdef CONFIG_ADDRENV + FAR void *vaddr; + int ret; + + /* Create an address environment for the new ELF task */ + + ret = up_addrenv_create(envsize, &loadinfo->addrenv); + if (ret < 0) + { + bdbg("ERROR: up_addrenv_create failed: %d\n", ret); + return ret; + } + + /* Get the virtual address associated with the start of the address + * environment. This is the base address that we will need to use to + * access the ELF image (but only if the address environment has been + * selected. + */ + + ret = up_addrenv_vaddr(loadinfo->addrenv, &vaddr); + if (ret < 0) + { + bdbg("ERROR: up_addrenv_vaddr failed: %d\n", ret); + return ret; + } + + loadinfo->elfalloc = (uintptr_t)vaddr; + return OK; +#else + /* Allocate memory to hold the ELF image */ + + loadinfo->elfalloc = (uintptr_t)kzalloc(envsize); + if (!loadinfo->elfalloc) + { + return -ENOMEM; + } + + return OK; +#endif +} + +/**************************************************************************** + * Name: elf_addrenv_free + * + * Description: + * Release the address environment previously created by + * elf_addrenv_create(). This function is called only under certain error + * conditions after the the module has been loaded but not yet started. + * After the module has been started, the address environment will + * automatically be freed when the module exits. + * + * Input Parameters: + * loadinfo - Load state information + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void elf_addrenv_free(FAR struct elf_loadinfo_s *loadinfo) +{ +#ifdef CONFIG_ADDRENV + int ret; + + /* Free the address environemnt */ + + ret = up_addrenv_destroy(loadinfo->addrenv); + if (ret < 0) + { + bdbg("ERROR: up_addrenv_destroy failed: %d\n", ret); + } + + /* Clear out all indications of the allocated address environment */ + + loadinfo->elfalloc = 0; + loadinfo->elfsize = 0; + loadinfo->addrenv = 0; +#else + /* If there is an allocation for the ELF image, free it */ + + if (loadinfo->elfalloc != 0) + { + kfree((FAR void *)loadinfo->elfalloc); + loadinfo->elfalloc = 0; + } + + loadinfo->elfsize = 0; +#endif +} diff --git a/nuttx/binfmt/libelf/libelf_bind.c b/nuttx/binfmt/libelf/libelf_bind.c index e35087b1d..ccdb5108e 100644 --- a/nuttx/binfmt/libelf/libelf_bind.c +++ b/nuttx/binfmt/libelf/libelf_bind.c @@ -86,10 +86,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: elf_readsym + * Name: elf_readrel * * Description: - * Read the ELFT symbol structure at the specfied index into memory. + * Read the ELF32_Rel structure into memory. * ****************************************************************************/ @@ -184,7 +184,7 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx, return ret; } - /* Calculate the relocation address */ + /* Calculate the relocation address. */ if (rel.r_offset < 0 || rel.r_offset > dstsec->sh_size - sizeof(uint32_t)) { @@ -195,14 +195,42 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx, addr = dstsec->sh_addr + rel.r_offset; + /* If CONFIG_ADDRENV=y, then 'addr' lies in a virtual address space that + * may not be in place now. elf_addrenv_select() will temporarily + * instantiate that address space. + */ + +#ifdef CONFIG_ADDRENV + ret = elf_addrenv_select(loadinfo); + if (ret < 0) + { + bdbg("ERROR: elf_addrenv_select() failed: %d\n", ret); + return ret; + } +#endif + /* Now perform the architecture-specific relocation */ ret = arch_relocate(&rel, &sym, addr); if (ret < 0) { - bdbg("Section %d reloc %d: Relocation failed: %d\n", ret); +#ifdef CONFIG_ADDRENV + (void)elf_addrenv_restore(loadinfo); +#endif + bdbg("ERROR: Section %d reloc %d: Relocation failed: %d\n", ret); + return ret; + } + + /* Restore the original address environment */ + +#ifdef CONFIG_ADDRENV + ret = elf_addrenv_restore(loadinfo); + if (ret < 0) + { + bdbg("ERROR: elf_addrenv_restore() failed: %d\n", ret); return ret; } +#endif } return OK; diff --git a/nuttx/binfmt/libelf/libelf_load.c b/nuttx/binfmt/libelf/libelf_load.c index b1ac44e21..0e4ad9798 100644 --- a/nuttx/binfmt/libelf/libelf_load.c +++ b/nuttx/binfmt/libelf/libelf_load.c @@ -49,7 +49,6 @@ #include #include -#include #include #include "libelf.h" @@ -135,11 +134,12 @@ static inline int elf_loadfile(FAR struct elf_loadinfo_s *loadinfo) int i; /* Allocate (and zero) memory for the ELF file. */ - - loadinfo->elfalloc = (uintptr_t)kzalloc(loadinfo->elfsize); - if (!loadinfo->elfalloc) + + ret = elf_addrenv_alloc(loadinfo, loadinfo->elfsize); + if (ret < 0) { - return -ENOMEM; + bdbg("ERROR: elf_addrenv_alloc() failed: %d\n", ret); + return ret; } /* Read each section into memory that is marked SHF_ALLOC + SHT_NOBITS */ @@ -165,6 +165,20 @@ static inline int elf_loadfile(FAR struct elf_loadinfo_s *loadinfo) if (shdr->sh_type != SHT_NOBITS) { + /* If CONFIG_ADDRENV=y, then 'dest' lies in a virtual address space + * that may not be in place now. elf_addrenv_select() will + * temporarily instantiate that address space. + */ + +#ifdef CONFIG_ADDRENV + ret = elf_addrenv_select(loadinfo); + if (ret < 0) + { + bdbg("ERROR: elf_addrenv_select() failed: %d\n", ret); + return ret; + } +#endif + /* Read the section data from sh_offset to dest */ ret = elf_read(loadinfo, dest, shdr->sh_size, shdr->sh_offset); @@ -173,6 +187,17 @@ static inline int elf_loadfile(FAR struct elf_loadinfo_s *loadinfo) bdbg("Failed to read section %d: %d\n", i, ret); return ret; } + + /* Restore the original address environment */ + +#ifdef CONFIG_ADDRENV + ret = elf_addrenv_restore(loadinfo); + if (ret < 0) + { + bdbg("ERROR: elf_addrenv_restore() failed: %d\n", ret); + return ret; + } +#endif } /* Update sh_addr to point to copy in memory */ diff --git a/nuttx/binfmt/libelf/libelf_read.c b/nuttx/binfmt/libelf/libelf_read.c index da41212f2..f4b725183 100644 --- a/nuttx/binfmt/libelf/libelf_read.c +++ b/nuttx/binfmt/libelf/libelf_read.c @@ -98,7 +98,11 @@ static inline void elf_dumpreaddata(char *buffer, int buflen) * Name: elf_read * * Description: - * Read 'readsize' bytes from the object file at 'offset' + * Read 'readsize' bytes from the object file at 'offset'. The data is + * read into 'buffer.' If 'buffer' is part of the ELF address environment, + * then the caller is responsibile for assuring that that address + * environment is in place before calling this function (i.e., that + * elf_addrenv_select() has been called if CONFIG_ADDRENV=y). * * Returned Value: * 0 (OK) is returned on success and a negated errno is returned on diff --git a/nuttx/binfmt/libelf/libelf_unload.c b/nuttx/binfmt/libelf/libelf_unload.c index 532fc606f..539e5faf7 100644 --- a/nuttx/binfmt/libelf/libelf_unload.c +++ b/nuttx/binfmt/libelf/libelf_unload.c @@ -67,8 +67,9 @@ * Name: elf_unload * * Description: - * This function unloads the object from memory. This essentially - * undoes the actions of elf_load. + * This function unloads the object from memory. This essentially undoes + * the actions of elf_load. It is called only under certain error + * conditions after the the module has been loaded but not yet started. * * Returned Value: * 0 (OK) is returned on success and a negated errno is returned on @@ -84,13 +85,7 @@ int elf_unload(struct elf_loadinfo_s *loadinfo) /* Release memory holding the relocated ELF image */ - if (loadinfo->elfalloc != 0) - { - kfree((FAR void *)loadinfo->elfalloc); - loadinfo->elfalloc = 0; - } - - loadinfo->elfsize = 0; + elf_addrenv_free(loadinfo); /* Release memory used to hold static constructors and destructors */ diff --git a/nuttx/binfmt/libnxflat/Make.defs b/nuttx/binfmt/libnxflat/Make.defs index 4f522e52b..6a0bf1873 100644 --- a/nuttx/binfmt/libnxflat/Make.defs +++ b/nuttx/binfmt/libnxflat/Make.defs @@ -41,9 +41,9 @@ BINFMT_CSRCS += nxflat.c # NXFLAT library -BINFMT_CSRCS += libnxflat_init.c libnxflat_uninit.c libnxflat_load.c \ - libnxflat_unload.c libnxflat_verify.c libnxflat_read.c \ - libnxflat_bind.c +BINFMT_CSRCS += libnxflat_init.c libnxflat_uninit.c libnxflat_addrenv.c +BINFMT_CSRCS += libnxflat_load.c libnxflat_unload.c libnxflat_verify.c +BINFMT_CSRCS += libnxflat_read.c libnxflat_bind.c # Hook the libnxflat subdirectory into the build diff --git a/nuttx/binfmt/libnxflat/libnxflat.h b/nuttx/binfmt/libnxflat/libnxflat.h new file mode 100644 index 000000000..cb1cb7057 --- /dev/null +++ b/nuttx/binfmt/libnxflat/libnxflat.h @@ -0,0 +1,136 @@ +/**************************************************************************** + * binfmt/libnxflat/libnxflat.h + * + * Copyright (C) 2012 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 __BINFMT_LIBNXFLAT_LIBNXFLAT_H +#define __BINFMT_LIBNXFLAT_LIBNXFLAT_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/**************************************************************************** + * Name: nxflat_addrenv_alloc + * + * Description: + * Allocate memory for the ELF image (elfalloc). If CONFIG_ADDRENV=n, + * elfalloc will be allocated using kzalloc(). If CONFIG_ADDRENV-y, then + * elfalloc will be allocated using up_addrenv_create(). In either case, + * there will be a unique instance of elfalloc (and stack) for each + * instance of a process. + * + * Input Parameters: + * loadinfo - Load state information + * envsize - The size (in bytes) of the address environment needed for the + * ELF image. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +int nxflat_addrenv_alloc(FAR struct nxflat_loadinfo_s *loadinfo, size_t envsize); + +/**************************************************************************** + * Name: nxflat_addrenv_select + * + * Description: + * Temporarity select the task's address environemnt. + * + * Input Parameters: + * loadinfo - Load state information + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +# define nxflat_addrenv_select(l) up_addrenv_select((l)->addrenv, &(l)->oldenv) +#endif + +/**************************************************************************** + * Name: nxflat_addrenv_restore + * + * Description: + * Restore the address environment before nxflat_addrenv_select() was called.. + * + * Input Parameters: + * loadinfo - Load state information + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +# define nxflat_addrenv_restore(l) up_addrenv_restore((l)->oldenv) +#endif + +/**************************************************************************** + * Name: nxflat_addrenv_free + * + * Description: + * Release the address environment previously created by + * nxflat_addrenv_create(). This function is called only under certain + * error conditions after the the module has been loaded but not yet + * started. After the module has been started, the address environment + * will automatically be freed when the module exits. + * + * Input Parameters: + * loadinfo - Load state information + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void nxflat_addrenv_free(FAR struct nxflat_loadinfo_s *loadinfo); + +#endif /* __BINFMT_LIBNXFLAT_LIBNXFLAT_H */ diff --git a/nuttx/binfmt/libnxflat/libnxflat_addrenv.c b/nuttx/binfmt/libnxflat/libnxflat_addrenv.c new file mode 100644 index 000000000..c6b3fce34 --- /dev/null +++ b/nuttx/binfmt/libnxflat/libnxflat_addrenv.c @@ -0,0 +1,234 @@ +/**************************************************************************** + * binfmt/libnxflat/libnxflat_addrenv.c + * + * Copyright (C) 2012 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +#include "libnxflat.h" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Constant Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: nxflat_addrenv_create + * + * Description: + * Allocate memory for the ELF image (elfalloc). If CONFIG_ADDRENV=n, + * elfalloc will be allocated using kzalloc(). If CONFIG_ADDRENV-y, then + * elfalloc will be allocated using up_addrenv_create(). In either case, + * there will be a unique instance of elfalloc (and stack) for each + * instance of a process. + * + * Input Parameters: + * loadinfo - Load state information + * envsize - The size (in bytes) of the address environment needed for the + * ELF image. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +int nxflat_addrenv_create(FAR struct nxflat_loadinfo_s *loadinfo, size_t envsize) +{ + FAR struct dspace_s *dspace; +#ifdef CONFIG_ADDRENV + FAR void *vaddr; + hw_addrenv_t oldenv; + int ret; +#endif + + DEBUGASSERT(!loadinfo->dspace); + + /* Allocate the struct dspace_s container for the D-Space allocation */ + + dspace = (FAR struct dspace_s *)kmalloc(sizeof(struct dspace_s)); + if (dspace == 0) + { + bdbg("ERROR: Failed to allocate DSpace\n"); + return -ENOMEM; + } + +#ifdef CONFIG_ADDRENV + /* Create a D-Space address environment for the new NXFLAT task */ + + ret = up_addrenv_create(envsize, &loadinfo->addrenv); + if (ret < 0) + { + bdbg("ERROR: up_addrenv_create failed: %d\n", ret); + goto errout_with_dspace; + } + + /* Get the virtual address associated with the start of the address + * environment. This is the base address that we will need to use to + * access the D-Space region (but only if the address environment has been + * selected. + */ + + ret = up_addrenv_vaddr(loadinfo->addrenv, &vaddr); + if (ret < 0) + { + bdbg("ERROR: up_addrenv_vaddr failed: %d\n", ret); + goto errout_with_addrenv; + } + + /* Clear all of the allocated D-Space memory. We have to temporarily + * selected the D-Space address environment to do this. + */ + + ret = up_addrenv_select(loadinfo->addrenv, &oldenv); + if (ret < 0) + { + bdbg("ERROR: up_addrenv_select failed: %d\n", ret); + goto errout_with_addrenv; + } + + memset(vaddr, 0, envsize); + + ret = up_addrenv_restore(oldenv); + if (ret < 0) + { + bdbg("ERROR: up_addrenv_restore failed: %d\n", ret); + goto errout_with_addrenv; + } + + /* Success... save the fruits of our labor */ + + loadinfo->dspace = dspace; + dspace->crefs = 1; + dspace->region = (FAR uint8_t *)vaddr; + return OK; + +errout_with_addrenv: + (void)up_addrenv_destroy(loadinfo->addrenv); + loadinfo->addrenv = 0; + +errout_with_dspace: + kfree(dspace); + return ret; +#else + /* Allocate (and zero) memory to hold the ELF image */ + + dspace->region = (FAR uint8_t *)kzalloc(envsize); + if (!dspace->region) + { + kfree(dspace); + return -ENOMEM; + } + + loadinfo->dspace = dspace; + dspace->crefs = 1; + return OK; +#endif +} + +/**************************************************************************** + * Name: nxflat_addrenv_free + * + * Description: + * Release the address environment previously created by + * nxflat_addrenv_create(). This function is called only under certain + * error conditions after the the module has been loaded but not yet + * started. After the module has been started, the address environment + * will automatically be freed when the module exits. + * + * Input Parameters: + * loadinfo - Load state information + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void nxflat_addrenv_free(FAR struct nxflat_loadinfo_s *loadinfo) +{ + FAR struct dspace_s *dspace; +#ifdef CONFIG_ADDRENV + int ret; +#endif + + DEBUGASSERT(loadinfo); + dspace = loadinfo->dspace; + + if (dspace) + { +#ifdef CONFIG_ADDRENV + /* Destroy the address environment */ + + ret = up_addrenv_destroy(loadinfo->addrenv); + if (ret < 0) + { + bdbg("ERROR: up_addrenv_destroy failed: %d\n", ret); + } + + loadinfo->addrenv = 0; +#else + /* Free the allocated D-Space region */ + + if (dspace->region) + { + kfree(dspace->region); + } +#endif + + /* Now destroy the D-Space container */ + + DEBUGASSERT(dspace->crefs == 1); + kfree(dspace); + loadinfo->dspace = NULL; + } +} diff --git a/nuttx/binfmt/libnxflat/libnxflat_bind.c b/nuttx/binfmt/libnxflat/libnxflat_bind.c index 2b9f64715..3a86d5355 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_bind.c +++ b/nuttx/binfmt/libnxflat/libnxflat_bind.c @@ -47,9 +47,12 @@ #include #include + #include #include +#include "libnxflat.h" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -229,8 +232,6 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo) hdr = (FAR struct nxflat_hdr_s*)loadinfo->ispace; - /* From this, we can get the list of relocation entries. */ - /* From this, we can get the offset to the list of relocation entries */ offset = ntohl(hdr->h_relocstart); @@ -252,6 +253,22 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo) bvdbg("isize: %08lx dpsace: %p relocs: %p\n", (long)loadinfo->isize, loadinfo->dspace->region, relocs); + /* All relocations are performed within the D-Space allocation. If + * CONFIG_ADDRENV=y, then that D-Space allocation lies in an address + * environment that may not be in place. So, in that case, we must call + * nxflat_addrenv_select to temporarily instantiate that address space + * before the relocations can be performed. + */ + +#ifdef CONFIG_ADDRENV + ret = nxflat_addrenv_select(loadinfo); + if (ret < 0) + { + bdbg("ERROR: nxflat_addrenv_select() failed: %d\n", ret); + return ret; + } +#endif + /* Now, traverse the relocation list of and bind each GOT relocation. */ ret = OK; /* Assume success */ @@ -329,6 +346,16 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo) } #endif + /* Restore the original address environment */ + +#ifdef CONFIG_ADDRENV + ret = nxflat_addrenv_restore(loadinfo); + if (ret < 0) + { + bdbg("ERROR: nxflat_addrenv_restore() failed: %d\n", ret); + } +#endif + return ret; } @@ -346,16 +373,19 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo) ****************************************************************************/ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo, - FAR const struct symtab_s *exports, - int nexports) + FAR const struct symtab_s *exports, + int nexports) { FAR struct nxflat_import_s *imports; FAR struct nxflat_hdr_s *hdr; - FAR const struct symtab_s *symbol; + FAR const struct symtab_s *symbol; char *symname; uint32_t offset; uint16_t nimports; +#ifdef CONFIG_ADDRENV + int ret; +#endif int i; /* The NXFLAT header is the first thing at the beginning of the ISpace. */ @@ -370,6 +400,22 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo, nimports = ntohs(hdr->h_importcount); bvdbg("Imports offset: %08x nimports: %d\n", offset, nimports); + /* The import[] table resides within the D-Space allocation. If + * CONFIG_ADDRENV=y, then that D-Space allocation lies in an address + * environment that may not be in place. So, in that case, we must call + * nxflat_addrenv_select to temporarily instantiate that address space + * before the import[] table can be modified. + */ + +#ifdef CONFIG_ADDRENV + ret = nxflat_addrenv_select(loadinfo); + if (ret < 0) + { + bdbg("ERROR: nxflat_addrenv_select() failed: %d\n", ret); + return ret; + } +#endif + /* Verify that this module requires imported symbols */ if (offset != 0 && nimports > 0) @@ -421,6 +467,9 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo, if (!symbol) { bdbg("Exported symbol \"%s\" not found\n", symname); +#ifdef CONFIG_ADDRENV + (void)nxflat_addrenv_restore(loadinfo); +#endif return -ENOENT; } @@ -442,7 +491,73 @@ static inline int nxflat_bindimports(FAR struct nxflat_loadinfo_s *loadinfo, } #endif + /* Restore the original address environment */ + +#ifdef CONFIG_ADDRENV + ret = nxflat_addrenv_restore(loadinfo); + if (ret < 0) + { + bdbg("ERROR: nxflat_addrenv_restore() failed: %d\n", ret); + } + + return ret; +#else return OK; +#endif +} + +/**************************************************************************** + * Name: nxflat_clearbss + * + * Description: + * Clear uninitialized .bss memory + * + * Returned Value: + * 0 (OK) is returned on success and a negated errno is returned on + * failure. + * + ****************************************************************************/ + +static inline int nxflat_clearbss(FAR struct nxflat_loadinfo_s *loadinfo) +{ +#ifdef CONFIG_ADDRENV + int ret; +#endif + + /* .bss resides within the D-Space allocation. If CONFIG_ADDRENV=y, then + * that D-Space allocation lies in an address environment that may not be + * in place. So, in that case, we must call nxflat_addrenv_select to + * temporarily instantiate that address space before the .bss can be + * accessed. + */ + +#ifdef CONFIG_ADDRENV + ret = nxflat_addrenv_select(loadinfo); + if (ret < 0) + { + bdbg("ERROR: nxflat_addrenv_select() failed: %d\n", ret); + return ret; + } +#endif + + /* Zero the BSS area */ + + memset((void*)(loadinfo->dspace->region + loadinfo->datasize), 0, + loadinfo->bsssize); + + /* Restore the original address environment */ + +#ifdef CONFIG_ADDRENV + ret = nxflat_addrenv_restore(loadinfo); + if (ret < 0) + { + bdbg("ERROR: nxflat_addrenv_restore() failed: %d\n", ret); + } + + return ret; +#else + return OK; +#endif } /**************************************************************************** @@ -484,8 +599,7 @@ int nxflat_bind(FAR struct nxflat_loadinfo_s *loadinfo, * space in the loaded file. */ - memset((void*)(loadinfo->dspace->region + loadinfo->datasize), - 0, loadinfo->bsssize); + ret = nxflat_clearbss(loadinfo); } } diff --git a/nuttx/binfmt/libnxflat/libnxflat_load.c b/nuttx/binfmt/libnxflat/libnxflat_load.c index b6693ea36..5f13b577a 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_load.c +++ b/nuttx/binfmt/libnxflat/libnxflat_load.c @@ -41,6 +41,7 @@ #include #include + #include #include #include @@ -48,8 +49,11 @@ #include #include + #include +#include "libnxflat.h" + /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ @@ -143,7 +147,7 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo) */ loadinfo->ispace = (uint32_t)mmap(NULL, loadinfo->isize, PROT_READ, - MAP_SHARED|MAP_FILE, loadinfo->filfd, 0); + MAP_SHARED|MAP_FILE, loadinfo->filfd, 0); if (loadinfo->ispace == (uint32_t)MAP_FAILED) { bdbg("Failed to map NXFLAT ISpace: %d\n", errno); @@ -152,23 +156,37 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo) bvdbg("Mapped ISpace (%d bytes) at %08x\n", loadinfo->isize, loadinfo->ispace); - /* The following call will give a pointer to the allocated but - * uninitialized ISpace memory. + /* The following call allocate D-Space memory and will provide a pointer + * to the allocated (but still uninitialized) D-Space memory. */ - loadinfo->dspace = (struct dspace_s *)malloc(SIZEOF_DSPACE_S(loadinfo->dsize)); - if (loadinfo->dspace == 0) + ret = nxflat_addrenv_alloc(loadinfo, loadinfo->dsize); + if (ret < 0) { - bdbg("Failed to allocate DSpace\n"); - ret = -ENOMEM; - goto errout; + bdbg("ERROR: nxflat_addrenv_alloc() failed: %d\n", ret); + return ret; } - loadinfo->dspace->crefs = 1; - bvdbg("Allocated DSpace (%d bytes) at %p\n", loadinfo->dsize, loadinfo->dspace->region); + bvdbg("Allocated DSpace (%d bytes) at %p\n", + loadinfo->dsize, loadinfo->dspace->region); - /* Now, read the data into allocated DSpace at doffset into the - * allocated DSpace memory. + /* If CONFIG_ADDRENV=y, then the D-Space allocation lies in an address + * environment that may not be in place. So, in that case, we must call + * nxflat_addrenv_select to temporarily instantiate that address space + * it can be initialized. + */ + +#ifdef CONFIG_ADDRENV + ret = nxflat_addrenv_select(loadinfo); + if (ret < 0) + { + bdbg("ERROR: nxflat_addrenv_select() failed: %d\n", ret); + return ret; + } +#endif + + /* Now, read the data into allocated DSpace at doffset into the allocated + * DSpace memory. */ ret = nxflat_read(loadinfo, (char*)loadinfo->dspace->region, dreadsize, doffset); @@ -181,9 +199,23 @@ int nxflat_load(struct nxflat_loadinfo_s *loadinfo) bvdbg("TEXT: %08x Entry point offset: %08x Data offset: %08x\n", loadinfo->ispace, loadinfo->entryoffs, doffset); + /* Restore the original address environment */ + +#ifdef CONFIG_ADDRENV + ret = nxflat_addrenv_restore(loadinfo); + if (ret < 0) + { + bdbg("ERROR: nxflat_addrenv_restore() failed: %d\n", ret); + return ret; + } +#endif + return OK; errout: +#ifdef CONFIG_ADDRENV + (void)nxflat_addrenv_restore(loadinfo); +#endif (void)nxflat_unload(loadinfo); return ret; } diff --git a/nuttx/binfmt/libnxflat/libnxflat_unload.c b/nuttx/binfmt/libnxflat/libnxflat_unload.c index 47c30bd55..71d0c8499 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_unload.c +++ b/nuttx/binfmt/libnxflat/libnxflat_unload.c @@ -40,11 +40,15 @@ #include #include + #include #include +#include #include +#include "libnxflat.h" + /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ @@ -65,8 +69,9 @@ * Name: nxflat_unload * * Description: - * This function unloads the object from memory. This essentially - * undoes the actions of nxflat_load. + * This function unloads the object from memory. This essentially undoes + * the actions of nxflat_load. It is called only under certain error + * conditions after the the module has been loaded but not yet started. * * Returned Value: * 0 (OK) is returned on success and a negated errno is returned on @@ -76,9 +81,8 @@ int nxflat_unload(struct nxflat_loadinfo_s *loadinfo) { - /* Reset the contents of the info structure. */ - /* Release the memory segments */ + /* Release the I-Space mmap'ed file */ if (loadinfo->ispace) { @@ -86,12 +90,9 @@ int nxflat_unload(struct nxflat_loadinfo_s *loadinfo) loadinfo->ispace = 0; } - if (loadinfo->dspace) - { - free((void*)loadinfo->dspace); - loadinfo->dspace = 0; - } + /* Release the D-Space address environment */ + nxflat_addrenv_free(loadinfo); return OK; } diff --git a/nuttx/binfmt/nxflat.c b/nuttx/binfmt/nxflat.c index 5973a96a9..db29941ca 100644 --- a/nuttx/binfmt/nxflat.c +++ b/nuttx/binfmt/nxflat.c @@ -187,10 +187,31 @@ static int nxflat_loadbinary(struct binary_s *binp) binp->entrypt = (main_t)(loadinfo.ispace + loadinfo.entryoffs); binp->mapped = (void*)loadinfo.ispace; - binp->alloc[0] = (void*)loadinfo.dspace; binp->mapsize = loadinfo.isize; binp->stacksize = loadinfo.stacksize; + /* Add the ELF allocation to the alloc[] only if there is no address + * enironment. If there is an address environment, it will automatically + * be freed when the function exits + * + * REVISIT: If the module is loaded then unloaded, wouldn't this cause + * a memory leak? + */ + +#ifdef CONFIG_ADDRENV +# warning "REVISIT" +#else + binp->alloc[0] = (void*)loadinfo.dspace; +#endif + +#ifdef CONFIG_ADDRENV + /* Save the address environment. This will be needed when the module is + * executed for the up_addrenv_assign() call. + */ + + binp->addrenv = loadinfo.addrenv; +#endif + nxflat_dumpbuffer("Entry code", (FAR const uint8_t*)binp->entrypt, MIN(loadinfo.isize - loadinfo.entryoffs, 512)); diff --git a/nuttx/configs/eagle100/httpd/setenv.sh b/nuttx/configs/eagle100/httpd/setenv.sh index 9022695a4..d22bf6f91 100755 --- a/nuttx/configs/eagle100/httpd/setenv.sh +++ b/nuttx/configs/eagle100/httpd/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi - WD=`pwd` -export BUILDROOT_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" -export PATH="${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +#export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/nuttx/configs/eagle100/nettest/setenv.sh b/nuttx/configs/eagle100/nettest/setenv.sh index f03beff85..37cc7735c 100755 --- a/nuttx/configs/eagle100/nettest/setenv.sh +++ b/nuttx/configs/eagle100/nettest/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi - WD=`pwd` -export BUILDROOT_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" -export PATH="${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +#export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/nuttx/configs/eagle100/nsh/setenv.sh b/nuttx/configs/eagle100/nsh/setenv.sh index c64bfed54..cd8710503 100755 --- a/nuttx/configs/eagle100/nsh/setenv.sh +++ b/nuttx/configs/eagle100/nsh/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi - WD=`pwd` -export BUILDROOT_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" -export PATH="${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +#export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/nuttx/configs/eagle100/nxflat/setenv.sh b/nuttx/configs/eagle100/nxflat/setenv.sh index 2335de190..771be4ec6 100755 --- a/nuttx/configs/eagle100/nxflat/setenv.sh +++ b/nuttx/configs/eagle100/nxflat/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi - WD=`pwd` -export BUILDROOT_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" -export PATH="${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +#export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/nuttx/include/nuttx/binfmt/binfmt.h b/nuttx/include/nuttx/binfmt/binfmt.h index 2e2c6dda8..6df5190d2 100644 --- a/nuttx/include/nuttx/binfmt/binfmt.h +++ b/nuttx/include/nuttx/binfmt/binfmt.h @@ -41,8 +41,11 @@ ****************************************************************************/ #include + #include #include + +#include #include /**************************************************************************** @@ -93,12 +96,26 @@ struct binary_s main_t entrypt; /* Entry point into a program module */ FAR void *mapped; /* Memory-mapped, address space */ FAR void *alloc[BINFMT_NALLOC]; /* Allocated address spaces */ + + /* Constructors/destructors */ + #ifdef CONFIG_BINFMT_CONSTRUCTORS FAR binfmt_ctor_t *ctors; /* Pointer to a list of constructors */ FAR binfmt_dtor_t *dtors; /* Pointer to a list of destructors */ uint16_t nctors; /* Number of constructors in the list */ uint16_t ndtors; /* Number of destructors in the list */ #endif + + /* Address environment. + * + * addrenv - This is the handle created by up_addrenv_create() that can be + * used to manage the tasks address space. + */ + +#ifdef CONFIG_ADDRENV + task_addrenv_t addrenv; /* Task address environment */ +#endif + size_t mapsize; /* Size of the mapped address region (needed for munmap) */ size_t stacksize; /* Size of the stack in bytes (unallocated) */ }; diff --git a/nuttx/include/nuttx/binfmt/elf.h b/nuttx/include/nuttx/binfmt/elf.h index 432e57f0f..6b6851934 100644 --- a/nuttx/include/nuttx/binfmt/elf.h +++ b/nuttx/include/nuttx/binfmt/elf.h @@ -59,6 +59,18 @@ # define CONFIG_ELF_ALIGN_LOG2 2 #endif +#ifndef CONFIG_ELF_STACKSIZE +# define CONFIG_ELF_STACKSIZE 2048 +#endif + +#ifndef CONFIG_ELF_BUFFERSIZE +# define CONFIG_ELF_BUFFERSIZE 128 +#endif + +#ifndef CONFIG_ELF_BUFFERINCR +# define CONFIG_ELF_BUFFERINCR 32 +#endif + /* Allocation array size and indices */ #define LIBELF_ELF_ALLOC 0 @@ -80,8 +92,16 @@ struct elf_loadinfo_s { - /* The alloc[] array holds memory that persists after the ELF module has - * been loaded. + /* elfalloc is the base address of the memory that is allocated to hold the + * ELF program image. + * + * If CONFIG_ADDRENV=n, elfalloc will be allocated using kmalloc() (or + * kzalloc()). If CONFIG_ADDRENV-y, then elfalloc will be allocated using + * up_addrenv_create(). In either case, there will be a unique instance + * of elfalloc (and stack) for each instance of a process. + * + * The alloc[] array in struct binary_s will hold memory that persists after + * the ELF module has been loaded. */ uintptr_t elfalloc; /* Memory allocated when ELF file was loaded */ @@ -90,6 +110,9 @@ struct elf_loadinfo_s Elf32_Ehdr ehdr; /* Buffered ELF file header */ FAR Elf32_Shdr *shdr; /* Buffered ELF section headers */ uint8_t *iobuffer; /* File I/O buffer */ + + /* Constructors and destructors */ + #ifdef CONFIG_BINFMT_CONSTRUCTORS FAR void *ctoralloc; /* Memory allocated for ctors */ FAR void *dtoralloc; /* Memory allocated dtors */ @@ -98,6 +121,20 @@ struct elf_loadinfo_s uint16_t nctors; /* Number of constructors */ uint16_t ndtors; /* Number of destructors */ #endif + + /* Address environment. + * + * addrenv - This is the handle created by up_addrenv_create() that can be + * used to manage the tasks address space. + * oldenv - This is a value returned by up_addrenv_select() that must be + * used to restore the current hardware address environment. + */ + +#ifdef CONFIG_ADDRENV + task_addrenv_t addrenv; /* Task address environment */ + hw_addrenv_t oldenv; /* Saved hardware address environment */ +#endif + uint16_t symtabidx; /* Symbol table section index */ uint16_t strtabidx; /* String table section index */ uint16_t buflen; /* size of iobuffer[] */ @@ -187,8 +224,9 @@ EXTERN int elf_bind(FAR struct elf_loadinfo_s *loadinfo, * Name: elf_unload * * Description: - * This function unloads the object from memory. This essentially - * undoes the actions of elf_load. + * This function unloads the object from memory. This essentially undoes + * the actions of elf_load. It is called only under certain error + * conditions after the the module has been loaded but not yet started. * * Returned Value: * 0 (OK) is returned on success and a negated errno is returned on diff --git a/nuttx/include/nuttx/binfmt/nxflat.h b/nuttx/include/nuttx/binfmt/nxflat.h index 89e28fbcc..db396771b 100644 --- a/nuttx/include/nuttx/binfmt/nxflat.h +++ b/nuttx/include/nuttx/binfmt/nxflat.h @@ -44,7 +44,9 @@ #include #include + #include +#include /**************************************************************************** * Pre-processor Definitions @@ -61,17 +63,24 @@ struct nxflat_loadinfo_s { /* Instruction Space (ISpace): This region contains the nxflat file header - * plus everything from the text section. Ideally, will have only one mmap'ed - * text section instance in the system for each module. + * plus everything from the text section. + * + * The ISpace region is allocated using mmap() and, thus, can be shared by + * multiple tasks. Ideally, will have only one mmap'ed text section + * instance in the system for each module. */ - uint32_t ispace; /* Address where hdr/text is loaded */ + uintptr_t ispace; /* Address where hdr/text is loaded */ uint32_t entryoffs; /* Offset from ispace to entry point */ uint32_t isize; /* Size of ispace. */ - /* Data Space (DSpace): This region contains all information that in referenced - * as data (other than the stack which is separately allocated). There will be - * a unique instance of DSpace (and stack) for each instance of a process. + /* Data Space (DSpace): This region contains all information that is + * referenced as data (other than the stack which is separately allocated). + * + * If CONFIG_ADDRENV=n, DSpace will be allocated using kmalloc() (or + * kzalloc()). If CONFIG_ADDRENV-y, then DSpace will be allocated using + * up_addrenv_create(). In either case, there will be a unique instance + * of DSpace (and stack) for each instance of a process. */ struct dspace_s *dspace; /* Allocated D-Space (data/bss/etc) */ @@ -85,6 +94,19 @@ struct nxflat_loadinfo_s uint32_t relocstart; /* Start of array of struct flat_reloc */ uint16_t reloccount; /* Number of elements in reloc array */ + /* Address environment. + * + * addrenv - This is the handle created by up_addrenv_create() that can be + * used to manage the tasks address space. + * oldenv - This is a value returned by up_addrenv_select() that must be + * used to restore the current hardware address environment. + */ + +#ifdef CONFIG_ADDRENV + task_addrenv_t addrenv; /* Task address environment */ + hw_addrenv_t oldenv; /* Saved hardware address environment */ +#endif + /* File descriptors */ int filfd; /* Descriptor for the file being loaded */ @@ -212,8 +234,9 @@ EXTERN int nxflat_bind(FAR struct nxflat_loadinfo_s *loadinfo, * Name: nxflat_unload * * Description: - * This function unloads the object from memory. This essentially - * undoes the actions of nxflat_load. + * This function unloads the object from memory. This essentially undoes + * the actions of nxflat_load. It is called only under certain error + * conditions after the the module has been loaded but not yet started. * * Returned Value: * 0 (OK) is returned on success and a negated errno is returned on diff --git a/nuttx/include/nuttx/sched.h b/nuttx/include/nuttx/sched.h index 172f46901..6eaba6e9c 100644 --- a/nuttx/include/nuttx/sched.h +++ b/nuttx/include/nuttx/sched.h @@ -163,24 +163,40 @@ typedef struct environ_s environ_t; # define SIZEOF_ENVIRON_T(alloc) (sizeof(environ_t) + alloc - 1) #endif -/* This structure describes a reference counted D-Space region */ +/* This structure describes a reference counted D-Space region. This must be a + * separately allocated "break-away" structure that can be owned by a task and + * any pthreads created by the task. + */ +#ifdef CONFIG_PIC struct dspace_s { - uint32_t crefs; /* This is the number of pthreads that shared the - * the same D-Space */ - uint8_t region[1]; /* Beginning of the allocated region */ -}; + /* The life of the structure allocation is determined by this reference + * count. This count is number of threads that shared the the same D-Space. + * This includes the parent task as well as any pthreads created by the + * parent task or any of its child threads. + */ + + uint16_t crefs; -#define SIZEOF_DSPACE_S(n) (sizeof(struct dspace_s) - 1 + (n)) + /* This is the allocated D-Space memory region. This may be a physical + * address allocated with kmalloc(), or it may be virtual address associated + * with an address environment (if CONFIG_ADDRENV=y). + */ -/* This is the task control block (TCB) */ + FAR uint8_t *region; +}; +#endif + +/* This is the task control block (TCB). Each task or thread is represented by + * a TCB. The TCB is the heart of the NuttX task-control logic. + */ struct _TCB { /* Fields used to support list management *************************************/ - FAR struct _TCB *flink; /* link in DQ of TCBs */ + FAR struct _TCB *flink; /* Doubly linked list */ FAR struct _TCB *blink; /* Task Management Fields *****************************************************/ -- cgit v1.2.3 From 272fc3b5233e6d3c9e4d9c32a67511868f2c1a9a Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 19 Dec 2012 21:16:03 +0000 Subject: Some minor fixes for CONFIG_ADDRENV=y git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5444 42af7a65-404d-4744-a932-0658087f49c3 --- apps/ChangeLog.txt | 5 +++- apps/examples/elf/elf_main.c | 41 +++++++++++++++++++++++++++--- apps/examples/nxflat/nxflat_main.c | 41 +++++++++++++++++++++++++++--- nuttx/binfmt/binfmt_unloadmodule.c | 2 +- nuttx/binfmt/libnxflat/libnxflat_addrenv.c | 1 + nuttx/binfmt/libnxflat/libnxflat_bind.c | 9 ++++++- nuttx/binfmt/libnxflat/libnxflat_unload.c | 1 - 7 files changed, 90 insertions(+), 10 deletions(-) (limited to 'nuttx') diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index d6e5de3c1..e9eaf0a83 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -429,4 +429,7 @@ * Rename CONFIG_PCODE and CONFIG_FICL as CONFIG_INTERPRETERS_PCODE and CONFIG_INTERPRETERS_FICL for consistency with other configuration naming. * apps/examples/keypadtest: A keypad test example contributed by Denis - Carikli \ No newline at end of file + Carikli. + * apps/examples/elf and nxflat: If CONFIG_BINFMT_EXEPATH is defined, these + tests will now use a relative path to the program and expect the binfmt/ + logic to find the absolute path to the program using the PATH variable. diff --git a/apps/examples/elf/elf_main.c b/apps/examples/elf/elf_main.c index 669de430d..66a47592c 100644 --- a/apps/examples/elf/elf_main.c +++ b/apps/examples/elf/elf_main.c @@ -70,6 +70,10 @@ # error "You must provide file descriptors via CONFIG_NFILE_DESCRIPTORS in your configuration file" #endif +#ifdef CONFIG_BINFMT_DISABLE +# error "The binary loader is disabled (CONFIG_BINFMT_DISABLE)!" +#endif + #ifndef CONFIG_ELF # error "You must select CONFIG_ELF in your configuration file" #endif @@ -136,7 +140,9 @@ static unsigned int g_mmstep; /* Memory Usage at beginning of test step */ static const char delimiter[] = "****************************************************************************"; -static char path[128]; +#ifndef CONFIG_BINFMT_EXEPATH +static char fullpath[128]; +#endif /**************************************************************************** * Symbols from Auto-Generated Code @@ -264,19 +270,46 @@ int elf_main(int argc, char *argv[]) mm_update(&g_mmstep, "after mount"); + /* Does the system support the PATH variable? Has the PATH variable + * already been set? If YES and NO, then set the PATH variable to + * the ROMFS mountpoint. + */ + +#if defined(CONFIG_BINFMT_EXEPATH) && !defined(CONFIG_PATH_INITIAL) + (void)setenv("PATH", MOUNTPT, 1); +#endif + /* Now excercise every program in the ROMFS file system */ for (i = 0; dirlist[i]; i++) { + /* Output a seperated so that we can clearly discrinmate the output of + * this program from the others. + */ + testheader(dirlist[i]); + /* Initialize the binary_s structure */ + memset(&bin, 0, sizeof(struct binary_s)); - snprintf(path, 128, "%s/%s", MOUNTPT, dirlist[i]); - bin.filename = path; + /* If the binary loader does not support the PATH variable, then + * create the full path to the executable program. Otherwise, + * use the relative path so that the binary loader will have to + * search the PATH variable to find the executable. + */ + +#ifdef CONFIG_BINFMT_EXEPATH + bin.filename = dirlist[i]; +#else + snprintf(fullpath, 128, "%s/%s", MOUNTPT, dirlist[i]); + bin.filename = fullpath; +#endif bin.exports = exports; bin.nexports = nexports; + /* Load the ELF module */ + ret = load_module(&bin); if (ret < 0) { @@ -286,6 +319,8 @@ int elf_main(int argc, char *argv[]) mm_update(&g_mmstep, "after load_module"); + /* Execute the ELF module */ + ret = exec_module(&bin, 50); mm_update(&g_mmstep, "after exec_module"); diff --git a/apps/examples/nxflat/nxflat_main.c b/apps/examples/nxflat/nxflat_main.c index 638e960a0..536bc1dd8 100644 --- a/apps/examples/nxflat/nxflat_main.c +++ b/apps/examples/nxflat/nxflat_main.c @@ -69,6 +69,10 @@ # error "You must provide file descriptors via CONFIG_NFILE_DESCRIPTORS in your configuration file" #endif +#ifdef CONFIG_BINFMT_DISABLE +# error "The binary loader is disabled (CONFIG_BINFMT_DISABLE)!" +#endif + #ifndef CONFIG_NXFLAT # error "You must select CONFIG_NXFLAT in your configuration file" #endif @@ -125,7 +129,9 @@ static const char delimiter[] = "****************************************************************************"; -static char path[128]; +#ifndef CONFIG_BINFMT_EXEPATH +static char fullpath[128]; +#endif /**************************************************************************** * Private Functions @@ -188,19 +194,46 @@ int nxflat_main(int argc, char *argv[]) nxflat_uninitialize(); } + /* Does the system support the PATH variable? Has the PATH variable + * already been set? If YES and NO, then set the PATH variable to + * the ROMFS mountpoint. + */ + +#if defined(CONFIG_BINFMT_EXEPATH) && !defined(CONFIG_PATH_INITIAL) + (void)setenv("PATH", MOUNTPT, 1); +#endif + /* Now excercise every progrm in the ROMFS file system */ for (i = 0; dirlist[i]; i++) { + /* Output a seperated so that we can clearly discrinmate the output of + * this program from the others. + */ + testheader(dirlist[i]); + /* Initialize the binary_s structure */ + memset(&bin, 0, sizeof(struct binary_s)); - snprintf(path, 128, "%s/%s", MOUNTPT, dirlist[i]); - bin.filename = path; + /* If the binary loader does not support the PATH variable, then + * create the full path to the executable program. Otherwise, + * use the relative path so that the binary loader will have to + * search the PATH variable to find the executable. + */ + +#ifdef CONFIG_BINFMT_EXEPATH + bin.filename = dirlist[i]; +#else + snprintf(fullpath, 128, "%s/%s", MOUNTPT, dirlist[i]); + bin.filename = fullpath; +#endif bin.exports = exports; bin.nexports = NEXPORTS; + /* Load the NXFLAT module */ + ret = load_module(&bin); if (ret < 0) { @@ -208,6 +241,8 @@ int nxflat_main(int argc, char *argv[]) exit(1); } + /* Execute the ELF module */ + ret = exec_module(&bin, 50); if (ret < 0) { diff --git a/nuttx/binfmt/binfmt_unloadmodule.c b/nuttx/binfmt/binfmt_unloadmodule.c index a0050481c..a03b98d6c 100644 --- a/nuttx/binfmt/binfmt_unloadmodule.c +++ b/nuttx/binfmt/binfmt_unloadmodule.c @@ -183,7 +183,7 @@ int unload_module(FAR const struct binary_s *binp) if (binp->alloc[i]) { bvdbg("Freeing alloc[%d]: %p\n", i, binp->alloc[i]); - free(binp->alloc[i]); + free((FAR void *)binp->alloc[i]); } } diff --git a/nuttx/binfmt/libnxflat/libnxflat_addrenv.c b/nuttx/binfmt/libnxflat/libnxflat_addrenv.c index c6b3fce34..233713ccd 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_addrenv.c +++ b/nuttx/binfmt/libnxflat/libnxflat_addrenv.c @@ -39,6 +39,7 @@ #include +#include #include #include diff --git a/nuttx/binfmt/libnxflat/libnxflat_bind.c b/nuttx/binfmt/libnxflat/libnxflat_bind.c index 3a86d5355..816810a46 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_bind.c +++ b/nuttx/binfmt/libnxflat/libnxflat_bind.c @@ -38,6 +38,7 @@ ****************************************************************************/ #include +#include #include #include @@ -248,7 +249,7 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo) DEBUGASSERT(offset + nrelocs * sizeof(struct nxflat_reloc_s) <= (loadinfo->isize + loadinfo->dsize)); - relocs = (FAR struct nxflat_reloc_s*) + relocs = (FAR struct nxflat_reloc_s *) (offset - loadinfo->isize + loadinfo->dspace->region); bvdbg("isize: %08lx dpsace: %p relocs: %p\n", (long)loadinfo->isize, loadinfo->dspace->region, relocs); @@ -276,7 +277,13 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo) { /* Handle the relocation by the relocation type */ +#ifdef CONFIG_CAN_PASS_STRUCTS reloc = *relocs++; +#else + memcpy(&reloc, relocs, sizeof(struct nxflat_reloc_s)); + relocs++; +#endif + result = OK; switch (NXFLAT_RELOC_TYPE(reloc.r_info)) { diff --git a/nuttx/binfmt/libnxflat/libnxflat_unload.c b/nuttx/binfmt/libnxflat/libnxflat_unload.c index 71d0c8499..eb1aa0343 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_unload.c +++ b/nuttx/binfmt/libnxflat/libnxflat_unload.c @@ -95,4 +95,3 @@ int nxflat_unload(struct nxflat_loadinfo_s *loadinfo) nxflat_addrenv_free(loadinfo); return OK; } - -- cgit v1.2.3 From db3e7613bce907bab90a64c297ec420f3b35f7ce Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 19 Dec 2012 22:18:30 +0000 Subject: Verify PATH variable in apps/examples/elf git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5445 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 2 + nuttx/arch/arm/Kconfig | 1 + nuttx/binfmt/binfmt_exepath.c | 1 + nuttx/binfmt/binfmt_loadmodule.c | 6 +-- nuttx/binfmt/binfmt_unloadmodule.c | 2 +- nuttx/binfmt/libelf/libelf_addrenv.c | 4 +- nuttx/binfmt/libnxflat/libnxflat_addrenv.c | 4 +- nuttx/configs/stm32f4discovery/elf/defconfig | 70 ++++++++++++++++++++++------ 8 files changed, 68 insertions(+), 22 deletions(-) (limited to 'nuttx') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 1296076b6..cda6eb947 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3799,3 +3799,5 @@ address environment interfaces. If CONFIG_ADDRENV=y, then binfmt/ will now create an address environment for new tasks (instead of just malloc'ing the task memory). + * configs/stm32f4discovery/elf: Enable support/test of the PATH + to find executables using a relative path. diff --git a/nuttx/arch/arm/Kconfig b/nuttx/arch/arm/Kconfig index 9fa73782d..4fce8efbf 100644 --- a/nuttx/arch/arm/Kconfig +++ b/nuttx/arch/arm/Kconfig @@ -111,6 +111,7 @@ config ARCH_CHIP_STM32 select ARCH_HAVE_CMNVECTOR select ARCH_HAVE_MPU select ARCH_HAVE_I2CRESET + select ARCH_IRQPRIO ---help--- STMicro STM32 architectures (ARM Cortex-M3/4). diff --git a/nuttx/binfmt/binfmt_exepath.c b/nuttx/binfmt/binfmt_exepath.c index 24903e26d..4fd7ad918 100644 --- a/nuttx/binfmt/binfmt_exepath.c +++ b/nuttx/binfmt/binfmt_exepath.c @@ -42,6 +42,7 @@ #include #include +#include #include #include #include diff --git a/nuttx/binfmt/binfmt_loadmodule.c b/nuttx/binfmt/binfmt_loadmodule.c index 8a691edc7..112a6b35b 100644 --- a/nuttx/binfmt/binfmt_loadmodule.c +++ b/nuttx/binfmt/binfmt_loadmodule.c @@ -146,11 +146,11 @@ int load_module(FAR struct binary_s *bin) #endif { /* Were we given a relative path? Or an absolute path to the file to - * be loaded. + * be loaded? Absolute paths start with '/'. */ #ifdef CONFIG_BINFMT_EXEPATH - if (bin->filename[0] == '/') + if (bin->filename[0] != '/') { FAR const char *relpath; FAR char *fullpath; @@ -168,7 +168,7 @@ int load_module(FAR struct binary_s *bin) { /* Get the next absolute file path */ - while ((fullpath = exepath_next(handle, relpath))) + while ((fullpath = exepath_next(handle, relpath)) != NULL) { /* Try to load the file at this path */ diff --git a/nuttx/binfmt/binfmt_unloadmodule.c b/nuttx/binfmt/binfmt_unloadmodule.c index a03b98d6c..365f26a34 100644 --- a/nuttx/binfmt/binfmt_unloadmodule.c +++ b/nuttx/binfmt/binfmt_unloadmodule.c @@ -83,7 +83,7 @@ ****************************************************************************/ #ifdef CONFIG_BINFMT_CONSTRUCTORS -static inline void exec_dtors(FAR const struct binary_s *binp) +static inline int exec_dtors(FAR const struct binary_s *binp) { binfmt_dtor_t *dtor = binp->dtors; #ifdef CONFIG_ADDRENV diff --git a/nuttx/binfmt/libelf/libelf_addrenv.c b/nuttx/binfmt/libelf/libelf_addrenv.c index 28cc0e108..193062a54 100644 --- a/nuttx/binfmt/libelf/libelf_addrenv.c +++ b/nuttx/binfmt/libelf/libelf_addrenv.c @@ -64,7 +64,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: elf_addrenv_create + * Name: elf_addrenv_alloc * * Description: * Allocate memory for the ELF image (elfalloc). If CONFIG_ADDRENV=n, @@ -83,7 +83,7 @@ * ****************************************************************************/ -int elf_addrenv_create(FAR struct elf_loadinfo_s *loadinfo, size_t envsize) +int elf_addrenv_alloc(FAR struct elf_loadinfo_s *loadinfo, size_t envsize) { #ifdef CONFIG_ADDRENV FAR void *vaddr; diff --git a/nuttx/binfmt/libnxflat/libnxflat_addrenv.c b/nuttx/binfmt/libnxflat/libnxflat_addrenv.c index 233713ccd..2d9255b28 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_addrenv.c +++ b/nuttx/binfmt/libnxflat/libnxflat_addrenv.c @@ -65,7 +65,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: nxflat_addrenv_create + * Name: nxflat_addrenv_alloc * * Description: * Allocate memory for the ELF image (elfalloc). If CONFIG_ADDRENV=n, @@ -84,7 +84,7 @@ * ****************************************************************************/ -int nxflat_addrenv_create(FAR struct nxflat_loadinfo_s *loadinfo, size_t envsize) +int nxflat_addrenv_alloc(FAR struct nxflat_loadinfo_s *loadinfo, size_t envsize) { FAR struct dspace_s *dspace; #ifdef CONFIG_ADDRENV diff --git a/nuttx/configs/stm32f4discovery/elf/defconfig b/nuttx/configs/stm32f4discovery/elf/defconfig index b6c3ac593..9379c885b 100644 --- a/nuttx/configs/stm32f4discovery/elf/defconfig +++ b/nuttx/configs/stm32f4discovery/elf/defconfig @@ -8,6 +8,14 @@ CONFIG_NUTTX_NEWCONFIG=y # Build Setup # # CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_LINUX is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +# CONFIG_WINDOWS_NATIVE is not set +CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set # # Build Configuration @@ -73,12 +81,24 @@ CONFIG_ARCH_CHIP_STM32=y CONFIG_ARCH_CORTEXM4=y CONFIG_ARCH_FAMILY="armv7-m" CONFIG_ARCH_CHIP="stm32" +CONFIG_ARCH_HAVE_CMNVECTOR=y +# CONFIG_ARMV7M_CMNVECTOR is not set # CONFIG_ARCH_FPU is not set CONFIG_ARCH_HAVE_MPU=y # CONFIG_ARMV7M_MPU is not set -CONFIG_ARCH_IRQPRIO=y CONFIG_BOARD_LOOPSPERMSEC=16717 # CONFIG_ARCH_CALIBRATION is not set + +# +# ARMV7M Configuration Options +# +# CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC is not set +# CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODEREDW is not set +CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y +# CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM is not set +# CONFIG_ARMV7M_TOOLCHAIN_GNU_EABI is not set +# CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE is not set # CONFIG_SERIAL_TERMIOS is not set # @@ -88,8 +108,14 @@ CONFIG_BOARD_LOOPSPERMSEC=16717 # CONFIG_ARCH_CHIP_STM32F100CB is not set # CONFIG_ARCH_CHIP_STM32F100R8 is not set # CONFIG_ARCH_CHIP_STM32F100RB is not set +# CONFIG_ARCH_CHIP_STM32F100RC is not set +# CONFIG_ARCH_CHIP_STM32F100RD is not set +# CONFIG_ARCH_CHIP_STM32F100RE is not set # CONFIG_ARCH_CHIP_STM32F100V8 is not set # CONFIG_ARCH_CHIP_STM32F100VB is not set +# CONFIG_ARCH_CHIP_STM32F100VC is not set +# CONFIG_ARCH_CHIP_STM32F100VD is not set +# CONFIG_ARCH_CHIP_STM32F100VE is not set # CONFIG_ARCH_CHIP_STM32F103RET6 is not set # CONFIG_ARCH_CHIP_STM32F103VCT6 is not set # CONFIG_ARCH_CHIP_STM32F103VET6 is not set @@ -107,13 +133,6 @@ CONFIG_ARCH_CHIP_STM32F407VG=y # CONFIG_ARCH_CHIP_STM32F407IE is not set # CONFIG_ARCH_CHIP_STM32F407IG is not set CONFIG_STM32_STM32F40XX=y -CONFIG_STM32_CODESOURCERYW=y -# CONFIG_STM32_CODESOURCERYL is not set -# CONFIG_STM32_ATOLLIC_LITE is not set -# CONFIG_STM32_ATOLLIC_PRO is not set -# CONFIG_STM32_DEVKITARM is not set -# CONFIG_STM32_RAISONANCE is not set -# CONFIG_STM32_BUILDROOT is not set # CONFIG_STM32_DFU is not set # @@ -122,14 +141,14 @@ CONFIG_STM32_CODESOURCERYW=y # CONFIG_STM32_ADC1 is not set # CONFIG_STM32_ADC2 is not set # CONFIG_STM32_ADC3 is not set -# CONFIG_STM32_CRC is not set -# CONFIG_STM32_DMA1 is not set -# CONFIG_STM32_DMA2 is not set # CONFIG_STM32_BKPSRAM is not set # CONFIG_STM32_CAN1 is not set # CONFIG_STM32_CAN2 is not set # CONFIG_STM32_CCMDATARAM is not set +# CONFIG_STM32_CRC is not set # CONFIG_STM32_CRYP is not set +# CONFIG_STM32_DMA1 is not set +# CONFIG_STM32_DMA2 is not set # CONFIG_STM32_DAC1 is not set # CONFIG_STM32_DAC2 is not set # CONFIG_STM32_DCMI is not set @@ -174,6 +193,7 @@ CONFIG_STM32_USART2=y # # Alternate Pin Mapping # +# CONFIG_STM32_FLASH_PREFETCH is not set # CONFIG_STM32_JTAG_DISABLE is not set # CONFIG_STM32_JTAG_FULL_ENABLE is not set # CONFIG_STM32_JTAG_NOJNTRST_ENABLE is not set @@ -182,6 +202,11 @@ CONFIG_STM32_JTAG_SW_ENABLE=y # CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set CONFIG_STM32_CCMEXCLUDE=y +# +# U[S]ART Configuration +# +# CONFIG_USART2_RS485 is not set + # # USB Host Configuration # @@ -191,7 +216,11 @@ CONFIG_STM32_CCMEXCLUDE=y # # CONFIG_ARCH_NOINTC is not set # CONFIG_ARCH_DMA is not set +CONFIG_ARCH_IRQPRIO=y +# CONFIG_CUSTOM_STACK is not set +# CONFIG_ADDRENV is not set CONFIG_ARCH_STACKDUMP=y +# CONFIG_ENDIAN_BIG is not set # # Board Settings @@ -280,7 +309,6 @@ CONFIG_PREALLOC_TIMERS=4 # # Stack and heap information # -# CONFIG_CUSTOM_STACK is not set CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 @@ -316,8 +344,6 @@ CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y -CONFIG_STANDARD_SERIAL=y -CONFIG_CONFIG_SERIAL_NPOLLWAITERS=2 CONFIG_USART2_SERIAL_CONSOLE=y # CONFIG_NO_SERIAL_CONSOLE is not set @@ -381,12 +407,15 @@ CONFIG_MM_REGIONS=2 # Binary Formats # # CONFIG_BINFMT_DISABLE is not set +CONFIG_BINFMT_EXEPATH=y +CONFIG_PATH_INITIAL="/mnt/romfs" # CONFIG_NXFLAT is not set CONFIG_ELF=y CONFIG_ELF_ALIGN_LOG2=2 CONFIG_ELF_STACKSIZE=2048 CONFIG_ELF_BUFFERSIZE=128 CONFIG_ELF_BUFFERINCR=32 +# CONFIG_PIC is not set CONFIG_BINFMT_CONSTRUCTORS=y CONFIG_SYMTAB_ORDEREDBYNAME=y @@ -410,10 +439,20 @@ CONFIG_ARCH_LOWPUTC=y CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_C99_BOOL8 is not set CONFIG_HAVE_CXX=y # CONFIG_HAVE_CXXINITIALIZE is not set # CONFIG_CXX_NEWLONG is not set +# +# uClibc++ Standard C++ Library +# +# CONFIG_UCLIBCXX is not set + # # Application Configuration # @@ -430,6 +469,7 @@ CONFIG_HAVE_CXX=y # CONFIG_EXAMPLES_CAN is not set # CONFIG_EXAMPLES_CDCACM is not set # CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_CXXTEST is not set # CONFIG_EXAMPLES_DHCPD is not set CONFIG_EXAMPLES_ELF=y CONFIG_EXAMPLES_ELF_DEVMINOR=0 @@ -440,6 +480,7 @@ CONFIG_EXAMPLES_ELF_DEVPATH="/dev/ram0" # CONFIG_EXAMPLES_HELLOXX is not set # CONFIG_EXAMPLES_JSON is not set # CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set # CONFIG_EXAMPLES_IGMP is not set # CONFIG_EXAMPLES_LCDRW is not set # CONFIG_EXAMPLES_MM is not set @@ -494,6 +535,7 @@ CONFIG_EXAMPLES_ELF_DEVPATH="/dev/ram0" # # Networking Utilities # +# CONFIG_NETUTILS_CODECS is not set # CONFIG_NETUTILS_DHCPC is not set # CONFIG_NETUTILS_DHCPD is not set # CONFIG_NETUTILS_FTPC is not set -- cgit v1.2.3 From c2a284d25ef6dfd127ffebc574e43b113afe81de Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 20 Dec 2012 14:08:21 +0000 Subject: Fix make export target git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5446 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/TODO | 44 +++++++++++++++++++++++++++++++++++++++++++- nuttx/tools/Makefile.export | 8 +++++++- 2 files changed, 50 insertions(+), 2 deletions(-) (limited to 'nuttx') diff --git a/nuttx/TODO b/nuttx/TODO index 85a89b41f..6c28bfd43 100644 --- a/nuttx/TODO +++ b/nuttx/TODO @@ -20,7 +20,7 @@ nuttx/ (5) Graphics subystem (graphics/) (1) Pascal add-on (pcode/) (1) Documentation (Documentation/) - (6) Build system / Toolchains + (8) Build system / Toolchains (5) Linux/Cywgin simulation (arch/sim) (6) ARM (arch/arm/) (1) ARM/C5471 (arch/arm/src/c5471/) @@ -974,6 +974,48 @@ o Build system Priority: Low -- the kernel build configuration is not fully fielded yet. + Title: mconf NOT AVAILABLE IN NATIVE WINDOWS BUILD + Description: NuttX is migrating to the use of the kconfig-frontends mconf + tool for all configurations. In NuttX 6.24, support for native + Windows builds was added. However, the mconf tool does not + build to run natively under Windows. + + Some effort was spent trying to get a clean mconf build under + Windows. This is documented in the message thread beginning + here: http://tech.groups.yahoo.com/group/nuttx/message/2900. + The build was successfully completed using: MinGW-GCC, MSYS, + additional Windows libraries, and additional MSYS libraries + (MSYS is a variant of Cygwin so, presumeably, Cygwin could + have been used as well). However, on final testing, it was + found that there are problems with text and numeric entry: + http://tech.groups.yahoo.com/group/nuttx/message/2953. This + was considered a show stopper and the changs were not checked + in. + + Options: (1) Use conf (not mconf). confis the text-only + configuration tool, (2) fix mconf, (3) write another variant + of the configuration tool for windows, or (4) do all configuration + under Cygwin or MSYS. I am doing (4) now, but this is very + awkward because I have to set the apps path to ../apps (vs + ..\apps) and CONFIG_WINDOWS_NATIVE=n for the 'make menuconfig' + to run error free under windows. Very awkward! + Status: Open, there are some workarounds, but none are good. + Priority: High + + Title: configure.sh NOT AVAILABLE IN NATIVE WINDOWS BUILD + Description: configure.sh is a Bash script and cannot be used from a Windows + CMD.exe window. I started a configure.bat script, but I do + not have the batch file programming skills to duplicate some + of the more complex operations. + + I also considered adding a configure.c file that could be + compiled and then executed by configure.bat (and configure.sh?). + But I have not gone down that path yet. + + The current work-around is to configure under Cygwin. + Status: Open + Priority: High + o Linux/Cywgin simulation (arch/sim) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/tools/Makefile.export b/nuttx/tools/Makefile.export index 95a33b779..002cb526b 100644 --- a/nuttx/tools/Makefile.export +++ b/nuttx/tools/Makefile.export @@ -37,10 +37,16 @@ include $(TOPDIR)/.config include $(EXPORTDIR)/Make.defs ifdef ARCHSCRIPT -LDPATH = ${shell echo "$(ARCHSCRIPT)" | sed -e "s/^-T[ ]*//g"} +ifeq ($(WINTOOL),y) +LDPATH = ${shell cygpath -u $(patsubst -T,,$(ARCHSCRIPT))} +else +LDPATH = $(patsubst -T,,$(ARCHSCRIPT)) +endif + LDNAME = ${shell basename ${LDPATH}} LDDIR = ${shell dirname ${LDPATH}} endif + ARCHSUBDIR = "arch/$(CONFIG_ARCH)/src" ARCHDIR ="$(TOPDIR)/$(ARCHSUBDIR)" -- cgit v1.2.3 From 0f2decb70f505b108999fcdb80e89d7aae6760ce Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 20 Dec 2012 20:22:21 +0000 Subject: Prep for release 6.24 git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5447 42af7a65-404d-4744-a932-0658087f49c3 --- NxWidgets/ChangeLog.txt | 6 +- NxWidgets/ReleaseNotes.txt | 38 +- apps/ChangeLog.txt | 6 +- nuttx/ChangeLog | 42 +-- nuttx/Documentation/NuttX.html | 809 ++++++++++++++++++++++++++++------------- nuttx/ReleaseNotes | 195 +++++++++- 6 files changed, 812 insertions(+), 284 deletions(-) (limited to 'nuttx') diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt index 7f7b21247..df9fb2d41 100644 --- a/NxWidgets/ChangeLog.txt +++ b/NxWidgets/ChangeLog.txt @@ -171,7 +171,7 @@ * Kconfig: Add option to turn on the memory monitor feature of the NxWidgets/NxWM unit tests. -1.4 2012-xx-xx Gregory Nutt +1.4 2012-12-20 Gregory Nutt * libnxwidgets/Makefile, NxWidgets/nxwm/Makefile, and NxWidgets/UnitTests/nxwm/Makefile: Makefile improvements from @@ -206,7 +206,7 @@ Contributed by Petteri, Aimonen. * NxWM::CStartWindow: Fix mq_receive error handling with signal is recieved. From Petteri Aimonen. -* NxWidgets:CNxTimer: Replace the original (apparently non-functional) signal- +* NxWidgets::CNxTimer: Replace the original (apparently non-functional) signal- based solution with a work queue-based solution. This raises some isses about using the internal work queues from user space. I have decided to implemented user-space work queues (someday) in order to accomplish that functionaliy. @@ -218,3 +218,5 @@ Contributed by Petteri Aimonen. * NxWidgets::CNxWidgets and NxWM::CStartWindow: Small changes to make sub- classing easier (from Petteri Aimonen). + +1.5 2013-xx-xx Gregory Nutt diff --git a/NxWidgets/ReleaseNotes.txt b/NxWidgets/ReleaseNotes.txt index 7d3fb7aaa..4b155c50e 100644 --- a/NxWidgets/ReleaseNotes.txt +++ b/NxWidgets/ReleaseNotes.txt @@ -9,7 +9,7 @@ features have been fully verified). NxWidgets-1.1 ============= -The 2nd release of the NxWidgets package as made on May 19, 2012. The +The 2nd release of the NxWidgets package was made on May 19, 2012. The headline new feature in this release is: * NxWM, the tiny window manager based on NX and NxWidgets. NxWM is true @@ -69,7 +69,7 @@ Bug fixes include changes to the following (see the ChangeLog for details): NxWidgets-1.2 ============= -The 3rd release of the NxWidgets package as made on June 15, 2012. This +The 3rd release of the NxWidgets package was made on June 15, 2012. This release depends on NuttX-6.19 or above and should not be used with older NuttX releases. @@ -100,7 +100,7 @@ As well as other, less critical bugs (see the ChangeLog for details) NxWidgets-1.3 ============= -The 4th release of the NxWidgets package as made on September 29, 2012. This +The 4th release of the NxWidgets package was made on September 29, 2012. This release depends on NuttX-6.22 or above and should not be used with older NuttX releases. @@ -112,3 +112,35 @@ of NuttX. These comptibility changes include: * Build system changes * Changes needed for the NuttX configuration tool +NxWidgets-1.4 +============= + +The 5th release of the NxWidgets package was made on December 20, 2012. This +release depends on NuttX-6.22 or above and should not be used with older +NuttX releases. This release corresponds to SVN revision r5447. + +Note: Nearly all changes between 1.3 and 1.4 were the result of the efforts +of Petteri Aimonen. + +Additional new features and extended functionality in Version 1.4: + +* NxWdigets::CNxServer: Reduce start-up delay +* NxWM::CApplicationWindow: Option to eliminate minimize button. +* NxWM::CTaskbar: Option to eliminte the background image; highlight current + icon in the task bar. +* NxWidgets::CNumericEdit: New widget. Basically a CLabel with +/- buttons. +* NxWidgets::CNxTimer: Replace the original signal-based solution with a + work queue-based solution. This raises some isses about using the + internal work queues from user space. +* Build System: Misc improvements. +* Tools: bitmap_converter.py will convert images to NxWidgets RLE-encoded format. + +Bugfixes (see the change log for details). Some of these are very important +(marked *critical*): + +* NxWidgets::CCallback: Misplaced #endif +* NxWM::CCalculator and NxWM::CStartWindow: Add forward declaration for icon images. +* glych_cycle: Correct width, destructor needs to be public. +* NxWidgets:CText and NxWidgets:CNumericEdite: Fix some memory freeing bugs +* NxWidgets::CScrollingPanel: It is borderless for now because there was no + easy way to redraw only the required part of the border. diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index e9eaf0a83..0695747f8 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -406,7 +406,7 @@ supports setting IP addresses, network masks, name server addresses, and hardware address (from Darcy Gong). -6.24 2012-xx-xx Gregory Nutt +6.24 2012-12-20 Gregory Nutt * apps/examples/ostest/roundrobin.c: Replace large tables with algorithmic prime number generation. This allows the roundrobin @@ -424,7 +424,7 @@ * apps/examples/relays/Makefile: Reduced stack requirement (Darcy Gong). * apps/nshlib and apps/netutils/dhcpc: Extend the NSH ifconfig command plus various DHCPC improvements(Darcy Gong). - * apps/nshlib/nsh_apps.c: Fix compilation errors whenCONFIG_NSH_DISABLEBG=y. + * apps/nshlib/nsh_apps.c: Fix compilation errors when CONFIG_NSH_DISABLEBG=y. From Freddie Chopin. * Rename CONFIG_PCODE and CONFIG_FICL as CONFIG_INTERPRETERS_PCODE and CONFIG_INTERPRETERS_FICL for consistency with other configuration naming. @@ -433,3 +433,5 @@ * apps/examples/elf and nxflat: If CONFIG_BINFMT_EXEPATH is defined, these tests will now use a relative path to the program and expect the binfmt/ logic to find the absolute path to the program using the PATH variable. + +6.25 2013-xx-xx Gregory Nutt diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index cda6eb947..ed1cf39dc 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3538,7 +3538,7 @@ * binfmt/libelf: The ELF loader is working correctly with C++ static constructors and destructors and all. * Documentation/NuttXBinfmt.html: Add documentation of the binary loader. - * configs/sim/ostest: Converted to use the mconfig configuration tool. + * configs/sim/ostest: Converted to use the mconf configuration tool. * configs/sim/cxxtest: New test that will be used to verify the uClibc++ port (eventually). * include/nuttx/fs/fs.h, lib/stdio/lib_libfread.c, lib_ferror.c, @@ -3570,7 +3570,7 @@ apps/examples/cxxtest works -- meaning the the uClibc++ is complete and verified for the STM32 platform. -6.24 2012-xx-xx Gregory Nutt +6.24 2012-12-20 Gregory Nutt * arch/arm/src/stm32: Support for STM32F100 high density chips added by Freddie Chopin. @@ -3604,19 +3604,19 @@ * arch/*/src/Makefile: Now uses only the libraries in lib/ Replace bash fragments that test for board/Makefile. * Makefile.win: The beginnings of a Windows-native build. This is just - the begining and not yet ready for prime time use. + the beginning and not yet ready for prime time use. * configs/stm32f4discovery/winbuild: This is a version of the standard NuttX OS test, but configured to build natively on Windows. Its only real purpose is to very the native Windows build logic. * tools/mkdeps.bat and tools/mkdeps.c: mkdeps.bat is a failed attempt to leverage mkdeps.sh to CMD.exe. It fails because the are certain critical CFLAG values that cannot be passed on the CMD.exe command line - (line '='). mkdeps.c is a work in progress that will, hopefully, + (like '='). mkdeps.c is a work in progress that will, hopefully, replace both mkdeps.sh and mkdeps.bat. - * tools/Config.mk: Centralize the definition of the scrpt that will be + * tools/Config.mk: Centralize the definition of the script that will be used to generated header file include paths for the compiler. This needs to be centralized in order to support the Windows native build. - * tools/incdir.bat: A replaced for tools/incdir.sh for use with the + * tools/incdir.bat: A replacement for tools/incdir.sh for use with the the Windows native build. * Makefile.unix: The existing top-level Makefile has been renamed Makefile.unix. @@ -3626,8 +3626,8 @@ * arch/arm/src/stm32/stm32_qencoder.c: TIM3 bug fix from Ryan Sundberg. * tools/mkromfsimg.sh: Correct typo in an error message (Ryan Sundberg) * arch/*/src/Makefile: Remove tftboot install and creation of System.map - for Windows native build. The fist is necessary, the second just needs - re-implemented. + for Windows native build. The first is a necessary change, the second + just needs re-implemented. * configs/mirtoo: Update Mirtoo pin definitions for Release 2. Provided by Konstantin Dimitrov. * Fixed an uninitialized variable in the file system that can cause @@ -3637,9 +3637,9 @@ conditional logic elsewhere. * nuttx/graphics: One a mouse button is pressed, continue to report all mouse button events to the first window that received the the initial - button down event, even if the mouse attempts to dray outside the + button down event, even if the mouse attempts to drag outside the window. From Petteri Aimonen. - * nuttx/graphics/nxmu/nx_block.c: One more fixe to the NX block message + * nuttx/graphics/nxmu/nx_block.c: One more fix to the NX block message logic from Petteri Aimonen. * include/nuttx/wqueue.h: Some basic definitions to support a user- space work queue (someday in the future). @@ -3654,8 +3654,6 @@ * sched/pause.c: Implements the POSIX pause() function. * ez80: Lots of changes to ez80 configurations and build logic as I struggle to get a clean Windows build (still not working). - * tools/prebuild.py: A Python script for Darcy Gong that can automate - many build/configuration operations. * configs/cloudctrl: Darcy Gong's CloudController board. This is a small network relay development board. Based on the Shenzhou IV development board design. It is based on the STM32F107VC MCU. @@ -3684,12 +3682,12 @@ * sched/task_exithook.c: Missing right bracket with certain conditional compilation (thanks James Goppert). * arch/arm/srch/stm32/stm32_otgfshost.c: Replace timeout handling; use - system tick instead of frame counter. The frame counter gets rset to + system tick instead of frame counter. The frame counter gets reset to zero at 0x3fff making it error prone. * arch/arm/src/stm32/stm32f20xx_rcc.c and stm32f40xx_rcc.c: Added option CONFIG_STM32_FLASH_PREFETCH. FLASH prefetch will now only be enabled if this option is selected. - * confgs/ez80f910200zco/ostest: Now used Kconfig/mconfig configuration + * confgs/ez80f910200zco/ostest: Now uses Kconfig/mconf configuration tool. Updated to build in native Windows environment. Other ez80f910200zco build scripts also updated. * configs/z8f64200100kit/ostest: Update to same level as ez80 configurations. @@ -3701,11 +3699,11 @@ get chip ID. Contributed by Darcy Gong. These should not be board-dependent, but should be in arch/arm/src/stm32 where they can be used from any board. * sched/work_thread.c: Fix backward conditional compilation. This might - has caused a memory leadk. From Freddie Chopin. + has caused a memory leak. From Freddie Chopin. * configs//Make.defs: Fix typo -wstrict-prototypes should be - -Wstrict-prototypes (From Denis Cariki). + -Wstrict-prototypes (From Denis Carilki). * arch/arm/src/calapyso/calypso_keypad.c: Add Calypso keypad driver. From - Denis Cariki. + Denis Carilki. * z8encore000zco/ostest and z8f64200100kit/ostest: Converted to use Kconfig/ mconf configuration tool. * arch/arm/src/armv7-m/up_exception.S: missing curly braces for push/pop @@ -3725,7 +3723,7 @@ * libc/stdlib/lib_rand.c: Always add one to result congruential generators to avoid the value zero. Suggested by Freddie Chopin. * tools/b16.c: Fixed precision math conversion utility. - * graphics/nxglib/nxglib_splitlinex.c: Fix the "fat, flat line bug" + * graphics/nxglib/nxglib_splitline.c: Fix the "fat, flat line bug" * arch/z80/src/*/Toolchain.defs: Add dummy Toolchain.defs files for the z80 family. * configs/z80sim/ostest: Converted to build with the Kconfig/mconf tool. @@ -3761,14 +3759,14 @@ value zero can be returned. Requested by Freddie Chopin. * arch/z80/src/Makefile.sdcc*, z80/up_mem.h: Redesign Z80 build so that it no longer depends on Bash scripts. - * configs/z80sim/nsh and pashello: Converted to (1) used the kconfig-frontends + * configs/z80sim/nsh and pashello: Converted to (1) use the kconfig-frontends configuration tool, and (2) to build natively under Windows. The NSH configuration is verified; the pashello configuration needs a more TLC. * tools/copydir.sh: Rename tools/winlink.sh to tools/copydir.sh * tools/link.bat, unlink.bat, and copydir.bat: Add Windows counterparts to the link.sh, unlink.sh, and copydir.sh Bash scripts. * configs/z80sim/pashello: Now builds correctly. - * configs/xtrs/ostest, nsh, and pashello: Converted to (1) used the kconfig- + * configs/xtrs/ostest, nsh, and pashello: Converted to (1) use the kconfig- frontends configuration tool, and (2) to build natively under Windows. * drivers/serial/Kconfig and sched/Kconfig: Two names for same configuration: CONFIG_LOWLEVEL_CONSOLE is bogus and CONFIG_DEV_LOWCONSOLE is in the wrong @@ -3786,7 +3784,7 @@ environment of the task started by os_bringup() will have the PATH environment variable defined to be that string. * binfmt/binfmt_exepath.c: If CONFIG_BINFMT_EXEPATH is defined, then this - file will be built. In contains logic to search for regular files at + file will be built. It contains logic to search for regular files at the absolutes paths found in the current PATH environment variable setting. This is untested and not yet hooked into the binfmt exec() logic on initial check-in @@ -3801,3 +3799,5 @@ just malloc'ing the task memory). * configs/stm32f4discovery/elf: Enable support/test of the PATH to find executables using a relative path. + +6.25 2013-xx-xx Gregory Nutt diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index d8d393a7c..5d9d3af3b 100644 --- a/nuttx/Documentation/NuttX.html +++ b/nuttx/Documentation/NuttX.html @@ -8,7 +8,7 @@

                            NuttX RTOS

                            -

                            Last Updated: December 15, 2012

                            +

                            Last Updated: December 20, 2012

                            @@ -339,6 +339,14 @@

                            + +
                            + +

                            +

                          • Optional tasks with address environments (Processes).
                          • +

                            + +
                            @@ -464,6 +472,13 @@

                            + +
                            + +

                            +

                          • PATH variable support.
                          • +

                            +
                            @@ -1039,30 +1054,31 @@ -

                            NuttX-6.23 Release Notes

                            +

                            NuttX-6.24 Release Notes

                            - The 90th release of NuttX, Version 6.23, was made on November 5, 2012, and is available for download from the + The 91st release of NuttX, Version 6.24, was made on December 20, 2012, and is available for download from the SourceForge website. - Note that the release consists of two tarballs: nuttx-6.23.tar.gz and apps-6.23.tar.gz. + Note that the release consists of two tarballs: nuttx-6.24.tar.gz and apps-6.24.tar.gz. Both may be needed (see the top-level nuttx/README.txt file for build information) The change log associated with the release is available here. Unreleased changes after this release are available in SVN. These unreleased changes are also listed here.

                            - This release corresponds with SVN release number: r5313, + This release corresponds with SVN release number: r5447, Note that all SVN information has been stripped from the tarballs. If you need the SVN configuration, you should check out directly from SVN. - Revision r5313 should equivalent to release 6.23 of NuttX: + Revision r5447 should equivalent to release 6.24 of NuttX:

                              -svn checkout -r5313 svn://svn.code.sf.net/p/nuttx/code/trunk nuttx-code
                              +svn checkout -r5447 svn://svn.code.sf.net/p/nuttx/code/trunk nuttx-code
                               
                            -

                            Or

                            +

                            Or (HTTP):

                              -svn checkout -r5313 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code
                              +svn checkout -r5447 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code
                               
                            +

                            Additional new features and extended functionality

                            @@ -1071,114 +1087,277 @@ svn checkout -r5313 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code
                          • RTOS: - If both atexit() and on_exit() are enabled, use on_exit() to implement atexit(). - Updates for RGMP 4.0.

                            +
                              +
                            • + Implemented the POSIX pause() function (still has some compiance issues). +
                            • +
                            • + Tasking logic is extended to support the notion of address environments. + An address environment is the key notion underlying "process" vs. tasks. + If tasks are created with address environments (by binfmt), the OS will propogate that environment to child threads and will destroy the address environment when all threads in the "process" exists. +
                            • +
                            • + If support for the PATH variable is enabled, the OS start up logic will create an initial environment containing the default PATH setting (CONFIG_PATH_INITIAL). + This initial PATH will then be inherited by all tasks. +
                            • +
                          • - Binfmt: - Add support for loading and executing ELF binary modules from a file system. + Binfmt:

                            +
                              +
                            • + The NuttX binary loaders have been updated to support the PATH environment variable. + Now, if the PATH is properly defined, programs can be executed from mass storage using only the file name. + This feature is added to support more standard behavior (eventually, NSH will support execution of programs in file systems by just entering the file name, perhaps in 6.25?). +
                            • +
                            • + The NXFLAT and ELF binary loaders have been extended to create address environments for any new tasks executed from the file system. + This feature requires that the architecture support a memory management unit (MMU) and the address environment interfaces declared in include/nuttx/arch.h (currently, this is only supported by the z180). +
                            • +
                          • Drivers: - Maxim MAX11802 touchscreen controller (Petteri Aimonen) -

                            + LCD driver for the Univision UG-2864AMBAG01 OLED
                          • - STM32 Driver: - Implementation of /dev/random using the STM32 Random Number Generator (RNG). -

                            + STM32: + Support for STM32F100 high density chips contributed by Freddie Chopin.
                          • - STM32 Boards: - ADC support for the Shenzhou IV board. - Relay support for the Shenzhou IV board (both by Darcy Gong). -

                            + STM32 Drivers: + Added optional RS-485 direction bit control (from Freddie Chopin).
                          • - C++ Standard Library: - Support is now included for the add-on uClibc++ C++ standard library support. - This includes support for iostreams, strings, STL, RTTI, exceptions -- the complete C++ environment. - uClibc++ is provided as a separate add-on package due to licensing issues. - Contributed by Qiang Yu and David of the RGMP team. + STM32 Boards:

                            +
                              +
                            • + Support for generic STM32F100RC board contributed by Freddie Chopin. +
                            • +
                            • + stm32f4discovery/nxlines: STM32F4Discovery support for the UG-2864AMBAG01 OLED. +
                            • +
                            • + stm32f4discovery/winbuild: A version of the NuttX OS test configured to build natively on Windows. +
                            • +
                            • + stm32f4discovery/elf: Now uses the PATH variable to find ELF executables. +
                            • +
                            • + configs/cloudctrl: Added for Darcy Gong's CloudController board +
                            • +
                            +
                          • +
                          • - Add support for __cxa_atexit(). -

                            + PIC32 Boards: + Update the Mirtoo configuration for Release 2 of the Mirtoo module.
                          • - C Standard Library: + Calypso: + Add Calypso keypad driver (from Denis Carilki). +

                          • +
                          • - Optimized generic and ARM-specific memcpy() function. - Optimized memset() function. + ZiLOG:

                            +
                              +
                            • + Add support for the z180 chip family and, specifically, for the P112 retro hardware (see http://p112.feedle.net/). +
                            • +
                            • + All ZiLOG configurations updated to use the current ZDS-II and/or SDCC toolchains. +
                            • +
                            +
                          • +
                          • - Add support for ferror()), feof()), and clearerror()). + Graphics:

                            +
                              +
                            • + Add a semaphore handshake so that operations on buffers from the NXMU client will be blocked until the NX server operates on the buffer data (from Petteri Aimonen). +
                            • +
                            • + nxtk_subwindowmove() and nxtk_getwindow(): Improvements to clipping logic from Petteri Aimonen. +
                            • +
                          • - Standard Math Library: + C Library: + lib/ sub-directory renamed libc/ (there is a new lib/ sub-directory that is used to hold all archives). +

                          • +
                          • - Port of the math library from Rhombus OS by Nick Johnson (Darcy Gong). -

                            + C++: + Exception stubs from Petteri Aimonen.
                          • Applications: - New NSH commands: ifup, ifdown, urlencode, urldecode, base64enc, bas64dec, and md5 (Darcy Gong). - Extensions to the ifconfig command (Darcy Gong), - Add support for NSH telnet login (Darcy Gong). - Enancements to NSH ping command to support pinging hosts with very long round-trip times.

                            -

                            - Many extensions to the webclient/wget and DNS resolver logic from Darcy Gong. - SON, Base64, URL encoding, and MD5 libraries contributed by Darcy Gong. +

                              +
                            • + Add NSH hexdump command to dump the contents of a file (or character device) to the console (contributed by Petteri Aimonen). +
                            • +
                            • + Extend the NSH ifconfig command plus various DHCPC improvements (from Darcy Gong). +
                            • +
                            +
                          • +
                          • +

                            + apps/examples:

                            -

                            - New examples: ELF loader, JSON, wgetjson, cxxtest, relays. +

                              +
                            • + ostest: Replace large tables with algorithmic prime number generation. + This allows the roundrobin test to run on platforms with minimal SRAM (Freddie Chopin). +
                            • +
                            • + keypadtest: A new keypad test example contributed by Denis Carikli. +
                            • +
                            • + elf and nxflat: If CONFIG_BINFMT_EXEPATH is defined, these examples will now use a relative path to the program and expect the binfmt/ logic to find the absolute path to the program using the PATH variable. +
                            • +
                            +
                          • +
                          • +

                            + Build system:

                            +
                              +
                            • +

                              + New top-level Makefiles: Makefile.unix and Makefile.win (along with numerous changes to other make-related files). + This adds basic support for building NuttX natively under Windows from a CMD.exe window (rather than in a POSIX-like environment). + This build: (1) Uses all Windows style paths, (2) Uses primarily Windows batch commands from CMD.exe, with (3) a few extensions from GNUWin32. +

                              +

                              + This capability should still be considered a work in progress because: (1) it has not been verfied on all targets and tools, and (2) still lacks some of the creature-comforts of the more mature environments (like a function configure.sh script and make menuconfig support). +

                            • +
                            • + Example Windows native builds for STM32F4Discovery, eZ80, z16f, z8, Z80, and Z180. +
                            • +
                            • + Several configurations have been converted to work the kconfig-frontends mconf configuration tool: stm32f4discovery/nxlines, and all eZ80, z16f, z8, Z80, and Z180 configurations. +
                            • +
                            • + Architectures now include a common Toolchain.defs file that can be used to manage toolchains in a more configurable way (most of this contributed by Mike Smith). +
                            • +
                            +
                          • +
                          • +

                            + Build tools: +

                            +
                              +
                            • + Renamed tools/winlink.sh to tools/copydir.sh. +
                            • +
                            • + Several new tools/scripts to support the Windows native build: tools/mkdeps.bat, tools/mkdeps.c, tools/link.bat, tools/unlink.bat, and tools/ copydir.bat. +
                            • +
                            • + tools/incdir.sh and tools/incdir.bat now support an -s option to generate system header file paths. +
                            • +
                            • + tools/b16.c: Fixed precision math conversion utility. +
                            • +

                          - Bugfixes (see the change log for details) + Bugfixes (see the change log for details). Some of these are very important (marked critical):

                            +
                          • +

                            + RTOS: + Fix some backward conditional compilation in the work queue logic (Freddie Chopin). +

                          • +
                          • +

                            + File System: + Uninitialized variable caused assertions (from Lorenz Meier). +

                          • Drivers: - W25 SPI FLASH -

                            + Partial fix for STM32 OTG FS device drivers and fix for short, unaligned writes in the flash translation layer (drivers/mtd/ftl.c), both from Petteri Aimonen.
                          • STM32 Drivers: - ADC reset

                            +
                              +
                            • + Qencoder driver and TIM3 driver fixes from Ryan Sundberg. +
                            • +
                            • + Fix timeout delay calculation in the STM32 OTG FS host driver. +
                            • +
                          • - Fraphics: - Missing implementation of the blocked method (*critical*, Petteri Aimonen). + LPC17xx Drivers: + Resources not being properly released when I2C driver is un-initialized. +

                          • +
                          • +

                            + Graphics:

                            +
                              +
                            • + Fix logic when the mouse drags outside of the window; fix another "blocked message" handling case (both from Petteri Aimonen). +
                            • +
                            • + nxtk_filltrapwindow(): Correct an offset problem (also from Peterri Aimonen). +
                            • +
                            • + nxglib_splitline(): Correct the "fat flat line" bug. +
                            • +
                          • C Library: - Floating point numbers in printf and related formatting functions (Mike Smith), - cf[get|set]speed() (Mike Smith)

                            +
                              +
                            • + nrand() changes to prevent coefficients from becoming zero which would "lock up" the random number generate. +
                            • +
                            • + Add rounding functions to the math library (contributed by Petteri Aimonen). +
                            • +
                            +
                          • +
                          • +

                            + Build system: + Changes to MIN definitions in all limit.h header files to avoid integer overflows. + For example from (-128) to (-127 - 1) (from Petteri Aimonen). +

                          • +
                          • +

                            + Applications: + Modbus fixes from Freddie Chopin.

                          +

                          As well as other, less critical bugs. See the ChangeLog for additional, detailed changes. @@ -1310,8 +1489,9 @@ svn checkout -r5313 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code

                            STATUS: - This port was contributed by Denis Carilki and includes the work of Denis, Alan Carvalho de Assis, and Stefan Richter. - Calypso support first appeared in NuttX-6.17. + This port was contributed by Denis Carilki and includes the work of Denis Carikli, Alan Carvalho de Assis, and Stefan Richter. + Calypso support first appeared in NuttX-6.17 with LCD drivers. + Support for the Calypso keyboard was added in NuttX-6.24 by Denis Carilki.

                          @@ -1340,8 +1520,8 @@ svn checkout -r5313 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code

                          Development Environments: - 1) Linux with native Linux GNU toolchain, 2) Cygwin with Cygwin GNU toolchain, or 3) Cygwin - with Windows native toolchain (CodeSourcery or devkitARM). A DIY toolchain for Linux + 1) Linux with native Linux GNU toolchain, 2) Cygwin/MSYS with Cygwin GNU toolchain, 3) Cygwin/MSYS + with Windows native toolchain (CodeSourcery or devkitARM), or 4) Native Windows. A DIY toolchain for Linux or Cygwin is provided by the NuttX buildroot package. @@ -1405,8 +1585,8 @@ svn checkout -r5313 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code

                          Development Environments: - 1) Linux with native Linux GNU toolchain, 2) Cygwin with Cygwin GNU toolchain, or 3) Cygwin - with Windows native toolchain (CodeSourcery or devkitARM). A DIY toolchain for Linux + 1) Linux with native Linux GNU toolchain, 2) Cygwin/MSYS with Cygwin GNU toolchain, 3) Cygwin/MSYS + with Windows native toolchain (CodeSourcery or devkitARM), or 4) Native Windows. A DIY toolchain for Linux or Cygwin is provided by the NuttX buildroot package. @@ -1558,8 +1738,8 @@ svn checkout -r5313 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code

                          Development Environments: - 1) Linux with native Linux GNU toolchain, 2) Cygwin with Cygwin GNU toolchain, or 3) Cygwin - with Windows native toolchain (CodeSourcery or devkitARM). A DIY toolchain for Linux + 1) Linux with native Linux GNU toolchain, 2) Cygwin/MSYS with Cygwin GNU toolchain, 3) Cygwin/MSYS + with Windows native toolchain (CodeSourcery or devkitARM), or 4) Native Windows. A DIY toolchain for Linux or Cygwin is provided by the NuttX buildroot package. @@ -1672,7 +1852,9 @@ svn checkout -r5313 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code

                          STMicro STM32F100x. Chip support for these STM32 "Value Line" family was contributed by Mike Smith and users have reported that they have successful brought up NuttX on there proprietary boards using this logic. + This logic was extended to support the high density STM32F100RC chips by Freddie Chopin However, there is no specific board support for this chip families in the NuttX source tree. + There is, however, generic support for STM32F100RC boards.

                          @@ -1744,8 +1926,8 @@ svn checkout -r5313 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code

                        Development Environments: - 1) Linux with native Linux GNU toolchain, 2) Cygwin with Cygwin GNU toolchain, or 3) Cygwin - with Windows native toolchain (RIDE7, CodeSourcery or devkitARM). A DIY toolchain for Linux + 1) Linux with native Linux GNU toolchain, 2) Cygwin/MSYS with Cygwin GNU toolchain, 3) Cygwin/MSYS + with Windows native toolchain (RIDE7, CodeSourcery or devkitARM), or 4) Native Windows. A DIY toolchain for Linux or Cygwin is provided by the NuttX buildroot package. @@ -1839,8 +2021,8 @@ svn checkout -r5313 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code

                        Development Environments: - 1) Linux with native Linux GNU toolchain, 2) Cygwin with Cygwin GNU toolchain, or 3) Cygwin - with Windows native toolchain (CodeSourcery or devkitARM). A DIY toolchain for Linux + 1) Linux with native Linux GNU toolchain, 2) Cygwin/MSYS with Cygwin GNU toolchain, 3) Cygwin/MSYS + with Windows native toolchain (CodeSourcery or devkitARM), or 4) Native Windows. A DIY toolchain for Linux or Cygwin is provided by the NuttX buildroot package. @@ -1974,8 +2156,8 @@ svn checkout -r5313 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code

                        Development Environments: - 1) Linux with native Linux GNU toolchain, 2) Cygwin with Cygwin GNU toolchain, or 3) Cygwin - with Windows native toolchain (CodeSourcery devkitARM or Code Red). A DIY toolchain for Linux + 1) Linux with native Linux GNU toolchain, 2) Cygwin/MSYS with Cygwin GNU toolchain, 3) Cygwin/MSYS + with Windows native toolchain (CodeSourcery devkitARM or Code Red), or 4) Native Windows. A DIY toolchain for Linux or Cygwin is provided by the NuttX buildroot package. @@ -2165,7 +2347,7 @@ svn checkout -r5313 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code

                        Development Environments: - 1) Linux with native Linux GNU toolchain, 2) Cygwin with Cygwin GNU Cortex-M3 or 4toolchain, or 3) Cygwin with Windows native GNU Cortex-M3 or M4 toolchain (CodeSourcery or devkitARM). A DIY toolchain for Linux or Cygwin is provided by the NuttX + 1) Linux with native Linux GNU toolchain, 2) Cygwin/MSYS with Cygwin GNU Cortex-M3 or 4 toolchain, 3) Cygwin/MSYS with Windows native GNU Cortex-M3 or M4 toolchain (CodeSourcery or devkitARM), or 4) Native Windows. A DIY toolchain for Linux or Cygwin is provided by the NuttX buildroot package. I use FreeScale's CodeWarrior IDE only to work with the JTAG debugger built into the Kinetis boards. I use the Code Red IDE with the some of the NXP parts and the Atollic toolchain with some of the STMicroelectronics parts. @@ -2284,7 +2466,7 @@ svn checkout -r5313 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code

                        Development Environments: - 1) Linux with native Linux GNU toolchain, 2) Cygwin with Cygwin GNU toolchain, or 3) Cygwin with Windows native toolchain. + 1) Linux with native Linux GNU toolchain, 2) Cygwin/MSYS with Cygwin GNU toolchain, 3) Cygwin/MSYS with Windows native toolchain, or 4) Native Windows. All testing, however, has been performed using the NuttX DIY toolchain for Linux or Cygwin is provided by the NuttX buildroot package. As a result, that toolchain is recommended. @@ -3252,192 +3434,311 @@ Other memory:

                          -nuttx-6.23 2012-11-05 Gregory Nutt <gnutt@nuttx.org>
                          -
                          -    * arch/arm/src/stm32/stm32_rng.c, chip/stm32_rng.h, and other files:
                          -      Implementation of /dev/random using the STM32 Random Number
                          -      Generator (RNG).
                          -    * board.h file for shenzhou, fire-stm32v2, and olimex-stm32-p107:
                          -      Add frequencies for HSE, HSI, LSE, and LSI.  These are needed
                          -      by the STM32 watchdog driver.
                          -    * CONFIG_EXAMPLES_*: To make things consistent, changed all occurrences
                          -      of CONFIG_EXAMPLE_* to CONFIG_EXAMPLES_*.
                          -    * drivers/mtd/w25.c and configs/*/src/up_w25.c:  Several fixes for the
                          -      W25 SPI FLASH.
                          -    * configs/*/Make.defs:  All buildroot tools now use the extension
                          -      xxx-nuttx-elf- vs. xxx-elf-
                          -    * configs/shenzhou/*/Make.defs:  Now uses the new buildroot 4.6.3
                          -      EABI toolchain.
                          -    * lib/stdio/lib_libdtoa.c:  Another dtoa() fix from Mike Smith.
                          -    * configs/shenzhou/src/up_adc.c:  Add ADC support for the Shenzhou
                          -      board (Darcy Gong).
                          -    * configs/shenzhou/thttpd:  Add a THTTPD configuration for the
                          -      Shenzhou board (Darcy Gong).
                          -    * include/termios.h and lib/termios/libcf*speed.c: The non-standard,
                          -      "hidden" c_speed cannot be type const or else static instantiations
                          -      of termios will be required to initialize it (Mike Smith).
                          -    * drivers/input/max11802.c/h, and include/nuttx/input max11802.h:  Adds
                          -      support for the Maxim MAX11802 touchscreen controller (contributed by
                          -      Petteri Aimonen).
                          -    * graphics/nxtk/nxtk_events.c:  Missing implementatin of the blocked
                          -      method.  This is a critical bugfix for graphics support (contributed
                          -      by Petteri Aimonen).
                          -    * drivers/usbdev/pl2303.c, drivers/usbdev/usbmsc.h, and
                          -      include/nuttx/usb/cdcacm.h: USB_CONFIG_ATTR_SELFPOWER vs.
                          -      USB_CONFIG_ATT_SELFPOWER (contributed by Petteri Aimonen).
                          -    * arch/arm/src/armv7-m/up_memcpy.S:  An optimized memcpy() function for
                          -      the ARMv7-M family contributed by Mike Smith.
                          -    * lib/strings/lib_vikmemcpy.c:  As an option, the larger but faster
                          -      implemementation of memcpy from Daniel Vik is now available (this is
                          -      from http://www.danielvik.com/2010/02/fast-memcpy-in-c.html).
                          -    * lib/strings/lib_memset.c: CONFIG_MEMSET_OPTSPEED will select a
                          -      version of memset() optimized for speed.  By default, memset() is
                          -      optimized for size.
                          -    * lib/strings/lib_memset.c: CONFIG_MEMSET_64BIT will perform 64-bit
                          -      aligned memset() operations.
                          -    * arch/arm/src/stm32/stm32_adc.c:  Need to put the ADC back into the
                          -      initial reset in the open/setup logic.  Opening the ADC driver works
                          -      the first time, but not the second because the device is left in a
                          -      powered down state on the last close.
                          -    * configs/olimex-lpc1766stck/scripts:  Replace all of the identical
                          -      ld.script files with the common one in this directory.
                          -    * configs/stm3220g-eval/scripts:  Replace all of the identical
                          -      ld.script files with the common one in this directory.
                          -    * configs/hymini-stm32v/scripts:  Replace all of the identical
                          -      ld.script files with the common one in this directory.
                          -    * configs/lpcxpresso-lpc1768/scripts:  Replace all of the identical
                          -      ld.script files with the common one in this directory.
                          -    * binfmt/elf.c, binfmt/libelf, include/elf.h, include/nuttx/elf.h: Add
                          -      basic framework for loadable ELF module support.  The initial check-
                          -      in is non-functional and is simply the framework for ELF support.
                          -    * include/nuttx/binfmt.h, nxflat.h, elf.h, and symtab.h:  Moved to
                          -      include/nuttx/binfmt/.
                          -    * arch/sim/src/up_elf.c and arch/x86/src/common/up_elf.c:  Add
                          -      for ELF modules.
                          -    * arch/arm/include/elf.h:  Added ARM ELF header file.
                          -    * include/elf32.h:  Renamed elf.h to elf32.h.
                          -    * configs/stm32f4discovery/ostest:  Converted to use the new
                          -      Kconfig-based configuration system.
                          -    * configs/stm32f4discovery/elf and configs/stm32f4discovery/scripts/gnu-elf.ld
                          -      Add a configuration for testing the ARM ELF loader.
                          -    * binfmt/libelf:  Can't use fstat(). NuttX does not yet support it.  Damn!
                          -    * binfmt/libelf:  The basic ELF module execution appears fully functional.
                          -    * configs/shenzhou/src/up_relays.c:  Add support for relays from the
                          -      Shenzhou board.  Contributed by Darcy Gong.
                          -    * lib/fixedmath: Moved the old lib/math to lib/fixedmath to make room for
                          -      the math library from the Rhombus OS
                          -    * lib/math: Now contains the math library from the Rhombus OS by Nick Johnson
                          -      (submitted by Darcy Gong).
                          -    * include/float.h:  Add a first cut at the float.h header file.  This
                          -      really should be an architecture/toolchain-specific header file.  It
                          -      is only used if CONFIG_ARCH_FLOAT_H is defined.
                          -    * lib/math: Files now conform to coding standards.  Separated float,
                          -      double, and long double versions of code into separate files so that
                          -      they don't draw in so much un-necessary code when doing a dumb link.
                          -    * binfmt/libelf:  The ELF loader is working correctly with C++ static
                          -      constructors and destructors and all.
                          -    * Documentation/NuttXBinfmt.html:  Add documentionof the binary loader.
                          -    * configs/sim/ostest:  Converted to use the mconfig configuration tool.
                          -    * configs/sim/cxxtest:  New test that will be used to verify the uClibc++
                          -      port (eventually).
                          -    * include/nuttx/fs/fs.h, lib/stdio/lib_libfread.c, lib_ferror.c,
                          -      lib_feof.c, and lib_clearerr.c:  Add support for ferror(), feof(),
                          -      and clearerror().  ferror() support is bogus at the moment (it
                          -      is equivalent to !feof()); the others should be good.
                          -    * configs/stm32f4discovery/include/board.h:  Correct timer 2-7
                          -      base frequency (provided by Freddie Chopin).
                          -    * include/nuttx/sched.h, sched/atexit.c, and sched/task_deletehook.c:
                          -      If both atexit() and on_exit() are enabled, then implement atexit()
                          -      as just a special caseof on_exit().  This assumes that the ABI can
                          -      handle receipt of more call parameters than the receiving function
                          -      expects.  That is usually the case if parameters are passed in
                          -      registers.
                          -    * libxx/libxx_cxa_atexit():  Implements __cxa_atexit()
                          -    * configs/stm32f4discovery/cxxtest:  New test that will be used to
                          -      verify the uClibc++ port (eventually).  The sim platform turned not
                          -      to be a good platform for testing uClibc++.  The sim example will not
                          -      run because the simulator will attempt to execute the static
                          -      constructors before main() starts. BUT... NuttX is not initialized
                          -      and this results in a crash.  On the STM324Discovery, I will have
                          -      better control over when the static constructors run.
                          -    * RGMP 4.0 updated from Qiany Yu.
                          -    * configs/*/Make.defs and configs/*/ld.script:  Massive clean-up
                          -      and standardization of linker scripts from Freddie Chopin.
                          -    * net/netdev_ioctl.c:  Add interface state flags and ioctl calls
                          -      to bring network interfaces up and down (from Darcy Gong).
                          -    * config/stm32f4discovery: Enable C++ exceptions.  Now the entire
                          -      apps/examples/cxxtest works -- meaning the the uClibc++ is
                          -      complete and verified for the STM32 platform.
                          -
                          -apps-6.23 2012-11-05 Gregory Nutt <gnutt@nuttx.org>
                          -
                          -    * vsn: Moved all NSH commands from vsn/ to system/.  Deleted the vsn/
                          +nuttx-6.24 2012-12-20 Gregory Nutt <gnutt@nuttx.org>
                          +
                          +    * arch/arm/src/stm32:  Support for STM32F100 high density chips
                          +      added by Freddie Chopin.
                          +    * configs/stm32f100_generic:  Support for generic STM32F100RC board
                          +      contributed by Freddie Chopin.
                          +    * arch/arm/src/stm32_otgfsdev.c:  Partial fix from Petteri Aimonen.
                          +    * drivers/lcd/ug-2864ambag01.c and include/nuttx/lcd/ug_2864ambag01.h:
                          +      LCD driver for the Univision OLED of the same name (untested on
                          +      initial check-in).
                          +    * configs/stm32f4discovery/nxlines:  Configure to use mconf/Kconfig
                          +      tool.
                          +    * configs/stm32f4discovery/src/up_ug2864ambag01.c:  Board-specific
                          +      initialization for UG-2864AMBAG01 OLED connecte to STM32F4Disovery.
                          +    * libxx/libxx_stdthrow.cxx:  Exception stubs from Petteri Aimonen.
                          +    * configs/stm32f4discovery/src/up_ug2864ambag01.c: Driver has been
                          +      verified on the STM32F4Discovery platform.  Some tuning of the
                          +      configuration could improve the presentation.  Lower resolution displays
                          +      are also more subject to the "fat, flat line bug" that I need to fix
                          +      someday.  See http://www.nuttx.org/doku.php?id=wiki:graphics:nxgraphics
                          +      for a description of the fat, flat line bug.
                          +    * libc:  Renamed nuttx/lib to nuttx/libc to make space for a true lib/
                          +      directory that will be forthcoming.  Also rename libraries:  liblib.a -> libc.a,
                          +      libulib.a -> libuc.a, libklib.a -> libkc.a, liblibxx.a ->libcxx.a.
                          +      (I will probably, eventually rename libxx to libcxx for consistency)
                          +    * Makefile, lib/: A new, empty directory that will hold generated libraries.
                          +      This simplifies the library patch calculations and lets me get rid of some
                          +      bash logic.  The change is functional, but only partially complete;
                          +      additional logic is needed in the arch/*/src/Makefile's as well.  Right
                          +      now that logic generate multiple library paths, all pointing to the lib/
                                 directory.
                          -    * Makefile:  Change order of includes when CONFIG_NEWCONFIG=y.  In
                          -      that case, namedapp must be included first so that the namedapp
                          -      context is established first.  If the namedapp context is established
                          -      later, it will overwrite any existing namedapp_list.h and nameapp_proto.h
                          -      files.
                          -    * CONFIG_EXAMPLES_*: To make things consistent, changed all occurrences
                          -      of CONFIG_EXAMPLE_* to CONFIG_EXAMPLES_*.
                          -    * Kconfig:  Fleshed out apps/examples/adc/Kconfig and apps/examples/wget/Kconfig.
                          -      There are still a LOT of empty, stub Kconfig files.
                          -    * Kconfig:  Fleshed out apps/examples/buttons/Kconfig. There are still a LOT
                          -      of empty, stub Kconfig files.
                          -    * apps/netutils/webserver/httpd.c:  Fix a bug that I introduced in
                          -      recent check-ins (Darcy Gong).
                          -    * apps/netutils/webclient/webclient.c:  Fix another but that I introduced
                          -      when I was trying to add correct handling for loss of connection (Darcy Gong)
                          -    * apps/nshlib/nsh_telnetd.c:  Add support for login to Telnet session via
                          -      username and password (Darcy Gong).
                          -    * apps/netutils/resolv/resolv.c (and files using the DNS resolver): Various
                          -      DNS address resolution improvements from Darcy Gong.
                          -    * apps/nshlib/nsh_netcmds.c:  The ping command now passes a maximum round
                          -      trip time to uip_icmpping().  This allows pinging of hosts on complex
                          -      networks where the ICMP ECHO round trip time may exceed the ping interval.
                          -    * apps/examples/nxtext/nxtext_main.c:  Fix bad conditional compilation
                          -      when CONFIG_NX_KBD is not defined.  Submitted by Petteri Aimonen.
                          -    * apps/examples/nximage/nximage_main.c:  Add a 5 second delay after the
                          -      NX logo is presented so that there is time for the image to be verified.
                          -      Suggested by Petteri Aimonen.
                          -    * apps/Makefile: Small change that reduces the number of shell invocations
                          -      by one (Mike Smith).
                          -    * apps/examples/elf:  Test example for the ELF loader.
                          -    * apps/examples/elf:  The ELF module test example appears fully functional.
                          -    * apps/netutils/json:  Add a snapshot of the cJSON project.  Contributed by
                          -      Darcy Gong.
                          -    * apps/examples/json:  Test example for cJSON from Darcy Gong
                          -    * apps/nshlib/nsh_netinit.c: Fix static IP DNS problem (Darcy Gong)
                          -    * apps/netutils/resolv/resolv.c: DNS fixes from Darcy Gong.
                          -    * COPYING: Licensing information added.
                          -    * apps/netutils/codec and include/netutils/urldecode.h, base64.h, and md5.h:
                          -      A port of the BASE46, MD5 and URL CODEC library from Darcy Gong.
                          -    * nsnlib/nsh_codeccmd.c:  NSH commands to use the CODEC library.
                          -      Contributed by Darcy Gong.
                          -    * apps/examples/wgetjson: Test example contributed by Darcy Gong
                          -    * apps/examples/cxxtest:  A test for the uClibc++ library provided by
                          -      Qiang Yu and the RGMP team.
                          -    * apps/netutils/webclient, apps/netutils.codes, and apps/examples/wgetjson:
                          -      Add support for wget POST interface.  Contributed by Darcy Gong.
                          -    * apps/examples/relays:  A relay example contributed by Darcy Gong.
                          -    * apps/nshlib/nsh_netcmds: Add ifup and ifdown commands (from Darcy
                          -      Gong).
                          -    * apps/nshlib/nsh_netcmds: Extend the ifconfig command so that it
                          -      supports setting IP addresses, network masks, name server addresses,
                          -      and hardware address (from Darcy Gong).
                          -
                          -NxWidgets-1.3 2012-09-29 Gregory Nutt <gnutt@nuttx.org>
                          -
                          -    * UnitTests/*/main.cxx:  Change entry point name to be consistent
                          -      with with entry point naming conventions introduced in NuttX
                          -      6.22.
                          -    * Kconfig:  Added a mconfig configuration file.  Eventually, NxWidgets
                          -      needs to get hooked into the NuttX mconf configuration.  Still not
                          -      exactly sure how to do that.
                          -    * libnxwidgets/Makefile and NxWidgets/nxwm/Makefile:  Need updates
                          -      for consistency with recent changes to NuttX build system (>= 6.22)
                          -    * Kconfig:  Add option to turn on the memory monitor feature of the
                          -      NxWidgets/NxWM unit tests.
                          +    * arch/*/src/Makefile:  Now uses only the libraries in lib/
                          +      Replace bash fragments that test for board/Makefile.
                          +    * Makefile.win:  The beginnings of a Windows-native build.  This is just
                          +      the beginning and not yet ready for prime time use.
                          +    * configs/stm32f4discovery/winbuild:  This is a version of the standard
                          +      NuttX OS test, but configured to build natively on Windows.  Its only
                          +      real purpose is to very the native Windows build logic.
                          +    * tools/mkdeps.bat and tools/mkdeps.c:  mkdeps.bat is a failed attempt
                          +      to leverage mkdeps.sh to CMD.exe.  It fails because the are certain
                          +      critical CFLAG values that cannot be passed on the CMD.exe command line
                          +      (like '=').  mkdeps.c is a work in progress that will, hopefully,
                          +      replace both mkdeps.sh and mkdeps.bat.
                          +    * tools/Config.mk:  Centralize the definition of the script that will be
                          +      used to generated header file include paths for the compiler.  This
                          +      needs to be centralized in order to support the Windows native build.
                          +    * tools/incdir.bat:  A replacement for tools/incdir.sh for use with the
                          +      the Windows native build.
                          +    * Makefile.unix:  The existing top-level Makefile has been renamed
                          +      Makefile.unix.
                          +    * Makefile:  This is a new top-level Makefile that just includes
                          +      either Makefile.unix or Makefile.win
                          +    * configs/stm3240g-eval/src:  Qencoder fixes from Ryan Sundberg.
                          +    * arch/arm/src/stm32/stm32_qencoder.c: TIM3 bug fix from Ryan Sundberg.
                          +    * tools/mkromfsimg.sh: Correct typo in an error message (Ryan Sundberg)
                          +    * arch/*/src/Makefile:  Remove tftboot install and creation of System.map
                          +      for Windows native build.  The first is a necessary change, the second
                          +      just needs re-implemented.
                          +    * configs/mirtoo: Update Mirtoo pin definitions for Release 2.  Provided
                          +      by Konstantin Dimitrov.
                          +    * Fixed an uninitialized variable in the file system that can cause 
                          +      assertions if DEBUG on (contributed by Lorenz Meier).
                          +    * Config.mk:  Defined DELIM to be either / or \, depending upon
                          +      CONFIG_WINDOWS_NATIVE.  This will allow me to eliminate a lot of
                          +      conditional logic elsewhere.
                          +    * nuttx/graphics: One a mouse button is pressed, continue to report all
                          +      mouse button events to the first window that received the the initial
                          +      button down event, even if the mouse attempts to drag outside the
                          +      window. From Petteri Aimonen.
                          +    * nuttx/graphics/nxmu/nx_block.c:  One more fix to the NX block message
                          +      logic from Petteri Aimonen.
                          +    * include/nuttx/wqueue.h: Some basic definitions to support a user-
                          +      space work queue (someday in the future).
                          +    * graphics/nxmu:  Add semaphores so buffers messages that send buffers
                          +      will block until the buffer data has been acted upon.
                          +    * graphics/nxmw:  Extended the blocked messages to cover mouse movement
                          +      and redraw events.  These will also cause problems if sent to a window
                          +      while it is closing.
                          +    * arch/several:  Change UARTs are enabled for i.MX, LM3S, ez80, and M16C to
                          +      match how they are enabled for other architectures.
                          +    * configs/ez80f910200kitg:  Convert to use mconf configuration.
                          +    * sched/pause.c:  Implements the POSIX pause() function.
                          +    * ez80: Lots of changes to ez80 configurations and build logic as I
                          +      struggle to get a clean Windows build (still not working).
                          +    * configs/cloudctrl:   Darcy Gong's CloudController board.  This is a
                          +      small network relay development board. Based on the Shenzhou IV development
                          +      board design.  It is based on the STM32F107VC MCU.
                          +    * arch/arm/src/stm32_serial.c and stm32_lowputc.c:  Added optional RS-485
                          +      direction bit control. From Freddie Chopin.
                          +    * Lots of build files:  ARMv7-M and MIPS32 Make.defs now include a common
                          +      Toolchain.defs file that can be used to manage toolchains in a more
                          +      configurable way.  Contributed by Mike Smith
                          +    * configs/stm32f4discovery/winbuild and configs/cloudctrl:  Adapted to use
                          +      Mike's Toolchain.defs.
                          +    * tools/configure.sh:  Adapted to handle paths and setenv.bat files correctly
                          +      for native Windows builds.
                          +    * More of build files:  AVR and AVR32 Make.defs now include a common
                          +      Toolchain.defs file that can be used to manage toolchains in a more
                          +      configurable way.  Contributed by Mike Smith
                          +    * tools/incdir.sh and incdir.bat: Add -s option to generate system header
                          +      file paths.
                          +    * nuttx/arch/arm/src/arm/Toolchain.defs: Add support for more ARM toolchains
                          +      (from Mike Smith).
                          +    * arch/arm/src/stm32/stm32f40xxx_rcc.c:  Enabled FLASH prefetch (from Petteri
                          +      Aimonen).
                          +    * graphics/nxtk/nxtk_filltrapwindow.c:  Correct an offset problem (from
                          +      Peterri Aimonen).
                          +    * graphics/nxglib/nxglib_splitline.c:  Fix error in drawing of near horizontal
                          +      lines (from Peterri Aimonen).
                          +    * sched/task_exithook.c:  Missing right bracket with certain conditional
                          +      compilation (thanks James Goppert).
                          +    * arch/arm/srch/stm32/stm32_otgfshost.c:  Replace timeout handling; use
                          +      system tick instead of frame counter.  The frame counter gets reset to
                          +      zero at 0x3fff making it error prone.
                          +    * arch/arm/src/stm32/stm32f20xx_rcc.c and stm32f40xx_rcc.c: Added option
                          +      CONFIG_STM32_FLASH_PREFETCH.  FLASH prefetch will now only be enabled
                          +      if this option is selected.
                          +    * confgs/ez80f910200zco/ostest:  Now uses Kconfig/mconf configuration
                          +      tool. Updated to build in native Windows environment.  Other ez80f910200zco
                          +      build scripts also updated.
                          +    * configs/z8f64200100kit/ostest: Update to same level as ez80 configurations.
                          +    * nuttx/configs/z8f64200100kit/scripts/setenv.bat: Add support for native
                          +      Windows build.
                          +    * nuttx/arch/arm/src/lpc17xx/lpc17_i2c.c: Resources not being released when
                          +      I2C is uninitialized.
                          +    * cloudctrl/src/up_chipid.c and shenzhou/src/up_chipid.c:  Add functions to
                          +      get chip ID.  Contributed by Darcy Gong.  These should not be board-dependent,
                          +      but should be in arch/arm/src/stm32 where they can be used from any board.
                          +    * sched/work_thread.c: Fix backward conditional compilation.  This might
                          +      has caused a memory leak.  From Freddie Chopin.
                          +    * configs/<many>/Make.defs:  Fix typo -wstrict-prototypes should be
                          +      -Wstrict-prototypes (From Denis Carilki).
                          +    * arch/arm/src/calapyso/calypso_keypad.c:  Add Calypso keypad driver.  From
                          +      Denis Carilki.
                          +    * z8encore000zco/ostest and z8f64200100kit/ostest:  Converted to use Kconfig/
                          +      mconf configuration tool.
                          +    * arch/arm/src/armv7-m/up_exception.S: missing curly braces for push/pop
                          +      From Freddie Chopin.
                          +    * z8encore000zco/ostest and z8f64200100kit/ostest:  Can now be modified to
                          +      support the Windows native builds (see corresponding README.txt files).
                          +    * configs/z16f2800100zcog - All configurations updated to use the ZDS-II
                          +      5.0.1 toolchain.
                          +    * configs/z16f2800100zcog - All configurations updated to use Kconfig/mconf
                          +      configuration tools.
                          +    * configs/z16f2800100zcog/ostest - Now supports a native Windows build
                          +      (other ZNEO configs may also support the native build, but this has not
                          +      been verfiied).
                          +    * include/nuttx/input/keypad.h, arch/arm/src/calypso/calypso_keypad.c, and
                          +      configs/compal_e99/nsh_highram: First cut at a standard keypad interface
                          +      definition.  Contributed by Denis Carikli.
                          +    * libc/stdlib/lib_rand.c:  Always add one to result congruential generators
                          +      to avoid the value zero.  Suggested by Freddie Chopin.
                          +    * tools/b16.c:  Fixed precision math conversion utility.
                          +    * graphics/nxglib/nxglib_splitline.c:  Fix the "fat, flat line bug"
                          +    * arch/z80/src/*/Toolchain.defs:  Add dummy Toolchain.defs files for the
                          +      z80 family.
                          +    * configs/z80sim/ostest:  Converted to build with the Kconfig/mconf tool.
                          +      Current configuration failed to build for me (Ubuntu 12.10, SDCC 3.2.0
                          +      pre-built for Linux) due to a glibc memory corruptionerror in SDCC.
                          +    * configs/z80sim/ostest: Default is now the Windows native build.  See
                          +      configs/z80sim/README.txt for instructions to convert back to a Linux or
                          +      or Cygwin build.
                          +    * arch/z80/src/Makefile.sdccw:  Renamed makefiles with extensions zdiil,
                          +      zdiiw, sdccl, and sdccw for the ZDS-II vs SDCC compilers and for the
                          +      POSIX vs Windows native builds.
                          +    * nuttx/drivers/mtd/ftl.c:  Fix for the flash translation layer. Short
                          +      unaligned writes were buggy.  From Petteri Aimonen.
                          +    * nuttx/libc/math/lib_round*.c:  Add rounding functions to the math
                          +      library.  Contributed by Petteri Aimonen.
                          +    * include/cxx/cstdlib:  Add stroul().  From Petteri Aimonen.
                          +    * arch/*/include/limits.h:  Change signed minimum values from, for example,
                          +      (-128) to (-127 - 1) to avoid overflows under certain conditions.  From
                          +      Peterri Aimonen.
                          +    * graphics/nxtk/nxtk_subwindowmove.c: Previously it was very difficult to
                          +      do e.g. "scroll by dx, dy". When given the full window area, nxtk_subwindowmove
                          +      would clip the offset always to 0,0. It makes more sense for it to clip the
                          +      source area and not modify the offset.  From Petteri Aimonen.
                          +    * graphics/nxtk/nxtk_getwindow.c: Clipping would change the offset of returned
                          +      data, and caller has no way to know what the new offset would be. This messes
                          +      up font drawing when the text is partially out of window, e.g. when scrolling.
                          +      Also from Petteri Aimonen.
                          +    * include/stdbool.h: Can now be disabled for C++ files if CONFIG_C99_BOOL8 is
                          +      defined.  CONFIG_C99_BOOL8 indicates (1) that the sizeof(_Bool) is one in both
                          +      C and C++, and (2) the the C compiler is C99 and supports the _Bool intrinsic
                          +      type. Requested by Freddie Chopin.
                          +    * include/stdlib/lib_rand.c:  Various additional changes so that the integer
                          +      value zero can be returned.  Requested by Freddie Chopin.
                          +    * arch/z80/src/Makefile.sdcc*, z80/up_mem.h:  Redesign Z80 build so that it
                          +      no longer depends on Bash scripts.
                          +    * configs/z80sim/nsh and pashello:  Converted to (1) use the kconfig-frontends
                          +      configuration tool, and (2) to build natively under Windows.  The NSH
                          +      configuration is verified; the pashello configuration needs a more TLC.
                          +    * tools/copydir.sh:  Rename tools/winlink.sh to tools/copydir.sh
                          +    * tools/link.bat, unlink.bat, and copydir.bat:  Add Windows counterparts
                          +      to the link.sh, unlink.sh, and copydir.sh Bash scripts.
                          +    * configs/z80sim/pashello:  Now builds correctly.
                          +    * configs/xtrs/ostest, nsh, and pashello:  Converted to (1) use the kconfig-
                          +      frontends configuration tool, and (2) to build natively under Windows.
                          +    * drivers/serial/Kconfig and sched/Kconfig:  Two names for same configuration:
                          +      CONFIG_LOWLEVEL_CONSOLE is bogus and CONFIG_DEV_LOWCONSOLE is in the wrong
                          +      Kconfig file.  Moved to drivers/serial/Kconfig replacing CONFIG_LOWLEVEL_CONSOLE.
                          +    * arch/z80/include/z180:  Add header files for z180 chips.  Initial versions
                          +      are just clones of z80 header files.
                          +    * arch/z80/src/z180:  Add source files for z180 chips.  Initial versions
                          +      are just clones of z80 source files.
                          +    * include/nuttx/arch.h:  Add address environment control interfaces (for use
                          +      with CPUs the provide MCUs and support process-like address environments).
                          +    * arch/z80/src/z180/z180_mmu.*:  Add MMU support for z180 tasks.
                          +    * configs/p112:  Add very basic board support and an examples/ostest
                          +      configuration for the venerable P112 board.
                          +    * sched/os_bringup.c: If CONFIG_PATH_INITIAL is defined, then the initial
                          +      environment of the task started by os_bringup() will have the PATH
                          +      environment variable defined to be that string.
                          +    * binfmt/binfmt_exepath.c:  If CONFIG_BINFMT_EXEPATH is defined, then this
                          +      file will be built.  It contains logic to search for regular files at
                          +      the absolutes paths found in the current PATH environment variable
                          +      setting.  This is untested and not yet hooked into the binfmt exec()
                          +      logic on initial check-in
                          +    * binfmt/binfmt_loadmodule.c: load_module() will now traverse the PATH
                          +      variable to locate files from their relative path.
                          +    * include/nuttx/arch.h and arch/z80/src/z180/z180_mmu.c:  Restructure the
                          +      address environment interfaces so that they will better integrate with
                          +      binfmt/.
                          +    * binfmt/libelf/*, binfmt/libnxflat/* and other files:  Integrate the
                          +      address environment interfaces.  If CONFIG_ADDRENV=y, then binfmt/
                          +      will now create an address environment for new tasks (instead of
                          +      just malloc'ing the task memory).
                          +    * configs/stm32f4discovery/elf:  Enable support/test of the PATH
                          +      to find executables using a relative path.
                          +
                          +apps-6.24 2012-12-20 Gregory Nutt <gnutt@nuttx.org>
                          +
                          +    * apps/examples/ostest/roundrobin.c:  Replace large tables with
                          +      algorithmic prime number generation.  This allows the roundrobin
                          +      test to run on platforms with minimal SRAM (Freddie Chopin).
                          +    * apps/nshlib/nsh_dbgcmds.c:  Add hexdump command to dump the contents
                          +      of a file (or character device) to the console  Contributed by Petteri
                          +      Aimonen.
                          +    * apps/examples/modbus:  Fixes from Freddie Chopin
                          +    * apps/examples/modbus/Kconfig: Kconfig logic for FreeModBus contributed
                          +      by Freddie Chopin.
                          +    * Makefile, */Makefile:  Various fixes for Windows native build.  Now uses
                          +      make foreach loops instead of shell loops.
                          +    * apps/examples/elf/test/*/Makefile: OSX doesn't support install -D, use
                          +      mkdir -p then install without the -D.  From Mike Smith.
                          +    * apps/examples/relays/Makefile: Reduced stack requirement (Darcy Gong).
                          +    * apps/nshlib and apps/netutils/dhcpc:  Extend the NSH ifconfig command plus
                          +      various DHCPC improvements(Darcy Gong).
                          +    * apps/nshlib/nsh_apps.c: Fix compilation errors when CONFIG_NSH_DISABLEBG=y.
                          +      From Freddie Chopin.
                          +    * Rename CONFIG_PCODE and CONFIG_FICL as CONFIG_INTERPRETERS_PCODE and
                          +      CONFIG_INTERPRETERS_FICL for consistency with other configuration naming.
                          +    * apps/examples/keypadtest:  A keypad test example contributed by Denis
                          +      Carikli.
                          +    * apps/examples/elf and nxflat:  If CONFIG_BINFMT_EXEPATH is defined, these
                          +      tests will now use a relative path to the program and expect the binfmt/
                          +      logic to find the absolute path to the program using the PATH variable.
                          +
                          +NxWidgets-1.4 2012-12-20 Gregory Nutt <gnutt@nuttx.org>
                          +
                          +    * libnxwidgets/Makefile, NxWidgets/nxwm/Makefile, and
                          +      NxWidgets/UnitTests/nxwm/Makefile:  Makefile improvements from
                          +      submitted by Petteri Aimonen.  Other Makefiles in the UnitTests
                          +      directory probably also need these changes.
                          +    * libnxwidgets/src/ccallback.cxx: Fix misplaced #endif.  Provided
                          +      by Petteri Aimonen.
                          +    * libnxwidgets/src/cnxserver.cxx:  Reduce delay to allow NX server
                          +      to start.  One second was un-necessarily long.  Reduced to 50 MS.
                          +      Reduction suggested by Petteri Aimonen.
                          +    * tools/bitmap_converter.py:  This script converts from any image type
                          +      supported by Python imaging library to the RLE-encoded format used by
                          +      NxWidgets.
                          +    * NxWidgets/nxwm/src/capplicationwindow.cxx: If the "desktop" is empty,
                          +      users have no need to minimize any windows. If the buttons are small,
                          +      it's easy to hit minimize button accidentally when trying to close an
                          +      application.  Contributed by Petteri Aimonen.
                          +    * NxWidgets/nxwm/src/ctaskbar.cxx:  Add an option to eliminate the
                          +      background image.  Contributed by Petteri Aimonen.
                          +    * NxWidgets/nxwm/src/chexcalculator.cxx and NxWidgets/nxwm/src/cstartwindow.cxx:
                          +      The config settings CONFIG_NXWM_STARTWINDOW_ICON and CONFIG_NXWM_HEXCALCULATOR_ICON
                          +      allow changing the icons used for these applications. However, to declare symbols
                          +      for these icons user would need to modify NxWidgets header files.
                          +      This commit adds a simple forward declaration to the relevant files, based on the
                          +      configured icon. If the icon does not exist, linker will give an error about it.
                          +      Contributed by Petteri Aimonen.
                          +    * NxWidgets::CTaskBar: Highlight the current window in the task bar.
                          +      Contributed by Petteri Aimonen.
                          +    * NxWidgets/libnxwidgets/src/glyph_cycle.cxx:  Width of glyph_cycle was wrong;
                          +      Destructor needs to by public.  From Petteri Aimonen.
                          +    * NxWidgets::CNumericEdit.  This is basically a label with plus and minus buttons.
                          +      Contributed by Petteri, Aimonen.
                          +    * NxWM::CStartWindow:  Fix mq_receive error handling with signal is recieved.
                          +      From Petteri Aimonen.
                          +    * NxWidgets::CNxTimer:  Replace the original (apparently non-functional) signal-
                          +      based solution with a work queue-based solution.  This raises some isses about
                          +      using the internal work queues from user space.  I have decided to implemented
                          +      user-space work queues (someday) in order to accomplish that functionaliy.
                          +      Submitted by Petteri Aimonen.
                          +    * NxWidgets:CText and NxWidgets:CNumericEdite:  Fix some memory freeing bugs
                          +      (from Petteri Aimonen).
                          +    * NxWidgets::CScrollingPanel:  Usability improvements.  It is borderless for now,
                          +      because there was no easy way to redraw only the required part of the border.
                          +      Contributed by Petteri Aimonen.
                          +    * NxWidgets::CNxWidgets and NxWM::CStartWindow: Small changes to make sub-
                          +      classing easier (from Petteri Aimonen).
                           
                           uClibc++-1.0 2011-11-05 <gnutt@nuttx.org>
                           
                          diff --git a/nuttx/ReleaseNotes b/nuttx/ReleaseNotes
                          index 5fe67a663..02cb8158d 100644
                          --- a/nuttx/ReleaseNotes
                          +++ b/nuttx/ReleaseNotes
                          @@ -3184,8 +3184,8 @@ file for build information).
                           This release corresponds with SVN release number: r5313
                           
                           Note that all SVN information has been stripped from the tarballs.  If you
                          -r5313 the SVN configuration, you should check out directly from SVN.  Revision
                          -r5206 should equivalent to release 6.22 of NuttX 6.22:
                          +need the SVN configuration, you should check out directly from SVN.  Revision
                          +r5313 should equivalent to release 6.23 of NuttX 6.23:
                           
                               svn checkout -r5313 svn://svn.code.sf.net/p/nuttx/code/trunk nuttx-code
                           
                          @@ -3249,3 +3249,194 @@ Bugfixes (see the change log for details).  Some of these are very important
                                (Mike Smith), cf[get|set]speed() (Mike Smith)
                           
                           As well as other, less critical bugs (see the ChangeLog for details)
                          +
                          +NuttX-6.24
                          +^^^^^^^^^^
                          +
                          +The 91st release of NuttX, Version 6.24, was made on December 20, 2012,
                          +and is available for download from the SourceForge website.  Note
                          +that release consists of two tarballs:  nuttx-6.24.tar.gz and
                          +apps-6.24.tar.gz.  Both may be needed (see the top-level nuttx/README.txt
                          +file for build information).
                          +
                          +This release corresponds with SVN release number: r5447
                          +
                          +Note that all SVN information has been stripped from the tarballs.  If you
                          +need the SVN configuration information, you should check out directly from
                          +SVN.  Revision r5447 should equivalent to release 6.24 of NuttX 6.24:
                          +
                          +    svn checkout -r5447 svn://svn.code.sf.net/p/nuttx/code/trunk nuttx-code
                          +
                          +Or (HTTP):
                          +
                          +    svn checkout -r5447 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code
                          +
                          +Additional new features and extended functionality:
                          +
                          +  * RTOS:
                          +
                          +    - Implemented the POSIX pause() function (still has some compiance
                          +      issues).
                          +    - Tasking logic is extended to support the notion of address
                          +      environments.  An address environment is the key notion underlying
                          +      "process" vs. tasks.  If tasks are created with address environments
                          +      (by binfmt), the OS will propogate that environment to child threads
                          +      and will destroy the address environment when the "process" exists.
                          +    - If support for the PATH variable is enabled, the OS start up logic
                          +      will create an initial environment containing the default PATH
                          +      setting (CONFIG_PATH_INITIAL).  This initial PATH will then be
                          +      inherited by all tasks.
                          +
                          +  * Binfmt
                          +
                          +    - The NuttX binary loaders have been updated to support the PATH
                          +      environment variable.  Now, if the PATH is properly defined, programs
                          +      can be executed from mass storage using only the file name.  This
                          +      feature is added to support more standard behavior (eventually, NSH
                          +      will support execution of programs in file systems by just entering
                          +      the file name, perhaps in 6.25?).
                          +    - The NXFLAT and ELF binary loaders have been extended to create
                          +      address environments for any new tasks executed from the file system.
                          +      This feature requires that the architecture support a memory management
                          +      unit (MMU) and the address environment interfaces declared in
                          +      include/nuttx/arch.h (currently, this is only supported by the z180).
                          +
                          +    * Drivers: LCD driver for the Univision UG-2864AMBAG01 OLED
                          +
                          +    * STM32: Support for STM32F100 high density chips contributed by Freddie
                          +      Chopin.
                          +
                          +    * STM32 Drivers:  Added optional RS-485 direction bit control (from
                          +      Freddie Chopin).
                          +
                          +    * STM32 Boards:
                          +
                          +      - Support for generic STM32F100RC board contributed by Freddie Chopin.
                          +      - stm32f4discovery/nxlines: STM32F4Discovery support for the
                          +        UG-2864AMBAG01 OLED.
                          +      - stm32f4discovery/winbuild:  A version of the NuttX OS test
                          +        configured to build natively on Windows.
                          +      - stm32f4discovery/elf: Now uses the PATH variable to find ELF
                          +        executables.
                          +      - configs/cloudctrl: Added for Darcy Gong's CloudController board
                          +
                          +    * PIC32 Boards: Update the Mirtool configuration for Release 2 of the
                          +      Mirtoo module.
                          +
                          +    * Calypso: Add Calypso keypad driver.  From Denis Cariki.
                          +
                          +    * ZiLOG:
                          +
                          +      - Add support for the z180 chip family and, specifically, for
                          +        the P112 retro hardware (see http://p112.feedle.net/).
                          +      - All ZiLOG configurations updated to use the current ZDS-II
                          +        and/or SDCC toolchains.
                          +
                          +    * Graphics:
                          +
                          +      - Add a semaphore handshake so that operations on buffers from
                          +        the NXMU client will be blocked until the NX server operates on the
                          +        buffer data (from Petteri Aimonen).
                          +      - nxtk_subwindowmove() and nxtk_getwindow(): Improvements to clipping
                          +        logic from Petteri Aimonen.
                          +
                          +    * C Library: lib/ sub-directory renamed libc/ (there is a new lib/ sub-
                          +      directory that is used to hold all archives).
                          +
                          +    * C++: Exception stubs from Petteri Aimonen.
                          +
                          +    * Applications:
                          +
                          +      - Add NSH hexdump command to dump the contents of a file (or character
                          +        device) to the console (contributed by Petteri Aimonen).
                          +      - Extend the NSH ifconfig command plus various DHCPC improvements
                          +        (from Darcy Gong).
                          +
                          +    * apps/examples:
                          +
                          +      - ostest: Replace large tables with algorithmic prime number
                          +        generation.  This allows the roundrobin test to run on platforms
                          +        with minimal SRAM (Freddie Chopin).
                          +      - keypadtest:  A new keypad test example contributed by Denis Carikli.
                          +      - elf and nxflat:  If CONFIG_BINFMT_EXEPATH is defined, these examples
                          +        will now use a relative path to the program and expect the binfmt/
                          +        logic to find the absolute path to the program using the PATH
                          +        variable.
                          +
                          +    * Build system:
                          +
                          +      - New top-level Makefiles: Makefile.unix and Makefile.win (along with
                          +        numerous changes to other make-related files).  This adds basic
                          +        support for building NuttX natively under Windows from a CMD.exe
                          +        window (rather than in a POSIX-like environment). This build: (1)
                          +        Uses all Windows style paths, (2) Uses primarily Windows batch
                          +        commands from cmd.exe, with (3) a few extensions from GNUWin32.
                          +
                          +        This capability should still be considered a work in progress
                          +        because: (1) it has not been verfied on all targets and tools,
                          +        and (2) still lacks some of the creature-comforts of the more
                          +        mature environments (like a function configure.sh script and
                          +        'make menuconfig' support).
                          +
                          +      - Example Windows native builds for STM32F4Discovery, eZ80, z16f, z8,
                          +        Z80, and Z180.
                          +      - Several configurations have been converted to work the kconfig-
                          +        frontends mconf configuration tool: stm32f4discovery/nxlines, and
                          +        all eZ80, z16f, z8, Z80, and Z180 configurations.
                          +      - Architectures now include a common Toolchain.defs file that can be
                          +        used to manage toolchains in a more configurable way (most of this
                          +        contributed by Mike Smith).
                          +
                          +    * Build tools: 
                          +
                          +      - Renamed tools/winlink.sh to tools/copydir.sh.
                          +      - Several new tools/scripts to support the Windows native build:
                          +        tools/mkdeps.bat, tools/mkdeps.c, tools/link.bat, unlink.bat, and
                          +        copydir.bat.
                          +      - tools/incdir.sh and incdir.bat now support an -s option to generate
                          +        system header file paths.
                          +      - tools/b16.c: Fixed precision math conversion utility.
                          +
                          +Bugfixes (see the change log for details).  Some of these are very important
                          +(marked *critical*):
                          +
                          +    * RTOS: Fix some backward conditional compilation in the work queue
                          +      logic (Freddie Chopin).
                          +
                          +    * File System: Uninitialized variable caused assertions (from Lorenz
                          +      Meier).
                          +
                          +    * Drivers: Partial fix for STM32 OTGFS device drivers and fix for short,
                          +      unaligned writes in the flash translation layer (drivers/mtd/ftl.c),
                          +      both from Petteri Aimonen.
                          +
                          +    * STM32 Drivers:
                          +
                          +      - Qencoder driver and TIM3 driver fixes from Ryan Sundberg.
                          +      - Fix timeout delay calculation in the STM32 OTG FS host driver.
                          +
                          +    * LPC17xx Drivers:  Resources not being properly released when I2C
                          +      driver is un-initialized.
                          +
                          +    * Graphics:
                          +
                          +      - Fix logic when the mouse drags outside of the window; fix
                          +        another "blocked message" handling case (both from Petteri Aimonen).
                          +      - nxtk_filltrapwindow():  Correct an offset problem (also from Peterri
                          +        Aimonen).
                          +      - nxglib_splitline():  Correct the "fat flat line" bug.
                          +
                          +    * C Library:
                          +
                          +      - nrand() changes to prevent coefficients from becoming zero which
                          +        would "lock up" the random number generate.
                          +      - Add rounding functions to the math library (contributed by Petteri
                          +        Aimonen).
                          +
                          +    * Build system:  Changes to MIN definitions in all limit.h header files
                          +      to avoid integer overflows.  For example from (-128) to (-127 - 1)
                          +      (from Petteri Aimonen).
                          +
                          +    * Applications: Modbus fixes from Freddie Chopin.
                          +
                          +As well as other, less critical bugs (see the ChangeLog for details)
                          -- 
                          cgit v1.2.3