From 99cc52c0763dea695fc740ed2dcfaed7468febd5 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 23 Nov 2012 14:13:57 +0000 Subject: [PATCH 001/157] 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 --- NxWidgets/ChangeLog.txt | 1 - 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 ++++- 44 files changed, 731 insertions(+), 623 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 diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt index 65022ea150..f932d5bc22 100644 --- a/NxWidgets/ChangeLog.txt +++ b/NxWidgets/ChangeLog.txt @@ -212,4 +212,3 @@ user-space work queues (someday) in order to accomplish that functionaliy. Submitted by Petteri Aimonen. - solutions diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 103c03de3e..6fad0d0ba9 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 eb3bfe85b3..3233918ca4 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 0000000000..0d08d89a8e --- /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 0000000000..defe30b51b --- /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 e39d7f4141..e214ce8bd0 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 4ebd26d5f3..41b6c72d3f 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 99228aa2c1..3c18452dfc 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 0000000000..96eb273f64 --- /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 12cc033cbc..2e604cade4 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 0000000000..6a4b1234ef --- /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 554e5f044f..bd509b86c8 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 63fa5d41f3..56e31ba7f4 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 15c31f1923..e7f998dc75 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 68d0192274..37e15dc9b5 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 aa84884d06..bccb350691 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 2912bf3187..fcfc0792f3 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 a061eb22cf..1bfd6f4d53 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 ba750e2122..9c8780a4aa 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 c142319dea..f71a0920e3 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 ef64e26157..1b1eb45d5a 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 7393606158..7155ccf5c5 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 7aa57e3ae0..da57945bde 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 f69eb5e957..45168938a8 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 583f1d8d8a..1b0f2c8ce1 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 69073bb438..a40098fff6 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 488884ba58..89c137a03c 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 1a6a38e7ca..d85e53525f 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 8c5b7e93b9..86dd3f815b 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 fa61494062..088dc79767 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 9b2ab9e5e2..9312ae0600 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 69c20da944..fb208f85c4 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 252416f6bf..cc62a030a9 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 0cdb9f05dc..1c8893289b 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 64bb4494b4..6d2a223df5 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 5fba7e2142..a7fce92f42 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 2c007cd390..2d8218bad1 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 1e3388e70d..8695dbb89c 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 30349e1ff0..951f4a87ec 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 9c7cb8268f..d09279a8db 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 63c9db51f2..e65958cfe9 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 6474a772e1..ba3878521f 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 093c5bd2e3..f7383fc9a5 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 1e862aae12..af83f8517e 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 From 24b649553719312f79127bba841818a43a00fd8a Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 23 Nov 2012 15:49:06 +0000 Subject: [PATCH 002/157] 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(-) diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt index f932d5bc22..c3ae00d6a5 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 e0df014c5e..993e86fb80 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 688031d883..caa0c02e8b 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 6fad0d0ba9..bf7e051686 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 c2e4409239..d6fcecc114 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 6c1861ef8c..c7f97b25ac 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 45980f2889..14ee1e7549 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 84892b67e3..cbf2d5ff37 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 c1032f1e75..55c051ffd7 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); } From 632d7a57b137ee963d58c9853eb9c4b9d66a586e Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 25 Nov 2012 18:00:40 +0000 Subject: [PATCH 003/157] 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(-) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index bf7e051686..f178635573 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 02b12ec873..80a9392dc9 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 6f52ef739e..3bde8fb7a5 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 From 7a88e307e8a013e8f3a99e8fa20f5daf08482d62 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 25 Nov 2012 20:58:39 +0000 Subject: [PATCH 004/157] 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 +++++-- .../configs/ez80f910200kitg/ostest/defconfig | 3 +- .../ez80f910200kitg/scripts/setenv.bat | 50 +++++++++++++++++++ .../scripts}/setenv.bat | 2 +- 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 +-- 19 files changed, 127 insertions(+), 59 deletions(-) create mode 100644 nuttx/configs/ez80f910200kitg/scripts/setenv.bat rename nuttx/configs/{ez80f910200kitg/ostest => ez80f910200zco/scripts}/setenv.bat (95%) diff --git a/nuttx/Makefile.unix b/nuttx/Makefile.unix index 78c34c2de5..5ecdabb643 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 6257dbdc85..34da12ad09 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 28ffa1387f..fcc418a0e9 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 7a145017c4..a3c6639f50 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 222a25db1f..004f607d4a 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 e061e6289f..757916281c 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/scripts/setenv.bat b/nuttx/configs/ez80f910200kitg/scripts/setenv.bat new file mode 100644 index 0000000000..3a1b987b4d --- /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/ez80f910200kitg/ostest/setenv.bat b/nuttx/configs/ez80f910200zco/scripts/setenv.bat similarity index 95% rename from nuttx/configs/ez80f910200kitg/ostest/setenv.bat rename to nuttx/configs/ez80f910200zco/scripts/setenv.bat index f461cf1cc2..88fc6cbf31 100644 --- a/nuttx/configs/ez80f910200kitg/ostest/setenv.bat +++ b/nuttx/configs/ez80f910200zco/scripts/setenv.bat @@ -1,6 +1,6 @@ @echo off -rem configs/ez80f810200kitg/ostest/setenv.bat +rem configs/ez80f910200zco/scripts/setenv.bat rem rem Copyright (C) 2012 Gregory Nutt. All rights reserved. rem Author: Gregory Nutt diff --git a/nuttx/drivers/Makefile b/nuttx/drivers/Makefile index 13a5078236..b2bf1b6119 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 425193f7e5..89cc5bd3f7 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 2745fcfff0..78dfbff30e 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 8afd76f89e..10e6db62fb 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 8b6d300523..1b445b6a78 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 0ba5efb7f1..06e689c753 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 9e6307ae21..e3452120dd 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 17750831ec..1713edb994 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 782c185452..e43693b290 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 91753ef318..ebb5226950 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 86ea90e25e..fa8e8acb54 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 From 7d61592105d0a53960d2129f3feee7615ec17833 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 26 Nov 2012 13:22:51 +0000 Subject: [PATCH 005/157] 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(-) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index f178635573..5c85d4bb63 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 5ecdabb643..d66c06bd82 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 2807e1a47a..99dde32093 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 335992524c..ac72fb60bc 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 14ee1e7549..c6c0b23827 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 */ From f1883fb2da23a440533ac6869f1fae823da4c5b1 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 26 Nov 2012 15:06:50 +0000 Subject: [PATCH 006/157] 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 +++--- .../configs/ez80f910200kitg/ostest/Make.defs | 26 ++++++------------- .../configs/ez80f910200kitg/ostest/setenv.sh | 7 +++-- nuttx/configs/olimex-stm32-p107/nsh/Make.defs | 6 +++++ .../olimex-stm32-p107/ostest/Make.defs | 6 +++++ 6 files changed, 30 insertions(+), 25 deletions(-) diff --git a/nuttx/arch/arm/src/lpc31xx/lpc31_usbdev.c b/nuttx/arch/arm/src/lpc31xx/lpc31_usbdev.c index 255f28da14..386abb5b86 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 a3c6639f50..1615763d1a 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 9f787ef1bb..607a5adb72 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 ce3ea8b53b..42003ccb6d 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 98871a47de..93677479f4 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 75f0ed8817..7a27f7755f 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 From aca95c773056329af4e38f629d43f55b327b1068 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 26 Nov 2012 17:07:34 +0000 Subject: [PATCH 007/157] 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 | 103 ++- nuttx/configs/ez80f910200zco/dhcpd/setenv.sh | 35 +- nuttx/configs/ez80f910200zco/httpd/Make.defs | 102 ++- nuttx/configs/ez80f910200zco/httpd/setenv.sh | 37 +- .../configs/ez80f910200zco/nettest/Make.defs | 102 ++- .../configs/ez80f910200zco/nettest/setenv.sh | 35 +- nuttx/configs/ez80f910200zco/nsh/Make.defs | 102 ++- nuttx/configs/ez80f910200zco/nsh/setenv.sh | 37 +- nuttx/configs/ez80f910200zco/ostest/Make.defs | 164 ++-- nuttx/configs/ez80f910200zco/ostest/appconfig | 39 - nuttx/configs/ez80f910200zco/ostest/defconfig | 810 ++++++++++-------- nuttx/configs/ez80f910200zco/ostest/setenv.sh | 35 +- nuttx/configs/ez80f910200zco/poll/Make.defs | 102 ++- nuttx/configs/ez80f910200zco/poll/setenv.sh | 35 +- .../configs/z16f2800100zcog/ostest/Make.defs | 93 +- .../z16f2800100zcog/pashello/Make.defs | 103 ++- nuttx/configs/z8encore000zco/ostest/Make.defs | 114 ++- nuttx/configs/z8f64200100kit/ostest/Make.defs | 114 ++- 21 files changed, 1201 insertions(+), 1020 deletions(-) delete mode 100644 nuttx/configs/ez80f910200zco/ostest/appconfig diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 5c85d4bb63..a325773653 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 5b6d7e6d2e..6bde573f60 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 d39c419e01..bc4e11e27c 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 d8e7d33fe4..2999e15d64 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) +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) +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 75e873a7fc..63367b4d57 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 -# -# 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. -# -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" +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_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 2a8ffb04f1..1c2ef3b611 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) +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) +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 75e873a7fc..1abd9c037d 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 -# -# 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. -# -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" +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_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 95a5b4201b..bfd958568a 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) +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) +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 8a03824086..deda4bc07b 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 -# -# 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. -# -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" +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_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 978e406b78..3bc219ab9e 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) +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) +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 8bfe02b2f4..969ec9df2a 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 -# -# 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. -# -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" +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_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 1a2759cff3..fa60dac053 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 + + # 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)"} + + # 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"} + + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' endif -# 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)"} - -# 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"} - # 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 + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ASSEMBLE + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ARCHIVE + 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 - @#echo "CC: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) endef define ASSEMBLE - @#echo "AS: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) -define ARCHIVE - echo "AR: $2"; - $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) -endef -else 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 987de079e8..0000000000 --- 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 7ffd452ee1..b443fdf93c 100644 --- a/nuttx/configs/ez80f910200zco/ostest/defconfig +++ b/nuttx/configs/ez80f910200zco/ostest/defconfig @@ -1,175 +1,178 @@ -############################################################################ -# configs/ez80f910200zco/ostest/defconfig # -# Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +CONFIG_NUTTX_NEWCONFIG=y + # -# 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. +# Build Setup # -# 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. +# 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 # -# Architecture selection +# CONFIG_APPS_DIR="../apps" +# CONFIG_BUILD_2PASS is not set + # -CONFIG_ARCH="z80" +# 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_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 Peripheral Support +# +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_ARCH_TIMERHOOK=y # -# eZ80 specific device driver settings +# Architecture Options # -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_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_STACKDUMP is not set # -# ez80 EMAC +# Board Settings # -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_DRAM_START= +CONFIG_DRAM_SIZE=65536 # -# General build options +# Boot options # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_MOTOROLA_SREC=n -CONFIG_RAW_BINARY=n +# 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="ostest_main" -CONFIG_DEBUG=y -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y +# CONFIG_ARCH_BOARD_EZ80F910200KITG is not set +CONFIG_ARCH_BOARD_EZ80F910200ZCO=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="ez80f910200zco" + +# +# Common Board Options +# +CONFIG_ARCH_HAVE_LEDS=y +CONFIG_ARCH_LEDS=y +CONFIG_ARCH_HAVE_BUTTONS=y +# CONFIG_ARCH_BUTTONS is not set + +# +# 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_START_YEAR=2009 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=28 -CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=y +# 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=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 - -# -# 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_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_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 -# -# Misc libc settings -# -CONFIG_NOPRINTF_FIELDWIDTH=n - -# -# 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) # @@ -179,244 +182,311 @@ 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 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 - -# -# Filesystem configuration -# -CONFIG_FS_FAT=n -CONFIG_FS_ROMFS=n - -# -# Maintain legacy build behavior (revisit) -# - -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y - -# -# SPI-based MMC/SD driver -# -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_EXAMPLES_OSTEST_LOOPS=1 -CONFIG_EXAMPLES_OSTEST_STACKSIZE=2048 -CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3 - -# -# 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 - # # Stack and heap information # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=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 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= + +# +# 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 + +# +# UART0 Configuration +# +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 + +# +# 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_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 + +# +# Interpreters +# + +# +# 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 +# + +# +# 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 6150434efc..d8545d5aae 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 -# -# 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. -# -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" +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_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 c9a9a83ea0..2d844f742c 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) +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) +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 1628f105b3..4370bcb45c 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 -# -# 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. -# -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" +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_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 e6b5ab4c69..e094f4ce6f 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) +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) +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 e06d1dc0bf..c06dc0d49b 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) +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) +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 3991f68675..55e351a79a 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) +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) +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 5987934c3c..6de98cc874 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) +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) +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 = From 285cd255991c1b077d657ea0b3ec376ac67fa5c9 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 26 Nov 2012 18:39:49 +0000 Subject: [PATCH 008/157] 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 | 158 +++++++++++------ nuttx/configs/ez80f910200zco/httpd/Make.defs | 158 +++++++++++------ .../configs/ez80f910200zco/nettest/Make.defs | 158 +++++++++++------ nuttx/configs/ez80f910200zco/nsh/Make.defs | 160 ++++++++++++------ nuttx/configs/ez80f910200zco/ostest/defconfig | 8 +- nuttx/configs/ez80f910200zco/poll/Make.defs | 158 +++++++++++------ nuttx/configs/ez80f910200zco/src/Makefile | 2 +- 9 files changed, 530 insertions(+), 280 deletions(-) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index a325773653..4876098ed3 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 b7d9f84d1e..b4700433b7 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 2999e15d64..c914fc2630 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 + + # 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)"} + + # 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"} + + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' endif -# 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)"} - -# 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"} - # 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 + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ASSEMBLE + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ARCHIVE + 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 - @#echo "CC: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) endef define ASSEMBLE - @#echo "AS: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) -define ARCHIVE - echo "AR: $2"; - $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) -endef -else 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 1c2ef3b611..5a8af2d340 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 + + # 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)"} + + # 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"} + + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' endif -# 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)"} - -# 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"} - # 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 + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ASSEMBLE + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ARCHIVE + 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 - @#echo "CC: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) endef define ASSEMBLE - @#echo "AS: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) -define ARCHIVE - echo "AR: $2"; - $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) -endef -else 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 bfd958568a..f5cbc8f809 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 + + # 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)"} + + # 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"} + + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' endif -# 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)"} - -# 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"} - # 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 + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ASSEMBLE + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ARCHIVE + 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 - @#echo "CC: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) endef define ASSEMBLE - @#echo "AS: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) -define ARCHIVE - echo "AR: $2"; - $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) -endef -else 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 3bc219ab9e..f0b8aa7c15 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 + + # 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)"} + + # 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"} + + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' endif -# 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)"} - -# 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"} - # 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 + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ASSEMBLE + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ARCHIVE + 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 - @#echo "CC: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) endef define ASSEMBLE - @#echo "AS: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) -define ARCHIVE - echo "AR: $2"; - $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) -endef -else 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 b443fdf93c..c82a60e3a6 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 2d844f742c..e1eefdd032 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 + + # 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)"} + + # 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"} + + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' endif -# 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)"} - -# 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"} - # 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 + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ASSEMBLE + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ARCHIVE + 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 - @#echo "CC: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) endef define ASSEMBLE - @#echo "AS: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) -define ARCHIVE - echo "AR: $2"; - $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) -endef -else 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 216f422902..d9f028f116 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)} From 8c5b57d449bae1b9f5b3b501356e486439f93ae0 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 27 Nov 2012 15:09:12 +0000 Subject: [PATCH 009/157] 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 | 523 ++++++++++-------- nuttx/configs/z8f64200100kit/ostest/Make.defs | 184 +++--- nuttx/configs/z8f64200100kit/ostest/setenv.sh | 39 +- .../configs/z8f64200100kit/scripts/setenv.bat | 50 ++ 8 files changed, 493 insertions(+), 315 deletions(-) create mode 100644 nuttx/configs/z8f64200100kit/scripts/setenv.bat diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index c1c5189c43..3d09915c38 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 9d7b036d38..8e91ab5723 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 bf0394b9d5..eb564973f0 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 4876098ed3..9e8ddf44d8 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 48d6fefce1..935dbfa0ce 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 */ + 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 */ + 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 */ + 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); + int ret = -1; - putreg32(I2C_CONCLR_STAC|I2C_CONCLR_SIC,priv->base+LPC17_I2C_CONCLR_OFFSET); - putreg32(I2C_CONSET_STA,priv->base+LPC17_I2C_CONSET_OFFSET); + sem_wait(&priv->mutex); - wd_start (priv->timeout, I2C_TIMEOUT, i2c_timeout, 1, (uint32_t)priv); - sem_wait(&priv->wait); - wd_cancel (priv->timeout); - sem_post (&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); - if( priv-> state == 0x18 || priv->state == 0x28) - ret=priv->wrcnt; - else if( priv-> state == 0x50 || priv->state == 0x58) - ret=priv->rdcnt; - return ret; + 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; + 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_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); + 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; + 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_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); + 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 6de98cc874..80a79eca46 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 + + # 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 + + 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 -# 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 - -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 @@ -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 + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ASSEMBLE + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ARCHIVE + 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 - @#echo "CC: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) endef define ASSEMBLE - @#echo "AS: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) -define ARCHIVE - echo "AR: $2"; - $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) -endef -else 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 166ed9e0c9..1a135a7d68 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 -# -# 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. -# -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" +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_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 0000000000..4281d5b117 --- /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% From 3c20b3a3cde677efa2963609d44954bfaf9c19a1 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 27 Nov 2012 16:26:54 +0000 Subject: [PATCH 010/157] 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 diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index 3d09915c38..0b4f58e77c 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 f5e15c8dc5..b343202305 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 59f0538f08..bc626e6995 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 d28fe873d0..371d304606 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 bb1c73dffe..58d2383126 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 abdf5c321e..27068acff0 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 9e8ddf44d8..810e0eb40a 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 1b14f96f61..0b5f7aa11b 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 5f5e86ebc4..3afdb9cb83 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 37c944f4d4..e04853115d 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 0000000000..55018edd46 --- /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 efc15c73d4..7c4d983a14 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 b70a6e9ce9..28c42c3925 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 0000000000..e2978e54a9 --- /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; +} From 8cad4a664b6745ba30bcc8c08c8754f6a51a6383 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 27 Nov 2012 17:22:32 +0000 Subject: [PATCH 011/157] 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(-) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 810e0eb40a..4b09926805 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 80a79eca46..05c2b1593b 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 abd86f7710..5646b06a1b 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(); From 6c26fa6537b1a94defc0c842677f0d812a35b123 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 28 Nov 2012 14:08:09 +0000 Subject: [PATCH 012/157] 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 +- .../configs/compal_e88/nsh_highram/Make.defs | 2 +- .../compal_e99/nsh_compalram/Make.defs | 2 +- .../configs/compal_e99/nsh_highram/Make.defs | 2 +- .../configs/ez80f910200kitg/ostest/Make.defs | 2 +- nuttx/configs/ez80f910200zco/dhcpd/Make.defs | 2 +- nuttx/configs/ez80f910200zco/httpd/Make.defs | 2 +- .../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 +- .../configs/z16f2800100zcog/ostest/Make.defs | 2 +- .../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 diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 4b09926805..170a554537 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 db37ef02ba..4b53c3b7cb 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 0000000000..aeb16eb4d9 --- /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 45a567ec43..d062993594 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 0db0a8dc9c..bd7dcf80c3 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 8d3a3adc1c..5feb144005 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 c834591732..b683df3ecd 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 2d65c2782f..a9454b0eca 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 f93a01f04c..61f5a5f6e4 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 2d65c2782f..a9454b0eca 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 607a5adb72..98296a51b6 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 c914fc2630..8671fdd518 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 5a8af2d340..a07580a321 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 f5cbc8f809..d13428a346 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 f0b8aa7c15..7a74bc3063 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 fa60dac053..5d3d4689eb 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 e1eefdd032..98ca225331 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 6f6ae7ad07..28b7f73a0c 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 5cf9fadf13..154d36556c 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 fcda184774..595bcf4fd6 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 379342a5d2..6fe4633889 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 2c3e3302fd..0eac402ab2 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 5823a1361b..ae26822d5e 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 367d2d9506..30caae7fd4 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 e094f4ce6f..b127a6b7ff 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 c06dc0d49b..2ac7aff1e5 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 40d934f1df..11253020eb 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 4905e82a31..d0185b4f9a 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 51bfd1d283..16d3ff3423 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 55e351a79a..9f033c20ae 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 05c2b1593b..570fd0f1b1 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) From 18b90c8848ca96919258e7df6dfd33a4ec7708d0 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 28 Nov 2012 15:53:42 +0000 Subject: [PATCH 013/157] 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 | 191 ++++++++++++------ nuttx/configs/z8encore000zco/ostest/setenv.sh | 37 ++-- .../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, 334 insertions(+), 101 deletions(-) create mode 100644 nuttx/configs/z8encore000zco/scripts/setenv.bat diff --git a/nuttx/arch/arm/src/calypso/calypso_keypad.c b/nuttx/arch/arm/src/calypso/calypso_keypad.c index aeb16eb4d9..d7f8ec780a 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 fd871e2462..a4bb830fd3 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 de6506490c..0bac6aed1a 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 7738f24362..45089947ca 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 e7f705cfda..3732a32a39 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 9abc06f050..d37ee23029 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 9f033c20ae..bbb9a9ddc4 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 + + # 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 + + 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 -# 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 - -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 @@ -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 + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ASSEMBLE + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ARCHIVE + 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 - @#echo "CC: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) endef define ASSEMBLE - @#echo "AS: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) -define ARCHIVE - echo "AR: $2"; - $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) -endef -else 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 5aa816dd96..e866ad7408 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 -# -# 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. -# -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" +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_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 0000000000..f208a6e8bb --- /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 afe6475653..1bb70ebb7e 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 570fd0f1b1..8b58a73463 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 1a135a7d68..b06ae60f94 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 e1722a4d8d..5434bb8474 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 cbc26fb26f..cc83172238 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) From afd86a08b5fb4b12ac25c23824e8c9592c5f265c Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 28 Nov 2012 17:50:28 +0000 Subject: [PATCH 014/157] 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 +- .../configs/ez80f910200kitg/ostest/Make.defs | 11 +- nuttx/configs/ez80f910200zco/dhcpd/Make.defs | 11 +- nuttx/configs/ez80f910200zco/httpd/Make.defs | 11 +- .../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 | 599 ++++++++++++----- nuttx/configs/z8f64200100kit/ostest/appconfig | 39 -- nuttx/configs/z8f64200100kit/ostest/defconfig | 612 +++++++++++++----- 17 files changed, 968 insertions(+), 471 deletions(-) delete mode 100644 nuttx/configs/z8encore000zco/ostest/appconfig delete mode 100644 nuttx/configs/z8f64200100kit/ostest/appconfig diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 170a554537..97b5b74a06 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 bbe99c17c2..5cee40628b 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 a2764cb653..12ab5dc0b2 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 6bde573f60..d257ca285a 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 1f0289f7ce..2bf89905ef 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 70b3ed76ec..a89e7cdeae 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 98296a51b6..0124684c67 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 8671fdd518..f227a046ce 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 a07580a321..398a6ec5d1 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 d13428a346..02b6a22a26 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 7a74bc3063..6a0c9bb73e 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 5d3d4689eb..727c68ba3b 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 98ca225331..d7ba08ec0f 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 212b52f727..0000000000 --- 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 05e7c906c0..a79355b711 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 +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +CONFIG_NUTTX_NEWCONFIG=y + # -# 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. +# Build Setup # -# 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. +# 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 # -# Architecture selection +# 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 -# -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 # -# General build options +# Boot options # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n +# 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="ostest_main" -CONFIG_DEBUG=y -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y +CONFIG_ARCH_BOARD_Z8ENCORE000ZCO=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="z8encore000zco" + +# +# Common Board Options +# +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_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_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 - -# -# 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 @@ -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,76 +174,310 @@ 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 CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 -# -# 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 - -# -# Settings for examples/ostest -CONFIG_EXAMPLES_OSTEST_LOOPS=1 -CONFIG_EXAMPLES_OSTEST_STACKSIZE=256 - -# -# 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 - # # Stack and heap information # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=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 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# 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 + +# +# 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 + +# +# 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 # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# 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 + +# +# Interpreters +# + +# +# 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 +# + +# +# 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/z8f64200100kit/ostest/appconfig b/nuttx/configs/z8f64200100kit/ostest/appconfig deleted file mode 100644 index e6f0c23750..0000000000 --- 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 bed04a40e5..2389a0d346 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 +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration # -# 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_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_ENDIAN_BIG=y -CONFIG_DRAM_SIZE=65536 -CONFIG_ARCH_LEDS=n -# -# ez8 specific device driver settings -# -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_NUTTX_NEWCONFIG=y # -# General build options +# Build Setup # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n +# 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 # -# General OS setup +# 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_USER_ENTRYPOINT="ostest_main" CONFIG_DEBUG=y -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=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="z8" +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 + +# +# 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_Z8F64200100KIT=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="z8f64200100kit" + +# +# Common Board Options +# +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,76 +174,310 @@ 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 CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 -# -# 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 - -# -# Settings for examples/ostest -CONFIG_EXAMPLES_OSTEST_LOOPS=1 -CONFIG_EXAMPLES_OSTEST_STACKSIZE=256 - -# -# 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 - # # Stack and heap information # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=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 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# 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 + +# +# 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 + +# +# 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 # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# 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 + +# +# Interpreters +# + +# +# 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 +# + +# +# 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 From 724d3c4c0dd93354fb02cc64972448e4ea7e00a0 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 29 Nov 2012 13:58:53 +0000 Subject: [PATCH 015/157] 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 +- .../configs/z8encore000zco/scripts/setenv.bat | 2 +- .../configs/z8f64200100kit/scripts/setenv.bat | 2 +- 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/apps/nshlib/nsh_apps.c b/apps/nshlib/nsh_apps.c index e335c2e2c2..7dbaf9ba8d 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 31d8dbb0cc..c9f2160274 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 f208a6e8bb..407cca97fe 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 4281d5b117..e0526d988a 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/. From cdada458a18eaf892b3791e4ace1c42535350495 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 29 Nov 2012 15:24:27 +0000 Subject: [PATCH 016/157] 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 ++ .../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 diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index 0b4f58e77c..29a54461ac 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 97b5b74a06..e0ca6c8dce 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 0000000000..4ee67c97eb --- /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 bbb9a9ddc4..9ce0052607 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 21117dd531..30a4a6285d 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 8b58a73463..85cb5c4015 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 c9b7a6dc2d..21087e6b82 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)} From 83b590b946b88b07b42eb8214ec9a5bed2ed2928 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 29 Nov 2012 16:48:29 +0000 Subject: [PATCH 017/157] 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 | 32 +++- nuttx/arch/z16/src/common/up_doirq.c | 4 +- nuttx/arch/z16/src/common/up_internal.h | 2 +- nuttx/configs/z16f2800100zcog/README.txt | 32 +++- .../configs/z16f2800100zcog/ostest/Make.defs | 179 ++++++++++++------ .../configs/z16f2800100zcog/ostest/setenv.sh | 34 ++-- .../z16f2800100zcog/pashello/Make.defs | 179 ++++++++++++------ .../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, 347 insertions(+), 166 deletions(-) diff --git a/nuttx/arch/z16/include/z16f/irq.h b/nuttx/arch/z16/include/z16f/irq.h index 83b251e81b..e470ddfcb4 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 b34d91c687..f209dcaed8 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 ($(COMPILER),zneocc.exe) -WARCHSRCDIR := ${shell cygpath -w $(ARCHSRCDIR)} -USRINCLUDES = -usrinc:'.;$(WTOPDIR)\sched;$(WARCHSRCDIR);$(WARCHSRCDIR)\common' + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + USRINCLUDES = -usrinc:'.;$(TOPDIR)/sched;$(ARCHSRCDIR);$(ARCHSRCDIR)/common' else -WARCHSRCDIR = $(ARCHSRCDIR) -USRINCLUDES = -I$(TOPDIR)/sched -I$(ARCHSRCDIR) -I$(ARCHSRCDIR)/common +ifeq ($(COMPILER),zneocc.exe) + WARCHSRCDIR := ${shell cygpath -w $(ARCHSRCDIR)} + USRINCLUDES = -usrinc:'.;$(WTOPDIR)\sched;$(WARCHSRCDIR);$(WARCHSRCDIR)\common' +else + 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 e8f40fb563..670e6985d4 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 4d07392d93..2c1968e8d3 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 64f90b9b9a..55ed22b10f 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 b127a6b7ff..1cd4250638 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,44 +33,68 @@ # ############################################################################ -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 + 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)"} + + # 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"} + + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' 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)"} - -# 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"} - # Assembler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) @@ -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 + $(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + $(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ASSEMBLE + $(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"} +endef + +define ARCHIVE + 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 - @#echo "CC: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) endef define ASSEMBLE - @#echo "AS: $1" $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) endef -ifeq ($(CONFIG_WINDOWS_NATIVE),y) -define ARCHIVE - echo "AR: $2"; - $(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G ) -endef -else 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 bddcad2b5b..8a696fdcbb 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 + # -# 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. +# This is the Cygwin path to location where the XDS-II tools were installed # -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" +TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/ZiLOG/ZDSII_ZNEO_5.0.1/bin" + +# +# 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. +# +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 2ac7aff1e5..10a5ee6893 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,44 +33,68 @@ # ############################################################################ -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 + 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)"} + + # 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"} + + # CFLAGs + + ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)' + ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)' + ARCHUSRINCLUDES = -usrinc:'.' 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)} - -# 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"} - # Assembler definitions ifeq ($(CONFIG_DEBUG_SYMBOLS),y) @@ -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 f957b23cbb..2db93c5ef7 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 + # -# 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. +# This is the Cygwin path to location where the XDS-II tools were installed # -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" +TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/ZiLOG/ZDSII_ZNEO_5.0.1/bin" + +# +# 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. +# +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 d37ee23029..9ec1b80afc 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 1bb70ebb7e..7356c8e87d 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 64b045bc27..3caa615834 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 */ From c9230359ef3da96b4aa2517475eb910e25ea1620 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 29 Nov 2012 18:44:02 +0000 Subject: [PATCH 018/157] 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 | 32 +- 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 +- .../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 +- .../configs/stm3240g-eval/discover/defconfig | 4 +- nuttx/configs/stm3240g-eval/xmlrpc/defconfig | 4 +- .../configs/stm32f100rc_generic/nsh/defconfig | 4 +- .../stm32f100rc_generic/ostest/defconfig | 4 +- .../stm32f4discovery/cxxtest/defconfig | 4 +- nuttx/configs/stm32f4discovery/elf/defconfig | 4 +- .../stm32f4discovery/nxlines/defconfig | 4 +- .../configs/stm32f4discovery/ostest/defconfig | 4 +- .../stm32f4discovery/winbuild/defconfig | 4 +- nuttx/configs/z16f2800100zcog/README.txt | 66 +- .../configs/z16f2800100zcog/ostest/appconfig | 39 -- .../configs/z16f2800100zcog/ostest/defconfig | 633 +++++++++++++----- .../z16f2800100zcog/pashello/defconfig | 621 ++++++++++++----- 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, 1085 insertions(+), 506 deletions(-) delete mode 100644 nuttx/configs/z16f2800100zcog/ostest/appconfig diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index 29a54461ac..6738380676 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 5876b9d2a8..bb525c9250 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"} -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) +ASRCS = +CSRCS = pashello.c device.c -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) + +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 b8c19b6a43..8f9fc8b22b 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 34cbf2eeee..6e7d1ac4fc 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 2fc4b26d47..5d808d5d6b 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 1860a15918..ba6a7bc356 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 396fae834c..aa041eb23c 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 ($(WINTOOL),y) - BIN = "${shell cygpath -w $(APPDIR)$(DELIM)libapps$(LIBEXT)}" +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + BIN = ..\..\libapps$(LIBEXT) else - BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = ..\\..\\libapps$(LIBEXT) +else + 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 e0ca6c8dce..f986619a3d 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 5cee40628b..6e55a57448 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 3233918ca4..9fa73782d9 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 c642f7152d..772b6f6632 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 a806e6ed11..52ea95c29a 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 826720ee7a..5efc061a5e 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 a89e7cdeae..bc37597229 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 5547333d88..440cb3e0b1 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 004f607d4a..e314b0fe1a 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 757916281c..0e399cfc73 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 bc4e11e27c..1bc9e56b81 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 c82a60e3a6..7597bcfd65 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 f126c51fd6..8e371686ba 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 c1e1818a5f..4c73b7a6c2 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 a5ccc8bfbe..ccc411a4d2 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 82884f4c3f..e8f189282b 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 1f99a63338..9c1da5494c 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 708c82a79d..26d132cd03 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 d7165573c9..aefa05326a 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 308203e273..dd72d6ab39 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 b5698ad189..41bb865926 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 92faa7f032..c56503e1f7 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 6648d3b132..1b3df6d32e 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 e4702507c3..8d98fe6968 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 286dd55ed6..4de3a09228 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 da7c8d200a..d260a87cbd 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 e52719f256..311dd075d6 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 55ed22b10f..0c69c75bca 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 a0f5d2462f..0000000000 --- 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 16f0177784..027d6d73c9 100644 --- a/nuttx/configs/z16f2800100zcog/ostest/defconfig +++ b/nuttx/configs/z16f2800100zcog/ostest/defconfig @@ -1,151 +1,175 @@ -############################################################################ -# configs/z16f2800100zcog/ostest/defconfig # -# Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration # -# 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" -CONFIG_ARCH_Z16=y -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 -# -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_NUTTX_NEWCONFIG=y # -# General build options +# Build Setup # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n +# 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 # -# General OS setup +# 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_USER_ENTRYPOINT="ostest_main" CONFIG_DEBUG=y -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=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_BOARD_LOOPSPERMSEC=1250 + +# +# Z16 Configuration Options +# +# 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 + +# +# 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_ARCH_STACKDUMP is not set +CONFIG_ENDIAN_BIG=y + +# +# Board Settings +# +CONFIG_DRAM_START= +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_Z16F2800100ZCOG=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="z16f2800100zcog" + +# +# Common Board Options +# +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_START_YEAR=2008 -CONFIG_START_MONTH=1 -CONFIG_START_DAY=28 -CONFIG_JULIAN_TIME=n +# 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=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 - -# -# 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_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_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 -# -# 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,71 +179,314 @@ 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 CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=4 -# -# 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 - -# -# 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 - # # Stack and heap information # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n +# 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_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# 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 + +# +# 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 + +# +# 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 + +# +# System Logging Device Options # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# 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 +# + +# +# 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 eec7b15752..c9f0d96731 100644 --- a/nuttx/configs/z16f2800100zcog/pashello/defconfig +++ b/nuttx/configs/z16f2800100zcog/pashello/defconfig @@ -1,151 +1,175 @@ -############################################################################ -# configs/z16f2800100zcog/pashello/defconfig # -# Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration # -# 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" -CONFIG_ARCH_Z16=y -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 -# -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_NUTTX_NEWCONFIG=y # -# General build options +# Build Setup # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n +# 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 # -# General OS setup +# 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_USER_ENTRYPOINT="pashello_main" CONFIG_DEBUG=y -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=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_BOARD_LOOPSPERMSEC=1250 + +# +# Z16 Configuration Options +# +# 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 + +# +# 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_ARCH_STACKDUMP is not set +CONFIG_ENDIAN_BIG=y + +# +# Board Settings +# +CONFIG_DRAM_START= +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_Z16F2800100ZCOG=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="z16f2800100zcog" + +# +# Common Board Options +# +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 - -# -# 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_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_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 -# -# 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,71 +179,308 @@ 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 CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=4 -# -# 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 - -# -# 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 - # # Stack and heap information # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n +# 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_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# 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 + +# +# 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 + +# +# 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 + +# +# System Logging Device Options # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# 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 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/z8encore000zco/README.txt b/nuttx/configs/z8encore000zco/README.txt index 9ec1b80afc..7ca50db8ce 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 a79355b711..7ff44faaec 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 7356c8e87d..b0f224ad8d 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 2389a0d346..1650600cde 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 af83f8517e..145bfe9bbc 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 From f63b1d9296232e1c0f0a37d1fc7cdfb87f34946f Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 29 Nov 2012 22:27:22 +0000 Subject: [PATCH 019/157] 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 + .../configs/ez80f910200kitg/ostest/Make.defs | 2 +- nuttx/configs/ez80f910200zco/dhcpd/Make.defs | 2 +- nuttx/configs/ez80f910200zco/httpd/Make.defs | 2 +- .../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 +++ .../configs/z16f2800100zcog/ostest/Make.defs | 2 +- .../configs/z16f2800100zcog/ostest/defconfig | 8 +++++-- .../z16f2800100zcog/pashello/Make.defs | 2 +- .../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(-) diff --git a/misc/pascal/nuttx/Makefile b/misc/pascal/nuttx/Makefile index aa041eb23c..cfabb1424d 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 f986619a3d..73c873f01c 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 f209dcaed8..5c0ef42beb 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 932a5ec13b..bda9602acd 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 0124684c67..c2aab3c9fb 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 f227a046ce..1ad97cffe6 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 398a6ec5d1..77a5e731cf 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 02b6a22a26..c0d7c2f1d9 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 6a0c9bb73e..258e8a5dc1 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 727c68ba3b..e61e328bc2 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 d7ba08ec0f..c6cbd46167 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 0c69c75bca..e12931df20 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 1cd4250638..20565edeb6 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 027d6d73c9..f9ed657275 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 10a5ee6893..e0cfc6e314 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 c9f0d96731..aa0fb0b1a1 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 0977550077..fcb4bac3ac 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 9ce0052607..e9eacba898 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 85cb5c4015..1cc9726aa9 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 b2bf1b6119..aaaa67bd79 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 ec2627b464..4556912be5 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 From 7f7356cdc914dacae1cec0de2671e026f4f8dd01 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 1 Dec 2012 15:43:51 +0000 Subject: [PATCH 020/157] 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 + .../configs/compal_e99/nsh_highram/appconfig | 3 +- .../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 diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index 6738380676..d6e5de3c1d 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 c0d126ad47..ae5f0a61a1 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 3d95ccb16d..91f1331dfc 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 9d20e9312d..bdbfd4de80 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 1463b0253f..e40a63be9e 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 0000000000..9dee80633a --- /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 0000000000..3de0556a2b --- /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 0000000000..afdc3e08ae --- /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 73c873f01c..61a5a26d60 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 d7f8ec780a..cdc22b286e 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 db5e61236d..dfe0be5879 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 1f4d54a1c3..1d405874eb 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 cbf2d5ff37..11658e1493 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 0000000000..574b421c1a --- /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 */ + From b0b339c2425dea83abd2065ed95dca2273011246 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 1 Dec 2012 16:32:03 +0000 Subject: [PATCH 021/157] 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(-) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 61a5a26d60..62937d4fe6 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 c8bcb2cd7a..032bb39b87 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 cb998fb12e..caab36531f 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 - **********************************************************/ +/**************************************************************************** + * Private Data + ****************************************************************************/ -/************************************************************ - * Global Variables - ************************************************************/ - -/********************************************************** - * Private Constant Data - **********************************************************/ - -/************************************************************ - * Private Variables - ************************************************************/ - -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 */ - nRandInt = (RND1_CONSTK * g_nRandInt1) % RND1_CONSTP; - g_nRandInt1 = nRandInt; + /* First order congruential generator. One is added to the result of the + * generated value to avoid the value zero which breaks the logic. + */ + + 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 */ - 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; + /* 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; + + 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 */ - +} From 6fa076a17125a2bf58ac7404fccfcea73494808e Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 1 Dec 2012 18:04:10 +0000 Subject: [PATCH 022/157] 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(-) diff --git a/nuttx/configs/sim/nx11/defconfig b/nuttx/configs/sim/nx11/defconfig index 46b5cb4147..0ac3362be2 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 caab36531f..465cce47f8 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); +} + +#if (CONFIG_LIB_RAND_ORDER == 2) +static double_t frand2(void) +{ + /* Second order congruential generator */ + + fgenerate2(); /* 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)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 } From 3f5c10515649b6925d063ae6e4a1eb3ba0abd8e5 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 1 Dec 2012 18:44:57 +0000 Subject: [PATCH 023/157] 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(-) diff --git a/nuttx/drivers/lcd/ug-2864ambag01.c b/nuttx/drivers/lcd/ug-2864ambag01.c index e133f39010..2a47b38eb7 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 465cce47f8..bbefaee5d0 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; From d128c03666021694c4d2d969061599014f6515c7 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 2 Dec 2012 17:34:08 +0000 Subject: [PATCH 024/157] 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 | 365 +++++++++++++++++------ 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, 443 insertions(+), 106 deletions(-) create mode 100644 nuttx/tools/b16.c diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 62937d4fe6..6225ab2fb6 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 11658e1493..fa2ccc1a0d 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" */ + /* Line is going "south east". Get the X positions of each point */ - b16x = itob16(line.pt1.x) - halfoffset; - iy = line.pt1.y + halfheight; + b16x = itob16(line.pt1.x); + quad[0].x = b16x + b16xoffset; + quad[1].x = b16x - b16xoffset; - 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); + quad[2].x = b16x + b16xoffset; + quad[3].x = b16x - b16xoffset; - b16x = itob16(line.pt2.x) + halfoffset; - iy = line.pt2.y - halfheight; + 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); - 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; + /* 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" */ + /* Get the X positions of each point */ - b16x = itob16(line.pt1.x) + halfoffset; - iy = line.pt1.y + halfheight; + b16x = itob16(line.pt1.x); + quad[0].x = b16x - b16xoffset; + quad[1].x = b16x + b16xoffset; - 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); + quad[2].x = b16x - b16xoffset; + quad[3].x = b16x + b16xoffset; - b16x = itob16(line.pt2.x) - halfoffset; - iy = line.pt2.y - halfheight; + 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); - 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; + /* 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 d834f48f0c..32344a1deb 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 bbefaee5d0..0faef5d66a 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 a661424dc8..4a46901e6a 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 0000000000..66d581ffa6 --- /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 b1f189f6fb..1a35f78579 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 From 995d13a48449cf4e153693a6086d77bb14aa809d Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 3 Dec 2012 14:13:23 +0000 Subject: [PATCH 025/157] 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 diff --git a/nuttx/arch/avr/src/avr32/Toolchain.defs b/nuttx/arch/avr/src/avr32/Toolchain.defs index 6a4b1234ef..b45abadc1c 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 0000000000..483bc84e73 --- /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 0000000000..a5f139eb5a --- /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 0000000000..9c262f593d --- /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 ecd44e4e21..08f3fbea15 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 0dcb1b37d0..1d5ae7116f 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 From 66c7e430cf1658f120317e00660aa5c4a8508d3b Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 3 Dec 2012 15:33:24 +0000 Subject: [PATCH 026/157] 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 | 532 +++++++++++++++++++------- 9 files changed, 440 insertions(+), 199 deletions(-) delete mode 100644 nuttx/configs/z80sim/ostest/appconfig diff --git a/misc/tools/README.txt b/misc/tools/README.txt index 47c966921a..512d8ebaab 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 6225ab2fb6..1401792baf 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 a91973167b..99c12ae064 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 9c262f593d..e6ece2b557 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 bc37597229..7adfcee863 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 08f3fbea15..154437f1bc 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 1d5ae7116f..f8bca5b19f 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 59f1211b12..0000000000 --- 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 d81ae74582..8c2da36146 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 +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +CONFIG_NUTTX_NEWCONFIG=y + # -# 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. +# Build Setup # -# 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. +# 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 # -# Architecture selection +# CONFIG_APPS_DIR="../apps" +# CONFIG_BUILD_2PASS is not set + # -CONFIG_ARCH="z80" +# 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,71 +148,299 @@ 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 CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 -# -# 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 - -# -# 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 - # # Stack and heap information # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=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 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# 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 + +# +# 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 + +# +# System Logging Device Options # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# 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 +# + +# +# 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 From c2fa8016606432ac23361d7108f66c58a020d695 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 3 Dec 2012 20:12:59 +0000 Subject: [PATCH 028/157] 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 | 147 +++++++++++++----- nuttx/configs/xtrs/ostest/Make.defs | 147 +++++++++++++----- nuttx/configs/xtrs/pashello/Make.defs | 147 +++++++++++++----- nuttx/configs/z80sim/README.txt | 35 ++++- nuttx/configs/z80sim/nsh/Make.defs | 147 +++++++++++++----- nuttx/configs/z80sim/ostest/Make.defs | 147 +++++++++++++----- nuttx/configs/z80sim/ostest/defconfig | 14 +- nuttx/configs/z80sim/ostest/setenv.bat | 50 ++++++ nuttx/configs/z80sim/pashello/Make.defs | 147 +++++++++++++----- nuttx/configs/z80sim/scripts/setenv.bat | 50 ++++++ .../z80sim/{ostest => scripts}/setenv.sh | 31 +++- nuttx/tools/Config.mk | 11 +- 16 files changed, 847 insertions(+), 246 deletions(-) create mode 100644 nuttx/configs/z80sim/ostest/setenv.bat create mode 100644 nuttx/configs/z80sim/scripts/setenv.bat rename nuttx/configs/z80sim/{ostest => scripts}/setenv.sh (71%) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 1401792baf..cd46b5a2ef 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 a8a63c1115..91f99d0cfb 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 99c12ae064..233b6ec902 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 154d36556c..8dd552990f 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 0eac402ab2..749b693154 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 +# 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 + +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 - + LD = link-z80 + AS = as-z80 + ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else - -LD = sdldz80 -AS = sdasz80 -ARCHCPUFLAGS = -mz80 - + 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) -ASFLAGS = -x -a -l -o -s +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = -x -a -l -o -s -SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 -SDCCLIB = z80.lib +SDCCLIB = z80.lib -ASMEXT = .asm -OBJEXT = .o -LIBEXT = .lib -EXEEXT = .cmd +ASMEXT = .asm +OBJEXT = .o +LIBEXT = .lib +EXEEXT = .cmd -define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.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 -MKDEP = $(TOPDIR)/tools/mkdeps.sh +# Custom CLEAN definition -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +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 +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)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 ae26822d5e..550c70d3c8 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 +# 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 + +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 - + LD = link-z80 + AS = as-z80 + ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else - -LD = sdldz80 -AS = sdasz80 -ARCHCPUFLAGS = -mz80 - + 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) -ASFLAGS = -x -a -l -o -s +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = -x -a -l -o -s -SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 -SDCCLIB = z80.lib +SDCCLIB = z80.lib -ASMEXT = .asm -OBJEXT = .o -LIBEXT = .lib -EXEEXT = .cmd +ASMEXT = .asm +OBJEXT = .o +LIBEXT = .lib +EXEEXT = .cmd -define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.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 -MKDEP = $(TOPDIR)/tools/mkdeps.sh +# Custom CLEAN definition -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +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 +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)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 30caae7fd4..409e303c10 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 +# 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 + +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 - + LD = link-z80 + AS = as-z80 + ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else - -LD = sdldz80 -AS = sdasz80 -ARCHCPUFLAGS = -mz80 - + 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) -ASFLAGS = -x -a -l -o -s +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = -x -a -l -o -s -SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 -SDCCLIB = z80.lib +SDCCLIB = z80.lib -ASMEXT = .asm -OBJEXT = .o -LIBEXT = .lib -EXEEXT = .cmd +ASMEXT = .asm +OBJEXT = .o +LIBEXT = .lib +EXEEXT = .cmd -define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.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 -MKDEP = $(TOPDIR)/tools/mkdeps.sh +# Custom CLEAN definition -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +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 +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)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 f8bca5b19f..c371cdaff7 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. - *** glibc detected *** sdcclib: malloc(): memory corruption: 0x09f09768 *** + 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 *** + + 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 11253020eb..a5b325e79d 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 +# 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 + +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 - + LD = link-z80 + AS = as-z80 + ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else - -LD = sdldz80 -AS = sdasz80 -ARCHCPUFLAGS = -mz80 - + 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) -ASFLAGS = -x -a -l -o -s +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = -x -a -l -o -s -SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 -SDCCLIB = z80.lib +SDCCLIB = z80.lib -ASMEXT = .asm -OBJEXT = .o -LIBEXT = .lib -EXEEXT = .hex +ASMEXT = .asm +OBJEXT = .o +LIBEXT = .lib +EXEEXT = .hex -define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.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 -MKDEP = $(TOPDIR)/tools/mkdeps.sh +# Custom CLEAN definition -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +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 +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)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 d0185b4f9a..54b6d8c45d 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 +# 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 + +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 - + LD = link-z80 + AS = as-z80 + ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else - -LD = sdldz80 -AS = sdasz80 -ARCHCPUFLAGS = -mz80 - + 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) -ASFLAGS = -x -a -l -o -s +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = -x -a -l -o -s -SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 -SDCCLIB = z80.lib +SDCCLIB = z80.lib -ASMEXT = .asm -OBJEXT = .o -LIBEXT = .lib -EXEEXT = .hex +ASMEXT = .asm +OBJEXT = .o +LIBEXT = .lib +EXEEXT = .hex -define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.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 -MKDEP = $(TOPDIR)/tools/mkdeps.sh +# Custom CLEAN definition -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +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 +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)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 8c2da36146..fa79acd304 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 0000000000..e5c7ff5bf1 --- /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/pashello/Make.defs b/nuttx/configs/z80sim/pashello/Make.defs index 16d3ff3423..076aad7ed7 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 +# 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 + +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 - + LD = link-z80 + AS = as-z80 + ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent else - -LD = sdldz80 -AS = sdasz80 -ARCHCPUFLAGS = -mz80 - + 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) -ASFLAGS = -x -a -l -o -s +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = -x -a -l -o -s -SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 -SDCCLIB = z80.lib +SDCCLIB = z80.lib -ASMEXT = .asm -OBJEXT = .o -LIBEXT = .lib -EXEEXT = .hex +ASMEXT = .asm +OBJEXT = .o +LIBEXT = .lib +EXEEXT = .hex -define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.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 -MKDEP = $(TOPDIR)/tools/mkdeps.sh +# Custom CLEAN definition -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +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 +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)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 0000000000..c266d1e818 --- /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/ostest/setenv.sh b/nuttx/configs/z80sim/scripts/setenv.sh similarity index 71% rename from nuttx/configs/z80sim/ostest/setenv.sh rename to nuttx/configs/z80sim/scripts/setenv.sh index 239e352861..ead1e1f5f7 100755 --- a/nuttx/configs/z80sim/ostest/setenv.sh +++ b/nuttx/configs/z80sim/scripts/setenv.sh @@ -1,7 +1,7 @@ #!/bin/bash # configs/z80sim/ostest/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,35 @@ # 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 -export SDCC_BIN=/usr/local/bin -export PATH=${SDCC_BIN}:/sbin:/usr/sbin:${PATH_ORIG} +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 300df7a6ac..9ac93e7d01 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 From c0ced89e2d81b660bb965b9382ba3a4ba09d2be8 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 4 Dec 2012 14:34:48 +0000 Subject: [PATCH 029/157] 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(-) diff --git a/nuttx/configs/z80sim/README.txt b/nuttx/configs/z80sim/README.txt index c371cdaff7..a5fc011a17 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 From ccae1c4fb2bcc9a71e04a7bf02032a3b90381855 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 5 Dec 2012 15:01:11 +0000 Subject: [PATCH 030/157] 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 ++- .../z80/src/{Makefile.sdcc => Makefile.sdccl} | 110 ++++--- nuttx/arch/z80/src/Makefile.sdccw | 274 ++++++++++++++++++ .../src/{Makefile.zdsii => Makefile.zdsiil} | 56 +--- 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 ++ 15 files changed, 616 insertions(+), 103 deletions(-) rename nuttx/arch/z80/src/{Makefile.sdcc => Makefile.sdccl} (66%) create mode 100644 nuttx/arch/z80/src/Makefile.sdccw rename nuttx/arch/z80/src/{Makefile.zdsii => Makefile.zdsiil} (74%) create mode 100644 nuttx/arch/z80/src/Makefile.zdsiiw create mode 100755 nuttx/arch/z80/src/mkhpbase.bat diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index cd46b5a2ef..ab1412ae2f 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 4b02b1f0b9..c3e2caea77 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.sdccl similarity index 66% rename from nuttx/arch/z80/src/Makefile.sdcc rename to nuttx/arch/z80/src/Makefile.sdccl index 91f99d0cfb..531fbedf96 100644 --- a/nuttx/arch/z80/src/Makefile.sdcc +++ b/nuttx/arch/z80/src/Makefile.sdccl @@ -1,5 +1,5 @@ ############################################################################ -# arch/z80/src/Makefile.sdcc +# arch/z80/src/Makefile.sdccl # # Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -86,7 +86,7 @@ HEAP_BASE = ${shell ./mkhpbase.sh} all: $(HEAD_OBJ) libarch$(LIBEXT) -.PHONY: board/libboard$(LIBEXT) +.PHONY: board/libboard$(LIBEXT) pass1.lnk nuttx.lnk $(AOBJS) $(HEAD_OBJ): %$(OBJEXT): %$(ASMEXT) $(call ASSEMBLE, $<, $@) @@ -97,11 +97,40 @@ $(COBJS): %$(OBJEXT): %.c # 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) | \ +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 + $(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 @@ -143,76 +172,79 @@ board/libboard$(LIBEXT): # This target builds the final executable -pass1.hex: up_mem.h asm_mem.h $(SDCC_LIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) +pass1.lnk: @echo "LD: pass1.hex" - @echo "--" >pass1.lnk # Non-interactive - @echo "-k $(BOARDDIR)" >>pass1.lnk # Path to board library + @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 + @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 + @echo "-b START=$(CONFIG_LINKER_START_AREA)" >>pass1.lnk # Start of START area else - @echo "-b START=0" >>pass1.lnk # Start of START area + @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 + @echo "-b _CODE=$(CONFIG_LINKER_CODE_AREA)" >>pass1.lnk # Start of _CODE area else - @echo "-b _CODE=256" >>pass1.lnk # Start of _CODE area + @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 + @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.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 +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 + @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 + @echo "-b START=$(CONFIG_LINKER_START_AREA)" >>nuttx.lnk # Start of START area else - @echo "-b START=0" >>nuttx.lnk # Start of START area + @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 + @echo "-b _CODE=$(CONFIG_LINKER_CODE_AREA)" >>nuttx.lnk # Start of _CODE area else - @echo "-b _CODE=256" >>nuttx.lnk # Start of _CODE area + @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 + @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 nuttx.hex +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.hex | \ + sed s/:00000001FF/:00520001AD/ nuttx.ihx | \ hex2cmd > $(TOPDIR)/nuttx.cmd else - $(Q) packihx nuttx.hex > $(TOPDIR)/nuttx$(EXEEXT) + $(Q) packihx nuttx.ihx > $(TOPDIR)/nuttx$(EXEEXT) endif # This is part of the top-level export target diff --git a/nuttx/arch/z80/src/Makefile.sdccw b/nuttx/arch/z80/src/Makefile.sdccw new file mode 100644 index 0000000000..5841136ebf --- /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.zdsiil similarity index 74% rename from nuttx/arch/z80/src/Makefile.zdsii rename to nuttx/arch/z80/src/Makefile.zdsiil index 1615763d1a..87ada571fc 100644 --- a/nuttx/arch/z80/src/Makefile.zdsii +++ b/nuttx/arch/z80/src/Makefile.zdsiil @@ -1,5 +1,5 @@ ############################################################################ -# arch/z80/src/Makefile.zdsii +# arch/z80/src/Makefile.zdsiil # # Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -40,13 +40,9 @@ 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 +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) @@ -103,33 +99,6 @@ board$(DELIM)libboard$(LIBEXT): 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 \ @@ -157,49 +126,36 @@ ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) @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) @@ -208,13 +164,9 @@ 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$(DELIM)Makefile ]; then \ $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \ fi -endif $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/nuttx/arch/z80/src/Makefile.zdsiiw b/nuttx/arch/z80/src/Makefile.zdsiiw new file mode 100644 index 0000000000..bf599ecaea --- /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 0000000000..8792f73a4e --- /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 8dd552990f..8034555222 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 749b693154..db67b931cb 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 550c70d3c8..3555017377 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 409e303c10..641b9426d6 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 a5b325e79d..1edd5fdcf8 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 54b6d8c45d..91d30a061b 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 076aad7ed7..2dca56a0eb 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 e23caeb0f3..9b46b48801 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 } From 4c98d2e73211a2bde3530c9f1f369efa0d0745e1 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 5 Dec 2012 16:28:33 +0000 Subject: [PATCH 031/157] 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(-) diff --git a/nuttx/arch/z80/src/Makefile.sdccl b/nuttx/arch/z80/src/Makefile.sdccl index 531fbedf96..916f85b708 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 5841136ebf..4433429bb2 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 a5fc011a17..c85e236ef8 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 From 756aa6b90920d0087ad708c3ad10e091be79e46e Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 7 Dec 2012 16:00:56 +0000 Subject: [PATCH 032/157] 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 +- .../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 diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt index c3ae00d6a5..7f7b212473 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 2ca055c1c4..dda8efc1d5 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 d3ee40cf93..b7c507bb25 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 671b01087b..52a67fbd4f 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 ab1412ae2f..0ec0fdc3d6 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 f3021f6cce..fd8c086aaf 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 12c92f6cfc..640db7e7be 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 67d66ce7af..db97a9a4ac 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 f4fad08ff5..ce3dd783d4 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 edb92c7e6b..c35148a56c 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 5976264844..5b10d910f6 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 4feff7fe19..04001e55c3 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 fdd8bfd100..a4458e3015 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 d836522e7c..dba3e4fdc9 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 ce9085bfb8..33c8ebcd34 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 9aa36b1d09..9288cb5852 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 c2a9a620f0..aa167a0af1 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 55ee7a2c55..6601c4737f 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 1dfa2afeef..9e27b14e6e 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 94614ee251..724d8c98d3 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 ff5770442f..f1a1c1e178 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 258e77ec91..7db7592d4e 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 0000000000..e35b794a55 --- /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 cdb35aa5cd..6cf8f0317f 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 121c7702af..c91f2d22fa 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 a6fd9f5ddb..3c2bb7f371 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 55c7c1dcc7..b30d5548b7 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 522f3fdb17..1bf8ed9da5 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 aab4ae4be8..1759310bc2 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 160926d070..aaadb9c91b 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 44582c4124..ff48d313fa 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 f112199124..9c16aee293 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 bc6a265f0e..ece25f4e52 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 0000000000..6191cee5b8 --- /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 0000000000..145cf3df60 --- /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 0000000000..b2ddba6707 --- /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 0faef5d66a..453a4537a0 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 8b5fc42e8b..9c78342c2f 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 From cb393b2757e7afaae1616fd6abd6aed984786650 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 7 Dec 2012 19:02:57 +0000 Subject: [PATCH 033/157] 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 | 153 ++++++------------ nuttx/arch/z80/src/Makefile.sdccw | 144 +++++------------ 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 +-- .../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 +-- .../z80sim/sdcc-2.6.0-asz80-symlen.patch | 11 -- nuttx/configs/z80sim/src/z80_lowputc.c | 19 --- 21 files changed, 229 insertions(+), 652 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 diff --git a/nuttx/arch/z80/src/Makefile.sdccl b/nuttx/arch/z80/src/Makefile.sdccl index 916f85b708..d4cf28a458 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 +$(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: - @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 +# 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 4433429bb2..0cd7b4757f 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 +$(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: - @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 +# 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 99087bb088..43c750e4e1 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 960061a802..1989f99d00 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 8792f73a4e..0000000000 --- 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 1d7acb7d56..0000000000 --- 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 0000000000..9273d3f89b --- /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 828a29d776..1bdc6061f9 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 bdd55bc6b8..1db636d30e 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 87ea7063ac..be5fba4a9b 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 154437f1bc..02409de73a 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 db67b931cb..d56a65dbe1 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 3555017377..777491f62c 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 641b9426d6..3e57e78615 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 d91c18d988..0000000000 --- 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 c85e236ef8..37db83533e 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 1edd5fdcf8..4aa82ae717 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 91d30a061b..be0fc2470b 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 2dca56a0eb..05ece7666d 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 d91c18d988..0000000000 --- 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 9b46b48801..9bfe266c1d 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 } From 10bda33ba37efe6797d8e91b27ca5312be9d92d6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 7 Dec 2012 20:45:07 +0000 Subject: [PATCH 034/157] 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 | 178 +++++++++++------------ nuttx/arch/z80/src/z80/z80_rom.asm | 215 +++++++++++++++------------- 4 files changed, 214 insertions(+), 208 deletions(-) diff --git a/nuttx/arch/z80/src/Makefile.sdccl b/nuttx/arch/z80/src/Makefile.sdccl index d4cf28a458..3ccf2e33e3 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 0cd7b4757f..3c36439d90 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 1bdc6061f9..7074461c2b 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 + 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 + 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 d3bc135306..70e698bf0b 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 + 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 + 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 + From 2ca319a5cfdc404c9ce167c3f3672db1950cc199 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 7 Dec 2012 22:02:51 +0000 Subject: [PATCH 035/157] 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 | 610 +++++++++++++++++------ 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 | 537 ++++++++++++++------ 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, 1099 insertions(+), 568 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 diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 0ec0fdc3d6..37dbc30763 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 02409de73a..dae8a51ba0 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 42cffb7404..1a84abee5c 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 37db83533e..0580b684c7 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 22298ecda7..0000000000 --- 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 c86b0edc1d..d3fd607069 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 +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +CONFIG_NUTTX_NEWCONFIG=y + # -# 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. +# Build Setup # -# 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. +# 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 # -# Architecture selection +# CONFIG_APPS_DIR="..\apps" +# CONFIG_BUILD_2PASS is not set + # -CONFIG_ARCH="z80" +# 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_NSH_MMCSDMINOR=0 + +# +# 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_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=21 -CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=n +# 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=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_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_DISABLE_CLOCK=n +# 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,86 +155,347 @@ 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 CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 -# -# 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 - -# -# Settings for examples/nsh -# -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_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" - # # Stack and heap information # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=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 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# 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 # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# 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_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_LINELEN=40 +CONFIG_NSH_NESTDEPTH=3 +# CONFIG_NSH_DISABLESCRIPT is not set +# CONFIG_NSH_DISABLEBG is not set +CONFIG_NSH_CONSOLE=y +# CONFIG_NSH_CONDEV is not set +# CONFIG_NSH_ARCHINIT 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=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 0000000000..9ce941938b --- /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 48373b0f20..0000000000 --- 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 38d7b91f80..0000000000 --- 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 655c87408b..1d9eb7a0e0 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 +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +CONFIG_NUTTX_NEWCONFIG=y + # -# 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. +# Build Setup # -# 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. +# 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 # -# Architecture selection +# CONFIG_APPS_DIR="..\apps" +# CONFIG_BUILD_2PASS is not set + # -CONFIG_ARCH="z80" +# 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 + +# +# 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_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=21 -CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=n +# 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=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_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="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,71 +154,294 @@ 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 CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 -# -# 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 - -# -# 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 - # # Stack and heap information # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=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 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# 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=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 + +# +# System Logging Device Options # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# 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_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 0000000000..59c372ddd9 --- /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 b9de2b9e0f..0000000000 --- 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 1e5d98b29c..27d6850934 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; } From c5d9112de113f09613684d58f1b41fdf0c36def6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 8 Dec 2012 16:37:43 +0000 Subject: [PATCH 036/157] 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 +- .../configs/ez80f910200kitg/ostest/Make.defs | 2 +- nuttx/configs/ez80f910200zco/dhcpd/Make.defs | 2 +- nuttx/configs/ez80f910200zco/httpd/Make.defs | 2 +- .../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 +- .../configs/hymini-stm32v/usbserial/Make.defs | 2 +- .../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 +- .../configs/lpc4330-xplorer/ostest/Make.defs | 2 +- .../lpcxpresso-lpc1768/dhcpd/Make.defs | 2 +- .../configs/lpcxpresso-lpc1768/nsh/Make.defs | 2 +- nuttx/configs/lpcxpresso-lpc1768/nx/Make.defs | 2 +- .../lpcxpresso-lpc1768/ostest/Make.defs | 2 +- .../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 +- .../mcu123-lpc214x/composite/Make.defs | 2 +- nuttx/configs/mcu123-lpc214x/nsh/Make.defs | 2 +- nuttx/configs/mcu123-lpc214x/ostest/Make.defs | 2 +- .../mcu123-lpc214x/usbserial/Make.defs | 2 +- .../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 +- .../configs/olimex-lpc1766stk/ftpc/Make.defs | 2 +- .../olimex-lpc1766stk/hidkbd/Make.defs | 2 +- .../olimex-lpc1766stk/nettest/Make.defs | 2 +- nuttx/configs/olimex-lpc1766stk/nsh/Make.defs | 2 +- nuttx/configs/olimex-lpc1766stk/nx/Make.defs | 2 +- .../olimex-lpc1766stk/ostest/Make.defs | 2 +- .../olimex-lpc1766stk/slip-httpd/Make.defs | 2 +- .../olimex-lpc1766stk/thttpd/Make.defs | 2 +- .../olimex-lpc1766stk/usbserial/Make.defs | 2 +- .../olimex-lpc1766stk/usbstorage/Make.defs | 2 +- .../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 +- .../olimex-stm32-p107/ostest/Make.defs | 2 +- .../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 +- .../configs/pcblogic-pic32mx/ostest/Make.defs | 2 +- nuttx/configs/pic32-starterkit/nsh/Make.defs | 2 +- nuttx/configs/pic32-starterkit/nsh2/Make.defs | 2 +- .../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 +- .../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 +- .../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 +- .../configs/stm3210e-eval/usbserial/Make.defs | 2 +- .../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 +- .../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 +- .../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 +- .../configs/stm3240g-eval/webserver/Make.defs | 2 +- nuttx/configs/stm3240g-eval/xmlrpc/Make.defs | 2 +- .../configs/stm32f100rc_generic/nsh/Make.defs | 2 +- .../stm32f100rc_generic/ostest/Make.defs | 2 +- .../stm32f4discovery/cxxtest/Make.defs | 2 +- nuttx/configs/stm32f4discovery/elf/Make.defs | 2 +- nuttx/configs/stm32f4discovery/nsh/Make.defs | 2 +- .../stm32f4discovery/nxlines/Make.defs | 2 +- .../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 ++- .../configs/z16f2800100zcog/ostest/Make.defs | 2 +- .../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/{winlink.sh => copydir.sh} | 2 +- nuttx/tools/link.bat | 89 +++++++++++++++ nuttx/tools/unlink.bat | 71 ++++++++++++ 181 files changed, 535 insertions(+), 199 deletions(-) create mode 100755 nuttx/tools/copydir.bat rename nuttx/tools/{winlink.sh => copydir.sh} (99%) create mode 100755 nuttx/tools/link.bat create mode 100755 nuttx/tools/unlink.bat diff --git a/misc/pascal/nuttx/Makefile b/misc/pascal/nuttx/Makefile index cfabb1424d..66a34b1b78 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 37dbc30763..0bf9ec9717 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 154e5aa2b8..49f48d2d68 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 50cc0ace56..c3f6286df8 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 e7f998dc75..f99ad6d5b4 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 bccb350691..85705a297b 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 ab8c9cd36c..8dc6b8f40d 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 2b53029471..872fd450c8 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 e6fdb9952f..ca00a08589 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 1bfd6f4d53..50ba85e25b 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 9c8780a4aa..1a70009f13 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 f71a0920e3..c36788bfe0 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 1b1eb45d5a..bb6814ea5c 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 7155ccf5c5..f12e55a753 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 45168938a8..d8ac0ef43a 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 ef5b28ede5..d1d9bb75ac 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 ac9e7853b3..d1e90251a6 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 3bc31ce777..f563efd5a9 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 2c8aa9c44d..937cba0d8a 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 4eb37853b0..c9c7146a7c 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 dbdfddf1b5..ac1471bbc1 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 930c50d2b4..5735a5e07d 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 1aa37e6dfe..e018d3f47b 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 c2aab3c9fb..601d754f9a 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 1ad97cffe6..144400c643 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 77a5e731cf..6cc369d970 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 c0d7c2f1d9..13bf4476e0 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 258e8a5dc1..550e1cf035 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 e61e328bc2..51d40c0bb1 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 c6cbd46167..5149161fe8 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 6022fac750..61d07af04f 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 73ad7f66e6..68006d2712 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 bb92fd59fc..2aea64f3d8 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 6ba30422e1..8fb6887455 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 7af7f82460..28518874c3 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 9f00a4939c..d4e01da7a0 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 c514e9b53d..0ed8654fd5 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 a3b6d55954..d68ed325a3 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 45d30d3200..8a6d8d2e53 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 6d80293679..a419832dff 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 6c8db35318..cd67cb29bd 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 e39eb4447e..aaaed140b5 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 94285fc78a..32bbc28016 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 b25c1be620..6aaec391b1 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 0b0e668f97..a39737c2e3 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 8dcc94b3f7..8b4af64867 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 fc7216f229..f464bbdc0c 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 bab1ab565c..a79386a9fa 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 c19c7e91f6..f91228471d 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 49cec55529..acdff005a1 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 49cec55529..acdff005a1 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 0f6b8914a9..c20ecb1422 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 84cec73996..a0b7d2867a 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 4e17bd90a3..0d7b86e64b 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 ad40aa69b0..3c977c7874 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 b9ba57b0dd..7727b31179 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 bb63eeec77..122c94fc7d 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 58652c1ef9..1cfb29e865 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 0c6292e358..9eb0cb279c 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 28dbf31579..be934cb419 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 d9ae7e305a..0ebe367a9b 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 76b9e7abb0..222f56dc62 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 5490d690f8..a470ef8e7a 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 408d19c234..a645e237b9 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 a40098fff6..bce07fab08 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 51193893c3..bccebc6e9e 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 6bc3bee804..0eda678876 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 eb04d01962..e24cd7dd5e 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 870313d73f..e52d9d8047 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 86dd3f815b..9d25218502 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 088dc79767..aba7594070 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 9312ae0600..8aaae829eb 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 fb208f85c4..48e8149ed0 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 cc62a030a9..08f156070e 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 1c8893289b..e72666b904 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 6d2a223df5..72fa6dd6bb 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 7510cef3ed..86cbd013e6 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 1c4ebf8a9c..1851a03d35 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 8cd4b0cc4b..3973652ace 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 659a5142e3..8675a12e4c 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 ce5508390a..e1492bebf8 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 c882ce94fe..feb7065d47 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 e1c96eb6be..3a125842dd 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 3312b63cdd..c3d0831f21 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 5eb7bbbb76..d2cfc40506 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 f9b164deb5..fa63ea7999 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 b7f9c37fd1..e5fd731329 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 32d0530bd4..acef11b6e0 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 8658c457af..e0cd16c1bf 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 1d8990cb5c..adb4067f06 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 07bb91c09d..f99c88f53d 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 a7fce92f42..b21261fd63 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 2d8218bad1..b144104b30 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 93677479f4..9681772543 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 7a27f7755f..174878c7a1 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 f14c078941..e870ae1508 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 a16447aec3..616b139484 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 a4fe11a027..6af29537ba 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 1c709c1f85..33d80d61b0 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 ee8661d910..f7e9d8c9e5 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 7e4f5d43e0..3bd11e7225 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 4d29bc904f..9f280f51ed 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 942ec383fa..28a451f196 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 cf3bd8db2a..5690aaa7b1 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 808f12193b..c20a749dd1 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 dd518a5afc..4fb1ba3a2a 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 7bec9327bd..7e0b3ae468 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 f387da6006..f875f2b4e2 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 b4313cdec4..24f57c2012 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 67b0191f4c..71f8506aea 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 ff119f6cd0..cc61f116d6 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 749ffbbc30..436d316c8d 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 3e7ef5db78..7e42b07635 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 c162ebdd1a..cfcec08353 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 c8658035ba..7b06f42823 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 8a53198e22..93068399e0 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 0a14d2d944..dda7d6785f 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 7af8b7593e..35bfbd6425 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 08c8415c0b..5559c7839f 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 cd5caf8f58..d0d8d3c710 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 c6c2db5b3b..8f06d77348 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 730545d3fb..6076214c61 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 0ff741f416..2dd040f25d 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 9fdbf2ad91..e6a4fb60e0 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 258fd1a593..9cab57494e 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 64706c8888..740e7cebd6 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 3690b36952..e3722a6f37 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 98843f3c50..639d078102 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 22bab8f55d..ab00824b09 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 2a324e0ac9..d5a5bda1c0 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 1f5077cd75..f0eebdbe89 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 39b6b5d66b..9f0c85dd63 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 11048e4c58..e8c2ecf65e 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 4484f54519..07761fb165 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 d820898430..4b9b46ea9c 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 51075db663..7c6e9d640b 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 c1da1e5bfa..39700e67c1 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 6d7d099ead..24021f1781 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 38b5479d30..3028607d18 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 368baf7eab..9c25155163 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 8a4ec77097..4658f3dc8d 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 60f8e223ed..c9382eefd1 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 810a48baaf..bbd9b8c5fe 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 11000a4f99..1d7c60a569 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 cd13c24e98..6e71770efd 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 8c99420ade..eb2aa88877 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 9ba5b8f992..51efb62ca6 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 b14abfb34e..43e3b07af1 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 60af5b155a..4bf1662b93 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 463f6920d2..5fc535dffb 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 e5035cbdc7..8e75d971ed 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 7d6d53469f..bd561d7a4d 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 480529117c..7b807abdbf 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 75a81aea6d..c0296ea677 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 836ec0ac71..c15ab4f81c 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 8dbc884b9b..b2bb451505 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 791750fe68..6a2ea6ef7d 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 d09279a8db..c71f982408 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 e65958cfe9..8a119d9fde 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 ba3878521f..da316dd266 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 99ef12d478..9d692b8dd5 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 efa53b08af..93c7bba860 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 e8c0fcbb37..ae0e44ae44 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 dc4a358386..54276acf73 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 273a01dab8..19889b1138 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 d56a65dbe1..40812c4513 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 777491f62c..525616e7ef 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 3e57e78615..a3677fc3e6 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 20565edeb6..eb706f5cd4 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 e0cfc6e314..311aa65783 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 4aa82ae717..6ecde586b6 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 be0fc2470b..1efd349839 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 05ece7666d..09c84ffcb1 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 1d9eb7a0e0..19d2554641 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 e9eacba898..f18b3dda9b 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 1cc9726aa9..278f724c34 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 68b85dc4f3..2b9ac61f45 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 0000000000..2857c415f0 --- /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/winlink.sh b/nuttx/tools/copydir.sh similarity index 99% rename from nuttx/tools/winlink.sh rename to nuttx/tools/copydir.sh index f79eda2bd7..5d9f790022 100755 --- a/nuttx/tools/winlink.sh +++ b/nuttx/tools/copydir.sh @@ -1,6 +1,6 @@ #!/bin/bash ############################################################################ -# tools/winlink.sh +# tools/copydir.sh # # Copyright (C) 2008 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/nuttx/tools/link.bat b/nuttx/tools/link.bat new file mode 100755 index 0000000000..434574ee36 --- /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 0000000000..25e83bb9f8 --- /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 From 9ba1a8f55d7224dfa2ca260bad6891b8222e96fb Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 8 Dec 2012 21:31:43 +0000 Subject: [PATCH 037/157] 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(-) diff --git a/nuttx/arch/z80/src/z80/up_mem.h b/nuttx/arch/z80/src/z80/up_mem.h index 9273d3f89b..a12b52656b 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 0580b684c7..8b90f30957 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 d3fd607069..ff9a90344b 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 fa79acd304..0697d8bba4 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 19d2554641..b0ff5ce169 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 # From 93683ae1b56bc740d1377e76507162a6f00018ea Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 8 Dec 2012 23:21:34 +0000 Subject: [PATCH 038/157] 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 | 548 +++++++++++++----- nuttx/configs/xtrs/ostest/setenv.bat | 54 ++ .../xtrs/{ostest => scripts}/setenv.sh | 37 +- nuttx/configs/xtrs/src/xtr_lowputc.c | 24 +- nuttx/configs/xtrs/src/xtrs_head.asm | 238 ++++---- 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 +- 19 files changed, 739 insertions(+), 342 deletions(-) delete mode 100644 nuttx/configs/xtrs/ostest/appconfig create mode 100644 nuttx/configs/xtrs/ostest/setenv.bat rename nuttx/configs/xtrs/{ostest => scripts}/setenv.sh (67%) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 0bf9ec9717..e77c70e8f1 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 3ccf2e33e3..cbb3f8656e 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 3c36439d90..372786a872 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 d257ca285a..76cdd5f9f4 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 2bf89905ef..79bb5eb5c7 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 233b6ec902..8bebdfae25 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 7adfcee863..50e1cc6007 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 dae8a51ba0..9f94ed9ad2 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 d998929853..0000000000 --- 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 0104deb2c9..32a7711fcf 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 +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +CONFIG_NUTTX_NEWCONFIG=y + # -# 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. +# Build Setup # -# 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. +# 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 # -# Architecture selection +# CONFIG_APPS_DIR="..\apps" +# CONFIG_BUILD_2PASS is not set + # -CONFIG_ARCH="z80" +# 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_LINKER_START_AREA=0x5200 -CONFIG_LINKER_CODE_AREA=0x5300 -CONFIG_LINKER_ROM_AT_0000=y +CONFIG_ARCH_BOARD_XTRS=y +# CONFIG_ARCH_BOARD_Z80SIM is not set +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="xtrs" # -# 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=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,71 +159,300 @@ 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 CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 -# -# 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 - -# -# 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 - # # Stack and heap information # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=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 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# 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 + +# +# 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 # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# 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_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 0000000000..38822dcc2d --- /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/scripts/setenv.sh similarity index 67% rename from nuttx/configs/xtrs/ostest/setenv.sh rename to nuttx/configs/xtrs/scripts/setenv.sh index 73454b772c..8dc863ba59 100755 --- a/nuttx/configs/xtrs/ostest/setenv.sh +++ b/nuttx/configs/xtrs/scripts/setenv.sh @@ -1,7 +1,7 @@ #!/bin/bash # configs/xtrs/ostest/setenv.sh # -# Copyright (C) 2008 Gregory Nutt. All rights reserved. +# Copyright (C) 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -32,14 +32,41 @@ # 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 -export SDCC_BIN=/usr/local/bin -export PATH=${SDCC_BIN}:/sbin:/usr/sbin:${PATH_ORIG} +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 8ed166211e..60f4db049a 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 bd7156f590..c2122898ed 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 + 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 + 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 8b90f30957..50e2c70288 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 ff9a90344b..5b21b97bf9 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 0697d8bba4..656f71fd12 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 b0ff5ce169..16124f39b2 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 43869fdeca..3dfd23dd10 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. From 200ce6d7ff301e68d6b90ac40a22866190b4c80b Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 9 Dec 2012 17:34:53 +0000 Subject: [PATCH 039/157] 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 +- .../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 +- .../configs/stm3240g-eval/discover/defconfig | 3 +- nuttx/configs/stm3240g-eval/xmlrpc/defconfig | 3 +- .../configs/stm32f100rc_generic/nsh/defconfig | 3 +- .../stm32f100rc_generic/ostest/defconfig | 3 +- .../stm32f4discovery/cxxtest/defconfig | 3 +- nuttx/configs/stm32f4discovery/elf/defconfig | 3 +- .../stm32f4discovery/nxlines/defconfig | 3 +- .../configs/stm32f4discovery/ostest/defconfig | 3 +- .../stm32f4discovery/winbuild/defconfig | 3 +- nuttx/configs/xtrs/README.txt | 56 +- nuttx/configs/xtrs/nsh/appconfig | 44 -- nuttx/configs/xtrs/nsh/defconfig | 619 +++++++++++++----- 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 | 549 +++++++++++----- nuttx/configs/xtrs/pashello/setenv.bat | 54 ++ nuttx/configs/xtrs/pashello/setenv.sh | 45 -- nuttx/configs/xtrs/src/xtr_serial.c | 3 +- .../configs/z16f2800100zcog/ostest/defconfig | 3 +- .../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, 1082 insertions(+), 596 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 diff --git a/apps/nshlib/nsh_consolemain.c b/apps/nshlib/nsh_consolemain.c index 6b51be4705..f05447a64e 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 5463e0f5a2..85a4ccb9c2 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 e77c70e8f1..ffa2e719ff 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 440cb3e0b1..fbb5e8c139 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 0e399cfc73..d8be31a97d 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 7597bcfd65..977dda1dc5 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 8e371686ba..2fb623a0d0 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 4c73b7a6c2..36f8e40fc6 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 ccc411a4d2..86d17c3eed 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 e8f189282b..ccbcf9ab25 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 9c1da5494c..648a928519 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 26d132cd03..aece175691 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 aefa05326a..152486d1bb 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 dd72d6ab39..6b4c9af707 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 41bb865926..a0228a3def 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 c56503e1f7..0041feb502 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 1b3df6d32e..6487742cf3 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 8d98fe6968..b6c3ac5930 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 4de3a09228..8609993ea1 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 d260a87cbd..b29622c8ed 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 311dd075d6..ac8a18c9bb 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 9f94ed9ad2..1a63d3a90e 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 ef9401691b..0000000000 --- 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 dc4e595563..cc3d4da2fc 100644 --- a/nuttx/configs/xtrs/nsh/defconfig +++ b/nuttx/configs/xtrs/nsh/defconfig @@ -1,138 +1,154 @@ -############################################################################ -# configs/xtrs/nsh/defconfig # -# Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +CONFIG_NUTTX_NEWCONFIG=y + # -# 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. +# Build Setup # -# 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. +# 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 # -# Architecture selection +# CONFIG_APPS_DIR="..\apps" +# CONFIG_BUILD_2PASS is not set + # -CONFIG_ARCH="z80" +# 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_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=0x0000 CONFIG_DRAM_SIZE=65536 # -# Z80sim 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_LINKER_START_AREA=0x5200 -CONFIG_LINKER_CODE_AREA=0x5300 -CONFIG_LINKER_ROM_AT_0000=y +CONFIG_ARCH_BOARD_XTRS=y +# CONFIG_ARCH_BOARD_Z80SIM is not set +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="xtrs" # -# 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_NSH_MMCSDMINOR=0 + +# +# 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_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_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 - -# -# 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_DISABLE_CLOCK=n +# 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) # @@ -142,86 +158,347 @@ 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 CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 -# -# 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 - -# -# Settings for examples/nsh -# -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_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" - # # Stack and heap information # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=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 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# 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 # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# 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_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_LINELEN=40 +CONFIG_NSH_NESTDEPTH=3 +# CONFIG_NSH_DISABLESCRIPT is not set +# CONFIG_NSH_DISABLEBG is not set +CONFIG_NSH_CONSOLE=y +# CONFIG_NSH_CONDEV is not set +# CONFIG_NSH_ARCHINIT 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=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 0000000000..0df2ba4b66 --- /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 99d45f97a7..0000000000 --- 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 32a7711fcf..cf87886a2a 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 7cb5a7cf2a..0000000000 --- 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 52d4e6b839..d0b5d8245b 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 +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +CONFIG_NUTTX_NEWCONFIG=y + # -# 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. +# Build Setup # -# 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. +# 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 # -# Architecture selection +# CONFIG_APPS_DIR="..\apps" +# CONFIG_BUILD_2PASS is not set + # -CONFIG_ARCH="z80" +# 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=0x0000 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_LINKER_START_AREA=0x5200 -CONFIG_LINKER_CODE_AREA=0x5300 -CONFIG_LINKER_ROM_AT_0000=y +CONFIG_ARCH_BOARD_XTRS=y +# CONFIG_ARCH_BOARD_Z80SIM is not set +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="xtrs" # -# 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 + +# +# 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_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_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 - -# -# 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="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,71 +158,294 @@ 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 CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 -# -# 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 - -# -# 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 - # # Stack and heap information # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=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 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# 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 + +# +# 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 # -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# 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_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 0000000000..fbedd244a8 --- /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 4e2e98e316..0000000000 --- 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 1a84abee5c..eb6846179a 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 f9ed657275..defd3d5efa 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 aa0fb0b1a1..f3067a9e7c 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 50e2c70288..595a17783b 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 5b21b97bf9..1f8edacb19 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 656f71fd12..a961d550d5 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 16124f39b2..a8d565ce2d 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 7ff44faaec..b098c682bc 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 1650600cde..caa6854198 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 df96da59fb..b5b5d82d8a 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 3dfd23dd10..a1e0dff49d 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 9ffcd75dc9..9708eb5bc0 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 5a8d53beef..7f17a686d0 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 02f4809d2b..7a60a680d7 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 4a3e877454..ab0de5b47c 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 d71a0e1746..3db83d3d71 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); From 50909ac4e225c152e48e7e423f4489b65c2d70d4 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 9 Dec 2012 18:20:49 +0000 Subject: [PATCH 040/157] 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 | 142 ++++++++++++--- nuttx/configs/pjrc-8051/setenv.sh | 32 +++- 4 files changed, 425 insertions(+), 227 deletions(-) create mode 100644 nuttx/arch/8051/src/Makefile.sdccl diff --git a/nuttx/arch/8051/src/Makefile b/nuttx/arch/8051/src/Makefile index 61e40d84b9..867024b62b 100644 --- a/nuttx/arch/8051/src/Makefile +++ b/nuttx/arch/8051/src/Makefile @@ -33,203 +33,22 @@ # ############################################################################ +# Makefile fragments + -include $(TOPDIR)/Make.defs +-include chip/Make.defs +-include board/Make.defs -CFLAGS += -I$(TOPDIR)/sched -ASFLAGS = -x -j -g -l -s -p -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -D__ASSEMBLY__ +# Check for SDCC native windows build -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) +ifeq ($(CONFIG_WINDOWS_NATIVE),y) -SDCCLIBDIR = /usr/local/share/sdcc/lib/large-stack-auto -SDCCPATH = -L$(SDCCLIBDIR) -SDCCLIBS = -llibfloat.lib -llibint.lib -lliblong.lib -llibmysdcc.lib -lmcs51.lib + # SDCC Windows native build -LINKSSRCS = up_head.S -LINKASRCS = $(LINKSSRCS:.S=$(ASMEXT)) -LINKOBJS = $(LINKASRCS:$(ASMEXT)=$(OBJEXT)) -LINKLIBS ?= -LIBPATHS = -L"$(TOPDIR)/lib" -LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS))) + include Makefile.sdccw +else -TESTSRCS = up_irqtest.c -TESTOBJS = $(TESTSRCS:.c=$(OBJEXT)) -TESTLINKOBJS = up_head$(OBJEXT) -TESTEXTRAOBJS = up_savecontext$(OBJEXT) up_restorecontext$(OBJEXT) + # SDCC in a POSIX environment (Linux, OSX, or Cygwin/MSYS) -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: - -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 - -# 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 + 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 0000000000..e90ef23e95 --- /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 8034555222..d4716dedca 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 -ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = --debug +# 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 - ARCHOPTIMIZATION = + SDCC_INSTALLDIR = /usr/local + SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/large-stack-auto 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 = sdld +AS = sdas8051 +AR = sdar -r -CROSSDEV = -CC = sdcc -CPP = sdcpp -LD = aslink -AS = asx8051 -#AR = sdar -r -AR = sdcclib -a +IRAM_SIZE = 0x100 +DEF_STACK_BASE = 0x24 -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + ARCHOPTIMIZATION = --debug +else + ARCHOPTIMIZATION = +endif -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 d71c234ba2..621bb27b1c 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 -export SDCC_BIN=/usr/local/bin -export PATH=${SDCC_BIN}:/sbin:/usr/sbin:${PATH_ORIG} +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}" From 8cb01b42d0c247d9532e1946abf79386f91a931a Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 9 Dec 2012 19:07:01 +0000 Subject: [PATCH 041/157] 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(+) diff --git a/nuttx/configs/pjrc-8051/README.txt b/nuttx/configs/pjrc-8051/README.txt index dae92b59b1..46084f5d33 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. + From 2b1f75ced63fb51305a97a4f6c9c73141f2689cd Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 10 Dec 2012 17:03:34 +0000 Subject: [PATCH 042/157] 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 diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index ffa2e719ff..1287383739 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 0000000000..9e21975222 --- /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 0000000000..b31c69bcfc --- /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 0000000000..a80a6b4205 --- /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 0000000000..3f058591fd --- /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 0000000000..a701184489 --- /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 0000000000..0de51cab19 --- /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 46084f5d33..c9c44327e0 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 ca594c10fc..815c6a71df 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; From 5f72f975b378b95e04ca99973da43ce4227960ce Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 10 Dec 2012 18:40:01 +0000 Subject: [PATCH 043/157] 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 +++++ .../z80/src/z180/z180_restoreusercontext.asm | 104 ++++++ nuttx/arch/z80/src/z180/z180_rom.asm | 297 ++++++++++++++++ .../z80/src/z180/z180_saveusercontext.asm | 143 ++++++++ .../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 diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 1287383739..7a2a2cbfff 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 771c605c7e..ef18031431 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 a133f209a6..c94947279d 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 12ab5dc0b2..a04ecdedd4 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 112fcde3aa..0a0673e031 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 dacc0bc5b4..e07a071d95 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 a617540a98..7d482df49b 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 3cfd65dc6b..3013ec8f4b 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 2688c045f5..2997cd4fa9 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 b1894ca347..bc9ebbb11f 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 5b2b5ff16f..5e6a903425 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 b31c69bcfc..f2e140a10a 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 0000000000..9f77e395c1 --- /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 0000000000..4eafa8da8d --- /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 0000000000..d371a5d224 --- /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 0000000000..c06164cddb --- /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 0000000000..3979f3f0ed --- /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 0000000000..b766654f66 --- /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 0000000000..38054e4b8a --- /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 0000000000..e414c547c7 --- /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 0000000000..a088f8d40b --- /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 0000000000..ca064160a9 --- /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 0000000000..8d0211261f --- /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 0000000000..7e738c953a --- /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 0000000000..929f38d6a1 --- /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 0000000000..2ccfc2f99f --- /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 0000000000..fd2a70c1fd --- /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 0000000000..c27574f4e8 --- /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 0000000000..31c9ef8ce4 --- /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 0000000000..3d9bbe55b7 --- /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 0000000000..281cfcf6a7 --- /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 e80b2b231b..a216d71ef7 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 */ From 97ddd5100fa54b3c49e0aae002ec2883b01b3b41 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 10 Dec 2012 22:39:18 +0000 Subject: [PATCH 044/157] 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 diff --git a/nuttx/arch/z80/Kconfig b/nuttx/arch/z80/Kconfig index a04ecdedd4..91aedba8f6 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 f2e140a10a..22a3cee37d 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 9f77e395c1..5c0c61166a 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 0000000000..d887b317b0 --- /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 */ From 7978ac907ba023c523f51244f6da2882a1455b2e Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 11 Dec 2012 18:04:04 +0000 Subject: [PATCH 045/157] 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 | 81 +++- 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, 1056 insertions(+), 110 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 diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 7a2a2cbfff..7e3b2a43fe 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 c3f6286df8..0ed46cba16 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 ef18031431..7dd23ac3dd 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 c94947279d..55f42339cd 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 6e55a57448..f192281439 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 91aedba8f6..4dcc8255e1 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 3f058591fd..a72cf47082 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 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 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 4eafa8da8d..58abbd6f2a 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 d371a5d224..069f36204c 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 ca064160a9..ddd0283e98 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 0000000000..c71f597550 --- /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 0000000000..1a4c034062 --- /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 0000000000..e12f41e9b7 --- /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 ae02c276a1..cbf909327d 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 b4700433b7..23f5e4380d 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 52d46af89b..42e7c4b9cf 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 a15881868e..add2b2d653 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 c836a75573..54c234d8d6 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 e43839ad60..54b729988f 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 ab0de5b47c..afb35c1c0e 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 From b09b1b66b02ca5bd8241050b21d7030bec344d4a Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 11 Dec 2012 21:42:15 +0000 Subject: [PATCH 046/157] 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 | 101 +++- nuttx/arch/z80/src/z180/z180_mmu.c | 89 ++-- 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 | 65 ++- nuttx/sched/sched_releasetcb.c | 6 + 28 files changed, 1341 insertions(+), 85 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 diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 7e3b2a43fe..11e8b200b8 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 7dd23ac3dd..281b738b8d 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 55f42339cd..9ad499d3ff 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 a4bb830fd3..4b57f8f7b6 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 1ae9278318..e0b46f7eca 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 1989f99d00..3adb02a398 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 58abbd6f2a..3082e69cbb 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 38054e4b8a..aa33bd1e12 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; + +/* 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. + */ #define IRQ_ENTER(irq, regs) \ - do { \ - savestate = (FAR chipreg_t *)current_regs; \ - current_regs = (regs); \ - } while (0) + 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 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 c71f597550..076d91befe 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: + * A handle that may be used with up_addrenv_restore() to restore the + * address environment before up_addrenv_instantiate() was called. + * + ****************************************************************************/ + +FAR void *up_addrenv_instantiate(FAR _TCB *tcb) +{ + uint8_t oldcbr; + irqstate_t flags; + + /* 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 new CBR value into CBR register */ + + outp(Z180_MMU_CBR, tcb->xcp.cbr.cbr); + } + + irqrestore(flags); + 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. * ****************************************************************************/ -#ifdef CONFIG_ADDRENV -int up_addrenv_instantiate(FAR _TCB *tcb) +int up_addrenv_restore(FAR void *handle) { - irqstate_t flags; + /* Restore the CBR value */ - /* 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; + 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 1a4c034062..74463427a8 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 2ccfc2f99f..65ae791db5 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 50e1cc6007..bba1444c4d 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 23f5e4380d..e7f73f945d 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 0000000000..ae2bf31307 --- /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 0000000000..6b6f5964d9 --- /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 0000000000..55077709d9 --- /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 0000000000..e64c7b5dd3 --- /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 0000000000..2cdc13ba5f --- /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 0000000000..19ca1ef57d --- /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 0000000000..dc214445f1 --- /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 0000000000..c55027d622 --- /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 0000000000..087e1ab2bd --- /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 99d5578502..9ace929124 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 54c234d8d6..7c444602eb 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 afb35c1c0e..bfaec3b5d5 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 a6205d6585..5370da0591 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 5fdf3b88d8..dc2db29168 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; } - /* Associate file descriptors with the new task */ + /* Share the address environment of the parent task. NOTE: Only tasks + * created throught the nuttx/binfmt loaders may have an address + * environment. + */ - status = sched_setuppthreadfiles(ptcb); - if (status != OK) +#ifdef CONFIG_ADDRENV + ret = up_addrenv_share((FAR const _TCB *)g_readytorun.head, ptcb); + if (ret < 0) { sched_releasetcb(ptcb); - return status; + return -ret; + } +#endif + + /* Associate file descriptors with the new task */ + + ret = sched_setuppthreadfiles(ptcb); + if (ret != OK) + { + sched_releasetcb(ptcb); + 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 21837262d6..0557c829b7 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); From 7eb340179101119bfef9b16c09f919fdeaa8a41e Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 11 Dec 2012 22:51:20 +0000 Subject: [PATCH 047/157] 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(-) diff --git a/nuttx/arch/z80/include/z180/chip.h b/nuttx/arch/z80/include/z180/chip.h index 22a3cee37d..3844b28006 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 aa33bd1e12..ae80f4f76d 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 ddd0283e98..cb370ffdaf 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 929f38d6a1..d5d625b334 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 076d91befe..e24b22b8e1 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 74463427a8..69ee13cc52 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 2cdc13ba5f..62162f37e9 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 1f8c7d7caf..aa5efd432e 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 f700e539d8..091e66765f 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 54b729988f..8f811c65f7 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); From 092c435c46d11b5ebaae6112a39ef12c9a1965c2 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 12 Dec 2012 00:07:15 +0000 Subject: [PATCH 048/157] 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(-) diff --git a/nuttx/arch/z80/src/Makefile.sdccl b/nuttx/arch/z80/src/Makefile.sdccl index cbb3f8656e..1ddd8da628 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 372786a872..6d0f17e8ad 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 From a71e9d8104137b52bbb3c81d3ae155eb5c450fc9 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 12 Dec 2012 16:38:50 +0000 Subject: [PATCH 049/157] 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 diff --git a/nuttx/arch/z80/include/z180/irq.h b/nuttx/arch/z80/include/z180/irq.h index a72cf47082..6fbeaf5b58 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 */ -#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) +/* 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_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 069f36204c..f196c45d78 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 cb370ffdaf..2ecbefe246 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 c27574f4e8..8a7a62a545 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 0000000000..2871be2bbb --- /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 0000000000..300ad2f310 --- /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 0000000000..cd544b9267 --- /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 From e9e7bacfa20e2756fa13bee1067beb77ae543578 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 12 Dec 2012 17:06:47 +0000 Subject: [PATCH 050/157] 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(-) diff --git a/nuttx/arch/z80/include/z180/irq.h b/nuttx/arch/z80/include/z180/irq.h index 6fbeaf5b58..1d0c27cb47 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 d5d625b334..96a691c4c9 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 2871be2bbb..b4ca907cbc 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 300ad2f310..c7d9a608a1 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 cd544b9267..3bda5c4702 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 From b922099dc28728d2a5e255dc580a968324187965 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 13 Dec 2012 18:13:22 +0000 Subject: [PATCH 051/157] 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 | 419 +++++++++++++++++++-------- 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, 447 insertions(+), 117 deletions(-) diff --git a/nuttx/arch/z80/include/z180/chip.h b/nuttx/arch/z80/include/z180/chip.h index 3844b28006..1127e4e00e 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 d887b317b0..c4c996f81d 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 - ****************************************************************************/ + ************************************************************************************/ +/* Configuration ********************************************************************/ - /* Z180 Register Bit addresses **********************************************/ +/* 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!) + */ -#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 */ +#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_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 */ +# define Z180_ASCI0_ASEXT (SFR_OFFSET+0x12) /* ASCI Extension Control Register */ +# define Z180_ASCI1_ASEXT (SFR_OFFSET+0x13) /* ASCI Extension 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 */ +# 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_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 */ +/* CSI/O Registers */ -#define Z180_RCR 0x36 /* Refresh Control Register */ +#define Z180_CSIO_CNTR (SFR_OFFSET+0x0a) /* CSI/O Control Register */ +#define Z180_CSIO_TRD (SFR_OFFSET+0x0b) /* Transmit/Receive Data 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 */ +/* Timer Registers */ -#define Z180_OMCR 0x3e /* Operation Mode Control Register */ -#define Z180_ICR 0x3f /* I/O Control Register */ +#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 */ -/* Z180 Register Bit definitions ********************************************/ +#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 */ + +#ifdef HAVE_Z8S180 /* Z8S180/Z8L180 class processors */ +# define Z180_CMR (SFR_OFFSET+0x1e) /* Clock Multiplier Register */ +#endif + +#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 + +/* PIA Registers */ + +# 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 */ + +/* 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 */ + +/* 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 6b6f5964d9..70beeceace 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 72f6c10e29..e72c0be3bc 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 eb1901d27c..c7566f6d36 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 From 7dcb78d3c4563ce9394b5b9d6a74bcd31177e8b6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 13 Dec 2012 21:49:11 +0000 Subject: [PATCH 052/157] 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 | 467 ++++++++++++++++++++++----- nuttx/configs/p112/README.txt | 3 +- 2 files changed, 394 insertions(+), 76 deletions(-) diff --git a/nuttx/arch/z80/src/z180/z180_iomap.h b/nuttx/arch/z80/src/z180/z180_iomap.h index c4c996f81d..4a695f95d6 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_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_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 -#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_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 */ -#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 +/* 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_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 70beeceace..265024cca5 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. From 9ef2bd0745ecb8cf4c4544acfb84144906648972 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 14 Dec 2012 15:32:26 +0000 Subject: [PATCH 053/157] 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 diff --git a/nuttx/arch/z80/src/z180/Kconfig b/nuttx/arch/z80/src/z180/Kconfig index 3082e69cbb..d00fa643b4 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 f196c45d78..a50c67f39a 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 0000000000..9f5bb95894 --- /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 4a695f95d6..c429fe7d31 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 0000000000..b44414d553 --- /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 0000000000..f5494a6b44 --- /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 0000000000..b15183bda3 --- /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 */ From 67b2e69b2335d009840b0bd065b2e53cf0352ad7 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 14 Dec 2012 19:15:07 +0000 Subject: [PATCH 054/157] 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 +- .../configs/ez80f910200kitg/ostest/defconfig | 2 +- nuttx/configs/ez80f910200zco/dhcpd/defconfig | 2 +- nuttx/configs/ez80f910200zco/httpd/defconfig | 2 +- .../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 diff --git a/nuttx/arch/z80/Kconfig b/nuttx/arch/z80/Kconfig index 4dcc8255e1..7e39a3f8e8 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 e0b46f7eca..652a7cc88f 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 3adb02a398..def13b5462 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 cc535530d8..a67bf75390 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 d00fa643b4..34297f7a79 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 a50c67f39a..7b495e693a 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 9f5bb95894..65815c21b1 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 c429fe7d31..8717ae8144 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 b44414d553..e5d5171c19 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 0000000000..5382c56cd1 --- /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 0000000000..493a793cda --- /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 b15183bda3..2ac08f7f18 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" + /* Disable [E]SCC interrupts and perform the low-level output */ + 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" + 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 0000000000..31248eb518 --- /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 07832572c2..cf3f9b3247 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 d8be31a97d..50efbfdaf3 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 37a256d5eb..95baadc13b 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 0cf4c33aaa..6a910ee0bb 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 9f7d438be7..22cf35a0c4 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 804a4563ff..8ad3930fff 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 977dda1dc5..3a13523331 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 316d150d0a..82cea4fcf2 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 62162f37e9..eb02fe6bcf 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 b098c682bc..7d9b227f4b 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 caa6854198..a349529872 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 From a202ca65d16c057a010c4291a79b5a55002f425c Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 15 Dec 2012 15:03:35 +0000 Subject: [PATCH 055/157] 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 diff --git a/nuttx/arch/z80/Kconfig b/nuttx/arch/z80/Kconfig index 7e39a3f8e8..b8b20c6f9b 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 34297f7a79..160c66b50b 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 7b495e693a..24d2cb64ae 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 65815c21b1..556973a753 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 + + /* 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) # define HAVE_SCC_CONSOLE 1 # define HAVE_SERIAL_CONSOLE 1 -#elif defined(CONFIG_Z180_ESCCA_SERIAL_CONSOLE) + /* Disable other console selections */ + # 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_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 8717ae8144..f2e9d5915f 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 e5d5171c19..f729355c63 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 +#ifdef HAVE_SCC_CONSOLE #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_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 493a793cda..308e01980d 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 +#ifdef HAVE_UART_CONSOLE #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 */ } +#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 31248eb518..0b0e12d793 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 0000000000..ceb7efb5fa --- /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 55077709d9..35a8011c18 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 eb02fe6bcf..c30adcf225 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 cc3d4da2fc..8730ebab72 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 cf87886a2a..a0a100bcfd 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 d0b5d8245b..d23c507163 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 e72c0be3bc..1180149cdb 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 1f8edacb19..fb9fac5462 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 a961d550d5..d3410d52d3 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 a8d565ce2d..e7dee626c1 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 c7566f6d36..7611dc29e7 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 From 8fc05d82fc7e1258cff333dcdebfb718820d0d48 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 15 Dec 2012 16:03:45 +0000 Subject: [PATCH 056/157] 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(-) diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index 49f48d2d68..d8d393a7c7 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 9ad499d3ff..b9210277e8 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 e7f73f945d..21aace2afe 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 265024cca5..7f49ffe900 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 ================= From 14a896b20509dfc4657778fa21246cffb2ec2b55 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 16 Dec 2012 21:15:27 +0000 Subject: [PATCH 057/157] 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 diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 11e8b200b8..c61b28f69a 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 fcc418a0e9..85a89b41f4 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 cbf909327d..495bd050f9 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 bda9602acd..8ec0d877c1 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 0000000000..c81588975b --- /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 aece175691..beee306398 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 49ab37264f..80c0e7c7b7 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 7fe97a911e..75890f3bcb 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 83e65dbb58..8bc8d2205d 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 ec61528914..e0a236bbed 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 c0b16236dd..a53ac2aa8c 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); From fe4bf6f555a1a453c16a7c671cef3625902d2991 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 17 Dec 2012 14:43:31 +0000 Subject: [PATCH 058/157] 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 | 129 +++++++++++++++---- nuttx/include/nuttx/binfmt/binfmt.h | 19 ++- 7 files changed, 262 insertions(+), 45 deletions(-) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index c61b28f69a..c932a1f2d6 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 71c5b0a003..830a05caa3 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,22 +313,111 @@ 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 0ed46cba16..5361a28665 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 40cbe4b213..cd52136b08 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 c81588975b..24903e26dc 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 e87075aa90..8a691edc73 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(); - - /* 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) +#ifdef CONFIG_BINFMT_EXEPATH + if (bin->filename[0] == '/') { - /* Use this handler to try to load the format */ + FAR const char *relpath; + FAR char *fullpath; + EXEPATH_HANDLE handle; - ret = binfmt->load(bin); - if (ret == OK) + /* Set aside the relative path */ + + relpath = bin->filename; + ret = -ENOENT; + + /* Initialize to traverse the PATH variable */ + + 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; + } + } } - } - sched_unlock(); + /* 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. + */ + + 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 80c0e7c7b7..200823bb84 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. From 8ae8d43ae254c55a8eaa9c48d38ca8dfa63987be Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 18 Dec 2012 16:15:27 +0000 Subject: [PATCH 059/157] 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 | 283 +++++++++++++++------ nuttx/include/nuttx/arch.h | 194 ++++++++++---- nuttx/include/nuttx/binfmt/binfmt.h | 4 +- 6 files changed, 624 insertions(+), 153 deletions(-) diff --git a/nuttx/Documentation/NuttXBinfmt.html b/nuttx/Documentation/NuttXBinfmt.html index 830a05caa3..9c9fd3a510 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 5361a28665..526892d3ef 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 9e21975222..d7cf82a268 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 e24b22b8e1..5f9b26be2b 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;
                              @@ -269,6 +293,165 @@ errout_with_irq:
                                 return ret;
                               }
                               
                              +/****************************************************************************
                              + * Name: up_addrenv_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.
                              + *
                              + ****************************************************************************/
                              +
                              +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;
                              +
                              +  DEBUGASSERT(cbr && oldenv);
                              +
                              +  /* Return the current CBR value from the CBR register */
                              +
                              +  flags = irqsave();
                              +  *oldenv = (hw_addrenv_t)inp(Z180_MMU_CBR);
                              +
                              +  /* Write the new CBR value into CBR register */
                              +
                              +  outp(Z180_MMU_CBR, cbr->cbr);
                              +  irqrestore(flags);
                              +  return OK;
                              +}
                              +
                              +/****************************************************************************
                              + * Name: up_addrenv_restore
                              + *
                              + * 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.
                              + *
                              + ****************************************************************************/
                              +
                              +int up_addrenv_restore(hw_addrenv_t oldenv)
                              +{
                              +  outp(Z180_MMU_CBR, (uint8_t)oldenv);
                              +  return OK;
                              +}
                              +
                              +/****************************************************************************
                              + * 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.
                              + *
                              + ****************************************************************************/
                              +
                              +int up_addrenv_destroy(task_addrenv_t addrenv)
                              +{
                              +  FAR struct z180_cbr_s *cbr = (FAR struct z180_cbr_s *)addrenv;
                              +
                              +  DEBUGASSERT(cbr);
                              +
                              +  /* Free the physical address space backing up the mapping */
                              +
                              +#ifdef CONFIG_GRAN_SINGLE
                              +  gran_free((FAR void *)cbr->cbr, cbr->pages);
                              +#else
                              +  gran_free(g_physhandle, (FAR void *)cbr->cbr, cbr->pages);
                              +#endif
                              +
                              +  /* And make the CBR structure available for re-use */
                              +
                              +  z180_mmu_freecbr(cbr);
                              +  return OK;
                              +}
                              +
                              +/****************************************************************************
                              + * 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.
                              + *
                              + ****************************************************************************/
                              +
                              +int up_addrenv_assign(task_addrenv_t addrenv, FAR _TCB *tcb)
                              +{
                              +  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 */
                              +
                              +  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
                                *
                              @@ -312,72 +495,6 @@ int up_addrenv_share(FAR const _TCB *ptcb, FAR _TCB *ctcb)
                                 return OK;
                               }
                               
                              -/****************************************************************************
                              - * 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:
                              - *   A handle that may be used with up_addrenv_restore() to restore the
                              - *   address environment before up_addrenv_instantiate() was called.
                              - *
                              - ****************************************************************************/
                              -
                              -FAR void *up_addrenv_instantiate(FAR _TCB *tcb)
                              -{
                              -  uint8_t oldcbr;
                              -  irqstate_t flags;
                              -
                              -  /* Get the current CBR value from the CBR register */
                              -
                              -  flags = irqsave();
                              -  oldcbr = inp(Z180_MMU_CBR);
                              -
                              -  /* Check if the task has an address environment. */
                              -
                              -  if (tcb->xcp.cbr)
                              -    {
                              -      /* Yes.. Write the new CBR value into CBR register */
                              -
                              -      outp(Z180_MMU_CBR, tcb->xcp.cbr->cbr);
                              -    }
                              -
                              -  irqrestore(flags);
                              -  return (FAR void *)oldcbr;
                              -}
                              -
                              -/****************************************************************************
                              - * 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);
                              -  return OK;
                              -}
                              -
                               /****************************************************************************
                                * Name: up_addrenv_release
                                *
                              @@ -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 7c444602eb..8b4b10ade9 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,7 +430,119 @@ 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_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.
                              + *
                              + ****************************************************************************/
                              +
                              +#ifdef CONFIG_ADDRENV
                              +int up_addrenv_vaddr(FAR task_addrenv_t addrenv, FAR void **vaddr);
                              +#endif
                              +
                              +/****************************************************************************
                              + * 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.
                              + *
                              + ****************************************************************************/
                              +
                              +#ifdef CONFIG_ADDRENV
                              +int up_addrenv_select(task_addrenv_t addrenv, hw_addrenv_t *oldenv);
                              +#endif
                              +
                              +/****************************************************************************
                              + * Name: up_addrenv_restore
                              + *
                              + * 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.
                              + *
                              + ****************************************************************************/
                              +
                              +#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
                               
                               /****************************************************************************
                              @@ -424,49 +567,6 @@ int up_addrenv_create(FAR _TCB *tcb, size_t envsize);
                               int up_addrenv_share(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:
                              - *   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_restore(FAR void *handle);
                              -#endif
                              -
                               /****************************************************************************
                                * Name: up_addrenv_release
                                *
                              diff --git a/nuttx/include/nuttx/binfmt/binfmt.h b/nuttx/include/nuttx/binfmt/binfmt.h
                              index 200823bb84..2e2c6dda8a 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[] */
                              
                              From 56a650461894d8ab541277010e93fd5ca75f9f0d Mon Sep 17 00:00:00 2001
                              From: patacongo 
                              Date: Wed, 19 Dec 2012 17:54:26 +0000
                              Subject: [PATCH 060/157] 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
                              
                              diff --git a/apps/examples/nxflat/Makefile b/apps/examples/nxflat/Makefile
                              index 344ee9c6de..94092bd396 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 c932a1f2d6..1296076b68 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 526892d3ef..0408f82ac8 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 c756e2b6ad..8d19879927 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 cd52136b08..d320bc8300 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 37f4459660..400451c408 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 52243fcf78..a0050481c6 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 ea1e7b0ca8..bcebf13ca5 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 c8857c3f74..93d95a23c3 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 5b0be9ab02..04c9144f64 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 0000000000..28cc0e108d --- /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 e35087b1de..ccdb5108e5 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 b1ac44e21f..0e4ad97988 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 da41212f23..f4b7251836 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 532fc606fb..539e5faf7b 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 4f522e52b2..6a0bf1873f 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 0000000000..cb1cb7057b --- /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 0000000000..c6b3fce341 --- /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 2b9f647159..3a86d53558 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 b6693ea36a..5f13b577a2 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 47c30bd55f..71d0c84993 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 5973a96a98..db29941caf 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 9022695a4d..d22bf6f919 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 f03beff85a..37cc7735cf 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 c64bfed542..cd87105032 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 2335de1907..771be4ec64 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 2e2c6dda8a..6df5190d20 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 432e57f0f8..6b68519347 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 89e28fbcc1..db396771b4 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 172f469011..6eaba6e9c6 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; + + /* 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). + */ + + FAR uint8_t *region; }; +#endif -#define SIZEOF_DSPACE_S(n) (sizeof(struct dspace_s) - 1 + (n)) - -/* This is the task control block (TCB) */ +/* 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 *****************************************************/ From 272fc3b5233e6d3c9e4d9c32a67511868f2c1a9a Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 19 Dec 2012 21:16:03 +0000 Subject: [PATCH 061/157] 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 | 43 ++++++++++++++++++++-- apps/examples/nxflat/nxflat_main.c | 43 ++++++++++++++++++++-- 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, 92 insertions(+), 12 deletions(-) diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index d6e5de3c1d..e9eaf0a838 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 669de430dd..66a47592c8 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]); - memset(&bin, 0, sizeof(struct binary_s)); - snprintf(path, 128, "%s/%s", MOUNTPT, dirlist[i]); + /* Initialize the binary_s structure */ - bin.filename = path; + memset(&bin, 0, sizeof(struct binary_s)); + + /* 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 638e960a00..536bc1dd82 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]); - memset(&bin, 0, sizeof(struct binary_s)); - snprintf(path, 128, "%s/%s", MOUNTPT, dirlist[i]); + /* Initialize the binary_s structure */ - bin.filename = path; + memset(&bin, 0, sizeof(struct binary_s)); + + /* 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 a0050481c6..a03b98d6c7 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 c6b3fce341..233713ccd5 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 3a86d53558..816810a467 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 71d0c84993..eb1aa03434 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; } - From db3e7613bce907bab90a64c297ec420f3b35f7ce Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 19 Dec 2012 22:18:30 +0000 Subject: [PATCH 062/157] 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(-) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 1296076b68..cda6eb947f 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 9fa73782d9..4fce8efbfb 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 24903e26dc..4fd7ad9185 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 8a691edc73..112a6b35b1 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 a03b98d6c7..365f26a341 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 28cc0e108d..193062a540 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 233713ccd5..2d9255b286 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 b6c3ac5930..9379c885b5 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 From c2a284d25ef6dfd127ffebc574e43b113afe81de Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 20 Dec 2012 14:08:21 +0000 Subject: [PATCH 063/157] 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(-) diff --git a/nuttx/TODO b/nuttx/TODO index 85a89b41f4..6c28bfd434 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 95a33b7796..002cb526b4 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)" From 0f2decb70f505b108999fcdb80e89d7aae6760ce Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 20 Dec 2012 20:22:21 +0000 Subject: [PATCH 064/157] 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 | 811 ++++++++++++++++++++++----------- nuttx/ReleaseNotes | 195 +++++++- 6 files changed, 813 insertions(+), 285 deletions(-) diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt index 7f7b212473..df9fb2d418 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 7d3fb7aaa3..4b155c50ea 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 e9eaf0a838..0695747f81 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 cda6eb947f..ed1cf39dc6 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 d8d393a7c7..5d9d3af3ba 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 Drivers: + Added optional RS-485 direction bit control (from Freddie Chopin).

                          • STM32 Boards: - ADC support for the Shenzhou IV board. - Relay support for the Shenzhou IV board (both by Darcy Gong).

                            +
                              +
                            • + 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 +
                            • +
                          • - 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. -

                            -

                            - Add support for __cxa_atexit(). -

                            + PIC32 Boards: + Update the Mirtoo configuration for Release 2 of the Mirtoo module.
                          • - C Standard Library: -

                            - Optimized generic and ARM-specific memcpy() function. - Optimized memset() function. -

                            -

                            - Add support for ferror()), feof()), and clearerror()). -

                            + Calypso: + Add Calypso keypad driver (from Denis Carilki).
                          • - Standard Math Library: -

                            - Port of the math library from Rhombus OS by Nick Johnson (Darcy Gong). + 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: - 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>
                          +nuttx-6.24 2012-12-20 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/
                          +    * 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).
                          +    * 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.
                           
                          -NxWidgets-1.3 2012-09-29 Gregory Nutt <gnutt@nuttx.org>
                          +apps-6.24 2012-12-20 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.
                          +    * 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 5fe67a663e..02cb8158df 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)
                          
                          From eaf1d8063cc707b1041e8583663d9edd45f42c5d Mon Sep 17 00:00:00 2001
                          From: px4dev 
                          Date: Tue, 1 Jan 2013 19:39:17 -0800
                          Subject: [PATCH 065/157] Build system updates to match the NuttX merge.
                          
                          ---
                           nuttx/arch/arm/src/calypso/calypso_keypad.c | 379 --------------------
                           nuttx/configs/px4fmu/common/Make.defs       |  61 ++--
                           nuttx/configs/px4fmu/nsh/defconfig          |   2 +
                           nuttx/configs/px4fmu/src/Makefile           |  14 +-
                           nuttx/configs/px4io/common/Make.defs        |  43 +--
                           nuttx/configs/px4io/src/Makefile            |   9 +-
                           nuttx/drivers/serial/serial.c               |   2 +-
                           nuttx/include/termios.h                     |   3 +
                           8 files changed, 53 insertions(+), 460 deletions(-)
                           delete mode 100644 nuttx/arch/arm/src/calypso/calypso_keypad.c
                          
                          diff --git a/nuttx/arch/arm/src/calypso/calypso_keypad.c b/nuttx/arch/arm/src/calypso/calypso_keypad.c
                          deleted file mode 100644
                          index cdc22b286e..0000000000
                          --- a/nuttx/arch/arm/src/calypso/calypso_keypad.c
                          +++ /dev/null
                          @@ -1,379 +0,0 @@
                          -/****************************************************************************
                          - * 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);
                          -}
                          -
                          -int keypad_kbdinit(void)
                          -{
                          -  calypso_armio();
                          -  up_keypad();
                          -
                          -  return OK;
                          -}
                          diff --git a/nuttx/configs/px4fmu/common/Make.defs b/nuttx/configs/px4fmu/common/Make.defs
                          index ff2e4c5fac..8f4928ddaa 100644
                          --- a/nuttx/configs/px4fmu/common/Make.defs
                          +++ b/nuttx/configs/px4fmu/common/Make.defs
                          @@ -39,12 +39,15 @@
                           # Make.defs in the per-config directories.
                           #
                           
                          +include ${TOPDIR}/tools/Config.mk
                          +
                           #
                           # We only support building with the ARM bare-metal toolchain from
                           # https://launchpad.net/gcc-arm-embedded on Windows, Linux or Mac OS.
                           #
                          +CONFIG_ARMV7M_TOOLCHAIN	:= GNU_EABI
                           
                          -CROSSDEV		 = arm-none-eabi-
                          +include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs
                           
                           CC			 = $(CROSSDEV)gcc
                           CXX			 = $(CROSSDEV)g++
                          @@ -166,25 +169,34 @@ OBJEXT			 = .o
                           LIBEXT			 = .a
                           EXEEXT			 =
                           
                          -define PREPROCESS
                          -	@echo "CPP: $1->$2"
                          -	@$(CPP) $(CPPFLAGS) $(abspath $1) -o $2
                          -endef
                          -
                          -define COMPILE
                          -	@echo "CC: $1"
                          -	$(Q)$(CC) -c $(CFLAGS) $(abspath $1) -o $2
                          -endef
                          -
                          -define COMPILEXX
                          -	@echo "CXX: $1"
                          -	$(Q)$(CXX) -c $(CXXFLAGS) $(abspath $1) -o $2
                          -endef
                          -
                          -define ASSEMBLE
                          -	@echo "AS: $1"
                          -	$(Q)$(CC) -c $(AFLAGS) $(abspath $1) -o $2
                          -endef
                          +#define PREPROCESS
                          +#	@echo "CPP: $1->$2"
                          +#	@$(CPP) $(CPPFLAGS) $(abspath $1) -o $2
                          +#endef
                          +#
                          +#define COMPILE
                          +#	@echo "CC: $1"
                          +#	$(Q)$(CC) -c $(CFLAGS) $(abspath $1) -o $2
                          +#endef
                          +#
                          +#define COMPILEXX
                          +#	@echo "CXX: $1"
                          +#	$(Q)$(CXX) -c $(CXXFLAGS) $(abspath $1) -o $2
                          +#endef
                          +#
                          +#define ASSEMBLE
                          +#	@echo "AS: $1"
                          +#	$(Q)$(CC) -c $(AFLAGS) $(abspath $1) -o $2
                          +#endef
                          +#
                          +#define ARCHIVE
                          +#	echo "AR: $2"; \
                          +#	$(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
                          +#endef
                          +#
                          +#define CLEAN
                          +#	@rm -f *.o *.a
                          +#endef
                           
                           # produce partially-linked $1 from files in $2
                           define PRELINK
                          @@ -192,15 +204,6 @@ define PRELINK
                           	@$(LD) -Ur -o $1 $2 && $(OBJCOPY) --localize-hidden $1
                           endef
                           
                          -define ARCHIVE
                          -	echo "AR: $2"; \
                          -	$(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
                          -endef
                          -
                          -define CLEAN
                          -	@rm -f *.o *.a
                          -endef
                          -
                           HOSTCC			 = gcc
                           HOSTINCLUDES		 = -I.
                           HOSTCFLAGS		 = -Wall -Wstrict-prototypes -Wshadow -g -pipe
                          diff --git a/nuttx/configs/px4fmu/nsh/defconfig b/nuttx/configs/px4fmu/nsh/defconfig
                          index bc724c0063..f17f9c20b0 100755
                          --- a/nuttx/configs/px4fmu/nsh/defconfig
                          +++ b/nuttx/configs/px4fmu/nsh/defconfig
                          @@ -767,6 +767,8 @@ CONFIG_FS_ROMFS=y
                           # CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card.
                           #   Default is 20MHz, current setting 24 MHz
                           #
                          +CONFIG_MMCSD=y
                          +CONFIG_MMCSD_SPI=y
                           CONFIG_MMCSD_NSLOTS=1
                           CONFIG_MMCSD_READONLY=n
                           CONFIG_MMCSD_SPICLOCK=24000000
                          diff --git a/nuttx/configs/px4fmu/src/Makefile b/nuttx/configs/px4fmu/src/Makefile
                          index c3d6bf543c..d4276f7fc5 100644
                          --- a/nuttx/configs/px4fmu/src/Makefile
                          +++ b/nuttx/configs/px4fmu/src/Makefile
                          @@ -64,23 +64,21 @@ $(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           libboard$(LIBEXT): $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $@, $${obj}); \
                          -	done ; )
                          -	touch $@
                          +	$(call ARCHIVE, $@, $(OBJS))
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          -	@touch $@
                          +	$(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f libboard$(LIBEXT) *~ .*.swp
                          +	$(call DELFILE, libboard$(LIBEXT))
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                           
                          diff --git a/nuttx/configs/px4io/common/Make.defs b/nuttx/configs/px4io/common/Make.defs
                          index a3996a9ed3..d6d52e3d24 100644
                          --- a/nuttx/configs/px4io/common/Make.defs
                          +++ b/nuttx/configs/px4io/common/Make.defs
                          @@ -39,12 +39,15 @@
                           # Make.defs in the per-config directories.
                           #
                           
                          +include ${TOPDIR}/tools/Config.mk
                          +
                           #
                           # We only support building with the ARM bare-metal toolchain from
                           # https://launchpad.net/gcc-arm-embedded on Windows, Linux or Mac OS.
                           #
                          +CONFIG_ARMV7M_TOOLCHAIN	:= GNU_EABI
                           
                          -CROSSDEV		 = arm-none-eabi-
                          +include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs
                           
                           CC			 = $(CROSSDEV)gcc
                           CXX			 = $(CROSSDEV)g++
                          @@ -160,46 +163,10 @@ OBJEXT			 = .o
                           LIBEXT			 = .a
                           EXEEXT			 =
                           
                          -# If VERBOSE is set, don't hide the compiler invocations.
                          -ifeq ($(VERBOSE),YES)
                          -_v				 =
                          -else
                          -_v				 = @
                          -endif
                          -
                          -define PREPROCESS
                          -	@echo "CPP: $1->$2"
                          -	@$(CPP) $(CPPFLAGS) $(abspath $1) -o $2
                          -endef
                          -
                          -define COMPILE
                          -	@echo "CC: $1"
                          -	$(_v)$(CC) -c $(CFLAGS) $(abspath $1) -o $2
                          -endef
                          -
                          -define COMPILEXX
                          -	@echo "CXX: $1"
                          -	$(_v)$(CXX) -c $(CXXFLAGS) $(abspath $1) -o $2
                          -endef
                          -
                          -define ASSEMBLE
                          -	@echo "AS: $1"
                          -	$(_v)$(CC) -c $(AFLAGS) $(abspath $1) -o $2
                          -endef
                          -
                           # produce partially-linked $1 from files in $2
                           define PRELINK
                           	@echo "PRELINK: $1"
                          -	@$(LD) -Ur -o $1 $2 && $(OBJCOPY) --localize-hidden $1
                          -endef
                          -
                          -define ARCHIVE
                          -	echo "AR: $2"; \
                          -	$(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
                          -endef
                          -
                          -define CLEAN
                          -	@rm -f *.o *.a
                          +	$(Q) $(LD) -Ur -o $1 $2 && $(OBJCOPY) --localize-hidden $1
                           endef
                           
                           HOSTCC			 = gcc
                          diff --git a/nuttx/configs/px4io/src/Makefile b/nuttx/configs/px4io/src/Makefile
                          index 144fa85495..bb9539d16a 100644
                          --- a/nuttx/configs/px4io/src/Makefile
                          +++ b/nuttx/configs/px4io/src/Makefile
                          @@ -65,9 +65,7 @@ $(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           libboard$(LIBEXT): $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $@, $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $@, $(OBJS))
                           
                           .depend: Makefile $(SRCS)
                           	@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          @@ -76,10 +74,11 @@ libboard$(LIBEXT): $(OBJS)
                           depend: .depend
                           
                           clean:
                          -	@rm -f libboard$(LIBEXT) *~ .*.swp
                          +	$(call DELFILE, libboard$(LIBEXT))
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/nuttx/drivers/serial/serial.c b/nuttx/drivers/serial/serial.c
                          index 84e9bdf2a1..682c1599f6 100644
                          --- a/nuttx/drivers/serial/serial.c
                          +++ b/nuttx/drivers/serial/serial.c
                          @@ -254,7 +254,7 @@ static inline ssize_t uart_irqwrite(FAR uart_dev_t *dev, FAR const char *buffer,
                               {
                                 int ch = *buffer++;
                           
                          -      /* assume that this is console text output and always do \n -> \r\n conversion */
                          +     /* If this is the console, then we should replace LF with CR-LF */
                           
                                 if (ch == '\n')
                                   {
                          diff --git a/nuttx/include/termios.h b/nuttx/include/termios.h
                          index 2e1c38fc26..95b20a3d36 100644
                          --- a/nuttx/include/termios.h
                          +++ b/nuttx/include/termios.h
                          @@ -109,6 +109,9 @@
                           #define PARODD    (1 << 5)  /* Bit 5: Odd parity, else even */
                           #define HUPCL     (1 << 6)  /* Bit 6: Hang up on last close */
                           #define CLOCAL    (1 << 7)  /* Bit 7: Ignore modem status lines */
                          +#define CCTS_OFLOW (1 << 8) /* Bit 8: CTS flow control of output */
                          +#define CRTSCTS   CCTS_OFLOW
                          +#define CRTS_IFLOW (1 << 9) /* Bit 9: RTS flow control of input */
                           
                           /* Local Modes (c_lflag in the termios structure) */
                           
                          
                          From b3f037e876055ff4f5169fb5df1639d50d7d5976 Mon Sep 17 00:00:00 2001
                          From: px4dev 
                          Date: Tue, 1 Jan 2013 20:35:07 -0800
                          Subject: [PATCH 066/157] Forgot to save this one; more build system tweaks.
                          
                          ---
                           nuttx/configs/px4fmu/common/Make.defs | 30 +--------------------------
                           1 file changed, 1 insertion(+), 29 deletions(-)
                          
                          diff --git a/nuttx/configs/px4fmu/common/Make.defs b/nuttx/configs/px4fmu/common/Make.defs
                          index 8f4928ddaa..97da9b3cb6 100644
                          --- a/nuttx/configs/px4fmu/common/Make.defs
                          +++ b/nuttx/configs/px4fmu/common/Make.defs
                          @@ -169,39 +169,11 @@ OBJEXT			 = .o
                           LIBEXT			 = .a
                           EXEEXT			 =
                           
                          -#define PREPROCESS
                          -#	@echo "CPP: $1->$2"
                          -#	@$(CPP) $(CPPFLAGS) $(abspath $1) -o $2
                          -#endef
                          -#
                          -#define COMPILE
                          -#	@echo "CC: $1"
                          -#	$(Q)$(CC) -c $(CFLAGS) $(abspath $1) -o $2
                          -#endef
                          -#
                          -#define COMPILEXX
                          -#	@echo "CXX: $1"
                          -#	$(Q)$(CXX) -c $(CXXFLAGS) $(abspath $1) -o $2
                          -#endef
                          -#
                          -#define ASSEMBLE
                          -#	@echo "AS: $1"
                          -#	$(Q)$(CC) -c $(AFLAGS) $(abspath $1) -o $2
                          -#endef
                          -#
                          -#define ARCHIVE
                          -#	echo "AR: $2"; \
                          -#	$(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
                          -#endef
                          -#
                          -#define CLEAN
                          -#	@rm -f *.o *.a
                          -#endef
                           
                           # produce partially-linked $1 from files in $2
                           define PRELINK
                           	@echo "PRELINK: $1"
                          -	@$(LD) -Ur -o $1 $2 && $(OBJCOPY) --localize-hidden $1
                          +	$(Q) $(LD) -Ur -o $1 $2 && $(OBJCOPY) --localize-hidden $1
                           endef
                           
                           HOSTCC			 = gcc
                          
                          From 3f420066964fe574bcf1c243d6a66646a433f777 Mon Sep 17 00:00:00 2001
                          From: px4dev 
                          Date: Tue, 1 Jan 2013 20:35:43 -0800
                          Subject: [PATCH 067/157] Don't re-run the configuration phase every time we
                           build; NuttX will re-build just about everything if you do.
                          
                          ---
                           Makefile | 4 ++--
                           1 file changed, 2 insertions(+), 2 deletions(-)
                          
                          diff --git a/Makefile b/Makefile
                          index d9469bb49a..8831f67ff5 100644
                          --- a/Makefile
                          +++ b/Makefile
                          @@ -75,16 +75,16 @@ $(FIRMWARE_BINARY):	configure_$(TARGET) setup_$(TARGET)
                           configure_px4fmu:
                           ifneq ($(TARGET),px4fmu)
                           	@make -C $(PX4BASE) distclean
                          -endif
                           	@cd $(NUTTX_SRC)/tools && /bin/sh configure.sh px4fmu/nsh
                           	@echo px4fmu > $(CONFIGURED)
                          +endif
                           
                           configure_px4io:
                           ifneq ($(TARGET),px4io)
                           	@make -C $(PX4BASE) distclean
                          -endif
                           	@cd $(NUTTX_SRC)/tools && /bin/sh configure.sh px4io/io
                           	@echo px4io > $(CONFIGURED)
                          +endif
                           
                           #
                           # Per-configuration additional targets
                          
                          From e7723e0d52b053a912aba9b0deb7010194d2a251 Mon Sep 17 00:00:00 2001
                          From: px4dev 
                          Date: Wed, 2 Jan 2013 22:13:30 -0800
                          Subject: [PATCH 068/157] Force a configure before compiling in order to work
                           around more NuttX/config dependency issues.
                          
                          ---
                           Makefile | 29 +++++++++++++++++------------
                           1 file changed, 17 insertions(+), 12 deletions(-)
                          
                          diff --git a/Makefile b/Makefile
                          index 8831f67ff5..ef51025a4b 100644
                          --- a/Makefile
                          +++ b/Makefile
                          @@ -28,13 +28,7 @@ UPLOADER		 = $(PX4BASE)/Tools/px_uploader.py
                           # What are we currently configured for?
                           #
                           CONFIGURED		 = $(PX4BASE)/.configured
                          -ifeq ($(wildcard $(CONFIGURED)),)
                          -# the $(CONFIGURED) target will make this a reality before building
                          -export TARGET		 = px4fmu
                          -$(shell echo $(TARGET) > $(CONFIGURED))
                          -else
                          -export TARGET		 = $(shell cat $(CONFIGURED))
                          -endif
                          +export TARGET		:= $(shell cat $(CONFIGURED))
                           
                           #
                           # What we will build
                          @@ -59,12 +53,13 @@ $(FIRMWARE_BUNDLE):	$(FIRMWARE_BINARY) $(MKFW) $(FIRMWARE_PROTOTYPE)
                           	@$(MKFW) --prototype $(FIRMWARE_PROTOTYPE) \
                           		--git_identity $(PX4BASE) \
                           		--image $(FIRMWARE_BINARY) > $@
                          +
                           #
                           # Build the firmware binary.
                           #
                           .PHONY:			$(FIRMWARE_BINARY)
                          -$(FIRMWARE_BINARY):	configure_$(TARGET) setup_$(TARGET)
                          -	@echo Building $@
                          +$(FIRMWARE_BINARY):	setup_$(TARGET) configure-check
                          +	@echo Building $@ for $(TARGET)
                           	@make -C $(NUTTX_SRC) -r $(MQUIET) all
                           	@cp $(NUTTX_SRC)/nuttx.bin $@
                           
                          @@ -73,19 +68,26 @@ $(FIRMWARE_BINARY):	configure_$(TARGET) setup_$(TARGET)
                           # and makes it current.
                           #
                           configure_px4fmu:
                          -ifneq ($(TARGET),px4fmu)
                          +	@echo Configuring for px4fmu
                           	@make -C $(PX4BASE) distclean
                           	@cd $(NUTTX_SRC)/tools && /bin/sh configure.sh px4fmu/nsh
                           	@echo px4fmu > $(CONFIGURED)
                          -endif
                           
                           configure_px4io:
                          -ifneq ($(TARGET),px4io)
                          +	@echo Configuring for px4io
                           	@make -C $(PX4BASE) distclean
                           	@cd $(NUTTX_SRC)/tools && /bin/sh configure.sh px4io/io
                           	@echo px4io > $(CONFIGURED)
                          +
                          +configure-check:
                          +ifeq ($(wildcard $(CONFIGURED)),)
                          +	@echo
                          +	@echo "Not configured - use 'make configure_px4fmu' or 'make configure_px4io' first"
                          +	@echo
                          +	@exit 1
                           endif
                           
                          +
                           #
                           # Per-configuration additional targets
                           #
                          @@ -96,6 +98,9 @@ setup_px4fmu:
                           
                           setup_px4io:
                           
                          +# fake target to make configure-check happy if TARGET is not set
                          +setup_:
                          +
                           #
                           # Firmware uploading.
                           #
                          
                          From f127495caa2d45a1b1fff3be7a9d3756259d23e2 Mon Sep 17 00:00:00 2001
                          From: px4dev 
                          Date: Fri, 11 Jan 2013 02:14:43 -0800
                          Subject: [PATCH 069/157] Manually fixup merge botches via direct comparison
                           with NuttX r5447.
                          
                          ---
                           Makefile                                      |    6 +-
                           nuttx/COPYING                                 |   51 +
                           nuttx/Kconfig                                 |  112 +-
                           nuttx/Makefile                                |  626 +-------
                           nuttx/TODO                                    |   55 +-
                           nuttx/arch/arm/include/elf.h                  |  243 +++
                           nuttx/arch/arm/include/stm32/chip.h           |  200 ++-
                           .../arch/arm/include/stm32/stm32f10xxx_irq.h  |   58 +-
                           nuttx/arch/arm/src/Makefile                   |  160 +-
                           nuttx/arch/arm/src/armv7-m/Kconfig            |   51 +
                           nuttx/arch/arm/src/armv7-m/memcpy.S           |  351 -----
                           nuttx/arch/arm/src/armv7-m/up_elf.c           |  450 ++++++
                           nuttx/arch/arm/src/armv7-m/up_hardfault.c     |    4 +-
                           nuttx/arch/arm/src/armv7-m/up_memcpy.S        |  416 ++++++
                           .../arm/src/common/arm-elf.h}                 |   38 +-
                           nuttx/arch/arm/src/stm32/Kconfig              |  622 ++++++--
                           nuttx/arch/arm/src/stm32/chip/stm32_eth.h     |    8 -
                           .../arm/src/stm32/chip/stm32f100_pinmap.h     |  190 ++-
                           .../arm/src/stm32/chip/stm32f103vc_pinmap.h   |    2 +-
                           .../arm/src/stm32/chip/stm32f103ze_pinmap.h   |   94 +-
                           .../arm/src/stm32/chip/stm32f105vb_pinmap.h   |    2 +-
                           .../arm/src/stm32/chip/stm32f107vc_pinmap.h   |    2 +-
                           .../arm/src/stm32/chip/stm32f10xxx_gpio.h     |   23 +
                           .../src/stm32/chip/stm32f10xxx_memorymap.h    |   61 +-
                           .../arch/arm/src/stm32/chip/stm32f10xxx_rcc.h |   78 +-
                           .../arm/src/stm32/chip/stm32f10xxx_vectors.h  |   72 +-
                           .../arm/src/stm32/chip/stm32f20xxx_pinmap.h   |    2 +-
                           .../arm/src/stm32/chip/stm32f40xxx_pinmap.h   |    2 +-
                           nuttx/arch/arm/src/stm32/stm32_adc.h          |    2 +-
                           nuttx/arch/arm/src/stm32/stm32_eth.c          |   11 +
                           nuttx/arch/arm/src/stm32/stm32_eth.h          |   35 +-
                           nuttx/arch/arm/src/stm32/stm32_i2c.c          |  389 ++---
                           nuttx/arch/arm/src/stm32/stm32_lowputc.c      |   75 +-
                           nuttx/arch/arm/src/stm32/stm32_otgfsdev.c     |   26 +-
                           nuttx/arch/arm/src/stm32/stm32_qencoder.c     |    1 +
                           nuttx/arch/arm/src/stm32/stm32_serial.c       |  186 ++-
                           nuttx/arch/arm/src/stm32/stm32_uart.h         |   14 +
                           nuttx/arch/arm/src/stm32/stm32f10xxx_rcc.c    |   56 +-
                           nuttx/binfmt/binfmt_exec.c                    |    2 +-
                           nuttx/binfmt/binfmt_globals.c                 |    2 +-
                           nuttx/binfmt/binfmt_internal.h                |    2 +-
                           nuttx/binfmt/binfmt_register.c                |    2 +-
                           nuttx/binfmt/binfmt_unregister.c              |    2 +-
                           nuttx/binfmt/libnxflat/Kconfig                |    5 +
                           nuttx/binfmt/libnxflat/libnxflat_init.c       |    7 +-
                           nuttx/binfmt/libnxflat/libnxflat_read.c       |   14 +-
                           nuttx/binfmt/libnxflat/libnxflat_uninit.c     |    7 +-
                           nuttx/binfmt/libnxflat/libnxflat_verify.c     |    9 +-
                           nuttx/binfmt/symtab_findbyname.c              |    2 +-
                           nuttx/binfmt/symtab_findbyvalue.c             |    2 +-
                           nuttx/binfmt/symtab_findorderedbyname.c       |    2 +-
                           nuttx/binfmt/symtab_findorderedbyvalue.c      |    2 +-
                           nuttx/configs/README.txt                      |  179 ++-
                           nuttx/configs/px4fmu/nsh/defconfig            |    5 +
                           nuttx/drivers/Kconfig                         |   76 +-
                           nuttx/drivers/Makefile                        |   27 +-
                           nuttx/drivers/analog/adc.c                    |   15 +-
                           nuttx/drivers/input/max11802.c                | 1313 +++++++++++++++++
                           nuttx/drivers/input/max11802.h                |  167 +++
                           nuttx/drivers/lcd/Kconfig                     |   81 +-
                           nuttx/drivers/lcd/ug-9664hswag01.c            |   15 +-
                           nuttx/drivers/mmcsd/mmcsd_sdio.c              |    5 +
                           nuttx/drivers/mmcsd/mmcsd_spi.c               |   11 +-
                           nuttx/drivers/net/e1000.c                     |  297 ++--
                           nuttx/drivers/net/e1000.h                     |    4 +-
                           nuttx/drivers/net/vnet.c                      |  327 ++--
                           nuttx/drivers/usbdev/pl2303.c                 |    2 +-
                           nuttx/drivers/usbdev/usbmsc.h                 |    2 +-
                           nuttx/fs/Makefile                             |   18 +-
                           nuttx/fs/fs_stat.c                            |    7 +-
                           nuttx/graphics/Makefile                       |   98 +-
                           nuttx/graphics/nxfonts/Makefile.sources       |   14 +-
                           nuttx/graphics/nxglib/Makefile.sources        |   52 +-
                           nuttx/graphics/nxmu/nx_bitmap.c               |   29 +-
                           nuttx/graphics/nxmu/nx_block.c                |    2 +-
                           nuttx/graphics/nxmu/nx_getrectangle.c         |   30 +-
                           nuttx/graphics/nxmu/nxfe.h                    |   21 +
                           nuttx/graphics/nxmu/nxmu_kbdin.c              |    2 +-
                           nuttx/graphics/nxmu/nxmu_mouse.c              |   46 +-
                           nuttx/graphics/nxmu/nxmu_redrawreq.c          |    2 +-
                           nuttx/graphics/nxmu/nxmu_reportposition.c     |    2 +-
                           nuttx/graphics/nxmu/nxmu_sendwindow.c         |   44 +
                           nuttx/graphics/nxmu/nxmu_server.c             |   10 +
                           nuttx/graphics/nxsu/nx_mousein.c              |   30 +-
                           nuttx/graphics/nxtk/nxtk_events.c             |   39 +-
                           nuttx/graphics/nxtk/nxtk_internal.h           |    5 +
                           nuttx/include/cxx/cstdbool                    |    9 +
                           nuttx/include/cxx/cstdio                      |   12 +-
                           nuttx/include/elf32.h                         |  352 +++++
                           nuttx/include/net/if.h                        |    9 +
                           nuttx/include/nuttx/binfmt.h                  |  209 ---
                           nuttx/include/nuttx/{ => binfmt}/symtab.h     |   10 +-
                           nuttx/include/nuttx/compiler.h                |   23 +-
                           nuttx/include/nuttx/float.h                   |  225 +++
                           nuttx/include/nuttx/fs/fs.h                   |   15 +-
                           nuttx/include/nuttx/i2c.h                     |   31 +-
                           nuttx/include/nuttx/input/max11802.h          |  175 +++
                           nuttx/include/nuttx/lcd/ug-2864ambag01.h      |  245 +++
                           nuttx/include/nuttx/lcd/ug-9664hswag01.h      |   15 +-
                           nuttx/include/nuttx/net/ioctl.h               |    6 +
                           nuttx/include/nuttx/net/uip/uip-arch.h        |    4 +
                           nuttx/include/nuttx/nxflat.h                  |  264 ----
                           nuttx/include/nuttx/power/pm.h                |    6 +-
                           nuttx/include/nuttx/sched.h                   |    6 +-
                           nuttx/include/nuttx/usb/cdcacm.h              |    2 +-
                           nuttx/include/nuttx/usb/usbdev_trace.h        |    4 -
                           nuttx/include/nuttx/wqueue.h                  |   24 +-
                           nuttx/include/stdio.h                         |    7 +-
                           nuttx/include/termios.h                       |    2 +-
                           nuttx/include/unistd.h                        |    1 +
                           nuttx/lib/Makefile                            |   98 +-
                           nuttx/lib/README.txt                          |   82 +-
                           nuttx/lib/stdlib/lib_rand.c                   |  220 ---
                           nuttx/lib/string/lib_memcmp.c                 |   74 -
                           nuttx/{lib => libc}/Kconfig                   |  111 +-
                           nuttx/libc/Makefile                           |  145 ++
                           nuttx/libc/README.txt                         |   85 ++
                           nuttx/{lib => libc}/dirent/Make.defs          |    2 +-
                           nuttx/{lib => libc}/dirent/lib_readdirr.c     |    2 +-
                           nuttx/{lib => libc}/dirent/lib_telldir.c      |    2 +-
                           nuttx/{lib/math => libc/fixedmath}/Make.defs  |   10 +-
                           .../math => libc/fixedmath}/lib_b16atan2.c    |    2 +-
                           .../{lib/math => libc/fixedmath}/lib_b16cos.c |    2 +-
                           .../{lib/math => libc/fixedmath}/lib_b16sin.c |    2 +-
                           .../math => libc/fixedmath}/lib_fixedmath.c   |    2 +-
                           nuttx/{lib/math => libc/fixedmath}/lib_rint.c |    2 +-
                           nuttx/{lib => libc}/lib.csv                   |    0
                           nuttx/{lib => libc}/lib_internal.h            |   57 +-
                           nuttx/{lib => libc}/libgen/Make.defs          |    2 +-
                           nuttx/{lib => libc}/libgen/lib_basename.c     |    2 +-
                           nuttx/{lib => libc}/libgen/lib_dirname.c      |    2 +-
                           nuttx/libc/math/Kconfig                       |   26 +
                           nuttx/libc/math/lib_acos.c                    |   46 +
                           nuttx/libc/math/lib_acosf.c                   |   41 +
                           nuttx/libc/math/lib_acosl.c                   |   46 +
                           nuttx/libc/math/lib_asin.c                    |   69 +
                           nuttx/libc/math/lib_asinf.c                   |   65 +
                           nuttx/libc/math/lib_asinl.c                   |   69 +
                           nuttx/libc/math/lib_atan.c                    |   48 +
                           nuttx/libc/math/lib_atan2.c                   |   86 ++
                           nuttx/libc/math/lib_atan2f.c                  |   81 +
                           nuttx/libc/math/lib_atan2l.c                  |   87 ++
                           nuttx/libc/math/lib_atanf.c                   |   43 +
                           nuttx/libc/math/lib_atanl.c                   |   48 +
                           nuttx/libc/math/lib_ceil.c                    |   52 +
                           nuttx/libc/math/lib_ceilf.c                   |   47 +
                           nuttx/libc/math/lib_ceill.c                   |   52 +
                           nuttx/libc/math/lib_cos.c                     |   46 +
                           nuttx/libc/math/lib_cosf.c                    |   41 +
                           nuttx/libc/math/lib_cosh.c                    |   47 +
                           nuttx/libc/math/lib_coshf.c                   |   42 +
                           nuttx/libc/math/lib_coshl.c                   |   47 +
                           nuttx/libc/math/lib_cosl.c                    |   46 +
                           nuttx/libc/math/lib_exp.c                     |  126 ++
                           nuttx/libc/math/lib_expf.c                    |  112 ++
                           nuttx/libc/math/lib_expl.c                    |  126 ++
                           nuttx/libc/math/lib_fabs.c                    |   46 +
                           nuttx/libc/math/lib_fabsf.c                   |   41 +
                           nuttx/libc/math/lib_fabsl.c                   |   46 +
                           nuttx/libc/math/lib_floor.c                   |   52 +
                           nuttx/libc/math/lib_floorf.c                  |   47 +
                           nuttx/libc/math/lib_floorl.c                  |   52 +
                           nuttx/libc/math/lib_fmod.c                    |   52 +
                           nuttx/libc/math/lib_fmodf.c                   |   47 +
                           nuttx/libc/math/lib_fmodl.c                   |   52 +
                           nuttx/libc/math/lib_frexp.c                   |   47 +
                           nuttx/libc/math/lib_frexpf.c                  |   42 +
                           nuttx/libc/math/lib_frexpl.c                  |   47 +
                           nuttx/libc/math/lib_ldexp.c                   |   46 +
                           nuttx/libc/math/lib_ldexpf.c                  |   41 +
                           nuttx/libc/math/lib_ldexpl.c                  |   46 +
                           nuttx/libc/math/lib_libexpi.c                 |  103 ++
                           nuttx/libc/math/lib_libsqrtapprox.c           |   50 +
                           nuttx/libc/math/lib_log.c                     |   82 +
                           nuttx/libc/math/lib_log10.c                   |   46 +
                           nuttx/libc/math/lib_log10f.c                  |   41 +
                           nuttx/libc/math/lib_log10l.c                  |   46 +
                           nuttx/libc/math/lib_log2.c                    |   46 +
                           nuttx/libc/math/lib_log2f.c                   |   41 +
                           nuttx/libc/math/lib_log2l.c                   |   46 +
                           nuttx/libc/math/lib_logf.c                    |   77 +
                           nuttx/libc/math/lib_logl.c                    |   80 +
                           nuttx/libc/math/lib_modf.c                    |   58 +
                           nuttx/libc/math/lib_modff.c                   |   55 +
                           nuttx/libc/math/lib_modfl.c                   |   61 +
                           nuttx/libc/math/lib_pow.c                     |   46 +
                           nuttx/libc/math/lib_powf.c                    |   41 +
                           nuttx/libc/math/lib_powl.c                    |   46 +
                           nuttx/libc/math/lib_sin.c                     |  114 ++
                           nuttx/libc/math/lib_sinf.c                    |  104 ++
                           nuttx/libc/math/lib_sinh.c                    |   47 +
                           nuttx/libc/math/lib_sinhf.c                   |   42 +
                           nuttx/libc/math/lib_sinhl.c                   |   47 +
                           nuttx/libc/math/lib_sinl.c                    |  114 ++
                           nuttx/libc/math/lib_sqrt.c                    |   99 ++
                           nuttx/libc/math/lib_sqrtf.c                   |   84 ++
                           nuttx/libc/math/lib_sqrtl.c                   |  101 ++
                           nuttx/libc/math/lib_tan.c                     |   46 +
                           nuttx/libc/math/lib_tanf.c                    |   41 +
                           nuttx/libc/math/lib_tanh.c                    |   49 +
                           nuttx/libc/math/lib_tanhf.c                   |   44 +
                           nuttx/libc/math/lib_tanhl.c                   |   49 +
                           nuttx/libc/math/lib_tanl.c                    |   46 +
                           nuttx/{lib => libc}/misc/Make.defs            |    2 +-
                           nuttx/{lib => libc}/misc/lib_crc32.c          |    2 +-
                           nuttx/{lib => libc}/misc/lib_dbg.c            |    2 +-
                           nuttx/{lib => libc}/misc/lib_dumpbuffer.c     |    2 +-
                           nuttx/{lib => libc}/misc/lib_filesem.c        |    2 +-
                           nuttx/{lib => libc}/misc/lib_init.c           |    2 +-
                           nuttx/{lib => libc}/misc/lib_match.c          |    2 +-
                           nuttx/{lib => libc}/misc/lib_sendfile.c       |    2 +-
                           nuttx/{lib => libc}/misc/lib_streamsem.c      |    2 +-
                           nuttx/{lib => libc}/mqueue/Make.defs          |    2 +-
                           nuttx/{lib => libc}/mqueue/mq_getattr.c       |    2 +-
                           nuttx/{lib => libc}/mqueue/mq_setattr.c       |    2 +-
                           nuttx/{lib => libc}/net/Make.defs             |    2 +-
                           nuttx/{lib => libc}/net/lib_etherntoa.c       |    2 +-
                           nuttx/{lib => libc}/net/lib_htonl.c           |    2 +-
                           nuttx/{lib => libc}/net/lib_htons.c           |    2 +-
                           nuttx/{lib => libc}/net/lib_inetaddr.c        |    2 +-
                           nuttx/{lib => libc}/net/lib_inetntoa.c        |    2 +-
                           nuttx/{lib => libc}/net/lib_inetntop.c        |    2 +-
                           nuttx/{lib => libc}/net/lib_inetpton.c        |    2 +-
                           nuttx/{lib => libc}/pthread/Make.defs         |    2 +-
                           .../pthread/pthread_attrdestroy.c             |    2 +-
                           .../pthread/pthread_attrgetinheritsched.c     |    2 +-
                           .../pthread/pthread_attrgetschedparam.c       |    2 +-
                           .../pthread/pthread_attrgetschedpolicy.c      |    2 +-
                           .../pthread/pthread_attrgetstacksize.c        |    2 +-
                           .../{lib => libc}/pthread/pthread_attrinit.c  |    2 +-
                           .../pthread/pthread_attrsetinheritsched.c     |    2 +-
                           .../pthread/pthread_attrsetschedparam.c       |    2 +-
                           .../pthread/pthread_attrsetschedpolicy.c      |    2 +-
                           .../pthread/pthread_attrsetstacksize.c        |    2 +-
                           .../pthread/pthread_barrierattrdestroy.c      |    2 +-
                           .../pthread/pthread_barrierattrgetpshared.c   |    2 +-
                           .../pthread/pthread_barrierattrinit.c         |    2 +-
                           .../pthread/pthread_barrierattrsetpshared.c   |    2 +-
                           .../pthread/pthread_condattrdestroy.c         |    2 +-
                           .../pthread/pthread_condattrinit.c            |    2 +-
                           .../pthread/pthread_mutexattrdestroy.c        |    2 +-
                           .../pthread/pthread_mutexattrgetpshared.c     |    2 +-
                           .../pthread/pthread_mutexattrgettype.c        |    2 +-
                           .../pthread/pthread_mutexattrinit.c           |    2 +-
                           .../pthread/pthread_mutexattrsetpshared.c     |    2 +-
                           .../pthread/pthread_mutexattrsettype.c        |    2 +-
                           nuttx/{lib => libc}/queue/Make.defs           |    2 +-
                           nuttx/{lib => libc}/queue/dq_addafter.c       |    2 +-
                           nuttx/{lib => libc}/queue/dq_addbefore.c      |    2 +-
                           nuttx/{lib => libc}/queue/dq_addfirst.c       |    2 +-
                           nuttx/{lib => libc}/queue/dq_addlast.c        |    2 +-
                           nuttx/{lib => libc}/queue/dq_rem.c            |    2 +-
                           nuttx/{lib => libc}/queue/dq_remfirst.c       |    2 +-
                           nuttx/{lib => libc}/queue/dq_remlast.c        |    2 +-
                           nuttx/{lib => libc}/queue/sq_addafter.c       |    2 +-
                           nuttx/{lib => libc}/queue/sq_addfirst.c       |    2 +-
                           nuttx/{lib => libc}/queue/sq_addlast.c        |    2 +-
                           nuttx/{lib => libc}/queue/sq_rem.c            |    2 +-
                           nuttx/{lib => libc}/queue/sq_remafter.c       |    2 +-
                           nuttx/{lib => libc}/queue/sq_remfirst.c       |    2 +-
                           nuttx/{lib => libc}/queue/sq_remlast.c        |    2 +-
                           nuttx/{lib => libc}/sched/Make.defs           |    2 +-
                           .../sched/sched_getprioritymax.c              |    2 +-
                           .../sched/sched_getprioritymin.c              |    2 +-
                           nuttx/{lib => libc}/semaphore/Make.defs       |    2 +-
                           nuttx/{lib => libc}/semaphore/sem_getvalue.c  |    2 +-
                           nuttx/{lib => libc}/semaphore/sem_init.c      |    2 +-
                           nuttx/{lib => libc}/signal/Make.defs          |    2 +-
                           nuttx/{lib => libc}/signal/sig_addset.c       |    2 +-
                           nuttx/{lib => libc}/signal/sig_delset.c       |    2 +-
                           nuttx/{lib => libc}/signal/sig_emptyset.c     |    2 +-
                           nuttx/{lib => libc}/signal/sig_fillset.c      |    2 +-
                           nuttx/{lib => libc}/signal/sig_ismember.c     |    2 +-
                           nuttx/{lib => libc}/stdio/Make.defs           |   36 +-
                           nuttx/{lib => libc}/stdio/lib_asprintf.c      |    2 +-
                           nuttx/{lib => libc}/stdio/lib_avsprintf.c     |    2 +-
                           .../stdio/lib_clearerr.c}                     |   65 +-
                           nuttx/{lib => libc}/stdio/lib_dtoa.c          |    2 +-
                           nuttx/{lib => libc}/stdio/lib_fclose.c        |    2 +-
                           .../lib_strstr.c => libc/stdio/lib_feof.c}    |   93 +-
                           .../stdio/lib_ferror.c}                       |  126 +-
                           nuttx/{lib => libc}/stdio/lib_fflush.c        |    2 +-
                           nuttx/{lib => libc}/stdio/lib_fgetc.c         |    2 +-
                           nuttx/{lib => libc}/stdio/lib_fgetpos.c       |    2 +-
                           nuttx/{lib => libc}/stdio/lib_fgets.c         |    4 +-
                           nuttx/{lib => libc}/stdio/lib_fileno.c        |    2 +-
                           nuttx/{lib => libc}/stdio/lib_fopen.c         |    2 +-
                           nuttx/{lib => libc}/stdio/lib_fprintf.c       |    2 +-
                           nuttx/{lib => libc}/stdio/lib_fputc.c         |    2 +-
                           nuttx/{lib => libc}/stdio/lib_fputs.c         |    2 +-
                           nuttx/{lib => libc}/stdio/lib_fread.c         |    2 +-
                           nuttx/{lib => libc}/stdio/lib_fseek.c         |    2 +-
                           nuttx/{lib => libc}/stdio/lib_fsetpos.c       |    2 +-
                           nuttx/{lib => libc}/stdio/lib_ftell.c         |    2 +-
                           nuttx/{lib => libc}/stdio/lib_fwrite.c        |    2 +-
                           nuttx/{lib => libc}/stdio/lib_gets.c          |    2 +-
                           nuttx/{lib => libc}/stdio/lib_libdtoa.c       |    2 +-
                           nuttx/{lib => libc}/stdio/lib_libfflush.c     |    2 +-
                           nuttx/{lib => libc}/stdio/lib_libflushall.c   |    2 +-
                           nuttx/{lib => libc}/stdio/lib_libfread.c      |   33 +-
                           nuttx/{lib => libc}/stdio/lib_libfwrite.c     |    2 +-
                           nuttx/{lib => libc}/stdio/lib_libnoflush.c    |    2 +-
                           nuttx/{lib => libc}/stdio/lib_libsprintf.c    |    2 +-
                           nuttx/{lib => libc}/stdio/lib_libvsprintf.c   |    4 +-
                           nuttx/{lib => libc}/stdio/lib_lowinstream.c   |    2 +-
                           nuttx/{lib => libc}/stdio/lib_lowoutstream.c  |    2 +-
                           nuttx/{lib => libc}/stdio/lib_lowprintf.c     |    2 +-
                           nuttx/{lib => libc}/stdio/lib_meminstream.c   |    2 +-
                           nuttx/{lib => libc}/stdio/lib_memoutstream.c  |    2 +-
                           nuttx/{lib => libc}/stdio/lib_nullinstream.c  |    2 +-
                           nuttx/{lib => libc}/stdio/lib_nulloutstream.c |    2 +-
                           nuttx/{lib => libc}/stdio/lib_perror.c        |    2 +-
                           nuttx/{lib => libc}/stdio/lib_printf.c        |    2 +-
                           nuttx/{lib => libc}/stdio/lib_puts.c          |    2 +-
                           nuttx/{lib => libc}/stdio/lib_rawinstream.c   |    2 +-
                           nuttx/{lib => libc}/stdio/lib_rawoutstream.c  |    2 +-
                           nuttx/{lib => libc}/stdio/lib_rawprintf.c     |   17 +-
                           nuttx/{lib => libc}/stdio/lib_rdflush.c       |    2 +-
                           nuttx/{lib => libc}/stdio/lib_snprintf.c      |    2 +-
                           nuttx/{lib => libc}/stdio/lib_sprintf.c       |    2 +-
                           nuttx/{lib => libc}/stdio/lib_sscanf.c        |    2 +-
                           nuttx/{lib => libc}/stdio/lib_stdinstream.c   |    2 +-
                           nuttx/{lib => libc}/stdio/lib_stdoutstream.c  |    2 +-
                           nuttx/{lib => libc}/stdio/lib_syslogstream.c  |    2 +-
                           nuttx/{lib => libc}/stdio/lib_ungetc.c        |    2 +-
                           nuttx/{lib => libc}/stdio/lib_vfprintf.c      |    2 +-
                           nuttx/{lib => libc}/stdio/lib_vprintf.c       |    2 +-
                           nuttx/{lib => libc}/stdio/lib_vsnprintf.c     |    2 +-
                           nuttx/{lib => libc}/stdio/lib_vsprintf.c      |    4 +-
                           nuttx/{lib => libc}/stdio/lib_wrflush.c       |    2 +-
                           nuttx/{lib => libc}/stdio/lib_zeroinstream.c  |    2 +-
                           nuttx/{lib => libc}/stdlib/Make.defs          |    2 +-
                           nuttx/{lib => libc}/stdlib/lib_abort.c        |    2 +-
                           nuttx/{lib => libc}/stdlib/lib_abs.c          |    2 +-
                           nuttx/{lib => libc}/stdlib/lib_imaxabs.c      |    2 +-
                           nuttx/{lib => libc}/stdlib/lib_labs.c         |    2 +-
                           nuttx/{lib => libc}/stdlib/lib_llabs.c        |    2 +-
                           nuttx/{lib => libc}/stdlib/lib_qsort.c        |    2 +-
                           nuttx/{lib => libc}/string/Make.defs          |   12 +-
                           nuttx/{lib => libc}/string/lib_checkbase.c    |    2 +-
                           nuttx/{lib => libc}/string/lib_isbasedigit.c  |    2 +-
                           nuttx/{lib => libc}/string/lib_memccpy.c      |    2 +-
                           nuttx/{lib => libc}/string/lib_memchr.c       |    2 +-
                           nuttx/{lib => libc}/string/lib_memcpy.c       |    2 +-
                           nuttx/libc/string/lib_memset.c                |  188 +++
                           nuttx/{lib => libc}/string/lib_skipspace.c    |    2 +-
                           nuttx/{lib => libc}/string/lib_strcasecmp.c   |    2 +-
                           nuttx/{lib => libc}/string/lib_strcat.c       |    2 +-
                           nuttx/{lib => libc}/string/lib_strchr.c       |    4 +-
                           nuttx/{lib => libc}/string/lib_strcmp.c       |    2 +-
                           nuttx/{lib => libc}/string/lib_strcpy.c       |    2 +-
                           nuttx/{lib => libc}/string/lib_strcspn.c      |    2 +-
                           nuttx/{lib => libc}/string/lib_strdup.c       |    2 +-
                           nuttx/{lib => libc}/string/lib_strerror.c     |    2 +-
                           nuttx/{lib => libc}/string/lib_strlen.c       |    2 +-
                           nuttx/{lib => libc}/string/lib_strncasecmp.c  |    2 +-
                           nuttx/{lib => libc}/string/lib_strncat.c      |    2 +-
                           nuttx/{lib => libc}/string/lib_strncmp.c      |    2 +-
                           nuttx/{lib => libc}/string/lib_strncpy.c      |    2 +-
                           nuttx/{lib => libc}/string/lib_strndup.c      |    2 +-
                           nuttx/{lib => libc}/string/lib_strnlen.c      |    4 +-
                           nuttx/{lib => libc}/string/lib_strpbrk.c      |    2 +-
                           nuttx/{lib => libc}/string/lib_strrchr.c      |    2 +-
                           nuttx/{lib => libc}/string/lib_strspn.c       |    2 +-
                           nuttx/{lib => libc}/string/lib_strtod.c       |    2 +-
                           nuttx/{lib => libc}/string/lib_strtok.c       |    2 +-
                           nuttx/{lib => libc}/string/lib_strtokr.c      |    2 +-
                           nuttx/{lib => libc}/string/lib_strtol.c       |    2 +-
                           nuttx/{lib => libc}/string/lib_strtoll.c      |    2 +-
                           nuttx/{lib => libc}/string/lib_strtoul.c      |    2 +-
                           nuttx/{lib => libc}/string/lib_strtoull.c     |    2 +-
                           nuttx/libc/string/lib_vikmemcpy.c             |  348 +++++
                           nuttx/{lib => libc}/termios/Make.defs         |    2 +-
                           nuttx/{lib => libc}/termios/lib_cfgetspeed.c  |    2 +-
                           nuttx/{lib => libc}/termios/lib_cfsetspeed.c  |    9 +-
                           nuttx/{lib => libc}/termios/lib_tcflush.c     |    2 +-
                           nuttx/{lib => libc}/termios/lib_tcgetattr.c   |    2 +-
                           nuttx/{lib => libc}/termios/lib_tcsetattr.c   |    2 +-
                           nuttx/{lib => libc}/time/Make.defs            |    2 +-
                           nuttx/{lib => libc}/time/lib_calendar2utc.c   |    2 +-
                           .../{lib => libc}/time/lib_daysbeforemonth.c  |    2 +-
                           nuttx/{lib => libc}/time/lib_gmtime.c         |    2 +-
                           nuttx/{lib => libc}/time/lib_gmtimer.c        |    2 +-
                           nuttx/{lib => libc}/time/lib_isleapyear.c     |    2 +-
                           nuttx/{lib => libc}/time/lib_mktime.c         |    2 +-
                           nuttx/{lib => libc}/time/lib_strftime.c       |    2 +-
                           nuttx/{lib => libc}/time/lib_time.c           |    2 +-
                           nuttx/{lib => libc}/unistd/Make.defs          |    2 +-
                           nuttx/{lib => libc}/unistd/lib_chdir.c        |    2 +-
                           nuttx/{lib => libc}/unistd/lib_getcwd.c       |    2 +-
                           nuttx/{lib => libc}/unistd/lib_getopt.c       |    2 +-
                           nuttx/{lib => libc}/unistd/lib_getoptargp.c   |    2 +-
                           nuttx/{lib => libc}/unistd/lib_getoptindp.c   |    2 +-
                           nuttx/{lib => libc}/unistd/lib_getoptoptp.c   |    2 +-
                           nuttx/libxx/Makefile                          |   73 +-
                           nuttx/libxx/README.txt                        |    5 +
                           nuttx/libxx/libxx_cxa_atexit.cxx              |  146 ++
                           nuttx/libxx/libxx_eabi_atexit.cxx             |   23 +-
                           nuttx/libxx/libxx_internal.hxx                |   67 +
                           nuttx/libxx/libxx_stdthrow.cxx                |   74 +
                           nuttx/mm/Makefile                             |   17 +-
                           nuttx/mm/Makefile.test                        |   18 +-
                           nuttx/mm/mm_initialize.c                      |    6 +-
                           nuttx/net/Makefile                            |   14 +-
                           nuttx/net/netdev_ioctl.c                      |  151 +-
                           nuttx/net/uip/uip_icmpping.c                  |    2 +
                           nuttx/sched/Kconfig                           |   11 +-
                           nuttx/sched/Makefile                          |   16 +-
                           nuttx/sched/atexit.c                          |   16 +-
                           nuttx/sched/mq_open.c                         |    3 +-
                           nuttx/sched/on_exit.c                         |    5 +-
                           .../stdio/lib_vdprintf.c => sched/pause.c}    |   69 +-
                           nuttx/sched/sched_getscheduler.c              |    1 +
                           nuttx/sched/sem_open.c                        |    3 +-
                           nuttx/sched/sleep.c                           |    2 +-
                           nuttx/sched/task_exithook.c                   |    4 +-
                           nuttx/sched/usleep.c                          |    2 +-
                           nuttx/tools/Makefile.export                   |    4 +-
                           nuttx/tools/configure.sh                      |   92 +-
                           nuttx/tools/define.bat                        |  178 +++
                           nuttx/tools/define.sh                         |    8 +-
                           nuttx/tools/incdir.sh                         |    3 +
                           nuttx/tools/mkconfig.c                        |    2 +-
                           nuttx/tools/mkdeps.bat                        |  173 +++
                           nuttx/tools/mkdeps.c                          |  721 +++++++++
                           nuttx/tools/mkdeps.sh                         |    2 +-
                           nuttx/tools/mkromfsimg.sh                     |    2 +-
                           nuttx/tools/mksymtab.c                        |    2 +-
                           428 files changed, 13932 insertions(+), 3888 deletions(-)
                           create mode 100644 nuttx/arch/arm/include/elf.h
                           create mode 100644 nuttx/arch/arm/src/armv7-m/Kconfig
                           delete mode 100644 nuttx/arch/arm/src/armv7-m/memcpy.S
                           create mode 100644 nuttx/arch/arm/src/armv7-m/up_elf.c
                           create mode 100644 nuttx/arch/arm/src/armv7-m/up_memcpy.S
                           rename nuttx/{lib/string/lib_memset.c => arch/arm/src/common/arm-elf.h} (64%)
                           create mode 100644 nuttx/drivers/input/max11802.c
                           create mode 100644 nuttx/drivers/input/max11802.h
                           create mode 100644 nuttx/include/elf32.h
                           delete mode 100644 nuttx/include/nuttx/binfmt.h
                           rename nuttx/include/nuttx/{ => binfmt}/symtab.h (96%)
                           create mode 100644 nuttx/include/nuttx/float.h
                           create mode 100644 nuttx/include/nuttx/input/max11802.h
                           create mode 100644 nuttx/include/nuttx/lcd/ug-2864ambag01.h
                           delete mode 100644 nuttx/include/nuttx/nxflat.h
                           delete mode 100644 nuttx/lib/stdlib/lib_rand.c
                           delete mode 100644 nuttx/lib/string/lib_memcmp.c
                           rename nuttx/{lib => libc}/Kconfig (67%)
                           create mode 100644 nuttx/libc/Makefile
                           create mode 100644 nuttx/libc/README.txt
                           rename nuttx/{lib => libc}/dirent/Make.defs (98%)
                           rename nuttx/{lib => libc}/dirent/lib_readdirr.c (99%)
                           rename nuttx/{lib => libc}/dirent/lib_telldir.c (99%)
                           rename nuttx/{lib/math => libc/fixedmath}/Make.defs (90%)
                           rename nuttx/{lib/math => libc/fixedmath}/lib_b16atan2.c (99%)
                           rename nuttx/{lib/math => libc/fixedmath}/lib_b16cos.c (98%)
                           rename nuttx/{lib/math => libc/fixedmath}/lib_b16sin.c (99%)
                           rename nuttx/{lib/math => libc/fixedmath}/lib_fixedmath.c (99%)
                           rename nuttx/{lib/math => libc/fixedmath}/lib_rint.c (99%)
                           rename nuttx/{lib => libc}/lib.csv (100%)
                           rename nuttx/{lib => libc}/lib_internal.h (79%)
                           rename nuttx/{lib => libc}/libgen/Make.defs (98%)
                           rename nuttx/{lib => libc}/libgen/lib_basename.c (99%)
                           rename nuttx/{lib => libc}/libgen/lib_dirname.c (99%)
                           create mode 100644 nuttx/libc/math/Kconfig
                           create mode 100644 nuttx/libc/math/lib_acos.c
                           create mode 100644 nuttx/libc/math/lib_acosf.c
                           create mode 100644 nuttx/libc/math/lib_acosl.c
                           create mode 100644 nuttx/libc/math/lib_asin.c
                           create mode 100644 nuttx/libc/math/lib_asinf.c
                           create mode 100644 nuttx/libc/math/lib_asinl.c
                           create mode 100644 nuttx/libc/math/lib_atan.c
                           create mode 100644 nuttx/libc/math/lib_atan2.c
                           create mode 100644 nuttx/libc/math/lib_atan2f.c
                           create mode 100644 nuttx/libc/math/lib_atan2l.c
                           create mode 100644 nuttx/libc/math/lib_atanf.c
                           create mode 100644 nuttx/libc/math/lib_atanl.c
                           create mode 100644 nuttx/libc/math/lib_ceil.c
                           create mode 100644 nuttx/libc/math/lib_ceilf.c
                           create mode 100644 nuttx/libc/math/lib_ceill.c
                           create mode 100644 nuttx/libc/math/lib_cos.c
                           create mode 100644 nuttx/libc/math/lib_cosf.c
                           create mode 100644 nuttx/libc/math/lib_cosh.c
                           create mode 100644 nuttx/libc/math/lib_coshf.c
                           create mode 100644 nuttx/libc/math/lib_coshl.c
                           create mode 100644 nuttx/libc/math/lib_cosl.c
                           create mode 100644 nuttx/libc/math/lib_exp.c
                           create mode 100644 nuttx/libc/math/lib_expf.c
                           create mode 100644 nuttx/libc/math/lib_expl.c
                           create mode 100644 nuttx/libc/math/lib_fabs.c
                           create mode 100644 nuttx/libc/math/lib_fabsf.c
                           create mode 100644 nuttx/libc/math/lib_fabsl.c
                           create mode 100644 nuttx/libc/math/lib_floor.c
                           create mode 100644 nuttx/libc/math/lib_floorf.c
                           create mode 100644 nuttx/libc/math/lib_floorl.c
                           create mode 100644 nuttx/libc/math/lib_fmod.c
                           create mode 100644 nuttx/libc/math/lib_fmodf.c
                           create mode 100644 nuttx/libc/math/lib_fmodl.c
                           create mode 100644 nuttx/libc/math/lib_frexp.c
                           create mode 100644 nuttx/libc/math/lib_frexpf.c
                           create mode 100644 nuttx/libc/math/lib_frexpl.c
                           create mode 100644 nuttx/libc/math/lib_ldexp.c
                           create mode 100644 nuttx/libc/math/lib_ldexpf.c
                           create mode 100644 nuttx/libc/math/lib_ldexpl.c
                           create mode 100644 nuttx/libc/math/lib_libexpi.c
                           create mode 100644 nuttx/libc/math/lib_libsqrtapprox.c
                           create mode 100644 nuttx/libc/math/lib_log.c
                           create mode 100644 nuttx/libc/math/lib_log10.c
                           create mode 100644 nuttx/libc/math/lib_log10f.c
                           create mode 100644 nuttx/libc/math/lib_log10l.c
                           create mode 100644 nuttx/libc/math/lib_log2.c
                           create mode 100644 nuttx/libc/math/lib_log2f.c
                           create mode 100644 nuttx/libc/math/lib_log2l.c
                           create mode 100644 nuttx/libc/math/lib_logf.c
                           create mode 100644 nuttx/libc/math/lib_logl.c
                           create mode 100644 nuttx/libc/math/lib_modf.c
                           create mode 100644 nuttx/libc/math/lib_modff.c
                           create mode 100644 nuttx/libc/math/lib_modfl.c
                           create mode 100644 nuttx/libc/math/lib_pow.c
                           create mode 100644 nuttx/libc/math/lib_powf.c
                           create mode 100644 nuttx/libc/math/lib_powl.c
                           create mode 100644 nuttx/libc/math/lib_sin.c
                           create mode 100644 nuttx/libc/math/lib_sinf.c
                           create mode 100644 nuttx/libc/math/lib_sinh.c
                           create mode 100644 nuttx/libc/math/lib_sinhf.c
                           create mode 100644 nuttx/libc/math/lib_sinhl.c
                           create mode 100644 nuttx/libc/math/lib_sinl.c
                           create mode 100644 nuttx/libc/math/lib_sqrt.c
                           create mode 100644 nuttx/libc/math/lib_sqrtf.c
                           create mode 100644 nuttx/libc/math/lib_sqrtl.c
                           create mode 100644 nuttx/libc/math/lib_tan.c
                           create mode 100644 nuttx/libc/math/lib_tanf.c
                           create mode 100644 nuttx/libc/math/lib_tanh.c
                           create mode 100644 nuttx/libc/math/lib_tanhf.c
                           create mode 100644 nuttx/libc/math/lib_tanhl.c
                           create mode 100644 nuttx/libc/math/lib_tanl.c
                           rename nuttx/{lib => libc}/misc/Make.defs (99%)
                           rename nuttx/{lib => libc}/misc/lib_crc32.c (99%)
                           rename nuttx/{lib => libc}/misc/lib_dbg.c (99%)
                           rename nuttx/{lib => libc}/misc/lib_dumpbuffer.c (99%)
                           rename nuttx/{lib => libc}/misc/lib_filesem.c (99%)
                           rename nuttx/{lib => libc}/misc/lib_init.c (99%)
                           rename nuttx/{lib => libc}/misc/lib_match.c (98%)
                           rename nuttx/{lib => libc}/misc/lib_sendfile.c (99%)
                           rename nuttx/{lib => libc}/misc/lib_streamsem.c (99%)
                           rename nuttx/{lib => libc}/mqueue/Make.defs (98%)
                           rename nuttx/{lib => libc}/mqueue/mq_getattr.c (99%)
                           rename nuttx/{lib => libc}/mqueue/mq_setattr.c (99%)
                           rename nuttx/{lib => libc}/net/Make.defs (98%)
                           rename nuttx/{lib => libc}/net/lib_etherntoa.c (99%)
                           rename nuttx/{lib => libc}/net/lib_htonl.c (99%)
                           rename nuttx/{lib => libc}/net/lib_htons.c (99%)
                           rename nuttx/{lib => libc}/net/lib_inetaddr.c (99%)
                           rename nuttx/{lib => libc}/net/lib_inetntoa.c (99%)
                           rename nuttx/{lib => libc}/net/lib_inetntop.c (99%)
                           rename nuttx/{lib => libc}/net/lib_inetpton.c (99%)
                           rename nuttx/{lib => libc}/pthread/Make.defs (99%)
                           rename nuttx/{lib => libc}/pthread/pthread_attrdestroy.c (99%)
                           rename nuttx/{lib => libc}/pthread/pthread_attrgetinheritsched.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_attrgetschedparam.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_attrgetschedpolicy.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_attrgetstacksize.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_attrinit.c (99%)
                           rename nuttx/{lib => libc}/pthread/pthread_attrsetinheritsched.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_attrsetschedparam.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_attrsetschedpolicy.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_attrsetstacksize.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_barrierattrdestroy.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_barrierattrgetpshared.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_barrierattrinit.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_barrierattrsetpshared.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_condattrdestroy.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_condattrinit.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_mutexattrdestroy.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_mutexattrgetpshared.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_mutexattrgettype.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_mutexattrinit.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_mutexattrsetpshared.c (98%)
                           rename nuttx/{lib => libc}/pthread/pthread_mutexattrsettype.c (98%)
                           rename nuttx/{lib => libc}/queue/Make.defs (98%)
                           rename nuttx/{lib => libc}/queue/dq_addafter.c (99%)
                           rename nuttx/{lib => libc}/queue/dq_addbefore.c (98%)
                           rename nuttx/{lib => libc}/queue/dq_addfirst.c (98%)
                           rename nuttx/{lib => libc}/queue/dq_addlast.c (99%)
                           rename nuttx/{lib => libc}/queue/dq_rem.c (99%)
                           rename nuttx/{lib => libc}/queue/dq_remfirst.c (99%)
                           rename nuttx/{lib => libc}/queue/dq_remlast.c (99%)
                           rename nuttx/{lib => libc}/queue/sq_addafter.c (98%)
                           rename nuttx/{lib => libc}/queue/sq_addfirst.c (98%)
                           rename nuttx/{lib => libc}/queue/sq_addlast.c (99%)
                           rename nuttx/{lib => libc}/queue/sq_rem.c (99%)
                           rename nuttx/{lib => libc}/queue/sq_remafter.c (99%)
                           rename nuttx/{lib => libc}/queue/sq_remfirst.c (98%)
                           rename nuttx/{lib => libc}/queue/sq_remlast.c (99%)
                           rename nuttx/{lib => libc}/sched/Make.defs (98%)
                           rename nuttx/{lib => libc}/sched/sched_getprioritymax.c (99%)
                           rename nuttx/{lib => libc}/sched/sched_getprioritymin.c (99%)
                           rename nuttx/{lib => libc}/semaphore/Make.defs (98%)
                           rename nuttx/{lib => libc}/semaphore/sem_getvalue.c (99%)
                           rename nuttx/{lib => libc}/semaphore/sem_init.c (99%)
                           rename nuttx/{lib => libc}/signal/Make.defs (98%)
                           rename nuttx/{lib => libc}/signal/sig_addset.c (99%)
                           rename nuttx/{lib => libc}/signal/sig_delset.c (99%)
                           rename nuttx/{lib => libc}/signal/sig_emptyset.c (99%)
                           rename nuttx/{lib => libc}/signal/sig_fillset.c (99%)
                           rename nuttx/{lib => libc}/signal/sig_ismember.c (99%)
                           rename nuttx/{lib => libc}/stdio/Make.defs (70%)
                           rename nuttx/{lib => libc}/stdio/lib_asprintf.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_avsprintf.c (99%)
                           rename nuttx/{lib/string/lib_memmove.c => libc/stdio/lib_clearerr.c} (60%)
                           rename nuttx/{lib => libc}/stdio/lib_dtoa.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_fclose.c (99%)
                           rename nuttx/{lib/string/lib_strstr.c => libc/stdio/lib_feof.c} (54%)
                           rename nuttx/{lib/string/lib_strcasestr.c => libc/stdio/lib_ferror.c} (50%)
                           rename nuttx/{lib => libc}/stdio/lib_fflush.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_fgetc.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_fgetpos.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_fgets.c (98%)
                           rename nuttx/{lib => libc}/stdio/lib_fileno.c (98%)
                           rename nuttx/{lib => libc}/stdio/lib_fopen.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_fprintf.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_fputc.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_fputs.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_fread.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_fseek.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_fsetpos.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_ftell.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_fwrite.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_gets.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_libdtoa.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_libfflush.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_libflushall.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_libfread.c (89%)
                           rename nuttx/{lib => libc}/stdio/lib_libfwrite.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_libnoflush.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_libsprintf.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_libvsprintf.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_lowinstream.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_lowoutstream.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_lowprintf.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_meminstream.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_memoutstream.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_nullinstream.c (98%)
                           rename nuttx/{lib => libc}/stdio/lib_nulloutstream.c (98%)
                           rename nuttx/{lib => libc}/stdio/lib_perror.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_printf.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_puts.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_rawinstream.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_rawoutstream.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_rawprintf.c (91%)
                           rename nuttx/{lib => libc}/stdio/lib_rdflush.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_snprintf.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_sprintf.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_sscanf.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_stdinstream.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_stdoutstream.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_syslogstream.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_ungetc.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_vfprintf.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_vprintf.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_vsnprintf.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_vsprintf.c (98%)
                           rename nuttx/{lib => libc}/stdio/lib_wrflush.c (99%)
                           rename nuttx/{lib => libc}/stdio/lib_zeroinstream.c (98%)
                           rename nuttx/{lib => libc}/stdlib/Make.defs (98%)
                           rename nuttx/{lib => libc}/stdlib/lib_abort.c (99%)
                           rename nuttx/{lib => libc}/stdlib/lib_abs.c (98%)
                           rename nuttx/{lib => libc}/stdlib/lib_imaxabs.c (98%)
                           rename nuttx/{lib => libc}/stdlib/lib_labs.c (98%)
                           rename nuttx/{lib => libc}/stdlib/lib_llabs.c (98%)
                           rename nuttx/{lib => libc}/stdlib/lib_qsort.c (99%)
                           rename nuttx/{lib => libc}/string/Make.defs (91%)
                           rename nuttx/{lib => libc}/string/lib_checkbase.c (99%)
                           rename nuttx/{lib => libc}/string/lib_isbasedigit.c (99%)
                           rename nuttx/{lib => libc}/string/lib_memccpy.c (99%)
                           rename nuttx/{lib => libc}/string/lib_memchr.c (99%)
                           rename nuttx/{lib => libc}/string/lib_memcpy.c (99%)
                           create mode 100644 nuttx/libc/string/lib_memset.c
                           rename nuttx/{lib => libc}/string/lib_skipspace.c (98%)
                           rename nuttx/{lib => libc}/string/lib_strcasecmp.c (98%)
                           rename nuttx/{lib => libc}/string/lib_strcat.c (98%)
                           rename nuttx/{lib => libc}/string/lib_strchr.c (97%)
                           rename nuttx/{lib => libc}/string/lib_strcmp.c (98%)
                           rename nuttx/{lib => libc}/string/lib_strcpy.c (98%)
                           rename nuttx/{lib => libc}/string/lib_strcspn.c (98%)
                           rename nuttx/{lib => libc}/string/lib_strdup.c (98%)
                           rename nuttx/{lib => libc}/string/lib_strerror.c (99%)
                           rename nuttx/{lib => libc}/string/lib_strlen.c (98%)
                           rename nuttx/{lib => libc}/string/lib_strncasecmp.c (98%)
                           rename nuttx/{lib => libc}/string/lib_strncat.c (98%)
                           rename nuttx/{lib => libc}/string/lib_strncmp.c (99%)
                           rename nuttx/{lib => libc}/string/lib_strncpy.c (98%)
                           rename nuttx/{lib => libc}/string/lib_strndup.c (99%)
                           rename nuttx/{lib => libc}/string/lib_strnlen.c (97%)
                           rename nuttx/{lib => libc}/string/lib_strpbrk.c (99%)
                           rename nuttx/{lib => libc}/string/lib_strrchr.c (98%)
                           rename nuttx/{lib => libc}/string/lib_strspn.c (99%)
                           rename nuttx/{lib => libc}/string/lib_strtod.c (99%)
                           rename nuttx/{lib => libc}/string/lib_strtok.c (99%)
                           rename nuttx/{lib => libc}/string/lib_strtokr.c (99%)
                           rename nuttx/{lib => libc}/string/lib_strtol.c (99%)
                           rename nuttx/{lib => libc}/string/lib_strtoll.c (99%)
                           rename nuttx/{lib => libc}/string/lib_strtoul.c (99%)
                           rename nuttx/{lib => libc}/string/lib_strtoull.c (99%)
                           create mode 100644 nuttx/libc/string/lib_vikmemcpy.c
                           rename nuttx/{lib => libc}/termios/Make.defs (98%)
                           rename nuttx/{lib => libc}/termios/lib_cfgetspeed.c (99%)
                           rename nuttx/{lib => libc}/termios/lib_cfsetspeed.c (97%)
                           rename nuttx/{lib => libc}/termios/lib_tcflush.c (99%)
                           rename nuttx/{lib => libc}/termios/lib_tcgetattr.c (99%)
                           rename nuttx/{lib => libc}/termios/lib_tcsetattr.c (99%)
                           rename nuttx/{lib => libc}/time/Make.defs (98%)
                           rename nuttx/{lib => libc}/time/lib_calendar2utc.c (99%)
                           rename nuttx/{lib => libc}/time/lib_daysbeforemonth.c (99%)
                           rename nuttx/{lib => libc}/time/lib_gmtime.c (99%)
                           rename nuttx/{lib => libc}/time/lib_gmtimer.c (99%)
                           rename nuttx/{lib => libc}/time/lib_isleapyear.c (99%)
                           rename nuttx/{lib => libc}/time/lib_mktime.c (99%)
                           rename nuttx/{lib => libc}/time/lib_strftime.c (99%)
                           rename nuttx/{lib => libc}/time/lib_time.c (99%)
                           rename nuttx/{lib => libc}/unistd/Make.defs (98%)
                           rename nuttx/{lib => libc}/unistd/lib_chdir.c (99%)
                           rename nuttx/{lib => libc}/unistd/lib_getcwd.c (99%)
                           rename nuttx/{lib => libc}/unistd/lib_getopt.c (99%)
                           rename nuttx/{lib => libc}/unistd/lib_getoptargp.c (98%)
                           rename nuttx/{lib => libc}/unistd/lib_getoptindp.c (98%)
                           rename nuttx/{lib => libc}/unistd/lib_getoptoptp.c (98%)
                           create mode 100644 nuttx/libxx/libxx_cxa_atexit.cxx
                           create mode 100644 nuttx/libxx/libxx_internal.hxx
                           create mode 100644 nuttx/libxx/libxx_stdthrow.cxx
                           rename nuttx/{lib/stdio/lib_vdprintf.c => sched/pause.c} (68%)
                           create mode 100644 nuttx/tools/define.bat
                           create mode 100644 nuttx/tools/mkdeps.bat
                           create mode 100644 nuttx/tools/mkdeps.c
                          
                          diff --git a/Makefile b/Makefile
                          index ef51025a4b..b762521e20 100644
                          --- a/Makefile
                          +++ b/Makefile
                          @@ -28,7 +28,9 @@ UPLOADER		 = $(PX4BASE)/Tools/px_uploader.py
                           # What are we currently configured for?
                           #
                           CONFIGURED		 = $(PX4BASE)/.configured
                          +ifneq ($(wildcard $(CONFIGURED)),)
                           export TARGET		:= $(shell cat $(CONFIGURED))
                          +endif
                           
                           #
                           # What we will build
                          @@ -40,8 +42,8 @@ FIRMWARE_PROTOTYPE	 = $(IMAGE_DIR)/$(TARGET).prototype
                           #
                           # Debugging
                           #
                          -MQUIET			 = --no-print-directory
                          -#MQUIET			 = --print-directory
                          +#MQUIET			 = --no-print-directory
                          +MQUIET			 = --print-directory
                           
                           all:			$(FIRMWARE_BUNDLE)
                           
                          diff --git a/nuttx/COPYING b/nuttx/COPYING
                          index 863b81a2fc..b3655265d6 100644
                          --- a/nuttx/COPYING
                          +++ b/nuttx/COPYING
                          @@ -163,6 +163,57 @@ dtoa():
                             "This product includes software developed by the University of
                              California, Berkeley and its contributors."
                           
                          +libc/string/lib_vikmemcpy.c
                          +^^^^^^^^^^^^^^^^^^^^^^^^^^^
                          +
                          +  If you enable CONFIG_MEMCPY_VIK, then you will build with the optimized
                          +  version of memcpy from Daniel Vik.  Licensing information for that version
                          +  of memcpy() follows:
                          +
                          +  Copyright (C) 1999-2010 Daniel Vik
                          +
                          +  This software is provided 'as-is', without any express or implied
                          +  warranty. In no event will the authors be held liable for any
                          +  damages arising from the use of this software.
                          +  Permission is granted to anyone to use this software for any
                          +  purpose, including commercial applications, and to alter it and
                          +  redistribute it freely, subject to the following restrictions:
                          + 
                          +  1. The origin of this software must not be misrepresented; you
                          +     must not claim that you wrote the original software. If you
                          +     use this software in a product, an acknowledgment in the
                          +     use this software in a product, an acknowledgment in the
                          +     product documentation would be appreciated but is not
                          +     required.
                          + 
                          +  2. Altered source versions must be plainly marked as such, and
                          +     must not be misrepresented as being the original software.
                          + 
                          +  3. This notice may not be removed or altered from any source
                          +     distribution.
                          + 
                          +libc/math
                          +^^^^^^^^^
                          +
                          +  If you enable CONFIG_LIB, you will build the math library at libc/math.
                          +  This library was taken from the math library developed for the Rhombus
                          +  OS by Nick Johnson (https://github.com/nickbjohnson4224/rhombus).  This
                          +  port was contributed by Darcy Gong.  The Rhombus math library has this
                          +  compatible MIT license:
                          +
                          +    Copyright (C) 2009-2011 Nick Johnson 
                          +  
                          +  Permission to use, copy, modify, and distribute this software for any
                          +  purpose with or without fee is hereby granted, provided that the above
                          +  copyright notice and this permission notice appear in all copies.
                          + 
                          +  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          +  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          +  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          +  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          +  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          +  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          +
                           Documents/rss.gif
                           ^^^^^^^^^^^^^^^^^
                           
                          diff --git a/nuttx/Kconfig b/nuttx/Kconfig
                          index 0fe6eb0f7c..10d624efb8 100644
                          --- a/nuttx/Kconfig
                          +++ b/nuttx/Kconfig
                          @@ -20,10 +20,75 @@ menu "Build Setup"
                           config EXPERIMENTAL
                           	bool "Prompt for development and/or incomplete code/drivers"
                           
                          +choice
                          +	prompt "Build Host Platform"
                          +	default HOST_LINUX
                          +
                          +config HOST_LINUX
                          +	bool "Linux"
                          +
                          +config HOST_OSX
                          +	bool "OSX"
                          +
                          +config HOST_WINDOWS
                          +	bool "Windows"
                          +
                          +config HOST_OTHER
                          +	bool "Other"
                          +
                          +endchoice
                          +
                          +choice
                          +	prompt "Windows Build Environment"
                          +	default WINDOWS_CYGWIN
                          +	depends on HOST_WINDOWS
                          +
                          +config WINDOWS_NATIVE
                          +	bool "Windows Native"
                          +	---help---
                          +		Build natively in a CMD.exe environment with Windows style paths (like C:\cgywin\home)
                          +
                          +config WINDOWS_CYGWIN
                          +	bool "Cygwin"
                          +-	--help---
                          +		Build natively in a Cygwin environment with POSIX style paths (like /cygdrive/c/cgywin/home)
                          +
                          +config WINDOWS_MSYS
                          +	bool "MSYS"
                          +	---help---
                          +		Build natively in a Cygwin environment with POSIX style paths (like /cygdrive/c/cgywin/home)
                          +
                          +config WINDOWS_OTHER
                          +	bool "Windows POSIX-like environment"
                          +	---help---
                          +		Build natively in another POSIX-like environment.  Additional support may be necessary
                          +
                          +endchoice
                          +
                          +config WINDOWS_MKLINK
                          +	bool "Use mklink"
                          +	default n
                          +	depends on WINDOWS_NATIVE
                          +	---help---
                          +		Use the mklink command to set up symbolic links when NuttX is
                          +		configured.  Otherwise, configuration directories will be copied to
                          +		establish the configuration.
                          +
                          +		If directories are copied, then some confusion can result ("Which
                          +		version of the file did I modify?").  In that case, it is recommended
                          +		that you re-build using 'make clean_context all'.  That will cause the
                          +		configured directories to be recopied on each build.
                          +
                          +		NOTE: This option also (1) that you have administrator privileges, (2)
                          +		that you are using Windows 2000 or better, and (3) that you are using
                          +		the NTFS file system.  Select 'n' is that is not the case.
                          +
                           menu "Build Configuration"
                          +
                           config APPS_DIR
                           	string "Application directory"
                          -	default "../apps"
                          +	default "../apps" if !WINDOWS_NATIVE
                          +	default "..\apps" if WINDOWS_NATIVE
                           	---help---
                           		Identifies the directory that builds the
                           		application to link with NuttX.  Default: ../apps This symbol must be assigned
                          @@ -192,6 +257,17 @@ config ARCH_MATH_H
                           		that don't select ARCH_MATH_H, the redirecting math.h header file
                           		will stay out-of-the-way in include/nuttx/.
                           
                          +config ARCH_FLOAT_H
                          +	bool "float.h"
                          +	default n
                          +	---help---
                          +		The float.h header file defines the properties of your floating
                          +		point implementation.  It would always be best to use your
                          +		toolchain's float.h header file but if none is avaiable, a default
                          +		float.h header file will provided if this option is selected.  However
                          + 		there is no assurance that the settings in this float.h are actually
                          +		correct for your platform!
                          +
                           config ARCH_STDARG_H
                           	bool "stdarg.h"
                           	default n
                          @@ -244,17 +320,24 @@ config DEBUG_ENABLE
                           
                           comment "Subsystem Debug Options"
                           
                          +config DEBUG_MM
                          +	bool "Enable Memory Manager Debug Output"
                          +	default n
                          +	---help---
                          +		Enable memory management debug output (disabled by default)
                          +
                           config DEBUG_SCHED
                           	bool "Enable Scheduler Debug Output"
                           	default n
                           	---help---
                           		Enable OS debug output (disabled by default)
                           
                          -config DEBUG_MM
                          -	bool "Enable Memory Manager Debug Output"
                          +config DEBUG_PAGING
                          +	bool "Enable Demand Paging Debug Output"
                           	default n
                          +	depends on PAGING
                           	---help---
                          -		Enable memory management debug output (disabled by default)
                          +		Enable demand paging debug output (disabled by default)
                           
                           config DEBUG_NET
                           	bool "Enable Network Debug Output"
                          @@ -311,6 +394,13 @@ config DEBUG_INPUT
                           		Enable low level debug output from the input device drivers such as
                            		mice and touchscreens (disabled by default)
                           
                          +config DEBUG_ANALOG
                          +	bool "Enable Analog Device Debug Output"
                          +	default n
                          +	---help---
                          +		Enable low level debug output from the analog device drivers such as
                          + 		A/D and D/A converters (disabled by default)
                          +
                           config DEBUG_I2C
                           	bool "Enable I2C Debug Output"
                           	default n
                          @@ -325,12 +415,18 @@ config DEBUG_SPI
                           	---help---
                           		Enable I2C driver debug output (disabled by default)
                           
                          +config DEBUG_DMA
                          +	bool "Enable DMA Debug Output"
                          +	default n
                          +	---help---
                          +		Enable DMA-releated debug output (disabled by default)
                          +
                           config DEBUG_WATCHDOG
                           	bool "Enable Watchdog Timer Debug Output"
                           	default n
                           	depends on WATCHDOG
                           	---help---
                          -		Enable  watchdog timer debug output (disabled by default)
                          +		Enable watchdog timer debug output (disabled by default)
                           
                           endif
                           
                          @@ -375,8 +471,12 @@ menu "Memory Management"
                           source mm/Kconfig
                           endmenu
                           
                          +menu "Binary Formats"
                          +source binfmt/Kconfig
                          +endmenu
                          +
                           menu "Library Routines"
                          -source lib/Kconfig
                          +source libc/Kconfig
                           source libxx/Kconfig
                           endmenu
                           
                          diff --git a/nuttx/Makefile b/nuttx/Makefile
                          index 7a058d88e9..cf7a57c83d 100644
                          --- a/nuttx/Makefile
                          +++ b/nuttx/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # Makefile
                           #
                          -#   Copyright (C) 2007-2012 Gregory Nutt. All rights reserved.
                          +#   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                           #
                           # Redistribution and use in source and binary forms, with or without
                          @@ -33,619 +33,17 @@
                           #
                           ############################################################################
                           
                          -TOPDIR		:= ${shell pwd | sed -e 's/ /\\ /g'}
                          --include ${TOPDIR}/.config
                          --include ${TOPDIR}/tools/Config.mk
                          --include ${TOPDIR}/Make.defs
                          +# This is a top-level "kludge" Makefile that just includes the correct
                          +# Makefile.  If you already know the Makefile that you want, you can skip
                          +# this nonsense using:
                          +#
                          +#   make -f Makefile.unix, OR
                          +#   make -f Makefile.win
                          +#
                           
                          -# Control build verbosity
                          -
                          -ifeq ($(V),1)
                          -export Q :=
                          +-include .config
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +include Makefile.win
                           else
                          -export Q := @
                          +include Makefile.unix
                           endif
                          -
                          -# Default tools
                          -
                          -ifeq ($(DIRLINK),)
                          -DIRLINK		= $(TOPDIR)/tools/link.sh
                          -DIRUNLINK	= $(TOPDIR)/tools/unlink.sh
                          -endif
                          -
                          -# This define is passed as EXTRADEFINES for kernel-mode builds.  It is also passed
                          -# during PASS1 (but not PASS2) context and depend targets.
                          -
                          -KDEFINE		= ${shell $(TOPDIR)/tools/define.sh $(CC) __KERNEL__}
                          -
                          -# Process architecture and board-specific directories
                          -
                          -ARCH_DIR	= arch/$(CONFIG_ARCH)
                          -ARCH_SRC	= $(ARCH_DIR)/src
                          -ARCH_INC	= $(ARCH_DIR)/include
                          -BOARD_DIR	= configs/$(CONFIG_ARCH_BOARD)
                          -
                          -# Add-on directories.  These may or may not be in place in the
                          -# NuttX source tree (they must be specifically installed)
                          -#
                          -# CONFIG_APPS_DIR can be over-ridden from the command line or in the .config file.
                          -# The default value of CONFIG_APPS_DIR is ../apps.  Ultimately, the application
                          -# will be built if APPDIR is defined.  APPDIR will be defined if a directory containing
                          -# a Makefile is found at the path provided by CONFIG_APPS_DIR
                          -
                          -ifeq ($(CONFIG_APPS_DIR),)
                          -CONFIG_APPS_DIR	= ../apps
                          -endif
                          -APPDIR		:= ${shell if [ -r $(CONFIG_APPS_DIR)/Makefile ]; then echo "$(CONFIG_APPS_DIR)"; fi}
                          -
                          -# All add-on directories.
                          -#
                          -# NUTTX_ADDONS is the list of directories built into the NuttX kernel.
                          -# USER_ADDONS is the list of directories that will be built into the user application
                          -
                          -NUTTX_ADDONS	:= $(NX_DIR)
                          -USER_ADDONS		:=
                          -
                          -ifeq ($(CONFIG_NUTTX_KERNEL),y)
                          -USER_ADDONS	+= $(APPDIR)
                          -else
                          -NUTTX_ADDONS	+= $(APPDIR)
                          -endif
                          -
                          -# Lists of build directories.
                          -#
                          -# FSDIRS depend on file descriptor support; NONFSDIRS do not (except for parts
                          -#   of FSDIRS).  We will exclude FSDIRS from the build if file descriptor
                          -#   support is disabled
                          -# CONTEXTDIRS include directories that have special, one-time pre-build
                          -#   requirements.  Normally this includes things like auto-generation of
                          -#   configuration specific files or creation of configurable symbolic links
                          -# USERDIRS - When NuttX is build is a monolithic kernel, this provides the
                          -#   list of directories that must be built
                          -# OTHERDIRS - These are directories that are not built but probably should
                          -#   be cleaned to prevent garbarge from collecting in them when changing
                          -#   configurations.
                          -
                          -NONFSDIRS	= sched $(ARCH_SRC) $(NUTTX_ADDONS)
                          -FSDIRS		= fs drivers binfmt
                          -CONTEXTDIRS	= $(APPDIR)
                          -USERDIRS	=
                          -
                          -ifeq ($(CONFIG_NUTTX_KERNEL),y)
                          -
                          -NONFSDIRS	+= syscall
                          -CONTEXTDIRS	+= syscall
                          -USERDIRS	+= syscall lib mm $(USER_ADDONS)
                          -ifeq ($(CONFIG_HAVE_CXX),y)
                          -USERDIRS	+= libxx
                          -endif
                          -
                          -else
                          -
                          -NONFSDIRS	+= lib mm
                          -OTHERDIRS	+= syscall $(USER_ADDONS)
                          -ifeq ($(CONFIG_HAVE_CXX),y)
                          -NONFSDIRS	+= libxx
                          -else
                          -OTHERDIRS	+= libxx
                          -endif
                          -
                          -endif
                          -
                          -ifeq ($(CONFIG_NX),y)
                          -NONFSDIRS	+= graphics
                          -CONTEXTDIRS	+= graphics
                          -else
                          -OTHERDIRS	+= graphics
                          -endif
                          -
                          -# CLEANDIRS are the directories that will clean in.  These are
                          -#   all directories that we know about.
                          -# KERNDEPDIRS are the directories in which we will build target dependencies.
                          -#   If NuttX and applications are built separately (CONFIG_NUTTX_KERNEL),
                          -#   then this holds only the directories containing kernel files.
                          -# USERDEPDIRS. If NuttX and applications are built separately (CONFIG_NUTTX_KERNEL),
                          -#   then this holds only the directories containing user files.
                          -
                          -CLEANDIRS	= $(NONFSDIRS) $(FSDIRS) $(USERDIRS) $(OTHERDIRS)
                          -KERNDEPDIRS	= $(NONFSDIRS)
                          -USERDEPDIRS	= $(USERDIRS)
                          -
                          -# Add file system directories to KERNDEPDIRS (they are already in CLEANDIRS)
                          -
                          -ifeq ($(CONFIG_NFILE_DESCRIPTORS),0)
                          -ifeq ($(CONFIG_NET),y)
                          -ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0)
                          -KERNDEPDIRS	+= fs
                          -endif
                          -KERNDEPDIRS	+= drivers
                          -endif
                          -else
                          -KERNDEPDIRS	+= $(FSDIRS)
                          -endif
                          -
                          -# Add networking directories to KERNDEPDIRS and CLEANDIRS
                          -
                          -ifeq ($(CONFIG_NET),y)
                          -KERNDEPDIRS	+= net
                          -endif
                          -CLEANDIRS	+= net
                          -
                          -#
                          -# Extra objects used in the final link.
                          -#
                          -# Pass 1 1ncremental (relative) link objects should be put into the
                          -# processor-specific source directory (where other link objects will
                          -# be created).  If the pass1 obect is an archive, it could go anywhere.
                          -
                          -ifeq ($(CONFIG_BUILD_2PASS),y)
                          -EXTRA_OBJS	+= $(CONFIG_PASS1_OBJECT)
                          -endif
                          -
                          -# NUTTXLIBS is the list of NuttX libraries that is passed to the
                          -#   processor-specific Makefile to build the final NuttX target.
                          -#   Libraries in FSDIRS are excluded if file descriptor support
                          -#   is disabled.
                          -# USERLIBS is the list of libraries used to build the final user-space
                          -#   application
                          -
                          -NUTTXLIBS	= sched/libsched$(LIBEXT) $(ARCH_SRC)/libarch$(LIBEXT)
                          -USERLIBS	=
                          -
                          -# Add libraries for syscall support.  The C library will be needed by
                          -# both the kernel- and user-space builds.  For now, the memory manager (mm)
                          -# is placed in user space (only).
                          -
                          -ifeq ($(CONFIG_NUTTX_KERNEL),y)
                          -NUTTXLIBS	+= syscall/libstubs$(LIBEXT) lib/libklib$(LIBEXT)
                          -USERLIBS	+= syscall/libproxies$(LIBEXT) lib/libulib$(LIBEXT) mm/libmm$(LIBEXT)
                          -else
                          -NUTTXLIBS	+= mm/libmm$(LIBEXT) lib/liblib$(LIBEXT)
                          -endif
                          -
                          -# Add libraries for C++ support.  CXX, CXXFLAGS, and COMPILEXX must
                          -# be defined in Make.defs for this to work!
                          -
                          -ifeq ($(CONFIG_HAVE_CXX),y)
                          -ifeq ($(CONFIG_NUTTX_KERNEL),y)
                          -USERLIBS	+= libxx/liblibxx$(LIBEXT)
                          -else
                          -NUTTXLIBS	+= libxx/liblibxx$(LIBEXT)
                          -endif
                          -endif
                          -
                          -# Add library for application support.
                          -
                          -ifneq ($(APPDIR),)
                          -ifeq ($(CONFIG_NUTTX_KERNEL),y)
                          -USERLIBS	+= $(APPDIR)/libapps$(LIBEXT)
                          -else
                          -NUTTXLIBS	+= $(APPDIR)/libapps$(LIBEXT)
                          -endif
                          -endif
                          -
                          -# Add libraries for network support
                          -
                          -ifeq ($(CONFIG_NET),y)
                          -NUTTXLIBS	+= net/libnet$(LIBEXT)
                          -endif
                          -
                          -# Add libraries for file system support
                          -
                          -ifeq ($(CONFIG_NFILE_DESCRIPTORS),0)
                          -ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0)
                          -NUTTXLIBS	+= fs/libfs$(LIBEXT)
                          -endif
                          -ifeq ($(CONFIG_NET),y)
                          -NUTTXLIBS	+= drivers/libdrivers$(LIBEXT)
                          -endif
                          -else
                          -NUTTXLIBS	+= fs/libfs$(LIBEXT) drivers/libdrivers$(LIBEXT) binfmt/libbinfmt$(LIBEXT)
                          -endif
                          -
                          -# Add libraries for the NX graphics sub-system
                          -
                          -ifneq ($(NX_DIR),)
                          -NUTTXLIBS	+= $(NX_DIR)/libnx$(LIBEXT)
                          -endif
                          -
                          -ifeq ($(CONFIG_NX),y)
                          -NUTTXLIBS        += graphics/libgraphics$(LIBEXT)
                          -endif
                          -
                          -# This is the name of the final target (relative to the top level directorty)
                          -
                          -BIN		= nuttx$(EXEEXT)
                          -
                          -all: $(BIN)
                          -.PHONY: context clean_context check_context export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean
                          -
                          -# Target used to copy include/nuttx/math.h.  If CONFIG_ARCH_MATH_H is
                          -# defined, then there is an architecture specific math.h header file
                          -# that will be included indirectly from include/math.h.  But first, we
                          -# have to copy math.h from include/nuttx/. to include/.
                          -
                          -ifeq ($(CONFIG_ARCH_MATH_H),y)
                          -include/math.h: include/nuttx/math.h
                          -	@cp -f include/nuttx/math.h include/math.h
                          -else
                          -include/math.h:
                          -endif
                          -
                          -# Target used to copy include/nuttx/stdarg.h.  If CONFIG_ARCH_STDARG_H is
                          -# defined, then there is an architecture specific stdarg.h header file
                          -# that will be included indirectly from include/stdarg.h.  But first, we
                          -# have to copy stdarg.h from include/nuttx/. to include/.
                          -
                          -ifeq ($(CONFIG_ARCH_STDARG_H),y)
                          -include/stdarg.h: include/nuttx/stdarg.h
                          -	@cp -f include/nuttx/stdarg.h include/stdarg.h
                          -else
                          -include/stdarg.h:
                          -endif
                          -
                          -# Targets used to build include/nuttx/version.h.  Creation of version.h is
                          -# part of the overall NuttX configuration sequence. Notice that the
                          -# tools/mkversion tool is built and used to create include/nuttx/version.h
                          -
                          -tools/mkversion:
                          -	@$(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)"  mkversion
                          -
                          -$(TOPDIR)/.version:
                          -	@if [ ! -f .version ]; then \
                          -		echo "No .version file found, creating one"; \
                          -		tools/version.sh -v 0.0 -b 0 .version; \
                          -		chmod 755 .version; \
                          -	fi
                          -
                          -include/nuttx/version.h: $(TOPDIR)/.version tools/mkversion
                          -	@tools/mkversion $(TOPDIR) > include/nuttx/version.h
                          -
                          -# Targets used to build include/nuttx/config.h.  Creation of config.h is
                          -# part of the overall NuttX configuration sequence. Notice that the
                          -# tools/mkconfig tool is built and used to create include/nuttx/config.h
                          -
                          -tools/mkconfig:
                          -	@$(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)"  mkconfig
                          -
                          -include/nuttx/config.h: $(TOPDIR)/.config tools/mkconfig
                          -	@tools/mkconfig $(TOPDIR) > include/nuttx/config.h
                          -
                          -# dirlinks, and helpers
                          -#
                          -# Directories links.  Most of establishing the NuttX configuration involves
                          -# setting up symbolic links with 'generic' directory names to specific,
                          -# configured directories.
                          -#
                          -# Link the apps/include directory to include/apps
                          -
                          -include/apps: Make.defs
                          -ifneq ($(APPDIR),)
                          -	@if [ -d $(TOPDIR)/$(APPDIR)/include ]; then \
                          -		$(DIRLINK) $(TOPDIR)/$(APPDIR)/include include/apps; \
                          -	fi
                          -endif
                          -
                          -# Link the arch//include directory to include/arch
                          -
                          -include/arch: Make.defs
                          -	@$(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
                          -	@$(DIRLINK) $(TOPDIR)/$(BOARD_DIR)/include include/arch/board
                          -
                          -# Link the configs//src dir to arch//src/board
                          -
                          -$(ARCH_SRC)/board: Make.defs
                          -	@$(DIRLINK) $(TOPDIR)/$(BOARD_DIR)/src $(ARCH_SRC)/board
                          -
                          -# Link arch//include/ to arch//include/chip
                          -
                          -$(ARCH_SRC)/chip: Make.defs
                          -ifneq ($(CONFIG_ARCH_CHIP),)
                          -	@$(DIRLINK) $(TOPDIR)/$(ARCH_SRC)/$(CONFIG_ARCH_CHIP) $(ARCH_SRC)/chip
                          -endif
                          -
                          -# Link arch//src/ to arch//src/chip
                          -
                          -include/arch/chip: include/arch Make.defs
                          -ifneq ($(CONFIG_ARCH_CHIP),)
                          -	@$(DIRLINK) $(TOPDIR)/$(ARCH_INC)/$(CONFIG_ARCH_CHIP) include/arch/chip
                          -endif
                          -
                          -dirlinks: include/arch include/arch/board include/arch/chip $(ARCH_SRC)/board $(ARCH_SRC)/chip include/apps
                          -
                          -# context
                          -#
                          -# The context target is invoked on each target build to assure that NuttX is
                          -# properly configured.  The basic configuration steps include creation of the
                          -# the config.h and version.h header files in the include/nuttx directory and
                          -# the establishment of symbolic links to configured directories.
                          -
                          -context: check_context include/nuttx/config.h include/nuttx/version.h include/math.h include/stdarg.h dirlinks
                          -	@for dir in $(CONTEXTDIRS) ; do \
                          -		$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" context; \
                          -	done
                          -
                          -# clean_context
                          -#
                          -# This is part of the distclean target.  It removes all of the header files
                          -# and symbolic links created by the context target.
                          -
                          -clean_context:
                          -	@rm -f include/nuttx/config.h
                          -	@rm -f include/nuttx/version.h
                          -	@rm -f include/math.h
                          -	@rm -f include/stdarg.h
                          -	@$(DIRUNLINK) include/arch/board
                          -	@$(DIRUNLINK) include/arch/chip
                          -	@$(DIRUNLINK) include/arch
                          -	@$(DIRUNLINK) $(ARCH_SRC)/board
                          -	@$(DIRUNLINK) $(ARCH_SRC)/chip
                          -	@$(DIRUNLINK) include/apps
                          -
                          -# check_context
                          -#
                          -# This target checks if NuttX has been configured.  NuttX is configured using
                          -# the script tools/configure.sh.  That script will install certain files in
                          -# the top-level NuttX build directory.  This target verifies that those
                          -# configuration files have been installed and that NuttX is ready to be built.
                          -
                          -check_context:
                          -	@if [ ! -e ${TOPDIR}/.config -o ! -e ${TOPDIR}/Make.defs ]; then \
                          -		echo "" ; echo "Nuttx has not been configured:" ; \
                          -		echo "  cd tools; ./configure.sh " ; echo "" ; \
                          -		exit 1 ; \
                          -	fi
                          -
                          -# Archive targets.  The target build sequency will first create a series of
                          -# libraries, one per configured source file directory.  The final NuttX
                          -# execution will then be built from those libraries.  The following targets
                          -# built those libraries.
                          -#
                          -# Possible kernel-mode builds
                          -
                          -lib/libklib$(LIBEXT): context
                          -	@$(MAKE) -C lib TOPDIR="$(TOPDIR)" libklib$(LIBEXT) EXTRADEFINES=$(KDEFINE)
                          -
                          -sched/libsched$(LIBEXT): context
                          -	@$(MAKE) -C sched TOPDIR="$(TOPDIR)" libsched$(LIBEXT) EXTRADEFINES=$(KDEFINE)
                          -
                          -$(ARCH_SRC)/libarch$(LIBEXT): context
                          -	@$(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) EXTRADEFINES=$(KDEFINE)
                          -
                          -net/libnet$(LIBEXT): context
                          -	@$(MAKE) -C net TOPDIR="$(TOPDIR)" libnet$(LIBEXT) EXTRADEFINES=$(KDEFINE)
                          -
                          -fs/libfs$(LIBEXT): context
                          -	@$(MAKE) -C fs TOPDIR="$(TOPDIR)" libfs$(LIBEXT) EXTRADEFINES=$(KDEFINE)
                          -
                          -drivers/libdrivers$(LIBEXT): context
                          -	@$(MAKE) -C drivers TOPDIR="$(TOPDIR)" libdrivers$(LIBEXT) EXTRADEFINES=$(KDEFINE)
                          -
                          -binfmt/libbinfmt$(LIBEXT): context
                          -	@$(MAKE) -C binfmt TOPDIR="$(TOPDIR)" libbinfmt$(LIBEXT) EXTRADEFINES=$(KDEFINE)
                          -
                          -graphics/libgraphics$(LIBEXT): context
                          -	@$(MAKE) -C graphics TOPDIR="$(TOPDIR)" libgraphics$(LIBEXT) EXTRADEFINES=$(KDEFINE)
                          -
                          -syscall/libstubs$(LIBEXT): context
                          -	@$(MAKE) -C syscall TOPDIR="$(TOPDIR)" libstubs$(LIBEXT) EXTRADEFINES=$(KDEFINE)
                          -
                          -# Possible user-mode builds
                          -
                          -lib/libulib$(LIBEXT): context
                          -	@$(MAKE) -C lib TOPDIR="$(TOPDIR)" libulib$(LIBEXT)
                          -
                          -libxx/liblibxx$(LIBEXT): context
                          -	@$(MAKE) -C libxx TOPDIR="$(TOPDIR)" liblibxx$(LIBEXT)
                          -
                          -mm/libmm$(LIBEXT): context
                          -	@$(MAKE) -C mm TOPDIR="$(TOPDIR)" libmm$(LIBEXT) EXTRADEFINES=$(KDEFINE)
                          -
                          -$(APPDIR)/libapps$(LIBEXT): context
                          -	@$(MAKE) -C $(APPDIR) TOPDIR="$(TOPDIR)" libapps$(LIBEXT)
                          -
                          -syscall/libproxies$(LIBEXT): context
                          -	@$(MAKE) -C syscall TOPDIR="$(TOPDIR)" libproxies$(LIBEXT)
                          -
                          -# Possible non-kernel builds
                          -
                          -lib/liblib$(LIBEXT): context
                          -	@$(MAKE) -C lib TOPDIR="$(TOPDIR)" liblib$(LIBEXT)
                          -
                          -# pass1 and pass2
                          -#
                          -# If the 2 pass build option is selected, then this pass1 target is
                          -# configured to built before the pass2 target.  This pass1 target may, as an
                          -# example, build an extra link object (CONFIG_PASS1_OBJECT) which may be an
                          -# incremental (relative) link object, but could be a static library (archive);
                          -# some modification to this Makefile would be required if CONFIG_PASS1_OBJECT
                          -# is an archive.  Exactly what is performed during pass1 or what it generates
                          -# is unknown to this makefule unless CONFIG_PASS1_OBJECT is defined.
                          -
                          -pass1deps: context pass1dep $(USERLIBS)
                          -
                          -pass1: pass1deps
                          -ifeq ($(CONFIG_BUILD_2PASS),y)
                          -	@if [ -z "$(CONFIG_PASS1_BUILDIR)" ]; then \
                          -		echo "ERROR: CONFIG_PASS1_BUILDIR not defined"; \
                          -		exit 1; \
                          -	fi
                          -	@if [ ! -d "$(CONFIG_PASS1_BUILDIR)" ]; then \
                          -		echo "ERROR: CONFIG_PASS1_BUILDIR does not exist"; \
                          -		exit 1; \
                          -	fi
                          -	@if [ ! -f "$(CONFIG_PASS1_BUILDIR)/Makefile" ]; then \
                          -		echo "ERROR: No Makefile in CONFIG_PASS1_BUILDIR"; \
                          -		exit 1; \
                          -	fi
                          -	@$(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" LINKLIBS="$(NUTTXLIBS)" USERLIBS="$(USERLIBS)" "$(CONFIG_PASS1_TARGET)"
                          -endif
                          -
                          -pass2deps: context pass2dep $(NUTTXLIBS)
                          -
                          -pass2: pass2deps
                          -	@$(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" EXTRA_OBJS="$(EXTRA_OBJS)" LINKLIBS="$(NUTTXLIBS)" EXTRADEFINES=$(KDEFINE) $(BIN)
                          -	@if [ -w /tftpboot ] ; then \
                          -		cp -f $(BIN) /tftpboot/$(BIN).${CONFIG_ARCH}; \
                          -	fi
                          -ifeq ($(CONFIG_RRLOAD_BINARY),y)
                          -	@echo "MK: $(BIN).rr"
                          -	@$(TOPDIR)/tools/mkimage.sh --Prefix $(CROSSDEV) $(BIN) $(BIN).rr
                          -	@if [ -w /tftpboot ] ; then \
                          -		cp -f $(BIN).rr /tftpboot/$\(BIN).rr.$(CONFIG_ARCH); \
                          -	fi
                          -endif
                          -ifeq ($(CONFIG_INTELHEX_BINARY),y)
                          -	@echo "CP: $(BIN).hex"
                          -	@$(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) $(BIN).hex
                          -endif
                          -ifeq ($(CONFIG_MOTOROLA_SREC),y)
                          -	@echo "CP: $(BIN).srec"
                          -	@$(OBJCOPY) $(OBJCOPYARGS) -O srec $(BIN) $(BIN).srec
                          -endif
                          -ifeq ($(CONFIG_RAW_BINARY),y)
                          -	@echo "CP: $(BIN).bin"
                          -	@$(OBJCOPY) $(OBJCOPYARGS) -O binary $(BIN) $(BIN).bin
                          -endif
                          -
                          -# $(BIN)
                          -#
                          -# Create the final NuttX executable in a two pass build process.  In the
                          -# normal case, all pass1 and pass2 dependencies are created then pass1
                          -# and pass2 targets are built.  However, in some cases, you may need to build
                          -# pass1 depenencies and pass1 first, then build pass2 dependencies and pass2.
                          -# in that case, execute 'make pass1 pass2' from the command line.
                          -
                          -$(BIN): pass1deps pass2deps pass1 pass2
                          -
                          -# download
                          -#
                          -# This is a helper target that will rebuild NuttX and download it to the target
                          -# system in one step.  The operation of this target depends completely upon
                          -# implementation of the DOWNLOAD command in the user Make.defs file.  It will
                          -# generate an error an error if the DOWNLOAD command is not defined.
                          -
                          -download: $(BIN)
                          -	$(call DOWNLOAD, $<)
                          -
                          -# pass1dep: Create pass1 build dependencies
                          -# pass2dep: Create pass2 build dependencies
                          -
                          -pass1dep: context
                          -	@for dir in $(USERDEPDIRS) ; do \
                          -		$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" depend ; \
                          -	done
                          -
                          -pass2dep: context
                          -	@for dir in $(KERNDEPDIRS) ; do \
                          -		$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" EXTRADEFINES=$(KDEFINE) depend; \
                          -	done
                          -
                          -# Configuration targets
                          -#
                          -# These targets depend on the kconfig-frontends packages.  To use these, you
                          -# must first download and install the kconfig-frontends package from this
                          -# location: http://ymorin.is-a-geek.org/projects/kconfig-frontends.  See
                          -# misc/tools/README.txt for additional information.
                          -
                          -config:
                          -	@APPSDIR=${CONFIG_APPS_DIR} conf Kconfig
                          -
                          -oldconfig:
                          -	@APPSDIR=${CONFIG_APPS_DIR} conf --oldconfig Kconfig
                          -
                          -menuconfig:
                          -	@APPSDIR=${CONFIG_APPS_DIR} mconf Kconfig
                          -
                          -# export
                          -#
                          -# The export target will package the NuttX libraries and header files into
                          -# an exportable package.  Caveats: (1) These needs some extension for the KERNEL
                          -# build; it needs to receive USERLIBS and create a libuser.a). (2) The logic
                          -# in tools/mkexport.sh only supports GCC and, for example, explicitly assumes
                          -# that the archiver is 'ar'
                          -
                          -export: pass2deps
                          -	@tools/mkexport.sh -w$(WINTOOL) -t "$(TOPDIR)" -l "$(NUTTXLIBS)"
                          -
                          -# General housekeeping targets:  dependencies, cleaning, etc.
                          -#
                          -# depend:    Create both PASS1 and PASS2 dependencies
                          -# clean:     Removes derived object files, archives, executables, and
                          -#            temporary files, but retains the configuration and context
                          -#            files and directories.
                          -# distclean: Does 'clean' then also removes all configuration and context
                          -#            files.  This essentially restores the directory structure
                          -#            to its original, unconfigured stated.
                          -
                          -depend: pass1dep pass2dep
                          -
                          -subdir_clean:
                          -	@for dir in $(CLEANDIRS) ; do \
                          -		if [ -e $$dir/Makefile ]; then \
                          -			$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" clean ; \
                          -		fi \
                          -	done
                          -	@$(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" clean
                          -	@$(MAKE) -C mm -f Makefile.test TOPDIR="$(TOPDIR)" clean
                          -ifeq ($(CONFIG_BUILD_2PASS),y)
                          -	@$(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" clean
                          -endif
                          -
                          -clean: subdir_clean
                          -	@rm -f $(BIN) nuttx.* mm_test *.map _SAVED_APPS_config *~
                          -	@rm -f nuttx-export*
                          -
                          -subdir_distclean:
                          -	@for dir in $(CLEANDIRS) ; do \
                          -		if [ -e $$dir/Makefile ]; then \
                          -			$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" distclean ; \
                          -		fi \
                          -	done
                          -
                          -distclean: clean subdir_distclean clean_context
                          -ifeq ($(CONFIG_BUILD_2PASS),y)
                          -	@$(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" distclean
                          -endif
                          -	@rm -f Make.defs setenv.sh .config .config.old
                          -
                          -# Application housekeeping targets.  The APPDIR variable refers to the user
                          -# application directory.  A sample apps/ directory is included with NuttX,
                          -# however, this is not treated as part of NuttX and may be replaced with a
                          -# different application directory.  For the most part, the application
                          -# directory is treated like any other build directory in this script.  However,
                          -# as a convenience, the following targets are included to support housekeeping
                          -# functions in the user application directory from the NuttX build directory.
                          -#
                          -# apps_clean:     Perform the clean operation only in the user application
                          -#                 directory
                          -# apps_distclean: Perform the distclean operation only in the user application
                          -#                 directory.  Note that the apps/.config file (inf any) is
                          -#                 preserved so that this is not a "full" distclean but more of a
                          -#                 configuration "reset." (There willnot be an apps/.config
                          -#                 file if the configuration was generated via make menuconfig).
                          -
                          -apps_clean:
                          -ifneq ($(APPDIR),)
                          -	@$(MAKE) -C "$(TOPDIR)/$(APPDIR)" TOPDIR="$(TOPDIR)" clean
                          -endif
                          -
                          -apps_distclean:
                          -ifneq ($(APPDIR),)
                          -	@if [ -r "$(TOPDIR)/$(APPDIR)/.config" ]; then \
                          -		cp "$(TOPDIR)/$(APPDIR)/.config" _SAVED_APPS_config || \
                          -			{ echo "Copy of $(APPDIR)/.config failed" ; exit 1 ; } \
                          -	else \
                          -		rm -f _SAVED_APPS_config; \
                          -	fi
                          -	@$(MAKE) -C "$(TOPDIR)/$(APPDIR)" TOPDIR="$(TOPDIR)" distclean
                          -	@if [ -r _SAVED_APPS_config ]; then \
                          -		@mv _SAVED_APPS_config "$(TOPDIR)/$(APPDIR)/.config" || \
                          -			{ echo "Copy of _SAVED_APPS_config failed" ; exit 1 ; } \
                          -	fi
                          -endif
                          -
                          diff --git a/nuttx/TODO b/nuttx/TODO
                          index 8e353a9563..6c28bfd434 100644
                          --- a/nuttx/TODO
                          +++ b/nuttx/TODO
                          @@ -14,8 +14,8 @@ nuttx/
                             (2)  C++ Support
                             (6)  Binary loaders (binfmt/)
                            (17)  Network (net/, drivers/net)
                          -  (3)  USB (drivers/usbdev, drivers/usbhost)
                          - (11)  Libraries (lib/)
                          +  (4)  USB (drivers/usbdev, drivers/usbhost)
                          + (11)  Libraries (libc/, )
                             (9)  File system/Generic drivers (fs/, drivers/)
                             (5)  Graphics subystem (graphics/)
                             (1)  Pascal add-on (pcode/)
                          @@ -32,7 +32,7 @@ nuttx/
                             (0)  ARM/LPC43x (arch/arm/src/lpc43xx/)
                             (3)  ARM/STR71x (arch/arm/src/str71x/)
                             (3)  ARM/LM3S6918 (arch/arm/src/lm3s/)
                          -  (7)  ARM/STM32 (arch/arm/src/stm32/)
                          +  (4)  ARM/STM32 (arch/arm/src/stm32/)
                             (3)  AVR (arch/avr)
                             (0)  Intel x86 (arch/x86)
                             (5)  8051 / MCS51 (arch/8051/)
                          @@ -421,7 +421,7 @@ o Binary loaders (binfmt/)
                                             .word   .LC3-(.LPIC4+4)
                                             .word   .LC4-(.LPIC5+4)
                           
                          -               This is good and bad.  This is good because it means that .rodata.str1.1 can not
                          +               This is good and bad.  This is good because it means that .rodata.str1.1 can now
                                          reside in FLASH with .text and can be accessed using PC-relative addressing. 
                                          That can be accomplished by simply moving the .rodata from the .data section to
                                          the .text section in the linker script.  (The NXFLAT linker script is located at
                          @@ -629,8 +629,13 @@ o USB (drivers/usbdev, drivers/usbhost)
                                          CDC/ACM serial driver might need the line coding data (that
                                          data is not used currenly, but it might be).
                           
                          -o Libraries (lib/)
                          -  ^^^^^^^^^^^^^^^^
                          +  Title:       USB HUB SUPPORT
                          +  Description: Add support for USB hubs
                          +  Status:      Open
                          +  Priority:    Low/Unknown.  This is a feature enhancement.
                          +
                          +o Libraries (libc/)
                          +  ^^^^^^^^^^^^^^^^^
                           
                             Title:       ENVIRON
                             Description: The definition of environ in stdlib.h is bogus and will not
                          @@ -643,7 +648,7 @@ o Libraries (lib/)
                             Description: Need some minimal termios support... at a minimum, enough to
                                          switch between raw and "normal" modes to support behavior like
                                          that needed for readline().
                          -               UPDATE:  There is growing functionality in lib/termios/ and in the
                          +               UPDATE:  There is growing functionality in libc/termios/ and in the
                                          ioctl methods of several MCU serial drivers (stm32, lpc43, lpc17,
                                          pic32).  However, as phrased, this bug cannot yet be closed since
                                          this "growing functionality" does not address all termios.h
                          @@ -708,7 +713,7 @@ o Libraries (lib/)
                             Priority:     
                           
                             Title:       OLD dtoa NEEDS TO BE UPDATED
                          -  Description: This implementation of dtoa in lib/stdio is old and will not
                          +  Description: This implementation of dtoa in libc/stdio is old and will not
                                          work with some newer compilers.  See 
                                          http://patrakov.blogspot.com/2009/03/dont-use-old-dtoac.html
                             Status:      Open
                          @@ -716,7 +721,7 @@ o Libraries (lib/)
                           
                             Title:       SYSLOG INTEGRATION
                             Description: There are the beginnings of some system logging capabilities (see
                          -               drivers/syslog, fs/fs_syslog.c, and lib/stdio/lib_librawprintf.c and
                          +               drivers/syslog, fs/fs_syslog.c, and libc/stdio/lib_librawprintf.c and
                                          lib_liblowprintf.c.  For NuttX, SYSLOG is a concept and includes,
                                          extends, and replaces the legacy NuttX debug ouput.  Some additional
                                          integration is required to formalized this.  For example:
                          @@ -960,7 +965,7 @@ o Build system
                                          built configuration, only the multiple user mode can be supported
                                          with the NX server residing inside of the kernel space.  In
                                          this case, most of the user end functions in graphics/nxmu
                          -               must be moved to lib/nx and those functions must be built into
                          +               must be moved to libc/nx and those functions must be built into
                                          libuser.a to be linked with the user-space code.
                                          A similar issue exists in NSH that uses some internal OS
                                          interfaces that would not be available in a kernel build
                          @@ -1393,11 +1398,6 @@ o ARM/LM3S6918 (arch/arm/src/lm3s/)
                           o ARM/STM32 (arch/arm/src/stm32/)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                           
                          -  Title:       NOR FLASH DRIVER
                          -  Description: NOR Flash driver with FTL layer to support a file system.
                          -  Status:      Open
                          -  Priority:    Low
                          -
                             Title:       USBSERIAL ISSUES
                             Description  A USB device-side driver is in place but not well tested.  At
                                          present, the apps/examples/usbserial test sometimes fails.  The situation
                          @@ -1420,11 +1420,6 @@ o ARM/STM32 (arch/arm/src/stm32/)
                             Status:      Open
                             Priority:    Medium-High
                             
                          -  Title:       FSMC EXTERNAL MEMORY UNTESTED
                          -  Description: FSMC external memory support is untested
                          -  Status:      Open
                          -  Priority:    Low
                          -
                             Title:       DMA EXTENSIONS
                             Description: DMA logic needs to be extended.  DMA2, Channel 5, will not work
                                          because the DMA2 channels 4 & 5 share the same interrupt.
                          @@ -1432,12 +1427,6 @@ o ARM/STM32 (arch/arm/src/stm32/)
                             Priority:    Low until someone needs DMA1, Channel 5 (ADC3, UART4_TX, TIM5_CH1, or
                                          TIM8_CH2).
                           
                          -  Title:       UNFINISHED DRIVERS
                          -  Description: The following drivers are incomplete:  DAC.  The following drivers
                          -               are untested:  DMA on the F4, CAN.
                          -  Status:      Open
                          -  Priority:    Medium
                          -
                             Title:       F4 SDIO MULTI-BLOCK TRANSFER FAILURES
                             Description: If you use a large I/O buffer to access the file system, then the
                                          MMCSD driver will perform multiple block SD transfers.  With DMA
                          @@ -1461,13 +1450,15 @@ o ARM/STM32 (arch/arm/src/stm32/)
                             Status:      Open
                             Priority:    Low (I am not even sure if this is a problem yet).
                           
                          -  Status:      UNFINISHED STM32 F4 OTG FS HOST DRIVER
                          -  Description: A quick-n-dirty leverage of the the LPC17xx host driver was put into
                          -               the STM32 source to support development of the STM32 F4 OTG FS host
                          -               driver.  It is non-functional and still waiting for STM32 F4 logic
                          -               to be added.  Don't use it!
                          +  Title:       DMA FROM EXTERNAL, FSMC MEMORY
                          +  Description: I have seen a problem on F1 where all SDIO DMAs work exist for
                          +               write DMAs from FSMC memory (i.e., from FSMC memory to SDIO).
                          +               Read transfers work fine (SDIO to FSMC memory).  The failure is
                          +               a data underrun error with zero bytes of data transferred.  The
                          +               workaround for now is to use DMA buffers allocted from internal
                          +               SRAM.
                             Status:      Open
                          -  Priority:    Low (unless you need a host driver).
                          +  Priority:    Low
                           
                           o AVR (arch/avr)
                             ^^^^^^^^^^^^^^
                          diff --git a/nuttx/arch/arm/include/elf.h b/nuttx/arch/arm/include/elf.h
                          new file mode 100644
                          index 0000000000..21b2c1c2c1
                          --- /dev/null
                          +++ b/nuttx/arch/arm/include/elf.h
                          @@ -0,0 +1,243 @@
                          +/****************************************************************************
                          + * arch/arm/include/syscall.h
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Author: Gregory Nutt 
                          + *
                          + * Reference: "ELF for the ARM® Architecture," ARM IHI 0044D, current through
                          + *   ABI release 2.08, October 28, 2009, ARM Limited.
                          + *
                          + * 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_ARM_INCLUDE_ELF_H
                          +#define __ARCH_ARM_INCLUDE_ELF_H
                          +
                          +/****************************************************************************
                          + * Pre-processor Definitions
                          + ****************************************************************************/
                          +
                          +/* 4.3.1 ELF Identification.  Should have:
                          + *
                          + * e_machine         = EM_ARM
                          + * e_ident[EI_CLASS] = ELFCLASS32
                          + * e_ident[EI_DATA]  = ELFDATA2LSB (little endian) or ELFDATA2MSB (big endian)
                          + */
                          +
                          +#if 0 /* Defined in include/elf32.h */
                          +#define EM_ARM                   40
                          +#endif
                          +
                          +/* Table 4-2, ARM-specific e_flags */
                          +
                          +#define EF_ARM_EABI_MASK         0xff000000
                          +#define EF_ARM_EABI_UNKNOWN      0x00000000
                          +#define EF_ARM_EABI_VER1         0x01000000
                          +#define EF_ARM_EABI_VER2         0x02000000
                          +#define EF_ARM_EABI_VER3         0x03000000
                          +#define EF_ARM_EABI_VER4         0x04000000
                          +#define EF_ARM_EABI_VER5         0x05000000
                          +
                          +#define EF_ARM_BE8               0x00800000 
                          +
                          +/* Table 4-4, Processor specific section types */
                          +
                          +#define SHT_ARM_EXIDX            0x70000001 /* Exception Index table */
                          +#define SHT_ARM_PREEMPTMAP       0x70000002 /* BPABI DLL dynamic linking pre-emption map */
                          +#define SHT_ARM_ATTRIBUTES       0x70000003 /* Object file compatibility attributes */
                          +#define SHT_ARM_DEBUGOVERLAY     0x70000004
                          +#define SHT_ARM_OVERLAYSECTION   0x70000005
                          +
                          +/* 4.7.1 Relocation codes
                          + *
                          + * S (when used on its own) is the address of the symbol.
                          + * A is the addend for the relocation.
                          + * P is the address of the place being relocated (derived from r_offset).
                          + * Pa is the adjusted address of the place being relocated, defined as (P & 0xFFFFFFFC).
                          + * T is 1 if the target symbol S has type STT_FUNC and the symbol addresses a Thumb instruction;
                          + *   it is 0 otherwise.
                          + * B(S) is the addressing origin of the output segment defining the symbol S.
                          + * GOT_ORG is the addressing origin of the Global Offset Table
                          + * GOT(S) is the address of the GOT entry for the symbol S.
                          + */
                          +
                          +#define R_ARM_NONE               0             /* No relocation */
                          +#define R_ARM_PC24               1             /* ARM       ((S + A) | T) - P */
                          +#define R_ARM_ABS32              2             /* Data      (S + A) | T */
                          +#define R_ARM_REL32              3             /* Data      ((S + A) | T) - P */
                          +#define R_ARM_LDR_PC_G0          4             /* ARM       S + A - P */
                          +#define R_ARM_ABS16              5             /* Data      S + A */
                          +#define R_ARM_ABS12              6             /* ARM       S + A */
                          +#define R_ARM_THM_ABS5           7             /* Thumb16   S + A */
                          +#define R_ARM_ABS8               8             /* Data      S + A */
                          +#define R_ARM_SBREL32            9             /* Data      ((S + A) | T) - B(S) */
                          +#define R_ARM_THM_CALL           10            /* Thumb32   ((S + A) | T) - P */
                          +#define R_ARM_THM_PC8            11            /* Thumb16   S + A - Pa */
                          +#define R_ARM_BREL_ADJ           12            /* Data      ?B(S) + A */
                          +#define R_ARM_TLS_DESC           13            /* Data     */
                          +#define R_ARM_THM_SWI8           14            /* Obsolete */
                          +#define R_ARM_XPC25              15            /* Obsolete */
                          +#define R_ARM_THM_XPC22          16            /* Obsolete */
                          +#define R_ARM_TLS_DTPMOD32       17            /* Data      Module[S] */
                          +#define R_ARM_TLS_DTPOFF32       18            /* Data      S + A - TLS */
                          +#define R_ARM_TLS_TPOFF32        19            /* Data      S + A - tp */
                          +#define R_ARM_COPY               20            /* Miscellaneous */
                          +#define R_ARM_GLOB_DAT           21            /* Data      (S + A) | T */
                          +#define R_ARM_JUMP_SLOT          22            /* Data      (S + A) | T */
                          +#define R_ARM_RELATIVE           23            /* Data      B(S) + A */
                          +#define R_ARM_GOTOFF32           24            /* Data      ((S + A) | T) - GOT_ORG */
                          +#define R_ARM_BASE_PREL          25            /* Data      B(S) + A - P */
                          +#define R_ARM_GOT_BREL           26            /* Data      GOT(S) + A - GOT_ORG */
                          +#define R_ARM_PLT32              27            /* ARM       ((S + A) | T) - P */
                          +#define R_ARM_CALL               28            /* ARM       ((S + A) | T) - P */
                          +#define R_ARM_JUMP24             29            /* ARM       ((S + A) | T) - P */
                          +#define R_ARM_THM_JUMP24         30            /* Thumb32   ((S + A) | T) - P */
                          +#define R_ARM_BASE_ABS           31            /* Data      B(S) + A */
                          +#define R_ARM_ALU_PCREL_7_0      32            /* Obsolete */
                          +#define R_ARM_ALU_PCREL_15_8     33            /* Obsolete */
                          +#define R_ARM_ALU_PCREL_23_15    34            /* Obsolete */
                          +#define R_ARM_LDR_SBREL_11_0_NC  35            /* ARM       S + A - B(S) */
                          +#define R_ARM_ALU_SBREL_19_12_NC 36            /* ARM       S + A - B(S) */
                          +#define R_ARM_ALU_SBREL_27_20_CK 37            /* ARM       S + A - B(S) */
                          +#define R_ARM_TARGET1            38            /* Miscellaneous (S + A) | T or ((S + A) | T) - P */
                          +#define R_ARM_SBREL31            39            /* Data      ((S + A) | T) - B(S) */
                          +#define R_ARM_V4BX               40            /* Miscellaneous */
                          +#define R_ARM_TARGET2            41            /* Miscellaneous */
                          +#define R_ARM_PREL31             42            /* Data      ((S + A) | T) - P */
                          +#define R_ARM_MOVW_ABS_NC        43            /* ARM       (S + A) | T */
                          +#define R_ARM_MOVT_ABS           44            /* ARM       S + A */
                          +#define R_ARM_MOVW_PREL_NC       45            /* ARM       ((S + A) | T) - P */
                          +#define R_ARM_MOVT_PREL          46            /* ARM       S + A - P */
                          +#define R_ARM_THM_MOVW_ABS_NC    47            /* Thumb32   (S + A) | T */
                          +#define R_ARM_THM_MOVT_ABS       48            /* Thumb32   S + A */
                          +#define R_ARM_THM_MOVW_PREL_NC   49            /* Thumb32   ((S + A) | T) - P */
                          +#define R_ARM_THM_MOVT_PREL      50            /* Thumb32   S + A - P */
                          +#define R_ARM_THM_JUMP19         51            /* Thumb32   ((S + A) | T) - P */
                          +#define R_ARM_THM_JUMP6          52            /* Thumb16   S + A - P */
                          +#define R_ARM_THM_ALU_PREL_11_0  53            /* Thumb32   ((S + A) | T) - Pa */
                          +#define R_ARM_THM_PC12           54            /* Thumb32   S + A - Pa */
                          +#define R_ARM_ABS32_NOI          55            /* Data      S + A */
                          +#define R_ARM_REL32_NOI          56            /* Data      S + A - P */
                          +#define R_ARM_ALU_PC_G0_NC       57            /* ARM       ((S + A) | T) - P */
                          +#define R_ARM_ALU_PC_G0          58            /* ARM       ((S + A) | T) - P */
                          +#define R_ARM_ALU_PC_G1_NC       59            /* ARM       ((S + A) | T) - P */
                          +#define R_ARM_ALU_PC_G1          60            /* ARM       ((S + A) | T) - P */
                          +#define R_ARM_ALU_PC_G2          61            /* ARM       ((S + A) | T) - P */
                          +#define R_ARM_LDR_PC_G1          62            /* ARM       S + A - P */
                          +#define R_ARM_LDR_PC_G2          63            /* ARM       S + A - P */
                          +#define R_ARM_LDRS_PC_G0         64            /* ARM       S + A - P */
                          +#define R_ARM_LDRS_PC_G1         65            /* ARM       S + A - P */
                          +#define R_ARM_LDRS_PC_G2         66            /* ARM       S + A - P */
                          +#define R_ARM_LDC_PC_G0          67            /* ARM       S + A - P */
                          +#define R_ARM_LDC_PC_G1          68            /* ARM       S + A - P */
                          +#define R_ARM_LDC_PC_G2          69            /* ARM       S + A - P */
                          +#define R_ARM_ALU_SB_G0_NC       70            /* ARM       ((S + A) | T) - B(S) */
                          +#define R_ARM_ALU_SB_G0          71            /* ARM       ((S + A) | T) - B(S) */
                          +#define R_ARM_ALU_SB_G1_NC       72            /* ARM       ((S + A) | T) - B(S) */
                          +#define R_ARM_ALU_SB_G1          73            /* ARM       ((S + A) | T) - B(S) */
                          +#define R_ARM_ALU_SB_G2          74            /* ARM       ((S + A) | T) - B(S) */
                          +#define R_ARM_LDR_SB_G0          75            /* ARM       S + A - B(S) */
                          +#define R_ARM_LDR_SB_G1          76            /* ARM       S + A - B(S) */
                          +#define R_ARM_LDR_SB_G2          77            /* ARM       S + A - B(S) */
                          +#define R_ARM_LDRS_SB_G0         78            /* ARM       S + A - B(S) */
                          +#define R_ARM_LDRS_SB_G1         79            /* ARM       S + A - B(S) */
                          +#define R_ARM_LDRS_SB_G2         80            /* ARM       S + A - B(S) */
                          +#define R_ARM_LDC_SB_G0          81            /* ARM       S + A - B(S) */
                          +#define R_ARM_LDC_SB_G1          82            /* ARM       S + A - B(S) */
                          +#define R_ARM_LDC_SB_G2          83            /* ARM       S + A - B(S) */
                          +#define R_ARM_MOVW_BREL_NC       84            /* ARM       ((S + A) | T) - B(S) */
                          +#define R_ARM_MOVT_BREL          85            /* ARM       S + A - B(S) */
                          +#define R_ARM_MOVW_BREL          86            /* ARM       ((S + A) | T) - B(S) */
                          +#define R_ARM_THM_MOVW_BREL_NC   87            /* Thumb32   ((S + A) | T) - B(S) */
                          +#define R_ARM_THM_MOVT_BREL      88            /* Thumb32   S + A - B(S) */
                          +#define R_ARM_THM_MOVW_BREL      89            /* Thumb32   ((S + A) | T) - B(S) */
                          +#define R_ARM_TLS_GOTDESC        90            /* Data */
                          +#define R_ARM_TLS_CALL           91            /* ARM */
                          +#define R_ARM_TLS_DESCSEQ        92            /* ARM       TLS relaxation */
                          +#define R_ARM_THM_TLS_CALL       93            /* Thumb32 */
                          +#define R_ARM_PLT32_ABS          94            /* Data      PLT(S) + A */
                          +#define R_ARM_GOT_ABS            95            /* Data      GOT(S) + A */
                          +#define R_ARM_GOT_PREL           96            /* Data      GOT(S) + A - P */
                          +#define R_ARM_GOT_BREL12         97            /* ARM       GOT(S) + A - GOT_ORG */
                          +#define R_ARM_GOTOFF12           98            /* ARM       S + A - GOT_ORG */
                          +#define R_ARM_GOTRELAX           99            /* Miscellaneous */
                          +#define R_ARM_GNU_VTENTRY        100           /* Data */
                          +#define R_ARM_GNU_VTINHERIT      101           /* Data */
                          +#define R_ARM_THM_JUMP11         102           /* Thumb16   S + A - P */
                          +#define R_ARM_THM_JUMP8          103           /* Thumb16   S + A - P */
                          +#define R_ARM_TLS_GD32           104           /* Data      GOT(S) + A - P */
                          +#define R_ARM_TLS_LDM32          105           /* Data      GOT(S) + A - P */
                          +#define R_ARM_TLS_LDO32          106           /* Data      S + A - TLS */
                          +#define R_ARM_TLS_IE32           107           /* Data      GOT(S) + A - P */
                          +#define R_ARM_TLS_LE32           108           /* Data      S + A - tp */
                          +#define R_ARM_TLS_LDO12          109           /* ARM       S + A - TLS */
                          +#define R_ARM_TLS_LE12           110           /* ARM       S + A - tp */
                          +#define R_ARM_TLS_IE12GP         111           /* ARM       GOT(S) + A - GOT_ORG */
                          +#define R_ARM_ME_TOO             128           /* Obsolete */
                          +#define R_ARM_THM_TLS_DESCSEQ16  129           /* Thumb16 */
                          +#define R_ARM_THM_TLS_DESCSEQ32  130           /* Thumb32 */
                          +
                          +/* 5.2.1 Platform architecture compatibility data */
                          +
                          +#define PT_ARM_ARCHEXT_FMTMSK       0xff000000
                          +#define PT_ARM_ARCHEXT_PROFMSK      0x00ff0000
                          +#define PT_ARM_ARCHEXT_ARCHMSK      0x000000ff
                          +
                          +#define PT_ARM_ARCHEXT_FMT_OS       0x00000000
                          +#define PT_ARM_ARCHEXT_FMT_ABI      0x01000000
                          +
                          +#define PT_ARM_ARCHEXT_PROF_NONE    0x00000000
                          +#define PT_ARM_ARCHEXT_PROF_ARM     0x00410000
                          +#define PT_ARM_ARCHEXT_PROF_RT      0x00520000
                          +#define PT_ARM_ARCHEXT_PROF_MC      0x004d0000
                          +#define PT_ARM_ARCHEXT_PROF_CLASSIC 0x00530000
                          +
                          +#define PT_ARM_ARCHEXT_ARCH_UNKNOWN 0x00
                          +#define PT_ARM_ARCHEXT_ARCHv4       0x01
                          +#define PT_ARM_ARCHEXT_ARCHv4T      0x02
                          +#define PT_ARM_ARCHEXT_ARCHv5T      0x03
                          +#define PT_ARM_ARCHEXT_ARCHv5TE     0x04
                          +#define PT_ARM_ARCHEXT_ARCHv5TEJ    0x05
                          +#define PT_ARM_ARCHEXT_ARCHv6       0x06
                          +#define PT_ARM_ARCHEXT_ARCHv6KZ     0x07
                          +#define PT_ARM_ARCHEXT_ARCHv6T2     0x08
                          +#define PT_ARM_ARCHEXT_ARCHv6K      0x09
                          +#define PT_ARM_ARCHEXT_ARCHv7       0x0a
                          +#define PT_ARM_ARCHEXT_ARCHv6M      0x0b
                          +#define PT_ARM_ARCHEXT_ARCHv6SM     0x0c
                          +#define PT_ARM_ARCHEXT_ARCHv7EM     0x0d
                          +
                          +/* Table 5-6, ARM-specific dynamic array tags */
                          +
                          +#define DT_ARM_RESERVED1         0x70000000
                          +#define DT_ARM_SYMTABSZ          0x70000001
                          +#define DT_ARM_PREEMPTMAP        0x70000002
                          +#define DT_ARM_RESERVED2         0x70000003
                          +
                          +#endif /* __ARCH_ARM_INCLUDE_ELF_H */
                          diff --git a/nuttx/arch/arm/include/stm32/chip.h b/nuttx/arch/arm/include/stm32/chip.h
                          index d01929e1ca..d34c2eb4f0 100644
                          --- a/nuttx/arch/arm/include/stm32/chip.h
                          +++ b/nuttx/arch/arm/include/stm32/chip.h
                          @@ -59,12 +59,11 @@
                           /* STM32 F100 Value Line ************************************************************/
                           
                           #if defined(CONFIG_ARCH_CHIP_STM32F100C8) || defined(CONFIG_ARCH_CHIP_STM32F100CB) \
                          - || defined(CONFIG_ARCH_CHIP_STM32F100R8) || defined(CONFIG_ARCH_CHIP_STM32F100RB) \
                          - || defined(CONFIG_ARCH_CHIP_STM32F100V8) || defined(CONFIG_ARCH_CHIP_STM32F100VB)
                          + || defined(CONFIG_ARCH_CHIP_STM32F100R8) || defined(CONFIG_ARCH_CHIP_STM32F100RB)
                           #  define CONFIG_STM32_STM32F10XX        1   /* STM32F10xxx family */
                          -#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  define CONFIG_STM32_MEDIUMDENSITY     1   /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  define CONFIG_STM32_MEDIUMDENSITY     1   /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  define CONFIG_STM32_VALUELINE         1   /* STM32F100x */
                           #  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                           #  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          @@ -72,15 +71,110 @@
                           #  define STM32_NFSMC                    0   /* FSMC */
                           #  define STM32_NATIM                    1   /* One advanced timer TIM1 */
                           #  define STM32_NGTIM                    3   /* 16-bit general timers TIM2,3,4 with DMA */
                          -#  define STM32_NBTIM                    0   /* No basic timers */
                          -#  define STM32_NDMA                     2   /* DMA1-2 */
                          +#  define STM32_NBTIM                    2   /* 2 basic timers: TIM6, TIM7 */
                          +// TODO: there are also 3 additional timers (15-17) that don't fit any existing category
                          +#  define STM32_NDMA                     1   /* DMA1 */
                           #  define STM32_NSPI                     2   /* SPI1-2 */
                          -#  define STM32_NI2S                     0   /* No I2S (?) */
                          +#  define STM32_NI2S                     0   /* No I2S */
                           #  define STM32_NUSART                   3   /* USART1-3 */
                           #  define STM32_NI2C                     2   /* I2C1-2 */
                           #  define STM32_NCAN                     0   /* No CAN */
                           #  define STM32_NSDIO                    0   /* No SDIO */
                           #  define STM32_NUSBOTG                  0   /* No USB OTG FS/HS */
                          +#  define STM32_NGPIO                    64  /* GPIOA-D */
                          +#  define STM32_NADC                     1   /* ADC1 */
                          +#  define STM32_NDAC                     2   /* DAC 1-2 */
                          +#  define STM32_NCRC                     1   /* CRC1 */
                          +#  define STM32_NETHERNET                0   /* No ethernet */
                          +#  define STM32_NRNG                     0   /* No random number generator (RNG) */
                          +#  define STM32_NDCMI                    0   /* No digital camera interface (DCMI) */
                          +
                          +#elif defined(CONFIG_ARCH_CHIP_STM32F100V8) || defined(CONFIG_ARCH_CHIP_STM32F100VB)
                          +#  define CONFIG_STM32_STM32F10XX        1   /* STM32F10xxx family */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  define CONFIG_STM32_MEDIUMDENSITY     1   /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                          +#  define CONFIG_STM32_VALUELINE         1   /* STM32F100x */
                          +#  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                          +#  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          +#  undef  CONFIG_STM32_STM32F40XX            /* STM32F405xx and STM32407xx families */
                          +#  define STM32_NFSMC                    0   /* FSMC */
                          +#  define STM32_NATIM                    1   /* One advanced timer TIM1 */
                          +#  define STM32_NGTIM                    3   /* 16-bit general timers TIM2,3,4 with DMA */
                          +#  define STM32_NBTIM                    2   /* 2 basic timers: TIM6, TIM7 */
                          +// TODO: there are also 3 additional timers (15-17) that don't fit any existing category
                          +#  define STM32_NDMA                     1   /* DMA1 */
                          +#  define STM32_NSPI                     2   /* SPI1-2 */
                          +#  define STM32_NI2S                     0   /* No I2S */
                          +#  define STM32_NUSART                   3   /* USART1-3 */
                          +#  define STM32_NI2C                     2   /* I2C1-2 */
                          +#  define STM32_NCAN                     0   /* No CAN */
                          +#  define STM32_NSDIO                    0   /* No SDIO */
                          +#  define STM32_NUSBOTG                  0   /* No USB OTG FS/HS */
                          +#  define STM32_NGPIO                    80  /* GPIOA-E */
                          +#  define STM32_NADC                     1   /* ADC1 */
                          +#  define STM32_NDAC                     2   /* DAC 1-2 */
                          +#  define STM32_NCRC                     1   /* CRC1 */
                          +#  define STM32_NETHERNET                0   /* No ethernet */
                          +#  define STM32_NRNG                     0   /* No random number generator (RNG) */
                          +#  define STM32_NDCMI                    0   /* No digital camera interface (DCMI) */
                          +
                          +/* STM32 F100 High-density value Line ************************************************************/
                          +
                          +#elif defined(CONFIG_ARCH_CHIP_STM32F100RC) || defined(CONFIG_ARCH_CHIP_STM32F100RD) \
                          + || defined(CONFIG_ARCH_CHIP_STM32F100RE)
                          +#  define CONFIG_STM32_STM32F10XX        1   /* STM32F10xxx family */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  define CONFIG_STM32_HIGHDENSITY       1   /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                          +#  define CONFIG_STM32_VALUELINE         1   /* STM32F100x */
                          +#  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                          +#  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          +#  undef  CONFIG_STM32_STM32F40XX            /* STM32F405xx and STM32407xx families */
                          +#  define STM32_NFSMC                    0   /* FSMC */
                          +#  define STM32_NATIM                    1   /* One advanced timer TIM1 */
                          +#  define STM32_NGTIM                    4   /* 16-bit general timers TIM2,3,4,5 with DMA */
                          +#  define STM32_NBTIM                    2   /* 2 basic timers: TIM6, TIM7 */
                          +// TODO: there are also 6 additional timers (12-17) that don't fit any existing category
                          +#  define STM32_NDMA                     2   /* DMA1-2 */
                          +#  define STM32_NSPI                     3   /* SPI1-3 */
                          +#  define STM32_NI2S                     0   /* No I2S */
                          +#  define STM32_NUSART                   5   /* USART1-5 */
                          +#  define STM32_NI2C                     2   /* I2C1-2 */
                          +#  define STM32_NCAN                     0   /* No CAN */
                          +#  define STM32_NSDIO                    0   /* No SDIO */
                          +#  define STM32_NUSBOTG                  0   /* No USB OTG FS/HS */
                          +#  define STM32_NGPIO                    64  /* GPIOA-D */
                          +#  define STM32_NADC                     1   /* ADC1 */
                          +#  define STM32_NDAC                     2   /* DAC 1-2 */
                          +#  define STM32_NCRC                     1   /* CRC1 */
                          +#  define STM32_NETHERNET                0   /* No ethernet */
                          +#  define STM32_NRNG                     0   /* No random number generator (RNG) */
                          +#  define STM32_NDCMI                    0   /* No digital camera interface (DCMI) */
                          +
                          +#elif defined(CONFIG_ARCH_CHIP_STM32F100VC) || defined(CONFIG_ARCH_CHIP_STM32F100VD) \
                          + || defined(CONFIG_ARCH_CHIP_STM32F100VE)
                          +#  define CONFIG_STM32_STM32F10XX        1   /* STM32F10xxx family */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  define CONFIG_STM32_HIGHDENSITY       1   /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                          +#  define CONFIG_STM32_VALUELINE         1   /* STM32F100x */
                          +#  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                          +#  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          +#  undef  CONFIG_STM32_STM32F40XX            /* STM32F405xx and STM32407xx families */
                          +#  define STM32_NFSMC                    1   /* FSMC */
                          +#  define STM32_NATIM                    1   /* One advanced timer TIM1 */
                          +#  define STM32_NGTIM                    4   /* 16-bit general timers TIM2,3,4,5 with DMA */
                          +#  define STM32_NBTIM                    2   /* 2 basic timers: TIM6, TIM7 */
                          +// TODO: there are also 6 additional timers (12-17) that don't fit any existing category
                          +#  define STM32_NDMA                     2   /* DMA1-2 */
                          +#  define STM32_NSPI                     3   /* SPI1-3 */
                          +#  define STM32_NI2S                     0   /* No I2S */
                          +#  define STM32_NUSART                   5   /* USART1-5 */
                          +#  define STM32_NI2C                     2   /* I2C1-2 */
                          +#  define STM32_NCAN                     0   /* No CAN */
                          +#  define STM32_NSDIO                    0   /* No SDIO */
                          +#  define STM32_NUSBOTG                  0   /* No USB OTG FS/HS */
                           #  define STM32_NGPIO                    80  /* GPIOA-E */
                           #  define STM32_NADC                     1   /* ADC1 */
                           #  define STM32_NDAC                     2   /* DAC 1-2 */
                          @@ -96,9 +190,9 @@
                           
                           #elif defined(CONFIG_ARCH_CHIP_STM32F103RET6)
                           #  define CONFIG_STM32_STM32F10XX        1   /* STM32F10xxx family */
                          -#  undef CONFIG_STM32_LOWDENSITY             /* STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  define CONFIG_STM32_HIGHDENSITY       1   /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef CONFIG_STM32_LOWDENSITY             /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  define CONFIG_STM32_HIGHDENSITY       1   /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  undef  CONFIG_STM32_VALUELINE             /* STM32F100x */
                           #  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                           #  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          @@ -129,9 +223,9 @@
                           
                           #elif defined(CONFIG_ARCH_CHIP_STM32F103VCT6) || defined(CONFIG_ARCH_CHIP_STM32F103VET6)
                           #  define CONFIG_STM32_STM32F10XX        1   /* STM32F10xxx family */
                          -#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  define CONFIG_STM32_HIGHDENSITY       1   /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  define CONFIG_STM32_HIGHDENSITY       1   /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  undef  CONFIG_STM32_VALUELINE             /* STM32F100x */
                           #  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                           #  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          @@ -162,9 +256,9 @@
                           
                           #elif defined(CONFIG_ARCH_CHIP_STM32F103ZET6) 
                           #  define CONFIG_STM32_STM32F10XX        1   /* STM32F10xxx family */
                          -#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  define CONFIG_STM32_HIGHDENSITY       1   /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  define CONFIG_STM32_HIGHDENSITY       1   /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  undef  CONFIG_STM32_VALUELINE             /* STM32F100x */
                           #  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                           #  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          @@ -192,9 +286,9 @@
                           /* STM32 F105/F107 Connectivity Line *******************************************************/
                           #elif defined(CONFIG_ARCH_CHIP_STM32F105VBT7)
                           #  define CONFIG_STM32_STM32F10XX        1   /* STM32F10xxx family */
                          -#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  undef  CONFIG_STM32_VALUELINE             /* STM32F100x */
                           #  define CONFIG_STM32_CONNECTIVITYLINE  1   /* STM32F105x and STM32F107x */
                           #  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          @@ -221,9 +315,9 @@
                           
                           #elif defined(CONFIG_ARCH_CHIP_STM32F107VC)
                           #  define CONFIG_STM32_STM32F10XX        1   /* STM32F10xxx family */
                          -#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  undef  CONFIG_STM32_VALUELINE             /* STM32F100x */
                           #  define CONFIG_STM32_CONNECTIVITYLINE  1   /* STM32F105x and STM32F107x */
                           #  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          @@ -251,9 +345,9 @@
                           /* STM32 F2 Family ******************************************************************/
                           #elif defined(CONFIG_ARCH_CHIP_STM32F207IG)  /* UFBGA-176 1024Kb FLASH 128Kb SRAM */
                           #  undef  CONFIG_STM32_STM32F10XX            /* STM32F10xxx family */
                          -#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  undef  CONFIG_STM32_VALUELINE             /* STM32F100x */
                           #  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                           #  define CONFIG_STM32_STM32F20XX        1   /* STM32F205x and STM32F207x */
                          @@ -283,9 +377,9 @@
                           /* STM23 F4 Family ******************************************************************/
                           #elif defined(CONFIG_ARCH_CHIP_STM32F405RG)  /* LQFP 64 10x10x1.4 1024Kb FLASH 192Kb SRAM */
                           #  undef  CONFIG_STM32_STM32F10XX            /* STM32F10xxx family */
                          -#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  undef  CONFIG_STM32_VALUELINE             /* STM32F100x */
                           #  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                           #  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          @@ -314,9 +408,9 @@
                           
                           #elif defined(CONFIG_ARCH_CHIP_STM32F405VG)  /* LQFP 100 14x14x1.4  1024Kb FLASH 192Kb SRAM */
                           #  undef  CONFIG_STM32_STM32F10XX            /* STM32F10xxx family */
                          -#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  undef  CONFIG_STM32_VALUELINE             /* STM32F100x */
                           #  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                           #  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          @@ -345,9 +439,9 @@
                           
                           #elif defined(CONFIG_ARCH_CHIP_STM32F405ZG)  /* LQFP 144 20x20x1.4 1024Kb FLASH 192Kb SRAM */
                           #  undef  CONFIG_STM32_STM32F10XX            /* STM32F10xxx family */
                          -#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  undef  CONFIG_STM32_VALUELINE             /* STM32F100x */
                           #  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                           #  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          @@ -376,9 +470,9 @@
                           
                           #elif defined(CONFIG_ARCH_CHIP_STM32F407VE)  /* LQFP-100 512Kb FLASH 192Kb SRAM */
                           #  undef  CONFIG_STM32_STM32F10XX            /* STM32F10xxx family */
                          -#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  undef  CONFIG_STM32_VALUELINE             /* STM32F100x */
                           #  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                           #  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          @@ -407,9 +501,9 @@
                           
                           #elif defined(CONFIG_ARCH_CHIP_STM32F407VG)  /* LQFP-100 14x14x1.4 1024Kb FLASH 192Kb SRAM */
                           #  undef  CONFIG_STM32_STM32F10XX            /* STM32F10xxx family */
                          -#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  undef  CONFIG_STM32_VALUELINE             /* STM32F100x */
                           #  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                           #  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          @@ -438,9 +532,9 @@
                           
                           #elif defined(CONFIG_ARCH_CHIP_STM32F407ZE)  /* LQFP-144 512Kb FLASH 192Kb SRAM */
                           #  undef  CONFIG_STM32_STM32F10XX            /* STM32F10xxx family */
                          -#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  undef  CONFIG_STM32_VALUELINE             /* STM32F100x */
                           #  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                           #  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          @@ -469,9 +563,9 @@
                           
                           #elif defined(CONFIG_ARCH_CHIP_STM32F407ZG)  /* LQFP 144 20x20x1.4 1024Kb FLASH 192Kb SRAM */
                           #  undef  CONFIG_STM32_STM32F10XX            /* STM32F10xxx family */
                          -#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  undef  CONFIG_STM32_VALUELINE             /* STM32F100x */
                           #  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                           #  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          @@ -500,9 +594,9 @@
                           
                           #elif defined(CONFIG_ARCH_CHIP_STM32F407IE)  /* LQFP 176 24x24x1.4 512Kb FLASH 192Kb SRAM */
                           #  undef  CONFIG_STM32_STM32F10XX            /* STM32F10xxx family */
                          -#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  undef  CONFIG_STM32_VALUELINE             /* STM32F100x */
                           #  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                           #  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          @@ -531,9 +625,9 @@
                           
                           #elif defined(CONFIG_ARCH_CHIP_STM32F407IG)  /* BGA 176; LQFP 176 24x24x1.4 1024Kb FLASH 192Kb SRAM */
                           #  undef  CONFIG_STM32_STM32F10XX            /* STM32F10xxx family */
                          -#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          -#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          -#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F101x  and STM32F103x w/ 256/512 Kbytes */
                          +#  undef  CONFIG_STM32_LOWDENSITY            /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
                          +#  undef  CONFIG_STM32_MEDIUMDENSITY         /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
                          +#  undef  CONFIG_STM32_HIGHDENSITY           /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
                           #  undef  CONFIG_STM32_VALUELINE             /* STM32F100x */
                           #  undef  CONFIG_STM32_CONNECTIVITYLINE      /* STM32F105x and STM32F107x */
                           #  undef  CONFIG_STM32_STM32F20XX            /* STM32F205x and STM32F207x */
                          diff --git a/nuttx/arch/arm/include/stm32/stm32f10xxx_irq.h b/nuttx/arch/arm/include/stm32/stm32f10xxx_irq.h
                          index 67f4ba436b..7c3f7cf958 100644
                          --- a/nuttx/arch/arm/include/stm32/stm32f10xxx_irq.h
                          +++ b/nuttx/arch/arm/include/stm32/stm32f10xxx_irq.h
                          @@ -61,11 +61,13 @@
                            * External interrupts (vectors >= 16)
                            */
                           
                          -#if defined(CONFIG_STM32_VALUELINE) && defined(CONFIG_STM32_MEDIUMDENSITY)
                          + /* Value line devices */
                          +
                          +#if defined(CONFIG_STM32_VALUELINE)
                           #  define STM32_IRQ_WWDG        (16) /* 0:  Window Watchdog interrupt */
                           #  define STM32_IRQ_PVD         (17) /* 1:  PVD through EXTI Line detection interrupt */
                           #  define STM32_IRQ_TAMPER      (18) /* 2:  Tamper interrupt */
                          -#  define STM32_IRQ_RTC         (19) /* 3:  RTC global interrupt */
                          +#  define STM32_IRQ_RTC         (19) /* 3:  RTC Wakeup through EXTI line interrupt */
                           #  define STM32_IRQ_FLASH       (20) /* 4:  Flash global interrupt */
                           #  define STM32_IRQ_RCC         (21) /* 5:  RCC global interrupt */
                           #  define STM32_IRQ_EXTI0       (22) /* 6:  EXTI Line 0 interrupt */
                          @@ -80,12 +82,18 @@
                           #  define STM32_IRQ_DMA1CH5     (31) /* 15: DMA1 Channel 5 global interrupt */
                           #  define STM32_IRQ_DMA1CH6     (32) /* 16: DMA1 Channel 6 global interrupt */
                           #  define STM32_IRQ_DMA1CH7     (33) /* 17: DMA1 Channel 7 global interrupt */
                          -#  define STM32_IRQ_ADC12       (34) /* 18: ADC1 and ADC2 global interrupt */
                          -                                     /* 19-22: reserved */
                          +#  define STM32_IRQ_ADC1        (34) /* 18: ADC1 global interrupt */
                          +#  define STM32_IRQ_RESERVED0   (35) /* 19: Reserved 0 */
                          +#  define STM32_IRQ_RESERVED1   (36) /* 20: Reserved 1 */
                          +#  define STM32_IRQ_RESERVED2   (37) /* 21: Reserved 2 */
                          +#  define STM32_IRQ_RESERVED3   (38) /* 22: Reserved 3 */
                           #  define STM32_IRQ_EXTI95      (39) /* 23: EXTI Line[9:5] interrupts */
                           #  define STM32_IRQ_TIM1BRK     (40) /* 24: TIM1 Break interrupt */
                          -#  define STM32_IRQ_TIM1UP      (41) /* 25: TIM1 Update interrupt (TIM16 global interrupt) */
                          -#  define STM32_IRQ_TIM1TRGCOM  (42) /* 26: TIM1 Trigger and Commutation interrupts (TIM17 global interrupt) */
                          +#  define STM32_IRQ_TIM15       (40) /*     TIM15 global interrupt */
                          +#  define STM32_IRQ_TIM1UP      (41) /* 25: TIM1 Update interrupt */
                          +#  define STM32_IRQ_TIM16       (41) /*     TIM16 global interrupt */
                          +#  define STM32_IRQ_TIM1TRGCOM  (42) /* 26: TIM1 Trigger and Commutation interrupts */
                          +#  define STM32_IRQ_TIM17       (42) /*     TIM17 global interrupt */
                           #  define STM32_IRQ_TIM1CC      (43) /* 27: TIM1 Capture Compare interrupt */
                           #  define STM32_IRQ_TIM2        (44) /* 28: TIM2 global interrupt */
                           #  define STM32_IRQ_TIM3        (45) /* 29: TIM3 global interrupt */
                          @@ -100,29 +108,30 @@
                           #  define STM32_IRQ_USART2      (54) /* 38: USART2 global interrupt */
                           #  define STM32_IRQ_USART3      (55) /* 39: USART3 global interrupt */
                           #  define STM32_IRQ_EXTI1510    (56) /* 40: EXTI Line[15:10] interrupts */
                          -#  define STM32_IRQ_RTCALR      (57) /* 41: RTC alarm through EXTI line interrupt */
                          +#  define STM32_IRQ_RTCALR      (57) /* 41: RTC alarms (A and B) through EXTI line interrupt */
                           #  define STM32_IRQ_CEC         (58) /* 42: CEC global interrupt */
                          -#  if defined(CONFIG_STM32_HIGHDENSITY)
                          -#    define STM32_IRQ_TIM12     (59) /* 43: TIM12 global interrupt */
                          -#    define STM32_IRQ_TIM13     (60) /* 44: TIM13 global interrupt */
                          -#    define STM32_IRQ_TIM14     (61) /* 45: TIM14 global interrupt */
                          -                                     /* 46-47: reserved */
                          -#    define STM32_IRQ_FSMC      (64) /* 48: FSMC global interrupt */
                          -                                     /* 49: reserved */
                          -#    define STM32_IRQ_TIM5      (66) /* 50: TIM5 global interrupt */
                          -#    define STM32_IRQ_SPI3      (67) /* 51: SPI1 global interrupt */
                          -#    define STM32_IRQ_UART4     (68) /* 52: USART2 global interrupt */
                          -#    define STM32_IRQ_UART5     (69) /* 53: USART3 global interrupt */
                          -#  else
                          -                                     /* 43-53: reserved */
                          -#  endif
                          +#  define STM32_IRQ_TIM12       (59) /* 43: TIM12 global interrupt */
                          +#  define STM32_IRQ_TIM13       (60) /* 44: TIM13 global interrupt */
                          +#  define STM32_IRQ_TIM14       (61) /* 45: TIM14 global interrupt */
                          +#  define STM32_IRQ_RESERVED4   (62) /* 46: Reserved 4 */
                          +#  define STM32_IRQ_RESERVED5   (63) /* 47: Reserved 5 */
                          +#  define STM32_IRQ_FSMC        (64) /* 48: FSMC global interrupt */
                          +#  define STM32_IRQ_RESERVED6   (65) /* 49: Reserved 6 */
                          +#  define STM32_IRQ_TIM5        (66) /* 50: TIM5 global interrupt */
                          +#  define STM32_IRQ_SPI3        (67) /* 51: SPI3 global interrupt */
                          +#  define STM32_IRQ_UART4       (68) /* 52: USART2 global interrupt */
                          +#  define STM32_IRQ_UART5       (69) /* 53: USART5 global interrupt */
                           #  define STM32_IRQ_TIM6        (70) /* 54: TIM6 global interrupt */
                           #  define STM32_IRQ_TIM7        (71) /* 55: TIM7 global interrupt */
                           #  define STM32_IRQ_DMA2CH1     (72) /* 56: DMA2 Channel 1 global interrupt */
                           #  define STM32_IRQ_DMA2CH2     (73) /* 57: DMA2 Channel 2 global interrupt */
                           #  define STM32_IRQ_DMA2CH3     (74) /* 58: DMA2 Channel 3 global interrupt */
                          -#  define STM32_IRQ_DMA2CH45    (75) /* 59: DMA2 Channel 4 global interrupt */
                          -#  define NR_IRQS               (76)
                          +#  define STM32_IRQ_DMA2CH45    (75) /* 59: DMA2 Channel 4 and 5 global interrupt */
                          +#  define STM32_IRQ_DMA2CH5     (76) /* 60: DMA2 Channel 5 global interrupt */
                          +#  define NR_IRQS               (77)
                          +
                          +/* Connectivity Line Devices */
                          +
                           #elif defined(CONFIG_STM32_CONNECTIVITYLINE)
                           #  define STM32_IRQ_WWDG        (16) /* 0:  Window Watchdog interrupt */
                           #  define STM32_IRQ_PVD         (17) /* 1:  PVD through EXTI Line detection interrupt */
                          @@ -193,6 +202,9 @@
                           #  define STM32_IRQ_CAN2SCE     (82) /* 66: CAN2 SCE interrupt */
                           #  define STM32_IRQ_OTGFS       (83) /* 67: USB On The Go FS global interrupt */
                           #  define NR_IRQS               (84)
                          +
                          +/* Medium and High Density Devices */
                          +
                           #else
                           #  define STM32_IRQ_WWDG        (16) /* 0:  Window Watchdog interrupt */
                           #  define STM32_IRQ_PVD         (17) /* 1:  PVD through EXTI Line detection interrupt */
                          diff --git a/nuttx/arch/arm/src/Makefile b/nuttx/arch/arm/src/Makefile
                          index 74be6c18d1..e44def30c0 100644
                          --- a/nuttx/arch/arm/src/Makefile
                          +++ b/nuttx/arch/arm/src/Makefile
                          @@ -36,58 +36,90 @@
                           -include $(TOPDIR)/Make.defs
                           -include chip/Make.defs
                           
                          -ARCH_SRCDIR	= $(TOPDIR)/arch/$(CONFIG_ARCH)/src
                           ifeq ($(CONFIG_ARCH_CORTEXM3),y)   # Cortex-M3 is ARMv7-M
                          -ARCH_SUBDIR	= armv7-m
                          +ARCH_SUBDIR = armv7-m
                           else
                           ifeq ($(CONFIG_ARCH_CORTEXM4),y)   # Cortex-M4 is ARMv7E-M
                          -ARCH_SUBDIR	= armv7-m
                          +ARCH_SUBDIR = armv7-m
                           else
                          -ARCH_SUBDIR	= arm
                          +ARCH_SUBDIR = arm
                           endif
                           endif
                           
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  ARCH_SRCDIR = $(TOPDIR)\arch\$(CONFIG_ARCH)\src
                          +  NUTTX = "$(TOPDIR)\nuttx$(EXEEXT)"
                          +  CFLAGS += -I$(ARCH_SRCDIR)\chip
                          +  CFLAGS += -I$(ARCH_SRCDIR)\common
                          +  CFLAGS += -I$(ARCH_SRCDIR)\$(ARCH_SUBDIR)
                          +  CFLAGS += -I$(TOPDIR)\sched
                          +else
                          +  ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
                          +ifeq ($(WINTOOL),y)
                          +  NUTTX = "${shell cygpath -w $(TOPDIR)/nuttx$(EXEEXT)}"
                          +  CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}"
                          +  CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/common}"
                          +  CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/$(ARCH_SUBDIR)}"
                          +  CFLAGS += -I "${shell cygpath -w $(TOPDIR)/sched}"
                          +else
                          +  NUTTX = "$(TOPDIR)/nuttx$(EXEEXT)"
                          +  CFLAGS += -I$(ARCH_SRCDIR)/chip
                          +  CFLAGS += -I$(ARCH_SRCDIR)/common
                          +  CFLAGS += -I$(ARCH_SRCDIR)/$(ARCH_SUBDIR)
                          +  CFLAGS += -I$(TOPDIR)/sched
                          +endif
                          +endif
                          +
                          +HEAD_OBJ = $(HEAD_ASRC:.S=$(OBJEXT))
                          +
                          +ASRCS = $(CHIP_ASRCS) $(CMN_ASRCS)
                          +AOBJS = $(ASRCS:.S=$(OBJEXT))
                          +
                          +CSRCS = $(CHIP_CSRCS) $(CMN_CSRCS)
                          +COBJS = $(CSRCS:.c=$(OBJEXT))
                          +
                          +SRCS = $(ASRCS) $(CSRCS)
                          +OBJS = $(AOBJS) $(COBJS)
                          +
                          +LDFLAGS += $(ARCHSCRIPT)
                          +
                          +EXTRA_LIBS ?=
                          +EXTRA_LIBPATHS ?=
                          +LINKLIBS ?=
                          +
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BOARDMAKE = $(if $(wildcard .\board\Makefile),y,)
                          +  LIBPATHS += -L"$(TOPDIR)\lib"
                          +ifeq ($(BOARDMAKE),y)
                          +  LIBPATHS += -L"$(TOPDIR)\arch\$(CONFIG_ARCH)\src\board"
                          +endif
                          +
                          +else
                          +  BOARDMAKE = $(if $(wildcard ./board/Makefile),y,)
                          +
                           ifeq ($(WINTOOL),y)
                          -  NUTTX		= "${shell cygpath -w $(TOPDIR)/nuttx}"
                          -  CFLAGS	+= -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
                          -  		   -I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
                          -		   -I "${shell cygpath -w $(ARCH_SRCDIR)/$(ARCH_SUBDIR)}" \
                          -		   -I "${shell cygpath -w $(TOPDIR)/sched}"
                          -else
                          -  NUTTX		= $(TOPDIR)/nuttx
                          -  CFLAGS	+= -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common \
                          -		   -I$(ARCH_SRCDIR)/$(ARCH_SUBDIR) -I$(TOPDIR)/sched
                          +  LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/lib"}"
                          +ifeq ($(BOARDMAKE),y)
                          +  LIBPATHS += -L"${shell cygpath -w "$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board"}"
                           endif
                           
                          -HEAD_OBJ	= $(HEAD_ASRC:.S=$(OBJEXT))
                          -
                          -ASRCS		= $(CHIP_ASRCS) $(CMN_ASRCS)
                          -AOBJS		= $(ASRCS:.S=$(OBJEXT))
                          -
                          -CSRCS		= $(CHIP_CSRCS) $(CMN_CSRCS)
                          -COBJS		= $(CSRCS:.c=$(OBJEXT))
                          -
                          -SRCS		= $(ASRCS) $(CSRCS)
                          -OBJS		= $(AOBJS) $(COBJS)
                          -
                          -LDFLAGS		= $(ARCHSCRIPT)
                          -EXTRA_LIBS	?=
                          -
                          -LINKLIBS	=
                          -ifeq ($(WINTOOL),y)
                          -  LIBPATHS	= ${shell for path in $(LINKLIBS); do dir=`dirname $(TOPDIR)/$$path`;echo "-L\"`cygpath -w $$dir`\"";done}
                          -  LIBPATHS	+= -L"${shell cygpath -w $(BOARDDIR)}"
                           else
                          -  LIBPATHS	= $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
                          -  LIBPATHS	+= -L"$(BOARDDIR)"
                          +  LIBPATHS += -L"$(TOPDIR)/lib"
                          +ifeq ($(BOARDMAKE),y)
                          +  LIBPATHS += -L"$(TOPDIR)/arch/$(CONFIG_ARCH)/src/board"
                          +endif
                          +endif
                           endif
                          -LDLIBS		= $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
                           
                          -BOARDDIR	= $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board
                          +LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS)))
                          +ifeq ($(BOARDMAKE),y)
                          +  LDLIBS += -lboard
                          +endif
                           
                          -LIBGCC		= "${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name}"
                          +LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}"
                          +GCC_LIBDIR := ${shell dirname $(LIBGCC)}
                           
                          -VPATH		= chip:common:$(ARCH_SUBDIR)
                          +VPATH = chip:common:$(ARCH_SUBDIR)
                           
                           all: $(HEAD_OBJ) libarch$(LIBEXT)
                           
                          @@ -100,20 +132,21 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           libarch$(LIBEXT): $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $@, $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $@, $(OBJS))
                           
                           board/libboard$(LIBEXT):
                          -	@$(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES)
                           
                          -nuttx: $(HEAD_OBJ) board/libboard$(LIBEXT)
                          -	@echo "LD: nuttx"
                          -	@$(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX)$(EXEEXT) $(HEAD_OBJ) $(EXTRA_OBJS) \
                          -		--start-group $(LDLIBS) -lboard $(EXTRA_LIBS) $(LIBGCC) --end-group
                          -	@$(NM) $(NUTTX)$(EXEEXT) | \
                          +nuttx$(EXEEXT): $(HEAD_OBJ) board/libboard$(LIBEXT)
                          +	$(Q) echo "LD: nuttx"
                          +	$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
                          +		-o $(NUTTX)$(EXEEXT) $(HEAD_OBJ) $(EXTRA_OBJS) \
                          +		--start-group $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) --end-group
                          +ifneq ($(CONFIG_WINDOWS_NATIVE),y)
                          +	$(Q) $(NM) $(NUTTX)$(EXEEXT) | \
                           	grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
                           	sort > $(TOPDIR)/System.map
                          +endif
                           
                           # This is part of the top-level export target
                           # Note that there may not be a head object if layout is handled
                          @@ -121,37 +154,38 @@ nuttx: $(HEAD_OBJ) board/libboard$(LIBEXT)
                           
                           export_head: board/libboard$(LIBEXT) $(HEAD_OBJ)
                           ifneq ($(HEAD_OBJ),)
                          -	@if [ -d "$(EXPORT_DIR)/startup" ]; then \
                          +	$(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
                          +	exit 1; \
                          +	fi
                           endif
                           
                           # Dependencies
                           
                           .depend: Makefile chip/Make.defs $(SRCS)
                          -	@if [ -e board/Makefile ]; then \
                          -		$(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \
                          -	fi
                          -	@$(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \
                          -	 $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          -	@touch $@
                          +ifeq ($(BOARDMAKE),y)
                          +	$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend
                          +endif
                          +	$(Q) $(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \
                          +	 "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@if [ -e board/Makefile ]; then \
                          -		$(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \
                          -	fi
                          -	@rm -f libarch$(LIBEXT) *~ .*.swp
                          +ifeq ($(BOARDMAKE),y)
                          +	$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean
                          +endif
                          +	$(call DELFILE, libarch$(LIBEXT))
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@if [ -e board/Makefile ]; then \
                          -		$(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \
                          -	fi
                          -	@rm -f Make.dep .depend
                          +ifeq ($(BOARDMAKE),y)
                          +	$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean
                          +endif
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/nuttx/arch/arm/src/armv7-m/Kconfig b/nuttx/arch/arm/src/armv7-m/Kconfig
                          new file mode 100644
                          index 0000000000..dc5aa39153
                          --- /dev/null
                          +++ b/nuttx/arch/arm/src/armv7-m/Kconfig
                          @@ -0,0 +1,51 @@
                          +#
                          +# For a description of the syntax of this configuration file,
                          +# see misc/tools/kconfig-language.txt.
                          +#
                          +
                          +comment "ARMV7M Configuration Options"
                          +
                          +choice
                          +	prompt "Toolchain Selection"
                          +	default ARMV7M_TOOLCHAIN_CODESOURCERYW if HOST_WINDOWS
                          +	default ARMV7M_TOOLCHAIN_GNU_EABI if !HOST_WINDOWS
                          +
                          +config ARMV7M_TOOLCHAIN_ATOLLIC
                          +	bool "Atollic Lite/Pro for Windows"
                          +	depends on HOST_WINDOWS
                          +
                          +config ARMV7M_TOOLCHAIN_BUILDROOT
                          +	bool "Buildroot (Cygwin or Linux)"
                          +	depends on !WINDOWS_NATIVE
                          +
                          +config ARMV7M_TOOLCHAIN_CODEREDL
                          +	bool "CodeRed for Linux"
                          +	depends on HOST_LINUX
                          +
                          +config ARMV7M_TOOLCHAIN_CODEREDW
                          +	bool "CodeRed for Windows"
                          +	depends on HOST_WINDOWS
                          +
                          +config ARMV7M_TOOLCHAIN_CODESOURCERYL
                          +	bool "CodeSourcery GNU toolchain under Linux"
                          +	depends on HOST_LINUX
                          +
                          +config ARMV7M_TOOLCHAIN_CODESOURCERYW
                          +	bool "CodeSourcery GNU toolchain under Windows"
                          +	depends on HOST_WINDOWS
                          +
                          +config ARMV7M_TOOLCHAIN_DEVKITARM
                          +	bool "devkitARM GNU toolchain"
                          +	depends on HOST_WINDOWS
                          +
                          +config ARMV7M_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.
                          +
                          +config ARMV7M_TOOLCHAIN_RAISONANCE
                          +	bool "STMicro Raisonance for Windows"
                          +	depends on HOST_WINDOWS
                          +
                          +endchoice
                          diff --git a/nuttx/arch/arm/src/armv7-m/memcpy.S b/nuttx/arch/arm/src/armv7-m/memcpy.S
                          deleted file mode 100644
                          index c6d3ff649c..0000000000
                          --- a/nuttx/arch/arm/src/armv7-m/memcpy.S
                          +++ /dev/null
                          @@ -1,351 +0,0 @@
                          -@
                          -@ armv7m-optimised memcpy, apparently in the public domain
                          -@
                          -@ Obtained via a posting on the Stellaris forum:
                          -@	http://e2e.ti.com/support/microcontrollers/stellaris_arm_cortex-m3_microcontroller/f/473/t/44360.aspx
                          -@
                          -@ Posted by rocksoft on Jul 24, 2008 10:19 AM
                          -@ 
                          -@ Hi, 
                          -@ 
                          -@ I recently finished a "memcpy" replacement and thought it might be useful for others...
                          -@ 
                          -@ I've put some instructions and the code here:
                          -@ 
                          -@ http://www.rock-software.net/downloads/memcpy/
                          -@ 
                          -@ Hope it works for you as well as it did for me.
                          -@ 
                          -@ Liam.
                          -@ @	
                          -@ ---------------------------------------------------------------------------- 
                          -
                          -.syntax unified
                          -
                          -.thumb
                          -
                          -.cpu cortex-m3
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -
                          - .global memcpy
                          - 
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -@ Optimised "general" copy routine
                          -
                          -.text
                          -
                          -@ We have 16 possible alignment combinations of src and dst, this jump table directs the copy operation
                          -@ Bits:  Src=00, Dst=00 - Long to Long copy
                          -@ Bits:  Src=00, Dst=01 - Long to Byte before half word
                          -@ Bits:  Src=00, Dst=10 - Long to Half word
                          -@ Bits:  Src=00, Dst=11 - Long to Byte before long word
                          -@ Bits:  Src=01, Dst=00 - Byte before half word to long
                          -@ Bits:  Src=01, Dst=01 - Byte before half word to byte before half word - Same alignment
                          -@ Bits:  Src=01, Dst=10 - Byte before half word to half word
                          -@ Bits:  Src=01, Dst=11 - Byte before half word to byte before long word
                          -@ Bits:  Src=10, Dst=00 - Half word to long word
                          -@ Bits:  Src=10, Dst=01 - Half word to byte before half word
                          -@ Bits:  Src=10, Dst=10 - Half word to half word - Same Alignment
                          -@ Bits:  Src=10, Dst=11 - Half word to byte before long word
                          -@ Bits:  Src=11, Dst=00 - Byte before long word to long word
                          -@ Bits:  Src=11, Dst=01 - Byte before long word to byte before half word
                          -@ Bits:  Src=11, Dst=11 - Byte before long word to half word
                          -@ Bits:  Src=11, Dst=11 - Byte before long word to Byte before long word - Same alignment
                          -
                          -MEM_DataCopyTable:
                          -  .byte (MEM_DataCopy0 - MEM_DataCopyJump) >> 1      
                          -  .byte (MEM_DataCopy1 - MEM_DataCopyJump) >> 1      
                          -  .byte (MEM_DataCopy2 - MEM_DataCopyJump) >> 1
                          -  .byte (MEM_DataCopy3 - MEM_DataCopyJump) >> 1
                          -  .byte (MEM_DataCopy4 - MEM_DataCopyJump) >> 1
                          -  .byte (MEM_DataCopy5 - MEM_DataCopyJump) >> 1
                          -  .byte (MEM_DataCopy6 - MEM_DataCopyJump) >> 1
                          -  .byte (MEM_DataCopy7 - MEM_DataCopyJump) >> 1
                          -  .byte (MEM_DataCopy8 - MEM_DataCopyJump) >> 1
                          -  .byte (MEM_DataCopy9 - MEM_DataCopyJump) >> 1
                          -  .byte (MEM_DataCopy10 - MEM_DataCopyJump) >> 1
                          -  .byte (MEM_DataCopy11 - MEM_DataCopyJump) >> 1
                          -  .byte (MEM_DataCopy12 - MEM_DataCopyJump) >> 1
                          -  .byte (MEM_DataCopy13 - MEM_DataCopyJump) >> 1
                          -  .byte (MEM_DataCopy14 - MEM_DataCopyJump) >> 1
                          -  .byte (MEM_DataCopy15 - MEM_DataCopyJump) >> 1
                          -
                          -  .align 2
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -
                          -//#define 10 10
                          -
                          -MEM_LongCopyTable:
                          -  .byte (MEM_LongCopyEnd - MEM_LongCopyJump) >> 1 @ 0 bytes left
                          -  .byte 0                    @ 4 bytes left  
                          -  .byte (1 * 10) >> 1   @ 8 bytes left
                          -  .byte (2 * 10) >> 1   @ 12 bytes left
                          -  .byte (3 * 10) >> 1   @ 16 bytes left
                          -  .byte (4 * 10) >> 1   @ 20 bytes left
                          -  .byte (5 * 10) >> 1   @ 24 bytes left  
                          -  .byte (6 * 10) >> 1   @ 28 bytes left
                          -  .byte (7 * 10) >> 1   @ 32 bytes left
                          -  .byte (8 * 10) >> 1   @ 36 bytes left
                          -
                          -  .align 2
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -@ r0 = destination, r1 = source, r2 = length
                          -
                          -.thumb_func
                          -
                          -memcpy:
                          -  push {r14}
                          -  
                          -  @ This allows the inner workings to "assume" a minimum amount of bytes
                          -  cmp r2, #4
                          -  blt MEM_DataCopyBytes
                          -    
                          -  and r14, r0, #3             @ Get destination alignment bits
                          -  bfi r14, r1, #2, #2         @ Get source alignment bits
                          -  ldr r3, =MEM_DataCopyTable  @ Jump table base  
                          -  tbb [r3, r14]               @ Perform jump on src/dst alignment bits
                          -MEM_DataCopyJump:
                          -
                          - .align 4
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -@ Bits:  Src=01, Dst=01 - Byte before half word to byte before half word - Same alignment
                          -@ 3 bytes to read for long word aligning
                          -
                          -MEM_DataCopy5:
                          -  ldrb r3, [r1], #0x01
                          -  strb r3, [r0], #0x01
                          -  sub r2, r2, #0x01
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -@ Bits:  Src=10, Dst=10 - Half word to half word - Same Alignment
                          -@ 2 bytes to read for long word aligning
                          -
                          -MEM_DataCopy10:
                          -  ldrb r3, [r1], #0x01
                          -  strb r3, [r0], #0x01
                          -  sub r2, r2, #0x01
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -@ Bits:  Src=11, Dst=11 - Byte before long word to Byte before long word - Same alignment
                          -@ 1 bytes to read for long word aligning
                          -
                          -MEM_DataCopy15:
                          -  ldrb r3, [r1], #0x01
                          -  strb r3, [r0], #0x01
                          -  sub r2, r2, #0x01
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -@ Bits:  Src=00, Dst=00 - Long to Long copy
                          -
                          -MEM_DataCopy0:
                          -  @ Save regs
                          -  push {r4-r12}
                          -
                          -  cmp r2, #0x28
                          -  blt MEM_DataCopy0_2
                          -  
                          -MEM_DataCopy0_1:
                          -  ldmia r1!, {r3-r12}
                          -  stmia r0!, {r3-r12}
                          -  sub r2, r2, #0x28    
                          -  cmp r2, #0x28
                          -  bge MEM_DataCopy0_1
                          -
                          -MEM_DataCopy0_2:
                          -  @ Copy remaining long words
                          -  ldr r14, =MEM_LongCopyTable
                          -  lsr r11, r2, #0x02
                          -  tbb [r14, r11]
                          -
                          -MEM_LongCopyJump:
                          -  ldr.w r3, [r1], #0x04   @ 4 bytes remain 
                          -  str.w r3, [r0], #0x04
                          -  b MEM_LongCopyEnd
                          -  ldmia.w r1!, {r3-r4}    @ 8 bytes remain 
                          -  stmia.w r0!, {r3-r4}
                          -  b MEM_LongCopyEnd
                          -  ldmia.w r1!, {r3-r5}    @ 12 bytes remain
                          -  stmia.w r0!, {r3-r5}
                          -  b MEM_LongCopyEnd
                          -  ldmia.w r1!, {r3-r6}    @ 16 bytes remain
                          -  stmia.w r0!, {r3-r6}
                          -  b MEM_LongCopyEnd
                          -  ldmia.w r1!, {r3-r7}    @ 20 bytes remain
                          -  stmia.w r0!, {r3-r7}
                          -  b MEM_LongCopyEnd
                          -  ldmia.w r1!, {r3-r8}    @ 24 bytes remain
                          -  stmia.w r0!, {r3-r8}
                          -  b MEM_LongCopyEnd
                          -  ldmia.w r1!, {r3-r9}    @ 28 bytes remain
                          -  stmia.w r0!, {r3-r9}
                          -  b MEM_LongCopyEnd
                          -  ldmia.w r1!, {r3-r10}   @ 32 bytes remain
                          -  stmia.w r0!, {r3-r10}
                          -  b MEM_LongCopyEnd
                          -  ldmia.w r1!, {r3-r11}   @ 36 bytes remain
                          -  stmia.w r0!, {r3-r11}
                          -  
                          -MEM_LongCopyEnd:  
                          -  pop {r4-r12}
                          -  and r2, r2, #0x03    @ All the longs have been copied
                          -  
                          -@ ----------------------------------------------------------------------------   
                          -
                          -MEM_DataCopyBytes:
                          -  @ Deal with up to 3 remaining bytes
                          -  cmp r2, #0x00
                          -  it eq
                          -  popeq {pc}
                          -  ldrb r3, [r1], #0x01
                          -  strb r3, [r0], #0x01
                          -  subs r2, r2, #0x01
                          -  it eq
                          -  popeq {pc}
                          -  ldrb r3, [r1], #0x01
                          -  strb r3, [r0], #0x01
                          -  subs r2, r2, #0x01
                          -  it eq
                          -  popeq {pc}
                          -  ldrb r3, [r1], #0x01
                          -  strb r3, [r0], #0x01
                          -  pop {pc}
                          -
                          - .align 4
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -@ Bits:  Src=01, Dst=11 - Byte before half word to byte before long word
                          -@ 3 bytes to read for long word aligning the source
                          -
                          -MEM_DataCopy7:
                          -  ldrb r3, [r1], #0x01
                          -  strb r3, [r0], #0x01
                          -  sub r2, r2, #0x01
                          -  
                          -@ ----------------------------------------------------------------------------   
                          -@ Bits:  Src=10, Dst=00 - Half word to long word
                          -@ 2 bytes to read for long word aligning the source
                          -
                          -MEM_DataCopy8: 
                          -  ldrb r3, [r1], #0x01
                          -  strb r3, [r0], #0x01
                          -  sub r2, r2, #0x01
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -@ Bits:  Src=11, Dst=01 - Byte before long word to byte before half word
                          -@ 1 byte to read for long word aligning the source
                          -
                          -MEM_DataCopy13:
                          -  ldrb r3, [r1], #0x01
                          -  strb r3, [r0], #0x01
                          -  sub r2, r2, #0x01
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -@ Bits:  Src=00, Dst=10 - Long to Half word
                          -
                          -MEM_DataCopy2: 
                          -  cmp r2, #0x28
                          -  blt MEM_DataCopy2_1
                          -
                          -  @ Save regs
                          -  push {r4-r12}
                          -MEM_DataCopy2_2:
                          -  ldmia r1!, {r3-r12}
                          -
                          -  strh r3, [r0], #0x02
                          -
                          -  lsr r3, r3, #0x10  
                          -  bfi r3, r4, #0x10, #0x10  
                          -  lsr r4, r4, #0x10  
                          -  bfi r4, r5, #0x10, #0x10  
                          -  lsr r5, r5, #0x10  
                          -  bfi r5, r6, #0x10, #0x10  
                          -  lsr r6, r6, #0x10  
                          -  bfi r6, r7, #0x10, #0x10  
                          -  lsr r7, r7, #0x10  
                          -  bfi r7, r8, #0x10, #0x10  
                          -  lsr r8, r8, #0x10  
                          -  bfi r8, r9, #0x10, #0x10  
                          -  lsr r9, r9, #0x10  
                          -  bfi r9, r10, #0x10, #0x10  
                          -  lsr r10, r10, #0x10  
                          -  bfi r10, r11, #0x10, #0x10  
                          -  lsr r11, r11, #0x10  
                          -  bfi r11, r12, #0x10, #0x10  
                          -  stmia r0!, {r3-r11}
                          -  lsr r12, r12, #0x10  
                          -  strh r12, [r0], #0x02
                          -
                          -  sub r2, r2, #0x28    
                          -  cmp r2, #0x28
                          -  bge MEM_DataCopy2_2
                          -  pop {r4-r12}
                          -
                          -MEM_DataCopy2_1: @ Read longs and write 2 x half words
                          -  cmp r2, #4
                          -  blt MEM_DataCopyBytes
                          -  ldr r3, [r1], #0x04
                          -  strh r3, [r0], #0x02
                          -  lsr r3, r3, #0x10
                          -  strh r3, [r0], #0x02
                          -  sub r2, r2, #0x04
                          -  b MEM_DataCopy2
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -@ Bits:  Src=01, Dst=00 - Byte before half word to long
                          -@ Bits:  Src=01, Dst=10 - Byte before half word to half word
                          -@ 3 bytes to read for long word aligning the source
                          -
                          -MEM_DataCopy4: 
                          -MEM_DataCopy6:  
                          -  @ Read B and write B
                          -  ldrb r3, [r1], #0x01
                          -  strb r3, [r0], #0x01
                          -  sub r2, r2, #0x01
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -@ Bits:  Src=10, Dst=01 - Half word to byte before half word
                          -@ Bits:  Src=10, Dst=11 - Half word to byte before long word
                          -@ 2 bytes to read for long word aligning the source
                          -
                          -MEM_DataCopy9:
                          -MEM_DataCopy11:
                          -  ldrb r3, [r1], #0x01
                          -  strb r3, [r0], #0x01
                          -  sub r2, r2, #0x01
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -@ Bits:  Src=11, Dst=00 - Byte before long word to long word
                          -@ Bits:  Src=11, Dst=11 - Byte before long word to half word
                          -@ 1 byte to read for long word aligning the source
                          -
                          -MEM_DataCopy12:
                          -MEM_DataCopy14:
                          -  @ Read B and write B
                          -  ldrb r3, [r1], #0x01
                          -  strb r3, [r0], #0x01
                          -  sub r2, r2, #0x01
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -@ Bits:  Src=00, Dst=01 - Long to Byte before half word
                          -@ Bits:  Src=00, Dst=11 - Long to Byte before long word
                          -
                          -MEM_DataCopy1: @ Read longs, write B->H->B
                          -MEM_DataCopy3: 
                          -  cmp r2, #4
                          -  blt MEM_DataCopyBytes
                          -  ldr r3, [r1], #0x04
                          -  strb r3, [r0], #0x01
                          -  lsr r3, r3, #0x08
                          -  strh r3, [r0], #0x02
                          -  lsr r3, r3, #0x10
                          -  strb r3, [r0], #0x01
                          -  sub r2, r2, #0x04  
                          -  b MEM_DataCopy3
                          -
                          -@ ---------------------------------------------------------------------------- 
                          -
                          diff --git a/nuttx/arch/arm/src/armv7-m/up_elf.c b/nuttx/arch/arm/src/armv7-m/up_elf.c
                          new file mode 100644
                          index 0000000000..b838a69057
                          --- /dev/null
                          +++ b/nuttx/arch/arm/src/armv7-m/up_elf.c
                          @@ -0,0 +1,450 @@
                          +/****************************************************************************
                          + * arch/arm/src/armv7-m/up_elf.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 
                          +
                          +/****************************************************************************
                          + * Pre-processor Definitions
                          + ****************************************************************************/
                          +
                          +/****************************************************************************
                          + * Private Data
                          + ****************************************************************************/
                          +
                          +/****************************************************************************
                          + * Private Functions
                          + ****************************************************************************/
                          +
                          +/****************************************************************************
                          + * Public Functions
                          + ****************************************************************************/
                          +
                          +/****************************************************************************
                          + * Name: arch_checkarch
                          + *
                          + * Description:
                          + *   Given the ELF header in 'hdr', verify that the ELF file is appropriate
                          + *   for the current, configured architecture.  Every architecture that uses
                          + *   the ELF loader must provide this function.
                          + *
                          + * Input Parameters:
                          + *   hdr - The ELF header read from the ELF file.
                          + *
                          + * Returned Value:
                          + *   True if the architecture supports this ELF file.
                          + *
                          + ****************************************************************************/
                          +
                          +bool arch_checkarch(FAR const Elf32_Ehdr *ehdr)
                          +{
                          +  /* Make sure it's an ARM executable */
                          +
                          +  if (ehdr->e_machine != EM_ARM)
                          +    {
                          +      bdbg("Not for ARM: e_machine=%04x\n", ehdr->e_machine);
                          +      return -ENOEXEC;
                          +    }
                          +
                          +  /* Make sure that 32-bit objects are supported */
                          +
                          +  if (ehdr->e_ident[EI_CLASS] != ELFCLASS32)
                          +    {
                          +      bdbg("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]);
                          +      return -ENOEXEC;
                          +    }
                          +
                          +  /* Verify endian-ness */
                          +
                          +#ifdef CONFIG_ENDIAN_BIG
                          +  if (ehdr->e_ident[EI_DATA] != ELFDATA2MSB)
                          +#else
                          +  if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB)
                          +#endif
                          +    {
                          +      bdbg("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]);
                          +      return -ENOEXEC;
                          +    }
                          +
                          +  /* TODO:  Check ABI here. */
                          +  return OK;
                          +}
                          +
                          +/****************************************************************************
                          + * Name: arch_relocate and arch_relocateadd
                          + *
                          + * Description:
                          + *   Perform on architecture-specific ELF relocation.  Every architecture
                          + *   that uses the ELF loader must provide this function.
                          + *
                          + * Input Parameters:
                          + *   rel - The relocation type
                          + *   sym - The ELF symbol structure containing the fully resolved value.
                          + *   addr - The address that requires the relocation.
                          + *
                          + * Returned Value:
                          + *   Zero (OK) if the relocation was successful.  Otherwise, a negated errno
                          + *   value indicating the cause of the relocation failure.
                          + *
                          + ****************************************************************************/
                          +
                          +int arch_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
                          +                  uintptr_t addr)
                          +{
                          +  int32_t offset;
                          +  uint32_t upper_insn;
                          +  uint32_t lower_insn;
                          +
                          +  switch (ELF32_R_TYPE(rel->r_info))
                          +    {
                          +    case R_ARM_NONE:
                          +      {
                          +        /* No relocation */
                          +      }
                          +      break;
                          +
                          +    case R_ARM_PC24:
                          +    case R_ARM_CALL:
                          +    case R_ARM_JUMP24:
                          +      {
                          +        bvdbg("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%s' st_value=%08lx\n",
                          +              ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t*)addr),
                          +              sym, (long)sym->st_value);
                          +
                          +        offset = (*(uint32_t*)addr & 0x00ffffff) << 2;
                          +        if (offset & 0x02000000)
                          +          {
                          +            offset -= 0x04000000;
                          +          }
                          +
                          +        offset += sym->st_value - addr;
                          +        if (offset & 3 || offset <= (int32_t) 0xfe000000 || offset >= (int32_t) 0x02000000)
                          +          {
                          +            bdbg("  ERROR: PC24 [%d] relocation out of range, offset=%08lx\n",
                          +                 ELF32_R_TYPE(rel->r_info), offset);
                          +
                          +            return -EINVAL;
                          +          }
                          +
                          +        offset >>= 2;
                          +
                          +        *(uint32_t*)addr &= 0xff000000;
                          +        *(uint32_t*)addr |= offset & 0x00ffffff;
                          +      }
                          +      break;
                          +
                          +    case R_ARM_ABS32:
                          +    case R_ARM_TARGET1:  /* New ABI:  TARGET1 always treated as ABS32 */
                          +      {
                          +        bvdbg("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
                          +              (long)addr, (long)(*(uint32_t*)addr), sym, (long)sym->st_value);
                          +
                          +        *(uint32_t*)addr += sym->st_value;
                          +      }
                          +      break;
                          +
                          +    case R_ARM_THM_CALL:
                          +    case R_ARM_THM_JUMP24:
                          +      {
                          +        uint32_t S;
                          +        uint32_t J1;
                          +        uint32_t J2;
                          +
                          +        /* Thumb BL and B.W instructions. Encoding:
                          +         *
                          +         * upper_insn:
                          +         *
                          +         *  1   1   1   1   1   1
                          +         *  5   4   3   2   1   0   9   8   7   6   5   4   3   2   1   0
                          +         * +----------+---+-------------------------------+--------------+
                          +         * |1   1   1 |OP1|     OP2                       |              | 32-Bit Instructions
                          +         * +----------+---+--+-----+----------------------+--------------+
                          +         * |1   1   1 | 1   0|  S  |              imm10                  | BL Instruction
                          +         * +----------+------+-----+-------------------------------------+
                          +         *
                          +         * lower_insn:
                          +         *
                          +         *  1   1   1   1   1   1
                          +         *  5   4   3   2   1   0   9   8   7   6   5   4   3   2   1   0
                          +         * +---+---------------------------------------------------------+
                          +         * |OP |                                                         | 32-Bit Instructions
                          +         * +---+--+---+---+---+------------------------------------------+
                          +         * |1   1 |J1 | 1 |J2 |                 imm11                    | BL Instruction
                          +         * +------+---+---+---+------------------------------------------+
                          +         *
                          +         * The branch target is encoded in these bits:
                          +         *
                          +         *   S     = upper_insn[10]
                          +         *   imm10 = upper_insn[0:9]
                          +         *   imm11 = lower_insn[0:10]
                          +         *   J1    = lower_insn[13]
                          +         *   J2    = lower_insn[11]
                          +         */
                          +
                          +        upper_insn = (uint32_t)(*(uint16_t*)addr);
                          +        lower_insn = (uint32_t)(*(uint16_t*)(addr + 2));
                          +
                          +        bvdbg("Performing THM_JUMP24 [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
                          +              ELF32_R_TYPE(rel->r_info), (long)addr, (int)upper_insn, (int)lower_insn,
                          +              sym, (long)sym->st_value);
                          +
                          +        /* Extract the 25-bit offset from the 32-bit instruction:
                          +         *
                          +         *   offset[24]    = S
                          +         *   offset[23]    = ~(J1 ^ S)
                          +         *   offset[22]    = ~(J2 ^ S)]
                          +         *   offset[12:21] = imm10
                          +         *   offset[1:11]  = imm11
                          +         *   offset[0]     = 0
                          +         */
                          +
                          +        S   = (upper_insn >> 10) & 1;
                          +        J1  = (lower_insn >> 13) & 1;
                          +        J2  = (lower_insn >> 11) & 1;
                          +
                          +        offset = (S << 24) |                       /* S -   > offset[24] */
                          +                 ((~(J1 ^ S) & 1) << 23) |         /* J1    -> offset[23] */
                          +                 ((~(J2 ^ S) & 1) << 22) |         /* J2    -> offset[22] */
                          +                 ((upper_insn & 0x03ff) << 12) |   /* imm10 -> offset[12:21] */
                          +                 ((lower_insn & 0x07ff) << 1);     /* imm11 -> offset[1:11] */
                          +                                                   /* 0     -> offset[0] */
                          +
                          +        /* Sign extend */
                          +
                          +        if (offset & 0x01000000)
                          +          {
                          +            offset -= 0x02000000;
                          +          }
                          +
                          +        /* And perform the relocation */
                          +
                          +        bvdbg("  S=%d J1=%d J2=%d offset=%08lx branch target=%08lx\n",
                          +              S, J1, J2, (long)offset, offset + sym->st_value - addr);
                          +
                          +        offset += sym->st_value - addr;
                          +
                          +        /* Is this a function symbol?  If so, then the branch target must be
                          +         * an odd Thumb address
                          +         */
                          +
                          +        if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && (offset & 1) == 0)
                          +          {
                          +            bdbg("  ERROR: JUMP24 [%d] requires odd offset, offset=%08lx\n",
                          +                 ELF32_R_TYPE(rel->r_info), offset);
                          +
                          +            return -EINVAL;
                          +          }
                          +
                          +        /* Check the range of the offset */
                          +
                          +        if (offset <= (int32_t)0xff000000 || offset >= (int32_t)0x01000000)
                          +          {
                          +            bdbg("  ERROR: JUMP24 [%d] relocation out of range, branch taget=%08lx\n",
                          +                 ELF32_R_TYPE(rel->r_info), offset);
                          +
                          +            return -EINVAL;
                          +          }
                          +
                          +        /* Now, reconstruct the 32-bit instruction using the new, relocated
                          +         * branch target.
                          +         */
                          +
                          +        S  = (offset >> 24) & 1;
                          +        J1 = S ^ (~(offset >> 23) & 1);
                          +        J2 = S ^ (~(offset >> 22) & 1);
                          + 
                          +        upper_insn = ((upper_insn & 0xf800) | (S << 10) | ((offset >> 12) & 0x03ff));
                          +        *(uint16_t*)addr = (uint16_t)upper_insn;
                          +
                          +        lower_insn = ((lower_insn & 0xd000) | (J1 << 13) | (J2 << 11) | ((offset >> 1) & 0x07ff));
                          +        *(uint16_t*)(addr + 2) = (uint16_t)lower_insn;
                          +
                          +        bvdbg("  S=%d J1=%d J2=%d insn [%04x %04x]\n",
                          +              S, J1, J2, (int)upper_insn, (int)lower_insn);
                          +      }
                          +      break;
                          +
                          +    case R_ARM_V4BX:
                          +      {
                          +        bvdbg("Performing V4BX link at addr=%08lx [%08lx]\n",
                          +              (long)addr, (long)(*(uint32_t*)addr));
                          +
                          +         /* Preserve only Rm and the condition code */
                          +
                          +        *(uint32_t*)addr &= 0xf000000f;
                          +
                          +        /* Change instruction to 'mov pc, Rm' */
                          +
                          +        *(uint32_t*)addr |= 0x01a0f000;
                          +      }
                          +      break;
                          +
                          +    case R_ARM_PREL31:
                          +      {
                          +        bvdbg("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
                          +              (long)addr, (long)(*(uint32_t*)addr), sym, (long)sym->st_value);
                          +
                          +        offset           = *(uint32_t*)addr + sym->st_value - addr;
                          +        *(uint32_t*)addr = offset & 0x7fffffff;
                          +      }
                          +      break;
                          +
                          +    case R_ARM_MOVW_ABS_NC:
                          +    case R_ARM_MOVT_ABS:
                          +      {
                          +        bvdbg("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
                          +              ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t*)addr),
                          +              sym, (long)sym->st_value);
                          +
                          +        offset = *(uint32_t*)addr;
                          +        offset = ((offset & 0xf0000) >> 4) | (offset & 0xfff);
                          +        offset = (offset ^ 0x8000) - 0x8000;
                          +
                          +        offset += sym->st_value;
                          +        if (ELF32_R_TYPE(rel->r_info) == R_ARM_MOVT_ABS)
                          +          {
                          +            offset >>= 16;
                          +          }
                          +
                          +        *(uint32_t*)addr &= 0xfff0f000;
                          +        *(uint32_t*)addr |= ((offset & 0xf000) << 4) | (offset & 0x0fff);
                          +      }
                          +      break;
                          +
                          +    case R_ARM_THM_MOVW_ABS_NC:
                          +    case R_ARM_THM_MOVT_ABS:
                          +      {
                          +        /* Thumb BL and B.W instructions. Encoding:
                          +         *
                          +         * upper_insn:
                          +         *
                          +         *  1   1   1   1   1   1
                          +         *  5   4   3   2   1   0   9   8   7   6   5   4   3   2   1   0
                          +         * +----------+---+-------------------------------+--------------+
                          +         * |1   1   1 |OP1|     OP2                       |              | 32-Bit Instructions
                          +         * +----------+---+--+-----+----------------------+--------------+
                          +         * |1   1   1 | 1   0|  i  | 1  0   1   1   0   0 |    imm4      | MOVT Instruction
                          +         * +----------+------+-----+----------------------+--------------+
                          +         *
                          +         * lower_insn:
                          +         *
                          +         *  1   1   1   1   1   1
                          +         *  5   4   3   2   1   0   9   8   7   6   5   4   3   2   1   0
                          +         * +---+---------------------------------------------------------+
                          +         * |OP |                                                         | 32-Bit Instructions
                          +         * +---+----------+--------------+-------------------------------+
                          +         * |0  |   imm3   |      Rd      |            imm8               | MOVT Instruction
                          +         * +---+----------+--------------+-------------------------------+
                          +         *
                          +         * The 16-bit immediate value is encoded in these bits:
                          +         *
                          +         *   i    = imm16[11]    = upper_insn[10]
                          +         *   imm4 = imm16[12:15] = upper_insn[3:0]
                          +         *   imm3 = imm16[8:10]  = lower_insn[14:12]
                          +         *   imm8 = imm16[0:7]   = lower_insn[7:0]
                          +         */
                          +
                          +        upper_insn = (uint32_t)(*(uint16_t*)addr);
                          +        lower_insn = (uint32_t)(*(uint16_t*)(addr + 2));
                          +
                          +        bvdbg("Performing THM_MOVx [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
                          +              ELF32_R_TYPE(rel->r_info), (long)addr, (int)upper_insn, (int)lower_insn,
                          +              sym, (long)sym->st_value);
                          +
                          +        /* Extract the 16-bit offset from the 32-bit instruction */
                          +
                          +        offset = ((upper_insn & 0x000f) << 12) | /* imm4 -> imm16[8:10] */
                          +                 ((upper_insn & 0x0400) << 1) |  /* i    -> imm16[11] */
                          +                 ((lower_insn & 0x7000) >> 4) |  /* imm3 -> imm16[8:10] */
                          +                  (lower_insn & 0x00ff);         /* imm8 -> imm16[0:7] */
                          +
                          +        /* Sign extend */
                          +
                          +        offset = (offset ^ 0x8000) - 0x8000;
                          +
                          +        /* And perform the relocation */
                          +
                          +        bvdbg("  offset=%08lx branch target=%08lx\n",
                          +              (long)offset, offset + sym->st_value);
                          +
                          +        offset += sym->st_value;
                          +
                          +        /* Update the immediate value in the instruction.  For MOVW we want the bottom
                          +         * 16-bits; for MOVT we want the top 16-bits.
                          +         */
                          +
                          +        if (ELF32_R_TYPE(rel->r_info) == R_ARM_THM_MOVT_ABS)
                          +          {
                          +            offset >>= 16;
                          +          }
                          +
                          +        upper_insn = ((upper_insn & 0xfbf0) | ((offset & 0xf000) >> 12) | ((offset & 0x0800) >> 1));
                          +        *(uint16_t*)addr = (uint16_t)upper_insn;
                          +
                          +        lower_insn = ((lower_insn & 0x8f00) | ((offset & 0x0700) << 4) | (offset & 0x00ff));
                          +        *(uint16_t*)(addr + 2) = (uint16_t)lower_insn;
                          +
                          +        bvdbg("  insn [%04x %04x]\n",
                          +             (int)upper_insn, (int)lower_insn);
                          +      }
                          +      break;
                          +
                          +    default:
                          +      bdbg("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info));
                          +      return -EINVAL;
                          +    }
                          +
                          +  return OK;
                          +}
                          +
                          +int arch_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym,
                          +                     uintptr_t addr)
                          +{
                          +  bdbg("RELA relocation not supported\n");
                          +  return -ENOSYS;
                          +}
                          +
                          diff --git a/nuttx/arch/arm/src/armv7-m/up_hardfault.c b/nuttx/arch/arm/src/armv7-m/up_hardfault.c
                          index cb3ce9e8a9..c30015ad22 100644
                          --- a/nuttx/arch/arm/src/armv7-m/up_hardfault.c
                          +++ b/nuttx/arch/arm/src/armv7-m/up_hardfault.c
                          @@ -57,9 +57,7 @@
                           
                           /* Debug output from this file may interfere with context switching! */
                           
                          -#undef DEBUG_HARDFAULTS         /* Define to debug hard faults */
                          -
                          -#ifdef DEBUG_HARDFAULTS
                          +#ifdef CONFIG_DEBUG_HARDFAULT
                           # define hfdbg(format, arg...) lldbg(format, ##arg)
                           #else
                           # define hfdbg(x...)
                          diff --git a/nuttx/arch/arm/src/armv7-m/up_memcpy.S b/nuttx/arch/arm/src/armv7-m/up_memcpy.S
                          new file mode 100644
                          index 0000000000..a154cab614
                          --- /dev/null
                          +++ b/nuttx/arch/arm/src/armv7-m/up_memcpy.S
                          @@ -0,0 +1,416 @@
                          +/************************************************************************************
                          + * nuttx/arch/arm/src/armv7-m/up_memcpy.S
                          + *
                          + * armv7m-optimised memcpy, contributed by Mike Smith.  Apparently in the public
                          + * domain and is re-released here under the modified BSD license:
                          + *
                          + * Obtained via a posting on the Stellaris forum:
                          + *  http://e2e.ti.com/support/microcontrollers/\
                          + *       stellaris_arm_cortex-m3_microcontroller/f/473/t/44360.aspx
                          + *
                          + * Posted by rocksoft on Jul 24, 2008 10:19 AM
                          + *
                          + *   Hi,
                          + *
                          + *   I recently finished a "memcpy" replacement and thought it might be useful for
                          + *   others...
                          + *
                          + *   I've put some instructions and the code here:
                          + *
                          + *   http://www.rock-software.net/downloads/memcpy/
                          + *
                          + *   Hope it works for you as well as it did for me.
                          + *
                          + *   Liam.
                          + *
                          + * 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.
                          + *
                          + ************************************************************************************/
                          +
                          +/************************************************************************************
                          + * Global Symbols
                          + ************************************************************************************/
                          +
                          +	.global		memcpy
                          +
                          +	.syntax		unified
                          +	.thumb
                          +	.cpu		cortex-m3
                          +	.file		"up_memcpy.S"
                          +
                          +/************************************************************************************
                          + * .text
                          + ************************************************************************************/
                          +
                          +	.text
                          +
                          +/************************************************************************************
                          + * Private Constant Data
                          + ************************************************************************************/
                          +
                          +/* We have 16 possible alignment combinations of src and dst, this jump table
                          + * directs the copy operation
                          + *
                          + * Bits:  Src=00, Dst=00 - Long to Long copy
                          + * Bits:  Src=00, Dst=01 - Long to Byte before half word
                          + * Bits:  Src=00, Dst=10 - Long to Half word
                          + * Bits:  Src=00, Dst=11 - Long to Byte before long word
                          + * Bits:  Src=01, Dst=00 - Byte before half word to long
                          + * Bits:  Src=01, Dst=01 - Byte before half word to byte before half word -
                          + *                         Same alignment
                          + * Bits:  Src=01, Dst=10 - Byte before half word to half word
                          + * Bits:  Src=01, Dst=11 - Byte before half word to byte before long word
                          + * Bits:  Src=10, Dst=00 - Half word to long word
                          + * Bits:  Src=10, Dst=01 - Half word to byte before half word
                          + * Bits:  Src=10, Dst=10 - Half word to half word - Same Alignment
                          + * Bits:  Src=10, Dst=11 - Half word to byte before long word
                          + * Bits:  Src=11, Dst=00 - Byte before long word to long word
                          + * Bits:  Src=11, Dst=01 - Byte before long word to byte before half word
                          + * Bits:  Src=11, Dst=11 - Byte before long word to half word
                          + * Bits:  Src=11, Dst=11 - Byte before long word to Byte before long word -
                          + *                         Same alignment
                          + */
                          +
                          +MEM_DataCopyTable:
                          +	.byte	(MEM_DataCopy0 - MEM_DataCopyJump) >> 1
                          +	.byte	(MEM_DataCopy1 - MEM_DataCopyJump) >> 1
                          +	.byte	(MEM_DataCopy2 - MEM_DataCopyJump) >> 1
                          +	.byte	(MEM_DataCopy3 - MEM_DataCopyJump) >> 1
                          +	.byte	(MEM_DataCopy4 - MEM_DataCopyJump) >> 1
                          +	.byte	(MEM_DataCopy5 - MEM_DataCopyJump) >> 1
                          +	.byte	(MEM_DataCopy6 - MEM_DataCopyJump) >> 1
                          +	.byte	(MEM_DataCopy7 - MEM_DataCopyJump) >> 1
                          +	.byte	(MEM_DataCopy8 - MEM_DataCopyJump) >> 1
                          +	.byte	(MEM_DataCopy9 - MEM_DataCopyJump) >> 1
                          +	.byte	(MEM_DataCopy10 - MEM_DataCopyJump) >> 1
                          +	.byte	(MEM_DataCopy11 - MEM_DataCopyJump) >> 1
                          +	.byte	(MEM_DataCopy12 - MEM_DataCopyJump) >> 1
                          +	.byte	(MEM_DataCopy13 - MEM_DataCopyJump) >> 1
                          +	.byte	(MEM_DataCopy14 - MEM_DataCopyJump) >> 1
                          +	.byte	(MEM_DataCopy15 - MEM_DataCopyJump) >> 1
                          +
                          +	.align 2
                          +
                          +MEM_LongCopyTable:
                          +	.byte	(MEM_LongCopyEnd - MEM_LongCopyJump) >> 1	/* 0 bytes left */
                          +	.byte	0					/* 4 bytes left */
                          +	.byte	(1 * 10) >> 1		/* 8 bytes left */
                          +	.byte	(2 * 10) >> 1		/* 12 bytes left */
                          +	.byte	(3 * 10) >> 1		/* 16 bytes left */
                          +	.byte	(4 * 10) >> 1		/* 20 bytes left */
                          +	.byte	(5 * 10) >> 1		/* 24 bytes left */
                          +	.byte	(6 * 10) >> 1		/* 28 bytes left */
                          +	.byte	(7 * 10) >> 1		/* 32 bytes left */
                          +	.byte	(8 * 10) >> 1		/* 36 bytes left */
                          +
                          +	.align 2
                          +
                          +/************************************************************************************
                          + * Public Functions
                          + ************************************************************************************/
                          +/************************************************************************************
                          + * Name: memcpy
                          + *
                          + * Description:
                          + *   Optimised "general" copy routine
                          + *
                          + * Input Parameters:
                          + *   r0 = destination, r1 = source, r2 = length
                          + *
                          + ************************************************************************************/
                          +
                          +	.thumb_func
                          +memcpy:
                          +	push	{r14}
                          +
                          +	/* This allows the inner workings to "assume" a minimum amount of bytes */
                          +	/* Quickly check for very short copies */
                          +
                          +	cmp		r2, #4
                          +	blt		MEM_DataCopyBytes
                          +
                          +	and		r14, r0, #3		 		/* Get destination alignment bits */
                          +	bfi		r14, r1, #2, #2	 		/* Get source alignment bits */
                          +	ldr		r3, =MEM_DataCopyTable	/* Jump table base */
                          +	tbb		[r3, r14]		   		/* Perform jump on src/dst alignment bits */
                          +MEM_DataCopyJump:
                          +
                          +	.align 4
                          +
                          +/* Bits:  Src=01, Dst=01 - Byte before half word to byte before half word - Same alignment
                          + * 3 bytes to read for long word aligning
                          + */
                          +
                          +MEM_DataCopy5:
                          +	ldrb	r3, [r1], #0x01
                          +	strb	r3, [r0], #0x01
                          +	sub		r2, r2, #0x01
                          +
                          +/* Bits:  Src=10, Dst=10 - Half word to half word - Same Alignment
                          + * 2 bytes to read for long word aligning
                          + */
                          +
                          +MEM_DataCopy10:
                          +	ldrb	r3, [r1], #0x01
                          +	strb	r3, [r0], #0x01
                          +	sub		r2, r2, #0x01
                          +
                          +/* Bits:  Src=11, Dst=11 - Byte before long word to Byte before long word - Same alignment
                          + * 1 bytes to read for long word aligning
                          + */
                          +
                          +MEM_DataCopy15:
                          +	ldrb	r3, [r1], #0x01
                          +	strb	r3, [r0], #0x01
                          +	sub		r2, r2, #0x01
                          +
                          +/* Bits:  Src=00, Dst=00 - Long to Long copy */
                          +
                          +MEM_DataCopy0:
                          +	/* Save regs that may be used by memcpy */
                          +
                          +	push	{r4-r12}
                          +
                          +	/* Check for short word-aligned copy */
                          +
                          +	cmp		r2, #0x28
                          +	blt		MEM_DataCopy0_2
                          +
                          +	/* Bulk copy loop */
                          +
                          +MEM_DataCopy0_1:
                          +	ldmia	r1!, {r3-r12}
                          +	stmia	r0!, {r3-r12}
                          +	sub		r2, r2, #0x28
                          +	cmp		r2, #0x28
                          +	bge		MEM_DataCopy0_1
                          +
                          +	/* Copy remaining long words */
                          +
                          +MEM_DataCopy0_2:
                          +	/* Copy remaining long words */
                          +
                          +	ldr		r14, =MEM_LongCopyTable
                          +	lsr		r11, r2, #0x02
                          +	tbb		[r14, r11]
                          +
                          +	/* longword copy branch table anchor */
                          +
                          +MEM_LongCopyJump:
                          +	ldr.w	r3, [r1], #0x04		/* 4 bytes remain */
                          +	str.w	r3, [r0], #0x04
                          +	b		MEM_LongCopyEnd
                          +	ldmia.w	r1!, {r3-r4}		/* 8 bytes remain */
                          +	stmia.w	r0!, {r3-r4}
                          +	b		MEM_LongCopyEnd
                          +	ldmia.w	r1!, {r3-r5}		/* 12 bytes remain */
                          +	stmia.w	r0!, {r3-r5}
                          +	b		MEM_LongCopyEnd
                          +	ldmia.w	r1!, {r3-r6}		/* 16 bytes remain */
                          +	stmia.w	r0!, {r3-r6}
                          +	b		MEM_LongCopyEnd
                          +	ldmia.w	r1!, {r3-r7}		/* 20 bytes remain */
                          +	stmia.w	r0!, {r3-r7}
                          +	b		MEM_LongCopyEnd
                          +	ldmia.w	r1!, {r3-r8}		/* 24 bytes remain */
                          +	stmia.w	r0!, {r3-r8}
                          +	b		MEM_LongCopyEnd
                          +	ldmia.w	r1!, {r3-r9}		/* 28 bytes remain */
                          +	stmia.w	r0!, {r3-r9}
                          +	b		MEM_LongCopyEnd
                          +	ldmia.w	r1!, {r3-r10}		/* 32 bytes remain */
                          +	stmia.w	r0!, {r3-r10}
                          +	b		MEM_LongCopyEnd
                          +	ldmia.w	r1!, {r3-r11}		/* 36 bytes remain */
                          +	stmia.w	r0!, {r3-r11}
                          +
                          +MEM_LongCopyEnd:
                          +	pop		{r4-r12}
                          +	and		r2, r2, #0x03		/* All the longs have been copied */
                          +
                          +	/* Deal with up to 3 remaining bytes */
                          +
                          +MEM_DataCopyBytes:
                          +	/* Deal with up to 3 remaining bytes */
                          +
                          +	cmp		r2, #0x00
                          +	it		eq
                          +	popeq	{pc}
                          +	ldrb	r3, [r1], #0x01
                          +	strb	r3, [r0], #0x01
                          +	subs	r2, r2, #0x01
                          +	it		eq
                          +	popeq	{pc}
                          +	ldrb	r3, [r1], #0x01
                          +	strb	r3, [r0], #0x01
                          +	subs	r2, r2, #0x01
                          +	it		eq
                          +	popeq	{pc}
                          +	ldrb	r3, [r1], #0x01
                          +	strb	r3, [r0], #0x01
                          +	pop		{pc}
                          +
                          + .align 4
                          +
                          +/* Bits:  Src=01, Dst=11 - Byte before half word to byte before long word
                          + * 3 bytes to read for long word aligning the source
                          + */
                          +
                          +MEM_DataCopy7:
                          +	ldrb	r3, [r1], #0x01
                          +	strb	r3, [r0], #0x01
                          +	sub		r2, r2, #0x01
                          +
                          +/* Bits:  Src=10, Dst=00 - Half word to long word
                          + * 2 bytes to read for long word aligning the source
                          + */
                          +
                          +MEM_DataCopy8:
                          +	ldrb	r3, [r1], #0x01
                          +	strb	r3, [r0], #0x01
                          +	sub		r2, r2, #0x01
                          +
                          +/* Bits:  Src=11, Dst=01 - Byte before long word to byte before half word
                          + * 1 byte to read for long word aligning the source
                          + */
                          +
                          +MEM_DataCopy13:
                          +	ldrb	r3, [r1], #0x01
                          +	strb	r3, [r0], #0x01
                          +	sub		r2, r2, #0x01
                          +
                          +/* Bits:  Src=00, Dst=10 - Long to Half word */
                          +
                          +MEM_DataCopy2:
                          +	cmp		r2, #0x28
                          +	blt		MEM_DataCopy2_1
                          +
                          +	/* Save regs */
                          +
                          +	push	{r4-r12}
                          +
                          +	/* Bulk copy loop */
                          +
                          +MEM_DataCopy2_2:
                          +	ldmia	r1!, {r3-r12}
                          +
                          +	strh	r3, [r0], #0x02
                          +
                          +	lsr		r3, r3, #0x10
                          +	bfi		r3, r4, #0x10, #0x10
                          +	lsr		r4, r4, #0x10
                          +	bfi		r4, r5, #0x10, #0x10
                          +	lsr		r5, r5, #0x10
                          +	bfi		r5, r6, #0x10, #0x10
                          +	lsr		r6, r6, #0x10
                          +	bfi		r6, r7, #0x10, #0x10
                          +	lsr		r7, r7, #0x10
                          +	bfi		r7, r8, #0x10, #0x10
                          +	lsr		r8, r8, #0x10
                          +	bfi		r8, r9, #0x10, #0x10
                          +	lsr		r9, r9, #0x10
                          +	bfi		r9, r10, #0x10, #0x10
                          +	lsr		r10, r10, #0x10
                          +	bfi		r10, r11, #0x10, #0x10
                          +	lsr		r11, r11, #0x10
                          +	bfi		r11, r12, #0x10, #0x10
                          +	stmia	r0!, {r3-r11}
                          +	lsr		r12, r12, #0x10
                          +	strh	r12, [r0], #0x02
                          +
                          +	sub		r2, r2, #0x28
                          +	cmp		r2, #0x28
                          +	bge		MEM_DataCopy2_2
                          +	pop		{r4-r12}
                          +
                          +MEM_DataCopy2_1: /* Read longs and write 2 x half words */
                          +	cmp		r2, #4
                          +	blt		MEM_DataCopyBytes
                          +	ldr		r3, [r1], #0x04
                          +	strh	r3, [r0], #0x02
                          +	lsr		r3, r3, #0x10
                          +	strh	r3, [r0], #0x02
                          +	sub		r2, r2, #0x04
                          +	b		MEM_DataCopy2
                          +
                          +/* Bits:  Src=01, Dst=00 - Byte before half word to long
                          + * Bits:  Src=01, Dst=10 - Byte before half word to half word
                          + * 3 bytes to read for long word aligning the source
                          + */
                          +
                          +MEM_DataCopy4:
                          +MEM_DataCopy6:
                          +	/* Read B and write B */
                          +
                          +	ldrb	r3, [r1], #0x01
                          +	strb	r3, [r0], #0x01
                          +	sub		r2, r2, #0x01
                          +
                          +/* Bits:  Src=10, Dst=01 - Half word to byte before half word
                          + * Bits:  Src=10, Dst=11 - Half word to byte before long word
                          + * 2 bytes to read for long word aligning the source
                          + */
                          +
                          +MEM_DataCopy9:
                          +MEM_DataCopy11:
                          +	ldrb	r3, [r1], #0x01
                          +	strb	r3, [r0], #0x01
                          +	sub		r2, r2, #0x01
                          +
                          +/* Bits:  Src=11, Dst=00 -chm Byte before long word to long word
                          + * Bits:  Src=11, Dst=11 - Byte before long word to half word
                          + * 1 byte to read for long word aligning the source
                          + */
                          +
                          +MEM_DataCopy12:
                          +MEM_DataCopy14:
                          +	/* Read B and write B */
                          +
                          +	ldrb	r3, [r1], #0x01
                          +	strb	r3, [r0], #0x01
                          +	sub		r2, r2, #0x01
                          +
                          +/* Bits:  Src=00, Dst=01 - Long to Byte before half word
                          + * Bits:  Src=00, Dst=11 - Long to Byte before long word
                          + */
                          +
                          +MEM_DataCopy1: /* Read longs, write B->H->B */
                          +MEM_DataCopy3:
                          +	cmp		r2, #4
                          +	blt		MEM_DataCopyBytes
                          +	ldr		r3, [r1], #0x04
                          +	strb	r3, [r0], #0x01
                          +	lsr		r3, r3, #0x08
                          +	strh	r3, [r0], #0x02
                          +	lsr		r3, r3, #0x10
                          +	strb	r3, [r0], #0x01
                          +	sub		r2, r2, #0x04
                          +	b		MEM_DataCopy3
                          +
                          +	.size	memcpy, .-memcpy
                          +	.end
                          diff --git a/nuttx/lib/string/lib_memset.c b/nuttx/arch/arm/src/common/arm-elf.h
                          similarity index 64%
                          rename from nuttx/lib/string/lib_memset.c
                          rename to nuttx/arch/arm/src/common/arm-elf.h
                          index 916351b974..fac387b110 100644
                          --- a/nuttx/lib/string/lib_memset.c
                          +++ b/nuttx/arch/arm/src/common/arm-elf.h
                          @@ -1,7 +1,7 @@
                          -/************************************************************
                          - * lib/string/lib_memset.c
                          +/****************************************************************************
                          + * arch/arm/src/common/arm-elf.h
                            *
                          - *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                            *
                            * Redistribution and use in source and binary forms, with or without
                          @@ -31,29 +31,23 @@
                            * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
                            * POSSIBILITY OF SUCH DAMAGE.
                            *
                          - ************************************************************/
                          + ****************************************************************************/
                           
                          -/************************************************************
                          - * Compilation Switches
                          - ************************************************************/
                          +#ifndef __ARCH_ARM_SRC_ARM_ELF_H
                          +#define __ARCH_ARM_SRC_ARM_ELF_H
                           
                          -/************************************************************
                          +/****************************************************************************
                            * Included Files
                          - ************************************************************/
                          + ****************************************************************************/
                           
                           #include 
                          -#include 
                          -#include 
                           
                          -/************************************************************
                          - * Global Functions
                          - ************************************************************/
                          +/****************************************************************************
                          + * Pre-processor Definitions
                          + ****************************************************************************/
                           
                          -#ifndef CONFIG_ARCH_MEMSET
                          -void *memset(void *s, int c, size_t n)
                          -{
                          -  unsigned char *p = (unsigned char*)s;
                          -  while (n-- > 0) *p++ = c;
                          -  return s;
                          -}
                          -#endif
                          +/****************************************************************************
                          + * Public Types
                          + ****************************************************************************/
                          +
                          +#endif /* __ARCH_ARM_SRC_ARM_ELF_H */
                          diff --git a/nuttx/arch/arm/src/stm32/Kconfig b/nuttx/arch/arm/src/stm32/Kconfig
                          index a1635f0a4c..99dde32093 100644
                          --- a/nuttx/arch/arm/src/stm32/Kconfig
                          +++ b/nuttx/arch/arm/src/stm32/Kconfig
                          @@ -34,6 +34,27 @@ config ARCH_CHIP_STM32F100RB
                           	select STM32_STM32F10XX
                           	select STM32_VALUELINE
                           
                          +config ARCH_CHIP_STM32F100RC
                          +	bool "STM32F100RC"
                          +	select ARCH_CORTEXM3
                          +	select STM32_STM32F10XX
                          +	select STM32_VALUELINE
                          +	select STM32_HIGHDENSITY
                          +
                          +config ARCH_CHIP_STM32F100RD
                          +	bool "STM32F100RD"
                          +	select ARCH_CORTEXM3
                          +	select STM32_STM32F10XX
                          +	select STM32_VALUELINE
                          +	select STM32_HIGHDENSITY
                          +
                          +config ARCH_CHIP_STM32F100RE
                          +	bool "STM32F100RE"
                          +	select ARCH_CORTEXM3
                          +	select STM32_STM32F10XX
                          +	select STM32_VALUELINE
                          +	select STM32_HIGHDENSITY
                          +
                           config ARCH_CHIP_STM32F100V8
                           	bool "STM32F100V8"
                           	select ARCH_CORTEXM3
                          @@ -46,6 +67,27 @@ config ARCH_CHIP_STM32F100VB
                           	select STM32_STM32F10XX
                           	select STM32_VALUELINE
                           
                          +config ARCH_CHIP_STM32F100VC
                          +	bool "STM32F100VC"
                          +	select ARCH_CORTEXM3
                          +	select STM32_STM32F10XX
                          +	select STM32_VALUELINE
                          +	select STM32_HIGHDENSITY
                          +
                          +config ARCH_CHIP_STM32F100VD
                          +	bool "STM32F100VD"
                          +	select ARCH_CORTEXM3
                          +	select STM32_STM32F10XX
                          +	select STM32_VALUELINE
                          +	select STM32_HIGHDENSITY
                          +
                          +config ARCH_CHIP_STM32F100VE
                          +	bool "STM32F100VE"
                          +	select ARCH_CORTEXM3
                          +	select STM32_STM32F10XX
                          +	select STM32_VALUELINE
                          +	select STM32_HIGHDENSITY
                          +
                           config ARCH_CHIP_STM32F103RET6
                           	bool "STM32F103RET6"
                           	select ARCH_CORTEXM3
                          @@ -108,7 +150,7 @@ config ARCH_CHIP_STM32F407VE
                           
                           config ARCH_CHIP_STM32F407VG
                           	bool "STM32F407VG"
                          -	select ARCH_CORTEXM3
                          +	select ARCH_CORTEXM4
                           	select STM32_STM32F40XX
                           
                           config ARCH_CHIP_STM32F407ZE
                          @@ -151,37 +193,10 @@ config STM32_STM32F20XX
                           config STM32_STM32F40XX
                           	bool
                           
                          -choice
                          -	prompt "Toolchain Selection"
                          -	default STM32_CODESOURCERYW
                          -	depends on ARCH_CHIP_STM32
                          -
                          -config STM32_CODESOURCERYW
                          -	bool "CodeSourcery for Windows"
                          -
                          -config STM32_CODESOURCERYL
                          -	bool "CodeSourcery for Linux"
                          -
                          -config STM32_ATOLLIC_LITE
                          -	bool "Atollic Lite for Windows"
                          -
                          -config STM32_ATOLLIC_PRO
                          -	bool "Atollic Pro for Windows"
                          -
                          -config STM32_DEVKITARM
                          -	bool "DevkitARM (Windows)"
                          -
                          -config STM32_RAISONANCE
                          -	bool "STMicro Raisonance for Windows"
                          -
                          -config STM32_BUILDROOT
                          -	bool "NuttX buildroot (Cygwin or Linux)"
                          -
                          -endchoice
                          -
                           config STM32_DFU
                           	bool "DFU bootloader"
                           	default n
                          +	depends on !STM32_VALUELINE
                           	---help---
                           		Configure and position code for use with the STMicro DFU bootloader.  Do
                           		not select this option if you will load code using JTAG/SWM.
                          @@ -197,25 +212,13 @@ config STM32_ADC2
                           	bool "ADC2"
                           	default n
                           	select STM32_ADC
                          +	depends on !STM32_VALUELINE
                           
                           config STM32_ADC3
                           	bool "ADC3"
                           	default n
                           	select STM32_ADC
                          -
                          -config STM32_CRC
                          -	bool "CRC"
                          -	default n
                          -
                          -config STM32_DMA1
                          -	bool "DMA1"
                          -	default n
                          -	select ARCH_DMA
                          -
                          -config STM32_DMA2
                          -	bool "DMA2"
                          -	default n
                          -	select ARCH_DMA
                          +	depends on !STM32_VALUELINE
                           
                           config STM32_BKP
                           	bool "BKP"
                          @@ -232,6 +235,7 @@ config STM32_CAN1
                           	default n
                           	select CAN
                           	select STM32_CAN
                          +	depends on !STM32_VALUELINE
                           
                           config STM32_CAN2
                           	bool "CAN2"
                          @@ -245,11 +249,31 @@ config STM32_CCMDATARAM
                           	default n
                           	depends on STM32_STM32F40XX
                           
                          +config STM32_CEC
                          +	bool "CEC"
                          +	default n
                          +	depends on STM32_VALUELINE
                          +
                          +config STM32_CRC
                          +	bool "CRC"
                          +	default n
                          +
                           config STM32_CRYP
                           	bool "CRYP"
                           	default n
                           	depends on STM32_STM32F20XX || STM32_STM32F40XX
                           
                          +config STM32_DMA1
                          +	bool "DMA1"
                          +	default n
                          +	select ARCH_DMA
                          +
                          +config STM32_DMA2
                          +	bool "DMA2"
                          +	default n
                          +	select ARCH_DMA
                          +	depends on !STM32_VALUELINE || (STM32_VALUELINE && STM32_HIGHDENSITY)
                          +
                           config STM32_DAC1
                           	bool "DAC1"
                           	default n
                          @@ -274,7 +298,7 @@ config STM32_ETHMAC
                           config STM32_FSMC
                           	bool "FSMC"
                           	default n
                          -	depends on !STM32_CONNECTIVITYLINE
                          +	depends on !STM32_CONNECTIVITYLINE && (STM32_HIGHDENSITY || STM32_STM32F20XX || STM32_STM32F40XX)
                           
                           config STM32_HASH
                           	bool "HASH"
                          @@ -325,7 +349,7 @@ config STM32_RNG
                           config STM32_SDIO
                           	bool "SDIO"
                           	default n
                          -	depends on !STM32_CONNECTIVITYLINE
                          +	depends on !STM32_CONNECTIVITYLINE && !STM32_VALUELINE
                           
                           config STM32_SPI1
                           	bool "SPI1"
                          @@ -342,7 +366,7 @@ config STM32_SPI2
                           config STM32_SPI3
                           	bool "SPI3"
                           	default n
                          -	depends on STM32_CONNECTIVITYLINE || STM32_STM32F20XX || STM32_STM32F40XX
                          +	depends on STM32_CONNECTIVITYLINE || STM32_STM32F20XX || STM32_STM32F40XX || (STM32_VALUELINE && STM32_HIGHDENSITY)
                           	select SPI
                           	select STM32_SPI
                           
                          @@ -382,6 +406,7 @@ config STM32_TIM7
                           config STM32_TIM8
                           	bool "TIM8"
                           	default n
                          +	depends on !STM32_VALUELINE
                           
                           config STM32_TIM9
                           	bool "TIM9"
                          @@ -401,17 +426,32 @@ config STM32_TIM11
                           config STM32_TIM12
                           	bool "TIM12"
                           	default n
                          -	depends on STM32_STM32F20XX || STM32_STM32F40XX
                          +	depends on STM32_STM32F20XX || STM32_STM32F40XX || STM32_VALUELINE
                           
                           config STM32_TIM13
                           	bool "TIM13"
                           	default n
                          -	depends on STM32_STM32F20XX || STM32_STM32F40XX
                          +	depends on STM32_STM32F20XX || STM32_STM32F40XX || STM32_VALUELINE
                           
                           config STM32_TIM14
                           	bool "TIM14"
                           	default n
                          -	depends on STM32_STM32F20XX || STM32_STM32F40XX
                          +	depends on STM32_STM32F20XX || STM32_STM32F40XX || STM32_VALUELINE
                          +
                          +config STM32_TIM15
                          +	bool "TIM15"
                          +	default n
                          +	depends on STM32_VALUELINE
                          +
                          +config STM32_TIM16
                          +	bool "TIM16"
                          +	default n
                          +	depends on STM32_VALUELINE
                          +
                          +config STM32_TIM17
                          +	bool "TIM17"
                          +	default n
                          +	depends on STM32_VALUELINE
                           
                           config STM32_USART1
                           	bool "USART1"
                          @@ -447,7 +487,7 @@ config STM32_USART6
                           config STM32_USB
                           	bool "USB Device"
                           	default n
                          -	depends on STM32_STM32F10XX
                          +	depends on STM32_STM32F10XX && !STM32_VALUELINE
                           	select USBDEV
                           
                           config STM32_WWDG
                          @@ -474,6 +514,52 @@ config STM32_CAN
                           
                           menu "Alternate Pin Mapping"
                           
                          +choice
                          +	prompt "CAN1 Alternate Pin Mappings"
                          +	depends on STM32_STM32F10XX && STM32_CAN1
                          +	default STM32_CAN1_NO_REMAP
                          +
                          +config STM32_CAN1_NO_REMAP
                          +	bool "No pin remapping"
                          +
                          +config STM32_CAN1_REMAP1
                          +	bool "CAN1 alternate pin remapping #1"
                          +
                          +config STM32_CAN1_REMAP2
                          +	bool "CAN1 alternate pin remapping #2"
                          +
                          +endchoice
                          +
                          +config STM32_CAN2_REMAP
                          +	bool "CAN2 Alternate Pin Mapping"
                          +	default n
                          +	depends on STM32_CONNECTIVITYLINE && STM32_CAN2
                          +
                          +config STM32_CEC_REMAP
                          +	bool "CEC Alternate Pin Mapping"
                          +	default n
                          +	depends on STM32_STM32F10XX && STM32_CEC
                          +
                          +config STM32_ETH_REMAP
                          +	bool "Ethernet Alternate Pin Mapping"
                          +	default n
                          +	depends on STM32_CONNECTIVITYLINE && STM32_ETHMAC
                          +
                          +config STM32_I2C1_REMAP
                          +	bool "I2C1 Alternate Pin Mapping"
                          +	default n
                          +	depends on STM32_STM32F10XX && STM32_I2C1
                          +
                          +config STM32_SPI1_REMAP
                          +	bool "SPI1 Alternate Pin Mapping"
                          +	default n
                          +	depends on STM32_STM32F10XX && STM32_SPI1
                          +
                          +config STM32_SPI3_REMAP
                          +	bool "SPI3 Alternate Pin Mapping"
                          +	default n
                          +	depends on STM32_STM32F10XX && STM32_SPI3 && !STM32_VALUELINE
                          +
                           choice
                           	prompt "TIM1 Alternate Pin Mappings"
                           	depends on STM32_STM32F10XX && STM32_TIM1
                          @@ -530,6 +616,51 @@ config STM32_TIM4_REMAP
                           	default n
                           	depends on STM32_STM32F10XX && STM32_TIM4
                           
                          +config STM32_TIM9_REMAP
                          +	bool "TIM9 Alternate Pin Mapping"
                          +	default n
                          +	depends on STM32_STM32F10XX && STM32_TIM9
                          +
                          +config STM32_TIM10_REMAP
                          +	bool "TIM10 Alternate Pin Mapping"
                          +	default n
                          +	depends on STM32_STM32F10XX && STM32_TIM10
                          +
                          +config STM32_TIM11_REMAP
                          +	bool "TIM11 Alternate Pin Mapping"
                          +	default n
                          +	depends on STM32_STM32F10XX && STM32_TIM11
                          +
                          +config STM32_TIM12_REMAP
                          +	bool "TIM12 Alternate Pin Mapping"
                          +	default n
                          +	depends on STM32_STM32F10XX && STM32_TIM12
                          +
                          +config STM32_TIM13_REMAP
                          +	bool "TIM13 Alternate Pin Mapping"
                          +	default n
                          +	depends on STM32_STM32F10XX && STM32_TIM13
                          +
                          +config STM32_TIM14_REMAP
                          +	bool "TIM14 Alternate Pin Mapping"
                          +	default n
                          +	depends on STM32_STM32F10XX && STM32_TIM14
                          +
                          +config STM32_TIM15_REMAP
                          +	bool "TIM15 Alternate Pin Mapping"
                          +	default n
                          +	depends on STM32_STM32F10XX && STM32_TIM15
                          +
                          +config STM32_TIM16_REMAP
                          +	bool "TIM16 Alternate Pin Mapping"
                          +	default n
                          +	depends on STM32_STM32F10XX && STM32_TIM16
                          +
                          +config STM32_TIM17_REMAP
                          +	bool "TIM17 Alternate Pin Mapping"
                          +	default n
                          +	depends on STM32_STM32F10XX && STM32_TIM17
                          +
                           config STM32_USART1_REMAP
                           	bool "USART1 Alternate Pin Mapping"
                           	default n
                          @@ -556,47 +687,6 @@ config STM32_USART3_PARTIAL_REMAP
                           
                           endchoice
                           
                          -config STM32_SPI1_REMAP
                          -	bool "SPI1 Alternate Pin Mapping"
                          -	default n
                          -	depends on STM32_STM32F10XX && STM32_SPI1
                          -
                          -config STM32_SPI3_REMAP
                          -	bool "SPI3 Alternate Pin Mapping"
                          -	default n
                          -	depends on STM32_STM32F10XX && STM32_SPI3
                          -
                          -config STM32_I2C1_REMAP
                          -	bool "I2C1 Alternate Pin Mapping"
                          -	default n
                          -	depends on STM32_STM32F10XX && STM32_I2C1
                          -
                          -choice
                          -	prompt "CAN1 Alternate Pin Mappings"
                          -	depends on STM32_STM32F10XX && STM32_CAN1
                          -	default STM32_CAN1_NO_REMAP
                          -
                          -config STM32_CAN1_NO_REMAP
                          -	bool "No pin remapping"
                          -
                          -config STM32_CAN1_REMAP1
                          -	bool "CAN1 alternate pin remapping #1"
                          -
                          -config STM32_CAN1_REMAP2
                          -	bool "CAN1 alternate pin remapping #2"
                          -
                          -endchoice
                          -
                          -config STM32_CAN2_REMAP
                          -	bool "CAN2 Alternate Pin Mapping"
                          -	default n
                          -	depends on STM32_CONNECTIVITYLINE && STM32_CAN2
                          -
                          -config STM32_ETH_REMAP
                          -	bool "Ethernet Alternate Pin Mapping"
                          -	default n
                          -	depends on STM32_CONNECTIVITYLINE && STM32_ETHMAC
                          -
                           endmenu
                           
                           config STM32_FLASH_PREFETCH
                          @@ -645,9 +735,11 @@ config ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG
                           config STM32_CCMEXCLUDE
                           	bool "Exclude CCM SRAM from the heap"
                           	depends on STM32_STM32F20XX || STM32_STM32F40XX
                          -	default y if  ARCH_DMA
                          +	default y if  ARCH_DMA || ELF
                           	---help---
                          -		Exclude CCM SRAM from the HEAP because it cannot be used for DMA.
                          +		Exclude CCM SRAM from the HEAP because (1) it cannot be used for DMA
                          +		and (2) it appears to be impossible to execute ELF modules from CCM
                          +		RAM.
                           
                           config STM32_FSMC_SRAM
                           	bool "External SRAM on FSMC"
                          @@ -672,6 +764,7 @@ config STM32_TIM1_PWM
                           config STM32_TIM1_CHANNEL
                           	int "TIM1 PWM Output Channel"
                           	default 1
                          +	range 1 4
                           	depends on STM32_TIM1_PWM
                           	---help---
                           		If TIM1 is enabled for PWM usage, you also need specifies the timer output
                          @@ -682,7 +775,7 @@ config STM32_TIM2_PWM
                           	default n
                           	depends on STM32_TIM2
                           	---help---
                          -		Reserve timer 1 for use by PWM
                          +		Reserve timer 2 for use by PWM
                           
                           		Timer devices may be used for different purposes.  One special purpose is
                           		to generate modulated outputs for such things as motor control.  If STM32_TIM2
                          @@ -692,6 +785,7 @@ config STM32_TIM2_PWM
                           config STM32_TIM2_CHANNEL
                           	int "TIM2 PWM Output Channel"
                           	default 1
                          +	range 1 4
                           	depends on STM32_TIM2_PWM
                           	---help---
                           		If TIM2 is enabled for PWM usage, you also need specifies the timer output
                          @@ -702,7 +796,7 @@ config STM32_TIM3_PWM
                           	default n
                           	depends on STM32_TIM3
                           	---help---
                          -		Reserve timer 1 for use by PWM
                          +		Reserve timer 3 for use by PWM
                           
                           		Timer devices may be used for different purposes.  One special purpose is
                           		to generate modulated outputs for such things as motor control.  If STM32_TIM3
                          @@ -712,6 +806,7 @@ config STM32_TIM3_PWM
                           config STM32_TIM3_CHANNEL
                           	int "TIM3 PWM Output Channel"
                           	default 1
                          +	range 1 4
                           	depends on STM32_TIM3_PWM
                           	---help---
                           		If TIM3 is enabled for PWM usage, you also need specifies the timer output
                          @@ -722,7 +817,7 @@ config STM32_TIM4_PWM
                           	default n
                           	depends on STM32_TIM4
                           	---help---
                          -		Reserve timer 1 for use by PWM
                          +		Reserve timer 4 for use by PWM
                           
                           		Timer devices may be used for different purposes.  One special purpose is
                           		to generate modulated outputs for such things as motor control.  If STM32_TIM4
                          @@ -732,6 +827,7 @@ config STM32_TIM4_PWM
                           config STM32_TIM4_CHANNEL
                           	int "TIM4 PWM Output Channel"
                           	default 1
                          +	range 1 4
                           	depends on STM32_TIM4_PWM
                           	---help---
                           		If TIM4 is enabled for PWM usage, you also need specifies the timer output
                          @@ -742,7 +838,7 @@ config STM32_TIM5_PWM
                           	default n
                           	depends on STM32_TIM5
                           	---help---
                          -		Reserve timer 1 for use by PWM
                          +		Reserve timer 5 for use by PWM
                           
                           		Timer devices may be used for different purposes.  One special purpose is
                           		to generate modulated outputs for such things as motor control.  If STM32_TIM5
                          @@ -752,6 +848,7 @@ config STM32_TIM5_PWM
                           config STM32_TIM5_CHANNEL
                           	int "TIM5 PWM Output Channel"
                           	default 1
                          +	range 1 4
                           	depends on STM32_TIM5_PWM
                           	---help---
                           		If TIM5 is enabled for PWM usage, you also need specifies the timer output
                          @@ -762,7 +859,7 @@ config STM32_TIM8_PWM
                           	default n
                           	depends on STM32_TIM8
                           	---help---
                          -		Reserve timer 1 for use by PWM
                          +		Reserve timer 8 for use by PWM
                           
                           		Timer devices may be used for different purposes.  One special purpose is
                           		to generate modulated outputs for such things as motor control.  If STM32_TIM8
                          @@ -772,6 +869,7 @@ config STM32_TIM8_PWM
                           config STM32_TIM8_CHANNEL
                           	int "TIM8 PWM Output Channel"
                           	default 1
                          +	range 1 4
                           	depends on STM32_TIM8_PWM
                           	---help---
                           		If TIM8 is enabled for PWM usage, you also need specifies the timer output
                          @@ -782,7 +880,7 @@ config STM32_TIM9_PWM
                           	default n
                           	depends on STM32_TIM9
                           	---help---
                          -		Reserve timer 1 for use by PWM
                          +		Reserve timer 9 for use by PWM
                           
                           		Timer devices may be used for different purposes.  One special purpose is
                           		to generate modulated outputs for such things as motor control.  If STM32_TIM9
                          @@ -792,6 +890,7 @@ config STM32_TIM9_PWM
                           config STM32_TIM9_CHANNEL
                           	int "TIM9 PWM Output Channel"
                           	default 1
                          +	range 1 4
                           	depends on STM32_TIM9_PWM
                           	---help---
                           		If TIM9 is enabled for PWM usage, you also need specifies the timer output
                          @@ -802,7 +901,7 @@ config STM32_TIM10_PWM
                           	default n
                           	depends on STM32_TIM10
                           	---help---
                          -		Reserve timer 1 for use by PWM
                          +		Reserve timer 10 for use by PWM
                           
                           		Timer devices may be used for different purposes.  One special purpose is
                           		to generate modulated outputs for such things as motor control.  If STM32_TIM10
                          @@ -812,6 +911,7 @@ config STM32_TIM10_PWM
                           config STM32_TIM10_CHANNEL
                           	int "TIM10 PWM Output Channel"
                           	default 1
                          +	range 1 4
                           	depends on STM32_TIM10_PWM
                           	---help---
                           		If TIM10 is enabled for PWM usage, you also need specifies the timer output
                          @@ -822,7 +922,7 @@ config STM32_TIM11_PWM
                           	default n
                           	depends on STM32_TIM11
                           	---help---
                          -		Reserve timer 1 for use by PWM
                          +		Reserve timer 11 for use by PWM
                           
                           		Timer devices may be used for different purposes.  One special purpose is
                           		to generate modulated outputs for such things as motor control.  If STM32_TIM11
                          @@ -832,6 +932,7 @@ config STM32_TIM11_PWM
                           config STM32_TIM11_CHANNEL
                           	int "TIM11 PWM Output Channel"
                           	default 1
                          +	range 1 4
                           	depends on STM32_TIM11_PWM
                           	---help---
                           		If TIM11 is enabled for PWM usage, you also need specifies the timer output
                          @@ -842,7 +943,7 @@ config STM32_TIM12_PWM
                           	default n
                           	depends on STM32_TIM12
                           	---help---
                          -		Reserve timer 1 for use by PWM
                          +		Reserve timer 12 for use by PWM
                           
                           		Timer devices may be used for different purposes.  One special purpose is
                           		to generate modulated outputs for such things as motor control.  If STM32_TIM12
                          @@ -852,6 +953,7 @@ config STM32_TIM12_PWM
                           config STM32_TIM12_CHANNEL
                           	int "TIM12 PWM Output Channel"
                           	default 1
                          +	range 1 4
                           	depends on STM32_TIM12_PWM
                           	---help---
                           		If TIM12 is enabled for PWM usage, you also need specifies the timer output
                          @@ -862,7 +964,7 @@ config STM32_TIM13_PWM
                           	default n
                           	depends on STM32_TIM13
                           	---help---
                          -		Reserve timer 1 for use by PWM
                          +		Reserve timer 13 for use by PWM
                           
                           		Timer devices may be used for different purposes.  One special purpose is
                           		to generate modulated outputs for such things as motor control.  If STM32_TIM13
                          @@ -872,6 +974,7 @@ config STM32_TIM13_PWM
                           config STM32_TIM13_CHANNEL
                           	int "TIM13 PWM Output Channel"
                           	default 1
                          +	range 1 4
                           	depends on STM32_TIM13_PWM
                           	---help---
                           		If TIM13 is enabled for PWM usage, you also need specifies the timer output
                          @@ -882,7 +985,7 @@ config STM32_TIM14_PWM
                           	default n
                           	depends on STM32_TIM14
                           	---help---
                          -		Reserve timer 1 for use by PWM
                          +		Reserve timer 14 for use by PWM
                           
                           		Timer devices may be used for different purposes.  One special purpose is
                           		to generate modulated outputs for such things as motor control.  If STM32_TIM14
                          @@ -892,11 +995,75 @@ config STM32_TIM14_PWM
                           config STM32_TIM14_CHANNEL
                           	int "TIM14 PWM Output Channel"
                           	default 1
                          +	range 1 4
                           	depends on STM32_TIM14_PWM
                           	---help---
                           		If TIM14 is enabled for PWM usage, you also need specifies the timer output
                           		channel {1,..,4}
                           
                          +config STM32_TIM15_PWM
                          +	bool "TIM15 PWM"
                          +	default n
                          +	depends on STM32_TIM15
                          +	---help---
                          +		Reserve timer 15 for use by PWM
                          +
                          +		Timer devices may be used for different purposes.  One special purpose is
                          +		to generate modulated outputs for such things as motor control.  If STM32_TIM15
                          +		is defined then THIS following may also be defined to indicate that
                          +		the timer is intended to be used for pulsed output modulation.
                          +
                          +config STM32_TIM15_CHANNEL
                          +	int "TIM15 PWM Output Channel"
                          +	default 1
                          +	range 1 2
                          +	depends on STM32_TIM15_PWM
                          +	---help---
                          +		If TIM15 is enabled for PWM usage, you also need specifies the timer output
                          +		channel {1,2}
                          +
                          +config STM32_TIM16_PWM
                          +	bool "TIM16 PWM"
                          +	default n
                          +	depends on STM32_TIM16
                          +	---help---
                          +		Reserve timer 16 for use by PWM
                          +
                          +		Timer devices may be used for different purposes.  One special purpose is
                          +		to generate modulated outputs for such things as motor control.  If STM32_TIM16
                          +		is defined then THIS following may also be defined to indicate that
                          +		the timer is intended to be used for pulsed output modulation.
                          +
                          +config STM32_TIM16_CHANNEL
                          +	int "TIM16 PWM Output Channel"
                          +	default 1
                          +	range 1 1
                          +	depends on STM32_TIM16_PWM
                          +	---help---
                          +		If TIM16 is enabled for PWM usage, you also need specifies the timer output
                          +		channel {1}
                          +
                          +config STM32_TIM17_PWM
                          +	bool "TIM17 PWM"
                          +	default n
                          +	depends on STM32_TIM17
                          +	---help---
                          +		Reserve timer 17 for use by PWM
                          +
                          +		Timer devices may be used for different purposes.  One special purpose is
                          +		to generate modulated outputs for such things as motor control.  If STM32_TIM17
                          +		is defined then THIS following may also be defined to indicate that
                          +		the timer is intended to be used for pulsed output modulation.
                          +
                          +config STM32_TIM17_CHANNEL
                          +	int "TIM17 PWM Output Channel"
                          +	default 1
                          +	range 1 1
                          +	depends on STM32_TIM17_PWM
                          +	---help---
                          +		If TIM17 is enabled for PWM usage, you also need specifies the timer output
                          +		channel {1}
                          +
                           config STM32_TIM1_ADC
                           	bool "TIM1 ADC"
                           	default n
                          @@ -918,16 +1085,22 @@ choice
                           
                           config STM32_TIM1_ADC1
                           	bool "TIM1 ADC channel 1"
                          +	depends on STM32_ADC1
                          +	select HAVE_ADC1_TIMER
                           	---help---
                           		Reserve TIM1 to trigger ADC1
                           
                           config STM32_TIM1_ADC2
                           	bool "TIM1 ADC channel 2"
                          +	depends on STM32_ADC2
                          +	select HAVE_ADC2_TIMER
                           	---help---
                           		Reserve TIM1 to trigger ADC2
                           
                           config STM32_TIM1_ADC3
                           	bool "TIM1 ADC channel 3"
                          +	depends on STM32_ADC3
                          +	select HAVE_ADC3_TIMER
                           	---help---
                           		Reserve TIM1 to trigger ADC3
                           
                          @@ -954,16 +1127,22 @@ choice
                           
                           config STM32_TIM2_ADC1
                           	bool "TIM2 ADC channel 1"
                          +	depends on STM32_ADC1
                          +	select HAVE_ADC1_TIMER
                           	---help---
                           		Reserve TIM2 to trigger ADC1
                           
                           config STM32_TIM2_ADC2
                           	bool "TIM2 ADC channel 2"
                          +	depends on STM32_ADC2
                          +	select HAVE_ADC2_TIMER
                           	---help---
                           		Reserve TIM2 to trigger ADC2
                           
                           config STM32_TIM2_ADC3
                           	bool "TIM2 ADC channel 3"
                          +	depends on STM32_ADC3
                          +	select HAVE_ADC3_TIMER
                           	---help---
                           		Reserve TIM2 to trigger ADC3
                           
                          @@ -990,16 +1169,22 @@ choice
                           
                           config STM32_TIM3_ADC1
                           	bool "TIM3 ADC channel 1"
                          +	depends on STM32_ADC1
                          +	select HAVE_ADC1_TIMER
                           	---help---
                           		Reserve TIM3 to trigger ADC1
                           
                           config STM32_TIM3_ADC2
                           	bool "TIM3 ADC channel 2"
                          +	depends on STM32_ADC2
                          +	select HAVE_ADC2_TIMER
                           	---help---
                           		Reserve TIM3 to trigger ADC2
                           
                           config STM32_TIM3_ADC3
                           	bool "TIM3 ADC channel 3"
                          +	depends on STM32_ADC3
                          +	select HAVE_ADC3_TIMER
                           	---help---
                           		Reserve TIM3 to trigger ADC3
                           
                          @@ -1026,16 +1211,22 @@ choice
                           
                           config STM32_TIM4_ADC1
                           	bool "TIM4 ADC channel 1"
                          +	depends on STM32_ADC1
                          +	select HAVE_ADC1_TIMER
                           	---help---
                           		Reserve TIM4 to trigger ADC1
                           
                           config STM32_TIM4_ADC2
                           	bool "TIM4 ADC channel 2"
                          +	depends on STM32_ADC2
                          +	select HAVE_ADC2_TIMER
                           	---help---
                           		Reserve TIM4 to trigger ADC2
                           
                           config STM32_TIM4_ADC3
                           	bool "TIM4 ADC channel 3"
                          +	depends on STM32_ADC3
                          +	select HAVE_ADC3_TIMER
                           	---help---
                           		Reserve TIM4 to trigger ADC3
                           
                          @@ -1062,16 +1253,22 @@ choice
                           
                           config STM32_TIM5_ADC1
                           	bool "TIM5 ADC channel 1"
                          +	depends on STM32_ADC1
                          +	select HAVE_ADC1_TIMER
                           	---help---
                           		Reserve TIM5 to trigger ADC1
                           
                           config STM32_TIM5_ADC2
                           	bool "TIM5 ADC channel 2"
                          +	depends on STM32_ADC2
                          +	select HAVE_ADC2_TIMER
                           	---help---
                           		Reserve TIM5 to trigger ADC2
                           
                           config STM32_TIM5_ADC3
                           	bool "TIM5 ADC channel 3"
                          +	depends on STM32_ADC3
                          +	select HAVE_ADC3_TIMER
                           	---help---
                           		Reserve TIM5 to trigger ADC3
                           
                          @@ -1098,21 +1295,81 @@ choice
                           
                           config STM32_TIM8_ADC1
                           	bool "TIM8 ADC channel 1"
                          +	depends on STM32_ADC1
                          +	select HAVE_ADC1_TIMER
                           	---help---
                           		Reserve TIM8 to trigger ADC1
                           
                           config STM32_TIM8_ADC2
                           	bool "TIM8 ADC channel 2"
                          +	depends on STM32_ADC2
                          +	select HAVE_ADC2_TIMER
                           	---help---
                           		Reserve TIM8 to trigger ADC2
                           
                           config STM32_TIM8_ADC3
                           	bool "TIM8 ADC channel 3"
                          +	depends on STM32_ADC3
                          +	select HAVE_ADC3_TIMER
                           	---help---
                           		Reserve TIM8 to trigger ADC3
                           
                           endchoice
                           
                          +config HAVE_ADC1_TIMER
                          +	bool
                          +
                          +config HAVE_ADC2_TIMER
                          +	bool
                          +
                          +config HAVE_ADC3_TIMER
                          +	bool
                          +
                          +config STM32_ADC1_SAMPLE_FREQUENCY
                          +	int "ADC1 Sampling Frequency"
                          +	default 100
                          +	depends on HAVE_ADC1_TIMER
                          +	---help---
                          +		ADC1 sampling frequency.  Default:  100Hz
                          +
                          +config STM32_ADC1_TIMTRIG
                          +	int "ADC1 Timer Trigger"
                          +	default 0
                          +	range 0 4
                          +	depends on HAVE_ADC1_TIMER
                          +	---help---
                          +		Values 0:CC1 1:CC2 2:CC3 3:CC4 4:TRGO
                          +
                          +config STM32_ADC2_SAMPLE_FREQUENCY
                          +	int "ADC2 Sampling Frequency"
                          +	default 100
                          +	depends on HAVE_ADC2_TIMER
                          +	---help---
                          +		ADC2 sampling frequency.  Default:  100Hz
                          +
                          +config STM32_ADC2_TIMTRIG
                          +	int "ADC2 Timer Trigger"
                          +	default 0
                          +	range 0 4
                          +	depends on HAVE_ADC2_TIMER
                          +	---help---
                          +		Values 0:CC1 1:CC2 2:CC3 3:CC4 4:TRGO
                          +
                          +config STM32_ADC3_SAMPLE_FREQUENCY
                          +	int "ADC3 Sampling Frequency"
                          +	default 100
                          +	depends on HAVE_ADC3_TIMER
                          +	---help---
                          +		ADC3 sampling frequency.  Default:  100Hz
                          +
                          +config STM32_ADC3_TIMTRIG
                          +	int "ADC3 Timer Trigger"
                          +	default 0
                          +	range 0 4
                          +	depends on HAVE_ADC3_TIMER
                          +	---help---
                          +		Values 0:CC1 1:CC2 2:CC3 3:CC4 4:TRGO
                          +
                           config STM32_TIM1_DAC
                           	bool "TIM1 DAC"
                           	default n
                          @@ -1149,7 +1406,7 @@ config STM32_TIM2_DAC
                           	default n
                           	depends on STM32_TIM2 && STM32_DAC
                           	---help---
                          -		Reserve timer 1 for use by DAC
                          +		Reserve timer 2 for use by DAC
                           
                           		Timer devices may be used for different purposes.  If STM32_TIM2 is
                           		defined then the following may also be defined to indicate that the
                          @@ -1180,7 +1437,7 @@ config STM32_TIM3_DAC
                           	default n
                           	depends on STM32_TIM3 && STM32_DAC
                           	---help---
                          -		Reserve timer 1 for use by DAC
                          +		Reserve timer 3 for use by DAC
                           
                           		Timer devices may be used for different purposes.  If STM32_TIM3 is
                           		defined then the following may also be defined to indicate that the
                          @@ -1211,7 +1468,7 @@ config STM32_TIM4_DAC
                           	default n
                           	depends on STM32_TIM4 && STM32_DAC
                           	---help---
                          -		Reserve timer 1 for use by DAC
                          +		Reserve timer 4 for use by DAC
                           
                           		Timer devices may be used for different purposes.  If STM32_TIM4 is
                           		defined then the following may also be defined to indicate that the
                          @@ -1242,7 +1499,7 @@ config STM32_TIM5_DAC
                           	default n
                           	depends on STM32_TIM5 && STM32_DAC
                           	---help---
                          -		Reserve timer 1 for use by DAC
                          +		Reserve timer 5 for use by DAC
                           
                           		Timer devices may be used for different purposes.  If STM32_TIM5 is
                           		defined then the following may also be defined to indicate that the
                          @@ -1273,7 +1530,7 @@ config STM32_TIM6_DAC
                           	default n
                           	depends on STM32_TIM6 && STM32_DAC
                           	---help---
                          -		Reserve timer 1 for use by DAC
                          +		Reserve timer 6 for use by DAC
                           
                           		Timer devices may be used for different purposes.  If STM32_TIM6 is
                           		defined then the following may also be defined to indicate that the
                          @@ -1304,7 +1561,7 @@ config STM32_TIM7_DAC
                           	default n
                           	depends on STM32_TIM7 && STM32_DAC
                           	---help---
                          -		Reserve timer 1 for use by DAC
                          +		Reserve timer 7 for use by DAC
                           
                           		Timer devices may be used for different purposes.  If STM32_TIM7 is
                           		defined then the following may also be defined to indicate that the
                          @@ -1335,7 +1592,7 @@ config STM32_TIM8_DAC
                           	default n
                           	depends on STM32_TIM8 && STM32_DAC
                           	---help---
                          -		Reserve timer 1 for use by DAC
                          +		Reserve timer 8 for use by DAC
                           
                           		Timer devices may be used for different purposes.  If STM32_TIM8 is
                           		defined then the following may also be defined to indicate that the
                          @@ -1366,7 +1623,7 @@ config STM32_TIM9_DAC
                           	default n
                           	depends on STM32_TIM9 && STM32_DAC
                           	---help---
                          -		Reserve timer 1 for use by DAC
                          +		Reserve timer 9 for use by DAC
                           
                           		Timer devices may be used for different purposes.  If STM32_TIM9 is
                           		defined then the following may also be defined to indicate that the
                          @@ -1397,7 +1654,7 @@ config STM32_TIM10_DAC
                           	default n
                           	depends on STM32_TIM10 && STM32_DAC
                           	---help---
                          -		Reserve timer 1 for use by DAC
                          +		Reserve timer 10 for use by DAC
                           
                           		Timer devices may be used for different purposes.  If STM32_TIM10 is
                           		defined then the following may also be defined to indicate that the
                          @@ -1428,7 +1685,7 @@ config STM32_TIM11_DAC
                           	default n
                           	depends on STM32_TIM11 && STM32_DAC
                           	---help---
                          -		Reserve timer 1 for use by DAC
                          +		Reserve timer 11 for use by DAC
                           
                           		Timer devices may be used for different purposes.  If STM32_TIM11 is
                           		defined then the following may also be defined to indicate that the
                          @@ -1459,7 +1716,7 @@ config STM32_TIM12_DAC
                           	default n
                           	depends on STM32_TIM12 && STM32_DAC
                           	---help---
                          -		Reserve timer 1 for use by DAC
                          +		Reserve timer 12 for use by DAC
                           
                           		Timer devices may be used for different purposes.  If STM32_TIM12 is
                           		defined then the following may also be defined to indicate that the
                          @@ -1490,7 +1747,7 @@ config STM32_TIM13_DAC
                           	default n
                           	depends on STM32_TIM13 && STM32_DAC
                           	---help---
                          -		Reserve timer 1 for use by DAC
                          +		Reserve timer 13 for use by DAC
                           
                           		Timer devices may be used for different purposes.  If STM32_TIM13 is
                           		defined then the following may also be defined to indicate that the
                          @@ -1521,7 +1778,7 @@ config STM32_TIM14_DAC
                           	default n
                           	depends on STM32_TIM14 && STM32_DAC
                           	---help---
                          -		Reserve timer 1 for use by DAC
                          +		Reserve timer 14 for use by DAC
                           
                           		Timer devices may be used for different purposes.  If STM32_TIM14 is
                           		defined then the following may also be defined to indicate that the
                          @@ -1547,6 +1804,27 @@ config STM32_TIM14_DAC2
                           
                           endchoice
                           
                          +menu "U[S]ART Configuration"
                          +	depends on STM32_USART1 || STM32_USART2 || STM32_USART3 || STM32_USART4 || STM32_USART5 || STM32_USART6
                          +
                          +config USART1_RS485
                          +	bool "RS-485 on USART1"
                          +	default n
                          +	depends on STM32_USART1
                          +	---help---
                          +		Enable RS-485 interface on USART1. Your board config will have to
                          +		provide GPIO_USART1_RS485_DIR pin definition. Currently it cannot be
                          +		used with USART1_RXDMA.
                          +
                          +config USART1_RS485_DIR_POLARITY
                          +	int "USART1 RS-485 DIR pin polarity"
                          +	default 1
                          +	range 0 1
                          +	depends on USART1_RS485
                          +	---help---
                          +		Polarity of DIR pin for RS-485 on USART1. Set to state on DIR pin which
                          +		enables TX (0 - low / nTXEN, 1 - high / TXEN).		
                          +
                           config USART1_RXDMA
                           	bool "USART1 Rx DMA"
                           	default n
                          @@ -1554,6 +1832,24 @@ config USART1_RXDMA
                           	---help---
                           		In high data rate usage, Rx DMA may eliminate Rx overrun errors
                           
                          +config USART2_RS485
                          +	bool "RS-485 on USART2"
                          +	default n
                          +	depends on STM32_USART2
                          +	---help---
                          +		Enable RS-485 interface on USART2. Your board config will have to
                          +		provide GPIO_USART2_RS485_DIR pin definition. Currently it cannot be
                          +		used with USART2_RXDMA.
                          +
                          +config USART2_RS485_DIR_POLARITY
                          +	int "USART2 RS-485 DIR pin polarity"
                          +	default 1
                          +	range 0 1
                          +	depends on USART2_RS485
                          +	---help---
                          +		Polarity of DIR pin for RS-485 on USART2. Set to state on DIR pin which
                          +		enables TX (0 - low / nTXEN, 1 - high / TXEN).
                          +
                           config USART2_RXDMA
                           	bool "USART2 Rx DMA"
                           	default n
                          @@ -1561,6 +1857,24 @@ config USART2_RXDMA
                           	---help---
                           		In high data rate usage, Rx DMA may eliminate Rx overrun errors
                           
                          +config USART3_RS485
                          +	bool "RS-485 on USART3"
                          +	default n
                          +	depends on STM32_USART3
                          +	---help---
                          +		Enable RS-485 interface on USART3. Your board config will have to
                          +		provide GPIO_USART3_RS485_DIR pin definition. Currently it cannot be
                          +		used with USART3_RXDMA.
                          +
                          +config USART3_RS485_DIR_POLARITY
                          +	int "USART3 RS-485 DIR pin polarity"
                          +	default 1
                          +	range 0 1
                          +	depends on USART3_RS485
                          +	---help---
                          +		Polarity of DIR pin for RS-485 on USART3. Set to state on DIR pin which
                          +		enables TX (0 - low / nTXEN, 1 - high / TXEN).
                          +
                           config USART3_RXDMA
                           	bool "USART3 Rx DMA"
                           	default n
                          @@ -1568,6 +1882,24 @@ config USART3_RXDMA
                           	---help---
                           		In high data rate usage, Rx DMA may eliminate Rx overrun errors
                           
                          +config UART4_RS485
                          +	bool "RS-485 on UART4"
                          +	default n
                          +	depends on STM32_UART4
                          +	---help---
                          +		Enable RS-485 interface on UART4. Your board config will have to
                          +		provide GPIO_UART4_RS485_DIR pin definition. Currently it cannot be
                          +		used with UART4_RXDMA.
                          +
                          +config UART4_RS485_DIR_POLARITY
                          +	int "UART4 RS-485 DIR pin polarity"
                          +	default 1
                          +	range 0 1
                          +	depends on UART4_RS485
                          +	---help---
                          +		Polarity of DIR pin for RS-485 on UART4. Set to state on DIR pin which
                          +		enables TX (0 - low / nTXEN, 1 - high / TXEN).
                          +
                           config UART4_RXDMA
                           	bool "UART4 Rx DMA"
                           	default n
                          @@ -1575,6 +1907,24 @@ config UART4_RXDMA
                           	---help---
                           		In high data rate usage, Rx DMA may eliminate Rx overrun errors
                           
                          +config UART5_RS485
                          +	bool "RS-485 on UART5"
                          +	default n
                          +	depends on STM32_UART5
                          +	---help---
                          +		Enable RS-485 interface on UART5. Your board config will have to
                          +		provide GPIO_UART5_RS485_DIR pin definition. Currently it cannot be
                          +		used with UART5_RXDMA.
                          +
                          +config UART5_RS485_DIR_POLARITY
                          +	int "UART5 RS-485 DIR pin polarity"
                          +	default 1
                          +	range 0 1
                          +	depends on UART5_RS485
                          +	---help---
                          +		Polarity of DIR pin for RS-485 on UART5. Set to state on DIR pin which
                          +		enables TX (0 - low / nTXEN, 1 - high / TXEN).
                          +
                           config UART5_RXDMA
                           	bool "UART5 Rx DMA"
                           	default n
                          @@ -1582,6 +1932,24 @@ config UART5_RXDMA
                           	---help---
                           		In high data rate usage, Rx DMA may eliminate Rx overrun errors
                           
                          +config USART6_RS485
                          +	bool "RS-485 on USART6"
                          +	default n
                          +	depends on STM32_USART6
                          +	---help---
                          +		Enable RS-485 interface on USART6. Your board config will have to
                          +		provide GPIO_USART6_RS485_DIR pin definition. Currently it cannot be
                          +		used with USART6_RXDMA.
                          +
                          +config USART6_RS485_DIR_POLARITY
                          +	int "USART6 RS-485 DIR pin polarity"
                          +	default 1
                          +	range 0 1
                          +	depends on USART6_RS485
                          +	---help---
                          +		Polarity of DIR pin for RS-485 on USART6. Set to state on DIR pin which
                          +		enables TX (0 - low / nTXEN, 1 - high / TXEN).
                          +
                           config USART6_RXDMA
                           	bool "USART6 Rx DMA"
                           	default n
                          @@ -1598,6 +1966,8 @@ config SERIAL_TERMIOS
                           		If this is not defined, then the terminal settings (baud, parity, etc).
                           		are not configurable at runtime; serial streams cannot be flushed, etc..
                           
                          +endmenu
                          +
                           menu "SPI Configuration"
                           	depends on STM32_SPI
                           
                          @@ -1697,6 +2067,16 @@ config STM32_PHYADDR
                           	---help---
                           		The 5-bit address of the PHY on the board.  Default: 1
                           
                          +config STM32_PHYINIT
                          +	bool "Board-specific PHY Initialization"
                          +	default n
                          +	---help---
                          +		Some boards require specialized initialization of the PHY before it can be used.
                          +		This may include such things as configuring GPIOs, resetting the PHY, etc.  If
                          +		STM32_PHYINIT is defined in the configuration then the board specific logic must
                          +		provide stm32_phyinitialize();  The STM32 Ethernet driver will call this function
                          +		one time before it first uses the PHY.
                          +
                           config STM32_MII
                           	bool "Use MII interface"
                           	default n
                          @@ -1908,14 +2288,14 @@ config STM32_OTGFS_NPTXFIFO_SIZE
                           	depends on USBHOST && STM32_OTGFS
                           	---help---
                           		Size of the non-periodic Tx FIFO in 32-bit words.  Default 96 (384 bytes)
                          - 
                          +
                           config STM32_OTGFS_PTXFIFO_SIZE
                           	int "Periodic Tx FIFO size"
                           	default 128
                           	depends on USBHOST && STM32_OTGFS
                           	---help---
                           		Size of the periodic Tx FIFO in 32-bit words.  Default 96 (384 bytes)
                          - 
                          +
                           config STM32_OTGFS_DESCSIZE
                           	int "Descriptor Size"
                           	default 128
                          @@ -1929,14 +2309,14 @@ config STM32_OTGFS_SOFINTR
                           	depends on USBHOST && STM32_OTGFS
                           	---help---
                           		Enable SOF interrupts.  Why would you ever want to do that?
                          - 
                          +
                           config STM32_USBHOST_REGDEBUG
                           	bool "Register-Level Debug"
                           	default n
                           	depends on USBHOST && STM32_OTGFS
                           	---help---
                           		Enable very low-level register access debug.  Depends on DEBUG.
                          - 
                          +
                           config STM32_USBHOST_PKTDUMP
                           	bool "Packet Dump Debug"
                           	default n
                          diff --git a/nuttx/arch/arm/src/stm32/chip/stm32_eth.h b/nuttx/arch/arm/src/stm32/chip/stm32_eth.h
                          index a4a109d016..92a229cccd 100644
                          --- a/nuttx/arch/arm/src/stm32/chip/stm32_eth.h
                          +++ b/nuttx/arch/arm/src/stm32/chip/stm32_eth.h
                          @@ -835,14 +835,6 @@ struct eth_rxdesc_s
                            * Public Functions
                            ****************************************************************************************************/
                           
                          -#undef EXTERN
                          -#if defined(__cplusplus)
                          -#define EXTERN extern "C"
                          -extern "C" {
                          -#else
                          -#define EXTERN extern
                          -#endif
                          -
                           #endif /* __ASSEMBLY__ */
                           #endif /* STM32_NETHERNET > 0 */
                           #endif /* __ARCH_ARM_SRC_STM32_CHIP_STM32_ETH_H */
                          diff --git a/nuttx/arch/arm/src/stm32/chip/stm32f100_pinmap.h b/nuttx/arch/arm/src/stm32/chip/stm32f100_pinmap.h
                          index 01d6e1ce06..addef02656 100644
                          --- a/nuttx/arch/arm/src/stm32/chip/stm32f100_pinmap.h
                          +++ b/nuttx/arch/arm/src/stm32/chip/stm32f100_pinmap.h
                          @@ -6,6 +6,8 @@
                            *   Copyright (C) 2012 Michael Smith. All Rights reserved.
                            *   Author: Gregory Nutt 
                            *           Uros Platise 
                          + *           Michael Smith
                          + *           Freddie Chopin 
                            *
                            * Redistribution and use in source and binary forms, with or without
                            * modification, are permitted provided that the following conditions
                          @@ -49,6 +51,87 @@
                            * Pre-processor Definitions
                            ************************************************************************************/
                           
                          +/* Alternate Pin Functions: */
                          +
                          +/* ADC */
                          +
                          +#define GPIO_ADC1_IN0       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN0)
                          +#define GPIO_ADC1_IN1       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN1)
                          +#define GPIO_ADC1_IN2       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN2)
                          +#define GPIO_ADC1_IN3       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN3)
                          +#define GPIO_ADC1_IN4       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4)
                          +#define GPIO_ADC1_IN5       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5)
                          +#define GPIO_ADC1_IN6       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN6)
                          +#define GPIO_ADC1_IN7       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN7)
                          +#define GPIO_ADC1_IN8       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN0)
                          +#define GPIO_ADC1_IN9       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN1)
                          +#define GPIO_ADC1_IN10      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN0)
                          +#define GPIO_ADC1_IN11      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN1)
                          +#define GPIO_ADC1_IN12      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN2)
                          +#define GPIO_ADC1_IN13      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN3)
                          +#define GPIO_ADC1_IN14      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN4)
                          +#define GPIO_ADC1_IN15      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN5)
                          +
                          +/* CEC */
                          +#if defined(CONFIG_STM32_CEC_REMAP)
                          +#  define GPIO_CEC          (GPIO_ALT|GPIO_CNF_AFOD|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN10)
                          +#else
                          +#  define GPIO_CEC          (GPIO_ALT|GPIO_CNF_AFOD|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN8)
                          +#endif
                          +
                          +/* DAC
                          + * Note from RM0041, 11.2: "Once the DAC channelx is enabled, the corresponding
                          + * GPIO pin (PA4 or PA5) is automatically connected to the analog converter
                          + * output (DAC_OUTx). In order to avoid parasitic consumption, the PA4 or PA5
                          + * pin should first be configured to analog (AIN)."
                          + */
                          +
                          +#define GPIO_DAC_OUT1       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4)
                          +#define GPIO_DAC_OUT2       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5)
                          +
                          +/* FSMC */
                          +
                          +/* TODO - VL devices in 100- and 144-pin packages have FSMC */
                          +
                          +/* I2C */
                          +
                          +#if defined(CONFIG_STM32_I2C1_REMAP)
                          +#  define GPIO_I2C1_SCL     (GPIO_ALT|GPIO_CNF_AFOD|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN8)
                          +#  define GPIO_I2C1_SDA     (GPIO_ALT|GPIO_CNF_AFOD|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN9)
                          +#else
                          +#  define GPIO_I2C1_SCL     (GPIO_ALT|GPIO_CNF_AFOD|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN6)
                          +#  define GPIO_I2C1_SDA     (GPIO_ALT|GPIO_CNF_AFOD|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN7)
                          +#endif
                          +#define GPIO_I2C1_SMBA      (GPIO_ALT|GPIO_CNF_INFLOAT|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN5)
                          +
                          +#define GPIO_I2C2_SCL       (GPIO_ALT|GPIO_CNF_AFOD|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN10)
                          +#define GPIO_I2C2_SDA       (GPIO_ALT|GPIO_CNF_AFOD|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN11)
                          +#define GPIO_I2C2_SMBA      (GPIO_ALT|GPIO_CNF_INFLOAT|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN12)
                          +
                          +/* SPI */
                          +
                          +#if defined(CONFIG_STM32_SPI1_REMAP)
                          +#  define GPIO_SPI1_NSS     (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN15)
                          +#  define GPIO_SPI1_SCK     (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN3)
                          +#  define GPIO_SPI1_MISO    (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN4)
                          +#  define GPIO_SPI1_MOSI    (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN5)
                          +#else
                          +#  define GPIO_SPI1_NSS     (GPIO_INPUT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN4)
                          +#  define GPIO_SPI1_SCK     (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN5)
                          +#  define GPIO_SPI1_MISO    (GPIO_INPUT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN6)
                          +#  define GPIO_SPI1_MOSI    (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN7)
                          +#endif
                          +
                          +#define GPIO_SPI2_NSS       (GPIO_INPUT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN12)
                          +#define GPIO_SPI2_SCK       (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN13)
                          +#define GPIO_SPI2_MISO      (GPIO_INPUT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN14)
                          +#define GPIO_SPI2_MOSI      (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN15)
                          +
                          +#define GPIO_SPI3_NSS       (GPIO_INPUT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN15)
                          +#define GPIO_SPI3_SCK       (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN3)
                          +#define GPIO_SPI3_MISO      (GPIO_INPUT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN4)
                          +#define GPIO_SPI3_MOSI      (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN5)
                          +
                           /* TIMERS */
                           
                           #if defined(CONFIG_STM32_TIM1_FULL_REMAP)
                          @@ -186,6 +269,77 @@
                           #  define GPIO_TIM4_CH4OUT  (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN9)
                           #endif
                           
                          +#define GPIO_TIM5_CH1IN     (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN0)
                          +#define GPIO_TIM5_CH1OUT    (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN0)
                          +#define GPIO_TIM5_CH2IN     (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN1)
                          +#define GPIO_TIM5_CH2OUT    (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN1)
                          +#define GPIO_TIM5_CH3IN     (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN2)
                          +#define GPIO_TIM5_CH3OUT    (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN2)
                          +#define GPIO_TIM5_CH4IN     (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN3)
                          +#define GPIO_TIM5_CH4OUT    (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN3)
                          +
                          +#if defined(CONFIG_STM32_TIM12_REMAP)
                          +#  define GPIO_TIM12_CH1IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN12)
                          +#  define GPIO_TIM12_CH1OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN12)
                          +#  define GPIO_TIM12_CH2IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN13)
                          +#  define GPIO_TIM12_CH2OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN13)
                          +#else
                          +#  define GPIO_TIM12_CH1IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN4)
                          +#  define GPIO_TIM12_CH1OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTC|GPIO_PIN4)
                          +#  define GPIO_TIM12_CH2IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN5)
                          +#  define GPIO_TIM12_CH2OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTC|GPIO_PIN5)
                          +#endif
                          +
                          +#if defined(CONFIG_STM32_TIM13_REMAP)
                          +#  define GPIO_TIM13_CH1IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN0)
                          +#  define GPIO_TIM13_CH1OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN0)
                          +#else
                          +#  define GPIO_TIM13_CH1IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN8)
                          +#  define GPIO_TIM13_CH1OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTC|GPIO_PIN8)
                          +#endif
                          +
                          +#if defined(CONFIG_STM32_TIM14_REMAP)
                          +#  define GPIO_TIM14_CH1IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN1)
                          +#  define GPIO_TIM14_CH1OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN1)
                          +#else
                          +#  define GPIO_TIM14_CH1IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN9)
                          +#  define GPIO_TIM14_CH1OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTC|GPIO_PIN9)
                          +#endif
                          +
                          +#if defined(CONFIG_STM32_TIM15_REMAP)
                          +#  define GPIO_TIM15_CH1IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN14)
                          +#  define GPIO_TIM15_CH1OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN14)
                          +#  define GPIO_TIM15_CH2IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN15)
                          +#  define GPIO_TIM15_CH2OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN15)
                          +#else
                          +#  define GPIO_TIM15_CH1IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN2)
                          +#  define GPIO_TIM15_CH1OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN2)
                          +#  define GPIO_TIM15_CH2IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN3)
                          +#  define GPIO_TIM15_CH2OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN3)
                          +#endif
                          +#define GPIO_TIM15_BKIN     (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN9)
                          +#define GPIO_TIM15_CH1N     (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN15)
                          +
                          +#if defined(CONFIG_STM32_TIM16_REMAP)
                          +#  define GPIO_TIM16_CH1IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN6)
                          +#  define GPIO_TIM16_CH1OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN6)
                          +#else
                          +#  define GPIO_TIM16_CH1IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN8)
                          +#  define GPIO_TIM16_CH1OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN8)
                          +#endif
                          +#define GPIO_TIM16_BKIN     (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN5)
                          +#define GPIO_TIM16_CH1N     (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN6)
                          +
                          +#if defined(CONFIG_STM32_TIM17_REMAP)
                          +#  define GPIO_TIM17_CH1IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN7)
                          +#  define GPIO_TIM17_CH1OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN7)
                          +#else
                          +#  define GPIO_TIM17_CH1IN  (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN9)
                          +#  define GPIO_TIM17_CH1OUT (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN9)
                          +#endif
                          +#define GPIO_TIM17_BKIN     (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN10)
                          +#define GPIO_TIM17_CH1N     (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN7)
                          +
                           /* USART */
                           
                           #if defined(CONFIG_STM32_USART1_REMAP)
                          @@ -230,38 +384,10 @@
                           #  define GPIO_USART3_RTS   (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN14)
                           #endif
                           
                          -/* SPI */
                          +#define GPIO_UART4_TX       (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTC|GPIO_PIN10)
                          +#define GPIO_UART4_RX       (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN11)
                           
                          -#if defined(CONFIG_STM32_SPI1_REMAP)
                          -#  define GPIO_SPI1_NSS     (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN15)
                          -#  define GPIO_SPI1_SCK     (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN3)
                          -#  define GPIO_SPI1_MISO    (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN4)
                          -#  define GPIO_SPI1_MOSI    (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN5)
                          -#else
                          -#  define GPIO_SPI1_NSS     (GPIO_INPUT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN4)
                          -#  define GPIO_SPI1_SCK     (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN5)
                          -#  define GPIO_SPI1_MISO    (GPIO_INPUT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN6)
                          -#  define GPIO_SPI1_MOSI    (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN7)
                          -#endif
                          -
                          -#define GPIO_SPI2_NSS       (GPIO_INPUT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN12)
                          -#define GPIO_SPI2_SCK       (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN13)
                          -#define GPIO_SPI2_MISO      (GPIO_INPUT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN14)
                          -#define GPIO_SPI2_MOSI      (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN15)
                          -
                          -/* I2C */
                          -
                          -#if defined(CONFIG_STM32_I2C1_REMAP)
                          -#  define GPIO_I2C1_SCL     (GPIO_ALT|GPIO_CNF_AFOD|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN8)
                          -#  define GPIO_I2C1_SDA     (GPIO_ALT|GPIO_CNF_AFOD|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN9)
                          -#else
                          -#  define GPIO_I2C1_SCL     (GPIO_ALT|GPIO_CNF_AFOD|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN6)
                          -#  define GPIO_I2C1_SDA     (GPIO_ALT|GPIO_CNF_AFOD|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN7)
                          -#endif
                          -#define GPIO_I2C1_SMBA    (GPIO_ALT|GPIO_CNF_INFLOAT|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN5)
                          -
                          -#define GPIO_I2C2_SCL     (GPIO_ALT|GPIO_CNF_AFOD|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN10)
                          -#define GPIO_I2C2_SDA     (GPIO_ALT|GPIO_CNF_AFOD|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN11)
                          -#define GPIO_I2C2_SMBA    (GPIO_ALT|GPIO_CNF_INFLOAT|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN12)
                          +#define GPIO_UART5_TX       (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTC|GPIO_PIN12)
                          +#define GPIO_UART5_RX       (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTD|GPIO_PIN2)
                           
                           #endif /* __ARCH_ARM_SRC_STM32_CHIP_STM32F100_PINMAP_H */
                          diff --git a/nuttx/arch/arm/src/stm32/chip/stm32f103vc_pinmap.h b/nuttx/arch/arm/src/stm32/chip/stm32f103vc_pinmap.h
                          index 1606768025..52a513215d 100644
                          --- a/nuttx/arch/arm/src/stm32/chip/stm32f103vc_pinmap.h
                          +++ b/nuttx/arch/arm/src/stm32/chip/stm32f103vc_pinmap.h
                          @@ -129,7 +129,7 @@
                           
                           
                           #if 0 /* Needs further investigation */
                          -#define GPIO_DAC_OUT1           (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUTz|GPIO_PORTA|GPIO_PIN4)
                          +#define GPIO_DAC_OUT1           (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4)
                           #define GPIO_DAC_OUT2           (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5)
                           #endif
                           
                          diff --git a/nuttx/arch/arm/src/stm32/chip/stm32f103ze_pinmap.h b/nuttx/arch/arm/src/stm32/chip/stm32f103ze_pinmap.h
                          index 9bcee49f57..581b026a09 100644
                          --- a/nuttx/arch/arm/src/stm32/chip/stm32f103ze_pinmap.h
                          +++ b/nuttx/arch/arm/src/stm32/chip/stm32f103ze_pinmap.h
                          @@ -50,53 +50,53 @@
                           
                           /* ADC */
                           
                          -#define GPIO_ADC1_IN0       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN0)
                          -#define GPIO_ADC1_IN1       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN1)
                          -#define GPIO_ADC1_IN2       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN2)
                          -#define GPIO_ADC1_IN3       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN3)
                          -#define GPIO_ADC1_IN4       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4)
                          -#define GPIO_ADC1_IN5       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5)
                          -#define GPIO_ADC1_IN6       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN6)
                          -#define GPIO_ADC1_IN7       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN7)
                          -#define GPIO_ADC1_IN8       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN0)
                          -#define GPIO_ADC1_IN9       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN1)
                          -#define GPIO_ADC1_IN10      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN0)
                          -#define GPIO_ADC1_IN11      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN1)
                          -#define GPIO_ADC1_IN12      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN2)
                          -#define GPIO_ADC1_IN13      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN3)
                          -#define GPIO_ADC1_IN14      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN4)
                          -#define GPIO_ADC1_IN15      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN5)
                          +#define GPIO_ADC1_IN0       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN0)
                          +#define GPIO_ADC1_IN1       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN1)
                          +#define GPIO_ADC1_IN2       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN2)
                          +#define GPIO_ADC1_IN3       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN3)
                          +#define GPIO_ADC1_IN4       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4)
                          +#define GPIO_ADC1_IN5       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5)
                          +#define GPIO_ADC1_IN6       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN6)
                          +#define GPIO_ADC1_IN7       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN7)
                          +#define GPIO_ADC1_IN8       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN0)
                          +#define GPIO_ADC1_IN9       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN1)
                          +#define GPIO_ADC1_IN10      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN0)
                          +#define GPIO_ADC1_IN11      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN1)
                          +#define GPIO_ADC1_IN12      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN2)
                          +#define GPIO_ADC1_IN13      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN3)
                          +#define GPIO_ADC1_IN14      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN4)
                          +#define GPIO_ADC1_IN15      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN5)
                           
                          -#define GPIO_ADC2_IN0       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN0)
                          -#define GPIO_ADC2_IN1       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN1)
                          -#define GPIO_ADC2_IN2       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN2)
                          -#define GPIO_ADC2_IN3       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN3)
                          -#define GPIO_ADC2_IN4       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4)
                          -#define GPIO_ADC2_IN5       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5)
                          -#define GPIO_ADC2_IN6       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN6)
                          -#define GPIO_ADC2_IN7       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN7)
                          -#define GPIO_ADC2_IN8       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN0)
                          -#define GPIO_ADC2_IN9       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN1)
                          -#define GPIO_ADC2_IN10      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN0)
                          -#define GPIO_ADC2_IN11      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN1)
                          -#define GPIO_ADC2_IN12      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN2)
                          -#define GPIO_ADC2_IN13      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN3)
                          -#define GPIO_ADC2_IN14      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN4)
                          -#define GPIO_ADC2_IN15      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN5)
                          +#define GPIO_ADC2_IN0       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN0)
                          +#define GPIO_ADC2_IN1       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN1)
                          +#define GPIO_ADC2_IN2       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN2)
                          +#define GPIO_ADC2_IN3       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN3)
                          +#define GPIO_ADC2_IN4       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4)
                          +#define GPIO_ADC2_IN5       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5)
                          +#define GPIO_ADC2_IN6       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN6)
                          +#define GPIO_ADC2_IN7       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN7)
                          +#define GPIO_ADC2_IN8       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN0)
                          +#define GPIO_ADC2_IN9       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN1)
                          +#define GPIO_ADC2_IN10      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN0)
                          +#define GPIO_ADC2_IN11      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN1)
                          +#define GPIO_ADC2_IN12      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN2)
                          +#define GPIO_ADC2_IN13      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN3)
                          +#define GPIO_ADC2_IN14      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN4)
                          +#define GPIO_ADC2_IN15      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN5)
                           
                          -#define GPIO_ADC3_IN0       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN0)
                          -#define GPIO_ADC3_IN1       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN1)
                          -#define GPIO_ADC3_IN2       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN2)
                          -#define GPIO_ADC3_IN3       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN3)
                          -#define GPIO_ADC3_IN4       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTF|GPIO_PIN6)
                          -#define GPIO_ADC3_IN5       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTF|GPIO_PIN7)
                          -#define GPIO_ADC3_IN6       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTF|GPIO_PIN8)
                          -#define GPIO_ADC3_IN7       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTF|GPIO_PIN9)
                          -#define GPIO_ADC3_IN8       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTF|GPIO_PIN10)
                          -#define GPIO_ADC3_IN10      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN0)
                          -#define GPIO_ADC3_IN11      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN1)
                          -#define GPIO_ADC3_IN12      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN2)
                          -#define GPIO_ADC3_IN13      (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN3)
                          +#define GPIO_ADC3_IN0       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN0)
                          +#define GPIO_ADC3_IN1       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN1)
                          +#define GPIO_ADC3_IN2       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN2)
                          +#define GPIO_ADC3_IN3       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN3)
                          +#define GPIO_ADC3_IN4       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTF|GPIO_PIN6)
                          +#define GPIO_ADC3_IN5       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTF|GPIO_PIN7)
                          +#define GPIO_ADC3_IN6       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTF|GPIO_PIN8)
                          +#define GPIO_ADC3_IN7       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTF|GPIO_PIN9)
                          +#define GPIO_ADC3_IN8       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTF|GPIO_PIN10)
                          +#define GPIO_ADC3_IN10      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN0)
                          +#define GPIO_ADC3_IN11      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN1)
                          +#define GPIO_ADC3_IN12      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN2)
                          +#define GPIO_ADC3_IN13      (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN3)
                           
                           /* DAC - "Once the DAC channelx is enabled, the corresponding GPIO pin
                            * (PA4 or PA5) is automatically connected to the analog converter output
                          @@ -104,8 +104,8 @@
                            * should first be configured to analog (AIN)."
                            */
                           
                          -#define GPIO_DAC_OUT1       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTF|GPIO_PIN10)
                          -#define GPIO_DAC_OUT2       (GPIO_ALT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PIN10)
                          +#define GPIO_DAC_OUT1       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4)
                          +#define GPIO_DAC_OUT2       (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5)
                           
                           /* TIMERS */
                           
                          diff --git a/nuttx/arch/arm/src/stm32/chip/stm32f105vb_pinmap.h b/nuttx/arch/arm/src/stm32/chip/stm32f105vb_pinmap.h
                          index 7a5ec3381e..054a7337db 100644
                          --- a/nuttx/arch/arm/src/stm32/chip/stm32f105vb_pinmap.h
                          +++ b/nuttx/arch/arm/src/stm32/chip/stm32f105vb_pinmap.h
                          @@ -85,7 +85,7 @@
                           #endif
                           
                           #if 0 /* Needs further investigation */
                          -#define GPIO_DAC_OUT1           (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUTz|GPIO_PORTA|GPIO_PIN4)
                          +#define GPIO_DAC_OUT1           (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4)
                           #define GPIO_DAC_OUT2           (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5)
                           #endif
                           
                          diff --git a/nuttx/arch/arm/src/stm32/chip/stm32f107vc_pinmap.h b/nuttx/arch/arm/src/stm32/chip/stm32f107vc_pinmap.h
                          index 9bbc214798..2419620fc4 100644
                          --- a/nuttx/arch/arm/src/stm32/chip/stm32f107vc_pinmap.h
                          +++ b/nuttx/arch/arm/src/stm32/chip/stm32f107vc_pinmap.h
                          @@ -85,7 +85,7 @@
                           #endif
                           
                           #if 0 /* Needs further investigation */
                          -#define GPIO_DAC_OUT1           (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUTz|GPIO_PORTA|GPIO_PIN4)
                          +#define GPIO_DAC_OUT1           (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4)
                           #define GPIO_DAC_OUT2           (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5)
                           #endif
                           
                          diff --git a/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_gpio.h b/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_gpio.h
                          index a95d13100e..d339fc15ef 100644
                          --- a/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_gpio.h
                          +++ b/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_gpio.h
                          @@ -59,6 +59,7 @@
                           #define STM32_AFIO_EXTICR2_OFFSET    0x000c  /* External interrupt configuration register 2 */
                           #define STM32_AFIO_EXTICR3_OFFSET    0x0010  /* External interrupt configuration register 3 */
                           #define STM32_AFIO_EXTICR4_OFFSET    0x0014  /* External interrupt configuration register 4 */
                          +#define STM32_AFIO_MAPR2_OFFSET      0x001c  /* AF remap and debug I/O configuration register 2 */
                           
                           /* Register Addresses ***************************************************************/
                           
                          @@ -373,5 +374,27 @@
                           #define AFIO_EXTICR4_EXTI15_SHIFT    (12)      /* Bits 15-12: EXTI 15 configuration */
                           #define AFIO_EXTICR4_EXTI15_MASK     (AFIO_EXTICR_PORT_MASK << AFIO_EXTICR4_EXTI15_SHIFT)
                           
                          +/* AF remap and debug I/O configuration register 2 */
                          +
                          +#ifdef CONFIG_STM32_VALUELINE
                          +#  define AFIO_MAPR2_TIM15_REMAP         (1 << 0)   /* Bit 0: TIM15 remapping */
                          +#  define AFIO_MAPR2_TIM16_REMAP         (1 << 1)   /* Bit 1: TIM16 remapping */
                          +#  define AFIO_MAPR2_TIM17_REMAP         (1 << 2)   /* Bit 2: TIM17 remapping */
                          +#  define AFIO_MAPR2_CEC_REMAP           (1 << 3)   /* Bit 3: CEC remapping */
                          +#  define AFIO_MAPR2_TIM1_DMA_REMAP      (1 << 4)   /* Bit 4: TIM1 DMA remapping */
                          +#else
                          +#  define AFIO_MAPR2_TIM9_REMAP          (1 << 5)   /* Bit 5: TIM9 remapping */
                          +#  define AFIO_MAPR2_TIM10_REMAP         (1 << 6)   /* Bit 6: TIM10 remapping */
                          +#  define AFIO_MAPR2_TIM11_REMAP         (1 << 7)   /* Bit 7: TIM11 remapping */
                          +#endif
                          +#define AFIO_MAPR2_TIM13_REMAP           (1 << 8)   /* Bit 8: TIM13 remapping */
                          +#define AFIO_MAPR2_TIM14_REMAP           (1 << 9)   /* Bit 9: TIM14 remapping */
                          +#define AFIO_MAPR2_FSMC_NADV             (1 << 10)  /* Bit 10: NADV connect/disconnect */
                          +#ifdef CONFIG_STM32_VALUELINE
                          +#  define AFIO_MAPR2_TIM67_DAC_DMA_REMAP (1 << 11)  /* Bit 11: TIM67_DAC DMA remapping */
                          +#  define AFIO_MAPR2_TIM12_REMAP         (1 << 12)  /* Bit 12: TIM12 remapping */
                          +#  define AFIO_MAPR2_MISC_REMAP          (1 << 13)  /* Bit 13: Miscellaneous features remapping */
                          +#endif
                          +
                           #endif /* __ARCH_ARM_SRC_STM32_CHIP_STM32F10XXX_GPIO_H */
                           
                          diff --git a/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_memorymap.h b/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_memorymap.h
                          index ed1bc26259..a1d2e26d30 100644
                          --- a/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_memorymap.h
                          +++ b/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_memorymap.h
                          @@ -60,7 +60,9 @@
                           #define STM32_TIM5_BASE      0x40000c00     /* 0x40000c00 - 0x40000fff: TIM5 timer */
                           #define STM32_TIM6_BASE      0x40001000     /* 0x40001000 - 0x400013ff: TIM6 timer */
                           #define STM32_TIM7_BASE      0x40001400     /* 0x40001400 - 0x400007ff: TIM7 timer */
                          -                                            /* 0x40001800 - 0x40000fff: Reserved */
                          +#define STM32_TIM12_BASE     0x40001800     /* 0x40001800 - 0x40001bff: TIM12 timer */
                          +#define STM32_TIM13_BASE     0x40001c00     /* 0x40001c00 - 0x40001fff: TIM13 timer */
                          +#define STM32_TIM14_BASE     0x40002000     /* 0x40002000 - 0x400023ff: TIM14 timer */
                           #define STM32_RTC_BASE       0x40002800     /* 0x40002800 - 0x40002bff: RTC */
                           #define STM32_WWDG_BASE      0x40002c00     /* 0x40002C00 - 0x40002fff: Window watchdog (WWDG) */
                           #define STM32_IWDG_BASE      0x40003000     /* 0x40003000 - 0x400033ff: Independent watchdog (IWDG) */
                          @@ -83,8 +85,8 @@
                           #define STM32_BKP_BASE       0x40006c00     /* 0x40006c00 - 0x40006fff: Backup registers (BKP) */
                           #define STM32_PWR_BASE       0x40007000     /* 0x40007000 - 0x400073ff: Power control PWR */
                           #define STM32_DAC_BASE       0x40007400     /* 0x40007400 - 0x400077ff: DAC */
                          -                                            /* 0x40007800 - 0x4000ffff: Reserved */
                          -
                          +#define STM32_CEC_BASE       0x40007800     /* 0x40007800 - 0x40007bff: CEC */
                          +                                            /* 0x40007c00 - 0x4000ffff: Reserved */
                           /* APB2 bus */
                           
                           #define STM32_AFIO_BASE      0x40010000     /* 0x40010000 - 0x400103ff: AFIO */
                          @@ -102,44 +104,49 @@
                           #define STM32_SPI1_BASE      0x40013000     /* 0x40013000 - 0x400133ff: SPI1 */
                           #define STM32_TIM8_BASE      0x40013400     /* 0x40013400 - 0x400137ff: TIM8 timer */
                           #define STM32_USART1_BASE    0x40013800     /* 0x40013800 - 0x40013bff: USART1 */
                          -#define STM32_ADC3_BASE      0x40012800     /* 0x40012800 - 0x40013fff: ADC3 */
                          -                                            /* 0x40014000 - 0x40017fff: Reserved */
                          +#define STM32_ADC3_BASE      0x40012800     /* 0x40012800 - 0x40013c00: ADC3 */
                          +                                            /* 0x40013c00 - 0x40013fff: Reserved */
                          +#define STM32_TIM15_BASE     0x40014400     /* 0x40014400 - 0x400147ff: TIM15 */
                          +#define STM32_TIM16_BASE     0x40014400     /* 0x40014400 - 0x400147ff: TIM16 */
                          +#define STM32_TIM17_BASE     0x40014800     /* 0x40014800 - 0x40014bff: TIM17 */
                          +                                            /* 0x40014c00 - 0x4001ffff: Reserved */
                          +
                           /* AHB bus */
                           
                          -#define STM32_SDIO_BASE     0x40018000     /* 0x40018000 - 0x400183ff: SDIO  */
                          -                                           /* 0x40018400 - 0x40017fff: Reserved */
                          -#define STM32_DMA1_BASE     0x40020000     /* 0x40020000 - 0x400203ff: DMA1  */
                          -#define STM32_DMA2_BASE     0x40020400     /* 0x40020000 - 0x400207ff: DMA2  */
                          -                                           /* 0x40020800 - 0x40020fff: Reserved */
                          -#define STM32_RCC_BASE      0x40021000     /* 0x40021000 - 0x400213ff: Reset and Clock control RCC */
                          -                                           /* 0x40021400 - 0x40021fff:  Reserved */
                          -#define STM32_OTGFS_BASE    0x50000000     /* 0x50000000 - 0x500003ff: USB OTG FS */
                          -#define STM32_FLASHIF_BASE  0x40022000     /* 0x40022000 - 0x400223ff: Flash memory interface */
                          -#define STM32_CRC_BASE      0x40028000     /* 0x40023000 - 0x400233ff: CRC */
                          -                                           /* 0x40023400 - 0x40027fff: Reserved */
                          -#define STM32_ETHERNET_BASE 0x40028000     /* 0x40028000 - 0x40029fff: Ethernet */
                          -                                           /* 0x40030000 - 0x4fffffff: Reserved */
                          +#define STM32_SDIO_BASE      0x40018000     /* 0x40018000 - 0x400183ff: SDIO  */
                          +                                            /* 0x40018400 - 0x40017fff: Reserved */
                          +#define STM32_DMA1_BASE      0x40020000     /* 0x40020000 - 0x400203ff: DMA1  */
                          +#define STM32_DMA2_BASE      0x40020400     /* 0x40020000 - 0x400207ff: DMA2  */
                          +                                            /* 0x40020800 - 0x40020fff: Reserved */
                          +#define STM32_RCC_BASE       0x40021000     /* 0x40021000 - 0x400213ff: Reset and Clock control RCC */
                          +                                            /* 0x40021400 - 0x40021fff:  Reserved */
                          +#define STM32_OTGFS_BASE     0x50000000     /* 0x50000000 - 0x500003ff: USB OTG FS */
                          +#define STM32_FLASHIF_BASE   0x40022000     /* 0x40022000 - 0x400223ff: Flash memory interface */
                          +#define STM32_CRC_BASE       0x40028000     /* 0x40023000 - 0x400233ff: CRC */
                          +                                            /* 0x40023400 - 0x40027fff: Reserved */
                          +#define STM32_ETHERNET_BASE  0x40028000     /* 0x40028000 - 0x40029fff: Ethernet */
                          +                                            /* 0x40030000 - 0x4fffffff: Reserved */
                           
                           /* Peripheral BB base */
                           
                          -#define STM32_PERIPHBB_BASE 0x42000000
                          +#define STM32_PERIPHBB_BASE  0x42000000
                           
                           /* Flexible SRAM controller (FSMC) */
                           
                          -#define STM32_FSMC_BANK1    0x60000000     /* 0x60000000-0x6fffffff: 256Mb NOR/SRAM */
                          -#define STM32_FSMC_BANK2    0x70000000     /* 0x70000000-0x7fffffff: 256Mb NAND FLASH */
                          -#define STM32_FSMC_BANK3    0x80000000     /* 0x80000000-0x8fffffff: 256Mb  NAND FLASH */
                          -#define STM32_FSMC_BANK4    0x90000000     /* 0x90000000-0x9fffffff: 256Mb PC CARD*/
                          -#define STM32_IS_EXTSRAM(a) ((((uint32_t)(a)) & STM32_REGION_MASK) == STM32_FSMC_BANK1)
                          +#define STM32_FSMC_BANK1     0x60000000     /* 0x60000000-0x6fffffff: 256Mb NOR/SRAM */
                          +#define STM32_FSMC_BANK2     0x70000000     /* 0x70000000-0x7fffffff: 256Mb NAND FLASH */
                          +#define STM32_FSMC_BANK3     0x80000000     /* 0x80000000-0x8fffffff: 256Mb  NAND FLASH */
                          +#define STM32_FSMC_BANK4     0x90000000     /* 0x90000000-0x9fffffff: 256Mb PC CARD*/
                          +#define STM32_IS_EXTSRAM(a)  ((((uint32_t)(a)) & STM32_REGION_MASK) == STM32_FSMC_BANK1)
                           
                          -#define STM32_FSMC_BASE     0xa0000000     /* 0xa0000000-0xbfffffff: 512Mb FSMC register block */
                          +#define STM32_FSMC_BASE      0xa0000000     /* 0xa0000000-0xbfffffff: 512Mb FSMC register block */
                           
                           /* Other registers -- see armv7-m/nvic.h for standard Cortex-M3 registers in this
                            * address range
                            */
                           
                          -#define STM32_SCS_BASE      0xe000e000
                          -#define STM32_DEBUGMCU_BASE 0xe0042000
                          +#define STM32_SCS_BASE       0xe000e000
                          +#define STM32_DEBUGMCU_BASE  0xe0042000
                           
                           #endif /* __ARCH_ARM_SRC_STM32_CHIP_STM32F10XXX_MEMORYMAP_H */
                           
                          diff --git a/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_rcc.h b/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_rcc.h
                          index 60365b9218..1a792b7ebc 100644
                          --- a/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_rcc.h
                          +++ b/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_rcc.h
                          @@ -163,7 +163,9 @@
                           #  define RCC_CFGR_PLLMUL_CLKx14    (12 << RCC_CFGR_PLLMUL_SHIFT) /* 1100: PLL input clock x 14 */
                           #  define RCC_CFGR_PLLMUL_CLKx15    (13 << RCC_CFGR_PLLMUL_SHIFT) /* 1101: PLL input clock x 15 */
                           #  define RCC_CFGR_PLLMUL_CLKx16    (14 << RCC_CFGR_PLLMUL_SHIFT) /* 111x: PLL input clock x 16 */
                          -#define RCC_CFGR_USBPRE             (1 << 22) /* Bit 22: USB prescaler */
                          +#ifndef CONFIG_STM32_VALUELINE
                          +#  define RCC_CFGR_USBPRE           (1 << 22) /* Bit 22: USB prescaler */
                          +#endif
                           #define RCC_CFGR_MCO_SHIFT          (24)      /* Bits 26-24: Microcontroller Clock Output */
                           #define RCC_CFGR_MCO_MASK           (0x0f << RCC_CFGR_MCO_SHIFT)
                           #  define RCC_CFGR_NOCLK            (0 << RCC_CFGR_MCO_SHIFT)  /* 0xx: No clock */
                          @@ -207,12 +209,22 @@
                           #define TCC_APB2RSTR_IOPFRST        (1 << 7)  /* Bit 7: IO port F reset */
                           #define TCC_APB2RSTR_IOPGRST        (1 << 8)  /* Bit 8: IO port G reset */
                           #define RCC_APB2RSTR_ADC1RST        (1 << 9)  /* Bit 9: ADC 1 interface reset */
                          -#define RCC_APB2RSTR_ADC2RST        (1 << 10) /* Bit 10: ADC 2 interface reset */
                          +#ifndef CONFIG_STM32_VALUELINE
                          +#  define RCC_APB2RSTR_ADC2RST      (1 << 10) /* Bit 10: ADC 2 interface reset */
                          +#endif
                           #define RCC_APB2RSTR_TIM1RST        (1 << 11) /* Bit 11: TIM1 Timer reset */
                           #define RCC_APB2RSTR_SPI1RST        (1 << 12) /* Bit 12: SPI 1 reset */
                          -#define RCC_APB2RSTR_TIM8RST        (1 << 13) /* Bit 13: TIM8 Timer reset */
                          +#ifndef CONFIG_STM32_VALUELINE
                          +#  define RCC_APB2RSTR_TIM8RST      (1 << 13) /* Bit 13: TIM8 Timer reset */
                          +#endif
                           #define RCC_APB2RSTR_USART1RST      (1 << 14) /* Bit 14: USART1 reset */
                          -#define RCC_APB2RSTR_ADC3RST        (1 << 15) /* Bit 15: ADC3 interface reset */
                          +#ifndef CONFIG_STM32_VALUELINE
                          +#  define RCC_APB2RSTR_ADC3RST      (1 << 15) /* Bit 15: ADC3 interface reset */
                          +#else
                          +#  define RCC_APB2RSTR_TIM15RST     (1 << 16) /* Bit 16: TIM15 reset */
                          +#  define RCC_APB2RSTR_TIM16RST     (1 << 17) /* Bit 17: TIM16 reset */
                          +#  define RCC_APB2RSTR_TIM17RST     (1 << 18) /* Bit 18: TIM17 reset */
                          +#endif
                           
                           /* APB1 Peripheral reset register */
                           
                          @@ -222,6 +234,11 @@
                           #define RCC_APB1RSTR_TIM5RST        (1 << 3)  /* Bit 3: Timer 5 reset */
                           #define RCC_APB1RSTR_TIM6RST        (1 << 4)  /* Bit 4: Timer 6 reset */
                           #define RCC_APB1RSTR_TIM7RST        (1 << 5)  /* Bit 5: Timer 7 reset */
                          +#ifdef CONFIG_STM32_VALUELINE
                          +#  define RCC_APB1RSTR_TIM12RST     (1 << 6) /* Bit 6: TIM12 reset */
                          +#  define RCC_APB1RSTR_TIM13RST     (1 << 7) /* Bit 7: TIM13 reset */
                          +#  define RCC_APB1RSTR_TIM14RST     (1 << 8) /* Bit 8: TIM14 reset */
                          +#endif
                           #define RCC_APB1RSTR_WWDGRST        (1 << 11) /* Bit 11: Window Watchdog reset */
                           #define RCC_APB1RSTR_SPI2RST        (1 << 14) /* Bit 14: SPI 2 reset */
                           #define RCC_APB1RSTR_SPI3RST        (1 << 15) /* Bit 15: SPI 3 reset */
                          @@ -231,12 +248,17 @@
                           #define RCC_APB1RSTR_UART5RST       (1 << 20) /* Bit 18: UART 5 reset */
                           #define RCC_APB1RSTR_I2C1RST        (1 << 21) /* Bit 21: I2C 1 reset */
                           #define RCC_APB1RSTR_I2C2RST        (1 << 22) /* Bit 22: I2C 2 reset */
                          -#define RCC_APB1RSTR_USBRST         (1 << 23) /* Bit 23: USB reset */
                          -#define RCC_APB1RSTR_CAN1RST        (1 << 25) /* Bit 25: CAN1 reset */
                          -#define RCC_APB1RSTR_CAN2RST        (1 << 26) /* Bit 26: CAN2 reset */
                          +#ifndef CONFIG_STM32_VALUELINE
                          +#  define RCC_APB1RSTR_USBRST       (1 << 23) /* Bit 23: USB reset */
                          +#  define RCC_APB1RSTR_CAN1RST      (1 << 25) /* Bit 25: CAN1 reset */
                          +#  define RCC_APB1RSTR_CAN2RST      (1 << 26) /* Bit 26: CAN2 reset */
                          +#endif
                           #define RCC_APB1RSTR_BKPRST         (1 << 27) /* Bit 27: Backup interface reset */
                           #define RCC_APB1RSTR_PWRRST         (1 << 28) /* Bit 28: Power interface reset */
                           #define RCC_APB1RSTR_DACRST         (1 << 29) /* Bit 29: DAC interface reset */
                          +#ifdef CONFIG_STM32_VALUELINE
                          +#  define RCC_APB1RSTR_CECRST       (1 << 30) /* Bit 30: CEC reset */
                          +#endif
                           
                           /* AHB Peripheral Clock enable register */
                           
                          @@ -246,7 +268,9 @@
                           #define RCC_AHBENR_FLITFEN          (1 << 4)  /* Bit 4: FLITF clock enable */
                           #define RCC_AHBENR_CRCEN            (1 << 6)  /* Bit 6: CRC clock enable */
                           #define RCC_AHBENR_FSMCEN           (1 << 8)  /* Bit 8: FSMC clock enable */
                          -#define RCC_AHBENR_SDIOEN           (1 << 10) /* Bit 10: SDIO clock enable */
                          +#ifndef CONFIG_STM32_VALUELINE
                          +#  define RCC_AHBENR_SDIOEN         (1 << 10) /* Bit 10: SDIO clock enable */
                          +#endif
                           #ifdef CONFIG_STM32_CONNECTIVITYLINE
                           #  define RCC_AHBENR_ETHMACEN       (1 << 14) /* Bit 14: Ethernet MAC clock enable */
                           #  define RCC_AHBENR_ETHMACTXEN     (1 << 15) /* Bit 15: Ethernet MAC TX clock enable */
                          @@ -272,12 +296,22 @@
                           #define RCC_APB2ENR_IOPFEN          (1 << 7)  /* Bit 7: I/O port F clock enable */
                           #define RCC_APB2ENR_IOPGEN          (1 << 8)  /* Bit 8: I/O port G clock enable */
                           #define RCC_APB2ENR_ADC1EN          (1 << 9)  /* Bit 9: ADC 1 interface clock enable */
                          -#define RCC_APB2ENR_ADC2EN          (1 << 10) /* Bit 10: ADC 2 interface clock enable */
                          +#ifndef CONFIG_STM32_VALUELINE
                          +#  define RCC_APB2ENR_ADC2EN        (1 << 10) /* Bit 10: ADC 2 interface clock enable */
                          +#endif
                           #define RCC_APB2ENR_TIM1EN          (1 << 11) /* Bit 11: TIM1 Timer clock enable */
                           #define RCC_APB2ENR_SPI1EN          (1 << 12) /* Bit 12: SPI 1 clock enable */
                          -#define RCC_APB2ENR_TIM8EN          (1 << 13) /* Bit 13: TIM8 Timer clock enable */
                          +#ifndef CONFIG_STM32_VALUELINE
                          +#  define RCC_APB2ENR_TIM8EN        (1 << 13) /* Bit 13: TIM8 Timer clock enable */
                          +#endif
                           #define RCC_APB2ENR_USART1EN        (1 << 14) /* Bit 14: USART1 clock enable */
                          -#define RCC_APB2ENR_ADC3EN          (1 << 15) /* Bit 14: ADC3 interface clock enable */
                          +#ifndef CONFIG_STM32_VALUELINE
                          +#  define RCC_APB2ENR_ADC3EN        (1 << 15) /* Bit 14: ADC3 interface clock enable */
                          +#else
                          +#  define RCC_APB2ENR_TIM15EN       (1 << 16) /* Bit 16: TIM15 clock enable */
                          +#  define RCC_APB2ENR_TIM16EN       (1 << 17) /* Bit 17: TIM16 clock enable */
                          +#  define RCC_APB2ENR_TIM17EN       (1 << 18) /* Bit 18: TIM17 clock enable */
                          +#endif
                           
                           /* APB1 Peripheral Clock enable register */
                           
                          @@ -287,6 +321,11 @@
                           #define RCC_APB1ENR_TIM5EN          (1 << 3)  /* Bit 3: Timer 5 clock enable */
                           #define RCC_APB1ENR_TIM6EN          (1 << 4)  /* Bit 4: Timer 6 clock enable */
                           #define RCC_APB1ENR_TIM7EN          (1 << 5)  /* Bit 5: Timer 7 clock enable */
                          +#ifdef CONFIG_STM32_VALUELINE
                          +#  define RCC_APB1ENR_TIM12EN       (1 << 6)  /* Bit 6: Timer 12 clock enable */
                          +#  define RCC_APB1ENR_TIM13EN       (1 << 7)  /* Bit 7: Timer 13 clock enable */
                          +#  define RCC_APB1ENR_TIM14EN       (1 << 8)  /* Bit 8: Timer 14 clock enable */
                          +#endif
                           #define RCC_APB1ENR_WWDGEN          (1 << 11) /* Bit 11: Window Watchdog clock enable */
                           #define RCC_APB1ENR_SPI2EN          (1 << 14) /* Bit 14: SPI 2 clock enable */
                           #define RCC_APB1ENR_SPI3EN          (1 << 15) /* Bit 15: SPI 3 clock enable */
                          @@ -296,12 +335,17 @@
                           #define RCC_APB1ENR_UART5EN         (1 << 20) /* Bit 20: UART 5 clock enable */
                           #define RCC_APB1ENR_I2C1EN          (1 << 21) /* Bit 21: I2C 1 clock enable */
                           #define RCC_APB1ENR_I2C2EN          (1 << 22) /* Bit 22: I2C 2 clock enable */
                          -#define RCC_APB1ENR_USBEN           (1 << 23) /* Bit 23: USB clock enable */
                          -#define RCC_APB1ENR_CAN1EN          (1 << 25) /* Bit 25: CAN1 clock enable */
                          -#define RCC_APB1ENR_CAN2EN          (1 << 26) /* Bit 25: CAN2 clock enable */
                          +#ifndef CONFIG_STM32_VALUELINE
                          +#  define RCC_APB1ENR_USBEN         (1 << 23) /* Bit 23: USB clock enable */
                          +#  define RCC_APB1ENR_CAN1EN        (1 << 25) /* Bit 25: CAN1 clock enable */
                          +#  define RCC_APB1ENR_CAN2EN        (1 << 26) /* Bit 25: CAN2 clock enable */
                          +#endif
                           #define RCC_APB1ENR_BKPEN           (1 << 27) /* Bit 27: Backup interface clock enable */
                           #define RCC_APB1ENR_PWREN           (1 << 28) /* Bit 28: Power interface clock enable */
                           #define RCC_APB1ENR_DACEN           (1 << 29) /* Bit 29: DAC interface clock enable */
                          +#ifdef CONFIG_STM32_VALUELINE
                          +#  define RCC_APB1ENR_CECEN         (1 << 30) /* Bit 30: CEC clock enable */
                          +#endif
                           
                           /* Backup domain control register */
                           
                          @@ -331,7 +375,7 @@
                           
                           #if defined(CONFIG_STM32_VALUELINE) || defined(CONFIG_STM32_CONNECTIVITYLINE)
                           
                          -/* Clock configuration register 2 (For connectivity line only) */
                          +/* Clock configuration register 2 (For value line and connectivity line only) */
                           
                           #define RCC_CFGR2_PREDIV1_SHIFT     (0)
                           #define RCC_CFGR2_PREDIV1_MASK      (0x0f << RCC_CFGR2_PREDIV1_SHIFT)
                          @@ -352,6 +396,10 @@
                           #  define RCC_CFGR2_PREDIV1d15      (14 << RCC_CFGR2_PREDIV1_SHIFT)
                           #  define RCC_CFGR2_PREDIV1d16      (15 << RCC_CFGR2_PREDIV1_SHIFT)
                           
                          +#endif
                          +
                          +#ifdef CONFIG_STM32_CONNECTIVITYLINE
                          +
                           #define RCC_CFGR2_PREDIV2_SHIFT     (4)
                           #define RCC_CFGR2_PREDIV2_MASK      (0x0f << RCC_CFGR2_PREDIV2_SHIFT)
                           #  define RCC_CFGR2_PREDIV2d1       (0 << RCC_CFGR2_PREDIV2_SHIFT)
                          diff --git a/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_vectors.h b/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_vectors.h
                          index b8d71799fe..24822c37d3 100644
                          --- a/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_vectors.h
                          +++ b/nuttx/arch/arm/src/stm32/chip/stm32f10xxx_vectors.h
                          @@ -49,15 +49,77 @@
                            * definition that provides the number of supported vectors.
                            */
                           
                          -#ifdef CONFIG_ARMV7M_CMNVECTOR
                          +#  ifdef CONFIG_ARMV7M_CMNVECTOR
                           
                          -/* Reserve 60 interrupt table entries for I/O interrupts. */
                          +/* Reserve 61 interrupt table entries for I/O interrupts. */
                           
                          -#  define ARMV7M_PERIPHERAL_INTERRUPTS 60
                          +#    define ARMV7M_PERIPHERAL_INTERRUPTS 61
                           
                           #else
                          -#  error This target requires CONFIG_ARMV7M_CMNVECTOR
                          -#endif /* CONFIG_ARMV7M_CMNVECTOR */
                          +
                          +VECTOR(stm32_wwdg, STM32_IRQ_WWDG)                /* Vector 16+0:  Window Watchdog interrupt */
                          +VECTOR(stm32_pvd, STM32_IRQ_PVD)                  /* Vector 16+1:  PVD through EXTI Line detection interrupt */
                          +VECTOR(stm32_tamper, STM32_IRQ_TAMPER)            /* Vector 16+2:  Tamper interrupt */
                          +VECTOR(stm32_rtc, STM32_IRQ_RTC)                  /* Vector 16+3:  RTC Wakeup through EXTI line interrupt */
                          +VECTOR(stm32_flash, STM32_IRQ_FLASH)              /* Vector 16+4:  Flash global interrupt */
                          +VECTOR(stm32_rcc, STM32_IRQ_RCC)                  /* Vector 16+5:  RCC global interrupt */
                          +VECTOR(stm32_exti0, STM32_IRQ_EXTI0)              /* Vector 16+6:  EXTI Line 0 interrupt */
                          +VECTOR(stm32_exti1, STM32_IRQ_EXTI1)              /* Vector 16+7:  EXTI Line 1 interrupt */
                          +VECTOR(stm32_exti2, STM32_IRQ_EXTI2)              /* Vector 16+8:  EXTI Line 2 interrupt */
                          +VECTOR(stm32_exti3, STM32_IRQ_EXTI3)              /* Vector 16+9:  EXTI Line 3 interrupt */
                          +VECTOR(stm32_exti4, STM32_IRQ_EXTI4)              /* Vector 16+10: EXTI Line 4 interrupt */
                          +VECTOR(stm32_dma1ch1, STM32_IRQ_DMA1CH1)          /* Vector 16+11: DMA1 Channel 1 global interrupt */
                          +VECTOR(stm32_dma1ch2, STM32_IRQ_DMA1CH2)          /* Vector 16+12: DMA1 Channel 2 global interrupt */
                          +VECTOR(stm32_dma1ch3, STM32_IRQ_DMA1CH3)          /* Vector 16+13: DMA1 Channel 3 global interrupt */
                          +VECTOR(stm32_dma1ch4, STM32_IRQ_DMA1CH4)          /* Vector 16+14: DMA1 Channel 4 global interrupt */
                          +VECTOR(stm32_dma1ch5, STM32_IRQ_DMA1CH5)          /* Vector 16+15: DMA1 Channel 5 global interrupt */
                          +VECTOR(stm32_dma1ch6, STM32_IRQ_DMA1CH6)          /* Vector 16+16: DMA1 Channel 6 global interrupt */
                          +VECTOR(stm32_dma1ch7, STM32_IRQ_DMA1CH7)          /* Vector 16+17: DMA1 Channel 7 global interrupt */
                          +VECTOR(stm32_adc1, STM32_IRQ_ADC1)                /* Vector 16+18: ADC1 global interrupt */
                          +UNUSED(STM32_IRQ_RESERVED0)                       /* Vector 16+19: Reserved 0 */
                          +UNUSED(STM32_IRQ_RESERVED1)                       /* Vector 16+20: Reserved 1 */
                          +UNUSED(STM32_IRQ_RESERVED2)                       /* Vector 16+21: Reserved 2 */
                          +UNUSED(STM32_IRQ_RESERVED3)                       /* Vector 16+22: Reserved 3 */
                          +VECTOR(stm32_exti95, STM32_IRQ_EXTI95)            /* Vector 16+23: EXTI Line[9:5] interrupts */
                          +VECTOR(stm32_tim1brk, STM32_IRQ_TIM1BRK)          /* Vector 16+24: TIM1 Break interrupt; TIM15 global interrupt */
                          +VECTOR(stm32_tim1up, STM32_IRQ_TIM1UP)            /* Vector 16+25: TIM1 Update interrupt; TIM16 global interrupt */
                          +VECTOR(stm32_tim1trgcom, STM32_IRQ_TIM1TRGCOM)    /* Vector 16+26: TIM1 Trigger and Commutation interrupts; TIM17 global interrupt */
                          +VECTOR(stm32_tim1cc, STM32_IRQ_TIM1CC)            /* Vector 16+27: TIM1 Capture Compare interrupt */
                          +VECTOR(stm32_tim2, STM32_IRQ_TIM2)                /* Vector 16+28: TIM2 global interrupt */
                          +VECTOR(stm32_tim3, STM32_IRQ_TIM3)                /* Vector 16+29: TIM3 global interrupt */
                          +VECTOR(stm32_tim4, STM32_IRQ_TIM4)                /* Vector 16+30: TIM4 global interrupt */
                          +VECTOR(stm32_i2c1ev, STM32_IRQ_I2C1EV)            /* Vector 16+31: I2C1 event interrupt */
                          +VECTOR(stm32_i2c1er, STM32_IRQ_I2C1ER)            /* Vector 16+32: I2C1 error interrupt */
                          +VECTOR(stm32_i2c2ev, STM32_IRQ_I2C2EV)            /* Vector 16+33: I2C2 event interrupt */
                          +VECTOR(stm32_i2c2er, STM32_IRQ_I2C2ER)            /* Vector 16+34: I2C2 error interrupt */
                          +VECTOR(stm32_spi1, STM32_IRQ_SPI1)                /* Vector 16+35: SPI1 global interrupt */
                          +VECTOR(stm32_spi2, STM32_IRQ_SPI2)                /* Vector 16+36: SPI2 global interrupt */
                          +VECTOR(stm32_usart1, STM32_IRQ_USART1)            /* Vector 16+37: USART1 global interrupt */
                          +VECTOR(stm32_usart2, STM32_IRQ_USART2)            /* Vector 16+38: USART2 global interrupt */
                          +VECTOR(stm32_usart3, STM32_IRQ_USART3)            /* Vector 16+39: USART3 global interrupt */
                          +VECTOR(stm32_exti1510, STM32_IRQ_EXTI1510)        /* Vector 16+40: EXTI Line[15:10] interrupts */
                          +VECTOR(stm32_rtcalr, STM32_IRQ_RTCALR)            /* Vector 16+41: RTC alarms (A and B) through EXTI line interrupt */
                          +VECTOR(stm32_cec, STM32_IRQ_CEC)                  /* Vector 16+42: CEC global interrupt */
                          +VECTOR(stm32_tim12, STM32_IRQ_TIM12)              /* Vector 16+43: TIM12 global interrupt */
                          +VECTOR(stm32_tim13, STM32_IRQ_TIM13)              /* Vector 16+44: TIM13 global interrupt */
                          +VECTOR(stm32_tim14, STM32_IRQ_TIM14)              /* Vector 16+45: TIM14 global interrupt */
                          +UNUSED(STM32_IRQ_RESERVED4)                       /* Vector 16+46: Reserved 4 */
                          +UNUSED(STM32_IRQ_RESERVED5)                       /* Vector 16+47: Reserved 5 */
                          +VECTOR(stm32_fsmc, STM32_IRQ_FSMC)                /* Vector 16+48: FSMC global interrupt */
                          +UNUSED(STM32_IRQ_RESERVED6)                       /* Vector 16+49: Reserved 6 */
                          +VECTOR(stm32_tim5, STM32_IRQ_TIM5)                /* Vector 16+50: TIM5 global interrupt */
                          +VECTOR(stm32_spi3, STM32_IRQ_SPI3)                /* Vector 16+51: SPI3 global interrupt */
                          +VECTOR(stm32_uart4, STM32_IRQ_UART4)              /* Vector 16+52: USART2 global interrupt */
                          +VECTOR(stm32_uart5, STM32_IRQ_UART5)              /* Vector 16+53: USART5 global interrupt */
                          +VECTOR(stm32_tim6, STM32_IRQ_TIM6)                /* Vector 16+54: TIM6 global interrupt */
                          +VECTOR(stm32_tim7, STM32_IRQ_TIM7)                /* Vector 16+55: TIM7 global interrupt */
                          +VECTOR(stm32_dma2ch1, STM32_IRQ_DMA2CH1)          /* Vector 16+56: DMA2 Channel 1 global interrupt */
                          +VECTOR(stm32_dma2ch2, STM32_IRQ_DMA2CH2)          /* Vector 16+57: DMA2 Channel 2 global interrupt */
                          +VECTOR(stm32_dma2ch3, STM32_IRQ_DMA2CH3)          /* Vector 16+58: DMA2 Channel 3 global interrupt */
                          +VECTOR(stm32_dma2ch45, STM32_IRQ_DMA2CH45)        /* Vector 16+59: DMA2 Channel 4 and 5 global interrupt */
                          +VECTOR(stm32_dma2ch5, STM32_IRQ_DMA2CH5)          /* Vector 16+60: DMA2 Channel 5 global interrupt */
                          +
                          +#  endif /* CONFIG_ARMV7M_CMNVECTOR */
                           
                           #elif defined(CONFIG_STM32_CONNECTIVITYLINE)
                           
                          diff --git a/nuttx/arch/arm/src/stm32/chip/stm32f20xxx_pinmap.h b/nuttx/arch/arm/src/stm32/chip/stm32f20xxx_pinmap.h
                          index 817e747f71..699ca4fdc4 100644
                          --- a/nuttx/arch/arm/src/stm32/chip/stm32f20xxx_pinmap.h
                          +++ b/nuttx/arch/arm/src/stm32/chip/stm32f20xxx_pinmap.h
                          @@ -222,7 +222,7 @@
                           #define GPIO_ETH_MII_TX_EN_2  (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTG|GPIO_PIN11)
                           #define GPIO_ETH_PPS_OUT_1    (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN5)
                           #define GPIO_ETH_PPS_OUT_2    (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTG|GPIO_PIN8)
                          -#define GPIO_ETH_RMII_CRS_DV  (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULLGPIO_PORTA|GPIO_PIN7)
                          +#define GPIO_ETH_RMII_CRS_DV  (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN7)
                           #define GPIO_ETH_RMII_REF_CLK (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN1)
                           #define GPIO_ETH_RMII_RXD0    (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTC|GPIO_PIN4)
                           #define GPIO_ETH_RMII_RXD1    (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTC|GPIO_PIN5)
                          diff --git a/nuttx/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h b/nuttx/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h
                          index ae2436a70f..31e51caf07 100644
                          --- a/nuttx/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h
                          +++ b/nuttx/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h
                          @@ -222,7 +222,7 @@
                           #define GPIO_ETH_MII_TX_EN_2  (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTG|GPIO_PIN11)
                           #define GPIO_ETH_PPS_OUT_1    (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN5)
                           #define GPIO_ETH_PPS_OUT_2    (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTG|GPIO_PIN8)
                          -#define GPIO_ETH_RMII_CRS_DV  (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULLGPIO_PORTA|GPIO_PIN7)
                          +#define GPIO_ETH_RMII_CRS_DV  (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN7)
                           #define GPIO_ETH_RMII_REF_CLK (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN1)
                           #define GPIO_ETH_RMII_RXD0    (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTC|GPIO_PIN4)
                           #define GPIO_ETH_RMII_RXD1    (GPIO_ALT|GPIO_AF11|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTC|GPIO_PIN5)
                          diff --git a/nuttx/arch/arm/src/stm32/stm32_adc.h b/nuttx/arch/arm/src/stm32/stm32_adc.h
                          index c25da38305..7b6c13b338 100644
                          --- a/nuttx/arch/arm/src/stm32/stm32_adc.h
                          +++ b/nuttx/arch/arm/src/stm32/stm32_adc.h
                          @@ -281,7 +281,7 @@
                           
                           #if defined(ADC1_HAVE_TIMER) || defined(ADC2_HAVE_TIMER) || defined(ADC3_HAVE_TIMER)
                           #  define ADC_HAVE_TIMER 1
                          -#  if defined(CONFIG_STM32_STM32F10XX) && defined(CONFIG_STM32_FORCEPOWER)
                          +#  if defined(CONFIG_STM32_STM32F10XX) && !defined(CONFIG_STM32_FORCEPOWER)
                           #    warning "CONFIG_STM32_FORCEPOWER must be defined to enable the timer(s)"
                           #  endif
                           #else
                          diff --git a/nuttx/arch/arm/src/stm32/stm32_eth.c b/nuttx/arch/arm/src/stm32/stm32_eth.c
                          index 3054142ce8..006f67142b 100644
                          --- a/nuttx/arch/arm/src/stm32/stm32_eth.c
                          +++ b/nuttx/arch/arm/src/stm32/stm32_eth.c
                          @@ -2594,6 +2594,17 @@ static int stm32_phyinit(FAR struct stm32_ethmac_s *priv)
                               }
                             up_mdelay(PHY_RESET_DELAY);
                           
                          +  /* Perform any necessary, board-specific PHY initialization */
                          +
                          +#ifdef CONFIG_STM32_PHYINIT
                          +  ret = stm32_phy_boardinitialize(0);
                          +  if (ret < 0)
                          +    {
                          +      ndbg("Failed to initialize the PHY: %d\n", ret);
                          +      return ret;
                          +    }
                          +#endif
                          +
                             /* Special workaround for the Davicom DM9161 PHY is required. */
                           
                           #ifdef CONFIG_PHY_DM9161
                          diff --git a/nuttx/arch/arm/src/stm32/stm32_eth.h b/nuttx/arch/arm/src/stm32/stm32_eth.h
                          index f0c14b5b1f..4501712b14 100644
                          --- a/nuttx/arch/arm/src/stm32/stm32_eth.h
                          +++ b/nuttx/arch/arm/src/stm32/stm32_eth.h
                          @@ -66,14 +66,13 @@ extern "C" {
                            * Function: stm32_ethinitialize
                            *
                            * Description:
                          - *   Initialize the Ethernet driver for one interface.  If the STM32 chip
                          - *   supports multiple Ethernet controllers, then board specific logic
                          - *   must implement up_netinitialize() and call this function to initialize
                          - *   the desired interfaces.
                          + *   Initialize the Ethernet driver for one interface.  If the STM32 chip supports
                          + *   multiple Ethernet controllers, then board specific logic must implement
                          + *   up_netinitialize() and call this function to initialize the desired interfaces.
                            *
                            * Parameters:
                          - *   intf - In the case where there are multiple EMACs, this value
                          - *          identifies which EMAC is to be initialized.
                          + *   intf - In the case where there are multiple EMACs, this value identifies which
                          + *   EMAC is to be initialized.
                            *
                            * Returned Value:
                            *   OK on success; Negated errno on failure.
                          @@ -86,6 +85,30 @@ extern "C" {
                           EXTERN int stm32_ethinitialize(int intf);
                           #endif
                           
                          +/************************************************************************************
                          + * Function: stm32_phy_boardinitialize
                          + *
                          + * Description:
                          + *   Some boards require specialized initialization of the PHY before it can be used.
                          + *   This may include such things as configuring GPIOs, resetting the PHY, etc.  If
                          + *   CONFIG_STM32_PHYINIT is defined in the configuration then the board specific
                          + *   logic must provide stm32_phyinitialize();  The STM32 Ethernet driver will call
                          + *   this function one time before it first uses the PHY.
                          + *
                          + * Parameters:
                          + *   intf - Always zero for now.
                          + *
                          + * Returned Value:
                          + *   OK on success; Negated errno on failure.
                          + *
                          + * Assumptions:
                          + *
                          + ************************************************************************************/
                          +
                          +#ifdef CONFIG_STM32_PHYINIT
                          +EXTERN int stm32_phy_boardinitialize(int intf);
                          +#endif
                          +
                           #undef EXTERN
                           #if defined(__cplusplus)
                           }
                          diff --git a/nuttx/arch/arm/src/stm32/stm32_i2c.c b/nuttx/arch/arm/src/stm32/stm32_i2c.c
                          index a4b10b55c6..c44a823dbb 100644
                          --- a/nuttx/arch/arm/src/stm32/stm32_i2c.c
                          +++ b/nuttx/arch/arm/src/stm32/stm32_i2c.c
                          @@ -107,17 +107,23 @@
                           
                           #if !defined(CONFIG_STM32_I2CTIMEOSEC) && !defined(CONFIG_STM32_I2CTIMEOMS)
                           #  define CONFIG_STM32_I2CTIMEOSEC 0
                          -#  define CONFIG_STM32_I2CTIMEOMS   500   /* Default is 500 milliseconds */
                          +#  define CONFIG_STM32_I2CTIMEOMS  500   /* Default is 500 milliseconds */
                           #elif !defined(CONFIG_STM32_I2CTIMEOSEC)
                           #  define CONFIG_STM32_I2CTIMEOSEC 0     /* User provided milliseconds */
                           #elif !defined(CONFIG_STM32_I2CTIMEOMS)
                          -#  define CONFIG_STM32_I2CTIMEOMS   0     /* User provided seconds */
                          +#  define CONFIG_STM32_I2CTIMEOMS  0     /* User provided seconds */
                           #endif
                           
                           /* Interrupt wait time timeout in system timer ticks */
                           
                          -#define CONFIG_STM32_I2CTIMEOTICKS \
                          -  (SEC2TICK(CONFIG_STM32_I2CTIMEOSEC) + MSEC2TICK(CONFIG_STM32_I2CTIMEOMS))
                          +#ifndef CONFIG_STM32_I2CTIMEOTICKS
                          +#  define CONFIG_STM32_I2CTIMEOTICKS \
                          +    (SEC2TICK(CONFIG_STM32_I2CTIMEOSEC) + MSEC2TICK(CONFIG_STM32_I2CTIMEOMS))
                          +#endif
                          +
                          +#ifndef CONFIG_STM32_I2C_DYNTIMEO_STARTSTOP
                          +#  define CONFIG_STM32_I2C_DYNTIMEO_STARTSTOP TICK2USEC(CONFIG_STM32_I2CTIMEOTICKS)
                          +#endif
                           
                           /* On the STM32F103ZE, there is an internal conflict between I2C1 and FSMC.  In that
                            * case, it is necessary to disable FSMC before each I2C1 access and re-enable FSMC
                          @@ -129,6 +135,18 @@
                           #  define I2C1_FSMC_CONFLICT
                           #endif
                           
                          +/* Macros to convert a I2C pin to a GPIO output */
                          +
                          +#if defined(CONFIG_STM32_STM32F10XX)
                          +#  define I2C_OUTPUT (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_CNF_OUTOD | \
                          +                      GPIO_MODE_50MHz)
                          +#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX)
                          +#  define I2C_OUTPUT (GPIO_OUTPUT | GPIO_FLOAT | GPIO_OPENDRAIN |\
                          +                      GPIO_SPEED_50MHz | GPIO_OUTPUT_SET)
                          +#endif
                          +
                          +#define MKI2C_OUTPUT(p) (((p) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | I2C_OUTPUT)
                          +
                           /* Debug ****************************************************************************/
                           /* CONFIG_DEBUG_I2C + CONFIG_DEBUG enables general I2C debug output. */
                           
                          @@ -200,18 +218,16 @@ struct stm32_trace_s
                           
                           struct stm32_i2c_config_s
                           {
                          -  uint32_t    base;        /* I2C base address */
                          +  uint32_t base;              /* I2C base address */
                          +  uint32_t clk_bit;           /* Clock enable bit */
                          +  uint32_t reset_bit;         /* Reset bit */
                          +  uint32_t scl_pin;           /* GPIO configuration for SCL as SCL */
                          +  uint32_t sda_pin;           /* GPIO configuration for SDA as SDA */
                           #ifndef CONFIG_I2C_POLLED
                          -  int         ( *isr)(int, void *); /* Interrupt handler */
                          +  int (*isr)(int, void *);    /* Interrupt handler */
                          +  uint32_t ev_irq;            /* Event IRQ */
                          +  uint32_t er_irq;            /* Error IRQ */
                           #endif
                          -  uint32_t    clk_bit;     /* Clock enable bit */
                          -  uint32_t    reset_bit;   /* Reset bit */
                          -  uint32_t    scl_pin;     /* GPIO configuration for SCL as SCL */
                          -  uint32_t    scl_gpio;    /* GPIO configuration for SCL as a GPIO */
                          -  uint32_t    sda_pin;     /* GPIO configuration for SDA as SDA */
                          -  uint32_t    sda_gpio;    /* GPIO configuration for SDA as a GPIO */
                          -  uint32_t    ev_irq;      /* Event IRQ */
                          -  uint32_t    er_irq;      /* Error IRQ */
                           };
                           
                           /* I2C Device Private Data */
                          @@ -219,31 +235,31 @@ struct stm32_i2c_config_s
                           struct stm32_i2c_priv_s
                           {
                             const struct stm32_i2c_config_s *config; /* Port configuration */
                          -  int         refs;        /* Referernce count */
                          -  sem_t       sem_excl;    /* Mutual exclusion semaphore */
                          +  int refs;                    /* Referernce count */
                          +  sem_t sem_excl;              /* Mutual exclusion semaphore */
                           #ifndef CONFIG_I2C_POLLED
                          -  sem_t       sem_isr;     /* Interrupt wait semaphore */
                          +  sem_t sem_isr;               /* Interrupt wait semaphore */
                           #endif
                          -  volatile uint8_t intstate;  /* Interrupt handshake (see enum stm32_intstate_e) */
                          +  volatile uint8_t intstate;   /* Interrupt handshake (see enum stm32_intstate_e) */
                               
                          -  uint8_t     msgc;        /* Message count */
                          -  struct i2c_msg_s *msgv;  /* Message list */
                          -  uint8_t    *ptr;         /* Current message buffer */
                          -  int         dcnt;        /* Current message length */
                          -  uint16_t    flags;       /* Current message flags */
                          +  uint8_t msgc;                /* Message count */
                          +  struct i2c_msg_s *msgv;      /* Message list */
                          +  uint8_t *ptr;                /* Current message buffer */
                          +  int dcnt;                    /* Current message length */
                          +  uint16_t flags;              /* Current message flags */
                           
                             /* I2C trace support */
                           
                           #ifdef CONFIG_I2C_TRACE
                          -  int         tndx;        /* Trace array index */
                          -  uint32_t    start_time;  /* Time when the trace was started */
                          +  int tndx;                    /* Trace array index */
                          +  uint32_t start_time;         /* Time when the trace was started */
                           
                             /* The actual trace data */
                           
                             struct stm32_trace_s trace[CONFIG_I2C_NTRACE];
                           #endif
                           
                          -  uint32_t    status;      /* End of transfer SR2|SR1 status */
                          +  uint32_t status;             /* End of transfer SR2|SR1 status */
                           };
                           
                           /* I2C Device, Instance */
                          @@ -270,8 +286,11 @@ static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv,
                                                                  uint8_t offset, uint16_t clearbits,
                                                                  uint16_t setbits);
                           static inline void stm32_i2c_sem_wait(FAR struct i2c_dev_s *dev);
                          -static inline int  stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv, int timeout_us);
                          -static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv, int timeout_us);
                          +#ifdef CONFIG_STM32_I2C_DYNTIMEO
                          +static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs);
                          +#endif /* CONFIG_STM32_I2C_DYNTIMEO */
                          +static inline int  stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv);
                          +static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv);
                           static inline void stm32_i2c_sem_post(FAR struct i2c_dev_s *dev);
                           static inline void stm32_i2c_sem_init(FAR struct i2c_dev_s *dev);
                           static inline void stm32_i2c_sem_destroy(FAR struct i2c_dev_s *dev);
                          @@ -281,7 +300,7 @@ static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv, uint32_t statu
                           static void stm32_i2c_traceevent(FAR struct stm32_i2c_priv_s *priv,
                                                          enum stm32_trace_e event, uint32_t parm);
                           static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv);
                          -#endif
                          +#endif /* CONFIG_I2C_TRACE */
                           static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv,
                                                          uint32_t frequency);
                           static inline void stm32_i2c_sendstart(FAR struct stm32_i2c_priv_s *priv);
                          @@ -291,7 +310,7 @@ static inline uint32_t stm32_i2c_getstatus(FAR struct stm32_i2c_priv_s *priv);
                           #ifdef I2C1_FSMC_CONFLICT
                           static inline uint32_t stm32_i2c_disablefsmc(FAR struct stm32_i2c_priv_s *priv);
                           static inline void stm32_i2c_enablefsmc(uint32_t ahbenr);
                          -#endif
                          +#endif /* I2C1_FSMC_CONFLICT */
                           static int stm32_i2c_isr(struct stm32_i2c_priv_s * priv);
                           #ifndef CONFIG_I2C_POLLED
                           #ifdef CONFIG_STM32_I2C1
                          @@ -329,27 +348,18 @@ static int stm32_i2c_transfer(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *m
                            ************************************************************************************/
                           
                           #ifdef CONFIG_STM32_I2C1
                          -# ifndef GPIO_I2C1_SCL_GPIO
                          -#  define  GPIO_I2C1_SCL_GPIO 0
                          -# endif
                          -# ifndef GPIO_I2C1_SDA_GPIO
                          -#  define  GPIO_I2C1_SDA_GPIO 0
                          -# endif
                          -
                           static const struct stm32_i2c_config_s stm32_i2c1_config = 
                           {
                             .base       = STM32_I2C1_BASE,
                          -#ifndef CONFIG_I2C_POLLED
                          -  .isr        = stm32_i2c1_isr,
                          -#endif
                             .clk_bit    = RCC_APB1ENR_I2C1EN,
                             .reset_bit  = RCC_APB1RSTR_I2C1RST,
                             .scl_pin    = GPIO_I2C1_SCL,
                          -  .scl_gpio   = GPIO_I2C1_SCL_GPIO,
                             .sda_pin    = GPIO_I2C1_SDA,
                          -  .sda_gpio   = GPIO_I2C1_SDA_GPIO,
                          +#ifndef CONFIG_I2C_POLLED
                          +  .isr        = stm32_i2c1_isr,
                             .ev_irq     = STM32_IRQ_I2C1EV,
                             .er_irq     = STM32_IRQ_I2C1ER
                          +#endif
                           };
                           
                           struct stm32_i2c_priv_s stm32_i2c1_priv =
                          @@ -367,27 +377,18 @@ struct stm32_i2c_priv_s stm32_i2c1_priv =
                           #endif
                           
                           #ifdef CONFIG_STM32_I2C2
                          -# ifndef GPIO_I2C2_SCL_GPIO
                          -#  define  GPIO_I2C2_SCL_GPIO 0
                          -# endif
                          -# ifndef GPIO_I2C2_SDA_GPIO
                          -#  define  GPIO_I2C2_SDA_GPIO 0
                          -# endif
                          -
                           static const struct stm32_i2c_config_s stm32_i2c2_config = 
                           {
                             .base       = STM32_I2C2_BASE,
                          -#ifndef CONFIG_I2C_POLLED  
                          -  .isr        = stm32_i2c2_isr,
                          -#endif
                             .clk_bit    = RCC_APB1ENR_I2C2EN,
                             .reset_bit  = RCC_APB1RSTR_I2C2RST,
                             .scl_pin    = GPIO_I2C2_SCL,
                          -  .scl_gpio   = GPIO_I2C2_SCL_GPIO,
                             .sda_pin    = GPIO_I2C2_SDA,
                          -  .sda_gpio   = GPIO_I2C2_SDA_GPIO,
                          +#ifndef CONFIG_I2C_POLLED  
                          +  .isr        = stm32_i2c2_isr,
                             .ev_irq     = STM32_IRQ_I2C2EV,
                             .er_irq     = STM32_IRQ_I2C2ER
                          +#endif
                           };
                           
                           struct stm32_i2c_priv_s stm32_i2c2_priv =
                          @@ -405,27 +406,18 @@ struct stm32_i2c_priv_s stm32_i2c2_priv =
                           #endif
                           
                           #ifdef CONFIG_STM32_I2C3
                          -# ifndef GPIO_I2C3_SCL_GPIO
                          -#  define  GPIO_I2C3_SCL_GPIO 0
                          -# endif
                          -# ifndef GPIO_I2C3_SDA_GPIO
                          -#  define  GPIO_I2C3_SDA_GPIO 0
                          -# endif
                          -
                           static const struct stm32_i2c_config_s stm32_i2c3_config = 
                           {
                             .base       = STM32_I2C3_BASE,
                          -#ifndef CONFIG_I2C_POLLED
                          -  .isr        = stm32_i2c3_isr,
                          -#endif
                             .clk_bit    = RCC_APB1ENR_I2C3EN,
                             .reset_bit  = RCC_APB1RSTR_I2C3RST,
                             .scl_pin    = GPIO_I2C3_SCL,
                          -  .scl_gpio   = GPIO_I2C3_SCL_GPIO,
                             .sda_pin    = GPIO_I2C3_SDA,
                          -  .sda_gpio   = GPIO_I2C3_SDA_GPIO,
                          +#ifndef CONFIG_I2C_POLLED
                          +  .isr        = stm32_i2c3_isr,
                             .ev_irq     = STM32_IRQ_I2C3EV,
                             .er_irq     = STM32_IRQ_I2C3ER
                          +#endif
                           };
                           
                           struct stm32_i2c_priv_s stm32_i2c3_priv =
                          @@ -525,6 +517,35 @@ static inline void stm32_i2c_sem_wait(FAR struct i2c_dev_s *dev)
                               }
                           }
                           
                          +/************************************************************************************
                          + * Name: stm32_i2c_tousecs
                          + *
                          + * Description:
                          + *   Return a micro-second delay based on the number of bytes left to be processed.
                          + *
                          + ************************************************************************************/
                          +
                          +#ifdef CONFIG_STM32_I2C_DYNTIMEO
                          +static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs)
                          +{
                          +  size_t bytecount = 0;
                          +  int i;
                          +
                          +  /* Count the number of bytes left to process */
                          +
                          +  for (i = 0; i < msgc; i++)
                          +    {
                          +      bytecount += msgs[i].length;
                          +    }
                          +
                          +  /* Then return a number of microseconds based on a user provided scaling
                          +   * factor.
                          +   */
                          +
                          +  return (useconds_t)(CONFIG_STM32_I2C_DYNTIMEO_USECPERBYTE * bytecount);
                          +}
                          +#endif
                          +
                           /************************************************************************************
                            * Name: stm32_i2c_sem_waitdone
                            *
                          @@ -534,7 +555,7 @@ static inline void stm32_i2c_sem_wait(FAR struct i2c_dev_s *dev)
                            ************************************************************************************/
                           
                           #ifndef CONFIG_I2C_POLLED
                          -static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv, int timeout_us)
                          +static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
                           {
                             struct timespec abstime;
                             irqstate_t flags;
                          @@ -566,31 +587,24 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv, int
                           #if CONFIG_STM32_I2CTIMEOSEC > 0
                                 abstime.tv_sec += CONFIG_STM32_I2CTIMEOSEC;
                           #endif
                          -#if CONFIG_STM32_I2CTIMEOUS_PER_BYTE > 0
                           
                          -      /* Count the number of bytes left to process */
                          -      int i;
                          -      int bytecount = 0;
                          -      for (i = 0; i < priv->msgc; i++)
                          -        {
                          -          bytecount += priv->msgv[i].length;
                          -        }
                          +      /* Add a value proportional to the number of bytes in the transfer */
                           
                          -      abstime.tv_nsec += (CONFIG_STM32_I2CTIMEOUS_PER_BYTE * bytecount) * 1000;
                          +#ifdef CONFIG_STM32_I2C_DYNTIMEO
                          +      abstime.tv_nsec += 1000 * stm32_i2c_tousecs(priv->msgc, priv->msgv);
                          +      if (abstime.tv_nsec > 1000 * 1000 * 1000)
                          +        {
                          +          abstime.tv_sec++;
                          +          abstime.tv_nsec -= 1000 * 1000 * 1000;
                          +        }
                          +
                          +#elif CONFIG_STM32_I2CTIMEOMS > 0
                          +      abstime.tv_nsec += CONFIG_STM32_I2CTIMEOMS * 1000 * 1000;
                                 if (abstime.tv_nsec > 1000 * 1000 * 1000)
                                   {
                                     abstime.tv_sec++;
                                     abstime.tv_nsec -= 1000 * 1000 * 1000;
                                   }
                          -#else
                          -  #if CONFIG_STM32_I2CTIMEOMS > 0
                          -        abstime.tv_nsec += CONFIG_STM32_I2CTIMEOMS * 1000 * 1000;
                          -        if (abstime.tv_nsec > 1000 * 1000 * 1000)
                          -          {
                          -            abstime.tv_sec++;
                          -            abstime.tv_nsec -= 1000 * 1000 * 1000;
                          -          }
                          -  #endif
                           #endif
                                 /* Wait until either the transfer is complete or the timeout expires */
                           
                          @@ -624,12 +638,21 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv, int
                             return ret;
                           }
                           #else
                          -static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv, int timeout_us)
                          +static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
                           {
                          +  uint32_t timeout;
                             uint32_t start;
                             uint32_t elapsed;
                             int ret;
                           
                          +  /* Get the timeout value */
                          +
                          +#ifdef CONFIG_STM32_I2C_DYNTIMEO
                          +  timeout = USEC2TICK(stm32_i2c_tousecs(priv->msgc, priv->msgv));
                          +#else
                          +  timeout = CONFIG_STM32_I2CTIMEOTICKS;
                          +#endif
                          +
                             /* Signal the interrupt handler that we are waiting.  NOTE:  Interrupts
                              * are currently disabled but will be temporarily re-enabled below when
                              * sem_timedwait() sleeps.
                          @@ -652,10 +675,11 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv, int
                               }
                           
                             /* Loop until the transfer is complete. */
                          -  while (priv->intstate != INTSTATE_DONE && elapsed < USEC2TICK(timeout_us));
                          +
                          +  while (priv->intstate != INTSTATE_DONE && elapsed < timeout);
                           
                             i2cvdbg("intstate: %d elapsed: %d threshold: %d status: %08x\n",
                          -          priv->intstate, elapsed, USEC2TICK(timeout_us), priv->status);
                          +          priv->intstate, elapsed, timeout, priv->status);
                           
                             /* Set the interrupt state back to IDLE */
                           
                          @@ -673,13 +697,22 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv, int
                            *
                            ************************************************************************************/
                           
                          -static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv, int timeout_us)
                          +static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
                           {
                             uint32_t start;
                             uint32_t elapsed;
                          +  uint32_t timeout;
                             uint32_t cr1;
                             uint32_t sr1;
                           
                          +  /* Select a timeout */
                          +
                          +#ifdef CONFIG_STM32_I2C_DYNTIMEO
                          +  timeout = USEC2TICK(CONFIG_STM32_I2C_DYNTIMEO_STARTSTOP);
                          +#else
                          +  timeout = CONFIG_STM32_I2CTIMEOTICKS;
                          +#endif
                          +
                             /* Wait as stop might still be in progress; but stop might also
                              * be set because of a timeout error: "The [STOP] bit is set and
                              * cleared by software, cleared by hardware when a Stop condition is
                          @@ -712,7 +745,7 @@ static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv, int
                           
                             /* Loop until the stop is complete or a timeout occurs. */
                           
                          -  while (elapsed < USEC2TICK(timeout_us));
                          +  while (elapsed < timeout);
                           
                             /* If we get here then a timeout occurred with the STOP condition
                              * still pending.
                          @@ -932,7 +965,7 @@ static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv, uint32_t frequ
                               {
                                 /* Fast mode speed calculation with Tlow/Thigh = 16/9 */
                           
                          -#ifdef CONFIG_I2C_DUTY16_9
                          +#ifdef CONFIG_STM32_I2C_DUTY16_9
                                 speed = (uint16_t)(STM32_PCLK1_FREQUENCY / (frequency * 25));
                           
                                 /* Set DUTY and fast speed bits */
                          @@ -1071,7 +1104,7 @@ static inline uint32_t stm32_i2c_disablefsmc(FAR struct stm32_i2c_priv_s *priv)
                           
                             /* Is this I2C1 */
                           
                          -#ifdef CONFIG_STM32_I2C2
                          +#if defined(CONFIG_STM32_I2C2) || defined(CONFIG_STM32_I2C3)
                             if (priv->config->base == STM32_I2C1_BASE)
                           #endif
                               {
                          @@ -1198,10 +1231,14 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv)
                                   {
                                     stm32_i2c_traceevent(priv, I2CEVENT_RCVBYTE, priv->dcnt);
                           
                          +          /* No interrupts or context switches may occur in the following
                          +           * sequence.  Otherwise, additional bytes may be sent by the
                          +           * device.
                          +           */
                          +
                           #ifdef CONFIG_I2C_POLLED
                                     irqstate_t state = irqsave();
                           #endif
                          -
                                     /* Receive a byte */
                           
                                     *priv->ptr++ = stm32_i2c_getreg(priv, STM32_I2C_DR_OFFSET);
                          @@ -1217,7 +1254,6 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv)
                           #ifdef CONFIG_I2C_POLLED
                                     irqrestore(state);
                           #endif
                          -
                                   }
                               }
                               
                          @@ -1408,7 +1444,6 @@ static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv)
                             /* Enable power and reset the peripheral */
                           
                             modifyreg32(STM32_RCC_APB1ENR, 0, priv->config->clk_bit);
                          -
                             modifyreg32(STM32_RCC_APB1RSTR, 0, priv->config->reset_bit);
                             modifyreg32(STM32_RCC_APB1RSTR, priv->config->reset_bit, 0);
                           
                          @@ -1428,10 +1463,10 @@ static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv)
                             /* Attach ISRs */
                                       
                           #ifndef CONFIG_I2C_POLLED
                          -        irq_attach(priv->config->ev_irq, priv->config->isr);
                          -        irq_attach(priv->config->er_irq, priv->config->isr);
                          -        up_enable_irq(priv->config->ev_irq);
                          -        up_enable_irq(priv->config->er_irq);
                          +  irq_attach(priv->config->ev_irq, priv->config->isr);
                          +  irq_attach(priv->config->er_irq, priv->config->isr);
                          +  up_enable_irq(priv->config->ev_irq);
                          +  up_enable_irq(priv->config->er_irq);
                           #endif
                           
                             /* Set peripheral frequency, where it must be at least 2 MHz  for 100 kHz
                          @@ -1461,17 +1496,23 @@ static int stm32_i2c_deinit(FAR struct stm32_i2c_priv_s *priv)
                           
                             stm32_i2c_putreg(priv, STM32_I2C_CR1_OFFSET, 0);
                           
                          +  /* Unconfigure GPIO pins */
                          +
                             stm32_unconfiggpio(priv->config->scl_pin);
                             stm32_unconfiggpio(priv->config->sda_pin);
                           
                          +  /* Disable and detach interrupts */
                          +
                           #ifndef CONFIG_I2C_POLLED
                             up_disable_irq(priv->config->ev_irq);
                             up_disable_irq(priv->config->er_irq);
                             irq_detach(priv->config->ev_irq);
                             irq_detach(priv->config->er_irq);
                           #endif
                          -  modifyreg32(STM32_RCC_APB1ENR, priv->config->clk_bit, 0);
                           
                          +  /* Disable clocking */
                          +
                          +  modifyreg32(STM32_RCC_APB1ENR, priv->config->clk_bit, 0);
                             return OK;
                           }
                           
                          @@ -1533,14 +1574,14 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms
                             struct stm32_i2c_inst_s     *inst = (struct stm32_i2c_inst_s *)dev;
                             FAR struct stm32_i2c_priv_s *priv = inst->priv;
                             uint32_t    status = 0;
                          -  //uint32_t    ahbenr;
                          +  uint32_t    ahbenr;
                             int         errval = 0;
                           
                             ASSERT(count);
                           
                             /* Disable FSMC that shares a pin with I2C1 (LBAR) */
                           
                          -  (void)stm32_i2c_disablefsmc(priv);
                          +  ahbenr = stm32_i2c_disablefsmc(priv);
                           
                             /* Wait for any STOP in progress.  NOTE:  If we have to disable the FSMC
                              * then we cannot do this at the top of the loop, unfortunately.  The STOP
                          @@ -1548,11 +1589,7 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms
                              */
                           
                           #ifndef I2C1_FSMC_CONFLICT
                          -    #if CONFIG_STM32_I2CTIMEOUS_START_STOP > 0
                          -      stm32_i2c_sem_waitstop(priv, CONFIG_STM32_I2CTIMEOUS_START_STOP);
                          -    #else 
                          -      stm32_i2c_sem_waitstop(priv, CONFIG_STM32_I2CTIMEOMS + CONFIG_STM32_I2CTIMEOSEC * 1000000);
                          -    #endif
                          +  stm32_i2c_sem_waitstop(priv);
                           #endif
                           
                             /* Clear any pending error interrupts */
                          @@ -1573,22 +1610,6 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms
                             priv->msgv = msgs;
                             priv->msgc = count;
                           
                          -  /* Calculate timeout values */
                          -  int timeout_us = 0;
                          -  #if CONFIG_STM32_I2CTIMEOUS_PER_BYTE > 0
                          -    /* Count the number of bytes left to process */
                          -    int i;
                          -    int bytecount = 10;
                          -    for (i = 0; i < count; i++)
                          -      {
                          -        bytecount += msgs[i].length;
                          -      }
                          -    timeout_us = CONFIG_STM32_I2CTIMEOUS_PER_BYTE * bytecount;
                          -    //i2cvdbg("i2c wait: %d\n", timeout_us);
                          -  #else
                          -    timeout_us = CONFIG_STM32_I2CTIMEOMS + CONFIG_STM32_I2CTIMEOSEC * 1000000;
                          -  #endif
                          -
                             /* Reset I2C trace logic */
                           
                             stm32_i2c_tracereset(priv);
                          @@ -1608,7 +1629,7 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms
                              * the BUSY flag.
                              */
                           
                          -  if (stm32_i2c_sem_waitdone(priv, timeout_us) < 0)
                          +  if (stm32_i2c_sem_waitdone(priv) < 0)
                               {
                                 status = stm32_i2c_getstatus(priv);
                                 errval = ETIMEDOUT;
                          @@ -1623,7 +1644,9 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms
                                  */
                           
                                 stm32_i2c_clrstart(priv);
                          -      // XXX also clear busy flag in case of timeout
                          +
                          +      /* Clear busy flag in case of timeout */
                          +
                                 status = priv->status & 0xffff;
                               }
                             else
                          @@ -1953,11 +1976,14 @@ int up_i2cuninitialize(FAR struct i2c_dev_s * dev)
                            *
                            ************************************************************************************/
                           
                          +#ifdef CONFIG_I2C_RESET
                           int up_i2creset(FAR struct i2c_dev_s * dev)
                           {
                             struct stm32_i2c_priv_s * priv;
                          -  unsigned clock_count;
                          -  unsigned stretch_count;
                          +  unsigned int clock_count;
                          +  unsigned int stretch_count;
                          +  unit32_ scl_gpio;
                          +  unit32_ sda_gpio;
                             int ret = ERROR;
                             irqstate_t state;
                           
                          @@ -1979,83 +2005,70 @@ int up_i2creset(FAR struct i2c_dev_s * dev)
                           
                             stm32_i2c_deinit(priv);
                           
                          -  /* If possible, use GPIO configuration to un-wedge the bus */
                          +  /* Use GPIO configuration to un-wedge the bus */
                           
                          -  if ((priv->config->scl_gpio != 0) && (priv->config->sda_gpio != 0))
                          +  scl_gpio = MKI2C_OUTPUT(priv->config->scl_pin);
                          +  sda_gpio = MKI2C_OUTPUT(priv->config->sda_pin);
                          +
                          +  /* Clock the bus until any slaves currently driving it let it go. */
                          +
                          +  clock_count = 0;
                          +  while (!stm32_gpioread(sda_gpio)) 
                               {
                          -      stm32_configgpio(priv->config->scl_gpio);
                          -      stm32_configgpio(priv->config->sda_gpio);
                          +      /* Give up if we have tried too hard */
                           
                          -      /*
                          -       * Clock the bus until any slaves currently driving it let it go.
                          +      if (clock_count++ > 1000)
                          +        { 
                          +          goto out;
                          +        }
                          +
                          +      /* Sniff to make sure that clock stretching has finished.
                          +       *
                          +       * If the bus never relaxes, the reset has failed.
                                  */
                           
                          -      clock_count = 0;
                          -      while (!stm32_gpioread(priv->config->sda_gpio)) 
                          -        {
                          -
                          +      stretch_count = 0;
                          +      while (!stm32_gpioread(scl_gpio))
                          +        { 
                                     /* Give up if we have tried too hard */
                           
                          -          if (clock_count++ > 1000)
                          +          if (stretch_count++ > 1000)
                                       { 
                                         goto out;
                                       }
                           
                          -          /*
                          -           * Sniff to make sure that clock stretching has finished.
                          -           *
                          -           * If the bus never relaxes, the reset has failed.
                          -           */
                          -
                          -          stretch_count = 0;
                          -          while (!stm32_gpioread(priv->config->scl_gpio))
                          -            { 
                          -
                          -              /* Give up if we have tried too hard */
                          -
                          -              if (stretch_count++ > 1000)
                          -                { 
                          -                  goto out;
                          -                }
                          -
                          -              up_udelay(10);
                          -
                          -            }
                          -
                          -            /* Drive SCL low */
                          -
                          -            stm32_gpiowrite(priv->config->scl_gpio, 0);
                          -            up_udelay(10);
                          -
                          -            /* Drive SCL high again */
                          -
                          -            stm32_gpiowrite(priv->config->scl_gpio, 1);
                          -            up_udelay(10);
                          -
                          +          up_udelay(10);
                                   }
                           
                          -      /*
                          -       * Generate a start followed by a stop to reset slave
                          -       * state machines.
                          -       */
                          +      /* Drive SCL low */
                           
                          -      stm32_gpiowrite(priv->config->sda_gpio, 0);
                          -      up_udelay(10);
                          -      stm32_gpiowrite(priv->config->scl_gpio, 0);
                          -      up_udelay(10);
                          -      stm32_gpiowrite(priv->config->scl_gpio, 1);
                          -      up_udelay(10);
                          -      stm32_gpiowrite(priv->config->sda_gpio, 1);
                          +      stm32_gpiowrite(scl_gpio, 0);
                                 up_udelay(10);
                           
                          -      /*
                          -       * Revert the GPIO configuration.
                          -       */
                          -      stm32_unconfiggpio(priv->config->sda_gpio);
                          -      stm32_unconfiggpio(priv->config->scl_gpio);
                          +      /* Drive SCL high again */
                           
                          +      stm32_gpiowrite(scl_gpio, 1);
                          +      up_udelay(10);
                               }
                           
                          +  /* Generate a start followed by a stop to reset slave
                          +   * state machines.
                          +   */
                          +
                          +  stm32_gpiowrite(sda_gpio, 0);
                          +  up_udelay(10);
                          +  stm32_gpiowrite(scl_gpio, 0);
                          +  up_udelay(10);
                          +  stm32_gpiowrite(scl_gpio, 1);
                          +  up_udelay(10);
                          +  stm32_gpiowrite(sda_gpio, 1);
                          +  up_udelay(10);
                          +
                          +  /* Revert the GPIO configuration. */
                          + 
                          +  stm32_unconfiggpio(sda_gpio);
                          +  stm32_unconfiggpio(scl_gpio);
                          +
                             /* Re-init the port */
                           
                             stm32_i2c_init(priv);
                          @@ -2063,11 +2076,11 @@ int up_i2creset(FAR struct i2c_dev_s * dev)
                           
                           out:
                           
                          -  /* release the port for re-use by other clients */
                          +  /* Release the port for re-use by other clients */
                           
                             stm32_i2c_sem_post(dev);
                          -
                             return ret;
                           }
                          +#endif /* CONFIG_I2C_RESET */
                           
                          -#endif /* defined(CONFIG_STM32_I2C1) || defined(CONFIG_STM32_I2C2) || defined(CONFIG_STM32_I2C3) */
                          +#endif /* CONFIG_STM32_I2C1 || CONFIG_STM32_I2C2 || CONFIG_STM32_I2C3 */
                          diff --git a/nuttx/arch/arm/src/stm32/stm32_lowputc.c b/nuttx/arch/arm/src/stm32/stm32_lowputc.c
                          index 7f72056729..6cb07dad93 100644
                          --- a/nuttx/arch/arm/src/stm32/stm32_lowputc.c
                          +++ b/nuttx/arch/arm/src/stm32/stm32_lowputc.c
                          @@ -67,6 +67,14 @@
                           #  define STM32_CONSOLE_2STOP    CONFIG_USART1_2STOP
                           #  define STM32_CONSOLE_TX       GPIO_USART1_TX
                           #  define STM32_CONSOLE_RX       GPIO_USART1_RX
                          +#  ifdef CONFIG_USART1_RS485
                          +#    define STM32_CONSOLE_RS485_DIR GPIO_USART1_RS485_DIR
                          +#    if (CONFIG_USART1_RS485_DIR_POLARITY == 0)
                          +#      define STM32_CONSOLE_RS485_DIR_POLARITY false
                          +#    else
                          +#      define STM32_CONSOLE_RS485_DIR_POLARITY true
                          +#    endif
                          +#  endif
                           #elif defined(CONFIG_USART2_SERIAL_CONSOLE)
                           #  define STM32_CONSOLE_BASE     STM32_USART2_BASE
                           #  define STM32_APBCLOCK         STM32_PCLK1_FREQUENCY
                          @@ -76,6 +84,14 @@
                           #  define STM32_CONSOLE_2STOP    CONFIG_USART2_2STOP
                           #  define STM32_CONSOLE_TX       GPIO_USART2_TX
                           #  define STM32_CONSOLE_RX       GPIO_USART2_RX
                          +#  ifdef CONFIG_USART2_RS485
                          +#    define STM32_CONSOLE_RS485_DIR GPIO_USART2_RS485_DIR
                          +#    if (CONFIG_USART2_RS485_DIR_POLARITY == 0)
                          +#      define STM32_CONSOLE_RS485_DIR_POLARITY false
                          +#    else
                          +#      define STM32_CONSOLE_RS485_DIR_POLARITY true
                          +#    endif
                          +#  endif
                           #elif defined(CONFIG_USART3_SERIAL_CONSOLE)
                           #  define STM32_CONSOLE_BASE     STM32_USART3_BASE
                           #  define STM32_APBCLOCK         STM32_PCLK1_FREQUENCY
                          @@ -85,6 +101,14 @@
                           #  define STM32_CONSOLE_2STOP    CONFIG_USART3_2STOP
                           #  define STM32_CONSOLE_TX       GPIO_USART3_TX
                           #  define STM32_CONSOLE_RX       GPIO_USART3_RX
                          +#  ifdef CONFIG_USART3_RS485
                          +#    define STM32_CONSOLE_RS485_DIR GPIO_USART3_RS485_DIR
                          +#    if (CONFIG_USART3_RS485_DIR_POLARITY == 0)
                          +#      define STM32_CONSOLE_RS485_DIR_POLARITY false
                          +#    else
                          +#      define STM32_CONSOLE_RS485_DIR_POLARITY true
                          +#    endif
                          +#  endif
                           #elif defined(CONFIG_UART4_SERIAL_CONSOLE)
                           #  define STM32_CONSOLE_BASE     STM32_UART4_BASE
                           #  define STM32_APBCLOCK         STM32_PCLK1_FREQUENCY
                          @@ -94,6 +118,14 @@
                           #  define STM32_CONSOLE_2STOP    CONFIG_UART4_2STOP
                           #  define STM32_CONSOLE_TX       GPIO_UART4_TX
                           #  define STM32_CONSOLE_RX       GPIO_UART4_RX
                          +#  ifdef CONFIG_UART4_RS485
                          +#    define STM32_CONSOLE_RS485_DIR GPIO_UART4_RS485_DIR
                          +#    if (CONFIG_UART4_RS485_DIR_POLARITY == 0)
                          +#      define STM32_CONSOLE_RS485_DIR_POLARITY false
                          +#    else
                          +#      define STM32_CONSOLE_RS485_DIR_POLARITY true
                          +#    endif
                          +#  endif
                           #elif defined(CONFIG_UART5_SERIAL_CONSOLE)
                           #  define STM32_CONSOLE_BASE     STM32_UART5_BASE
                           #  define STM32_APBCLOCK         STM32_PCLK1_FREQUENCY
                          @@ -103,6 +135,14 @@
                           #  define STM32_CONSOLE_2STOP    CONFIG_UART5_2STOP
                           #  define STM32_CONSOLE_TX       GPIO_UART5_TX
                           #  define STM32_CONSOLE_RX       GPIO_UART5_RX
                          +#  ifdef CONFIG_UART5_RS485
                          +#    define STM32_CONSOLE_RS485_DIR GPIO_UART5_RS485_DIR
                          +#    if (CONFIG_UART5_RS485_DIR_POLARITY == 0)
                          +#      define STM32_CONSOLE_RS485_DIR_POLARITY false
                          +#    else
                          +#      define STM32_CONSOLE_RS485_DIR_POLARITY true
                          +#    endif
                          +#  endif
                           #elif defined(CONFIG_USART6_SERIAL_CONSOLE)
                           #  define STM32_CONSOLE_BASE     STM32_USART6_BASE
                           #  define STM32_APBCLOCK         STM32_PCLK2_FREQUENCY
                          @@ -112,6 +152,14 @@
                           #  define STM32_CONSOLE_2STOP    CONFIG_USART6_2STOP
                           #  define STM32_CONSOLE_TX       GPIO_USART6_TX
                           #  define STM32_CONSOLE_RX       GPIO_USART6_RX
                          +#  ifdef CONFIG_USART6_RS485
                          +#    define STM32_CONSOLE_RS485_DIR GPIO_USART6_RS485_DIR
                          +#    if (CONFIG_USART6_RS485_DIR_POLARITY == 0)
                          +#      define STM32_CONSOLE_RS485_DIR_POLARITY false
                          +#    else
                          +#      define STM32_CONSOLE_RS485_DIR_POLARITY true
                          +#    endif
                          +#  endif
                           #endif
                           
                           /* CR1 settings */
                          @@ -230,10 +278,19 @@ void up_lowputc(char ch)
                             /* Wait until the TX data register is empty */
                           
                             while ((getreg32(STM32_CONSOLE_BASE + STM32_USART_SR_OFFSET) & USART_SR_TXE) == 0);
                          +#if STM32_CONSOLE_RS485_DIR
                          +  stm32_gpiowrite(STM32_CONSOLE_RS485_DIR, STM32_CONSOLE_RS485_DIR_POLARITY);
                          +#endif
                           
                             /* Then send the character */
                           
                             putreg32((uint32_t)ch, STM32_CONSOLE_BASE + STM32_USART_DR_OFFSET);
                          +
                          +#if STM32_CONSOLE_RS485_DIR
                          +  while ((getreg32(STM32_CONSOLE_BASE + STM32_USART_SR_OFFSET) & USART_SR_TC) == 0);
                          +  stm32_gpiowrite(STM32_CONSOLE_RS485_DIR, !STM32_CONSOLE_RS485_DIR_POLARITY);
                          +#endif
                          +
                           #endif
                           }
                           
                          @@ -328,7 +385,14 @@ void stm32_lowsetup(void)
                           
                           #ifdef STM32_CONSOLE_TX
                             stm32_configgpio(STM32_CONSOLE_TX);
                          -  stm32_configgpio(STM32_CONSOLE_TX);
                          +#endif
                          +#ifdef STM32_CONSOLE_RX
                          +  stm32_configgpio(STM32_CONSOLE_RX);
                          +#endif
                          +
                          +#if STM32_CONSOLE_RS485_DIR
                          +  stm32_configgpio(STM32_CONSOLE_RS485_DIR);
                          +  stm32_gpiowrite(STM32_CONSOLE_RS485_DIR, !STM32_CONSOLE_RS485_DIR_POLARITY);
                           #endif
                           
                             /* Enable and configure the selected console device */
                          @@ -382,7 +446,14 @@ void stm32_lowsetup(void)
                           
                           #ifdef STM32_CONSOLE_TX
                             stm32_configgpio(STM32_CONSOLE_TX);
                          -  stm32_configgpio(STM32_CONSOLE_TX);
                          +#endif
                          +#ifdef STM32_CONSOLE_RX
                          +  stm32_configgpio(STM32_CONSOLE_RX);
                          +#endif
                          +
                          +#if STM32_CONSOLE_RS485_DIR
                          +  stm32_configgpio(STM32_CONSOLE_RS485_DIR);
                          +  stm32_gpiowrite(STM32_CONSOLE_RS485_DIR, !STM32_CONSOLE_RS485_DIR_POLARITY);
                           #endif
                           
                             /* Enable and configure the selected console device */
                          diff --git a/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c b/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c
                          index 461d500ad1..94772b693f 100644
                          --- a/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c
                          +++ b/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c
                          @@ -3651,10 +3651,14 @@ static int stm32_epout_configure(FAR struct stm32_ep_s *privep, uint8_t eptype,
                             regval  = stm32_getreg(regaddr);
                             if ((regval & OTGFS_DOEPCTL_USBAEP) == 0)
                               {
                          -      regval &= ~(OTGFS_DOEPCTL_MPSIZ_MASK | OTGFS_DIEPCTL_EPTYP_MASK | OTGFS_DIEPCTL_TXFNUM_MASK);
                          +      if (regval & OTGFS_DOEPCTL_NAKSTS)
                          +        {
                          +          regval |= OTGFS_DOEPCTL_CNAK;
                          +        }
                          +      
                          +      regval &= ~(OTGFS_DOEPCTL_MPSIZ_MASK | OTGFS_DOEPCTL_EPTYP_MASK);
                                 regval |= mpsiz;
                                 regval |= (eptype << OTGFS_DOEPCTL_EPTYP_SHIFT);
                          -      regval |= (eptype << OTGFS_DIEPCTL_TXFNUM_SHIFT);
                                 regval |= (OTGFS_DOEPCTL_SD0PID | OTGFS_DOEPCTL_USBAEP);
                                 stm32_putreg(regval, regaddr);
                           
                          @@ -3743,6 +3747,11 @@ static int stm32_epin_configure(FAR struct stm32_ep_s *privep, uint8_t eptype,
                             regval  = stm32_getreg(regaddr);
                             if ((regval & OTGFS_DIEPCTL_USBAEP) == 0)
                               {
                          +      if (regval & OTGFS_DIEPCTL_NAKSTS)
                          +        {
                          +          regval |= OTGFS_DIEPCTL_CNAK;
                          +        }
                          +      
                                 regval &= ~(OTGFS_DIEPCTL_MPSIZ_MASK | OTGFS_DIEPCTL_EPTYP_MASK | OTGFS_DIEPCTL_TXFNUM_MASK);
                                 regval |= mpsiz;
                                 regval |= (eptype << OTGFS_DIEPCTL_EPTYP_SHIFT);
                          @@ -3900,7 +3909,7 @@ static void stm32_epout_disable(FAR struct stm32_ep_s *privep)
                            * Name: stm32_epin_disable
                            *
                            * Description:
                          - *   Diable an IN endpoint will no longer be used
                          + *   Disable an IN endpoint when it will no longer be used
                            *
                            *******************************************************************************/
                           
                          @@ -3912,6 +3921,17 @@ static void stm32_epin_disable(FAR struct stm32_ep_s *privep)
                           
                             usbtrace(TRACE_EPDISABLE, privep->epphy);
                           
                          +  /* After USB reset, the endpoint will already be deactivated by the
                          +   * hardware. Trying to disable again will just hang in the wait.
                          +   */
                          +
                          +  regaddr = STM32_OTGFS_DIEPCTL(privep->epphy);
                          +  regval  = stm32_getreg(regaddr);
                          +  if ((regval & OTGFS_DIEPCTL_USBAEP) == 0)
                          +    {
                          +      return;
                          +    }
                          +
                             /* Make sure that there is no pending IPEPNE interrupt (because we are
                              * to poll this bit below).
                              */
                          diff --git a/nuttx/arch/arm/src/stm32/stm32_qencoder.c b/nuttx/arch/arm/src/stm32/stm32_qencoder.c
                          index 8553296f93..d37614c03c 100644
                          --- a/nuttx/arch/arm/src/stm32/stm32_qencoder.c
                          +++ b/nuttx/arch/arm/src/stm32/stm32_qencoder.c
                          @@ -607,6 +607,7 @@ static FAR struct stm32_lowerhalf_s *stm32_tim2lower(int tim)
                           #endif
                           #ifdef CONFIG_STM32_TIM3_QE
                               case 3:
                          +      return &g_tim3lower;
                           #endif
                           #ifdef CONFIG_STM32_TIM4_QE
                               case 4:
                          diff --git a/nuttx/arch/arm/src/stm32/stm32_serial.c b/nuttx/arch/arm/src/stm32/stm32_serial.c
                          index c7f97b25ac..aa46a8987a 100644
                          --- a/nuttx/arch/arm/src/stm32/stm32_serial.c
                          +++ b/nuttx/arch/arm/src/stm32/stm32_serial.c
                          @@ -198,11 +198,15 @@ struct up_dev_s
                             uint8_t           parity;    /* 0=none, 1=odd, 2=even */
                             uint8_t           bits;      /* Number of bits (7 or 8) */
                             bool              stopbits2; /* True: Configure with 2 stop bits instead of 1 */
                          +  bool              iflow;     /* input flow control (RTS) enabled */
                          +  bool              oflow;     /* output flow control (CTS) enabled */
                             uint32_t          baud;      /* Configured baud */
                           #else
                             const uint8_t     parity;    /* 0=none, 1=odd, 2=even */
                             const uint8_t     bits;      /* Number of bits (7 or 8) */
                             const bool        stopbits2; /* True: Configure with 2 stop bits instead of 1 */
                          +  const bool        iflow;     /* input flow control (RTS) enabled */
                          +  const bool        oflow;     /* output flow control (CTS) enabled */
                             const uint32_t    baud;      /* Configured baud */
                           #endif
                           
                          @@ -239,7 +243,7 @@ struct up_dev_s
                            * Private Function Prototypes
                            ****************************************************************************/
                           
                          -static void up_setspeed(struct uart_dev_s *dev);
                          +static void up_set_format(struct uart_dev_s *dev);
                           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);
                          @@ -411,6 +415,8 @@ static struct up_dev_s g_usart1priv =
                             .parity        = CONFIG_USART1_PARITY,
                             .bits          = CONFIG_USART1_BITS,
                             .stopbits2     = CONFIG_USART1_2STOP,
                          +  .iflow         = false,
                          +  .oflow         = false,
                             .baud          = CONFIG_USART1_BAUD,
                             .apbclock      = STM32_PCLK2_FREQUENCY,
                             .usartbase     = STM32_USART1_BASE,
                          @@ -471,6 +477,8 @@ static struct up_dev_s g_usart2priv =
                             .parity        = CONFIG_USART2_PARITY,
                             .bits          = CONFIG_USART2_BITS,
                             .stopbits2     = CONFIG_USART2_2STOP,
                          +  .iflow         = false,
                          +  .oflow         = false,
                             .baud          = CONFIG_USART2_BAUD,
                             .apbclock      = STM32_PCLK1_FREQUENCY,
                             .usartbase     = STM32_USART2_BASE,
                          @@ -531,6 +539,8 @@ static struct up_dev_s g_usart3priv =
                             .parity        = CONFIG_USART3_PARITY,
                             .bits          = CONFIG_USART3_BITS,
                             .stopbits2     = CONFIG_USART3_2STOP,
                          +  .iflow         = false,
                          +  .oflow         = false,
                             .baud          = CONFIG_USART3_BAUD,
                             .apbclock      = STM32_PCLK1_FREQUENCY,
                             .usartbase     = STM32_USART3_BASE,
                          @@ -591,17 +601,15 @@ static struct up_dev_s g_uart4priv =
                             .parity        = CONFIG_UART4_PARITY,
                             .bits          = CONFIG_UART4_BITS,
                             .stopbits2     = CONFIG_UART4_2STOP,
                          +  .iflow         = false,
                          +  .oflow         = false,
                             .baud          = CONFIG_UART4_BAUD,
                             .apbclock      = STM32_PCLK1_FREQUENCY,
                             .usartbase     = STM32_UART4_BASE,
                             .tx_gpio       = GPIO_UART4_TX,
                             .rx_gpio       = GPIO_UART4_RX,
                          -#ifdef GPIO_UART4_CTS
                          -  .cts_gpio      = GPIO_UART4_CTS,
                          -#endif
                          -#ifdef GPIO_UART4_RTS
                          -  .rts_gpio      = GPIO_UART4_RTS,
                          -#endif
                          +  .cts_gpio      = 0,  /* flow control not supported on this port */
                          +  .rts_gpio      = 0,  /* flow control not supported on this port */
                           #ifdef CONFIG_UART4_RXDMA
                             .rxdma_channel = DMAMAP_UART4_RX,
                             .rxfifo        = g_uart4rxfifo,
                          @@ -651,17 +659,15 @@ static struct up_dev_s g_uart5priv =
                             .parity         = CONFIG_UART5_PARITY,
                             .bits           = CONFIG_UART5_BITS,
                             .stopbits2      = CONFIG_UART5_2STOP,
                          +  .iflow         = false,
                          +  .oflow         = false,
                             .baud           = CONFIG_UART5_BAUD,
                             .apbclock       = STM32_PCLK1_FREQUENCY,
                             .usartbase      = STM32_UART5_BASE,
                             .tx_gpio        = GPIO_UART5_TX,
                             .rx_gpio        = GPIO_UART5_RX,
                          -#ifdef GPIO_UART5_CTS
                          -  .cts_gpio       = GPIO_UART5_CTS,
                          -#endif
                          -#ifdef GPIO_UART5_RTS
                          -  .rts_gpio       = GPIO_UART5_RTS,
                          -#endif
                          +  .cts_gpio       = 0,  /* flow control not supported on this port */
                          +  .rts_gpio       = 0,  /* flow control not supported on this port */
                           #ifdef CONFIG_UART5_RXDMA
                             .rxdma_channel = DMAMAP_UART5_RX,
                             .rxfifo        = g_uart5rxfifo,
                          @@ -711,6 +717,8 @@ static struct up_dev_s g_usart6priv =
                             .parity         = CONFIG_USART6_PARITY,
                             .bits           = CONFIG_USART6_BITS,
                             .stopbits2      = CONFIG_USART6_2STOP,
                          +  .iflow         = false,
                          +  .oflow         = false,
                             .baud           = CONFIG_USART6_BAUD,
                             .apbclock       = STM32_PCLK2_FREQUENCY,
                             .usartbase      = STM32_USART6_BASE,
                          @@ -884,21 +892,22 @@ static int up_dma_nextrx(struct up_dev_s *priv)
                           #endif
                           
                           /****************************************************************************
                          - * Name: up_setspeed
                          + * Name: up_set_format
                            *
                            * Description:
                          - *   Set the serial line speed.
                          + *   Set the serial line format and speed.
                            *
                            ****************************************************************************/
                           
                           #ifndef CONFIG_SUPPRESS_UART_CONFIG
                          -static void up_setspeed(struct uart_dev_s *dev)
                          +static void up_set_format(struct uart_dev_s *dev)
                           {
                             struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
                             uint32_t usartdiv32;
                             uint32_t mantissa;
                             uint32_t fraction;
                             uint32_t brr;
                          +  uint32_t regval;
                           
                             /* Configure the USART Baud Rate.  The baud rate for the receiver and
                              * transmitter (Rx and Tx) are both set to the same value as programmed
                          @@ -928,8 +937,52 @@ static void up_setspeed(struct uart_dev_s *dev)
                              fraction   = (usartdiv32 - (mantissa << 5) + 1) >> 1;
                              brr       |= fraction << USART_BRR_FRAC_SHIFT;
                              up_serialout(priv, STM32_USART_BRR_OFFSET, brr);
                          +
                          +  /* Configure parity mode */
                          +
                          +  regval  = up_serialin(priv, STM32_USART_CR1_OFFSET);
                          +  regval &= ~(USART_CR1_PCE|USART_CR1_PS);
                          +
                          +  if (priv->parity == 1)       /* Odd parity */
                          +    {
                          +      regval |= (USART_CR1_PCE|USART_CR1_PS);
                          +    }
                          +  else if (priv->parity == 2)  /* Even parity */
                          +    {
                          +      regval |= USART_CR1_PCE;
                          +    }
                          +
                          +  up_serialout(priv, STM32_USART_CR1_OFFSET, regval);
                          +
                          +  /* Configure STOP bits */
                          +
                          +  regval = up_serialin(priv, STM32_USART_CR2_OFFSET);
                          +  regval &= ~(USART_CR2_STOP_MASK);
                          +
                          +  if (priv->stopbits2)
                          +    {
                          +      regval |= USART_CR2_STOP2;
                          +    }
                          +  up_serialout(priv, STM32_USART_CR2_OFFSET, regval);
                          +
                          +  /* Configure hardware flow control */
                          +
                          +  regval  = up_serialin(priv, STM32_USART_CR3_OFFSET);
                          +  regval &= ~(USART_CR3_CTSE|USART_CR3_RTSE);
                          +
                          +  if (priv->iflow && (priv->rts_gpio != 0))
                          +    { 
                          +      regval |= USART_CR3_RTSE;
                          +    }
                          +  if (priv->oflow && (priv->cts_gpio != 0))
                          +    { 
                          +      regval |= USART_CR3_CTSE;
                          +    }
                          +
                          +  up_serialout(priv, STM32_USART_CR3_OFFSET, regval);
                          +
                           }
                          -#endif
                          +#endif /* CONFIG_SUPPRESS_UART_CONFIG */
                           
                           /****************************************************************************
                            * Name: up_setup
                          @@ -974,43 +1027,28 @@ static int up_setup(struct uart_dev_s *dev)
                           #endif
                           
                             /* Configure CR2 */
                          -  /* Clear STOP, CLKEN, CPOL, CPHA, LBCL, and interrupt enable bits */
                          +  /* Clear CLKEN, CPOL, CPHA, LBCL, and interrupt enable bits */
                           
                             regval = up_serialin(priv, STM32_USART_CR2_OFFSET);
                          -  regval &= ~(USART_CR2_STOP_MASK|USART_CR2_CLKEN|USART_CR2_CPOL|
                          +  regval &= ~(USART_CR2_CLKEN|USART_CR2_CPOL|
                                         USART_CR2_CPHA|USART_CR2_LBCL|USART_CR2_LBDIE);
                           
                          -  /* Configure STOP bits */
                          -
                          -  if (priv->stopbits2)
                          -    {
                          -      regval |= USART_CR2_STOP2;
                          -    }
                             up_serialout(priv, STM32_USART_CR2_OFFSET, regval);
                           
                             /* Configure CR1 */
                          -  /* Clear M, PCE, PS, TE, REm and all interrupt enable bits */
                          +  /* Clear M, TE, REm and all interrupt enable bits */
                           
                             regval  = up_serialin(priv, STM32_USART_CR1_OFFSET);
                          -  regval &= ~(USART_CR1_M|USART_CR1_PCE|USART_CR1_PS|USART_CR1_TE|
                          +  regval &= ~(USART_CR1_M|USART_CR1_TE|
                                         USART_CR1_RE|USART_CR1_ALLINTS);
                           
                          -  /* Configure word length and parity mode */
                          +  /* Configure word length */
                           
                             if (priv->bits == 9)         /* Default: 1 start, 8 data, n stop */
                               {
                                 regval |= USART_CR1_M;   /* 1 start, 9 data, n stop */
                               }
                           
                          -  if (priv->parity == 1)       /* Odd parity */
                          -    {
                          -      regval |= (USART_CR1_PCE|USART_CR1_PS);
                          -    }
                          -  else if (priv->parity == 2)  /* Even parity */
                          -    {
                          -      regval |= USART_CR1_PCE;
                          -    }
                          -
                             up_serialout(priv, STM32_USART_CR1_OFFSET, regval);
                           
                             /* Configure CR3 */
                          @@ -1023,9 +1061,9 @@ static int up_setup(struct uart_dev_s *dev)
                           
                             up_serialout(priv, STM32_USART_CR3_OFFSET, regval);
                           
                          -  /* Configure the USART Baud Rate. */
                          +  /* Configure the USART line format and speed. */
                           
                          -  up_setspeed(dev);
                          +  up_set_format(dev);
                           
                             /* Enable Rx, Tx, and the USART */
                           
                          @@ -1056,12 +1094,15 @@ static int up_dma_setup(struct uart_dev_s *dev)
                             int result;
                             uint32_t regval;
                           
                          -  /* Do the basic UART setup first */
                          +  /* Do the basic UART setup first, unless we are the console */
                           
                          -  result = up_setup(dev);
                          -  if (result != OK)
                          -    {
                          -      return result;
                          +  if (!dev->isconsole)
                          +    {    
                          +      result = up_setup(dev);
                          +      if (result != OK)
                          +        {
                          +          return result;
                          +        }
                               }
                           
                             /* Acquire the DMA channel.  This should always succeed. */
                          @@ -1371,12 +1412,21 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
                                       break;
                                     }
                           
                          -        /* TODO:  Other termios fields are not yet returned.
                          -         * Note that only cfsetospeed is not necessary because we have
                          -         * knowledge that only one speed is supported.
                          +        cfsetispeed(termiosp, priv->baud);
                          +
                          +        /* Note that since we only support 8/9 bit modes and
                          +         * there is no way to report 9-bit mode, we always claim 8.
                                    */
                           
                          -        cfsetispeed(termiosp, priv->baud);
                          +        termiosp->c_cflag = 
                          +          ((priv->parity != 0) ? PARENB : 0) |
                          +          ((priv->parity == 1) ? PARODD : 0) |
                          +          ((priv->stopbits2) ? CSTOPB : 0) |
                          +          ((priv->oflow) ? CCTS_OFLOW : 0) |
                          +          ((priv->iflow) ? CRTS_IFLOW : 0) |
                          +          CS8;
                          +
                          +        /* TODO: CCTS_IFLOW, CCTS_OFLOW */
                                 }
                                 break;
                           
                          @@ -1390,16 +1440,48 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
                                       break;
                                     }
                           
                          -        /* TODO:  Handle other termios settings.
                          -         * Note that only cfgetispeed is used besued we have knowledge
                          +        /* Perform some sanity checks before accepting any changes */
                          +
                          +        if (((termiosp->c_cflag & CSIZE) != CS8) ||
                          +            ((termiosp->c_cflag & CCTS_OFLOW) && (priv->cts_gpio == 0)) ||
                          +            ((termiosp->c_cflag & CRTS_IFLOW) && (priv->rts_gpio == 0)))
                          +          { 
                          +            ret = -EINVAL;
                          +            break;
                          +          }
                          +
                          +        if (termiosp->c_cflag & PARENB)
                          +          { 
                          +            priv->parity = (termiosp->c_cflag & PARODD) ? 1 : 2;
                          +          }
                          +        else
                          +          { 
                          +            priv->parity = 0;
                          +          }
                          +
                          +        priv->stopbits2 = (termiosp->c_cflag & CSTOPB) != 0;
                          +        priv->oflow = (termiosp->c_cflag & CCTS_OFLOW) != 0;
                          +        priv->iflow = (termiosp->c_cflag & CRTS_IFLOW) != 0;
                          +
                          +        /* Note that since there is no way to request 9-bit mode
                          +         * and no way to support 5/6/7-bit modes, we ignore them
                          +         * all here.
                          +         */
                          +
                          +        /* Note that only cfgetispeed is used because we have knowledge
                                    * that only one speed is supported.
                                    */
                           
                                   priv->baud = cfgetispeed(termiosp);
                          -        up_setspeed(dev);
                          +
                          +        /* effect the changes immediately - note that we do not implement
                          +         * TCSADRAIN / TCSAFLUSH
                          +         */
                          +
                          +        up_set_format(dev);
                                 }
                                 break;
                          -#endif
                          +#endif /* CONFIG_SERIAL_TERMIOS */
                           
                           #ifdef CONFIG_USART_BREAKS
                               case TIOCSBRK:  /* BSD compatibility: Turn break on, unconditionally */
                          diff --git a/nuttx/arch/arm/src/stm32/stm32_uart.h b/nuttx/arch/arm/src/stm32/stm32_uart.h
                          index a70923cbf9..8ff6a9975f 100644
                          --- a/nuttx/arch/arm/src/stm32/stm32_uart.h
                          +++ b/nuttx/arch/arm/src/stm32/stm32_uart.h
                          @@ -223,6 +223,20 @@
                           #  undef SERIAL_HAVE_ONLY_DMA
                           #endif
                           
                          +/* Is RS-485 used? */
                          +
                          +#if defined(CONFIG_USART1_RS485) || defined(CONFIG_USART2_RS485) || \
                          +    defined(CONFIG_USART3_RS485) || defined(CONFIG_UART4_RS485)  || \
                          +    defined(CONFIG_UART5_RS485) || defined(CONFIG_USART6_RS485)
                          +#  define HAVE_RS485 1
                          +#endif
                          +
                          +#ifdef HAVE_RS485
                          +#  define USART_CR1_USED_INTS    (USART_CR1_RXNEIE | USART_CR1_TXEIE | USART_CR1_PEIE | USART_CR1_TCIE)
                          +#else
                          +#  define USART_CR1_USED_INTS    (USART_CR1_RXNEIE | USART_CR1_TXEIE | USART_CR1_PEIE)
                          +#endif
                          +
                           /************************************************************************************
                            * Public Types
                            ************************************************************************************/
                          diff --git a/nuttx/arch/arm/src/stm32/stm32f10xxx_rcc.c b/nuttx/arch/arm/src/stm32/stm32f10xxx_rcc.c
                          index 47ed5e016b..ae3fa516ea 100644
                          --- a/nuttx/arch/arm/src/stm32/stm32f10xxx_rcc.c
                          +++ b/nuttx/arch/arm/src/stm32/stm32f10xxx_rcc.c
                          @@ -92,7 +92,11 @@ static inline void rcc_reset(void)
                             putreg32(regval, STM32_RCC_CR);
                           
                             regval  = getreg32(STM32_RCC_CFGR);       /* Reset PLLSRC, PLLXTPRE, PLLMUL and USBPRE bits */
                          -  regval &= ~(RCC_CFGR_PLLSRC|RCC_CFGR_PLLXTPRE|RCC_CFGR_PLLMUL_MASK|RCC_CFGR_USBPRE);
                          +  regval &= ~(RCC_CFGR_PLLSRC|RCC_CFGR_PLLXTPRE|RCC_CFGR_PLLMUL_MASK
                          +#ifndef CONFIG_STM32_VALUELINE
                          +              |RCC_CFGR_USBPRE
                          +#endif
                          +              );
                             putreg32(regval, STM32_RCC_CFGR);
                           
                             putreg32(0, STM32_RCC_CIR);               /* Disable all interrupts */
                          @@ -224,6 +228,27 @@ static inline void rcc_enableapb1(void)
                           #endif
                           #endif
                           
                          +#ifdef CONFIG_STM32_TIM12
                          +  /* Timer 12 clock enable */
                          +#ifdef CONFIG_STM32_FORCEPOWER
                          +  regval |= RCC_APB1ENR_TIM12EN;
                          +#endif
                          +#endif
                          +
                          +#ifdef CONFIG_STM32_TIM13
                          +  /* Timer 13 clock enable */
                          +#ifdef CONFIG_STM32_FORCEPOWER
                          +  regval |= RCC_APB1ENR_TIM13EN;
                          +#endif
                          +#endif
                          +
                          +#ifdef CONFIG_STM32_TIM14
                          +  /* Timer 14 clock enable */
                          +#ifdef CONFIG_STM32_FORCEPOWER
                          +  regval |= RCC_APB1ENR_TIM14EN;
                          +#endif
                          +#endif
                          +
                           #ifdef CONFIG_STM32_WWDG
                             /* Window Watchdog clock enable */
                           
                          @@ -315,6 +340,13 @@ static inline void rcc_enableapb1(void)
                           
                             regval |= RCC_APB1ENR_DACEN;
                           #endif
                          +
                          +#ifdef CONFIG_STM32_CEC
                          +  /* CEC clock enable */
                          +
                          +  regval |= RCC_APB1ENR_CECEN;
                          +#endif
                          +
                             putreg32(regval, STM32_RCC_APB1ENR);
                           }
                           
                          @@ -404,6 +436,28 @@ static inline void rcc_enableapb2(void)
                           
                             regval |= RCC_APB2ENR_ADC3EN;
                           #endif
                          +
                          +#ifdef CONFIG_STM32_TIM15
                          +  /* TIM15 Timer clock enable */
                          +#ifdef CONFIG_STM32_FORCEPOWER
                          +  regval |= RCC_APB2ENR_TIM15EN;
                          +#endif
                          +#endif
                          +
                          +#ifdef CONFIG_STM32_TIM16
                          +  /* TIM16 Timer clock enable */
                          +#ifdef CONFIG_STM32_FORCEPOWER
                          +  regval |= RCC_APB2ENR_TIM16EN;
                          +#endif
                          +#endif
                          +
                          +#ifdef CONFIG_STM32_TIM17
                          +  /* TIM17 Timer clock enable */
                          +#ifdef CONFIG_STM32_FORCEPOWER
                          +  regval |= RCC_APB2ENR_TIM17EN;
                          +#endif
                          +#endif
                          +
                             putreg32(regval, STM32_RCC_APB2ENR);
                           }
                           
                          diff --git a/nuttx/binfmt/binfmt_exec.c b/nuttx/binfmt/binfmt_exec.c
                          index c070324c31..60e8d8efde 100644
                          --- a/nuttx/binfmt/binfmt_exec.c
                          +++ b/nuttx/binfmt/binfmt_exec.c
                          @@ -44,7 +44,7 @@
                           #include 
                           #include 
                           
                          -#include 
                          +#include 
                           
                           #include "binfmt_internal.h"
                           
                          diff --git a/nuttx/binfmt/binfmt_globals.c b/nuttx/binfmt/binfmt_globals.c
                          index 069d3a2aa9..d3246bd506 100644
                          --- a/nuttx/binfmt/binfmt_globals.c
                          +++ b/nuttx/binfmt/binfmt_globals.c
                          @@ -39,7 +39,7 @@
                           
                           #include 
                           
                          -#include 
                          +#include 
                           
                           #ifndef CONFIG_BINFMT_DISABLE
                           
                          diff --git a/nuttx/binfmt/binfmt_internal.h b/nuttx/binfmt/binfmt_internal.h
                          index da67f5350b..4fab9724d4 100644
                          --- a/nuttx/binfmt/binfmt_internal.h
                          +++ b/nuttx/binfmt/binfmt_internal.h
                          @@ -42,7 +42,7 @@
                           
                           #include 
                           
                          -#include 
                          +#include 
                           
                           /****************************************************************************
                            * Pre-processor Definitions
                          diff --git a/nuttx/binfmt/binfmt_register.c b/nuttx/binfmt/binfmt_register.c
                          index 7f6eef671a..925f29353f 100644
                          --- a/nuttx/binfmt/binfmt_register.c
                          +++ b/nuttx/binfmt/binfmt_register.c
                          @@ -44,7 +44,7 @@
                           #include 
                           #include 
                           
                          -#include 
                          +#include 
                           
                           #include "binfmt_internal.h"
                           
                          diff --git a/nuttx/binfmt/binfmt_unregister.c b/nuttx/binfmt/binfmt_unregister.c
                          index b97b9b67dd..f895e354d0 100644
                          --- a/nuttx/binfmt/binfmt_unregister.c
                          +++ b/nuttx/binfmt/binfmt_unregister.c
                          @@ -44,7 +44,7 @@
                           #include 
                           #include 
                           
                          -#include 
                          +#include 
                           
                           #include "binfmt_internal.h"
                           
                          diff --git a/nuttx/binfmt/libnxflat/Kconfig b/nuttx/binfmt/libnxflat/Kconfig
                          index ae2bf31307..fdb270cfb2 100644
                          --- a/nuttx/binfmt/libnxflat/Kconfig
                          +++ b/nuttx/binfmt/libnxflat/Kconfig
                          @@ -2,3 +2,8 @@
                           # For a description of the syntax of this configuration file,
                           # see misc/tools/kconfig-language.txt.
                           #
                          +
                          +config NXFLAT_DUMPBUFFER
                          +	bool "Dump NXFLAT buffers"
                          +	default n
                          +	depends on DEBUG && DEBUG_VERBOSE
                          diff --git a/nuttx/binfmt/libnxflat/libnxflat_init.c b/nuttx/binfmt/libnxflat/libnxflat_init.c
                          index 5b6375ff16..b7cac8d866 100644
                          --- a/nuttx/binfmt/libnxflat/libnxflat_init.c
                          +++ b/nuttx/binfmt/libnxflat/libnxflat_init.c
                          @@ -48,7 +48,7 @@
                           #include 
                           
                           #include 
                          -#include 
                          +#include 
                           
                           /****************************************************************************
                            * Pre-Processor Definitions
                          @@ -112,8 +112,9 @@ int nxflat_init(const char *filename, struct nxflat_loadinfo_s *loadinfo)
                             loadinfo->filfd = open(filename, O_RDONLY);
                             if (loadinfo->filfd < 0)
                               {
                          -      bdbg("Failed to open NXFLAT binary %s: %d\n", filename, ret);
                          -      return -errno;      
                          +      int errval = errno;
                          +      bdbg("Failed to open NXFLAT binary %s: %d\n", filename, errval);
                          +      return -errval;      
                               }
                           
                             /* Read the NXFLAT header from offset 0 */
                          diff --git a/nuttx/binfmt/libnxflat/libnxflat_read.c b/nuttx/binfmt/libnxflat/libnxflat_read.c
                          index dbcd542791..8deeb0805e 100644
                          --- a/nuttx/binfmt/libnxflat/libnxflat_read.c
                          +++ b/nuttx/binfmt/libnxflat/libnxflat_read.c
                          @@ -48,7 +48,7 @@
                           #include 
                           
                           #include 
                          -#include 
                          +#include 
                           
                           /****************************************************************************
                            * Pre-Processor Definitions
                          @@ -129,8 +129,9 @@ int nxflat_read(struct nxflat_loadinfo_s *loadinfo, char *buffer, int readsize,
                                 rpos = lseek(loadinfo->filfd, offset, SEEK_SET);
                                 if (rpos != offset)
                                   {
                          -          bdbg("Failed to seek to position %d: %d\n", offset, errno);
                          -          return -errno;
                          +          int errval = errno;
                          +          bdbg("Failed to seek to position %d: %d\n", offset, errval);
                          +          return -errval;
                                   }
                           
                                 /* Read the file data at offset into the user buffer */
                          @@ -138,10 +139,11 @@ int nxflat_read(struct nxflat_loadinfo_s *loadinfo, char *buffer, int readsize,
                                  nbytes = read(loadinfo->filfd, bufptr, bytesleft);
                                  if (nbytes < 0)
                                    {
                          -           if (errno != EINTR)
                          +           int errval = errno;
                          +           if (errval != EINTR)
                                        {
                          -               bdbg("Read of .data failed: %d\n", errno);
                          -               return -errno;
                          +               bdbg("Read of .data failed: %d\n", errval);
                          +               return -errval;
                                        }
                                    }
                                  else if (nbytes == 0)
                          diff --git a/nuttx/binfmt/libnxflat/libnxflat_uninit.c b/nuttx/binfmt/libnxflat/libnxflat_uninit.c
                          index 5d06296c79..b9715196b9 100644
                          --- a/nuttx/binfmt/libnxflat/libnxflat_uninit.c
                          +++ b/nuttx/binfmt/libnxflat/libnxflat_uninit.c
                          @@ -42,7 +42,8 @@
                           #include 
                           #include 
                           #include 
                          -#include 
                          +
                          +#include 
                           
                           /****************************************************************************
                            * Pre-Processor Definitions
                          @@ -56,10 +57,6 @@
                            * Private Functions
                            ****************************************************************************/
                           
                          -/****************************************************************************
                          - * Name: nxflat_swap32
                          - ****************************************************************************/
                          -
                           /****************************************************************************
                            * Public Functions
                            ****************************************************************************/
                          diff --git a/nuttx/binfmt/libnxflat/libnxflat_verify.c b/nuttx/binfmt/libnxflat/libnxflat_verify.c
                          index f799aca4f6..20af5d2f74 100644
                          --- a/nuttx/binfmt/libnxflat/libnxflat_verify.c
                          +++ b/nuttx/binfmt/libnxflat/libnxflat_verify.c
                          @@ -42,8 +42,9 @@
                           #include 
                           #include 
                           #include 
                          +
                           #include 
                          -#include 
                          +#include 
                           
                           /****************************************************************************
                            * Pre-processor Definitions
                          @@ -91,10 +92,10 @@ int nxflat_verifyheader(const struct nxflat_hdr_s *header)
                             if (strncmp(header->h_magic, NXFLAT_MAGIC, 4) != 0)
                               {
                                 bdbg("Unrecognized magic=\"%c%c%c%c\"\n",
                          -	  header->h_magic[0], header->h_magic[1],
                          -	  header->h_magic[2], header->h_magic[3]);
                          +      header->h_magic[0], header->h_magic[1],
                          +      header->h_magic[2], header->h_magic[3]);
                                 return -ENOEXEC;
                               }
                          +
                             return OK;
                           }
                          -
                          diff --git a/nuttx/binfmt/symtab_findbyname.c b/nuttx/binfmt/symtab_findbyname.c
                          index 201d7ba07d..c0343e2708 100644
                          --- a/nuttx/binfmt/symtab_findbyname.c
                          +++ b/nuttx/binfmt/symtab_findbyname.c
                          @@ -44,7 +44,7 @@
                           #include 
                           #include 
                           
                          -#include 
                          +#include 
                           
                           /****************************************************************************
                            * Pre-processor Definitions
                          diff --git a/nuttx/binfmt/symtab_findbyvalue.c b/nuttx/binfmt/symtab_findbyvalue.c
                          index 4382ed5d8d..c47d5c7518 100644
                          --- a/nuttx/binfmt/symtab_findbyvalue.c
                          +++ b/nuttx/binfmt/symtab_findbyvalue.c
                          @@ -44,7 +44,7 @@
                           #include 
                           #include 
                           
                          -#include 
                          +#include 
                           
                           /****************************************************************************
                            * Pre-processor Definitions
                          diff --git a/nuttx/binfmt/symtab_findorderedbyname.c b/nuttx/binfmt/symtab_findorderedbyname.c
                          index 61decf49ad..a678788e78 100644
                          --- a/nuttx/binfmt/symtab_findorderedbyname.c
                          +++ b/nuttx/binfmt/symtab_findorderedbyname.c
                          @@ -44,7 +44,7 @@
                           #include 
                           #include 
                           
                          -#include 
                          +#include 
                           
                           /****************************************************************************
                            * Pre-processor Definitions
                          diff --git a/nuttx/binfmt/symtab_findorderedbyvalue.c b/nuttx/binfmt/symtab_findorderedbyvalue.c
                          index 92b107856d..bad4bf8cd7 100644
                          --- a/nuttx/binfmt/symtab_findorderedbyvalue.c
                          +++ b/nuttx/binfmt/symtab_findorderedbyvalue.c
                          @@ -44,7 +44,7 @@
                           #include 
                           #include 
                           
                          -#include 
                          +#include 
                           
                           /****************************************************************************
                            * Pre-processor Definitions
                          diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt
                          index c4f5de5e35..21aace2afe 100644
                          --- a/nuttx/configs/README.txt
                          +++ b/nuttx/configs/README.txt
                          @@ -103,14 +103,23 @@ Make.defs -- This makefile fragment provides architecture and
                           
                               Tools: CC, LD, AR, NM, OBJCOPY, OBJDUMP
                               Tool options: CFLAGS, LDFLAGS
                          -    COMPILE, ASSEMBLE, ARCHIVE, CLEAN, and MKDEP macros
                           
                             When this makefile fragment runs, it will be passed TOPDIR which
                             is the path to the root directory of the build.  This makefile
                          -  fragment may include ${TOPDIR}/.config to perform configuration
                          -  specific settings.  For example, the CFLAGS will most likely be
                          +  fragment should include:
                          +
                          +    $(TOPDIR)/.config          : Nuttx configuration
                          +    $(TOPDIR)/tools/Config.mk  : Common definitions
                          +
                          +  Definitions in the Make.defs file probably depend on some of the
                          +  settings in the .config file.  For example, the CFLAGS will most likely be
                             different if CONFIG_DEBUG=y.
                           
                          +  The included tools/Config.mk file contains additional definitions that may
                          +  be overriden in the architecture-specific Make.defs file as necessary:
                          +
                          +    COMPILE, ASSEMBLE, ARCHIVE, CLEAN, and MKDEP macros
                          +
                           defconfig -- This is a configuration file similar to the Linux
                             configuration file.  In contains variable/value pairs like:
                           
                          @@ -174,7 +183,6 @@ defconfig -- This is a configuration file similar to the Linux
                               CONFIG_RAW_BINARY - make a raw binary format file used with many
                                 different loaders using the GNU objcopy program.  This option
                                 should not be selected if you are not using the GNU toolchain.
                          -    CONFIG_HAVE_LIBM - toolchain supports libm.a
                               CONFIG_HAVE_CXX - toolchain supports C++ and CXX, CXXFLAGS, and
                                 COMPILEXX have been defined in the configurations Make.defs
                                 file.
                          @@ -321,7 +329,7 @@ defconfig -- This is a configuration file similar to the Linux
                               CONFIG_RR_INTERVAL - The round robin timeslice will be set
                                 this number of milliseconds;  Round robin scheduling can
                                 be disabled by setting this value to zero.
                          -    CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in 
                          +    CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
                                 scheduler to monitor system performance
                               CONFIG_TASK_NAME_SIZE - Specifies that maximum size of a
                                 task name to save in the TCB.  Useful if scheduler
                          @@ -349,7 +357,7 @@ defconfig -- This is a configuration file similar to the Linux
                               CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority
                                 inheritance is enabled.  It defines the maximum number of
                                 different threads (minus one) that can take counts on a
                          -      semaphore with priority inheritance support.  This may be 
                          +      semaphore with priority inheritance support.  This may be
                                 set to zero if priority inheritance is disabled OR if you
                                 are only using semaphores as mutexes (only one holder) OR
                                 if no more than two threads participate using a counting
                          @@ -375,9 +383,6 @@ defconfig -- This is a configuration file similar to the Linux
                               CONFIG_SDCLONE_DISABLE. Disable cloning of all socket
                                 desciptors by task_create() when a new task is started. If
                                 set, all sockets will appear to be closed in the new task.
                          -    CONFIG_NXFLAT. Enable support for the NXFLAT binary format.
                          -      This format will support execution of NuttX binaries located
                          -      in a ROMFS filesystem (see examples/nxflat).
                               CONFIG_SCHED_WORKQUEUE.  Create a dedicated "worker" thread to
                                 handle delayed processing from interrupt handlers.  This feature
                                 is required for some drivers but, if there are not complaints,
                          @@ -421,6 +426,39 @@ defconfig -- This is a configuration file similar to the Linux
                                 where 'app' is the application name. If not defined, CONFIG_USER_ENTRYPOINT
                                 defaults to user_start.
                           
                          +  Binary Loaders:
                          +    CONFIG_BINFMT_DISABLE - By default, support for loadable binary formats
                          +      is built.
                          +    This logic may be suppressed be defining this setting.
                          +    CONFIG_BINFMT_CONSTRUCTORS - Build in support for C++ constructors in
                          +      loaded modules.
                          +    CONFIG_SYMTAB_ORDEREDBYNAME - Symbol tables are order by name (rather
                          +      than value).
                          +    CONFIG_NXFLAT. Enable support for the NXFLAT binary format. This format
                          +      will support execution of NuttX binaries located in a ROMFS filesystem
                          +      (see apps/examples/nxflat).
                          +    CONFIG_ELF - Enable support for the ELF binary format. This format will
                          +      support execution of ELF binaries copied from a file system and
                          +      relocated into RAM (see apps/examples/elf).
                          +
                          +    If CONFIG_ELF is selected, then these additional options are available:
                          +
                          +    CONFIG_ELF_ALIGN_LOG2 - Align all sections to this Log2 value:  0->1,
                          +      1->2, 2->4, etc.
                          +    CONFIG_ELF_STACKSIZE - This is the default stack size that will will
                          +      be used when starting ELF binaries.
                          +    CONFIG_ELF_BUFFERSIZE - This is an I/O buffer that is used to access
                          +      the ELF file.  Variable length items will need to be read (such as
                          +      symbol names).  This is really just this initial size of the buffer;
                          +      it will be reallocated as necessary to hold large symbol names).
                          +      Default: 128
                          +    CONFIG_ELF_BUFFERINCR - This is an I/O buffer that is used to access
                          +      the ELF file.  Variable length items will need to be read (such as
                          +      symbol names). This value specifies the size increment to use each
                          +      time the buffer is reallocated. Default: 32
                          +    CONFIG_ELF_DUMPBUFFER - Dump various ELF buffers for debug purposes.
                          +      This option requires CONFIG_DEBUG and CONFIG_DEBUG_VERBOSE.
                          +
                             System Logging:
                               CONFIG_SYSLOG enables general system logging support.
                               CONFIG_SYSLOG_DEVPATH - The full path to the system logging device.  Default
                          @@ -506,7 +544,7 @@ defconfig -- This is a configuration file similar to the Linux
                                 from the end of RAM for page tables or other system usage.  The
                                 configuration settings and linker directives must be cognizant of that:
                                 CONFIG_PAGING_NDATA should be defined to prevent the data region from
                          -      extending all the way to the end of memory. 
                          +      extending all the way to the end of memory.
                               CONFIG_PAGING_DEFPRIO - The default, minimum priority of the page fill
                                 worker thread.  The priority of the page fill work thread will be boosted
                                 boosted dynmically so that it matches the priority of the task on behalf
                          @@ -520,7 +558,7 @@ defconfig -- This is a configuration file similar to the Linux
                                 transfer is completed. Default:  Undefined (non-blocking).
                               CONFIG_PAGING_WORKPERIOD - The page fill worker thread will wake periodically
                                 even if there is no mapping to do.  This selection controls that wake-up
                          -      period (in microseconds).  This wake-up a failsafe that will handle any 
                          +      period (in microseconds).  This wake-up a failsafe that will handle any
                                 cases where a single is lost (that would really be a bug and shouldn't
                                 happen!) and also supports timeouts for case of non-blocking, asynchronous
                                 fills (see CONFIG_PAGING_TIMEOUT_TICKS).
                          @@ -532,7 +570,7 @@ defconfig -- This is a configuration file similar to the Linux
                               Some architecture-specific settings.  Defaults are architecture specific.
                               If you don't know what you are doing, it is best to leave these undefined
                               and try the system defaults:
                          - 
                          +
                               CONFIG_PAGING_VECPPAGE - This the physical address of the page in
                                 memory to be mapped to the vector address.
                               CONFIG_PAGING_VECL2PADDR - This is the physical address of the L2
                          @@ -555,7 +593,7 @@ defconfig -- This is a configuration file similar to the Linux
                                 devices. CONFIG_PAGING_SDSLOT identifies the slot number of the SD
                                 device to initialize. This must be undefined if SD is not being used.
                                 This should be defined to be zero for the typical device that has
                          -      only a single slot (See CONFIG_MMCSD_NSLOTS). If defined, 
                          +      only a single slot (See CONFIG_MMCSD_NSLOTS). If defined,
                                 CONFIG_PAGING_SDSLOT will instruct certain board-specific logic to
                                 initialize the media in this SD slot.
                               CONFIG_PAGING_M25PX - Use the m25px.c FLASH driver.  If this is selected,
                          @@ -624,6 +662,37 @@ defconfig -- This is a configuration file similar to the Linux
                                 CONFIG_ARCH_STRNCPY, CONFIG_ARCH_STRLEN, CONFIG_ARCH_STRNLEN
                                 CONFIG_ARCH_BZERO
                           
                          +  If CONFIG_ARCH_MEMCPY is not selected, then you make also select Daniel
                          +  Vik's optimized implementation of memcpy():
                          +
                          +    CONFIG_MEMCPY_VIK - Select this option to use the optimized memcpy()
                          +      function by Daniel Vik.  Select this option for improved performance
                          +      at the expense of increased size. See licensing information in the
                          +      top-level COPYING file.  Default: n
                          +
                          +  And if CONFIG_MEMCPY_VIK is selected, the following tuning options are available:
                          +
                          +    CONFIG_MEMCPY_PRE_INC_PTRS - Use pre-increment of pointers. Default is
                          +      post increment of pointers.
                          +
                          +    CONFIG_MEMCPY_INDEXED_COPY - Copying data using array indexing. Using
                          +      this option, disables the CONFIG_MEMCPY_PRE_INC_PTRS option.
                          +
                          +    CONFIG_MEMCPY_64BIT - Compiles memcpy for architectures that suppport
                          +      64-bit operations efficiently.
                          +
                          +  If CONFIG_ARCH_MEMSET is not selected, then the following option is
                          +  also available:
                          +
                          +    CONFIG_MEMSET_OPTSPEED - Select this option to use a version of memcpy()
                          +      optimized for speed. Default: memcpy() is optimized for size.
                          +
                          +  And if CONFIG_MEMSET_OPTSPEED is selected, the following tuning option is
                          +  available:
                          +
                          +    CONFIG_MEMSET_64BIT - Compiles memset() for architectures that suppport
                          +      64-bit operations efficiently.
                          +
                             The architecture may provide custom versions of certain standard header
                             files:
                           
                          @@ -666,6 +735,15 @@ defconfig -- This is a configuration file similar to the Linux
                                 don't select CONFIG_ARCH_MATH_H, the redirecting math.h header file will
                                 stay out-of-the-way in include/nuttx/.
                           
                          +    CONFIG_ARCH_FLOAT_H
                          +      If you enable the generic, built-in math library, then that math library
                          +      will expect your toolchain to provide the standard float.h header file.
                          +      The float.h header file defines the properties of your floating point
                          +      implementation.  It would always be best to use your toolchain's float.h
                          +      header file but if none is avaiable, a default float.h header file will
                          +      provided if this option is selected.  However, there is no assurance that
                          +      the settings in this float.h are actually correct for your platform!
                          +
                               CONFIG_ARCH_STDARG_H - There is also a redirecting version of stdarg.h in
                                 the source tree as well. It also resides out-of-the-way at include/nuttx/stdarg.h.
                                 This is because you should normally use your toolchain's stdarg.h file. But
                          @@ -696,7 +774,7 @@ defconfig -- This is a configuration file similar to the Linux
                                 If CONFIG_ARCH_ROMGETC is defined, then the architecture logic
                                 must export the function up_romgetc().  up_romgetc() will simply
                                 read one byte of data from the instruction space.
                          - 
                          +
                                 If CONFIG_ARCH_ROMGETC, certain C stdio functions are effected:
                                 (1) All format strings in printf, fprintf, sprintf, etc. are
                                 assumed to lie in FLASH (string arguments for %s are still assumed
                          @@ -766,7 +844,7 @@ defconfig -- This is a configuration file similar to the Linux
                                 much sense in supporting FAT date and time unless you have a
                                 hardware RTC or other way to get the time and date.
                               CONFIG_FS_NXFFS: Enable NuttX FLASH file system (NXFF) support.
                          -    CONFIG_NXFFS_ERASEDSTATE: The erased state of FLASH. 
                          +    CONFIG_NXFFS_ERASEDSTATE: The erased state of FLASH.
                                 This must have one of the values of 0xff or 0x00.
                                 Default: 0xff.
                               CONFIG_NXFFS_PACKTHRESHOLD: When packing flash file data,
                          @@ -920,7 +998,7 @@ defconfig -- This is a configuration file similar to the Linux
                           
                               CONFIG_INPUT
                                 Enables general support for input devices
                          - 
                          +
                               CONFIG_INPUT_TSC2007
                                 If CONFIG_INPUT is selected, then this setting will enable building
                                 of the TI TSC2007 touchscreen driver.
                          @@ -935,14 +1013,14 @@ defconfig -- This is a configuration file similar to the Linux
                                 Enables support for the SPI interface (not currenly supported)
                               CONFIG_STMPE811_I2C
                                 Enables support for the I2C interface
                          -    CONFIG_STMPE811_MULTIPLE 
                          +    CONFIG_STMPE811_MULTIPLE
                                 Can be defined to support multiple STMPE811 devices on board.
                               CONFIG_STMPE811_ACTIVELOW
                                 Interrupt is generated by an active low signal (or falling edge).
                               CONFIG_STMPE811_EDGE
                                 Interrupt is generated on an edge (vs. on the active level)
                               CONFIG_STMPE811_NPOLLWAITERS
                          -      Maximum number of threads that can be waiting on poll() (ignored if 
                          +      Maximum number of threads that can be waiting on poll() (ignored if
                                 CONFIG_DISABLE_POLL is set).
                               CONFIG_STMPE811_TSC_DISABLE
                                 Disable driver touchscreen functionality.
                          @@ -1051,21 +1129,21 @@ defconfig -- This is a configuration file similar to the Linux
                               port.  The default data link layer for uIP is Ethernet. If CONFIG_NET_SLIP
                               is defined in the NuttX configuration file, then SLIP will be supported.
                               The basic differences between the SLIP and Ethernet configurations is that
                          -    when SLIP is selected: 
                          +    when SLIP is selected:
                           
                          -    * The link level header (that comes before the IP header) is omitted. 
                          -    * All MAC address processing is suppressed. 
                          +    * The link level header (that comes before the IP header) is omitted.
                          +    * All MAC address processing is suppressed.
                               * ARP is disabled.
                           
                               If CONFIG_NET_SLIP is not selected, then Ethernet will be used (there is
                               no need to define anything special in the configuration file to use
                          -    Ethernet -- it is the default). 
                          +    Ethernet -- it is the default).
                           
                               CONFIG_NET_SLIP -- Enables building of the SLIP driver. SLIP requires
                                 at least one IP protocols selected and the following additional
                                 network settings: CONFIG_NET_NOINTS and CONFIG_NET_MULTIBUFFER.
                                 CONFIG_NET_BUFSIZE *must* be set to 296.  Other optional configuration
                          -      settings that affect the SLIP driver: CONFIG_NET_STATISTICS. 
                          +      settings that affect the SLIP driver: CONFIG_NET_STATISTICS.
                                 Default: Ethernet
                           
                               If SLIP is selected, then the following SLIP options are available:
                          @@ -1081,6 +1159,10 @@ defconfig -- This is a configuration file similar to the Linux
                           
                               CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
                               CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
                          +    CONFIG_NET_RESOLV_MAXRESPONSE - This setting determines the maximum
                          +      size of response message that can be received by the DNS resolver.
                          +      The default is 96 but may need to be larger on enterprise networks
                          +      (perhaps 176).
                           
                             THTTPD
                           
                          @@ -1102,7 +1184,7 @@ defconfig -- This is a configuration file similar to the Linux
                                 to run before killing them.
                               CONFIG_THTTPD_CHARSET- The default character set name to use with
                                 text MIME types.
                          -    CONFIG_THTTPD_IOBUFFERSIZE - 
                          +    CONFIG_THTTPD_IOBUFFERSIZE -
                               CONFIG_THTTPD_INDEX_NAMES - A list of index filenames to check. The
                                 files are searched for in this order.
                               CONFIG_AUTH_FILE - The file to use for authentication. If this is
                          @@ -1134,7 +1216,7 @@ defconfig -- This is a configuration file similar to the Linux
                                 You can also leave both options undefined, and thttpd will not do
                                 anything special about tildes. Enabling both options is an error.
                                 Typical values, if they're defined, are "users" for
                          -      CONFIG_THTTPD_TILDE_MAP1 and "public_html"forCONFIG_THTTPD_TILDE_MAP2. 
                          +      CONFIG_THTTPD_TILDE_MAP1 and "public_html"forCONFIG_THTTPD_TILDE_MAP2.
                               CONFIG_THTTPD_GENERATE_INDICES
                               CONFIG_THTTPD_URLPATTERN - If defined, then it will be used to match
                                 and verify referrers.
                          @@ -1192,7 +1274,7 @@ defconfig -- This is a configuration file similar to the Linux
                             USB host HID class driver. Requires CONFIG_USBHOST=y,
                               CONFIG_USBHOST_INT_DISABLE=n, CONFIG_NFILE_DESCRIPTORS > 0,
                               CONFIG_SCHED_WORKQUEUE=y, and CONFIG_DISABLE_SIGNALS=n.
                          - 
                          +
                               CONFIG_HIDKBD_POLLUSEC
                                 Device poll rate in microseconds. Default: 100 milliseconds.
                               CONFIG_HIDKBD_DEFPRIO
                          @@ -1211,7 +1293,7 @@ defconfig -- This is a configuration file similar to the Linux
                                 If set to y all 231 possible scancodes will be converted to
                                 something.  Default:  104 key US keyboard.
                               CONFIG_HIDKBD_NODEBOUNCE
                          -      If set to y normal debouncing is disabled.  Default: 
                          +      If set to y normal debouncing is disabled.  Default:
                                 Debounce enabled (No repeat keys).
                           
                             USB host mass storage class driver. Requires CONFIG_USBHOST=y,
                          @@ -1248,12 +1330,12 @@ defconfig -- This is a configuration file similar to the Linux
                                 Configure the CDC serial driver as part of a composite driver
                                 (only if CONFIG_USBDEV_COMPOSITE is also defined)
                               CONFIG_CDCACM_IFNOBASE
                          -       If the CDC driver is part of a composite device, then this may need to 
                          +       If the CDC driver is part of a composite device, then this may need to
                                 be defined to offset the CDC/ACM interface numbers so that they are
                                 unique and contiguous.  When used with the Mass Storage driver, the
                                 correct value for this offset is zero.
                               CONFIG_CDCACM_STRBASE
                          -      If the CDC driver is part of a composite device, then this may need to 
                          +      If the CDC driver is part of a composite device, then this may need to
                                 be defined to offset the CDC/ACM string numbers so that they are
                                 unique and contiguous.  When used with the Mass Storage driver, the
                                 correct value for this offset is four (this value actuallly only needs
                          @@ -1312,13 +1394,13 @@ defconfig -- This is a configuration file similar to the Linux
                                 Configure the mass storage driver as part of a composite driver
                                 (only if CONFIG_USBDEV_COMPOSITE is also defined)
                               CONFIG_USBMSC_IFNOBASE
                          -      If the CDC driver is part of a composite device, then this may need to 
                          +      If the CDC driver is part of a composite device, then this may need to
                                 be defined to offset the mass storage interface number so that it is
                                 unique and contiguous.  When used with the CDC/ACM driver, the
                                 correct value for this offset is two (because of the two CDC/ACM
                                 interfaces that will precede it).
                               CONFIG_USBMSC_STRBASE
                          -      If the CDC driver is part of a composite device, then this may need to 
                          +      If the CDC driver is part of a composite device, then this may need to
                                 be defined to offset the mass storage string numbers so that they are
                                 unique and contiguous.  When used with the CDC/ACM driver, the
                                 correct value for this offset is four (or perhaps 5 or 6, depending
                          @@ -1526,10 +1608,15 @@ configs/avr32dev1
                           configs/c5471evm
                             This is a port to the Spectrum Digital C5471 evaluation board.  The
                             TMS320C5471 is a dual core processor from TI with an ARM7TDMI general
                          -  purpose processor and a c54 DSP.  It is also known as TMS320DA180 or just DA180. 
                          +  purpose processor and a c54 DSP.  It is also known as TMS320DA180 or just DA180.
                             NuttX runs on the ARM core and is built with a GNU arm-nuttx-elf toolchain*.
                             This port is complete and verified.
                           
                          +configs/cloudctrl
                          +  Darcy'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.
                          +
                           configs/compal_e88 and compal_e99
                             These directories contain the board support for compal e88 and e99 phones.
                             These ports are based on patches contributed by Denis Carikli for both the
                          @@ -1542,23 +1629,23 @@ configs/demo9s12ne64
                             is code complete but has not yet been verified.
                           
                           configs/ea3131
                          -  Embedded Artists EA3131 Development board.  This board is based on the 
                          +  Embedded Artists EA3131 Development board.  This board is based on the
                             an NXP LPC3131 MCU. This OS is built with the arm-nuttx-elf toolchain*.
                             STATUS:  This port is complete and mature.
                           
                           configs/ea3152
                          -  Embedded Artists EA3152 Development board.  This board is based on the 
                          +  Embedded Artists EA3152 Development board.  This board is based on the
                             an NXP LPC3152 MCU. This OS is built with the arm-nuttx-elf toolchain*.
                             STATUS:  This port is has not be exercised well, but since it is
                             a simple derivative of the ea3131, it should be fully functional.
                           
                           configs/eagle100
                          -  Micromint Eagle-100 Development board.  This board is based on the 
                          +  Micromint Eagle-100 Development board.  This board is based on the
                             an ARM Cortex-M3 MCU, the Luminary LM3S6918. This OS is built with the
                             arm-nuttx-elf toolchain*.  STATUS:  This port is complete and mature.
                           
                           configs/ekk-lm3s9b96
                          -  TI/Stellaris EKK-LM3S9B96 board.  This board is based on the 
                          +  TI/Stellaris EKK-LM3S9B96 board.  This board is based on the
                             an EKK-LM3S9B96 which is a Cortex-M3.
                           
                           configs/ez80f0910200kitg
                          @@ -1586,13 +1673,13 @@ configs/kwikstik-k40.
                           
                           configs/lincoln60
                              NuttX port to the Micromint Lincoln 60 board.
                          -  
                          +
                           configs/lm3s6432-s2e
                             Stellaris RDK-S2E Reference Design Kit and the MDL-S2E Ethernet to
                             Serial module.
                           
                           configs/lm3s6965-ek
                          -  Stellaris LM3S6965 Evaluation Kit.  This board is based on the 
                          +  Stellaris LM3S6965 Evaluation Kit.  This board is based on the
                             an ARM Cortex-M3 MCU, the Luminary/TI LM3S6965. This OS is built with the
                             arm-nuttx-elf toolchain*.  STATUS:  This port is complete and mature.
                           
                          @@ -1649,7 +1736,7 @@ configs/ntosd-dm320
                             toolchain*: see
                           
                               http://wiki.neurostechnology.com/index.php/OSD_1.0_Developer_Home
                          - 
                          +
                             There are some differences between the Dev Board and the currently
                             available commercial v1.0 Boards.  See
                           
                          @@ -1739,7 +1826,7 @@ configs/qemu-i486
                             hardwared (Google the Bifferboard).
                           
                           configs/rgmp
                          -  RGMP stands for RTOS and GPOS on Multi-Processor.  RGMP is a project for 
                          +  RGMP stands for RTOS and GPOS on Multi-Processor.  RGMP is a project for
                             running GPOS and RTOS simultaneously on multi-processor platforms. You can
                             port your favorite RTOS to RGMP together with an unmodified Linux to form a
                             hybrid operating system. This makes your application able to use both RTOS
                          @@ -1780,8 +1867,14 @@ configs/stm3240g-eval
                             microcontroller (ARM Cortex-M4 with FPU).  This port uses a GNU Cortex-M4
                             toolchain (such as CodeSourcery).
                           
                          +configs/stm32f100rc_generic
                          +  STMicro STM32F100RC generic board based on STM32F100RC high-density value line
                          +  chip. This "generic" configuration is not very usable out-of-box, but can be
                          +  used as a starting point to creating new configs with similar STM32
                          +  high-density value line chips.
                          +  
                           configs/stm32f4discovery
                          -  STMicro STM32F4-Discovery board boased on the STMIcro STM32F407VGT6 MCU.
                          +  STMicro STM32F4-Discovery board based on the STMIcro STM32F407VGT6 MCU.
                           
                           configs/sure-pic32mx
                             The "Advanced USB Storage Demo Board," Model DB-DP11215, from Sure
                          @@ -1818,7 +1911,7 @@ configs/vsn
                           
                           configs/xtrs
                             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 
                          +  An emulator for this computer is available to run TRS80 programs on a
                             linux platform (http://www.tim-mann.org/xtrs.html).
                           
                           configs/z16f2800100zcog
                          @@ -1869,7 +1962,7 @@ And if configs///appconfig exists and your
                           application directory is not in the standard loction (../apps), then
                           you should also specify the location of the application directory on the
                           command line like:
                          -  
                          +
                             cd tools
                             ./configure.sh -a  /
                           
                          diff --git a/nuttx/configs/px4fmu/nsh/defconfig b/nuttx/configs/px4fmu/nsh/defconfig
                          index cd86d5544f..9555e43ecd 100755
                          --- a/nuttx/configs/px4fmu/nsh/defconfig
                          +++ b/nuttx/configs/px4fmu/nsh/defconfig
                          @@ -200,6 +200,10 @@ CONFIG_STM32_TIM9=y
                           CONFIG_STM32_TIM10=y
                           CONFIG_STM32_TIM11=y
                           
                          +#
                          +# We want the flash prefetch on for max performance.
                          +#
                          +STM32_FLASH_PREFETCH=y
                           
                           #
                           # Enable the MTD driver for the onboard I2C EEPROM
                          @@ -351,6 +355,7 @@ CONFIG_I2C=y
                           CONFIG_I2C_POLLED=y
                           CONFIG_I2C_TRANSFER=y
                           CONFIG_I2C_TRACE=n
                          +CONFIG_I2C_RESET=y
                           # Allow 180 us per byte, a wide margin for the 400 KHz clock we're using
                           # e.g. 9.6 ms for an EEPROM page write, 0.9 ms for a MAG update
                           CONFIG_STM32_I2CTIMEOUS_PER_BYTE=200
                          diff --git a/nuttx/drivers/Kconfig b/nuttx/drivers/Kconfig
                          index 1d263ec145..8302d21b71 100644
                          --- a/nuttx/drivers/Kconfig
                          +++ b/nuttx/drivers/Kconfig
                          @@ -47,7 +47,8 @@ config CAN_EXTID
                           	bool "CAN extended IDs"
                           	default n
                           	---help---
                          -		Enables support for the 29-bit extended ID.  Default Standard 11-bit IDs.
                          +		Enables support for the 29-bit extended ID.  Default Standard 11-bit
                          +		IDs.
                           
                           config CAN_FIFOSIZE
                           	int "CAN driver I/O buffer size"
                          @@ -83,10 +84,10 @@ config PWM_PULSECOUNT
                           	bool "PWM Pulse Count Support"
                           	default n
                           	---help---
                          -		Some hardware will support generation of a fixed number of pulses.  This
                          -		might be used, for example to support a stepper motor.  If the hardware
                          -		will support a fixed pulse count, then this configuration should be set to
                          -		enable the capability.
                          +		Some hardware will support generation of a fixed number of pulses.
                          +		This might be used, for example to support a stepper motor.  If the
                          +		hardware will support a fixed pulse count, then this configuration
                          +		should be set to enable the capability.
                           
                           endif
                           
                          @@ -147,23 +148,25 @@ config SPI_OWNBUS
                           	bool "SPI single device"
                           	default n
                           	---help---
                          -		Set if there is only one active device on the SPI bus.  No locking or SPI
                          -		configuration will be performed. It is not necessary for clients to lock,
                          -		re-configure, etc..
                          +		Set if there is only one active device on the SPI bus.  No locking or
                          +		SPI configuration will be performed. It is not necessary for clients to
                          +		lock, re-configure, etc..
                           
                           config SPI_EXCHANGE
                           	bool "SPI exchange"
                           	default y
                           	---help---
                          -		Driver supports a single exchange method (vs a recvblock() and sndblock ()methods).
                          +		Driver supports a single exchange method (vs a recvblock() and
                          +		sndblock() methods).
                           
                           config SPI_CMDDATA
                           	bool "SPI CMD/DATA"
                           	default n
                           	---help---
                          -		Devices on the SPI bus require out-of-band support to distinguish command
                          -		transfers from data transfers.  Such devices will often support either 9-bit
                          -		SPI (yech) or 8-bit SPI and a GPIO output that selects between command and data.
                          +		Devices on the SPI bus require out-of-band support to distinguish
                          +		command transfers from data transfers.  Such devices will often support
                          +		either 9-bit SPI (yech) or 8-bit SPI and a GPIO output that selects
                          +		between command and data.
                           
                           endif
                           
                          @@ -173,35 +176,36 @@ menuconfig RTC
                           	---help---
                           		This selection enables configuration of a real time clock (RTCdriver.
                           		See include/nuttx/rtc.h for further watchdog timer driver information.
                          -		Most RTC drivers are MCU specific and may require other specific settings.
                          +		Most RTC drivers are MCU specific and may require other specific
                          +		settings.
                           
                           config RTC_DATETIME
                           	bool "Date/Time RTC Support"
                           	default n
                           	depends on RTC
                           	---help---
                          -		There are two general types of RTC:  (1) A simple battery backed counter
                          -		that keeps the time when power is down, and (2) a full date / time RTC the
                          -		provides the date and time information, often in BCD format.  If
                          -		RTC_DATETIME is selected, it specifies this second kind of RTC. In this
                          -		case, the RTC is used to "seed" the normal NuttX timer and the NuttX system
                          -		timer provides for higher resolution time.
                          +		There are two general types of RTC:  (1) A simple battery backed
                          +		counter that keeps the time when power is down, and (2) a full
                          +		date / time RTC the provides the date and time information, often in
                          +		BCD format.  If RTC_DATETIME is selected, it specifies this second kind
                          +		of RTC. In this case, the RTC is used to "seed" the normal NuttX timer
                          +		and the NuttX system timer provides for higher resolution time.
                           
                           config RTC_HIRES
                           	bool "Hi-Res RTC Support"
                           	default n
                           	depends on RTC && !RTC_DATETIME
                           	---help---
                          -		If RTC_DATETIME not selected, then the simple, battery backed counter is
                          -		used.  There are two different implementations of such simple counters
                          -		based on the time resolution of the counter: The typical RTC keeps time
                          -		to resolution of 1 second, usually supporting a 32-bit time_t value.  In
                          -		this case, the RTC is used to "seed" the normal NuttX timer and the NuttX
                          -		timer provides for higherresoution time.
                          +		If RTC_DATETIME not selected, then the simple, battery backed counter
                          +		is used.  There are two different implementations of such simple
                          +		counters based on the time resolution of the counter: The typical RTC
                          +		keeps time to resolution of 1 second, usually supporting a 32-bit
                          +		time_t value.  In this case, the RTC is used to "seed" the normal NuttX
                          +		timer and the NuttX timer provides for higherresoution time.
                           
                          -		If RTC_HIRES is enabled in the NuttX configuration, then the RTC provides
                          -		higher resolution time and completely replaces the system timer for purpose
                          -		of date and time.
                          +		If RTC_HIRES is enabled in the NuttX configuration, then the RTC
                          +		provides higher resolution time and completely replaces the system
                          +		timer for purpose of date and time.
                           
                           config RTC_FREQUENCY
                           	int "Hi-Res RTC frequency"
                          @@ -209,8 +213,8 @@ config RTC_FREQUENCY
                           	depends on RTC && !RTC_DATETIME && RTC_HIRES
                           	---help---
                           		If RTC_HIRES is defined, then the frequency of the high resolution RTC
                          -		must be provided.  If RTC_HIRES is not defined, RTC_FREQUENCY is assumed
                          -		to be one Hz.
                          +		must be provided.  If RTC_HIRES is not defined, RTC_FREQUENCY is
                          +		assumed to be one Hz.
                           
                           config RTC_ALARM 
                           	bool "RTC Alarm Support"
                          @@ -224,8 +228,9 @@ menuconfig WATCHDOG
                           	bool "Watchdog Timer Support"
                           	default n
                           	---help---
                          -		This selection enables building of the "upper-half" watchdog timer driver.
                          -		See include/nuttx/watchdog.h for further watchdog timer driver information.
                          +		This selection enables building of the "upper-half" watchdog timer
                          +		driver. See include/nuttx/watchdog.h for further watchdog timer driver
                          +		information.
                           
                           if WATCHDOG
                           endif
                          @@ -348,7 +353,8 @@ menuconfig POWER
                           	bool "Power Management Support"
                           	default n
                           	---help---
                          -		Enable building of power-related devices (battery monitors, chargers, etc).
                          +		Enable building of power-related devices (battery monitors, chargers,
                          +		etc).
                           
                           if POWER
                           source drivers/power/Kconfig
                          @@ -386,8 +392,8 @@ menuconfig SERIAL
                           	default y
                           	---help---
                           		Front-end character drivers for chip-specific UARTs.  This provide
                          -		some TTY-like functionality and are commonly used (but not required for)
                          -		the NuttX system console.  See also include/nuttx/serial/serial.h
                          +		some TTY-like functionality and are commonly used (but not required
                          +		for) the NuttX system console.  See also include/nuttx/serial/serial.h
                           
                           if SERIAL
                           source drivers/serial/Kconfig
                          diff --git a/nuttx/drivers/Makefile b/nuttx/drivers/Makefile
                          index 6d3b40b1f3..aaaa67bd79 100644
                          --- a/nuttx/drivers/Makefile
                          +++ b/nuttx/drivers/Makefile
                          @@ -86,15 +86,15 @@ ifeq ($(CONFIG_WATCHDOG),y)
                           endif
                           endif
                           
                          -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)
                           
                          -BIN			= libdrivers$(LIBEXT)
                          +BIN = libdrivers$(LIBEXT)
                           
                          -all:	$(BIN)
                          +all: $(BIN)
                           
                           $(AOBJS): %$(OBJEXT): %.S
                           	$(call ASSEMBLE, $<, $@)
                          @@ -102,22 +102,21 @@ $(AOBJS): %$(OBJEXT): %.S
                           $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                          -$(BIN):	$(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $@, $${obj}); \
                          -	done ; )
                          +$(BIN): $(OBJS)
                          +	$(call ARCHIVE, $@, $(OBJS))
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          -	@touch $@
                          +	$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f $(BIN) *~ .*.swp
                          +	$(call DELFILE, $(BIN))
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/nuttx/drivers/analog/adc.c b/nuttx/drivers/analog/adc.c
                          index 84070f162a..72f19452a4 100644
                          --- a/nuttx/drivers/analog/adc.c
                          +++ b/nuttx/drivers/analog/adc.c
                          @@ -143,7 +143,7 @@ static int adc_open(FAR struct file *filep)
                                             dev->ad_recv.af_head = 0;
                                             dev->ad_recv.af_tail = 0;
                           
                          -                  /* Finally, Enable the CAN RX interrupt */
                          +                  /* Finally, Enable the ADC RX interrupt */
                           
                                             dev->ad_ops->ao_rxint(dev, true);
                           
                          @@ -151,9 +151,11 @@ static int adc_open(FAR struct file *filep)
                           
                                             dev->ad_ocount = tmp;
                                           }
                          +
                                         irqrestore(flags);
                                       }
                                   }
                          +
                                 sem_post(&dev->ad_closesem);
                               }
                             return ret;
                          @@ -370,6 +372,10 @@ static int adc_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
                            * Public Functions
                            ****************************************************************************/
                           
                          +/****************************************************************************
                          + * Name: adc_receive
                          + ****************************************************************************/
                          +
                           int adc_receive(FAR struct adc_dev_s *dev, uint8_t ch, int32_t data)
                           {
                             FAR struct adc_fifo_s *fifo = &dev->ad_recv;
                          @@ -390,7 +396,7 @@ int adc_receive(FAR struct adc_dev_s *dev, uint8_t ch, int32_t data)
                           
                             if (nexttail != fifo->af_head)
                               {
                          -      /* Add the new, decoded CAN message at the tail of the FIFO */
                          +      /* Add the new, decoded ADC sample at the tail of the FIFO */
                           
                                 fifo->af_buffer[fifo->af_tail].am_channel = ch;
                                 fifo->af_buffer[fifo->af_tail].am_data    = data;
                          @@ -403,11 +409,16 @@ int adc_receive(FAR struct adc_dev_s *dev, uint8_t ch, int32_t data)
                                   {
                                     sem_post(&fifo->af_sem);
                                   }
                          +
                                 err = OK;
                               }
                               return err;
                           }
                           
                          +/****************************************************************************
                          + * Name: adc_register
                          + ****************************************************************************/
                          +
                           int adc_register(FAR const char *path, FAR struct adc_dev_s *dev)
                           {
                             /* Initialize the ADC device structure */
                          diff --git a/nuttx/drivers/input/max11802.c b/nuttx/drivers/input/max11802.c
                          new file mode 100644
                          index 0000000000..ea3883cd0c
                          --- /dev/null
                          +++ b/nuttx/drivers/input/max11802.c
                          @@ -0,0 +1,1313 @@
                          +/****************************************************************************
                          + * drivers/input/max11802.c
                          + *
                          + *   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                          + *   Authors: Gregory Nutt 
                          + *            Petteri Aimonen 
                          + *
                          + * References:
                          + *   "Low-Power, Ultra-Small Resistive Touch-Screen Controllers
                          + *    with I2C/SPI Interface" Maxim IC, Rev 3, 10/2010
                          + *
                          + * 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 
                          +#include 
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +
                          +#include "max11802.h"
                          +
                          +/****************************************************************************
                          + * Pre-processor Definitions
                          + ****************************************************************************/
                          +
                          +/* This is a value for the threshold that guantees a big difference on the
                          + * first pendown (but can't overflow).
                          + */
                          +
                          +#define INVALID_THRESHOLD 0x1000
                          +
                          +/****************************************************************************
                          + * Private Types
                          + ****************************************************************************/
                          +
                          +/****************************************************************************
                          + * Private Function Prototypes
                          + ****************************************************************************/
                          +/* Low-level SPI helpers */
                          +
                          +#ifdef CONFIG_SPI_OWNBUS
                          +static inline void max11802_configspi(FAR struct spi_dev_s *spi);
                          +#  define max11802_lock(spi)
                          +#  define max11802_unlock(spi)
                          +#else
                          +#  define max11802_configspi(spi);
                          +static void max11802_lock(FAR struct spi_dev_s *spi);
                          +static void max11802_unlock(FAR struct spi_dev_s *spi);
                          +#endif
                          +
                          +static uint16_t max11802_sendcmd(FAR struct max11802_dev_s *priv, uint8_t cmd, int *tags);
                          +
                          +/* Interrupts and data sampling */
                          +
                          +static void max11802_notify(FAR struct max11802_dev_s *priv);
                          +static int max11802_sample(FAR struct max11802_dev_s *priv,
                          +                           FAR struct max11802_sample_s *sample);
                          +static int max11802_waitsample(FAR struct max11802_dev_s *priv,
                          +                               FAR struct max11802_sample_s *sample);
                          +static void max11802_worker(FAR void *arg);
                          +static int max11802_interrupt(int irq, FAR void *context);
                          +
                          +/* Character driver methods */
                          +
                          +static int max11802_open(FAR struct file *filep);
                          +static int max11802_close(FAR struct file *filep);
                          +static ssize_t max11802_read(FAR struct file *filep, FAR char *buffer, size_t len);
                          +static int max11802_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
                          +#ifndef CONFIG_DISABLE_POLL
                          +static int max11802_poll(FAR struct file *filep, struct pollfd *fds, bool setup);
                          +#endif
                          +
                          +/****************************************************************************
                          + * Private Data
                          + ****************************************************************************/
                          +
                          +/* This the the vtable that supports the character driver interface */
                          +
                          +static const struct file_operations max11802_fops =
                          +{
                          +  max11802_open,    /* open */
                          +  max11802_close,   /* close */
                          +  max11802_read,    /* read */
                          +  0,                /* write */
                          +  0,                /* seek */
                          +  max11802_ioctl    /* ioctl */
                          +#ifndef CONFIG_DISABLE_POLL
                          +  , max11802_poll   /* poll */
                          +#endif
                          +};
                          +
                          +/* If only a single MAX11802 device is supported, then the driver state
                          + * structure may as well be pre-allocated.
                          + */
                          +
                          +#ifndef CONFIG_MAX11802_MULTIPLE
                          +static struct max11802_dev_s g_max11802;
                          +
                          +/* Otherwise, we will need to maintain allocated driver instances in a list */
                          +
                          +#else
                          +static struct max11802_dev_s *g_max11802list;
                          +#endif
                          +
                          +/****************************************************************************
                          + * Private Functions
                          + ****************************************************************************/
                          +
                          +/****************************************************************************
                          + * Function: max11802_lock
                          + *
                          + * Description:
                          + *   Lock the SPI bus and re-configure as necessary.  This function must be
                          + *   to assure: (1) exclusive access to the SPI bus, and (2) to assure that
                          + *   the shared bus is properly configured for the touchscreen controller.
                          + *
                          + * Parameters:
                          + *   spi  - Reference to the SPI driver structure
                          + *
                          + * Returned Value:
                          + *   None
                          + *
                          + * Assumptions:
                          + *
                          + ****************************************************************************/
                          +
                          +#ifndef CONFIG_SPI_OWNBUS
                          +static void max11802_lock(FAR struct spi_dev_s *spi)
                          +{
                          +  /* Lock the SPI bus because there are multiple devices competing for the
                          +   * SPI bus
                          +   */
                          +
                          +  (void)SPI_LOCK(spi, true);
                          +
                          +  /* We have the lock.  Now make sure that the SPI bus is configured for the
                          +   * MAX11802 (it might have gotten configured for a different device while
                          +   * unlocked)
                          +   */
                          +
                          +  SPI_SELECT(spi, SPIDEV_TOUCHSCREEN, true);
                          +  SPI_SETMODE(spi, CONFIG_MAX11802_SPIMODE);
                          +  SPI_SETBITS(spi, 8);
                          +  SPI_SETFREQUENCY(spi, CONFIG_MAX11802_FREQUENCY);
                          +  SPI_SELECT(spi, SPIDEV_TOUCHSCREEN, false);
                          +}
                          +#endif
                          +
                          +/****************************************************************************
                          + * Function: max11802_unlock
                          + *
                          + * Description:
                          + *   If we are sharing the SPI bus with other devices (CONFIG_SPI_OWNBUS
                          + *   undefined) then we need to un-lock the SPI bus for each transfer,
                          + *   possibly losing the current configuration.
                          + *
                          + * Parameters:
                          + *   spi  - Reference to the SPI driver structure
                          + *
                          + * Returned Value:
                          + *   None
                          + *
                          + * Assumptions:
                          + *
                          + ****************************************************************************/
                          +
                          +#ifndef CONFIG_SPI_OWNBUS
                          +static void max11802_unlock(FAR struct spi_dev_s *spi)
                          +{
                          +  /* Relinquish the SPI bus. */
                          +
                          +  (void)SPI_LOCK(spi, false);
                          +}
                          +#endif
                          +
                          +/****************************************************************************
                          + * Function: max11802_configspi
                          + *
                          + * Description:
                          + *   Configure the SPI for use with the MAX11802.  This function should be
                          + *   called once during touchscreen initialization to configure the SPI
                          + *   bus.  Note that if CONFIG_SPI_OWNBUS is not defined, then this function
                          + *   does nothing.
                          + *
                          + * Parameters:
                          + *   spi  - Reference to the SPI driver structure
                          + *
                          + * Returned Value:
                          + *   None
                          + *
                          + * Assumptions:
                          + *
                          + ****************************************************************************/
                          +
                          +#ifdef CONFIG_SPI_OWNBUS
                          +static inline void max11802_configspi(FAR struct spi_dev_s *spi)
                          +{
                          +  /* Configure SPI for the MAX11802.  But only if we own the SPI bus.  Otherwise, don't
                          +   * bother because it might change.
                          +   */
                          +
                          +  SPI_SELECT(spi, SPIDEV_TOUCHSCREEN, true);
                          +  SPI_SETMODE(spi, CONFIG_MAX11802_SPIMODE);
                          +  SPI_SETBITS(spi, 8);
                          +  SPI_SETFREQUENCY(spi, CONFIG_MAX11802_FREQUENCY);
                          +  SPI_SELECT(spi, SPIDEV_TOUCHSCREEN, false);
                          +}
                          +#endif
                          +
                          +/****************************************************************************
                          + * Name: max11802_sendcmd
                          + ****************************************************************************/
                          +
                          +static uint16_t max11802_sendcmd(FAR struct max11802_dev_s *priv, uint8_t cmd, int *tags)
                          +{
                          +  uint8_t  buffer[2];
                          +  uint16_t result;
                          +
                          +  /* Select the MAX11802 */
                          +
                          +  SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN, true);
                          +
                          +  /* Send the command */
                          +
                          +  (void)SPI_SEND(priv->spi, cmd);
                          +  
                          +  /* Read the data */
                          +
                          +  SPI_RECVBLOCK(priv->spi, buffer, 2);
                          +  SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN, false);
                          +
                          +  result = ((uint16_t)buffer[0] << 8) | (uint16_t)buffer[1];
                          +  *tags = result & 0xF;
                          +  result >>= 4; // Get rid of tags
                          +  
                          +  ivdbg("cmd:%02x response:%04x\n", cmd, result);
                          +  return result;
                          +}
                          +
                          +/****************************************************************************
                          + * Name: max11802_notify
                          + ****************************************************************************/
                          +
                          +static void max11802_notify(FAR struct max11802_dev_s *priv)
                          +{
                          +#ifndef CONFIG_DISABLE_POLL
                          +  int i;
                          +#endif
                          +
                          +  /* If there are threads waiting for read data, then signal one of them
                          +   * that the read data is available.
                          +   */
                          +
                          +  if (priv->nwaiters > 0)
                          +    {
                          +      /* After posting this semaphore, we need to exit because the sample
                          +       * is no longer available.
                          +       */
                          +
                          +      sem_post(&priv->waitsem); 
                          +    }
                          +
                          +  /* If there are threads waiting on poll() for MAX11802 data to become available,
                          +   * then wake them up now.  NOTE: we wake up all waiting threads because we
                          +   * do not know that they are going to do.  If they all try to read the data,
                          +   * then some make end up blocking after all.
                          +   */
                          +
                          +#ifndef CONFIG_DISABLE_POLL
                          +  for (i = 0; i < CONFIG_MAX11802_NPOLLWAITERS; i++)
                          +    {
                          +      struct pollfd *fds = priv->fds[i];
                          +      if (fds)
                          +        {
                          +          fds->revents |= POLLIN;
                          +          ivdbg("Report events: %02x\n", fds->revents);
                          +          sem_post(fds->sem);
                          +        }
                          +    }
                          +#endif
                          +}
                          +
                          +/****************************************************************************
                          + * Name: max11802_sample
                          + ****************************************************************************/
                          +
                          +static int max11802_sample(FAR struct max11802_dev_s *priv,
                          +                          FAR struct max11802_sample_s *sample)
                          +{
                          +  irqstate_t flags;
                          +  int ret = -EAGAIN;
                          +
                          +  /* Interrupts must be disabled when this is called to (1) prevent posting
                          +   * of semaphores from interrupt handlers, and (2) to prevent sampled data
                          +   * from changing until it has been reported.
                          +   */
                          +
                          +  flags = irqsave();
                          +
                          +  /* Is there new MAX11802 sample data available? */
                          +
                          +  if (priv->penchange)
                          +    {
                          +      /* Yes.. the state has changed in some way.  Return a copy of the
                          +       * sampled data.
                          +       */
                          +
                          +      memcpy(sample, &priv->sample, sizeof(struct max11802_sample_s ));
                          +
                          +      /* Now manage state transitions */
                          +
                          +      if (sample->contact == CONTACT_UP)
                          +        {
                          +          /* Next.. no contact.  Increment the ID so that next contact ID
                          +           * will be unique.  X/Y positions are no longer valid.
                          +           */
                          +
                          +          priv->sample.contact = CONTACT_NONE;
                          +          priv->sample.valid   = false;
                          +          priv->id++;
                          +        }
                          +      else if (sample->contact == CONTACT_DOWN)
                          +       {
                          +          /* First report -- next report will be a movement */
                          +
                          +         priv->sample.contact = CONTACT_MOVE;
                          +       }
                          +
                          +      priv->penchange = false;
                          +      ret = OK;
                          +    }
                          +
                          +  irqrestore(flags);
                          +  return ret;
                          +}
                          +
                          +/****************************************************************************
                          + * Name: max11802_waitsample
                          + ****************************************************************************/
                          +
                          +static int max11802_waitsample(FAR struct max11802_dev_s *priv,
                          +                               FAR struct max11802_sample_s *sample)
                          +{
                          +  irqstate_t flags;
                          +  int ret;
                          +
                          +  /* Interrupts must be disabled when this is called to (1) prevent posting
                          +   * of semaphores from interrupt handlers, and (2) to prevent sampled data
                          +   * from changing until it has been reported.
                          +   *
                          +   * In addition, we will also disable pre-emption to prevent other threads
                          +   * from getting control while we muck with the semaphores.
                          +   */
                          +
                          +  sched_lock();
                          +  flags = irqsave();
                          +
                          +  /* Now release the semaphore that manages mutually exclusive access to
                          +   * the device structure.  This may cause other tasks to become ready to
                          +   * run, but they cannot run yet because pre-emption is disabled.
                          +   */
                          +
                          +  sem_post(&priv->devsem);
                          +
                          +  /* Try to get the a sample... if we cannot, then wait on the semaphore
                          +   * that is posted when new sample data is available.
                          +   */
                          +
                          +  while (max11802_sample(priv, sample) < 0)
                          +    {
                          +      /* Wait for a change in the MAX11802 state */
                          + 
                          +      ivdbg("Waiting..\n");
                          +      priv->nwaiters++;
                          +      ret = sem_wait(&priv->waitsem);
                          +      priv->nwaiters--;
                          +
                          +      if (ret < 0)
                          +        {
                          +          /* If we are awakened by a signal, then we need to return
                          +           * the failure now.
                          +           */
                          +
                          +          idbg("sem_wait: %d\n", errno);
                          +          DEBUGASSERT(errno == EINTR);
                          +          ret = -EINTR;
                          +          goto errout;
                          +        }
                          +    }
                          +
                          +  ivdbg("Sampled\n");
                          +
                          +   /* Re-acquire the the semaphore that manages mutually exclusive access to
                          +   * the device structure.  We may have to wait here.  But we have our sample.
                          +   * Interrupts and pre-emption will be re-enabled while we wait.
                          +   */
                          +
                          +  ret = sem_wait(&priv->devsem);
                          +
                          +errout:
                          +  /* Then re-enable interrupts.  We might get interrupt here and there
                          +   * could be a new sample.  But no new threads will run because we still
                          +   * have pre-emption disabled.
                          +   */
                          +
                          +  irqrestore(flags);
                          +
                          +  /* Restore pre-emption.  We might get suspended here but that is okay
                          +   * because we already have our sample.  Note:  this means that if there
                          +   * were two threads reading from the MAX11802 for some reason, the data
                          +   * might be read out of order.
                          +   */
                          +
                          +  sched_unlock();
                          +  return ret;
                          +}
                          +
                          +/****************************************************************************
                          + * Name: max11802_schedule
                          + ****************************************************************************/
                          +
                          +static int max11802_schedule(FAR struct max11802_dev_s *priv)
                          +{
                          +  FAR struct max11802_config_s *config;
                          +  int                           ret;
                          +
                          +  /* Get a pointer the callbacks for convenience (and so the code is not so
                          +   * ugly).
                          +   */
                          +
                          +  config = priv->config;
                          +  DEBUGASSERT(config != NULL);
                          +
                          +  /* Disable further interrupts.  MAX11802 interrupts will be re-enabled
                          +   * after the worker thread executes.
                          +   */
                          +
                          +  config->enable(config, false);
                          +
                          +  /* Disable the watchdog timer.  It will be re-enabled in the worker thread
                          +   * while the pen remains down.
                          +   */
                          +
                          +  wd_cancel(priv->wdog);
                          +
                          +  /* Transfer processing to the worker thread.  Since MAX11802 interrupts are
                          +   * disabled while the work is pending, no special action should be required
                          +   * to protected the work queue.
                          +   */
                          +
                          +  DEBUGASSERT(priv->work.worker == NULL);
                          +  ret = work_queue(HPWORK, &priv->work, max11802_worker, priv, 0);
                          +  if (ret != 0)
                          +    {
                          +      illdbg("Failed to queue work: %d\n", ret);
                          +    }
                          +
                          +  return OK;
                          +}
                          +
                          +/****************************************************************************
                          + * Name: max11802_wdog
                          + ****************************************************************************/
                          +
                          +static void max11802_wdog(int argc, uint32_t arg1, ...)
                          +{
                          +  FAR struct max11802_dev_s *priv = (FAR struct max11802_dev_s *)((uintptr_t)arg1);
                          +  (void)max11802_schedule(priv);
                          +}
                          +
                          +/****************************************************************************
                          + * Name: max11802_worker
                          + ****************************************************************************/
                          +
                          +static void max11802_worker(FAR void *arg)
                          +{
                          +  FAR struct max11802_dev_s    *priv = (FAR struct max11802_dev_s *)arg;
                          +  FAR struct max11802_config_s *config;
                          +  uint16_t                      x;
                          +  uint16_t                      y;
                          +  uint16_t                      xdiff;
                          +  uint16_t                      ydiff;
                          +  bool                          pendown;
                          +  int                           ret;
                          +  int                           tags, tags2;
                          +
                          +  ASSERT(priv != NULL);
                          +
                          +  /* Get a pointer the callbacks for convenience (and so the code is not so
                          +   * ugly).
                          +   */
                          +
                          +  config = priv->config;
                          +  DEBUGASSERT(config != NULL);
                          +
                          +  /* Disable the watchdog timer.  This is safe because it is started only
                          +   * by this function and this function is serialized on the worker thread.
                          +   */
                          +
                          +  wd_cancel(priv->wdog);
                          +
                          +  /* Lock the SPI bus so that we have exclusive access */
                          +
                          +  max11802_lock(priv->spi);
                          +  
                          +  /* Start coordinate measurement */
                          +  (void)max11802_sendcmd(priv, MAX11802_CMD_MEASUREXY, &tags);
                          +  
                          +  /* Get exclusive access to the driver data structure */
                          +
                          +  do
                          +    {
                          +      ret = sem_wait(&priv->devsem);
                          +
                          +      /* This should only fail if the wait was canceled by an signal
                          +       * (and the worker thread will receive a lot of signals).
                          +       */
                          +
                          +      DEBUGASSERT(ret == OK || errno == EINTR);
                          +    }
                          +  while (ret < 0);
                          +
                          +  /* Check for pen up or down by reading the PENIRQ GPIO. */
                          +
                          +  pendown = config->pendown(config);
                          +
                          +  /* Handle the change from pen down to pen up */
                          +
                          +  if (pendown)
                          +    ivdbg("\nPD\n");
                          +  else
                          +    ivdbg("\nPU\n");
                          +  
                          +  if (!pendown)
                          +    {
                          +      /* The pen is up.. reset thresholding variables. */
                          +
                          +      priv->threshx = INVALID_THRESHOLD;
                          +      priv->threshy = INVALID_THRESHOLD;
                          +
                          +      /* Ignore the interrupt if the pen was already up (CONTACT_NONE == pen up
                          +       * and already reported; CONTACT_UP == pen up, but not reported)
                          +       */
                          +
                          +      ivdbg("\nPC%d\n", priv->sample.contact);
                          +      
                          +      if (priv->sample.contact == CONTACT_NONE ||
                          +          priv->sample.contact == CONTACT_UP)
                          +
                          +        {
                          +          goto ignored;
                          +        }
                          +
                          +      /* The pen is up.  NOTE: We know from a previous test, that this is a
                          +       * loss of contact condition.  This will be changed to CONTACT_NONE
                          +       * after the loss of contact is sampled.
                          +       */
                          +
                          +       priv->sample.contact = CONTACT_UP;
                          +    }
                          +
                          +  /* It is a pen down event.  If the last loss-of-contact event has not been
                          +   * processed yet, then we have to ignore the pen down event (or else it will
                          +   * look like a drag event)
                          +   */
                          +
                          +  else if (priv->sample.contact == CONTACT_UP)
                          +    {
                          +      /* If we have not yet processed the last pen up event, then we
                          +       * cannot handle this pen down event. We will have to discard it.  That
                          +       * should be okay because we will set the timer to to sample again
                          +       * later.
                          +       */
                          +
                          +       ivdbg("Previous pen up event still in buffer\n");
                          +       max11802_notify(priv);
                          +       wd_start(priv->wdog, MAX11802_WDOG_DELAY, max11802_wdog, 1, (uint32_t)priv);
                          +       goto ignored;
                          +    }
                          +  else
                          +    {
                          +      /* Wait for data ready */
                          +      do {
                          +        /* Handle pen down events.  First, sample positional values. */
                          +      
                          +#ifdef CONFIG_MAX11802_SWAPXY
                          +        x = max11802_sendcmd(priv, MAX11802_CMD_YPOSITION, &tags);
                          +        y = max11802_sendcmd(priv, MAX11802_CMD_XPOSITION, &tags2);
                          +#else
                          +        x = max11802_sendcmd(priv, MAX11802_CMD_XPOSITION, &tags);
                          +        y = max11802_sendcmd(priv, MAX11802_CMD_YPOSITION, &tags2);
                          +#endif
                          +      } while (tags == 0xF || tags2 == 0xF);
                          +
                          +      /* Continue to sample the position while the pen is down */
                          +      wd_start(priv->wdog, MAX11802_WDOG_DELAY, max11802_wdog, 1, (uint32_t)priv);
                          +      
                          +      /* Check if data is valid */
                          +      if ((tags & 0x03) != 0)
                          +      {
                          +        ivdbg("Touch ended before measurement\n");
                          +        goto ignored;
                          +      }
                          +      
                          +      /* Perform a thresholding operation so that the results will be more stable.
                          +       * If the difference from the last sample is small, then ignore the event.
                          +       * REVISIT:  Should a large change in pressure also generate a event?
                          +       */
                          +
                          +      xdiff = x > priv->threshx ? (x - priv->threshx) : (priv->threshx - x);
                          +      ydiff = y > priv->threshy ? (y - priv->threshy) : (priv->threshy - y);
                          +
                          +      /* Check the thresholds.  Bail if there is no significant difference */
                          +
                          +      if (xdiff < CONFIG_MAX11802_THRESHX && ydiff < CONFIG_MAX11802_THRESHY)
                          +        {
                          +          /* Little or no change in either direction ... don't report anything. */
                          +
                          +          goto ignored;
                          +        }
                          +
                          +      /* When we see a big difference, snap to the new x/y thresholds */
                          +
                          +      priv->threshx       = x;
                          +      priv->threshy       = y;
                          +
                          +      /* Update the x/y position in the sample data */
                          +
                          +      priv->sample.x      = priv->threshx;
                          +      priv->sample.y      = priv->threshy;
                          +
                          +      /* The X/Y positional data is now valid */
                          +
                          +      priv->sample.valid = true;
                          +
                          +      /* If this is the first (acknowledged) pen down report, then report
                          +       * this as the first contact.  If contact == CONTACT_DOWN, it will be
                          +       * set to set to CONTACT_MOVE after the contact is first sampled.
                          +       */
                          +
                          +      if (priv->sample.contact != CONTACT_MOVE)
                          +        {
                          +          /* First contact */
                          +
                          +          priv->sample.contact = CONTACT_DOWN;
                          +        }
                          +    }
                          +
                          +  /* Indicate the availability of new sample data for this ID */
                          +
                          +  priv->sample.id = priv->id;
                          +  priv->penchange = true;
                          +
                          +  /* Notify any waiters that new MAX11802 data is available */
                          +
                          +  max11802_notify(priv);
                          +
                          +ignored:
                          +  config->enable(config, true);
                          +
                          +  /* Release our lock on the state structure and unlock the SPI bus */
                          +
                          +  sem_post(&priv->devsem);
                          +  max11802_unlock(priv->spi);
                          +}
                          +
                          +/****************************************************************************
                          + * Name: max11802_interrupt
                          + ****************************************************************************/
                          +
                          +static int max11802_interrupt(int irq, FAR void *context)
                          +{
                          +  FAR struct max11802_dev_s    *priv;
                          +  FAR struct max11802_config_s *config;
                          +  int                           ret;
                          +
                          +  /* Which MAX11802 device caused the interrupt? */
                          +
                          +#ifndef CONFIG_MAX11802_MULTIPLE
                          +  priv = &g_max11802;
                          +#else
                          +  for (priv = g_max11802list;
                          +       priv && priv->configs->irq != irq;
                          +       priv = priv->flink);
                          +
                          +  ASSERT(priv != NULL);
                          +#endif
                          +
                          +  /* Get a pointer the callbacks for convenience (and so the code is not so
                          +   * ugly).
                          +   */
                          +
                          +  config = priv->config;
                          +  DEBUGASSERT(config != NULL);
                          +
                          +  /* Schedule sampling to occur on the worker thread */
                          +
                          +  ret = max11802_schedule(priv);
                          +
                          +  /* Clear any pending interrupts and return success */
                          +
                          +  config->clear(config);
                          +  return ret;
                          +}
                          +
                          +/****************************************************************************
                          + * Name: max11802_open
                          + ****************************************************************************/
                          +
                          +static int max11802_open(FAR struct file *filep)
                          +{
                          +#ifdef CONFIG_MAX11802_REFCNT
                          +  FAR struct inode         *inode;
                          +  FAR struct max11802_dev_s *priv;
                          +  uint8_t                   tmp;
                          +  int                       ret;
                          +
                          +  ivdbg("Opening\n");
                          +
                          +  DEBUGASSERT(filep);
                          +  inode = filep->f_inode;
                          +
                          +  DEBUGASSERT(inode && inode->i_private);
                          +  priv  = (FAR struct max11802_dev_s *)inode->i_private;
                          +
                          +  /* Get exclusive access to the driver data structure */
                          +
                          +  ret = sem_wait(&priv->devsem);
                          +  if (ret < 0)
                          +    {
                          +      /* This should only happen if the wait was canceled by an signal */
                          +
                          +      DEBUGASSERT(errno == EINTR);
                          +      return -EINTR;
                          +    }
                          +
                          +  /* Increment the reference count */
                          +
                          +  tmp = priv->crefs + 1;
                          +  if (tmp == 0)
                          +    {
                          +      /* More than 255 opens; uint8_t overflows to zero */
                          +
                          +      ret = -EMFILE;
                          +      goto errout_with_sem;
                          +    }
                          +
                          +  /* When the reference increments to 1, this is the first open event
                          +   * on the driver.. and an opportunity to do any one-time initialization.
                          +   */
                          +
                          +  /* Save the new open count on success */
                          +
                          +  priv->crefs = tmp;
                          +
                          +errout_with_sem:
                          +  sem_post(&priv->devsem);
                          +  return ret;
                          +#else
                          +  ivdbg("Opening\n");
                          +  return OK;
                          +#endif
                          +}
                          +
                          +/****************************************************************************
                          + * Name: max11802_close
                          + ****************************************************************************/
                          +
                          +static int max11802_close(FAR struct file *filep)
                          +{
                          +#ifdef CONFIG_MAX11802_REFCNT
                          +  FAR struct inode         *inode;
                          +  FAR struct max11802_dev_s *priv;
                          +  int                       ret;
                          +
                          +  ivdbg("Closing\n");
                          +  DEBUGASSERT(filep);
                          +  inode = filep->f_inode;
                          +
                          +  DEBUGASSERT(inode && inode->i_private);
                          +  priv  = (FAR struct max11802_dev_s *)inode->i_private;
                          +
                          +  /* Get exclusive access to the driver data structure */
                          +
                          +  ret = sem_wait(&priv->devsem);
                          +  if (ret < 0)
                          +    {
                          +      /* This should only happen if the wait was canceled by an signal */
                          +
                          +      DEBUGASSERT(errno == EINTR);
                          +      return -EINTR;
                          +    }
                          +
                          +  /* Decrement the reference count unless it would decrement a negative
                          +   * value.  When the count decrements to zero, there are no further
                          +   * open references to the driver.
                          +   */
                          +
                          +  if (priv->crefs >= 1)
                          +    {
                          +      priv->crefs--;
                          +    }
                          +
                          +  sem_post(&priv->devsem);
                          +#endif
                          +  ivdbg("Closing\n");
                          +  return OK;
                          +}
                          +
                          +/****************************************************************************
                          + * Name: max11802_read
                          + ****************************************************************************/
                          +
                          +static ssize_t max11802_read(FAR struct file *filep, FAR char *buffer, size_t len)
                          +{
                          +  FAR struct inode          *inode;
                          +  FAR struct max11802_dev_s *priv;
                          +  FAR struct touch_sample_s *report;
                          +  struct max11802_sample_s   sample;
                          +  int                        ret;
                          +
                          +  ivdbg("buffer:%p len:%d\n", buffer, len);
                          +  DEBUGASSERT(filep);
                          +  inode = filep->f_inode;
                          +
                          +  DEBUGASSERT(inode && inode->i_private);
                          +  priv  = (FAR struct max11802_dev_s *)inode->i_private;
                          +
                          +  /* Verify that the caller has provided a buffer large enough to receive
                          +   * the touch data.
                          +   */
                          +
                          +  if (len < SIZEOF_TOUCH_SAMPLE_S(1))
                          +    {
                          +      /* We could provide logic to break up a touch report into segments and
                          +       * handle smaller reads... but why?
                          +       */
                          +
                          +      idbg("Unsupported read size: %d\n", len);
                          +      return -ENOSYS;
                          +    }
                          +
                          +  /* Get exclusive access to the driver data structure */
                          +
                          +  ret = sem_wait(&priv->devsem);
                          +  if (ret < 0)
                          +    {
                          +      /* This should only happen if the wait was canceled by an signal */
                          +
                          +      idbg("sem_wait: %d\n", errno);
                          +      DEBUGASSERT(errno == EINTR);
                          +      return -EINTR;
                          +    }
                          +
                          +  /* Try to read sample data. */
                          +
                          +  ret = max11802_sample(priv, &sample);
                          +  if (ret < 0)
                          +    {
                          +      /* Sample data is not available now.  We would ave to wait to get
                          +       * receive sample data.  If the user has specified the O_NONBLOCK
                          +       * option, then just return an error.
                          +       */
                          +
                          +      ivdbg("Sample data is not available\n");
                          +      if (filep->f_oflags & O_NONBLOCK)
                          +        {
                          +          ret = -EAGAIN;
                          +          goto errout;
                          +       }
                          +
                          +      /* Wait for sample data */
                          +
                          +      ret = max11802_waitsample(priv, &sample);
                          +      if (ret < 0)
                          +        {
                          +          /* We might have been awakened by a signal */
                          +
                          +          idbg("max11802_waitsample: %d\n", ret);
                          +          goto errout;
                          +        }
                          +    }
                          +
                          +  /* In any event, we now have sampled MAX11802 data that we can report
                          +   * to the caller.
                          +   */
                          +
                          +  report = (FAR struct touch_sample_s *)buffer;
                          +  memset(report, 0, SIZEOF_TOUCH_SAMPLE_S(1));
                          +  report->npoints            = 1;
                          +  report->point[0].id        = sample.id;
                          +  report->point[0].x         = sample.x;
                          +  report->point[0].y         = sample.y;
                          +
                          +  /* Report the appropriate flags */
                          +
                          +  if (sample.contact == CONTACT_UP)
                          +    {
                          +       /* Pen is now up.  Is the positional data valid?  This is important to
                          +        * know because the release will be sent to the window based on its
                          +        * last positional data.
                          +        */
                          +
                          +      if (sample.valid)
                          +        {
                          +          report->point[0].flags  = TOUCH_UP | TOUCH_ID_VALID | TOUCH_POS_VALID;
                          +        }
                          +      else
                          +        {
                          +          report->point[0].flags  = TOUCH_UP | TOUCH_ID_VALID;
                          +        }
                          +    }
                          +  else if (sample.contact == CONTACT_DOWN)
                          +    {
                          +      /* First contact */
                          +
                          +      report->point[0].flags  = TOUCH_DOWN | TOUCH_ID_VALID | TOUCH_POS_VALID;
                          +    }
                          +  else /* if (sample->contact == CONTACT_MOVE) */
                          +    {
                          +      /* Movement of the same contact */
                          +
                          +      report->point[0].flags  = TOUCH_MOVE | TOUCH_ID_VALID | TOUCH_POS_VALID;
                          +    }
                          +
                          +  ivdbg("  id:      %d\n", report->point[0].id);
                          +  ivdbg("  flags:   %02x\n", report->point[0].flags);
                          +  ivdbg("  x:       %d\n", report->point[0].x);
                          +  ivdbg("  y:       %d\n", report->point[0].y);
                          +
                          +  ret = SIZEOF_TOUCH_SAMPLE_S(1);
                          +
                          +errout:
                          +  sem_post(&priv->devsem);
                          +  ivdbg("Returning: %d\n", ret);
                          +  return ret;
                          +}
                          +
                          +/****************************************************************************
                          + * Name:max11802_ioctl
                          + ****************************************************************************/
                          +
                          +static int max11802_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
                          +{
                          +  FAR struct inode         *inode;
                          +  FAR struct max11802_dev_s *priv;
                          +  int                       ret;
                          +
                          +  ivdbg("cmd: %d arg: %ld\n", cmd, arg);
                          +  DEBUGASSERT(filep);
                          +  inode = filep->f_inode;
                          +
                          +  DEBUGASSERT(inode && inode->i_private);
                          +  priv  = (FAR struct max11802_dev_s *)inode->i_private;
                          +
                          +  /* Get exclusive access to the driver data structure */
                          +
                          +  ret = sem_wait(&priv->devsem);
                          +  if (ret < 0)
                          +    {
                          +      /* This should only happen if the wait was canceled by an signal */
                          +
                          +      DEBUGASSERT(errno == EINTR);
                          +      return -EINTR;
                          +    }
                          +
                          +  /* Process the IOCTL by command */
                          +
                          +  switch (cmd)
                          +    {
                          +      case TSIOC_SETFREQUENCY:  /* arg: Pointer to uint32_t frequency value */
                          +        {
                          +          FAR uint32_t *ptr = (FAR uint32_t *)((uintptr_t)arg);
                          +          DEBUGASSERT(priv->config != NULL && ptr != NULL);
                          +          priv->config->frequency = SPI_SETFREQUENCY(priv->spi, *ptr);
                          +        }
                          +        break;
                          +
                          +      case TSIOC_GETFREQUENCY:  /* arg: Pointer to uint32_t frequency value */
                          +        {
                          +          FAR uint32_t *ptr = (FAR uint32_t *)((uintptr_t)arg);
                          +          DEBUGASSERT(priv->config != NULL && ptr != NULL);
                          +          *ptr = priv->config->frequency;
                          +        }
                          +        break;
                          +
                          +      default:
                          +        ret = -ENOTTY;
                          +        break;
                          +    }
                          +
                          +  sem_post(&priv->devsem);
                          +  return ret;
                          +}
                          +
                          +/****************************************************************************
                          + * Name: max11802_poll
                          + ****************************************************************************/
                          +
                          +#ifndef CONFIG_DISABLE_POLL
                          +static int max11802_poll(FAR struct file *filep, FAR struct pollfd *fds,
                          +                        bool setup)
                          +{
                          +  FAR struct inode         *inode;
                          +  FAR struct max11802_dev_s *priv;
                          +  pollevent_t               eventset;
                          +  int                       ndx;
                          +  int                       ret = OK;
                          +  int                       i;
                          +
                          +  ivdbg("setup: %d\n", (int)setup);
                          +  DEBUGASSERT(filep && fds);
                          +  inode = filep->f_inode;
                          +
                          +  DEBUGASSERT(inode && inode->i_private);
                          +  priv  = (FAR struct max11802_dev_s *)inode->i_private;
                          +
                          +  /* Are we setting up the poll?  Or tearing it down? */
                          +
                          +  ret = sem_wait(&priv->devsem);
                          +  if (ret < 0)
                          +    {
                          +      /* This should only happen if the wait was canceled by an signal */
                          +
                          +      DEBUGASSERT(errno == EINTR);
                          +      return -EINTR;
                          +    }
                          +
                          +  if (setup)
                          +    {
                          +      /* Ignore waits that do not include POLLIN */
                          +
                          +      if ((fds->events & POLLIN) == 0)
                          +        {
                          +          ret = -EDEADLK;
                          +          goto errout;
                          +        }
                          +
                          +      /* This is a request to set up the poll.  Find an available
                          +       * slot for the poll structure reference
                          +       */
                          +
                          +      for (i = 0; i < CONFIG_MAX11802_NPOLLWAITERS; i++)
                          +        {
                          +          /* Find an available slot */
                          +
                          +          if (!priv->fds[i])
                          +            {
                          +              /* Bind the poll structure and this slot */
                          +
                          +              priv->fds[i] = fds;
                          +              fds->priv    = &priv->fds[i];
                          +              break;
                          +            }
                          +        }
                          +
                          +      if (i >= CONFIG_MAX11802_NPOLLWAITERS)
                          +        {
                          +          fds->priv    = NULL;
                          +          ret          = -EBUSY;
                          +          goto errout;
                          +        }
                          +
                          +      /* Should we immediately notify on any of the requested events? */
                          +
                          +      if (priv->penchange)
                          +        {
                          +          max11802_notify(priv);
                          +        }
                          +    }
                          +  else if (fds->priv)
                          +    {
                          +      /* This is a request to tear down the poll. */
                          +
                          +      struct pollfd **slot = (struct pollfd **)fds->priv;
                          +      DEBUGASSERT(slot != NULL);
                          +
                          +      /* Remove all memory of the poll setup */
                          +
                          +      *slot                = NULL;
                          +      fds->priv            = NULL;
                          +    }
                          +
                          +errout:
                          +  sem_post(&priv->devsem);
                          +  return ret;
                          +}
                          +#endif
                          +
                          +/****************************************************************************
                          + * Public Functions
                          + ****************************************************************************/
                          +
                          +/****************************************************************************
                          + * Public Functions
                          + ****************************************************************************/
                          +
                          +/****************************************************************************
                          + * Name: max11802_register
                          + *
                          + * Description:
                          + *   Configure the MAX11802 to use the provided SPI device instance.  This
                          + *   will register the driver as /dev/inputN where N is the minor device
                          + *   number
                          + *
                          + * Input Parameters:
                          + *   dev     - An SPI driver instance
                          + *   config  - Persistent board configuration data
                          + *   minor   - The input device minor number
                          + *
                          + * Returned Value:
                          + *   Zero is returned on success.  Otherwise, a negated errno value is
                          + *   returned to indicate the nature of the failure.
                          + *
                          + ****************************************************************************/
                          +
                          +int max11802_register(FAR struct spi_dev_s *spi,
                          +                      FAR struct max11802_config_s *config, int minor)
                          +{
                          +  FAR struct max11802_dev_s *priv;
                          +  char devname[DEV_NAMELEN];
                          +#ifdef CONFIG_MAX11802_MULTIPLE
                          +  irqstate_t flags;
                          +#endif
                          +  int ret;
                          +
                          +  ivdbg("spi: %p minor: %d\n", spi, minor);
                          +
                          +  /* Debug-only sanity checks */
                          +
                          +  DEBUGASSERT(spi != NULL && config != NULL && minor >= 0 && minor < 100);
                          +
                          +  /* Create and initialize a MAX11802 device driver instance */
                          +
                          +#ifndef CONFIG_MAX11802_MULTIPLE
                          +  priv = &g_max11802;
                          +#else
                          +  priv = (FAR struct max11802_dev_s *)kmalloc(sizeof(struct max11802_dev_s));
                          +  if (!priv)
                          +    {
                          +      idbg("kmalloc(%d) failed\n", sizeof(struct max11802_dev_s));
                          +      return -ENOMEM;
                          +    }
                          +#endif
                          +
                          +  /* Initialize the MAX11802 device driver instance */
                          +
                          +  memset(priv, 0, sizeof(struct max11802_dev_s));
                          +  priv->spi     = spi;               /* Save the SPI device handle */
                          +  priv->config  = config;            /* Save the board configuration */
                          +  priv->wdog    = wd_create();       /* Create a watchdog timer */
                          +  priv->threshx = INVALID_THRESHOLD; /* Initialize thresholding logic */
                          +  priv->threshy = INVALID_THRESHOLD; /* Initialize thresholding logic */
                          +
                          +  sem_init(&priv->devsem,  0, 1);    /* Initialize device structure semaphore */
                          +  sem_init(&priv->waitsem, 0, 0);    /* Initialize pen event wait semaphore */
                          +
                          +  /* Make sure that interrupts are disabled */
                          +
                          +  config->clear(config);
                          +  config->enable(config, false);
                          +
                          +  /* Attach the interrupt handler */
                          +
                          +  ret = config->attach(config, max11802_interrupt);
                          +  if (ret < 0)
                          +    {
                          +      idbg("Failed to attach interrupt\n");
                          +      goto errout_with_priv;
                          +    }
                          +
                          +  idbg("Mode: %d Bits: 8 Frequency: %d\n",
                          +       CONFIG_MAX11802_SPIMODE, CONFIG_MAX11802_FREQUENCY);
                          +
                          +  /* Lock the SPI bus so that we have exclusive access */
                          +
                          +  max11802_lock(spi);
                          +
                          +  /* Configure the SPI interface */
                          +
                          +  max11802_configspi(spi);
                          +
                          +  /* Configure MAX11802 registers */
                          +  SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN, true);
                          +  (void)SPI_SEND(priv->spi, MAX11802_CMD_MODE_WR);
                          +  (void)SPI_SEND(priv->spi, MAX11802_MODE);
                          +  SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN, false);
                          +
                          +  SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN, true);
                          +  (void)SPI_SEND(priv->spi, MAX11802_CMD_AVG_WR);
                          +  (void)SPI_SEND(priv->spi, MAX11802_AVG);
                          +  SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN, false);
                          +
                          +  SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN, true);
                          +  (void)SPI_SEND(priv->spi, MAX11802_CMD_TIMING_WR);
                          +  (void)SPI_SEND(priv->spi, MAX11802_TIMING);
                          +  SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN, false);
                          +  
                          +  SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN, true);
                          +  (void)SPI_SEND(priv->spi, MAX11802_CMD_DELAY_WR);
                          +  (void)SPI_SEND(priv->spi, MAX11802_DELAY);
                          +  SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN, false);
                          +  
                          +  /* Test that the device access was successful. */
                          +  SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN, true);
                          +  (void)SPI_SEND(priv->spi, MAX11802_CMD_MODE_RD);
                          +  ret = SPI_SEND(priv->spi, 0);
                          +  SPI_SELECT(priv->spi, SPIDEV_TOUCHSCREEN, false);
                          +  
                          +  /* Unlock the bus */
                          +  max11802_unlock(spi);
                          +  
                          +  if (ret != MAX11802_MODE)
                          +  {
                          +    idbg("max11802 mode readback failed: %02x\n", ret);
                          +    goto errout_with_priv;
                          +  }
                          +  
                          +  /* Register the device as an input device */
                          +
                          +  (void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, minor);
                          +  ivdbg("Registering %s\n", devname);
                          +
                          +  ret = register_driver(devname, &max11802_fops, 0666, priv);
                          +  if (ret < 0)
                          +    {
                          +      idbg("register_driver() failed: %d\n", ret);
                          +      goto errout_with_priv;
                          +    }
                          +
                          +  /* If multiple MAX11802 devices are supported, then we will need to add
                          +   * this new instance to a list of device instances so that it can be
                          +   * found by the interrupt handler based on the recieved IRQ number.
                          +   */
                          +
                          +#ifdef CONFIG_MAX11802_MULTIPLE
                          +  priv->flink    = g_max11802list;
                          +  g_max11802list = priv;
                          +  irqrestore(flags);
                          +#endif
                          +
                          +  /* Schedule work to perform the initial sampling and to set the data
                          +   * availability conditions.
                          +   */
                          +
                          +  ret = work_queue(HPWORK, &priv->work, max11802_worker, priv, 0);
                          +  if (ret != 0)
                          +    {
                          +      idbg("Failed to queue work: %d\n", ret);
                          +      goto errout_with_priv;
                          +    }
                          +
                          +  /* And return success (?) */
                          +
                          +  return OK;
                          +
                          +errout_with_priv:
                          +  sem_destroy(&priv->devsem);
                          +#ifdef CONFIG_MAX11802_MULTIPLE
                          +  kfree(priv);
                          +#endif
                          +  return ret;
                          +}
                          diff --git a/nuttx/drivers/input/max11802.h b/nuttx/drivers/input/max11802.h
                          new file mode 100644
                          index 0000000000..b6beec0451
                          --- /dev/null
                          +++ b/nuttx/drivers/input/max11802.h
                          @@ -0,0 +1,167 @@
                          +/********************************************************************************************
                          + * drivers/input/max11802.h
                          + *
                          + *   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                          + *   Authors: Gregory Nutt 
                          + *            Petteri Aimonen 
                          + *
                          + * References:
                          + *   "Low-Power, Ultra-Small Resistive Touch-Screen Controllers
                          + *    with I2C/SPI Interface" Maxim IC, Rev 3, 10/2010
                          + *
                          + * 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 __DRIVERS_INPUT_MAX11802_H
                          +#define __DRIVERS_INPUT_MAX11802_H
                          +
                          +/********************************************************************************************
                          + * Included Files
                          + ********************************************************************************************/
                          +
                          +#include 
                          +
                          +#include 
                          +#include 
                          +#include 
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +#include 
                          +
                          +/********************************************************************************************
                          + * Pre-Processor Definitions
                          + ********************************************************************************************/
                          +/* Configuration ****************************************************************************/
                          +
                          +/* MAX11802 Interfaces *********************************************************************/
                          +
                          +/* LSB of register addresses specifies read (1) or write (0). */
                          +#define MAX11802_CMD_XPOSITION ((0x52 << 1) | 1)
                          +#define MAX11802_CMD_YPOSITION ((0x54 << 1) | 1)
                          +#define MAX11802_CMD_MEASUREXY (0x70 << 1)
                          +#define MAX11802_CMD_MODE_WR   (0x0B << 1)
                          +#define MAX11802_CMD_MODE_RD   ((0x0B << 1) | 1)
                          +#define MAX11802_CMD_AVG_WR    (0x03 << 1)
                          +#define MAX11802_CMD_TIMING_WR (0x05 << 1)
                          +#define MAX11802_CMD_DELAY_WR  (0x06 << 1)
                          +
                          +/* Register values to set */
                          +#define MAX11802_MODE    0x0E
                          +#define MAX11802_AVG     0x55
                          +#define MAX11802_TIMING  0x77
                          +#define MAX11802_DELAY   0x55
                          +
                          +/* Driver support **************************************************************************/
                          +/* This format is used to construct the /dev/input[n] device driver path.  It
                          + * defined here so that it will be used consistently in all places.
                          + */
                          +
                          +#define DEV_FORMAT   "/dev/input%d"
                          +#define DEV_NAMELEN  16
                          +
                          +/* Poll the pen position while the pen is down at this rate (50MS): */
                          +
                          +#define MAX11802_WDOG_DELAY  ((50 + (MSEC_PER_TICK-1))/ MSEC_PER_TICK)
                          +
                          +/********************************************************************************************
                          + * Public Types
                          + ********************************************************************************************/
                          +
                          +/* This describes the state of one contact */
                          +
                          +enum max11802_contact_3
                          +{
                          +  CONTACT_NONE = 0,                    /* No contact */
                          +  CONTACT_DOWN,                        /* First contact */
                          +  CONTACT_MOVE,                        /* Same contact, possibly different position */
                          +  CONTACT_UP,                          /* Contact lost */
                          +};
                          +
                          +/* This structure describes the results of one MAX11802 sample */
                          +
                          +struct max11802_sample_s
                          +{
                          +  uint8_t  id;                          /* Sampled touch point ID */
                          +  uint8_t  contact;                     /* Contact state (see enum ads7843e_contact_e) */
                          +  bool     valid;                       /* True: x,y contain valid, sampled data */
                          +  uint16_t x;                           /* Measured X position */
                          +  uint16_t y;                           /* Measured Y position */
                          +};
                          +
                          +/* This structure describes the state of one MAX11802 driver instance */
                          +
                          +struct max11802_dev_s
                          +{
                          +#ifdef CONFIG_ADS7843E_MULTIPLE
                          +  FAR struct ads7843e_dev_s *flink;     /* Supports a singly linked list of drivers */
                          +#endif
                          +  uint8_t nwaiters;                     /* Number of threads waiting for MAX11802 data */
                          +  uint8_t id;                           /* Current touch point ID */
                          +  volatile bool penchange;              /* An unreported event is buffered */
                          +  uint16_t threshx;                     /* Thresholding X value */
                          +  uint16_t threshy;                     /* Thresholding Y value */
                          +  sem_t devsem;                         /* Manages exclusive access to this structure */
                          +  sem_t waitsem;                        /* Used to wait for the availability of data */
                          +
                          +  FAR struct max11802_config_s *config; /* Board configuration data */
                          +  FAR struct spi_dev_s *spi;            /* Saved SPI driver instance */
                          +  struct work_s work;                   /* Supports the interrupt handling "bottom half" */
                          +  struct max11802_sample_s sample;      /* Last sampled touch point data */
                          +  WDOG_ID wdog;                         /* Poll the position while the pen is down */
                          +
                          +  /* The following is a list if poll structures of threads waiting for
                          +   * driver events. The 'struct pollfd' reference for each open is also
                          +   * retained in the f_priv field of the 'struct file'.
                          +   */
                          +
                          +#ifndef CONFIG_DISABLE_POLL
                          +  struct pollfd *fds[CONFIG_ADS7843E_NPOLLWAITERS];
                          +#endif
                          +};
                          +
                          +/********************************************************************************************
                          + * Public Function Prototypes
                          + ********************************************************************************************/
                          +
                          +#ifdef __cplusplus
                          +#define EXTERN extern "C"
                          +extern "C" {
                          +#else
                          +#define EXTERN extern
                          +#endif
                          +
                          +#undef EXTERN
                          +#ifdef __cplusplus
                          +}
                          +#endif
                          +
                          +#endif /* __DRIVERS_INPUT_ADS7843E_H */
                          diff --git a/nuttx/drivers/lcd/Kconfig b/nuttx/drivers/lcd/Kconfig
                          index 640239e637..2d20003ac5 100644
                          --- a/nuttx/drivers/lcd/Kconfig
                          +++ b/nuttx/drivers/lcd/Kconfig
                          @@ -183,12 +183,85 @@ config NOKIA6100_RGBORD
                           endif
                           
                           config LCD_UG9664HSWAG01
                          -	bool "9664HSWAG01 OLED Display Module"
                          +	bool "UG-9664HSWAG01 OLED Display Module"
                           	default n
                           	---help---
                          -		ug-9664hswag01.c.  OLED Display Module, UG-9664HSWAG01", Univision
                          -		Technology Inc.  Used with the LPC Xpresso and Embedded Artists
                          -		base board.
                          +		OLED Display Module, UG-9664HSWAG01, Univision Technology Inc.  Used
                          +		with the LPCXpresso and Embedded Artists base board.
                          +
                          +		Required LCD driver settings:
                          +		LCD_MAXCONTRAST should be 255, but any value >0 and <=255 will be accepted.
                          +		LCD_MAXPOWER should be 1:  0=off, 1=on
                          +
                          +		Required SPI driver settings:
                          +		SPI_CMDDATA - Include support for cmd/data selection.
                          +
                          +if LCD_UG9664HSWAG01
                          +
                          +config UG9664HSWAG01_SPIMODE
                          +	int "UG-9664HSWAG01 SPI Mode"
                          +	default 0
                          +	---help---
                          +		Controls the SPI mode
                          +
                          +config UG9664HSWAG01_FREQUENCY
                          +	int "UG-9664HSWAG01 SPI Frequency"
                          +	default 3500000
                          +	---help---
                          +		Define to use a different bus frequency
                          +
                          +config UG9664HSWAG01_NINTERFACES
                          +	int "Number of UG-9664HSWAG01 Devices"
                          +	default 1
                          +	---help---
                          +		Specifies the number of physical UG-9664HSWAG01 devices that will be
                          +		supported.  NOTE:  At present, this must be undefined or defined to be 1.
                          +
                          +config UG9664HSWAG01_POWER
                          +	bool "Power control"
                          +	default n
                          +	---help---
                          +		If the hardware supports a controllable OLED a power supply, this
                          +		configuration should be defined.  In this case the system must
                          +		provide an interface ug_power().
                          +
                          +endif
                          +
                          +config LCD_UG2864AMBAG01
                          +	bool "UG-2864AMBAG01 OLED Display Module"
                          +	default n
                          +	---help---
                          +		OLED Display Module, UG-2864AMBAG01, Univision Technology Inc. 
                          +
                          +		Required LCD driver settings:
                          +		LCD_MAXCONTRAST should be 255, but any value >0 and <=255 will be accepted.
                          +		LCD_MAXPOWER should be 1:  0=off, 1=on
                          +
                          +		Required SPI driver settings:
                          +		SPI_CMDDATA - Include support for cmd/data selection.
                          +
                          +if LCD_UG2864AMBAG01
                          +
                          +	config UG2864AMBAG01_SPIMODE
                          +	int "UG-2864AMBAG01 SPI Mode"
                          +	default 3
                          +	---help---
                          +		Controls the SPI mode
                          +
                          +config UG2864AMBAG01_FREQUENCY
                          +	int "UG-2864AMBAG01 SPI Frequency"
                          +	default 3500000
                          +	---help---
                          +		Define to use a different bus frequency
                          +
                          +config UG2864AMBAG01_NINTERFACES
                          +	int "Number of UG-2864AMBAG01 Devices"
                          +	default 1
                          +	---help---
                          +		Specifies the number of physical UG-9664HSWAG01 devices that will be
                          +		supported.  NOTE:  At present, this must be undefined or defined to be 1.
                          +
                          +endif
                           
                           config LCD_SSD1289
                           	bool "LCD Based on SSD1289 Controller"
                          diff --git a/nuttx/drivers/lcd/ug-9664hswag01.c b/nuttx/drivers/lcd/ug-9664hswag01.c
                          index e0e8e8e3a0..6ef78fca6e 100644
                          --- a/nuttx/drivers/lcd/ug-9664hswag01.c
                          +++ b/nuttx/drivers/lcd/ug-9664hswag01.c
                          @@ -73,8 +73,6 @@
                            * CONFIG_UG9664HSWAG01_POWER
                            *   If the hardware supports a controllable OLED a power supply, this
                            *   configuration shold be defined.  (See ug_power() below).
                          - * CONFIG_LCD_UGDEBUG - Enable detailed UG-9664HSWAG01 debug output
                          - *   (CONFIG_DEBUG and CONFIG_VERBOSE must also be enabled).
                            * 
                            * Required LCD driver settings:
                            * CONFIG_LCD_UG9664HSWAG01 - Enable UG-9664HSWAG01 support
                          @@ -119,11 +117,10 @@
                           
                           #ifndef CONFIG_DEBUG
                           #  undef CONFIG_DEBUG_VERBOSE
                          -#  undef CONFIG_DEBUG_GRAPHICS
                           #endif
                           
                           #ifndef CONFIG_DEBUG_VERBOSE
                          -#  undef CONFIG_LCD_UGDEBUG
                          +#  undef CONFIG_DEBUG_LCD
                           #endif
                           
                           /* Check contrast selection */
                          @@ -182,7 +179,7 @@
                           #define UG_BPP          1
                           #define UG_COLORFMT     FB_FMT_Y1
                           
                          -/* Bytes per logical row andactual device row */
                          +/* Bytes per logical row and actual device row */
                           
                           #define UG_XSTRIDE      (UG_XRES >> 3) /* Pixels arrange "horizontally for user" */
                           #define UG_YSTRIDE      (UG_YRES >> 3) /* But actual device arrangement is "vertical" */
                          @@ -198,10 +195,10 @@
                           
                           /* Debug ******************************************************************************/
                           
                          -#ifdef CONFIG_LCD_UGDEBUG
                          -# define ugdbg(format, arg...)  vdbg(format, ##arg)
                          +#ifdef CONFIG_DEBUG_LCD
                          +# define lcddbg(format, arg...)  vdbg(format, ##arg)
                           #else
                          -# define ugdbg(x...)
                          +# define lcddbg(x...)
                           #endif
                           
                           /**************************************************************************************
                          @@ -997,7 +994,7 @@ FAR struct lcd_dev_s *ug_initialize(FAR struct spi_dev_s *spi, unsigned int devn
                           
                             SPI_CMDDATA(spi, SPIDEV_DISPLAY, true);
                           
                          -  /* Set the starting position for the run */
                          +  /* Configure the device */
                           
                             (void)SPI_SEND(spi, SSD1305_SETCOLL + 2);       /* Set low column address */
                             (void)SPI_SEND(spi, SSD1305_SETCOLH + 2);       /* Set high column address */
                          diff --git a/nuttx/drivers/mmcsd/mmcsd_sdio.c b/nuttx/drivers/mmcsd/mmcsd_sdio.c
                          index b17ae077d3..3caa615834 100644
                          --- a/nuttx/drivers/mmcsd/mmcsd_sdio.c
                          +++ b/nuttx/drivers/mmcsd/mmcsd_sdio.c
                          @@ -38,6 +38,9 @@
                            ****************************************************************************/
                           
                           #include 
                          +
                          +#if defined (CONFIG_MMCSD) && defined (CONFIG_MMCSD_SDIO)
                          +
                           #include 
                           
                           #include 
                          @@ -3179,3 +3182,5 @@ errout_with_alloc:
                             kfree(priv);
                             return ret;
                           }
                          +
                          +#endif /* defined (CONFIG_MMCSD) && defined (CONFIG_MMCSD_SDIO) */
                          diff --git a/nuttx/drivers/mmcsd/mmcsd_spi.c b/nuttx/drivers/mmcsd/mmcsd_spi.c
                          index 7dbadc55fe..d437b7feaa 100644
                          --- a/nuttx/drivers/mmcsd/mmcsd_spi.c
                          +++ b/nuttx/drivers/mmcsd/mmcsd_spi.c
                          @@ -38,6 +38,9 @@
                            ****************************************************************************/
                           
                           #include 
                          +
                          +#if defined (CONFIG_MMCSD) && defined (CONFIG_MMCSD_SPI)
                          +
                           #include 
                           
                           #include 
                          @@ -508,7 +511,7 @@ static uint32_t mmcsd_sendcmd(FAR struct mmcsd_slot_s *slot,
                                 }
                                 break;
                           
                          -    /* The R3 response is 5 bytes long */
                          +    /* The R3 response is 5 bytes long. The first byte is identical to R1. */
                           
                               case MMCSD_CMDRESP_R3:
                                 {
                          @@ -520,8 +523,10 @@ static uint32_t mmcsd_sendcmd(FAR struct mmcsd_slot_s *slot,
                                   fvdbg("CMD%d[%08x] R1=%02x OCR=%08x\n",
                                         cmd->cmd & 0x3f, arg, response, slot->ocr);
                                 }
                          +      break;
                          +
                          +    /* The R7 response is 5 bytes long. The first byte is identical to R1. */
                           
                          -    /* The R7 response is 5 bytes long */
                               case MMCSD_CMDRESP_R7:
                               default:
                                 {
                          @@ -1876,3 +1881,5 @@ int mmcsd_spislotinitialize(int minor, int slotno, FAR struct spi_dev_s *spi)
                             (void)SPI_REGISTERCALLBACK(spi, mmcsd_mediachanged, (void*)slot);
                             return OK;
                           }
                          +
                          +#endif /* defined (CONFIG_MMCSD) && defined (CONFIG_MMCSD_SPI) */
                          diff --git a/nuttx/drivers/net/e1000.c b/nuttx/drivers/net/e1000.c
                          index ec2b29b6ad..cae6f39b40 100644
                          --- a/nuttx/drivers/net/e1000.c
                          +++ b/nuttx/drivers/net/e1000.c
                          @@ -60,6 +60,7 @@
                           #include 
                           #include 
                           #include 
                          +#include 
                           #include 
                           #include 
                           #include "e1000.h"
                          @@ -104,9 +105,9 @@ struct e1000_dev {
                               uint32_t io_mem_base;
                               uint32_t mem_size;
                               int pci_dev_id;
                          +	uint16_t pci_addr;
                               unsigned char src_mac[6];
                               unsigned char dst_mac[6];
                          -    int irq;
                               struct irq_action int_desc;
                               struct tx_ring tx_ring;
                               struct rx_ring rx_ring;
                          @@ -308,16 +309,16 @@ void e1000_init(struct e1000_dev *dev)
                               e1000_outl(dev, E1000_FCRTH, pba*9/10);
                           
                               // setup tx rings
                          -    txd_phys = PADDR(dev->tx_ring.desc);
                          -    kmem_phys = PADDR(dev->tx_ring.buf);
                          +    txd_phys = PADDR((uintptr_t)dev->tx_ring.desc);
                          +    kmem_phys = PADDR((uintptr_t)dev->tx_ring.buf);
                               for (i=0; itx_ring.desc[i].base_address = kmem_phys;
                          -	dev->tx_ring.desc[i].packet_length = 0;
                          -	dev->tx_ring.desc[i].cksum_offset = 0;
                          -	dev->tx_ring.desc[i].cksum_origin = 0;
                          -	dev->tx_ring.desc[i].desc_status = 1;
                          -	dev->tx_ring.desc[i].desc_command = (1<<0)|(1<<1)|(1<<3);
                          -	dev->tx_ring.desc[i].special_info = 0;
                          +		dev->tx_ring.desc[i].base_address = kmem_phys;
                          +		dev->tx_ring.desc[i].packet_length = 0;
                          +		dev->tx_ring.desc[i].cksum_offset = 0;
                          +		dev->tx_ring.desc[i].cksum_origin = 0;
                          +		dev->tx_ring.desc[i].desc_status = 1;
                          +		dev->tx_ring.desc[i].desc_command = (1<<0)|(1<<1)|(1<<3);
                          +		dev->tx_ring.desc[i].special_info = 0;
                               }
                               dev->tx_ring.tail = 0;
                               e1000_outl(dev, E1000_TDT, 0);
                          @@ -329,15 +330,15 @@ void e1000_init(struct e1000_dev *dev)
                               e1000_outl(dev, E1000_TXDCTL, 0x01010000);
                           
                               // setup rx rings
                          -    rxd_phys = PADDR(dev->rx_ring.desc);
                          -    kmem_phys = PADDR(dev->rx_ring.buf);
                          +    rxd_phys = PADDR((uintptr_t)dev->rx_ring.desc);
                          +    kmem_phys = PADDR((uintptr_t)dev->rx_ring.buf);
                               for (i=0; irx_ring.desc[i].base_address = kmem_phys;
                          -	dev->rx_ring.desc[i].packet_length = 0;
                          -	dev->rx_ring.desc[i].packet_cksum = 0;
                          -	dev->rx_ring.desc[i].desc_status = 0;
                          -	dev->rx_ring.desc[i].desc_errors = 0;
                          -	dev->rx_ring.desc[i].vlan_tag = 0;
                          +		dev->rx_ring.desc[i].base_address = kmem_phys;
                          +		dev->rx_ring.desc[i].packet_length = 0;
                          +		dev->rx_ring.desc[i].packet_cksum = 0;
                          +		dev->rx_ring.desc[i].desc_status = 0;
                          +		dev->rx_ring.desc[i].desc_errors = 0;
                          +		dev->rx_ring.desc[i].vlan_tag = 0;
                               }
                               dev->rx_ring.head = 0;
                               dev->rx_ring.tail = CONFIG_E1000_N_RX_DESC-1;
                          @@ -378,7 +379,7 @@ static int e1000_transmit(struct e1000_dev *e1000)
                           {
                               int tail = e1000->tx_ring.tail;
                               unsigned char *cp = (unsigned char *)
                          -	(e1000->tx_ring.buf + tail * CONFIG_E1000_BUFF_SIZE);
                          +		(e1000->tx_ring.buf + tail * CONFIG_E1000_BUFF_SIZE);
                               int count = e1000->uip_dev.d_len;
                           
                               /* Verify that the hardware is ready to send another packet.  If we get
                          @@ -387,7 +388,7 @@ static int e1000_transmit(struct e1000_dev *e1000)
                                */
                           
                               if (!e1000->tx_ring.desc[tail].desc_status)
                          -	return -1;
                          +		return -1;
                           
                               /* Increment statistics */
                           
                          @@ -445,14 +446,14 @@ static int e1000_uiptxpoll(struct uip_driver_s *dev)
                                */
                           
                               if (e1000->uip_dev.d_len > 0) {
                          -	uip_arp_out(&e1000->uip_dev);
                          -	e1000_transmit(e1000);
                          +		uip_arp_out(&e1000->uip_dev);
                          +		e1000_transmit(e1000);
                           
                          -	/* Check if there is room in the device to hold another packet. If not,
                          -	 * return a non-zero value to terminate the poll.
                          -	 */
                          -	if (!e1000->tx_ring.desc[tail].desc_status)
                          -	    return -1;
                          +		/* Check if there is room in the device to hold another packet. If not,
                          +		 * return a non-zero value to terminate the poll.
                          +		 */
                          +		if (!e1000->tx_ring.desc[tail].desc_status)
                          +			return -1;
                               }
                           
                               /* If zero is returned, the polling will continue until all connections have
                          @@ -483,75 +484,75 @@ static void e1000_receive(struct e1000_dev *e1000)
                           {
                               int head = e1000->rx_ring.head;
                               unsigned char *cp = (unsigned char *)
                          -	(e1000->rx_ring.buf + head * CONFIG_E1000_BUFF_SIZE);
                          +		(e1000->rx_ring.buf + head * CONFIG_E1000_BUFF_SIZE);
                               int cnt;
                           
                               while (e1000->rx_ring.desc[head].desc_status) {
                           
                          -	/* Check for errors and update statistics */
                          +		/* Check for errors and update statistics */
                           	
                          -	// Here we do not handle packets that exceed packet-buffer size
                          -	if ((e1000->rx_ring.desc[head].desc_status & 3) == 1) {
                          -	    cprintf("NIC READ: Oversized packet\n");
                          -	    goto next;
                          -	}
                          +		// Here we do not handle packets that exceed packet-buffer size
                          +		if ((e1000->rx_ring.desc[head].desc_status & 3) == 1) {
                          +			cprintf("NIC READ: Oversized packet\n");
                          +			goto next;
                          +		}
                           	
                          -	/* Check if the packet is a valid size for the uIP buffer configuration */
                          +		/* Check if the packet is a valid size for the uIP buffer configuration */
                           	
                          -	// get the number of actual data-bytes in this packet
                          -	cnt = e1000->rx_ring.desc[head].packet_length;
                          +		// get the number of actual data-bytes in this packet
                          +		cnt = e1000->rx_ring.desc[head].packet_length;
                           	
                          -	if (cnt > CONFIG_NET_BUFSIZE || cnt < 14) {
                          -	    cprintf("NIC READ: invalid package size\n");
                          -	    goto next;
                          -	}
                          +		if (cnt > CONFIG_NET_BUFSIZE || cnt < 14) {
                          +			cprintf("NIC READ: invalid package size\n");
                          +			goto next;
                          +		}
                               
                          -	/* Copy the data data from the hardware to e1000->uip_dev.d_buf.  Set
                          -	 * amount of data in e1000->uip_dev.d_len
                          -	 */
                          +		/* Copy the data data from the hardware to e1000->uip_dev.d_buf.  Set
                          +		 * amount of data in e1000->uip_dev.d_len
                          +		 */
                               
                          -	// now we try to copy these data-bytes to the UIP buffer
                          -	memcpy(e1000->uip_dev.d_buf, cp, cnt);
                          -	e1000->uip_dev.d_len = cnt;
                          +		// now we try to copy these data-bytes to the UIP buffer
                          +		memcpy(e1000->uip_dev.d_buf, cp, cnt);
                          +		e1000->uip_dev.d_len = cnt;
                           
                          -	/* We only accept IP packets of the configured type and ARP packets */
                          +		/* We only accept IP packets of the configured type and ARP packets */
                           
                           #ifdef CONFIG_NET_IPv6
                          -	if (BUF->type == HTONS(UIP_ETHTYPE_IP6))
                          +		if (BUF->type == HTONS(UIP_ETHTYPE_IP6))
                           #else
                          -	if (BUF->type == HTONS(UIP_ETHTYPE_IP))
                          +			if (BUF->type == HTONS(UIP_ETHTYPE_IP))
                           #endif
                          -	{
                          -	    uip_arp_ipin(&e1000->uip_dev);
                          -	    uip_input(&e1000->uip_dev);
                          +			{
                          +				uip_arp_ipin(&e1000->uip_dev);
                          +				uip_input(&e1000->uip_dev);
                           
                          -	    /* If the above function invocation resulted in data that should be
                          -	     * sent out on the network, the field  d_len will set to a value > 0.
                          -	     */
                          +				/* If the above function invocation resulted in data that should be
                          +				 * sent out on the network, the field  d_len will set to a value > 0.
                          +				 */
                           
                          -	    if (e1000->uip_dev.d_len > 0) {
                          -		uip_arp_out(&e1000->uip_dev);
                          -		e1000_transmit(e1000);
                          -	    }
                          -	}
                          -	else if (BUF->type == htons(UIP_ETHTYPE_ARP)) {
                          -	    uip_arp_arpin(&e1000->uip_dev);
                          +				if (e1000->uip_dev.d_len > 0) {
                          +					uip_arp_out(&e1000->uip_dev);
                          +					e1000_transmit(e1000);
                          +				}
                          +			}
                          +			else if (BUF->type == htons(UIP_ETHTYPE_ARP)) {
                          +				uip_arp_arpin(&e1000->uip_dev);
                           
                          -	    /* If the above function invocation resulted in data that should be
                          -	     * sent out on the network, the field  d_len will set to a value > 0.
                          -	     */
                          +				/* If the above function invocation resulted in data that should be
                          +				 * sent out on the network, the field  d_len will set to a value > 0.
                          +				 */
                           
                          -	    if (e1000->uip_dev.d_len > 0) {
                          -		e1000_transmit(e1000);
                          -	    }
                          -	}
                          +				if (e1000->uip_dev.d_len > 0) {
                          +					e1000_transmit(e1000);
                          +				}
                          +			}
                           
                               next:
                          -	e1000->rx_ring.desc[head].desc_status = 0;
                          -	e1000->rx_ring.head = (head + 1) % CONFIG_E1000_N_RX_DESC;
                          -	e1000->rx_ring.free++;
                          -	head = e1000->rx_ring.head;
                          -	cp = (unsigned char *)(e1000->rx_ring.buf + head * CONFIG_E1000_BUFF_SIZE);
                          +		e1000->rx_ring.desc[head].desc_status = 0;
                          +		e1000->rx_ring.head = (head + 1) % CONFIG_E1000_N_RX_DESC;
                          +		e1000->rx_ring.free++;
                          +		head = e1000->rx_ring.head;
                          +		cp = (unsigned char *)(e1000->rx_ring.buf + head * CONFIG_E1000_BUFF_SIZE);
                               }
                           }
                           
                          @@ -615,7 +616,7 @@ static void e1000_polltimer(int argc, uint32_t arg, ...)
                                * the TX poll if he are unable to accept another packet for transmission.
                                */
                               if (!e1000->tx_ring.desc[tail].desc_status)
                          -	return;
                          +		return;
                           
                               /* If so, update TCP timing states and poll uIP for new XMIT data. Hmmm..
                                * might be bug here.  Does this mean if there is a transmit in progress,
                          @@ -651,8 +652,8 @@ static int e1000_ifup(struct uip_driver_s *dev)
                               struct e1000_dev *e1000 = (struct e1000_dev *)dev->d_private;
                           
                               ndbg("Bringing up: %d.%d.%d.%d\n",
                          -	 dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff,
                          -	 (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24 );
                          +		 dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff,
                          +		 (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24 );
                           
                               /* Initialize PHYs, the Ethernet interface, and setup up Ethernet interrupts */
                               e1000_init(e1000);
                          @@ -662,9 +663,9 @@ static int e1000_ifup(struct uip_driver_s *dev)
                               (void)wd_start(e1000->txpoll, E1000_WDDELAY, e1000_polltimer, 1, (uint32_t)e1000);
                           
                               if (e1000_inl(e1000, E1000_STATUS) & 2)
                          -	e1000->bifup = true;
                          +		e1000->bifup = true;
                               else
                          -	e1000->bifup = false;
                          +		e1000->bifup = false;
                           
                               return OK;
                           }
                          @@ -749,9 +750,9 @@ static int e1000_txavail(struct uip_driver_s *dev)
                               /* Ignore the notification if the interface is not yet up */
                           
                               if (e1000->bifup) {
                          -	/* Check if there is room in the hardware to hold another outgoing packet. */
                          -	if (e1000->tx_ring.desc[tail].desc_status)
                          -	    (void)uip_poll(&e1000->uip_dev, e1000_uiptxpoll);
                          +		/* Check if there is room in the hardware to hold another outgoing packet. */
                          +		if (e1000->tx_ring.desc[tail].desc_status)
                          +			(void)uip_poll(&e1000->uip_dev, e1000_uiptxpoll);
                               }
                           
                               irqrestore(flags);
                          @@ -779,11 +780,11 @@ static int e1000_txavail(struct uip_driver_s *dev)
                           #ifdef CONFIG_NET_IGMP
                           static int e1000_addmac(struct uip_driver_s *dev, const uint8_t *mac)
                           {
                          -  struct e1000_dev *e1000 = (struct e1000_dev *)dev->d_private;
                          +	struct e1000_dev *e1000 = (struct e1000_dev *)dev->d_private;
                           
                          -  /* Add the MAC address to the hardware multicast routing table */
                          +	/* Add the MAC address to the hardware multicast routing table */
                           
                          -  return OK;
                          +	return OK;
                           }
                           #endif
                           
                          @@ -808,15 +809,15 @@ static int e1000_addmac(struct uip_driver_s *dev, const uint8_t *mac)
                           #ifdef CONFIG_NET_IGMP
                           static int e1000_rmmac(struct uip_driver_s *dev, const uint8_t *mac)
                           {
                          -  struct e1000_dev *e1000 = (struct e1000_dev *)dev->d_private;
                          +	struct e1000_dev *e1000 = (struct e1000_dev *)dev->d_private;
                           
                          -  /* Add the MAC address to the hardware multicast routing table */
                          +	/* Add the MAC address to the hardware multicast routing table */
                           
                          -  return OK;
                          +	return OK;
                           }
                           #endif
                           
                          -irqreturn_t  e1000_interrupt_handler(struct Trapframe *tf, void *dev_id)
                          +static irqreturn_t e1000_interrupt_handler(int irq, void *dev_id)
                           {
                               struct e1000_dev *e1000 = (struct e1000_dev *)dev_id;
                               
                          @@ -826,27 +827,27 @@ irqreturn_t  e1000_interrupt_handler(struct Trapframe *tf, void *dev_id)
                           
                               // not for me
                               if (intr_cause == 0) 
                          -	return IRQ_NONE;
                          +		return IRQ_NONE;
                           
                               /* Handle interrupts according to status bit settings */
                           
                               // Link status change
                               if (intr_cause & (1<<2)) {
                          -	if (e1000_inl(e1000, E1000_STATUS) & 2)
                          -	    e1000->bifup = true;
                          -	else
                          -	    e1000->bifup = false;
                          +		if (e1000_inl(e1000, E1000_STATUS) & 2)
                          +			e1000->bifup = true;
                          +		else
                          +			e1000->bifup = false;
                               }
                               
                               /* Check if we received an incoming packet, if so, call skel_receive() */
                           
                               // Rx-descriptor Timer expired
                               if (intr_cause & (1<<7))
                          -	e1000_receive(e1000);
                          +		e1000_receive(e1000);
                           
                               // Tx queue empty
                               if (intr_cause & (1<<1))
                          -	wd_cancel(e1000->txtimeout);
                          +		wd_cancel(e1000->txtimeout);
                           
                               /* Check is a packet transmission just completed.  If so, call skel_txdone.
                                * This may disable further Tx interrupts if there are no pending
                          @@ -855,17 +856,17 @@ irqreturn_t  e1000_interrupt_handler(struct Trapframe *tf, void *dev_id)
                           
                               // Tx-descriptor Written back
                               if (intr_cause & (1<<0))
                          -	uip_poll(&e1000->uip_dev, e1000_uiptxpoll);
                          +		uip_poll(&e1000->uip_dev, e1000_uiptxpoll);
                             
                           
                               // Rx-Descriptors Low
                               if (intr_cause & (1<<4)) {
                          -	int tail;
                          -	tail = e1000->rx_ring.tail + e1000->rx_ring.free;
                          -	tail %= CONFIG_E1000_N_RX_DESC;
                          -	e1000->rx_ring.tail = tail;
                          -	e1000->rx_ring.free = 0;
                          -	e1000_outl(e1000, E1000_RDT, tail);
                          +		int tail;
                          +		tail = e1000->rx_ring.tail + e1000->rx_ring.free;
                          +		tail %= CONFIG_E1000_N_RX_DESC;
                          +		e1000->rx_ring.tail = tail;
                          +		e1000->rx_ring.free = 0;
                          +		e1000_outl(e1000, E1000_RDT, tail);
                               }
                           
                               return IRQ_HANDLED;
                          @@ -885,20 +886,21 @@ static pci_id_t e1000_id_table[] = {
                           static int e1000_probe(uint16_t addr, pci_id_t id)
                           {
                               uint32_t mmio_base, mmio_size;
                          -    uint32_t pci_cmd, size;
                          -    int err, irq, flags;
                          +    uint32_t size;
                          +    int err;
                               void *kmem, *omem;
                               struct e1000_dev *dev;
                           
                               // alloc e1000_dev memory
                          -    dev = kzalloc(sizeof(struct e1000_dev));
                          -    if (dev == NULL)
                          -	return -1;
                          +    if ((dev = kzalloc(sizeof(struct e1000_dev))) == NULL)
                          +		return -1;
                          +
                          +	// save pci addr
                          +	dev->pci_addr = addr;
                           
                               // enable device
                          -    err = pci_enable_device(addr, PCI_RESOURCE_MEM);
                          -    if (err)
                          -	goto error;
                          +	if ((err = pci_enable_device(addr, PCI_BUS_MASTER)) < 0)
                          +		goto error;
                           
                               // get e1000 device type
                               dev->pci_dev_id = id.join;
                          @@ -908,33 +910,20 @@ static int e1000_probe(uint16_t addr, pci_id_t id)
                               mmio_size = pci_resource_len(addr, 0);
                               err = rgmp_memmap_nocache(mmio_base, mmio_size, mmio_base);
                               if (err) 
                          -	goto error;
                          +		goto error;
                               dev->phy_mem_base = mmio_base;
                               dev->io_mem_base = mmio_base;
                               dev->mem_size = mmio_size;
                           
                          -    // make sure the controller's Bus Master capability is enabled
                          -    pci_cmd = pci_config_readl(addr, PCI_COMMAND);
                          -    pci_cmd |= (1<<2);
                          -    pci_config_writel(addr, PCI_COMMAND, pci_cmd);
                          -
                               // MAC address
                               memset(dev->dst_mac, 0xFF, 6);
                               memcpy(dev->src_mac, (void *)(dev->io_mem_base+E1000_RA), 6);
                           
                          -    // get e1000 IRQ
                          -    flags = 0;
                          -    irq = pci_enable_msi(addr);
                          -    if (irq == 0) {
                          -	irq = pci_read_irq(addr);
                          -	flags |= IDC_SHARE;
                          -    }
                          -    dev->irq = irq;
                          +    // IRQ setup
                               dev->int_desc.handler = e1000_interrupt_handler;
                               dev->int_desc.dev_id = dev;
                          -    err = rgmp_request_irq(irq, &dev->int_desc, flags);
                          -    if (err)
                          -	goto err0;
                          +	if ((err = pci_request_irq(addr, &dev->int_desc, 0)) < 0)
                          +		goto err0;
                           
                               // Here we alloc a big block of memory once and make it
                               // aligned to page boundary and multiple of page size. This
                          @@ -942,15 +931,19 @@ static int e1000_probe(uint16_t addr, pci_id_t id)
                               // should be mapped no-cache which will hugely reduce memory 
                               // access performance. The page size alloc will restrict
                               // this bad effect only within the memory we alloc here.
                          +	//
                          +	// NEED FIX: the memalign may alloc memory continous in
                          +	// virtual address but dis-continous in physical address
                          +	// due to RGMP memory setup.
                               size = CONFIG_E1000_N_TX_DESC * sizeof(struct tx_desc) +
                          -	   CONFIG_E1000_N_TX_DESC * CONFIG_E1000_BUFF_SIZE +
                          -	   CONFIG_E1000_N_RX_DESC * sizeof(struct rx_desc) + 
                          -	   CONFIG_E1000_N_RX_DESC * CONFIG_E1000_BUFF_SIZE;
                          +		CONFIG_E1000_N_TX_DESC * CONFIG_E1000_BUFF_SIZE +
                          +		CONFIG_E1000_N_RX_DESC * sizeof(struct rx_desc) + 
                          +		CONFIG_E1000_N_RX_DESC * CONFIG_E1000_BUFF_SIZE;
                               size = ROUNDUP(size, PGSIZE);
                               omem = kmem = memalign(PGSIZE, size);
                               if (kmem == NULL) {
                          -	err = -ENOMEM;
                          -	goto err1;
                          +		err = -ENOMEM;
                          +		goto err1;
                               }
                               rgmp_memremap_nocache((uintptr_t)kmem, size);
                           
                          @@ -991,7 +984,7 @@ static int e1000_probe(uint16_t addr, pci_id_t id)
                               /* Register the device with the OS so that socket IOCTLs can be performed */
                               err = netdev_register(&dev->uip_dev);
                               if (err)
                          -	goto err2;
                          +		goto err2;
                           
                               // insert into e1000_list
                               dev->next = e1000_list.next;
                          @@ -1000,14 +993,14 @@ static int e1000_probe(uint16_t addr, pci_id_t id)
                           
                               return 0;
                           
                          - err2:
                          +err2:
                               rgmp_memremap((uintptr_t)omem, size);
                               free(omem);
                          - err1:
                          -    rgmp_free_irq(irq, &dev->int_desc);
                          - err0:
                          +err1:
                          +    pci_free_irq(addr);
                          +err0:
                               rgmp_memunmap(mmio_base, mmio_size);
                          - error:
                          +error:
                               kfree(dev);
                               cprintf("e1000 device probe fail: %d\n", err);
                               return err;
                          @@ -1028,21 +1021,21 @@ void e1000_mod_exit(void)
                               struct e1000_dev *dev;
                           
                               size = CONFIG_E1000_N_TX_DESC * sizeof(struct tx_desc) +
                          -	   CONFIG_E1000_N_TX_DESC * CONFIG_E1000_BUFF_SIZE +
                          -	   CONFIG_E1000_N_RX_DESC * sizeof(struct rx_desc) + 
                          -	   CONFIG_E1000_N_RX_DESC * CONFIG_E1000_BUFF_SIZE;
                          +		CONFIG_E1000_N_TX_DESC * CONFIG_E1000_BUFF_SIZE +
                          +		CONFIG_E1000_N_RX_DESC * sizeof(struct rx_desc) + 
                          +		CONFIG_E1000_N_RX_DESC * CONFIG_E1000_BUFF_SIZE;
                               size = ROUNDUP(size, PGSIZE);
                           
                               for (dev=e1000_list.next; dev!=NULL; dev=dev->next) {
                          -	netdev_unregister(&dev->uip_dev);
                          -	e1000_reset(dev);
                          -	wd_delete(dev->txpoll);
                          -	wd_delete(dev->txtimeout);
                          -	rgmp_memremap((uintptr_t)dev->tx_ring.desc, size);
                          -	free(dev->tx_ring.desc);
                          -	rgmp_free_irq(dev->irq, &dev->int_desc);
                          -	rgmp_memunmap((uintptr_t)dev->io_mem_base, dev->mem_size);
                          -	kfree(dev);
                          +		netdev_unregister(&dev->uip_dev);
                          +		e1000_reset(dev);
                          +		wd_delete(dev->txpoll);
                          +		wd_delete(dev->txtimeout);
                          +		rgmp_memremap((uintptr_t)dev->tx_ring.desc, size);
                          +		free(dev->tx_ring.desc);
                          +		pci_free_irq(dev->pci_addr);
                          +		rgmp_memunmap((uintptr_t)dev->io_mem_base, dev->mem_size);
                          +		kfree(dev);
                               }
                           
                               e1000_list.next = NULL;
                          diff --git a/nuttx/drivers/net/e1000.h b/nuttx/drivers/net/e1000.h
                          index 6614ad77ec..63ff53e3c3 100644
                          --- a/nuttx/drivers/net/e1000.h
                          +++ b/nuttx/drivers/net/e1000.h
                          @@ -44,9 +44,7 @@
                            * Included Files
                            ****************************************************************************/
                           
                          -#include 
                          -#include 
                          -#include 
                          +#include 
                           
                           /****************************************************************************
                            * Pre-processor Definitions
                          diff --git a/nuttx/drivers/net/vnet.c b/nuttx/drivers/net/vnet.c
                          index f1e2465b96..e05a39675c 100644
                          --- a/nuttx/drivers/net/vnet.c
                          +++ b/nuttx/drivers/net/vnet.c
                          @@ -168,30 +168,30 @@ static int vnet_transmit(FAR struct vnet_driver_s *vnet)
                           {
                               int err;
                           
                          -  /* Verify that the hardware is ready to send another packet.  If we get
                          -   * here, then we are committed to sending a packet; Higher level logic
                          -   * must have assured that there is not transmission in progress.
                          -   */
                          +	/* Verify that the hardware is ready to send another packet.  If we get
                          +	 * here, then we are committed to sending a packet; Higher level logic
                          +	 * must have assured that there is not transmission in progress.
                          +	 */
                           
                          -  /* Increment statistics */
                          +	/* Increment statistics */
                           
                          -  /* Send the packet: address=vnet->sk_dev.d_buf, length=vnet->sk_dev.d_len */
                          +	/* Send the packet: address=vnet->sk_dev.d_buf, length=vnet->sk_dev.d_len */
                               err = vnet_xmit(vnet->vnet, (char *)vnet->sk_dev.d_buf, vnet->sk_dev.d_len);
                               if (err) {
                          -	/* Setup the TX timeout watchdog (perhaps restarting the timer) */
                          -	//(void)wd_start(vnet->sk_txtimeout, VNET_TXTIMEOUT, vnet_txtimeout, 1, (uint32_t)vnet);
                          +		/* Setup the TX timeout watchdog (perhaps restarting the timer) */
                          +		//(void)wd_start(vnet->sk_txtimeout, VNET_TXTIMEOUT, vnet_txtimeout, 1, (uint32_t)vnet);
                           
                          -	// When vnet_xmit fail, it means TX buffer is full. Watchdog 
                          -	// is of no use here because no TX done INT will happen. So 
                          -	// we reset the TX buffer directly.
                          +		// When vnet_xmit fail, it means TX buffer is full. Watchdog 
                          +		// is of no use here because no TX done INT will happen. So 
                          +		// we reset the TX buffer directly.
                           #ifdef CONFIG_DEBUG
                          -	cprintf("VNET: TX buffer is full\n");
                          +		cprintf("VNET: TX buffer is full\n");
                           #endif
                          -	return ERROR;
                          +		return ERROR;
                               }
                               else {
                          -	// this step may be unnecessary here
                          -	vnet_txdone(vnet);
                          +		// this step may be unnecessary here
                          +		vnet_txdone(vnet);
                               }
                           
                               return OK;
                          @@ -223,29 +223,29 @@ static int vnet_transmit(FAR struct vnet_driver_s *vnet)
                           
                           static int vnet_uiptxpoll(struct uip_driver_s *dev)
                           {
                          -  FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private;
                          +	FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private;
                           
                          -  /* If the polling resulted in data that should be sent out on the network,
                          -   * the field d_len is set to a value > 0.
                          -   */
                          +	/* If the polling resulted in data that should be sent out on the network,
                          +	 * the field d_len is set to a value > 0.
                          +	 */
                           
                          -  if (vnet->sk_dev.d_len > 0)
                          +	if (vnet->sk_dev.d_len > 0)
                               {
                          -      uip_arp_out(&vnet->sk_dev);
                          -      vnet_transmit(vnet);
                          +		uip_arp_out(&vnet->sk_dev);
                          +		vnet_transmit(vnet);
                           
                          -      /* Check if there is room in the device to hold another packet. If not,
                          -       * return a non-zero value to terminate the poll.
                          -       */
                          -      if (vnet_is_txbuff_full(vnet->vnet))
                          -	  return 1;
                          +		/* Check if there is room in the device to hold another packet. If not,
                          +		 * return a non-zero value to terminate the poll.
                          +		 */
                          +		if (vnet_is_txbuff_full(vnet->vnet))
                          +			return 1;
                               }
                           
                          -  /* If zero is returned, the polling will continue until all connections have
                          -   * been examined.
                          -   */
                          +	/* If zero is returned, the polling will continue until all connections have
                          +	 * been examined.
                          +	 */
                           
                          -  return 0;
                          +	return 0;
                           }
                           
                           /****************************************************************************
                          @@ -265,54 +265,53 @@ static int vnet_uiptxpoll(struct uip_driver_s *dev)
                            *
                            ****************************************************************************/
                           
                          -void rtos_vnet_recv(struct rgmp_vnet *vnet_dummy, char *data, int len)
                          +void rtos_vnet_recv(struct rgmp_vnet *rgmp_vnet, char *data, int len)
                           {
                          -    // now only support 1 vnet
                          -    struct vnet_driver_s *vnet = &g_vnet[0];
                          +    struct vnet_driver_s *vnet = rgmp_vnet->priv;
                           
                               do {
                          -	/* Check for errors and update statistics */
                          +		/* Check for errors and update statistics */
                           
                          -	/* Check if the packet is a valid size for the uIP buffer configuration */
                          -	if (len > CONFIG_NET_BUFSIZE || len < 14) {
                          +		/* Check if the packet is a valid size for the uIP buffer configuration */
                          +		if (len > CONFIG_NET_BUFSIZE || len < 14) {
                           #ifdef CONFIG_DEBUG
                          -	    cprintf("VNET: receive invalid packet of size %d\n", len);
                          +			cprintf("VNET: receive invalid packet of size %d\n", len);
                           #endif
                          -	    return;
                          -	}
                          +			return;
                          +		}
                           
                          -	// Copy the data data from the hardware to vnet->sk_dev.d_buf.  Set
                          -	// amount of data in vnet->sk_dev.d_len
                          -	memcpy(vnet->sk_dev.d_buf, data, len);
                          -	vnet->sk_dev.d_len = len;
                          +		// Copy the data data from the hardware to vnet->sk_dev.d_buf.  Set
                          +		// amount of data in vnet->sk_dev.d_len
                          +		memcpy(vnet->sk_dev.d_buf, data, len);
                          +		vnet->sk_dev.d_len = len;
                           
                          -	/* We only accept IP packets of the configured type and ARP packets */
                          +		/* We only accept IP packets of the configured type and ARP packets */
                           
                           #ifdef CONFIG_NET_IPv6
                          -	if (BUF->type == HTONS(UIP_ETHTYPE_IP6))
                          +		if (BUF->type == HTONS(UIP_ETHTYPE_IP6))
                           #else
                          -	if (BUF->type == HTONS(UIP_ETHTYPE_IP))
                          +			if (BUF->type == HTONS(UIP_ETHTYPE_IP))
                           #endif
                          -	{
                          -	    uip_arp_ipin(&vnet->sk_dev);
                          -	    uip_input(&vnet->sk_dev);
                          +			{
                          +				uip_arp_ipin(&vnet->sk_dev);
                          +				uip_input(&vnet->sk_dev);
                           
                          -	    // If the above function invocation resulted in data that should be
                          -	    // sent out on the network, the field  d_len will set to a value > 0.
                          -	    if (vnet->sk_dev.d_len > 0) {
                          -		uip_arp_out(&vnet->sk_dev);
                          -		vnet_transmit(vnet);
                          -	    }
                          -	}
                          -	else if (BUF->type == htons(UIP_ETHTYPE_ARP)) {
                          -	    uip_arp_arpin(&vnet->sk_dev);
                          +				// If the above function invocation resulted in data that should be
                          +				// sent out on the network, the field  d_len will set to a value > 0.
                          +				if (vnet->sk_dev.d_len > 0) {
                          +					uip_arp_out(&vnet->sk_dev);
                          +					vnet_transmit(vnet);
                          +				}
                          +			}
                          +			else if (BUF->type == htons(UIP_ETHTYPE_ARP)) {
                          +				uip_arp_arpin(&vnet->sk_dev);
                           
                          -	    // If the above function invocation resulted in data that should be
                          -	    // sent out on the network, the field  d_len will set to a value > 0.
                          -	    if (vnet->sk_dev.d_len > 0) {
                          -		vnet_transmit(vnet);
                          -	    }
                          -	}
                          +				// If the above function invocation resulted in data that should be
                          +				// sent out on the network, the field  d_len will set to a value > 0.
                          +				if (vnet->sk_dev.d_len > 0) {
                          +					vnet_transmit(vnet);
                          +				}
                          +			}
                               }
                               while (0); /* While there are more packets to be processed */
                           }
                          @@ -336,17 +335,17 @@ void rtos_vnet_recv(struct rgmp_vnet *vnet_dummy, char *data, int len)
                           
                           static void vnet_txdone(FAR struct vnet_driver_s *vnet)
                           {
                          -  /* Check for errors and update statistics */
                          +	/* Check for errors and update statistics */
                           
                          -  /* If no further xmits are pending, then cancel the TX timeout and
                          -   * disable further Tx interrupts.
                          -   */
                          +	/* If no further xmits are pending, then cancel the TX timeout and
                          +	 * disable further Tx interrupts.
                          +	 */
                           
                          -  //wd_cancel(vnet->sk_txtimeout);
                          +	//wd_cancel(vnet->sk_txtimeout);
                           
                          -  /* Then poll uIP for new XMIT data */
                          +	/* Then poll uIP for new XMIT data */
                           
                          -  (void)uip_poll(&vnet->sk_dev, vnet_uiptxpoll);
                          +	(void)uip_poll(&vnet->sk_dev, vnet_uiptxpoll);
                           }
                           
                           /****************************************************************************
                          @@ -370,15 +369,15 @@ static void vnet_txdone(FAR struct vnet_driver_s *vnet)
                           
                           static void vnet_txtimeout(int argc, uint32_t arg, ...)
                           {
                          -  FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)arg;
                          +	FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)arg;
                           
                          -  /* Increment statistics and dump debug info */
                          +	/* Increment statistics and dump debug info */
                           
                          -  /* Then reset the hardware */
                          +	/* Then reset the hardware */
                           
                          -  /* Then poll uIP for new XMIT data */
                          +	/* Then poll uIP for new XMIT data */
                           
                          -  (void)uip_poll(&vnet->sk_dev, vnet_uiptxpoll);
                          +	(void)uip_poll(&vnet->sk_dev, vnet_uiptxpoll);
                           }
                           
                           /****************************************************************************
                          @@ -401,28 +400,28 @@ static void vnet_txtimeout(int argc, uint32_t arg, ...)
                           
                           static void vnet_polltimer(int argc, uint32_t arg, ...)
                           {
                          -  FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)arg;
                          +	FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)arg;
                           
                          -  /* Check if there is room in the send another TX packet.  We cannot perform
                          -   * the TX poll if he are unable to accept another packet for transmission.
                          -   */
                          -  if (vnet_is_txbuff_full(vnet->vnet)) {
                          +	/* Check if there is room in the send another TX packet.  We cannot perform
                          +	 * the TX poll if he are unable to accept another packet for transmission.
                          +	 */
                          +	if (vnet_is_txbuff_full(vnet->vnet)) {
                           #ifdef CONFIG_DEBUG
                          -      cprintf("VNET: TX buffer is full\n");
                          +		cprintf("VNET: TX buffer is full\n");
                           #endif
                          -      return;
                          -  }
                          +		return;
                          +	}
                           
                          -  /* If so, update TCP timing states and poll uIP for new XMIT data. Hmmm..
                          -   * might be bug here.  Does this mean if there is a transmit in progress,
                          -   * we will missing TCP time state updates?
                          -   */
                          +	/* If so, update TCP timing states and poll uIP for new XMIT data. Hmmm..
                          +	 * might be bug here.  Does this mean if there is a transmit in progress,
                          +	 * we will missing TCP time state updates?
                          +	 */
                           
                          -  (void)uip_timer(&vnet->sk_dev, vnet_uiptxpoll, VNET_POLLHSEC);
                          +	(void)uip_timer(&vnet->sk_dev, vnet_uiptxpoll, VNET_POLLHSEC);
                           
                          -  /* Setup the watchdog poll timer again */
                          +	/* Setup the watchdog poll timer again */
                           
                          -  (void)wd_start(vnet->sk_txpoll, VNET_WDDELAY, vnet_polltimer, 1, arg);
                          +	(void)wd_start(vnet->sk_txpoll, VNET_WDDELAY, vnet_polltimer, 1, arg);
                           }
                           
                           /****************************************************************************
                          @@ -444,20 +443,20 @@ static void vnet_polltimer(int argc, uint32_t arg, ...)
                           
                           static int vnet_ifup(struct uip_driver_s *dev)
                           {
                          -  FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private;
                          +	FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private;
                           
                          -  ndbg("Bringing up: %d.%d.%d.%d\n",
                          -       dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff,
                          -       (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24 );
                          +	ndbg("Bringing up: %d.%d.%d.%d\n",
                          +		 dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff,
                          +		 (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24 );
                           
                          -  /* Initialize PHYs, the Ethernet interface, and setup up Ethernet interrupts */
                          +	/* Initialize PHYs, the Ethernet interface, and setup up Ethernet interrupts */
                           
                          -  /* Set and activate a timer process */
                          +	/* Set and activate a timer process */
                           
                          -  (void)wd_start(vnet->sk_txpoll, VNET_WDDELAY, vnet_polltimer, 1, (uint32_t)vnet);
                          +	(void)wd_start(vnet->sk_txpoll, VNET_WDDELAY, vnet_polltimer, 1, (uint32_t)vnet);
                           
                          -  vnet->sk_bifup = true;
                          -  return OK;
                          +	vnet->sk_bifup = true;
                          +	return OK;
                           }
                           
                           /****************************************************************************
                          @@ -478,28 +477,28 @@ static int vnet_ifup(struct uip_driver_s *dev)
                           
                           static int vnet_ifdown(struct uip_driver_s *dev)
                           {
                          -  FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private;
                          -  irqstate_t flags;
                          +	FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private;
                          +	irqstate_t flags;
                           
                          -  /* Disable the Ethernet interrupt */
                          +	/* Disable the Ethernet interrupt */
                           
                          -  flags = irqsave();
                          +	flags = irqsave();
                           
                          -  /* Cancel the TX poll timer and TX timeout timers */
                          +	/* Cancel the TX poll timer and TX timeout timers */
                           
                          -  wd_cancel(vnet->sk_txpoll);
                          -  //wd_cancel(vnet->sk_txtimeout);
                          +	wd_cancel(vnet->sk_txpoll);
                          +	//wd_cancel(vnet->sk_txtimeout);
                           
                          -  /* Put the the EMAC is its reset, non-operational state.  This should be
                          -   * a known configuration that will guarantee the vnet_ifup() always
                          -   * successfully brings the interface back up.
                          -   */
                          +	/* Put the the EMAC is its reset, non-operational state.  This should be
                          +	 * a known configuration that will guarantee the vnet_ifup() always
                          +	 * successfully brings the interface back up.
                          +	 */
                           
                          -  /* Mark the device "down" */
                          +	/* Mark the device "down" */
                           
                          -  vnet->sk_bifup = false;
                          -  irqrestore(flags);
                          -  return OK;
                          +	vnet->sk_bifup = false;
                          +	irqrestore(flags);
                          +	return OK;
                           }
                           
                           /****************************************************************************
                          @@ -523,35 +522,35 @@ static int vnet_ifdown(struct uip_driver_s *dev)
                           
                           static int vnet_txavail(struct uip_driver_s *dev)
                           {
                          -  FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private;
                          -  irqstate_t flags;
                          +	FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private;
                          +	irqstate_t flags;
                           
                          -  /* Disable interrupts because this function may be called from interrupt
                          -   * level processing.
                          -   */
                          +	/* Disable interrupts because this function may be called from interrupt
                          +	 * level processing.
                          +	 */
                           
                          -  flags = irqsave();
                          +	flags = irqsave();
                           
                          -  /* Ignore the notification if the interface is not yet up */
                          +	/* Ignore the notification if the interface is not yet up */
                           
                          -  if (vnet->sk_bifup)
                          +	if (vnet->sk_bifup)
                               {
                          -      /* Check if there is room in the hardware to hold another outgoing packet. */
                          -	if (vnet_is_txbuff_full(vnet->vnet)) {
                          +		/* Check if there is room in the hardware to hold another outgoing packet. */
                          +		if (vnet_is_txbuff_full(vnet->vnet)) {
                           #ifdef CONFIG_DEBUG
                          -	    cprintf("VNET: TX buffer is full\n");
                          +			cprintf("VNET: TX buffer is full\n");
                           #endif
                          -	    goto out;
                          -	}
                          +			goto out;
                          +		}
                           
                          -      /* If so, then poll uIP for new XMIT data */
                          +		/* If so, then poll uIP for new XMIT data */
                           
                          -      (void)uip_poll(&vnet->sk_dev, vnet_uiptxpoll);
                          +		(void)uip_poll(&vnet->sk_dev, vnet_uiptxpoll);
                               }
                           
                          - out:
                          -  irqrestore(flags);
                          -  return OK;
                          +out:
                          +	irqrestore(flags);
                          +	return OK;
                           }
                           
                           /****************************************************************************
                          @@ -575,11 +574,11 @@ static int vnet_txavail(struct uip_driver_s *dev)
                           #ifdef CONFIG_NET_IGMP
                           static int vnet_addmac(struct uip_driver_s *dev, FAR const uint8_t *mac)
                           {
                          -  FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private;
                          +	FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private;
                           
                          -  /* Add the MAC address to the hardware multicast routing table */
                          +	/* Add the MAC address to the hardware multicast routing table */
                           
                          -  return OK;
                          +	return OK;
                           }
                           #endif
                           
                          @@ -604,11 +603,11 @@ static int vnet_addmac(struct uip_driver_s *dev, FAR const uint8_t *mac)
                           #ifdef CONFIG_NET_IGMP
                           static int vnet_rmmac(struct uip_driver_s *dev, FAR const uint8_t *mac)
                           {
                          -  FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private;
                          +	FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private;
                           
                          -  /* Add the MAC address to the hardware multicast routing table */
                          +	/* Add the MAC address to the hardware multicast routing table */
                           
                          -  return OK;
                          +	return OK;
                           }
                           #endif
                           
                          @@ -633,41 +632,41 @@ static int vnet_rmmac(struct uip_driver_s *dev, FAR const uint8_t *mac)
                            *
                            ****************************************************************************/
                           
                          -void vnet_initialize(void)
                          +int vnet_init(struct rgmp_vnet *vnet)
                           {
                          -  struct vnet_driver_s *priv;
                          -  struct rgmp_vnet *vnet = vnet_list.next;
                          -  int i;
                          +	struct vnet_driver_s *priv;
                          +	static int i = 0;
                           
                          -  for (i=0; i= CONFIG_VNET_NINTERFACES)
                          +		return -1;
                           
                          -      /* Initialize the driver structure */
                          +	priv = &g_vnet[i++];
                           
                          -      memset(priv, 0, sizeof(struct vnet_driver_s));
                          -      priv->sk_dev.d_ifup    = vnet_ifup;     /* I/F down callback */
                          -      priv->sk_dev.d_ifdown  = vnet_ifdown;   /* I/F up (new IP address) callback */
                          -      priv->sk_dev.d_txavail = vnet_txavail;  /* New TX data callback */
                          +	/* Initialize the driver structure */
                          +
                          +	memset(priv, 0, sizeof(struct vnet_driver_s));
                          +	priv->sk_dev.d_ifup    = vnet_ifup;     /* I/F down callback */
                          +	priv->sk_dev.d_ifdown  = vnet_ifdown;   /* I/F up (new IP address) callback */
                          +	priv->sk_dev.d_txavail = vnet_txavail;  /* New TX data callback */
                           #ifdef CONFIG_NET_IGMP
                          -      priv->sk_dev.d_addmac  = vnet_addmac;   /* Add multicast MAC address */
                          -      priv->sk_dev.d_rmmac   = vnet_rmmac;    /* Remove multicast MAC address */
                          +	priv->sk_dev.d_addmac  = vnet_addmac;   /* Add multicast MAC address */
                          +	priv->sk_dev.d_rmmac   = vnet_rmmac;    /* Remove multicast MAC address */
                           #endif
                          -      priv->sk_dev.d_private = (void*)g_vnet; /* Used to recover private state from dev */
                          +	priv->sk_dev.d_private = (void*)priv;   /* Used to recover private state from dev */
                           
                          -      /* Create a watchdog for timing polling for and timing of transmisstions */
                          +	/* Create a watchdog for timing polling for and timing of transmisstions */
                           
                          -      priv->sk_txpoll       = wd_create();   /* Create periodic poll timer */
                          -      //priv->sk_txtimeout    = wd_create();   /* Create TX timeout timer */
                          +	priv->sk_txpoll       = wd_create();    /* Create periodic poll timer */
                          +	//priv->sk_txtimeout    = wd_create();   /* Create TX timeout timer */
                           
                          -      priv->vnet = vnet;
                          +	priv->vnet = vnet;
                          +	vnet->priv = priv;
                           
                          -      /* Register the device with the OS */
                          +	/* Register the device with the OS */
                           
                          -      (void)netdev_register(&priv->sk_dev);
                          -      vnet = vnet->next;
                          -  }
                          +	(void)netdev_register(&priv->sk_dev);
                          +
                          +	return 0;
                           }
                           
                           #endif /* CONFIG_NET && CONFIG_NET_VNET */
                          diff --git a/nuttx/drivers/usbdev/pl2303.c b/nuttx/drivers/usbdev/pl2303.c
                          index 69bf879656..95f26c1854 100644
                          --- a/nuttx/drivers/usbdev/pl2303.c
                          +++ b/nuttx/drivers/usbdev/pl2303.c
                          @@ -132,7 +132,7 @@
                           /* USB Controller */
                           
                           #ifndef CONFIG_USBDEV_SELFPOWERED
                          -#  define SELFPOWERED USB_CONFIG_ATT_SELFPOWER
                          +#  define SELFPOWERED USB_CONFIG_ATTR_SELFPOWER
                           #else
                           #  define SELFPOWERED (0)
                           #endif
                          diff --git a/nuttx/drivers/usbdev/usbmsc.h b/nuttx/drivers/usbdev/usbmsc.h
                          index 6a5530d9d9..883a499517 100644
                          --- a/nuttx/drivers/usbdev/usbmsc.h
                          +++ b/nuttx/drivers/usbdev/usbmsc.h
                          @@ -227,7 +227,7 @@
                           /* USB Controller */
                           
                           #ifndef CONFIG_USBDEV_SELFPOWERED
                          -#  define SELFPOWERED USB_CONFIG_ATT_SELFPOWER
                          +#  define SELFPOWERED USB_CONFIG_ATTR_SELFPOWER
                           #else
                           #  define SELFPOWERED (0)
                           #endif
                          diff --git a/nuttx/fs/Makefile b/nuttx/fs/Makefile
                          index ce952e06f9..6955c164b5 100644
                          --- a/nuttx/fs/Makefile
                          +++ b/nuttx/fs/Makefile
                          @@ -120,25 +120,21 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           $(BIN):	$(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $@, $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $@, $(OBJS))
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) --dep-path . $(MMAPDEPPATH) $(FATDEPPATH) $(ROMFSDEPPATH) $(NXFFSDEPPATH) $(NFSDEPPATH) \
                          -		$(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          -	@touch $@
                          +	$(Q) $(MKDEP) --dep-path . $(MMAPDEPPATH) $(FATDEPPATH) $(ROMFSDEPPATH) $(NXFFSDEPPATH) $(NFSDEPPATH) \
                          +		"$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f $(BIN) *~ .*.swp
                          +	$(call DELFILE, $(BIN))
                           	$(call CLEAN)
                          -	@( for dir in $(SUBDIRS); do \
                          -		rm -f $${dir}/*~ $${dir}/.*.swp; \
                          -	done ; )
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/nuttx/fs/fs_stat.c b/nuttx/fs/fs_stat.c
                          index cf27e87a6c..4df25028f3 100644
                          --- a/nuttx/fs/fs_stat.c
                          +++ b/nuttx/fs/fs_stat.c
                          @@ -1,7 +1,7 @@
                           /****************************************************************************
                            * fs/fs_stat.c
                            *
                          - *   Copyright (C) 2007-2009 , 2012Gregory 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
                          @@ -122,7 +122,8 @@ static inline int statroot(FAR struct stat *buf)
                           /****************************************************************************
                            * Name: stat
                            *
                          - * Return: Zero on success; -1 on failure with errno set:
                          + * Returned Value:
                          + *   Zero on success; -1 on failure with errno set:
                            *
                            *   EACCES  Search permission is denied for one of the directories in the
                            *           path prefix of path.
                          @@ -134,7 +135,7 @@ static inline int statroot(FAR struct stat *buf)
                            *
                            ****************************************************************************/
                           
                          -int stat(const char *path, FAR struct stat *buf)
                          +int stat(FAR const char *path, FAR struct stat *buf)
                           {
                             FAR struct inode *inode;
                             const char       *relpath = NULL;
                          diff --git a/nuttx/graphics/Makefile b/nuttx/graphics/Makefile
                          index 6e549c1dd7..238e14df42 100644
                          --- a/nuttx/graphics/Makefile
                          +++ b/nuttx/graphics/Makefile
                          @@ -33,7 +33,6 @@
                           #
                           ############################################################################
                           
                          --include $(TOPDIR)/.config
                           -include $(TOPDIR)/Make.defs
                           
                           DEPPATH		= --dep-path .
                          @@ -44,34 +43,34 @@ endif
                           
                           include nxglib/Make.defs
                           DEPPATH		+= --dep-path nxglib
                          -CFLAGS		+= ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxglib}
                          +CFLAGS		+= ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxglib}
                           
                           include nxbe/Make.defs
                           DEPPATH		+= --dep-path nxbe
                          -CFLAGS		+= ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxbe}
                          +CFLAGS		+= ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxbe}
                           
                           ifeq ($(CONFIG_NX_MULTIUSER),y)
                           include nxmu/Make.defs
                           DEPPATH		+= --dep-path nxmu
                          -CFLAGS		+= ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxmu}
                          +CFLAGS		+= ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxmu}
                           else
                           include nxsu/Make.defs
                           DEPPATH		+= --dep-path nxsu
                          -CFLAGS		+= ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxsu}
                          +CFLAGS		+= ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxsu}
                           endif
                           
                           include nxtk/Make.defs
                           DEPPATH		+= --dep-path nxtk
                          -CFLAGS		+= ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxtk}
                          +CFLAGS		+= ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxtk}
                           
                           include nxfonts/Make.defs
                           DEPPATH		+= --dep-path nxfonts
                          -CFLAGS		+= ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxfonts}
                          +CFLAGS		+= ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxfonts}
                           
                           ifeq ($(CONFIG_NXCONSOLE),y)
                           include nxconsole/Make.defs
                           DEPPATH		+= --dep-path nxconsole
                          -CFLAGS		+= ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxconsole}
                          +CFLAGS		+= ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxconsole}
                           endif
                           
                           ASRCS		= $(NXGLIB_ASRCS) $(NXBE_ASRCS) $(NX_ASRCS) $(NXTK_ASRCS) $(NXFONTS_ASRCS) $(NXCON_ASRCS)
                          @@ -97,84 +96,84 @@ all:	mklibgraphics
                           	 gen32bppsources genfontsources
                           
                           gen1bppsources:
                          -	@$(MAKE) -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=1 EXTRADEFINES=$(EXTRADEFINES)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_BITSPERPIXEL=1 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=1 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_BITSPERPIXEL=1 EXTRADEFINES=$(EXTRADEFINES)
                           
                           gen2bppsource:
                          -	@$(MAKE) -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=2 EXTRADEFINES=$(EXTRADEFINES)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_BITSPERPIXEL=2 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=2 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_BITSPERPIXEL=2 EXTRADEFINES=$(EXTRADEFINES)
                           
                           gen4bppsource:
                          -	@$(MAKE) -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=4 EXTRADEFINES=$(EXTRADEFINES)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_BITSPERPIXEL=4 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=4 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_BITSPERPIXEL=4 EXTRADEFINES=$(EXTRADEFINES)
                           
                           gen8bppsource:
                          -	@$(MAKE) -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=8 EXTRADEFINES=$(EXTRADEFINES)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_BITSPERPIXEL=8 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=8 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_BITSPERPIXEL=8 EXTRADEFINES=$(EXTRADEFINES)
                           
                           gen16bppsource:
                          -	@$(MAKE) -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=16 EXTRADEFINES=$(EXTRADEFINES)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_BITSPERPIXEL=16 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=16 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_BITSPERPIXEL=16 EXTRADEFINES=$(EXTRADEFINES)
                           
                           gen24bppsource:
                          -	@$(MAKE) -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=24 EXTRADEFINES=$(EXTRADEFINES)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_BITSPERPIXEL=24 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=24 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_BITSPERPIXEL=24 EXTRADEFINES=$(EXTRADEFINES)
                           
                           gen32bppsources:
                          -	@$(MAKE) -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=32 EXTRADEFINES=$(EXTRADEFINES)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_BITSPERPIXEL=32 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxglib -f Makefile.sources TOPDIR=$(TOPDIR) NXGLIB_BITSPERPIXEL=32 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_BITSPERPIXEL=32 EXTRADEFINES=$(EXTRADEFINES)
                           
                           genfontsources:
                           ifeq ($(CONFIG_NXFONT_SANS23X27),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=1 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=1 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SANS22X29),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=2 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=2 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SANS28X37),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=3 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=3 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SANS39X48),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=4 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=4 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SANS17X23B),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=16 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=16 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SANS20X27B),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=17 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=17 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SANS22X29B),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=5 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=5 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SANS28X37B),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=6 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=6 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SANS40X49B),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=7 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=7 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SERIF22X29),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=8 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=8 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SERIF29X37),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=9 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=9 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SERIF38X48),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=10 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=10 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SERIF22X28B),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=11 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=11 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SERIF27X38B),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=12 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=12 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SERIF38X49B),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=13 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=13 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SANS17X22),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=14 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=14 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           ifeq ($(CONFIG_NXFONT_SANS20X26),y)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=15 EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=15 EXTRADEFINES=$(EXTRADEFINES)
                           endif
                           
                           gensources: gen1bppsources gen2bppsource gen4bppsource gen8bppsource gen16bppsource gen24bppsource gen32bppsources genfontsources
                          @@ -186,30 +185,29 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           $(BIN): $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $@, $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $@, $(OBJS))
                           
                           mklibgraphics: gensources $(BIN)
                           
                           .depend: gensources Makefile $(SRCS)
                          -	@$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          -	@touch $@
                          +	$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           context: gensources
                           
                           clean:
                          -	@$(MAKE) -C nxglib -f Makefile.sources clean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources clean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES)
                          -	@rm -f $(BIN) *~ .*.swp
                          +	$(Q) $(MAKE) -C nxglib -f Makefile.sources clean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources clean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES)
                          +	$(call DELFILE, $(BIN))
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@$(MAKE) -C nxglib -f Makefile.sources distclean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES)
                          -	@$(MAKE) -C nxfonts -f Makefile.sources distclean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES)
                          -	@rm -f Make.dep .depend
                          +	$(Q) $(MAKE) -C nxglib -f Makefile.sources distclean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) $(MAKE) -C nxfonts -f Makefile.sources distclean TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES)
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                           
                          diff --git a/nuttx/graphics/nxfonts/Makefile.sources b/nuttx/graphics/nxfonts/Makefile.sources
                          index f2aa87cafd..76a099dcbe 100644
                          --- a/nuttx/graphics/nxfonts/Makefile.sources
                          +++ b/nuttx/graphics/nxfonts/Makefile.sources
                          @@ -33,7 +33,6 @@
                           #
                           ############################################################################
                           
                          --include $(TOPDIR)/.config
                           -include $(TOPDIR)/Make.defs
                           
                           ifdef NXFONTS_BITSPERPIXEL
                          @@ -177,13 +176,14 @@ all:	$(GEN_CSRC)
                           .PHONY : clean distclean
                           
                           $(GEN_CSRC) : $(DEPENDENCY)
                          -	@$(call PREPROCESS, $<, $(GEN_TMP))
                          -	@cat $(GEN_TMP) | sed -e "/^#/d" >$@
                          -	@rm -f  $(GEN_TMP)
                          +	$(call PREPROCESS, $<, $(GEN_TMP))
                          +	$(Q) cat $(GEN_TMP) | sed -e "/^#/d" >$@
                          +	$(Q) rm -f  $(GEN_TMP)
                           
                           clean:
                          -	@rm -f *~ .*.swp *.i
                          +	$(call DELFILE, *.i)
                          +	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f nxfonts_convert_*bpp.c
                          -	@rm -f nxfonts_bitmaps_*.c
                          +	$(call DELFILE, nxfonts_convert_*bpp.c)
                          +	$(call DELFILE, nxfonts_bitmaps_*.c)
                          diff --git a/nuttx/graphics/nxglib/Makefile.sources b/nuttx/graphics/nxglib/Makefile.sources
                          index 67f8defc31..71d6e0661b 100644
                          --- a/nuttx/graphics/nxglib/Makefile.sources
                          +++ b/nuttx/graphics/nxglib/Makefile.sources
                          @@ -33,7 +33,6 @@
                           #
                           ############################################################################
                           
                          --include $(TOPDIR)/.config
                           -include $(TOPDIR)/Make.defs
                           
                           ifeq ($(NXGLIB_BITSPERPIXEL),1)
                          @@ -123,53 +122,54 @@ all:	$(GEN_CSRCS)
                           
                           $(SETP_CSRC) : $(BLITDIR)/nxglib_setpixel.c nxglib_bitblit.h
                           ifneq ($(NXGLIB_BITSPERPIXEL),)
                          -	@$(call PREPROCESS, $(BLITDIR)/nxglib_setpixel.c, $(SETP_TMP))
                          -	@cat $(SETP_TMP) | sed -e "/^#/d" >$@
                          -	@rm -f  $(SETP_TMP)
                          +	$(call PREPROCESS, $(BLITDIR)/nxglib_setpixel.c, $(SETP_TMP))
                          +	$(Q) cat $(SETP_TMP) | sed -e "/^#/d" >$@
                          +	$(Q) rm -f  $(SETP_TMP)
                           endif
                           
                           $(RFILL_CSRC) : $(BLITDIR)/nxglib_fillrectangle.c nxglib_bitblit.h
                           ifneq ($(NXGLIB_BITSPERPIXEL),)
                          -	@$(call PREPROCESS, $(BLITDIR)/nxglib_fillrectangle.c, $(RFILL_TMP))
                          -	@cat $(RFILL_TMP) | sed -e "/^#/d" >$@
                          -	@rm -f  $(RFILL_TMP)
                          +	$(call PREPROCESS, $(BLITDIR)/nxglib_fillrectangle.c, $(RFILL_TMP))
                          +	$(Q) cat $(RFILL_TMP) | sed -e "/^#/d" >$@
                          +	$(Q) rm -f  $(RFILL_TMP)
                           endif
                           
                           $(RGET_CSRC) : $(BLITDIR)/nxglib_getrectangle.c nxglib_bitblit.h
                           ifneq ($(NXGLIB_BITSPERPIXEL),)
                          -	@$(call PREPROCESS, $(BLITDIR)/nxglib_getrectangle.c, $(RGET_TMP))
                          -	@cat $(RGET_TMP) | sed -e "/^#/d" >$@
                          -	@rm -f  $(RGET_TMP)
                          +	$(call PREPROCESS, $(BLITDIR)/nxglib_getrectangle.c, $(RGET_TMP))
                          +	$(Q) cat $(RGET_TMP) | sed -e "/^#/d" >$@
                          +	$(Q) rm -f  $(RGET_TMP)
                           endif
                           
                           $(TFILL_CSRC) : $(BLITDIR)/nxglib_filltrapezoid.c nxglib_bitblit.h
                           ifneq ($(NXGLIB_BITSPERPIXEL),)
                          -	@$(call PREPROCESS, $(BLITDIR)/nxglib_filltrapezoid.c, $(TFILL_TMP))
                          -	@cat $(TFILL_TMP) | sed -e "/^#/d" >$@
                          -	@rm -f  $(TFILL_TMP)
                          +	$(call PREPROCESS, $(BLITDIR)/nxglib_filltrapezoid.c, $(TFILL_TMP))
                          +	$(Q) cat $(TFILL_TMP) | sed -e "/^#/d" >$@
                          +	$(Q) rm -f  $(TFILL_TMP)
                           endif
                           
                           $(RMOVE_CSRC) : $(BLITDIR)/nxglib_moverectangle.c nxglib_bitblit.h
                           ifneq ($(NXGLIB_BITSPERPIXEL),)
                          -	@$(call PREPROCESS, $(BLITDIR)/nxglib_moverectangle.c, $(RMOVE_TMP))
                          -	@cat $(RMOVE_TMP) | sed -e "/^#/d" >$@
                          -	@rm -f  $(RMOVE_TMP)
                          +	$(call PREPROCESS, $(BLITDIR)/nxglib_moverectangle.c, $(RMOVE_TMP))
                          +	$(Q) cat $(RMOVE_TMP) | sed -e "/^#/d" >$@
                          +	$(Q) rm -f  $(RMOVE_TMP)
                           endif
                           
                           $(RCOPY_CSRC) : $(BLITDIR)/nxglib_copyrectangle.c nxglib_bitblit.h
                           ifneq ($(NXGLIB_BITSPERPIXEL),)
                          -	@$(call PREPROCESS, $(BLITDIR)/nxglib_copyrectangle.c, $(RCOPY_TMP))
                          -	@cat $(RCOPY_TMP) | sed -e "/^#/d" >$@
                          -	@rm -f  $(RCOPY_TMP)
                          +	$(call PREPROCESS, $(BLITDIR)/nxglib_copyrectangle.c, $(RCOPY_TMP))
                          +	$(Q) cat $(RCOPY_TMP) | sed -e "/^#/d" >$@
                          +	$(Q) rm -f  $(RCOPY_TMP)
                           endif
                           
                           clean:
                          -	@rm -f *~ .*.swp *.i
                          +	$(call DELFILE, *.i)
                          +	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f nxglib_setpixel_*bpp.c
                          -	@rm -f nxglib_fillrectangle_*bpp.c
                          -	@rm -f nxglib_getrectangle_*bpp.c
                          -	@rm -f nxglib_filltrapezoid_*bpp.c
                          -	@rm -f nxglib_moverectangle_*bpp.c
                          -	@rm -f nxglib_copyrectangle_*bpp.c
                          +	$(call DELFILE, nxglib_setpixel_*bpp.c)
                          +	$(call DELFILE, nxglib_fillrectangle_*bpp.c)
                          +	$(call DELFILE, nxglib_getrectangle_*bpp.c)
                          +	$(call DELFILE, nxglib_filltrapezoid_*bpp.c)
                          +	$(call DELFILE, nxglib_moverectangle_*bpp.c)
                          +	$(call DELFILE, nxglib_copyrectangle_*bpp.c)
                          diff --git a/nuttx/graphics/nxmu/nx_bitmap.c b/nuttx/graphics/nxmu/nx_bitmap.c
                          index a86eda96ac..a0bd748b09 100644
                          --- a/nuttx/graphics/nxmu/nx_bitmap.c
                          +++ b/nuttx/graphics/nxmu/nx_bitmap.c
                          @@ -100,6 +100,8 @@ int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest,
                             FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
                             struct nxsvrmsg_bitmap_s outmsg;
                             int i;
                          +  int ret;
                          +  sem_t sem_done;
                           
                           #ifdef CONFIG_DEBUG
                             if (!wnd || !dest || !src || !origin)
                          @@ -124,7 +126,32 @@ int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest,
                             outmsg.origin.y   = origin->y;
                             nxgl_rectcopy(&outmsg.dest, dest);
                           
                          +  
                          +  /* Create a semaphore for tracking command completion */
                          +
                          +  outmsg.sem_done = &sem_done;
                          +  ret = sem_init(&sem_done, 0, 0);
                          +  
                          +  if (ret != OK)
                          +    {
                          +      gdbg("sem_init failed: %d\n", errno);
                          +      return ret;
                          +    }
                          +  
                             /* Forward the fill command to the server */
                           
                          -  return nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_bitmap_s));
                          +  ret = nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_bitmap_s));
                          +  
                          +  /* Wait that the command is completed, so that caller can release the buffer. */
                          +  
                          +  if (ret == OK)
                          +    {
                          +      ret = sem_wait(&sem_done);
                          +    }
                          +  
                          +  /* Destroy the semaphore and return. */
                          +  
                          +  sem_destroy(&sem_done);
                          +  
                          +  return ret;
                           }
                          diff --git a/nuttx/graphics/nxmu/nx_block.c b/nuttx/graphics/nxmu/nx_block.c
                          index 3a051f9d7d..7b198613c6 100644
                          --- a/nuttx/graphics/nxmu/nx_block.c
                          +++ b/nuttx/graphics/nxmu/nx_block.c
                          @@ -140,7 +140,7 @@ int nx_block(NXWINDOW hwnd, FAR void *arg)
                                  * that it will not be blocked.
                                  */
                           
                          -      ret = nxmu_sendserver(wnd->conn, &outmsg, sizeof(struct nxbe_window_s));
                          +      ret = nxmu_sendserver(wnd->conn, &outmsg, sizeof(struct nxsvrmsg_blocked_s));
                               }
                           
                             return ret;
                          diff --git a/nuttx/graphics/nxmu/nx_getrectangle.c b/nuttx/graphics/nxmu/nx_getrectangle.c
                          index f32065129c..9b7d3679c4 100644
                          --- a/nuttx/graphics/nxmu/nx_getrectangle.c
                          +++ b/nuttx/graphics/nxmu/nx_getrectangle.c
                          @@ -98,7 +98,9 @@ int nx_getrectangle(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
                           {
                             FAR struct nxbe_window_s        *wnd = (FAR struct nxbe_window_s *)hwnd;
                             struct nxsvrmsg_getrectangle_s  outmsg;
                          -
                          +  int ret;
                          +  sem_t sem_done;
                          +  
                           #ifdef CONFIG_DEBUG
                             if (!hwnd || !rect || !dest)
                               {
                          @@ -118,7 +120,31 @@ int nx_getrectangle(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
                           
                             nxgl_rectcopy(&outmsg.rect, rect);
                           
                          +  /* Create a semaphore for tracking command completion */
                          +
                          +  outmsg.sem_done = &sem_done;
                          +  ret = sem_init(&sem_done, 0, 0);
                          +  
                          +  if (ret != OK)
                          +    {
                          +      gdbg("sem_init failed: %d\n", errno);
                          +      return ret;
                          +    }
                          +  
                             /* Forward the fill command to the server */
                           
                          -  return nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_getrectangle_s));
                          +  ret = nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_getrectangle_s));
                          +  
                          +  /* Wait that the command is completed, so that caller can release the buffer. */
                          +  
                          +  if (ret == OK)
                          +    {
                          +      ret = sem_wait(&sem_done);
                          +    }
                          +  
                          +  /* Destroy the semaphore and return. */
                          +  
                          +  sem_destroy(&sem_done);
                          +  
                          +  return ret;
                           }
                          diff --git a/nuttx/graphics/nxmu/nxfe.h b/nuttx/graphics/nxmu/nxfe.h
                          index 8b6a21ef48..b9e02616ce 100644
                          --- a/nuttx/graphics/nxmu/nxfe.h
                          +++ b/nuttx/graphics/nxmu/nxfe.h
                          @@ -392,6 +392,7 @@ struct nxsvrmsg_getrectangle_s
                             unsigned int plane;              /* The plane number to read */
                             FAR uint8_t *dest;               /* Memory location in which to store the graphics data */
                             unsigned int deststride;         /* Width of the destination memory in bytes */
                          +  sem_t *sem_done;                 /* Semaphore to report when command is done. */
                           };
                           
                           /* Fill a trapezoidal region in the window with a color */
                          @@ -425,6 +426,7 @@ struct nxsvrmsg_bitmap_s
                             FAR const void *src[CONFIG_NX_NPLANES]; /* The start of the source image. */
                             struct nxgl_point_s origin;     /* Offset into the source image data */
                             unsigned int stride;            /* The width of the full source image in pixels. */
                          +  sem_t *sem_done;                /* Semaphore to report when command is done. */
                           };
                           
                           /* Set the color of the background */
                          @@ -586,6 +588,25 @@ EXTERN int nxmu_sendwindow(FAR struct nxbe_window_s *wnd, FAR const void *msg,
                           EXTERN int nxmu_sendclient(FAR struct nxfe_conn_s *conn,
                                                      FAR const void *msg, size_t msglen);
                           
                          +/****************************************************************************
                          + * Name: nxmu_sendclientwindow
                          + *
                          + * Description:
                          + *  Send a message to the client at NX_CLIMSG_PRIO priority
                          + *
                          + * Input Parameters:
                          + *   wnd    - A pointer to the back-end window structure
                          + *   msg    - A pointer to the message to send
                          + *   msglen - The length of the message in bytes.
                          + *
                          + * Return:
                          + *   OK on success; ERROR on failure with errno set appropriately
                          + *
                          + ****************************************************************************/
                          +
                          +int nxmu_sendclientwindow(FAR struct nxbe_window_s *wnd, FAR const void *msg,
                          +                    size_t msglen);
                          +
                           /****************************************************************************
                            * Name: nxmu_openwindow
                            *
                          diff --git a/nuttx/graphics/nxmu/nxmu_kbdin.c b/nuttx/graphics/nxmu/nxmu_kbdin.c
                          index 2c658009bc..0308c2bfa8 100644
                          --- a/nuttx/graphics/nxmu/nxmu_kbdin.c
                          +++ b/nuttx/graphics/nxmu/nxmu_kbdin.c
                          @@ -108,7 +108,7 @@ void nxmu_kbdin(FAR struct nxfe_state_s *fe, uint8_t nch, FAR uint8_t *ch)
                                     outmsg->ch[i] = ch[i];
                                   }
                           
                          -      (void)nxmu_sendclient(fe->be.topwnd->conn, outmsg, size);
                          +      (void)nxmu_sendclientwindow(fe->be.topwnd, outmsg, size);
                                 free(outmsg);
                               }
                           }
                          diff --git a/nuttx/graphics/nxmu/nxmu_mouse.c b/nuttx/graphics/nxmu/nxmu_mouse.c
                          index 3ebe062d29..1b8f4a5921 100644
                          --- a/nuttx/graphics/nxmu/nxmu_mouse.c
                          +++ b/nuttx/graphics/nxmu/nxmu_mouse.c
                          @@ -61,9 +61,10 @@
                            * Private Data
                            ****************************************************************************/
                           
                          -static struct nxgl_point_s g_mpos;
                          -static struct nxgl_point_s g_mrange;
                          -static uint8_t             g_mbutton;
                          +static struct nxgl_point_s   g_mpos;
                          +static struct nxgl_point_s   g_mrange;
                          +static uint8_t               g_mbutton;
                          +static struct nxbe_window_s *g_mwnd;
                           
                           /****************************************************************************
                            * Public Data
                          @@ -129,7 +130,7 @@ int nxmu_mousereport(struct nxbe_window_s *wnd)
                                     outmsg.buttons = g_mbutton;
                                     nxgl_vectsubtract(&outmsg.pos, &g_mpos, &wnd->bounds.pt1);
                           
                          -          return nxmu_sendclient(wnd->conn, &outmsg, sizeof(struct nxclimsg_mousein_s));
                          +          return nxmu_sendclientwindow(wnd, &outmsg, sizeof(struct nxclimsg_mousein_s));
                                   }
                               }
                           
                          @@ -154,6 +155,7 @@ int nxmu_mousein(FAR struct nxfe_state_s *fe,
                             struct nxbe_window_s *wnd;
                             nxgl_coord_t x = pos->x;
                             nxgl_coord_t y = pos->y;
                          +  uint8_t oldbuttons;
                             int ret;
                           
                             /* Clip x and y to within the bounding rectangle */
                          @@ -182,20 +184,36 @@ int nxmu_mousein(FAR struct nxfe_state_s *fe,
                               {
                                 /* Update the mouse value */
                           
                          -      g_mpos.x  = x;
                          -      g_mpos.y  = y;
                          -      g_mbutton = buttons;
                          +      oldbuttons = g_mbutton;
                          +      g_mpos.x   = x;
                          +      g_mpos.y   = y;
                          +      g_mbutton  = buttons;
                           
                          -      /* Pick the window to receive the mouse event.  Start with
                          -       * the top window and go down.  Stop with the first window
                          -       * that gets the mouse report
                          +      /* If a button is already down, regard this as part of a mouse drag
                          +       * event. Pass all the following events to the window where the drag
                          +       * started in.
                          +       */
                          +
                          +      if (oldbuttons && g_mwnd && g_mwnd->cb->mousein)
                          +        {
                          +          struct nxclimsg_mousein_s outmsg;
                          +          outmsg.msgid   = NX_CLIMSG_MOUSEIN;
                          +          outmsg.wnd     = g_mwnd;
                          +          outmsg.buttons = g_mbutton;
                          +          nxgl_vectsubtract(&outmsg.pos, &g_mpos, &g_mwnd->bounds.pt1);
                          +
                          +          return nxmu_sendclientwindow(g_mwnd, &outmsg, sizeof(struct nxclimsg_mousein_s));
                          +        }
                          +
                          +      /* Pick the window to receive the mouse event.  Start with the top
                          +       * window and go down.  Stop with the first window that gets the mouse
                          +       * report
                                  */
                           
                                 for (wnd = fe->be.topwnd; wnd; wnd = wnd->below)
                                   {
                          -          /* The background window normally has no callback structure
                          -           * (unless a client has taken control of the background via
                          -           * nx_requestbkgd()).
                          +          /* The background window normally has no callback structure (unless
                          +           * a client has taken control of the background via nx_requestbkgd()).
                                      */
                           
                                     if (wnd->cb)
                          @@ -207,6 +225,8 @@ int nxmu_mousein(FAR struct nxfe_state_s *fe,
                                           }
                                       }
                                   }
                          +
                          +      g_mwnd = wnd;
                               }
                           
                             return OK;
                          diff --git a/nuttx/graphics/nxmu/nxmu_redrawreq.c b/nuttx/graphics/nxmu/nxmu_redrawreq.c
                          index 32ca477a26..f54aa85a7e 100644
                          --- a/nuttx/graphics/nxmu/nxmu_redrawreq.c
                          +++ b/nuttx/graphics/nxmu/nxmu_redrawreq.c
                          @@ -87,7 +87,7 @@ void nxfe_redrawreq(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s
                             outmsg.more  = false;
                             nxgl_rectoffset(&outmsg.rect, rect, -wnd->bounds.pt1.x, -wnd->bounds.pt1.y);
                           
                          -  (void)nxmu_sendclient(wnd->conn, &outmsg, sizeof(struct nxclimsg_redraw_s));
                          +  (void)nxmu_sendclientwindow(wnd, &outmsg, sizeof(struct nxclimsg_redraw_s));
                           }
                           
                           
                          diff --git a/nuttx/graphics/nxmu/nxmu_reportposition.c b/nuttx/graphics/nxmu/nxmu_reportposition.c
                          index f9b5f9dafa..6ffb3f4ee7 100644
                          --- a/nuttx/graphics/nxmu/nxmu_reportposition.c
                          +++ b/nuttx/graphics/nxmu/nxmu_reportposition.c
                          @@ -100,7 +100,7 @@ void nxfe_reportposition(FAR struct nxbe_window_s *wnd)
                           
                             /* And provide this to the client */
                           
                          -  ret = nxmu_sendclient(wnd->conn, &outmsg, sizeof(struct nxclimsg_newposition_s));
                          +  ret = nxmu_sendclientwindow(wnd, &outmsg, sizeof(struct nxclimsg_newposition_s));
                             if (ret < 0)
                               {
                                 gdbg("nxmu_sendclient failed: %d\n", errno);
                          diff --git a/nuttx/graphics/nxmu/nxmu_sendwindow.c b/nuttx/graphics/nxmu/nxmu_sendwindow.c
                          index 6f64ffff2c..0826a45bc9 100644
                          --- a/nuttx/graphics/nxmu/nxmu_sendwindow.c
                          +++ b/nuttx/graphics/nxmu/nxmu_sendwindow.c
                          @@ -112,3 +112,47 @@ int nxmu_sendwindow(FAR struct nxbe_window_s *wnd, FAR const void *msg,
                           
                             return ret;
                           }
                          +
                          +/****************************************************************************
                          + * Name: nxmu_sendclientwindow
                          + *
                          + * Description:
                          + *  Send a message to the client at NX_CLIMSG_PRIO priority
                          + *
                          + * Input Parameters:
                          + *   wnd    - A pointer to the back-end window structure
                          + *   msg    - A pointer to the message to send
                          + *   msglen - The length of the message in bytes.
                          + *
                          + * Return:
                          + *   OK on success; ERROR on failure with errno set appropriately
                          + *
                          + ****************************************************************************/
                          +
                          +int nxmu_sendclientwindow(FAR struct nxbe_window_s *wnd, FAR const void *msg,
                          +                    size_t msglen)
                          +{
                          +    int ret = OK;
                          +
                          +  /* Sanity checking */
                          +
                          +#ifdef CONFIG_DEBUG
                          +  if (!wnd || !wnd->conn)
                          +    {
                          +      errno = EINVAL;
                          +      return ERROR;
                          +    }
                          +#endif
                          +
                          +  /* Ignore messages destined to a blocked window (no errors reported) */
                          +
                          +  if (!NXBE_ISBLOCKED(wnd))
                          +    {
                          +      /* Send the message to the server */
                          +
                          +      ret = nxmu_sendclient(wnd->conn, msg, msglen);
                          +    }
                          +
                          +  return ret;
                          +}
                          +
                          diff --git a/nuttx/graphics/nxmu/nxmu_server.c b/nuttx/graphics/nxmu/nxmu_server.c
                          index 2730e0ea28..cfaa5bbf5d 100644
                          --- a/nuttx/graphics/nxmu/nxmu_server.c
                          +++ b/nuttx/graphics/nxmu/nxmu_server.c
                          @@ -451,6 +451,11 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev)
                                      {
                                        FAR struct nxsvrmsg_getrectangle_s *getmsg = (FAR struct nxsvrmsg_getrectangle_s *)buffer;
                                        nxbe_getrectangle(getmsg->wnd, &getmsg->rect, getmsg->plane, getmsg->dest, getmsg->deststride);
                          +             
                          +             if (getmsg->sem_done)
                          +              {
                          +                sem_post(getmsg->sem_done);
                          +              }
                                      }
                                      break;
                           
                          @@ -471,6 +476,11 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev)
                                      {
                                        FAR struct nxsvrmsg_bitmap_s *bmpmsg = (FAR struct nxsvrmsg_bitmap_s *)buffer;
                                        nxbe_bitmap(bmpmsg->wnd, &bmpmsg->dest, bmpmsg->src, &bmpmsg->origin, bmpmsg->stride);
                          +             
                          +             if (bmpmsg->sem_done)
                          +              {
                          +                sem_post(bmpmsg->sem_done);
                          +              }
                                      }
                                      break;
                           
                          diff --git a/nuttx/graphics/nxsu/nx_mousein.c b/nuttx/graphics/nxsu/nx_mousein.c
                          index bee4a22650..5b268358bf 100644
                          --- a/nuttx/graphics/nxsu/nx_mousein.c
                          +++ b/nuttx/graphics/nxsu/nx_mousein.c
                          @@ -62,9 +62,10 @@
                            * Private Data
                            ****************************************************************************/
                           
                          -static struct nxgl_point_s g_mpos;
                          -static struct nxgl_point_s g_mrange;
                          -static uint8_t             g_mbutton;
                          +static struct nxgl_point_s   g_mpos;
                          +static struct nxgl_point_s   g_mrange;
                          +static uint8_t               g_mbutton;
                          +static struct nxbe_window_s *g_mwnd;
                           
                           /****************************************************************************
                            * Public Data
                          @@ -148,6 +149,7 @@ int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, uint8_t buttons)
                           {
                             FAR struct nxfe_state_s *fe = (FAR struct nxfe_state_s *)handle;
                             struct nxbe_window_s *wnd;
                          +  uint8_t oldbuttons;
                             int ret;
                           
                             /* Clip x and y to within the bounding rectangle */
                          @@ -176,13 +178,27 @@ int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, uint8_t buttons)
                               {
                                 /* Update the mouse value */
                           
                          +      oldbuttons = g_mbutton;
                                 g_mpos.x  = x;
                                 g_mpos.y  = y;
                                 g_mbutton = buttons;
                           
                          -      /* Pick the window to receive the mouse event.  Start with
                          -       * the top window and go down.  Step with the first window
                          -       * that gets the mouse report
                          +      /* If a button is already down, regard this as part of a mouse drag
                          +       * event. Pass all the following events to the window where the drag
                          +       * started in.
                          +       */
                          +
                          +      if (oldbuttons && g_mwnd && g_mwnd->cb->mousein)
                          +        {
                          +          struct nxgl_point_s relpos;
                          +          nxgl_vectsubtract(&relpos, &g_mpos, &g_mwnd->bounds.pt1);
                          +          g_mwnd->cb->mousein((NXWINDOW)g_mwnd, &relpos, g_mbutton, g_mwnd->arg);
                          +          return OK;
                          +        }
                          +
                          +      /* Pick the window to receive the mouse event.  Start with the top
                          +       * window and go down.  Step with the first window that gets the mouse
                          +       * report
                                  */
                           
                                 for (wnd = fe->be.topwnd; wnd; wnd = wnd->below)
                          @@ -193,6 +209,8 @@ int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, uint8_t buttons)
                                         break;
                                       }
                                   }
                          +
                          +      g_mwnd = wnd;
                               }
                             return OK;
                           }
                          diff --git a/nuttx/graphics/nxtk/nxtk_events.c b/nuttx/graphics/nxtk/nxtk_events.c
                          index 33c50b7f90..facf921762 100644
                          --- a/nuttx/graphics/nxtk/nxtk_events.c
                          +++ b/nuttx/graphics/nxtk/nxtk_events.c
                          @@ -76,6 +76,9 @@ static void nxtk_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
                           static void nxtk_kbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch,
                                                  FAR void *arg);
                           #endif
                          +#ifdef CONFIG_NX_MULTIUSER
                          +static void nxtk_blocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2);
                          +#endif
                           
                           /****************************************************************************
                            * Private Data
                          @@ -95,6 +98,9 @@ const struct nx_callback_s g_nxtkcb =
                           #ifdef CONFIG_NX_KBD
                             , nxtk_kbdin    /* kbdin */
                           #endif
                          +#ifdef CONFIG_NX_MULTIUSER
                          +  , nxtk_blocked
                          +#endif
                           };
                           
                           /****************************************************************************
                          @@ -255,9 +261,20 @@ static void nxtk_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
                           
                             nxgl_vectoradd(&abspos, pos, &fwnd->wnd.bounds.pt1);
                           
                          +  /* In order to deliver mouse release events to the same window where the
                          +   * mouse down event happened, we store the initial mouse down location.
                          +   */
                          +
                          +  if (fwnd->mbutton == 0 && buttons != 0)
                          +    {
                          +      fwnd->mpos = abspos;
                          +    }
                          +
                          +  fwnd->mbutton = buttons;
                          +
                             /* Is the mouse position inside of the client window region? */
                           
                          -  if (fwnd->fwcb->mousein && nxgl_rectinside(&fwnd->fwrect, &abspos))
                          +  if (fwnd->fwcb->mousein && nxgl_rectinside(&fwnd->fwrect, &fwnd->mpos))
                               {
                                 nxgl_vectsubtract(&relpos, &abspos, &fwnd->fwrect.pt1);
                                 fwnd->fwcb->mousein((NXTKWINDOW)fwnd, &relpos, buttons, fwnd->fwarg);
                          @@ -265,7 +282,7 @@ static void nxtk_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
                           
                             /* If the mouse position inside the toobar region? */
                           
                          -  else if (fwnd->tbcb->mousein && nxgl_rectinside(&fwnd->tbrect, &abspos))
                          +  else if (fwnd->tbcb->mousein && nxgl_rectinside(&fwnd->tbrect, &fwnd->mpos))
                               {
                                 nxgl_vectsubtract(&relpos, &abspos, &fwnd->tbrect.pt1);
                                 fwnd->tbcb->mousein((NXTKWINDOW)fwnd, &relpos, buttons, fwnd->tbarg);
                          @@ -292,6 +309,24 @@ static void nxtk_kbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch,
                           }
                           #endif
                           
                          +/****************************************************************************
                          + * Name: nxtk_blocked
                          + ****************************************************************************/
                          +
                          +#ifdef CONFIG_NX_MULTIUSER
                          +static void nxtk_blocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2)
                          +{
                          +  FAR struct nxtk_framedwindow_s *fwnd = (FAR struct nxtk_framedwindow_s *)hwnd;
                          +
                          +  /* Only the client window gets keyboard input */
                          +
                          +  if (fwnd->fwcb->blocked)
                          +    {
                          +      fwnd->fwcb->blocked((NXTKWINDOW)fwnd, fwnd->fwarg, arg2);
                          +    }
                          +}
                          +#endif
                          +
                           /****************************************************************************
                            * Public Functions
                            ****************************************************************************/
                          diff --git a/nuttx/graphics/nxtk/nxtk_internal.h b/nuttx/graphics/nxtk/nxtk_internal.h
                          index 87a098845a..3a31215d83 100644
                          --- a/nuttx/graphics/nxtk/nxtk_internal.h
                          +++ b/nuttx/graphics/nxtk/nxtk_internal.h
                          @@ -72,6 +72,11 @@ struct nxtk_framedwindow_s
                             struct nxgl_rect_s fwrect;
                             FAR const struct nx_callback_s *fwcb;
                             FAR void *fwarg;
                          +
                          +  /* Initial mouse down location */
                          +
                          +  uint8_t mbutton;
                          +  struct nxgl_point_s mpos;
                           };
                           
                           /****************************************************************************
                          diff --git a/nuttx/include/cxx/cstdbool b/nuttx/include/cxx/cstdbool
                          index d2f0639d21..192fde490b 100644
                          --- a/nuttx/include/cxx/cstdbool
                          +++ b/nuttx/include/cxx/cstdbool
                          @@ -46,4 +46,13 @@
                           // Namespace
                           //***************************************************************************
                           
                          +//***************************************************************************
                          +// Namespace
                          +//***************************************************************************
                          +
                          +namespace std
                          +{
                          +  using ::_Bool8;
                          +}
                          +
                           #endif // __INCLUDE_CXX_CSTDBOOL
                          diff --git a/nuttx/include/cxx/cstdio b/nuttx/include/cxx/cstdio
                          index 900d429cb9..6a9620e1ad 100644
                          --- a/nuttx/include/cxx/cstdio
                          +++ b/nuttx/include/cxx/cstdio
                          @@ -52,6 +52,8 @@ namespace std
                             using ::FILE;
                             using ::fpos_t;
                             using ::size_t;
                          +
                          +  using ::clearerr;
                             using ::fclose;
                             using ::fflush;
                             using ::feof;
                          @@ -69,16 +71,24 @@ namespace std
                             using ::ftell;
                             using ::fwrite;
                             using ::gets;
                          +  using ::ungetc;
                          +
                             using ::printf;
                             using ::puts;
                             using ::rename;
                             using ::sprintf;
                          +  using ::asprintf;
                             using ::snprintf;
                          -  using ::ungetc;
                          +  using ::sscanf;
                          +  using ::perror;
                          +
                             using ::vprintf;
                             using ::vfprintf;
                             using ::vsprintf;
                          +  using ::avsprintf;
                             using ::vsnprintf;
                          +  using ::vsscanf;
                          +
                             using ::fdopen;
                             using ::statfs;
                           }
                          diff --git a/nuttx/include/elf32.h b/nuttx/include/elf32.h
                          new file mode 100644
                          index 0000000000..e16ae0091a
                          --- /dev/null
                          +++ b/nuttx/include/elf32.h
                          @@ -0,0 +1,352 @@
                          +/****************************************************************************
                          + * include/elf32.h
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Author: Gregory Nutt 
                          + *
                          + * Reference: System V Application Binary Interface, Edition 4.1, March 18,
                          + * 1997, The Santa Cruz Operation, Inc.
                          + *
                          + * 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_ELF32_H
                          +#define __INCLUDE_ELF32_H
                          +
                          +/****************************************************************************
                          + * Included Files
                          + ****************************************************************************/
                          +
                          +#include 
                          +
                          +#include 
                          +
                          +/****************************************************************************
                          + * Pre-processor Definitions
                          + ****************************************************************************/
                          +
                          +/****************************************************************************
                          + * Pre-processor Definitions
                          + ****************************************************************************/
                          +
                          +/* Values for Elf32_Ehdr::e_type */
                          +
                          +#define ET_NONE           0       /* No file type */
                          +#define ET_REL            1       /* Relocatable file */
                          +#define ET_EXEC           2       /* Executable file */
                          +#define ET_DYN            3       /* Shared object file */
                          +#define ET_CORE           4       /* Core file */
                          +#define ET_LOPROC         0xff00  /* Processor-specific */
                          +#define ET_HIPROC         0xffff  /* Processor-specific */
                          +
                          +/* Values for Elf32_Ehdr::e_machine (most of this were not included in the
                          + * original SCO document but have been gleaned from elsewhere).
                          + */
                          +
                          +#define EM_NONE            0      /* No machine */
                          +#define EM_M32             1      /* AT&T WE 32100 */
                          +#define EM_SPARC           2      /* SPARC */
                          +#define EM_386             3      /* Intel 80386 */
                          +#define EM_68K             4      /* Motorola 68000 */
                          +#define EM_88K             5      /* Motorola 88000 */
                          +#define EM_486             6      /* Intel 486+ */
                          +#define EM_860             7      /* Intel 80860 */
                          +#define EM_MIPS            8      /* MIPS R3000 Big-Endian */
                          +#define EM_MIPS_RS4_BE     10     /* MIPS R4000 Big-Endian */
                          +#define EM_PARISC          15     /* HPPA */
                          +#define EM_SPARC32PLUS     18     /* Sun's "v8plus" */
                          +#define EM_PPC             20     /* PowerPC */
                          +#define EM_PPC64           21     /* PowerPC64 */
                          +#define EM_ARM             40     /* ARM */
                          +#define EM_SH              42     /* SuperH */
                          +#define EM_SPARCV9         43     /* SPARC v9 64-bit */
                          +#define EM_IA_64           50     /* HP/Intel IA-64 */
                          +#define EM_X86_64          62     /* AMD x86-64 */
                          +#define EM_S390            22     /* IBM S/390 */
                          +#define EM_CRIS            76     /* Axis Communications 32-bit embedded processor */
                          +#define EM_V850            87     /* NEC v850 */
                          +#define EM_M32R            88     /* Renesas M32R */
                          +#define EM_H8_300          46
                          +#define EM_ALPHA           0x9026
                          +#define EM_CYGNUS_V850     0x9080
                          +#define EM_CYGNUS_M32R     0x9041
                          +#define EM_S390_OLD        0xa390
                          +#define EM_FRV             0x5441
                          +
                          +/* Values for Elf32_Ehdr::e_version */
                          +
                          +#define EV_NONE            0      /* Invalid version */
                          +#define EV_CURRENT         1      /* The current version */
                          +
                          +/* Ehe ELF identifier */
                          +
                          +#define EI_MAG0            0      /* File identification */
                          +#define EI_MAG1            1      /* "  " "            " */
                          +#define EI_MAG2            2      /* "  " "            " */
                          +#define EI_MAG3            3      /* "  " "            " */
                          +#define EI_CLASS           4      /* File class */
                          +#define EI_DATA            5      /* Data encoding */
                          +#define EI_VERSION         6      /* File version */
                          +#define EI_PAD             7      /* Start of padding bytes */
                          +#define EI_NIDENT          16     /* Size of eident[] */
                          +
                          +#define EI_MAGIC_SIZE      4
                          +#define EI_MAGIC           {0x7f, 'E', 'L', 'F'}
                          +
                          +/* Values for EI_CLASS */
                          +
                          +#define ELFCLASSNONE       0      /* Invalid class */
                          +#define ELFCLASS32         1      /* 32-bit objects */
                          +#define ELFCLASS64         2      /* 64-bit objects */
                          +
                          +/* Values for EI_DATA */
                          +
                          +#define ELFDATANONE        0     /* Invalid data encoding */
                          +#define ELFDATA2LSB        1     /* Least significant byte occupying the lowest address */
                          +#define ELFDATA2MSB        2     /* Most significant byte occupying the lowest address */
                          +
                          +/* Figure 4-7: Special Section Indexes */
                          +
                          +#define SHN_UNDEF          0
                          +#define SHN_LORESERVE      0xff00
                          +#define SHN_LOPROC         0xff00
                          +#define SHN_HIPROC         0xff1f
                          +#define SHN_ABS            0xfff1
                          +#define SHN_COMMON         0xfff2
                          +#define SHN_HIRESERVE      0xffff
                          +
                          +/* Figure 4-9: Section Types, sh_type */
                          +
                          +#define SHT_NULL           0
                          +#define SHT_PROGBITS       1
                          +#define SHT_SYMTAB         2
                          +#define SHT_STRTAB         3
                          +#define SHT_RELA           4
                          +#define SHT_HASH           5
                          +#define SHT_DYNAMIC        6
                          +#define SHT_NOTE           7
                          +#define SHT_NOBITS         8
                          +#define SHT_REL            9
                          +#define SHT_SHLIB          10
                          +#define SHT_DYNSYM         11
                          +#define SHT_LOPROC         0x70000000
                          +#define SHT_HIPROC         0x7fffffff
                          +#define SHT_LOUSER         0x80000000
                          +#define SHT_HIUSER         0xffffffff
                          +
                          +/* Figure 4-11: Section Attribute Flags, sh_flags */
                          +
                          +#define SHF_WRITE          1
                          +#define SHF_ALLOC          2
                          +#define SHF_EXECINSTR      4
                          +#define SHF_MASKPROC       0xf0000000
                          +
                          +/* Definitions for Elf32_Sym::st_info */
                          +
                          +#define ELF32_ST_BIND(i)   ((i) >> 4)
                          +#define ELF32_ST_TYPE(i)   ((i) & 0xf)
                          +#define ELF32_ST_INFO(b,t) (((b) << 4) | ((t) & 0xf))
                          +
                          +/* Figure 4-16: Symbol Binding, ELF32_ST_BIND */
                          +
                          +#define STB_LOCAL          0
                          +#define STB_GLOBAL         1
                          +#define STB_WEAK           2
                          +#define STB_LOPROC         13
                          +#define STB_HIPROC         15
                          +
                          +/* Figure 4-17: Symbol Types, ELF32_ST_TYPE */
                          +
                          +#define STT_NOTYPE         0
                          +#define STT_OBJECT         1
                          +#define STT_FUNC           2
                          +#define STT_SECTION        3
                          +#define STT_FILE           4
                          +#define STT_LOPROC         13
                          +#define STT_HIPROC         15
                          +
                          +/* Definitions for Elf32_Rel*::r_info */
                          +
                          +#define ELF32_R_SYM(i)    ((i) >> 8)
                          +#define ELF32_R_TYPE(i)   ((i) & 0xff)
                          +#define ELF32_R_INFO(s,t) (((s)<< 8) | ((t) & 0xff))
                          +
                          +/* Figure 5-2: Segment Types, p_type */
                          +
                          +#define PT_NULL            0
                          +#define PT_LOAD            1
                          +#define PT_DYNAMIC         2
                          +#define PT_INTERP          3
                          +#define PT_NOTE            4
                          +#define PT_SHLIB           5
                          +#define PT_PHDR            6
                          +#define PT_LOPROC          0x70000000
                          +#define PT_HIPROC          0x7fffffff
                          +
                          +/* Figure 5-3: Segment Flag Bits, p_flags */
                          +
                          +#define PF_X               1          /* Execute */
                          +#define PF_W               2          /* Write */
                          +#define PF_R               4          /* Read */
                          +#define PF_MASKPROC        0xf0000000 /* Unspecified */
                          +
                          +/* Figure 5-10: Dynamic Array Tags, d_tag */
                          +
                          +#define DT_NULL            0          /* d_un=ignored */
                          +#define DT_NEEDED          1          /* d_un=d_val */
                          +#define DT_PLTRELSZ        2          /* d_un=d_val */
                          +#define DT_PLTGOT          3          /* d_un=d_ptr */
                          +#define DT_HASH            4          /* d_un=d_ptr */
                          +#define DT_STRTAB          5          /* d_un=d_ptr */
                          +#define DT_SYMTAB          6          /* d_un=d_ptr */
                          +#define DT_RELA            7          /* d_un=d_ptr */
                          +#define DT_RELASZ          8          /* d_un=d_val */
                          +#define DT_RELAENT         9          /* d_un=d_val */
                          +#define DT_STRSZ           10         /* d_un=d_val */
                          +#define DT_SYMENT          11         /* d_un=d_val */
                          +#define DT_INIT            12         /* d_un=d_ptr */
                          +#define DT_FINI            13         /* d_un=d_ptr */
                          +#define DT_SONAME          14         /* d_un=d_val */
                          +#define DT_RPATH           15         /* d_un=d_val */
                          +#define DT_SYMBOLIC        16         /* d_un=ignored */
                          +#define DT_REL             17         /* d_un=d_ptr */
                          +#define DT_RELSZ           18         /* d_un=d_val */
                          +#define DT_RELENT          19         /* d_un=d_val */
                          +#define DT_PLTREL          20         /* d_un=d_val */
                          +#define DT_DEBUG           21         /* d_un=d_ptr */
                          +#define DT_TEXTREL         22         /* d_un=ignored */
                          +#define DT_JMPREL          23         /* d_un=d_ptr */
                          +#define DT_BINDNOW         24         /* d_un=ignored */
                          +#define DT_LOPROC          0x70000000 /* d_un=unspecified */
                          +#define DT_HIPROC          0x7fffffff /* d_un= unspecified */
                          +
                          +/****************************************************************************
                          + * Public Type Definitions
                          + ****************************************************************************/
                          +
                          +/* Figure 4.2: 32-Bit Data Types */
                          +
                          +typedef uint32_t  Elf32_Addr;  /* Unsigned program address */
                          +typedef uint16_t  Elf32_Half;  /* Unsigned medium integer */
                          +typedef uint32_t  Elf32_Off;   /* Unsigned file offset */
                          +typedef int32_t   Elf32_Sword; /* Signed large integer */
                          +typedef uint32_t  Elf32_Word;  /* Unsigned large integer */
                          +
                          +/* Figure 4-3: ELF Header */
                          +
                          +typedef struct
                          +{
                          +  unsigned char e_ident[EI_NIDENT];
                          +  Elf32_Half    e_type;
                          +  Elf32_Half    e_machine;
                          +  Elf32_Word    e_version;
                          +  Elf32_Addr    e_entry;
                          +  Elf32_Off     e_phoff;
                          +  Elf32_Off     e_shoff;
                          +  Elf32_Word    e_flags;
                          +  Elf32_Half    e_ehsize;
                          +  Elf32_Half    e_phentsize;
                          +  Elf32_Half    e_phnum;
                          +  Elf32_Half    e_shentsize;
                          +  Elf32_Half    e_shnum;
                          +  Elf32_Half    e_shstrndx;
                          +} Elf32_Ehdr;
                          +
                          +/* Figure 4-8: Section Header */
                          +
                          +typedef struct
                          +{
                          +  Elf32_Word    sh_name;
                          +  Elf32_Word    sh_type;
                          +  Elf32_Word    sh_flags;
                          +  Elf32_Addr    sh_addr;
                          +  Elf32_Off     sh_offset;
                          +  Elf32_Word    sh_size;
                          +  Elf32_Word    sh_link;
                          +  Elf32_Word    sh_info;
                          +  Elf32_Word    sh_addralign;
                          +  Elf32_Word    sh_entsize;
                          +} Elf32_Shdr;
                          +
                          +/* Figure 4-15: Symbol Table Entry */
                          +
                          +typedef struct
                          +{
                          +  Elf32_Word    st_name;
                          +  Elf32_Addr    st_value;
                          +  Elf32_Word    st_size;
                          +  unsigned char st_info;
                          +  unsigned char st_other;
                          +  Elf32_Half    st_shndx;
                          +} Elf32_Sym;
                          +
                          +/* Figure 4-19: Relocation Entries */
                          +
                          +typedef struct
                          +{
                          +  Elf32_Addr   r_offset;
                          +  Elf32_Word   r_info;
                          +} Elf32_Rel;
                          +
                          +typedef struct
                          +{
                          +  Elf32_Addr   r_offset;
                          +  Elf32_Word   r_info;
                          +  Elf32_Sword  r_addend;
                          +} Elf32_Rela;
                          +
                          +/* Figure 5-1: Program Header */
                          +
                          +typedef struct
                          +{
                          +  Elf32_Word   p_type;
                          +  Elf32_Off    p_offset;
                          +  Elf32_Addr   p_vaddr;
                          +  Elf32_Addr   p_paddr;
                          +  Elf32_Word   p_filesz;
                          +  Elf32_Word   p_memsz;
                          +  Elf32_Word   p_flags;
                          +  Elf32_Word   p_align;
                          +} Elf32_Phdr;
                          +
                          +/* Figure 5-9: Dynamic Structure */
                          +
                          +typedef struct
                          +{
                          +  Elf32_Sword  d_tag;
                          +  union
                          +  {
                          +    Elf32_Word d_val;
                          +    Elf32_Addr d_ptr;
                          +  } d_un;
                          +} Elf32_Dyn;
                          +
                          +//extern Elf32_Dyn _DYNAMIC[] ;
                          +
                          +#endif /* __INCLUDE_ELF32_H */
                          diff --git a/nuttx/include/net/if.h b/nuttx/include/net/if.h
                          index e64b58563f..1ff8ebc383 100644
                          --- a/nuttx/include/net/if.h
                          +++ b/nuttx/include/net/if.h
                          @@ -52,6 +52,10 @@
                           #define IF_NAMESIZE     6   /* Newer naming standard */
                           #define IFHWADDRLEN     6
                           
                          +#define IFF_RUNNING     (1 << 0)
                          +#define IF_FLAG_IFUP    (1 << 0)
                          +#define IF_FLAG_IFDOWN  (2 << 0)
                          +
                           /*******************************************************************************************
                            * Public Type Definitions
                            *******************************************************************************************/
                          @@ -72,6 +76,7 @@ struct lifreq
                               struct sockaddr         lifru_hwaddr;             /* MAC address */
                               int                     lifru_count;              /* Number of devices */
                               int                     lifru_mtu;                /* MTU size */
                          +    uint8_t                 lifru_flags;              /* Interface flags */
                             } lifr_ifru;
                           };
                           
                          @@ -82,6 +87,7 @@ struct lifreq
                           #define lifr_hwaddr         lifr_ifru.lifru_hwaddr    /* MAC address */
                           #define lifr_mtu            lifr_ifru.lifru_mtu       /* MTU */
                           #define lifr_count          lifr_ifru.lifru_count     /* Number of devices */
                          +#define lifr_flags          lifr_ifru.lifru_flags     /* interface flags */
                           
                           /* This is the older I/F request that should only be used with IPv4.  However, since
                            * NuttX only supports IPv4 or 6 (not both), we can force the older structure to
                          @@ -101,6 +107,7 @@ struct ifreq
                               struct sockaddr         ifru_hwaddr;              /* MAC address */
                               int                     ifru_count;               /* Number of devices */
                               int                     ifru_mtu;                 /* MTU size */
                          +    uint8_t                 ifru_flags;               /* Interface flags */
                             } ifr_ifru;
                           };
                           
                          @@ -111,6 +118,7 @@ struct ifreq
                           #define ifr_hwaddr          ifr_ifru.ifru_hwaddr      /* MAC address */
                           #define ifr_mtu             ifr_ifru.ifru_mtu         /* MTU */
                           #define ifr_count           ifr_ifru.ifru_count       /* Number of devices */
                          +#define ifr_flags           ifr_ifru.ifru_flags       /* interface flags */
                           
                           #else /* CONFIG_NET_IPv6 */
                           
                          @@ -123,6 +131,7 @@ struct ifreq
                           #define ifr_hwaddr          lifr_ifru.lifru_hwaddr    /* MAC address */
                           #define ifr_mtu             lifr_ifru.lifru_mtu       /* MTU */
                           #define ifr_count           lifr_ifru.lifru_count     /* Number of devices */
                          +#define ifr_flags           lifr_ifru.lifru_flags     /* interface flags */
                           
                           #endif /* CONFIG_NET_IPv6 */
                           
                          diff --git a/nuttx/include/nuttx/binfmt.h b/nuttx/include/nuttx/binfmt.h
                          deleted file mode 100644
                          index 70beda3933..0000000000
                          --- a/nuttx/include/nuttx/binfmt.h
                          +++ /dev/null
                          @@ -1,209 +0,0 @@
                          -/****************************************************************************
                          - * include/nuttx/binfmt.h
                          - *
                          - *   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.
                          - *
                          - ****************************************************************************/
                          -
                          -#ifndef __INCLUDE_NUTTX_BINFMT_H
                          -#define __INCLUDE_NUTTX_BINFMT_H
                          -
                          -/****************************************************************************
                          - * Included Files
                          - ****************************************************************************/
                          -
                          -#include 
                          -#include 
                          -#include 
                          -#include 
                          -
                          -/****************************************************************************
                          - * Pre-processor Definitions
                          - ****************************************************************************/
                          -
                          -/****************************************************************************
                          - * Public Types
                          - ****************************************************************************/
                          -
                          -/* This describes the file to be loaded */
                          -
                          -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 **argv;               /* Argument list */
                          -  FAR const struct symtab_s *exports;  /* Table of exported symbols */
                          -  int nexports;                        /* The number of symbols in exports[] */
                          -
                          -  /* Information provided from the loader (if successful) describing the
                          -   * resources used by the loaded module.
                          -   */
                          -
                          -  main_t entrypt;                      /* Entry point into a program module */
                          -  FAR void *ispace;                    /* Memory-mapped, I-space (.text) address */
                          -  FAR struct dspace_s *dspace;         /* Address of the allocated .data/.bss space */
                          -  size_t isize;                        /* Size of the I-space region (needed for munmap) */
                          -  size_t stacksize;                    /* Size of the stack in bytes (unallocated) */
                          -};
                          -
                          -/* This describes one binary format handler */
                          -
                          -struct binfmt_s
                          -{
                          -  FAR struct binfmt_s *next;             /* Supports a singly-linked list */
                          -  int (*load)(FAR struct binary_s *bin); /* Verify and load binary into memory */
                          -};
                          -
                          -/****************************************************************************
                          - * Public Data
                          - ****************************************************************************/
                          -
                          -#undef EXTERN
                          -#if defined(__cplusplus)
                          -#define EXTERN extern "C"
                          -extern "C" {
                          -#else
                          -#define EXTERN extern
                          -#endif
                          -
                          -/****************************************************************************
                          - * Public Function Prototypes
                          - ****************************************************************************/
                          -
                          -/****************************************************************************
                          - * Name: register_binfmt
                          - *
                          - * Description:
                          - *   Register a loader for a binary format
                          - *
                          - * Returned Value:
                          - *   This is a NuttX internal function so it follows the convention that
                          - *   0 (OK) is returned on success and a negated errno is returned on
                          - *   failure.
                          - *
                          - ****************************************************************************/
                          -
                          -EXTERN int register_binfmt(FAR struct binfmt_s *binfmt);
                          -
                          -/****************************************************************************
                          - * Name: unregister_binfmt
                          - *
                          - * Description:
                          - *   Register a loader for a binary format
                          - *
                          - * Returned Value:
                          - *   This is a NuttX internal function so it follows the convention that
                          - *   0 (OK) is returned on success and a negated errno is returned on
                          - *   failure.
                          - *
                          - ****************************************************************************/
                          -
                          -EXTERN int unregister_binfmt(FAR struct binfmt_s *binfmt);
                          -
                          -/****************************************************************************
                          - * Name: load_module
                          - *
                          - * Description:
                          - *   Load a module into memory, bind it to an exported symbol take, and
                          - *   prep the module for execution.
                          - *
                          - * 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.
                          - *
                          - ****************************************************************************/
                          -
                          -EXTERN int load_module(FAR struct binary_s *bin);
                          -
                          -/****************************************************************************
                          - * Name: unload_module
                          - *
                          - * Description:
                          - *   Unload a (non-executing) module from memory.  If the module has
                          - *   been started (via exec_module), calling this will be fatal.
                          - *
                          - * Returned Value:
                          - *   This is a NuttX internal function so it follows the convention that
                          - *   0 (OK) is returned on success and a negated errno is returned on
                          - *   failure.
                          - *
                          - ****************************************************************************/
                          -
                          -EXTERN int unload_module(FAR const struct binary_s *bin);
                          -
                          -/****************************************************************************
                          - * Name: exec_module
                          - *
                          - * Description:
                          - *   Execute a module that has been loaded into memory by load_module().
                          - *
                          - * Returned Value:
                          - *   This is an end-user function, so it follows the normal convention:
                          - *   Returns the PID of the exec'ed module.  On failure, it.returns
                          - *   -1 (ERROR) and sets errno appropriately.
                          - *
                          - ****************************************************************************/
                          -
                          -EXTERN int exec_module(FAR const struct binary_s *bin, int priority);
                          -
                          -/****************************************************************************
                          - * Name: exec
                          - *
                          - * Description:
                          - *   This is a convenience function that wraps load_ and exec_module into
                          - *   one call.
                          - *
                          - * Input Parameter:
                          - *   filename - Fulll path to the binary to be loaded
                          - *   argv     - Argument list
                          - *   exports  - Table of exported symbols
                          - *   nexports - The number of symbols in exports
                          - *
                          - * Returned Value:
                          - *   This is an end-user function, so it follows the normal convention:
                          - *   Returns the PID of the exec'ed module.  On failure, it.returns
                          - *   -1 (ERROR) and sets errno appropriately.
                          - *
                          - ****************************************************************************/
                          -
                          -EXTERN int exec(FAR const char *filename, FAR const char **argv,
                          -                FAR const struct symtab_s *exports, int nexports);
                          -
                          -#undef EXTERN
                          -#if defined(__cplusplus)
                          -}
                          -#endif
                          -
                          -#endif /* __INCLUDE_NUTTX_BINFMT_H */
                          -
                          diff --git a/nuttx/include/nuttx/symtab.h b/nuttx/include/nuttx/binfmt/symtab.h
                          similarity index 96%
                          rename from nuttx/include/nuttx/symtab.h
                          rename to nuttx/include/nuttx/binfmt/symtab.h
                          index b302ab20a9..346c6099fd 100644
                          --- a/nuttx/include/nuttx/symtab.h
                          +++ b/nuttx/include/nuttx/binfmt/symtab.h
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * include/nuttx/symtab.h
                          + * include/nuttx/binfmt/symtab.h
                            *
                            *   Copyright (C) 2009 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          @@ -33,8 +33,8 @@
                            *
                            ****************************************************************************/
                           
                          -#ifndef __INCLUDE_NUTTX_SYMTAB_H
                          -#define __INCLUDE_NUTTX_SYMTAB_H
                          +#ifndef __INCLUDE_NUTTX_BINFMT_SYMTAB_H
                          +#define __INCLUDE_NUTTX_BINFMT_SYMTAB_H
                           
                           /****************************************************************************
                            * Included Files
                          @@ -54,7 +54,7 @@
                            * is a fixed size array of struct symtab_s.  The information is intentionally
                            * minimal and supports only:
                            *
                          - * 1. Function points as sym_values.  Of other kinds of values need to be
                          + * 1. Function pointers as sym_values.  Of other kinds of values need to be
                            *    supported, then typing information would also need to be included in
                            *    the structure.
                            *
                          @@ -159,5 +159,5 @@ symtab_findorderedbyvalue(FAR const struct symtab_s *symtab,
                           }
                           #endif
                           
                          -#endif /* __INCLUDE_NUTTX_SYMTAB_H */
                          +#endif /* __INCLUDE_NUTTX_BINFMT_SYMTAB_H */
                           
                          diff --git a/nuttx/include/nuttx/compiler.h b/nuttx/include/nuttx/compiler.h
                          index d8f79fe9e5..6ad51ad0fb 100644
                          --- a/nuttx/include/nuttx/compiler.h
                          +++ b/nuttx/include/nuttx/compiler.h
                          @@ -87,11 +87,16 @@
                           
                           # define packed_struct __attribute__ ((packed))
                           
                          -/* GCC does not support the reentrant or naked attributes */
                          +/* GCC does not support the reentrant attribute */
                           
                           # define reentrant_function
                          -# define naked_function
                           
                          +/* The naked attribute informs GCC that the programmer will take care of
                          + * the function prolog and epilog.
                          + */
                          +
                          +# define naked_function __attribute__ ((naked,no_instrument_function))
                          + 
                           /* The inline_function attribute informs GCC that the function should always
                            * be inlined, regardless of the level of optimization.  The noinline_function
                            * indicates that the function should never be inlined.
                          @@ -191,8 +196,10 @@
                           
                           /* GCC supports both types double and long long */
                           
                          -# define CONFIG_HAVE_DOUBLE 1
                           # define CONFIG_HAVE_LONG_LONG 1
                          +# define CONFIG_HAVE_FLOAT 1
                          +# define CONFIG_HAVE_DOUBLE 1
                          +# define CONFIG_HAVE_LONG_DOUBLE 1
                           
                           /* Structures and unions can be assigned and passed as values */
                           
                          @@ -295,7 +302,9 @@
                           /* SDCC does not support type long long or type double */
                           
                           # undef  CONFIG_HAVE_LONG_LONG
                          +# define CONFIG_HAVE_FLOAT 1
                           # undef  CONFIG_HAVE_DOUBLE
                          +# undef  CONFIG_HAVE_LONG_DOUBLE
                           
                           /* Structures and unions cannot be passed as values or used
                            * in assignments.
                          @@ -398,8 +407,10 @@
                            * simply do not support long long or double.
                            */
                           
                          -# undef  CONFIG_HAVE_DOUBLE
                           # undef  CONFIG_HAVE_LONG_LONG
                          +# define CONFIG_HAVE_FLOAT 1
                          +# undef  CONFIG_HAVE_DOUBLE
                          +# undef  CONFIG_HAVE_LONG_DOUBLE
                           
                           /* Structures and unions can be assigned and passed as values */
                           
                          @@ -433,9 +444,11 @@
                           # undef  CONFIG_LONG_IS_NOT_INT
                           # undef  CONFIG_PTR_IS_NOT_INT
                           # undef  CONFIG_HAVE_INLINE
                          -# define inline
                          +# define inline 1
                           # undef  CONFIG_HAVE_LONG_LONG
                          +# define CONFIG_HAVE_FLOAT 1
                           # undef  CONFIG_HAVE_DOUBLE
                          +# undef  CONFIG_HAVE_LONG_DOUBLE
                           # undef  CONFIG_CAN_PASS_STRUCTS
                           
                           #endif
                          diff --git a/nuttx/include/nuttx/float.h b/nuttx/include/nuttx/float.h
                          new file mode 100644
                          index 0000000000..a8e4aa28b5
                          --- /dev/null
                          +++ b/nuttx/include/nuttx/float.h
                          @@ -0,0 +1,225 @@
                          +/****************************************************************************
                          + * include/nuttx/float.h
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Author: Gregory Nutt 
                          + *
                          + * Reference: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/float.h.html
                          + *
                          + * 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_FLOAT_H
                          +#define __INCLUDE_NUTTX_FLOAT_H
                          +
                          +/* TODO:  These values could vary with architectures toolchains.  This
                          + * logic should be move at least to the include/arch directory.
                          + */
                          +
                          +/****************************************************************************
                          + * Included Files
                          + ****************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +/****************************************************************************
                          + * Pre-processor Definitions
                          + ****************************************************************************/
                          +
                          +/* Radix of exponent representation, b. */
                          +
                          +#define FLT_RADIX 2
                          +
                          +/* Number of base-FLT_RADIX digits in the floating-point significand, p. */
                          +
                          +#define FLT_MANT_DIG 24
                          +
                          +#if CONFIG_HAVE_DOUBLE
                          +#  define DBL_MANT_DIG 53
                          +#else
                          +#  define DBL_MANT_DIG FLT_MANT_DIG
                          +#endif
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +#  define LDBL_MANT_DIG DBL_MANT_DIG /* FIX ME */
                          +#else
                          +#  define LDBL_MANT_DIG DBL_MANT_DIG
                          +#endif
                          +
                          +/* Number of decimal digits, n, such that any floating-point number in the
                          + * widest supported floating type with pmax radix b digits can be rounded
                          + * to a floating-point number with n decimal digits and back again without
                          + * change to the value.
                          + */
                          +
                          +#define DECIMAL_DIG 10
                          +
                          +/* Number of decimal digits, q, such that any floating-point number with q
                          + * decimal digits can be rounded into a floating-point number with p radix
                          + * b digits and back again without change to the q decimal digits.
                          + */
                          +
                          +#define FLT_DIG 6
                          +
                          +#if CONFIG_HAVE_DOUBLE
                          +#  define DBL_DIG 15  /* 10 */
                          +#else
                          +#  define DBL_DIG FLT_DIG
                          +#endif
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +#  define LDBL_DIG DBL_DIG  /* FIX ME */
                          +#else
                          +#  define LDBL_DIG DBL_DIG
                          +#endif
                          +
                          +/* Minimum negative integer such that FLT_RADIX raised to that power minus
                          + * 1 is a normalized floating-point number, emin.
                          + */
                          +
                          +#define FLT_MIN_EXP (-125)
                          +
                          +#if CONFIG_HAVE_DOUBLE
                          +#  define DBL_MIN_EXP (-1021)
                          +#else
                          +#  define DBL_MIN_EXP FLT_MIN_EXP
                          +#endif
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +#  define LDBL_MIN_EXP DBL_MIN_EXP /* FIX ME */
                          +#else
                          +#  define LDBL_MIN_EXP DBL_MIN_EXP
                          +#endif
                          +
                          +/* inimum negative integer such that 10 raised to that power is in the range
                          + * of normalized floating-point numbers.
                          + */
                          +
                          +#define FLT_MIN_10_EXP (-37)
                          +
                          +#if CONFIG_HAVE_DOUBLE
                          +#  define DBL_MIN_10_EXP (-307)  /* -37 */
                          +#else
                          +#  define DBL_MIN_10_EXP FLT_MIN_10_EXP
                          +#endif
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +#  define LDBL_MIN_10_EXP DBL_MIN_10_EXP  /* FIX ME */
                          +#else
                          +#  define LDBL_MIN_10_EXP DBL_MIN_10_EXP
                          +#endif
                          +
                          +/* Maximum integer such that FLT_RADIX raised to that power minus 1 is a
                          + * representable finite floating-point number, emax.
                          + */
                          +
                          +#define FLT_MAX_EXP 128
                          +
                          +#if CONFIG_HAVE_DOUBLE
                          +#  define DBL_MAX_EXP 1024
                          +#else
                          +#  define DBL_MAX_EXP FLT_MAX_EXP
                          +#endif
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +#  define LDBL_MAX_EXP DBL_MAX_EXP /* FIX ME */
                          +#else
                          +#  define LDBL_MAX_EXP DBL_MAX_EXP
                          +#endif
                          +
                          +/* Maximum integer such that 10 raised to that power is in the range of
                          + * representable finite floating-point numbers.
                          + */
                          +
                          +#define FLT_MAX_10_EXP 38  /* 37 */
                          +
                          +#if CONFIG_HAVE_DOUBLE
                          +#  define DBL_MAX_10_EXP 308  /* 37 */
                          +#else
                          +#  define DBL_MAX_10_EXP FLT_MAX_10_EXP
                          +#endif
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +#  define LDBL_MAX_10_EXP DBL_MAX_10_EXP  /* FIX ME */
                          +#else
                          +#  define LDBL_MAX_10_EXP DBL_MAX_10_EXP
                          +#endif
                          +
                          +/* Maximum representable finite floating-point number. */
                          +
                          +#define FLT_MAX 3.40282347e+38F  /* 1E+37 */
                          +
                          +#if CONFIG_HAVE_DOUBLE
                          +#  define DBL_MAX 1.7976931348623157e+308  /* 1E+37 */
                          +#else
                          +#  define DBL_MAX FLT_MAX
                          +#endif
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +#  define LDBL_MAX DBL_MAX  /* FIX ME */
                          +#else
                          +#  define LDBL_MAX DBL_MAX
                          +#endif
                          +
                          +/* The difference between 1 and the least value greater than 1 that is
                          + * representable in the given floating-point type, b1-p.
                          + */
                          +
                          +#define FLT_EPSILON 1.1920929e-07F  /* 1E-5 */
                          +
                          +#if CONFIG_HAVE_DOUBLE
                          +#  define DBL_EPSILON 2.2204460492503131e-16  /* 1E-9 */
                          +#else
                          +#  define DBL_EPSILON FLT_EPSILON
                          +#endif
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +#  define LDBL_EPSILON DBL_EPSILON /* FIX ME */
                          +#else
                          +#  define LDBL_EPSILON DBL_EPSILON
                          +#endif
                          +
                          +/* Minimum normalized positive floating-point number, bemin -1. */
                          +
                          +#define FLT_MIN 1.17549435e-38F  /* 1E-37 */
                          +
                          +#if CONFIG_HAVE_DOUBLE
                          +#define DBL_MIN 2.2250738585072014e-308  /* 1E-37 */
                          +#else
                          +#  define DBL_MIN FLT_MIN
                          +#endif
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +#  define LDBL_MIN DBL_MIN /* FIX ME */
                          +#else
                          +#  define LDBL_MIN DBL_MIN
                          +#endif
                          +
                          +#endif /* __INCLUDE_NUTTX_FLOAT_H */
                          diff --git a/nuttx/include/nuttx/fs/fs.h b/nuttx/include/nuttx/fs/fs.h
                          index 79090a8daa..1759310bc2 100644
                          --- a/nuttx/include/nuttx/fs/fs.h
                          +++ b/nuttx/include/nuttx/fs/fs.h
                          @@ -51,6 +51,10 @@
                           /****************************************************************************
                            * Definitions
                            ****************************************************************************/
                          +/* Stream flags for the fs_flags field of in struct file_struct */
                          +
                          +#define __FS_FLAG_EOF   (1 << 0) /* EOF detected by a read operation */
                          +#define __FS_FLAG_ERROR (1 << 1) /* Error detected by any operation */
                           
                           /****************************************************************************
                            * Type Definitions
                          @@ -270,11 +274,6 @@ struct filelist
                           struct file_struct
                           {
                             int                fs_filedes;   /* File descriptor associated with stream */
                          -  uint16_t           fs_oflags;    /* Open mode flags */
                          -#if CONFIG_NUNGET_CHARS > 0
                          -  uint8_t            fs_nungotten; /* The number of characters buffered for ungetc */
                          -  unsigned char      fs_ungotten[CONFIG_NUNGET_CHARS];
                          -#endif
                           #if CONFIG_STDIO_BUFFER_SIZE > 0
                             sem_t              fs_sem;       /* For thread safety */
                             pid_t              fs_holder;    /* Holder of sem */
                          @@ -283,6 +282,12 @@ struct file_struct
                             FAR unsigned char *fs_bufend;    /* Pointer to 1 past end of buffer */
                             FAR unsigned char *fs_bufpos;    /* Current position in buffer */
                             FAR unsigned char *fs_bufread;   /* Pointer to 1 past last buffered read char. */
                          +#endif
                          +  uint16_t           fs_oflags;    /* Open mode flags */
                          +  uint8_t            fs_flags;     /* Stream flags */
                          +#if CONFIG_NUNGET_CHARS > 0
                          +  uint8_t            fs_nungotten; /* The number of characters buffered for ungetc */
                          +  unsigned char      fs_ungotten[CONFIG_NUNGET_CHARS];
                           #endif
                           };
                           
                          diff --git a/nuttx/include/nuttx/i2c.h b/nuttx/include/nuttx/i2c.h
                          index ef3d9a3883..23356ecd30 100644
                          --- a/nuttx/include/nuttx/i2c.h
                          +++ b/nuttx/include/nuttx/i2c.h
                          @@ -1,7 +1,7 @@
                           /****************************************************************************
                            * include/nuttx/i2c.h
                            *
                          - *   Copyright(C) 2009-2011 Gregory Nutt. All rights reserved.
                          + *   Copyright(C) 2009-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                            *
                            * Redistribution and use in source and binary forms, with or without
                          @@ -47,6 +47,16 @@
                           /****************************************************************************
                            * Pre-processor Definitions
                            ****************************************************************************/
                          +/* If a dynamic timeout is selected, then a non-negative, non-zero micro-
                          + * seconds per byte vale must be provided as well.
                          + */
                          +
                          +#ifdef CONFIG_STM32_I2C_DYNTIMEO
                          +#  if CONFIG_STM32_I2C_DYNTIMEO_USECPERBYTE < 1
                          +#    warning "Ignoring CONFIG_STM32_I2C_DYNTIMEO because of CONFIG_STM32_I2C_DYNTIMEO_USECPERBYTE"
                          +#    undef CONFIG_STM32_I2C_DYNTIMEO
                          +#  endif
                          +#endif
                           
                           /* I2C address calculation.  Convert 7- and 10-bit address to 8-bit and
                            * 16-bit read/write address
                          @@ -323,24 +333,19 @@ EXTERN FAR struct i2c_dev_s *up_i2cinitialize(int port);
                            *
                            ****************************************************************************/
                           
                          -EXTERN int up_i2cuninitialize(FAR struct i2c_dev_s * dev);
                          +EXTERN int up_i2cuninitialize(FAR struct i2c_dev_s *dev);
                           
                          -/****************************************************************************
                          +/************************************************************************************
                            * Name: up_i2creset
                            *
                            * Description:
                          - *   Reset the port and the associated I2C bus.  Useful when the bus or an
                          - *   attached slave has become wedged or unresponsive.
                          + *   Reset an I2C bus
                            *
                          - * Input Parameter:
                          - *   Device structure as returned by the up_i2cinitalize()
                          - *
                          - * Returned Value:
                          - *   OK on success, ERROR if the bus cannot be unwedged. 
                          - *
                          - ****************************************************************************/
                          + ************************************************************************************/
                           
                          -EXTERN int up_i2creset(FAR struct i2c_dev_s * dev);
                          +#ifdef CONFIG_I2C_RESET
                          +EXTERN int up_i2creset(FAR struct i2c_dev_s *dev);
                          +#endif
                           
                           #undef EXTERN
                           #if defined(__cplusplus)
                          diff --git a/nuttx/include/nuttx/input/max11802.h b/nuttx/include/nuttx/input/max11802.h
                          new file mode 100644
                          index 0000000000..3d03bdd115
                          --- /dev/null
                          +++ b/nuttx/include/nuttx/input/max11802.h
                          @@ -0,0 +1,175 @@
                          +/****************************************************************************
                          + * include/nuttx/input/max11802.h
                          + *
                          + *   Copyright (C) 2011 Gregory Nutt. All rights reserved.
                          + *   Authors: Gregory Nutt 
                          + *            Petteri Aimonen 
                          + *
                          + * References:
                          + *   "Low-Power, Ultra-Small Resistive Touch-Screen Controllers
                          + *    with I2C/SPI Interface" Maxim IC, Rev 3, 10/2010
                          + *
                          + * 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_MAX11802_H
                          +#define __INCLUDE_NUTTX_INPUT_MAX11802_H
                          +
                          +/****************************************************************************
                          + * Included Files
                          + ****************************************************************************/
                          +
                          +#include 
                          +#include 
                          +#include 
                          +#include 
                          +
                          +#if defined(CONFIG_INPUT) && defined(CONFIG_INPUT_MAX11802)
                          +
                          +/****************************************************************************
                          + * Pre-Processor Definitions
                          + ****************************************************************************/
                          +/* Configuration ************************************************************/
                          +/* SPI Frequency.  Default:  100KHz */
                          +
                          +#ifndef CONFIG_MAX11802_FREQUENCY
                          +#  define CONFIG_MAX11802_FREQUENCY 100000
                          +#endif
                          +
                          +/* Maximum number of threads than can be waiting for POLL events */
                          +
                          +#ifndef CONFIG_MAX11802_NPOLLWAITERS
                          +#  define CONFIG_MAX11802_NPOLLWAITERS 2
                          +#endif
                          +
                          +#ifndef CONFIG_MAX11802_SPIMODE
                          +#  define CONFIG_MAX11802_SPIMODE SPIDEV_MODE0
                          +#endif
                          +
                          +/* Thresholds */
                          +
                          +#ifndef CONFIG_MAX11802_THRESHX
                          +#  define CONFIG_MAX11802_THRESHX 12
                          +#endif
                          +
                          +#ifndef CONFIG_MAX11802_THRESHY
                          +#  define CONFIG_MAX11802_THRESHY 12
                          +#endif
                          +
                          +/* Check for some required settings.  This can save the user a lot of time
                          + * in getting the right configuration.
                          + */
                          +
                          +#ifdef CONFIG_DISABLE_SIGNALS
                          +#  error "Signals are required.  CONFIG_DISABLE_SIGNALS must not be selected."
                          +#endif
                          +
                          +#ifndef CONFIG_SCHED_WORKQUEUE
                          +#  error "Work queue support required.  CONFIG_SCHED_WORKQUEUE must be selected."
                          +#endif
                          +
                          +/****************************************************************************
                          + * Public Types
                          + ****************************************************************************/
                          +
                          +/* A reference to a structure of this type must be passed to the MAX11802
                          + * driver.  This structure provides information about the configuration
                          + * of the MAX11802 and provides some board-specific hooks.
                          + *
                          + * Memory for this structure is provided by the caller.  It is not copied
                          + * by the driver and is presumed to persist while the driver is active. The
                          + * memory must be writable because, under certain circumstances, the driver
                          + * may modify frequency or X plate resistance values.
                          + */
                          +
                          +struct max11802_config_s
                          +{
                          +  /* Device characterization */
                          +
                          +  uint32_t frequency;  /* SPI frequency */
                          +
                          +  /* IRQ/GPIO access callbacks.  These operations all hidden behind
                          +   * callbacks to isolate the MAX11802 driver from differences in GPIO
                          +   * interrupt handling by varying boards and MCUs.  If possible,
                          +   * interrupts should be configured on both rising and falling edges
                          +   * so that contact and loss-of-contact events can be detected.
                          +   *
                          +   * attach  - Attach the MAX11802 interrupt handler to the GPIO interrupt
                          +   * enable  - Enable or disable the GPIO interrupt
                          +   * clear   - Acknowledge/clear any pending GPIO interrupt
                          +   * pendown - Return the state of the pen down GPIO input
                          +   */
                          +
                          +  int  (*attach)(FAR struct max11802_config_s *state, xcpt_t isr);
                          +  void (*enable)(FAR struct max11802_config_s *state, bool enable);
                          +  void (*clear)(FAR struct max11802_config_s *state);
                          +  bool (*pendown)(FAR struct max11802_config_s *state);
                          +};
                          +
                          +/****************************************************************************
                          + * Public Function Prototypes
                          + ****************************************************************************/
                          +
                          +#ifdef __cplusplus
                          +#define EXTERN extern "C"
                          +extern "C" {
                          +#else
                          +#define EXTERN extern
                          +#endif
                          +
                          +/****************************************************************************
                          + * Name: max11802_register
                          + *
                          + * Description:
                          + *   Configure the MAX11802 to use the provided SPI device instance.  This
                          + *   will register the driver as /dev/inputN where N is the minor device
                          + *   number
                          + *
                          + * Input Parameters:
                          + *   spi     - An SPI driver instance
                          + *   config  - Persistent board configuration data
                          + *   minor   - The input device minor number
                          + *
                          + * Returned Value:
                          + *   Zero is returned on success.  Otherwise, a negated errno value is
                          + *   returned to indicate the nature of the failure.
                          + *
                          + ****************************************************************************/
                          +
                          +EXTERN  int max11802_register(FAR struct spi_dev_s *spi,
                          +                             FAR struct max11802_config_s *config,
                          +                             int minor);
                          +
                          +#undef EXTERN
                          +#ifdef __cplusplus
                          +}
                          +#endif
                          +
                          +#endif /* CONFIG_INPUT && CONFIG_INPUT_MAX11802 */
                          +#endif /* __INCLUDE_NUTTX_INPUT_MAX11802_H */
                          diff --git a/nuttx/include/nuttx/lcd/ug-2864ambag01.h b/nuttx/include/nuttx/lcd/ug-2864ambag01.h
                          new file mode 100644
                          index 0000000000..deb5689812
                          --- /dev/null
                          +++ b/nuttx/include/nuttx/lcd/ug-2864ambag01.h
                          @@ -0,0 +1,245 @@
                          +/**************************************************************************************
                          + * include/nuttx/lcd/ug-2864ambag01.h
                          + * Driver for Univision UG-2864AMBAG01 OLED display (wih SH1101A controller) in SPI
                          + * mode
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Author: Gregory Nutt 
                          + *
                          + * References:
                          + *   1. Product Specification (Preliminary), Part Name: OEL Display Module, Part ID:
                          + *      UG-2864AMBAG01, Doc No: SASI-9015-A, Univision Technology Inc.
                          + *   2. SH1101A, 132 X 64 Dot Matrix OLED/PLED, Preliminary Segment/Common Driver with
                          + *      Controller, Sino Wealth
                          + *
                          + * 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_UG_8264AMBAG01_H
                          +#define __INCLUDE_NUTTX_UG_8264AMBAG01_H
                          +
                          +/**************************************************************************************
                          + * Included Files
                          + **************************************************************************************/
                          +
                          +#include 
                          +
                          +#include 
                          +
                          +#include 
                          +
                          +#ifdef CONFIG_LCD_UG2864AMBAG01
                          +
                          +/**************************************************************************************
                          + * Pre-processor Definitions
                          + **************************************************************************************/
                          +/* Configuration **********************************************************************/
                          +/* UG-2864AMBAG01 Configuration Settings:
                          + *
                          + * CONFIG_UG2864AMBAG01_SPIMODE - Controls the SPI mode
                          + * CONFIG_UG2864AMBAG01_FREQUENCY - Define to use a different bus frequency
                          + * CONFIG_UG2864AMBAG01_NINTERFACES - Specifies the number of physical UG-2864AMBAG01
                          + *   devices that will be supported.
                          + *
                          + * Required LCD driver settings:
                          + *
                          + * CONFIG_LCD_UG28AMBAG01 - Enable UG-2864AMBAG01 support
                          + * CONFIG_LCD_MAXCONTRAST should be 255, but any value >0 and <=255 will be accepted.
                          + * CONFIG_LCD_MAXPOWER must be 1
                          + *
                          + * Option LCD driver settings:
                          + * CONFIG_LCD_LANDSCAPE, CONFIG_LCD_PORTRAIT, CONFIG_LCD_RLANDSCAPE, and
                          + *   CONFIG_LCD_RPORTRAIT - Display orientation.
                          + *
                          + * Required SPI driver settings:
                          + * CONFIG_SPI_CMDDATA - Include support for cmd/data selection.
                          + */
                          +
                          +/* SPI Interface
                          + *
                          + * "The serial interface consists of serial clock SCL, serial data SI, A0 and
                          + *  CS . SI is shifted into an 8-bit shift register on every rising edge of
                          + *  SCL in the order of D7, D6, … and D0. A0 is sampled on every eighth clock
                          + *  and the data byte in the shift register is written to the display data RAM
                          + *  or command register in the same clock."
                          + *
                          + * MODE 3:
                          + *   Clock polarity:  High (CPOL=1)
                          + *   Clock phase:     Sample on trailing (rising edge) (CPHA 1)
                          + */
                          +
                          +#ifndef CONFIG_UG2864AMBAG01_SPIMODE
                          +#  define CONFIG_UG2864AMBAG01_SPIMODE SPIDEV_MODE3
                          +#endif
                          +
                          +/* "This module determines whether the input data is interpreted as data or
                          + * command. When A0 = “H”, the inputs at D7 - D0 are interpreted as data and be
                          + * written to display RAM. When A0 = “L”, the inputs at D7 - D0 are interpreted
                          + * as command, they will be decoded and be written to the corresponding command
                          + * registers.
                          + */
                          +
                          +#ifndef CONFIG_SPI_CMDDATA
                          +#  error "CONFIG_SPI_CMDDATA must be defined in your NuttX configuration"
                          +#endif
                          +
                          +/* CONFIG_UG2864AMBAG01_NINTERFACES determines the number of physical interfaces
                          + * that will be supported.
                          + */
                          +
                          +#ifndef CONFIG_UG2864AMBAG01_NINTERFACES
                          +#  define CONFIG_UG2864AMBAG01_NINTERFACES 1
                          +#endif
                          +
                          +/* Check contrast selection */
                          +
                          +#if !defined(CONFIG_LCD_MAXCONTRAST)
                          +#  define CONFIG_LCD_MAXCONTRAST 255
                          +#endif
                          +
                          +#if CONFIG_LCD_MAXCONTRAST <= 0|| CONFIG_LCD_MAXCONTRAST > 255
                          +#  error "CONFIG_LCD_MAXCONTRAST exceeds supported maximum"
                          +#endif
                          +
                          +#if CONFIG_LCD_MAXCONTRAST < 255
                          +#  warning "Optimal setting of CONFIG_LCD_MAXCONTRAST is 255"
                          +#endif
                          +
                          +/* Check power setting */
                          +
                          +#if !defined(CONFIG_LCD_MAXPOWER)
                          +#  define CONFIG_LCD_MAXPOWER 1
                          +#endif
                          +
                          +#if CONFIG_LCD_MAXPOWER != 1
                          +#  warning "CONFIG_LCD_MAXPOWER exceeds supported maximum"
                          +#  undef CONFIG_LCD_MAXPOWER
                          +#  define CONFIG_LCD_MAXPOWER 1
                          +#endif
                          +
                          +/* Color is 1bpp monochrome with leftmost column contained in bits 0  */
                          +
                          +#ifdef CONFIG_NX_DISABLE_1BPP
                          +#  warning "1 bit-per-pixel support needed"
                          +#endif
                          +
                          +/* Orientation */
                          +
                          +#if defined(CONFIG_LCD_LANDSCAPE)
                          +#  undef CONFIG_LCD_PORTRAIT
                          +#  undef CONFIG_LCD_RLANDSCAPE
                          +#  undef CONFIG_LCD_RPORTRAIT
                          +#elif defined(CONFIG_LCD_PORTRAIT)
                          +#  undef CONFIG_LCD_LANDSCAPE
                          +#  undef CONFIG_LCD_RLANDSCAPE
                          +#  undef CONFIG_LCD_RPORTRAIT
                          +#elif defined(CONFIG_LCD_RLANDSCAPE)
                          +#  undef CONFIG_LCD_LANDSCAPE
                          +#  undef CONFIG_LCD_PORTRAIT
                          +#  undef CONFIG_LCD_RPORTRAIT
                          +#elif defined(CONFIG_LCD_RPORTRAIT)
                          +#  undef CONFIG_LCD_LANDSCAPE
                          +#  undef CONFIG_LCD_PORTRAIT
                          +#  undef CONFIG_LCD_RLANDSCAPE
                          +#else
                          +#  define CONFIG_LCD_LANDSCAPE 1
                          +#  warning "Assuming landscape orientation"
                          +#endif
                          +
                          +/* Some important "colors" */
                          +
                          +#define UG_Y1_BLACK  0
                          +#define UG_Y1_WHITE  1
                          +
                          +/**************************************************************************************
                          + * Public Types
                          + **************************************************************************************/
                          +
                          +/**************************************************************************************
                          + * Public Data
                          + **************************************************************************************/
                          +
                          +#ifdef __cplusplus
                          +extern "C"
                          +{
                          +#endif
                          +
                          +/**************************************************************************************
                          + * Public Function Prototypes
                          + **************************************************************************************/
                          +
                          +/**************************************************************************************
                          + * Name:  ug2864ambag01_initialize
                          + *
                          + * Description:
                          + *   Initialize the UG-2864AMBAG01 video hardware.  The initial state of the
                          + *   OLED is fully initialized, display memory cleared, and the OLED ready
                          + *   to use, but with the power setting at 0 (full off == sleep mode).
                          + *
                          + * Input Parameters:
                          + *
                          + *   spi - A reference to the SPI driver instance.
                          + *   devno - A value in the range of 0 through CONFIG_UG2864AMBAG01_NINTERFACES-1.
                          + *     This allows support for multiple OLED devices.
                          + *
                          + * Returned Value:
                          + *
                          + *   On success, this function returns a reference to the LCD object for
                          + *   the specified OLED.  NULL is returned on any failure.
                          + *
                          + **************************************************************************************/
                          +
                          +struct lcd_dev_s; /* See include/nuttx/lcd/lcd.h */
                          +struct spi_dev_s; /* See include/nuttx/spi.h */
                          +FAR struct lcd_dev_s *ug2864ambag01_initialize(FAR struct spi_dev_s *spi,
                          +                                               unsigned int devno);
                          +
                          +/************************************************************************************************
                          + * Name:  ug2864ambag01_fill
                          + *
                          + * Description:
                          + *   This non-standard method can be used to clear the entire display by writing one
                          + *   color to the display.  This is much faster than writing a series of runs.
                          + *
                          + * Input Parameters:
                          + *   priv   - Reference to private driver structure
                          + *
                          + * Assumptions:
                          + *   Caller has selected the OLED section.
                          + *
                          + **************************************************************************************/
                          +
                          +void ug2864ambag01_fill(FAR struct lcd_dev_s *dev, uint8_t color);
                          +
                          +#ifdef __cplusplus
                          +}
                          +#endif
                          +
                          +#endif /* CONFIG_LCD_UG2864AMBAG01 */
                          +#endif /* __INCLUDE_NUTTX_UG_8264AMBAG01_H */
                          diff --git a/nuttx/include/nuttx/lcd/ug-9664hswag01.h b/nuttx/include/nuttx/lcd/ug-9664hswag01.h
                          index 696005b5d0..b470e0895e 100644
                          --- a/nuttx/include/nuttx/lcd/ug-9664hswag01.h
                          +++ b/nuttx/include/nuttx/lcd/ug-9664hswag01.h
                          @@ -3,7 +3,7 @@
                            * Driver for the Univision UG-9664HSWAG01 Display with the Solomon Systech
                            * SSD1305 LCD controller.
                            *
                          - *   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
                          @@ -58,8 +58,6 @@
                            * CONFIG_UG9664HSWAG01_POWER
                            *   If the hardware supports a controllable OLED a power supply, this
                            *   configuration shold be defined.  (See ug_power() below).
                          - * CONFIG_LCD_UGDEBUG - Enable detailed UG-9664HSWAG01 debug output
                          - *   (CONFIG_DEBUG and CONFIG_VERBOSE must also be enabled).
                            * 
                            * Required LCD driver settings:
                            * CONFIG_LCD_UG9664HSWAG01 - Enable UG-9664HSWAG01 support
                          @@ -90,10 +88,8 @@
                            ****************************************************************************/
                           
                           #ifdef __cplusplus
                          -#define EXTERN extern "C"
                          -extern "C" {
                          -#else
                          -#define EXTERN extern
                          +extern "C"
                          +{
                           #endif
                           
                           /****************************************************************************
                          @@ -123,7 +119,7 @@ extern "C" {
                           
                           struct lcd_dev_s; /* see nuttx/lcd.h */
                           struct spi_dev_s; /* see nuttx/spi.h */
                          -EXTERN FAR struct lcd_dev_s *ug_initialize(FAR struct spi_dev_s *spi, unsigned int devno);
                          +FAR struct lcd_dev_s *ug_initialize(FAR struct spi_dev_s *spi, unsigned int devno);
                           
                           /****************************************************************************
                            * Name:  ug_power
                          @@ -145,12 +141,11 @@ EXTERN FAR struct lcd_dev_s *ug_initialize(FAR struct spi_dev_s *spi, unsigned i
                            **************************************************************************************/
                           
                           #ifdef CONFIG_UG9664HSWAG01_POWER
                          -EXTERN void ug_power(unsigned int devno, bool on);
                          +void ug_power(unsigned int devno, bool on);
                           #else
                           #  define ug_power(a,b)
                           #endif
                           
                          -#undef EXTERN
                           #ifdef __cplusplus
                           }
                           #endif
                          diff --git a/nuttx/include/nuttx/net/ioctl.h b/nuttx/include/nuttx/net/ioctl.h
                          index be3f597f47..d5d1a001c8 100644
                          --- a/nuttx/include/nuttx/net/ioctl.h
                          +++ b/nuttx/include/nuttx/net/ioctl.h
                          @@ -146,9 +146,15 @@
                           
                           #define SIOCSIWPMKSA     _SIOC(0x0036) /* PMKSA cache operation */
                           
                          +/* Interface flags */
                          +
                          +#define SIOCSIFFLAGS     _SIOC(0x0037) /* Sets the interface flags */
                          +#define SIOCGIFFLAGS     _SIOC(0x0038) /* Gets the interface flags */
                          +
                           /****************************************************************************
                            * Type Definitions
                            ****************************************************************************/
                          +
                           /* See include/net/if.h */
                           
                           /****************************************************************************
                          diff --git a/nuttx/include/nuttx/net/uip/uip-arch.h b/nuttx/include/nuttx/net/uip/uip-arch.h
                          index 9546de04eb..73805c6fb1 100644
                          --- a/nuttx/include/nuttx/net/uip/uip-arch.h
                          +++ b/nuttx/include/nuttx/net/uip/uip-arch.h
                          @@ -90,6 +90,10 @@ struct uip_driver_s
                             char d_ifname[IFNAMSIZ];
                           #endif
                           
                          +  /* Drivers interface flags.  See IFF_* definitions in include/net/if.h */
                          +
                          +  uint8_t d_flags;
                          +
                             /* Ethernet device identity */
                           
                           #ifdef CONFIG_NET_ETHERNET
                          diff --git a/nuttx/include/nuttx/nxflat.h b/nuttx/include/nuttx/nxflat.h
                          deleted file mode 100644
                          index b6501522ef..0000000000
                          --- a/nuttx/include/nuttx/nxflat.h
                          +++ /dev/null
                          @@ -1,264 +0,0 @@
                          -/****************************************************************************
                          - * include/nuttx/nxflat.h
                          - *
                          - *   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.
                          - *
                          - ****************************************************************************/
                          -
                          -#ifndef __INCLUDE_NUTTX_NXFLAT_H
                          -#define __INCLUDE_NUTTX_NXFLAT_H
                          -
                          -/****************************************************************************
                          - * Included Files
                          - ****************************************************************************/
                          -
                          -#include 
                          -
                          -#include 
                          -#include 
                          -#include 
                          -
                          -/****************************************************************************
                          - * Pre-processor Definitions
                          - ****************************************************************************/
                          -
                          -/****************************************************************************
                          - * Public Types
                          - ****************************************************************************/
                          -
                          -/* This struct provides a desciption of the currently loaded instantiation
                          - * of an nxflat binary.
                          - */
                          -
                          -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.
                          -   */
                          -
                          -  uint32_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.
                          -   */
                          -
                          -  struct dspace_s *dspace; /* Allocated D-Space (data/bss/etc) */
                          -  uint32_t datasize;       /* Size of data segment in dspace */
                          -  uint32_t bsssize;        /* Size of bss segment in dspace */
                          -  uint32_t stacksize;      /* Size of stack (not allocated) */
                          -  uint32_t dsize;          /* Size of dspace (may be large than parts) */
                          -
                          -  /* This is temporary memory where relocation records will be loaded. */
                          -
                          -  uint32_t relocstart;     /* Start of array of struct flat_reloc */
                          -  uint16_t reloccount;     /* Number of elements in reloc array */
                          -
                          -  /* File descriptors */
                          -
                          -  int    filfd;            /* Descriptor for the file being loaded */
                          -
                          -  /* This is a copy of the NXFLAT header (still in network order) */
                          -
                          -  struct nxflat_hdr_s header;
                          -};
                          -
                          -/****************************************************************************
                          - * Public Functions
                          - ****************************************************************************/
                          -
                          -#undef EXTERN
                          -#if defined(__cplusplus)
                          -#define EXTERN extern "C"
                          -extern "C" {
                          -#else
                          -#define EXTERN extern
                          -#endif
                          -
                          -/****************************************************************************
                          - * These are APIs exported by libnxflat (and may be used outside of NuttX):
                          - ****************************************************************************/
                          -
                          -/***********************************************************************
                          - * Name: nxflat_verifyheader
                          - *
                          - * Description:
                          - *   Given the header from a possible NXFLAT executable, verify that it
                          - *   is an NXFLAT executable.
                          - *
                          - * Returned Value:
                          - *   0 (OK) is returned on success and a negated errno is returned on
                          - *   failure.
                          - *
                          - ***********************************************************************/
                          -
                          -EXTERN int nxflat_verifyheader(const struct nxflat_hdr_s *header);
                          -
                          -/***********************************************************************
                          - * Name: nxflat_init
                          - *
                          - * Description:
                          - *   This function is called to configure the library to process an NXFLAT
                          - *   program binary.
                          - *
                          - * Returned Value:
                          - *   0 (OK) is returned on success and a negated errno is returned on
                          - *   failure.
                          - *
                          - ***********************************************************************/
                          -
                          -EXTERN int nxflat_init(const char *filename,
                          -                       struct nxflat_loadinfo_s *loadinfo);
                          -
                          -/***********************************************************************
                          - * Name: nxflat_uninit
                          - *
                          - * Description:
                          - *   Releases any resources committed by nxflat_init().  This essentially
                          - *   undoes the actions of nxflat_init.
                          - *
                          - * Returned Value:
                          - *   0 (OK) is returned on success and a negated errno is returned on
                          - *   failure.
                          - *
                          - ***********************************************************************/
                          -
                          -EXTERN int nxflat_uninit(struct nxflat_loadinfo_s *loadinfo);
                          -
                          -/***********************************************************************
                          - * Name: nxflat_load
                          - *
                          - * Description:
                          - *   Loads the binary specified by nxflat_init into memory, mapping
                          - *   the I-space executable regions, allocating the D-Space region,
                          - *   and inializing the data segment (relocation information is
                          - *   temporarily loaded into the BSS region.  BSS will be cleared
                          - *   by nxflat_bind() after the relocation data has been processed).
                          - *
                          - * Returned Value:
                          - *   0 (OK) is returned on success and a negated errno is returned on
                          - *   failure.
                          - *
                          - ***********************************************************************/
                          -
                          -EXTERN int nxflat_load(struct nxflat_loadinfo_s *loadinfo);
                          -
                          -/***********************************************************************
                          - * Name: nxflat_read
                          - *
                          - * Description:
                          - *   Read 'readsize' bytes from the object file at 'offset'
                          - *
                          - * Returned Value:
                          - *   0 (OK) is returned on success and a negated errno is returned on
                          - *   failure.
                          - *
                          - ***********************************************************************/
                          -
                          -EXTERN int nxflat_read(struct nxflat_loadinfo_s *loadinfo, char *buffer,
                          -                       int readsize, int offset);
                          -
                          -/***********************************************************************
                          - * Name: nxflat_bind
                          - *
                          - * Description:
                          - *   Bind the imported symbol names in the loaded module described by
                          - *   'loadinfo' using the exported symbol values provided by 'symtab'
                          - *   After binding the module, clear the BSS region (which held the relocation
                          - *   data) in preparation for execution.
                          - *
                          - * Returned Value:
                          - *   0 (OK) is returned on success and a negated errno is returned on
                          - *   failure.
                          - *
                          - ***********************************************************************/
                          -
                          -struct symtab_s;
                          -EXTERN int nxflat_bind(FAR struct nxflat_loadinfo_s *loadinfo,
                          -                       FAR const struct symtab_s *exports, int nexports);
                          -
                          -/***********************************************************************
                          - * Name: nxflat_unload
                          - *
                          - * Description:
                          - *   This function unloads the object from memory. This essentially
                          - *   undoes the actions of nxflat_load.
                          - *
                          - * Returned Value:
                          - *   0 (OK) is returned on success and a negated errno is returned on
                          - *   failure.
                          - *
                          - ***********************************************************************/
                          -
                          -EXTERN int nxflat_unload(struct nxflat_loadinfo_s *loadinfo);
                          -
                          -/****************************************************************************
                          - * These are APIs used internally only by NuttX:
                          - ****************************************************************************/
                          -/***********************************************************************
                          - * Name: nxflat_initialize
                          - *
                          - * Description:
                          - *   NXFLAT support is built unconditionally.  However, it order to
                          - *   use this binary format, this function must be called during system
                          - *   format in order to register the NXFLAT binary format.
                          - *
                          - * Returned Value:
                          - *   This is a NuttX internal function so it follows the convention that
                          - *   0 (OK) is returned on success and a negated errno is returned on
                          - *   failure.
                          - *
                          - ***********************************************************************/
                          -
                          -EXTERN int nxflat_initialize(void);
                          -
                          -/****************************************************************************
                          - * Name: nxflat_uninitialize
                          - *
                          - * Description:
                          - *   Unregister the NXFLAT binary loader
                          - *
                          - * Returned Value:
                          - *   None
                          - *
                          - ****************************************************************************/
                          -
                          -EXTERN void nxflat_uninitialize(void);
                          -
                          -#undef EXTERN
                          -#if defined(__cplusplus)
                          -}
                          -#endif
                          -
                          -#endif /* __INCLUDE_NUTTX_NXFLAT_H */
                          diff --git a/nuttx/include/nuttx/power/pm.h b/nuttx/include/nuttx/power/pm.h
                          index 86e23f090e..9c0568b2dd 100644
                          --- a/nuttx/include/nuttx/power/pm.h
                          +++ b/nuttx/include/nuttx/power/pm.h
                          @@ -163,7 +163,7 @@
                           #endif
                           
                           #if CONFIG_PM_IDLEENTER_THRESH >= CONFIG_PM_IDLEEXIT_THRESH
                          -#  error "Must have CONFIG_PM_IDLEENTER_THRESH < CONFIG_PM_IDLEEXIT_THRESH
                          +#  error "Must have CONFIG_PM_IDLEENTER_THRESH < CONFIG_PM_IDLEEXIT_THRESH"
                           #endif
                           
                           #ifndef CONFIG_PM_IDLEENTER_COUNT
                          @@ -181,7 +181,7 @@
                           #endif
                           
                           #if CONFIG_PM_STANDBYENTER_THRESH >= CONFIG_PM_STANDBYEXIT_THRESH
                          -#  error "Must have CONFIG_PM_STANDBYENTER_THRESH < CONFIG_PM_STANDBYEXIT_THRESH
                          +#  error "Must have CONFIG_PM_STANDBYENTER_THRESH < CONFIG_PM_STANDBYEXIT_THRESH"
                           #endif
                           
                           #ifndef CONFIG_PM_STANDBYENTER_COUNT
                          @@ -199,7 +199,7 @@
                           #endif
                           
                           #if CONFIG_PM_SLEEPENTER_THRESH >= CONFIG_PM_SLEEPEXIT_THRESH
                          -#  error "Must have CONFIG_PM_SLEEPENTER_THRESH < CONFIG_PM_SLEEPEXIT_THRESH
                          +#  error "Must have CONFIG_PM_SLEEPENTER_THRESH < CONFIG_PM_SLEEPEXIT_THRESH"
                           #endif
                           
                           #ifndef CONFIG_PM_SLEEPENTER_COUNT
                          diff --git a/nuttx/include/nuttx/sched.h b/nuttx/include/nuttx/sched.h
                          index 54094c8f14..6eaba6e9c6 100644
                          --- a/nuttx/include/nuttx/sched.h
                          +++ b/nuttx/include/nuttx/sched.h
                          @@ -138,11 +138,11 @@ typedef union entry_u entry_t;
                            */
                           
                           #ifdef CONFIG_SCHED_ATEXIT
                          -typedef void (*atexitfunc_t)(void);
                          +typedef CODE void (*atexitfunc_t)(void);
                           #endif
                           
                           #ifdef CONFIG_SCHED_ONEXIT
                          -typedef void (*onexitfunc_t)(int exitcode, FAR void *arg);
                          +typedef CODE void (*onexitfunc_t)(int exitcode, FAR void *arg);
                           #endif
                           
                           /* POSIX Message queue */
                          @@ -205,7 +205,7 @@ struct _TCB
                             start_t  start;                        /* Thread start function               */
                             entry_t  entry;                        /* Entry Point into the thread         */
                           
                          -#ifdef CONFIG_SCHED_ATEXIT
                          +#if defined(CONFIG_SCHED_ATEXIT) && !defined(CONFIG_SCHED_ONEXIT)
                           # if defined(CONFIG_SCHED_ATEXIT_MAX) && CONFIG_SCHED_ATEXIT_MAX > 1
                             atexitfunc_t atexitfunc[CONFIG_SCHED_ATEXIT_MAX];
                           # else
                          diff --git a/nuttx/include/nuttx/usb/cdcacm.h b/nuttx/include/nuttx/usb/cdcacm.h
                          index 307f2a5977..1dca050c4b 100644
                          --- a/nuttx/include/nuttx/usb/cdcacm.h
                          +++ b/nuttx/include/nuttx/usb/cdcacm.h
                          @@ -205,7 +205,7 @@
                           /* USB Controller */
                           
                           #ifndef CONFIG_USBDEV_SELFPOWERED
                          -#  define SELFPOWERED USB_CONFIG_ATT_SELFPOWER
                          +#  define SELFPOWERED USB_CONFIG_ATTR_SELFPOWER
                           #else
                           #  define SELFPOWERED (0)
                           #endif
                          diff --git a/nuttx/include/nuttx/usb/usbdev_trace.h b/nuttx/include/nuttx/usb/usbdev_trace.h
                          index ae8e13c3a4..ab3a5f4bea 100644
                          --- a/nuttx/include/nuttx/usb/usbdev_trace.h
                          +++ b/nuttx/include/nuttx/usb/usbdev_trace.h
                          @@ -238,10 +238,6 @@
                           #define USBCOMPOSITE_TRACEERR_ALLOCDEVSTRUCT         0x000a
                           #define USBCOMPOSITE_TRACEERR_CLASSOBJECT            0x000b
                           #define USBCOMPOSITE_TRACEERR_DEVREGISTER            0x000c
                          -#define USBCOMPOSITE_TRACEERR_INVALIDARG             0x000d
                          -#define USBCOMPOSITE_TRACEERR_INVALIDARG             0x000f
                          -#define USBCOMPOSITE_TRACEERR_INVALIDARG             0x0010
                          -#define USBCOMPOSITE_TRACEERR_INVALIDARG             0x0011
                           
                           /* USB Storage driver class events ******************************************/
                           
                          diff --git a/nuttx/include/nuttx/wqueue.h b/nuttx/include/nuttx/wqueue.h
                          index 644585c56f..c509bf197b 100644
                          --- a/nuttx/include/nuttx/wqueue.h
                          +++ b/nuttx/include/nuttx/wqueue.h
                          @@ -109,17 +109,35 @@
                           #  endif
                           #endif
                           
                          -/* Work queue IDs (indices).  These are both zero if there is only one work
                          - * queue.
                          +/* Work queue IDs (indices):
                          + *
                          + * Kernel Work Queues:
                          + *   HPWORK: This ID of the high priority work queue that should only be used for
                          + *   hi-priority, time-critical, driver bottom-half functions.
                          + *
                          + *   LPWORK: This is the ID of the low priority work queue that can be used for any
                          + *   purpose.  if CONFIG_SCHED_LPWORK is not defined, then there is only one kernel
                          + *   work queue and LPWORK == HPWORK.
                          + *
                          + * User Work Queue:
                          + *   USRWORK:  CONFIG_NUTTX_KERNEL and CONFIG_SCHED_USRWORK are defined, then NuttX
                          + *   will also support a user-accessible work queue.  Otherwise, USRWORK == LPWORK.
                            */
                           
                           #define HPWORK 0
                           #ifdef CONFIG_SCHED_LPWORK
                          -#  define LPWORK 1
                          +#  define LPWORK (HPWORK+1)
                           #else
                           #  define LPWORK HPWORK
                           #endif
                           
                          +#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_SCHED_USRWORK)
                          +#  warning "Feature not implemented"
                          +#  define USRWORK (LPWORK+1)
                          +#else
                          +#  define USRWORK LPWORK
                          +#endif
                          +
                           /****************************************************************************
                            * Public Types
                            ****************************************************************************/
                          diff --git a/nuttx/include/stdio.h b/nuttx/include/stdio.h
                          index 754cedbb40..0441ea4b85 100644
                          --- a/nuttx/include/stdio.h
                          +++ b/nuttx/include/stdio.h
                          @@ -102,6 +102,9 @@ extern "C" {
                           
                           /* ANSI-like File System Interfaces */
                           
                          +/* Operations on streams (FILE) */
                          +
                          +EXTERN void   clearerr(register FILE *stream);
                           EXTERN int    fclose(FAR FILE *stream);
                           EXTERN int    fflush(FAR FILE *stream);
                           EXTERN int    feof(FAR FILE *stream);
                          @@ -120,6 +123,9 @@ EXTERN int    fsetpos(FAR FILE *stream, FAR fpos_t *pos);
                           EXTERN long   ftell(FAR FILE *stream);
                           EXTERN size_t fwrite(FAR const void *ptr, size_t size, size_t n_items, FAR FILE *stream);
                           EXTERN FAR char *gets(FAR char *s);
                          +EXTERN int    ungetc(int c, FAR FILE *stream);
                          +
                          +/* Operations on the stdout stream, buffers, paths, and the whole printf-family */
                           
                           EXTERN int    printf(const char *format, ...);
                           EXTERN int    puts(FAR const char *s);
                          @@ -130,7 +136,6 @@ EXTERN int    snprintf(FAR char *buf, size_t size, const char *format, ...);
                           EXTERN int    sscanf(const char *buf, const char *fmt, ...);
                           EXTERN void   perror(FAR const char *s);
                           
                          -EXTERN int    ungetc(int c, FAR FILE *stream);
                           EXTERN int    vprintf(FAR const char *format, va_list ap);
                           EXTERN int    vfprintf(FAR FILE *stream, const char *format, va_list ap);
                           EXTERN int    vdprintf(FAR int fd, const char *format, va_list ap);
                          diff --git a/nuttx/include/termios.h b/nuttx/include/termios.h
                          index 537edbd8f1..3032e47460 100644
                          --- a/nuttx/include/termios.h
                          +++ b/nuttx/include/termios.h
                          @@ -232,7 +232,7 @@ struct termios
                              * cf[set|get][o|i]speed() POSIX interfaces.
                              */
                           
                          -  speed_t c_speed;    /* Input/output speed (non-POSIX)*/
                          +  speed_t c_speed;          /* Input/output speed (non-POSIX)*/
                           };
                           
                           /****************************************************************************
                          diff --git a/nuttx/include/unistd.h b/nuttx/include/unistd.h
                          index e2ad6ff826..681ce9e632 100644
                          --- a/nuttx/include/unistd.h
                          +++ b/nuttx/include/unistd.h
                          @@ -133,6 +133,7 @@ EXTERN pid_t   getpid(void);
                           EXTERN void    _exit(int status) noreturn_function;
                           EXTERN unsigned int sleep(unsigned int seconds);
                           EXTERN int     usleep(useconds_t usec);
                          +EXTERN int     pause(void);
                           
                           /* File descriptor operations */
                           
                          diff --git a/nuttx/lib/Makefile b/nuttx/lib/Makefile
                          index fc8f0c4dda..58857dbd41 100644
                          --- a/nuttx/lib/Makefile
                          +++ b/nuttx/lib/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # lib/Makefile
                           #
                          -#   Copyright (C) 2007-2012 Gregory Nutt. All rights reserved.
                          +#   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                           #
                           # Redistribution and use in source and binary forms, with or without
                          @@ -35,101 +35,11 @@
                           
                           -include $(TOPDIR)/Make.defs
                           
                          -ASRCS =
                          -CSRCS =
                          +all:
                           
                          -DEPPATH := --dep-path .
                          -VPATH := .
                          +depend:
                           
                          -include stdio/Make.defs
                          -include stdlib/Make.defs
                          -include unistd/Make.defs
                          -include sched/Make.defs
                          -include string/Make.defs
                          -include pthread/Make.defs
                          -include semaphore/Make.defs
                          -include signal/Make.defs
                          -include mqueue/Make.defs
                          -include math/Make.defs
                          -include net/Make.defs
                          -include time/Make.defs
                          -include libgen/Make.defs
                          -include dirent/Make.defs
                          -include termios/Make.defs
                          -include queue/Make.defs
                          -include misc/Make.defs
                          -
                          -AOBJS = $(ASRCS:.S=$(OBJEXT))
                          -COBJS = $(CSRCS:.c=$(OBJEXT))
                          -
                          -SRCS = $(ASRCS) $(CSRCS)
                          -OBJS = $(AOBJS) $(COBJS)
                          -
                          -UBIN = libulib$(LIBEXT)
                          -KBIN = libklib$(LIBEXT)
                          -BIN  = liblib$(LIBEXT)
                          -
                          -all: $(BIN)
                          -
                          -$(AOBJS): %$(OBJEXT): %.S
                          -	$(call ASSEMBLE, $<, $@)
                          -
                          -$(COBJS): %$(OBJEXT): %.c
                          -	$(call COMPILE, $<, $@)
                          -
                          -$(BIN):	$(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $@, $${obj}); \
                          -	done ; )
                          -
                          -ifneq ($(BIN),$(UBIN))
                          -.userlib:
                          -	@$(MAKE) $(UBIN) BIN=$(UBIN) TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES)
                          -	@touch .userlib
                          -
                          -$(UBIN): kclean .userlib
                          -endif
                          -
                          -ifneq ($(BIN),$(KBIN))
                          -.kernlib:
                          -	@$(MAKE) $(KBIN) BIN=$(KBIN) TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES)
                          -	@touch .kernlib
                          -
                          -$(KBIN): uclean .kernlib
                          -endif
                          -
                          -.depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          -	@touch $@
                          -
                          -depend: .depend
                          -
                          -# Clean Targets:
                          -# Clean user-mode temporary files (retaining the UBIN binary)
                          -
                          -uclean:
                          -ifneq ($(OBJEXT),)
                          -	@( if [ -f .userlib ]; then rm -f *$(OBJEXT); fi )
                          -endif
                          -	@rm -f .userlib *~ .*.swp
                          -
                          -# Clean kernel-mode temporary files (retaining the KBIN binary)
                          -
                          -kclean:
                          -ifneq ($(OBJEXT),)
                          -	@( if [ -f .kernlib ]; then rm -f *$(OBJEXT); fi )
                          -endif
                          -	@rm -f .kernlib *~ .*.swp
                          -
                          -# Really clean everything
                          -
                          -clean: uclean kclean
                          -	@rm -f $(BIN) $(UBIN) $(KBIN) *~ .*.swp
                          +clean:
                           	$(call CLEAN)
                           
                          -# Deep clean -- removes all traces of the configuration
                          -
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          -
                          --include Make.dep
                          diff --git a/nuttx/lib/README.txt b/nuttx/lib/README.txt
                          index 63d1c343c0..f742b9a243 100644
                          --- a/nuttx/lib/README.txt
                          +++ b/nuttx/lib/README.txt
                          @@ -1,84 +1,6 @@
                          -lib
                          -===
                          -
                          -This directory contains numerous, small functions typically associated with
                          -what you would expect to find in a standard C library.  The sub-directories
                          -in this directory contain standard interface that can be executed by user-
                          -mode programs.
                          -
                          -Normally, NuttX is built with no protection and all threads running in kerne-
                          -mode.  In that model, there is no real architectural distinction between
                          -what is a kernel-mode program and what is a user-mode program; the system is
                          -more like on multi-threaded program that all runs in kernel-mode.
                          -
                          -But if the CONFIG_NUTTX_KERNEL option is selected, NuttX will be built into
                          -distinct user-mode and kernel-mode sections.  In that case, most of the
                          -code in the nuttx/ directory will run in kernel-mode with with exceptions
                          -of (1) the user-mode "proxies" found in syscall/proxies, and (2) the
                          -standard C library functions found in this directory.  In this build model,
                          -it is critical to separate the user-mode OS interfaces in this way.
                          -
                          -Sub-Directories
                          -===============
                          -
                          -The files in the lib/ directory are organized (mostly) according which file
                          -in the include/ directory provides the prototype for library functions.  So
                          -we have:
                          -
                          -  libgen    - libgen.h
                          -  math      - math.h and fixedmath.h
                          -  mqueue    - pthread.h
                          -  net       - Various network-related header files: netinet/ether.h, arpa/inet.h
                          -  pthread   - pthread.h
                          -  queue     - queue.h
                          -  sched     - sched.h
                          -  semaphore - semaphore.h
                          -  stdio     - stdio.h
                          -  stdlib    - stdlib.h
                          -  string    - string.h
                          -  time      - time.h
                          -  unistd    - unistd.h
                          -
                          -There is also a misc/ subdirectory that contains various internal functions
                          -and interfaces from header files that are too few to warrant their own sub-
                          -directory:
                          -
                          - misc       - Nonstandard "glue" logic, debug.h, crc32.h, dirent.h
                          -
                          -Library Database
                          +lib/ README File
                           ================
                           
                          -Information about functions available in the NuttX C library information is
                          -maintained in a database.  That "database" is implemented as a simple comma-
                          -separated-value file, lib.csv.  Most spreadsheets programs will accept this
                          -format and can be used to maintain the library database.
                          +This directory is reserved for libraries generated during the NuttX build process
                           
                          -This library database will (eventually) be used to generate symbol library
                          -symbol table information that can be exported to external applications.
                           
                          -The format of the CSV file for each line is:
                          -
                          -  Field 1: Function name
                          -  Field 2: The header file that contains the function prototype
                          -  Field 3: Condition for compilation
                          -  Field 4: The type of function return value.
                          -  Field 5 - N+5: The type of each of the N formal parameters of the function
                          -
                          -Each type field has a format as follows:
                          -
                          -  type name:
                          -        For all simpler types
                          -  formal type | actual type: 
                          -        For array types where the form of the formal (eg. int parm[2])
                          -        differs from the type of actual passed parameter (eg. int*).  This
                          -        is necessary because you cannot do simple casts to array types.
                          -  formal type | union member actual type | union member fieldname:
                          -        A similar situation exists for unions.  For example, the formal
                          -        parameter type union sigval -- You cannot cast a uintptr_t to
                          -        a union sigval, but you can cast to the type of one of the union
                          -        member types when passing the actual paramter.  Similarly, we
                          -        cannot cast a union sigval to a uinptr_t either.  Rather, we need
                          -        to cast a specific union member fieldname to uintptr_t.
                          -
                          -NOTE: The tool mksymtab can be used to generate a symbol table from this CSV
                          -file.  See nuttx/tools/README.txt for further details about the use of mksymtab.
                          diff --git a/nuttx/lib/stdlib/lib_rand.c b/nuttx/lib/stdlib/lib_rand.c
                          deleted file mode 100644
                          index 7227c52d0d..0000000000
                          --- a/nuttx/lib/stdlib/lib_rand.c
                          +++ /dev/null
                          @@ -1,220 +0,0 @@
                          -/************************************************************
                          - * lib/stdlib/lib_rand.c
                          - *
                          - *   Copyright (C) 2007, 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.
                          - *
                          - ************************************************************/
                          -
                          -/************************************************************
                          - * Compilation Switches
                          - ************************************************************/
                          -
                          -/************************************************************
                          - * Included Files
                          - ************************************************************/
                          -
                          -#include 
                          -#include 
                          -
                          -/************************************************************
                          - * Definitions
                          - ************************************************************/
                          -
                          -#ifndef CONFIG_LIB_RAND_ORDER
                          -#define CONFIG_LIB_RAND_ORDER 1
                          -#endif
                          -
                          -/* Values needed by the random number generator */
                          -
                          -#define RND1_CONSTK  470001
                          -#define RND1_CONSTP  999563
                          -#define RND2_CONSTK1 366528
                          -#define RND2_CONSTK2 508531
                          -#define RND2_CONSTP  998917
                          -#define RND3_CONSTK1 360137
                          -#define RND3_CONSTK2 519815
                          -#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 Type Declarations
                          - ************************************************************/
                          -
                          -/************************************************************
                          - * Private Function Prototypes
                          - ************************************************************/
                          -
                          -static unsigned int nrand(unsigned int nLimit);
                          -static double_t frand1(void);
                          -#if (CONFIG_LIB_RAND_ORDER > 1)
                          -static double_t frand2(void);
                          -#if (CONFIG_LIB_RAND_ORDER > 2)
                          -static double_t frand3(void);
                          -#endif
                          -#endif
                          -
                          -/**********************************************************
                          - * Global Constant Data
                          - **********************************************************/
                          -
                          -/************************************************************
                          - * Global Variables
                          - ************************************************************/
                          -
                          -/**********************************************************
                          - * Private Constant Data
                          - **********************************************************/
                          -
                          -/************************************************************
                          - * Private Variables
                          - ************************************************************/
                          -
                          -static unsigned long g_nRandInt1;
                          -#if (CONFIG_LIB_RAND_ORDER > 1)
                          -static unsigned long g_nRandInt2;
                          -#if (CONFIG_LIB_RAND_ORDER > 2)
                          -static unsigned long g_nRandInt3;
                          -#endif
                          -#endif
                          -
                          -/************************************************************
                          - * Private Functions
                          - ************************************************************/
                          - 
                          -static unsigned int nrand(unsigned int nLimit)
                          -{
                          -  unsigned long nResult;
                          -  double_t fRatio;
                          -
                          -  /* Loop to be sure a legal random number is generated */
                          -  do {
                          -
                          -    /* Get a random integer in the requested range */
                          -#if (CONFIG_LIB_RAND_ORDER == 1)
                          -    fRatio = frand1();
                          -#elif (CONFIG_LIB_RAND_ORDER == 2)
                          -    fRatio = frand2();
                          -#else
                          -    fRatio = frand3();
                          -#endif
                          -
                          -    /* Then, produce the return-able value */
                          -    nResult = (unsigned long)(((double_t)nLimit) * fRatio);
                          -
                          -  } while (nResult >= (unsigned long)nLimit);
                          -
                          -  return (unsigned int)nResult;
                          -
                          -} /* end nrand */
                          -
                          -static double_t frand1(void)
                          -{
                          -  unsigned long nRandInt;
                          -
                          -  /* First order congruential generator */
                          -  nRandInt = (RND1_CONSTK * g_nRandInt1) % RND1_CONSTP;
                          -  g_nRandInt1 = nRandInt;
                          -
                          -  /* 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 */
                          -
                          -#if (CONFIG_LIB_RAND_ORDER > 1)
                          -static double_t frand2(void)
                          -{
                          -  unsigned long nRandInt;
                          -
                          -  /* Second order congruential generator */
                          -  nRandInt = (RND2_CONSTK1 * g_nRandInt1 + RND2_CONSTK2 * g_nRandInt2) %
                          -    RND2_CONSTP;
                          -  g_nRandInt2 = g_nRandInt1;
                          -  g_nRandInt1 = nRandInt;
                          -
                          -  /* 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 */
                          -
                          -#if (CONFIG_LIB_RAND_ORDER > 2)
                          -static double_t frand3(void)
                          -{
                          -  unsigned long nRandInt;
                          -
                          -  /* 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;
                          -
                          -  /* 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 */
                          -#endif
                          -#endif
                          -
                          -/************************************************************
                          - * Public Functions
                          - ************************************************************/
                          -/************************************************************
                          - * Function:  srand, rand
                          - ************************************************************/
                          -
                          -void srand(unsigned int seed)
                          -{
                          -  g_nRandInt1 = seed;
                          -#if (CONFIG_LIB_RAND_ORDER > 1)
                          -  g_nRandInt2 = seed;
                          -  (void)frand1();
                          -#if (CONFIG_LIB_RAND_ORDER > 2)
                          -  g_nRandInt3 = seed;
                          -  (void)frand2();
                          -#endif
                          -#endif
                          -
                          -} /* end srand */
                          -
                          -int rand(void)
                          -{
                          -  return (int)nrand(32768);
                          -
                          -} /* end rand */
                          -
                          diff --git a/nuttx/lib/string/lib_memcmp.c b/nuttx/lib/string/lib_memcmp.c
                          deleted file mode 100644
                          index eb2e1fd125..0000000000
                          --- a/nuttx/lib/string/lib_memcmp.c
                          +++ /dev/null
                          @@ -1,74 +0,0 @@
                          -/************************************************************
                          - * lib/string/lib_memcmp.c
                          - *
                          - *   Copyright (C) 2007, 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.
                          - *
                          - ************************************************************/
                          -
                          -/************************************************************
                          - * Compilation Switches
                          - ************************************************************/
                          -
                          -/************************************************************
                          - * Included Files
                          - ************************************************************/
                          -
                          -#include 
                          -#include 
                          -#include 
                          -
                          -/************************************************************
                          - * Global Functions
                          - ************************************************************/
                          -
                          -#ifndef CONFIG_ARCH_MEMCMP
                          -int memcmp(const void *s1, const void *s2, size_t n)
                          -{
                          -  unsigned char *p1 = (unsigned char *)s1;
                          -  unsigned char *p2 = (unsigned char *)s2;
                          -
                          -  while (n-- > 0)
                          -    {
                          -      if (*p1 < *p2)
                          -        {
                          -          return -1;
                          -        }
                          -      else if (*p1 > *p2)
                          -        {
                          -          return 1;
                          -        }
                          -
                          -      p1++;
                          -      p2++;
                          -    }
                          -  return 0;
                          -}
                          -#endif
                          diff --git a/nuttx/lib/Kconfig b/nuttx/libc/Kconfig
                          similarity index 67%
                          rename from nuttx/lib/Kconfig
                          rename to nuttx/libc/Kconfig
                          index 69a55d09cf..bd470be7f5 100644
                          --- a/nuttx/lib/Kconfig
                          +++ b/nuttx/libc/Kconfig
                          @@ -30,12 +30,7 @@ config LIB_HOMEDIR
                           	---help---
                           		The home directory to use with operations like such as 'cd ~'
                           
                          -config HAVE_LIBM
                          -	bool "Architecture-specific libm.a"
                          -	default n
                          -	---help---
                          -		Architecture specific logic provides an implementation of libm.a
                          -		and a math.h header file that can be found at include/arch/math.h.
                          +source libc/math/Kconfig
                           
                           config NOPRINTF_FIELDWIDTH
                           	bool "Disable sprintf support fieldwidth"
                          @@ -153,42 +148,128 @@ config ARCH_OPTIMIZED_FUNCTIONS
                           
                           if ARCH_OPTIMIZED_FUNCTIONS
                           config ARCH_MEMCPY
                          -	bool "memcpy"
                          +	bool "memcpy()"
                           	default n
                          +	---help---
                          +		Select this option if the architecture provides an optimized version
                          +		of memcpy().
                          +
                          +config MEMCPY_VIK
                          +	bool "Vik memcpy()"
                          +	default n
                          +	depends on !ARCH_MEMCPY
                          +	---help---
                          +		Select this option to use the optimized memcpy() function by Daniel Vik.
                          +		Select this option for improved performance at the expense of increased
                          +		size. See licensing information in the top-level COPYING file.
                          +
                          +if MEMCPY_VIK
                          +config MEMCPY_PRE_INC_PTRS
                          +	bool "Pre-increment pointers"
                          +	default n
                          +	---help---
                          +		Use pre-increment of pointers. Default is post increment of pointers.
                          +
                          +config MEMCPY_INDEXED_COPY
                          +	bool "Array indexing"
                          +	default y
                          +	---help---
                          +		Copying data using array indexing. Using this option, disables the
                          +		MEMCPY_PRE_INC_PTRS option.
                          +
                          +config MEMCPY_64BIT
                          +	bool "64-bit memcpy()"
                          +	default n
                          +	---help---
                          +		Compiles memcpy() for architectures that suppport 64-bit operations
                          +		efficiently.
                          +
                          +endif
                           
                           config ARCH_MEMCMP
                          -	bool "memcmp"
                          +	bool "memcmp()"
                           	default n
                          +	---help---
                          +		Select this option if the architecture provides an optimized version
                          +		of memcmp().
                           
                           config ARCH_MEMMOVE
                          -	bool "memmove"
                          +	bool "memmove()"
                           	default n
                          +	---help---
                          +		Select this option if the architecture provides an optimized version
                          +		of memmove().
                           
                           config ARCH_MEMSET
                          -	bool "memset"
                          +	bool "memset()"
                           	default n
                          +	---help---
                          +		Select this option if the architecture provides an optimized version
                          +		of memset().
                          +
                          +config MEMSET_OPTSPEED
                          +	bool "Optimize memset() for speed"
                          +	default n
                          +	depends on !ARCH_MEMSET
                          +	---help---
                          +		Select this option to use a version of memcpy() optimized for speed.
                          +		Default: memcpy() is optimized for size.
                          +
                          +config MEMSET_64BIT
                          +	bool "64-bit memset()"
                          +	default n
                          +	depends on MEMSET_OPTSPEED
                          +	---help---
                          +		Compiles memset() for architectures that suppport 64-bit operations
                          +		efficiently.
                          +
                          +config ARCH_STRCHR
                          +	bool "strchr()"
                          +	default n
                          +	---help---
                          +		Select this option if the architecture provides an optimized version
                          +		of strchr().
                           
                           config ARCH_STRCMP
                          -	bool "strcmp"
                          +	bool "strcmp()"
                           	default n
                          +	---help---
                          +		Select this option if the architecture provides an optimized version
                          +		of strcmp().
                           
                           config ARCH_STRCPY
                          -	bool "strcpy"
                          +	bool "strcpy()"
                           	default n
                          +	---help---
                          +		Select this option if the architecture provides an optimized version
                          +		of strcpy().
                           
                           config ARCH_STRNCPY
                          -	bool "strncpy"
                          +	bool "strncpy()"
                           	default n
                          +	---help---
                          +		Select this option if the architecture provides an optimized version
                          +		of strncpy().
                           
                           config ARCH_STRLEN
                           	bool "strlen"
                           	default n
                          +	---help---
                          +		Select this option if the architecture provides an optimized version
                          +		of strlen().
                           
                           config ARCH_STRNLEN
                          -	bool "strlen"
                          +	bool "strlen()"
                           	default n
                          +	---help---
                          +		Select this option if the architecture provides an optimized version
                          +		of strnlen().
                           
                           config ARCH_BZERO
                          -	bool "bzero"
                          +	bool "bzero()"
                           	default n
                          +	---help---
                          +		Select this option if the architecture provides an optimized version
                          +		of bzero().
                          +
                           endif
                          diff --git a/nuttx/libc/Makefile b/nuttx/libc/Makefile
                          new file mode 100644
                          index 0000000000..22dbba1d91
                          --- /dev/null
                          +++ b/nuttx/libc/Makefile
                          @@ -0,0 +1,145 @@
                          +############################################################################
                          +# libc/Makefile
                          +#
                          +#   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.
                          +#
                          +###########################################################################
                          +
                          +-include $(TOPDIR)/Make.defs
                          +
                          +ASRCS =
                          +CSRCS =
                          +
                          +DEPPATH := --dep-path .
                          +VPATH := .
                          +
                          +include stdio/Make.defs
                          +include stdlib/Make.defs
                          +include unistd/Make.defs
                          +include sched/Make.defs
                          +include string/Make.defs
                          +include pthread/Make.defs
                          +include semaphore/Make.defs
                          +include signal/Make.defs
                          +include mqueue/Make.defs
                          +include math/Make.defs
                          +include fixedmath/Make.defs
                          +include net/Make.defs
                          +include time/Make.defs
                          +include libgen/Make.defs
                          +include dirent/Make.defs
                          +include termios/Make.defs
                          +include queue/Make.defs
                          +include misc/Make.defs
                          +
                          +AOBJS = $(ASRCS:.S=$(OBJEXT))
                          +COBJS = $(CSRCS:.c=$(OBJEXT))
                          +
                          +SRCS = $(ASRCS) $(CSRCS)
                          +OBJS = $(AOBJS) $(COBJS)
                          +
                          +UBIN = libuc$(LIBEXT)
                          +KBIN = libkc$(LIBEXT)
                          +BIN  = libc$(LIBEXT)
                          +
                          +all: $(BIN)
                          +
                          +$(AOBJS): %$(OBJEXT): %.S
                          +	$(call ASSEMBLE, $<, $@)
                          +
                          +$(COBJS): %$(OBJEXT): %.c
                          +	$(call COMPILE, $<, $@)
                          +
                          +$(BIN): $(OBJS)
                          +	$(call ARCHIVE, $@, $(OBJS))
                          +
                          +ifneq ($(BIN),$(UBIN))
                          +.userlib:
                          +	$(Q) $(MAKE) $(UBIN) BIN=$(UBIN) TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) touch .userlib
                          +
                          +$(UBIN): kclean .userlib
                          +endif
                          +
                          +ifneq ($(BIN),$(KBIN))
                          +.kernlib:
                          +	$(Q) $(MAKE) $(KBIN) BIN=$(KBIN) TOPDIR=$(TOPDIR) EXTRADEFINES=$(EXTRADEFINES)
                          +	$(Q) touch .kernlib
                          +
                          +$(KBIN): uclean .kernlib
                          +endif
                          +
                          +.depend: Makefile $(SRCS)
                          +	$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) touch $@
                          +
                          +depend: .depend
                          +
                          +# Clean Targets:
                          +# Clean user-mode temporary files (retaining the UBIN binary)
                          +
                          +uclean:
                          +ifneq ($(OBJEXT),)
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +	$(Q) if exist .userlib ]; then del *$(OBJEXT)
                          +else
                          +	$(Q) ( if [ -f .userlib ]; then rm -f *$(OBJEXT); fi )
                          +endif
                          +endif
                          +	$(call DELFILE, .userlib)
                          +
                          +# Clean kernel-mode temporary files (retaining the KBIN binary)
                          +
                          +kclean:
                          +ifneq ($(OBJEXT),)
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +	$(Q) if exist .kernlib ]; then del *$(OBJEXT)
                          +else
                          +	$(Q) ( if [ -f .kernlib ]; then rm -f *$(OBJEXT); fi )
                          +endif
                          +endif
                          +	$(call DELFILE, .kernlib)
                          +
                          +# Really clean everything
                          +
                          +clean: uclean kclean
                          +	$(call DELFILE, $(BIN))
                          +	$(call DELFILE, $(UBIN))
                          +	$(call DELFILE, $(KBIN))
                          +	$(call CLEAN)
                          +
                          +# Deep clean -- removes all traces of the configuration
                          +
                          +distclean: clean
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                          +
                          +-include Make.dep
                          diff --git a/nuttx/libc/README.txt b/nuttx/libc/README.txt
                          new file mode 100644
                          index 0000000000..ed672d0388
                          --- /dev/null
                          +++ b/nuttx/libc/README.txt
                          @@ -0,0 +1,85 @@
                          +lib
                          +===
                          +
                          +This directory contains numerous, small functions typically associated with
                          +what you would expect to find in a standard C library.  The sub-directories
                          +in this directory contain standard interface that can be executed by user-
                          +mode programs.
                          +
                          +Normally, NuttX is built with no protection and all threads running in kerne-
                          +mode.  In that model, there is no real architectural distinction between
                          +what is a kernel-mode program and what is a user-mode program; the system is
                          +more like on multi-threaded program that all runs in kernel-mode.
                          +
                          +But if the CONFIG_NUTTX_KERNEL option is selected, NuttX will be built into
                          +distinct user-mode and kernel-mode sections.  In that case, most of the
                          +code in the nuttx/ directory will run in kernel-mode with with exceptions
                          +of (1) the user-mode "proxies" found in syscall/proxies, and (2) the
                          +standard C library functions found in this directory.  In this build model,
                          +it is critical to separate the user-mode OS interfaces in this way.
                          +
                          +Sub-Directories
                          +===============
                          +
                          +The files in the libc/ directory are organized (mostly) according which file
                          +in the include/ directory provides the prototype for library functions.  So
                          +we have:
                          +
                          +  libgen    - libgen.h
                          +  fixedmath - fixedmath.h
                          +  math      - math.h
                          +  mqueue    - pthread.h
                          +  net       - Various network-related header files: netinet/ether.h, arpa/inet.h
                          +  pthread   - pthread.h
                          +  queue     - queue.h
                          +  sched     - sched.h
                          +  semaphore - semaphore.h
                          +  stdio     - stdio.h
                          +  stdlib    - stdlib.h
                          +  string    - string.h
                          +  time      - time.h
                          +  unistd    - unistd.h
                          +
                          +There is also a misc/ subdirectory that contains various internal functions
                          +and interfaces from header files that are too few to warrant their own sub-
                          +directory:
                          +
                          + misc       - Nonstandard "glue" logic, debug.h, crc32.h, dirent.h
                          +
                          +Library Database
                          +================
                          +
                          +Information about functions available in the NuttX C library information is
                          +maintained in a database.  That "database" is implemented as a simple comma-
                          +separated-value file, lib.csv.  Most spreadsheets programs will accept this
                          +format and can be used to maintain the library database.
                          +
                          +This library database will (eventually) be used to generate symbol library
                          +symbol table information that can be exported to external applications.
                          +
                          +The format of the CSV file for each line is:
                          +
                          +  Field 1: Function name
                          +  Field 2: The header file that contains the function prototype
                          +  Field 3: Condition for compilation
                          +  Field 4: The type of function return value.
                          +  Field 5 - N+5: The type of each of the N formal parameters of the function
                          +
                          +Each type field has a format as follows:
                          +
                          +  type name:
                          +        For all simpler types
                          +  formal type | actual type: 
                          +        For array types where the form of the formal (eg. int parm[2])
                          +        differs from the type of actual passed parameter (eg. int*).  This
                          +        is necessary because you cannot do simple casts to array types.
                          +  formal type | union member actual type | union member fieldname:
                          +        A similar situation exists for unions.  For example, the formal
                          +        parameter type union sigval -- You cannot cast a uintptr_t to
                          +        a union sigval, but you can cast to the type of one of the union
                          +        member types when passing the actual paramter.  Similarly, we
                          +        cannot cast a union sigval to a uinptr_t either.  Rather, we need
                          +        to cast a specific union member fieldname to uintptr_t.
                          +
                          +NOTE: The tool mksymtab can be used to generate a symbol table from this CSV
                          +file.  See nuttx/tools/README.txt for further details about the use of mksymtab.
                          diff --git a/nuttx/lib/dirent/Make.defs b/nuttx/libc/dirent/Make.defs
                          similarity index 98%
                          rename from nuttx/lib/dirent/Make.defs
                          rename to nuttx/libc/dirent/Make.defs
                          index cc1d6b7839..f2927bed82 100644
                          --- a/nuttx/lib/dirent/Make.defs
                          +++ b/nuttx/libc/dirent/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/dirent/Make.defs
                          +# libc/dirent/Make.defs
                           #
                           #   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/dirent/lib_readdirr.c b/nuttx/libc/dirent/lib_readdirr.c
                          similarity index 99%
                          rename from nuttx/lib/dirent/lib_readdirr.c
                          rename to nuttx/libc/dirent/lib_readdirr.c
                          index 47c5b9a7bd..93c99ac283 100644
                          --- a/nuttx/lib/dirent/lib_readdirr.c
                          +++ b/nuttx/libc/dirent/lib_readdirr.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/dirent/lib_readdirr.c
                          + * libc/dirent/lib_readdirr.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/dirent/lib_telldir.c b/nuttx/libc/dirent/lib_telldir.c
                          similarity index 99%
                          rename from nuttx/lib/dirent/lib_telldir.c
                          rename to nuttx/libc/dirent/lib_telldir.c
                          index 3753b326e9..f77a4a1c21 100644
                          --- a/nuttx/lib/dirent/lib_telldir.c
                          +++ b/nuttx/libc/dirent/lib_telldir.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/dirent/fs_telldir.c
                          + * libc/dirent/fs_telldir.c
                            *
                            *   Copyright (C) 2007-2008, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/math/Make.defs b/nuttx/libc/fixedmath/Make.defs
                          similarity index 90%
                          rename from nuttx/lib/math/Make.defs
                          rename to nuttx/libc/fixedmath/Make.defs
                          index 126cd2f471..b53df2b2c0 100644
                          --- a/nuttx/lib/math/Make.defs
                          +++ b/nuttx/libc/fixedmath/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/math/Make.defs
                          +# libc/fixedmath/Make.defs
                           #
                           #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          @@ -33,11 +33,11 @@
                           #
                           ############################################################################
                           
                          -# Add the math C files to the build
                          +# Add the fixed precision math C files to the build
                           
                           CSRCS += lib_rint.c lib_fixedmath.c lib_b16sin.c lib_b16cos.c lib_b16atan2.c
                           
                          -# Add the math directory to the build
                          +# Add the fixed precision math directory to the build
                           
                          -DEPPATH += --dep-path math
                          -VPATH += :math
                          +DEPPATH += --dep-path fixedmath
                          +VPATH += :fixedmath
                          diff --git a/nuttx/lib/math/lib_b16atan2.c b/nuttx/libc/fixedmath/lib_b16atan2.c
                          similarity index 99%
                          rename from nuttx/lib/math/lib_b16atan2.c
                          rename to nuttx/libc/fixedmath/lib_b16atan2.c
                          index 8792fa0879..443ab7be34 100644
                          --- a/nuttx/lib/math/lib_b16atan2.c
                          +++ b/nuttx/libc/fixedmath/lib_b16atan2.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/math/lib_b16atan2.c
                          + * libc/fixedmath/lib_b16atan2.c
                            *
                            *   Copyright (C) 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/math/lib_b16cos.c b/nuttx/libc/fixedmath/lib_b16cos.c
                          similarity index 98%
                          rename from nuttx/lib/math/lib_b16cos.c
                          rename to nuttx/libc/fixedmath/lib_b16cos.c
                          index 7547871f63..0ebe482624 100644
                          --- a/nuttx/lib/math/lib_b16cos.c
                          +++ b/nuttx/libc/fixedmath/lib_b16cos.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/math/lib_b16cos.c
                          + * libc/fixedmath/lib_b16cos.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/math/lib_b16sin.c b/nuttx/libc/fixedmath/lib_b16sin.c
                          similarity index 99%
                          rename from nuttx/lib/math/lib_b16sin.c
                          rename to nuttx/libc/fixedmath/lib_b16sin.c
                          index 1eee179934..9cd2f0da3e 100644
                          --- a/nuttx/lib/math/lib_b16sin.c
                          +++ b/nuttx/libc/fixedmath/lib_b16sin.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/math/lib_b16sin.c
                          + * libc/fixedmath/lib_b16sin.c
                            *
                            *   Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/math/lib_fixedmath.c b/nuttx/libc/fixedmath/lib_fixedmath.c
                          similarity index 99%
                          rename from nuttx/lib/math/lib_fixedmath.c
                          rename to nuttx/libc/fixedmath/lib_fixedmath.c
                          index c1a710e739..9e9213b4fc 100644
                          --- a/nuttx/lib/math/lib_fixedmath.c
                          +++ b/nuttx/libc/fixedmath/lib_fixedmath.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/math/lib_fixedmath.c
                          + * libc/math/lib_fixedmath.c
                            *
                            *   Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/math/lib_rint.c b/nuttx/libc/fixedmath/lib_rint.c
                          similarity index 99%
                          rename from nuttx/lib/math/lib_rint.c
                          rename to nuttx/libc/fixedmath/lib_rint.c
                          index bd861ecedc..a1212c970b 100644
                          --- a/nuttx/lib/math/lib_rint.c
                          +++ b/nuttx/libc/fixedmath/lib_rint.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/math/lib_rint.c
                          + * libc/fixedmath/lib_rint.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/lib.csv b/nuttx/libc/lib.csv
                          similarity index 100%
                          rename from nuttx/lib/lib.csv
                          rename to nuttx/libc/lib.csv
                          diff --git a/nuttx/lib/lib_internal.h b/nuttx/libc/lib_internal.h
                          similarity index 79%
                          rename from nuttx/lib/lib_internal.h
                          rename to nuttx/libc/lib_internal.h
                          index 49cba9996f..c09c751d4a 100644
                          --- a/nuttx/lib/lib_internal.h
                          +++ b/nuttx/libc/lib_internal.h
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/lib_internal.h
                          + * libc/lib_internal.h
                            *
                            *   Copyright (C) 2007-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          @@ -117,57 +117,56 @@ extern bool g_dbgenable;
                           /* Defined in lib_streamsem.c */
                           
                           #if CONFIG_NFILE_STREAMS > 0
                          -extern void  stream_semtake(FAR struct streamlist *list);
                          -extern void  stream_semgive(FAR struct streamlist *list);
                          +void  stream_semtake(FAR struct streamlist *list);
                          +void  stream_semgive(FAR struct streamlist *list);
                           #endif
                           
                           /* Defined in lib_libnoflush.c */
                           
                           #ifdef CONFIG_STDIO_LINEBUFFER
                          -extern int lib_noflush(FAR struct lib_outstream_s *this);
                          +int lib_noflush(FAR struct lib_outstream_s *this);
                           #endif
                           
                           /* Defined in lib_libsprintf.c */
                           
                          -extern int lib_sprintf(FAR struct lib_outstream_s *obj,
                          +int lib_sprintf(FAR struct lib_outstream_s *obj,
                                                  const char *fmt, ...);
                           
                           /* Defined lib_libvsprintf.c */
                           
                          -extern int lib_vsprintf(FAR struct lib_outstream_s *obj,
                          -                        FAR const char *src, va_list ap);
                          +int lib_vsprintf(FAR struct lib_outstream_s *obj,
                          +                 FAR const char *src, va_list ap);
                           
                           /* Defined lib_rawprintf.c */
                           
                          -extern int lib_rawvprintf(const char *src, va_list ap);
                          -extern int lib_rawvdprintf(int fd, const char *fmt, va_list ap);
                          +int lib_rawvprintf(const char *src, va_list ap);
                           
                           /* Defined lib_lowprintf.c */
                           
                          -extern int lib_lowvprintf(const char *src, va_list ap);
                          +int lib_lowvprintf(const char *src, va_list ap);
                           
                           /* Defined in lib_dtoa.c */
                           
                           #ifdef CONFIG_LIBC_FLOATINGPOINT
                          -extern char *__dtoa(double d, int mode, int ndigits,
                          -                    int *decpt, int *sign, char **rve);
                          +char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign,
                          +             char **rve);
                           #endif
                           
                           /* Defined in lib_libwrite.c */
                           
                          -extern ssize_t lib_fwrite(FAR const void *ptr, size_t count, FAR FILE *stream);
                          +ssize_t lib_fwrite(FAR const void *ptr, size_t count, FAR FILE *stream);
                           
                           /* Defined in lib_libfread.c */
                           
                          -extern ssize_t lib_fread(FAR void *ptr, size_t count, FAR FILE *stream);
                          +ssize_t lib_fread(FAR void *ptr, size_t count, FAR FILE *stream);
                           
                           /* Defined in lib_libfflush.c */
                           
                          -extern ssize_t lib_fflush(FAR FILE *stream, bool bforce);
                          +ssize_t lib_fflush(FAR FILE *stream, bool bforce);
                           
                           /* Defined in lib_rdflush.c */
                           
                          -extern int lib_rdflush(FAR FILE *stream);
                          +int lib_rdflush(FAR FILE *stream);
                           
                           /* Defined in lib_wrflush.c */
                           
                          @@ -176,25 +175,37 @@ int lib_wrflush(FAR FILE *stream);
                           /* Defined in lib_sem.c */
                           
                           #if CONFIG_STDIO_BUFFER_SIZE > 0
                          -extern void lib_sem_initialize(FAR struct file_struct *stream);
                          -extern void lib_take_semaphore(FAR struct file_struct *stream);
                          -extern void lib_give_semaphore(FAR struct file_struct *stream);
                          +void lib_sem_initialize(FAR struct file_struct *stream);
                          +void lib_take_semaphore(FAR struct file_struct *stream);
                          +void lib_give_semaphore(FAR struct file_struct *stream);
                           #endif
                           
                           /* Defined in lib_libgetbase.c */
                           
                          -extern int lib_getbase(const char *nptr, const char **endptr);
                          +int lib_getbase(const char *nptr, const char **endptr);
                           
                           /* Defined in lib_skipspace.c */
                           
                          -extern void lib_skipspace(const char **pptr);
                          +void lib_skipspace(const char **pptr);
                           
                           /* Defined in lib_isbasedigit.c */
                           
                          -extern bool lib_isbasedigit(int ch, int base, int *value);
                          +bool lib_isbasedigit(int ch, int base, int *value);
                           
                           /* Defined in lib_checkbase.c */
                           
                          -extern int lib_checkbase(int base, const char **pptr);
                          +int lib_checkbase(int base, const char **pptr);
                          +
                          +/* Defined in lib_expi.c */
                          +
                          +#ifdef CONFIG_LIBM
                          +double lib_expi(size_t n);
                          +#endif
                          +
                          +/* Defined in lib_libsqrtapprox.c */
                          +
                          +#ifdef CONFIG_LIBM
                          +float lib_sqrtapprox(float x);
                          +#endif
                           
                           #endif /* __LIB_LIB_INTERNAL_H */
                          diff --git a/nuttx/lib/libgen/Make.defs b/nuttx/libc/libgen/Make.defs
                          similarity index 98%
                          rename from nuttx/lib/libgen/Make.defs
                          rename to nuttx/libc/libgen/Make.defs
                          index f126455124..6e786655d9 100644
                          --- a/nuttx/lib/libgen/Make.defs
                          +++ b/nuttx/libc/libgen/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/libgen/Make.defs
                          +# libc/libgen/Make.defs
                           #
                           #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/libgen/lib_basename.c b/nuttx/libc/libgen/lib_basename.c
                          similarity index 99%
                          rename from nuttx/lib/libgen/lib_basename.c
                          rename to nuttx/libc/libgen/lib_basename.c
                          index 986c6b8520..68188edbf5 100644
                          --- a/nuttx/lib/libgen/lib_basename.c
                          +++ b/nuttx/libc/libgen/lib_basename.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/libgen/lib_basename.c
                          + * libc/libgen/lib_basename.c
                            *
                            *   Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/libgen/lib_dirname.c b/nuttx/libc/libgen/lib_dirname.c
                          similarity index 99%
                          rename from nuttx/lib/libgen/lib_dirname.c
                          rename to nuttx/libc/libgen/lib_dirname.c
                          index 248293a605..6d076fd610 100644
                          --- a/nuttx/lib/libgen/lib_dirname.c
                          +++ b/nuttx/libc/libgen/lib_dirname.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/libgen/lib_dirname.c
                          + * libc/libgen/lib_dirname.c
                            *
                            *   Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/libc/math/Kconfig b/nuttx/libc/math/Kconfig
                          new file mode 100644
                          index 0000000000..c24bfd53f3
                          --- /dev/null
                          +++ b/nuttx/libc/math/Kconfig
                          @@ -0,0 +1,26 @@
                          +#
                          +# For a description of the syntax of this configuration file,
                          +# see misc/tools/kconfig-language.txt.
                          +#
                          +
                          +config LIBM
                          +	bool "Math library"
                          +	default n
                          +	depends on !ARCH_MATH_H
                          +	---help---
                          +		By default, no math library will be provided by NuttX.  In this this case, it
                          +		is assumed that (1) no math library is required, or (2) you will be using the
                          +		math.h header file and the libm library provided by your toolchain.
                          +
                          +		This is may be a very good choice is possible because your toolchain may have
                          +		have a highly optimized version of libm.
                          +
                          +		Another possibility is that you have a custom, architecture-specific math
                          +		libary and that the corresponding math.h file resides at arch//include/math.h.
                          +		The option is selected via ARCH_MATH_H.  If ARCH_MATH_H is selected,then the include/nuttx/math.h
                          + 		header file will be copied to include/math.h where it can be used by your applications.
                          +
                          +		If ARCH_MATH_H is not defined, then this option can be selected to build a generic,
                          +		math library built into NuttX.  This math library comes from the Rhombus OS and
                          +		was written by Nick Johnson.  The Rhombus OS math library port was contributed by
                          +		Darcy Gong.
                          diff --git a/nuttx/libc/math/lib_acos.c b/nuttx/libc/math/lib_acos.c
                          new file mode 100644
                          index 0000000000..147003237f
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_acos.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_acos.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double acos(double x)
                          +{
                          +  return (M_PI_2 - asin(x));
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_acosf.c b/nuttx/libc/math/lib_acosf.c
                          new file mode 100644
                          index 0000000000..447b2767f1
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_acosf.c
                          @@ -0,0 +1,41 @@
                          +/************************************************************************
                          + * libc/math/lib_acosf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float acosf(float x)
                          +{
                          +  return (M_PI_2 - asinf(x));
                          +}
                          diff --git a/nuttx/libc/math/lib_acosl.c b/nuttx/libc/math/lib_acosl.c
                          new file mode 100644
                          index 0000000000..a0f2262380
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_acosl.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_acos.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double acosl(long double x)
                          +{
                          +  return (M_PI_2 - asinl(x));
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_asin.c b/nuttx/libc/math/lib_asin.c
                          new file mode 100644
                          index 0000000000..d9941a7e5b
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_asin.c
                          @@ -0,0 +1,69 @@
                          +/************************************************************************
                          + * libc/math/lib_sin.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double asin(double x)
                          +{
                          +  long double y, y_sin, y_cos;
                          +
                          +  y = 0;
                          +
                          +  while (1)
                          +    {
                          +      y_sin = sin(y);
                          +      y_cos = cos(y);
                          +
                          +      if (y > M_PI_2 || y < -M_PI_2)
                          +        {
                          +          y = fmod(y, M_PI);
                          +        }
                          +
                          +      if (y_sin + DBL_EPSILON >= x && y_sin - DBL_EPSILON <= x)
                          +        {
                          +          break;
                          +        }
                          +
                          +      y = y - (y_sin - x) / y_cos;
                          +    }
                          +
                          +  return y;
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_asinf.c b/nuttx/libc/math/lib_asinf.c
                          new file mode 100644
                          index 0000000000..57e518acb4
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_asinf.c
                          @@ -0,0 +1,65 @@
                          +/************************************************************************
                          + * libc/math/lib_sinf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float asinf(float x)
                          +{
                          +  long double y, y_sin, y_cos;
                          +
                          +  y = 0;
                          +
                          +  while (1)
                          +    {
                          +      y_sin = sinf(y);
                          +      y_cos = cosf(y);
                          +
                          +      if (y > M_PI_2 || y < -M_PI_2)
                          +        {
                          +          y = fmodf(y, M_PI);
                          +        }
                          +
                          +      if (y_sin + FLT_EPSILON >= x && y_sin - FLT_EPSILON <= x)
                          +        {
                          +          break;
                          +        }
                          +
                          +      y = y - (y_sin - x) / y_cos;
                          +    }
                          +
                          +  return y;
                          +}
                          +
                          diff --git a/nuttx/libc/math/lib_asinl.c b/nuttx/libc/math/lib_asinl.c
                          new file mode 100644
                          index 0000000000..19f284e535
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_asinl.c
                          @@ -0,0 +1,69 @@
                          +/************************************************************************
                          + * libc/math/lib_sinl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double asinl(long double x)
                          +{
                          +  long double y, y_sin, y_cos;
                          +
                          +  y = 0;
                          +
                          +  while (1)
                          +    {
                          +      y_sin = sinl(y);
                          +      y_cos = cosl(y);
                          +
                          +      if (y > M_PI_2 || y < -M_PI_2)
                          +        {
                          +          y = fmodl(y, M_PI);
                          +        }
                          +
                          +      if (y_sin + LDBL_EPSILON >= x && y_sin - LDBL_EPSILON <= x)
                          +        {
                          +          break;
                          +        }
                          +
                          +      y = y - (y_sin - x) / y_cos;
                          +    }
                          +
                          +  return y;
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_atan.c b/nuttx/libc/math/lib_atan.c
                          new file mode 100644
                          index 0000000000..44d68ece2f
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_atan.c
                          @@ -0,0 +1,48 @@
                          +/************************************************************************
                          + * libc/math/lib_atan.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double atan(double x)
                          +{
                          +  return asin(x / sqrt(x * x + 1));
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_atan2.c b/nuttx/libc/math/lib_atan2.c
                          new file mode 100644
                          index 0000000000..6d7d2ad482
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_atan2.c
                          @@ -0,0 +1,86 @@
                          +/************************************************************************
                          + * libc/math/lib_atan2.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double atan2(double y, double x)
                          +{
                          +  if (y == 0.0)
                          +    {
                          +      if (x >= 0.0)
                          +        {
                          +          return 0.0;
                          +        }
                          +      else
                          +        {
                          +          return M_PI;
                          +        }
                          +    }
                          +  else if (y > 0.0)
                          +    {
                          +      if (x == 0.0)
                          +        {
                          +          return M_PI_2;
                          +        }
                          +      else if (x > 0.0)
                          +        {
                          +          return atan(y / x);
                          +        }
                          +      else
                          +        {
                          +          return M_PI - atan(y / x);
                          +        }
                          +    }
                          +  else
                          +    {
                          +      if (x == 0.0)
                          +        {
                          +          return M_PI + M_PI_2;
                          +        }
                          +      else if (x > 0.0)
                          +        {
                          +          return 2 * M_PI - atan(y / x);
                          +        }
                          +      else
                          +        {
                          +          return M_PI + atan(y / x);
                          +        }
                          +    }
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_atan2f.c b/nuttx/libc/math/lib_atan2f.c
                          new file mode 100644
                          index 0000000000..7ff9af1305
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_atan2f.c
                          @@ -0,0 +1,81 @@
                          +/************************************************************************
                          + * libc/math/lib_atan2f.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float atan2f(float y, float x)
                          +{
                          +  if (y == 0.0)
                          +    {
                          +      if (x >= 0.0)
                          +        {
                          +          return 0.0;
                          +        }
                          +      else
                          +        {
                          +          return M_PI;
                          +        }
                          +    }
                          +  else if (y > 0.0)
                          +    {
                          +      if (x == 0.0)
                          +        {
                          +          return M_PI_2;
                          +        }
                          +      else if (x > 0.0)
                          +        {
                          +          return atanf(y / x);
                          +        }
                          +      else
                          +        {
                          +          return M_PI - atanf(y / x);
                          +        }
                          +    }
                          +  else
                          +    {
                          +      if (x == 0.0)
                          +        {
                          +          return M_PI + M_PI_2;
                          +        }
                          +      else if (x > 0.0)
                          +        {
                          +          return 2 * M_PI - atanf(y / x);
                          +        }
                          +      else
                          +        {
                          +          return M_PI + atanf(y / x);
                          +        }
                          +    }
                          +}
                          diff --git a/nuttx/libc/math/lib_atan2l.c b/nuttx/libc/math/lib_atan2l.c
                          new file mode 100644
                          index 0000000000..48bfd06f39
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_atan2l.c
                          @@ -0,0 +1,87 @@
                          +/************************************************************************
                          + * libc/math/lib_atan2l.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double atan2l(long double y, long double x)
                          +{
                          +
                          +  if (y == 0.0)
                          +    {
                          +      if (x >= 0.0)
                          +        {
                          +          return 0.0;
                          +        }
                          +      else
                          +        {
                          +          return M_PI;
                          +        }
                          +    }
                          +  else if (y > 0.0)
                          +    {
                          +      if (x == 0.0)
                          +        {
                          +          return M_PI_2;
                          +        }
                          +      else if (x > 0.0)
                          +        {
                          +          return atanl(y / x);
                          +        }
                          +      else
                          +        {
                          +          return M_PI - atanl(y / x);
                          +        }
                          +    }
                          +  else
                          +    {
                          +      if (x == 0.0)
                          +        {
                          +          return M_PI + M_PI_2;
                          +        }
                          +      else if (x > 0.0)
                          +        {
                          +          return 2 * M_PI - atanl(y / x);
                          +        }
                          +      else
                          +        {
                          +          return M_PI + atanl(y / x);
                          +        }
                          +    }
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_atanf.c b/nuttx/libc/math/lib_atanf.c
                          new file mode 100644
                          index 0000000000..a84605787a
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_atanf.c
                          @@ -0,0 +1,43 @@
                          +/************************************************************************
                          + * libc/math/lib_atanf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float atanf(float x)
                          +{
                          +  return asinf(x / sqrtf(x * x + 1));
                          +}
                          diff --git a/nuttx/libc/math/lib_atanl.c b/nuttx/libc/math/lib_atanl.c
                          new file mode 100644
                          index 0000000000..752d493070
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_atanl.c
                          @@ -0,0 +1,48 @@
                          +/************************************************************************
                          + * libc/math/lib_atanl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double atanl(long double x)
                          +{
                          +  return asinl(x / sqrtl(x * x + 1));
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_ceil.c b/nuttx/libc/math/lib_ceil.c
                          new file mode 100644
                          index 0000000000..3c6678dc1d
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_ceil.c
                          @@ -0,0 +1,52 @@
                          +/************************************************************************
                          + * libc/math/lib_ceil.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double ceil(double x)
                          +{
                          +  modf(x, &x);
                          +  if (x > 0.0)
                          +    {
                          +      x += 1.0;
                          +    }
                          +
                          +  return x;
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_ceilf.c b/nuttx/libc/math/lib_ceilf.c
                          new file mode 100644
                          index 0000000000..afbe2cf13b
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_ceilf.c
                          @@ -0,0 +1,47 @@
                          +/************************************************************************
                          + * libc/math/lib_ceilf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float ceilf(float x)
                          +{
                          +  modff(x, &x);
                          +  if (x > 0.0)
                          +    {
                          +      x += 1.0;
                          +    }
                          +
                          +  return x;
                          +}
                          diff --git a/nuttx/libc/math/lib_ceill.c b/nuttx/libc/math/lib_ceill.c
                          new file mode 100644
                          index 0000000000..757016b530
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_ceill.c
                          @@ -0,0 +1,52 @@
                          +/************************************************************************
                          + * libc/math/lib_ceil;.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double ceill(long double x)
                          +{
                          +  modfl(x, &x);
                          +  if (x > 0.0)
                          +    {
                          +      x += 1.0;
                          +    }
                          +
                          +  return x;
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_cos.c b/nuttx/libc/math/lib_cos.c
                          new file mode 100644
                          index 0000000000..4b4e1a20b9
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_cos.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_cos.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double cos(double x)
                          +{
                          +  return sin(x + M_PI_2);
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_cosf.c b/nuttx/libc/math/lib_cosf.c
                          new file mode 100644
                          index 0000000000..d9ac951f62
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_cosf.c
                          @@ -0,0 +1,41 @@
                          +/************************************************************************
                          + * libc/math/lib_cosf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float cosf(float x)
                          +{
                          +  return sinf(x + M_PI_2);
                          +}
                          diff --git a/nuttx/libc/math/lib_cosh.c b/nuttx/libc/math/lib_cosh.c
                          new file mode 100644
                          index 0000000000..3246ea5f96
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_cosh.c
                          @@ -0,0 +1,47 @@
                          +/************************************************************************
                          + * libc/math/lib_cosh.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double cosh(double x)
                          +{
                          +  x = exp(x);
                          +  return ((x + (1.0 / x)) / 2.0);
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_coshf.c b/nuttx/libc/math/lib_coshf.c
                          new file mode 100644
                          index 0000000000..f0c28ab2ea
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_coshf.c
                          @@ -0,0 +1,42 @@
                          +/************************************************************************
                          + * libc/math/lib_coshf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float coshf(float x)
                          +{
                          +  x = expf(x);
                          +  return ((x + (1.0 / x)) / 2.0);
                          +}
                          diff --git a/nuttx/libc/math/lib_coshl.c b/nuttx/libc/math/lib_coshl.c
                          new file mode 100644
                          index 0000000000..957ec61a73
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_coshl.c
                          @@ -0,0 +1,47 @@
                          +/************************************************************************
                          + * libc/math/lib_coshl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double coshl(long double x)
                          +{
                          +  x = expl(x);
                          +  return ((x + (1.0 / x)) / 2.0);
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_cosl.c b/nuttx/libc/math/lib_cosl.c
                          new file mode 100644
                          index 0000000000..972d4aa9da
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_cosl.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_cosl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double cosl(long double x)
                          +{
                          +  return sinl(x + M_PI_2);
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_exp.c b/nuttx/libc/math/lib_exp.c
                          new file mode 100644
                          index 0000000000..62494251de
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_exp.c
                          @@ -0,0 +1,126 @@
                          +/************************************************************************
                          + * libc/math/lib_exp.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +
                          +#include "lib_internal.h"
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +
                          +/************************************************************************
                          + * Private Data
                          + ************************************************************************/
                          +
                          +static double _dbl_inv_fact[] =
                          +{
                          +  1.0 / 1.0,                    // 1 / 0!
                          +  1.0 / 1.0,                    // 1 / 1!
                          +  1.0 / 2.0,                    // 1 / 2!
                          +  1.0 / 6.0,                    // 1 / 3!
                          +  1.0 / 24.0,                   // 1 / 4!
                          +  1.0 / 120.0,                  // 1 / 5!
                          +  1.0 / 720.0,                  // 1 / 6!
                          +  1.0 / 5040.0,                 // 1 / 7!
                          +  1.0 / 40320.0,                // 1 / 8!
                          +  1.0 / 362880.0,               // 1 / 9!
                          +  1.0 / 3628800.0,              // 1 / 10!
                          +  1.0 / 39916800.0,             // 1 / 11!
                          +  1.0 / 479001600.0,            // 1 / 12!
                          +  1.0 / 6227020800.0,           // 1 / 13!
                          +  1.0 / 87178291200.0,          // 1 / 14!
                          +  1.0 / 1307674368000.0,        // 1 / 15!
                          +  1.0 / 20922789888000.0,       // 1 / 16!
                          +  1.0 / 355687428096000.0,      // 1 / 17!
                          +  1.0 / 6402373705728000.0,     // 1 / 18!
                          +};
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +double exp(double x)
                          +{
                          +  size_t int_part;
                          +  bool invert;
                          +  double value;
                          +  double x0;
                          +  size_t i;
                          +
                          +  if (x == 0)
                          +    {
                          +      return 1;
                          +    }
                          +  else if (x < 0)
                          +    {
                          +      invert = true;
                          +      x = -x;
                          +    }
                          +  else
                          +    {
                          +      invert = false;
                          +    }
                          +
                          +  /* Extract integer component */
                          +
                          +  int_part = (size_t) x;
                          +
                          +  /* Set x to fractional component */
                          +
                          +  x -= (double)int_part;
                          +
                          +  /* Perform Taylor series approximation with nineteen terms */
                          +
                          +  value = 0.0;
                          +  x0 = 1.0;
                          +  for (i = 0; i < 19; i++)
                          +    {
                          +      value += x0 * _dbl_inv_fact[i];
                          +      x0 *= x;
                          +    }
                          +
                          +  /* Multiply by exp of the integer component */
                          +
                          +  value *= lib_expi(int_part);
                          +
                          +  if (invert)
                          +    {
                          +      return (1.0 / value);
                          +    }
                          +  else
                          +    {
                          +      return value;
                          +    }
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_expf.c b/nuttx/libc/math/lib_expf.c
                          new file mode 100644
                          index 0000000000..3e43c54a6c
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_expf.c
                          @@ -0,0 +1,112 @@
                          +/************************************************************************
                          + * libc/math/lib_expf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include "lib_internal.h"
                          +
                          +/************************************************************************
                          + * Private Data
                          + ************************************************************************/
                          +
                          +static float _flt_inv_fact[] =
                          +{
                          +  1.0 / 1.0,                    // 1/0!
                          +  1.0 / 1.0,                    // 1/1!
                          +  1.0 / 2.0,                    // 1/2!
                          +  1.0 / 6.0,                    // 1/3!
                          +  1.0 / 24.0,                   // 1/4!
                          +  1.0 / 120.0,                  // 1/5!
                          +  1.0 / 720.0,                  // 1/6!
                          +  1.0 / 5040.0,                 // 1/7!
                          +  1.0 / 40320.0,                // 1/8!
                          +  1.0 / 362880.0,               // 1/9!
                          +  1.0 / 3628800.0,              // 1/10!
                          +};
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float expf(float x)
                          +{
                          +  size_t int_part;
                          +  bool invert;
                          +  float value;
                          +  float x0;
                          +  size_t i;
                          +
                          +  if (x == 0)
                          +    {
                          +      return 1;
                          +    }
                          +  else if (x < 0)
                          +    {
                          +      invert = true;
                          +      x = -x;
                          +    }
                          +  else
                          +    {
                          +      invert = false;
                          +    }
                          +
                          +  /* Extract integer component */
                          +
                          +  int_part = (size_t) x;
                          +
                          +  /* set x to fractional component */
                          +
                          +  x -= (float)int_part;
                          +
                          +  /* Perform Taylor series approximation with eleven terms */
                          +
                          +  value = 0.0;
                          +  x0 = 1.0;
                          +  for (i = 0; i < 10; i++)
                          +    {
                          +      value += x0 * _flt_inv_fact[i];
                          +      x0 *= x;
                          +    }
                          +
                          +  /* Multiply by exp of the integer component */
                          +
                          +  value *= lib_expi(int_part);
                          +
                          +  if (invert)
                          +    {
                          +      return (1.0 / value);
                          +    }
                          +  else
                          +    {
                          +      return value;
                          +    }
                          +}
                          diff --git a/nuttx/libc/math/lib_expl.c b/nuttx/libc/math/lib_expl.c
                          new file mode 100644
                          index 0000000000..231faa35f1
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_expl.c
                          @@ -0,0 +1,126 @@
                          +/************************************************************************
                          + * libc/math/lib_expl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +
                          +#include "lib_internal.h"
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +
                          +/************************************************************************
                          + * Private Data
                          + ************************************************************************/
                          +
                          +static long double _ldbl_inv_fact[] =
                          +{
                          +  1.0 / 1.0,                    // 1 / 0!
                          +  1.0 / 1.0,                    // 1 / 1!
                          +  1.0 / 2.0,                    // 1 / 2!
                          +  1.0 / 6.0,                    // 1 / 3!
                          +  1.0 / 24.0,                   // 1 / 4!
                          +  1.0 / 120.0,                  // 1 / 5!
                          +  1.0 / 720.0,                  // 1 / 6!
                          +  1.0 / 5040.0,                 // 1 / 7!
                          +  1.0 / 40320.0,                // 1 / 8!
                          +  1.0 / 362880.0,               // 1 / 9!
                          +  1.0 / 3628800.0,              // 1 / 10!
                          +  1.0 / 39916800.0,             // 1 / 11!
                          +  1.0 / 479001600.0,            // 1 / 12!
                          +  1.0 / 6227020800.0,           // 1 / 13!
                          +  1.0 / 87178291200.0,          // 1 / 14!
                          +  1.0 / 1307674368000.0,        // 1 / 15!
                          +  1.0 / 20922789888000.0,       // 1 / 16!
                          +  1.0 / 355687428096000.0,      // 1 / 17!
                          +  1.0 / 6402373705728000.0,     // 1 / 18!
                          +};
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +long double expl(long double x)
                          +{
                          +  size_t int_part;
                          +  bool invert;
                          +  long double value;
                          +  long double x0;
                          +  size_t i;
                          +
                          +  if (x == 0)
                          +    {
                          +      return 1;
                          +    }
                          +  else if (x < 0)
                          +    {
                          +      invert = true;
                          +      x = -x;
                          +    }
                          +  else
                          +    {
                          +      invert = false;
                          +    }
                          +
                          +  /* Extract integer component */
                          +
                          +  int_part = (size_t) x;
                          +
                          +  /* Set x to fractional component */
                          +
                          +  x -= (long double)int_part;
                          +
                          +  /* Perform Taylor series approximation with nineteen terms */
                          +
                          +  value = 0.0;
                          +  x0 = 1.0;
                          +  for (i = 0; i < 19; i++)
                          +    {
                          +      value += x0 * _ldbl_inv_fact[i];
                          +      x0 *= x;
                          +    }
                          +
                          +  /* Multiply by exp of the integer component */
                          +
                          +  value *= lib_expi(int_part);
                          +
                          +  if (invert)
                          +    {
                          +      return (1.0 / value);
                          +    }
                          +  else
                          +    {
                          +      return value;
                          +    }
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_fabs.c b/nuttx/libc/math/lib_fabs.c
                          new file mode 100644
                          index 0000000000..774755087b
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_fabs.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_fabs.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double fabs(double x)
                          +{
                          +  return ((x < 0) ? -x : x);
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_fabsf.c b/nuttx/libc/math/lib_fabsf.c
                          new file mode 100644
                          index 0000000000..4c8ebae620
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_fabsf.c
                          @@ -0,0 +1,41 @@
                          +/************************************************************************
                          + * libc/math/lib_fabsf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float fabsf(float x)
                          +{
                          +  return ((x < 0) ? -x : x);
                          +}
                          diff --git a/nuttx/libc/math/lib_fabsl.c b/nuttx/libc/math/lib_fabsl.c
                          new file mode 100644
                          index 0000000000..96ac7d5db3
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_fabsl.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_fabsl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double fabsl(long double x)
                          +{
                          +  return ((x < 0) ? -x : x);
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_floor.c b/nuttx/libc/math/lib_floor.c
                          new file mode 100644
                          index 0000000000..3330607ce9
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_floor.c
                          @@ -0,0 +1,52 @@
                          +/************************************************************************
                          + * libc/math/lib_floor.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double floor(double x)
                          +{
                          +  modf(x, &x);
                          +  if (x < 0.0)
                          +    {
                          +      x -= 1.0;
                          +    }
                          +
                          +  return x;
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_floorf.c b/nuttx/libc/math/lib_floorf.c
                          new file mode 100644
                          index 0000000000..81483d4c9c
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_floorf.c
                          @@ -0,0 +1,47 @@
                          +/************************************************************************
                          + * libc/math/lib_floorf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float floorf(float x)
                          +{
                          +  modff(x, &x);
                          +  if (x < 0.0)
                          +    {
                          +      x -= 1.0;
                          +    }
                          +
                          +  return x;
                          +}
                          diff --git a/nuttx/libc/math/lib_floorl.c b/nuttx/libc/math/lib_floorl.c
                          new file mode 100644
                          index 0000000000..0d9ec43b45
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_floorl.c
                          @@ -0,0 +1,52 @@
                          +/************************************************************************
                          + * libc/math/lib_floorl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double floorl(long double x)
                          +{
                          +  modfl(x, &x);
                          +  if (x < 0.0)
                          +    {
                          +      x -= 1.0;
                          +    }
                          +
                          +  return x;
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_fmod.c b/nuttx/libc/math/lib_fmod.c
                          new file mode 100644
                          index 0000000000..c66210cdea
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_fmod.c
                          @@ -0,0 +1,52 @@
                          +/************************************************************************
                          + * libc/math/lib_fmod.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double fmod(double x, double div)
                          +{
                          +  double n0;
                          +
                          +  x /= div;
                          +  x = modf(x, &n0);
                          +  x *= div;
                          +
                          +  return x;
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_fmodf.c b/nuttx/libc/math/lib_fmodf.c
                          new file mode 100644
                          index 0000000000..d70bb791ca
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_fmodf.c
                          @@ -0,0 +1,47 @@
                          +/************************************************************************
                          + * libc/math/lib_fmodf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float fmodf(float x, float div)
                          +{
                          +  float n0;
                          +
                          +  x /= div;
                          +  x = modff(x, &n0);
                          +  x *= div;
                          +
                          +  return x;
                          +}
                          diff --git a/nuttx/libc/math/lib_fmodl.c b/nuttx/libc/math/lib_fmodl.c
                          new file mode 100644
                          index 0000000000..1299bf6e89
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_fmodl.c
                          @@ -0,0 +1,52 @@
                          +/************************************************************************
                          + * libc/math/lib_fmodl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double fmodl(long double x, long double div)
                          +{
                          +  long double n0;
                          +
                          +  x /= div;
                          +  x = modfl(x, &n0);
                          +  x *= div;
                          +
                          +  return x;
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_frexp.c b/nuttx/libc/math/lib_frexp.c
                          new file mode 100644
                          index 0000000000..b9576dfd4d
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_frexp.c
                          @@ -0,0 +1,47 @@
                          +/************************************************************************
                          + * libc/math/lib_frexp.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double frexp(double x, int *exponent)
                          +{
                          +  *exponent = (int)ceil(log2(x));
                          +  return x / ldexp(1.0, *exponent);
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_frexpf.c b/nuttx/libc/math/lib_frexpf.c
                          new file mode 100644
                          index 0000000000..d93ffb1731
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_frexpf.c
                          @@ -0,0 +1,42 @@
                          +/************************************************************************
                          + * libc/math/lib_frexpf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float frexpf(float x, int *exponent)
                          +{
                          +  *exponent = (int)ceilf(log2f(x));
                          +  return x / ldexpf(1.0, *exponent);
                          +}
                          diff --git a/nuttx/libc/math/lib_frexpl.c b/nuttx/libc/math/lib_frexpl.c
                          new file mode 100644
                          index 0000000000..90993b137b
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_frexpl.c
                          @@ -0,0 +1,47 @@
                          +/************************************************************************
                          + * libc/math/lib_frexpl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double frexpl(long double x, int *exponent)
                          +{
                          +  *exponent = (int)ceill(log2(x));
                          +  return x / ldexpl(1.0, *exponent);
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_ldexp.c b/nuttx/libc/math/lib_ldexp.c
                          new file mode 100644
                          index 0000000000..9b74d53d71
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_ldexp.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_ldexp.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double ldexp(double x, int n)
                          +{
                          +  return (x * pow(2.0, (double)n));
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_ldexpf.c b/nuttx/libc/math/lib_ldexpf.c
                          new file mode 100644
                          index 0000000000..f3aaf555b4
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_ldexpf.c
                          @@ -0,0 +1,41 @@
                          +/************************************************************************
                          + * libc/math/lib_ldexpf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float ldexpf(float x, int n)
                          +{
                          +  return (x * powf(2.0, (float)n));
                          +}
                          diff --git a/nuttx/libc/math/lib_ldexpl.c b/nuttx/libc/math/lib_ldexpl.c
                          new file mode 100644
                          index 0000000000..29764aaba3
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_ldexpl.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_ldexpl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double ldexpl(long double x, int n)
                          +{
                          +  return (x * powl(2.0, (long double)n));
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_libexpi.c b/nuttx/libc/math/lib_libexpi.c
                          new file mode 100644
                          index 0000000000..33ba537b1e
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_libexpi.c
                          @@ -0,0 +1,103 @@
                          +/************************************************************************
                          + * libc/math/lib_libexpi.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Pre-processor Definitions
                          + ************************************************************************/
                          +
                          +#define M_E2    (M_E * M_E)
                          +#define M_E4    (M_E2 * M_E2)
                          +#define M_E8    (M_E4 * M_E4)
                          +#define M_E16   (M_E8 * M_E8)
                          +#define M_E32   (M_E16 * M_E16)
                          +#define M_E64   (M_E32 * M_E32)
                          +#define M_E128  (M_E64 * M_E64)
                          +#define M_E256  (M_E128 * M_E128)
                          +#define M_E512  (M_E256 * M_E256)
                          +#define M_E1024 (M_E512 * M_E512)
                          +
                          +/************************************************************************
                          + * Private Data
                          + ************************************************************************/
                          +
                          +static double _expi_square_tbl[11] =
                          +{
                          +  M_E,                          // e^1
                          +  M_E2,                         // e^2
                          +  M_E4,                         // e^4
                          +  M_E8,                         // e^8
                          +  M_E16,                        // e^16
                          +  M_E32,                        // e^32
                          +  M_E64,                        // e^64
                          +  M_E128,                       // e^128
                          +  M_E256,                       // e^256
                          +  M_E512,                       // e^512
                          +  M_E1024,                      // e^1024
                          +};
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +double lib_expi(size_t n)
                          +{
                          +  size_t i;
                          +  double val;
                          +
                          +  if (n > 1024)
                          +    {
                          +      return INFINITY;
                          +    }
                          +
                          +  val = 1.0;
                          +
                          +  for (i = 0; n; i++)
                          +    {
                          +      if (n & (1 << i))
                          +        {
                          +          n   &= ~(1 << i);
                          +          val *= _expi_square_tbl[i];
                          +        }
                          +    }
                          +
                          +  return val;
                          +}
                          +
                          diff --git a/nuttx/libc/math/lib_libsqrtapprox.c b/nuttx/libc/math/lib_libsqrtapprox.c
                          new file mode 100644
                          index 0000000000..b6a9b0d54c
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_libsqrtapprox.c
                          @@ -0,0 +1,50 @@
                          +/************************************************************************
                          + * libc/math/lib_libsqrtapprox.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float lib_sqrtapprox(float x)
                          +{
                          +  int32_t i;
                          +
                          +  /* Floats + bit manipulation = +inf fun! */
                          +
                          +  i = *((int32_t *) & x);
                          +  i = 0x1fc00000 + (i >> 1);
                          +  x = *((float *)&i);
                          +
                          +  return x;
                          +}
                          diff --git a/nuttx/libc/math/lib_log.c b/nuttx/libc/math/lib_log.c
                          new file mode 100644
                          index 0000000000..7156f6b411
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_log.c
                          @@ -0,0 +1,82 @@
                          +/************************************************************************
                          + * libc/math/lib_log.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double log(double x)
                          +{
                          +  double y, y_old, ey, epsilon;
                          +
                          +  y = 0.0;
                          +  y_old = 1.0;
                          +  epsilon = DBL_EPSILON;
                          +
                          +  while (y > y_old + epsilon || y < y_old - epsilon)
                          +    {
                          +      y_old = y;
                          +      ey = exp(y);
                          +      y -= (ey - x) / ey;
                          +
                          +      if (y > 700.0)
                          +        {
                          +          y = 700.0;
                          +        }
                          +
                          +      if (y < -700.0)
                          +        {
                          +          y = -700.0;
                          +        }
                          +
                          +      epsilon = (fabs(y) > 1.0) ? fabs(y) * DBL_EPSILON : DBL_EPSILON;
                          +    }
                          +
                          +  if (y == 700.0)
                          +    {
                          +      return INFINITY;
                          +    }
                          +
                          +  if (y == -700.0)
                          +    {
                          +      return INFINITY;
                          +    }
                          +
                          +  return y;
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_log10.c b/nuttx/libc/math/lib_log10.c
                          new file mode 100644
                          index 0000000000..9daa914925
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_log10.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_log10.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double log10(double x)
                          +{
                          +  return (log(x) / M_LN10);
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_log10f.c b/nuttx/libc/math/lib_log10f.c
                          new file mode 100644
                          index 0000000000..778daedd5b
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_log10f.c
                          @@ -0,0 +1,41 @@
                          +/************************************************************************
                          + * libc/math/lib_log10f.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float log10f(float x)
                          +{
                          +  return (logf(x) / M_LN10);
                          +}
                          diff --git a/nuttx/libc/math/lib_log10l.c b/nuttx/libc/math/lib_log10l.c
                          new file mode 100644
                          index 0000000000..efbeb721b4
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_log10l.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_log10l.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double log10l(long double x)
                          +{
                          +  return (logl(x) / M_LN10);
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_log2.c b/nuttx/libc/math/lib_log2.c
                          new file mode 100644
                          index 0000000000..4da39acdc3
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_log2.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_log2.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double log2(double x)
                          +{
                          +  return (log(x) / M_LN2);
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_log2f.c b/nuttx/libc/math/lib_log2f.c
                          new file mode 100644
                          index 0000000000..f514e5a9e0
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_log2f.c
                          @@ -0,0 +1,41 @@
                          +/************************************************************************
                          + * libc/math/lib_log2f.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float log2f(float x)
                          +{
                          +  return (logf(x) / M_LN2);
                          +}
                          diff --git a/nuttx/libc/math/lib_log2l.c b/nuttx/libc/math/lib_log2l.c
                          new file mode 100644
                          index 0000000000..21e80a930f
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_log2l.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_log2l.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double log2l(long double x)
                          +{
                          +  return (logl(x) / M_LN2);
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_logf.c b/nuttx/libc/math/lib_logf.c
                          new file mode 100644
                          index 0000000000..3815fef84c
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_logf.c
                          @@ -0,0 +1,77 @@
                          +/************************************************************************
                          + * libc/math/lib_logf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float logf(float x)
                          +{
                          +  float y, y_old, ey, epsilon;
                          +
                          +  y = 0.0;
                          +  y_old = 1.0;
                          +  epsilon = FLT_EPSILON;
                          +
                          +  while (y > y_old + epsilon || y < y_old - epsilon)
                          +    {
                          +      y_old = y;
                          +      ey = exp(y);
                          +      y -= (ey - x) / ey;
                          +
                          +      if (y > 700.0)
                          +        {
                          +          y = 700.0;
                          +        }
                          +
                          +      if (y < -700.0)
                          +        {
                          +          y = -700.0;
                          +        }
                          +
                          +      epsilon = (fabs(y) > 1.0) ? fabs(y) * FLT_EPSILON : FLT_EPSILON;
                          +    }
                          +
                          +  if (y == 700.0)
                          +    {
                          +      return INFINITY;
                          +    }
                          +
                          +  if (y == -700.0)
                          +    {
                          +      return INFINITY;
                          +    }
                          +
                          +  return y;
                          +}
                          diff --git a/nuttx/libc/math/lib_logl.c b/nuttx/libc/math/lib_logl.c
                          new file mode 100644
                          index 0000000000..6128160114
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_logl.c
                          @@ -0,0 +1,80 @@
                          +/************************************************************************
                          + * libc/math/lib_lol.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double logl(long double x)
                          +{
                          +  long double y, y_old, ey, epsilon;
                          +
                          +  y = 0.0;
                          +  y_old = 1.0;
                          +  epsilon = LDBL_EPSILON;
                          +
                          +  while (y > y_old + epsilon || y < y_old - epsilon)
                          +    {
                          +      y_old = y;
                          +      ey = expl(y);
                          +      y -= (ey - x) / ey;
                          +
                          +      if (y > 700.0)
                          +        {
                          +          y = 700.0;
                          +        }
                          +
                          +      if (y < -700.0)
                          +        {
                          +          y = -700.0;
                          +        }
                          +    }
                          +
                          +  if (y == 700.0)
                          +    {
                          +      return INFINITY;
                          +    }
                          +
                          +  if (y == -700.0)
                          +    {
                          +      return INFINITY;
                          +    }
                          +
                          +  return y;
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_modf.c b/nuttx/libc/math/lib_modf.c
                          new file mode 100644
                          index 0000000000..f3f25f6fb0
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_modf.c
                          @@ -0,0 +1,58 @@
                          +/************************************************************************
                          + * libc/math/lib_modf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double modf(double x, double *iptr)
                          +{
                          +  if (fabs(x) >= 4503599627370496.0)
                          +    {
                          +      *iptr = x;
                          +      return 0.0;
                          +    }
                          +  else if (fabs(x) < 1.0)
                          +    {
                          +      *iptr = 0.0;
                          +      return x;
                          +    }
                          +  else
                          +    {
                          +      *iptr = (double)(int64_t) x;
                          +      return (x - *iptr);
                          +    }
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_modff.c b/nuttx/libc/math/lib_modff.c
                          new file mode 100644
                          index 0000000000..28d3a3ae0b
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_modff.c
                          @@ -0,0 +1,55 @@
                          +/************************************************************************
                          + * libc/math/lib_modff.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float modff(float x, float *iptr)
                          +{
                          +  if (fabsf(x) >= 8388608.0)
                          +    {
                          +      *iptr = x;
                          +      return 0.0;
                          +    }
                          +  else if (fabs(x) < 1.0)
                          +    {
                          +      *iptr = 0.0;
                          +      return x;
                          +    }
                          +  else
                          +    {
                          +      *iptr = (float)(int)x;
                          +      return (x - *iptr);
                          +    }
                          +}
                          diff --git a/nuttx/libc/math/lib_modfl.c b/nuttx/libc/math/lib_modfl.c
                          new file mode 100644
                          index 0000000000..77bba0e0c0
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_modfl.c
                          @@ -0,0 +1,61 @@
                          +/************************************************************************
                          + * libc/math/lib_modfl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double modfl(long double x, long double *iptr)
                          +{
                          +  if (fabs(x) >= 4503599627370496.0)
                          +    {
                          +      *iptr = x;
                          +      return 0.0;
                          +    }
                          +  else if (fabs(x) < 1.0)
                          +    {
                          +      *iptr = 0.0;
                          +      return x;
                          +    }
                          +  else
                          +    {
                          +      *iptr = (long double)(int64_t) x;
                          +      return (x - *iptr);
                          +    }
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_pow.c b/nuttx/libc/math/lib_pow.c
                          new file mode 100644
                          index 0000000000..a19d491fad
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_pow.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_pow.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double pow(double b, double e)
                          +{
                          +  return exp(e * log(b));
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_powf.c b/nuttx/libc/math/lib_powf.c
                          new file mode 100644
                          index 0000000000..5709048982
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_powf.c
                          @@ -0,0 +1,41 @@
                          +/************************************************************************
                          + * libc/math/lib_powf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float powf(float b, float e)
                          +{
                          +  return expf(e * logf(b));
                          +}
                          diff --git a/nuttx/libc/math/lib_powl.c b/nuttx/libc/math/lib_powl.c
                          new file mode 100644
                          index 0000000000..81438217cf
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_powl.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_powl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double powl(long double b, long double e)
                          +{
                          +  return expl(e * logl(b));
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_sin.c b/nuttx/libc/math/lib_sin.c
                          new file mode 100644
                          index 0000000000..e005d98cb6
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_sin.c
                          @@ -0,0 +1,114 @@
                          +/************************************************************************
                          + * libc/math/lib_sin.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +
                          +/************************************************************************
                          + * Private Data
                          + ************************************************************************/
                          +
                          +static double _dbl_inv_fact[] =
                          +{
                          +  1.0 / 1.0,                    // 1 / 1!
                          +  1.0 / 6.0,                    // 1 / 3!
                          +  1.0 / 120.0,                  // 1 / 5!
                          +  1.0 / 5040.0,                 // 1 / 7!
                          +  1.0 / 362880.0,               // 1 / 9!
                          +  1.0 / 39916800.0,             // 1 / 11!
                          +  1.0 / 6227020800.0,           // 1 / 13!
                          +  1.0 / 1307674368000.0,        // 1 / 15!
                          +  1.0 / 355687428096000.0,      // 1 / 17!
                          +  1.0 / 121645100408832000.0,   // 1 / 19!
                          +};
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +double sin(double x)
                          +{
                          +  double x_squared;
                          +  double sin_x;
                          +  size_t i;
                          +
                          +  /* Move x to [-pi, pi) */
                          +
                          +  x = fmod(x, 2 * M_PI);
                          +  if (x >= M_PI)
                          +    {
                          +      x -= 2 * M_PI;
                          +    }
                          +
                          +  if (x < -M_PI)
                          +    {
                          +      x += 2 * M_PI;
                          +    }
                          +
                          +  /* Move x to [-pi/2, pi/2) */
                          +
                          +  if (x >= M_PI_2)
                          +    {
                          +      x = M_PI - x;
                          +    }
                          +
                          +  if (x < -M_PI_2)
                          +    {
                          +      x = -M_PI - x;
                          +    }
                          +
                          +  x_squared = x * x;
                          +  sin_x = 0.0;
                          +
                          +  /* Perform Taylor series approximation for sin(x) with ten terms */
                          +
                          +  for (i = 0; i < 10; i++)
                          +    {
                          +      if (i % 2 == 0)
                          +        {
                          +          sin_x += x * _dbl_inv_fact[i];
                          +        }
                          +      else
                          +        {
                          +          sin_x -= x * _dbl_inv_fact[i];
                          +        }
                          +
                          +      x *= x_squared;
                          +    }
                          +
                          +  return sin_x;
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_sinf.c b/nuttx/libc/math/lib_sinf.c
                          new file mode 100644
                          index 0000000000..9e493d8efc
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_sinf.c
                          @@ -0,0 +1,104 @@
                          +/************************************************************************
                          + * libc/math/lib_sinf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +/************************************************************************
                          + * Private Data
                          + ************************************************************************/
                          +
                          +static float _flt_inv_fact[] =
                          +{
                          +  1.0 / 1.0,                    // 1 / 1!
                          +  1.0 / 6.0,                    // 1 / 3!
                          +  1.0 / 120.0,                  // 1 / 5!
                          +  1.0 / 5040.0,                 // 1 / 7!
                          +  1.0 / 362880.0,               // 1 / 9!
                          +  1.0 / 39916800.0,             // 1 / 11!
                          +};
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float sinf(float x)
                          +{
                          +  float x_squared;
                          +  float sin_x;
                          +  size_t i;
                          +
                          +  /* Move x to [-pi, pi) */
                          +
                          +  x = fmodf(x, 2 * M_PI);
                          +  if (x >= M_PI)
                          +    {
                          +      x -= 2 * M_PI;
                          +    }
                          +
                          +  if (x < -M_PI)
                          +    {
                          +      x += 2 * M_PI;
                          +    }
                          +
                          +  /* Move x to [-pi/2, pi/2) */
                          +
                          +  if (x >= M_PI_2)
                          +    {
                          +      x = M_PI - x;
                          +    }
                          +
                          +  if (x < -M_PI_2)
                          +    {
                          +      x = -M_PI - x;
                          +    }
                          +
                          +  x_squared = x * x;
                          +  sin_x = 0.0;
                          +
                          +  /* Perform Taylor series approximation for sin(x) with six terms */
                          +
                          +  for (i = 0; i < 6; i++)
                          +    {
                          +      if (i % 2 == 0)
                          +        {
                          +          sin_x += x * _flt_inv_fact[i];
                          +        }
                          +      else
                          +        {
                          +          sin_x -= x * _flt_inv_fact[i];
                          +        }
                          +
                          +      x *= x_squared;
                          +    }
                          +
                          +  return sin_x;
                          +}
                          diff --git a/nuttx/libc/math/lib_sinh.c b/nuttx/libc/math/lib_sinh.c
                          new file mode 100644
                          index 0000000000..0c3e2d11d8
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_sinh.c
                          @@ -0,0 +1,47 @@
                          +/************************************************************************
                          + * libc/math/lib_sinh.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double sinh(double x)
                          +{
                          +  x = exp(x);
                          +  return ((x - (1.0 / x)) / 2.0);
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_sinhf.c b/nuttx/libc/math/lib_sinhf.c
                          new file mode 100644
                          index 0000000000..e9d198440f
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_sinhf.c
                          @@ -0,0 +1,42 @@
                          +/************************************************************************
                          + * libc/math/lib_sinhf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float sinhf(float x)
                          +{
                          +  x = expf(x);
                          +  return ((x - (1.0 / x)) / 2.0);
                          +}
                          diff --git a/nuttx/libc/math/lib_sinhl.c b/nuttx/libc/math/lib_sinhl.c
                          new file mode 100644
                          index 0000000000..a1bcad81e8
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_sinhl.c
                          @@ -0,0 +1,47 @@
                          +/************************************************************************
                          + * libc/math/lib_sinhl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double sinhl(long double x)
                          +{
                          +  x = expl(x);
                          +  return ((x - (1.0 / x)) / 2.0);
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_sinl.c b/nuttx/libc/math/lib_sinl.c
                          new file mode 100644
                          index 0000000000..6ed539a39d
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_sinl.c
                          @@ -0,0 +1,114 @@
                          +/************************************************************************
                          + * libc/math/lib_sinl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +
                          +/************************************************************************
                          + * Private Data
                          + ************************************************************************/
                          +
                          +static long double _ldbl_inv_fact[] =
                          +{
                          +  1.0 / 1.0,                    // 1 / 1!
                          +  1.0 / 6.0,                    // 1 / 3!
                          +  1.0 / 120.0,                  // 1 / 5!
                          +  1.0 / 5040.0,                 // 1 / 7!
                          +  1.0 / 362880.0,               // 1 / 9!
                          +  1.0 / 39916800.0,             // 1 / 11!
                          +  1.0 / 6227020800.0,           // 1 / 13!
                          +  1.0 / 1307674368000.0,        // 1 / 15!
                          +  1.0 / 355687428096000.0,      // 1 / 17!
                          +  1.0 / 121645100408832000.0,   // 1 / 19!
                          +};
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +long double sinl(long double x)
                          +{
                          +  long double x_squared;
                          +  long double sin_x;
                          +  size_t i;
                          +
                          +  /* Move x to [-pi, pi) */
                          +
                          +  x = fmodl(x, 2 * M_PI);
                          +  if (x >= M_PI)
                          +    {
                          +      x -= 2 * M_PI;
                          +    }
                          +
                          +  if (x < -M_PI)
                          +    {
                          +      x += 2 * M_PI;
                          +    }
                          +
                          +  /* Move x to [-pi/2, pi/2) */
                          +
                          +  if (x >= M_PI_2)
                          +    {
                          +      x = M_PI - x;
                          +    }
                          +
                          +  if (x < -M_PI_2)
                          +    {
                          +      x = -M_PI - x;
                          +    }
                          +
                          +  x_squared = x * x;
                          +  sin_x = 0.0;
                          +
                          +  /* Perform Taylor series approximation for sin(x) with ten terms */
                          +
                          +  for (i = 0; i < 10; i++)
                          +    {
                          +      if (i % 2 == 0)
                          +        {
                          +          sin_x += x * _ldbl_inv_fact[i];
                          +        }
                          +      else
                          +        {
                          +          sin_x -= x * _ldbl_inv_fact[i];
                          +        }
                          +
                          +      x *= x_squared;
                          +    }
                          +
                          +  return sin_x;
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_sqrt.c b/nuttx/libc/math/lib_sqrt.c
                          new file mode 100644
                          index 0000000000..e8a1c42ea2
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_sqrt.c
                          @@ -0,0 +1,99 @@
                          +/************************************************************************
                          + * libc/math/lib_sqrt.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +
                          +#include "lib_internal.h"
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double sqrt(double x)
                          +{
                          +  long double y, y1;
                          +
                          +  if (x < 0.0)
                          +    {
                          +      errno = EDOM;
                          +      return NAN;
                          +    }
                          +
                          +  if (isnan(x))
                          +    {
                          +      return NAN;
                          +    }
                          +
                          +  if (isinf(x))
                          +    {
                          +      return INFINITY;
                          +    }
                          +
                          +  if (x == 0.0)
                          +    {
                          +      return 0.0;
                          +    }
                          +
                          +  /* Guess square root (using bit manipulation) */
                          +
                          +  y = lib_sqrtapprox(x);
                          +
                          +  /* Perform four iterations of approximation.  This number (4) is
                          +   * definitely optimal
                          +   */
                          +
                          +  y = 0.5 * (y + x / y);
                          +  y = 0.5 * (y + x / y);
                          +  y = 0.5 * (y + x / y);
                          +  y = 0.5 * (y + x / y);
                          +
                          +  /* If guess was terribe (out of range of float).  Repeat approximation
                          +   * until convergence.
                          +   */
                          +
                          +  if (y * y < x - 1.0 || y * y > x + 1.0)
                          +    {
                          +      y1 = -1.0;
                          +      while (y != y1)
                          +        {
                          +          y1 = y;
                          +          y = 0.5 * (y + x / y);
                          +        }
                          +    }
                          +
                          +  return y;
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_sqrtf.c b/nuttx/libc/math/lib_sqrtf.c
                          new file mode 100644
                          index 0000000000..cf45ccacc3
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_sqrtf.c
                          @@ -0,0 +1,84 @@
                          +/************************************************************************
                          + * libc/math/lib_sqrtf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +
                          +#include "lib_internal.h"
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float sqrtf(float x)
                          +{
                          +  float y;
                          +
                          +  /* Filter out invalid/trivial inputs */
                          +
                          +  if (x < 0.0)
                          +    {
                          +      errno = EDOM;
                          +      return NAN;
                          +    }
                          +
                          +  if (isnan(x))
                          +    {
                          +      return NAN;
                          +    }
                          +
                          +  if (isinf(x))
                          +    {
                          +      return INFINITY;
                          +    }
                          +
                          +  if (x == 0.0)
                          +    {
                          +      return 0.0;
                          +    }
                          +
                          +  /* Guess square root (using bit manipulation) */
                          +
                          +  y = lib_sqrtapprox(x);
                          +
                          +  /* Perform three iterations of approximation. This number (3) is
                          +   * definitely optimal
                          +   */
                          +
                          +  y = 0.5 * (y + x / y);
                          +  y = 0.5 * (y + x / y);
                          +  y = 0.5 * (y + x / y);
                          +
                          +  return y;
                          +}
                          diff --git a/nuttx/libc/math/lib_sqrtl.c b/nuttx/libc/math/lib_sqrtl.c
                          new file mode 100644
                          index 0000000000..4035992feb
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_sqrtl.c
                          @@ -0,0 +1,101 @@
                          +/************************************************************************
                          + * libc/math/lib_sqrtl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009-2011 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +
                          +#include "lib_internal.h"
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double sqrtl(long double x)
                          +{
                          +  long double y, y1;
                          +
                          +  /* Filter out invalid/trivial inputs */
                          +
                          +  if (x < 0.0)
                          +    {
                          +      errno = EDOM;
                          +      return NAN;
                          +    }
                          +
                          +  if (isnan(x))
                          +    {
                          +    return NAN;
                          +    }
                          +
                          +  if (isinf(x))
                          +    {
                          +    return INFINITY;
                          +    }
                          +
                          +  if (x == 0.0)
                          +    {
                          +    return 0.0;
                          +    }
                          +
                          +  /* Guess square root (using bit manipulation) */
                          +
                          +  y = lib_sqrtapprox(x);
                          +
                          +  /* Perform four iterations of approximation.  This number (4) is
                          +   * definitely optimal
                          +   */
                          +
                          +  y = 0.5 * (y + x / y);
                          +  y = 0.5 * (y + x / y);
                          +  y = 0.5 * (y + x / y);
                          +  y = 0.5 * (y + x / y);
                          +
                          +  /* If guess was terribe (out of range of float).  Repeat approximation
                          +   * until convergence
                          +   */
                          +
                          +  if (y * y < x - 1.0 || y * y > x + 1.0)
                          +    {
                          +      y1 = -1.0;
                          +      while (y != y1)
                          +        {
                          +          y1 = y;
                          +          y = 0.5 * (y + x / y);
                          +        }
                          +    }
                          +
                          +  return y;
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_tan.c b/nuttx/libc/math/lib_tan.c
                          new file mode 100644
                          index 0000000000..4c091c09bc
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_tan.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_tan.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double tan(double x)
                          +{
                          +  return (sin(x) / cos(x));
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_tanf.c b/nuttx/libc/math/lib_tanf.c
                          new file mode 100644
                          index 0000000000..0c9110a0b7
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_tanf.c
                          @@ -0,0 +1,41 @@
                          +/************************************************************************
                          + * libc/math/lib_tanf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float tanf(float x)
                          +{
                          +  return (sinf(x) / cosf(x));
                          +}
                          diff --git a/nuttx/libc/math/lib_tanh.c b/nuttx/libc/math/lib_tanh.c
                          new file mode 100644
                          index 0000000000..3b9ea0f418
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_tanh.c
                          @@ -0,0 +1,49 @@
                          +/************************************************************************
                          + * libc/math/lib_tanh.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_DOUBLE
                          +double tanh(double x)
                          +{
                          +  double x0 = exp(x);
                          +  double x1 = 1.0 / x0;
                          +
                          +  return ((x0 + x1) / (x0 - x1));
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_tanhf.c b/nuttx/libc/math/lib_tanhf.c
                          new file mode 100644
                          index 0000000000..43d4182044
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_tanhf.c
                          @@ -0,0 +1,44 @@
                          +/************************************************************************
                          + * libc/math/lib_tanhf.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +float tanhf(float x)
                          +{
                          +  float x0 = expf(x);
                          +  float x1 = 1.0 / x0;
                          +
                          +  return ((x0 + x1) / (x0 - x1));
                          +}
                          diff --git a/nuttx/libc/math/lib_tanhl.c b/nuttx/libc/math/lib_tanhl.c
                          new file mode 100644
                          index 0000000000..5aafd1e7b9
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_tanhl.c
                          @@ -0,0 +1,49 @@
                          +/************************************************************************
                          + * libc/math/lib_tanhl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double tanhl(long double x)
                          +{
                          +  long double x0 = exp(x);
                          +  long double x1 = 1.0 / x0;
                          +
                          +  return ((x0 + x1) / (x0 - x1));
                          +}
                          +#endif
                          diff --git a/nuttx/libc/math/lib_tanl.c b/nuttx/libc/math/lib_tanl.c
                          new file mode 100644
                          index 0000000000..e77abe0f1e
                          --- /dev/null
                          +++ b/nuttx/libc/math/lib_tanl.c
                          @@ -0,0 +1,46 @@
                          +/************************************************************************
                          + * libc/math/lib_tanl.c
                          + *
                          + * This file is a part of NuttX:
                          + *
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          + *   Ported by: Darcy Gong
                          + *
                          + * It derives from the Rhombs OS math library by Nick Johnson which has
                          + * a compatibile, MIT-style license:
                          + *
                          + * Copyright (C) 2009, 2010 Nick Johnson 
                          + * 
                          + * Permission to use, copy, modify, and distribute this software for any
                          + * purpose with or without fee is hereby granted, provided that the above
                          + * copyright notice and this permission notice appear in all copies.
                          + * 
                          + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                          + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                          + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                          + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                          + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                          + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                          + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                          + *
                          + ************************************************************************/
                          +
                          +/************************************************************************
                          + * Included Files
                          + ************************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +/************************************************************************
                          + * Public Functions
                          + ************************************************************************/
                          +
                          +#ifdef CONFIG_HAVE_LONG_DOUBLE
                          +long double tanl(long double x)
                          +{
                          +  return (sinl(x) / cosl(x));
                          +}
                          +#endif
                          diff --git a/nuttx/lib/misc/Make.defs b/nuttx/libc/misc/Make.defs
                          similarity index 99%
                          rename from nuttx/lib/misc/Make.defs
                          rename to nuttx/libc/misc/Make.defs
                          index c12533f754..f4284ac60c 100644
                          --- a/nuttx/lib/misc/Make.defs
                          +++ b/nuttx/libc/misc/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/misc/Make.defs
                          +# libc/misc/Make.defs
                           #
                           #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/misc/lib_crc32.c b/nuttx/libc/misc/lib_crc32.c
                          similarity index 99%
                          rename from nuttx/lib/misc/lib_crc32.c
                          rename to nuttx/libc/misc/lib_crc32.c
                          index f851598e01..ae73ba3d79 100644
                          --- a/nuttx/lib/misc/lib_crc32.c
                          +++ b/nuttx/libc/misc/lib_crc32.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************************************
                          - * lib/misc/lib_crc32.c
                          + * libc/misc/lib_crc32.c
                            *
                            * This file is a part of NuttX:
                            *
                          diff --git a/nuttx/lib/misc/lib_dbg.c b/nuttx/libc/misc/lib_dbg.c
                          similarity index 99%
                          rename from nuttx/lib/misc/lib_dbg.c
                          rename to nuttx/libc/misc/lib_dbg.c
                          index aacdaa30a9..5605ff828f 100644
                          --- a/nuttx/lib/misc/lib_dbg.c
                          +++ b/nuttx/libc/misc/lib_dbg.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/misc/lib_dbg.c
                          + * libc/misc/lib_dbg.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/misc/lib_dumpbuffer.c b/nuttx/libc/misc/lib_dumpbuffer.c
                          similarity index 99%
                          rename from nuttx/lib/misc/lib_dumpbuffer.c
                          rename to nuttx/libc/misc/lib_dumpbuffer.c
                          index 155468ca12..52158b2204 100644
                          --- a/nuttx/lib/misc/lib_dumpbuffer.c
                          +++ b/nuttx/libc/misc/lib_dumpbuffer.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/misc/lib_dumpbuffer.c
                          + * libc/misc/lib_dumpbuffer.c
                            *
                            *   Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/misc/lib_filesem.c b/nuttx/libc/misc/lib_filesem.c
                          similarity index 99%
                          rename from nuttx/lib/misc/lib_filesem.c
                          rename to nuttx/libc/misc/lib_filesem.c
                          index 1d1f25c2fd..5cc4624ec6 100644
                          --- a/nuttx/lib/misc/lib_filesem.c
                          +++ b/nuttx/libc/misc/lib_filesem.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/misc/lib_filesem.c
                          + * libc/misc/lib_filesem.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/misc/lib_init.c b/nuttx/libc/misc/lib_init.c
                          similarity index 99%
                          rename from nuttx/lib/misc/lib_init.c
                          rename to nuttx/libc/misc/lib_init.c
                          index 3403a837b9..6a120f7b13 100644
                          --- a/nuttx/lib/misc/lib_init.c
                          +++ b/nuttx/libc/misc/lib_init.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/misc/lib_init.c
                          + * libc/misc/lib_init.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/misc/lib_match.c b/nuttx/libc/misc/lib_match.c
                          similarity index 98%
                          rename from nuttx/lib/misc/lib_match.c
                          rename to nuttx/libc/misc/lib_match.c
                          index 18e0632ec6..a8cfad3293 100644
                          --- a/nuttx/lib/misc/lib_match.c
                          +++ b/nuttx/libc/misc/lib_match.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/misc/lib_match.c - simple shell-style filename matcher
                          + * libc/misc/lib_match.c - simple shell-style filename matcher
                            *
                            * Simple shell-style filename pattern matcher written by Jef Poskanzer
                            * This pattern matcher only handles '?', '*' and '**', and  multiple
                          diff --git a/nuttx/lib/misc/lib_sendfile.c b/nuttx/libc/misc/lib_sendfile.c
                          similarity index 99%
                          rename from nuttx/lib/misc/lib_sendfile.c
                          rename to nuttx/libc/misc/lib_sendfile.c
                          index a82eb325e7..8a38dc317e 100644
                          --- a/nuttx/lib/misc/lib_sendfile.c
                          +++ b/nuttx/libc/misc/lib_sendfile.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/misc/lib_streamsem.c
                          + * libc/misc/lib_streamsem.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/misc/lib_streamsem.c b/nuttx/libc/misc/lib_streamsem.c
                          similarity index 99%
                          rename from nuttx/lib/misc/lib_streamsem.c
                          rename to nuttx/libc/misc/lib_streamsem.c
                          index fdf494e751..e38298bdbb 100644
                          --- a/nuttx/lib/misc/lib_streamsem.c
                          +++ b/nuttx/libc/misc/lib_streamsem.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/misc/lib_streamsem.c
                          + * libc/misc/lib_streamsem.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/mqueue/Make.defs b/nuttx/libc/mqueue/Make.defs
                          similarity index 98%
                          rename from nuttx/lib/mqueue/Make.defs
                          rename to nuttx/libc/mqueue/Make.defs
                          index 40dc6c13e6..826970fa32 100644
                          --- a/nuttx/lib/mqueue/Make.defs
                          +++ b/nuttx/libc/mqueue/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/mqueue/Make.defs
                          +# libc/mqueue/Make.defs
                           #
                           #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/mqueue/mq_getattr.c b/nuttx/libc/mqueue/mq_getattr.c
                          similarity index 99%
                          rename from nuttx/lib/mqueue/mq_getattr.c
                          rename to nuttx/libc/mqueue/mq_getattr.c
                          index 9c9f47fdce..2fc0e131be 100644
                          --- a/nuttx/lib/mqueue/mq_getattr.c
                          +++ b/nuttx/libc/mqueue/mq_getattr.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/mqueue/mq_getattr.c
                          + * libc/mqueue/mq_getattr.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/mqueue/mq_setattr.c b/nuttx/libc/mqueue/mq_setattr.c
                          similarity index 99%
                          rename from nuttx/lib/mqueue/mq_setattr.c
                          rename to nuttx/libc/mqueue/mq_setattr.c
                          index 1276d64e8a..45a848e6d7 100644
                          --- a/nuttx/lib/mqueue/mq_setattr.c
                          +++ b/nuttx/libc/mqueue/mq_setattr.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/mqueue/mq_setattr.c
                          + * libc/mqueue/mq_setattr.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/net/Make.defs b/nuttx/libc/net/Make.defs
                          similarity index 98%
                          rename from nuttx/lib/net/Make.defs
                          rename to nuttx/libc/net/Make.defs
                          index ae041bd2c5..9d4e5c06b3 100644
                          --- a/nuttx/lib/net/Make.defs
                          +++ b/nuttx/libc/net/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/net/Make.defs
                          +# libc/net/Make.defs
                           #
                           #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/net/lib_etherntoa.c b/nuttx/libc/net/lib_etherntoa.c
                          similarity index 99%
                          rename from nuttx/lib/net/lib_etherntoa.c
                          rename to nuttx/libc/net/lib_etherntoa.c
                          index f89f205a2e..91fb01c570 100644
                          --- a/nuttx/lib/net/lib_etherntoa.c
                          +++ b/nuttx/libc/net/lib_etherntoa.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/net/lib_etherntoa.c
                          + * libc/net/lib_etherntoa.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/net/lib_htonl.c b/nuttx/libc/net/lib_htonl.c
                          similarity index 99%
                          rename from nuttx/lib/net/lib_htonl.c
                          rename to nuttx/libc/net/lib_htonl.c
                          index e4c3e53838..a10f54f379 100644
                          --- a/nuttx/lib/net/lib_htonl.c
                          +++ b/nuttx/libc/net/lib_htonl.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/net/lib_ntohl.c
                          + * libc/net/lib_ntohl.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/net/lib_htons.c b/nuttx/libc/net/lib_htons.c
                          similarity index 99%
                          rename from nuttx/lib/net/lib_htons.c
                          rename to nuttx/libc/net/lib_htons.c
                          index b4117e1dc2..13addd9136 100644
                          --- a/nuttx/lib/net/lib_htons.c
                          +++ b/nuttx/libc/net/lib_htons.c
                          @@ -1,5 +1,5 @@
                           /***************************************************************************
                          - * lib/net/lib_htons.c
                          + * libc/net/lib_htons.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/net/lib_inetaddr.c b/nuttx/libc/net/lib_inetaddr.c
                          similarity index 99%
                          rename from nuttx/lib/net/lib_inetaddr.c
                          rename to nuttx/libc/net/lib_inetaddr.c
                          index 48b01d682f..46c6c548dc 100644
                          --- a/nuttx/lib/net/lib_inetaddr.c
                          +++ b/nuttx/libc/net/lib_inetaddr.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/net/lib_inetaddr.c
                          + * libc/net/lib_inetaddr.c
                            *
                            *   Copyright (C) 2011 Yu Qiang. All rights reserved.
                            *   Author: Yu Qiang 
                          diff --git a/nuttx/lib/net/lib_inetntoa.c b/nuttx/libc/net/lib_inetntoa.c
                          similarity index 99%
                          rename from nuttx/lib/net/lib_inetntoa.c
                          rename to nuttx/libc/net/lib_inetntoa.c
                          index 0f4fb61df6..e2d92d8648 100644
                          --- a/nuttx/lib/net/lib_inetntoa.c
                          +++ b/nuttx/libc/net/lib_inetntoa.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/net/lib_inetntoa.c
                          + * libc/net/lib_inetntoa.c
                            *
                            *   Copyright (C) 2007-2008, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/net/lib_inetntop.c b/nuttx/libc/net/lib_inetntop.c
                          similarity index 99%
                          rename from nuttx/lib/net/lib_inetntop.c
                          rename to nuttx/libc/net/lib_inetntop.c
                          index dc6a2d0d79..25c32c48cf 100644
                          --- a/nuttx/lib/net/lib_inetntop.c
                          +++ b/nuttx/libc/net/lib_inetntop.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/net/lib_inetntop.c
                          + * libc/net/lib_inetntop.c
                            *
                            *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/net/lib_inetpton.c b/nuttx/libc/net/lib_inetpton.c
                          similarity index 99%
                          rename from nuttx/lib/net/lib_inetpton.c
                          rename to nuttx/libc/net/lib_inetpton.c
                          index 5371cd3f21..c5f117535b 100644
                          --- a/nuttx/lib/net/lib_inetpton.c
                          +++ b/nuttx/libc/net/lib_inetpton.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/net/lib_inetpton.c
                          + * libc/net/lib_inetpton.c
                            *
                            *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/Make.defs b/nuttx/libc/pthread/Make.defs
                          similarity index 99%
                          rename from nuttx/lib/pthread/Make.defs
                          rename to nuttx/libc/pthread/Make.defs
                          index a1eba7bb0a..07e4f05701 100644
                          --- a/nuttx/lib/pthread/Make.defs
                          +++ b/nuttx/libc/pthread/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/pthread/Make.defs
                          +# libc/pthread/Make.defs
                           #
                           #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_attrdestroy.c b/nuttx/libc/pthread/pthread_attrdestroy.c
                          similarity index 99%
                          rename from nuttx/lib/pthread/pthread_attrdestroy.c
                          rename to nuttx/libc/pthread/pthread_attrdestroy.c
                          index 103528c7e1..37ad46ebcd 100644
                          --- a/nuttx/lib/pthread/pthread_attrdestroy.c
                          +++ b/nuttx/libc/pthread/pthread_attrdestroy.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_attrdestroy.c
                          + * libc/pthread/pthread_attrdestroy.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_attrgetinheritsched.c b/nuttx/libc/pthread/pthread_attrgetinheritsched.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_attrgetinheritsched.c
                          rename to nuttx/libc/pthread/pthread_attrgetinheritsched.c
                          index 02d6e0b7c0..6ec8ae71f6 100644
                          --- a/nuttx/lib/pthread/pthread_attrgetinheritsched.c
                          +++ b/nuttx/libc/pthread/pthread_attrgetinheritsched.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_attrgetinheritsched.c
                          + * libc/pthread/pthread_attrgetinheritsched.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_attrgetschedparam.c b/nuttx/libc/pthread/pthread_attrgetschedparam.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_attrgetschedparam.c
                          rename to nuttx/libc/pthread/pthread_attrgetschedparam.c
                          index c6bf55dea8..6bcc9618e9 100644
                          --- a/nuttx/lib/pthread/pthread_attrgetschedparam.c
                          +++ b/nuttx/libc/pthread/pthread_attrgetschedparam.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_attrgetschedparam.c
                          + * libc/pthread/pthread_attrgetschedparam.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_attrgetschedpolicy.c b/nuttx/libc/pthread/pthread_attrgetschedpolicy.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_attrgetschedpolicy.c
                          rename to nuttx/libc/pthread/pthread_attrgetschedpolicy.c
                          index c42b828c96..8845e2bd81 100644
                          --- a/nuttx/lib/pthread/pthread_attrgetschedpolicy.c
                          +++ b/nuttx/libc/pthread/pthread_attrgetschedpolicy.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_attrgetschedpolicy.c
                          + * libc/pthread/pthread_attrgetschedpolicy.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_attrgetstacksize.c b/nuttx/libc/pthread/pthread_attrgetstacksize.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_attrgetstacksize.c
                          rename to nuttx/libc/pthread/pthread_attrgetstacksize.c
                          index 2faa586ba8..9fde29e810 100644
                          --- a/nuttx/lib/pthread/pthread_attrgetstacksize.c
                          +++ b/nuttx/libc/pthread/pthread_attrgetstacksize.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_attrgetstacksize.c
                          + * libc/pthread/pthread_attrgetstacksize.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_attrinit.c b/nuttx/libc/pthread/pthread_attrinit.c
                          similarity index 99%
                          rename from nuttx/lib/pthread/pthread_attrinit.c
                          rename to nuttx/libc/pthread/pthread_attrinit.c
                          index d06a535d78..427a582b91 100644
                          --- a/nuttx/lib/pthread/pthread_attrinit.c
                          +++ b/nuttx/libc/pthread/pthread_attrinit.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_attrinit.c
                          + * libc/pthread/pthread_attrinit.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_attrsetinheritsched.c b/nuttx/libc/pthread/pthread_attrsetinheritsched.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_attrsetinheritsched.c
                          rename to nuttx/libc/pthread/pthread_attrsetinheritsched.c
                          index df2c2fba33..1102fe176a 100644
                          --- a/nuttx/lib/pthread/pthread_attrsetinheritsched.c
                          +++ b/nuttx/libc/pthread/pthread_attrsetinheritsched.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_attrsetinheritsched.c
                          + * libc/pthread/pthread_attrsetinheritsched.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_attrsetschedparam.c b/nuttx/libc/pthread/pthread_attrsetschedparam.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_attrsetschedparam.c
                          rename to nuttx/libc/pthread/pthread_attrsetschedparam.c
                          index c2ab4d1c41..587d62206b 100644
                          --- a/nuttx/lib/pthread/pthread_attrsetschedparam.c
                          +++ b/nuttx/libc/pthread/pthread_attrsetschedparam.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_attrsetschedparam.c
                          + * libc/pthread/pthread_attrsetschedparam.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_attrsetschedpolicy.c b/nuttx/libc/pthread/pthread_attrsetschedpolicy.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_attrsetschedpolicy.c
                          rename to nuttx/libc/pthread/pthread_attrsetschedpolicy.c
                          index 4e43e635de..e1d1c86195 100644
                          --- a/nuttx/lib/pthread/pthread_attrsetschedpolicy.c
                          +++ b/nuttx/libc/pthread/pthread_attrsetschedpolicy.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_attrsetschedpolicy.c
                          + * libc/pthread/pthread_attrsetschedpolicy.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_attrsetstacksize.c b/nuttx/libc/pthread/pthread_attrsetstacksize.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_attrsetstacksize.c
                          rename to nuttx/libc/pthread/pthread_attrsetstacksize.c
                          index 8a826dd3ac..fca993baf8 100644
                          --- a/nuttx/lib/pthread/pthread_attrsetstacksize.c
                          +++ b/nuttx/libc/pthread/pthread_attrsetstacksize.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_attrsetstacksize.c
                          + * libc/pthread/pthread_attrsetstacksize.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_barrierattrdestroy.c b/nuttx/libc/pthread/pthread_barrierattrdestroy.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_barrierattrdestroy.c
                          rename to nuttx/libc/pthread/pthread_barrierattrdestroy.c
                          index 6d16b9cff8..5519caa61f 100644
                          --- a/nuttx/lib/pthread/pthread_barrierattrdestroy.c
                          +++ b/nuttx/libc/pthread/pthread_barrierattrdestroy.c
                          @@ -1,5 +1,5 @@
                           /********************************************************************************
                          - * lib/pthread/pthread_barrierattrdestroy.c
                          + * libc/pthread/pthread_barrierattrdestroy.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_barrierattrgetpshared.c b/nuttx/libc/pthread/pthread_barrierattrgetpshared.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_barrierattrgetpshared.c
                          rename to nuttx/libc/pthread/pthread_barrierattrgetpshared.c
                          index d29bc6dfc8..83faffae08 100644
                          --- a/nuttx/lib/pthread/pthread_barrierattrgetpshared.c
                          +++ b/nuttx/libc/pthread/pthread_barrierattrgetpshared.c
                          @@ -1,5 +1,5 @@
                           /********************************************************************************
                          - * lib/pthread/pthread_barrierattrgetpshared.c
                          + * libc/pthread/pthread_barrierattrgetpshared.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_barrierattrinit.c b/nuttx/libc/pthread/pthread_barrierattrinit.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_barrierattrinit.c
                          rename to nuttx/libc/pthread/pthread_barrierattrinit.c
                          index b5f35ca917..7ab1018835 100644
                          --- a/nuttx/lib/pthread/pthread_barrierattrinit.c
                          +++ b/nuttx/libc/pthread/pthread_barrierattrinit.c
                          @@ -1,5 +1,5 @@
                           /********************************************************************************
                          - * lib/pthread/pthread_barrierattrinit.c
                          + * libc/pthread/pthread_barrierattrinit.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_barrierattrsetpshared.c b/nuttx/libc/pthread/pthread_barrierattrsetpshared.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_barrierattrsetpshared.c
                          rename to nuttx/libc/pthread/pthread_barrierattrsetpshared.c
                          index d0eecbf5a4..2585de7a0d 100644
                          --- a/nuttx/lib/pthread/pthread_barrierattrsetpshared.c
                          +++ b/nuttx/libc/pthread/pthread_barrierattrsetpshared.c
                          @@ -1,5 +1,5 @@
                           /********************************************************************************
                          - * lib/pthread/pthread_barrierattrsetpshared.c
                          + * libc/pthread/pthread_barrierattrsetpshared.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_condattrdestroy.c b/nuttx/libc/pthread/pthread_condattrdestroy.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_condattrdestroy.c
                          rename to nuttx/libc/pthread/pthread_condattrdestroy.c
                          index d6c3df5d1a..30a0c4db1b 100644
                          --- a/nuttx/lib/pthread/pthread_condattrdestroy.c
                          +++ b/nuttx/libc/pthread/pthread_condattrdestroy.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_condattrdestroy.c
                          + * libc/pthread/pthread_condattrdestroy.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_condattrinit.c b/nuttx/libc/pthread/pthread_condattrinit.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_condattrinit.c
                          rename to nuttx/libc/pthread/pthread_condattrinit.c
                          index 5721c61593..511376f2e6 100644
                          --- a/nuttx/lib/pthread/pthread_condattrinit.c
                          +++ b/nuttx/libc/pthread/pthread_condattrinit.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_condattrinit.c
                          + * libc/pthread/pthread_condattrinit.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_mutexattrdestroy.c b/nuttx/libc/pthread/pthread_mutexattrdestroy.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_mutexattrdestroy.c
                          rename to nuttx/libc/pthread/pthread_mutexattrdestroy.c
                          index e9868df68b..82a13c300e 100644
                          --- a/nuttx/lib/pthread/pthread_mutexattrdestroy.c
                          +++ b/nuttx/libc/pthread/pthread_mutexattrdestroy.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_mutexattrdestroy.c
                          + * libc/pthread/pthread_mutexattrdestroy.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_mutexattrgetpshared.c b/nuttx/libc/pthread/pthread_mutexattrgetpshared.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_mutexattrgetpshared.c
                          rename to nuttx/libc/pthread/pthread_mutexattrgetpshared.c
                          index bc6379db5f..dc18484ec5 100644
                          --- a/nuttx/lib/pthread/pthread_mutexattrgetpshared.c
                          +++ b/nuttx/libc/pthread/pthread_mutexattrgetpshared.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_mutexattrgetpshared.c
                          + * libc/pthread/pthread_mutexattrgetpshared.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_mutexattrgettype.c b/nuttx/libc/pthread/pthread_mutexattrgettype.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_mutexattrgettype.c
                          rename to nuttx/libc/pthread/pthread_mutexattrgettype.c
                          index 5fb10f3015..3b8b3ec052 100644
                          --- a/nuttx/lib/pthread/pthread_mutexattrgettype.c
                          +++ b/nuttx/libc/pthread/pthread_mutexattrgettype.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_mutexattrgettype.c
                          + * libc/pthread/pthread_mutexattrgettype.c
                            *
                            *   Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_mutexattrinit.c b/nuttx/libc/pthread/pthread_mutexattrinit.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_mutexattrinit.c
                          rename to nuttx/libc/pthread/pthread_mutexattrinit.c
                          index f815bf16c1..f8c2721953 100644
                          --- a/nuttx/lib/pthread/pthread_mutexattrinit.c
                          +++ b/nuttx/libc/pthread/pthread_mutexattrinit.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_mutexattrinit.c
                          + * libc/pthread/pthread_mutexattrinit.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_mutexattrsetpshared.c b/nuttx/libc/pthread/pthread_mutexattrsetpshared.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_mutexattrsetpshared.c
                          rename to nuttx/libc/pthread/pthread_mutexattrsetpshared.c
                          index 900476fdd2..7501fd980b 100644
                          --- a/nuttx/lib/pthread/pthread_mutexattrsetpshared.c
                          +++ b/nuttx/libc/pthread/pthread_mutexattrsetpshared.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_mutexattrsetpshared.c
                          + * libc/pthread/pthread_mutexattrsetpshared.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/pthread/pthread_mutexattrsettype.c b/nuttx/libc/pthread/pthread_mutexattrsettype.c
                          similarity index 98%
                          rename from nuttx/lib/pthread/pthread_mutexattrsettype.c
                          rename to nuttx/libc/pthread/pthread_mutexattrsettype.c
                          index 81427c757e..068a27dc26 100644
                          --- a/nuttx/lib/pthread/pthread_mutexattrsettype.c
                          +++ b/nuttx/libc/pthread/pthread_mutexattrsettype.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/pthread/pthread_mutexattrsettype.c
                          + * libc/pthread/pthread_mutexattrsettype.c
                            *
                            *   Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/queue/Make.defs b/nuttx/libc/queue/Make.defs
                          similarity index 98%
                          rename from nuttx/lib/queue/Make.defs
                          rename to nuttx/libc/queue/Make.defs
                          index 976e7a2b87..9a843dbdc9 100644
                          --- a/nuttx/lib/queue/Make.defs
                          +++ b/nuttx/libc/queue/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/queue/Make.defs
                          +# libc/queue/Make.defs
                           #
                           #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/queue/dq_addafter.c b/nuttx/libc/queue/dq_addafter.c
                          similarity index 99%
                          rename from nuttx/lib/queue/dq_addafter.c
                          rename to nuttx/libc/queue/dq_addafter.c
                          index bfbe0052d8..e4d1abf63d 100644
                          --- a/nuttx/lib/queue/dq_addafter.c
                          +++ b/nuttx/libc/queue/dq_addafter.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/queue/dq_addafter.c
                          + * libc/queue/dq_addafter.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/queue/dq_addbefore.c b/nuttx/libc/queue/dq_addbefore.c
                          similarity index 98%
                          rename from nuttx/lib/queue/dq_addbefore.c
                          rename to nuttx/libc/queue/dq_addbefore.c
                          index d740ea8309..3c403fc944 100644
                          --- a/nuttx/lib/queue/dq_addbefore.c
                          +++ b/nuttx/libc/queue/dq_addbefore.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/queue/dq_addbefore.c
                          + * libc/queue/dq_addbefore.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/queue/dq_addfirst.c b/nuttx/libc/queue/dq_addfirst.c
                          similarity index 98%
                          rename from nuttx/lib/queue/dq_addfirst.c
                          rename to nuttx/libc/queue/dq_addfirst.c
                          index 7c7312de3b..56767b9289 100644
                          --- a/nuttx/lib/queue/dq_addfirst.c
                          +++ b/nuttx/libc/queue/dq_addfirst.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/queue/dq_addfirst.c
                          + * libc/queue/dq_addfirst.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/queue/dq_addlast.c b/nuttx/libc/queue/dq_addlast.c
                          similarity index 99%
                          rename from nuttx/lib/queue/dq_addlast.c
                          rename to nuttx/libc/queue/dq_addlast.c
                          index 745deb27d1..3ef08abd05 100644
                          --- a/nuttx/lib/queue/dq_addlast.c
                          +++ b/nuttx/libc/queue/dq_addlast.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/queue/dq_addlast.c
                          + * libc/queue/dq_addlast.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/queue/dq_rem.c b/nuttx/libc/queue/dq_rem.c
                          similarity index 99%
                          rename from nuttx/lib/queue/dq_rem.c
                          rename to nuttx/libc/queue/dq_rem.c
                          index 218427bf84..db20762c75 100644
                          --- a/nuttx/lib/queue/dq_rem.c
                          +++ b/nuttx/libc/queue/dq_rem.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/queue/dq_rem.c
                          + * libc/queue/dq_rem.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/queue/dq_remfirst.c b/nuttx/libc/queue/dq_remfirst.c
                          similarity index 99%
                          rename from nuttx/lib/queue/dq_remfirst.c
                          rename to nuttx/libc/queue/dq_remfirst.c
                          index 26c5fd7a67..e87acc3382 100644
                          --- a/nuttx/lib/queue/dq_remfirst.c
                          +++ b/nuttx/libc/queue/dq_remfirst.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/queue/dq_remfirst.c
                          + * libc/queue/dq_remfirst.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/queue/dq_remlast.c b/nuttx/libc/queue/dq_remlast.c
                          similarity index 99%
                          rename from nuttx/lib/queue/dq_remlast.c
                          rename to nuttx/libc/queue/dq_remlast.c
                          index 35adc73e2d..18c1823359 100644
                          --- a/nuttx/lib/queue/dq_remlast.c
                          +++ b/nuttx/libc/queue/dq_remlast.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/queue/dq_remlast.c
                          + * libc/queue/dq_remlast.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/queue/sq_addafter.c b/nuttx/libc/queue/sq_addafter.c
                          similarity index 98%
                          rename from nuttx/lib/queue/sq_addafter.c
                          rename to nuttx/libc/queue/sq_addafter.c
                          index 965ac28444..5d47feba0f 100644
                          --- a/nuttx/lib/queue/sq_addafter.c
                          +++ b/nuttx/libc/queue/sq_addafter.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/queue/sq_addafter.c
                          + * libc/queue/sq_addafter.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/queue/sq_addfirst.c b/nuttx/libc/queue/sq_addfirst.c
                          similarity index 98%
                          rename from nuttx/lib/queue/sq_addfirst.c
                          rename to nuttx/libc/queue/sq_addfirst.c
                          index 8fc8e06199..9624861541 100644
                          --- a/nuttx/lib/queue/sq_addfirst.c
                          +++ b/nuttx/libc/queue/sq_addfirst.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/queue/sq_addfirst.c
                          + * libc/queue/sq_addfirst.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/queue/sq_addlast.c b/nuttx/libc/queue/sq_addlast.c
                          similarity index 99%
                          rename from nuttx/lib/queue/sq_addlast.c
                          rename to nuttx/libc/queue/sq_addlast.c
                          index f9f9625cc0..faa07efb5c 100644
                          --- a/nuttx/lib/queue/sq_addlast.c
                          +++ b/nuttx/libc/queue/sq_addlast.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/queue/sq_addlast.c
                          + * libc/queue/sq_addlast.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/queue/sq_rem.c b/nuttx/libc/queue/sq_rem.c
                          similarity index 99%
                          rename from nuttx/lib/queue/sq_rem.c
                          rename to nuttx/libc/queue/sq_rem.c
                          index 6ba52354d4..720be182cd 100644
                          --- a/nuttx/lib/queue/sq_rem.c
                          +++ b/nuttx/libc/queue/sq_rem.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/queue/sq_rem.c
                          + * libc/queue/sq_rem.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/queue/sq_remafter.c b/nuttx/libc/queue/sq_remafter.c
                          similarity index 99%
                          rename from nuttx/lib/queue/sq_remafter.c
                          rename to nuttx/libc/queue/sq_remafter.c
                          index 4dcfb06e44..0545a00f95 100644
                          --- a/nuttx/lib/queue/sq_remafter.c
                          +++ b/nuttx/libc/queue/sq_remafter.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/queue/sq_remafter.c
                          + * libc/queue/sq_remafter.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/queue/sq_remfirst.c b/nuttx/libc/queue/sq_remfirst.c
                          similarity index 98%
                          rename from nuttx/lib/queue/sq_remfirst.c
                          rename to nuttx/libc/queue/sq_remfirst.c
                          index 43df6de417..f81c18dc2e 100644
                          --- a/nuttx/lib/queue/sq_remfirst.c
                          +++ b/nuttx/libc/queue/sq_remfirst.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/queue/sq_remfirst.c
                          + * libc/queue/sq_remfirst.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/queue/sq_remlast.c b/nuttx/libc/queue/sq_remlast.c
                          similarity index 99%
                          rename from nuttx/lib/queue/sq_remlast.c
                          rename to nuttx/libc/queue/sq_remlast.c
                          index 92cdbde985..8f045e4932 100644
                          --- a/nuttx/lib/queue/sq_remlast.c
                          +++ b/nuttx/libc/queue/sq_remlast.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/queue/sq_remlast.c
                          + * libc/queue/sq_remlast.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/sched/Make.defs b/nuttx/libc/sched/Make.defs
                          similarity index 98%
                          rename from nuttx/lib/sched/Make.defs
                          rename to nuttx/libc/sched/Make.defs
                          index f398b755e0..d2356db0f1 100644
                          --- a/nuttx/lib/sched/Make.defs
                          +++ b/nuttx/libc/sched/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/sched/Make.defs
                          +# libc/sched/Make.defs
                           #
                           #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/sched/sched_getprioritymax.c b/nuttx/libc/sched/sched_getprioritymax.c
                          similarity index 99%
                          rename from nuttx/lib/sched/sched_getprioritymax.c
                          rename to nuttx/libc/sched/sched_getprioritymax.c
                          index 14b368dfc0..6ea37e76a9 100644
                          --- a/nuttx/lib/sched/sched_getprioritymax.c
                          +++ b/nuttx/libc/sched/sched_getprioritymax.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/sched/sched_getprioritymax.c
                          + * libc/sched/sched_getprioritymax.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/sched/sched_getprioritymin.c b/nuttx/libc/sched/sched_getprioritymin.c
                          similarity index 99%
                          rename from nuttx/lib/sched/sched_getprioritymin.c
                          rename to nuttx/libc/sched/sched_getprioritymin.c
                          index 86410cb0f6..dbb46d81eb 100644
                          --- a/nuttx/lib/sched/sched_getprioritymin.c
                          +++ b/nuttx/libc/sched/sched_getprioritymin.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/sched/sched_getprioritymin.c
                          + * libc/sched/sched_getprioritymin.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/semaphore/Make.defs b/nuttx/libc/semaphore/Make.defs
                          similarity index 98%
                          rename from nuttx/lib/semaphore/Make.defs
                          rename to nuttx/libc/semaphore/Make.defs
                          index fdc0fe7d54..b6551ff96a 100644
                          --- a/nuttx/lib/semaphore/Make.defs
                          +++ b/nuttx/libc/semaphore/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/semaphore/Make.defs
                          +# libc/semaphore/Make.defs
                           #
                           #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/semaphore/sem_getvalue.c b/nuttx/libc/semaphore/sem_getvalue.c
                          similarity index 99%
                          rename from nuttx/lib/semaphore/sem_getvalue.c
                          rename to nuttx/libc/semaphore/sem_getvalue.c
                          index 31c6bb7e06..ce9d12611a 100644
                          --- a/nuttx/lib/semaphore/sem_getvalue.c
                          +++ b/nuttx/libc/semaphore/sem_getvalue.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/semaphore/sem_getvalue.c
                          + * libc/semaphore/sem_getvalue.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/semaphore/sem_init.c b/nuttx/libc/semaphore/sem_init.c
                          similarity index 99%
                          rename from nuttx/lib/semaphore/sem_init.c
                          rename to nuttx/libc/semaphore/sem_init.c
                          index bc14415f97..7732eb57a5 100644
                          --- a/nuttx/lib/semaphore/sem_init.c
                          +++ b/nuttx/libc/semaphore/sem_init.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/sem/sem_init.c
                          + * libc/sem/sem_init.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/signal/Make.defs b/nuttx/libc/signal/Make.defs
                          similarity index 98%
                          rename from nuttx/lib/signal/Make.defs
                          rename to nuttx/libc/signal/Make.defs
                          index e27da9b2e8..fe7eb180e7 100644
                          --- a/nuttx/lib/signal/Make.defs
                          +++ b/nuttx/libc/signal/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/signal/Make.defs
                          +# libc/signal/Make.defs
                           #
                           #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/signal/sig_addset.c b/nuttx/libc/signal/sig_addset.c
                          similarity index 99%
                          rename from nuttx/lib/signal/sig_addset.c
                          rename to nuttx/libc/signal/sig_addset.c
                          index 19ba0cb6b6..06ddabd6b2 100644
                          --- a/nuttx/lib/signal/sig_addset.c
                          +++ b/nuttx/libc/signal/sig_addset.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/signal/sig_addset.c
                          + * libc/signal/sig_addset.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/signal/sig_delset.c b/nuttx/libc/signal/sig_delset.c
                          similarity index 99%
                          rename from nuttx/lib/signal/sig_delset.c
                          rename to nuttx/libc/signal/sig_delset.c
                          index 1c661d37f6..04112d8729 100644
                          --- a/nuttx/lib/signal/sig_delset.c
                          +++ b/nuttx/libc/signal/sig_delset.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/signal/sig_delset.c
                          + * libc/signal/sig_delset.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/signal/sig_emptyset.c b/nuttx/libc/signal/sig_emptyset.c
                          similarity index 99%
                          rename from nuttx/lib/signal/sig_emptyset.c
                          rename to nuttx/libc/signal/sig_emptyset.c
                          index ac0c6b3e89..16ddd3f68f 100644
                          --- a/nuttx/lib/signal/sig_emptyset.c
                          +++ b/nuttx/libc/signal/sig_emptyset.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/signal/sig_emptyset.c
                          + * libc/signal/sig_emptyset.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/signal/sig_fillset.c b/nuttx/libc/signal/sig_fillset.c
                          similarity index 99%
                          rename from nuttx/lib/signal/sig_fillset.c
                          rename to nuttx/libc/signal/sig_fillset.c
                          index 8697d7577f..99ee95c1ff 100644
                          --- a/nuttx/lib/signal/sig_fillset.c
                          +++ b/nuttx/libc/signal/sig_fillset.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/signal/sig_fillset.c
                          + * libc/signal/sig_fillset.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/signal/sig_ismember.c b/nuttx/libc/signal/sig_ismember.c
                          similarity index 99%
                          rename from nuttx/lib/signal/sig_ismember.c
                          rename to nuttx/libc/signal/sig_ismember.c
                          index c5bb091b7b..1a8590e003 100644
                          --- a/nuttx/lib/signal/sig_ismember.c
                          +++ b/nuttx/libc/signal/sig_ismember.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/signal/sig_ismember.c
                          + * libc/signal/sig_ismember.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/Make.defs b/nuttx/libc/stdio/Make.defs
                          similarity index 70%
                          rename from nuttx/lib/stdio/Make.defs
                          rename to nuttx/libc/stdio/Make.defs
                          index a4e9007052..e18ab0220f 100644
                          --- a/nuttx/lib/stdio/Make.defs
                          +++ b/nuttx/libc/stdio/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/stdio/Make.defs
                          +# libc/stdio/Make.defs
                           #
                           #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          @@ -34,27 +34,39 @@
                           ############################################################################
                           
                           # Add the stdio C files to the build
                          +# This first group of C files do not depend on having file descriptors or
                          +# C streams.
                           
                           CSRCS += lib_fileno.c lib_printf.c lib_rawprintf.c lib_lowprintf.c \
                          -		  lib_sprintf.c lib_asprintf.c lib_snprintf.c lib_libsprintf.c \
                          -		  lib_vsprintf.c lib_avsprintf.c lib_vsnprintf.c lib_libvsprintf.c \
                          -		  lib_meminstream.c lib_memoutstream.c lib_lowinstream.c \
                          -		  lib_lowoutstream.c lib_zeroinstream.c lib_nullinstream.c \
                          -		  lib_nulloutstream.c lib_sscanf.c
                          +		 lib_sprintf.c lib_asprintf.c lib_snprintf.c lib_libsprintf.c \
                          +		 lib_vsprintf.c lib_avsprintf.c lib_vsnprintf.c lib_libvsprintf.c \
                          +		 lib_meminstream.c lib_memoutstream.c lib_lowinstream.c \
                          +		 lib_lowoutstream.c lib_zeroinstream.c lib_nullinstream.c \
                          +		 lib_nulloutstream.c lib_sscanf.c
                          +
                          +# The remaining sources files depend upon file descriptors
                           
                           ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
                          +
                           CSRCS += lib_rawinstream.c lib_rawoutstream.c
                          +
                          +# And these depend upon both file descriptors and C streams
                          +
                           ifneq ($(CONFIG_NFILE_STREAMS),0)
                          +
                           CSRCS += lib_fopen.c lib_fclose.c lib_fread.c lib_libfread.c lib_fseek.c \
                          -		   lib_ftell.c lib_fsetpos.c lib_fgetpos.c lib_fgetc.c lib_fgets.c \
                          -		   lib_gets.c lib_fwrite.c lib_libfwrite.c lib_fflush.c \
                          -		   lib_libflushall.c lib_libfflush.c lib_rdflush.c lib_wrflush.c \
                          -		   lib_fputc.c lib_puts.c lib_fputs.c lib_ungetc.c lib_vprintf.c \
                          -		   lib_fprintf.c lib_vfprintf.c lib_vdprintf.c lib_stdinstream.c lib_stdoutstream.c \
                          -		   lib_perror.c
                          +		 lib_ftell.c lib_fsetpos.c lib_fgetpos.c lib_fgetc.c lib_fgets.c \
                          +		 lib_gets.c lib_fwrite.c lib_libfwrite.c lib_fflush.c \
                          +		 lib_libflushall.c lib_libfflush.c lib_rdflush.c lib_wrflush.c \
                          +		 lib_fputc.c lib_puts.c lib_fputs.c lib_ungetc.c lib_vprintf.c \
                          +		 lib_fprintf.c lib_vfprintf.c lib_stdinstream.c lib_stdoutstream.c \
                          +		 lib_perror.c lib_feof.c lib_ferror.c lib_clearerr.c
                          +
                           endif
                           endif
                           
                          +# Other support that depends on specific, configured features.
                          +
                           ifeq ($(CONFIG_SYSLOG),y)
                           CSRCS += lib_syslogstream.c
                           endif
                          diff --git a/nuttx/lib/stdio/lib_asprintf.c b/nuttx/libc/stdio/lib_asprintf.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_asprintf.c
                          rename to nuttx/libc/stdio/lib_asprintf.c
                          index 84aaafa462..20ca6de326 100644
                          --- a/nuttx/lib/stdio/lib_asprintf.c
                          +++ b/nuttx/libc/stdio/lib_asprintf.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_asprintf.c
                          + * libc/stdio/lib_asprintf.c
                            *
                            *   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_avsprintf.c b/nuttx/libc/stdio/lib_avsprintf.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_avsprintf.c
                          rename to nuttx/libc/stdio/lib_avsprintf.c
                          index 8561b97c21..15ff8c9fbd 100644
                          --- a/nuttx/lib/stdio/lib_avsprintf.c
                          +++ b/nuttx/libc/stdio/lib_avsprintf.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_avsprintf.c
                          + * libc/stdio/lib_avsprintf.c
                            *
                            *   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_memmove.c b/nuttx/libc/stdio/lib_clearerr.c
                          similarity index 60%
                          rename from nuttx/lib/string/lib_memmove.c
                          rename to nuttx/libc/stdio/lib_clearerr.c
                          index ecaeb54cf2..589b56feb6 100644
                          --- a/nuttx/lib/string/lib_memmove.c
                          +++ b/nuttx/libc/stdio/lib_clearerr.c
                          @@ -1,7 +1,7 @@
                          -/************************************************************
                          - * lib/string/lib_memmove.c
                          +/****************************************************************************
                          + * libc/stdio/lib_clearerr.c
                            *
                          - *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                            *
                            * Redistribution and use in source and binary forms, with or without
                          @@ -31,42 +31,39 @@
                            * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
                            * POSSIBILITY OF SUCH DAMAGE.
                            *
                          - ************************************************************/
                          + ****************************************************************************/
                           
                          -/************************************************************
                          - * Compilation Switches
                          - ************************************************************/
                          -
                          -/************************************************************
                          +/****************************************************************************
                            * Included Files
                          - ************************************************************/
                          + ****************************************************************************/
                           
                           #include 
                          -#include 
                          -#include 
                           
                          -/************************************************************
                          - * Global Functions
                          - ************************************************************/
                          +#include 
                          +#include 
                           
                          -#ifndef CONFIG_ARCH_MEMMOVE
                          -void *memmove(void *dest, const void *src, size_t count)
                          +#include 
                          +
                          +#if CONFIG_NFILE_STREAMS > 0
                          +
                          +/****************************************************************************
                          + * Public Functions
                          + ****************************************************************************/
                          +
                          +/****************************************************************************
                          + * Name: Functions
                          + *
                          + * Description:
                          + *   Clear any end-of-file or error conditions.
                          + *
                          + * Returned Value:
                          + *   None
                          + *
                          + ****************************************************************************/
                          +
                          +void clearerr(FILE *stream)
                           {
                          -  char *tmp, *s;
                          -  if (dest <= src)
                          -    {
                          -      tmp = (char*) dest;
                          -      s = (char*) src;
                          -      while (count--)
                          -	*tmp++ = *s++;
                          -    }
                          -  else
                          -    {
                          -      tmp = (char*) dest + count;
                          -      s = (char*) src + count;
                          -      while (count--)
                          -	*--tmp = *--s;
                          -    }
                          -  return dest;
                          +  stream->fs_flags = 0;
                           }
                          -#endif
                          +#endif /* CONFIG_NFILE_STREAMS */
                          +
                          diff --git a/nuttx/lib/stdio/lib_dtoa.c b/nuttx/libc/stdio/lib_dtoa.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_dtoa.c
                          rename to nuttx/libc/stdio/lib_dtoa.c
                          index b8c7db9803..44290ae328 100644
                          --- a/nuttx/lib/stdio/lib_dtoa.c
                          +++ b/nuttx/libc/stdio/lib_dtoa.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_dtoa.c
                          + * libc/stdio/lib_dtoa.c
                            *
                            * This file was ported to NuttX by Yolande Cates.
                            *
                          diff --git a/nuttx/lib/stdio/lib_fclose.c b/nuttx/libc/stdio/lib_fclose.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_fclose.c
                          rename to nuttx/libc/stdio/lib_fclose.c
                          index 8cecb8af3c..c04537adf7 100644
                          --- a/nuttx/lib/stdio/lib_fclose.c
                          +++ b/nuttx/libc/stdio/lib_fclose.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_fclose.c
                          + * libc/stdio/lib_fclose.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strstr.c b/nuttx/libc/stdio/lib_feof.c
                          similarity index 54%
                          rename from nuttx/lib/string/lib_strstr.c
                          rename to nuttx/libc/stdio/lib_feof.c
                          index b8c896fa2e..e036398fda 100644
                          --- a/nuttx/lib/string/lib_strstr.c
                          +++ b/nuttx/libc/stdio/lib_feof.c
                          @@ -1,17 +1,17 @@
                           /****************************************************************************
                          - * lib/string/lib_strstr.c
                          + * libc/stdio/lib_feof.c
                            *
                          - *   Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
                          + *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                            *
                          - * Redistribution and use str source and binary forms, with or without
                          + * 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 str binary form must reproduce the above copyright
                          - *    notice, this list of conditions and the following disclaimer str
                          + * 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
                          @@ -39,66 +39,39 @@
                           
                           #include 
                           
                          -#include 
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +#if CONFIG_NFILE_STREAMS > 0
                           
                           /****************************************************************************
                          - * Global Functions
                          + * Public Functions
                            ****************************************************************************/
                           
                          -char *strstr(const char *str, const char *substr)
                          +/****************************************************************************
                          + * Name: feof
                          + *
                          + * Description:
                          + *   The feof() function shall test if the currently file pointer for the
                          + *   stream is at the end of file.
                          + *
                          + * Returned Value:
                          + *  This function will return non-zero if the the file pointer is positioned
                          + *  at the end of file.
                          + *
                          + ****************************************************************************/
                          +
                          +int feof(FILE *stream)
                           {
                          -  const char *candidate;  /* Candidate in str with matching start character */
                          -  char         ch;        /* First character of the substring */
                          -  int          len;       /* The length of the substring */
                          +  /* If the end-of-file condition is encountered by any of the C-buffered
                          +   * I/O functions that perform read operations, they should set the
                          +   * __FS_FLAG_EOF in the fs_flags field of struct file_struct.
                          +   */
                           
                          -  /* Special case the empty substring */
                          -
                          -  len = strlen(substr);
                          -  ch  = *substr;
                          -
                          -  if (!ch)
                          -    {
                          -      /* We'll say that an empty substring matches at the beginning of
                          -       * the string
                          -       */
                          -
                          -      return (char*)str;
                          -    }
                          -
                          -  /* Search for the substring */
                          -
                          -  candidate = str;
                          -  for (;;)
                          -    {
                          -      /* strchr() will return a pointer to the next occurrence of the
                          -       * character ch in the string
                          -       */
                          -
                          -      candidate = strchr(candidate, ch);
                          -      if (!candidate || strlen(candidate) < len)
                          -        {
                          -           /* First character of the substring does not appear in the string
                          -            * or the remainder of the string is not long enough to contain the
                          -            * substring.
                          -            */
                          -
                          -           return NULL;
                          -        }
                          -
                          -      /* Check if this is the beginning of a matching substring */
                          -
                          -      if (strncmp(candidate, substr, len) == 0)
                          -        {
                          -           return (char*)candidate;
                          -        }
                          -
                          -      /* No, find the next candidate after this one */
                          -
                          -      candidate++;
                          -    }
                          -
                          -  /* Won't get here, but some compilers might complain */
                          -
                          -  return NULL;
                          +  return (stream->fs_flags & __FS_FLAG_EOF) != 0;
                           }
                           
                          +#endif /* CONFIG_NFILE_STREAMS */
                          +
                          diff --git a/nuttx/lib/string/lib_strcasestr.c b/nuttx/libc/stdio/lib_ferror.c
                          similarity index 50%
                          rename from nuttx/lib/string/lib_strcasestr.c
                          rename to nuttx/libc/stdio/lib_ferror.c
                          index 23f0ab57e6..a977394cb1 100644
                          --- a/nuttx/lib/string/lib_strcasestr.c
                          +++ b/nuttx/libc/stdio/lib_ferror.c
                          @@ -1,17 +1,17 @@
                           /****************************************************************************
                          - * lib/string/lib_strstr.c
                          + * libc/stdio/lib_ferror.c
                            *
                            *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                            *
                          - * Redistribution and use str source and binary forms, with or without
                          + * 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 str binary form must reproduce the above copyright
                          - *    notice, this list of conditions and the following disclaimer str
                          + * 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
                          @@ -39,96 +39,52 @@
                           
                           #include 
                           
                          -#include 
                          -#include 
                          +#include 
                          +#include 
                          +
                          +#include 
                          +
                          +#if CONFIG_NFILE_STREAMS > 0
                           
                           /****************************************************************************
                          - * Private Functions
                          + * Public Functions
                            ****************************************************************************/
                           
                          -static FAR char *strcasechr(FAR const char *s, int uc)
                          -{
                          -  register char ch;
                          -
                          -  if (s)
                          -    {
                          -      for (; *s; s++)
                          -        {
                          -          ch = *s;
                          -          if (toupper(ch) == uc)
                          -            {
                          -              return (FAR char*)s;
                          -            }
                          -        }
                          -    }
                          -
                          -  return NULL;
                          -}
                          -
                           /****************************************************************************
                          - * Global Functions
                          + * Name: ferror
                          + *
                          + * Description:
                          + *   This function will test if the last operation resulted in an eror.  This
                          + *   is used to disambiguate EOF and error conditions.
                          + *
                          + * Return Value:
                          + *   A non-zero value is returned to indicate the error condition.
                          + *
                            ****************************************************************************/
                           
                          -FAR char *strcasestr(FAR const char *str, FAR const char *substr)
                          +int ferror(FILE *stream)
                           {
                          -  const char *candidate;  /* Candidate in str with matching start character */
                          -  char         ch;        /* First character of the substring */
                          -  int          len;       /* The length of the substring */
                          +#if 0
                          +  /* If an error is encountered by any of the C-buffered I/O functions, they
                          +   * should set the __FS_FLAG_ERROR in the fs_flags field of struct
                          +   * file_struct.
                          +   */
                           
                          -  /* Special case the empty substring */
                          +  return (stream->fs_flags & __FS_FLAG_ERROR) != 0;
                          +#else
                          +  /* However, nothing currenlty sets the __FS_FLAG_ERROR flag (that is a job
                          +   * for another day).  The __FS_FLAG_EOF is set by operations that perform
                          +   * read operations.  Since ferror()  is probably only called to disambiguate
                          +   * the meaning of other functions that return EOF, to indicate either EOF or
                          +   * an error, just testing for not EOF is probably sufficient for now.
                          +   *
                          +   * This approach would not work if ferror() is called in other contexts. In
                          +   * those cases, ferror() will always report an error.
                          +   */
                           
                          -  len = strlen(substr);
                          -  ch  = *substr;
                          -
                          -  if (!ch)
                          -    {
                          -      /* We'll say that an empty substring matches at the beginning of
                          -       * the string
                          -       */
                          -
                          -      return (char*)str;
                          -    }
                          -
                          -  /* Search for the substring */
                          -
                          -  candidate = str;
                          -  ch        = toupper(ch);
                          -
                          -  for (;;)
                          -    {
                          -      /* strcasechr() will return a pointer to the next occurrence of the
                          -       * character ch in the string (ignoring case)
                          -       */
                          -
                          -      candidate = strcasechr(candidate, ch);
                          -      if (!candidate || strlen(candidate) < len)
                          -        {
                          -           /* First character of the substring does not appear in the string
                          -            * or the remainder of the string is not long enough to contain the
                          -            * substring.
                          -            */
                          -
                          -           return NULL;
                          -        }
                          -
                          -      /* Check if this is the beginning of a matching substring (ignoring case) */
                          -
                          -      if (strncasecmp(candidate, substr, len) == 0)
                          -        {
                          -           /* Yes.. return the pointer to the first occurrence of the matching
                          -            * substring.
                          -            */
                          -
                          -           return (char*)candidate;
                          -        }
                          -
                          -      /* No, find the next candidate after this one */
                          -
                          -      candidate++;
                          -    }
                          -
                          -  /* Won't get here, but some compilers might complain */
                          -
                          -  return NULL;
                          +  return (stream->fs_flags & __FS_FLAG_EOF) == 0;
                          +#endif
                           }
                           
                          +#endif /* CONFIG_NFILE_STREAMS */
                          +
                          diff --git a/nuttx/lib/stdio/lib_fflush.c b/nuttx/libc/stdio/lib_fflush.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_fflush.c
                          rename to nuttx/libc/stdio/lib_fflush.c
                          index d0b5e0185d..a84a14a599 100644
                          --- a/nuttx/lib/stdio/lib_fflush.c
                          +++ b/nuttx/libc/stdio/lib_fflush.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_fflush.c
                          + * libc/stdio/lib_fflush.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_fgetc.c b/nuttx/libc/stdio/lib_fgetc.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_fgetc.c
                          rename to nuttx/libc/stdio/lib_fgetc.c
                          index 4b3d0ec44f..81e2e4ba72 100644
                          --- a/nuttx/lib/stdio/lib_fgetc.c
                          +++ b/nuttx/libc/stdio/lib_fgetc.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_fgetc.c
                          + * libc/stdio/lib_fgetc.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_fgetpos.c b/nuttx/libc/stdio/lib_fgetpos.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_fgetpos.c
                          rename to nuttx/libc/stdio/lib_fgetpos.c
                          index e9e9f4d102..7663ca2dbe 100644
                          --- a/nuttx/lib/stdio/lib_fgetpos.c
                          +++ b/nuttx/libc/stdio/lib_fgetpos.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_fgetpos.c
                          + * libc/stdio/lib_fgetpos.c
                            *
                            *   Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_fgets.c b/nuttx/libc/stdio/lib_fgets.c
                          similarity index 98%
                          rename from nuttx/lib/stdio/lib_fgets.c
                          rename to nuttx/libc/stdio/lib_fgets.c
                          index a4f9089ed7..35d024ebb0 100644
                          --- a/nuttx/lib/stdio/lib_fgets.c
                          +++ b/nuttx/libc/stdio/lib_fgets.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_fgets.c
                          + * libc/stdio/lib_fgets.c
                            *
                            *   Copyright (C) 2007-2008, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          @@ -150,7 +150,7 @@ char *fgets(FAR char *buf, int buflen, FILE *stream)
                                 if (ch == '\n')
                           #elif defined(CONFIG_EOL_IS_CR)
                                 if (ch == '\r')
                          -#elif CONFIG_EOL_IS_EITHER_CRLF
                          +#else /* elif CONFIG_EOL_IS_EITHER_CRLF */
                                 if (ch == '\n' || ch == '\r')
                           #endif
                                   {
                          diff --git a/nuttx/lib/stdio/lib_fileno.c b/nuttx/libc/stdio/lib_fileno.c
                          similarity index 98%
                          rename from nuttx/lib/stdio/lib_fileno.c
                          rename to nuttx/libc/stdio/lib_fileno.c
                          index fca08fc0d4..f227aa372b 100644
                          --- a/nuttx/lib/stdio/lib_fileno.c
                          +++ b/nuttx/libc/stdio/lib_fileno.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_fileno.c
                          + * libc/stdio/lib_fileno.c
                            *
                            *   Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_fopen.c b/nuttx/libc/stdio/lib_fopen.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_fopen.c
                          rename to nuttx/libc/stdio/lib_fopen.c
                          index 29ff4569c2..cb68b35843 100644
                          --- a/nuttx/lib/stdio/lib_fopen.c
                          +++ b/nuttx/libc/stdio/lib_fopen.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_fopen.c
                          + * libc/stdio/lib_fopen.c
                            *
                            *   Copyright (C) 2007-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_fprintf.c b/nuttx/libc/stdio/lib_fprintf.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_fprintf.c
                          rename to nuttx/libc/stdio/lib_fprintf.c
                          index a803de4bd0..5b6fe58f42 100644
                          --- a/nuttx/lib/stdio/lib_fprintf.c
                          +++ b/nuttx/libc/stdio/lib_fprintf.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_fprintf.c
                          + * libc/stdio/lib_fprintf.c
                            *
                            *   Copyright (C) 2007, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_fputc.c b/nuttx/libc/stdio/lib_fputc.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_fputc.c
                          rename to nuttx/libc/stdio/lib_fputc.c
                          index 121161f102..5d8065b431 100644
                          --- a/nuttx/lib/stdio/lib_fputc.c
                          +++ b/nuttx/libc/stdio/lib_fputc.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_fputc.c
                          + * libc/stdio/lib_fputc.c
                            *
                            *   Copyright (C) 2007, 2008, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_fputs.c b/nuttx/libc/stdio/lib_fputs.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_fputs.c
                          rename to nuttx/libc/stdio/lib_fputs.c
                          index 2d6217d4aa..7b87a89d00 100644
                          --- a/nuttx/lib/stdio/lib_fputs.c
                          +++ b/nuttx/libc/stdio/lib_fputs.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_fputs.c
                          + * libc/stdio/lib_fputs.c
                            *
                            *   Copyright (C) 2007, 2008, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_fread.c b/nuttx/libc/stdio/lib_fread.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_fread.c
                          rename to nuttx/libc/stdio/lib_fread.c
                          index 4a4b29256d..6717141225 100644
                          --- a/nuttx/lib/stdio/lib_fread.c
                          +++ b/nuttx/libc/stdio/lib_fread.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_fread.c
                          + * libc/stdio/lib_fread.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_fseek.c b/nuttx/libc/stdio/lib_fseek.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_fseek.c
                          rename to nuttx/libc/stdio/lib_fseek.c
                          index 7380f83b3b..36216d94a9 100644
                          --- a/nuttx/lib/stdio/lib_fseek.c
                          +++ b/nuttx/libc/stdio/lib_fseek.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_fseek.c
                          + * libc/stdio/lib_fseek.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_fsetpos.c b/nuttx/libc/stdio/lib_fsetpos.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_fsetpos.c
                          rename to nuttx/libc/stdio/lib_fsetpos.c
                          index 13d556521b..3d79a18775 100644
                          --- a/nuttx/lib/stdio/lib_fsetpos.c
                          +++ b/nuttx/libc/stdio/lib_fsetpos.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_fsetpos.c
                          + * libc/stdio/lib_fsetpos.c
                            *
                            *   Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_ftell.c b/nuttx/libc/stdio/lib_ftell.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_ftell.c
                          rename to nuttx/libc/stdio/lib_ftell.c
                          index 9476481529..99fc20f340 100644
                          --- a/nuttx/lib/stdio/lib_ftell.c
                          +++ b/nuttx/libc/stdio/lib_ftell.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_ftell.c
                          + * libc/stdio/lib_ftell.c
                            *
                            *   Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_fwrite.c b/nuttx/libc/stdio/lib_fwrite.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_fwrite.c
                          rename to nuttx/libc/stdio/lib_fwrite.c
                          index 60e0017463..e8de004feb 100644
                          --- a/nuttx/lib/stdio/lib_fwrite.c
                          +++ b/nuttx/libc/stdio/lib_fwrite.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_fwrite.c
                          + * libc/stdio/lib_fwrite.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_gets.c b/nuttx/libc/stdio/lib_gets.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_gets.c
                          rename to nuttx/libc/stdio/lib_gets.c
                          index 95a6b36ebf..39c31d273d 100644
                          --- a/nuttx/lib/stdio/lib_gets.c
                          +++ b/nuttx/libc/stdio/lib_gets.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_gets.c
                          + * libc/stdio/lib_gets.c
                            *
                            *   Copyright (C) 2007-2008, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_libdtoa.c b/nuttx/libc/stdio/lib_libdtoa.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_libdtoa.c
                          rename to nuttx/libc/stdio/lib_libdtoa.c
                          index 667c49c535..29f61fd76e 100644
                          --- a/nuttx/lib/stdio/lib_libdtoa.c
                          +++ b/nuttx/libc/stdio/lib_libdtoa.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/unistd/lib_libdtoa.c
                          + * libc/unistd/lib_libdtoa.c
                            *
                            * This file was ported to NuttX by Yolande Cates.
                            *
                          diff --git a/nuttx/lib/stdio/lib_libfflush.c b/nuttx/libc/stdio/lib_libfflush.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_libfflush.c
                          rename to nuttx/libc/stdio/lib_libfflush.c
                          index 2a4fe29326..f2f0cfe144 100644
                          --- a/nuttx/lib/stdio/lib_libfflush.c
                          +++ b/nuttx/libc/stdio/lib_libfflush.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_libfflush.c
                          + * libc/stdio/lib_libfflush.c
                            *
                            *   Copyright (C) 2007-2008, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_libflushall.c b/nuttx/libc/stdio/lib_libflushall.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_libflushall.c
                          rename to nuttx/libc/stdio/lib_libflushall.c
                          index 9d0a89e9c1..7ac3da7e0e 100644
                          --- a/nuttx/lib/stdio/lib_libflushall.c
                          +++ b/nuttx/libc/stdio/lib_libflushall.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_libflushall.c
                          + * libc/stdio/lib_libflushall.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_libfread.c b/nuttx/libc/stdio/lib_libfread.c
                          similarity index 89%
                          rename from nuttx/lib/stdio/lib_libfread.c
                          rename to nuttx/libc/stdio/lib_libfread.c
                          index 03b47eda66..bc6479037d 100644
                          --- a/nuttx/lib/stdio/lib_libfread.c
                          +++ b/nuttx/libc/stdio/lib_libfread.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_libfread.c
                          + * libc/stdio/lib_libfread.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          @@ -187,7 +187,10 @@ ssize_t lib_fread(FAR void *ptr, size_t count, FAR FILE *stream)
                                               }
                                             else if (bytes_read == 0)
                                               {
                          -                      /* We are at the end of the file */
                          +                      /* We are at the end of the file.  But we may already
                          +                       * have buffered data.  In that case, we will report
                          +                       * the EOF indication later.
                          +                       */
                           
                                                 goto shortread;
                                               }
                          @@ -232,7 +235,10 @@ ssize_t lib_fread(FAR void *ptr, size_t count, FAR FILE *stream)
                                               }
                                             else if (bytes_read == 0)
                                               {
                          -                      /* We are at the end of the file */
                          +                      /* We are at the end of the file.  But we may already
                          +                       * have buffered data.  In that case, we will report
                          +                       * the EOF indication later.
                          +                       */
                           
                                                 goto shortread;
                                               }
                          @@ -261,6 +267,11 @@ ssize_t lib_fread(FAR void *ptr, size_t count, FAR FILE *stream)
                                       }
                                     else if (bytes_read == 0)
                                       {
                          +              /* We are at the end of the file.  But we may already
                          +               * have buffered data.  In that case, we will report
                          +               * the EOF indication later.
                          +               */
                          +
                                         break;
                                       }
                                     else
                          @@ -270,12 +281,26 @@ ssize_t lib_fread(FAR void *ptr, size_t count, FAR FILE *stream)
                                       }
                                   }
                           #endif
                          -    /* Here after a successful (but perhaps short) read */
                          +      /* Here after a successful (but perhaps short) read */
                           
                           #if CONFIG_STDIO_BUFFER_SIZE > 0
                               shortread:
                           #endif
                                 bytes_read = dest - (unsigned char*)ptr;
                          +
                          +      /* Set or clear the EOF indicator.  If we get here because of a
                          +       * short read and the total number of* bytes read is zero, then
                          +       * we must be at the end-of-file.
                          +       */
                          +
                          +      if (bytes_read > 0)
                          +        {
                          +          stream->fs_flags &= ~__FS_FLAG_EOF;
                          +        }
                          +      else
                          +        {
                          +          stream->fs_flags |= __FS_FLAG_EOF;
                          +        }
                               }
                           
                             lib_give_semaphore(stream);
                          diff --git a/nuttx/lib/stdio/lib_libfwrite.c b/nuttx/libc/stdio/lib_libfwrite.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_libfwrite.c
                          rename to nuttx/libc/stdio/lib_libfwrite.c
                          index e71866b498..b917b3b564 100644
                          --- a/nuttx/lib/stdio/lib_libfwrite.c
                          +++ b/nuttx/libc/stdio/lib_libfwrite.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_libfwrite.c
                          + * libc/stdio/lib_libfwrite.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_libnoflush.c b/nuttx/libc/stdio/lib_libnoflush.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_libnoflush.c
                          rename to nuttx/libc/stdio/lib_libnoflush.c
                          index e3b8911534..076f8a17e6 100644
                          --- a/nuttx/lib/stdio/lib_libnoflush.c
                          +++ b/nuttx/libc/stdio/lib_libnoflush.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_libnoflush.c
                          + * libc/stdio/lib_libnoflush.c
                            *
                            *   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_libsprintf.c b/nuttx/libc/stdio/lib_libsprintf.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_libsprintf.c
                          rename to nuttx/libc/stdio/lib_libsprintf.c
                          index 2474a6f01d..2d820ab37b 100644
                          --- a/nuttx/lib/stdio/lib_libsprintf.c
                          +++ b/nuttx/libc/stdio/lib_libsprintf.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_libsprintf.c
                          + * libc/stdio/lib_libsprintf.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_libvsprintf.c b/nuttx/libc/stdio/lib_libvsprintf.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_libvsprintf.c
                          rename to nuttx/libc/stdio/lib_libvsprintf.c
                          index 30c988599c..9a391610dc 100644
                          --- a/nuttx/lib/stdio/lib_libvsprintf.c
                          +++ b/nuttx/libc/stdio/lib_libvsprintf.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_libvsprintf.c
                          + * libc/stdio/lib_libvsprintf.c
                            *
                            *   Copyright (C) 2007-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          @@ -1161,7 +1161,7 @@ static void postjustify(FAR struct lib_outstream_s *obj, uint8_t fmt,
                            ****************************************************************************/
                           
                           /****************************************************************************
                          - * lib/stdio/lib_vsprintf
                          + * libc/stdio/lib_vsprintf
                            ****************************************************************************/
                           
                           int lib_vsprintf(FAR struct lib_outstream_s *obj, FAR const char *src, va_list ap)
                          diff --git a/nuttx/lib/stdio/lib_lowinstream.c b/nuttx/libc/stdio/lib_lowinstream.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_lowinstream.c
                          rename to nuttx/libc/stdio/lib_lowinstream.c
                          index 499a647ea2..7284601e8e 100644
                          --- a/nuttx/lib/stdio/lib_lowinstream.c
                          +++ b/nuttx/libc/stdio/lib_lowinstream.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_lowinstream.c
                          + * libc/stdio/lib_lowinstream.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_lowoutstream.c b/nuttx/libc/stdio/lib_lowoutstream.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_lowoutstream.c
                          rename to nuttx/libc/stdio/lib_lowoutstream.c
                          index 092f39ca25..f600bc614a 100644
                          --- a/nuttx/lib/stdio/lib_lowoutstream.c
                          +++ b/nuttx/libc/stdio/lib_lowoutstream.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_lowoutstream.c
                          + * libc/stdio/lib_lowoutstream.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_lowprintf.c b/nuttx/libc/stdio/lib_lowprintf.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_lowprintf.c
                          rename to nuttx/libc/stdio/lib_lowprintf.c
                          index 392ef2c6a8..f7d4ffe2fe 100644
                          --- a/nuttx/lib/stdio/lib_lowprintf.c
                          +++ b/nuttx/libc/stdio/lib_lowprintf.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_lowprintf.c
                          + * libc/stdio/lib_lowprintf.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_meminstream.c b/nuttx/libc/stdio/lib_meminstream.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_meminstream.c
                          rename to nuttx/libc/stdio/lib_meminstream.c
                          index a842096fb4..2a30d956d6 100644
                          --- a/nuttx/lib/stdio/lib_meminstream.c
                          +++ b/nuttx/libc/stdio/lib_meminstream.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_meminstream.c
                          + * libc/stdio/lib_meminstream.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_memoutstream.c b/nuttx/libc/stdio/lib_memoutstream.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_memoutstream.c
                          rename to nuttx/libc/stdio/lib_memoutstream.c
                          index 21197358b7..efd527cbc5 100644
                          --- a/nuttx/lib/stdio/lib_memoutstream.c
                          +++ b/nuttx/libc/stdio/lib_memoutstream.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_memoutstream.c
                          + * libc/stdio/lib_memoutstream.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_nullinstream.c b/nuttx/libc/stdio/lib_nullinstream.c
                          similarity index 98%
                          rename from nuttx/lib/stdio/lib_nullinstream.c
                          rename to nuttx/libc/stdio/lib_nullinstream.c
                          index 0eadb0a8e4..aeb0af3790 100644
                          --- a/nuttx/lib/stdio/lib_nullinstream.c
                          +++ b/nuttx/libc/stdio/lib_nullinstream.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_nullinstream.c
                          + * libc/stdio/lib_nullinstream.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_nulloutstream.c b/nuttx/libc/stdio/lib_nulloutstream.c
                          similarity index 98%
                          rename from nuttx/lib/stdio/lib_nulloutstream.c
                          rename to nuttx/libc/stdio/lib_nulloutstream.c
                          index 69878fd579..5742953448 100644
                          --- a/nuttx/lib/stdio/lib_nulloutstream.c
                          +++ b/nuttx/libc/stdio/lib_nulloutstream.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_nulloutstream.c
                          + * libc/stdio/lib_nulloutstream.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_perror.c b/nuttx/libc/stdio/lib_perror.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_perror.c
                          rename to nuttx/libc/stdio/lib_perror.c
                          index 867e113f98..1818983292 100644
                          --- a/nuttx/lib/stdio/lib_perror.c
                          +++ b/nuttx/libc/stdio/lib_perror.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_perror.c
                          + * libc/stdio/lib_perror.c
                            *
                            *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_printf.c b/nuttx/libc/stdio/lib_printf.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_printf.c
                          rename to nuttx/libc/stdio/lib_printf.c
                          index 50db06c475..0e90c7ca5a 100644
                          --- a/nuttx/lib/stdio/lib_printf.c
                          +++ b/nuttx/libc/stdio/lib_printf.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_printf.c
                          + * libc/stdio/lib_printf.c
                            *
                            *   Copyright (C) 2007-2008, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_puts.c b/nuttx/libc/stdio/lib_puts.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_puts.c
                          rename to nuttx/libc/stdio/lib_puts.c
                          index e63a63917f..53eda7081e 100644
                          --- a/nuttx/lib/stdio/lib_puts.c
                          +++ b/nuttx/libc/stdio/lib_puts.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_puts.c
                          + * libc/stdio/lib_puts.c
                            *
                            *   Copyright (C) 2007, 2008, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_rawinstream.c b/nuttx/libc/stdio/lib_rawinstream.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_rawinstream.c
                          rename to nuttx/libc/stdio/lib_rawinstream.c
                          index 9671a27166..55456769eb 100644
                          --- a/nuttx/lib/stdio/lib_rawinstream.c
                          +++ b/nuttx/libc/stdio/lib_rawinstream.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_rawinstream.c
                          + * libc/stdio/lib_rawinstream.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_rawoutstream.c b/nuttx/libc/stdio/lib_rawoutstream.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_rawoutstream.c
                          rename to nuttx/libc/stdio/lib_rawoutstream.c
                          index ed813f87aa..e1fe371346 100644
                          --- a/nuttx/lib/stdio/lib_rawoutstream.c
                          +++ b/nuttx/libc/stdio/lib_rawoutstream.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_rawoutstream.c
                          + * libc/stdio/lib_rawoutstream.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_rawprintf.c b/nuttx/libc/stdio/lib_rawprintf.c
                          similarity index 91%
                          rename from nuttx/lib/stdio/lib_rawprintf.c
                          rename to nuttx/libc/stdio/lib_rawprintf.c
                          index 1a6eb16b7c..98bbbea053 100644
                          --- a/nuttx/lib/stdio/lib_rawprintf.c
                          +++ b/nuttx/libc/stdio/lib_rawprintf.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_rawprintf.c
                          + * libc/stdio/lib_rawprintf.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          @@ -149,18 +149,3 @@ int lib_rawprintf(const char *fmt, ...)
                           
                             return ret;
                           }
                          -
                          -
                          -/****************************************************************************
                          - * Name: lib_rawvdprintf
                          - ****************************************************************************/
                          -
                          -int lib_rawvdprintf(int fd, const char *fmt, va_list ap)
                          -{
                          -  /* Wrap the stdout in a stream object and let lib_vsprintf
                          -   * do the work.
                          -   */
                          -  struct lib_rawoutstream_s rawoutstream;
                          -  lib_rawoutstream(&rawoutstream, fd);
                          -  return lib_vsprintf(&rawoutstream.public, fmt, ap);
                          -}
                          diff --git a/nuttx/lib/stdio/lib_rdflush.c b/nuttx/libc/stdio/lib_rdflush.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_rdflush.c
                          rename to nuttx/libc/stdio/lib_rdflush.c
                          index 35c5495c17..c6136792bb 100644
                          --- a/nuttx/lib/stdio/lib_rdflush.c
                          +++ b/nuttx/libc/stdio/lib_rdflush.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_rdflush.c
                          + * libc/stdio/lib_rdflush.c
                            *
                            *   Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_snprintf.c b/nuttx/libc/stdio/lib_snprintf.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_snprintf.c
                          rename to nuttx/libc/stdio/lib_snprintf.c
                          index e5ce7b0f02..a4ba0dbb30 100644
                          --- a/nuttx/lib/stdio/lib_snprintf.c
                          +++ b/nuttx/libc/stdio/lib_snprintf.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_snprintf.c
                          + * libc/stdio/lib_snprintf.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_sprintf.c b/nuttx/libc/stdio/lib_sprintf.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_sprintf.c
                          rename to nuttx/libc/stdio/lib_sprintf.c
                          index 89fd610330..deb0669a3b 100644
                          --- a/nuttx/lib/stdio/lib_sprintf.c
                          +++ b/nuttx/libc/stdio/lib_sprintf.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_sprintf.c
                          + * libc/stdio/lib_sprintf.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_sscanf.c b/nuttx/libc/stdio/lib_sscanf.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_sscanf.c
                          rename to nuttx/libc/stdio/lib_sscanf.c
                          index 7e1fae276d..77a6cf212f 100644
                          --- a/nuttx/lib/stdio/lib_sscanf.c
                          +++ b/nuttx/libc/stdio/lib_sscanf.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_sscanf.c
                          + * libc/stdio/lib_sscanf.c
                            *
                            *   Copyright (C) 2007, 2008, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_stdinstream.c b/nuttx/libc/stdio/lib_stdinstream.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_stdinstream.c
                          rename to nuttx/libc/stdio/lib_stdinstream.c
                          index 77aab9ec88..261b266346 100644
                          --- a/nuttx/lib/stdio/lib_stdinstream.c
                          +++ b/nuttx/libc/stdio/lib_stdinstream.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_stdinstream.c
                          + * libc/stdio/lib_stdinstream.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_stdoutstream.c b/nuttx/libc/stdio/lib_stdoutstream.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_stdoutstream.c
                          rename to nuttx/libc/stdio/lib_stdoutstream.c
                          index 20da5b7026..dfe67271f1 100644
                          --- a/nuttx/lib/stdio/lib_stdoutstream.c
                          +++ b/nuttx/libc/stdio/lib_stdoutstream.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_stdoutstream.c
                          + * libc/stdio/lib_stdoutstream.c
                            *
                            *   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_syslogstream.c b/nuttx/libc/stdio/lib_syslogstream.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_syslogstream.c
                          rename to nuttx/libc/stdio/lib_syslogstream.c
                          index 21151b43a1..5529c5de8c 100644
                          --- a/nuttx/lib/stdio/lib_syslogstream.c
                          +++ b/nuttx/libc/stdio/lib_syslogstream.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_syslogstream.c
                          + * libc/stdio/lib_syslogstream.c
                            *
                            *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_ungetc.c b/nuttx/libc/stdio/lib_ungetc.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_ungetc.c
                          rename to nuttx/libc/stdio/lib_ungetc.c
                          index c10d4fba1a..178aeddd10 100644
                          --- a/nuttx/lib/stdio/lib_ungetc.c
                          +++ b/nuttx/libc/stdio/lib_ungetc.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_ungetc.c
                          + * libc/stdio/lib_ungetc.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_vfprintf.c b/nuttx/libc/stdio/lib_vfprintf.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_vfprintf.c
                          rename to nuttx/libc/stdio/lib_vfprintf.c
                          index 1c3a2d7fc9..cd117ddc30 100644
                          --- a/nuttx/lib/stdio/lib_vfprintf.c
                          +++ b/nuttx/libc/stdio/lib_vfprintf.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_vfprintf.c
                          + * libc/stdio/lib_vfprintf.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_vprintf.c b/nuttx/libc/stdio/lib_vprintf.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_vprintf.c
                          rename to nuttx/libc/stdio/lib_vprintf.c
                          index d085d58869..6ddfe2b246 100644
                          --- a/nuttx/lib/stdio/lib_vprintf.c
                          +++ b/nuttx/libc/stdio/lib_vprintf.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_vprintf.c
                          + * libc/stdio/lib_vprintf.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_vsnprintf.c b/nuttx/libc/stdio/lib_vsnprintf.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_vsnprintf.c
                          rename to nuttx/libc/stdio/lib_vsnprintf.c
                          index c6f52092d1..f7fd02e427 100644
                          --- a/nuttx/lib/stdio/lib_vsnprintf.c
                          +++ b/nuttx/libc/stdio/lib_vsnprintf.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_vsnprintf.c
                          + * libc/stdio/lib_vsnprintf.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_vsprintf.c b/nuttx/libc/stdio/lib_vsprintf.c
                          similarity index 98%
                          rename from nuttx/lib/stdio/lib_vsprintf.c
                          rename to nuttx/libc/stdio/lib_vsprintf.c
                          index 5db46664e3..b6d80808f9 100644
                          --- a/nuttx/lib/stdio/lib_vsprintf.c
                          +++ b/nuttx/libc/stdio/lib_vsprintf.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_vsprintf.c
                          + * libc/stdio/lib_vsprintf.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          @@ -84,7 +84,7 @@ int vsprintf(FAR char *dest, const char *src, va_list ap)
                             struct lib_memoutstream_s memoutstream;
                           
                             /* Wrap the destination buffer in a stream object and let
                          -   * lib/stdio/lib_vsprintf do the work.
                          +   * libc/stdio/lib_vsprintf do the work.
                              */
                           
                             lib_memoutstream((FAR struct lib_memoutstream_s *)&memoutstream, dest, LIB_BUFLEN_UNKNOWN);
                          diff --git a/nuttx/lib/stdio/lib_wrflush.c b/nuttx/libc/stdio/lib_wrflush.c
                          similarity index 99%
                          rename from nuttx/lib/stdio/lib_wrflush.c
                          rename to nuttx/libc/stdio/lib_wrflush.c
                          index 39680da6ae..40b8e38c8d 100644
                          --- a/nuttx/lib/stdio/lib_wrflush.c
                          +++ b/nuttx/libc/stdio/lib_wrflush.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_wrflush.c
                          + * libc/stdio/lib_wrflush.c
                            *
                            *   Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdio/lib_zeroinstream.c b/nuttx/libc/stdio/lib_zeroinstream.c
                          similarity index 98%
                          rename from nuttx/lib/stdio/lib_zeroinstream.c
                          rename to nuttx/libc/stdio/lib_zeroinstream.c
                          index 39a6c22ef3..a52ecc1d06 100644
                          --- a/nuttx/lib/stdio/lib_zeroinstream.c
                          +++ b/nuttx/libc/stdio/lib_zeroinstream.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdio/lib_zeroinstream.c
                          + * libc/stdio/lib_zeroinstream.c
                            *
                            *   Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdlib/Make.defs b/nuttx/libc/stdlib/Make.defs
                          similarity index 98%
                          rename from nuttx/lib/stdlib/Make.defs
                          rename to nuttx/libc/stdlib/Make.defs
                          index 76e285808a..dcc4dab26a 100644
                          --- a/nuttx/lib/stdlib/Make.defs
                          +++ b/nuttx/libc/stdlib/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/stdlib/Make.defs
                          +# libc/stdlib/Make.defs
                           #
                           #   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdlib/lib_abort.c b/nuttx/libc/stdlib/lib_abort.c
                          similarity index 99%
                          rename from nuttx/lib/stdlib/lib_abort.c
                          rename to nuttx/libc/stdlib/lib_abort.c
                          index 84b6009500..1c7442c7f5 100644
                          --- a/nuttx/lib/stdlib/lib_abort.c
                          +++ b/nuttx/libc/stdlib/lib_abort.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/stdlib/lib_abort.c
                          + * libc/stdlib/lib_abort.c
                            *
                            *   Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdlib/lib_abs.c b/nuttx/libc/stdlib/lib_abs.c
                          similarity index 98%
                          rename from nuttx/lib/stdlib/lib_abs.c
                          rename to nuttx/libc/stdlib/lib_abs.c
                          index 1a0c1671cc..a4e4ec6694 100644
                          --- a/nuttx/lib/stdlib/lib_abs.c
                          +++ b/nuttx/libc/stdlib/lib_abs.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/stdlib/lib_abs.c
                          + * libc/stdlib/lib_abs.c
                            *
                            *   Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdlib/lib_imaxabs.c b/nuttx/libc/stdlib/lib_imaxabs.c
                          similarity index 98%
                          rename from nuttx/lib/stdlib/lib_imaxabs.c
                          rename to nuttx/libc/stdlib/lib_imaxabs.c
                          index c6e227c7de..d365043727 100644
                          --- a/nuttx/lib/stdlib/lib_imaxabs.c
                          +++ b/nuttx/libc/stdlib/lib_imaxabs.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/stdlib//lib_abs.c
                          + * libc/stdlib//lib_abs.c
                            *
                            *   Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdlib/lib_labs.c b/nuttx/libc/stdlib/lib_labs.c
                          similarity index 98%
                          rename from nuttx/lib/stdlib/lib_labs.c
                          rename to nuttx/libc/stdlib/lib_labs.c
                          index f7218ee833..7cf92a0a19 100644
                          --- a/nuttx/lib/stdlib/lib_labs.c
                          +++ b/nuttx/libc/stdlib/lib_labs.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/stdlib/lib_labs.c
                          + * libc/stdlib/lib_labs.c
                            *
                            *   Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdlib/lib_llabs.c b/nuttx/libc/stdlib/lib_llabs.c
                          similarity index 98%
                          rename from nuttx/lib/stdlib/lib_llabs.c
                          rename to nuttx/libc/stdlib/lib_llabs.c
                          index db7d3dbe07..3630d1716f 100644
                          --- a/nuttx/lib/stdlib/lib_llabs.c
                          +++ b/nuttx/libc/stdlib/lib_llabs.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/stdlib/lib_llabs.c
                          + * libc/stdlib/lib_llabs.c
                            *
                            *   Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/stdlib/lib_qsort.c b/nuttx/libc/stdlib/lib_qsort.c
                          similarity index 99%
                          rename from nuttx/lib/stdlib/lib_qsort.c
                          rename to nuttx/libc/stdlib/lib_qsort.c
                          index 9dd5c00409..021e782d40 100644
                          --- a/nuttx/lib/stdlib/lib_qsort.c
                          +++ b/nuttx/libc/stdlib/lib_qsort.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/stdlib/lib_qsort.c
                          + * libc/stdlib/lib_qsort.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/Make.defs b/nuttx/libc/string/Make.defs
                          similarity index 91%
                          rename from nuttx/lib/string/Make.defs
                          rename to nuttx/libc/string/Make.defs
                          index 6b21c7f146..311c8afd27 100644
                          --- a/nuttx/lib/string/Make.defs
                          +++ b/nuttx/libc/string/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/string/Make.defs
                          +# libc/string/Make.defs
                           #
                           #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          @@ -36,7 +36,7 @@
                           # Add the string C files to the build
                           
                           CSRCS += lib_checkbase.c lib_isbasedigit.c lib_memset.c lib_memchr.c \
                          -		 lib_memccpy.c lib_memcpy.c lib_memcmp.c lib_memmove.c lib_skipspace.c \
                          +		 lib_memccpy.c lib_memcmp.c lib_memmove.c lib_skipspace.c \
                           		 lib_strcasecmp.c lib_strcat.c lib_strchr.c lib_strcpy.c lib_strcmp.c \
                           		 lib_strcspn.c lib_strdup.c lib_strerror.c lib_strlen.c lib_strnlen.c \
                           		 lib_strncasecmp.c lib_strncat.c lib_strncmp.c lib_strncpy.c \
                          @@ -44,6 +44,14 @@ CSRCS += lib_checkbase.c lib_isbasedigit.c lib_memset.c lib_memchr.c \
                           		 lib_strspn.c lib_strstr.c lib_strtok.c lib_strtokr.c lib_strtol.c \
                           		 lib_strtoll.c lib_strtoul.c lib_strtoull.c lib_strtod.c
                           
                          +ifneq ($(CONFIG_ARCH_MEMCPY),y)
                          +ifeq ($(CONFIG_MEMCPY_VIK),y)
                          +CSRCS += lib_vikmemcpy.c
                          +else
                          +CSRCS += lib_memcpy.c
                          +endif
                          +endif
                          +
                           # Add the string directory to the build
                           
                           DEPPATH += --dep-path string
                          diff --git a/nuttx/lib/string/lib_checkbase.c b/nuttx/libc/string/lib_checkbase.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_checkbase.c
                          rename to nuttx/libc/string/lib_checkbase.c
                          index bc79ab2cec..32ae58dca3 100644
                          --- a/nuttx/lib/string/lib_checkbase.c
                          +++ b/nuttx/libc/string/lib_checkbase.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_checkbase.c
                          + * libc/string/lib_checkbase.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_isbasedigit.c b/nuttx/libc/string/lib_isbasedigit.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_isbasedigit.c
                          rename to nuttx/libc/string/lib_isbasedigit.c
                          index a2421bf2a4..dff8138811 100644
                          --- a/nuttx/lib/string/lib_isbasedigit.c
                          +++ b/nuttx/libc/string/lib_isbasedigit.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_isbasedigit.c
                          + * libc/string/lib_isbasedigit.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_memccpy.c b/nuttx/libc/string/lib_memccpy.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_memccpy.c
                          rename to nuttx/libc/string/lib_memccpy.c
                          index 1f3dbb52dd..1d77f58fe9 100644
                          --- a/nuttx/lib/string/lib_memccpy.c
                          +++ b/nuttx/libc/string/lib_memccpy.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_memccpy.c
                          + * libc/string/lib_memccpy.c
                            *
                            *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_memchr.c b/nuttx/libc/string/lib_memchr.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_memchr.c
                          rename to nuttx/libc/string/lib_memchr.c
                          index e0dec82700..0ac6091042 100644
                          --- a/nuttx/lib/string/lib_memchr.c
                          +++ b/nuttx/libc/string/lib_memchr.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_memchr.c
                          + * libc/string/lib_memchr.c
                            *
                            *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_memcpy.c b/nuttx/libc/string/lib_memcpy.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_memcpy.c
                          rename to nuttx/libc/string/lib_memcpy.c
                          index 3b62edbabd..2ebd5beee1 100644
                          --- a/nuttx/lib/string/lib_memcpy.c
                          +++ b/nuttx/libc/string/lib_memcpy.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_memcpy.c
                          + * libc/string/lib_memcpy.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/libc/string/lib_memset.c b/nuttx/libc/string/lib_memset.c
                          new file mode 100644
                          index 0000000000..0b98ebf96f
                          --- /dev/null
                          +++ b/nuttx/libc/string/lib_memset.c
                          @@ -0,0 +1,188 @@
                          +
                          +/****************************************************************************
                          + * libc/string/lib_memset.c
                          + *
                          + *   Copyright (C) 2007, 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.
                          + *
                          + ****************************************************************************/
                          +
                          +
                          +/****************************************************************************
                          + * Included Files
                          + ****************************************************************************/
                          +
                          +#include 
                          +
                          +#include 
                          +
                          +#include 
                          +#include 
                          +#include 
                          +
                          +/****************************************************************************
                          + * Pre-processor Definitions
                          + ****************************************************************************/
                          +
                          +/* Can't support CONFIG_MEMSET_64BIT if the platform does not have 64-bit
                          + * integer types.
                          + */
                          +
                          +#ifndef CONFIG_HAVE_LONG_LONG
                          +#  undef CONFIG_MEMSET_64BIT
                          +#endif
                          +
                          +/****************************************************************************
                          + * Global Functions
                          + ****************************************************************************/
                          +
                          +#ifndef CONFIG_ARCH_MEMSET
                          +void *memset(void *s, int c, size_t n)
                          +{
                          +#ifdef CONFIG_MEMSET_OPTSPEED
                          +  /* This version is optimized for speed (you could do better
                          +   * still by exploiting processor caching or memory burst
                          +   * knowledge.)
                          +   */
                          +
                          +  uintptr_t addr  = (uintptr_t)s;
                          +  uint16_t  val16 = ((uint16_t)c << 8) | (uint16_t)c;
                          +  uint32_t  val32 = ((uint32_t)val16 << 16) | (uint32_t)val16;
                          +#ifdef CONFIG_MEMSET_64BIT
                          +  uint64_t  val64 = ((uint64_t)val32 << 32) | (uint64_t)val32;
                          +#endif
                          +
                          +  /* Make sure that there is something to be cleared */
                          +
                          +  if (n > 0)
                          +    {
                          +      /* Align to a 16-bit boundary */
                          +
                          +      if ((addr & 1) != 0)
                          +        {
                          +          *(uint8_t*)addr = (uint8_t)c;
                          +          addr += 1;
                          +          n    -= 1;
                          +        }
                          +
                          +      /* Check if there are at least 16-bits left to be written */
                          +
                          +      if (n >= 2)
                          +        {
                          +          /* Align to a 32-bit boundary (we know that the destination
                          +           * address is already aligned to at least a 16-bit boundary).
                          +           */
                          +
                          +          if ((addr & 3) != 0)
                          +            {
                          +              *(uint16_t*)addr = val16;
                          +              addr += 2;
                          +              n    -= 2;
                          +            }
                          +
                          +#ifndef CONFIG_MEMSET_64BIT
                          +          /* Loop while there are at least 32-bits left to be written */
                          +
                          +          while (n >= 4)
                          +            {
                          +              *(uint32_t*)addr = val32;
                          +              addr += 4;
                          +              n    -= 4;
                          +            }
                          +#else
                          +          /* Check if there are at least 32-bits left to be written */
                          +
                          +          if (n >= 4)
                          +            {
                          +              /* Align to a 64-bit boundary (we know that the destination
                          +               * address is already aligned to at least a 32-bit boundary).
                          +               */
                          +
                          +              if ((addr & 7) != 0)
                          +                {
                          +                  *(uint32_t*)addr = val32;
                          +                  addr += 4;
                          +                  n    -= 4;
                          +                }
                          +
                          +              /* Loop while there are at least 64-bits left to be written */
                          +
                          +              while (n >= 8)
                          +                {
                          +                  *(uint64_t*)addr = val64;
                          +                  addr += 8;
                          +                  n    -= 8;
                          +                }
                          +            }
                          +#endif
                          +        }
                          +
                          +#ifdef CONFIG_MEMSET_64BIT
                          +      /* We may get here with n in the range 0..7.  If n >= 4, then we should
                          +       * have 64-bit alignment.
                          +       */
                          +
                          +      if (n >= 4)
                          +        {
                          +          *(uint32_t*)addr = val32;
                          +          addr += 4;
                          +          n    -= 4;
                          +        }
                          +#endif
                          +
                          +      /* We may get here under the following conditions:
                          +       *
                          +       *   n = 0, addr may or may not be aligned
                          +       *   n = 1, addr is aligned to at least a 16-bit boundary
                          +       *   n = 2, addr is aligned to a 32-bit boundary
                          +       *   n = 3, addr is aligned to a 32-bit boundary
                          +       */
                          +
                          +      if (n >= 2)
                          +        {
                          +          *(uint16_t*)addr = val16;
                          +          addr += 2;
                          +          n    -= 2;
                          +        }
                          +
                          +      if (n >= 1)
                          +        {
                          +          *(uint8_t*)addr = (uint8_t)c;
                          +        }
                          +    }
                          +#else
                          +  /* This version is optimized for size */
                          +
                          +  unsigned char *p = (unsigned char*)s;
                          +  while (n-- > 0) *p++ = c;
                          +#endif
                          +  return s;
                          +}
                          +#endif
                          diff --git a/nuttx/lib/string/lib_skipspace.c b/nuttx/libc/string/lib_skipspace.c
                          similarity index 98%
                          rename from nuttx/lib/string/lib_skipspace.c
                          rename to nuttx/libc/string/lib_skipspace.c
                          index b4e6588e59..4b72b1ec37 100644
                          --- a/nuttx/lib/string/lib_skipspace.c
                          +++ b/nuttx/libc/string/lib_skipspace.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_skipspace.c
                          + * libc/string/lib_skipspace.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strcasecmp.c b/nuttx/libc/string/lib_strcasecmp.c
                          similarity index 98%
                          rename from nuttx/lib/string/lib_strcasecmp.c
                          rename to nuttx/libc/string/lib_strcasecmp.c
                          index d4aa8cc031..df6f08118d 100644
                          --- a/nuttx/lib/string/lib_strcasecmp.c
                          +++ b/nuttx/libc/string/lib_strcasecmp.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_strcasecmp.c
                          + * libc/string/lib_strcasecmp.c
                            *
                            *   Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strcat.c b/nuttx/libc/string/lib_strcat.c
                          similarity index 98%
                          rename from nuttx/lib/string/lib_strcat.c
                          rename to nuttx/libc/string/lib_strcat.c
                          index 20350fec07..b331d3f1c1 100644
                          --- a/nuttx/lib/string/lib_strcat.c
                          +++ b/nuttx/libc/string/lib_strcat.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_strcat.c
                          + * libc/string/lib_strcat.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strchr.c b/nuttx/libc/string/lib_strchr.c
                          similarity index 97%
                          rename from nuttx/lib/string/lib_strchr.c
                          rename to nuttx/libc/string/lib_strchr.c
                          index ad72738620..e6af56eee5 100644
                          --- a/nuttx/lib/string/lib_strchr.c
                          +++ b/nuttx/libc/string/lib_strchr.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_strchr.c
                          + * libc/string/lib_strchr.c
                            *
                            *   Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          @@ -59,6 +59,7 @@
                            *
                            ****************************************************************************/
                           
                          +#ifndef CONFIG_ARCH_STRCHR
                           FAR char *strchr(FAR const char *s, int c)
                           {
                             if (s)
                          @@ -74,3 +75,4 @@ FAR char *strchr(FAR const char *s, int c)
                           
                             return NULL;
                           }
                          +#endif
                          diff --git a/nuttx/lib/string/lib_strcmp.c b/nuttx/libc/string/lib_strcmp.c
                          similarity index 98%
                          rename from nuttx/lib/string/lib_strcmp.c
                          rename to nuttx/libc/string/lib_strcmp.c
                          index 0e3eee8900..d4036cd3ea 100644
                          --- a/nuttx/lib/string/lib_strcmp.c
                          +++ b/nuttx/libc/string/lib_strcmp.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_strcmp.c
                          + * libc/string/lib_strcmp.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strcpy.c b/nuttx/libc/string/lib_strcpy.c
                          similarity index 98%
                          rename from nuttx/lib/string/lib_strcpy.c
                          rename to nuttx/libc/string/lib_strcpy.c
                          index e2f70b94e3..7a0576f5af 100644
                          --- a/nuttx/lib/string/lib_strcpy.c
                          +++ b/nuttx/libc/string/lib_strcpy.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/string/lib_strcpy.c
                          + * libc/string/lib_strcpy.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strcspn.c b/nuttx/libc/string/lib_strcspn.c
                          similarity index 98%
                          rename from nuttx/lib/string/lib_strcspn.c
                          rename to nuttx/libc/string/lib_strcspn.c
                          index 9da89241c5..23e913fadf 100644
                          --- a/nuttx/lib/string/lib_strcspn.c
                          +++ b/nuttx/libc/string/lib_strcspn.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_strcspn.c
                          + * libc/string/lib_strcspn.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strdup.c b/nuttx/libc/string/lib_strdup.c
                          similarity index 98%
                          rename from nuttx/lib/string/lib_strdup.c
                          rename to nuttx/libc/string/lib_strdup.c
                          index 44a0cbc0d8..a5b3a1e8c1 100644
                          --- a/nuttx/lib/string/lib_strdup.c
                          +++ b/nuttx/libc/string/lib_strdup.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/string//lib_strdup.c
                          + * libc/string//lib_strdup.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strerror.c b/nuttx/libc/string/lib_strerror.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_strerror.c
                          rename to nuttx/libc/string/lib_strerror.c
                          index 249f695c1b..0c7ca28fd8 100644
                          --- a/nuttx/lib/string/lib_strerror.c
                          +++ b/nuttx/libc/string/lib_strerror.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/string/lib_strerror.c
                          + * libc/string/lib_strerror.c
                            *
                            *   Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strlen.c b/nuttx/libc/string/lib_strlen.c
                          similarity index 98%
                          rename from nuttx/lib/string/lib_strlen.c
                          rename to nuttx/libc/string/lib_strlen.c
                          index 8333058091..6077858e23 100644
                          --- a/nuttx/lib/string/lib_strlen.c
                          +++ b/nuttx/libc/string/lib_strlen.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_strlen.c
                          + * libc/string/lib_strlen.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strncasecmp.c b/nuttx/libc/string/lib_strncasecmp.c
                          similarity index 98%
                          rename from nuttx/lib/string/lib_strncasecmp.c
                          rename to nuttx/libc/string/lib_strncasecmp.c
                          index be369cf0d8..35f701c5ef 100644
                          --- a/nuttx/lib/string/lib_strncasecmp.c
                          +++ b/nuttx/libc/string/lib_strncasecmp.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_strncasecmp.c
                          + * libc/string/lib_strncasecmp.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strncat.c b/nuttx/libc/string/lib_strncat.c
                          similarity index 98%
                          rename from nuttx/lib/string/lib_strncat.c
                          rename to nuttx/libc/string/lib_strncat.c
                          index af893e0f9b..78c54835e0 100644
                          --- a/nuttx/lib/string/lib_strncat.c
                          +++ b/nuttx/libc/string/lib_strncat.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/string/lib_strncat.c
                          + * libc/string/lib_strncat.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strncmp.c b/nuttx/libc/string/lib_strncmp.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_strncmp.c
                          rename to nuttx/libc/string/lib_strncmp.c
                          index ce22820249..dd8b57fd0b 100644
                          --- a/nuttx/lib/string/lib_strncmp.c
                          +++ b/nuttx/libc/string/lib_strncmp.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/lib_strncmp.c
                          + * libc/lib_strncmp.c
                            *
                            *   Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strncpy.c b/nuttx/libc/string/lib_strncpy.c
                          similarity index 98%
                          rename from nuttx/lib/string/lib_strncpy.c
                          rename to nuttx/libc/string/lib_strncpy.c
                          index 149369d508..8a97aa67b7 100644
                          --- a/nuttx/lib/string/lib_strncpy.c
                          +++ b/nuttx/libc/string/lib_strncpy.c
                          @@ -1,5 +1,5 @@
                           /************************************************************
                          - * lib/string/lib_strncpy.c
                          + * libc/string/lib_strncpy.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strndup.c b/nuttx/libc/string/lib_strndup.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_strndup.c
                          rename to nuttx/libc/string/lib_strndup.c
                          index ffaf892eaa..524e09754e 100644
                          --- a/nuttx/lib/string/lib_strndup.c
                          +++ b/nuttx/libc/string/lib_strndup.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/string//lib_strndup.c
                          + * libc/string//lib_strndup.c
                            *
                            *   Copyright (C) 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strnlen.c b/nuttx/libc/string/lib_strnlen.c
                          similarity index 97%
                          rename from nuttx/lib/string/lib_strnlen.c
                          rename to nuttx/libc/string/lib_strnlen.c
                          index 2b64fe9845..9bc3064cb1 100644
                          --- a/nuttx/lib/string/lib_strnlen.c
                          +++ b/nuttx/libc/string/lib_strnlen.c
                          @@ -1,12 +1,12 @@
                           /****************************************************************************
                          - * lib/string/lib_strnlen.c
                          + * libc/string/lib_strnlen.c
                            *
                            * This file is part of NuttX, contributed by Michael Hrabanek
                            *
                            *   Copyright (C) 2010 Gregory Nutt. All rights reserved.
                            *   Author: Michael Hrabanek
                            *
                          - * Derives from the file lib/lib_strlen.c:
                          + * Derives from the file libc/lib_strlen.c:
                            *
                            *   Copyright (C) 2007, 2008, 2010 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strpbrk.c b/nuttx/libc/string/lib_strpbrk.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_strpbrk.c
                          rename to nuttx/libc/string/lib_strpbrk.c
                          index 02e2ea2c70..ef9b0f3e97 100644
                          --- a/nuttx/lib/string/lib_strpbrk.c
                          +++ b/nuttx/libc/string/lib_strpbrk.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_strpbrk.c
                          + * libc/string/lib_strpbrk.c
                            *
                            *   Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strrchr.c b/nuttx/libc/string/lib_strrchr.c
                          similarity index 98%
                          rename from nuttx/lib/string/lib_strrchr.c
                          rename to nuttx/libc/string/lib_strrchr.c
                          index 91243ce589..08575c82bf 100644
                          --- a/nuttx/lib/string/lib_strrchr.c
                          +++ b/nuttx/libc/string/lib_strrchr.c
                          @@ -1,5 +1,5 @@
                           /************************************************************************
                          - * lib/string/lib_strrchr.c
                          + * libc/string/lib_strrchr.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strspn.c b/nuttx/libc/string/lib_strspn.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_strspn.c
                          rename to nuttx/libc/string/lib_strspn.c
                          index e7b5ea0a5b..6894b2b9dc 100644
                          --- a/nuttx/lib/string/lib_strspn.c
                          +++ b/nuttx/libc/string/lib_strspn.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_strspn.c
                          + * libc/string/lib_strspn.c
                            *
                            *   Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strtod.c b/nuttx/libc/string/lib_strtod.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_strtod.c
                          rename to nuttx/libc/string/lib_strtod.c
                          index 8fecd45713..58dfd6a292 100644
                          --- a/nuttx/lib/string/lib_strtod.c
                          +++ b/nuttx/libc/string/lib_strtod.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_strtod.c
                          + * libc/string/lib_strtod.c
                            * Convert string to double
                            *
                            *   Copyright (C) 2002 Michael Ringgaard. All rights reserved.
                          diff --git a/nuttx/lib/string/lib_strtok.c b/nuttx/libc/string/lib_strtok.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_strtok.c
                          rename to nuttx/libc/string/lib_strtok.c
                          index c409931359..85d6597d74 100644
                          --- a/nuttx/lib/string/lib_strtok.c
                          +++ b/nuttx/libc/string/lib_strtok.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_strtok.c
                          + * libc/string/lib_strtok.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strtokr.c b/nuttx/libc/string/lib_strtokr.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_strtokr.c
                          rename to nuttx/libc/string/lib_strtokr.c
                          index 1c571b6ae5..c7845be642 100644
                          --- a/nuttx/lib/string/lib_strtokr.c
                          +++ b/nuttx/libc/string/lib_strtokr.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_strtokr.c
                          + * libc/string/lib_strtokr.c
                            *
                            *   Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strtol.c b/nuttx/libc/string/lib_strtol.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_strtol.c
                          rename to nuttx/libc/string/lib_strtol.c
                          index c17d87e635..6ac0d6827d 100644
                          --- a/nuttx/lib/string/lib_strtol.c
                          +++ b/nuttx/libc/string/lib_strtol.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_strtol.c
                          + * libc/string/lib_strtol.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strtoll.c b/nuttx/libc/string/lib_strtoll.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_strtoll.c
                          rename to nuttx/libc/string/lib_strtoll.c
                          index 242e025c07..99fba08eba 100644
                          --- a/nuttx/lib/string/lib_strtoll.c
                          +++ b/nuttx/libc/string/lib_strtoll.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/string/lib_strtoll.c
                          + * libc/string/lib_strtoll.c
                            *
                            *   Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strtoul.c b/nuttx/libc/string/lib_strtoul.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_strtoul.c
                          rename to nuttx/libc/string/lib_strtoul.c
                          index b0d2d090e6..8f27ae3f2d 100644
                          --- a/nuttx/lib/string/lib_strtoul.c
                          +++ b/nuttx/libc/string/lib_strtoul.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * /lib/string/lib_strtoul.c
                          + * /libc/string/lib_strtoul.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/string/lib_strtoull.c b/nuttx/libc/string/lib_strtoull.c
                          similarity index 99%
                          rename from nuttx/lib/string/lib_strtoull.c
                          rename to nuttx/libc/string/lib_strtoull.c
                          index 6567457c0e..4808114afe 100644
                          --- a/nuttx/lib/string/lib_strtoull.c
                          +++ b/nuttx/libc/string/lib_strtoull.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * /lib/string/lib_strtoull.c
                          + * /libc/string/lib_strtoull.c
                            *
                            *   Copyright (C) 2009, 2010 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/libc/string/lib_vikmemcpy.c b/nuttx/libc/string/lib_vikmemcpy.c
                          new file mode 100644
                          index 0000000000..28bf4a4ced
                          --- /dev/null
                          +++ b/nuttx/libc/string/lib_vikmemcpy.c
                          @@ -0,0 +1,348 @@
                          +/****************************************************************************
                          + * File: libc/string/lib_vikmemcpy.c
                          + *
                          + * This is version of the optimized memcpy by Daniel Vik, adapted to the
                          + * NuttX environment.
                          + *
                          + *   Copyright (C) 1999-2010 Daniel Vik
                          + *
                          + * Adaptations include:
                          + * - File name change
                          + * - Use of types defined in stdint.h
                          + * - Integration with the NuttX configuration system
                          + * - Other cosmetic changes for consistency with NuttX coding standards
                          + * 
                          + * This software is provided 'as-is', without any express or implied
                          + * warranty. In no event will the authors be held liable for any
                          + * damages arising from the use of this software.
                          + * Permission is granted to anyone to use this software for any
                          + * purpose, including commercial applications, and to alter it and
                          + * redistribute it freely, subject to the following restrictions:
                          + * 
                          + * 1. The origin of this software must not be misrepresented; you
                          + *    must not claim that you wrote the original software. If you
                          + *    use this software in a product, an acknowledgment in the
                          + *    use this software in a product, an acknowledgment in the
                          + *    product documentation would be appreciated but is not
                          + *    required.
                          + * 
                          + * 2. Altered source versions must be plainly marked as such, and
                          + *    must not be misrepresented as being the original software.
                          + * 
                          + * 3. This notice may not be removed or altered from any source
                          + *    distribution.
                          + * 
                          + * Description: Implementation of the standard library function memcpy.
                          + *              This implementation of memcpy() is ANSI-C89 compatible.
                          + *
                          + * The following configuration options can be set:
                          + *
                          + *   CONFIG_ENDIAN_BIG
                          + *     Uses processor with big endian addressing. Default is little endian.
                          + *
                          + *   CONFIG_MEMCPY_PRE_INC_PTRS
                          + *     Use pre increment of pointers. Default is post increment of pointers.
                          + *
                          + *   CONFIG_MEMCPY_INDEXED_COPY
                          + *     Copying data using array indexing. Using this option, disables the
                          + *     CONFIG_MEMCPY_PRE_INC_PTRS option.
                          + *
                          + *   CONFIG_MEMCPY_64BIT - Compiles memcpy for 64 bit architectures
                          + *
                          + ****************************************************************************/
                          +
                          +/****************************************************************************
                          + * Configuration definitions.
                          + ****************************************************************************/
                          +
                          +#define CONFIG_MEMCPY_INDEXED_COPY
                          +
                          +/********************************************************************
                          + * Included Files
                          + *******************************************************************/
                          +
                          +#include 
                          +#include 
                          +
                          +#include 
                          +#include 
                          +#include 
                          +
                          +/********************************************************************
                          + * Pre-processor Definitions
                          + *******************************************************************/
                          +
                          +/* Can't support CONFIG_MEMCPY_64BIT if the platform does not have 64-bit
                          + * integer types.
                          + */
                          +
                          +#ifndef CONFIG_HAVE_LONG_LONG
                          +#  undef CONFIG_MEMCPY_64BIT
                          +#endif
                          +
                          +/* Remove definitions when CONFIG_MEMCPY_INDEXED_COPY is defined */
                          +
                          +#if defined (CONFIG_MEMCPY_INDEXED_COPY)
                          +#  if defined (CONFIG_MEMCPY_PRE_INC_PTRS)
                          +#    undef CONFIG_MEMCPY_PRE_INC_PTRS
                          +#  endif /* CONFIG_MEMCPY_PRE_INC_PTRS */
                          +#endif /* CONFIG_MEMCPY_INDEXED_COPY */
                          +
                          +/* Definitions for pre and post increment of pointers */
                          +
                          +#if defined (CONFIG_MEMCPY_PRE_INC_PTRS)
                          +
                          +#  define START_VAL(x)            (x)--
                          +#  define INC_VAL(x)              *++(x)
                          +#  define CAST_TO_U8(p, o)        ((uint8_t*)p + o + TYPE_WIDTH)
                          +#  define WHILE_DEST_BREAK        (TYPE_WIDTH - 1)
                          +#  define PRE_LOOP_ADJUST         - (TYPE_WIDTH - 1)
                          +#  define PRE_SWITCH_ADJUST       + 1
                          +
                          +#else /* CONFIG_MEMCPY_PRE_INC_PTRS */
                          +
                          +#  define START_VAL(x)
                          +#  define INC_VAL(x)              *(x)++
                          +#  define CAST_TO_U8(p, o)        ((uint8_t*)p + o)
                          +#  define WHILE_DEST_BREAK        0
                          +#  define PRE_LOOP_ADJUST
                          +#  define PRE_SWITCH_ADJUST
                          +
                          +#endif /* CONFIG_MEMCPY_PRE_INC_PTRS */
                          +
                          +/* Definitions for endian-ness */
                          +
                          +#ifdef CONFIG_ENDIAN_BIG
                          +
                          +#  define SHL <<
                          +#  define SHR >>
                          +
                          +#else /* CONFIG_ENDIAN_BIG */
                          +
                          +#  define SHL >>
                          +#  define SHR <<
                          +
                          +#endif /* CONFIG_ENDIAN_BIG */
                          +
                          +/********************************************************************
                          + * Macros for copying words of  different alignment.
                          + * Uses incremening pointers.
                          + *******************************************************************/
                          +
                          +#define CP_INCR()                         \
                          +{                                         \
                          +  INC_VAL(dstN) = INC_VAL(srcN);          \
                          +}
                          +
                          +#define CP_INCR_SH(shl, shr)              \
                          +{                                         \
                          +  dstWord       = srcWord SHL shl;        \
                          +  srcWord       = INC_VAL(srcN);          \
                          +  dstWord      |= srcWord SHR shr;        \
                          +  INC_VAL(dstN) = dstWord;                \
                          +}
                          +
                          +/********************************************************************
                          + * Macros for copying words of  different alignment.
                          + * Uses array indexes.
                          + *******************************************************************/
                          +
                          +#define CP_INDEX(idx)                     \
                          +{                                         \
                          +  dstN[idx] = srcN[idx];                  \
                          +}
                          +
                          +#define CP_INDEX_SH(x, shl, shr)          \
                          +{                                         \
                          +  dstWord   = srcWord SHL shl;            \
                          +  srcWord   = srcN[x];                    \
                          +  dstWord  |= srcWord SHR shr;            \
                          +  dstN[x]   = dstWord;                    \
                          +}
                          +
                          +/********************************************************************
                          + * Macros for copying words of different alignment.
                          + * Uses incremening pointers or array indexes depending on
                          + * configuration.
                          + *******************************************************************/
                          +
                          +#if defined (CONFIG_MEMCPY_INDEXED_COPY)
                          +
                          +#  define CP(idx)               CP_INDEX(idx)
                          +#  define CP_SH(idx, shl, shr)  CP_INDEX_SH(idx, shl, shr)
                          +
                          +#  define INC_INDEX(p, o)       ((p) += (o))
                          +
                          +#else /* CONFIG_MEMCPY_INDEXED_COPY */
                          +
                          +#  define CP(idx)               CP_INCR()
                          +#  define CP_SH(idx, shl, shr)  CP_INCR_SH(shl, shr)
                          +
                          +#  define INC_INDEX(p, o)
                          +
                          +#endif /* CONFIG_MEMCPY_INDEXED_COPY */
                          +
                          +#define COPY_REMAINING(count)                                     \
                          +{                                                                 \
                          +  START_VAL(dst8);                                                \
                          +  START_VAL(src8);                                                \
                          +                                                                  \
                          +  switch (count)                                                  \
                          +    {                                                             \
                          +    case 7: INC_VAL(dst8) = INC_VAL(src8);                        \
                          +    case 6: INC_VAL(dst8) = INC_VAL(src8);                        \
                          +    case 5: INC_VAL(dst8) = INC_VAL(src8);                        \
                          +    case 4: INC_VAL(dst8) = INC_VAL(src8);                        \
                          +    case 3: INC_VAL(dst8) = INC_VAL(src8);                        \
                          +    case 2: INC_VAL(dst8) = INC_VAL(src8);                        \
                          +    case 1: INC_VAL(dst8) = INC_VAL(src8);                        \
                          +    case 0:                                                       \
                          +    default: break;                                               \
                          +    }                                                             \
                          +}
                          +
                          +#define COPY_NO_SHIFT()                                           \
                          +{                                                                 \
                          +  UIntN* dstN = (UIntN*)(dst8 PRE_LOOP_ADJUST);                   \
                          +  UIntN* srcN = (UIntN*)(src8 PRE_LOOP_ADJUST);                   \
                          +  size_t length = count / TYPE_WIDTH;                             \
                          +                                                                  \
                          +  while (length & 7)                                              \
                          +    {                                                             \
                          +      CP_INCR();                                                  \
                          +      length--;                                                   \
                          +    }                                                             \
                          +                                                                  \
                          +  length /= 8;                                                    \
                          +                                                                  \
                          +  while (length--)                                                \
                          +    {                                                             \
                          +      CP(0);                                                      \
                          +      CP(1);                                                      \
                          +      CP(2);                                                      \
                          +      CP(3);                                                      \
                          +      CP(4);                                                      \
                          +      CP(5);                                                      \
                          +      CP(6);                                                      \
                          +      CP(7);                                                      \
                          +                                                                  \
                          +      INC_INDEX(dstN, 8);                                         \
                          +      INC_INDEX(srcN, 8);                                         \
                          +    }                                                             \
                          +                                                                  \
                          +  src8 = CAST_TO_U8(srcN, 0);                                     \
                          +  dst8 = CAST_TO_U8(dstN, 0);                                     \
                          +                                                                  \
                          +  COPY_REMAINING(count & (TYPE_WIDTH - 1));                       \
                          +                                                                  \
                          +  return dest;                                                    \
                          +}
                          +
                          +#define COPY_SHIFT(shift)                                         \
                          +{                                                                 \
                          +  UIntN* dstN  = (UIntN*)((((UIntN)dst8) PRE_LOOP_ADJUST) &       \
                          +                           ~(TYPE_WIDTH - 1));                    \
                          +  UIntN* srcN  = (UIntN*)((((UIntN)src8) PRE_LOOP_ADJUST) &       \
                          +                           ~(TYPE_WIDTH - 1));                    \
                          +  size_t length  = count / TYPE_WIDTH;                            \
                          +  UIntN srcWord = INC_VAL(srcN);                                  \
                          +  UIntN dstWord;                                                  \
                          +                                                                  \
                          +  while (length & 7)                                              \
                          +    {                                                             \
                          +      CP_INCR_SH(8 * shift, 8 * (TYPE_WIDTH - shift));            \
                          +      length--;                                                   \
                          +    }                                                             \
                          +                                                                  \
                          +  length /= 8;                                                    \
                          +                                                                  \
                          +  while (length--)                                                \
                          +    {                                                             \
                          +      CP_SH(0, 8 * shift, 8 * (TYPE_WIDTH - shift));              \
                          +      CP_SH(1, 8 * shift, 8 * (TYPE_WIDTH - shift));              \
                          +      CP_SH(2, 8 * shift, 8 * (TYPE_WIDTH - shift));              \
                          +      CP_SH(3, 8 * shift, 8 * (TYPE_WIDTH - shift));              \
                          +      CP_SH(4, 8 * shift, 8 * (TYPE_WIDTH - shift));              \
                          +      CP_SH(5, 8 * shift, 8 * (TYPE_WIDTH - shift));              \
                          +      CP_SH(6, 8 * shift, 8 * (TYPE_WIDTH - shift));              \
                          +      CP_SH(7, 8 * shift, 8 * (TYPE_WIDTH - shift));              \
                          +                                                                  \
                          +      INC_INDEX(dstN, 8);                                         \
                          +      INC_INDEX(srcN, 8);                                         \
                          +    }                                                             \
                          +                                                                  \
                          +  src8 = CAST_TO_U8(srcN, (shift - TYPE_WIDTH));                  \
                          +  dst8 = CAST_TO_U8(dstN, 0);                                     \
                          +                                                                  \
                          +  COPY_REMAINING(count & (TYPE_WIDTH - 1));                       \
                          +                                                                  \
                          +  return dest;                                                    \
                          +}
                          +
                          +/********************************************************************
                          + * Type Definitions
                          + *******************************************************************/
                          +
                          +#ifdef CONFIG_MEMCPY_64BIT
                          +typedef uint64_t            UIntN;
                          +#  define TYPE_WIDTH        8L
                          +#else
                          +typedef uint32_t            UIntN;
                          +#  define TYPE_WIDTH        4L
                          +#endif
                          +
                          +/********************************************************************
                          + * Public Functions
                          + *******************************************************************/
                          +/********************************************************************
                          + * Name: memcpy
                          + *
                          + * Description:
                          + *   Copies count bytes from src to dest. No overlap check is performed.
                          + *
                          + * Input Parameters:
                          + *   dest        - pointer to destination buffer
                          + *   src         - pointer to source buffer
                          + *   count       - number of bytes to copy
                          + *
                          + * Returned Value:
                          + *   A pointer to destination buffer
                          + *
                          + *******************************************************************/
                          +
                          +void *memcpy(void *dest, const void *src, size_t count) 
                          +{
                          +  uint8_t *dst8 = (uint8_t*)dest;
                          +  uint8_t *src8 = (uint8_t*)src;
                          +
                          +  if (count < 8)
                          +    {
                          +      COPY_REMAINING(count);
                          +      return dest;
                          +    }
                          +
                          +  START_VAL(dst8);
                          +  START_VAL(src8);
                          +
                          +  while (((UIntN)dst8 & (TYPE_WIDTH - 1)) != WHILE_DEST_BREAK)
                          +    {
                          +      INC_VAL(dst8) = INC_VAL(src8);
                          +      count--;
                          +    }
                          +
                          +  switch ((((UIntN)src8) PRE_SWITCH_ADJUST) & (TYPE_WIDTH - 1))
                          +    {
                          +    case 0: COPY_NO_SHIFT(); break;
                          +    case 1: COPY_SHIFT(1);   break;
                          +    case 2: COPY_SHIFT(2);   break;
                          +    case 3: COPY_SHIFT(3);   break;
                          +#if TYPE_WIDTH > 4
                          +    case 4: COPY_SHIFT(4);   break;
                          +    case 5: COPY_SHIFT(5);   break;
                          +    case 6: COPY_SHIFT(6);   break;
                          +    case 7: COPY_SHIFT(7);   break;
                          +#endif
                          +    }
                          +
                          +  return dest;
                          +}
                          diff --git a/nuttx/lib/termios/Make.defs b/nuttx/libc/termios/Make.defs
                          similarity index 98%
                          rename from nuttx/lib/termios/Make.defs
                          rename to nuttx/libc/termios/Make.defs
                          index a6bb77f835..d20a5f95c7 100644
                          --- a/nuttx/lib/termios/Make.defs
                          +++ b/nuttx/libc/termios/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/misc/Make.defs
                          +# libc/misc/Make.defs
                           #
                           #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/termios/lib_cfgetspeed.c b/nuttx/libc/termios/lib_cfgetspeed.c
                          similarity index 99%
                          rename from nuttx/lib/termios/lib_cfgetspeed.c
                          rename to nuttx/libc/termios/lib_cfgetspeed.c
                          index d7f0dc4736..da10daac1e 100644
                          --- a/nuttx/lib/termios/lib_cfgetspeed.c
                          +++ b/nuttx/libc/termios/lib_cfgetspeed.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/termios/lib_cfgetspeed.c
                          + * libc/termios/lib_cfgetspeed.c
                            *
                            *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/termios/lib_cfsetspeed.c b/nuttx/libc/termios/lib_cfsetspeed.c
                          similarity index 97%
                          rename from nuttx/lib/termios/lib_cfsetspeed.c
                          rename to nuttx/libc/termios/lib_cfsetspeed.c
                          index bf9e660640..a2a9475c4b 100644
                          --- a/nuttx/lib/termios/lib_cfsetspeed.c
                          +++ b/nuttx/libc/termios/lib_cfsetspeed.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/termios/lib_cfsetspeed.c
                          + * libc/termios/lib_cfsetspeed.c
                            *
                            *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          @@ -110,12 +110,7 @@
                           
                           int cfsetspeed(FAR struct termios *termiosp, speed_t speed)
                           {
                          -  FAR speed_t *speedp;
                          -
                             DEBUGASSERT(termiosp);
                          -
                          -  speedp = (FAR speed_t *)&termiosp->c_speed;
                          - *speedp = speed;
                          -
                          +  termiosp->c_speed = speed;
                             return OK;
                           }
                          diff --git a/nuttx/lib/termios/lib_tcflush.c b/nuttx/libc/termios/lib_tcflush.c
                          similarity index 99%
                          rename from nuttx/lib/termios/lib_tcflush.c
                          rename to nuttx/libc/termios/lib_tcflush.c
                          index 338524bdda..1a9710f6a0 100644
                          --- a/nuttx/lib/termios/lib_tcflush.c
                          +++ b/nuttx/libc/termios/lib_tcflush.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/termios/lib_tcflush.c
                          + * libc/termios/lib_tcflush.c
                            *
                            *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/termios/lib_tcgetattr.c b/nuttx/libc/termios/lib_tcgetattr.c
                          similarity index 99%
                          rename from nuttx/lib/termios/lib_tcgetattr.c
                          rename to nuttx/libc/termios/lib_tcgetattr.c
                          index 500871d9ff..e8d3112603 100644
                          --- a/nuttx/lib/termios/lib_tcgetattr.c
                          +++ b/nuttx/libc/termios/lib_tcgetattr.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/termios/lib_tcgetattr.c
                          + * libc/termios/lib_tcgetattr.c
                            *
                            *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/termios/lib_tcsetattr.c b/nuttx/libc/termios/lib_tcsetattr.c
                          similarity index 99%
                          rename from nuttx/lib/termios/lib_tcsetattr.c
                          rename to nuttx/libc/termios/lib_tcsetattr.c
                          index 791b519c85..901f2a1368 100644
                          --- a/nuttx/lib/termios/lib_tcsetattr.c
                          +++ b/nuttx/libc/termios/lib_tcsetattr.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/termios/lib_tcsetattr.c
                          + * libc/termios/lib_tcsetattr.c
                            *
                            *   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/time/Make.defs b/nuttx/libc/time/Make.defs
                          similarity index 98%
                          rename from nuttx/lib/time/Make.defs
                          rename to nuttx/libc/time/Make.defs
                          index ab74142291..4848813d11 100644
                          --- a/nuttx/lib/time/Make.defs
                          +++ b/nuttx/libc/time/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/time/Make.defs
                          +# libc/time/Make.defs
                           #
                           #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/time/lib_calendar2utc.c b/nuttx/libc/time/lib_calendar2utc.c
                          similarity index 99%
                          rename from nuttx/lib/time/lib_calendar2utc.c
                          rename to nuttx/libc/time/lib_calendar2utc.c
                          index e80c292fc6..1b8c40a9ea 100644
                          --- a/nuttx/lib/time/lib_calendar2utc.c
                          +++ b/nuttx/libc/time/lib_calendar2utc.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/time/lib_calendar2utc.c
                          + * libc/time/lib_calendar2utc.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/time/lib_daysbeforemonth.c b/nuttx/libc/time/lib_daysbeforemonth.c
                          similarity index 99%
                          rename from nuttx/lib/time/lib_daysbeforemonth.c
                          rename to nuttx/libc/time/lib_daysbeforemonth.c
                          index 8000b0e7a9..28f4d67a97 100644
                          --- a/nuttx/lib/time/lib_daysbeforemonth.c
                          +++ b/nuttx/libc/time/lib_daysbeforemonth.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/time/lib_daysbeforemonth.c
                          + * libc/time/lib_daysbeforemonth.c
                            *
                            *   Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/time/lib_gmtime.c b/nuttx/libc/time/lib_gmtime.c
                          similarity index 99%
                          rename from nuttx/lib/time/lib_gmtime.c
                          rename to nuttx/libc/time/lib_gmtime.c
                          index 99afeded9e..7a4d0f5e14 100644
                          --- a/nuttx/lib/time/lib_gmtime.c
                          +++ b/nuttx/libc/time/lib_gmtime.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/time/lib_gmtime.c
                          + * libc/time/lib_gmtime.c
                            *
                            *   Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/time/lib_gmtimer.c b/nuttx/libc/time/lib_gmtimer.c
                          similarity index 99%
                          rename from nuttx/lib/time/lib_gmtimer.c
                          rename to nuttx/libc/time/lib_gmtimer.c
                          index ba1c9724f1..d986205276 100644
                          --- a/nuttx/lib/time/lib_gmtimer.c
                          +++ b/nuttx/libc/time/lib_gmtimer.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/time/lib_gmtimer.c
                          + * libc/time/lib_gmtimer.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/time/lib_isleapyear.c b/nuttx/libc/time/lib_isleapyear.c
                          similarity index 99%
                          rename from nuttx/lib/time/lib_isleapyear.c
                          rename to nuttx/libc/time/lib_isleapyear.c
                          index 966c248e01..386e205b2e 100644
                          --- a/nuttx/lib/time/lib_isleapyear.c
                          +++ b/nuttx/libc/time/lib_isleapyear.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/time/lib_isleapyear.c
                          + * libc/time/lib_isleapyear.c
                            *
                            *   Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/time/lib_mktime.c b/nuttx/libc/time/lib_mktime.c
                          similarity index 99%
                          rename from nuttx/lib/time/lib_mktime.c
                          rename to nuttx/libc/time/lib_mktime.c
                          index 8c17e7c0ab..25254d70e5 100644
                          --- a/nuttx/lib/time/lib_mktime.c
                          +++ b/nuttx/libc/time/lib_mktime.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/time/lib_mktime.c
                          + * libc/time/lib_mktime.c
                            *
                            *   Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/time/lib_strftime.c b/nuttx/libc/time/lib_strftime.c
                          similarity index 99%
                          rename from nuttx/lib/time/lib_strftime.c
                          rename to nuttx/libc/time/lib_strftime.c
                          index cd0804f55d..3b0c8dd8f3 100644
                          --- a/nuttx/lib/time/lib_strftime.c
                          +++ b/nuttx/libc/time/lib_strftime.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/time/lib_strftime.c
                          + * libc/time/lib_strftime.c
                            *
                            *   Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/time/lib_time.c b/nuttx/libc/time/lib_time.c
                          similarity index 99%
                          rename from nuttx/lib/time/lib_time.c
                          rename to nuttx/libc/time/lib_time.c
                          index 106a04c366..673f6fdcdd 100644
                          --- a/nuttx/lib/time/lib_time.c
                          +++ b/nuttx/libc/time/lib_time.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/time/lib_time.c
                          + * libc/time/lib_time.c
                            *
                            *   Copyright (C) 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/unistd/Make.defs b/nuttx/libc/unistd/Make.defs
                          similarity index 98%
                          rename from nuttx/lib/unistd/Make.defs
                          rename to nuttx/libc/unistd/Make.defs
                          index e1441a48d3..67fce9b1d7 100644
                          --- a/nuttx/lib/unistd/Make.defs
                          +++ b/nuttx/libc/unistd/Make.defs
                          @@ -1,5 +1,5 @@
                           ############################################################################
                          -# lib/unistd/Make.defs
                          +# libc/unistd/Make.defs
                           #
                           #   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/unistd/lib_chdir.c b/nuttx/libc/unistd/lib_chdir.c
                          similarity index 99%
                          rename from nuttx/lib/unistd/lib_chdir.c
                          rename to nuttx/libc/unistd/lib_chdir.c
                          index 3dd1333cec..8953fb19b6 100644
                          --- a/nuttx/lib/unistd/lib_chdir.c
                          +++ b/nuttx/libc/unistd/lib_chdir.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/unistd/lib_chdir.c
                          + * libc/unistd/lib_chdir.c
                            *
                            *   Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/unistd/lib_getcwd.c b/nuttx/libc/unistd/lib_getcwd.c
                          similarity index 99%
                          rename from nuttx/lib/unistd/lib_getcwd.c
                          rename to nuttx/libc/unistd/lib_getcwd.c
                          index b94823300b..717ef29717 100644
                          --- a/nuttx/lib/unistd/lib_getcwd.c
                          +++ b/nuttx/libc/unistd/lib_getcwd.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/unistd/lib_getcwd.c
                          + * libc/unistd/lib_getcwd.c
                            *
                            *   Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/unistd/lib_getopt.c b/nuttx/libc/unistd/lib_getopt.c
                          similarity index 99%
                          rename from nuttx/lib/unistd/lib_getopt.c
                          rename to nuttx/libc/unistd/lib_getopt.c
                          index 832d287213..1a91909765 100644
                          --- a/nuttx/lib/unistd/lib_getopt.c
                          +++ b/nuttx/libc/unistd/lib_getopt.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/unistd/lib_getopt.c
                          + * libc/unistd/lib_getopt.c
                            *
                            *   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/unistd/lib_getoptargp.c b/nuttx/libc/unistd/lib_getoptargp.c
                          similarity index 98%
                          rename from nuttx/lib/unistd/lib_getoptargp.c
                          rename to nuttx/libc/unistd/lib_getoptargp.c
                          index 98a4850169..5610342ca9 100644
                          --- a/nuttx/lib/unistd/lib_getoptargp.c
                          +++ b/nuttx/libc/unistd/lib_getoptargp.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/unistd/lib_getoptargp.c
                          + * libc/unistd/lib_getoptargp.c
                            *
                            *   Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/unistd/lib_getoptindp.c b/nuttx/libc/unistd/lib_getoptindp.c
                          similarity index 98%
                          rename from nuttx/lib/unistd/lib_getoptindp.c
                          rename to nuttx/libc/unistd/lib_getoptindp.c
                          index 7714f8e708..94ea4d3fcd 100644
                          --- a/nuttx/lib/unistd/lib_getoptindp.c
                          +++ b/nuttx/libc/unistd/lib_getoptindp.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/unistd/lib_getoptindp.c
                          + * libc/unistd/lib_getoptindp.c
                            *
                            *   Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/lib/unistd/lib_getoptoptp.c b/nuttx/libc/unistd/lib_getoptoptp.c
                          similarity index 98%
                          rename from nuttx/lib/unistd/lib_getoptoptp.c
                          rename to nuttx/libc/unistd/lib_getoptoptp.c
                          index 4805b7ac3b..cd99b172f0 100644
                          --- a/nuttx/lib/unistd/lib_getoptoptp.c
                          +++ b/nuttx/libc/unistd/lib_getoptoptp.c
                          @@ -1,5 +1,5 @@
                           /****************************************************************************
                          - * lib/unistd/lib_getoptoptp.c
                          + * libc/unistd/lib_getoptoptp.c
                            *
                            *   Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
                            *   Author: Gregory Nutt 
                          diff --git a/nuttx/libxx/Makefile b/nuttx/libxx/Makefile
                          index 4122931ac9..2ab146e9cc 100644
                          --- a/nuttx/libxx/Makefile
                          +++ b/nuttx/libxx/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # libxx/Makefile
                           #
                          -#   Copyright (C) 2009 Gregory Nutt. All rights reserved.
                          +#   Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                           #
                           # Redistribution and use in source and binary forms, with or without
                          @@ -35,20 +35,56 @@
                           
                           -include $(TOPDIR)/Make.defs
                           
                          -ASRCS		= 
                          -AOBJS		= $(ASRCS:.S=$(OBJEXT))
                          -CSRCS		= 
                          -COBJS		= $(CSRCS:.c=$(OBJEXT))
                          -CXXSRCS		= libxx_cxapurevirtual.cxx libxx_delete.cxx libxx_deletea.cxx \
                          -			  libxx_eabi_atexit.cxx libxx_new.cxx libxx_newa.cxx 
                          -CXXOBJS		= $(CXXSRCS:.cxx=$(OBJEXT))
                          +# Sources
                           
                          -SRCS		= $(ASRCS) $(CSRCS) $(CXXSRCS)
                          -OBJS		= $(AOBJS) $(COBJS) $(CXXOBJS)
                          +ASRCS = 
                          +CSRCS = 
                           
                          -BIN		= liblibxx$(LIBEXT)
                          +CXXSRCS  = libxx_cxapurevirtual.cxx libxx_eabi_atexit.cxx  libxx_cxa_atexit.cxx
                           
                          -all:	$(BIN)
                          +# Some of the libxx/ files are not need if uClibc++ is installed because
                          +# uClibx++ replaces them
                          +
                          +ifneq ($(CONFIG_UCLIBCXX),y)
                          +CXXSRCS += libxx_delete.cxx libxx_deletea.cxx libxx_new.cxx libxx_newa.cxx
                          +CXXSRCS += libxx_stdthrow.cxx
                          +else
                          +ifneq ($(UCLIBCXX_EXCEPTION),y)
                          +CXXSRCS += libxx_stdthrow.cxx
                          +endif
                          +endif
                          +
                          +# Paths
                          +
                          +DEPPATH = --dep-path .
                          +VPATH = .
                          +
                          +# Include the uClibc++ Make.defs file if selected.  If it is included,
                          +# the uClibc++/Make.defs file will add its files to the source file list,
                          +# add its DEPPATH info, and will add the appropriate paths to the VPATH
                          +# variable
                          +#
                          +# Note that an error will occur if you select CONFIG_LIBXX_UCLIBCXX
                          +# without installing the uClibc++ package.  This is intentional to let
                          +# you know about the configuration problem.  Refer to misc/uClibc++/README.txt
                          +# for more information
                          +
                          +ifeq ($(CONFIG_UCLIBCXX),y)
                          +include uClibc++/Make.defs
                          +endif
                          +
                          +# Object Files
                          +
                          +AOBJS = $(ASRCS:.S=$(OBJEXT))
                          +COBJS = $(CSRCS:.c=$(OBJEXT))
                          +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT))
                          +
                          +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS)
                          +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS)
                          +
                          +BIN = libcxx$(LIBEXT)
                          +
                          +all: $(BIN)
                           
                           $(AOBJS): %$(OBJEXT): %.S
                           	$(call ASSEMBLE, $<, $@)
                          @@ -60,21 +96,20 @@ $(CXXOBJS): %$(OBJEXT): %.cxx
                           	$(call COMPILEXX, $<, $@)
                           
                           $(BIN):	$(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $@, $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $@, $(OBJS))
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep
                          -	@touch $@
                          +	$(Q) $(MKDEP) $(DEPPATH) "$(CXX)" -- $(CXXFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f $(BIN) *~ .*.swp
                          +	$(call DELFILE, $(BIN))
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/nuttx/libxx/README.txt b/nuttx/libxx/README.txt
                          index 6cf066f080..7a1c51fa70 100644
                          --- a/nuttx/libxx/README.txt
                          +++ b/nuttx/libxx/README.txt
                          @@ -12,6 +12,10 @@ are recommended:
                            - uClibc++   http://cxx.uclibc.org/
                            - uSTL       http://ustl.sourceforge.net/
                           
                          +There is a version of uClibc++ that is customized for NuttX that can
                          +be found here:  misc/uClibc++.  See misc/uClibc++ for installation
                          +instructions.
                          +
                           At present, only the following are supported here:
                           
                            - void *operator new(std::size_t nbytes);
                          @@ -19,6 +23,7 @@ At present, only the following are supported here:
                            - void operator delete[](void *ptr);
                            - void __cxa_pure_virtual(void);
                            - int __aeabi_atexit(void* object, void (*destroyer)(void*), void *dso_handle);
                          + - int __cxa_atexit(__cxa_exitfunc_t func, FAR void *arg, FAR void *dso_handle);
                            
                           operator new
                           ------------
                          diff --git a/nuttx/libxx/libxx_cxa_atexit.cxx b/nuttx/libxx/libxx_cxa_atexit.cxx
                          new file mode 100644
                          index 0000000000..cd31f94f61
                          --- /dev/null
                          +++ b/nuttx/libxx/libxx_cxa_atexit.cxx
                          @@ -0,0 +1,146 @@
                          +//***************************************************************************
                          +// libxx/libxx_eabi_atexit.cxx
                          +//
                          +//   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 "libxx_internal.hxx"
                          +
                          +//***************************************************************************
                          +// Pre-processor Definitions
                          +//***************************************************************************
                          +
                          +//***************************************************************************
                          +// Private Types
                          +//***************************************************************************
                          +
                          +struct __cxa_atexit_s
                          +{
                          +  __cxa_exitfunc_t func;
                          +  FAR void *arg;
                          +};
                          +
                          +//***************************************************************************
                          +// Private Data
                          +//***************************************************************************
                          +
                          +extern "C"
                          +{
                          +  //*************************************************************************
                          +  // Public Data
                          +  //*************************************************************************
                          +
                          +  FAR void *__dso_handle = NULL;
                          +
                          +  //*************************************************************************
                          +  // Private Functions
                          +  //*************************************************************************
                          +
                          +  //*************************************************************************
                          +  // Name: __cxa_callback
                          +  //
                          +  // Description:
                          +  //   This is really just an "adaptor" function that matches the form of
                          +  //   the __cxa_exitfunc_t to an onexitfunc_t using an allocated structure
                          +  //   to marshall the call parameters.
                          +  //
                          +  //*************************************************************************
                          +
                          +#if CONFIG_SCHED_ONEXIT
                          +  static void __cxa_callback(int exitcode, FAR void *arg)
                          +  {
                          +    FAR struct __cxa_atexit_s *alloc = (FAR struct __cxa_atexit_s *)arg;
                          +    DEBUGASSERT(alloc && alloc->func);
                          +
                          +    alloc->func(alloc->arg);
                          +    free(alloc);
                          +  }
                          +#endif
                          +
                          +  //*************************************************************************
                          +  // Public Functions
                          +  //*************************************************************************
                          +
                          +  //*************************************************************************
                          +  // Name: __cxa_atexit
                          +  //
                          +  // Description:
                          +  //   __cxa_atexit() registers a destructor function to be called by exit().
                          +  //   On a call to exit(), the registered functions should be called with
                          +  //   the single argument 'arg'. Destructor functions shall always be
                          +  //   called in the reverse order to their registration (i.e. the most
                          +  //   recently registered function shall be called first),
                          +  //
                          +  //   If shared libraries were supported, the callbacks should be invoked
                          +  //   when the shared library is unloaded as well.
                          +  //
                          +  // Reference:
                          +  //   Linux base
                          +  //
                          +  //*************************************************************************
                          +
                          +  int __cxa_atexit(__cxa_exitfunc_t func, FAR void *arg, FAR void *dso_handle)
                          +    {
                          +#if CONFIG_SCHED_ONEXIT
                          +      // Allocate memory to hold the marshaled __cxa_exitfunc_t call
                          +      // information.
                          +
                          +      FAR struct __cxa_atexit_s *alloc =
                          +        (FAR struct __cxa_atexit_s *)malloc(sizeof(struct __cxa_atexit_s));
                          +
                          +      if (alloc)
                          +        {
                          +          // Register the function to be called when the task/thread exists.
                          +
                          +          alloc->func = func;
                          +          alloc->arg  = arg;
                          +
                          +          return on_exit(__cxa_callback, alloc);
                          +        }
                          +      else
                          +#endif
                          +        {
                          +          // What else can we do?
                          +
                          +          return 0;
                          +        }
                          +    }
                          +}
                          diff --git a/nuttx/libxx/libxx_eabi_atexit.cxx b/nuttx/libxx/libxx_eabi_atexit.cxx
                          index aa0ff6956c..25f8306a84 100644
                          --- a/nuttx/libxx/libxx_eabi_atexit.cxx
                          +++ b/nuttx/libxx/libxx_eabi_atexit.cxx
                          @@ -40,26 +40,22 @@
                           #include 
                           #include 
                           
                          +#include "libxx_internal.hxx"
                          +
                           //***************************************************************************
                          -// Definitions
                          +// Pre-processor Definitions
                           //***************************************************************************
                           
                           //***************************************************************************
                           // Private Data
                           //***************************************************************************
                           
                          +//***************************************************************************
                          +// Public Functions
                          +//***************************************************************************
                          +
                           extern "C"
                           {
                          -  //*************************************************************************
                          -  // Public Data
                          -  //*************************************************************************
                          -
                          -  void *__dso_handle = NULL;
                          -
                          -  //*************************************************************************
                          -  // Public Functions
                          -  //*************************************************************************
                          -
                             //*************************************************************************
                             // Name: __aeabi_atexit
                             //
                          @@ -75,9 +71,8 @@ extern "C"
                             //
                             //*************************************************************************
                           
                          -  int __aeabi_atexit(void* object, void (*destroyer)(void*), void *dso_handle)
                          +  int __aeabi_atexit(FAR void *object, __cxa_exitfunc_t func, FAR void *dso_handle)
                               {
                          -      //return __cxa_atexit(destroyer, object, dso_handle); // 0 ? OK; non-0 ? failed }
                          -      return 0;
                          +      return __cxa_atexit(func, object, dso_handle); // 0 ? OK; non-0 ? failed
                               }
                           }
                          diff --git a/nuttx/libxx/libxx_internal.hxx b/nuttx/libxx/libxx_internal.hxx
                          new file mode 100644
                          index 0000000000..fe84c763ed
                          --- /dev/null
                          +++ b/nuttx/libxx/libxx_internal.hxx
                          @@ -0,0 +1,67 @@
                          +//***************************************************************************
                          +// lib/libxx_internal.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 __LIBXX_LIBXX_INTERNAL_HXX
                          +#define __LIBXX_LIBXX_INTERNAL_HXX
                          +
                          +//***************************************************************************
                          +// Included Files
                          +//***************************************************************************
                          +
                          +#include 
                          +
                          +//***************************************************************************
                          +// Definitions
                          +//***************************************************************************
                          +
                          +//***************************************************************************
                          +// Public Types
                          +//***************************************************************************/
                          +
                          +typedef CODE void (*__cxa_exitfunc_t)(void *arg);
                          +
                          +//***************************************************************************
                          +// Public Variables
                          +//***************************************************************************
                          +
                          +extern "C" FAR void *__dso_handle;
                          +
                          +//***************************************************************************
                          +// Public Function Prototypes
                          +//***************************************************************************
                          +
                          +extern "C" int __cxa_atexit(__cxa_exitfunc_t func, void *arg, void *dso_handle);
                          +
                          +#endif // __LIBXX_LIBXX_INTERNAL_HXX
                          diff --git a/nuttx/libxx/libxx_stdthrow.cxx b/nuttx/libxx/libxx_stdthrow.cxx
                          new file mode 100644
                          index 0000000000..588fae2642
                          --- /dev/null
                          +++ b/nuttx/libxx/libxx_stdthrow.cxx
                          @@ -0,0 +1,74 @@
                          +//***************************************************************************
                          +// libxx/libxx_newa.cxx
                          +//
                          +//   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                          +//   Author: 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 
                          +
                          +//***************************************************************************
                          +// Definitions
                          +//***************************************************************************
                          +
                          +//***************************************************************************
                          +// Private Data
                          +//***************************************************************************
                          +
                          +//***************************************************************************
                          +// Public Functions
                          +//***************************************************************************
                          +
                          +namespace std
                          +{
                          +  void __throw_out_of_range(const char*)
                          +  {
                          +    dbg("C++: Vector .at() with argument out of range\n");
                          +    abort();
                          +   }
                          +    
                          +  void __throw_length_error(const char*)
                          +  {
                          +     dbg("C++: Vector resize to excessive length\n");
                          +     abort();
                          +  }
                          +    
                          +  void __throw_bad_alloc()
                          +  {
                          +    dbg("C++: Bad allocation\n");
                          +    abort();
                          +  }
                          +}
                          diff --git a/nuttx/mm/Makefile b/nuttx/mm/Makefile
                          index 0ccf5a09a9..da41f9f57b 100644
                          --- a/nuttx/mm/Makefile
                          +++ b/nuttx/mm/Makefile
                          @@ -37,8 +37,8 @@
                           
                           ASRCS	= 
                           CSRCS	= mm_initialize.c mm_sem.c  mm_addfreechunk.c mm_size2ndx.c mm_shrinkchunk.c \
                          -	  mm_malloc.c mm_zalloc.c mm_calloc.c mm_realloc.c \
                          -	  mm_memalign.c mm_free.c mm_mallinfo.c
                          +		mm_malloc.c mm_zalloc.c mm_calloc.c mm_realloc.c \
                          +		mm_memalign.c mm_free.c mm_mallinfo.c
                           
                           ifeq ($(CONFIG_GRAN),y)
                           CSRCS	+= mm_graninit.c mm_granalloc.c mm_granfree.c mm_grancritical.c
                          @@ -61,21 +61,20 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           $(BIN):	$(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $@, $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $@, $(OBJS))
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          -	@touch $@
                          +	$(Q) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f $(BIN) *~ .*.swp
                          +	$(call DELFILE, $(BIN))
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/nuttx/mm/Makefile.test b/nuttx/mm/Makefile.test
                          index 63cab910e9..2ae9dcb883 100644
                          --- a/nuttx/mm/Makefile.test
                          +++ b/nuttx/mm/Makefile.test
                          @@ -33,12 +33,14 @@
                           #
                           ############################################################################
                           
                          -SRCS		= mm_test.c mm_initialize.c mm_sem.c  mm_addfreechunk.c mm_size2ndx.c mm_shrinkchunk.c \
                          +-include $(TOPDIR)/Make.defs
                          +
                          +SRCS	= mm_test.c mm_initialize.c mm_sem.c  mm_addfreechunk.c mm_size2ndx.c mm_shrinkchunk.c \
                           		  mm_malloc.c mm_zalloc.c mm_calloc.c mm_realloc.c \
                           		  mm_memalign.c mm_free.c mm_mallinfo.c
                          -OBJS		= $(SRCS:.c=.o1)
                          +OBJS	= $(SRCS:.c=.o1)
                           
                          -LIBS		= -lpthread -lc
                          +LIBS	= -lpthread -lc
                           
                           CC		= gcc
                           LD		= gcc
                          @@ -48,17 +50,19 @@ WARNIGNS	= -Wall -Wstrict-prototypes -Wshadow
                           CFLAGS		= -g $(DEFINES)
                           LDFLAGS		=
                           
                          -BIN		= ../mm_test
                          +BIN		= ..$(DELIM)mm_test
                           
                           all:	$(BIN)
                           
                           $(OBJS): %.o1: %.c
                           	@echo "Compiling $<"
                          -	$(CC) -c $(CFLAGS) $< -o $@
                          +	$(Q) $(CC) -c $(CFLAGS) $< -o $@
                           
                           $(BIN):	$(OBJS)
                           	@echo "Linking {$(OBJS)} to produce $@"
                          -	$(LD) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
                          +	$(Q) $(LD) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
                           
                           clean:
                          -	@rm -f $(BIN) *.o1 *~
                          +	$(call DELFILE, $(BIN))
                          +	$(call DELFILE, *.o1)
                          +	$(call CLEAN)
                          diff --git a/nuttx/mm/mm_initialize.c b/nuttx/mm/mm_initialize.c
                          index 3a21d1759b..a7f64cfafd 100644
                          --- a/nuttx/mm/mm_initialize.c
                          +++ b/nuttx/mm/mm_initialize.c
                          @@ -95,9 +95,9 @@ void mm_initialize(FAR void *heapstart, size_t heapsize)
                           
                             mlldbg("Heap: start=%p size=%u\n", heapstart, heapsize);
                           
                          -  /* The following two lines have cause problems for some ZiLog compilers
                          -   * in the past.  Life is easier if we just the suppress them for those
                          -   * tools.
                          +  /* The following two lines have cause problems for some older ZiLog
                          +   * compilers in the past (but not the more recent).  Life is easier if we
                          +   * just the suppress them altogther for those tools.
                              */
                           
                           #ifndef __ZILOG__
                          diff --git a/nuttx/net/Makefile b/nuttx/net/Makefile
                          index 506ef82138..74540b67d4 100644
                          --- a/nuttx/net/Makefile
                          +++ b/nuttx/net/Makefile
                          @@ -100,24 +100,22 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           $(BIN): $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $@, $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $@, $(OBJS))
                           
                           .depend: Makefile $(SRCS)
                           ifeq ($(CONFIG_NET),y)
                          -	@$(MKDEP) --dep-path . --dep-path uip $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) $(MKDEP) --dep-path . --dep-path uip "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           endif
                          -	@touch $@
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f $(BIN) *~ .*.swp
                          -	@rm -f uip/*~ uip/.*.swp
                          +	$(call DELFILE, $(BIN))
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/nuttx/net/netdev_ioctl.c b/nuttx/net/netdev_ioctl.c
                          index 4b5876efa0..ea5c0e4362 100644
                          --- a/nuttx/net/netdev_ioctl.c
                          +++ b/nuttx/net/netdev_ioctl.c
                          @@ -138,19 +138,47 @@ static void ioctl_setipaddr(FAR uip_ipaddr_t *outaddr, FAR const void *inaddr)
                            *
                            ****************************************************************************/
                           
                          -static inline void ioctl_ifup(FAR struct uip_driver_s *dev)
                          +static void ioctl_ifup(FAR struct uip_driver_s *dev)
                           {
                          +  /* Make sure that the device supports the d_ifup() method */
                          +
                             if (dev->d_ifup)
                               {
                          -      dev->d_ifup(dev);
                          +      /* Is the interface already up? */
                          +
                          +      if ((dev->d_flags & IFF_RUNNING) == 0)
                          +        {
                          +          /* No, bring the interface up now */
                          +
                          +          if (dev->d_ifup(dev) == OK)
                          +            {
                          +              /* Mark the interface as up */
                          +
                          +              dev->d_flags |= IFF_RUNNING;
                          +            }
                          +        }
                               }
                           }
                           
                          -static inline void ioctl_ifdown(FAR struct uip_driver_s *dev)
                          +static void ioctl_ifdown(FAR struct uip_driver_s *dev)
                           {
                          +  /* Make sure that the device supports the d_ifdown() method */
                          +
                             if (dev->d_ifdown)
                               {
                          -      dev->d_ifdown(dev);
                          +      /* Is the interface already down? */
                          +
                          +      if ((dev->d_flags & IFF_RUNNING) != 0)
                          +        {
                          +          /* No, take the interface down now */
                          +
                          +          if (dev->d_ifdown(dev) == OK)
                          +            {
                          +              /* Mark the interface as down */
                          +
                          +              dev->d_flags &= ~IFF_RUNNING;
                          +            }
                          +        }
                               }
                           }
                           
                          @@ -194,63 +222,130 @@ static int netdev_ifrioctl(FAR struct socket *psock, int cmd, struct ifreq *req)
                           
                             switch (cmd)
                               {
                          -      case SIOCGIFADDR:     /* Get IP address */
                          -        ioctl_getipaddr(&req->ifr_addr, &dev->d_ipaddr);
                          +      case SIOCGIFADDR:  /* Get IP address */
                          +        {
                          +          ioctl_getipaddr(&req->ifr_addr, &dev->d_ipaddr);
                          +        }
                                   break;
                           
                          -      case SIOCSIFADDR:     /* Set IP address */
                          -        ioctl_ifdown(dev);
                          -        ioctl_setipaddr(&dev->d_ipaddr, &req->ifr_addr);
                          -        ioctl_ifup(dev);
                          +      case SIOCSIFADDR:  /* Set IP address */
                          +        {
                          +          ioctl_ifdown(dev);
                          +          ioctl_setipaddr(&dev->d_ipaddr, &req->ifr_addr);
                          +          ioctl_ifup(dev);
                          +        }
                                   break;
                           
                                 case SIOCGIFDSTADDR:  /* Get P-to-P address */
                          -        ioctl_getipaddr(&req->ifr_dstaddr, &dev->d_draddr);
                          +        {
                          +          ioctl_getipaddr(&req->ifr_dstaddr, &dev->d_draddr);
                          +        }
                                   break;
                           
                                 case SIOCSIFDSTADDR:  /* Set P-to-P address */
                          -        ioctl_setipaddr(&dev->d_draddr, &req->ifr_dstaddr);
                          +        {
                          +          ioctl_setipaddr(&dev->d_draddr, &req->ifr_dstaddr);
                          +        }
                                   break;
                           
                                 case SIOCGIFNETMASK:  /* Get network mask */
                          -        ioctl_getipaddr(&req->ifr_addr, &dev->d_netmask);
                          +        {
                          +          ioctl_getipaddr(&req->ifr_addr, &dev->d_netmask);
                          +        }
                                   break;
                           
                                 case SIOCSIFNETMASK:  /* Set network mask */
                          -        ioctl_setipaddr(&dev->d_netmask, &req->ifr_addr);
                          +        {
                          +          ioctl_setipaddr(&dev->d_netmask, &req->ifr_addr);
                          +        }
                                   break;
                           
                                 case SIOCGIFMTU:  /* Get MTU size */
                          -        req->ifr_mtu = CONFIG_NET_BUFSIZE;
                          +        {
                          +          req->ifr_mtu = CONFIG_NET_BUFSIZE;
                          +        }
                          +        break;
                          +
                          +      case SIOCSIFFLAGS:  /* Sets the interface flags */
                          +        {
                          +          /* Is this a request to bring the interface up? */
                          +
                          +          if (req->ifr_flags & IF_FLAG_IFUP)
                          +            {
                          +              /* Yes.. bring the interface up */
                          +
                          +              ioctl_ifup(dev);
                          +            }
                          +
                          +          /* Is this a request to take the interface down? */
                          +
                          +          else if (req->ifr_flags & IF_FLAG_IFDOWN)
                          +            {
                          +              /* Yes.. take the interface down */
                          +
                          +              ioctl_ifdown(dev);
                          +            }
                          +        }
                          +        break;
                          +
                          +      case SIOCGIFFLAGS:  /* Gets the interface flags */
                          +        {
                          +          req->ifr_flags = 0;
                          +
                          +          /* Is the interface running? */
                          +
                          +          if (dev->d_flags & IFF_RUNNING)
                          +            {
                          +              /* Yes.. report interface up */
                          +
                          +              req->ifr_flags |= IF_FLAG_IFUP;
                          +            }
                          +          else
                          +            {
                          +              /* No.. report interface down */
                          +
                          +              req->ifr_flags |= IF_FLAG_IFDOWN;
                          +            }
                          +        }
                                   break;
                           
                                 /* MAC address operations only make sense if Ethernet is supported */
                           
                           #ifdef CONFIG_NET_ETHERNET
                                 case SIOCGIFHWADDR:  /* Get hardware address */
                          -        req->ifr_hwaddr.sa_family = AF_INETX;
                          -        memcpy(req->ifr_hwaddr.sa_data, dev->d_mac.ether_addr_octet, IFHWADDRLEN);
                          +        {
                          +          req->ifr_hwaddr.sa_family = AF_INETX;
                          +          memcpy(req->ifr_hwaddr.sa_data, dev->d_mac.ether_addr_octet, IFHWADDRLEN);
                          +        }
                                   break;
                           
                                 case SIOCSIFHWADDR:  /* Set hardware address -- will not take effect until ifup */
                          -        req->ifr_hwaddr.sa_family = AF_INETX;
                          -        memcpy(dev->d_mac.ether_addr_octet, req->ifr_hwaddr.sa_data, IFHWADDRLEN);
                          +        {
                          +          req->ifr_hwaddr.sa_family = AF_INETX;
                          +          memcpy(dev->d_mac.ether_addr_octet, req->ifr_hwaddr.sa_data, IFHWADDRLEN);
                          +        }
                                   break;
                           #endif
                           
                                 case SIOCDIFADDR:  /* Delete IP address */
                          -        ioctl_ifdown(dev);
                          -        memset(&dev->d_ipaddr, 0, sizeof(uip_ipaddr_t));
                          +        {
                          +          ioctl_ifdown(dev);
                          +          memset(&dev->d_ipaddr, 0, sizeof(uip_ipaddr_t));
                          +        }
                                   break;
                           
                                 case SIOCGIFCOUNT:  /* Get number of devices */
                          -        req->ifr_count = netdev_count();
                          -        ret = -ENOSYS;
                          +        {
                          +          req->ifr_count = netdev_count();
                          +          ret = -ENOSYS;
                          +        }
                                   break;
                           
                          -      case SIOCGIFBRDADDR:  /* Get broadcast IP address	*/
                          -      case SIOCSIFBRDADDR:  /* Set broadcast IP address	*/
                          -        ret = -ENOSYS;
                          +      case SIOCGIFBRDADDR:  /* Get broadcast IP address */
                          +      case SIOCSIFBRDADDR:  /* Set broadcast IP address */
                          +        {
                          +          ret = -ENOSYS;
                          +        }
                                   break;
                           
                           #ifdef CONFIG_NET_ARPIOCTLS
                          @@ -261,7 +356,9 @@ static int netdev_ifrioctl(FAR struct socket *psock, int cmd, struct ifreq *req)
                           #endif
                           
                                 default:
                          -        ret = -EINVAL;
                          +        {
                          +          ret = -EINVAL;
                          +        }
                                   break;;
                               }
                           
                          diff --git a/nuttx/net/uip/uip_icmpping.c b/nuttx/net/uip/uip_icmpping.c
                          index e3ebf72520..36f6e892ad 100644
                          --- a/nuttx/net/uip/uip_icmpping.c
                          +++ b/nuttx/net/uip/uip_icmpping.c
                          @@ -123,6 +123,7 @@ static inline int ping_timeout(struct icmp_ping_s *pstate)
                               {
                                 return TRUE;
                               }
                          +
                             return FALSE;
                           }
                           
                          @@ -365,6 +366,7 @@ int uip_ping(uip_ipaddr_t addr, uint16_t id, uint16_t seqno,
                           
                                 uip_icmpcallbackfree(state.png_cb);
                               }
                          +
                             uip_unlock(save);
                           
                             /* Return the negated error number in the event of a failure, or the
                          diff --git a/nuttx/sched/Kconfig b/nuttx/sched/Kconfig
                          index 3438ccf2c0..bfaec3b5d5 100644
                          --- a/nuttx/sched/Kconfig
                          +++ b/nuttx/sched/Kconfig
                          @@ -214,12 +214,17 @@ config SCHED_ATEXIT
                           config SCHED_ATEXIT_MAX
                           	int "Max number of atexit() functions"
                           	default 1
                          -	depends on SCHED_ATEXIT
                          +	depends on SCHED_ATEXIT && !SCHED_ONEXIT
                           	---help---
                           		By default if SCHED_ATEXIT is selected, only a single atexit() function
                           		is supported. That number can be increased by defined this setting to
                           		the number that you require.
                           
                          +		If both SCHED_ONEXIT and SCHED_ATEXIT are selected, then atexit() is built
                          +		on top of the on_exit() implementation.  In that case, SCHED_ONEXIT_MAX
                          +		determines the size of the combined number of atexit(0) and on_exit calls
                          +		and SCHED_ATEXIT_MAX is not used.
                          +
                           config SCHED_ONEXIT
                           	bool "Enable on_exit() API"
                           	default n
                          @@ -235,6 +240,10 @@ config SCHED_ONEXIT_MAX
                           		is supported. That number can be increased by defined this setting to the
                           		number that you require.
                           
                          +		If both SCHED_ONEXIT and SCHED_ATEXIT are selected, then atexit() is built
                          +		on top of the on_exit() implementation.  In that case, SCHED_ONEXIT_MAX
                          +		determines the size of the combined number of atexit(0) and on_exit calls.
                          +
                           config USER_ENTRYPOINT
                           	string "Application entry point"
                           	default "user_start"
                          diff --git a/nuttx/sched/Makefile b/nuttx/sched/Makefile
                          index 1e0a55aeaf..82f74fc3c8 100644
                          --- a/nuttx/sched/Makefile
                          +++ b/nuttx/sched/Makefile
                          @@ -94,7 +94,7 @@ SIGNAL_SRCS	= sig_initialize.c \
                           		  sig_findaction.c sig_allocatependingsigaction.c \
                           		  sig_releasependingsigaction.c sig_unmaskpendingsignal.c \
                           		  sig_removependingsignal.c sig_releasependingsignal.c sig_lowest.c \
                          -		  sig_mqnotempty.c sig_cleanup.c sig_received.c sig_deliver.c
                          +		  sig_mqnotempty.c sig_cleanup.c sig_received.c sig_deliver.c pause.c
                           
                           MQUEUE_SRCS	= mq_open.c mq_close.c mq_unlink.c mq_send.c mq_timedsend.c\
                           		  mq_sndinternal.c mq_receive.c mq_timedreceive.c mq_rcvinternal.c \
                          @@ -188,6 +188,7 @@ OBJS		= $(AOBJS) $(COBJS)
                           BIN		= libsched$(LIBEXT)
                           
                           all:	$(BIN)
                          +.PHONY: context depend clean distclean
                           
                           $(AOBJS): %$(OBJEXT): %.S
                           	$(call ASSEMBLE, $<, $@)
                          @@ -196,21 +197,20 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           $(BIN): $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $@, $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $@, $(OBJS))
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          -	@touch $@
                          +	$(Q) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f $(BIN) *~ .*.swp
                          +	$(call DELFILE, $(BIN))
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/nuttx/sched/atexit.c b/nuttx/sched/atexit.c
                          index f7d81bec20..b0559b01be 100644
                          --- a/nuttx/sched/atexit.c
                          +++ b/nuttx/sched/atexit.c
                          @@ -96,8 +96,13 @@
                            *         CONFIG_SCHED_ATEXIT_MAX defines a larger number.
                            *      2. atexit functions are not inherited when a new task is
                            *         created.
                          + *      3. If both SCHED_ONEXIT and SCHED_ATEXIT are selected, then atexit()
                          + *         is built on top of the on_exit() implementation.  In that case,
                          + *         CONFIG_SCHED_ONEXIT_MAX determines the size of the combined
                          + *         number of atexit(0) and on_exit calls and SCHED_ATEXIT_MAX is
                          + *         not used.
                            *
                          - * Parameters:
                          + * Input Parameters:
                            *   func - A pointer to the function to be called when the task exits.
                            *
                            * Return Value:
                          @@ -107,7 +112,14 @@
                           
                           int atexit(void (*func)(void))
                           {
                          -#if defined(CONFIG_SCHED_ATEXIT_MAX) && CONFIG_SCHED_ATEXIT_MAX > 1
                          +#if defined(CONFIG_SCHED_ONEXIT)
                          +  /* atexit is equivalent to on_exit() with no argument (Assuming that the ABI
                          +   * can handle a callback function that recieves more parameters than it expects).
                          +   */
                          +
                          +  return on_exit(onexitfunc_t func, NULL);
                          +
                          +#elif defined(CONFIG_SCHED_ATEXIT_MAX) && CONFIG_SCHED_ATEXIT_MAX > 1
                             _TCB *tcb = (_TCB*)g_readytorun.head;
                             int   index;
                             int   ret = ERROR;
                          diff --git a/nuttx/sched/mq_open.c b/nuttx/sched/mq_open.c
                          index 5e1b9b1377..89d80f072a 100644
                          --- a/nuttx/sched/mq_open.c
                          +++ b/nuttx/sched/mq_open.c
                          @@ -113,7 +113,6 @@ mqd_t mq_open(const char *mq_name, int oflags, ...)
                             FAR msgq_t     *msgq;
                             mqd_t           mqdes = NULL;
                             va_list         arg;          /* Points to each un-named argument */
                          -  mode_t          mode;         /* MQ creation mode parameter (ignored) */
                             struct mq_attr *attr;         /* MQ creation attributes */
                             int             namelen;      /* Length of MQ name */
                           
                          @@ -170,7 +169,7 @@ mqd_t mq_open(const char *mq_name, int oflags, ...)
                                                  */
                           
                                                 va_start(arg, oflags);
                          -                      mode = va_arg(arg, mode_t);
                          +                      (void)va_arg(arg, mode_t); /* MQ creation mode parameter (ignored) */
                                                 attr = va_arg(arg, struct mq_attr*);
                           
                                                 /* Initialize the new named message queue */
                          diff --git a/nuttx/sched/on_exit.c b/nuttx/sched/on_exit.c
                          index 5b8be5cd10..19a4f91960 100644
                          --- a/nuttx/sched/on_exit.c
                          +++ b/nuttx/sched/on_exit.c
                          @@ -117,7 +117,7 @@ int on_exit(CODE void (*func)(int, FAR void *), FAR void *arg)
                           #if defined(CONFIG_SCHED_ONEXIT_MAX) && CONFIG_SCHED_ONEXIT_MAX > 1
                             _TCB *tcb = (_TCB*)g_readytorun.head;
                             int   index;
                          -  int   ret = ERROR;
                          +  int   ret = ENOSPC;
                           
                             /* The following must be atomic */
                           
                          @@ -131,7 +131,6 @@ int on_exit(CODE void (*func)(int, FAR void *), FAR void *arg)
                                  * indices.
                                  */
                           
                          -      available = -1;
                                 for (index = 0; index < CONFIG_SCHED_ONEXIT_MAX; index++)
                                   {
                                     if (!tcb->onexitfunc[index])
                          @@ -149,7 +148,7 @@ int on_exit(CODE void (*func)(int, FAR void *), FAR void *arg)
                             return ret;
                           #else
                             _TCB *tcb = (_TCB*)g_readytorun.head;
                          -  int   ret = ERROR;
                          +  int   ret = ENOSPC;
                           
                             /* The following must be atomic */
                           
                          diff --git a/nuttx/lib/stdio/lib_vdprintf.c b/nuttx/sched/pause.c
                          similarity index 68%
                          rename from nuttx/lib/stdio/lib_vdprintf.c
                          rename to nuttx/sched/pause.c
                          index c2b5761107..607c4c7751 100644
                          --- a/nuttx/lib/stdio/lib_vdprintf.c
                          +++ b/nuttx/sched/pause.c
                          @@ -1,8 +1,8 @@
                           /****************************************************************************
                          - * lib/stdio/lib_vdprintf.c
                          + * sched/pause.c
                            *
                          - *   Copyright (C) 2007-2009, 2011 Andrew Tridgell. All rights reserved.
                          - *   Author: Andrew Tridgell 
                          + *   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
                          @@ -39,24 +39,15 @@
                           
                           #include 
                           
                          -#include 
                          -
                          -#include "lib_internal.h"
                          +#include 
                          +#include 
                           
                           /****************************************************************************
                          - * Pre-processor Definitions
                          + * Preprocessor Definitions
                            ****************************************************************************/
                           
                           /****************************************************************************
                          - * Private Type Declarations
                          - ****************************************************************************/
                          -
                          -/****************************************************************************
                          - * Private Function Prototypes
                          - ****************************************************************************/
                          -
                          -/****************************************************************************
                          - * Global Constant Data
                          + * Private Type Definitions
                            ****************************************************************************/
                           
                           /****************************************************************************
                          @@ -64,18 +55,56 @@
                            ****************************************************************************/
                           
                           /****************************************************************************
                          - * Private Constant Data
                          + * Private Variables
                            ****************************************************************************/
                           
                           /****************************************************************************
                          - * Private Variables
                          + * Private Function Prototypes
                            ****************************************************************************/
                           
                           /****************************************************************************
                            * Public Functions
                            ****************************************************************************/
                           
                          -int vdprintf(int fd, FAR const char *fmt, va_list ap)
                          +/****************************************************************************
                          + * Name: pause
                          + *
                          + * Description:
                          + *   The pause() function will suspend the calling thread until delivery of a
                          + *   non-blocked signal.
                          + *
                          + * Input Parameters:
                          + *   None
                          + *
                          + * Returned Value:
                          + *   Since pause() suspends thread execution indefinitely unless interrupted 
                          + *   a signal, there is no successful completion return value. A value of -1
                          + *   will always be returned and errno set to indicate the error (EINTR).
                          + *
                          + * POSIX compatibility:
                          + *   In the POSIX description of this function is the pause() function will
                          + *   suspend the calling thread until delivery of a signal whose action is
                          + *   either to execute a signal-catching function or to terminate the
                          + *   process.  This implementation only waits for any non-blocked signal
                          + *   to be received.
                          + *
                          + ****************************************************************************/
                          +
                          +int pause(void)
                           {
                          -	return lib_rawvdprintf(fd, fmt, ap);
                          +  sigset_t set;
                          +  struct siginfo value;
                          + 
                          +  /* Set up for the sleep.  Using the empty set means that we are not
                          +   * waiting for any particular signal.  However, any unmasked signal
                          +   * can still awaken sigtimedwait().
                          +   */
                          +
                          +  (void)sigemptyset(&set);
                          +
                          +  /* sigtwaitinfo() cannot succeed.  It should always return error EINTR
                          +   * meaning that some unblocked signal was caught.
                          +   */
                          +
                          +  return sigwaitinfo(&set, &value);
                           }
                          diff --git a/nuttx/sched/sched_getscheduler.c b/nuttx/sched/sched_getscheduler.c
                          index 5771e86ff4..0d996ca271 100644
                          --- a/nuttx/sched/sched_getscheduler.c
                          +++ b/nuttx/sched/sched_getscheduler.c
                          @@ -129,3 +129,4 @@ int sched_getscheduler(pid_t pid)
                                 return SCHED_FIFO;
                               }
                           }
                          +
                          diff --git a/nuttx/sched/sem_open.c b/nuttx/sched/sem_open.c
                          index 817c36b49b..b2b76fe380 100644
                          --- a/nuttx/sched/sem_open.c
                          +++ b/nuttx/sched/sem_open.c
                          @@ -120,7 +120,6 @@ FAR sem_t *sem_open (FAR const char *name, int oflag, ...)
                             FAR nsem_t  *psem;
                             FAR sem_t   *sem = (FAR sem_t*)ERROR;
                             va_list      arg;          /* Points to each un-named argument */
                          -  mode_t       mode;         /* Creation mode parameter (ignored) */
                             unsigned int value;        /* Semaphore value parameter */
                           
                             /* Make sure that a non-NULL name is supplied */
                          @@ -165,7 +164,7 @@ FAR sem_t *sem_open (FAR const char *name, int oflag, ...)
                                          */
                           
                                         va_start(arg, oflag);
                          -              mode = va_arg(arg, mode_t);
                          +              (void)va_arg(arg, mode_t); /* Creation mode parameter (ignored) */
                                         value = va_arg(arg, unsigned int);
                           
                                         /* Verify that a legal initial value was selected. */
                          diff --git a/nuttx/sched/sleep.c b/nuttx/sched/sleep.c
                          index 03884a5b64..9b3b6d57fc 100644
                          --- a/nuttx/sched/sleep.c
                          +++ b/nuttx/sched/sleep.c
                          @@ -141,7 +141,7 @@ unsigned int sleep(unsigned int seconds)
                             if (seconds)
                               {
                                 /* Set up for the sleep.  Using the empty set means that we are not
                          -       * waiting for any particualar signal.  However, any unmasked signal
                          +       * waiting for any particular signal.  However, any unmasked signal
                                  * can still awaken sigtimedwait().
                                  */
                           
                          diff --git a/nuttx/sched/task_exithook.c b/nuttx/sched/task_exithook.c
                          index 004d09e200..3bde8fb7a5 100644
                          --- a/nuttx/sched/task_exithook.c
                          +++ b/nuttx/sched/task_exithook.c
                          @@ -81,8 +81,8 @@
                            *   Call any registerd atexit function(s)
                            *
                            ****************************************************************************/
                          - 
                          -#ifdef CONFIG_SCHED_ATEXIT
                          +
                          +#if defined(CONFIG_SCHED_ATEXIT) && !defined(CONFIG_SCHED_ONEXIT)
                           static inline void task_atexit(FAR _TCB *tcb)
                           {
                           #if defined(CONFIG_SCHED_ATEXIT_MAX) && CONFIG_SCHED_ATEXIT_MAX > 1
                          diff --git a/nuttx/sched/usleep.c b/nuttx/sched/usleep.c
                          index 21996d788b..893a420f4e 100644
                          --- a/nuttx/sched/usleep.c
                          +++ b/nuttx/sched/usleep.c
                          @@ -137,7 +137,7 @@ int usleep(useconds_t usec)
                             if (usec)
                               {
                                 /* Set up for the sleep.  Using the empty set means that we are not
                          -       * waiting for any particualar signal.  However, any unmasked signal
                          +       * waiting for any particular signal.  However, any unmasked signal
                                  * can still awaken sigtimedwait().
                                  */
                           
                          diff --git a/nuttx/tools/Makefile.export b/nuttx/tools/Makefile.export
                          index e3629a4807..002cb526b4 100644
                          --- a/nuttx/tools/Makefile.export
                          +++ b/nuttx/tools/Makefile.export
                          @@ -67,7 +67,7 @@ endif
                           	@echo "ARCHCFLAGS=\"$(ARCHCFLAGS) $(ARCHCPUFLAGS)\"" >> $(EXPORTDIR)/makeinfo.sh
                           	@echo "ARCHCXXFLAGS=\"$(ARCHCXXFLAGS) $(ARCHCPUFLAGS)\"" >> $(EXPORTDIR)/makeinfo.sh
                           	@echo "CROSSDEV=\"$(CROSSDEV)\"" >> $(EXPORTDIR)/makeinfo.sh
                          -	@chmod 755 $(EXPORTDIR)/makeinfo.sh
                          +	$(Q) chmod 755 $(EXPORTDIR)/makeinfo.sh
                           
                           clean:
                          -	@rm -f $(EXPORTDIR)/makeinfo.sh
                          +	$(Q) rm -f $(EXPORTDIR)/makeinfo.sh
                          diff --git a/nuttx/tools/configure.sh b/nuttx/tools/configure.sh
                          index 3b68fe3f62..ffa997178e 100755
                          --- a/nuttx/tools/configure.sh
                          +++ b/nuttx/tools/configure.sh
                          @@ -100,32 +100,54 @@ if [ ! -d "${configpath}" ]; then
                             exit 3
                           fi
                           
                          -if [ ! -r "${configpath}/Make.defs" ]; then
                          -  echo "File \"${configpath}/Make.defs\" does not exist"
                          +src_makedefs="${configpath}/Make.defs"
                          +dest_makedefs="${TOPDIR}/Make.defs"
                          +
                          +if [ ! -r "${src_makedefs}" ]; then
                          +  echo "File \"${src_makedefs}\" does not exist"
                             exit 4
                           fi
                           
                          -if [ ! -r "${configpath}/setenv.sh" ]; then
                          -  echo "File \"${configpath}/setenv.sh\" does not exist"
                          -  exit 5
                          +src_setenv="${configpath}/setenv.sh"
                          +unset have_setenv
                          +
                          +if [ -r "${src_setenv}" ]; then
                          +  dest_setenv=${TOPDIR}/setenv.sh
                          +  have_setenv=y
                          +else
                          +  src_setenv="${configpath}/setenv.bat"
                          +  if [ -r "${src_setenv}" ]; then
                          +    dest_setenv=${TOPDIR}/setenv.bat
                          +    have_setenv=y
                          +  else
                          +    unset src_setenv
                          +  fi
                           fi
                           
                          -if [ ! -r "${configpath}/defconfig" ]; then
                          -  echo "File \"${configpath}/defconfig\" does not exist"
                          +src_config="${configpath}/defconfig"
                          +tmp_config="${TOPDIR}/.configX"
                          +dest_config="${TOPDIR}/.config"
                          +
                          +if [ ! -r "${src_config}" ]; then
                          +  echo "File \"${src_config}\" does not exist"
                             exit 6
                           fi
                           
                           # Extract values needed from the defconfig file.  We need:
                           # (1) The CONFIG_NUTTX_NEWCONFIG setting to know if this is a "new" style
                          -#     configuration, and
                          -# (2) The CONFIG_APPS_DIR to see if there is a configured location for the
                          -#     application directory.
                          +#     configuration,
                          +# (2) The CONFIG_WINDOWS_NATIVE setting to know it this is target for a
                          +#     native Windows (meaning that we want setenv.bat vs setenv.sh and we need
                          +#     to use backslashes in the CONFIG_APPS_DIR setting).
                          +# (3) The CONFIG_APPS_DIR setting to see if there is a configured location for the
                          +#     application directory.  This can be overridden from the command line.
                           
                          -newconfig=`grep CONFIG_NUTTX_NEWCONFIG= "${configpath}/defconfig" | cut -d'=' -f2`
                          +newconfig=`grep CONFIG_NUTTX_NEWCONFIG= "${src_config}" | cut -d'=' -f2`
                          +winnative=`grep CONFIG_WINDOWS_NATIVE= "${src_config}" | cut -d'=' -f2`
                           
                           defappdir=y
                           if [ -z "${appdir}" ]; then
                          -  quoted=`grep "^CONFIG_APPS_DIR=" "${configpath}/defconfig" | cut -d'=' -f2`
                          +  quoted=`grep "^CONFIG_APPS_DIR=" "${src_config}" | cut -d'=' -f2`
                             if [ ! -z "${appdir}" ]; then
                               appdir=`echo ${quoted} | sed -e "s/\"//g"`
                               defappdir=n
                          @@ -157,34 +179,45 @@ if [ -z "${appdir}" ]; then
                             fi
                           fi
                           
                          +# For checking the apps dir path, we need a POSIX version of the relative path.
                          +
                          +posappdir=`echo "${appdir}" | sed -e 's/\\\\/\\//g'`
                          +winappdir=`echo "${appdir}" | sed -e 's/\\//\\\\/g'`
                          +
                           # If appsdir was provided (or discovered) then make sure that the apps/
                           # directory exists
                           
                          -if [ ! -z "${appdir}" -a ! -d "${TOPDIR}/${appdir}" ]; then
                          -  echo "Directory \"${TOPDIR}/${appdir}\" does not exist"
                          +if [ ! -z "${appdir}" -a ! -d "${TOPDIR}/${posappdir}" ]; then
                          +  echo "Directory \"${TOPDIR}/${posappdir}\" does not exist"
                             exit 7
                           fi
                           
                           # Okay... Everything looks good.  Setup the configuration
                           
                          -install -C "${configpath}/Make.defs" "${TOPDIR}/." || \
                          -  { echo "Failed to copy ${configpath}/Make.defs" ; exit 7 ; }
                          -install -C "${configpath}/setenv.sh" "${TOPDIR}/." || \
                          -  { echo "Failed to copy ${configpath}/setenv.sh" ; exit 8 ; }
                          -chmod 755 "${TOPDIR}/setenv.sh"
                          -install -C "${configpath}/defconfig" "${TOPDIR}/.configX" || \
                          -  { echo "Failed to copy ${configpath}/defconfig" ; exit 9 ; }
                          +install "${src_makedefs}" "${dest_makedefs}" || \
                          +  { echo "Failed to copy \"${src_makedefs}\"" ; exit 7 ; }
                          +if [ "X${have_setenv}" = "Xy" ]; then
                          +  install "${src_setenv}" "${dest_setenv}" || \
                          +    { echo "Failed to copy ${src_setenv}" ; exit 8 ; }
                          +  chmod 755 "${dest_setenv}"
                          +fi
                          +install "${src_config}" "${tmp_config}" || \
                          +  { echo "Failed to copy \"${src_config}\"" ; exit 9 ; }
                           
                           # If we did not use the CONFIG_APPS_DIR that was in the defconfig config file,
                           # then append the correct application information to the tail of the .config
                           # file
                           
                           if [ "X${defappdir}" = "Xy" ]; then
                          -  sed -i -e "/^CONFIG_APPS_DIR/d" "${TOPDIR}/.configX"
                          -  echo "" >> "${TOPDIR}/.configX"
                          -  echo "# Application configuration" >> "${TOPDIR}/.configX"
                          -  echo "" >> "${TOPDIR}/.configX"
                          -  echo "CONFIG_APPS_DIR=\"$appdir\"" >> "${TOPDIR}/.configX"
                          +  sed -i -e "/^CONFIG_APPS_DIR/d" "${tmp_config}"
                          +  echo "" >> "${tmp_config}"
                          +  echo "# Application configuration" >> "${tmp_config}"
                          +  echo "" >> "${tmp_config}"
                          +  if [ "X${winnative}" = "Xy" ]; then
                          +    echo "CONFIG_APPS_DIR=\"$winappdir\"" >> "${tmp_config}"
                          +  else
                          +    echo "CONFIG_APPS_DIR=\"$posappdir\"" >> "${tmp_config}"
                          +  fi
                           fi 
                           
                           # Copy appconfig file.  The appconfig file will be copied to ${appdir}/.config
                          @@ -195,7 +228,7 @@ if [ ! -z "${appdir}" -a "X${newconfig}" != "Xy" ]; then
                             if [ ! -r "${configpath}/appconfig" ]; then
                               echo "NOTE: No readable appconfig file found in ${configpath}"
                             else
                          -    install -C "${configpath}/appconfig" "${TOPDIR}/${appdir}/.config" || \
                          +    install "${configpath}/appconfig" "${TOPDIR}/${posappdir}/.config" || \
                                 { echo "Failed to copy ${configpath}/appconfig" ; exit 10 ; }
                             fi
                           fi
                          @@ -203,6 +236,5 @@ fi
                           # install the final .configX only if it differs from any existing
                           # .config file.
                           
                          -install -C "${TOPDIR}/.configX" "${TOPDIR}/.config"
                          -rm -f "${TOPDIR}/.configX"
                          -
                          +install "${tmp_config}" "${dest_config}"
                          +rm -f "${tmp_config}"
                          diff --git a/nuttx/tools/define.bat b/nuttx/tools/define.bat
                          new file mode 100644
                          index 0000000000..13d29ac319
                          --- /dev/null
                          +++ b/nuttx/tools/define.bat
                          @@ -0,0 +1,178 @@
                          +@echo off
                          +
                          +rem tools/define.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 Handle command line options
                          +rem [-h]   [-val ] [ [-val ] [ [-val ] ...]]
                          +rem [-w] [-d] ignored for compatibility with define.sh
                          +
                          +set progname=%0
                          +
                          +:ArgLoop
                          +if "%1"=="-d" goto :NextArg
                          +if "%1"=="-w" goto :NextArg
                          +if "%1"=="-h" goto :ShowUsage
                          +
                          +goto :CheckCompilerPath
                          +
                          +:NextArg
                          +shift
                          +goto :ArgLoop
                          +
                          +:CheckCompilerPath
                          +
                          +if "%1"=="" (
                          +  echo Missing compiler path
                          +  goto :ShowUsage
                          +)
                          +
                          +set ccpath=%1
                          +shift
                          +
                          +set compiler=
                          +for /F %%i in ("%ccpath%") do set compiler=%%~ni
                          +
                          +if "%1"=="" (
                          +  echo Missing definition list
                          +  goto :ShowUsage
                          +)
                          +
                          +rem Check for some well known, non-GCC Windows native tools that require
                          +rem a special output format as well as special paths
                          +
                          +:GetFormat
                          +set fmt=std
                          +if "%compiler%"=="ez8cc" goto :SetZdsFormt
                          +if "%compiler%"=="zneocc" goto :SetZdsFormt
                          +if "%compiler%"=="ez80cc" goto :SetZdsFormt
                          +goto :ProcessDefinitions
                          +
                          +:SetZdsFormt
                          +set fmt=zds
                          +
                          +rem Now process each directory in the directory list
                          +
                          +:ProcessDefinitions
                          +set response=
                          +
                          +:DefinitionLoop
                          +if "%1"=="" goto :Done
                          +
                          +set varname=%1
                          +shift
                          +
                          +rem Handle the output depending on if there is a value for the variable or not
                          +
                          +if "%1"=="-val" goto :GetValue
                          +
                          +rem Handle the output using the selected format
                          +
                          +:NoValue
                          +if "%fmt%"=="zds" goto :NoValueZDS
                          +
                          +:NoValueStandard
                          +rem Treat the first definition differently
                          +
                          +if "%response%"=="" (
                          +  set response=-D%varname%
                          +  goto :DefinitionLoop
                          +)
                          +
                          +set response=%response% -D%varname%
                          +goto :DefinitionLoop
                          +
                          +:NoValueZDS
                          +rem Treat the first definition differently
                          +
                          +if "%response%"=="" (
                          +  set response=-define:%varname%
                          +  goto :DefinitionLoop
                          +)
                          +
                          +set response=%response% -define:%varname%
                          +goto :DefinitionLoop
                          +
                          +rem Get value following the variable name
                          +
                          +:GetValue
                          +shift
                          +set varvalue=%1
                          +shift
                          +
                          +rem Handle the output using the selected format
                          +
                          +if "%fmt%"=="zds" goto :ValueZDS
                          +
                          +:ValueStandard
                          +rem Treat the first definition differently
                          +
                          +if "%response%"=="" (
                          +  set response=-D%varname%=%varvalue%
                          +  goto :DefinitionLoop
                          +)
                          +
                          +set response=%response% -D%varname%=%varvalue%
                          +goto :DefinitionLoop
                          +
                          +:ValueZds
                          +rem Treat the first definition differently
                          +
                          +if "%response%"=="" (
                          +  set response=-define:%varname%=%varvalue%
                          +  goto :DefinitionLoop
                          +)
                          +
                          +set response=%response% -define:%varname%=%varvalue%
                          +goto :DefinitionLoop
                          +
                          +:Done
                          +echo %response%
                          +goto :End
                          +
                          +:ShowUsage
                          +echo %progname% is a tool for flexible generation of command line pre-processor
                          +echo definitions arguments for a variety of diffent ccpaths in a variety of
                          +echo compilation environments"
                          +echo USAGE:%progname% [-h] ^ [-val ^<^val1^>] [^ [-val ^] [^ [-val ^] ...]]
                          +echo Where:"
                          +echo 	^
                          +echo 		The full path to your ccpath
                          +echo 	^ ^ ^ ...
                          +echo 		A list of pre-preprocesser variable names to be defined.
                          +echo 	[-val ^] [-val ^] [-val ^] ...
                          +echo 		optional values to be assigned to each pre-processor variable.
                          +echo 		If not supplied, the variable will be defined with no explicit value.
                          +echo 	-h
                          +echo 		Show this text and exit
                          +
                          +:End
                          diff --git a/nuttx/tools/define.sh b/nuttx/tools/define.sh
                          index c53cb92a83..dc982cc648 100755
                          --- a/nuttx/tools/define.sh
                          +++ b/nuttx/tools/define.sh
                          @@ -1,7 +1,7 @@
                           #!/bin/bash
                           # tools/define.sh
                           #
                          -#   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
                          @@ -38,7 +38,7 @@
                           
                           progname=$0
                           wintool=n
                          -usage="USAGE: $progname [-w] [-d] [-l] [-h]  [=val1] [[=val2] [[=val3] ...]]"
                          +usage="USAGE: $progname [-w] [-d] [-h]  [=val1] [[=val2] [[=val3] ...]]"
                           advice="Try '$progname -h' for more information"
                           
                           while [ ! -z "$1" ]; do 
                          @@ -60,7 +60,7 @@ while [ ! -z "$1" ]; do
                           		echo "	"
                           		echo "		The full path to your compiler"
                           		echo "	  [ ..."
                          -		echo "		A list of pre-preprocesser variable names to be defind."
                          +		echo "		A list of pre-preprocesser variable names to be defined."
                           		echo "	[=val1] [=val2] [=val3]"
                           		echo "		optional values to be assigned to each pre-processor variable."
                           		echo "		If not supplied, the variable will be defined with no explicit value."
                          @@ -164,7 +164,7 @@ else
                           	fmt=std
                           fi
                           
                          -# Now process each directory in the directory list
                          +# Now process each definition in the definition list
                           
                           unset response
                           for vardef in $varlist; do
                          diff --git a/nuttx/tools/incdir.sh b/nuttx/tools/incdir.sh
                          index eaae082b97..145bfe9bbc 100755
                          --- a/nuttx/tools/incdir.sh
                          +++ b/nuttx/tools/incdir.sh
                          @@ -70,6 +70,9 @@ while [ ! -z "$1" ]; do
                           		echo "		header file paths."
                           		echo "	-d"
                           		echo "		Enable script debug"
                          +		echo "	-h"
                          +		echo "		Shows this help text and exits."
                          +		exit 0
                           		;;
                           	* )
                           		break;
                          diff --git a/nuttx/tools/mkconfig.c b/nuttx/tools/mkconfig.c
                          index 2d2fff5c56..3e55f50974 100644
                          --- a/nuttx/tools/mkconfig.c
                          +++ b/nuttx/tools/mkconfig.c
                          @@ -116,7 +116,7 @@ int main(int argc, char **argv, char **envp)
                             printf(" * configured (at present, NXFLAT is the only supported binary.\n");
                             printf(" * format).\n");
                             printf(" */\n\n");
                          -  printf("#if !defined(CONFIG_NXFLAT)\n");
                          +  printf("#if !defined(CONFIG_NXFLAT) && !defined(CONFIG_ELF)\n");
                             printf("# undef CONFIG_BINFMT_DISABLE\n");
                             printf("# define CONFIG_BINFMT_DISABLE 1\n");
                             printf("#endif\n\n");
                          diff --git a/nuttx/tools/mkdeps.bat b/nuttx/tools/mkdeps.bat
                          new file mode 100644
                          index 0000000000..23aab0b715
                          --- /dev/null
                          +++ b/nuttx/tools/mkdeps.bat
                          @@ -0,0 +1,173 @@
                          +@echo off
                          +
                          +rem tools/mkdeps.sh
                          +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 Accumulate CFLAGS up to "--"
                          +
                          +set cc=
                          +set cflags=
                          +set altpath=
                          +set files=
                          +set args=
                          +set debug=n
                          +
                          +:Loop
                          +if "%1"=="" goto Continue
                          +
                          +if "%1"=="--" (
                          +  set cc=%cflags%
                          +  set cflags=%args%
                          +  set args=
                          +  goto NextParm
                          +)
                          +
                          +if "%1"=="--dep-path" (
                          +  if "%args%"=="" (
                          +    set altpath=%altpath% %2
                          +  ) else (
                          +    set args=%args% %2
                          +  )
                          +  shift
                          +  goto NextParm
                          +)
                          +
                          +if "%1"=="--dep-debug" (
                          +rem  @echo on
                          +  set debug=y
                          +  goto NextParm
                          +)
                          +
                          +if "%1"=="--help" goto Usage
                          +
                          +if "%args%"=="" (
                          +  set args=%1
                          +) else (
                          +  set args=%args% %1
                          +)
                          +
                          +:NextParm
                          +shift
                          +goto Loop
                          +:Continue
                          +
                          +set files=%args%
                          +
                          +if "%debug%"=="y" (
                          +  echo cc=%cc%
                          +  echo cflags=%cflags%
                          +  echo files=%files%
                          +  echo altpath=%altpath%
                          +)
                          +
                          +rem Now check if we have everything
                          +
                          +if "%cc%"=="" (
                          +  echo ERROR: No compiler specified
                          +  goto Usage
                          +)
                          +
                          +if "%files%"=="" (
                          +  rem Don't report an error -- this happens normally in some configurations
                          +  echo # No files specified for dependency generataion
                          +  goto End
                          +)
                          +
                          +rem Then get the dependencies for each file
                          +
                          +if "%altpath%"=="" goto NoPaths
                          +for %%G in (%files%) do (
                          +  set fullpath=
                          +  set file=%%G
                          +  call :Checkpaths
                          +  if "%debug%"=="y" echo %file%: fullpath=%fullpath%
                          +  if "%fullpath%"=="" goto :NoFile
                          +  if "%debug%"=="y" echo CMD: %cc% -M %cflags% %fullpath%
                          +  %cc% -M %cflags% %fullpath% || goto DepFail
                          +)
                          +goto :End
                          +
                          +:NoPaths
                          +for %%G in (%files%) do (
                          +  set fullpath=
                          +  set file=%%G
                          +  call :CheckFile %%G
                          +)
                          +goto :End
                          +
                          +:CheckFile
                          +if "%debug%"=="y" echo Checkfile: Checking %file%
                          +if not exist %file% goto :NoFile
                          +set fullpath=%file%
                          +  if "%debug%"=="y" echo CMD: %cc% -M %cflags% %fullpath%
                          +%cc% -M %cflags% %fullpath% || goto DepFail
                          +goto :EOF
                          +
                          +:CheckPaths
                          +for %%H in (%altpath%) do (
                          +  set tmppath=%%H\%file%
                          +  if "%debug%"=="y" echo Checkfile: Checking %tmppath% 
                          +  if exist %tmppath% (
                          +    set fullpath=%tmppath%
                          +    goto :EOF
                          +  )
                          +)
                          +goto :EOF
                          +
                          +:NoFile
                          +echo ERROR: No readable file at %file%
                          +goto Usage
                          +
                          +:DepFail
                          +echo ERROR: Failed to created dependencies for %file%
                          +
                          +:Usage
                          +echo Usage: mkdeps  [OPTIONS] CC -- CFLAGS -- file [file [file...]]
                          +echo Where:
                          +echo   CC
                          +echo     A variable number of arguments that define how to execute the compiler
                          +echo   CFLAGS
                          +echo     The compiler compilation flags
                          +echo   file
                          +echo     One or more C files whose dependencies will be checked.  Each file is expected
                          +echo     to reside in the current directory unless --dep-path is provided on the command line
                          +echo And [OPTIONS] include:
                          +echo   --dep-debug
                          +echo     Enable script debug
                          +echo   --dep-path ^
                          +echo     Do not look in the current directory for the file.  Instead, look in  to see
                          +echo     if the file resides there.  --dep-path may be used multiple times to specify
                          +echo     multiple alternative location
                          +echo   --help
                          +echo     Shows this message and exits
                          +
                          +:End
                          diff --git a/nuttx/tools/mkdeps.c b/nuttx/tools/mkdeps.c
                          new file mode 100644
                          index 0000000000..64d81cbd77
                          --- /dev/null
                          +++ b/nuttx/tools/mkdeps.c
                          @@ -0,0 +1,721 @@
                          +/****************************************************************************
                          + * tools/mkdeps.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 
                          +
                          +/****************************************************************************
                          + * Pre-processor Definitions
                          + ****************************************************************************/
                          +
                          +#define MAX_BUFFER  (4096)
                          +
                          +/****************************************************************************
                          + * Private Types
                          + ****************************************************************************/
                          +
                          +enum slashmode_e
                          +{
                          +  MODE_FSLASH  = 0,
                          +  MODE_BSLASH  = 1,
                          +  MODE_DBLBACK = 2
                          +};
                          +
                          +/****************************************************************************
                          + * Private Data
                          + ****************************************************************************/
                          +
                          +static char *g_cc       = NULL;
                          +static char *g_cflags   = NULL;
                          +static char *g_files    = NULL;
                          +static char *g_altpath  = NULL;
                          +static int   g_debug    = 0;
                          +static bool  g_winnative = false;
                          +#ifdef HAVE_WINPATH
                          +static bool  g_winpath  = false;
                          +static char *g_topdir   = NULL;
                          +#endif
                          +
                          +static char g_command[MAX_BUFFER];
                          +
                          +/****************************************************************************
                          + * Private Functions
                          + ****************************************************************************/
                          +
                          + /* MinGW does not seem to provide strtok_r */
                          +
                          +#ifndef HAVE_STRTOK_R
                          +static char *MY_strtok_r(char *str, const char *delim, char **saveptr)
                          +{
                          +  char *pbegin;
                          +  char *pend = NULL;
                          +
                          +  /* Decide if we are starting a new string or continuing from
                          +   * the point we left off.
                          +   */
                          +
                          +  if (str)
                          +    {
                          +      pbegin = str;
                          +    }
                          +  else if (saveptr && *saveptr)
                          +    {
                          +      pbegin = *saveptr;
                          +    }
                          +  else
                          +    {
                          +      return NULL;
                          +    }
                          +
                          +  /* Find the beginning of the next token */
                          +
                          +  for (;
                          +       *pbegin && strchr(delim, *pbegin) != NULL;
                          +       pbegin++);
                          +
                          +  /* If we are at the end of the string with nothing
                          +   * but delimiters found, then return NULL.
                          +   */
                          +
                          +  if (!*pbegin)
                          +    {
                          +      return NULL;
                          +    }
                          +
                          +  /* Find the end of the token */
                          +
                          +  for (pend = pbegin + 1;
                          +       *pend && strchr(delim, *pend) == NULL;
                          +       pend++);
                          +
                          +  /* pend either points to the end of the string or to
                          +   * the first delimiter after the string.
                          +   */
                          +
                          +  if (*pend)
                          +    {
                          +      /* Turn the delimiter into a null terminator */
                          +
                          +      *pend++ = '\0';
                          +    }
                          +
                          +  /* Save the pointer where we left off and return the
                          +   * beginning of the token.
                          +   */
                          +
                          +  if (saveptr)
                          +    {
                          +      *saveptr = pend;
                          +    }
                          +  return pbegin;
                          +}
                          +
                          +#define strtok_r MY_strtok_r
                          +#endif
                          +
                          +static void append(char **base, char *str)
                          +{
                          +  char *oldbase;
                          +  char *newbase;
                          +  int alloclen;
                          +
                          +  oldbase = *base;
                          +  if (!oldbase)
                          +    {
                          +      newbase = strdup(str);      
                          +      if (!newbase)
                          +        {
                          +          fprintf(stderr, "ERROR: Failed to strdup %s\n", str);
                          +          exit(EXIT_FAILURE);
                          +        }
                          +    }
                          +  else
                          +    {
                          +      alloclen = strlen(oldbase) + strlen(str) + 2;
                          +      newbase = (char *)malloc(alloclen);
                          +      if (!newbase)
                          +        {
                          +          fprintf(stderr, "ERROR: Failed to allocate %d bytes\n", alloclen);
                          +          exit(EXIT_FAILURE);
                          +        }
                          + 
                          +      snprintf(newbase, alloclen, "%s %s\n", oldbase, str);
                          +      free(oldbase);
                          +   }
                          +
                          +  *base = newbase;
                          +}
                          +
                          +static void show_usage(const char *progname, const char *msg, int exitcode)
                          +{
                          +  if (msg)
                          +    {
                          +      fprintf(stderr, "\n");
                          +      fprintf(stderr, "%s:\n", msg);
                          +    }
                          +
                          +  fprintf(stderr, "\n");
                          +  fprintf(stderr, "%s  [OPTIONS] CC -- CFLAGS -- file [file [file...]]\n",
                          +          progname);
                          +  fprintf(stderr, "\n");
                          +  fprintf(stderr, "Where:\n");
                          +  fprintf(stderr, "  CC\n");
                          +  fprintf(stderr, "    A variable number of arguments that define how to execute the compiler\n");
                          +  fprintf(stderr, "  CFLAGS\n");
                          +  fprintf(stderr, "    The compiler compilation flags\n");
                          +  fprintf(stderr, "  file\n");
                          +  fprintf(stderr, "    One or more C files whose dependencies will be checked.  Each file is expected\n");
                          +  fprintf(stderr, "    to reside in the current directory unless --dep-path is provided on the command line\n");
                          +  fprintf(stderr, "\n");
                          +  fprintf(stderr, "And [OPTIONS] include:\n");
                          +  fprintf(stderr, "  --dep-debug\n");
                          +  fprintf(stderr, "    Enable script debug\n");
                          +  fprintf(stderr, "  --dep-path \n");
                          +  fprintf(stderr, "    Do not look in the current directory for the file.  Instead, look in  to see\n");
                          +  fprintf(stderr, "    if the file resides there.  --dep-path may be used multiple times to specify\n");
                          +  fprintf(stderr, "    multiple alternative location\n");
                          +  fprintf(stderr, "  --winnative\n");
                          +  fprintf(stderr, "    By default, a POSIX-style environment is assumed (e.g., Linux, Cygwin, etc.)  This option is\n");
                          +  fprintf(stderr, "    inform the tool that is working in a pure Windows native environment.\n");
                          +#ifdef HAVE_WINPATH
                          +  fprintf(stderr, "  --winpaths \n");
                          +  fprintf(stderr, "    This option is useful when using a Windows native toolchain in a POSIX environment (such\n");
                          +  fprintf(stderr, "    such as Cygwin).  In this case, will CC generates dependency lists using Windows paths\n");
                          +  fprintf(stderr, "    (e.g., C:\\blablah\\blabla).  This switch instructs the script to use 'cygpath' to convert\n");
                          +  fprintf(stderr, "    the Windows paths to Cygwin POSIXE paths.\n");
                          +#endif
                          +  fprintf(stderr, "  --help\n");
                          +  fprintf(stderr, "    Shows this message and exits\n");
                          +  exit(exitcode);
                          +}
                          +
                          +static void parse_args(int argc, char **argv)
                          +{
                          +  char *args = NULL;
                          +  int argidx;
                          +
                          +  /* Accumulate CFLAGS up to "--" */
                          +
                          +  for (argidx = 1; argidx < argc; argidx++)
                          +    {
                          +      if (strcmp(argv[argidx], "--") == 0)
                          +        {
                          +          g_cc = g_cflags;
                          +          g_cflags = args;
                          +          args = NULL;
                          +        }
                          +      else if (strcmp(argv[argidx], "--dep-debug") == 0)
                          +        {
                          +          g_debug++;
                          +        }
                          +      else if (strcmp(argv[argidx], "--dep-path") == 0)
                          +        {
                          +          argidx++;
                          +          if (argidx >= argc)
                          +            {
                          +              show_usage(argv[0], "ERROR: Missing argument to --dep-path", EXIT_FAILURE);
                          +            }
                          +
                          +          if (args)
                          +            {
                          +              append(&args, argv[argidx]);
                          +            }
                          +          else
                          +            {
                          +              append(&g_altpath, argv[argidx]);              
                          +            }
                          +        }
                          +      else if (strcmp(argv[argidx], "--winnative") == 0)
                          +        {
                          +          g_winnative = true;
                          +        }
                          +#ifdef HAVE_WINPATH
                          +      else if (strcmp(argv[argidx], "--winpath") == 0)
                          +        {
                          +          g_winpath = true;
                          +          if (g_topdir)
                          +            {
                          +              free(g_topdir);
                          +            }
                          +
                          +          argidx++;
                          +          if (argidx >= argc)
                          +            {
                          +              show_usage(argv[0], "ERROR: Missing argument to --winpath", EXIT_FAILURE);
                          +            }
                          +
                          +          g_topdir = strdup(argv[argidx]);
                          +        }
                          +#endif
                          +      else if (strcmp(argv[argidx], "--help") == 0)
                          +        {
                          +          show_usage(argv[0], NULL, EXIT_SUCCESS);
                          +        }
                          +      else
                          +        {
                          +          append(&args, argv[argidx]);
                          +        }
                          +    }
                          +
                          +  /* The final thing accumulated is the list of files */
                          +
                          +  g_files = args;
                          +
                          +  /* If no paths were specified, then look in the current directory only */
                          +
                          +  if (!g_altpath)
                          +    {
                          +      g_altpath = strdup(".");
                          +    }
                          +
                          +  if (g_debug)
                          +    {
                          +      fprintf(stderr, "SELECTIONS\n");
                          +      fprintf(stderr, "  CC             : [%s]\n", g_cc ? g_cc : "(None)");
                          +      fprintf(stderr, "  CFLAGS         : [%s]\n", g_cflags ? g_cflags : "(None)");
                          +      fprintf(stderr, "  FILES          : [%s]\n", g_files ? g_files : "(None)");
                          +      fprintf(stderr, "  PATHS          : [%s]\n", g_altpath ? g_altpath : "(None)");
                          +#ifdef HAVE_WINPATH
                          +      fprintf(stderr, "  Windows Paths  : [%s]\n", g_winpath ? "TRUE" : "FALSE");
                          +      if (g_winpath)
                          +        {
                          +          fprintf(stderr, "  TOPDIR         : [%s]\n", g_topdir);
                          +        }
                          +#endif
                          +      fprintf(stderr, "  Windows Native : [%s]\n", g_winnative ? "TRUE" : "FALSE");
                          +    }
                          +
                          +  /* Check for required paramters */
                          +
                          +  if (!g_cc)
                          +    {
                          +      show_usage(argv[0], "ERROR: No compiler specified", EXIT_FAILURE);
                          +    }
                          +
                          +  if (!g_files)
                          +    {
                          +      /* Don't report an error -- this happens normally in some configurations */
                          +
                          +      printf("# No files specified for dependency generataion\n");
                          +      exit(EXIT_SUCCESS);
                          +    }
                          +
                          +#ifdef HAVE_WINPATH
                          +  if (g_winnative && g_winpath)
                          +    {
                          +      show_usage(argv[0], "ERROR: Both --winnative and --winpapth makes no sense", EXIT_FAILURE);
                          +    }
                          +#endif
                          +}
                          +
                          +static void do_dependency(const char *file, char separator)
                          +{
                          +  static const char moption[] = " -M ";
                          +  struct stat buf;
                          +  char *alloc;
                          +  char *altpath;
                          +  char *path;
                          +  char *lasts;
                          +  int cmdlen;
                          +  int pathlen;
                          +  int filelen;
                          +  int totallen;
                          +  int ret;
                          +
                          +  /* Copy the compiler into the command buffer */
                          +
                          +  cmdlen = strlen(g_cc);
                          +  if (cmdlen >= MAX_BUFFER)
                          +    {
                          +      fprintf(stderr, "ERROR: Compiler string is too long [%d/%d]: %s\n",
                          +              cmdlen, MAX_BUFFER, g_cc);
                          +      exit(EXIT_FAILURE);
                          +    }
                          +
                          +  strcpy(g_command, g_cc);
                          +
                          +  /* Copy " -M " */
                          +
                          +  cmdlen += strlen(moption);
                          +  if (cmdlen >= MAX_BUFFER)
                          +    {
                          +      fprintf(stderr, "ERROR: Option string is too long [%d/%d]: %s\n",
                          +              cmdlen, MAX_BUFFER, moption);
                          +      exit(EXIT_FAILURE);
                          +    }
                          +
                          +  strcat(g_command, moption);
                          +
                          +  /* Copy the CFLAGS into the command buffer */
                          +
                          +  cmdlen += strlen(g_cflags);
                          +  if (cmdlen >= MAX_BUFFER)
                          +    {
                          +      fprintf(stderr, "ERROR: CFLAG string is too long [%d/%d]: %s\n",
                          +              cmdlen, MAX_BUFFER, g_cflags);
                          +      exit(EXIT_FAILURE);
                          +    }
                          +
                          +  strcat(g_command, g_cflags);
                          +
                          +  /* Add a space */
                          +
                          +  g_command[cmdlen] = ' ';
                          +  cmdlen++;
                          +  g_command[cmdlen] = '\0';
                          +
                          +  /* Make a copy of g_altpath. We need to do this because at least the version
                          +   * of strtok_r above does modifie it.
                          +   */
                          +
                          +  alloc = strdup(g_altpath);
                          +  if (!alloc)
                          +    {
                          +      fprintf(stderr, "ERROR: Failed to strdup paths\n");
                          +      exit(EXIT_FAILURE);
                          +    }
                          +
                          +  altpath = alloc;
                          +
                          +  /* Try each path.  This loop will continue until each path has been tried
                          +   * (failure) or until stat() finds the file
                          +   */
                          +
                          +  while ((path = strtok_r(altpath, " ", &lasts)) != NULL)
                          +    {
                          +      /* Create a full path to the file */
                          +
                          +      pathlen = strlen(path);
                          +      totallen = cmdlen + pathlen;
                          +      if (totallen >= MAX_BUFFER)
                          +        {
                          +          fprintf(stderr, "ERROR: Path is too long [%d/%d]: %s\n",
                          +                  totallen, MAX_BUFFER, path);
                          +          exit(EXIT_FAILURE);
                          +        }
                          +
                          +      strcpy(&g_command[cmdlen], path);
                          +
                          +      if (g_command[totallen] != '\0')
                          +        {
                          +          fprintf(stderr, "ERROR: Missing NUL terminator\n");
                          +          exit(EXIT_FAILURE);
                          +        }
                          +
                          +       if (g_command[totallen-1] != separator)
                          +        {
                          +          g_command[totallen] = separator;
                          +          g_command[totallen+1] = '\0';
                          +          pathlen++;
                          +          totallen++;
                          +        }
                          +
                          +       filelen = strlen(file);
                          +       totallen += filelen;
                          +       if (totallen >= MAX_BUFFER)
                          +         {
                          +          fprintf(stderr, "ERROR: Path+file is too long [%d/%d]\n",
                          +                  totallen, MAX_BUFFER);
                          +          exit(EXIT_FAILURE);
                          +         }
                          +        
                          +       strcat(g_command, file);
                          +
                          +      /* Check that a file actually exists at this path */
                          +
                          +      if (g_debug)
                          +        {
                          +          fprintf(stderr, "Trying path=%s file=%s fullpath=%s\n",
                          +                  path, file, &g_command[cmdlen]);
                          +        }
                          +
                          +      ret = stat(&g_command[cmdlen], &buf);
                          +      if (ret < 0)
                          +        {
                          +          altpath = NULL;
                          +          continue;
                          +        }
                          +
                          +      if (!S_ISREG(buf.st_mode))
                          +        {
                          +          fprintf(stderr, "ERROR: File %s exists but is not a regular file\n",
                          +                  &g_command[cmdlen]);
                          +          exit(EXIT_FAILURE);
                          +        }
                          +
                          +      /* Okay.. we have.  Create the dependency.  One a failure to start the
                          +       * compiler, system() will return -1;  Otherwise, the returned value
                          +       * from the compiler is in WEXITSTATUS(ret).
                          +       */
                          + 
                          +      ret = system(g_command);
                          +#ifdef WEXITSTATUS
                          +      if (ret < 0 || WEXITSTATUS(ret) != 0)
                          +        {
                          +          if (ret < 0)
                          +            {
                          +              fprintf(stderr, "ERROR: system failed: %s\n", strerror(errno));
                          +            }
                          +          else
                          +            {
                          +              fprintf(stderr, "ERROR: %s failed: %d\n", g_cc, WEXITSTATUS(ret));
                          +            }
                          +
                          +          fprintf(stderr, "       command: %s\n", g_command);
                          +          exit(EXIT_FAILURE);
                          +        }
                          +#else
                          +      if (ret < 0)
                          +        {
                          +          fprintf(stderr, "ERROR: system failed: %s\n", strerror(errno));
                          +          fprintf(stderr, "       command: %s\n", g_command);
                          +          exit(EXIT_FAILURE);
                          +        }
                          +#endif
                          + 
                          +      /* We don't really know that the command succeeded... Let's assume that it did */
                          + 
                          +      free(alloc);
                          +      return;
                          +    }
                          +
                          +   printf("# ERROR: File \"%s\" not found at any location\n", file);
                          +   exit(EXIT_FAILURE);
                          +}
                          +
                          +/* Convert a Cygwin path to a Windows path */
                          +
                          +#ifdef HAVE_WINPATH
                          +static char *cywin2windows(const char *str, const char *append, enum slashmode_e mode)
                          +{
                          +  static const char cygdrive[] = "/cydrive";
                          +  const char *src = src;
                          +  char *dest;
                          +  char *newpath;
                          +  char *allocpath = NULL;
                          +  int srclen = strlen(str);
                          +  int alloclen = 0;
                          +  int drive = 0;
                          +  int lastchar;
                          +
                          +  /* Skip any leading whitespace */
                          +
                          +  while (isspace(*str)) str++;
                          +
                          +  /* Were we asked to append something? */
                          +
                          +  if (append)
                          +    {
                          +      char *tmp;
                          + 
                          +      alloclen = sizeof(str) + sizeof(append) + 1;
                          +      allocpath = (char *)malloc(alloclen);
                          +      if (!allocpath)
                          +        {
                          +          fprintf(stderr, "ERROR: Failed to allocate %d bytes\n", alloclen);
                          +          exit(EXIT_FAILURE);
                          +        }
                          +
                          +      snprintf(allocpath, alloclen, "%s/%s", str, append);
                          +    }
                          +
                          +  /* Looking for path of the form /cygdrive/c/bla/bla/bla */
                          +
                          +  if (strcasecmp(src, cygdrive) == 0)
                          +    {
                          +      int cygsize = sizeof(cygdrive);
                          +      if (src[cygsize] == '/')
                          +        {
                          +          cygsize++;
                          +          srclen -= cygsize;
                          +          src += cygsize;
                          +
                          +          if (srclen <= 0)
                          +            {
                          +              fprintf(stderr, "ERROR: Unhandled path: \"%s\"\n", str);
                          +              exit(EXIT_FAILURE);
                          +            }
                          +
                          +          drive = toupper(*src);
                          +          if (drive < 'A' || drive > 'Z')
                          +            {
                          +              fprintf(stderr, "ERROR: Drive charager: \"%s\"\n", str);
                          +              exit(EXIT_FAILURE);
                          +            }
                          +
                          +          srclen--;
                          +          src++;
                          +          alloclen = 2;
                          +        }
                          +    }
                          +
                          +  /* Determine the size of the new path */
                          +
                          +  alloclen += sizeof(src) + 1;
                          +  if (mode == MODE_DBLBACK)
                          +    {
                          +      const char *tmpptr;
                          +      for (tmpptr = src; *tmpptr; tmpptr++)
                          +        {
                          +          if (*tmpptr == '/') alloclen++;
                          +        }
                          +    }
                          +
                          +  /* Allocate memory for the new path */
                          +
                          +  newpath = (char *)malloc(alloclen);
                          +  if (!newpath)
                          +    {
                          +      fprintf(stderr, "ERROR: Failed to allocate %d bytes\n", alloclen);
                          +      exit(EXIT_FAILURE);
                          +    }
                          +
                          +  dest = newpath;
                          +
                          +  /* Copy the drive character */
                          +
                          +  if (drive)
                          +    {
                          +      *dest++ = drive;
                          +      *dest++ = ':';
                          +    }
                          +
                          +  /* Copy each character from the source, making modifications for foward
                          +   * slashes as required.
                          +   */
                          +
                          +  lastchar = '\0';
                          +  for (; *src; src++)
                          +    {
                          +      if (mode != MODE_FSLASH && *src == '/')
                          +        {
                          +          if (lastchar != '/')
                          +            {
                          +              *dest++ = '\\';
                          +              if (mode == MODE_DBLBACK)
                          +                {
                          +                  *dest++ = '\\';
                          +                }
                          +            }
                          +        }
                          +      else
                          +        {
                          +          *dest++ = *src;
                          +        }
                          +
                          +      lastchar = *src;
                          +    }
                          +
                          +  *dest++ = '\0';
                          +  if (allocpath)
                          +    {
                          +      free(allocpath);
                          +    }
                          +  return dest;
                          +}
                          +#endif
                          +
                          +#ifdef HAVE_WINPATH
                          +static void do_winpath(char *file)
                          +{
                          +  /* The file is in POSIX format.  CC expects Windows format to generate the
                          +   * dependencies, but GNU make expect the resulting dependencies to be back
                          +   * in POSIX format.  What a mess!
                          +   */
                          +
                          +  char *path = cywin2windows(g_topdir, file, MODE_FSLASH);
                          +
                          +  /* Then get the dependency and perform conversions on it to make it
                          +   * palatable to the Cygwin make.
                          +   */
                          +#warning "Missing logic"
                          +
                          +  free(path);
                          +}
                          +#endif
                          +
                          +/****************************************************************************
                          + * Public Functions
                          + ****************************************************************************/
                          +
                          +int main(int argc, char **argv, char **envp)
                          +{
                          +  char *lasts;
                          +  char *files;
                          +  char *file;
                          +
                          +  /* Parse command line parameters */
                          +
                          +  parse_args(argc, argv);
                          +
                          +  /* Then generate dependencies for each path on the command line.  NOTE
                          +   * strtok_r will clobber the files list.  But that is okay because we are
                          +   * only going to traverse it once.
                          +   */
                          +
                          +  files = g_files;
                          +  while ((file = strtok_r(files, " ", &lasts)) != NULL)
                          +    {
                          +      /* Check if we need to do path conversions for a Windows-natvie tool
                          +       * being using in a POSIX/Cygwin environment.
                          +       */
                          +
                          +#ifdef HAVE_WINPATH
                          +      if (g_winpath)
                          +        {
                          +          do_winpath(file);
                          +        }
                          +      else
                          +#endif
                          +        {
                          +          do_dependency(file, g_winnative ? '\\' : '/');
                          +        }
                          +
                          +      files = NULL;
                          +    }
                          +
                          +  return EXIT_SUCCESS;
                          +}
                          diff --git a/nuttx/tools/mkdeps.sh b/nuttx/tools/mkdeps.sh
                          index d8984e5536..42397012b2 100755
                          --- a/nuttx/tools/mkdeps.sh
                          +++ b/nuttx/tools/mkdeps.sh
                          @@ -2,7 +2,7 @@
                           ############################################################################
                           # tools/mkdeps.sh
                           #
                          -#   Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
                          +#   Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                           #
                           # Redistribution and use in source and binary forms, with or without
                          diff --git a/nuttx/tools/mkromfsimg.sh b/nuttx/tools/mkromfsimg.sh
                          index b774119800..8811f19536 100755
                          --- a/nuttx/tools/mkromfsimg.sh
                          +++ b/nuttx/tools/mkromfsimg.sh
                          @@ -233,7 +233,7 @@ mkdir -p $workingdir || { echo "Failed to created the new $workingdir"; exit 1;
                           # Create the rcS file from the rcS.template
                           
                           if [ ! -r $rcstemplate ]; then
                          -    echo "$rcstemplete does not exist"
                          +    echo "$rcstemplate does not exist"
                               rmdir $workingdir
                               exit 1
                           fi
                          diff --git a/nuttx/tools/mksymtab.c b/nuttx/tools/mksymtab.c
                          index c5a46a92be..e401812c00 100644
                          --- a/nuttx/tools/mksymtab.c
                          +++ b/nuttx/tools/mksymtab.c
                          @@ -222,7 +222,7 @@ int main(int argc, char **argv, char **envp)
                           
                             fprintf(outstream, "/* %s: Auto-generated symbol table.  Do not edit */\n\n", symtab);
                             fprintf(outstream, "#include \n");
                          -  fprintf(outstream, "#include \n\n");
                          +  fprintf(outstream, "#include \n\n");
                           
                             /* Output all of the require header files */
                           
                          
                          From 919d53766acb1fa6acfb9e38074666167de772e9 Mon Sep 17 00:00:00 2001
                          From: px4dev 
                          Date: Fri, 11 Jan 2013 02:31:30 -0800
                          Subject: [PATCH 070/157] Less noisy build again.
                          
                          ---
                           Makefile | 4 ++--
                           1 file changed, 2 insertions(+), 2 deletions(-)
                          
                          diff --git a/Makefile b/Makefile
                          index b762521e20..f91e75d0b6 100644
                          --- a/Makefile
                          +++ b/Makefile
                          @@ -42,8 +42,8 @@ FIRMWARE_PROTOTYPE	 = $(IMAGE_DIR)/$(TARGET).prototype
                           #
                           # Debugging
                           #
                          -#MQUIET			 = --no-print-directory
                          -MQUIET			 = --print-directory
                          +MQUIET			 = --no-print-directory
                          +#MQUIET			 = --print-directory
                           
                           all:			$(FIRMWARE_BUNDLE)
                           
                          
                          From 0267782782f083c53bcf49b28e4ba2ed8c28105a Mon Sep 17 00:00:00 2001
                          From: px4dev 
                          Date: Fri, 11 Jan 2013 02:32:05 -0800
                          Subject: [PATCH 071/157] Recover changes lost to bad merging.
                          
                          ---
                           apps/Makefile                     |  71 ++++++++++----
                           apps/examples/adc/Makefile        |  23 +++--
                           apps/examples/adc/adc_main.c      |   7 +-
                           apps/examples/buttons/Makefile    |  23 +++--
                           apps/examples/can/Makefile        |  23 +++--
                           apps/examples/cdcacm/Makefile     |  21 ++--
                           apps/examples/hello/Makefile      |  21 ++--
                           apps/examples/helloxx/Makefile    |  25 ++---
                           apps/examples/mm/Makefile         |  23 +++--
                           apps/examples/mount/Makefile      |  23 +++--
                           apps/examples/nsh/Makefile        |  23 +++--
                           apps/examples/null/Makefile       |  23 +++--
                           apps/examples/ostest/Kconfig      |  27 ++++++
                           apps/examples/ostest/Makefile     |  21 ++--
                           apps/examples/ostest/roundrobin.c | 156 +++++++++++++-----------------
                           apps/examples/pipe/Makefile       |  23 +++--
                           apps/examples/poll/Makefile       |  24 +++--
                           apps/examples/pwm/Makefile        |  23 +++--
                           apps/examples/pwm/pwm_main.c      |   1 +
                           apps/examples/qencoder/Makefile   |  21 ++--
                           apps/examples/romfs/Makefile      |  26 ++---
                           apps/examples/serloop/Makefile    |  23 +++--
                           apps/examples/watchdog/Makefile   |  21 ++--
                           apps/interpreters/Makefile        |  32 +++---
                           apps/interpreters/ficl/Makefile   |  31 +++---
                           apps/namedapp/Makefile            |  34 ++++---
                           apps/nshlib/Kconfig               | 100 ++++++++++++++++++-
                           apps/nshlib/Makefile              |  63 ++++++------
                           apps/nshlib/nsh_dbgcmds.c         |  61 +++++++++++-
                           apps/nshlib/nsh_netinit.c         |  12 ++-
                           apps/system/Makefile              |  33 ++++---
                           apps/system/free/Makefile         |  30 +++---
                           apps/system/i2c/Makefile          |  29 +++---
                           apps/system/install/Makefile      |  29 +++---
                           apps/system/readline/Makefile     |  26 ++---
                           35 files changed, 726 insertions(+), 426 deletions(-)
                          
                          diff --git a/apps/Makefile b/apps/Makefile
                          index 11d95bc190..f0de58e25d 100644
                          --- a/apps/Makefile
                          +++ b/apps/Makefile
                          @@ -107,7 +107,7 @@ endif
                           # Create the list of available applications (INSTALLED_APPS)
                           
                           define ADD_BUILTIN
                          -INSTALLED_APPS += ${shell if [ -r $1/Makefile ]; then echo "$1"; fi}
                          +  INSTALLED_APPS += $(if $(wildcard $1$(DELIM)Makefile),$1,)
                           endef
                           
                           $(foreach BUILTIN, $(CONFIGURED_APPS), $(eval $(call ADD_BUILTIN,$(BUILTIN))))
                          @@ -120,8 +120,10 @@ INSTALLED_APPS += $(EXTERNAL_APPS)
                           # provided by the user (possibly as a symbolic link) to add libraries and
                           # applications to the standard build from the repository.
                           
                          -INSTALLED_APPS += ${shell if [ -r external/Makefile ]; then echo "external"; fi}
                          -SUBDIRS += ${shell if [ -r external/Makefile ]; then echo "external"; fi}
                          +EXTERNAL_DIR := $(dir $(wildcard external$(DELIM)Makefile))
                          +
                          +INSTALLED_APPS += $(EXTERNAL_DIR)
                          +SUBDIRS += $(EXTERNAL_DIR)
                           
                           # The final build target
                           
                          @@ -133,48 +135,81 @@ all: $(BIN)
                           .PHONY: $(INSTALLED_APPS) context depend clean distclean
                           
                           $(INSTALLED_APPS):
                          -	@$(MAKE) -C $@ TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)";
                          +	$(Q) $(MAKE) -C $@ TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
                           
                           $(BIN):	$(INSTALLED_APPS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $@, $${obj}); \
                          -	done ; )
                           
                           .context:
                          -	@for dir in $(INSTALLED_APPS) ; do \
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +	$(Q) for %%G in ($(INSTALLED_APPS)) do ( \
                          +		if exist %%G\.context del /f /q %%G\.context \
                          +		$(MAKE) -C %%G TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" context \
                          +	)
                          +else
                          +	$(Q) for dir in $(INSTALLED_APPS) ; do \
                           		rm -f $$dir/.context ; \
                          -		$(MAKE) -C $$dir TOPDIR="$(TOPDIR)"  APPDIR="$(APPDIR)" context ; \
                          +		$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" context ; \
                           	done
                          -	@touch $@
                          +endif
                          +	$(Q) touch $@
                           
                           context: .context
                           
                           .depend: context Makefile $(SRCS)
                          -	@for dir in $(INSTALLED_APPS) ; do \
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +	$(Q) for %%G in ($(INSTALLED_APPS)) do ( \
                          +		if exist %%G\.depend del /f /q %%G\.depend \
                          +		$(MAKE) -C %%G TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" depend \
                          +	)
                          +else
                          +	$(Q) for dir in $(INSTALLED_APPS) ; do \
                           		rm -f $$dir/.depend ; \
                          -		$(MAKE) -C $$dir TOPDIR="$(TOPDIR)"  APPDIR="$(APPDIR)" depend ; \
                          +		$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" depend ; \
                           	done
                          -	@touch $@
                          +endif
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@for dir in $(SUBDIRS) ; do \
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +	$(Q) for %%G in ($(SUBDIRS)) do ( \
                          +		$(MAKE) -C %%G clean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" \
                          +	)
                          +else
                          +	$(Q) for dir in $(SUBDIRS) ; do \
                           		$(MAKE) -C $$dir clean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"; \
                           	done
                          -	@rm -f $(BIN) *~ .*.swp *.o
                          +endif
                          +	$(call DELFILE, $(BIN))
                           	$(call CLEAN)
                           
                           distclean: # clean
                          -	@for dir in $(SUBDIRS) ; do \
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +	$(Q) for %%G in ($(SUBDIRS)) do ( \
                          +		$(MAKE) -C %%G distclean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" \
                          +	)
                          +	$(call DELFILE, .config)
                          +	$(call DELFILE, .context)
                          +	$(call DELFILE, .depend)
                          +	$(Q) ( if exist  external ( \
                          +		echo ********************************************************" \
                          +		echo * The external directory/link must be removed manually *" \
                          +		echo ********************************************************" \
                          +	)
                          +else
                          +	$(Q) for dir in $(SUBDIRS) ; do \
                           		$(MAKE) -C $$dir distclean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"; \
                           	done
                          -	@rm -f .config .context .depend
                          -	@( if [ -e external ]; then \
                          +	$(call DELFILE, .config)
                          +	$(call DELFILE, .context)
                          +	$(call DELFILE, .depend)
                          +	$(Q) ( if [ -e external ]; then \
                           		echo "********************************************************"; \
                           		echo "* The external directory/link must be removed manually *"; \
                           		echo "********************************************************"; \
                           	   fi; \
                           	) 
                          +endif
                           
                           
                          diff --git a/apps/examples/adc/Makefile b/apps/examples/adc/Makefile
                          index 6357dfc3db..69862b383d 100644
                          --- a/apps/examples/adc/Makefile
                          +++ b/apps/examples/adc/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # apps/examples/adc/Makefile
                           #
                          -#   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
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -76,9 +80,7 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           .context:
                          @@ -90,16 +92,17 @@ endif
                           context: .context
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/examples/adc/adc_main.c b/apps/examples/adc/adc_main.c
                          index 404fba8c1f..553658fee0 100644
                          --- a/apps/examples/adc/adc_main.c
                          +++ b/apps/examples/adc/adc_main.c
                          @@ -289,7 +289,7 @@ int adc_main(int argc, char *argv[])
                               {
                                 message("adc_main: open %s failed: %d\n", g_adcstate.devpath, errno);
                                 errval = 2;
                          -      goto errout_with_dev;
                          +      goto errout;
                               }
                           
                             /* Now loop the appropriate number of times, displaying the collected
                          @@ -357,6 +357,11 @@ int adc_main(int argc, char *argv[])
                                 }
                             }
                           
                          +  close(fd);
                          +  return OK;
                          +
                          +  /* Error exits */
                          +
                           errout_with_dev:
                             close(fd);
                           
                          diff --git a/apps/examples/buttons/Makefile b/apps/examples/buttons/Makefile
                          index 25d1ef2c2d..77c1cd67df 100644
                          --- a/apps/examples/buttons/Makefile
                          +++ b/apps/examples/buttons/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # apps/examples/buttons/Makefile
                           #
                          -#   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
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -76,9 +80,7 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           .context:
                          @@ -90,16 +92,17 @@ endif
                           context: .context
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/examples/can/Makefile b/apps/examples/can/Makefile
                          index c6dc5af84c..8924797e37 100644
                          --- a/apps/examples/can/Makefile
                          +++ b/apps/examples/can/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # apps/examples/can/Makefile
                           #
                          -#   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
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -76,9 +80,7 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           .context:
                          @@ -90,16 +92,17 @@ endif
                           context: .context
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/examples/cdcacm/Makefile b/apps/examples/cdcacm/Makefile
                          index 3fa886d561..e8d03807d8 100644
                          --- a/apps/examples/cdcacm/Makefile
                          +++ b/apps/examples/cdcacm/Makefile
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -80,9 +84,7 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           .context:
                          @@ -93,17 +95,18 @@ $(COBJS): %$(OBJEXT): %.c
                           context: .context
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                           
                          diff --git a/apps/examples/hello/Makefile b/apps/examples/hello/Makefile
                          index 1d78d723ed..560b0da358 100644
                          --- a/apps/examples/hello/Makefile
                          +++ b/apps/examples/hello/Makefile
                          @@ -54,10 +54,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -76,9 +80,7 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           .context:
                          @@ -90,16 +92,17 @@ endif
                           context: .context
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/examples/helloxx/Makefile b/apps/examples/helloxx/Makefile
                          index 8e85eab23e..062da7d588 100644
                          --- a/apps/examples/helloxx/Makefile
                          +++ b/apps/examples/helloxx/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # apps/examples/helloxx/Makefile
                           #
                          -#   Copyright (C) 2009-2011 Gregory Nutt. All rights reserved.
                          +#   Copyright (C) 2009-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                           #
                           # Redistribution and use in source and binary forms, with or without
                          @@ -50,10 +50,14 @@ CXXOBJS		= $(CXXSRCS:.cxx=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS) $(CXXSRCS)
                           OBJS		= $(AOBJS) $(COBJS) $(CXXOBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -69,7 +73,7 @@ STACKSIZE	= 2048
                           VPATH		= 
                           
                           all: .built
                          -.PHONY:	clean depend disclean chkcxx
                          +.PHONY:	clean depend distclean chkcxx
                           
                           chkcxx:
                           ifneq ($(CONFIG_HAVE_CXX),y)
                          @@ -93,9 +97,7 @@ $(CXXOBJS): %$(OBJEXT): %.cxx
                           	$(call COMPILEXX, $<, $@)
                           
                           .built: chkcxx $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           .context:
                          @@ -107,16 +109,17 @@ endif
                           context: .context
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/examples/mm/Makefile b/apps/examples/mm/Makefile
                          index 24ed4926f7..5ba7f4eec9 100644
                          --- a/apps/examples/mm/Makefile
                          +++ b/apps/examples/mm/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # apps/examples/mm/Makefile
                           #
                          -#   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
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -70,24 +74,23 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           context:
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/examples/mount/Makefile b/apps/examples/mount/Makefile
                          index 69cf970cf0..133bdfa1f5 100644
                          --- a/apps/examples/mount/Makefile
                          +++ b/apps/examples/mount/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # apps/Makefile
                           #
                          -#   Copyright (C) 2007-2008, 2010-2010 Gregory Nutt. All rights reserved.
                          +#   Copyright (C) 2007-2008, 2010-2010, 2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                           #
                           # Redistribution and use in source and binary forms, with or without
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -70,24 +74,23 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           context:
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/examples/nsh/Makefile b/apps/examples/nsh/Makefile
                          index bad40fb2e2..c7d212fc2c 100644
                          --- a/apps/examples/nsh/Makefile
                          +++ b/apps/examples/nsh/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # apps/examples/nsh/Makefile
                           #
                          -#   Copyright (C) 2007-2008, 2010-2011 Gregory Nutt. All rights reserved.
                          +#   Copyright (C) 2007-2008, 2010-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                           #
                           # Redistribution and use in source and binary forms, with or without
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -70,24 +74,23 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           context:
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/examples/null/Makefile b/apps/examples/null/Makefile
                          index 6341206007..47ec4cdafd 100644
                          --- a/apps/examples/null/Makefile
                          +++ b/apps/examples/null/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # examples/null/Makefile
                           #
                          -#   Copyright (C) 2007-2008, 2010-2011 Gregory Nutt. All rights reserved.
                          +#   Copyright (C) 2007-2008, 2010-2012 Gregory Nutt. All rights reserved.
                           #   Author: Gregory Nutt 
                           #
                           # Redistribution and use in source and binary forms, with or without
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -70,24 +74,23 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           context:
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/examples/ostest/Kconfig b/apps/examples/ostest/Kconfig
                          index 0da7e4ce34..c3fe8f21df 100644
                          --- a/apps/examples/ostest/Kconfig
                          +++ b/apps/examples/ostest/Kconfig
                          @@ -39,4 +39,31 @@ config EXAMPLES_OSTEST_NBARRIER_THREADS
                           		is 8 but a smaller number may be needed on systems without sufficient memory
                           		to start so many threads.
                           
                          +config EXAMPLES_OSTEST_RR_RANGE
                          +	int "Round-robin test - end of search range"
                          +	default 10000
                          +	range 1 32767
                          +	---help---
                          +		During round-robin scheduling test two threads are created. Each of the threads
                          +		searches for prime numbers in the configurable range, doing that configurable
                          +		number of times.
                          +
                          +		This value specifies the end of search range and together with number of runs
                          +		allows to configure the length of this test - it should last at least a few
                          +		tens of seconds. Allowed values [1; 32767], default 10000
                          +
                          +config EXAMPLES_OSTEST_RR_RUNS
                          +	int "Round-robin test - number of runs"
                          +	default 10
                          +	range 1 32767
                          +	---help---
                          +		During round-robin scheduling test two threads are created. Each of the threads
                          +		searches for prime numbers in the configurable range, doing that configurable
                          +		number of times.
                          +
                          +		This value specifies the number of times the thread searches the range for
                          +		prime numbers and together with end of search range allows to configure the
                          +		length of this test - it should last at least a few tens of seconds. Allowed
                          +		values [1; 32767], default 10
                          +
                           endif
                          diff --git a/apps/examples/ostest/Makefile b/apps/examples/ostest/Makefile
                          index 374964b396..3e78c64e83 100644
                          --- a/apps/examples/ostest/Makefile
                          +++ b/apps/examples/ostest/Makefile
                          @@ -98,10 +98,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -120,9 +124,7 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           .context:
                          @@ -134,16 +136,17 @@ endif
                           context: .context
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/examples/ostest/roundrobin.c b/apps/examples/ostest/roundrobin.c
                          index 5167a857ed..bfd344df34 100644
                          --- a/apps/examples/ostest/roundrobin.c
                          +++ b/apps/examples/ostest/roundrobin.c
                          @@ -1,7 +1,7 @@
                           /********************************************************************************
                            * examples/ostest/roundrobin.c
                            *
                          - *   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
                          @@ -39,6 +39,7 @@
                           
                           #include 
                           #include 
                          +#include 
                           #include "ostest.h"
                           
                           #if CONFIG_RR_INTERVAL > 0
                          @@ -47,115 +48,87 @@
                            * Definitions
                            ********************************************************************************/
                           
                          -/* This number may need to be tuned for different processor speeds.  Since these
                          - * arrays must be large to very correct SCHED_RR behavior, this test may require
                          - * too much memory on many targets.
                          - */
                          +/* This numbers should be tuned for different processor speeds via .config file.
                          + * With default values the test takes about 30s on Cortex-M3 @ 24MHz. With 32767
                          + * range and 10 runs it takes ~320s. */
                           
                          -/* #define CONFIG_NINTEGERS 32768 Takes forever on 60Mhz ARM7 */
                          +#ifndef CONFIG_EXAMPLES_OSTEST_RR_RANGE
                          +#  define CONFIG_EXAMPLES_OSTEST_RR_RANGE 10000
                          +#  warning "CONFIG_EXAMPLES_OSTEST_RR_RANGE undefined, using default value = 10000"
                          +#elif (CONFIG_EXAMPLES_OSTEST_RR_RANGE < 1) || (CONFIG_EXAMPLES_OSTEST_RR_RANGE > 32767)
                          +#  define CONFIG_EXAMPLES_OSTEST_RR_RANGE 10000
                          +#  warning "Invalid value of CONFIG_EXAMPLES_OSTEST_RR_RANGE, using default value = 10000"
                          +#endif
                           
                          -#define CONFIG_NINTEGERS 2048
                          -
                          -/********************************************************************************
                          - * Private Data
                          - ********************************************************************************/
                          -
                          -static int prime1[CONFIG_NINTEGERS];
                          -static int prime2[CONFIG_NINTEGERS];
                          +#ifndef CONFIG_EXAMPLES_OSTEST_RR_RUNS
                          +#  define CONFIG_EXAMPLES_OSTEST_RR_RUNS 10
                          +#  warning "CONFIG_EXAMPLES_OSTEST_RR_RUNS undefined, using default value = 10"
                          +#elif (CONFIG_EXAMPLES_OSTEST_RR_RUNS < 1) || (CONFIG_EXAMPLES_OSTEST_RR_RUNS > 32767)
                          +#  define CONFIG_EXAMPLES_OSTEST_RR_RUNS 10
                          +#  warning "Invalid value of CONFIG_EXAMPLES_OSTEST_RR_RUNS, using default value = 10"
                          +#endif
                           
                           /********************************************************************************
                            * Private Functions
                            ********************************************************************************/
                           
                           /********************************************************************************
                          - * Name: dosieve
                          + * Name: get_primes
                            *
                            * Description
                          - *   This implements a "sieve of aristophanes" algorithm for finding prime number.
                          - *   Credit for this belongs to someone, but I am not sure who anymore.  Anyway,
                          - *   the only purpose here is that we need some algorithm that takes a long period 
                          - *   of time to execute.
                          - *
                          + *   This function searches for prime numbers in the most primitive way possible.
                            ********************************************************************************/
                           
                          -static void dosieve(int *prime)
                          +static void get_primes(int *count, int *last)
                           {
                          -  int a,d;
                          -  int i;
                          -  int j;
                          +  int number;
                          +  int local_count = 0;
                          +  *last = 0;    // to make compiler happy
                           
                          -  a = 2;
                          -  d = a;
                          +  for (number = 1; number < CONFIG_EXAMPLES_OSTEST_RR_RANGE; number++)
                          +  {
                          +    int div;
                          +    bool is_prime = true;
                           
                          -  for (i = 0; i < CONFIG_NINTEGERS; i++)
                          +    for (div = 2; div <= number / 2; div++)
                          +      if (number % div == 0)
                          +      {
                          +        is_prime = false;
                          +        break;
                          +      }
                          +
                          +    if (is_prime)
                               {
                          -      prime[i] = i+2;
                          -    }
                          -
                          -  for (i = 1; i < 10; i++)
                          -    {
                          -      for (j = 0; j < CONFIG_NINTEGERS; j++)
                          -        {
                          -          d = a + d;
                          -          if (d < CONFIG_NINTEGERS)
                          -            {
                          -              prime[d]=0;
                          -            }
                          -        }
                          -      a++;
                          -      d = a;
                          -      i++;
                          -    }
                          -
                          +      local_count++;
                          +      *last = number;
                           #if 0 /* We don't really care what the numbers are */
                          -  for (i = 0, j= 0; i < CONFIG_NINTEGERS; i++)
                          -    {
                          -      if (prime[i] != 0)
                          -       {
                          -         printf(" Prime %d: %d\n", j, prime[i]);
                          -         j++;
                          -       }
                          -    }
                          +      printf(" Prime %d: %d\n", local_count, number);
                           #endif
                          +    }
                          +  }
                          +
                          +  *count = local_count;
                           }
                           
                           /********************************************************************************
                          - * Name: sieve1
                          + * Name: get_primes_thread
                            ********************************************************************************/
                           
                          -static void *sieve1(void *parameter)
                          +static void *get_primes_thread(void *parameter)
                           {
                          -  int i;
                          +  int id = (int)parameter;
                          +  int i, count, last;
                           
                          -  printf("sieve1 started\n");
                          +  printf("get_primes_thread id=%d started, looking for primes < %d, doing %d run(s)\n",
                          +         id, CONFIG_EXAMPLES_OSTEST_RR_RANGE, CONFIG_EXAMPLES_OSTEST_RR_RUNS);
                           
                          -  for (i = 0; i < 1000; i++)
                          +  for (i = 0; i < CONFIG_EXAMPLES_OSTEST_RR_RUNS; i++)
                               {
                          -      dosieve(prime1);
                          +      get_primes(&count, &last);
                               }
                           
                          -  printf("sieve1 finished\n");
                          -
                          -  pthread_exit(NULL);
                          -  return NULL; /* To keep some compilers happy */
                          -}
                          -
                          -/********************************************************************************
                          - * Name: sieve2
                          - ********************************************************************************/
                          -
                          -static void *sieve2(void *parameter)
                          -{
                          -  int i;
                          -
                          -  printf("sieve2 started\n");
                          -
                          -  for (i = 0; i < 1000; i++)
                          -    {
                          -      dosieve(prime2);
                          -    }
                          -
                          -  printf("sieve2 finished\n");
                          +  printf("get_primes_thread id=%d finished, found %d primes, last one was %d\n",
                          +         id, count, last);
                           
                             pthread_exit(NULL);
                             return NULL; /* To keep some compilers happy */
                          @@ -171,14 +144,13 @@ static void *sieve2(void *parameter)
                           
                           void rr_test(void)
                           {
                          -  pthread_t sieve1_thread;
                          -  pthread_t sieve2_thread;
                          +  pthread_t get_primes1_thread;
                          +  pthread_t get_primes2_thread;
                             struct sched_param sparam;
                             pthread_attr_t attr;
                             pthread_addr_t result;
                             int status;
                           
                          -  printf("rr_test: Starting sieve1 thread \n");
                             status = pthread_attr_init(&attr);
                             if (status != OK)
                               {
                          @@ -203,29 +175,31 @@ void rr_test(void)
                               }
                             else
                               {
                          -      printf("rr_test: Set thread policty to SCHED_RR\n");
                          +      printf("rr_test: Set thread policy to SCHED_RR\n");
                               }
                           
                          -  status = pthread_create(&sieve1_thread, &attr, sieve1, NULL);
                          +  printf("rr_test: Starting first get_primes_thread\n");
                          +
                          +  status = pthread_create(&get_primes1_thread, &attr, get_primes_thread, (void*)1);
                             if (status != 0)
                               {
                                 printf("rr_test: Error in thread 1 creation, status=%d\n",  status);
                               }
                           
                          -  printf("rr_test: Starting sieve1 thread \n");
                          +  printf("rr_test: Starting second get_primes_thread\n");
                           
                          -  status = pthread_create(&sieve2_thread, &attr, sieve2, NULL);
                          +  status = pthread_create(&get_primes2_thread, &attr, get_primes_thread, (void*)2);
                             if (status != 0)
                               {
                                 printf("rr_test: Error in thread 2 creation, status=%d\n",  status);
                               }
                           
                          -  printf("rr_test: Waiting for sieves to complete -- this should take awhile\n");
                          +  printf("rr_test: Waiting for threads to complete -- this should take awhile\n");
                             printf("rr_test: If RR scheduling is working, they should start and complete at\n");
                             printf("rr_test: about the same time\n");
                           
                          -  pthread_join(sieve2_thread, &result);
                          -  pthread_join(sieve1_thread, &result);
                          +  pthread_join(get_primes2_thread, &result);
                          +  pthread_join(get_primes1_thread, &result);
                             printf("rr_test: Done\n");
                           }
                           
                          diff --git a/apps/examples/pipe/Makefile b/apps/examples/pipe/Makefile
                          index 956c911b34..bed3190858 100644
                          --- a/apps/examples/pipe/Makefile
                          +++ b/apps/examples/pipe/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # apps/examples/pipe/Makefile
                           #
                          -#   Copyright (C) 2008, 2010-2011 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
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -70,24 +74,23 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           context:
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/examples/poll/Makefile b/apps/examples/poll/Makefile
                          index aef61d199c..13173f1253 100644
                          --- a/apps/examples/poll/Makefile
                          +++ b/apps/examples/poll/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # apps/examples/poll/Makefile
                           #
                          -#   Copyright (C) 2008, 2010-2011 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
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -70,25 +74,25 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           context:
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           # Register application
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend host
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                          +	$(call DELFILE, host$(HOSTEXEEXT))
                           
                           -include Make.dep
                          diff --git a/apps/examples/pwm/Makefile b/apps/examples/pwm/Makefile
                          index efbdb048e0..3a6f2520a0 100644
                          --- a/apps/examples/pwm/Makefile
                          +++ b/apps/examples/pwm/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # apps/examples/pwm/Makefile
                           #
                          -#   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
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -76,9 +80,7 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           .context:
                          @@ -88,16 +90,17 @@ $(COBJS): %$(OBJEXT): %.c
                           context: .context
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/examples/pwm/pwm_main.c b/apps/examples/pwm/pwm_main.c
                          index 775bdba6b1..a46c10f55c 100644
                          --- a/apps/examples/pwm/pwm_main.c
                          +++ b/apps/examples/pwm/pwm_main.c
                          @@ -48,6 +48,7 @@
                           #include 
                           #include 
                           #include 
                          +#include 
                           
                           #include 
                           
                          diff --git a/apps/examples/qencoder/Makefile b/apps/examples/qencoder/Makefile
                          index 3f3fc9def8..7d2427c6bf 100644
                          --- a/apps/examples/qencoder/Makefile
                          +++ b/apps/examples/qencoder/Makefile
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -76,9 +80,7 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           .context:
                          @@ -90,16 +92,17 @@ endif
                           context: .context
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/examples/romfs/Makefile b/apps/examples/romfs/Makefile
                          index ba930b77d0..2b02952eda 100644
                          --- a/apps/examples/romfs/Makefile
                          +++ b/apps/examples/romfs/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # apps/examples/romfs/Makefile
                           #
                          -#   Copyright (C) 2008, 2010-2011 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
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -61,7 +65,7 @@ ROOTDEPPATH	= --dep-path .
                           VPATH		= 
                           
                           all: .built
                          -.PHONY:	checkgenromfs clean depend disclean
                          +.PHONY:	checkgenromfs clean depend distclean
                           
                           $(AOBJS): %$(OBJEXT): %.S
                           	$(call ASSEMBLE, $<, $@)
                          @@ -86,26 +90,26 @@ romfs_testdir.h : testdir.img
                           	@xxd -i $< >$@ || { echo "xxd of $< failed" ; exit 1 ; }
                           
                           .built: romfs_testdir.h $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           context:
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           # Register application
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend testdir.img
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                          +	$(call DELFILE, testdir.img)
                           
                           -include Make.dep
                           
                          diff --git a/apps/examples/serloop/Makefile b/apps/examples/serloop/Makefile
                          index e1c415cdd8..4a262884bb 100644
                          --- a/apps/examples/serloop/Makefile
                          +++ b/apps/examples/serloop/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # apps/examples/serloop/Makefile
                           #
                          -#   Copyright (C) 2008, 2010-2011 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
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -70,26 +74,25 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           context:
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           # Register application
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                           
                          diff --git a/apps/examples/watchdog/Makefile b/apps/examples/watchdog/Makefile
                          index d2739dbb0a..9890959fb5 100644
                          --- a/apps/examples/watchdog/Makefile
                          +++ b/apps/examples/watchdog/Makefile
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -76,9 +80,7 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           .context:
                          @@ -88,16 +90,17 @@ $(COBJS): %$(OBJEXT): %.c
                           context: .context
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/interpreters/Makefile b/apps/interpreters/Makefile
                          index 5901fc8309..867d45f996 100644
                          --- a/apps/interpreters/Makefile
                          +++ b/apps/interpreters/Makefile
                          @@ -33,7 +33,7 @@
                           #
                           ############################################################################
                           
                          --include $(TOPDIR)/.config	# Current configuration
                          +-include $(TOPDIR)/.config
                           
                           # Sub-directories containing interpreter runtime
                           
                          @@ -41,30 +41,36 @@ SUBDIRS = pcode ficl
                           
                           # Create the list of installed runtime modules (INSTALLED_DIRS)
                           
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +define ADD_DIRECTORY
                          +INSTALLED_DIRS  += ${shell if exist $1\Makefile (echo $1)}
                          +endef
                          +else
                           define ADD_DIRECTORY
                           INSTALLED_DIRS  += ${shell if [ -r $1/Makefile ]; then echo "$1"; fi}
                           endef
                          +endif
                           
                           $(foreach DIR, $(SUBDIRS), $(eval $(call ADD_DIRECTORY,$(DIR))))
                           
                           all: nothing
                           .PHONY: nothing context depend clean distclean
                           
                          +define SDIR_template
                          +$(1)_$(2):
                          +	$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
                          +endef
                          +
                          +$(foreach SDIR, $(INSTALLED_DIRS), $(eval $(call SDIR_template,$(SDIR),depend)))
                          +$(foreach SDIR, $(INSTALLED_DIRS), $(eval $(call SDIR_template,$(SDIR),clean)))
                          +$(foreach SDIR, $(INSTALLED_DIRS), $(eval $(call SDIR_template,$(SDIR),distclean)))
                          +
                           nothing:
                           
                           context:
                           
                          -depend:
                          -	@for dir in $(INSTALLED_DIRS) ; do \
                          -		$(MAKE) -C $$dir depend TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"; \
                          -	done
                          +depend: $(foreach SDIR, $(INSTALLED_DIRS), $(SDIR)_depend)
                           
                          -clean:
                          -	@for dir in $(INSTALLED_DIRS) ; do \
                          -		$(MAKE) -C $$dir clean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"; \
                          -	done
                          +clean: $(foreach SDIR, $(INSTALLED_DIRS), $(SDIR)_clean)
                           
                          -distclean: clean
                          -	@for dir in $(INSTALLED_DIRS) ; do \
                          -		$(MAKE) -C $$dir distclean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"; \
                          -	done
                          +distclean: clean $(foreach SDIR, $(INSTALLED_DIRS), $(SDIR)_distclean)
                          diff --git a/apps/interpreters/ficl/Makefile b/apps/interpreters/ficl/Makefile
                          index fb953964e1..990630fb89 100644
                          --- a/apps/interpreters/ficl/Makefile
                          +++ b/apps/interpreters/ficl/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # apps/interpreters/ficl/Makefile
                           #
                          -#   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
                          @@ -35,14 +35,11 @@
                           
                           BUILDDIR := ${shell pwd | sed -e 's/ /\\ /g'}
                           
                          --include $(TOPDIR)/.config
                           -include $(TOPDIR)/Make.defs
                           include $(APPDIR)/Make.defs
                           
                           # Tools
                           
                          -INCDIR = $(TOPDIR)/tools/incdir.sh
                          -
                           ifeq ($(WINTOOL),y)
                           INCDIROPT = -w
                           endif
                          @@ -69,10 +66,14 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
                           SRCS = $(ASRCS) $(CSRCS)
                           OBJS = $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOT_DEPPATH = --dep-path .
                          @@ -95,24 +96,24 @@ debug:
                           	@#echo "CFLAGS: $(CFLAGS)"
                           
                           .built: debug $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          -	@touch .built
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                          +	$(Q) touch .built
                           
                           context:
                           
                           .depend: debug Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOT_DEPPATH) $(SRC_DEPPATH) $(FICL_DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          -	@touch $@
                          +	$(Q) $(MKDEP) $(ROOT_DEPPATH) $(SRC_DEPPATH) $(FICL_DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .context)
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/namedapp/Makefile b/apps/namedapp/Makefile
                          index 6b0fd6a053..a88c735674 100644
                          --- a/apps/namedapp/Makefile
                          +++ b/apps/namedapp/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # apps/nshlib/Makefile
                           #
                          -#   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
                          @@ -54,10 +54,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -75,32 +79,32 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          -	@touch .built
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                          +	$(Q) touch .built
                           
                           .context:
                           	@echo "/* List of application requirements, generated during make context. */" > namedapp_list.h
                           	@echo "/* List of application entry points, generated during make context. */" > namedapp_proto.h
                          -	@touch $@
                          +	$(Q) touch $@
                           
                           context: .context
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          -	@touch $@
                          +	$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f .context Make.dep .depend
                          -	@rm -f namedapp_list.h
                          -	@rm -f namedapp_proto.h
                          +	$(call DELFILE, .context)
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                          +	$(call DELFILE, namedapp_list.h)
                          +	$(call DELFILE, namedapp_proto.h)
                           
                           -include Make.dep
                           
                          diff --git a/apps/nshlib/Kconfig b/apps/nshlib/Kconfig
                          index d12a329738..17b107b8f5 100644
                          --- a/apps/nshlib/Kconfig
                          +++ b/apps/nshlib/Kconfig
                          @@ -23,122 +23,194 @@ config NSH_BUILTIN_APPS
                           		(NAMEDAPP).
                           
                           menu "Disable Individual commands"
                          +
                          +config NSH_DISABLE_BASE64DEC
                          +	bool "Disable base64dec"
                          +	default n
                          +	depends on NETUTILS_CODECS && CODECS_BASE64
                          +
                          +config NSH_DISABLE_BASE64ENC
                          +	bool "Disable base64enc"
                          +	default n
                          +	depends on NETUTILS_CODECS && CODECS_BASE64
                          +
                           config NSH_DISABLE_CAT
                           	bool "Disable cat"
                           	default n
                          +
                           config NSH_DISABLE_CD
                           	bool "Disable cd"
                           	default n
                          +
                           config NSH_DISABLE_CP
                           	bool "Disable cp"
                           	default n
                          +
                           config NSH_DISABLE_DD
                           	bool "Disable dd"
                           	default n
                          +
                           config NSH_DISABLE_ECHO
                           	bool "Disable echo"
                           	default n
                          +
                           config NSH_DISABLE_EXEC
                           	bool "Disable exec"
                           	default n
                          +
                           config NSH_DISABLE_EXIT
                           	bool "Disable exit"
                           	default n
                          +
                           config NSH_DISABLE_FREE
                           	bool "Disable free"
                           	default n
                          +
                           config NSH_DISABLE_GET
                           	bool "Disable get"
                           	default n
                          +
                           config NSH_DISABLE_HELP
                           	bool "Disable help"
                           	default n
                          +
                          +config NSH_DISABLE_HEXDUMP
                          +	bool "Disable hexdump"
                          +	default n
                          +
                           config NSH_DISABLE_IFCONFIG
                           	bool "Disable ifconfig"
                           	default n
                          +
                           config NSH_DISABLE_KILL
                           	bool "Disable kill"
                           	default n
                          +
                           config NSH_DISABLE_LOSETUP
                           	bool "Disable losetup"
                           	default n
                          +
                           config NSH_DISABLE_LS
                           	bool "Disable ls"
                           	default n
                          +
                           config NSH_DISABLE_MB
                           	bool "Disable mb"
                           	default n
                          +
                          +config NSH_DISABLE_MD5
                          +	bool "Disable md5"
                          +	default n
                          +	depends on NETUTILS_CODECS && CODECS_HASH_MD5
                          +
                           config NSH_DISABLE_MKDIR
                           	bool "Disable mkdir"
                           	default n
                          +
                           config NSH_DISABLE_MKFATFS
                           	bool "Disable mkfatfs"
                           	default n
                          +
                           config NSH_DISABLE_MKFIFO
                           	bool "Disable mkfifo"
                           	default n
                          +
                           config NSH_DISABLE_MKRD
                           	bool "Disable mkrd"
                           	default n
                          +
                           config NSH_DISABLE_MH
                           	bool "Disable mh"
                           	default n
                          +
                           config NSH_DISABLE_MOUNT
                           	bool "Disable mount"
                           	default n
                          +
                           config NSH_DISABLE_MW
                           	bool "Disable mw"
                           	default n
                          +
                           config NSH_DISABLE_NSFMOUNT
                           	bool "Disable nfsmount"
                           	default n
                          +
                           config NSH_DISABLE_PS
                           	bool "Disable ps"
                           	default n
                          +
                           config NSH_DISABLE_PING
                           	bool "Disable ping"
                           	default n
                          +
                           config NSH_DISABLE_PUT
                           	bool "Disable put"
                           	default n
                          +
                           config NSH_DISABLE_PWD
                           	bool "Disable pwd"
                           	default n
                          +
                           config NSH_DISABLE_RM
                           	bool "Disable rm"
                           	default n
                          +
                           config NSH_DISABLE_RMDIR
                           	bool "Disable rmdir"
                           	default n
                          +
                           config NSH_DISABLE_SET
                           	bool "Disable set"
                           	default n
                          +
                           config NSH_DISABLE_SH
                           	bool "Disable sh"
                           	default n
                          +
                           config NSH_DISABLE_SLEEP
                           	bool "Disable sleep"
                           	default n
                          +
                           config NSH_DISABLE_TEST
                           	bool "Disable test"
                           	default n
                          +
                           config NSH_DISABLE_UMOUNT
                           	bool "Disable umount"
                           	default n
                          +
                           config NSH_DISABLE_UNSET
                           	bool "Disable unset"
                           	default n
                          +
                          +config NSH_DISABLE_URLDECODE
                          +	bool "Disable urldecode"
                          +	default n
                          +	depends on NETUTILS_CODECS && CODECS_URLCODE
                          +
                          +config NSH_DISABLE_URLENCODE
                          +	bool "Disable urlencode"
                          +	default n
                          +	depends on NETUTILS_CODECS && CODECS_URLCODE
                          +
                           config NSH_DISABLE_USLEEP
                           	bool "Disable usleep"
                           	default n
                          +
                           config NSH_DISABLE_WGET
                           	bool "Disable wget"
                           	default n
                          +
                           config NSH_DISABLE_XD
                           	bool "Disable xd"
                           	default n
                          +
                           endmenu
                           
                          +config NSH_CODECS_BUFSIZE
                          +	int "File buffer size used by CODEC commands"
                          +	default 128
                          +
                           config NSH_FILEIOSIZE
                           	int "NSH I/O buffer size"
                           	default 1024
                          @@ -490,7 +562,7 @@ config NSH_DHCPC
                           
                           config NSH_IPADDR
                           	hex "Target IP address"
                          -	default 0x10000002
                          +	default 0xa0000002
                           	depends on NSH_LIBRARY && NET && !NSH_DHCPC
                           	---help---
                           		If NSH_DHCPC is NOT set, then the static IP address must be provided.
                          @@ -499,7 +571,7 @@ config NSH_IPADDR
                           
                           config NSH_DRIPADDR
                           	hex "Router IP address"
                          -	default 0x10000001
                          +	default 0xa0000001
                           	depends on NSH_LIBRARY && NET && !NSH_DHCPC
                           	---help---
                           		Default router IP address (aka, Gateway).  This is a 32-bit integer
                          @@ -513,6 +585,21 @@ config NSH_NETMASK
                           		Network mask.  This is a 32-bit integer value in host order.  So, as
                           		an example, 0xffffff00 would be 255.255.255.0.
                           
                          +config NSH_DNS
                          +	bool "Use DNS"
                          +	default n
                          +	depends on NSH_LIBRARY && NET && NET_UDP && NET_BROADCAST
                          +	---help---
                          +		Configure to use a DNS.
                          +
                          +config NSH_DNSIPADDR
                          +	hex "DNS IP address"
                          +	default 0xa0000001
                          +	depends on NSH_DNS
                          +	---help---
                          +		Configure the DNS address.  This is a 32-bit integer value in host
                          +		order.  So, as an example, 0xa0000001 would be 10.0.0.1.
                          +
                           config NSH_NOMAC
                           	bool "Hardware has no MAC address"
                           	default n
                          @@ -520,3 +607,12 @@ config NSH_NOMAC
                           	---help---
                           		Set if your ethernet hardware has no built-in MAC address.
                           		If set, a bogus MAC will be assigned.
                          +
                          +config NSH_MAX_ROUNDTRIP
                          +	int "Max Ping Round-Trip (DSEC)"
                          +	default 20
                          +	depends on NSH_LIBRARY && NET && !NSH_DISABLE_PING
                          +	---help---
                          +		This is the maximum round trip for a response to a ICMP ECHO request.
                          +		It is in units of deciseconds.  The default is 20 (2 seconds).
                          +
                          diff --git a/apps/nshlib/Makefile b/apps/nshlib/Makefile
                          index f616374bfd..73325e899d 100644
                          --- a/apps/nshlib/Makefile
                          +++ b/apps/nshlib/Makefile
                          @@ -39,64 +39,72 @@ include $(APPDIR)/Make.defs
                           
                           # NSH Library
                           
                          -ASRCS	=
                          -CSRCS	= nsh_init.c nsh_parse.c nsh_console.c nsh_fscmds.c nsh_ddcmd.c \
                          +ASRCS =
                          +CSRCS = nsh_init.c nsh_parse.c nsh_console.c nsh_fscmds.c nsh_ddcmd.c \
                           		nsh_proccmds.c nsh_mmcmds.c nsh_envcmds.c nsh_dbgcmds.c
                           
                           ifeq ($(CONFIG_NSH_BUILTIN_APPS),y)
                          -CSRCS	+= nsh_apps.c
                          +CSRCS += nsh_apps.c
                           endif
                           
                           ifeq ($(CONFIG_NSH_ROMFSETC),y)
                          -CSRCS	+= nsh_romfsetc.c
                          +CSRCS += nsh_romfsetc.c
                           endif
                           
                           ifeq ($(CONFIG_NET),y)
                          -CSRCS	+= nsh_netinit.c nsh_netcmds.c
                          +CSRCS += nsh_netinit.c nsh_netcmds.c
                           endif
                           
                           ifeq ($(CONFIG_RTC),y)
                          -CSRCS	+= nsh_timcmds.c
                          +CSRCS += nsh_timcmds.c
                           endif
                           
                           ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
                          -CSRCS	+= nsh_mntcmds.c
                          +CSRCS += nsh_mntcmds.c
                           endif
                           
                           ifeq ($(CONFIG_NSH_CONSOLE),y)
                          -CSRCS	+= nsh_consolemain.c
                          +CSRCS += nsh_consolemain.c
                           endif
                           
                           ifeq ($(CONFIG_NSH_TELNET),y)
                          -CSRCS	+= nsh_telnetd.c
                          +CSRCS += nsh_telnetd.c
                           endif
                           
                           ifneq ($(CONFIG_NSH_DISABLESCRIPT),y)
                          -CSRCS	+= nsh_test.c
                          +CSRCS += nsh_test.c
                           endif
                           
                           ifeq ($(CONFIG_USBDEV),y)
                          -CSRCS	+= nsh_usbdev.c
                          +CSRCS += nsh_usbdev.c
                           endif
                           
                          -AOBJS		= $(ASRCS:.S=$(OBJEXT))
                          -COBJS		= $(CSRCS:.c=$(OBJEXT))
                          +ifeq ($(CONFIG_NETUTILS_CODECS),y)
                          +CSRCS += nsh_codeccmd.c
                          +endif
                           
                          -SRCS		= $(ASRCS) $(CSRCS)
                          -OBJS		= $(AOBJS) $(COBJS)
                          +AOBJS = $(ASRCS:.S=$(OBJEXT))
                          +COBJS = $(CSRCS:.c=$(OBJEXT))
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +SRCS = $(ASRCS) $(CSRCS)
                          +OBJS = $(AOBJS) $(COBJS)
                          +
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../libapps$(LIBEXT)
                          +endif
                           endif
                           
                          -ROOTDEPPATH	= --dep-path .
                          -VPATH		= 
                          +ROOTDEPPATH = --dep-path .
                          +VPATH = 
                           
                           # Build targets
                           
                          -all:	.built
                          +all: .built
                           .PHONY: context .depend depend clean distclean
                           
                           $(AOBJS): %$(OBJEXT): %.S
                          @@ -106,26 +114,25 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                           	@touch .built
                           
                           context:
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) \
                          -	  $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	@$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                           	@touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, .context)
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                           
                          diff --git a/apps/nshlib/nsh_dbgcmds.c b/apps/nshlib/nsh_dbgcmds.c
                          index eb081fe9f9..85a4ccb9c2 100644
                          --- a/apps/nshlib/nsh_dbgcmds.c
                          +++ b/apps/nshlib/nsh_dbgcmds.c
                          @@ -46,6 +46,10 @@
                           #include 
                           #include 
                           
                          +#if CONFIG_NFILE_DESCRIPTORS > 0
                          +# include 
                          +#endif
                          +
                           #include "nsh.h"
                           #include "nsh_console.h"
                           
                          @@ -328,7 +332,7 @@ void nsh_dumpbuffer(FAR struct nsh_vtbl_s *vtbl, const char *msg,
                           }
                           
                           /****************************************************************************
                          - * Name: cmd_xd
                          + * Name: cmd_xd, hex dump of memory
                            ****************************************************************************/
                           
                           #ifndef CONFIG_NSH_DISABLE_XD
                          @@ -354,3 +358,58 @@ int cmd_xd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
                             return OK;
                           }
                           #endif
                          +
                          +/****************************************************************************
                          + * Name: cmd_hexdump, hex dump of files
                          + ****************************************************************************/
                          +
                          +#if CONFIG_NFILE_DESCRIPTORS > 0
                          +#ifndef CONFIG_NSH_DISABLE_HEXDUMP
                          +int cmd_hexdump(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
                          +{
                          +  uint8_t buffer[IOBUFFERSIZE];
                          +  char msg[32];
                          +  int position;
                          +  int fd;
                          +  int ret = OK;
                          +  
                          +  /* Open the file for reading */
                          +
                          +  fd = open(argv[1], O_RDONLY);
                          +  if (fd < 0)
                          +    {
                          +      nsh_output(vtbl, g_fmtcmdfailed, "hexdump", "open", NSH_ERRNO);
                          +      return ERROR;
                          +    }
                          +  
                          +  position = 0;
                          +  for (;;)
                          +  {
                          +    int nbytesread = read(fd, buffer, IOBUFFERSIZE);
                          +
                          +    /* Check for read errors */
                          +
                          +    if (nbytesread < 0)
                          +      {
                          +        int errval = errno;
                          +        nsh_output(vtbl, g_fmtcmdfailed, "hexdump", "read", NSH_ERRNO_OF(errval));
                          +        ret = ERROR;
                          +        break;
                          +      }
                          +    else if (nbytesread > 0)
                          +      {
                          +        snprintf(msg, sizeof(msg), "%s at %08x", argv[1], position);
                          +        nsh_dumpbuffer(vtbl, msg, buffer, nbytesread);
                          +        position += nbytesread;
                          +      }
                          +    else
                          +      {
                          +        break; // EOF
                          +      }
                          +  }
                          +  
                          +  (void)close(fd);
                          +  return ret;
                          +}
                          +#endif
                          +#endif
                          diff --git a/apps/nshlib/nsh_netinit.c b/apps/nshlib/nsh_netinit.c
                          index c95bf4c405..58d2383126 100644
                          --- a/apps/nshlib/nsh_netinit.c
                          +++ b/apps/nshlib/nsh_netinit.c
                          @@ -47,7 +47,7 @@
                           #include 
                           
                           #include 
                          -#if defined(CONFIG_NSH_DHCPC)
                          +#if defined(CONFIG_NSH_DHCPC) || defined(CONFIG_NSH_DNS)
                           #  include 
                           #  include 
                           #endif
                          @@ -60,6 +60,10 @@
                            * Definitions
                            ****************************************************************************/
                           
                          +#if defined(CONFIG_NSH_DRIPADDR) && !defined(CONFIG_NSH_DNSIPADDR)
                          +#  define CONFIG_NSH_DNSIPADDR CONFIG_NSH_DRIPADDR
                          +#endif
                          +
                           /****************************************************************************
                            * Private Types
                            ****************************************************************************/
                          @@ -125,10 +129,14 @@ int nsh_netinit(void)
                             addr.s_addr = HTONL(CONFIG_NSH_NETMASK);
                             uip_setnetmask("eth0", &addr);
                           
                          -#if defined(CONFIG_NSH_DHCPC)
                          +#if defined(CONFIG_NSH_DHCPC) || defined(CONFIG_NSH_DNS)
                             /* Set up the resolver */
                           
                             resolv_init();
                          +#if defined(CONFIG_NSH_DNS)
                          +  addr.s_addr = HTONL(CONFIG_NSH_DNSIPADDR);
                          +  resolv_conf(&addr);
                          +#endif
                           #endif
                           
                           #if defined(CONFIG_NSH_DHCPC)
                          diff --git a/apps/system/Makefile b/apps/system/Makefile
                          index d64bb54c6e..9955a6b2ce 100644
                          --- a/apps/system/Makefile
                          +++ b/apps/system/Makefile
                          @@ -41,31 +41,36 @@ SUBDIRS = free i2c install readline poweroff ramtron sdcard sysinfo
                           
                           # Create the list of installed runtime modules (INSTALLED_DIRS)
                           
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                           define ADD_DIRECTORY
                          -INSTALLED_DIRS  += ${shell if [ -r $1/Makefile ]; then echo "$1"; fi}
                          +  INSTALLED_DIRS  += $(if $(wildcard .\$1\Makefile),$1,)
                           endef
                          +else
                          +define ADD_DIRECTORY
                          +  INSTALLED_DIRS  += $(if $(wildcard ./$1/Makefile),$1,)
                          +endef
                          +endif
                           
                           $(foreach DIR, $(SUBDIRS), $(eval $(call ADD_DIRECTORY,$(DIR))))
                           
                           all: nothing
                           .PHONY: nothing context depend clean distclean
                           
                          +define SDIR_template
                          +$(1)_$(2):
                          +	$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
                          +endef
                          +
                          +$(foreach SDIR, $(INSTALLED_DIRS), $(eval $(call SDIR_template,$(SDIR),depend)))
                          +$(foreach SDIR, $(INSTALLED_DIRS), $(eval $(call SDIR_template,$(SDIR),clean)))
                          +$(foreach SDIR, $(INSTALLED_DIRS), $(eval $(call SDIR_template,$(SDIR),distclean)))
                          +
                           nothing:
                           
                           context:
                           
                          -depend:
                          -	@for dir in $(INSTALLED_DIRS) ; do \
                          -		$(MAKE) -C $$dir depend TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"; \
                          -	done
                          +depend: $(foreach SDIR, $(INSTALLED_DIRS), $(SDIR)_depend)
                           
                          -clean:
                          -	@for dir in $(INSTALLED_DIRS) ; do \
                          -		$(MAKE) -C $$dir clean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"; \
                          -	done
                          -
                          -distclean: clean
                          -	@for dir in $(INSTALLED_DIRS) ; do \
                          -		$(MAKE) -C $$dir distclean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"; \
                          -	done
                          +clean: $(foreach SDIR, $(INSTALLED_DIRS), $(SDIR)_clean)
                           
                          +distclean: clean $(foreach SDIR, $(INSTALLED_DIRS), $(SDIR)_distclean)
                          diff --git a/apps/system/free/Makefile b/apps/system/free/Makefile
                          index 7f911d81cc..dada00d992 100644
                          --- a/apps/system/free/Makefile
                          +++ b/apps/system/free/Makefile
                          @@ -1,7 +1,7 @@
                           ############################################################################
                           # apps/system/free/Makefile
                           #
                          -#   Copyright (C) 2011 Uros Platise. All rights reserved.
                          +#   Copyright (C) 2011-2012 Uros Platise. All rights reserved.
                           #   Author: Uros Platise 
                           #           Gregory Nutt 
                           #
                          @@ -61,10 +61,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -83,32 +87,32 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          -	@touch .built
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                          +	$(Q) touch .built
                           
                           # Register application
                           
                           .context:
                           	$(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main)
                          -	@touch $@
                          +	$(Q) touch $@
                           
                           context: .context
                           
                           # Create dependencies
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          -	@touch $@
                          +	$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f .context Make.dep .depend
                          +	$(call DELFILE, .context)
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/system/i2c/Makefile b/apps/system/i2c/Makefile
                          index 00db91bb70..029d2b6fe4 100644
                          --- a/apps/system/i2c/Makefile
                          +++ b/apps/system/i2c/Makefile
                          @@ -48,10 +48,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -73,30 +77,29 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          -	@touch .built
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                          +	$(Q) touch .built
                           
                           .context:
                           	$(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main)
                          -	@touch $@
                          +	$(Q) touch $@
                           
                           context: .context
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) \
                          -	  $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          -	@touch $@
                          +	$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f Make.dep .depend
                          +	$(call DELFILE, .context)
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                           
                          diff --git a/apps/system/install/Makefile b/apps/system/install/Makefile
                          index 71d82f34ce..6a02d859ff 100644
                          --- a/apps/system/install/Makefile
                          +++ b/apps/system/install/Makefile
                          @@ -2,6 +2,7 @@
                           # apps/system/install/Makefile
                           #
                           #   Copyright (C) 2011 Uros Platise. All rights reserved.
                          +#   Copyright (C) 2012 Gregory Nutt. All rights reserved.
                           #   Author: Uros Platise 
                           #           Gregory Nutt 
                           #
                          @@ -61,10 +62,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -83,32 +88,32 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          -	@touch .built
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                          +	$(Q) touch .built
                           
                           # Register application
                           
                           .context:
                           	$(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main)
                          -	@touch $@
                          +	$(Q) touch $@
                           
                           context: .context
                           
                           # Create dependencies
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          -	@touch $@
                          +	$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f .context Make.dep .depend
                          +	$(call DELFILE, .context)
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          diff --git a/apps/system/readline/Makefile b/apps/system/readline/Makefile
                          index 34fab7e810..3a48d324e7 100644
                          --- a/apps/system/readline/Makefile
                          +++ b/apps/system/readline/Makefile
                          @@ -52,10 +52,14 @@ COBJS		= $(CSRCS:.c=$(OBJEXT))
                           SRCS		= $(ASRCS) $(CSRCS)
                           OBJS		= $(AOBJS) $(COBJS)
                           
                          -ifeq ($(WINTOOL),y)
                          -  BIN		= "${shell cygpath -w  $(APPDIR)/libapps$(LIBEXT)}"
                          +ifeq ($(CONFIG_WINDOWS_NATIVE),y)
                          +  BIN		= ..\..\libapps$(LIBEXT)
                           else
                          -  BIN		= "$(APPDIR)/libapps$(LIBEXT)"
                          +ifeq ($(WINTOOL),y)
                          +  BIN		= ..\\..\\libapps$(LIBEXT)
                          +else
                          +  BIN		= ../../libapps$(LIBEXT)
                          +endif
                           endif
                           
                           ROOTDEPPATH	= --dep-path .
                          @@ -74,10 +78,8 @@ $(COBJS): %$(OBJEXT): %.c
                           	$(call COMPILE, $<, $@)
                           
                           .built: $(OBJS)
                          -	@( for obj in $(OBJS) ; do \
                          -		$(call ARCHIVE, $(BIN), $${obj}); \
                          -	done ; )
                          -	@touch .built
                          +	$(call ARCHIVE, $(BIN), $(OBJS))
                          +	$(Q) touch .built
                           
                           # Context build phase target
                           
                          @@ -86,18 +88,20 @@ context:
                           # Dependency build phase target
                           
                           .depend: Makefile $(SRCS)
                          -	@$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
                          -	@touch $@
                          +	$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
                          +	$(Q) touch $@
                           
                           depend: .depend
                           
                           # Housekeeping targets
                           
                           clean:
                          -	@rm -f *.o *~ .*.swp .built
                          +	$(call DELFILE, .built)
                           	$(call CLEAN)
                           
                           distclean: clean
                          -	@rm -f .context Make.dep .depend
                          +	$(call DELFILE, .context)
                          +	$(call DELFILE, Make.dep)
                          +	$(call DELFILE, .depend)
                           
                           -include Make.dep
                          
                          From fbf4c442307f29bee4c15eb5d656ae167141bee1 Mon Sep 17 00:00:00 2001
                          From: px4dev 
                          Date: Fri, 11 Jan 2013 02:32:29 -0800
                          Subject: [PATCH 072/157] Fix a compile error in the i2c reset code.
                          
                          ---
                           nuttx/arch/arm/src/stm32/stm32_i2c.c | 4 ++--
                           1 file changed, 2 insertions(+), 2 deletions(-)
                          
                          diff --git a/nuttx/arch/arm/src/stm32/stm32_i2c.c b/nuttx/arch/arm/src/stm32/stm32_i2c.c
                          index c44a823dbb..fd682cd5d0 100644
                          --- a/nuttx/arch/arm/src/stm32/stm32_i2c.c
                          +++ b/nuttx/arch/arm/src/stm32/stm32_i2c.c
                          @@ -1982,8 +1982,8 @@ int up_i2creset(FAR struct i2c_dev_s * dev)
                             struct stm32_i2c_priv_s * priv;
                             unsigned int clock_count;
                             unsigned int stretch_count;
                          -  unit32_ scl_gpio;
                          -  unit32_ sda_gpio;
                          +  uint32_t scl_gpio;
                          +  uint32_t sda_gpio;
                             int ret = ERROR;
                             irqstate_t state;
                           
                          
                          From 41987c7848a7bbf8b0735e3b2905b15e609b8ac0 Mon Sep 17 00:00:00 2001
                          From: px4dev 
                          Date: Fri, 11 Jan 2013 02:33:02 -0800
                          Subject: [PATCH 073/157] Recover fix for and enabling of interrupt-driven I2C.
                          
                          ---
                           nuttx/configs/px4fmu/nsh/defconfig | 2 +-
                           nuttx/sched/clock_time2ticks.c     | 2 +-
                           2 files changed, 2 insertions(+), 2 deletions(-)
                          
                          diff --git a/nuttx/configs/px4fmu/nsh/defconfig b/nuttx/configs/px4fmu/nsh/defconfig
                          index 9555e43ecd..8a76f0e052 100755
                          --- a/nuttx/configs/px4fmu/nsh/defconfig
                          +++ b/nuttx/configs/px4fmu/nsh/defconfig
                          @@ -352,7 +352,7 @@ CONFIG_CAN2_BAUD=700000
                           # I2C configuration
                           #
                           CONFIG_I2C=y
                          -CONFIG_I2C_POLLED=y
                          +#CONFIG_I2C_POLLED=y
                           CONFIG_I2C_TRANSFER=y
                           CONFIG_I2C_TRACE=n
                           CONFIG_I2C_RESET=y
                          diff --git a/nuttx/sched/clock_time2ticks.c b/nuttx/sched/clock_time2ticks.c
                          index 383264d513..9265872bb6 100644
                          --- a/nuttx/sched/clock_time2ticks.c
                          +++ b/nuttx/sched/clock_time2ticks.c
                          @@ -97,6 +97,6 @@ int clock_time2ticks(FAR const struct timespec *reltime, FAR int *ticks)
                           
                             /* Convert microseconds to clock ticks */
                           
                          -  *ticks = relusec / USEC_PER_TICK;
                          +  *ticks = (relusec + USEC_PER_TICK - 1) / USEC_PER_TICK;
                             return OK;
                           }
                          
                          From 2b37f33a221966628152144ddf050f731f8106d1 Mon Sep 17 00:00:00 2001
                          From: px4dev 
                          Date: Fri, 11 Jan 2013 02:39:56 -0800
                          Subject: [PATCH 074/157] The tests structure doesn't need to be writable.
                          
                          ---
                           apps/px4/tests/tests_main.c | 2 +-
                           1 file changed, 1 insertion(+), 1 deletion(-)
                          
                          diff --git a/apps/px4/tests/tests_main.c b/apps/px4/tests/tests_main.c
                          index 26f7ef96bf..d994645466 100644
                          --- a/apps/px4/tests/tests_main.c
                          +++ b/apps/px4/tests/tests_main.c
                          @@ -78,7 +78,7 @@ static int test_jig(int argc, char *argv[]);
                            * Private Data
                            ****************************************************************************/
                           
                          -struct {
                          +const struct {
                           	const char 	*name;
                           	int	(* fn)(int argc, char *argv[]);
                           	unsigned	options;
                          
                          From b5d3d8e436b5ba6415198b6ecd60185dceeccb18 Mon Sep 17 00:00:00 2001
                          From: px4dev 
                          Date: Fri, 11 Jan 2013 02:43:22 -0800
                          Subject: [PATCH 075/157] We can ignore this too.
                          
                          ---
                           .gitignore | 1 +
                           1 file changed, 1 insertion(+)
                          
                          diff --git a/.gitignore b/.gitignore
                          index d0d84b9854..ec6d08be3b 100644
                          --- a/.gitignore
                          +++ b/.gitignore
                          @@ -42,3 +42,4 @@ cscope.out
                           .configX-e
                           nuttx-export.zip
                           dot.gdbinit
                          +mkdeps
                          
                          From 419896f983d9d5298da0e7bda6450901088c6bc4 Mon Sep 17 00:00:00 2001
                          From: Lorenz Meier 
                          Date: Fri, 11 Jan 2013 18:02:47 +0100
                          Subject: [PATCH 076/157] WP fix contributed by James Goppert
                          
                          ---
                           apps/mavlink/waypoints.h | 4 ++--
                           1 file changed, 2 insertions(+), 2 deletions(-)
                          
                          diff --git a/apps/mavlink/waypoints.h b/apps/mavlink/waypoints.h
                          index 736d1f119f..c32ab32e5a 100644
                          --- a/apps/mavlink/waypoints.h
                          +++ b/apps/mavlink/waypoints.h
                          @@ -98,8 +98,8 @@ struct mavlink_wpm_storage {
                           	uint16_t max_size;
                           	uint16_t rcv_size;
                           	enum MAVLINK_WPM_STATES current_state;
                          -	uint16_t current_wp_id;							///< Waypoint in current transmission
                          -	uint16_t current_active_wp_id;					///< Waypoint the system is currently heading towards
                          +	int16_t current_wp_id;							///< Waypoint in current transmission
                          +	int16_t current_active_wp_id;					///< Waypoint the system is currently heading towards
                           	uint16_t current_count;
                           	uint8_t current_partner_sysid;
                           	uint8_t current_partner_compid;
                          
                          From dad7f9f436e38fa1cae185156bb13c7920ae29da Mon Sep 17 00:00:00 2001
                          From: Lorenz Meier 
                          Date: Sat, 12 Jan 2013 00:38:49 +0100
                          Subject: [PATCH 077/157] Selected adjustments / fixes to make old apps
                           compatible with new-style ADC driver
                          
                          ---
                           apps/commander/commander.c               |   6 +-
                           apps/drivers/boards/px4fmu/px4fmu_init.c |   2 +-
                           apps/drivers/stm32/adc/adc.cpp           |   4 +-
                           apps/px4/tests/test_adc.c                |  94 +++---------
                           apps/px4/tests/test_jig_voltages.c       | 173 ++++++++---------------
                           apps/sensors/sensors.cpp                 | 155 +++++++++++++-------
                           6 files changed, 188 insertions(+), 246 deletions(-)
                          
                          diff --git a/apps/commander/commander.c b/apps/commander/commander.c
                          index c059484024..86f5ac106d 100644
                          --- a/apps/commander/commander.c
                          +++ b/apps/commander/commander.c
                          @@ -1319,8 +1319,8 @@ int commander_thread_main(int argc, char *argv[])
                           	uint16_t counter = 0;
                           	uint8_t flight_env;
                           
                          -	/* Initialize to 3.0V to make sure the low-pass loads below valid threshold */
                          -	float battery_voltage = 12.0f;
                          +	/* Initialize to 0.0V */
                          +	float battery_voltage = 0.0f;
                           	bool battery_voltage_valid = true;
                           	bool low_battery_voltage_actions_done = false;
                           	bool critical_battery_voltage_actions_done = false;
                          @@ -1473,8 +1473,8 @@ int commander_thread_main(int argc, char *argv[])
                           			last_local_position_time = local_position.timestamp;
                           		}
                           
                          +		/* update battery status */
                           		orb_check(battery_sub, &new_data);
                          -
                           		if (new_data) {
                           			orb_copy(ORB_ID(battery_status), battery_sub, &battery);
                           			battery_voltage = battery.voltage_v;
                          diff --git a/apps/drivers/boards/px4fmu/px4fmu_init.c b/apps/drivers/boards/px4fmu/px4fmu_init.c
                          index 2a7bfe3d73..e88d2861ea 100644
                          --- a/apps/drivers/boards/px4fmu/px4fmu_init.c
                          +++ b/apps/drivers/boards/px4fmu/px4fmu_init.c
                          @@ -226,7 +226,7 @@ __EXPORT int nsh_archinitialize(void)
                           	stm32_configgpio(GPIO_ADC1_IN10);
                           	stm32_configgpio(GPIO_ADC1_IN11);
                           	stm32_configgpio(GPIO_ADC1_IN12);
                          -	//stm32_configgpio(GPIO_ADC1_IN13);	// jumperable to MPU6000 DRDY on some boards
                          +	stm32_configgpio(GPIO_ADC1_IN13);	// jumperable to MPU6000 DRDY on some boards
                           
                           	return OK;
                           }
                          diff --git a/apps/drivers/stm32/adc/adc.cpp b/apps/drivers/stm32/adc/adc.cpp
                          index 87dac1ef91..911def9439 100644
                          --- a/apps/drivers/stm32/adc/adc.cpp
                          +++ b/apps/drivers/stm32/adc/adc.cpp
                          @@ -366,8 +366,8 @@ int
                           adc_main(int argc, char *argv[])
                           {
                           	if (g_adc == nullptr) {
                          -		/* XXX this hardcodes the minimum channel set for PX4FMU - should be configurable */
                          -		g_adc = new ADC((1 << 10) | (1 << 11));
                          +		/* XXX this hardcodes the default channel set for PX4FMU - should be configurable */
                          +		g_adc = new ADC((1 << 10) | (1 << 11) | (1 << 12) | (1 << 13));
                           
                           		if (g_adc == nullptr)
                           			errx(1, "couldn't allocate the ADC driver");
                          diff --git a/apps/px4/tests/test_adc.c b/apps/px4/tests/test_adc.c
                          index c5960e7570..4c021303f4 100644
                          --- a/apps/px4/tests/test_adc.c
                          +++ b/apps/px4/tests/test_adc.c
                          @@ -53,96 +53,40 @@
                           #include "tests.h"
                           
                           #include 
                          +#include 
                          +#include 
                           
                           int test_adc(int argc, char *argv[])
                           {
                          -	int		fd0 = 0;
                          -	int		ret = 0;
                          +	int fd = open(ADC_DEVICE_PATH, O_RDONLY);
                           
                          -	#pragma pack(push,1)
                          -	struct adc_msg4_s {
                          -		uint8_t      am_channel1;	/**< The 8-bit ADC Channel 1 */
                          -		int32_t      am_data1;		/**< ADC convert result 1 (4 bytes) */
                          -		uint8_t      am_channel2;	/**< The 8-bit ADC Channel 2 */
                          -		int32_t      am_data2;		/**< ADC convert result 2 (4 bytes) */
                          -		uint8_t      am_channel3;	/**< The 8-bit ADC Channel 3 */
                          -		int32_t      am_data3;		/**< ADC convert result 3 (4 bytes) */
                          -		uint8_t      am_channel4;	/**< The 8-bit ADC Channel 4 */
                          -		int32_t      am_data4;		/**< ADC convert result 4 (4 bytes) */
                          -	};
                          -	#pragma pack(pop)
                          +	if (fd < 0)
                          +		err(1, "can't open ADC device");
                           
                          -	struct adc_msg4_s sample1;
                          +	for (unsigned i = 0; i < 5; i++) {
                          +		/* make space for a maximum of eight channels */
                          +		struct adc_msg_s data[8];
                          +		/* read all channels available */
                          +		ssize_t count = read(fd, data, sizeof(data));
                           
                          -	ssize_t nbytes;
                          -	int j;
                          -	int errval;
                          +		if (count < 0)
                          +			goto errout_with_dev;
                           
                          -	fd0 = open("/dev/adc0", O_RDONLY | O_NONBLOCK);
                          +		unsigned channels = count / sizeof(data[0]);
                           
                          -	if (fd0 <= 0) {
                          -		message("/dev/adc0 open fail: %d\n", errno);
                          -		return ERROR;
                          -
                          -	} else {
                          -		message("opened /dev/adc0 successfully\n");
                          -	}
                          -	usleep(10000);
                          -
                          -	for (j = 0; j < 10; j++) {
                          -
                          -		/* sleep 20 milliseconds */
                          -		usleep(20000);
                          -		nbytes = read(fd0, &sample1, sizeof(sample1));
                          -
                          -		/* Handle unexpected return values */
                          -
                          -		if (nbytes < 0) {
                          -			errval = errno;
                          -
                          -			if (errval != EINTR) {
                          -				message("reading /dev/adc0 failed: %d\n", errval);
                          -				errval = 3;
                          -				goto errout_with_dev;
                          -			}
                          -
                          -			message("\tinterrupted read..\n");
                          -
                          -		} else if (nbytes == 0) {
                          -			message("\tno data read, ignoring.\n");
                          -			ret = ERROR;
                          +		for (unsigned j = 0; j < channels; j++) {
                          +			printf("%d: %u  ", data[j].am_channel, data[j].am_data);
                           		}
                           
                          -		/* Print the sample data on successful return */
                          -
                          -		else {
                          -			if (nbytes != sizeof(sample1)) {
                          -				message("\tsample 1 size %d is not matching struct size %d, ignoring\n",
                          -					nbytes, sizeof(sample1));
                          -				ret = ERROR;
                          -
                          -			} else {
                          -
                          -				message("CYCLE %d:\n", j);
                          -
                          -				message("channel: %d value: %d\n",
                          -					(int)sample1.am_channel1, sample1.am_data1);
                          -				message("channel: %d value: %d\n",
                          -					(int)sample1.am_channel2, sample1.am_data2);
                          -				message("channel: %d value: %d\n",
                          -					(int)sample1.am_channel3, sample1.am_data3);
                          -				message("channel: %d value: %d\n",
                          -					(int)sample1.am_channel4, sample1.am_data4);
                          -			}
                          -		}
                          -		fflush(stdout);
                          +		printf("\n");
                          +		usleep(150000);
                           	}
                           
                           	message("\t ADC test successful.\n");
                           
                           errout_with_dev:
                           
                          -	if (fd0 != 0) close(fd0);
                          +	if (fd != 0) close(fd);
                           
                          -	return ret;
                          +	return OK;
                           }
                          diff --git a/apps/px4/tests/test_jig_voltages.c b/apps/px4/tests/test_jig_voltages.c
                          index 51f9b9a5bd..ca6d7fb688 100644
                          --- a/apps/px4/tests/test_jig_voltages.c
                          +++ b/apps/px4/tests/test_jig_voltages.c
                          @@ -52,7 +52,8 @@
                           #include "tests.h"
                           
                           #include 
                          -
                          +#include 
                          +#include 
                           
                           /****************************************************************************
                            * Pre-processor Definitions
                          @@ -89,129 +90,79 @@
                           
                           int test_jig_voltages(int argc, char *argv[])
                           {
                          -	int		fd0 = 0;
                          -	int		ret = OK;
                          -	const int nchannels = 4;
                          +	int fd = open(ADC_DEVICE_PATH, O_RDONLY);
                          +	int ret = OK;
                           
                          -	struct adc_msg4_s
                          -	{
                          -	  uint8_t      am_channel1;               /* The 8-bit ADC Channel */
                          -	  int32_t      am_data1;                  /* ADC convert result (4 bytes) */
                          -	  uint8_t      am_channel2;               /* The 8-bit ADC Channel */
                          -	  int32_t      am_data2;                  /* ADC convert result (4 bytes) */
                          -	  uint8_t      am_channel3;               /* The 8-bit ADC Channel */
                          -	  int32_t      am_data3;                  /* ADC convert result (4 bytes) */
                          -	  uint8_t      am_channel4;               /* The 8-bit ADC Channel */
                          -	  int32_t      am_data4;                  /* ADC convert result (4 bytes) */
                          -	}__attribute__((__packed__));;
                          -
                          -	struct adc_msg4_s sample1[4];
                          -
                          -	size_t readsize;
                          -	ssize_t nbytes;
                          -	int i = 0;
                          -	int j = 0;
                          -	int errval;
                          -
                          -	char name[11];
                          -	sprintf(name, "/dev/adc%d", j);
                          -	fd0 = open(name, O_RDONLY | O_NONBLOCK);
                          -	if (fd0 < 0)
                          -	{
                          -		printf("ADC: %s open fail\n", name);
                          -		return ERROR;
                          -	} else {
                          -		printf("Opened %s successfully\n", name);
                          +	if (fd < 0) {
                          +		warnx("can't open ADC device");
                          +		return 1;
                           	}
                           
                          +	/* make space for a maximum of eight channels */
                          +	struct adc_msg_s data[8];
                          +	/* read all channels available */
                          +	ssize_t count = read(fd, data, sizeof(data));
                          +
                          +	if (count < 0) {
                          +		close(fd);
                          +		warnx("can't read from ADC driver. Forgot 'adc start' command?");
                          +		return 1;
                          +	}
                          +
                          +	unsigned channels = count / sizeof(data[0]);
                          +
                          +	for (unsigned j = 0; j < channels; j++) {
                          +		printf("%d: %u  ", data[j].am_channel, data[j].am_data);
                          +	}
                          +
                          +	printf("\n");
                          +
                          +	warnx("\t ADC operational.\n");
                           
                           	/* Expected values */
                           	int16_t expected_min[] = {2700, 2700, 2200, 2000};
                           	int16_t expected_max[] = {3000, 3000, 2500, 2200};
                          -	char* check_res[nchannels];
                          +	char *check_res[channels];
                           
                          -	/* first adc read round */
                          -	readsize = 4 * sizeof(struct adc_msg_s);
                          +	if (channels < 4) {
                          +		close(fd);
                          +		warnx("not all four test channels available, aborting.");
                          +		return 1;
                           
                          -	/* Empty all buffers */
                          -	do {
                          -		nbytes = read(fd0, sample1, readsize);
                          +	} else {
                          +		/* Check values */
                          +		check_res[0] = (expected_min[0] < data[0].am_data && expected_max[0] > data[0].am_data) ? "OK" : "FAIL";
                          +		check_res[1] = (expected_min[1] < data[1].am_data && expected_max[1] > data[1].am_data) ? "OK" : "FAIL";
                          +		check_res[2] = (expected_min[2] < data[2].am_data && expected_max[2] > data[2].am_data) ? "OK" : "FAIL";
                          +		check_res[3] = (expected_min[3] < data[3].am_data && expected_max[3] > data[3].am_data) ? "OK" : "FAIL";
                          +
                          +		/* Accumulate result */
                          +		ret += (expected_min[0] > data[0].am_data || expected_max[0] < data[0].am_data) ? 1 : 0;
                          +		ret += (expected_min[1] > data[1].am_data || expected_max[1] < data[1].am_data) ? 1 : 0;
                          +		ret += (expected_min[2] > data[2].am_data || expected_max[2] < data[2].am_data) ? 1 : 0;
                          +		ret += (expected_min[3] > data[3].am_data || expected_max[3] < data[3].am_data) ? 1 : 0;
                          +
                          +		message("Sample:");
                          +		message("channel: %d value: %d (allowed min: %d, allowed max: %d), result: %s\n",
                          +			data[0].am_channel, (int)(data[0].am_data), expected_min[0], expected_max[0], check_res[0]);
                          +		message("channel: %d value: %d (allowed min: %d, allowed max: %d), result: %s\n",
                          +			data[1].am_channel, (int)(data[1].am_data), expected_min[1], expected_max[1], check_res[1]);
                          +		message("channel: %d value: %d (allowed min: %d, allowed max: %d), result: %s\n",
                          +			data[2].am_channel, (int)(data[2].am_data), expected_min[2], expected_max[2], check_res[2]);
                          +		message("channel: %d value: %d (allowed min: %d, allowed max: %d), result: %s\n",
                          +			data[3].am_channel, (int)(data[3].am_data), expected_min[3], expected_max[3], check_res[3]);
                          +
                          +		if (ret != OK) {
                          +			printf("\t JIG voltages test FAILED. Some channels where out of allowed range. Check supply voltages.\n");
                          +			goto errout_with_dev;
                          +		}
                           	}
                          -	while (nbytes > 0);
                           
                          -	up_udelay(20000);//microseconds
                          -	/* Take measurements */
                          -	nbytes = read(fd0, sample1, readsize);
                          +	printf("\t JIG voltages test successful.\n");
                           
                          -    /* Handle unexpected return values */
                          +errout_with_dev:
                           
                          -    if (nbytes <= 0)
                          -      {
                          -        errval = errno;
                          -        if (errval != EINTR)
                          -          {
                          -            message("read %s failed: %d\n",
                          -                    name, errval);
                          -            errval = 3;
                          -            goto errout_with_dev;
                          -          }
                          -
                          -        message("\tInterrupted read...\n");
                          -      }
                          -    else if (nbytes == 0)
                          -      {
                          -        message("\tNo data read, Ignoring\n");
                          -      }
                          -
                          -    /* Print the sample data on successful return */
                          -
                          -    else
                          -    {
                          -    	int nsamples = nbytes / sizeof(struct adc_msg_s);
                          -    	if (nsamples * sizeof(struct adc_msg_s) != nbytes)
                          -    	{
                          -    		message("\tread size=%d is not a multiple of sample size=%d, Ignoring\n",
                          -    				nbytes, sizeof(struct adc_msg_s));
                          -    	}
                          -    	else
                          -    	{
                          -    		/* Check values */
                          -    		check_res[0] = (expected_min[0] < sample1[i].am_data1 && expected_max[0] > sample1[i].am_data1) ? "OK" : "FAIL";
                          -    		check_res[1] = (expected_min[1] < sample1[i].am_data2 && expected_max[1] > sample1[i].am_data2) ? "OK" : "FAIL";
                          -    		check_res[2] = (expected_min[2] < sample1[i].am_data3 && expected_max[2] > sample1[i].am_data3) ? "OK" : "FAIL";
                          -    		check_res[3] = (expected_min[3] < sample1[i].am_data4 && expected_max[3] > sample1[i].am_data4) ? "OK" : "FAIL";
                          -
                          -    		/* Accumulate result */
                          -    		ret += (expected_min[0] > sample1[i].am_data1 || expected_max[0] < sample1[i].am_data1) ? 1 : 0;
                          -    		// XXX Chan 11 not connected on test setup
                          -    		//ret += (expected_min[1] > sample1[i].am_data2 || expected_max[1] < sample1[i].am_data2) ? 1 : 0;
                          -    		ret += (expected_min[2] > sample1[i].am_data3 || expected_max[2] < sample1[i].am_data3) ? 1 : 0;
                          -    		ret += (expected_min[3] > sample1[i].am_data4 || expected_max[3] < sample1[i].am_data4) ? 1 : 0;
                          -
                          -    		message("Sample:");
                          -    		message("%d: channel: %d value: %d (allowed min: %d, allowed max: %d), result: %s\n",
                          -    					i, sample1[i].am_channel1, sample1[i].am_data1, expected_min[0], expected_max[0], check_res[0]);
                          -        	message("Sample:");
                          -    		message("%d: channel: %d value: %d (allowed min: %d, allowed max: %d), result: %s\n",
                          -						i, sample1[i].am_channel2, sample1[i].am_data2, expected_min[1], expected_max[1], check_res[1]);
                          -        	message("Sample:");
                          -    		message("%d: channel: %d value: %d (allowed min: %d, allowed max: %d), result: %s\n",
                          -						i, sample1[i].am_channel3, sample1[i].am_data3, expected_min[2], expected_max[2], check_res[2]);
                          -        	message("Sample:");
                          -    		message("%d: channel: %d value: %d (allowed min: %d, allowed max: %d), result: %s\n",
                          -						i, sample1[i].am_channel4, sample1[i].am_data4, expected_min[3], expected_max[3], check_res[3]);
                          -
                          -    		if (ret != OK) {
                          -    			printf("\t ADC test FAILED. Some channels where out of allowed range. Check supply voltages.\n");
                          -    		 	goto errout_with_dev;
                          -    		}
                          -    	}
                          -    }
                          -
                          -	printf("\t ADC test successful.\n");
                          -
                          -	errout_with_dev:
                          -	  if (fd0 != 0) close(fd0);
                          +	if (fd != 0) close(fd);
                           
                           	return ret;
                           }
                          diff --git a/apps/sensors/sensors.cpp b/apps/sensors/sensors.cpp
                          index d003401735..8b5c66b4fc 100644
                          --- a/apps/sensors/sensors.cpp
                          +++ b/apps/sensors/sensors.cpp
                          @@ -43,7 +43,6 @@
                           
                           #include 
                           #include 
                          -#include 
                           #include 
                           #include 
                           #include 
                          @@ -52,13 +51,15 @@
                           #include 
                           #include 
                           
                          -#include 
                          +#include 
                           
                          +#include 
                           #include 
                           #include 
                           #include 
                           #include 
                           #include 
                          +#include 
                           
                           #include 
                           #include 
                          @@ -87,7 +88,7 @@
                           #define BARO_HEALTH_COUNTER_LIMIT_OK 5
                           #define ADC_HEALTH_COUNTER_LIMIT_OK  5
                           
                          -#define ADC_BATTERY_VOLATGE_CHANNEL  10
                          +#define ADC_BATTERY_VOLTAGE_CHANNEL  10
                           
                           #define BAT_VOL_INITIAL 12.f
                           #define BAT_VOL_LOWPASS_1 0.99f
                          @@ -108,8 +109,8 @@ extern "C" __EXPORT int sensors_main(int argc, char *argv[]);
                           class Sensors
                           {
                           public:
                          -	/** 
                          -	 * Constructor 
                          +	/**
                          +	 * Constructor
                           	 */
                           	Sensors();
                           
                          @@ -125,7 +126,7 @@ public:
                           	 */
                           	int		start();
                           
                          -private:	
                          +private:
                           	static const unsigned _rc_max_chan_count = RC_CHANNELS_MAX;	/**< maximum number of r/c channels we handle */
                           
                           #if CONFIG_HRT_PPM
                          @@ -233,7 +234,7 @@ private:
                           		param_t rc_map_pitch;
                           		param_t rc_map_yaw;
                           		param_t rc_map_throttle;
                          -		
                          +
                           		param_t rc_map_manual_override_sw;
                           		param_t rc_map_auto_mode_sw;
                           
                          @@ -373,7 +374,7 @@ Sensors::Sensors() :
                           	_hil_enabled(false),
                           	_publishing(true),
                           
                          -	/* subscriptions */
                          +/* subscriptions */
                           	_gyro_sub(-1),
                           	_accel_sub(-1),
                           	_mag_sub(-1),
                          @@ -383,13 +384,13 @@ Sensors::Sensors() :
                           	_params_sub(-1),
                           	_manual_control_sub(-1),
                           
                          -	/* publications */
                          +/* publications */
                           	_sensor_pub(-1),
                           	_manual_control_pub(-1),
                           	_rc_pub(-1),
                           	_battery_pub(-1),
                           
                          -	/* performance counters */
                          +/* performance counters */
                           	_loop_perf(perf_alloc(PC_ELAPSED, "sensor task update"))
                           {
                           
                          @@ -487,6 +488,7 @@ Sensors::~Sensors()
                           
                           		/* wait for a second for the task to quit at our request */
                           		unsigned i = 0;
                          +
                           		do {
                           			/* wait 20ms */
                           			usleep(20000);
                          @@ -513,15 +515,19 @@ Sensors::parameters_update()
                           		if (param_get(_parameter_handles.min[i], &(_parameters.min[i])) != OK) {
                           			warnx("Failed getting min for chan %d", i);
                           		}
                          +
                           		if (param_get(_parameter_handles.trim[i], &(_parameters.trim[i])) != OK) {
                           			warnx("Failed getting trim for chan %d", i);
                           		}
                          +
                           		if (param_get(_parameter_handles.max[i], &(_parameters.max[i])) != OK) {
                           			warnx("Failed getting max for chan %d", i);
                           		}
                          +
                           		if (param_get(_parameter_handles.rev[i], &(_parameters.rev[i])) != OK) {
                           			warnx("Failed getting rev for chan %d", i);
                           		}
                          +
                           		if (param_get(_parameter_handles.dz[i], &(_parameters.dz[i])) != OK) {
                           			warnx("Failed getting dead zone for chan %d", i);
                           		}
                          @@ -530,8 +536,8 @@ Sensors::parameters_update()
                           
                           		/* handle blowup in the scaling factor calculation */
                           		if (!isfinite(_parameters.scaling_factor[i]) ||
                          -			_parameters.scaling_factor[i] * _parameters.rev[i] < 0.000001f ||
                          -			_parameters.scaling_factor[i] * _parameters.rev[i] > 0.2f) {
                          +		    _parameters.scaling_factor[i] * _parameters.rev[i] < 0.000001f ||
                          +		    _parameters.scaling_factor[i] * _parameters.rev[i] > 0.2f) {
                           
                           			/* scaling factors do not make sense, lock them down */
                           			_parameters.scaling_factor[i] = 0;
                          @@ -553,18 +559,23 @@ Sensors::parameters_update()
                           	if (param_get(_parameter_handles.rc_map_roll, &(_parameters.rc_map_roll)) != OK) {
                           		warnx("Failed getting roll chan index");
                           	}
                          +
                           	if (param_get(_parameter_handles.rc_map_pitch, &(_parameters.rc_map_pitch)) != OK) {
                           		warnx("Failed getting pitch chan index");
                           	}
                          +
                           	if (param_get(_parameter_handles.rc_map_yaw, &(_parameters.rc_map_yaw)) != OK) {
                           		warnx("Failed getting yaw chan index");
                           	}
                          +
                           	if (param_get(_parameter_handles.rc_map_throttle, &(_parameters.rc_map_throttle)) != OK) {
                           		warnx("Failed getting throttle chan index");
                           	}
                          +
                           	if (param_get(_parameter_handles.rc_map_manual_override_sw, &(_parameters.rc_map_manual_override_sw)) != OK) {
                           		warnx("Failed getting override sw chan index");
                           	}
                          +
                           	if (param_get(_parameter_handles.rc_map_auto_mode_sw, &(_parameters.rc_map_auto_mode_sw)) != OK) {
                           		warnx("Failed getting auto mode sw chan index");
                           	}
                          @@ -576,12 +587,15 @@ Sensors::parameters_update()
                           	if (param_get(_parameter_handles.rc_map_manual_mode_sw, &(_parameters.rc_map_manual_mode_sw)) != OK) {
                           		warnx("Failed getting manual mode sw chan index");
                           	}
                          +
                           	if (param_get(_parameter_handles.rc_map_rtl_sw, &(_parameters.rc_map_rtl_sw)) != OK) {
                           		warnx("Failed getting rtl sw chan index");
                           	}
                          +
                           	if (param_get(_parameter_handles.rc_map_sas_mode_sw, &(_parameters.rc_map_sas_mode_sw)) != OK) {
                           		warnx("Failed getting sas mode sw chan index");
                           	}
                          +
                           	if (param_get(_parameter_handles.rc_map_offboard_ctrl_mode_sw, &(_parameters.rc_map_offboard_ctrl_mode_sw)) != OK) {
                           		warnx("Failed getting offboard control mode sw chan index");
                           	}
                          @@ -589,15 +603,19 @@ Sensors::parameters_update()
                           	if (param_get(_parameter_handles.rc_map_aux1, &(_parameters.rc_map_aux1)) != OK) {
                           		warnx("Failed getting mode aux 1 index");
                           	}
                          +
                           	if (param_get(_parameter_handles.rc_map_aux2, &(_parameters.rc_map_aux2)) != OK) {
                           		warnx("Failed getting mode aux 2 index");
                           	}
                          +
                           	if (param_get(_parameter_handles.rc_map_aux3, &(_parameters.rc_map_aux3)) != OK) {
                           		warnx("Failed getting mode aux 3 index");
                           	}
                          +
                           	if (param_get(_parameter_handles.rc_map_aux4, &(_parameters.rc_map_aux4)) != OK) {
                           		warnx("Failed getting mode aux 4 index");
                           	}
                          +
                           	if (param_get(_parameter_handles.rc_map_aux5, &(_parameters.rc_map_aux5)) != OK) {
                           		warnx("Failed getting mode aux 5 index");
                           	}
                          @@ -605,12 +623,15 @@ Sensors::parameters_update()
                           	if (param_get(_parameter_handles.rc_scale_roll, &(_parameters.rc_scale_roll)) != OK) {
                           		warnx("Failed getting rc scaling for roll");
                           	}
                          +
                           	if (param_get(_parameter_handles.rc_scale_pitch, &(_parameters.rc_scale_pitch)) != OK) {
                           		warnx("Failed getting rc scaling for pitch");
                           	}
                          +
                           	if (param_get(_parameter_handles.rc_scale_yaw, &(_parameters.rc_scale_yaw)) != OK) {
                           		warnx("Failed getting rc scaling for yaw");
                           	}
                          +
                           	if (param_get(_parameter_handles.rc_scale_flaps, &(_parameters.rc_scale_flaps)) != OK) {
                           		warnx("Failed getting rc scaling for flaps");
                           	}
                          @@ -673,9 +694,11 @@ Sensors::accel_init()
                           	int	fd;
                           
                           	fd = open(ACCEL_DEVICE_PATH, 0);
                          +
                           	if (fd < 0) {
                           		warn("%s", ACCEL_DEVICE_PATH);
                           		errx(1, "FATAL: no accelerometer found");
                          +
                           	} else {
                           		/* set the accel internal sampling rate up to at leat 500Hz */
                           		ioctl(fd, ACCELIOCSSAMPLERATE, 500);
                          @@ -694,9 +717,11 @@ Sensors::gyro_init()
                           	int	fd;
                           
                           	fd = open(GYRO_DEVICE_PATH, 0);
                          +
                           	if (fd < 0) {
                           		warn("%s", GYRO_DEVICE_PATH);
                           		errx(1, "FATAL: no gyro found");
                          +
                           	} else {
                           		/* set the gyro internal sampling rate up to at leat 500Hz */
                           		ioctl(fd, GYROIOCSSAMPLERATE, 500);
                          @@ -715,6 +740,7 @@ Sensors::mag_init()
                           	int	fd;
                           
                           	fd = open(MAG_DEVICE_PATH, 0);
                          +
                           	if (fd < 0) {
                           		warn("%s", MAG_DEVICE_PATH);
                           		errx(1, "FATAL: no magnetometer found");
                          @@ -735,6 +761,7 @@ Sensors::baro_init()
                           	int	fd;
                           
                           	fd = open(BARO_DEVICE_PATH, 0);
                          +
                           	if (fd < 0) {
                           		warn("%s", BARO_DEVICE_PATH);
                           		warnx("No barometer found, ignoring");
                          @@ -750,9 +777,10 @@ void
                           Sensors::adc_init()
                           {
                           
                          -	_fd_adc = open("/dev/adc0", O_RDONLY | O_NONBLOCK);
                          +	_fd_adc = open(ADC_DEVICE_PATH, O_RDONLY | O_NONBLOCK);
                          +
                           	if (_fd_adc < 0) {
                          -		warnx("/dev/adc0");
                          +		warnx(ADC_DEVICE_PATH);
                           		warnx("FATAL: no ADC found");
                           	}
                           }
                          @@ -821,7 +849,7 @@ Sensors::mag_poll(struct sensor_combined_s &raw)
                           		raw.magnetometer_raw[0] = mag_report.x_raw;
                           		raw.magnetometer_raw[1] = mag_report.y_raw;
                           		raw.magnetometer_raw[2] = mag_report.z_raw;
                          -		
                          +
                           		raw.magnetometer_counter++;
                           	}
                           }
                          @@ -853,6 +881,7 @@ Sensors::vehicle_status_poll()
                           
                           	/* Check HIL state if vehicle status has changed */
                           	orb_check(_vstatus_sub, &vstatus_updated);
                          +
                           	if (vstatus_updated) {
                           
                           		orb_copy(ORB_ID(vehicle_status), _vstatus_sub, &vstatus);
                          @@ -880,8 +909,7 @@ Sensors::parameter_update_poll(bool forced)
                           	/* Check if any parameter has changed */
                           	orb_check(_params_sub, ¶m_updated);
                           
                          -	if (param_updated || forced)
                          -	{
                          +	if (param_updated || forced) {
                           		/* read from param to clear updated flag */
                           		struct parameter_update_s update;
                           		orb_copy(ORB_ID(parameter_update), _params_sub, &update);
                          @@ -891,7 +919,7 @@ Sensors::parameter_update_poll(bool forced)
                           
                           		/* update sensor offsets */
                           		int fd = open(GYRO_DEVICE_PATH, 0);
                          -		struct gyro_scale gscale = { 
                          +		struct gyro_scale gscale = {
                           			_parameters.gyro_offset[0],
                           			1.0f,
                           			_parameters.gyro_offset[1],
                          @@ -899,8 +927,10 @@ Sensors::parameter_update_poll(bool forced)
                           			_parameters.gyro_offset[2],
                           			1.0f,
                           		};
                          +
                           		if (OK != ioctl(fd, GYROIOCSSCALE, (long unsigned int)&gscale))
                           			warn("WARNING: failed to set scale / offsets for gyro");
                          +
                           		close(fd);
                           
                           		fd = open(ACCEL_DEVICE_PATH, 0);
                          @@ -912,8 +942,10 @@ Sensors::parameter_update_poll(bool forced)
                           			_parameters.accel_offset[2],
                           			_parameters.accel_scale[2],
                           		};
                          +
                           		if (OK != ioctl(fd, ACCELIOCSSCALE, (long unsigned int)&ascale))
                           			warn("WARNING: failed to set scale / offsets for accel");
                          +
                           		close(fd);
                           
                           		fd = open(MAG_DEVICE_PATH, 0);
                          @@ -925,62 +957,64 @@ Sensors::parameter_update_poll(bool forced)
                           			_parameters.mag_offset[2],
                           			_parameters.mag_scale[2],
                           		};
                          +
                           		if (OK != ioctl(fd, MAGIOCSSCALE, (long unsigned int)&mscale))
                           			warn("WARNING: failed to set scale / offsets for mag");
                          +
                           		close(fd);
                           
                           #if 0
                          -		printf("CH0: RAW MAX: %d MIN %d S: %d MID: %d FUNC: %d\n",  (int)_parameters.max[0], (int)_parameters.min[0], (int)(_rc.chan[0].scaling_factor*10000), (int)(_rc.chan[0].mid), (int)_rc.function[0]);
                          -		printf("CH1: RAW MAX: %d MIN %d S: %d MID: %d FUNC: %d\n",  (int)_parameters.max[1], (int)_parameters.min[1], (int)(_rc.chan[1].scaling_factor*10000), (int)(_rc.chan[1].mid), (int)_rc.function[1]);
                          -		printf("MAN: %d %d\n", (int)(_rc.chan[0].scaled*100), (int)(_rc.chan[1].scaled*100));
                          +		printf("CH0: RAW MAX: %d MIN %d S: %d MID: %d FUNC: %d\n", (int)_parameters.max[0], (int)_parameters.min[0], (int)(_rc.chan[0].scaling_factor * 10000), (int)(_rc.chan[0].mid), (int)_rc.function[0]);
                          +		printf("CH1: RAW MAX: %d MIN %d S: %d MID: %d FUNC: %d\n", (int)_parameters.max[1], (int)_parameters.min[1], (int)(_rc.chan[1].scaling_factor * 10000), (int)(_rc.chan[1].mid), (int)_rc.function[1]);
                          +		printf("MAN: %d %d\n", (int)(_rc.chan[0].scaled * 100), (int)(_rc.chan[1].scaled * 100));
                           		fflush(stdout);
                           		usleep(5000);
                           #endif
                          -	}	
                          +	}
                           }
                           
                           void
                           Sensors::adc_poll(struct sensor_combined_s &raw)
                           {
                          -	#pragma pack(push,1)
                          -	struct adc_msg4_s {
                          -		uint8_t      am_channel1;	/**< The 8-bit ADC Channel 1 */
                          -		int32_t      am_data1;		/**< ADC convert result 1 (4 bytes) */
                          -		uint8_t      am_channel2;	/**< The 8-bit ADC Channel 2 */
                          -		int32_t      am_data2;		/**< ADC convert result 2 (4 bytes) */
                          -		uint8_t      am_channel3;	/**< The 8-bit ADC Channel 3 */
                          -		int32_t      am_data3;		/**< ADC convert result 3 (4 bytes) */
                          -		uint8_t      am_channel4;	/**< The 8-bit ADC Channel 4 */
                          -		int32_t      am_data4;		/**< ADC convert result 4 (4 bytes) */
                          -	} buf_adc;
                          -	#pragma pack(pop)
                           
                          +	/* rate limit to 100 Hz */
                           	if (hrt_absolute_time() - _last_adc >= 10000) {
                          -		read(_fd_adc, &buf_adc, sizeof(buf_adc));
                          +		/* make space for a maximum of eight channels */
                          +		struct adc_msg_s buf_adc[8];
                          +		/* read all channels available */
                          +		int ret = read(_fd_adc, &buf_adc, sizeof(buf_adc));
                           
                          -		if (ADC_BATTERY_VOLATGE_CHANNEL == buf_adc.am_channel1) {
                          -			/* Voltage in volts */
                          -			float voltage = (buf_adc.am_data1 * _parameters.battery_voltage_scaling);
                          +		/* look for battery channel */
                           
                          -			if (voltage > VOLTAGE_BATTERY_IGNORE_THRESHOLD_VOLTS) {
                          +		for (unsigned i = 0; i < sizeof(buf_adc) / sizeof(buf_adc[0]); i++) {
                           
                          -				_battery_status.timestamp = hrt_absolute_time();
                          -				_battery_status.voltage_v = (BAT_VOL_LOWPASS_1 * (_battery_status.voltage_v + BAT_VOL_LOWPASS_2 * voltage));;
                          -				/* current and discharge are unknown */
                          -				_battery_status.current_a = -1.0f;
                          -				_battery_status.discharged_mah = -1.0f;
                          +			if (ret >= sizeof(buf_adc[0]) && ADC_BATTERY_VOLTAGE_CHANNEL == buf_adc[i].am_channel) {
                          +				/* Voltage in volts */
                          +				float voltage = (buf_adc[i].am_data * _parameters.battery_voltage_scaling);
                           
                          -				/* announce the battery voltage if needed, just publish else */
                          -				if (_battery_pub > 0) {
                          -					orb_publish(ORB_ID(battery_status), _battery_pub, &_battery_status);
                          -				} else {
                          -					_battery_pub = orb_advertise(ORB_ID(battery_status), &_battery_status);
                          +				if (voltage > VOLTAGE_BATTERY_IGNORE_THRESHOLD_VOLTS) {
                          +
                          +					_battery_status.timestamp = hrt_absolute_time();
                          +					_battery_status.voltage_v = (BAT_VOL_LOWPASS_1 * (_battery_status.voltage_v + BAT_VOL_LOWPASS_2 * voltage));;
                          +					/* current and discharge are unknown */
                          +					_battery_status.current_a = -1.0f;
                          +					_battery_status.discharged_mah = -1.0f;
                          +
                          +					/* announce the battery voltage if needed, just publish else */
                          +					if (_battery_pub > 0) {
                          +						orb_publish(ORB_ID(battery_status), _battery_pub, &_battery_status);
                          +						printf("DBG: ADC PUB: %d, val: %d\n", ret, (int)(buf_adc[0].am_data));
                          +
                          +					} else {
                          +						_battery_pub = orb_advertise(ORB_ID(battery_status), &_battery_status);
                          +					}
                           				}
                          -			}
                           
                          -			raw.battery_voltage_counter++;
                          +				raw.battery_voltage_counter++;
                          +				_last_adc = hrt_absolute_time();
                          +				break;
                          +			}
                           		}
                          -		_last_adc = hrt_absolute_time();
                           	}
                           }
                           
                          @@ -1012,6 +1046,7 @@ Sensors::ppm_poll()
                           		/* publish to object request broker */
                           		if (rc_input_pub <= 0) {
                           			rc_input_pub = orb_advertise(ORB_ID(input_rc), &raw);
                          +
                           		} else {
                           			orb_publish(ORB_ID(input_rc), rc_input_pub, &raw);
                           		}
                          @@ -1052,6 +1087,7 @@ Sensors::ppm_poll()
                           			return;
                           
                           		unsigned channel_limit = rc_input.channel_count;
                          +
                           		if (channel_limit > _rc_max_chan_count)
                           			channel_limit = _rc_max_chan_count;
                           
                          @@ -1064,10 +1100,11 @@ Sensors::ppm_poll()
                           			/* scale around the mid point differently for lower and upper range */
                           			if (rc_input.values[i] > (_parameters.trim[i] + _parameters.dz[i])) {
                           				_rc.chan[i].scaled = (rc_input.values[i] - _parameters.trim[i]) / (float)(_parameters.max[i] - _parameters.trim[i]);
                          +
                           			} else if (rc_input.values[i] < (_parameters.trim[i] - _parameters.dz[i])) {
                           				/* division by zero impossible for trim == min (as for throttle), as this falls in the above if clause */
                           				_rc.chan[i].scaled = -((_parameters.trim[i] - rc_input.values[i]) / (float)(_parameters.trim[i] - _parameters.min[i]));
                          -				
                          +
                           			} else {
                           				/* in the configured dead zone, output zero */
                           				_rc.chan[i].scaled = 0.0f;
                          @@ -1078,6 +1115,7 @@ Sensors::ppm_poll()
                           				if ((int)_parameters.rev[i] == -1) {
                           					_rc.chan[i].scaled = 1.0f + -1.0f * _rc.chan[i].scaled;
                           				}
                          +
                           			} else {
                           				_rc.chan[i].scaled *= _parameters.rev[i];
                           			}
                          @@ -1103,7 +1141,9 @@ Sensors::ppm_poll()
                           		manual_control.yaw = limit_minus_one_to_one(_rc.chan[_rc.function[YAW]].scaled);
                           		/* throttle input */
                           		manual_control.throttle = _rc.chan[_rc.function[THROTTLE]].scaled;
                          +
                           		if (manual_control.throttle < 0.0f) manual_control.throttle = 0.0f;
                          +
                           		if (manual_control.throttle > 1.0f) manual_control.throttle = 1.0f;
                           
                           		/* scale output */
                          @@ -1175,6 +1215,7 @@ Sensors::ppm_poll()
                           		/* check if ready for publishing */
                           		if (_rc_pub > 0) {
                           			orb_publish(ORB_ID(rc_channels), _rc_pub, &_rc);
                          +
                           		} else {
                           			/* advertise the rc topic */
                           			_rc_pub = orb_advertise(ORB_ID(rc_channels), &_rc);
                          @@ -1183,6 +1224,7 @@ Sensors::ppm_poll()
                           		/* check if ready for publishing */
                           		if (_manual_control_pub > 0) {
                           			orb_publish(ORB_ID(manual_control_setpoint), _manual_control_pub, &manual_control);
                          +
                           		} else {
                           			_manual_control_pub = orb_advertise(ORB_ID(manual_control_setpoint), &manual_control);
                           		}
                          @@ -1260,7 +1302,7 @@ Sensors::task_main()
                           	fds[0].events = POLLIN;
                           
                           	while (!_task_should_exit) {
                          -		
                          +
                           		/* wait for up to 500ms for data */
                           		int pret = poll(&fds[0], (sizeof(fds) / sizeof(fds[0])), 100);
                           
                          @@ -1329,6 +1371,7 @@ Sensors::start()
                           		warn("task start failed");
                           		return -errno;
                           	}
                          +
                           	return OK;
                           }
                           
                          @@ -1343,6 +1386,7 @@ int sensors_main(int argc, char *argv[])
                           			errx(1, "sensors task already running");
                           
                           		sensors::g_sensors = new Sensors;
                          +
                           		if (sensors::g_sensors == nullptr)
                           			errx(1, "sensors task alloc failed");
                           
                          @@ -1351,12 +1395,14 @@ int sensors_main(int argc, char *argv[])
                           			sensors::g_sensors = nullptr;
                           			err(1, "sensors task start failed");
                           		}
                          +
                           		exit(0);
                           	}
                           
                           	if (!strcmp(argv[1], "stop")) {
                           		if (sensors::g_sensors == nullptr)
                           			errx(1, "sensors task not running");
                          +
                           		delete sensors::g_sensors;
                           		sensors::g_sensors = nullptr;
                           		exit(0);
                          @@ -1365,6 +1411,7 @@ int sensors_main(int argc, char *argv[])
                           	if (!strcmp(argv[1], "status")) {
                           		if (sensors::g_sensors) {
                           			errx(0, "task is running");
                          +
                           		} else {
                           			errx(1, "task is not running");
                           		}
                          
                          From 6c1b00e22fca4272c0cd3b861074893d351fe903 Mon Sep 17 00:00:00 2001
                          From: Lorenz Meier 
                          Date: Sat, 12 Jan 2013 00:53:45 +0100
                          Subject: [PATCH 078/157] Counting the number of tests correctly
                          
                          ---
                           apps/px4/tests/test_bson.c  |  2 +-
                           apps/px4/tests/tests_main.c | 16 +++++++++++-----
                           2 files changed, 12 insertions(+), 6 deletions(-)
                          
                          diff --git a/apps/px4/tests/test_bson.c b/apps/px4/tests/test_bson.c
                          index e2a10ec293..a42c462ca9 100644
                          --- a/apps/px4/tests/test_bson.c
                          +++ b/apps/px4/tests/test_bson.c
                          @@ -240,5 +240,5 @@ test_bson(int argc, char *argv[])
                           	decode(&decoder);
                           	free(buf);
                           
                          -	exit(0);
                          +	return OK;
                           }
                          \ No newline at end of file
                          diff --git a/apps/px4/tests/tests_main.c b/apps/px4/tests/tests_main.c
                          index 26f7ef96bf..5c3b0b0c26 100644
                          --- a/apps/px4/tests/tests_main.c
                          +++ b/apps/px4/tests/tests_main.c
                          @@ -107,9 +107,9 @@ struct {
                           	{"perf",		test_perf,	OPT_NOJIGTEST, 0},
                           	{"all",			test_all,	OPT_NOALLTEST | OPT_NOJIGTEST, 0},
                           	{"jig",			test_jig,	OPT_NOJIGTEST | OPT_NOALLTEST, 0},
                          -	{"param",		test_param,	0, 0},
                          -	{"bson",		test_bson,	0, 0},
                          -	{"file",		test_file,	0, 0},
                          +	{"param",		test_param,	OPT_NOJIGTEST, 0},
                          +	{"bson",		test_bson,	OPT_NOJIGTEST, 0},
                          +	{"file",		test_file,	OPT_NOJIGTEST, 0},
                           	{"help",		test_help,	OPT_NOALLTEST | OPT_NOHELP | OPT_NOJIGTEST, 0},
                           	{NULL,			NULL, 		0, 0}
                           };
                          @@ -133,6 +133,7 @@ test_all(int argc, char *argv[])
                           	unsigned	i;
                           	char		*args[2] = {"all", NULL};
                           	unsigned int failcount = 0;
                          +	unsigned int testscount = 0;
                           
                           	printf("\nRunning all tests...\n\n");
                           
                          @@ -153,6 +154,8 @@ test_all(int argc, char *argv[])
                           				printf("  [%s] \t\t\tPASS\n", tests[i].name);
                           				fflush(stdout);
                           			}
                          +
                          +			testscount++;
                           		}
                           	}
                           
                          @@ -184,7 +187,7 @@ test_all(int argc, char *argv[])
                           		printf("  \\ \\_\\    \\ \\_\\ \\_\\  \\ \\_\\  \\ \\_____\\ \n");
                           		printf("   \\/_/     \\/_/\\/_/   \\/_/   \\/_____/ \n");
                           		printf("\n");
                          -		printf(" Some tests failed (%d of %d)\n", failcount, i);
                          +		printf(" Some tests failed (%d of %d)\n", failcount, testscount);
                           	}
                           
                           	printf("\n");
                          @@ -242,6 +245,7 @@ int test_jig(int argc, char *argv[])
                           	unsigned	i;
                           	char		*args[2] = {"jig", NULL};
                           	unsigned int failcount = 0;
                          +	unsigned int testscount = 0;
                           
                           	printf("\nRunning all tests...\n\n");
                           	for (i = 0; tests[i].name; i++) {
                          @@ -259,6 +263,8 @@ int test_jig(int argc, char *argv[])
                           				printf("  [%s] \t\t\tPASS\n", tests[i].name);
                           				fflush(stdout);
                           			}
                          +
                          +			testscount++;
                           		}
                           	}
                           
                          @@ -287,7 +293,7 @@ int test_jig(int argc, char *argv[])
                           		printf("  \\ \\_\\    \\ \\_\\ \\_\\  \\ \\_\\  \\ \\_____\\ \n");
                           		printf("   \\/_/     \\/_/\\/_/   \\/_/   \\/_____/ \n");
                           		printf("\n");
                          -		printf(" Some tests failed (%d of %d)\n", failcount, i);
                          +		printf(" Some tests failed (%d of %d)\n", failcount, testscount);
                           	}
                           	printf("\n");
                           
                          
                          From 9f1ab9348cc48d1cba889326ea4a5bd4abf0bd30 Mon Sep 17 00:00:00 2001
                          From: Julian Oes 
                          Date: Fri, 11 Jan 2013 20:09:45 -0800
                          Subject: [PATCH 079/157] One printf made the tests unreadable
                          
                          ---
                           apps/sensors/sensors.cpp | 2 +-
                           1 file changed, 1 insertion(+), 1 deletion(-)
                          
                          diff --git a/apps/sensors/sensors.cpp b/apps/sensors/sensors.cpp
                          index 8b5c66b4fc..170dc6e576 100644
                          --- a/apps/sensors/sensors.cpp
                          +++ b/apps/sensors/sensors.cpp
                          @@ -1003,7 +1003,7 @@ Sensors::adc_poll(struct sensor_combined_s &raw)
                           					/* announce the battery voltage if needed, just publish else */
                           					if (_battery_pub > 0) {
                           						orb_publish(ORB_ID(battery_status), _battery_pub, &_battery_status);
                          -						printf("DBG: ADC PUB: %d, val: %d\n", ret, (int)(buf_adc[0].am_data));
                          +						//printf("DBG: ADC PUB: %d, val: %d\n", ret, (int)(buf_adc[0].am_data));
                           
                           					} else {
                           						_battery_pub = orb_advertise(ORB_ID(battery_status), &_battery_status);
                          
                          From 41cef1d6c5420ddf1193760678a908b4e624586f Mon Sep 17 00:00:00 2001
                          From: Marco Bauer 
                          Date: Sat, 12 Jan 2013 10:26:37 +0100
                          Subject: [PATCH 080/157] merged systemstate into blinkm driver
                          
                          ---
                           apps/drivers/blinkm/blinkm.cpp | 496 +++++++++++++++++++++++++++++++--
                           1 file changed, 474 insertions(+), 22 deletions(-)
                          
                          diff --git a/apps/drivers/blinkm/blinkm.cpp b/apps/drivers/blinkm/blinkm.cpp
                          index d589025cce..19f3b4d731 100644
                          --- a/apps/drivers/blinkm/blinkm.cpp
                          +++ b/apps/drivers/blinkm/blinkm.cpp
                          @@ -35,9 +35,57 @@
                            * @file blinkm.cpp
                            *
                            * Driver for the BlinkM LED controller connected via I2C.
                          + *
                          + * Connect the BlinkM to I2C3 and put the following line to the rc startup-script:
                          + * blinkm start
                          + *
                          + * To start the system monitor put in the next line after the blinm start:
                          + * blinkm systemmonitor
                          + *
                          + *
                          + * Description:
                          + * After startup, the Application checked how many lipo cells are connected to the System.
                          + * The recognized number off cells, will be blinked 5 times in purple color.
                          + * 2 Cells = 2 blinks
                          + * ...
                          + * 5 Cells = 5 blinks
                          + * Now the Application will show the actual selected Flightmode, GPS-Fix and Battery Warnings and Alerts.
                          + *
                          + * System disarmed:
                          + * The BlinkM should lit solid red.
                          + *
                          + * System armed:
                          + * One message is made of 4 Blinks and a pause in the same length as the 4 blinks.
                          + *
                          + * X-X-X-X-_-_-_-_-
                          + * -------------------------
                          + * G G G M
                          + * P P P O
                          + * S S S D
                          + *       E
                          + *
                          + * (X = on, _=off)
                          + *
                          + * The first 3 Blinks indicates the status of the GPS-Signal:
                          + * 0-4 satellites = X-X-X-X-_-_-_-_-
                          + *   5 satellites = X-X-_-X-_-_-_-_-
                          + *   6 satellites = X-_-_-X-_-_-_-_-
                          + * >=7 satellites = _-_-_-X-_-_-_-_-
                          + *
                          + * The fourth Blink indicates the Flightmode:
                          + * MANUAL     : off
                          + * STABILIZED : yellow
                          + * HOLD		  : blue
                          + * AUTO       : green
                          + *
                          + * Battery Warning (low Battery Level):
                          + * Continuously blinking in yellow X-X-X-X-X-X-X-X
                          + *
                          + * Battery Alert (critical Battery Level)
                          + * Continuously blinking in red X-X-X-X-X-X-X-X
                          + *
                            */
                           
                          -
                           #include 
                           
                           #include 
                          @@ -59,6 +107,12 @@
                           #include 
                           #include 
                           
                          +#include 
                          +#include 
                          +#include 
                          +#include 
                          +#include 
                          +
                           class BlinkM : public device::I2C
                           {
                           public:
                          @@ -67,7 +121,7 @@ public:
                           
                           	virtual int		init();
                           	virtual int		probe();
                          -
                          +	virtual int		setMode(int mode);
                           	virtual int		ioctl(struct file *filp, int cmd, unsigned long arg);
                           
                           	static const char	*script_names[];
                          @@ -96,10 +150,20 @@ private:
                           	};
                           
                           	work_s			_work;
                          -	static const unsigned	_monitor_interval = 250;
                           
                          -	static void		monitor_trampoline(void *arg);
                          -	void			monitor();
                          +	static int led_color_1;
                          +	static int led_color_2;
                          +	static int led_color_3;
                          +	static int led_color_4;
                          +	static int led_color_5;
                          +	static int led_color_6;
                          +	static int led_blink;
                          +
                          +	static int systemstate_run;
                          +
                          +	void 			setLEDColor(int ledcolor);
                          +	static void		led_trampoline(void *arg);
                          +	void			led();
                           
                           	int			set_rgb(uint8_t r, uint8_t g, uint8_t b);
                           
                          @@ -127,8 +191,7 @@ private:
                           /* for now, we only support one BlinkM */
                           namespace
                           {
                          -BlinkM *g_blinkm;
                          -
                          +	BlinkM *g_blinkm;
                           }
                           
                           /* list of script names, must match script ID numbers */
                          @@ -155,11 +218,36 @@ const char *BlinkM::script_names[] = {
                           	nullptr
                           };
                           
                          +#define MAX_CELL_VOLTAGE 	43	/* cell voltage if full charged */
                          +
                          +#define LED_OFF  			0
                          +#define LED_RED  			1
                          +#define LED_YELLOW  	2
                          +#define LED_PURPLE  	3
                          +#define LED_GREEN  		4
                          +#define LED_BLUE  		5
                          +#define LED_WHITE  		6
                          +#define LED_ONTIME  	100
                          +#define LED_OFFTIME  	100
                          +#define LED_BLINK  		1
                          +#define LED_NOBLINK  	0
                          +
                          +int BlinkM::led_color_1 = LED_OFF;
                          +int BlinkM::led_color_2 = LED_OFF;
                          +int BlinkM::led_color_3 = LED_OFF;
                          +int BlinkM::led_color_4 = LED_OFF;
                          +int BlinkM::led_color_5 = LED_OFF;
                          +int BlinkM::led_color_6 = LED_OFF;
                          +int BlinkM::led_blink = LED_NOBLINK;
                          +
                          +int BlinkM::systemstate_run = 0;
                          +
                           extern "C" __EXPORT int blinkm_main(int argc, char *argv[]);
                           
                           BlinkM::BlinkM(int bus) :
                           	I2C("blinkm", BLINKM_DEVICE_PATH, bus, 0x09, 100000)
                           {
                          +	memset(&_work, 0, sizeof(_work));
                           }
                           
                           BlinkM::~BlinkM()
                          @@ -170,7 +258,6 @@ int
                           BlinkM::init()
                           {
                           	int ret;
                          -
                           	ret = I2C::init();
                           
                           	if (ret != OK) {
                          @@ -179,13 +266,44 @@ BlinkM::init()
                           	}
                           
                           	/* set some sensible defaults */
                          -	set_fade_speed(25);
                          +	set_fade_speed(255);
                           
                           	/* turn off by default */
                           	play_script(BLACK);
                          +	set_fade_speed(255);
                          +	stop_script();
                          +	set_rgb(0,0,0);
                           
                          -	/* start the system monitor as a low-priority workqueue entry */
                          -	work_queue(LPWORK, &_work, (worker_t)&BlinkM::monitor_trampoline, this, 1);
                          +	return OK;
                          +}
                          +
                          +int
                          +BlinkM::setMode(int mode)
                          +{
                          +	if(mode == 1) {
                          +		if(BlinkM::systemstate_run == 0) {
                          +			/* set some sensible defaults */
                          +			set_fade_speed(255);
                          +
                          +			/* turn off by default */
                          +			play_script(BLACK);
                          +			set_fade_speed(255);
                          +			stop_script();
                          +			set_rgb(0,0,0);
                          +			BlinkM::systemstate_run = 1;
                          +			work_queue(LPWORK, &_work, (worker_t)&BlinkM::led_trampoline, this, 1);
                          +		}
                          +	} else {
                          +		BlinkM::systemstate_run = 0;
                          +		usleep(1000000);
                          +		/* set some sensible defaults */
                          +		set_fade_speed(255);
                          +		/* turn off by default */
                          +		play_script(BLACK);
                          +		set_fade_speed(255);
                          +		stop_script();
                          +		set_rgb(0,0,0);
                          +	}
                           
                           	return OK;
                           }
                          @@ -249,21 +367,343 @@ BlinkM::ioctl(struct file *filp, int cmd, unsigned long arg)
                           	return ret;
                           }
                           
                          +
                           void
                          -BlinkM::monitor_trampoline(void *arg)
                          +BlinkM::led_trampoline(void *arg)
                           {
                           	BlinkM *bm = (BlinkM *)arg;
                           
                          -	bm->monitor();
                          +	bm->led();
                           }
                           
                          -void
                          -BlinkM::monitor()
                          -{
                          -	/* check system state, possibly update LED to suit */
                           
                          -	/* re-queue ourselves to run again later */
                          -	work_queue(LPWORK, &_work, (worker_t)&BlinkM::monitor_trampoline, this, _monitor_interval);
                          +
                          +void
                          +BlinkM::led()
                          +{
                          +
                          +	static int vehicle_status_sub_fd;
                          +	static int vehicle_gps_position_sub_fd;
                          +
                          +	static int num_of_cells = 0;
                          +	static int detected_cells_runcount = 0;
                          +	static int t_led_color_1 = 0;
                          +	static int t_led_color_2 = 0;
                          +	static int t_led_color_3 = 0;
                          +	static int t_led_color_4 = 0;
                          +	static int t_led_color_5 = 0;
                          +	static int t_led_color_6 = 0;
                          +	static int t_led_blink = 0;
                          +	static int led_thread_runcount=1;
                          +	static int led_interval = 1000;
                          +
                          +	static bool topic_initialized = false;
                          +	static bool detected_cells_blinked = false;
                          +	static bool led_thread_ready = true;
                          +
                          +	int system_voltage = 0;
                          +	int num_of_used_sats = 0;
                          +	int poll_ret;
                          +
                          +	if(!topic_initialized) {
                          +		vehicle_status_sub_fd = orb_subscribe(ORB_ID(vehicle_status));
                          +		orb_set_interval(vehicle_status_sub_fd, 1000);
                          +
                          +		vehicle_gps_position_sub_fd = orb_subscribe(ORB_ID(vehicle_gps_position));
                          +		orb_set_interval(vehicle_gps_position_sub_fd, 1000);
                          +
                          +		topic_initialized = true;
                          +	}
                          +
                          +	pollfd fds[2];
                          +	fds[0].fd = vehicle_status_sub_fd;
                          +	fds[0].events = POLLIN;
                          +	fds[1].fd = vehicle_gps_position_sub_fd;
                          +	fds[1].events = POLLIN;
                          +
                          +	if(led_thread_ready == true) {
                          +		if(!detected_cells_blinked) {
                          +			if(num_of_cells > 0) {
                          +				t_led_color_1 = LED_PURPLE;
                          +			}
                          +			if(num_of_cells > 1) {
                          +				t_led_color_2 = LED_PURPLE;
                          +			}
                          +			if(num_of_cells > 2) {
                          +				t_led_color_3 = LED_PURPLE;
                          +			}
                          +			if(num_of_cells > 3) {
                          +				t_led_color_4 = LED_PURPLE;
                          +			}
                          +			if(num_of_cells > 4) {
                          +				t_led_color_5 = LED_PURPLE;
                          +			}
                          +			t_led_color_6 = LED_OFF;
                          +			t_led_blink = LED_BLINK;
                          +		} else {
                          +			t_led_color_1 = BlinkM::led_color_1;
                          +			t_led_color_2 = BlinkM::led_color_2;
                          +			t_led_color_3 = BlinkM::led_color_3;
                          +			t_led_color_4 = BlinkM::led_color_4;
                          +			t_led_color_5 = BlinkM::led_color_5;
                          +			t_led_color_6 = BlinkM::led_color_6;
                          +			t_led_blink = BlinkM::led_blink;
                          +		}
                          +		led_thread_ready = false;
                          +	}
                          +
                          +	switch(led_thread_runcount) {
                          +		case 1:	// 1. LED on
                          +			BlinkM::setLEDColor(t_led_color_1);
                          +			led_thread_runcount++;
                          +			led_interval = LED_ONTIME;
                          +			break;
                          +		case 2:	// 1. LED off
                          +			if(t_led_blink == LED_BLINK) {
                          +				BlinkM::setLEDColor(LED_OFF);
                          +			}
                          +			led_thread_runcount++;
                          +			led_interval = LED_OFFTIME;
                          +			break;
                          +		case 3:	// 2. LED on
                          +			BlinkM::setLEDColor(t_led_color_2);
                          +			led_thread_runcount++;
                          +			led_interval = LED_ONTIME;
                          +			break;
                          +		case 4:	// 2. LED off
                          +			if(t_led_blink == LED_BLINK) {
                          +				BlinkM::setLEDColor(LED_OFF);
                          +			}
                          +			led_thread_runcount++;
                          +			led_interval = LED_OFFTIME;
                          +			break;
                          +		case 5:	// 3. LED on
                          +			BlinkM::setLEDColor(t_led_color_3);
                          +			led_thread_runcount++;
                          +			led_interval = LED_ONTIME;
                          +			break;
                          +		case 6:	// 3. LED off
                          +			if(t_led_blink == LED_BLINK) {
                          +				BlinkM::setLEDColor(LED_OFF);
                          +			}
                          +			led_thread_runcount++;
                          +			led_interval = LED_OFFTIME;
                          +			break;
                          +		case 7:	// 4. LED on
                          +			BlinkM::setLEDColor(t_led_color_4);
                          +			led_thread_runcount++;
                          +			led_interval = LED_ONTIME;
                          +			break;
                          +		case 8:	// 4. LED off
                          +			if(t_led_blink == LED_BLINK) {
                          +				BlinkM::setLEDColor(LED_OFF);
                          +			}
                          +			led_thread_runcount++;
                          +			led_interval = LED_OFFTIME;
                          +			break;
                          +		case 9:	// 5. LED on
                          +			BlinkM::setLEDColor(t_led_color_5);
                          +			led_thread_runcount++;
                          +			led_interval = LED_ONTIME;
                          +			break;
                          +		case 10:	// 5. LED off
                          +			if(t_led_blink == LED_BLINK) {
                          +				BlinkM::setLEDColor(LED_OFF);
                          +			}
                          +			led_thread_runcount++;
                          +			led_interval = LED_OFFTIME;
                          +			break;
                          +		case 11:	// 6. LED on
                          +			BlinkM::setLEDColor(t_led_color_6);
                          +			led_thread_runcount++;
                          +			led_interval = LED_ONTIME;
                          +			break;
                          +		case 12:	// 6. LED off
                          +			if(t_led_blink == LED_BLINK) {
                          +				BlinkM::setLEDColor(LED_OFF);
                          +			}
                          +
                          +			//poll_ret = ::poll(&fds[0],1,1000);
                          +			poll_ret = ::poll(fds, 2, 1000);
                          +
                          +			if (poll_ret == 0) {
                          +				/* this means none of our providers is giving us data */
                          +				printf("[blinkm_systemstate_sensor] Got no data within a second\n");
                          +			} else if (poll_ret < 0) {
                          +				/* this is seriously bad - should be an emergency */
                          +				log("poll error %d", errno);
                          +				usleep(1000000);
                          +			} else {
                          +				if (fds[0].revents & POLLIN) {
                          +					/* obtained data for the first file descriptor */
                          +					struct vehicle_status_s vehicle_status_raw;
                          +					struct vehicle_gps_position_s vehicle_gps_position_raw;
                          +					/* copy sensors raw data into local buffer */
                          +
                          +					/* vehicle_status */
                          +					orb_copy(ORB_ID(vehicle_status), vehicle_status_sub_fd, &vehicle_status_raw);
                          +
                          +					/* vehicle_gps_position */
                          +					orb_copy(ORB_ID(vehicle_gps_position), vehicle_status_sub_fd, &vehicle_gps_position_raw);
                          +
                          +					/* get actual battery voltage */
                          +					system_voltage = (int)vehicle_status_raw.voltage_battery*10;
                          +
                          +					/* get number of used satellites in navigation */
                          +					num_of_used_sats = 0;
                          +					for(int satloop=0; satloop<20; satloop++) {
                          +						if(vehicle_gps_position_raw.satellite_used[satloop] == 1) {
                          +							num_of_used_sats++;
                          +						}
                          +					}
                          +
                          +					if(num_of_cells == 0) {
                          +							/* looking for lipo cells that are connected */
                          +						printf(" checking cells\n");
                          +						for(num_of_cells = 2; num_of_cells < 7; num_of_cells++) {
                          +							if(system_voltage < num_of_cells * MAX_CELL_VOLTAGE) break;
                          +						}
                          +						printf(" cells found:%u\n", num_of_cells);
                          +						} else {
                          +							if(vehicle_status_raw.battery_warning == VEHICLE_BATTERY_WARNING_WARNING) {
                          +								/* LED Pattern for battery low warning */
                          +								BlinkM::led_color_1 = LED_YELLOW;
                          +								BlinkM::led_color_2 = LED_YELLOW;
                          +								BlinkM::led_color_3 = LED_YELLOW;
                          +								BlinkM::led_color_4 = LED_YELLOW;
                          +								BlinkM::led_color_5 = LED_YELLOW;
                          +								BlinkM::led_color_6 = LED_YELLOW;
                          +								BlinkM::led_blink = LED_BLINK;
                          +
                          +							} else if(vehicle_status_raw.battery_warning == VEHICLE_BATTERY_WARNING_ALERT) {
                          +								/* LED Pattern for battery critical alerting */
                          +								BlinkM::led_color_1 = LED_RED;
                          +								BlinkM::led_color_2 = LED_RED;
                          +								BlinkM::led_color_3 = LED_RED;
                          +								BlinkM::led_color_4 = LED_RED;
                          +								BlinkM::led_color_5 = LED_RED;
                          +								BlinkM::led_color_6 = LED_RED;
                          +								BlinkM::led_blink = LED_BLINK;
                          +
                          +							} else {
                          +								/* no battery warnings here */
                          +
                          +								if(vehicle_status_raw.flag_system_armed == false) {
                          +									/* system not armed */
                          +									BlinkM::led_color_1 = LED_RED;
                          +									BlinkM::led_color_2 = LED_RED;
                          +									BlinkM::led_color_3 = LED_RED;
                          +									BlinkM::led_color_4 = LED_RED;
                          +									BlinkM::led_color_5 = LED_RED;
                          +									BlinkM::led_color_6 = LED_RED;
                          +									BlinkM::led_blink = LED_NOBLINK;
                          +
                          +								} else {
                          +									/* armed system - initial led pattern */
                          +									BlinkM::led_color_1 = LED_RED;
                          +									BlinkM::led_color_2 = LED_RED;
                          +									BlinkM::led_color_3 = LED_RED;
                          +									BlinkM::led_color_4 = LED_OFF;
                          +									BlinkM::led_color_5 = LED_OFF;
                          +									BlinkM::led_color_6 = LED_OFF;
                          +									BlinkM::led_blink = LED_BLINK;
                          +
                          +									/* handle 4th led - flightmode indicator */
                          +									switch((int)vehicle_status_raw.flight_mode) {
                          +										case VEHICLE_FLIGHT_MODE_MANUAL:
                          +												BlinkM::led_color_4 = LED_OFF;
                          +											break;
                          +
                          +										case VEHICLE_FLIGHT_MODE_STAB:
                          +												BlinkM::led_color_4 = LED_YELLOW;
                          +											break;
                          +
                          +										case VEHICLE_FLIGHT_MODE_HOLD:
                          +												BlinkM::led_color_4 = LED_BLUE;
                          +											break;
                          +
                          +										case VEHICLE_FLIGHT_MODE_AUTO:
                          +												BlinkM::led_color_4 = LED_GREEN;
                          +											break;
                          +									}
                          +
                          +									/* handling used sat´s */
                          +									if(num_of_used_sats >= 7) {
                          +										BlinkM::led_color_1 = LED_OFF;
                          +										BlinkM::led_color_2 = LED_OFF;
                          +										BlinkM::led_color_3 = LED_OFF;
                          +									} else if(num_of_used_sats == 6) {
                          +										BlinkM::led_color_2 = LED_OFF;
                          +										BlinkM::led_color_3 = LED_OFF;
                          +									} else if(num_of_used_sats == 5) {
                          +										BlinkM::led_color_3 = LED_OFF;
                          +									}
                          +								}
                          +							}
                          +						}
                          +
                          +
                          +					printf( " Volt:%8.4f\tArmed:%4u\tMode:%4u\tCells:%4u\tBattWarn:%4u\tSats:%4u\tFix:%4u\tVisible:%4u\n",
                          +					vehicle_status_raw.voltage_battery,
                          +					vehicle_status_raw.flag_system_armed,
                          +					vehicle_status_raw.flight_mode,
                          +					num_of_cells,
                          +					vehicle_status_raw.battery_warning,
                          +					num_of_used_sats,
                          +					vehicle_gps_position_raw.fix_type,
                          +					vehicle_gps_position_raw.satellites_visible);
                          +
                          +				}
                          +			}
                          +
                          +			led_thread_runcount=1;
                          +			led_thread_ready = true;
                          +			led_interval = LED_OFFTIME;
                          +
                          +			if(detected_cells_runcount < 5){
                          +				detected_cells_runcount++;
                          +			} else {
                          +				detected_cells_blinked = true;
                          +			}
                          +
                          +			break;
                          +		default:
                          +			led_thread_runcount=1;
                          +			t_led_blink = 0;
                          +			led_thread_ready = true;
                          +			break;
                          +	}
                          +
                          +	if(BlinkM::systemstate_run == 1) {
                          +		/* re-queue ourselves to run again later */
                          +		work_queue(LPWORK, &_work, (worker_t)&BlinkM::led_trampoline, this, led_interval);
                          +	}
                          +}
                          +
                          +void BlinkM::setLEDColor(int ledcolor) {
                          +	switch (ledcolor) {
                          +		case LED_OFF:	// off
                          +			BlinkM::set_rgb(0,0,0);
                          +			break;
                          +		case LED_RED:	// red
                          +			BlinkM::set_rgb(255,0,0);
                          +			break;
                          +		case LED_YELLOW:	// yellow
                          +			BlinkM::set_rgb(255,70,0);
                          +			break;
                          +		case LED_PURPLE:	// purple
                          +			BlinkM::set_rgb(255,0,255);
                          +			break;
                          +		case LED_GREEN:	// green
                          +			BlinkM::set_rgb(0,255,0);
                          +			break;
                          +		case LED_BLUE:	// blue
                          +			BlinkM::set_rgb(0,0,255);
                          +			break;
                          +		case LED_WHITE:	// white
                          +			BlinkM::set_rgb(255,255,255);
                          +			break;
                          +	}
                           }
                           
                           int
                          @@ -413,7 +853,6 @@ BlinkM::get_rgb(uint8_t &r, uint8_t &g, uint8_t &b)
                           	return ret;
                           }
                           
                          -
                           int
                           BlinkM::get_firmware_version(uint8_t version[2])
                           {
                          @@ -443,9 +882,21 @@ blinkm_main(int argc, char *argv[])
                           		exit(0);
                           	}
                           
                          +
                           	if (g_blinkm == nullptr)
                           		errx(1, "not started");
                           
                          +	if (!strcmp(argv[1], "systemstate")) {
                          +		g_blinkm->setMode(1);
                          +		exit(0);
                          +	}
                          +
                          +	if (!strcmp(argv[1], "ledoff")) {
                          +		g_blinkm->setMode(0);
                          +		exit(0);
                          +	}
                          +
                          +
                           	if (!strcmp(argv[1], "list")) {
                           		for (unsigned i = 0; BlinkM::script_names[i] != nullptr; i++)
                           			fprintf(stderr, "    %s\n", BlinkM::script_names[i]);
                          @@ -458,8 +909,9 @@ blinkm_main(int argc, char *argv[])
                           	if (fd < 0)
                           		err(1, "can't open BlinkM device");
                           
                          +	g_blinkm->setMode(0);
                           	if (ioctl(fd, BLINKM_PLAY_SCRIPT_NAMED, (unsigned long)argv[1]) == OK)
                           		exit(0);
                           
                          -	errx(1, "missing command, try 'start', 'list' or a script name");
                          -}
                          \ No newline at end of file
                          +	errx(1, "missing command, try 'start', 'systemstate', 'ledoff', 'list' or a script name.");
                          +}
                          
                          From 6d301710d97c3812a5f1e6c26415461b2fe92f58 Mon Sep 17 00:00:00 2001
                          From: px4dev 
                          Date: Sat, 12 Jan 2013 12:08:03 -0800
                          Subject: [PATCH 081/157] Suppress warnings from ARM's DSP_Lib code that are
                           spamming developers to no benefit.
                          
                          Addresses #149
                          ---
                           apps/mathlib/CMSIS/Include/arm_math.h | 4 ++--
                           apps/mathlib/CMSIS/Makefile           | 7 +++++++
                           2 files changed, 9 insertions(+), 2 deletions(-)
                          
                          diff --git a/apps/mathlib/CMSIS/Include/arm_math.h b/apps/mathlib/CMSIS/Include/arm_math.h
                          index fabd98be7a..f224d3eb03 100644
                          --- a/apps/mathlib/CMSIS/Include/arm_math.h
                          +++ b/apps/mathlib/CMSIS/Include/arm_math.h
                          @@ -5520,7 +5520,7 @@ extern "C"
                               *pIa = Ialpha;
                           
                               /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */
                          -    *pIb = -0.5 * Ialpha + (float32_t) 0.8660254039 *Ibeta;
                          +    *pIb = -0.5f * Ialpha + (float32_t) 0.8660254039f *Ibeta;
                           
                             }
                           
                          @@ -5898,7 +5898,7 @@ extern "C"
                                 /* Iniatilize output for below specified range as least output value of table */
                                 y = pYData[0];
                               }
                          -    else if(i >= S->nValues)
                          +    else if((unsigned)i >= S->nValues)
                               {
                                 /* Iniatilize output for above specified range as last output value of table */
                                 y = pYData[S->nValues - 1];
                          diff --git a/apps/mathlib/CMSIS/Makefile b/apps/mathlib/CMSIS/Makefile
                          index fa5de668af..9e28518bc7 100644
                          --- a/apps/mathlib/CMSIS/Makefile
                          +++ b/apps/mathlib/CMSIS/Makefile
                          @@ -45,6 +45,13 @@ INCLUDES		+= $(DSPLIB_SRCDIR)/Include \
                           			   $(DSPLIB_SRCDIR)/Device/ARM/ARMCM4/Include \
                           			   $(DSPLIB_SRCDIR)/Device/ARM/ARMCM3/Include
                           
                          +# Suppress some warnings that ARM should fix, but haven't.
                          +EXTRADEFINES		+= -Wno-unsuffixed-float-constants \
                          +			   -Wno-sign-compare \
                          +			   -Wno-shadow \
                          +			   -Wno-float-equal \
                          +			   -Wno-unused-variable
                          +
                           #
                           # Override the default visibility for symbols, since the CMSIS DSPLib doesn't
                           # have anything we can use to mark exported symbols.
                          
                          From 5b07efdbeb8b6c6e7c3e5a86a2e55a2de345b579 Mon Sep 17 00:00:00 2001
                          From: px4dev 
                          Date: Sat, 12 Jan 2013 12:10:06 -0800
                          Subject: [PATCH 082/157] Automatically generate depdencies for source files as
                           they are compiled, rather than using the NuttX dependency generator tool.
                          
                          ---
                           .gitignore            |  1 +
                           apps/mathlib/Makefile | 10 +++++++---
                           apps/mk/app.mk        | 26 +++++++++++++++-----------
                           3 files changed, 23 insertions(+), 14 deletions(-)
                          
                          diff --git a/.gitignore b/.gitignore
                          index d0d84b9854..f072889f0d 100644
                          --- a/.gitignore
                          +++ b/.gitignore
                          @@ -10,6 +10,7 @@ apps/namedapp/namedapp_proto.h
                           Make.dep
                           *.o
                           *.a
                          +*.d
                           *~
                           *.dSYM
                           Images/*.bin
                          diff --git a/apps/mathlib/Makefile b/apps/mathlib/Makefile
                          index e5fab1e354..e3aa9275ec 100644
                          --- a/apps/mathlib/Makefile
                          +++ b/apps/mathlib/Makefile
                          @@ -31,8 +31,6 @@
                           #
                           ############################################################################
                           
                          -include $(TOPDIR)/.config
                          -
                           #
                           # Math library
                           #
                          @@ -52,7 +50,13 @@ CXXHDRS		 = math/test/test.hpp \
                           		   math/Dcm.hpp \
                           		   math/Matrix.hpp
                           
                          -# XXX this really should be a CONFIG_* test
                          +#
                          +# In order to include .config we first have to save off the
                          +# current makefile name, since app.mk needs it.
                          +#
                          +APP_MAKEFILE	:= $(lastword $(MAKEFILE_LIST))
                          +-include $(TOPDIR)/.config
                          +
                           ifeq ($(CONFIG_ARCH_CORTEXM4)$(CONFIG_ARCH_FPU),yy)
                           INCLUDES	+= math/arm
                           CXXSRCS		+= math/arm/Vector.cpp \
                          diff --git a/apps/mk/app.mk b/apps/mk/app.mk
                          index 1d8b0e44c1..c5a0253940 100644
                          --- a/apps/mk/app.mk
                          +++ b/apps/mk/app.mk
                          @@ -81,7 +81,9 @@
                           # Work out who included us so we can report decent errors
                           #
                           THIS_MAKEFILE	:= $(lastword $(MAKEFILE_LIST))
                          -PARENT_MAKEFILE	:= $(lastword $(filter-out $(THIS_MAKEFILE),$(MAKEFILE_LIST)))
                          +ifeq ($(APP_MAKEFILE),)
                          +APP_MAKEFILE	:= $(lastword $(filter-out $(THIS_MAKEFILE),$(MAKEFILE_LIST)))
                          +endif
                           
                           ############################################################################
                           # Get configuration
                          @@ -93,7 +95,7 @@ include $(APPDIR)/Make.defs
                           ############################################################################
                           # Sanity-check the information we've been given and set any defaults
                           #
                          -SRCDIR		?= $(dir $(PARENT_MAKEFILE))
                          +SRCDIR		?= $(dir $(APP_MAKEFILE))
                           PRIORITY	?= SCHED_PRIORITY_DEFAULT
                           STACKSIZE	?= CONFIG_PTHREAD_STACK_DEFAULT
                           
                          @@ -112,14 +114,14 @@ endif
                           
                           # there has to be a source file
                           ifeq ($(ASRCS)$(CSRCS)$(CXXSRCS),)
                          -$(error $(realpath $(PARENT_MAKEFILE)): at least one of ASRCS, CSRCS or CXXSRCS must be set)
                          +$(error $(realpath $(APP_MAKEFILE)): at least one of ASRCS, CSRCS or CXXSRCS must be set)
                           endif
                           
                           # check that C++ is configured if we have C++ source files and we are building
                           ifneq ($(CXXSRCS),)
                           ifneq ($(CONFIG_HAVE_CXX),y)
                           ifeq ($(MAKECMDGOALS),build)
                          -$(error $(realpath $(PARENT_MAKEFILE)): cannot set CXXSRCS if CONFIG_HAVE_CXX not set in configuration)
                          +$(error $(realpath $(APP_MAKEFILE)): cannot set CXXSRCS if CONFIG_HAVE_CXX not set in configuration)
                           endif
                           endif
                           endif
                          @@ -153,6 +155,11 @@ COBJS		 = $(patsubst %.c,%.o,$(CSRCS))
                           CXXOBJS		 = $(patsubst %.cpp,%.o,$(CXXSRCS))
                           OBJS		 = $(AOBJS) $(COBJS) $(CXXOBJS)
                           
                          +# Automatic depdendency generation
                          +DEPS		 = $(OBJS:$(OBJEXT)=.d)
                          +CFLAGS		+= -MD
                          +CXXFLAGS	+= -MD
                          +
                           # The prelinked object that we are ultimately going to build
                           ifneq ($(APPNAME),)
                           PRELINKOBJ	 = $(APPNAME).pre.o
                          @@ -186,11 +193,8 @@ all:		.built
                           #
                           # Source dependencies
                           #
                          -depend:		.depend
                          -.depend:	$(MAKEFILE_LIST) $(SRCS)
                          -	@$(MKDEP) --dep-path . $(CC) -- $(CFLAGS) -- $(CSRCS) $(CHDRS) >Make.dep
                          -	@$(MKDEP) --dep-path . $(CXX) -- $(CXXFLAGS) -- $(CXXSRCS) $(CXXHDRS) >>Make.dep
                          -	@touch $@
                          +depend:
                          +	@exit 0
                           
                           ifneq ($(APPNAME),)
                           #
                          @@ -223,10 +227,10 @@ $(CXXOBJS): %.o : %.cpp
                           # Tidying up
                           #
                           clean:
                          -	@rm -f $(OBJS) $(PRELINKOBJ) Make.dep .built
                          +	@rm -f $(OBJS) $(DEPS) $(PRELINKOBJ) .built
                           	$(call CLEAN)
                           
                           distclean:	clean
                           	@rm -f Make.dep .depend
                           
                          --include Make.dep
                          +-include $(DEPS)
                          
                          From 1c63eda98bb89d0d206efb88195020f5822d7df8 Mon Sep 17 00:00:00 2001
                          From: px4dev 
                          Date: Sat, 12 Jan 2013 12:39:29 -0800
                          Subject: [PATCH 083/157] Objects depend on the makefile chain as well.
                          
                          ---
                           apps/mk/app.mk | 11 ++++-------
                           1 file changed, 4 insertions(+), 7 deletions(-)
                          
                          diff --git a/apps/mk/app.mk b/apps/mk/app.mk
                          index c5a0253940..7cbdc3e620 100644
                          --- a/apps/mk/app.mk
                          +++ b/apps/mk/app.mk
                          @@ -167,13 +167,9 @@ else
                           PRELINKOBJ	 = $(LIBNAME).pre.o
                           endif
                           
                          -# The archive that the object file will be placed in
                           # XXX does WINTOOL ever get set?
                           ifeq ($(WINTOOL),y)
                             INCDIROPT	= -w
                          -  BIN		 = "$(shell cygpath -w  $(APPDIR)/libapps$(LIBEXT))"
                          -else
                          -  BIN		 = "$(APPDIR)/libapps$(LIBEXT)"
                           endif
                           
                           ############################################################################
                          @@ -206,6 +202,7 @@ context:	.context
                           	@touch $@
                           else
                           context:
                          +	@exit 0
                           endif
                           
                           #
                          @@ -214,13 +211,13 @@ endif
                           $(PRELINKOBJ):	$(OBJS)
                           	$(call PRELINK, $@, $(OBJS))
                           
                          -$(AOBJS): %.o : %.S
                          +$(AOBJS): %.o : %.S $(MAKEFILE_LIST)
                           	$(call ASSEMBLE, $<, $@)
                           
                          -$(COBJS): %.o : %.c
                          +$(COBJS): %.o : %.c $(MAKEFILE_LIST)
                           	$(call COMPILE, $<, $@)
                           
                          -$(CXXOBJS): %.o : %.cpp
                          +$(CXXOBJS): %.o : %.cpp $(MAKEFILE_LIST)
                           	$(call COMPILEXX, $<, $@)
                           
                           #
                          
                          From dba244a8d48b8367c8ca14abaf5ff3b46ab7ad08 Mon Sep 17 00:00:00 2001
                          From: px4dev 
                          Date: Sat, 12 Jan 2013 12:46:46 -0800
                          Subject: [PATCH 084/157] Fix a build breaker, remove C*HDRS as they aren't
                           used.
                          
                          ---
                           apps/controllib/Makefile |  7 -------
                           apps/mathlib/Makefile    | 12 ------------
                           apps/mk/app.mk           |  4 ++++
                           3 files changed, 4 insertions(+), 19 deletions(-)
                          
                          diff --git a/apps/controllib/Makefile b/apps/controllib/Makefile
                          index 99cf910690..6749b805fa 100644
                          --- a/apps/controllib/Makefile
                          +++ b/apps/controllib/Makefile
                          @@ -43,11 +43,4 @@ CXXSRCS		 = block/Block.cpp \
                           		   blocks.cpp \
                           		   fixedwing.cpp
                           
                          -CXXHDRS		 = block/Block.hpp \
                          -		   block/BlockParam.hpp \
                          -		   block/UOrbPublication.hpp \
                          -		   block/UOrbSubscription.hpp \
                          -		   blocks.hpp \
                          -		   fixedwing.hpp
                          -
                           include $(APPDIR)/mk/app.mk
                          diff --git a/apps/mathlib/Makefile b/apps/mathlib/Makefile
                          index e3aa9275ec..7eebd6ae0b 100644
                          --- a/apps/mathlib/Makefile
                          +++ b/apps/mathlib/Makefile
                          @@ -42,14 +42,6 @@ CXXSRCS		 = math/test/test.cpp \
                           		   math/Dcm.cpp \
                           		   math/Matrix.cpp
                           
                          -CXXHDRS		 = math/test/test.hpp \
                          -		   math/Vector.hpp \
                          -		   math/Vector3.hpp \
                          -		   math/EulerAngles.hpp \
                          -		   math/Quaternion.hpp \
                          -		   math/Dcm.hpp \
                          -		   math/Matrix.hpp
                          -
                           #
                           # In order to include .config we first have to save off the
                           # current makefile name, since app.mk needs it.
                          @@ -61,14 +53,10 @@ ifeq ($(CONFIG_ARCH_CORTEXM4)$(CONFIG_ARCH_FPU),yy)
                           INCLUDES	+= math/arm
                           CXXSRCS		+= math/arm/Vector.cpp \
                           		   math/arm/Matrix.cpp
                          -CXXHDRS		+= math/arm/Vector.hpp \
                          -		   math/arm/Matrix.hpp
                           else
                           INCLUDES	+= math/generic
                           CXXSRCS		+= math/generic/Vector.cpp \
                           		   math/generic/Matrix.cpp
                          -CXXHDRS		+= math/generic/Vector.hpp \
                          -		   math/generic/Matrix.hpp
                           endif
                           
                           include $(APPDIR)/mk/app.mk
                          diff --git a/apps/mk/app.mk b/apps/mk/app.mk
                          index 7cbdc3e620..fa4a12cab6 100644
                          --- a/apps/mk/app.mk
                          +++ b/apps/mk/app.mk
                          @@ -167,9 +167,13 @@ else
                           PRELINKOBJ	 = $(LIBNAME).pre.o
                           endif
                           
                          +# The archive the prelinked object will be linked into
                           # XXX does WINTOOL ever get set?
                           ifeq ($(WINTOOL),y)
                             INCDIROPT	= -w
                          +  BIN		 = "$(shell cygpath -w  $(APPDIR)/libapps$(LIBEXT))"
                          +else
                          +  BIN		 = "$(APPDIR)/libapps$(LIBEXT)"
                           endif
                           
                           ############################################################################
                          
                          From 8ec566d0cb0078e027355798d2ed2670ee23d928 Mon Sep 17 00:00:00 2001
                          From: Marco Bauer 
                          Date: Sat, 12 Jan 2013 21:54:39 +0100
                          Subject: [PATCH 085/157] fix number of satellites
                          
                          ---
                           apps/drivers/blinkm/blinkm.cpp | 6 +++---
                           1 file changed, 3 insertions(+), 3 deletions(-)
                          
                          diff --git a/apps/drivers/blinkm/blinkm.cpp b/apps/drivers/blinkm/blinkm.cpp
                          index 19f3b4d731..ebe38ca43c 100644
                          --- a/apps/drivers/blinkm/blinkm.cpp
                          +++ b/apps/drivers/blinkm/blinkm.cpp
                          @@ -544,7 +544,7 @@ BlinkM::led()
                           					orb_copy(ORB_ID(vehicle_status), vehicle_status_sub_fd, &vehicle_status_raw);
                           
                           					/* vehicle_gps_position */
                          -					orb_copy(ORB_ID(vehicle_gps_position), vehicle_status_sub_fd, &vehicle_gps_position_raw);
                          +					orb_copy(ORB_ID(vehicle_gps_position), vehicle_gps_position_sub_fd, &vehicle_gps_position_raw);
                           
                           					/* get actual battery voltage */
                           					system_voltage = (int)vehicle_status_raw.voltage_battery*10;
                          @@ -642,7 +642,7 @@ BlinkM::led()
                           							}
                           						}
                           
                          -
                          +/*
                           					printf( " Volt:%8.4f\tArmed:%4u\tMode:%4u\tCells:%4u\tBattWarn:%4u\tSats:%4u\tFix:%4u\tVisible:%4u\n",
                           					vehicle_status_raw.voltage_battery,
                           					vehicle_status_raw.flag_system_armed,
                          @@ -652,7 +652,7 @@ BlinkM::led()
                           					num_of_used_sats,
                           					vehicle_gps_position_raw.fix_type,
                           					vehicle_gps_position_raw.satellites_visible);
                          -
                          +*/
                           				}
                           			}
                           
                          
                          From 15b61d4c15730c7a3e832a47f454ec7398303b55 Mon Sep 17 00:00:00 2001
                          From: Lorenz Meier 
                          Date: Sat, 12 Jan 2013 22:41:32 +0100
                          Subject: [PATCH 086/157] Improved battery voltage init, removed bogus printf()
                           from debugging
                          
                          ---
                           apps/sensors/sensors.cpp | 6 +++++-
                           1 file changed, 5 insertions(+), 1 deletion(-)
                          
                          diff --git a/apps/sensors/sensors.cpp b/apps/sensors/sensors.cpp
                          index 8b5c66b4fc..577dc483b3 100644
                          --- a/apps/sensors/sensors.cpp
                          +++ b/apps/sensors/sensors.cpp
                          @@ -994,6 +994,11 @@ Sensors::adc_poll(struct sensor_combined_s &raw)
                           
                           				if (voltage > VOLTAGE_BATTERY_IGNORE_THRESHOLD_VOLTS) {
                           
                          +					/* one-time initialization of low-pass value to avoid long init delays */
                          +					if (_battery_status.voltage_v < 3.0f) {
                          +						_battery_status.voltage_v = voltage;
                          +					}
                          +
                           					_battery_status.timestamp = hrt_absolute_time();
                           					_battery_status.voltage_v = (BAT_VOL_LOWPASS_1 * (_battery_status.voltage_v + BAT_VOL_LOWPASS_2 * voltage));;
                           					/* current and discharge are unknown */
                          @@ -1003,7 +1008,6 @@ Sensors::adc_poll(struct sensor_combined_s &raw)
                           					/* announce the battery voltage if needed, just publish else */
                           					if (_battery_pub > 0) {
                           						orb_publish(ORB_ID(battery_status), _battery_pub, &_battery_status);
                          -						printf("DBG: ADC PUB: %d, val: %d\n", ret, (int)(buf_adc[0].am_data));
                           
                           					} else {
                           						_battery_pub = orb_advertise(ORB_ID(battery_status), &_battery_status);
                          
                          From acbfd66e6726ec9dd8a4af53cfb47144a54c7e6f Mon Sep 17 00:00:00 2001
                          From: Lorenz Meier 
                          Date: Sat, 12 Jan 2013 23:26:26 +0100
                          Subject: [PATCH 087/157] Cleaned up tests further, in anticipation of merges
                           with other branches
                          
                          ---
                           apps/px4/tests/test_sleep.c |  3 +--
                           apps/px4/tests/tests_main.c | 19 +++++++++++++------
                           2 files changed, 14 insertions(+), 8 deletions(-)
                          
                          diff --git a/apps/px4/tests/test_sleep.c b/apps/px4/tests/test_sleep.c
                          index c7b9d28336..ae682b542d 100644
                          --- a/apps/px4/tests/test_sleep.c
                          +++ b/apps/px4/tests/test_sleep.c
                          @@ -90,9 +90,8 @@ int test_sleep(int argc, char *argv[])
                           	printf("\t %d 100ms sleeps\n", nsleeps);
                           	fflush(stdout);
                           
                          -	for (int i = 0; i < nsleeps; i++) {
                          +	for (unsigned int i = 0; i < nsleeps; i++) {
                           		usleep(100000);
                          -		//printf("\ttick\n");
                           	}
                           
                           	printf("\t Sleep test successful.\n");
                          diff --git a/apps/px4/tests/tests_main.c b/apps/px4/tests/tests_main.c
                          index 5c3b0b0c26..c392d0c4b1 100644
                          --- a/apps/px4/tests/tests_main.c
                          +++ b/apps/px4/tests/tests_main.c
                          @@ -78,11 +78,10 @@ static int test_jig(int argc, char *argv[]);
                            * Private Data
                            ****************************************************************************/
                           
                          -struct {
                          +const struct {
                           	const char 	*name;
                           	int	(* fn)(int argc, char *argv[]);
                           	unsigned	options;
                          -	int			passed;
                           #define OPT_NOHELP	(1<<0)
                           #define OPT_NOALLTEST	(1<<1)
                           #define OPT_NOJIGTEST	(1<<2)
                          @@ -135,6 +134,10 @@ test_all(int argc, char *argv[])
                           	unsigned int failcount = 0;
                           	unsigned int testscount = 0;
                           
                          +	/* store test results */
                          +	bool passed[(sizeof(tests) / sizeof(tests[0]))];
                          +	memset(&passed, 0, sizeof(passed));
                          +
                           	printf("\nRunning all tests...\n\n");
                           
                           	for (i = 0; tests[i].name; i++) {
                          @@ -150,7 +153,7 @@ test_all(int argc, char *argv[])
                           				failcount++;
                           
                           			} else {
                          -				tests[i].passed = 1;
                          +				passed[i] = true;
                           				printf("  [%s] \t\t\tPASS\n", tests[i].name);
                           				fflush(stdout);
                           			}
                          @@ -198,7 +201,7 @@ test_all(int argc, char *argv[])
                           	unsigned int k;
                           
                           	for (k = 0; k < i; k++) {
                          -		if ((tests[k].passed == 0) && !(tests[k].options & OPT_NOALLTEST)) {
                          +		if (!passed[k] && !(tests[k].options & OPT_NOALLTEST)) {
                           			printf(" [%s] to obtain details, please re-run with\n\t nsh> tests %s\n\n", tests[k].name, tests[k].name);
                           		}
                           	}
                          @@ -247,6 +250,10 @@ int test_jig(int argc, char *argv[])
                           	unsigned int failcount = 0;
                           	unsigned int testscount = 0;
                           
                          +	/* store test results */
                          +	bool passed[(sizeof(tests) / sizeof(tests[0]))];
                          +	memset(&passed, 0, sizeof(passed));
                          +
                           	printf("\nRunning all tests...\n\n");
                           	for (i = 0; tests[i].name; i++) {
                           		/* Only run tests that are not excluded */
                          @@ -259,7 +266,7 @@ int test_jig(int argc, char *argv[])
                           				fflush(stderr);
                           				failcount++;
                           			} else {
                          -				tests[i].passed = 1;
                          +				passed[i] = true;
                           				printf("  [%s] \t\t\tPASS\n", tests[i].name);
                           				fflush(stdout);
                           			}
                          @@ -302,7 +309,7 @@ int test_jig(int argc, char *argv[])
                           	unsigned int k;
                           	for (k = 0; k < i; k++)
                           	{
                          -		if ((tests[k].passed == 0) && !(tests[k].options & OPT_NOJIGTEST))
                          +		if (!passed[k] && !(tests[k].options & OPT_NOJIGTEST))
                           		{
                           			printf(" [%s] to obtain details, please re-run with\n\t nsh> tests %s\n\n", tests[k].name, tests[k].name);
                           		}
                          
                          From 054bb69cc7001fbfa3f8f674445ef7b4cd2decf6 Mon Sep 17 00:00:00 2001
                          From: Lorenz Meier 
                          Date: Sun, 13 Jan 2013 09:24:51 +0100
                          Subject: [PATCH 088/157] Showing correct test count also in success case
                          
                          ---
                           apps/px4/tests/tests_main.c | 4 ++--
                           1 file changed, 2 insertions(+), 2 deletions(-)
                          
                          diff --git a/apps/px4/tests/tests_main.c b/apps/px4/tests/tests_main.c
                          index c392d0c4b1..9fb5ac482b 100644
                          --- a/apps/px4/tests/tests_main.c
                          +++ b/apps/px4/tests/tests_main.c
                          @@ -181,7 +181,7 @@ test_all(int argc, char *argv[])
                           		printf("  \\ \\_\\ \\_\\  \\ \\_____\\  \\ \\_____\\     \\ \\_____\\  \\ \\_\\ \\_\\ \n");
                           		printf("   \\/_/\\/_/   \\/_____/   \\/_____/      \\/_____/   \\/_/\\/_/ \n");
                           		printf("\n");
                          -		printf(" All tests passed (%d of %d)\n", i, i);
                          +		printf(" All tests passed (%d of %d)\n", testscount, testscount);
                           
                           	} else {
                           		printf("  ______   ______     __     __ \n");
                          @@ -292,7 +292,7 @@ int test_jig(int argc, char *argv[])
                           		printf("  \\ \\_\\ \\_\\  \\ \\_____\\  \\ \\_____\\     \\ \\_____\\  \\ \\_\\ \\_\\ \n");
                           		printf("   \\/_/\\/_/   \\/_____/   \\/_____/      \\/_____/   \\/_/\\/_/ \n");
                           		printf("\n");
                          -		printf(" All tests passed (%d of %d)\n", i, i);
                          +		printf(" All tests passed (%d of %d)\n", testscount, testscount);
                           	} else {
                           		printf("  ______   ______     __     __ \n");
                           		printf(" /\\  ___\\ /\\  __ \\   /\\ \\   /\\ \\    \n");
                          
                          From ca690f60272b5330f632cd18b58ee9af89fbc9ae Mon Sep 17 00:00:00 2001
                          From: Lorenz Meier 
                          Date: Sun, 13 Jan 2013 09:35:56 +0100
                          Subject: [PATCH 089/157] Fixed #153 - when no microSD card is present, test
                           used to hang, now aborts with error.
                          
                          ---
                           apps/px4/tests/tests_file.c | 8 ++++++++
                           1 file changed, 8 insertions(+)
                          
                          diff --git a/apps/px4/tests/tests_file.c b/apps/px4/tests/tests_file.c
                          index 697410cee4..6f75b9812e 100644
                          --- a/apps/px4/tests/tests_file.c
                          +++ b/apps/px4/tests/tests_file.c
                          @@ -37,6 +37,7 @@
                            * File write test.
                            */
                           
                          +#include 
                           #include 
                           #include 
                           #include 
                          @@ -51,6 +52,13 @@
                           int
                           test_file(int argc, char *argv[])
                           {
                          +	/* check if microSD card is mounted */
                          +	struct stat buffer;
                          +	if (stat("/fs/microsd/", &buffer)) {
                          +		warnx("no microSD card mounted, aborting file test");
                          +		return 1;
                          +	}
                          +
                           	uint8_t buf[512];
                           	hrt_abstime start, end;
                           	perf_counter_t wperf = perf_alloc(PC_ELAPSED, "SD writes");
                          
                          From edc3ae7b6cbbbd5d61837cbd44a12d9c22770faf Mon Sep 17 00:00:00 2001
                          From: Marco Bauer 
                          Date: Sun, 13 Jan 2013 13:50:07 +0100
                          Subject: [PATCH 090/157] some changes in structure
                          
                          ---
                           Makefile                       |   3 +-
                           apps/drivers/blinkm/blinkm.cpp | 295 ++++++++++++++++-----------------
                           2 files changed, 143 insertions(+), 155 deletions(-)
                          
                          diff --git a/Makefile b/Makefile
                          index d9469bb49a..d3f859a251 100644
                          --- a/Makefile
                          +++ b/Makefile
                          @@ -109,7 +109,8 @@ ifeq ($(SYSTYPE),Linux)
                           SERIAL_PORTS		?= "/dev/ttyACM5,/dev/ttyACM4,/dev/ttyACM3,/dev/ttyACM2,/dev/ttyACM1,/dev/ttyACM0"
                           endif
                           ifeq ($(SERIAL_PORTS),)
                          -SERIAL_PORTS		 = "\\\\.\\COM32,\\\\.\\COM31,\\\\.\\COM30,\\\\.\\COM29,\\\\.\\COM28,\\\\.\\COM27,\\\\.\\COM26,\\\\.\\COM25,\\\\.\\COM24,\\\\.\\COM23,\\\\.\\COM22,\\\\.\\COM21,\\\\.\\COM20,\\\\.\\COM19,\\\\.\\COM18,\\\\.\\COM17,\\\\.\\COM16,\\\\.\\COM15,\\\\.\\COM14,\\\\.\\COM13,\\\\.\\COM12,\\\\.\\COM11,\\\\.\\COM10,\\\\.\\COM9,\\\\.\\COM8,\\\\.\\COM7,\\\\.\\COM6,\\\\.\\COM5,\\\\.\\COM4,\\\\.\\COM3,\\\\.\\COM2,\\\\.\\COM1,\\\\.\\COM0"
                          +#SERIAL_PORTS		 = "\\\\.\\COM32,\\\\.\\COM31,\\\\.\\COM30,\\\\.\\COM29,\\\\.\\COM28,\\\\.\\COM27,\\\\.\\COM26,\\\\.\\COM25,\\\\.\\COM24,\\\\.\\COM23,\\\\.\\COM22,\\\\.\\COM21,\\\\.\\COM20,\\\\.\\COM19,\\\\.\\COM18,\\\\.\\COM17,\\\\.\\COM16,\\\\.\\COM15,\\\\.\\COM14,\\\\.\\COM13,\\\\.\\COM12,\\\\.\\COM11,\\\\.\\COM10,\\\\.\\COM9,\\\\.\\COM8,\\\\.\\COM7,\\\\.\\COM6,\\\\.\\COM5,\\\\.\\COM4,\\\\.\\COM3,\\\\.\\COM2,\\\\.\\COM1,\\\\.\\COM0"
                          +SERIAL_PORTS		 = "\\\\.\\COM3,\\\\.\\COM2,\\\\.\\COM1,\\\\.\\COM0"
                           endif
                           
                           upload:		$(FIRMWARE_BUNDLE) $(UPLOADER)
                          diff --git a/apps/drivers/blinkm/blinkm.cpp b/apps/drivers/blinkm/blinkm.cpp
                          index ebe38ca43c..90dfa3eeaf 100644
                          --- a/apps/drivers/blinkm/blinkm.cpp
                          +++ b/apps/drivers/blinkm/blinkm.cpp
                          @@ -149,6 +149,21 @@ private:
                           		MORSE_CODE
                           	};
                           
                          +	enum systemDefines {
                          +		LED_OFF,
                          +		LED_RED,
                          +		LED_YELLOW,
                          +		LED_PURPLE,
                          +		LED_GREEN,
                          +		LED_BLUE,
                          +		LED_WHITE,
                          +		LED_ONTIME=100,
                          +		LED_OFFTIME=100,
                          +		LED_NOBLINK=0,
                          +		LED_BLINK=1,
                          +		MAX_CELL_VOLTAGE=43
                          +	};
                          +
                           	work_s			_work;
                           
                           	static int led_color_1;
                          @@ -159,7 +174,7 @@ private:
                           	static int led_color_6;
                           	static int led_blink;
                           
                          -	static int systemstate_run;
                          +	static bool systemstate_run;
                           
                           	void 			setLEDColor(int ledcolor);
                           	static void		led_trampoline(void *arg);
                          @@ -218,19 +233,6 @@ const char *BlinkM::script_names[] = {
                           	nullptr
                           };
                           
                          -#define MAX_CELL_VOLTAGE 	43	/* cell voltage if full charged */
                          -
                          -#define LED_OFF  			0
                          -#define LED_RED  			1
                          -#define LED_YELLOW  	2
                          -#define LED_PURPLE  	3
                          -#define LED_GREEN  		4
                          -#define LED_BLUE  		5
                          -#define LED_WHITE  		6
                          -#define LED_ONTIME  	100
                          -#define LED_OFFTIME  	100
                          -#define LED_BLINK  		1
                          -#define LED_NOBLINK  	0
                           
                           int BlinkM::led_color_1 = LED_OFF;
                           int BlinkM::led_color_2 = LED_OFF;
                          @@ -240,7 +242,8 @@ int BlinkM::led_color_5 = LED_OFF;
                           int BlinkM::led_color_6 = LED_OFF;
                           int BlinkM::led_blink = LED_NOBLINK;
                           
                          -int BlinkM::systemstate_run = 0;
                          +bool BlinkM::systemstate_run = false;
                          +
                           
                           extern "C" __EXPORT int blinkm_main(int argc, char *argv[]);
                           
                          @@ -281,28 +284,26 @@ int
                           BlinkM::setMode(int mode)
                           {
                           	if(mode == 1) {
                          -		if(BlinkM::systemstate_run == 0) {
                          +		if(BlinkM::systemstate_run == false) {
                           			/* set some sensible defaults */
                           			set_fade_speed(255);
                           
                           			/* turn off by default */
                           			play_script(BLACK);
                          -			set_fade_speed(255);
                           			stop_script();
                          -			set_rgb(0,0,0);
                          -			BlinkM::systemstate_run = 1;
                          +			//set_rgb(0,0,0);
                          +			BlinkM::systemstate_run = true;
                           			work_queue(LPWORK, &_work, (worker_t)&BlinkM::led_trampoline, this, 1);
                           		}
                           	} else {
                          -		BlinkM::systemstate_run = 0;
                          +		BlinkM::systemstate_run = false;
                           		usleep(1000000);
                           		/* set some sensible defaults */
                           		set_fade_speed(255);
                           		/* turn off by default */
                           		play_script(BLACK);
                          -		set_fade_speed(255);
                           		stop_script();
                          -		set_rgb(0,0,0);
                          +		//set_rgb(0,0,0);
                           	}
                           
                           	return OK;
                          @@ -403,7 +404,6 @@ BlinkM::led()
                           
                           	int system_voltage = 0;
                           	int num_of_used_sats = 0;
                          -	int poll_ret;
                           
                           	if(!topic_initialized) {
                           		vehicle_status_sub_fd = orb_subscribe(ORB_ID(vehicle_status));
                          @@ -415,12 +415,6 @@ BlinkM::led()
                           		topic_initialized = true;
                           	}
                           
                          -	pollfd fds[2];
                          -	fds[0].fd = vehicle_status_sub_fd;
                          -	fds[0].events = POLLIN;
                          -	fds[1].fd = vehicle_gps_position_sub_fd;
                          -	fds[1].events = POLLIN;
                          -
                           	if(led_thread_ready == true) {
                           		if(!detected_cells_blinked) {
                           			if(num_of_cells > 0) {
                          @@ -523,139 +517,132 @@ BlinkM::led()
                           				BlinkM::setLEDColor(LED_OFF);
                           			}
                           
                          -			//poll_ret = ::poll(&fds[0],1,1000);
                          -			poll_ret = ::poll(fds, 2, 1000);
                          +			/* obtained data for the first file descriptor */
                          +			struct vehicle_status_s vehicle_status_raw;
                          +			struct vehicle_gps_position_s vehicle_gps_position_raw;
                           
                          -			if (poll_ret == 0) {
                          -				/* this means none of our providers is giving us data */
                          -				printf("[blinkm_systemstate_sensor] Got no data within a second\n");
                          -			} else if (poll_ret < 0) {
                          -				/* this is seriously bad - should be an emergency */
                          -				log("poll error %d", errno);
                          -				usleep(1000000);
                          -			} else {
                          -				if (fds[0].revents & POLLIN) {
                          -					/* obtained data for the first file descriptor */
                          -					struct vehicle_status_s vehicle_status_raw;
                          -					struct vehicle_gps_position_s vehicle_gps_position_raw;
                          -					/* copy sensors raw data into local buffer */
                          +			bool new_data;
                          +			orb_check(vehicle_status_sub_fd, &new_data);
                           
                          -					/* vehicle_status */
                          -					orb_copy(ORB_ID(vehicle_status), vehicle_status_sub_fd, &vehicle_status_raw);
                          +			if (new_data) {
                          +				orb_copy(ORB_ID(vehicle_status), vehicle_status_sub_fd, &vehicle_status_raw);
                          +			}
                           
                          -					/* vehicle_gps_position */
                          -					orb_copy(ORB_ID(vehicle_gps_position), vehicle_gps_position_sub_fd, &vehicle_gps_position_raw);
                          +			orb_check(vehicle_gps_position_sub_fd, &new_data);
                           
                          -					/* get actual battery voltage */
                          -					system_voltage = (int)vehicle_status_raw.voltage_battery*10;
                          +			if (new_data) {
                          +				orb_copy(ORB_ID(vehicle_gps_position), vehicle_gps_position_sub_fd, &vehicle_gps_position_raw);
                          +			}
                           
                          -					/* get number of used satellites in navigation */
                          -					num_of_used_sats = 0;
                          -					for(int satloop=0; satloop<20; satloop++) {
                          -						if(vehicle_gps_position_raw.satellite_used[satloop] == 1) {
                          -							num_of_used_sats++;
                          -						}
                          -					}
                          +			/* get actual battery voltage */
                          +			system_voltage = (int)vehicle_status_raw.voltage_battery*10;
                           
                          -					if(num_of_cells == 0) {
                          -							/* looking for lipo cells that are connected */
                          -						printf(" checking cells\n");
                          -						for(num_of_cells = 2; num_of_cells < 7; num_of_cells++) {
                          -							if(system_voltage < num_of_cells * MAX_CELL_VOLTAGE) break;
                          -						}
                          -						printf(" cells found:%u\n", num_of_cells);
                          -						} else {
                          -							if(vehicle_status_raw.battery_warning == VEHICLE_BATTERY_WARNING_WARNING) {
                          -								/* LED Pattern for battery low warning */
                          -								BlinkM::led_color_1 = LED_YELLOW;
                          -								BlinkM::led_color_2 = LED_YELLOW;
                          -								BlinkM::led_color_3 = LED_YELLOW;
                          -								BlinkM::led_color_4 = LED_YELLOW;
                          -								BlinkM::led_color_5 = LED_YELLOW;
                          -								BlinkM::led_color_6 = LED_YELLOW;
                          -								BlinkM::led_blink = LED_BLINK;
                          -
                          -							} else if(vehicle_status_raw.battery_warning == VEHICLE_BATTERY_WARNING_ALERT) {
                          -								/* LED Pattern for battery critical alerting */
                          -								BlinkM::led_color_1 = LED_RED;
                          -								BlinkM::led_color_2 = LED_RED;
                          -								BlinkM::led_color_3 = LED_RED;
                          -								BlinkM::led_color_4 = LED_RED;
                          -								BlinkM::led_color_5 = LED_RED;
                          -								BlinkM::led_color_6 = LED_RED;
                          -								BlinkM::led_blink = LED_BLINK;
                          -
                          -							} else {
                          -								/* no battery warnings here */
                          -
                          -								if(vehicle_status_raw.flag_system_armed == false) {
                          -									/* system not armed */
                          -									BlinkM::led_color_1 = LED_RED;
                          -									BlinkM::led_color_2 = LED_RED;
                          -									BlinkM::led_color_3 = LED_RED;
                          -									BlinkM::led_color_4 = LED_RED;
                          -									BlinkM::led_color_5 = LED_RED;
                          -									BlinkM::led_color_6 = LED_RED;
                          -									BlinkM::led_blink = LED_NOBLINK;
                          -
                          -								} else {
                          -									/* armed system - initial led pattern */
                          -									BlinkM::led_color_1 = LED_RED;
                          -									BlinkM::led_color_2 = LED_RED;
                          -									BlinkM::led_color_3 = LED_RED;
                          -									BlinkM::led_color_4 = LED_OFF;
                          -									BlinkM::led_color_5 = LED_OFF;
                          -									BlinkM::led_color_6 = LED_OFF;
                          -									BlinkM::led_blink = LED_BLINK;
                          -
                          -									/* handle 4th led - flightmode indicator */
                          -									switch((int)vehicle_status_raw.flight_mode) {
                          -										case VEHICLE_FLIGHT_MODE_MANUAL:
                          -												BlinkM::led_color_4 = LED_OFF;
                          -											break;
                          -
                          -										case VEHICLE_FLIGHT_MODE_STAB:
                          -												BlinkM::led_color_4 = LED_YELLOW;
                          -											break;
                          -
                          -										case VEHICLE_FLIGHT_MODE_HOLD:
                          -												BlinkM::led_color_4 = LED_BLUE;
                          -											break;
                          -
                          -										case VEHICLE_FLIGHT_MODE_AUTO:
                          -												BlinkM::led_color_4 = LED_GREEN;
                          -											break;
                          -									}
                          -
                          -									/* handling used sat´s */
                          -									if(num_of_used_sats >= 7) {
                          -										BlinkM::led_color_1 = LED_OFF;
                          -										BlinkM::led_color_2 = LED_OFF;
                          -										BlinkM::led_color_3 = LED_OFF;
                          -									} else if(num_of_used_sats == 6) {
                          -										BlinkM::led_color_2 = LED_OFF;
                          -										BlinkM::led_color_3 = LED_OFF;
                          -									} else if(num_of_used_sats == 5) {
                          -										BlinkM::led_color_3 = LED_OFF;
                          -									}
                          -								}
                          -							}
                          -						}
                          -
                          -/*
                          -					printf( " Volt:%8.4f\tArmed:%4u\tMode:%4u\tCells:%4u\tBattWarn:%4u\tSats:%4u\tFix:%4u\tVisible:%4u\n",
                          -					vehicle_status_raw.voltage_battery,
                          -					vehicle_status_raw.flag_system_armed,
                          -					vehicle_status_raw.flight_mode,
                          -					num_of_cells,
                          -					vehicle_status_raw.battery_warning,
                          -					num_of_used_sats,
                          -					vehicle_gps_position_raw.fix_type,
                          -					vehicle_gps_position_raw.satellites_visible);
                          -*/
                          +			/* get number of used satellites in navigation */
                          +			num_of_used_sats = 0;
                          +			for(int satloop=0; satloop<20; satloop++) {
                          +				if(vehicle_gps_position_raw.satellite_used[satloop] == 1) {
                          +					num_of_used_sats++;
                           				}
                           			}
                           
                          +			if(num_of_cells == 0) {
                          +					/* looking for lipo cells that are connected */
                          +				printf(" checking cells\n");
                          +				for(num_of_cells = 2; num_of_cells < 7; num_of_cells++) {
                          +					if(system_voltage < num_of_cells * MAX_CELL_VOLTAGE) break;
                          +				}
                          +				printf(" cells found:%u\n", num_of_cells);
                          +				} else {
                          +					if(vehicle_status_raw.battery_warning == VEHICLE_BATTERY_WARNING_WARNING) {
                          +						/* LED Pattern for battery low warning */
                          +						BlinkM::led_color_1 = LED_YELLOW;
                          +						BlinkM::led_color_2 = LED_YELLOW;
                          +						BlinkM::led_color_3 = LED_YELLOW;
                          +						BlinkM::led_color_4 = LED_YELLOW;
                          +						BlinkM::led_color_5 = LED_YELLOW;
                          +						BlinkM::led_color_6 = LED_YELLOW;
                          +						BlinkM::led_blink = LED_BLINK;
                          +
                          +					} else if(vehicle_status_raw.battery_warning == VEHICLE_BATTERY_WARNING_ALERT) {
                          +						/* LED Pattern for battery critical alerting */
                          +						BlinkM::led_color_1 = LED_RED;
                          +						BlinkM::led_color_2 = LED_RED;
                          +						BlinkM::led_color_3 = LED_RED;
                          +						BlinkM::led_color_4 = LED_RED;
                          +						BlinkM::led_color_5 = LED_RED;
                          +						BlinkM::led_color_6 = LED_RED;
                          +						BlinkM::led_blink = LED_BLINK;
                          +
                          +					} else {
                          +						/* no battery warnings here */
                          +
                          +						if(vehicle_status_raw.flag_system_armed == false) {
                          +							/* system not armed */
                          +							BlinkM::led_color_1 = LED_RED;
                          +							BlinkM::led_color_2 = LED_RED;
                          +							BlinkM::led_color_3 = LED_RED;
                          +							BlinkM::led_color_4 = LED_RED;
                          +							BlinkM::led_color_5 = LED_RED;
                          +							BlinkM::led_color_6 = LED_RED;
                          +							BlinkM::led_blink = LED_NOBLINK;
                          +
                          +						} else {
                          +							/* armed system - initial led pattern */
                          +							BlinkM::led_color_1 = LED_RED;
                          +							BlinkM::led_color_2 = LED_RED;
                          +							BlinkM::led_color_3 = LED_RED;
                          +							BlinkM::led_color_4 = LED_OFF;
                          +							BlinkM::led_color_5 = LED_OFF;
                          +							BlinkM::led_color_6 = LED_OFF;
                          +							BlinkM::led_blink = LED_BLINK;
                          +
                          +							/* handle 4th led - flightmode indicator */
                          +							switch((int)vehicle_status_raw.flight_mode) {
                          +								case VEHICLE_FLIGHT_MODE_MANUAL:
                          +										BlinkM::led_color_4 = LED_OFF;
                          +									break;
                          +
                          +								case VEHICLE_FLIGHT_MODE_STAB:
                          +										BlinkM::led_color_4 = LED_YELLOW;
                          +									break;
                          +
                          +								case VEHICLE_FLIGHT_MODE_HOLD:
                          +										BlinkM::led_color_4 = LED_BLUE;
                          +									break;
                          +
                          +								case VEHICLE_FLIGHT_MODE_AUTO:
                          +										BlinkM::led_color_4 = LED_GREEN;
                          +									break;
                          +							}
                          +
                          +							/* handling used sat´s */
                          +							if(num_of_used_sats >= 7) {
                          +								BlinkM::led_color_1 = LED_OFF;
                          +								BlinkM::led_color_2 = LED_OFF;
                          +								BlinkM::led_color_3 = LED_OFF;
                          +							} else if(num_of_used_sats == 6) {
                          +								BlinkM::led_color_2 = LED_OFF;
                          +								BlinkM::led_color_3 = LED_OFF;
                          +							} else if(num_of_used_sats == 5) {
                          +								BlinkM::led_color_3 = LED_OFF;
                          +							}
                          +						}
                          +					}
                          +				}
                          +
                          +			/*
                          +			printf( " Volt:%8.4f\tArmed:%4u\tMode:%4u\tCells:%4u\tBattWarn:%4u\tSats:%4u\tFix:%4u\tVisible:%4u\n",
                          +			vehicle_status_raw.voltage_battery,
                          +			vehicle_status_raw.flag_system_armed,
                          +			vehicle_status_raw.flight_mode,
                          +			num_of_cells,
                          +			vehicle_status_raw.battery_warning,
                          +			num_of_used_sats,
                          +			vehicle_gps_position_raw.fix_type,
                          +			vehicle_gps_position_raw.satellites_visible);
                          +			*/
                          +
                          +
                           			led_thread_runcount=1;
                           			led_thread_ready = true;
                           			led_interval = LED_OFFTIME;
                          @@ -674,7 +661,7 @@ BlinkM::led()
                           			break;
                           	}
                           
                          -	if(BlinkM::systemstate_run == 1) {
                          +	if(BlinkM::systemstate_run == true) {
                           		/* re-queue ourselves to run again later */
                           		work_queue(LPWORK, &_work, (worker_t)&BlinkM::led_trampoline, this, led_interval);
                           	}
                          
                          From a2a87d101903fd9f703a58950a758b30f18fd384 Mon Sep 17 00:00:00 2001
                          From: Marco Bauer 
                          Date: Sun, 13 Jan 2013 13:51:02 +0100
                          Subject: [PATCH 091/157] some changes in structure
                          
                          ---
                           Makefile | 3 +--
                           1 file changed, 1 insertion(+), 2 deletions(-)
                          
                          diff --git a/Makefile b/Makefile
                          index d3f859a251..d9469bb49a 100644
                          --- a/Makefile
                          +++ b/Makefile
                          @@ -109,8 +109,7 @@ ifeq ($(SYSTYPE),Linux)
                           SERIAL_PORTS		?= "/dev/ttyACM5,/dev/ttyACM4,/dev/ttyACM3,/dev/ttyACM2,/dev/ttyACM1,/dev/ttyACM0"
                           endif
                           ifeq ($(SERIAL_PORTS),)
                          -#SERIAL_PORTS		 = "\\\\.\\COM32,\\\\.\\COM31,\\\\.\\COM30,\\\\.\\COM29,\\\\.\\COM28,\\\\.\\COM27,\\\\.\\COM26,\\\\.\\COM25,\\\\.\\COM24,\\\\.\\COM23,\\\\.\\COM22,\\\\.\\COM21,\\\\.\\COM20,\\\\.\\COM19,\\\\.\\COM18,\\\\.\\COM17,\\\\.\\COM16,\\\\.\\COM15,\\\\.\\COM14,\\\\.\\COM13,\\\\.\\COM12,\\\\.\\COM11,\\\\.\\COM10,\\\\.\\COM9,\\\\.\\COM8,\\\\.\\COM7,\\\\.\\COM6,\\\\.\\COM5,\\\\.\\COM4,\\\\.\\COM3,\\\\.\\COM2,\\\\.\\COM1,\\\\.\\COM0"
                          -SERIAL_PORTS		 = "\\\\.\\COM3,\\\\.\\COM2,\\\\.\\COM1,\\\\.\\COM0"
                          +SERIAL_PORTS		 = "\\\\.\\COM32,\\\\.\\COM31,\\\\.\\COM30,\\\\.\\COM29,\\\\.\\COM28,\\\\.\\COM27,\\\\.\\COM26,\\\\.\\COM25,\\\\.\\COM24,\\\\.\\COM23,\\\\.\\COM22,\\\\.\\COM21,\\\\.\\COM20,\\\\.\\COM19,\\\\.\\COM18,\\\\.\\COM17,\\\\.\\COM16,\\\\.\\COM15,\\\\.\\COM14,\\\\.\\COM13,\\\\.\\COM12,\\\\.\\COM11,\\\\.\\COM10,\\\\.\\COM9,\\\\.\\COM8,\\\\.\\COM7,\\\\.\\COM6,\\\\.\\COM5,\\\\.\\COM4,\\\\.\\COM3,\\\\.\\COM2,\\\\.\\COM1,\\\\.\\COM0"
                           endif
                           
                           upload:		$(FIRMWARE_BUNDLE) $(UPLOADER)
                          
                          From 825012b029a09e51828136deed3a24fab95c4780 Mon Sep 17 00:00:00 2001
                          From: Marco Bauer 
                          Date: Sun, 13 Jan 2013 18:04:07 +0100
                          Subject: [PATCH 092/157] switched to initialiser list and member variables
                          
                          ---
                           apps/drivers/blinkm/blinkm.cpp | 31 ++++++++++++++++++++-----------
                           1 file changed, 20 insertions(+), 11 deletions(-)
                          
                          diff --git a/apps/drivers/blinkm/blinkm.cpp b/apps/drivers/blinkm/blinkm.cpp
                          index 90dfa3eeaf..b1e20d4f85 100644
                          --- a/apps/drivers/blinkm/blinkm.cpp
                          +++ b/apps/drivers/blinkm/blinkm.cpp
                          @@ -119,6 +119,7 @@ public:
                           	BlinkM(int bus);
                           	~BlinkM();
                           
                          +
                           	virtual int		init();
                           	virtual int		probe();
                           	virtual int		setMode(int mode);
                          @@ -166,15 +167,15 @@ private:
                           
                           	work_s			_work;
                           
                          -	static int led_color_1;
                          -	static int led_color_2;
                          -	static int led_color_3;
                          -	static int led_color_4;
                          -	static int led_color_5;
                          -	static int led_color_6;
                          -	static int led_blink;
                          +	int led_color_1;
                          +	int led_color_2;
                          +	int led_color_3;
                          +	int led_color_4;
                          +	int led_color_5;
                          +	int led_color_6;
                          +	int led_blink;
                           
                          -	static bool systemstate_run;
                          +	bool systemstate_run;
                           
                           	void 			setLEDColor(int ledcolor);
                           	static void		led_trampoline(void *arg);
                          @@ -233,7 +234,7 @@ const char *BlinkM::script_names[] = {
                           	nullptr
                           };
                           
                          -
                          +/*
                           int BlinkM::led_color_1 = LED_OFF;
                           int BlinkM::led_color_2 = LED_OFF;
                           int BlinkM::led_color_3 = LED_OFF;
                          @@ -243,12 +244,20 @@ int BlinkM::led_color_6 = LED_OFF;
                           int BlinkM::led_blink = LED_NOBLINK;
                           
                           bool BlinkM::systemstate_run = false;
                          -
                          +*/
                           
                           extern "C" __EXPORT int blinkm_main(int argc, char *argv[]);
                           
                           BlinkM::BlinkM(int bus) :
                          -	I2C("blinkm", BLINKM_DEVICE_PATH, bus, 0x09, 100000)
                          +	I2C("blinkm", BLINKM_DEVICE_PATH, bus, 0x09, 100000),
                          +	led_color_1(LED_OFF),
                          +	led_color_2(LED_OFF),
                          +	led_color_3(LED_OFF),
                          +	led_color_4(LED_OFF),
                          +	led_color_5(LED_OFF),
                          +	led_color_6(LED_OFF),
                          +	led_blink(LED_NOBLINK),
                          +	systemstate_run(false)
                           {
                           	memset(&_work, 0, sizeof(_work));
                           }
                          
                          From 9ac2684ca040dbb075d21e1825e84d97434ed07b Mon Sep 17 00:00:00 2001
                          From: Lorenz Meier 
                          Date: Sun, 13 Jan 2013 22:42:12 +0100
                          Subject: [PATCH 093/157] Printing error reason in warning
                          
                          ---
                           apps/sensors/sensors.cpp | 2 +-
                           1 file changed, 1 insertion(+), 1 deletion(-)
                          
                          diff --git a/apps/sensors/sensors.cpp b/apps/sensors/sensors.cpp
                          index 577dc483b3..c0f802e67c 100644
                          --- a/apps/sensors/sensors.cpp
                          +++ b/apps/sensors/sensors.cpp
                          @@ -780,7 +780,7 @@ Sensors::adc_init()
                           	_fd_adc = open(ADC_DEVICE_PATH, O_RDONLY | O_NONBLOCK);
                           
                           	if (_fd_adc < 0) {
                          -		warnx(ADC_DEVICE_PATH);
                          +		warn(ADC_DEVICE_PATH);
                           		warnx("FATAL: no ADC found");
                           	}
                           }
                          
                          From 464c5245f264b974646b146b5cc1ddea44fbcbf6 Mon Sep 17 00:00:00 2001
                          From: James Goppert 
                          Date: Sun, 13 Jan 2013 17:09:22 -0500
                          Subject: [PATCH 094/157] Rebase of changes to sensor_hil_fixedwing branch.
                          
                          ---
                           .gitignore                                  |   5 +
                           apps/examples/control_demo/control_demo.cpp |   2 +-
                           apps/examples/control_demo/params.c         |  42 +--
                           apps/examples/kalman_demo/KalmanNav.cpp     | 371 ++++++++++++--------
                           apps/examples/kalman_demo/KalmanNav.hpp     |  17 +-
                           apps/examples/kalman_demo/params.c          |  10 +-
                           apps/mathlib/math/Dcm.cpp                   |  77 ++--
                           apps/mathlib/math/Dcm.hpp                   |   7 +
                           apps/mathlib/math/EulerAngles.cpp           |  26 +-
                           apps/mathlib/math/Quaternion.cpp            |  59 ++--
                           apps/mathlib/math/nasa_rotation_def.pdf     | Bin 0 -> 709235 bytes
                           apps/mathlib/math/test_math.sce             |  63 ++++
                           apps/mavlink/mavlink.c                      |   4 +
                           apps/mavlink/mavlink_hil.h                  |   6 +-
                           apps/mavlink/mavlink_receiver.c             | 184 +++++++++-
                           apps/uORB/topics/sensor_combined.h          |   1 +
                           16 files changed, 618 insertions(+), 256 deletions(-)
                           create mode 100644 apps/mathlib/math/nasa_rotation_def.pdf
                           create mode 100644 apps/mathlib/math/test_math.sce
                          
                          diff --git a/.gitignore b/.gitignore
                          index f072889f0d..0861e7a524 100644
                          --- a/.gitignore
                          +++ b/.gitignore
                          @@ -8,6 +8,7 @@
                           apps/namedapp/namedapp_list.h
                           apps/namedapp/namedapp_proto.h
                           Make.dep
                          +*.pyc
                           *.o
                           *.a
                           *.d
                          @@ -43,3 +44,7 @@ cscope.out
                           .configX-e
                           nuttx-export.zip
                           dot.gdbinit
                          +mavlink/include/mavlink/v0.9/
                          +.*.swp
                          +.swp
                          +core
                          diff --git a/apps/examples/control_demo/control_demo.cpp b/apps/examples/control_demo/control_demo.cpp
                          index d9c773c052..e609f2f4bd 100644
                          --- a/apps/examples/control_demo/control_demo.cpp
                          +++ b/apps/examples/control_demo/control_demo.cpp
                          @@ -108,7 +108,7 @@ int control_demo_main(int argc, char *argv[])
                           		deamon_task = task_spawn("control_demo",
                           					 SCHED_DEFAULT,
                           					 SCHED_PRIORITY_MAX - 10,
                          -					 4096,
                          +					 5120,
                           					 control_demo_thread_main,
                           					 (argv) ? (const char **)&argv[2] : (const char **)NULL);
                           		exit(0);
                          diff --git a/apps/examples/control_demo/params.c b/apps/examples/control_demo/params.c
                          index 4eec456fb1..8f923f5a1c 100644
                          --- a/apps/examples/control_demo/params.c
                          +++ b/apps/examples/control_demo/params.c
                          @@ -6,31 +6,31 @@
                           // 16 is max name length
                           
                           // gyro low pass filter
                          -PARAM_DEFINE_FLOAT(FWB_P_LP, 10.0f); // roll rate low pass cut freq
                          -PARAM_DEFINE_FLOAT(FWB_Q_LP, 10.0f); // pitch rate low pass cut freq
                          -PARAM_DEFINE_FLOAT(FWB_R_LP, 10.0f); // yaw rate low pass cut freq
                          +PARAM_DEFINE_FLOAT(FWB_P_LP, 300.0f); // roll rate low pass cut freq
                          +PARAM_DEFINE_FLOAT(FWB_Q_LP, 300.0f); // pitch rate low pass cut freq
                          +PARAM_DEFINE_FLOAT(FWB_R_LP, 300.0f); // yaw rate low pass cut freq
                           
                           // yaw washout
                           PARAM_DEFINE_FLOAT(FWB_R_HP, 1.0f); // yaw rate high pass
                           
                           // stabilization mode
                          -PARAM_DEFINE_FLOAT(FWB_P2AIL, 0.1f); // roll rate 2 aileron
                          -PARAM_DEFINE_FLOAT(FWB_Q2ELV, 0.1f); // pitch rate 2 elevator
                          -PARAM_DEFINE_FLOAT(FWB_R2RDR, 0.1f); // yaw rate 2 rudder
                          +PARAM_DEFINE_FLOAT(FWB_P2AIL, 0.5f); // roll rate 2 aileron
                          +PARAM_DEFINE_FLOAT(FWB_Q2ELV, 0.5f); // pitch rate 2 elevator
                          +PARAM_DEFINE_FLOAT(FWB_R2RDR, 0.2f); // yaw rate 2 rudder
                           
                           //  psi -> phi -> p
                          -PARAM_DEFINE_FLOAT(FWB_PSI2PHI, 2.0f);      // heading 2 roll
                          -PARAM_DEFINE_FLOAT(FWB_PHI2P, 2.0f);        // roll to roll rate
                          -PARAM_DEFINE_FLOAT(FWB_PHI_LIM_MAX, 1.0f);  // roll limit
                          +PARAM_DEFINE_FLOAT(FWB_PSI2PHI, 0.5f);      // heading 2 roll
                          +PARAM_DEFINE_FLOAT(FWB_PHI2P, 1.0f);        // roll to roll rate
                          +PARAM_DEFINE_FLOAT(FWB_PHI_LIM_MAX, 0.5f);  // roll limit, 28 deg
                           
                           // velocity -> theta
                          -PARAM_DEFINE_FLOAT(FWB_V2THE_P, 0.5f);
                          +PARAM_DEFINE_FLOAT(FWB_V2THE_P, 0.2f);
                           PARAM_DEFINE_FLOAT(FWB_V2THE_I, 0.0f);
                           PARAM_DEFINE_FLOAT(FWB_V2THE_D, 0.0f);
                           PARAM_DEFINE_FLOAT(FWB_V2THE_D_LP, 0.0f);
                           PARAM_DEFINE_FLOAT(FWB_V2THE_I_MAX, 0.0f);
                          -PARAM_DEFINE_FLOAT(FWB_THE_MIN, -1.0f);
                          -PARAM_DEFINE_FLOAT(FWB_THE_MAX, 1.0f);
                          +PARAM_DEFINE_FLOAT(FWB_THE_MIN, -0.5f);
                          +PARAM_DEFINE_FLOAT(FWB_THE_MAX, 0.5f);
                           
                           
                           // theta -> q
                          @@ -41,15 +41,15 @@ PARAM_DEFINE_FLOAT(FWB_THE2Q_D_LP, 0.0f);
                           PARAM_DEFINE_FLOAT(FWB_THE2Q_I_MAX, 0.0f);
                           
                           //  h -> thr
                          -PARAM_DEFINE_FLOAT(FWB_H2THR_P, 0.005f);
                          -PARAM_DEFINE_FLOAT(FWB_H2THR_I, 0.001f);
                          -PARAM_DEFINE_FLOAT(FWB_H2THR_D, 0.01f);
                          -PARAM_DEFINE_FLOAT(FWB_H2THR_D_LP, 1.0f);
                          -PARAM_DEFINE_FLOAT(FWB_H2THR_I_MAX, 250.0f);
                          +PARAM_DEFINE_FLOAT(FWB_H2THR_P, 0.01f);
                          +PARAM_DEFINE_FLOAT(FWB_H2THR_I, 0.0f);
                          +PARAM_DEFINE_FLOAT(FWB_H2THR_D, 0.0f);
                          +PARAM_DEFINE_FLOAT(FWB_H2THR_D_LP, 0.0f);
                          +PARAM_DEFINE_FLOAT(FWB_H2THR_I_MAX, 0.0f);
                           
                           // crosstrack
                          -PARAM_DEFINE_FLOAT(FWB_XT2YAW_MAX, 1.0f);
                          -PARAM_DEFINE_FLOAT(FWB_XT2YAW, 0.01f);
                          +PARAM_DEFINE_FLOAT(FWB_XT2YAW_MAX, 1.57f); // 90 deg
                          +PARAM_DEFINE_FLOAT(FWB_XT2YAW, 0.002f);
                           
                           // speed command
                           PARAM_DEFINE_FLOAT(FWB_V_MIN, 20.0f);
                          @@ -58,6 +58,6 @@ PARAM_DEFINE_FLOAT(FWB_V_MAX, 24.0f);
                           
                           // trim
                           PARAM_DEFINE_FLOAT(FWB_TRIM_AIL, 0.0f);
                          -PARAM_DEFINE_FLOAT(FWB_TRIM_ELV, 0.0f);
                          +PARAM_DEFINE_FLOAT(FWB_TRIM_ELV, 0.005f);
                           PARAM_DEFINE_FLOAT(FWB_TRIM_RDR, 0.0f);
                          -PARAM_DEFINE_FLOAT(FWB_TRIM_THR, 0.7f);
                          +PARAM_DEFINE_FLOAT(FWB_TRIM_THR, 0.81f);
                          diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp
                          index c2faa89de8..742bfc9c13 100644
                          --- a/apps/examples/kalman_demo/KalmanNav.cpp
                          +++ b/apps/examples/kalman_demo/KalmanNav.cpp
                          @@ -42,10 +42,12 @@
                           #include "KalmanNav.hpp"
                           
                           // constants
                          +// Titterton pg. 52
                           static const float omega = 7.2921150e-5f; // earth rotation rate, rad/s
                          -static const float R = 6.371000e6f; // earth radius, m
                          -static const float RSq = 4.0589641e13f; // radius squared
                          -static const float g = 9.8f; // gravitational accel. m/s^2
                          +static const float R0 = 6378137.0f; // earth radius, m
                          +
                          +static const float RSq = 4.0680631591e+13; // radius squared
                          +static const float g = 9.806f; // gravitational accel. m/s^2, XXX should be calibrated
                           
                           KalmanNav::KalmanNav(SuperBlock *parent, const char *name) :
                           	SuperBlock(parent, name),
                          @@ -57,15 +59,15 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) :
                           	// attitude measurement ekf matrices
                           	HAtt(6, 9),
                           	RAtt(6, 6),
                          -	// gps measurement ekf matrices
                          -	HGps(6, 9),
                          -	RGps(6, 6),
                          +	// position measurement ekf matrices
                          +	HPos(5, 9),
                          +	RPos(5, 5),
                           	// attitude representations
                           	C_nb(),
                           	q(),
                           	// subscriptions
                          -	_sensors(&getSubscriptions(), ORB_ID(sensor_combined), 5), // limit to 200 Hz
                          -	_gps(&getSubscriptions(), ORB_ID(vehicle_gps_position), 1000), // limit to 1 Hz
                          +	_sensors(&getSubscriptions(), ORB_ID(sensor_combined), 1), // limit to 1000 Hz
                          +	_gps(&getSubscriptions(), ORB_ID(vehicle_gps_position), 100), // limit to 10 Hz
                           	_param_update(&getSubscriptions(), ORB_ID(parameter_update), 1000), // limit to 1 Hz
                           	// publications
                           	_pos(&getPublications(), ORB_ID(vehicle_global_position)),
                          @@ -78,6 +80,9 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) :
                           	_outTimeStamp(hrt_absolute_time()),
                           	// frame count
                           	_navFrames(0),
                          +	// miss counts
                          +	_missFast(0),
                          +	_missSlow(0),
                           	// state
                           	fN(0), fE(0), fD(0),
                           	phi(0), theta(0), psi(0),
                          @@ -87,8 +92,8 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) :
                           	_vGyro(this, "V_GYRO"),
                           	_vAccel(this, "V_ACCEL"),
                           	_rMag(this, "R_MAG"),
                          -	_rGpsV(this, "R_GPS_V"),
                          -	_rGpsGeo(this, "R_GPS_GEO"),
                          +	_rGpsVel(this, "R_GPS_VEL"),
                          +	_rGpsPos(this, "R_GPS_POS"),
                           	_rGpsAlt(this, "R_GPS_ALT"),
                           	_rAccel(this, "R_ACCEL")
                           {
                          @@ -99,12 +104,21 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) :
                           
                           	// wait for gps lock
                           	while (1) {
                          -		updateSubscriptions();
                          +		struct pollfd fds[1];
                          +		fds[0].fd = _gps.getHandle();
                          +		fds[0].events = POLLIN;
                           
                          -		if (_gps.fix_type > 2) break;
                          +		// poll 10 seconds for new data
                          +		int ret = poll(fds, 1, 10000);
                           
                          -		printf("[kalman_demo] waiting for gps lock\n");
                          -		usleep(1000000);
                          +		if (ret > 0)  {
                          +			updateSubscriptions();
                          +
                          +			if (_gps.fix_type > 2) break;
                          +
                          +		} else if (ret == 0) {
                          +			printf("[kalman_demo] waiting for gps lock\n");
                          +		}
                           	}
                           
                           	// initial state
                          @@ -124,16 +138,12 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) :
                           	// initialize dcm
                           	C_nb = Dcm(q);
                           
                          -	// initialize F to identity
                          -	F = Matrix::identity(9);
                          -
                          -	// HGps is constant
                          -	HGps(0, 3) = 1.0f;
                          -	HGps(1, 4) = 1.0f;
                          -	HGps(2, 5) = 1.0f;
                          -	HGps(3, 6) = 1.0f;
                          -	HGps(4, 7) = 1.0f;
                          -	HGps(5, 8) = 1.0f;
                          +	// HPos is constant
                          +	HPos(0, 3) = 1.0f;
                          +	HPos(1, 4) = 1.0f;
                          +	HPos(2, 6) = 1.0f;
                          +	HPos(3, 7) = 1.0f;
                          +	HPos(4, 8) = 1.0f;
                           
                           	// initialize all parameters
                           	updateParams();
                          @@ -143,11 +153,13 @@ void KalmanNav::update()
                           {
                           	using namespace math;
                           
                          -	struct pollfd fds[2];
                          +	struct pollfd fds[3];
                           	fds[0].fd = _sensors.getHandle();
                           	fds[0].events = POLLIN;
                           	fds[1].fd = _param_update.getHandle();
                           	fds[1].events = POLLIN;
                          +	fds[2].fd = _gps.getHandle();
                          +	fds[2].events = POLLIN;
                           
                           	// poll 20 milliseconds for new data
                           	int ret = poll(fds, 2, 20);
                          @@ -158,53 +170,55 @@ void KalmanNav::update()
                           		return;
                           
                           	} else if (ret == 0) { // timeout
                          -		// run anyway
                          -	} else if (ret > 0) {
                          -		// update params when requested
                          -		if (fds[1].revents & POLLIN) {
                          -			printf("updating params\n");
                          -			updateParams();
                          -		}
                          -
                          -		// if no new sensor data, return
                          -		if (!(fds[0].revents & POLLIN)) return;
                          +		return;
                           	}
                           
                           	// get new timestamp
                           	uint64_t newTimeStamp = hrt_absolute_time();
                           
                           	// check updated subscriptions
                          +	if (_param_update.updated()) updateParams();
                          +
                           	bool gpsUpdate = _gps.updated();
                          +	bool sensorsUpdate = _sensors.updated();
                           
                           	// get new information from subscriptions
                           	// this clears update flag
                           	updateSubscriptions();
                           
                          -	// count fast frames
                          -	_navFrames += 1;
                          +	// abort update if no new data
                          +	if (!(sensorsUpdate || gpsUpdate)) return;
                           
                           	// fast prediciton step
                           	// note, using sensors timestamp so we can account
                           	// for packet lag
                           	float dtFast = (_sensors.timestamp - _fastTimeStamp) / 1.0e6f;
                           	_fastTimeStamp = _sensors.timestamp;
                          -	predictFast(dtFast);
                          +
                          +	if (dtFast < 1.0f / 50) {
                          +		predictFast(dtFast);
                          +		// count fast frames
                          +		_navFrames += 1;
                          +
                          +	} else _missFast++;
                           
                           	// slow prediction step
                           	float dtSlow = (_sensors.timestamp - _slowTimeStamp) / 1.0e6f;
                           
                          -	if (dtSlow > 1.0f / 200) { // 200 Hz
                          +	if (dtSlow > 1.0f / 100) { // 100 Hz
                           		_slowTimeStamp = _sensors.timestamp;
                          -		predictSlow(dtSlow);
                          +
                          +		if (dtSlow < 1.0f / 50) predictSlow(dtSlow);
                          +		else _missSlow ++;
                           	}
                           
                           	// gps correction step
                           	if (gpsUpdate) {
                          -		correctGps();
                          +		correctPos();
                           	}
                           
                           	// attitude correction step
                          -	if (_sensors.timestamp - _attTimeStamp > 1e6 / 1) { // 1 Hz
                          +	if (_sensors.timestamp - _attTimeStamp > 1e6 / 20) { // 20 Hz
                           		_attTimeStamp = _sensors.timestamp;
                           		correctAtt();
                           	}
                          @@ -218,8 +232,10 @@ void KalmanNav::update()
                           	// output
                           	if (newTimeStamp - _outTimeStamp > 1e6) { // 1 Hz
                           		_outTimeStamp = newTimeStamp;
                          -		printf("nav: %4d Hz\n", _navFrames);
                          +		printf("nav: %4d Hz, misses fast: %4d slow: %4d\n", _navFrames, _missFast, _missSlow);
                           		_navFrames = 0;
                          +		_missFast = 0;
                          +		_missSlow = 0;
                           	}
                           }
                           
                          @@ -298,21 +314,28 @@ void KalmanNav::predictFast(float dt)
                           	// trig
                           	float sinL = sinf(lat);
                           	float cosL = cosf(lat);
                          +	float cosLSing = cosf(lat);
                          +
                          +	if (fabsf(cosLSing) < 0.01f) cosLSing = 0.01f;
                           
                           	// position update
                           	// neglects angular deflections in local gravity
                           	// see Titerton pg. 70
                          -	float LDot = vN / (R + float(alt));
                          -	float lDot = vE / (cosL * (R + float(alt)));
                          -	float vNDot = fN - vE * (2 * omega +
                          -				 lDot) * sinL +
                          +	float R = R0 + float(alt);
                          +	float LDot = vN / R;
                          +	float lDot = vE / (cosLSing * R);
                          +	float rotRate = 2 * omega + lDot;
                          +	float vNDot = fN - vE * rotRate * sinL +
                           		      vD * LDot;
                          -	float vDDot = fD - vE * (2 * omega + lDot) * cosL -
                          +	float vDDot = fD - vE * rotRate * cosL -
                           		      vN * LDot + g;
                          -	float vEDot = fE + vN * (2 * omega + lDot) * sinL +
                          -		      vDDot * (2 * omega * cosL);
                          +	float vEDot = fE + vN * rotRate * sinL +
                          +		      vDDot * rotRate * cosL;
                           
                           	// rectangular integration
                          +	//printf("dt: %8.4f\n", double(dt));
                          +	//printf("fN: %8.4f, fE: %8.4f, fD: %8.4f\n", double(fN), double(fE), double(fD));
                          +	//printf("vN: %8.4f, vE: %8.4f, vD: %8.4f\n", double(vN), double(vE), double(vD));
                           	vN += vNDot * dt;
                           	vE += vEDot * dt;
                           	vD += vDDot * dt;
                          @@ -331,87 +354,88 @@ void KalmanNav::predictSlow(float dt)
                           	float cosLSq = cosL * cosL;
                           	float tanL = tanf(lat);
                           
                          +	// prepare for matrix
                          +	float R = R0 + float(alt);
                          +
                           	// F Matrix
                           	// Titterton pg. 291
                          -	//
                          -	// difference from Jacobian
                          -	// multiplity by dt for all elements
                          -	// add 1.0 to diagonal elements
                           
                          -	F(0, 1) = (-(omega * sinL + vE * tanL / R)) * dt;
                          -	F(0, 2) = (vN / R) * dt;
                          -	F(0, 4) = (1.0f / R) * dt;
                          -	F(0, 6) = (-omega * sinL) * dt;
                          -	F(0, 8) = (-vE / RSq) * dt;
                          +	F(0, 1) = -(omega * sinL + vE * tanL / R);
                          +	F(0, 2) = vN / R;
                          +	F(0, 4) = 1.0f / R;
                          +	F(0, 6) = -omega * sinL;
                          +	F(0, 8) = -vE / RSq;
                           
                          -	F(1, 0) = (omega * sinL + vE * tanL / R) * dt;
                          -	F(1, 2) = (omega * cosL + vE / R) * dt;
                          -	F(1, 3) = (-1.0f / R) * dt;
                          -	F(1, 8) = (vN / RSq) * dt;
                          +	F(1, 0) = omega * sinL + vE * tanL / R;
                          +	F(1, 2) = omega * cosL + vE / R;
                          +	F(1, 3) = -1.0f / R;
                          +	F(1, 8) = vN / RSq;
                           
                          -	F(2, 0) = (-vN / R) * dt;
                          -	F(2, 1) = (-omega * cosL - vE / R) * dt;
                          -	F(2, 4) = (-tanL / R) * dt;
                          -	F(2, 6) = (-omega * cosL - vE / (R * cosLSq)) * dt;
                          -	F(2, 8) = (vE * tanL / RSq) * dt;
                          +	F(2, 0) = -vN / R;
                          +	F(2, 1) = -omega * cosL - vE / R;
                          +	F(2, 4) = -tanL / R;
                          +	F(2, 6) = -omega * cosL - vE / (R * cosLSq);
                          +	F(2, 8) = vE * tanL / RSq;
                           
                          -	F(3, 1) = (-fD) * dt;
                          -	F(3, 2) = (fE) * dt;
                          -	F(3, 3) = 1.0f + (vD / R) * dt; // on diagonal
                          -	F(3, 4) = (-2 * (omega * sinL + vE * tanL / R)) * dt;
                          -	F(3, 5) = (vN / R) * dt;
                          -	F(3, 6) = (-vE * (2 * omega * cosL + vE / (R * cosLSq))) * dt;
                          -	F(3, 8) = ((vE * vE * tanL - vN * vD) / RSq) * dt;
                          +	F(3, 1) = -fD;
                          +	F(3, 2) = fE;
                          +	F(3, 3) = vD / R;
                          +	F(3, 4) = -2 * (omega * sinL + vE * tanL / R);
                          +	F(3, 5) = vN / R;
                          +	F(3, 6) = -vE * (2 * omega * cosL + vE / (R * cosLSq));
                          +	F(3, 8) = (vE * vE * tanL - vN * vD) / RSq;
                           
                          -	F(4, 0) = (fD) * dt;
                          -	F(4, 2) = (-fN) * dt;
                          -	F(4, 3) = (2 * omega * sinL + vE * tanL / R) * dt;
                          -	F(4, 4) = 1.0f + ((vN * tanL + vD) / R) * dt; // on diagonal
                          -	F(4, 5) = (2 * omega * cosL + vE / R) * dt;
                          -	F(4, 6) = (2 * omega * (vN * cosL - vD * sinL) +
                          -		   vN * vE / (R * cosLSq)) * dt;
                          -	F(4, 8) = (-vE * (vN * tanL + vD) / RSq) * dt;
                          +	F(4, 0) = fD;
                          +	F(4, 2) = -fN;
                          +	F(4, 3) = 2 * omega * sinL + vE * tanL / R;
                          +	F(4, 4) = (vN * tanL + vD) / R;
                          +	F(4, 5) = 2 * omega * cosL + vE / R;
                          +	F(4, 6) = 2 * omega * (vN * cosL - vD * sinL) +
                          +		  vN * vE / (R * cosLSq);
                          +	F(4, 8) = -vE * (vN * tanL + vD) / RSq;
                           
                          -	F(5, 0) = (-fE) * dt;
                          -	F(5, 1) = (fN) * dt;
                          -	F(5, 3) = (-2 * vN / R) * dt;
                          -	F(5, 4) = (-2 * (omega * cosL + vE / R)) * dt;
                          -	F(5, 6) = (2 * omega * vE * sinL) * dt;
                          -	F(5, 8) = ((vN * vN + vE * vE) / RSq) * dt;
                          +	F(5, 0) = -fE;
                          +	F(5, 1) = fN;
                          +	F(5, 3) = -2 * vN / R;
                          +	F(5, 4) = -2 * (omega * cosL + vE / R);
                          +	F(5, 6) = 2 * omega * vE * sinL;
                          +	F(5, 8) = (vN * vN + vE * vE) / RSq;
                           
                          -	F(6, 3) = (1 / R) * dt;
                          -	F(6, 8) = (-vN / RSq) * dt;
                          +	F(6, 3) = 1 / R;
                          +	F(6, 8) = -vN / RSq;
                           
                          -	F(7, 4) = (1 / (R * cosL)) * dt;
                          -	F(7, 6) = (vE * tanL / (R * cosL)) * dt;
                          -	F(7, 8) = (-vE / (cosL * RSq)) * dt;
                          +	F(7, 4) = 1 / (R * cosL);
                          +	F(7, 6) = vE * tanL / (R * cosL);
                          +	F(7, 8) = -vE / (cosL * RSq);
                           
                          -	F(8, 5) = (-1) * dt;
                          +	F(8, 5) = -1;
                           
                           	// G Matrix
                           	// Titterton pg. 291
                          -	G(0, 0) = -C_nb(0, 0) * dt;
                          -	G(0, 1) = -C_nb(0, 1) * dt;
                          -	G(0, 2) = -C_nb(0, 2) * dt;
                          -	G(1, 0) = -C_nb(1, 0) * dt;
                          -	G(1, 1) = -C_nb(1, 1) * dt;
                          -	G(1, 2) = -C_nb(1, 2) * dt;
                          -	G(2, 0) = -C_nb(2, 0) * dt;
                          -	G(2, 1) = -C_nb(2, 1) * dt;
                          -	G(2, 2) = -C_nb(2, 2) * dt;
                          +	G(0, 0) = -C_nb(0, 0);
                          +	G(0, 1) = -C_nb(0, 1);
                          +	G(0, 2) = -C_nb(0, 2);
                          +	G(1, 0) = -C_nb(1, 0);
                          +	G(1, 1) = -C_nb(1, 1);
                          +	G(1, 2) = -C_nb(1, 2);
                          +	G(2, 0) = -C_nb(2, 0);
                          +	G(2, 1) = -C_nb(2, 1);
                          +	G(2, 2) = -C_nb(2, 2);
                           
                          -	G(3, 3) = C_nb(0, 0) * dt;
                          -	G(3, 4) = C_nb(0, 1) * dt;
                          -	G(3, 5) = C_nb(0, 2) * dt;
                          -	G(4, 3) = C_nb(1, 0) * dt;
                          -	G(4, 4) = C_nb(1, 1) * dt;
                          -	G(4, 5) = C_nb(1, 2) * dt;
                          -	G(5, 3) = C_nb(2, 0) * dt;
                          -	G(5, 4) = C_nb(2, 1) * dt;
                          -	G(5, 5) = C_nb(2, 2) * dt;
                          +	G(3, 3) = C_nb(0, 0);
                          +	G(3, 4) = C_nb(0, 1);
                          +	G(3, 5) = C_nb(0, 2);
                          +	G(4, 3) = C_nb(1, 0);
                          +	G(4, 4) = C_nb(1, 1);
                          +	G(4, 5) = C_nb(1, 2);
                          +	G(5, 3) = C_nb(2, 0);
                          +	G(5, 4) = C_nb(2, 1);
                          +	G(5, 5) = C_nb(2, 2);
                           
                          -	// predict equations for kalman filter
                          -	P = F * P * F.transpose() + G * V * G.transpose();
                          +	// continuous predictioon equations
                          +	// for discrte time EKF
                          +	// http://en.wikipedia.org/wiki/Extended_Kalman_filter
                          +	P = P + (F * P + P * F.transpose() + G * V * G.transpose()) * dt;
                           }
                           
                           void KalmanNav::correctAtt()
                          @@ -428,12 +452,11 @@ void KalmanNav::correctAtt()
                           
                           	// mag measurement
                           	Vector3 zMag(_sensors.magnetometer_ga);
                          -	zMag = zMag.unit();
                           
                           	// mag predicted measurement
                           	// choosing some typical magnetic field properties,
                           	//  TODO dip/dec depend on lat/ lon/ time
                          -	static const float dip = 60.0f / M_RAD_TO_DEG_F; // dip, inclination with level
                          +	static const float dip = 0.0f / M_RAD_TO_DEG_F; // dip, inclination with level
                           	static const float dec = 0.0f / M_RAD_TO_DEG_F; // declination, clockwise rotation from north
                           	float bN = cosf(dip) * cosf(dec);
                           	float bE = cosf(dip) * sinf(dec);
                          @@ -443,10 +466,29 @@ void KalmanNav::correctAtt()
                           
                           	// accel measurement
                           	Vector3 zAccel(_sensors.accelerometer_m_s2);
                          +	float accelMag = zAccel.norm();
                           	zAccel = zAccel.unit();
                           
                          +	// ignore accel correction when accel mag not close to g
                          +	Matrix RAttAdjust = RAtt;
                          +
                          +	bool ignoreAccel = fabsf(accelMag - g) > 1.1f;
                          +
                          +	if (ignoreAccel) {
                          +		RAttAdjust(3, 3) = 1.0e10;
                          +		RAttAdjust(4, 4) = 1.0e10;
                          +		RAttAdjust(5, 5) = 1.0e10;
                          +
                          +	} else {
                          +		//printf("correcting attitude with accel\n");
                          +	}
                          +
                          +	// account for banked turn
                          +	// this would only work for fixed wing, so try to avoid
                          +	//Vector3 zCentrip = Vector3(0, cosf(phi), -sinf(phi))*g*tanf(phi);
                          +
                           	// accel predicted measurement
                          -	Vector3 zAccelHat = (C_nb.transpose() * Vector3(0, 0, -1)).unit();
                          +	Vector3 zAccelHat = (C_nb.transpose() * Vector3(0, 0, -g) /*+ zCentrip*/).unit();
                           
                           	// combined measurement
                           	Vector zAtt(6);
                          @@ -498,8 +540,9 @@ void KalmanNav::correctAtt()
                           	HAtt(5, 1) = cosPhi * sinTheta;
                           
                           	// compute correction
                          +	// http://en.wikipedia.org/wiki/Extended_Kalman_filter
                           	Vector y = zAtt - zAttHat; // residual
                          -	Matrix S = HAtt * P * HAtt.transpose() + RAtt; // residual covariance
                          +	Matrix S = HAtt * P * HAtt.transpose() + RAttAdjust; // residual covariance
                           	Matrix K = P * HAtt.transpose() * S.inverse();
                           	Vector xCorrect = K * y;
                           
                          @@ -510,24 +553,34 @@ void KalmanNav::correctAtt()
                           		if (isnan(val) || isinf(val)) {
                           			// abort correction and return
                           			printf("[kalman_demo] numerical failure in att correction\n");
                          +			// reset P matrix to identity
                          +			P = Matrix::identity(9) * 1.0f;
                           			return;
                           		}
                           	}
                           
                           	// correct state
                          -	phi += xCorrect(PHI);
                          -	theta += xCorrect(THETA);
                          +	if (!ignoreAccel) {
                          +		phi += xCorrect(PHI);
                          +		theta += xCorrect(THETA);
                          +	}
                          +
                           	psi += xCorrect(PSI);
                           
                          +	// attitude also affects nav velocities
                          +	vN += xCorrect(VN);
                          +	vE += xCorrect(VE);
                          +	vD += xCorrect(VD);
                          +
                           	// update state covariance
                          +	// http://en.wikipedia.org/wiki/Extended_Kalman_filter
                           	P = P - K * HAtt * P;
                           
                           	// fault detection
                           	float beta = y.dot(S.inverse() * y);
                          -	printf("attitude: beta = %8.4f\n", (double)beta);
                           
                           	if (beta > 10.0f) {
                          -		//printf("fault in attitude: beta = %8.4f\n", (double)beta);
                          +		printf("fault in attitude: beta = %8.4f\n", (double)beta);
                           		//printf("y:\n"); y.print();
                           	}
                           
                          @@ -536,20 +589,32 @@ void KalmanNav::correctAtt()
                           	q = Quaternion(EulerAngles(phi, theta, psi));
                           }
                           
                          -void KalmanNav::correctGps()
                          +void KalmanNav::correctPos()
                           {
                           	using namespace math;
                           	Vector y(6);
                           	y(0) = _gps.vel_n - vN;
                           	y(1) = _gps.vel_e - vE;
                          -	y(2) = _gps.vel_d - vD;
                          -	y(3) = double(_gps.lat) / 1.0e7 / M_RAD_TO_DEG - lat;
                          -	y(4) = double(_gps.lon) / 1.0e7 / M_RAD_TO_DEG - lon;
                          -	y(5) = double(_gps.alt) / 1.0e3 - alt;
                          +	y(2) = double(_gps.lat) / 1.0e7 / M_RAD_TO_DEG - lat;
                          +	y(3) = double(_gps.lon) / 1.0e7 / M_RAD_TO_DEG - lon;
                          +	y(4) = double(_gps.alt) / 1.0e3 - alt;
                          +
                          +	// update gps noise
                          +	float cosLSing = cosf(lat);
                          +	float R = R0 + float(alt);
                          +
                          +	// prevent singularity
                          +	if (fabsf(cosLSing) < 0.01f) cosLSing = 0.01f;
                          +
                          +	float noiseLat = _rGpsPos.get() / R;
                          +	float noiseLon = _rGpsPos.get() / (R * cosLSing);
                          +	RPos(2, 2) = noiseLat * noiseLat;
                          +	RPos(3, 3) = noiseLon * noiseLon;
                           
                           	// compute correction
                          -	Matrix S = HGps * P * HGps.transpose() + RGps; // residual covariance
                          -	Matrix K = P * HGps.transpose() * S.inverse();
                          +	// http://en.wikipedia.org/wiki/Extended_Kalman_filter
                          +	Matrix S = HPos * P * HPos.transpose() + RPos; // residual covariance
                          +	Matrix K = P * HPos.transpose() * S.inverse();
                           	Vector xCorrect = K * y;
                           
                           	// check correction is sane
                          @@ -566,6 +631,8 @@ void KalmanNav::correctGps()
                           			setLatDegE7(_gps.lat);
                           			setLonDegE7(_gps.lon);
                           			setAltE3(_gps.alt);
                          +			// reset P matrix to identity
                          +			P = Matrix::identity(9) * 1.0f;
                           			return;
                           		}
                           	}
                          @@ -579,14 +646,14 @@ void KalmanNav::correctGps()
                           	alt += double(xCorrect(ALT));
                           
                           	// update state covariance
                          -	P = P - K * HGps * P;
                          +	// http://en.wikipedia.org/wiki/Extended_Kalman_filter
                          +	P = P - K * HPos * P;
                           
                           	// fault detetcion
                           	float beta = y.dot(S.inverse() * y);
                          -	printf("gps: beta = %8.4f\n", (double)beta);
                           
                          -	if (beta > 100.0f) {
                          -		//printf("fault in gps: beta = %8.4f\n", (double)beta);
                          +	if (beta > 10.0f) {
                          +		printf("fault in gps: beta = %8.4f\n", (double)beta);
                           		//printf("y:\n"); y.print();
                           	}
                           }
                          @@ -597,6 +664,7 @@ void KalmanNav::updateParams()
                           	using namespace control;
                           	SuperBlock::updateParams();
                           
                          +
                           	// gyro noise
                           	V(0, 0) = _vGyro.get();   // gyro x, rad/s
                           	V(1, 1) = _vGyro.get();   // gyro y
                          @@ -608,20 +676,31 @@ void KalmanNav::updateParams()
                           	V(5, 5) = _vAccel.get();   // accel z
                           
                           	// magnetometer noise
                          -	RAtt(0, 0) = _rMag.get(); // normalized direction
                          -	RAtt(1, 1) = _rMag.get();
                          -	RAtt(2, 2) = _rMag.get();
                          +	float noiseMagSq = _rMag.get() * _rMag.get();
                          +	RAtt(0, 0) = noiseMagSq; // normalized direction
                          +	RAtt(1, 1) = noiseMagSq;
                          +	RAtt(2, 2) = noiseMagSq;
                           
                           	// accelerometer noise
                          -	RAtt(3, 3) = _rAccel.get(); // normalized direction
                          -	RAtt(4, 4) = _rAccel.get();
                          -	RAtt(5, 5) = _rAccel.get();
                          +	float noiseAccelSq = _rAccel.get() * _rAccel.get();
                          +	RAtt(3, 3) = noiseAccelSq; // normalized direction
                          +	RAtt(4, 4) = noiseAccelSq;
                          +	RAtt(5, 5) = noiseAccelSq;
                           
                           	// gps noise
                          -	RGps(0, 0) = _rGpsV.get(); // vn, m/s
                          -	RGps(1, 1) = _rGpsV.get(); // ve
                          -	RGps(2, 2) = _rGpsV.get(); // vd
                          -	RGps(3, 3) = _rGpsGeo.get(); // L, rad
                          -	RGps(4, 4) = _rGpsGeo.get(); // l, rad
                          -	RGps(5, 5) = _rGpsAlt.get(); // h, m
                          +	float cosLSing = cosf(lat);
                          +	float R = R0 + float(alt);
                          +
                          +	// prevent singularity
                          +	if (fabsf(cosLSing) < 0.01f) cosLSing = 0.01f;
                          +
                          +	float noiseVel = _rGpsVel.get();
                          +	float noiseLat = _rGpsPos.get() / R;
                          +	float noiseLon = _rGpsPos.get() / (R * cosLSing);
                          +	float noiseAlt = _rGpsAlt.get();
                          +	RPos(0, 0) = noiseVel * noiseVel; // vn
                          +	RPos(1, 1) = noiseVel * noiseVel; // ve
                          +	RPos(2, 2) = noiseLat * noiseLat; // lat
                          +	RPos(3, 3) = noiseLon * noiseLon; // lon
                          +	RPos(4, 4) = noiseAlt * noiseAlt; // h
                           }
                          diff --git a/apps/examples/kalman_demo/KalmanNav.hpp b/apps/examples/kalman_demo/KalmanNav.hpp
                          index dc4a81f4a1..1ea46d40ff 100644
                          --- a/apps/examples/kalman_demo/KalmanNav.hpp
                          +++ b/apps/examples/kalman_demo/KalmanNav.hpp
                          @@ -60,6 +60,11 @@
                           #include 
                           #include 
                           
                          +/**
                          + * Kalman filter navigation class
                          + * http://en.wikipedia.org/wiki/Extended_Kalman_filter
                          + * Discrete-time extended Kalman filter
                          + */
                           class KalmanNav : public control::SuperBlock
                           {
                           public:
                          @@ -70,7 +75,7 @@ public:
                           	void predictFast(float dt);
                           	void predictSlow(float dt);
                           	void correctAtt();
                          -	void correctGps();
                          +	void correctPos();
                           	virtual void updateParams();
                           protected:
                           	math::Matrix F;
                          @@ -79,8 +84,8 @@ protected:
                           	math::Matrix V;
                           	math::Matrix HAtt;
                           	math::Matrix RAtt;
                          -	math::Matrix HGps;
                          -	math::Matrix RGps;
                          +	math::Matrix HPos;
                          +	math::Matrix RPos;
                           	math::Dcm C_nb;
                           	math::Quaternion q;
                           	control::UOrbSubscription _sensors;
                          @@ -94,6 +99,8 @@ protected:
                           	uint64_t _attTimeStamp;
                           	uint64_t _outTimeStamp;
                           	uint16_t _navFrames;
                          +	uint16_t _missFast;
                          +	uint16_t _missSlow;
                           	float fN, fE, fD;
                           	// states
                           	enum {PHI = 0, THETA, PSI, VN, VE, VD, LAT, LON, ALT};
                          @@ -103,8 +110,8 @@ protected:
                           	control::BlockParam _vGyro;
                           	control::BlockParam _vAccel;
                           	control::BlockParam _rMag;
                          -	control::BlockParam _rGpsV;
                          -	control::BlockParam _rGpsGeo;
                          +	control::BlockParam _rGpsVel;
                          +	control::BlockParam _rGpsPos;
                           	control::BlockParam _rGpsAlt;
                           	control::BlockParam _rAccel;
                           	int32_t getLatDegE7() { return int32_t(lat * 1.0e7 * M_RAD_TO_DEG); }
                          diff --git a/apps/examples/kalman_demo/params.c b/apps/examples/kalman_demo/params.c
                          index 327e2cda66..03cdca5ed2 100644
                          --- a/apps/examples/kalman_demo/params.c
                          +++ b/apps/examples/kalman_demo/params.c
                          @@ -3,8 +3,8 @@
                           /*PARAM_DEFINE_FLOAT(NAME,0.0f);*/
                           PARAM_DEFINE_FLOAT(KF_V_GYRO, 0.01f);
                           PARAM_DEFINE_FLOAT(KF_V_ACCEL, 0.01f);
                          -PARAM_DEFINE_FLOAT(KF_R_MAG, 0.01f);
                          -PARAM_DEFINE_FLOAT(KF_R_GPS_V, 0.1f);
                          -PARAM_DEFINE_FLOAT(KF_R_GPS_GEO, 1.0e-7f);
                          -PARAM_DEFINE_FLOAT(KF_R_GPS_ALT, 10.0f);
                          -PARAM_DEFINE_FLOAT(KF_R_ACCEL, 0.01f);
                          +PARAM_DEFINE_FLOAT(KF_R_MAG, 1.0f);
                          +PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 1.0f);
                          +PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 1.0f);
                          +PARAM_DEFINE_FLOAT(KF_R_GPS_ALT, 1.0f);
                          +PARAM_DEFINE_FLOAT(KF_R_ACCEL, 1.0f);
                          diff --git a/apps/mathlib/math/Dcm.cpp b/apps/mathlib/math/Dcm.cpp
                          index 59f3d88ab4..467c6f34ef 100644
                          --- a/apps/mathlib/math/Dcm.cpp
                          +++ b/apps/mathlib/math/Dcm.cpp
                          @@ -52,6 +52,23 @@ Dcm::Dcm() :
                           {
                           }
                           
                          +Dcm::Dcm(float c00, float c01, float c02,
                          +	float c10, float c11, float c12,
                          +	float c20, float c21, float c22) :
                          +	Matrix(3, 3)
                          +{
                          +	Dcm &dcm = *this;
                          +	dcm(0,0) = c00;
                          +	dcm(0,1) = c01;
                          +	dcm(0,2) = c02;
                          +	dcm(1,0) = c10;
                          +	dcm(1,1) = c11;
                          +	dcm(1,2) = c12;
                          +	dcm(2,0) = c20;
                          +	dcm(2,1) = c21;
                          +	dcm(2,2) = c22;
                          +}
                          +
                           Dcm::Dcm(const float *data) :
                           	Matrix(3, 3, data)
                           {
                          @@ -61,22 +78,22 @@ Dcm::Dcm(const Quaternion &q) :
                           	Matrix(3, 3)
                           {
                           	Dcm &dcm = *this;
                          -	float a = q.getA();
                          -	float b = q.getB();
                          -	float c = q.getC();
                          -	float d = q.getD();
                          -	float aSq = a * a;
                          -	float bSq = b * b;
                          -	float cSq = c * c;
                          -	float dSq = d * d;
                          +	double a = q.getA();
                          +	double b = q.getB();
                          +	double c = q.getC();
                          +	double d = q.getD();
                          +	double aSq = a * a;
                          +	double bSq = b * b;
                          +	double cSq = c * c;
                          +	double dSq = d * d;
                           	dcm(0, 0) = aSq + bSq - cSq - dSq;
                          -	dcm(0, 1) = 2 * (b * c - a * d);
                          -	dcm(0, 2) = 2 * (a * c + b * d);
                          -	dcm(1, 0) = 2 * (b * c + a * d);
                          +	dcm(0, 1) = 2.0 * (b * c - a * d);
                          +	dcm(0, 2) = 2.0 * (a * c + b * d);
                          +	dcm(1, 0) = 2.0 * (b * c + a * d);
                           	dcm(1, 1) = aSq - bSq + cSq - dSq;
                          -	dcm(1, 2) = 2 * (c * d - a * b);
                          -	dcm(2, 0) = 2 * (b * d - a * c);
                          -	dcm(2, 1) = 2 * (a * b + c * d);
                          +	dcm(1, 2) = 2.0 * (c * d - a * b);
                          +	dcm(2, 0) = 2.0 * (b * d - a * c);
                          +	dcm(2, 1) = 2.0 * (a * b + c * d);
                           	dcm(2, 2) = aSq - bSq - cSq + dSq;
                           }
                           
                          @@ -84,12 +101,12 @@ Dcm::Dcm(const EulerAngles &euler) :
                           	Matrix(3, 3)
                           {
                           	Dcm &dcm = *this;
                          -	float cosPhi = cosf(euler.getPhi());
                          -	float sinPhi = sinf(euler.getPhi());
                          -	float cosThe = cosf(euler.getTheta());
                          -	float sinThe = sinf(euler.getTheta());
                          -	float cosPsi = cosf(euler.getPsi());
                          -	float sinPsi = sinf(euler.getPsi());
                          +	double cosPhi = cos(euler.getPhi());
                          +	double sinPhi = sin(euler.getPhi());
                          +	double cosThe = cos(euler.getTheta());
                          +	double sinThe = sin(euler.getTheta());
                          +	double cosPsi = cos(euler.getPsi());
                          +	double sinPsi = sin(euler.getPsi());
                           
                           	dcm(0, 0) = cosThe * cosPsi;
                           	dcm(0, 1) = -cosPhi * sinPsi + sinPhi * sinThe * cosPsi;
                          @@ -116,11 +133,23 @@ Dcm::~Dcm()
                           int __EXPORT dcmTest()
                           {
                           	printf("Test DCM\t\t: ");
                          +	// default ctor
                          +	ASSERT(matrixEqual(Dcm(),
                          +			   Matrix::identity(3)));
                          +	// quaternion ctor
                          +	ASSERT(matrixEqual(
                          +	 	Dcm(Quaternion(0.983347, 0.034271, 0.106021, 0.143572)),
                          +		Dcm( 0.9362934, -0.2750958,  0.2183507,  
                          + 			 0.2896295,  0.9564251, -0.0369570, 
                          +			-0.1986693,  0.0978434,  0.9751703)));
                          +	// euler angle ctor
                          +	ASSERT(matrixEqual(
                          +		Dcm(EulerAngles(0.1, 0.2, 0.3)),
                          +		Dcm( 0.9362934, -0.2750958,  0.2183507,  
                          + 			 0.2896295,  0.9564251, -0.0369570, 
                          +			-0.1986693,  0.0978434,  0.9751703)));
                          +	// rotations
                           	Vector3 vB(1, 2, 3);
                          -	ASSERT(matrixEqual(Dcm(Quaternion(1, 0, 0, 0)),
                          -			   Matrix::identity(3)));
                          -	ASSERT(matrixEqual(Dcm(EulerAngles(0, 0, 0)),
                          -			   Matrix::identity(3)));
                           	ASSERT(vectorEqual(Vector3(-2, 1, 3),
                           			   Dcm(EulerAngles(0, 0, M_PI_2_F))*vB));
                           	ASSERT(vectorEqual(Vector3(3, 2, -1),
                          diff --git a/apps/mathlib/math/Dcm.hpp b/apps/mathlib/math/Dcm.hpp
                          index de69a7aa4d..781933e9e5 100644
                          --- a/apps/mathlib/math/Dcm.hpp
                          +++ b/apps/mathlib/math/Dcm.hpp
                          @@ -64,6 +64,13 @@ public:
                           	 */
                           	Dcm();
                           
                          +	/**
                          +	 * scalar ctor
                          +	 */
                          +	Dcm(float c00, float c01, float c02,
                          +			float c10, float c11, float c12,
                          +			float c20, float c21, float c22);
                          +
                           	/**
                           	 * data ctor
                           	 */
                          diff --git a/apps/mathlib/math/EulerAngles.cpp b/apps/mathlib/math/EulerAngles.cpp
                          index 8991d56234..27ebbf8b3c 100644
                          --- a/apps/mathlib/math/EulerAngles.cpp
                          +++ b/apps/mathlib/math/EulerAngles.cpp
                          @@ -97,23 +97,27 @@ EulerAngles::~EulerAngles()
                           int __EXPORT eulerAnglesTest()
                           {
                           	printf("Test EulerAngles\t: ");
                          -	EulerAngles euler(1, 2, 3);
                          +	EulerAngles euler(0.1, 0.2, 0.3);
                           
                           	// test ctor
                          -	ASSERT(vectorEqual(Vector3(1, 2, 3), euler));
                          -	ASSERT(equal(euler.getPhi(), 1));
                          -	ASSERT(equal(euler.getTheta(), 2));
                          -	ASSERT(equal(euler.getPsi(), 3));
                          +	ASSERT(vectorEqual(Vector3(0.1, 0.2, 0.3), euler));
                          +	ASSERT(equal(euler.getPhi(), 0.1));
                          +	ASSERT(equal(euler.getTheta(), 0.2));
                          +	ASSERT(equal(euler.getPsi(), 0.3));
                           
                           	// test dcm ctor
                          +	euler = Dcm(EulerAngles(0.1,0.2,0.3));
                          +	ASSERT(vectorEqual(Vector3(0.1,0.2,0.3),euler));
                          +
                          +	// test quat ctor
                          +	euler = Quaternion(EulerAngles(0.1,0.2,0.3));
                          +	ASSERT(vectorEqual(Vector3(0.1,0.2,0.3),euler));
                           
                           	// test assignment
                          -	euler.setPhi(4);
                          -	ASSERT(equal(euler.getPhi(), 4));
                          -	euler.setTheta(5);
                          -	ASSERT(equal(euler.getTheta(), 5));
                          -	euler.setPsi(6);
                          -	ASSERT(equal(euler.getPsi(), 6));
                          +	euler.setPhi(0.4);
                          +	euler.setTheta(0.5);
                          +	euler.setPsi(0.6);
                          +	ASSERT(vectorEqual(Vector3(0.4,0.5,0.6),euler));
                           
                           	printf("PASS\n");
                           	return 0;
                          diff --git a/apps/mathlib/math/Quaternion.cpp b/apps/mathlib/math/Quaternion.cpp
                          index 68fe85300c..4f07840c36 100644
                          --- a/apps/mathlib/math/Quaternion.cpp
                          +++ b/apps/mathlib/math/Quaternion.cpp
                          @@ -79,32 +79,34 @@ Quaternion::Quaternion(const Vector &v) :
                           Quaternion::Quaternion(const Dcm &dcm) :
                           	Vector(4)
                           {
                          -	setA(0.5f * sqrtf(1 + dcm(0, 0) +
                          -			  dcm(1, 1) + dcm(2, 2)));
                          -	setB((dcm(2, 1) - dcm(1, 2)) /
                          -	     (4 * getA()));
                          -	setC((dcm(0, 2) - dcm(2, 0)) /
                          -	     (4 * getA()));
                          -	setD((dcm(1, 0) - dcm(0, 1)) /
                          -	     (4 * getA()));
                          +	// avoiding singularities by not using
                          +	// division equations
                          +	setA(0.5 * sqrt(1.0 +
                          +		double( dcm(0, 0) + dcm(1, 1) + dcm(2, 2))));
                          +	setB(0.5 * sqrt(1.0 +
                          +		double( dcm(0, 0) - dcm(1, 1) - dcm(2, 2))));
                          +	setC(0.5 * sqrt(1.0 +
                          +		double(-dcm(0, 0) + dcm(1, 1) - dcm(2, 2))));
                          +	setD(0.5 * sqrt(1.0 +
                          +		double(-dcm(0, 0) - dcm(1, 1) + dcm(2, 2))));
                           }
                           
                           Quaternion::Quaternion(const EulerAngles &euler) :
                           	Vector(4)
                           {
                          -	float cosPhi_2 = cosf(euler.getPhi() / 2.0f);
                          -	float cosTheta_2 = cosf(euler.getTheta() / 2.0f);
                          -	float cosPsi_2 = cosf(euler.getPsi() / 2.0f);
                          -	float sinPhi_2 = sinf(euler.getPhi() / 2.0f);
                          -	float sinTheta_2 = sinf(euler.getTheta() / 2.0f);
                          -	float sinPsi_2 = sinf(euler.getPsi() / 2.0f);
                          +	double cosPhi_2 = cos(double(euler.getPhi()) / 2.0);
                          +	double sinPhi_2 = sin(double(euler.getPhi()) / 2.0);
                          +	double cosTheta_2 = cos(double(euler.getTheta()) / 2.0);
                          +	double sinTheta_2 = sin(double(euler.getTheta()) / 2.0);
                          +	double cosPsi_2 = cos(double(euler.getPsi()) / 2.0);
                          +	double sinPsi_2 = sin(double(euler.getPsi()) / 2.0);
                           	setA(cosPhi_2 * cosTheta_2 * cosPsi_2 +
                           	     sinPhi_2 * sinTheta_2 * sinPsi_2);
                           	setB(sinPhi_2 * cosTheta_2 * cosPsi_2 -
                           	     cosPhi_2 * sinTheta_2 * sinPsi_2);
                           	setC(cosPhi_2 * sinTheta_2 * cosPsi_2 +
                           	     sinPhi_2 * cosTheta_2 * sinPsi_2);
                          -	setD(cosPhi_2 * cosTheta_2 * sinPsi_2 +
                          +	setD(cosPhi_2 * cosTheta_2 * sinPsi_2 -
                           	     sinPhi_2 * sinTheta_2 * cosPsi_2);
                           }
                           
                          @@ -147,33 +149,24 @@ int __EXPORT quaternionTest()
                           	ASSERT(equal(q.getC(), 0));
                           	ASSERT(equal(q.getD(), 0));
                           	// test float ctor
                          -	q = Quaternion(0, 1, 0, 0);
                          -	ASSERT(equal(q.getA(), 0));
                          -	ASSERT(equal(q.getB(), 1));
                          -	ASSERT(equal(q.getC(), 0));
                          -	ASSERT(equal(q.getD(), 0));
                          +	q = Quaternion(0.1825742, 0.3651484, 0.5477226, 0.7302967);
                          +	ASSERT(equal(q.getA(), 0.1825742));
                          +	ASSERT(equal(q.getB(), 0.3651484));
                          +	ASSERT(equal(q.getC(), 0.5477226));
                          +	ASSERT(equal(q.getD(), 0.7302967));
                           	// test euler ctor
                          -	q = Quaternion(EulerAngles(0, 0, 0));
                          -	ASSERT(equal(q.getA(), 1));
                          -	ASSERT(equal(q.getB(), 0));
                          -	ASSERT(equal(q.getC(), 0));
                          -	ASSERT(equal(q.getD(), 0));
                          +	q = Quaternion(EulerAngles(0.1, 0.2, 0.3));
                          +	ASSERT(vectorEqual(q, Quaternion(0.983347, 0.034271, 0.106021, 0.143572)));
                           	// test dcm ctor
                           	q = Quaternion(Dcm());
                          -	ASSERT(equal(q.getA(), 1));
                          -	ASSERT(equal(q.getB(), 0));
                          -	ASSERT(equal(q.getC(), 0));
                          -	ASSERT(equal(q.getD(), 0));
                          +	ASSERT(vectorEqual(q, Quaternion(1, 0, 0, 0)));
                           	// TODO test derivative
                           	// test accessors
                           	q.setA(0.1);
                           	q.setB(0.2);
                           	q.setC(0.3);
                           	q.setD(0.4);
                          -	ASSERT(equal(q.getA(), 0.1));
                          -	ASSERT(equal(q.getB(), 0.2));
                          -	ASSERT(equal(q.getC(), 0.3));
                          -	ASSERT(equal(q.getD(), 0.4));
                          +	ASSERT(vectorEqual(q, Quaternion(0.1, 0.2, 0.3, 0.4)));
                           	printf("PASS\n");
                           	return 0;
                           }
                          diff --git a/apps/mathlib/math/nasa_rotation_def.pdf b/apps/mathlib/math/nasa_rotation_def.pdf
                          new file mode 100644
                          index 0000000000000000000000000000000000000000..eb67a4bfcf58a32d13a26ff2140e23aa015505ea
                          GIT binary patch
                          literal 709235
                          zcmbUIc|6qJ|38kut`Z|7GpTHqL9}P=WF1D5wIW4~5hBY(wus3-ZI)a`O6al_F)B+D
                          zlTlGxFfo>xER|`Dk&I!+%=tcbUDx|{y-}z(aIp=xKc|6WJkLCV&oHOdq
                          z*nPXT_GnA1kBz^lNw3y6(ng_C1fNsVCMGCpP5Z!5KYVy#te-DR3;OAV(l*kCzW1X%
                          zP+DjM9q6Y4%5%9L$^dPot)mA$TBEel+J?)m98tR3(3cDJPDk57A0=&OhLZLR^<5qv
                          z_5V+a3HS4tUgl6+2PKXEqiE@)emrC0w^WvHd~-*s9#2I#-l8R-4JouR(r-`W`&
                          z>HK${HZ=Xe)oE)R{k`t*<7w*{{*7mCJ+$86`s!;#o3UK}JvVKA-M_WdMH~H%XI*XW
                          zzs*-yN9S++>FVhJy`8S%-{z~Uuk|-xbPb>l|1bV@4fX%NrpuD@U+uJXbpOJ0L^wV$
                          z*e@KCIcd$qkhGz6wDhDkZA1MDC~ZTCXVf7`jt&tB5s<(^L;d{e9PStOQ?m4zrOp=X
                          zVWO+!r>$qCi`UZ8(K~@QIAMr4^4IqD(Kpof(e?Aw);0UTTX;e;Dt#sbA0F{j*3i=G
                          z>ef#Ceo8AOc*~^!M>Sl|p7uj&THzz`!Gx0#2hRADerF*5pym9@pHpN+Fr+LXEQ6m&dH
                          z#F>rW&sHpr_~r+@;%^-%cWb;3xpwR156<1U)h8>;z8Sk8R<9rOq*dj;zxO?lVmm#t
                          zx_HGaHIeD&i+XZV`BOKS?hiyz(^%VkDo2#iuy4kF?h_=1VacM0Va_(I|MdX9P6tiW
                          zo_Vmx`$U!x$?q2RE^0LEdH=Jbyq8(8`&*x(2C~`=lS4)nNjQb|@{jd@Juh!@e-*;}
                          zU)$b0)-GGHKPK>pE&F|H%Yvb02wBNLYL_kL-^AsQ{dVy44a8d#VjwfREH2ABZHU(Y
                          zX-S>&&~7iw`JZxh$nOjxGW^f|-$#I6E(?OgA*c;xf}riubg)I~ESry?&z8_LWL|zg
                          zYeUQa`xa^*J_ObOKBng3<@SGUt>)q74$DR#8tCwHhd&!ZJ+zJf81*pJMce3)VGl!H
                          zw3kiJ&o0Y-(7)^GPw6@8z45sE^F|zS98RNKx%Xtny<8`CH{=x&vu&o{eq+XA_7m~p<3%uNR}amMQK9Xf(bnn
                          z_&*i@NpyLE{vlD@|DEV=C!gTJu*hXY@ISQv58}(h@Q;W?BJ|e@TR~zL2&wP?JH=%Y
                          z_(v3%CFids|7VSNTM~kO{{iJ?u~??;fs)oi|87`x(0`a&&p$QrcX|J34F2bmxCDmy
                          zo!Nbe5P}c=e`fA?&H86l|5FHlr)mp1mcSGLfb6o4{WG%vxf#Ec{YM+2gZ|SQK==y6
                          zWPcjOpIh<=FaN*2!p{K?{Z#vZdxgtxaZcm=5WxIUOY$YecU!|4q5h%2g`Cm3YSDMaaEZp)y
                          z$-A8qYpXGOpjLgXGOr>SLr@$h9%DxU9c%jkLJf;zaHF6^T}v
                          zjgOcx`948tK((f+;qg+x`pV7MKOe3qk6RXwsK2Q@Td(=UnDiUlcKa{0b-h+GN85kV
                          zc{&I$UE$6=9s8`-s*HKWrY9gQY2qMNTglex^6-A-CwcrXcuLq0mWD+PduCqNVZ{+#
                          zthQ$vGZ;JmW~_wV*U8dLx;S7IZ`Q#V`yP~Z<0j1}EU$W?_q2oBI11LL@-%0|`B#U<
                          zdToZ*Z1^Rqw^@2|GS93Qi_?MW?0+qm81eA&ZFc4__7Uh)RZ8a#EPb9_?&*eYDT(;y
                          zs`raB1;iJbe6h}y>`n2A%X&Q(y!zolNhefM1DXLr5midk!B(eXV+QV8?&v9qjw
                          zMH%b3*K}9t?Ug(JBinGb4s+dU6^}1!FMj!@*rp4nULR?4L}BX=<=sc$yTWOdiZ`8H
                          z0&}j>b016Q-i?Bi@8Q|@8omBIEm7QMAYdRuf{+vhI2V;^rUb`*2|KJIJso5Q*le#ej@s)^rT%DGyXDTbGa
                          zuixQT7Vdfg9=z7_GmEbL<3>zKVF-6L-t~3;v7Op^-a6u}mmh=Wj<$Y~ei+wBG0SEA
                          z7&aJ`Lp@`Kgvnp*Jt0~lN=1+5zuMTNa>H%?Wk-==rRosd(C4IU*G3e!>3&S*Y(;O@
                          zT<4O_9u&UwiQ(tB*EF5ILekh9tC^R1sP~~>mkcVT_U)1^Zlb@Z;_kikX?qy5dAnSa
                          z>?5_|gU19XOKyA+C@|-vil$U=ANJUqmfc2g%8tkw-NkSC)T?G|)OD4&_&B^%Qg&+WLdnb;r$6pz%E?;9aca*1E-$sV%qfuK6}D
                          zxk3(TT|kcf!hU@vGjaRtjBS;5x1ah(dnlgvI>vKa+(Sn6oBCjGtUo8v`(=z#XwtQ6
                          zMQvb6c@;;(+bE;|`rDX~yuv5yyp#4T;W`I4i`+W2HFDQQwzWtFb1lvAFkZ&l`M2
                          zs>TcsHhRn&yw7|Qr_g=Sb@z$AZ#@I79mLhBLn^Anq9c4|y&;*{7RL1ty93hTCr#q*s(*}ecr}x^n3<22EZK?!wzwzW86$+TFhT
                          z?YsWM65$AO1^izM9=n|X7xelQIsPNZ0pZQRdhtJi!#{>BzvI+@M)^No)}NIBq0{;k
                          zDe3;zW&H)r{2wmschvo#fy|DH&)Pa#uIPVRO0CpE7u@RXEalv|nRolt-A`BFcdqZ~
                          zTn-`8}@uzp$$If9$}2;;4TL9e;=X|7af|(EnEn_&0R;r>Ny;
                          zc=C@(JNzfWt>w__4<43d
                          zO07RasXsB*jSc(k>|eRw*sX&);#>13=|;91+W){EB4^lqagfXtg3V1OC&3U)Bmi9%
                          zL;xs)1v&u?vKME8GEpdOeqn!EQ}~q-Bl4|pCNjvpMvm|V0RYyt2k@MJKqLc3JaOp~
                          zpyS$&4^InlLi!+oc7Za86B5aD<~$&3p)BnH(69gyfiMW*goAwz0tO3!>K;B|b6KF8
                          zLZqW!_PwcX0fKS>jz%_Q*By0e$0PxoQCKOr`!OZZD-CRzz2jGt=)d_p>Q9~5I;H*
                          z2zn>t(s2Sn26hS1oR&)imjRksLI7}NKnL8Pbt4qO1JE^@rAr&%bUA$mjeoftjTio84sL
                          z$O{3lZQ2~7CSWW#NNM1RssWFm4){30WeABx(5DQ9ae&JK10<@U-|Y9tRJ9kghH`4T
                          zfJjP9!D6viu_6ir$0O#}Nt_u?Q+|WKv$_}1dvJTM2nyWDLg51>ROA4-v0^cM2Y*DE
                          zQTXPvCgG10Iqbg_`)yPozz3M*Ko_860?q!@>wlW$!McZ@#N(iy+$lIeN&y`|bmaY0*AHYGKMXF9Cdyc)TvZZaaFzs0BrN)^y938IrMK-c4
                          zggkUF*EOV+5ppg>WFIkX{UR+ldP<8EZr1j4rWHA~X3ub%Qgc7PDLU97l-&^06fzV#
                          zW!!)m8EuMU_ea;Thnmx4@I&?P{~F5}@YB(;g6Z0*)_1D*owm|~nV_iB=mJ`uM;$gj
                          zYV)P~3*Rg5gm#BvN2zf{9*s?_JUxBcgc&N|%q)G*dY;(k|C@^H
                          z?Y+g#jbYc#(`OsA(pQLCwUSa4W-edskj&PpO3lvTyfb6!(jG>hGcPlA`o6~bi;Z>L
                          zRxJWSZ$s7Lcu>dRz4A$V-VaNmCU6y+AqN~(hVP>?8klaJN^&QYp
                          z-n=>`4luvDzrvK+z|S`mgF?dll;G#z?IjEBvP|@Du@a?f*}+FrlAmb3da_-e)GH-<
                          zZ)My5@Dn%Q8LA+mttDkH)#PS%OJi+1#g9oVy&YovsG5|`z2A=CeL1hjc(ob;V5$00
                          zY1sW%nzVgR34Fif_K&K!)gPNY_tKK4na*sPYKc4Lzq>ARWNo=cCupUYHw)19o9hj?5jZgUxVdBpQ(=kqAfo0nd^
                          z&{FuV`&^Tz{JP1`iEy=tT$4N(N_|f&Qebs>4!P-+3_r7e%1XG#{ky^_s8!ItFy+mkY9ZkSMHl6E%x6%yhyJlY#bwz-qap6z8g^*8KGS~{zmPa
                          zTh*%LPwSlpBjtX#?B~{EzWT7xSMHb}Dr6zom+#kC{neVTs$aZ>Q2Azh-{&CWl-pLf
                          z;C&|5njbUX-|1^3T{v|k$_lG-xYj>
                          z%(1Wj$n|hyiN*7gEzeX|t$`(_eQtTW_0c1QMTfOQw*Lfwi<>`c1}*l
                          zOvv|d;Hvy`-lFH#zY-DH(K1=9Oh;_&WCa;j+>w=M@!CR5vX&-UmfRJC=`C;H(w23n
                          zBOivw6l_j*B0k(p69%5`Z$w|YZFl1ACM2ox)oEwT)skf{E5xYqe&ZxKs%J?h1~W6a
                          z@u=q|cVyDq{bh)t;y`{m7J4D&gqB)h@#1JxEUxq}nldOb*bG$4*N4waLum7OpUL?H0Vu920E8%lgsek)!6gNnX6}2nPDRiJhGLd9as0)y{qV<`mZs3_sN4=e8vusK
                          z^Z;2{qD1eO{&iOBSI{^^viJh29g7phg&@hzJDZ*;iwdG?C@MTTrJk}12;!NILLw{3m~Y3`4Q+oJ
                          zu{v^vOe(%EaNucXb(;srr$rtIKn*=BxfY|rG>i;9K_-LaZd^`dglW0s@X^tv`pp>Y
                          zm6D}`5jtn~)}98+NMYngbb~asY~r3-0?(S{2{>l>o3P)_bHtS7kU*V(ioHl=bRY^n
                          zrmQ^dh(u8(Q3AfFe^1WH(&5cR&2_}IW^((WfXHD(-U5eCNj--pR#itwR^DA$RC-Kj8G=Oi
                          z)wRKg9NufSSDpJ@9@XLf+`6aW8a7n?5bWgn#Ij`56gWb=q+$&W@%%LPK-6xlJ(+hV
                          z8y_I?uuGN&F;&YJ*tpvY7O0L)Titx|fK=t-hfjNR-+rFus;`3H`6{N{N~gNA(ho?j
                          zckc4Or0cZTKZCmQWs+Kv%_d9|5?OrRr)ZBB=v3`Eu%?ghDbHoW|t!iG%~IWbjgA8s7b3jxWYxm2J(2zB<&+8VD*9L6yG*L*Fs#uk})Ot0RSF
                          zL>;7Nj}N?%D<*wC6()+>^+xZIi4zu!-)N%JkJV}{9>s~d$;6R^Pzf`QuAg-nG}4F>J%bTl~3{u
                          zJKa!GK51ZEL1cd4wod-YdNZy7@PW($N{{dXog#g>By>ulBsQBMZISUOWkIsBz8^g-3WR
                          zz?&8ED=jxwsFcMq%bw=hrl@3}E*3|^TQhofsX{lx)Y#LfCHjC
                          zG|x;SQ3j;0k;n9e4JH&$UXl^Plx4b0g$Z*aK4(!*b26>7L||oUZb|c$kT}(s%szE&
                          z0_{_xm=@F5Bn)wLJFdUa5a$^&p}2>%C(3HoB7CkR;46wF?6dOEkE9`a
                          zDg{f4o2n_*H_JV;!e&^kvZgF_@Pk3I0Ju9$-|KdV&mFOY9dbtEHdG?U)RdKmU`QQV
                          zo9e45{p;f$XIHHpd>(OoUD`Rx1`x};Zwah6Drbc%PUrxcuF!QF$u*P%%n|zbl{(~4
                          zLN_NN@n|X(Q?V8j5WeYNlW4!oB{TQRw>+cJrYToPOL;>Q-`AI?nfEPd0^X
                          zikW(=ZS90k(cxq_Ht3UM)r+KNi1Y}I%29I$dn#!A#k>m>*0Ep^@QFa}PE3+2dZN!%3hDrfdIBF_H90X54
                          zNLp^O*RBKvz!&8Ts9vIv%Gk!U&IE%aMGgr@;SH{F9f&hH%5q>yXL9B#ZB|=Xg%Iv2
                          zbkCv`jd6W)UQdJg0Po@9g|w=F{+_>d7v2Ohz#0Y=LS5aUytVtL(fBNMcYUJhTSI*v
                          zc@#HRvTiRvwf-?!NSKh{l+bcQNMO}Gl>R!Lv14e5YJ`wzveEo5ci~`jnyhev!z`nC
                          zHS&pp#QKNQ%uK*xuu1q|C)JzD!-vJ?nm=_W#>B1SaK6zTyc&64RWam+Stv9W>czyD
                          zPAZ%~$gT#03_7QYR!fumEi<+^v&oAB#m=0-vfmzOfEOV|N*aYnlon53RS6hGAzxTE
                          zTvc{^7gCuwT$L&s8Z8IWlW53eY(Jha2LwdkJcSqEk16_qtrYU{x>Ux%%0#vqTX!^T
                          z01;T!sVH{fm$ucploocviy6NOd25-#c|<_YYE^lQH=!`MwU%v?1?qA5@{`>u2)uqh
                          zra9}>CS6S0>ys;C*!}1vRsBebYp;>1`FrGD2BYUmfp4qxv-XQYvC&G)U6n8&&s?-c
                          zY7$Z$ap9Tsaa}9@B)^$`;R+U16s8D^RcLUwR8>_wftXhG-JA$RA5BZq-Rie^9FelW
                          z>mX!Bkr$5NA0&yQ4nomNN7?0HryN$Sx;vo=!RPI-gXKQ!ACkH`vtUJ@mqI=13_kv@
                          z#N&GSkY?Ep6YT-rH8F_9Rgg`B>2~%yc?hm|sG4isOSK-(RU8$U8!!-@2&~ebI5A*w
                          zDODM~eJ$%Dj9#F1uZu60-b&q`}A9tCyKux#1_qL0nOUk^gl#Rpn)|!-}%xBm2)iPKIg6d{DLx
                          zuzlAPcm31@L=C2_^1#>Kyl5h;q~%z?b@%Mv6=I5b@eM=G)NRr9Tsf&-v9@cjN}W3P
                          zYK1~_8Kv@RtZ&>xRUFtq>vim3Kbq~QCQjb=KYt!FwowYkDK^q;<203D8qe&H`?inU
                          z_2}6|Qi^3_&WGYxlW*5buWUY2asu#)El?iCs_(Hq4JL0Xk4d3M+;xTf&Bm
                          z{i;^6y{mV)+qk~5oqiX`iNBw4lrI9r2&z)VUF%yPo*v(%eb!W;=g1K5dAasP4P#t*
                          za1$Cwts&;h&>W;BQ!pee$3UeN^h?Tg%VHjmI}hKk*~Zd2(a(_~U_O2@D`f&_-@
                          zJoO%xWj#&WSARsT3ol)(RKCVIP4*H4u41BMF^RPiR@sd8DN3&tYguS)!(5F}RWTX%z?_Fn2
                          z!X1nqR$m(nM*Db>I$9lmXsaqA*tx^#^b06_^4R#ON7th(?zz6v|4CT4>ua^B=XGY9<9^BrtwHl^G
                          z&_!vQYZ_hJOqpJwfIVjY9&z=vCyHnqil)v)aM5QwFJX7OoMdFqm7zjh;0h3uqENIK
                          zL0w~&;qT`(H|)1`h;iMRh#`V=51`~JF>XVCabVdus#G4cz6VpSG7w2A6)^YJ&$cI@
                          z#5M^id*&t;i-MyAC(#!-pL4tZ#+EO7ZVvD#!1sbR%6tLu+$ok~S65(r^muI>xTNgM
                          z*cHdxJuRCP{nR_zg00J*NrrDPGo6P%B1cdJi9MPBI9de;-G3`SRD`B?sP~uD|E>Z%(Nd)Sq*=E>CwasHzKDv93
                          z&h4?fz0t@jBwjX}Sv3t)Qjutjp*!ZGTGy%|kzmAdD{vaN8P)HY<-67@A_WhlO4`p#
                          zvw}ADV^Z|e`Y|u8scois7-wd&JxcCk1kK4|Z|lAFv?FTyf{|nw%#>g2aEWejR>o7v
                          z-dgH8iWG~d*@V&J04p&)2i=ca2Wmf{sJ>H^Fs$_*!i~Ecdw3P)$!k=1tu4>aXiiZ?
                          zPGK9iUkNiR^Kzs)z`RM5LA%a(??X!Nqo_ku>fYu%47-100fApBSsqUfu9OL|tto?T
                          z*uP$Px;NHtdP{#PV&L3j%KMdtVv@c5bV56(6MgMhym;y`If%0bfa_tT-fZvm);Cnt
                          zhaJK@)78DSBcdGjm|M2_7mOWD<5ON`dQ~myfu&mY6f=2PiWR1!>D7y}3vXK+Pmv#M
                          z4IQAme0-Q^ZRVnOZ|i*BR;5@X?}5iw46brmNs6Z?ibGlYR)
                          zDf%37@h-))Q6bdhCOR2YmWQdRRkYWR8qlI{*~B!hJ{}7=yW(V~G96?XQN3Nx<3${t
                          zL$_hy1@ke=;KHI70PI)R-nVc>9rvdFIM-l}S8dx+7qHsjIn0$5PbU1dTfM&dVpm8s
                          z%tLhCQrhqHfrF{3yy1~#4glYwqXo_nnUsUPmYH7jCT#lAYLBW0+xyM^FAk3edA022
                          z4vP#?$xzNqmnwbg&SBGdP_6aB+;Qj9C{Z9Hg2%%K9(S7uAMRx}l+L#bXfoH$B|9%S
                          zSo4gAc^nzfl@=_gjFN-Yu#I*W*Tdeu$mJ?enE{?)XdPEXg`{ouk8xlRr?FM
                          z;6i}*<(3dd|A+@aj9*fu!S0U@ar1x`P%wq+r;T57O|3;yk;w1M*=6W_CTJ@VEGZM|
                          z4(Q~V!6iM?Qjp~$p~d5lpt_0O$NnCGUo(ZGow7c+eSLSH#T(yINl(qH8Q#)iUbTo*
                          z=jx)@=D6!Fge#Dfvh`a1Is=lwk^~$G>FMpNW1RgXz!*r->UUb|P9^+F~6qp_G`Wo=h&7ak&=
                          zA8t@mj7YB-FZbOx(*@x{EY@yYu?E8b1YS1-B
                          zsiV5NZ7ylGd1}AYC9Br*1}3p0EJND)kK>wxF6s?Jl>@}
                          zV{k+;(p2EM$G|IV*5Hmaf<^w!rVI|UPO&WmqgVghHooqtXa=%m#qf7g@j=yiR)r@{
                          zM8lM&#NFjJl4BbdeI1|ggN`h}iwwEMHA#zvrsK8uM4Cf(e6XwcD8g4qxDfl^#O?kg
                          z=j}x(6ds-Uc|^bkOOK?OW%)r2&j?CRef#y(Y1a0Lz=|!#wT{Y*TB1rOV^mws^{O&`
                          z3!gafB`f6e%-$o(FvY;yQC(_)hHUUt%dt5|e^9*o@bM78g6DNEurN;>0fHJ>&vgHA
                          zg=V?>g0U-(KKMPdv@5X9g6dE{SLf=!K>=ouqVC-bC6EsG#7bedRMsk(V2URS@4>TS
                          zHP>A6H=$%#2_mvukvXdR@fG5tn&&Dn;ZU*4_(ogP!_r
                          zo>Zw6`AFayaMN|JEifS~(CGkDBDBUefGgBIBz5-2u2X753H5WjS*7+dX1P`IM}B-N
                          zT-PU$O|%+vwTr6Hb8vi(97tEJhJ;&<7HvCtDH!E_*QUnGC7mmO5K7qoEWbWO2VU>j
                          z-kUh;SF_(Y<+wJ+%l+8{(q)A+dn8`825Xm=9h6r~3)ZtstdYNd>W+H%9x=HU2kkH}
                          zcFEzRIV!IncBz~W(pN}*Hbc`t`D|j<=@cwBu}0x|-@b`kus&Csq`jZrs>J{N%w2il4?@;_D9rgI6zgdT`Y+ktZr(Y2^I@gWh_IVSZ*k~xx
                          z1{DAV^u@sZ2`6UxtA}kn)E=JAZo?cs85LO0)`rv6VkLsUi1MZNU`Cr)+Fvi2H}^CZ
                          z8=(m3&6KKgVFH6tH*9|Yo7@W<(3}oNAn3sZL{TAUq8O=iAn|Lex=+^mLKepbdj#GH
                          z9Xg&oT2Mq|v##CQp}9p|rwE1Jm=wEGCGmXXb9u)tT1CX1gj0yhvve_xIN}Z+tE-9#
                          zoHWHbP2UV$A#Nqn@%71KXG!hd0LX@aDww*q~xQ7-^VAeYO(DSkUd#WSNn^
                          z=vdV=So2!zyl~~G>3OG9%<1$#ZZFbk^1_r}$sE@=L3WO5FjV%}gFf
                          zn&m^B5eYRp;I|?t93Tj-66T?(tBsFp14O+Q#4k0#2~a@ege)LaM9R&3aX_@`s^T34
                          z0P4>{D+Mg2DvKzSnj9W@L*qdc0K^3x_iG+OuwRx)@r)!w2_gy;@EI4cP|83$2Yz{k
                          zQa1-UlqTRL;5>$oIw%4@O4K
                          zpbI7ByFRt9Uol_b+&n{PJI4>gHB#hNHWsSc)zUnTr~O~J!%@DLkA6u}RU^&cLMJ;a
                          z1{TpF==mHv%eOY?aYggF{dgjLtzbP*0Mi@X><*J@hoHhw75?v!W+GrL*Le*SSld&h
                          zE%@^?4~OU3pKHq~*IO-ucPQ*cCl4J9l708CE0EXJc_?i67RA%Cfmdd`U^%YSd_v9{
                          z7q|5R>GED5UR4`Yl80xBIld27Nq3A(3aVK1Lj9eRIV*~&(vsp5+hsTtv3mn_LEjkg
                          zoPTZu9fQSu8WK1)LDZ>NX?5guV_n~XeM%gL^tfnXq=a-J^Zo15uMZW!sZmB8Ni`+T
                          zTYpuJA^8VSuCdZ7LZ>K=?W7PsB(8S7y$6}S
                          zh!d9beX`r%pjyR~hmJz)dkPU{epuD~-K*?fFc&z=ugj4tGlDL>tC}7g$6yT$Ucsj9
                          zVCfqc;Ttov#?Pnk^F~MbPQa4aBieElH>9A`u2sl1UFsqV_h$?v@+Qpb)j{iWtviq~
                          zl(uwK+8-
                          ziFY*3cy=ku7>TkTBEKxZh%?6pb1hgPh{Zrxa&DI5Sh3P38imZ^SsA$M`pHW+D*oMT
                          zo5jJ*)}4FreIw
                          zl+g7xr*vT+qoxqabDOr>GDr2V(WW_UFFKo(=^!)*Wj*{2Oi*4)t}Fsx%0#kbbu(a5
                          zgdlcqWHVKAbZ1}?-C?F+MJ&sfPM%*n)h=*Nr!5HUI7DV+eEcwrB?2rS@5nSDHWRsY
                          z4#g>LrpcWvC>gCT&?G$9oQY@?*4ATKq6sqKx_UKutre0JDC;T28P7)iM{`j>aY0y1
                          zQQBNM_P`YgUs;$ZRP{xyF!hz|>F{>qK`CC2fFfMd1Z47(PU5*YQk;ew5YYs1^(}4q
                          zZ{XNn7z5nDlJ>4yiaU~Lnoee~gs$Z*oCbX8QVC7{sw#?}eJe($O?|BIqCi
                          za4HFOSt{{)ufF`y-+YyUX=G49TRISGiYP4TJXn+yA46mUFy!{?bc(klkAs06kg$bJ
                          zoC@Se=k~C8ks_WK2MD1HTEuuF5yy^Y05Ugdrk@ar;}8WyIG&d%mm^A1cdBoa)&z^f
                          zcTUh9D7vUoSPf}^^;(vw2fT=t2&6;;977O99?4yBis~6UTD2$@)d#ybToud-RwsaD=W
                          z7cPrQQG}}<+=L)q+P3}f#pc1FzzVpAEQERl&$0VSSghC8m_af=b$4%)nY^vn3(Gv>
                          z>(4D8^%;jIjZmC4^?6SC4?J-o^*r%4yw@LjKf$asQMc`CQyT<({o
                          z*tSbWd1s|`n1gs!6iiXt3~42ziBvj&J9{<~X3oA0DYG|eAy4S5mZl&sVNc40$A8N*
                          zY}$4vqvds!+4>c5-4yFp?OetJ(O3_Tx@oJ)=i70FJ*k|x+Mbat=6mg1GxjLZBg*H6
                          zHcIh_`Pm1XDm(#SKrSM&guJ<2hL9W>*(<8fZL}+)5cz;OB#oI&cB)9;ZlMt#a~JJ7zf*`8n{w|1tzxEnjsjP&yV1g`MNjv&d$R(=
                          z5tS@ezk8*n>UNmm!2&*2kap5GOk#xfdThk)E;4S(vUIT8
                          zZS~sQyThs=DF?#%<hbSd2;Thr$Itg_q~lHq
                          z;*TeWZb-#HItw9`vGc9sNf)0nRdWdA00y1Ww?tkP&+r2orSxSS`$xH+6zX`SZaaLK2@e>}Cm!@ue%G>-H
                          zeh%Fm143aC4o8e*h@fOSbQ5y%+S)hw{cFFkhwfhx0i>bO=U)nx4r|1
                          zS!prsV^G9ViFbVwG6lc-$a23sQJ{;U@kwfogaS(4z$Qv$JBN|ARk@3Qd@5+WC-5c#
                          zBo18Sbg#;LTAhQtB&5@XG3wxR7|Otl&a9SWY7(!#z_?T9tgOh_p0(OjB~J%R^G)>RJ>p7Mb4^GIs1|VAXZwyFudB4_mdxB8@WE=^@MevG
                          zSpWR;-RnzIVzQ6mw_rGyGKU|nE-l`L6jOWkL^t~Go+w`hkpoK$((1JH7_kfIK(}P=
                          zR8n$)W7EXP^WGQ4SHLeOWnpz3sMLD?8k(!zw8N5i4h-!wWkBn-BvNHy=-Wf_@lmWI
                          zfn9I{t8Ac-=0Y2L*8x~Lr<;pegXNi&DoT7sCfD&*V?Owp7LyaU#nhba^iWY^GA*XV
                          zfArfnNz({K!cDBwjgSQ8g&hPTD-w{)OKVByK&Z!HxYgAWc)gHN2}fl(q6a7(sJ_p22C1qa%qD{D=PEt;uUJ3XNVDkMFb`V=>0aCmd=|NRz~c1OJ-b*ADM28sF2pU(1wS%
                          zgtu2kGNaw^dR}05^uB40KO+6D{8LV9t=Ts3w;*02G4dt)iW;pRqDP2Cu$Qf3Al8LG+{*F0-7g`^i10+sPgzyDVT1!l2EbUOpenVD=5VW
                          zmgQD_x>rTc`6bsr(bLx|;_eMu?BbrS{m1hrknfCc-MoF$SE=Gw4qF^bEn#i6@1J~$
                          zGo(2n_RBm}OX;yK4q~0d223GTif`F6J`Bnc%Tme0QHrymsxBTxT-fKJEUMfZx_{Kb
                          zvu`Mx2U&G)b0m?A6NnhoOFM;pf#`L=+x_Sz2G_Bd(sY;d#Q&EiqMwj2I`%eV@|{Z0
                          zL9B+4(6?jh;Vk9wTf<5yb~?7A=0-mbcUk*ei-UZ1i^KTdpcqlBbUa~bj;5jMG<;S^
                          z2wt0K%d!eeyo@zO?-~4Y%H|(MZ(it$8Ny($%?6Nn;WXu)9Vv;`r5O~B^1c;v=Y(h5
                          z6Ar*<9CmI)%#^2?z+k4v4zg*N>aV=BQ`9uNk7FF-TUhdOM`$Aj
                          zyrg(M;M6@LeyTQQSaatPp)mcV*z)qy*mlN;U?OiA5w{+(WdB_VT*w}LA#`E8Z!I~F
                          z$O$;xzhkK1jT@I4G1we^)Q;CCzE6T*$*#{wiWYhWkey!qR9M}Sm~8_XZ2MtN0gX*u
                          z)iq9kx|KMvC!l3ycz6bLtABwFz->texN{a14HK&lKf3vg;OsLYF~yOy=WJ|b)vBK9
                          zfif28B7trt2wpOA%{UyT%!V)G3t}~!0UZkGN1A(qN02ZBQuvU!W`G4eJUqA}W&(?u
                          zz@N??3`vc|m-O4FN%p;P+ue=>k$@gFD5$DxQd;-?!SvL{kF?iJpU`1r$K3k$QEk$@
                          zv|Jx-AH6VYn1)C;dVnoaeL@&yI62a%`C|p;QMaHNC>+(dF!#K8zRRZ)E^lnPoYh4l
                          zsW7D-cRMC$x7o%<$z8HkNl`V~iYh3$@NjXdP;>Cq$t6fsv2PEvZ@Z-}#&{EeM
                          z+oOS$$LM)jw+ZOi@2;gI*J7Zr*}ndCt;DleSb?OR4UwV&4kv=o^4w`f{kHxD$7KP9OFcw9+o~}ZkZp_
                          z{up1qPq_!PF|}VBB$u4^;^b7pwdo8&4?0^ZeqvYKU|L6_GZky
                          zz}k^B9{NfNP;lHpPM0rRYP^RChgLls4BbklA2`O
                          z5U9bN6>GU>h6vpW2uS5~?izE)bsdKHIysno(0hqao?D^YC^RR#X`C)3($YoA@l+Yf
                          z)TbIt=i-kDPVuJo7=uV;P&9??xQy>PPN3PG9ctFL=4N$4=YN%n
                          zLwK?ILVFzMA~NKGwo&eT*vUO-3;;Wl#$+`~^~N7|q>0f;^L|M$2BUeRA=tJudDRhl
                          zyx0q4%mw>94p#?OtyCME>7wN`nC3YA{kH0cvJ@++K%H#1M8&HiKo{LHL_?W+)&8<%
                          zM}c(wQ)GhNCD1N9ZhCYp5xgKahy*Py4T~xecIsWuJ=HRZP4f?gNzA3{9q_hj5hZ>%
                          z7wr5ssWXfa=Sh{e+hlsU$*FBXspM9ez_Yg3a2()M&k`!**v3vq11+Kk=nBp`=rnfV
                          z+&9u~ECIiYqwXYPnx80t*Ky$B7qvUoRnyolEi5S9=8r*4snw>GUTWgcRRNnvl7JZv
                          z28D6o)CNyuh$G*RhlHvvp_&&!aoF6XCcobS#%*22rx-`#sH+4u`I|Xeg-!NfTK6_M
                          zRUifF4ui^LS((LNqnoIU23xPhK6;p=>{3|V8S7vEJw(-X>fuYT9r4Bc$|qH%Jt}4{
                          zMIN1Uv2f7u!mOIC-o2$DTfNCPHv3kQ_N#Z?Bx$s*6T#}6v7Wk=Zw}Uj&KT5|iYiHZ
                          zb=Act_@eKptYjZA7i6M6OW6kRDwyAH-1GHipxBgUz=bVOoSWAx%ING{Kc4SDMm9%2
                          zHz;HoDd}Lukdn_016x;GLTUejr*icC>uPEo=HR+wiN?UP$`5)G#w_Z_*mIMQR^8MY
                          z^^$k&KPZjPkJ>)8KjW3@9Sw9U1{-mug&2^RK92>I^LV+_(R=LN)
                          zI@Xo4hEE+Q2Y%JK>#i6rF8QKkT&+d9Xtc4d`lD~eiKBwPe4U=f$Pmp&a7^}
                          zw=2HkaS|6g!35vg$CT!5LJxf0W`Er{;nRz)_eqjRcf(UjHE-T?viVbopgY$FG`avp
                          zi$qT~ss;QY;y0#cgly?j%0|;Yjd%BQRGx`Qj8}yi-!F30vd@|0BMct6S~yZY4|+Le
                          zkLIg4bE=mhb#+=ebBqjbTokxR&lQvnM%Bw!kEXWMAn;QFA~@xMg<}P3@g97REM0(-
                          zg=jWA&UMd7Zw!8?t!c*gjK;>-O!%0e5_6a+YT;4rV0$&xJPiXc>0AipI?^OlMewa2gY8p?Lg}2k$9UUDcuo;?
                          zmt^_M24_5aoXqz{3Cr%4$LF1{cV?zQe=`#FdXiJ0x|Zd~@3cQ8ouVC^`+3wKx|_qT
                          z?VE;fWNye`8~lKuBBC{^El2l|8bFF*xe?{;JkpU-pMp-&sV+weBzgGwEL<2Cv#&V^G{k&1p$
                          zCY#0)WG>7TUS1Qfp>S&(NF;td^q-)XYm{A?LIDt$(^1%zW*wNs1r6k-Sg}t-U`gAA
                          zvh*ais3wFAl4ZbTXan?}kjvMhXpIA&Nc2_@O4r`YjAKQ+6mlSAoI77T(#Q+Z5ZHwf
                          zjMybrHB>R1WQ3>3@!j)nwsXvj6%p(8hSPFnGxEy%i{+r}ZAj$Y3vooUWO0BGv`|14
                          zb+{`^S;ed0R0tkS$Th4HvaUR8z4h#jOn^H(S7PHkON%P6tr=mje(v>C%ND~DF
                          zL6DZ04uS|odXuJLfY3|Yp6&aU`Of*y`Tfq!T-W?DlS@(4cHG(fdG@o`y6VKFC$*t2a+7G9v%KIH|5EZ)pbAVy-Z(!&e2U$bS({K=xndsg^n^&tX3
                          zXua{yuJ?nlBC}xMI3=C9Yo=?6cG>7~?eoWTU=bhtipguidkHdXk6AY=ZdYmwFhUug
                          zfO#VO9RrpJhBK?7w)|egxk@A5`Ok*GO+lIJe=+;x_}yei%#y-lsI~3vMkm|_p}Z1L
                          z-B9m#o3`FgYZY?~9y!7ytOnvhg1UM88!&|B0dfZ$v|&jO_orq9GZ+f0Eh%7d1oR
                          z{`)O{`A?Fef7x08wPfh;yB(C!{7pggH$M{1|0$sP`xB()0WB6t)e0x7%71w%FWInMoql?7409il%eqKvuP1s=@a%sL@_pFV3TL0ss$#+f-
                          z%P2NZd68=VAM3sPLibJy3L4Tq&qxT|ipBuUza
                          z%!Fk#l16>>dOZ4s)06b0b9{HZ28|WZ7fdA8@J19J
                          zuO=og7n5fFd>D~%_;$-J^7B)!y*~Bb#G&cZQTMEbv3}`?GwK&cc5aX{p@gXQRhe$o
                          zLTOL4^R6Wvp3U!Ec=6TtDK_=i1$Ww9H({^9Co!y5lag27)n4oo!H8`xS*x3~Trh1A
                          zjkz{|SvvL0CHYc4+38_{0BW&&ZY!IVSE}*xshV{7REb%M`kTY*BlR{`j-tB(eJ_rKejc{51iq1Kil0Y>+}A2v2dXH
                          z;a#R#cdg-4c=#V&aqk(V)Gr*8j6KtQdmelmSEJ3;+%Tx|Jn9pv`A?cG<~>NU
                          ztyd(<;!+A{&j)NhsU_K!&txe|#V3YBZFWL!oRj-oNj`;*CjwKh9Y~+yX%>%_Lyqk3Y;TeM`2Y3soy^Jc~*0tWiq6glS6K)hvfN%~uA9OzhOo`o6Df
                          z_N=#Mq?wiY)RR_SD?Jw1B84YoKD+<4aEx`u_LXhGB&+BrzBd|arIVj;uy?lme3;&j
                          zVPs-PWu#-E@?kMbB{jDtKMRMq7FKZPF0&0cuQ#mg-x7bLAY4b{d*QHuVEF5gl$2_g
                          zo5Cv#YBb}_ItkB@?P={*j}%-{3$;J?E_5o58s20cfiQ(NYn-z1HT+?e`jgg%y6S6r
                          zUr*B9S@sttHrA~l=?CMjpRSKO9dh3hJCWgtu^-6E+da>{7F?b`W;Jr%bMz&Kc~wsG
                          z-jn*J_!J>tkFATIhNNzzs3=F4mv`ZUiGxY=EL69-Do-~5WInv-0izd|jW(END!2c@
                          zQ$z=Ip#2JdDk?Nu?v<7{kgQql=kDJhm&R}G@^)E%bwthvM
                          z0sl&)=}Vtqc4qVlon4rzBrzH<6Qqcm&~4{jXd^o(MRG&Ds#Z;llXhXBp2@)dT3KgZ
                          zXe)P|?Z|S)NxxXd{_uElH~$b9Z0z&txJk-YqJj2sFUwwd0Fj}2wniJ`e=pRQ>H3{s
                          z6gg8;bCz?=-L%T~3+_3vu$3+`b`C;*bIXqpwy$$rtY++47+W(OTsUoa17<|WjfWEo
                          zn0#U_&*)l<3e1}9Ox>T>J(G{z8`v!ib-&w=ZP`(7*gH=wc*RuK!Y;>hfji-z
                          zlYYOFoNkNNl$|rYW0>N64Z-upAS&dhQK!23gNF*QhHzy}UHx0(n=CykcBFUC0{Bc;
                          zgTo~Z3+lLz%Py0B7MlA*dh{T2$o0G;RzT8j~HWMoE*lyHX2#~V^#(uW8x_B+*n>J-EbRE{OaOi%c>&`6LB9Z;CU`Qt*1UU(-1f0Nda2>G~SjOj~J4EAAhaYrK2@$<~#IFDh
                          zcgkCbS3e+I_AdvQN{+-H++4fwjxX@cS#l-uc(HsMlvkX&LRsSpuqz|JVCDr%2SnGL
                          znqq+!Bo0^E3;-wGKx<>>Jd9YkUc?C;vEVCp_S*npO(V?-SX~70Q0{;(fG}2r28d?<
                          z%LH36k%oh)0b5QiSm68>wK}jPvHaUD0n||e_{h{-$mPh-4-JFZ3k4$4t!0fPX`KytV?|hAS2QM6afH`Nwehu7Isyk2>{ZQ<6)@F+WvCdn@_=Z8?BUQ
                          zWqa#Pup&@y!zr>#^BRAzLtmAkoKxV?DdXC`eAOmnGY?&xO^&`2D2Inm-{?rz{+HgA
                          zm5sxsSjCJ@_i-KuwR=wmBc)<9*G8J$V-ce9=7r|m(A6KlASx#7&i+YY^H(zUi2z?A
                          ztuMH6{p;5F*U}UGAx!`Gdl0Ybwk|3Ge>n%}e=l$mh!o9#JZtQI{N*tOfeNCn1$a1h
                          zK<1$0u~yJQ2;+z-fYu0dIYT%(;U$s8&Vw%7HGmKq6X`UKU9!2R7qx$OXt8?R#rp*n
                          zz2ntek-s|bXGeJtlST#B8fA#eV(nvUJ5~j*2K`xWVcRlxSbD~H=SENg#lAJZY#B6-kB<9eN{9^T&Cz)miA*TUSqGubu&?
                          z2LeAz?sSV)*&D^Lgdbx+M;SU>ex}}Zcf)@qbw$~&y=W<}gv-%`L?(v@86oP?En`4T
                          z72fSHA+u8a2Km;)KZjd9_^p$3JjFynXsh3IBock>7P@v$5by@9xr3X
                          zx0_dhTW^6vxT^y7j9p_h%ZJwlzEJ`&?MU#leSYoW@KBIDSp5iaU{W_fI^qpW%`|>X
                          z6E$7q*a0jd!hP>gSDQcedS2<-4@pe$5qg{<`JPEPhzdjtQ*KV4o#H*#Hi
                          zqf0K|L+VWxSfQ%TW01j3a3U^SPJJErkYB}G{)nC`KKp%G;HFQ3i8Wgzgp$pUKf1A=
                          zTaO&riWbczj;Rbji{28-r;)qrbnG;ZrUx}A`NT1VhoP_fK9mXJHYfe{;B;P{Z@Z!3H6Ss$fuNg>b$Oj;ytqb^(IO8uY)cQxEW$W
                          zA7b`EH{ac7^s%4R?Sy-=xdPueZHxqHU&h)vlex3-bbFS)=lN*szj3ke(y
                          z0t8^+L(vW>s+YvUqBmPYlyvACtu0N#L2*8s0|QIFq7DFr4iTJ7I5>)-0pC-M=kojJ
                          zK)9wem5XLK8NI?9B9R8-OukxDX-L3XK!B<4z3vLTid#$~aP8MnA%J8IIS*yP*L-*9
                          z*cGEb1zj?4!2u6Bl(GDaCqg3a&+|*g1RD0-NmT~zk$*gz63_r
                          z1W;|LV55-XL_7kUL$lb5?wGM^n;z5Ypk9;Gq3$Yx80q?~A!SP(uB%CXm!qO)Ou*u90s(L!PQy5P
                          z$Bu!PeW$rdgi*WmUboxEa;OIR9L??SsNFWg4%QD3TOJs9*)4hMwdhelvwVt
                          z1gn`qP`DX5b8bBR!EfR){dxW>=L+&5rBiewxwSC}_7MyqMLg!zo
                          zZ={_e0brx;P`!r$ueXZ~yseTOinkNUhB^IG2WUznxB-^>xL}N3lp$;xXNx;&$ynW1
                          zxB;sJ=UVU>%L5{vkw6}A)at!iXWpHOMtp0p7~|}g}%H-N0{OK
                          zEfmZ+S);Fb%)L97FYei;^j(v#VrMdXskj9C8`rcXbPhJt^0fmRTwaFQ)3*$M-&k{o
                          zoQI_{_4`S(39O(5;{}uR0^lL`x4|OwtB85Qjd>RO?wl`;LRY@mj?&?ria_0&XXJ@X
                          z&?7)Wok;A&AQ$D$3Ktg_i$e;lL-83{;#s&e`>Md@2DPq>mK+bbLD|qtftRPrt}7n=
                          z9@;WhkkmIXgAz%;tx_vjz;#~f=M|fC+(V$xa)5oo`7etnjD#hMkI$=pyM7f!%s%qe
                          zilBVcbMr_}Q_07cW#52|q9ZT0=|5KPlRP@Br
                          z+Dsx`;;M4$B;9mWMPWrzerU)`Id*wx71M(^`0yF=kA=l&UI~fJKDRkM<1IOVaacR6
                          z><(5i8jZz?#e((uW-~@2c}v|MU|pO39oAM>XBrxn#+{jIY+Y^hTy(QrcOV$&{p-e~
                          zZ&TJy0Oq{j^u(!NBxAJvef_a2Ac^#PQ<2X-qt(=ccyClcqI7G&_jl-0+g|FvfY>n|
                          z1^zPcPAIf)FDFq(xCwZ4d{|YANj$s8YIDN~J_h7B{Q4UG&SF&^*`BQGNvKOZ2JVWm
                          zy3ql1ODaUyhNg6nIbH+-HmLJLJ87%x6p7?2pb&74Tc~w_wpR}I-&cBYC;G{gpz*C;|G^Vs^6c3rTd9-!r>nzT@F3PQptF$$8S6V+j
                          z=)`sMhT}|)F=k2VF;iri4lU3cfd(V$NB~KMnlvp&gBQ2;r#r-)C@QQ=Nvd33BpVSe
                          z&@=+nRn-w(K+=rJ72S4l9BDnGG9`w_d`k4|!kgV&It8qe)3snlc{dDbJYLSf3esZx
                          zFue0@=td<>>pU@ZJM3~Z60pnWj#3^?R+;>i7>bPu`&kYgGS;mpH7(;XyYo)3hz`g{
                          z%fNKl5N%`IJeaa}yh`Ml2XJMlnB`8e(o+LtJ-5WDF-M#k3+VQdiYY$ffYVa*!})(_
                          zPJArp;`Iv`Kg*b2tq<1IgChR)*mR8w{bXD=0_jyw-z$xeLo`G531>fo4+1d
                          zEuI3hg6Bc9kVvfrdS|GTtTT|wv(!oN;Z#xw8-7N?mP-OYUZ@U6|lt``#&FVL5Ed80S8un&n^G7mRe`XjsKZT$Jkofmi*Gxy_2
                          z5bkEKtHQdyUoVpIn(Ukyh20p-|AqfjlEePNELWqhaxQu+D%bC^b-)8cnaq=j#9w^2Lk|(_Y45Ei;kuS4xE>FzvD0?=vrVIytW4J
                          z?CQh=*vqWea8;|H6Osxk0o?{O#*azRU?CFt@M_a9h(9pq6tx@YvoLcxf-Ab&|MZwQ
                          z6wtPIn#S2)PJgy|xb$l8OJ^5-{EBmd2O>CSNLZsOHcfi`(C_sLH^bM`Ty7==rOFs&$6t)+jTYb1R9SXU;PGT{0%OE;^H$y2azQb>Z5Me<7Lb_S$ylR4LnhC$U!o5WiH`h`c>m
                          zEP&53WCgzXh7RlzT`j#$!LZ88IeD7A3sDlij_V_U%MvXrBKuAtE771-nF^w{l6?`H
                          zhEGJUc3!`nP9JT!*872e(CiD1+@)rtNq0}NFZ7ybVOtPXs=;i>u2g_r3x20
                          zdIX6@`p6dfgN1KiX1r{F+sTy2NLrVKc2ma-AORjk+}3i-EJ=49EZb3
                          zVbPV#kAf3VqXLn~+v<-}#iBwx(eD(Wy=unfIN_q%R$u@T0H&{j?7@Q-o9JmI@M-dV
                          zZM1f>>4cZe9(UKz!9Ne%u?Cj@PHuf{p8b074AddeRTjsEhEN>d7nW)DQkS&kFDqJuk=`Gf;13#IiQs&PBtj|ye;jvEVjqA^y{Vyj+!2Kjx=6`Nq<2~uIpS45
                          zQmsk@x2B1gd|(Ei>NWn4QL9MYplU!=tVAqnuZ{L2NA+Xib6dsUG=pCfjQLze>mkVav{-4!Sk`I+&VGYKcv3Z0M$2V_w5I?lO@Z!A)aTvsDLaV9)5%te@~
                          zz(Mknum#2Ut}J>Dg`f9NsX3S(4hCOB6l9e6+!${7LA4Ot{e|u9a+M#czuX@vF!S3|v+w6ivj(A8EOCA*
                          z{h_w)$aayA_d|%L{^${aN%Umcru$1
                          zE1M|W*5ELTNIS{rILgQFWC%o`piFU5?<{0d*4hKnDG5o)>b9$Yr1V6DjHs}5zb7Qt
                          z;({6dCY9~%FDFJS;0P0;yK3z92@bQ$m!rrU*HYQZtCBbVywxLM=HlGUW=zGI=yb9b
                          zU5akFKTG`+kfRoyH4a#9cmv35M?HV2{aFx2gt?BcP-R(jTKgYeS
                          zhX7G*cZY9uU5++4PB6DEh0iILCN8cSFY#ioJ+7t6M@ZnI@V%QpPa(Px0o|E^aN4!W
                          zOZVR_=?k
                          zyUAQorV`z|U46AjjksxcAd)e5@VrPaDiEpo>aZQyNzlIUIEGcne2@s8-Z+YD`&loV>|bQ
                          z$m3GA{3wGs{BF5=$hw$4pk4^OY(8Igoj<=7f=Ke?DtnM|?(yz(Bov~e5f?Nl_T1fa
                          zxKXWafhnb-CZAUGxx6uBkbi&tuOh6;xm0V5TMy)=lh7>ZV4vwYf2@GK*6Gr#vRG;q
                          zMCD+c`H~5H>zE?Z<8es&C0A2^B`Gb9KpIW&c2>aT8ne7rJIpolMQQ2t-L8v*>w$*v
                          zku&gll;yaJZ;;8zoT3(Dx`!S+5jW08V0_v(++-*C2nC!i=E9hIbQWWMzMx?KEZsaE
                          zRDjFTGO<07_y7d0WM2U8+;N`j`xwVp$6uVpal~3)ULYq0cCH!-15SoCX^00$YS$On
                          z^lZ_~>Ht{Aas&_@9N9PACYK5DvFrL6RT$0_=Uvfr-JyazMHA&>EbDC3P2I$VGll^@
                          zrf(G;Ati(QtTZC3z8K?o_mw2SBkcLL$>stBL*g_SlPfynPr5ytm@Vt_xv`$hD5s{e
                          zd(EDe#of^K7+*64mJFP+^J%1FUdTao>Y>n{iZV7{#5$#WI+_$A^R8k)fkm+I9#T0W
                          zj-QI>2Am@B+?Ymk;lnqW$eR9(pI+_`PBM3G_=coP$gDURB9I3QLLrXE5ewnZ`|=7X
                          zDtjKeu4;syZo=G-OZeO0kX5DclKUo7G;{ZITWLs-(q6;vjEojMrNwPS61EcI;5o?{+NZfxofx}Z0y~}B
                          zFV$L4vFbXdxJ+fT2#R6BWX@?%0%PL{
                          zxh3|Q+8gy{EDaSzPU}z5AJcoCj)c3vZ@$S`J|REDBTi_Aj6VOqx>od(ieLgStY)&>
                          zv&4OjADSOOrK=L1?+{NJ17{C`YlCx|-j3X)+?cb>66!KUmKLsUvKRQbwYRnf;2fq?
                          z>s2d=uZkj{Tf+cU5epRw*)X6`EpF}X{F}QdD-At;yy!H4J%=j^>z#yet|UxX4lYtM
                          zxrz8}E%x+A=CHi)=HrX!QRjd4^aE8*cXpy_yh%Ijc4ZgzzFJNe3B7H%=OcKmer1kf
                          zWgkhVgLs&RP^M*Lb*zE#NfShf!65pRLE$vX8xp1_D=VnNlT5?9WD3n&3dlF~aG_WY
                          z;a02FJ7Weyna9V>27KAuERwks1`;8uFP%v;ZwZJ^i<7x#-g>Te^;ozcob
                          zC|0NDbGib9m6c&_ed&D-IK9BNYoZ?F76v4?-)u}W4a<_!w!9s^rK#m&F1`~rCdq`;
                          z8<4OX6}%f|Fg#A4nv5_|h$W$XC*T)*>kSFBP0y{R*xlB$>ei%@G&rM&<{dTzAqsJ!
                          zObrc)vair<%j)OCw}!ceHigNk49j9~F*P+hlsB>(2)!+*Y)LjQ?oQA%*3>A=)ECY?
                          zPXp=UmT-drr#h(TI18;Z4Gl@A{*vJq-*XbnxxNV~{Owjnrd9mSlsB%gJY^O{?d)iUgaOGLK{}&04So_meaV_@-jg&B-@og3E*-FZBlLz+LqedNYPy=Ldf3V~naV)4
                          z93mK`jd-hZ%~L!&DOEn+nJhAU
                          zQc+etI~n95V-C@xRJ
                          zK`oLiI!B0_;3tQt8(NUZ*jc!CvnP6(_v;B=6S1sjSj
                          zCz}!qN-BYqTyLPUjE?Mm)0uk^P0fv~+P=-52}g-xab($^LRpkheFN>7OH5|z_gqea
                          z@|MgDn$(OW;^E1i)4=MyN&dHJWfm%%WDljPGVOh1
                          zMb_+M&GS7+2Fol>Hd7J0UoToi$%KlI$CCV|X6}wA6l%sBlQHUPk=^Nq+J+M!JYk?UM!9`65cD|Z~AVq;x{f9;$GICYShFQvF{-}j`bqTRPSQX+KOMq)@
                          zhc%EVUnl2ENM>T^ADtl`Tp0Xui>g65?=u(tz1C${R*7Zs&1CL5U*elkk+CjvvwU&Y
                          z`8#5hUS3cL3qgGArRJwk$Zs!rBTRBkF02_Yq7K(g7B-OK)8>#EhH1805hs>92M2
                          z7(qQ?s}J~i5J-eb#b2b;TGL)^aW&tamiWGTnfhauOtv?gaJ%8kR*4sqcz$s;_A;$e
                          zWI+dX*{?8`!yia^ED83yu(!%T2G4j_ymwc2SbFOPG=WsaSVI8h
                          z?p*cxii$&1BYPr61wCRCfvH^FTo=XiV!j4qS
                          zBtcF0h~UR1bdR$FS|%ujg2XhsU71B570o72Doi%%*pi%ca(GtXDoWxhIp9%8uFH_}
                          zXY!gHW!~jHv&#N}Qfv-+Ey~Afb_gg6S7K
                          zT+b;JvKK6FhT=3fcR`+%B_3dQQLQGlu}kM>p4C|h28$;MZ6z6%Ztw77&p9Erk0u9e
                          zpeyaiGniUWqx;&{={6&_rus{v{HMf)f=_|2rLob=xM<#br!8OD#!L9V+G~^pV`!ML
                          z#p;l@%&w9v#`q2jiyL!jO@m=D0Po0ketg@H)VPMww3AlsnJpm@RI4C~1Is|4r)gu6
                          zE-?4~qbfjf0SI2AM@OyWZGZ!ikjYbb3Y1>JPy%rB{@tTVJPRvwMDqT6
                          zAy9fq&-^~i?sB70bWq5i?zG}23&|DtBF{`ZL}rrv_?liGio}u{@O#@)4KD=
                          zpoJ|X)W%(&Jqbw>
                          zz99Q)(HsSZuD;Y4jAx>E-jSQ$>Ve2=dSG?d+_MInmaFH9Kw@7cYZ9M3N1|jn1YlB64K_w~Kv-xQQ
                          zPm|#_v1uZtH?A6Iin<1veC85i=ym5}?1cfTH@`i;KuQI0f$xZawn+cxgE+i(4L8_4
                          z7A4UY2-eDTD72&jzqcpgks3wi5C}#K4&^FX3kDkWG9E!xtkc%-`l$o>XQ>E@i(+2t;yRIo&Eh0^
                          zri|{VKhQv)U$>@okvaPLR3hL(2SL;j`wM6YZYukpD#3NU4n
                          ze!wr_m%Zs4mwu!3GfxOBoL%$m%n}N
                          zW51lmj=2firm1t?s`mk$n;#+Nk}wkj;bqUpJbw%t9Axs&knayO^L(JRLg!HZ|Ba`
                          z4M1VvVQeYO_c#SENm&#aR7W}7O)L#8kXapCWNf3BwZjIZvT
                          zKpMeEqSNr}X10V4^s)cx#*78=9L&p)Q{9^>TS47C+mZxQ!Bdz3;E1ewZ@ObEiZd!!l&Qo|Bm%BuiMlA&PHm()|{z>L^f3@uQLZ@
                          z*3#+CUJKM;Agk7e?}XbBZw}5A9_#69MfCaufFT+j`t}lJ6!?wvY68Z-x-hhDe1eBu
                          z({sPb>{I9?!f2N`5|_N-C|p|M0Ols5OQ=i@Jp1%nKeYBy)ULv0Eq49+8BD?+ybj_Q
                          z(doA*oS?AQ>vU*)`&|6gR5ZR^mro%
                          zHGtP!18X30biYGfjxg=lr?Ve4=G+!!eW4u1ux2MPk=3@@0}xwrs;%`?11zr(4|xIH
                          z&pdM&`tAVi*wf57!MDENp?1o)*l7yX_kcx#fZ>iyO4{6M6o9OpTl`h@&Z^QwX$FB%nX2aK^z0(ZHN
                          z62u*J=Txq=;EuOJG!Fl)bR{cBLm7N|kYQ#&T2mthSNakCA4@ZQgTpp6`4kTzB$5W|_HZg^!~bwqP#)Ecgze-
                          zE6CoAk&Vql(8DSU+n>#e?Aj}sY!-I(m>MShQb|VLL5BnVty@d&1?$!g=H%X$HMLDR
                          zuoVR;_r{d&lUcNWoS}CF*l_?jjybF(@6d9v-{x|+be6jLOE$)4tXTWTm^c@S*RGbwa}c5N=k
                          z6|oEmpj
                          z+RQYnL$)wDV_#WIaH*jyxQE&n6|ey_=G0JA>0?no=)2a2{jTG9`luqs#>y6&5mim?
                          za|Qn-#_v{w9-G@0yYH#khh_|HE1|e4*4WWK&ZW>0y@XzZF
                          zeP;s7pdQ|IZM}O*oGeT9YH@Rc+gjo>rdGT`PJMlAq(6@@t$(@WYMc_E>G{g5EECO#
                          zTJNko)O7M--8AyXW&s1*E5G}iU9N$Im--)>+-MnGMs--5f~MJ2dcUHVvfL^Z*!R7n
                          ztFIi}02HjGiF2R*F>W=7xHs(rqQuxH02#17XWFKYlJ|1}uQY+v1WxkUl&
                          z)Z!z$4|B#fJzMBU^QW+_SpI7^#!4-p*0(D9`)0WU>#gbL?kvVL;H;Yln%?fHO={bE
                          z#!?r+N0f}g5*RA5!Ap`)@|EAa3ek8YI}u+3urL^MtRk_4t?Nc{b8F{UhA%22ey37^
                          z!76DKr+GTP=xcta$mIQupspDmg^wRnTM*zrv#RWzsoTOZ3=I2!=+FUt0YK({`
                          zUf}nG{?h1{kgRB&+`YhaYYZ>T)40@N_66JEzP8;V|yldL-@UZOW0B;x3
                          z?4)301LxdF<-#{#;dqo!SV9;9Z(I9xuq&eBs(i%Bm;md9rJbRu!pD+JD5vc}XXOd>
                          z^YQ6pr|s>0>Rb*e^eh?AfIYBU3`DOHXO>>oWdugMmRP+Ek%w+XI{_>h;j0$~Crvaj
                          z%UraEvPBz`uBe^XsuOP+EsnJ!-#*I-E&2Aso^M5ewk(_DLHd-cPL$-%0FdsO^Vi-3
                          zRODr@4QJpov&~|uPfT-01F4~qKP!ZB&JaX`!Fa*?ZF(JYXtaRf8IYNIwW%Dp52OjZ
                          zz&~5+4KZDL4R#C>5CBu#Gc6zd%ZP<2jU@
                          zmHo-MEaL`ktJ3$EdSOZCh^Jt@QPO6}wkvyXVjB88@EFUh%|-H1NExvXJ_26#QX1YJ
                          zN&j?Z4!SB>m|49tx}x>$1!e8Glvs}E4cV|+Kl+3z!Mz#BWL|UZkoMdT&bsehe3X3Z
                          z?Y^@*D-g|#e|$wdtXps)sf>T1ca*Nz2_U%Itu5Wu)a$YTs5_q7L$Bj#+h^8z+66hF!6BEPi;
                          zy^|x5Xw5gLE7yKE9ojk)xDw`?HOEmy8r1*=BmnF(;Yf2K={QU3k7o&
                          zsUa1unBhm|`@R5=63|o=-4g0AG=`M
                          zh^uJBtqh<|VI*O?hp66kGT#cD^8+ynNE)znT6xl|xl`Fc0W>ON&NC=nfX)u21JiYX
                          z`nqrc&!T9o5=!ElE*G7tLmSh($3Gzm4GHANN{n8Jc6HxfC|?DO#rSo2)X;Bb5d9DG
                          zAYXorBUWWcw1f42|B76Qxa>B|tC+E-Hn=BH_^yE82g=iTZ}cbAzV1EOfJO&s4@s~d
                          z`&mM2715a)@>NJsr#N6ytZLxiFB;0IDOM<7`+aZ&|HV!45BdxL4#WIQ^Iw|3(=h*k
                          zBxq&%r2j^;{$^^-g8W@>y9M*vfq&K3<&*rY^{pld3%P{_|Gm8|*ud5=80=;HkneX3
                          zCUH>OV`>%b2|4AhMR~YSIFSqy&
                          z3DNwc8LocPOKUs-Rb8fNy;XIas8WlO@O}js3oB+J6PKhvnw~ZKLvMY!E2?RmNw`Wt
                          za?Ac4c^XCguGxU;{NT%{=%1^PRk;v+6UZMhf-+ZR_2-*|#Y7pdmpqHKh+yj_r;%^<5L%MBZ
                          z9O6lDt(h^AdwgKDS5=RaY6yKwF8_2lRH29$v$7Idm+LuTA@s${D)Wm4e}C&Pb)=1`ONX4R-lm@wzRoq&t^fYSb%|
                          z{%Jgy_y^Lr{>ywYD#M_xq1{JRSLow4nt-R_RFMr&UT5fSR{XGo?(fLCiHM*+xSwrG
                          zA3HqZ{q8~Z1&qF`%8(B*DZH-gNy%Wn^1Zpn6|<00G|#hib(gBILwdrIJ&@_7K0>fX
                          zgmLO1Yj!r9;lLRexS(n-Z1jDJ<}Kq3-7)vqhtxqj>;p4*@CuV&cc+bpv82IQR(0O;
                          z17RRGH@w%<@r|e1V$F+fnhklpBA4_mK
                          z8qpX_ke#oIt*xl8t)TtBD)qv*pBzfoAJ&y5A-*gaQlFd0_LdBnzvZl
                          zdk$g7?SYEzGSA}g(p9|ZVGpwLH?ffE4Xt(Pq80mOV#QBm);2`d+3i36F-g8=A_;WA3poDm#sU+
                          zwbVtl+xIccZpMeeRXQQY(}CqDIkV?}ofX*Wj(5R$-PJGi@ZG(F{lX+%Pk4{(_}H*#
                          zwZfqzi93_jmL#^`b;vcl)aW3)j0Rhq6SZ@nNSo94e5o#hRh6m_qtpGd=F^%z!{exi
                          z!@ya{z}v%DIWiN*_w$1_`y%hH3Voc<<}{}A3ioKqL7cpiDtvN(eDm2#M1Mh;2f^c%
                          z@#tFmA1azxwnx4d_}zyOr&3=jU{}*=juhH`F>WBaJF!=k$|9KevZ|Tu@|4NTWkq`YB
                          zALd^*2LE$>RQCTpd{kNv?2-Pz>74#Q!AA$DsJZiW4b3xzTtAM)xCqC|P(FPoC~Wq_
                          z3clKNc@I44*#0bJ%95(@P|8}QINSO^>+
                          z4yvp=C%_0E^az6?OaptwCXnI7P9aaD+kxedIzSNPt^;!@Yl#*NmZwVtx?2R)hhF;J
                          zu2*Rzwufn=PLaTkJaKaoBLaVf+r(CN#fweR6GZH(1
                          zZlDh9L~W^YeFeSu@=JclHo+SM
                          z=imMWC9g!jSm*?_1iB$sx6fr1!%702B*qb2P6=BsM1CMm(4hT}ioITTnci8?P9UCj
                          zdAa-i7Axif_YEEIjeB3zVtOz-@J1dBtSO?gX+`p+)levpD>KsU&Iar+o*blGnXTT)jF#7k!3ry3qJPON?;DEzRQiEF^n7WO$_0n}@*SKK^`b?>V
                          zTbnv3?Nv(ael3VJ^bfsMWZ;GxqN5Q0G#uasI{Qt#1Xp
                          zBDoX0IDyBJ9fd=LUvg3fhYD+ck{abe^sBSUP{QtuIgrnY&dCiukilC6=
                          z6T^tPor)aB2*Zq7*S_4}=XvdCKYPEPXYbeVzu)?!3~SA-S?jt!*Jph`??W7CrIXDX
                          ztpNa?;H#M>&W`;)%1!5JU#+ApPF~#v7HD{(^P23`$0^Xl<*fM}MZi5oweHh0@AuYDnM4p`(!*Zp)6ivPn2`E+%hP%c7Ev4_j?gGHH4!T9J
                          zeAWU%j;FaF%7N<*pWH7#KRh7Te1GLijd&ud%;n_ay-D<8M(QocYDYpdA67`QmslJV
                          zZD1x~CV&qnffs2aMIG+pq($4<=-_w);>Z9hm4B|MKfWQ!k~BSPEjB8^fLhi-FwfRF&OY8mr*v;>Y5vpGy{dRg#o-Jw3A4*EU-n*{1#klN+ifaNP`Nv!w+x
                          z-l}A_D=hk)a`(1^{#}jw)s!i%_y+aBw})&v&#!|?E7`lhTq1~Ir3c{isC;BFX5PNO1%TEZl+NeQymQz(wk1VJRay(T+mRhLuzf
                          zq%AD^?iba&Ev>b|Fg0c~xC(s;;NHL5DQhxgWq2M^3t{M{FxFCw6#X~33l{Xk{is|H
                          z>(V(3GP>puKk%lqSYSN>eFzKT@hCJ$gJt&nSd%fnPH{`sypo?yR4aW5?@r{wU3r>~
                          zx2)#@RG2T0zF>T@daicbyp?eI<(zJdtN#0dde}^Y%mayugnkP1l#vmbednAyE+*8X
                          zMH1#G7`GnGyss(Svt-)r_DIHK@R-*2fX{qUgA#+CV?o~2^a3{9tvH)XESYYfetLgt
                          zr>XN@dF8qDR$IirtEc!YkCte;8HnRtGq&-W-^krz+-5xPf^ryER0>8i`gkEMXjVi!
                          z$Uwhkb$AMxBackC8{_K3xK^gZx{PW^OUMF-o7qaX_sf--LeJxcd&NzSA(Zp)ZStbl
                          zHJ{z|%h;8yju&`@w|-#e(j|WRsEI=9VsTc+ws=zL`^UjHv31LFi^a~XuKs&(U!Kx(
                          z@WV5vQF=Enjr=f5F2r^~Y4z?EDUTN^@oq++PTqJgAt${Ggd{K@I4=_12QTZZ3wZ7^
                          zY1vX7C7=Z<;$P;iqD67^;_T^?xoLk$k(w?E?IIDyf~GXRRShQ?D&v#Gs;#zMGJfoC
                          zYr(bXJ0g~~t5j#_X$obfvIHm~uZ}qz8V%D)6SqRyMScvtbI}77v?-#{I^CIvoA7ZBKcOUi1d&$6@rnHJIwEh9c)hTfFX!E%@M^hagMK(x}
                          ze!Ol~ykIeuvRk4ov@-cyku_hH_^&2|zq>aVN1ZRSI^RGUoSkc)0gWh_zo>h^dd{d_
                          zAFNvxG_D&5`xt?|rxV-ZV1u~RVoJ3gRgmrtxDameFl1A_Y&Nlk_>(d}Pql8r*y94K
                          zhaQzN0PH{!hw1c42(>iSiiS+BY)xltbq0sSo8ekRgN-_KisQCunG=VSHrZU_pEnwAs6SKt$!vHdJ`Wpjz7n^c2F-<@=-RH#;4xLumX@$Wk$QmDL8Lb|DW;7)3l4Ebg1O1#Ft
                          zO7(=V+S@Y9xdaaVm@;%rHF@=Z=iRh|W78?B%m#n_vApYCDATLqsuPCYt)
                          zkr`F>&>{6RD{VV~Mt}j-6J~93IWm4G+>{HrOGj1IVj~ZGZ2B$US~L)H>x%0G#hv*o
                          zh4%Vy$+-JnK0@}A()W)qJDGF@fO+q6(~>>HsbA3|)Fry`?-%2ncJO(qn+)YWqW>(NH!
                          z)+$0JkO`2q|J^*BNWUTXCOk%^hKXhq0I87RZZ^&0*ihC3oY|3=0_`S*Q#QssjDj{z
                          zdoNPt55j_OP%AG)4Td*#n*KAJ!_#mus=ftzVha4LryYll0duWk_Iv9Q+4RqXSKho>
                          zXyLawzGz_K@g+1cr@AXWg8)-z+9(%H-}Hti87tJpB>f=AcoJa9Ul4N-$e8I$4&H|U
                          z1-d1`C`v(80T(vT7q+|dcGXn!P6vLqnkXMX@D21gQV&PZ@
                          zf-+hieI{R$b41z^|0a}IO*LtOEYa<-ZJ_{lZnz4<#)(kGhQlMQi1V4zG4iR;xQEB)
                          zVx49`OIduO^D2ji87u4t0SEcK`w@rCpJ0v5KKYj_DLPzPh{>SVRrOOsiz`~ZOWoay
                          zZ$~Se!na+?_wD+utDFQ8Kwp&Wg;bwu`{r)MPMFJpMpI7*uWY&IXlyTOH*qEFy6BaS
                          z5GsyhcRxFuA*Q`g65Aqi#w^V~Suy_J`SFRMisYX?9yd){GLm(q3Gwl@9X9gEo76rR
                          zC|Q;C8?N|&63f9$T*jV{I4(O9Evx;jMP}(xs!w&SW_+s#MEkS|1md=+zp)sUcCmfE
                          zNg{c%CY@lA^p7ny&kgXVdm<(>Ca(ML7o%;p5%Ygr9hE#n9
                          zp|$Px1#H#FsZS>#)YOKxPCgMKfOYvd4%)p{S3P6`ab0Y1+(C9PF55#S#&ULkVj2*JhAfj8>m5lxKl
                          zYO`TC)!Kx58cNC5dw;DrBK?u7*wwBpRgvxK5abDUgMV6mdk|S&b-H}fTA7}s6;m8#
                          zD}$5-HWc|K!CAF(Dg(XSnsMVor}~-T{QXB|m3>%zS|M^=s?K8@a;_ioN4v&f3b0+wtg8nU=USWzg+u3GEM#
                          zA3$yX5tv8;(=N*{6}D$kg%Jp`i-ZrIP(dB0aKCOMi}g2fiuJ^UC4Ydjml3BKXd-3n
                          z+D(C73kajf`9}r-vSBX+D9(O>vP$9rwhy5M1uv^m8ceKQRcd!w_y5JIWZXcOc+9vm!6ogCXnDhBm&Vpmla{pN>D>
                          zR=#fBe~p3qg@o|t+~yBsk3Eqg-f29qv_-H)#LB4mkK57MO8uRkYt^=}2Ejt>y%9Qw
                          zzll3XHTOxT2e}GwQ(bq!z%HMENFQy$rAKDgp}x%tddvwQOE)mK(w4d}Sai2gc4LwS
                          zC!SQh!th^5q82*><268FHk()g1x}JHQ!M=>8Fm#>IL7tPiZDJ;F~O4S-4KGa;Vba4
                          z+L=w8yM^`%Z>)>LLgAgKOM;p+ydbyZZ`%R9=PSXuNSY~JGacK^1aNsNPg$}D@}(5+
                          zn-@-8^x+ewVLc>+-njw0J}n{$a!uGKi<9ecw@#grR9Q
                          zV@*DpWG`+RaWgKCClGTV>RTV1)iy1$($j6(F0);!^g25hLMCl^E_)4EzGw`|CXH5E
                          z%RbQl_+aKCiRKaS4muytY=P-_xnhV6*`7Oo?R?9O-Fl8#kw-jT8Kw!C;wY^7l1MYGQ{H2CMlSd+N}|6&7V-K!TkKs#Ly4O
                          zR33*1K6Y#KcS5})s+BL34Yf|}75|7wx!^vHhn{+M$eB@s&>9cfDk~65f0i{y@Mja#
                          zrm)-krDs#_2+?CNTYgb~oU848Nu-1$EI{HJ{X&phm**w!;ok@vo>+s+2mi`ygH#g%
                          zi#yN5+gvQ$D!!^ZXHEam9?RLrCGER37yBUi!hsavSBJ_i%^lWIkj%2aFDY)S^vsru
                          zi^iB0ZdYvH7VoO^zUv8Axy|hvm&;|cq+nKx@w7L^DnZ~Cyis)DmBy(g<4PG
                          zkp_aD9ZD5A{>N-i@hPQ(s{^9~knXz>M29@|2Tulw9no^}3m1QpykWN5kDe3^T&#Lz
                          zh`e-VIshmnbl?2^Z^-^o*CX+e!1%L&_Y2AQAw~}GicKG7tI0b=`8$d#c9EFK^(882
                          z&0hLyR@y6ljOd-TVO?%{O@Ef0Wc=v}MiUp`!E1YEi{HB2^&gmX^uQ>~hpJiE-`84+
                          zE(Toxu-$aM2Y*~bKZG4;DWT5`i|AQTEmCXYkFr!mX1B;{G;gv`GPRpfdygXlZB0OnvTxDUlq5ID~uO-HJ@~0EpW|}{*1q&2JEe#9dd1du#{Kc!5EEo1s%&Y
                          zl;#3fuJ$=47)M$IiTOAZg8_tyZskq6X2l>w^6Cv6{5bRSU)|Y3p&#U&1L9(6p?}Tr
                          zqO|+upw6)-Cv?$zV!Z6~{1W)lK28S6GT?%tj~%BM?H*wDl^Lad
                          z({htel4k}|W;4YRR&P5m+@Ttl8VOBJvsKFo(hR=pM&anh5?byJOv|as$2?6?3fNs8
                          z8D!|sxK5}13gUfc+7X}{eTp#{M!u+R%q7T;tzp>5(VcYl`*rmJv7k91AD|$ej{+Zy
                          z7zo>ums4X*nme!jq@NN*m!NUF7VI<)j{x4>Q*y9X3NKbdZ}^a}QpVQ2P*2so!eA@?
                          zYAb<8O?F`)Z~=3Xn)Xb_+zNajubM2k;?iu)q{j#U9Ja&jZu0oxcE!kd?NHQAjYx@z
                          zmLAqV2!ZihQGx}{0?Amc!NWOk9+y~4p#&jJ8?>dA?imOHc+nR2_u|;Hah2Z)7r1jr
                          z9IHAzUfBrqJLt*?^Z(6JPRb)0`cXn{Y$6zgN>GCw&Y(72X(X2&daKFINBNx4P%NBm
                          zdW&`4^x~6!{DQ^N7MNYDxI~i=is$C^mOb4@taJ`v?)sJWQZByda}O1}TDMsF{Q6yb
                          zaY*sagE{!M?8EV_d-Vn+EGwbA>-mRGDjr#hno>ziwbEv-8I^aA3d#o_NUQgBQM|qN
                          za!R6U7Ktt;q#GqTrlur=Y4gX)T!tSXAy|b~svO%`0D{SBgy->wbC)#%YPDHYJ<+3z
                          zkQjVt>x%uPabmouy%YW-nAqzN7PEd2FE-l~p}XeD96i9mHMg`Gy>g)3^>io;*B^1<
                          z`z5{AT&(}q`=@46M-_THdk%2B>b?a!C}rB34T`v{CE7xjmMFhTH`M`Z71ySbcyT&)
                          zAxc2M`a=JbwQS~3YlT(Q>>C{c-8V`1Zyi|l>#vt7S%qjOyvvaOYC{$9zNz?HUm$)hvFZRg*O_!W2A!-+&l@hGhk930XO-+|
                          z@qUv{_K}V(#<$K-iaxhxgkk1SX`~Os@~%7pbD$~E74!CX)tn!J<5dQoiI;0ZjZ2!lBdsJwpzkvc7tl0)iT3;~?2VSQkvgYz%97
                          zh%)ryTTFMSBX5|@wbGpvAXQuM9}_-9Y>f-M&_et>V-p}H5&R;+fNkHQzB441%2=9R
                          zMK;`}ILf4%{~B(afR?Fpi&uZ|z0{~0!N6QC9Gn51_QEl2#iAg^U^PZ_!BqsJ3A>b)
                          z^OcB#n8TIvhv?%VwDUj*lrCF4|4F<5(p8Vk3JOt{q||o(#~SyrUw6jSaakSG%_lpb
                          z@o9ZBpOE3N7v8^5G`>hDrOxyjgUBe(4u{6qmT#n^mHr`QVe+KzX#9GV)s~fK#x}+F
                          z?DR}AWsH``m%ulic`ldYz`Kv%HQ}Y+o{kgvkV{HkMLqUl#s2KA>NE74x1TR{<>2mQ
                          zNV^kW@+2d#9FRLpv+NOFfL5s0bsiBV2wLasD!A*D0Gj@DwGlM*zrBGu8P?}V>)uE_Z0|N
                          z90`(?c{bGl9J85{)yL6=^<6+Iestt+M@379uXE{+N8eIPo0vbFW_%l&b}tzKs2W+`
                          zn*Hb?5z&X#Hv$rT@T1*OL-8D^XGsOP8yz=ByXqUW2mW|@)@@2YE^GWtQ@=i;u8C2G
                          z&}QW_2(z-r^F{)AjoT|zh;RNJls1FgG8q37Cz&w^zz+LmzsTjlu`-)wN-;BzyfBJB
                          zZ0|Ia*So$PQIFbB%Brov${iFbg-6vYX};s}&Ret`FW;4+z)DB$%p?F5VDh3+)+<+<
                          z+gDGqoGqE<^g4S3Y6QoXo=TO~G6D%405Z4(l#WagK
                          z_ZgwCJ%*l8DB6G!xPg~bio{o&`r9G@ChpX>%Ond{*|-
                          zpE>JI%S7MH6mOM714L$NCziqt;@WQLN9nvGbt@1k;kDOu!+1@MkuOUMB2caYe!u5*
                          zVzIdT^|&V?fa9Z`)9BMvb7(lg*Q;jm&
                          zc(xVmv{O&xF88+-*Gj>c@-SL&Y?lg!?kn<)^1)xDfjmj$5D!WB@T{VPa;cH8PV`{)
                          z)qnY~6=o|N{1ta^LR4qeW*Z35?p61=oQboE*{r6+S{2vbo*iy@-kQCde>~Ol-Y=G>
                          z-0x|lzY7a^-F~JTbq3~4UfCj53weYN>z;00aegSH1YB73d#*$W4F$Lnx+;^6AFd5j
                          z)jN@gT78;3W1}8To0+GT=doWlrK#+LWv)nHDb7R6?U`!=q8GVgAZ&{tv^*)Cy@-3|
                          zw^8~t8L)<4k0>97CbnDYQmYvgX$VWt
                          zD}9Hmu=@!NHk{fN9vbg$r9aPQlBb`7e1tJos|CLu6Q%Y>(23+_M=MC45?Biv0*uq`
                          zlrP^h7&NEh=~Bh?mKjEbeweB9`;-+PZDk1dKuuaYgC!(H*_U&m7)EiFDb|<}Hlbmy
                          zSq%i~Oc`XAI1^Y#EL>)E_^WCUNj#mdbgszNm0=61AKI`wVU-Ls5jJypnoe91jD~d;
                          zggfWE(;Dq{H4;)ilOzDgB8TA~SKSBqZSlk(uhaO~NIO76Ubr+VymxL{p!p?m0Cr{)
                          zrjIeo(VCEE(xJ<@Q)wFpgE+Ky3fKu^pI2w!?gm31163Fj!
                          z9e4J$=1b$GAG28bJ-@~t?a1{s{_Nd_MP)~>?%E#j
                          zB05@JXiB7uEcFJ8v{iL$D`Db4>{!Jcou9jAh%gDvD;<-?UI~~Y!@SLEq7#vPxG?_f
                          zy{@9G+ht&7VgPU+rlUDI3Id2aqLoe@G5B`J^Hfwr%AM>#Xo#kGFR8sFZ!e4KI^
                          z;&{_XvI	WvbDhI)_6tM7ah%o1kP`Z;+>+>mhE_%V=013CYcznar$C?3UN3((QS3
                          z2Y(hk{P|sAW+K&
                          z(|%xKLOmjQ!X%2qVYmsepYe6BQdmBl841vz9iRgMq?`iOgF2g-<1PSQUYYC|Vvay>
                          zQXU)4xQK8ncnM#)D(yj!-y6q6rv1C+_+?*nCVxm@2V6U_KFdye`}7!(
                          z%jT6*MxgKYnp-^>;z*(POc*#ApzFL1dOSd3=BbiCQZguj0jn`QS4x2&;4Szy<*-*2
                          ziq^ndBG}`VFTo;4?B6!uv|dL9{j|l-1EV0sZ)0gh00bPsE{4r2Q}$xV@+h;3#|P$O
                          zQ62@1@cQS$(A(ivt5~tsb;VUQn{Qi(ojQpV<_(~qJqLmVregDXa(mCy6
                          zn^htKQk`!zcb&j>m*Mb+kB5%*dRN*Guip`>4QeS$B->0j*x`%+~_m!-|#c_tm
                          zU@uD234lu>K!z?=5Y|Vj+lt(NHZDJRTSsP?ys8$C3R<5F+p}m(NARAX#|%?iP~#
                          z=}+>M_XEb*sWIJ)ZRT}sXkW(RzNg#ULgA;6mCx}D#wz57G39NfZ4+nx5%8e4MIgC8aR6&{Q2J85fI>mP>B=K)({UqX&{-3(
                          zBRM>5N;EH{OCW*wK+jaUQx(ga*-emQFM~D4)70>}=o+8EY-kLu$c%V_H@IJG1^!B>`R%Jyc
                          z&9^U`8X->qMd|SB)qhCQ6lm{1b)8c?r#qOA6*gRb5#t^ZW{(qi8C%>4
                          zpsFNlN|P5=n<4d@P*Q#R9$^ifrSQ76AlEbT8SR&$yA$N6f;A~8Wa4D%m{Pd_PG@Iu
                          zoJ2)k%)@*26Z`lCB3D^r|9n<*dGo89L!{9whjl;xOvlPERz-f82v6>u8B^)3=c
                          zHixc=b-EZmQaJ)$FB8FceCMz4CSHP<4VX0jJHakN-KkFu5Rg*6xYLuM)WNz^7tKld+hAp4onV^)B;3FVfYJ
                          z``?Y$%{mtp?I=GW^E48i`d4;_QS_4xg%4F*Y=Hln=tY?FnDa!6ZN
                          zaGR5COwZWCjE~31^lUp>Z@*oWIsQwm*ymnPi^kPo?H-D_
                          zoO{|vHcMvf1Ep=GJpnDPX5&9{PF7ca
                          z{dT^9dg|lP>rB^&g3hI`*L=!+o>`Vu>y(rnD>TToo05{cUtD}^1}%efdb{XWGsMqD
                          zKF%-9pUUZuZVmiife&qtmX0&Nth-iO
                          z>PNK+xhqmz-89u_gHdON__1t{C9Hb>
                          zc#^=f6CNK5L?&-tbFalM>K)m!I`e*lQW&D^qgf@X%;?`3FjA<$#I~RLQjx|A-1p6?
                          zE$UCV1RL{9$)5tJ<%2@E!iYjfErj{x&0mk|Wm8k7BesoUXX|W~V{a2z=wRyDlr$o=nU-*jKtRJ4NiE2WDeHbG=
                          z3PrvzuJzDWwdI3cDBPBrMZOqViM@l7iYM)@Q0M3i?>um4Gx0^2Vh>A3{HKON==+~S
                          z#TFm0-ddkq#uQYZ6{$_BT0e31L344Kewm|yF4kCzL_qdd>IOM%j*p|{kyx^#1kTz3
                          zYr+}xIh-VSkHJD%u#X4U=N18~4D@STyid+fSCe-x;4G9bk@=+7Hkpc^#y|k1fheKt
                          ziJ#^J0pljDnv3!KzY;D=zAH&bjokkbZ8-91$7t%gef)x@D|PWn0-&Pq#q+{%Cp?S$*EY9^Byxh$Gs#!lci#PZ
                          zlwU8^GC8pnv;E`IjjKKD+^xB{P4-XMto>kg}P-$Z@Um-RV+GTCTr2W8IbgA1T;Gq
                          zUxNhh$8ViKdYd-h5qw;Omn1p9{o}Bb|L!dnC$#m|KgUs
                          z$5G60K3S7G0bg1e%w&CraqTM=2vw!Kr
                          zdjt*WvShWE`gs_?He~(z1W`(~%|hp&{T5f+H00(3l6K(jl`!FWGo>w?or?w2ZYWMz
                          zDi-Z*gY#JQTumM6&bEF4u$~DX9bincWoPFj^Grp`ltmb4{m&Q$ZpY$@I&!Kmgy_I=
                          zI~Z2db-Db$**iEyOY5>JPUZrd6E7nWvHQ~zOlF$9p*%zMJ^vYjMvI4T*tpg`PyH2u
                          zw0QI8BGdh2<0;73*asGgwxU_T7vOBo@$7+)J6nUUqImY0VfZX97(%$-GPRFsy?Oh5
                          zPnAe~#hE%1NHu13QjIy5bxp$$jx8si_QB7BjwjqP@6%Y%kb5M|uR|j7@uYpvC#*y$
                          zLP@8iqYmi&I5ABj8X74ROTcoS;_1jHu@|8+n@6>>xhR#P&ytO0q}hsZX)Z}5KqM%c
                          z4QO1TuK>#{XizsJ#fqOwfZge_hB0SN^hadX*y{|d-Klh91_^z6KW
                          z*_mFEU6xn!qVxXY=-E#90ux-=S=@t%LbHb5C+=^}Jt$u3)4}DgCi4a!2F*}462E*X
                          z8=hK?<;Co9_wIb9{xly%DtD&u{+zN;pYQmI^YOh9IitO#^>CuAwcw;N<%<}f-f8_)
                          zT`~Nbd1nLuh(2*04L?_bHy!TMy6qaet4Mbgwo-q16UAirhm6F#3ijjTy=S7$#RU)y
                          zrb+*L45Pge9dN?;{ajt`I)oap`PQ}_+}eRuKIN?6@HssOA}&Id#OYrLq`1700SD#$
                          z@`ealYPIb<9r0JPF_&*gD9?dmGvw!DTtTCNMKRMXTj%E~_r^ZHx4fg-KREm%$Y*X(
                          z=TyB$;^eYm9x3BgfVNSf44?mJvCTcoCqcBuH<`I@b#3Q&ddZ7Ed$;q6aX(h_$j6@o
                          z4xtmiWnkjG4<7H2!6;)=rczgOTWhrq-j4CkD}$yw$IJTrPRn>#Yj4^Nz+2@;%z$@t
                          z-ZHLKCw_{QVgAb}Iq3&x!gZH9eDp0kCYU4o&zlBqej2j%8sc+2alEe5y-3XtS^toS
                          z55_-;#GAaX!j4q8zBnu2ll)g_o0}#^#qH3KUk-{UZTL&F$7F7abzm^EcioVuO(#rl
                          zZ+-%b8<#uFmi2{S=Q}%AS^IoT|mQQ!qO%0_AqK0(IW7lU+@=B?n|LoJ05^6Du
                          z#^ZJPEH>TI6OGnpO<3S$)DK*>9L$pTG}OW0PBF+T5|px#g=-y#-N6z?wPIiGOIYY+
                          zg|`LX*SNFQ@@?R6HUHBoVe>&utE;?L{M0+w-(!?3aCa1M
                          zrzD#hKA7lKj~d+kt=C=dqaI1PL}JJ6aZilg@7Up#Ab2VNt8M3Re+v8`cn1G&m<4UB
                          z{u^eV?xFu5dt2%%YHzrF{>|X{e`Dqy{5Mz1|Lku0A1>E9zW~>OEAZ`wH)wKKeBCz~
                          zC4V2c@xul;Z-XCsPEmV*NpmEs4ah9o@zU|?h~M0eedp(t6O4Sk5V~m<73ua
                          zX$mhnoq4cbfPD@r$~FLH%S
                          zFYi~cc}oz~EY`Vhb(2*uSt+M9M&9z~X=QEmImGojcX_yCPX^oYLek({yThz*lczJ2
                          zeO7ZNqqu*nW@r!JJ@Dsc9jDA1XTX_@ZWfBR
                          zq+BekUw>xjSis>p@gmilHYGQS`J`S>v{C66_xDXWGgy-4mYLov5l0hzs*)UX`1>Em
                          zd-E$}b~*~&IHYDI7^J&3D!ECx%jI#(b=OZ4B^Nu}+K11TT30~d5cjL~elPn$_E((yO=dTso|ohk|#+7GKvdz^$iRS6<4W#OL=7-cR$%aSvPk8WWfDq9||Er%T%O
                          zdu=$(Ze7Oly+^cPKTRD=5-mNfZ+`NU(x2KAm&XR2PYM)u{+@l&sGtAMfivA7Urq6Z
                          zWF^MmcsYFETk_H*>XlmiotlV$a;&5i7rP#8UOK9JwB&b@Z!1CA!Q{>N%*uYdJ!0bf
                          za0mWMv3o;bwdu&v*grH&dx9iWU;b1&-JNW^CN^6-VJ?Xob%~J)+3lY;FL)sMwz{Ri
                          z%%3ZjnEqTD}#oj=y`fH*16Jy7-Is!bKTe!H~rEH5yLUx_?r$-Nv$US|5=vv#Z8QU77~gTTS4AgicNk#lQR
                          zF@%OPJ8I$FT11;hNt!~aC|_QmhvSzDT==F5g3N`+R?48B&({wpwn^7xl-V|0ZY-)*
                          z2}TE+Tzb96)SFV+W(05!cNmM6PNLgEf)=bTI5KS%4N`6`^BnFzc(6LV|J9`bE|
                          z>akN%L8VWk?p1VbFAVoRl6VrY|Cn;Nq1h|vP5GIMX}i}HjjYj27XBw+7ab~(+!gzV
                          z`PNS<%}x5a{lo6QG%v}=M)f;IrAS@xLY!TROS(zN?vXn63o8U$9x`=99`Ac-xZ8Da
                          ze(JIJ!PE!#K6x)n%R8;A!+V6NZ4EYJCjX+4%VSr
                          z#E4`U!Aa5Ujy@q1TeoX9O$h$>QS{T3`FGE6{Pn9MuFb6Uu-TWGLEP^LiuCpc$8}w`
                          zaWV3cS@rTeUwPO@sS2AqB-(TIrbkyqy#5h=lSfL29}^9%uxRVK%3^Jq`1qu+yZSQ?
                          z(;fHI3%*r8{W?+BD*fqXSeAT$!h=GW&#qk-BmU=$TvDy}e3RWuE6o{LaPu@G4~0jG
                          zNj!Zc;~f-Y+|)XuELC%TD9y(xPYWCn=pUD2XCJau_d?9`@}0Wf3hOOJRC>G%JAWhp
                          zpiU2XsAwPNeYiX;xVu7NWcBfVh2MpK^M6VGKP3|XPBs4z?8(2^v;Qmh@|DVk_wY7D0AXW3f
                          zVNY&+)`n2PzjlK<0a}U&|4kU+->LRldtYPiJJYlsJxpG7KIplVmDcZGBXcCLafCtR
                          zk~#f6uhSP_NqOH&;*tQ90>MInM}?h@w+Un(k{tLfzl^+clsOj>-~zsYCC!pcazFy*
                          zkm<8h)lBdLv4aKtjovWe*l}7Z09Gyg%XkPvX0HkFItOdCt>ki3lk+NU_VPHcp8=82
                          z!xUjeF^It&0yjXb2;>0PPP>gpwn7v&c^NFYi#=+ZX#ijW7W83t6Jm(^8hBvVm`5v%
                          zxVY?en1SAzXCUB$CWSjU16pDgW_b1pSjh*l+4oI>vFZXF)I!Dtcr#ULQbUmoQx@V6515KNQP?_)Rj8!bM?+#(FIkesV7$n^53xDE!C#
                          z)Dc)=1yJ*b1AhZb%23E(h=9*zOg3l)u(`=)Hc`OZNF`MlEWI!;I(CE(X4auJTAwoo
                          zEQim*Ld=@j)pgV+qjTTUU3lN>Rl>(+?hnkd&S}sY6Rw^AvF@BJ1Viki{M_&w^xtSX
                          zLpzJOJNC}e8Wx?iCs;LJrU8kMPki3F<*1C%(7_DwRAego_3jHBHJ-mWBfwHX2=ED<
                          z(htUH^Gtt8jUmZE%}Dr2&St=VD1=G?0{Cu0fn6l1H#ZDla%bi#+>H*`zikkc+lT<*
                          z2=}AF&H$J}(7*pSj2tUJ(hr}d$zc8G$4-L0F<`>}J_F1!3Gh(;%^>dqt0V8>#Caxb
                          z*T!{PUN6z{1{gR9*GickP}6M9yX@}g9qtutUj0eRvzg{^^NrJ3kHqnT7chlsLaPA^
                          z2M%1W#hB@Q>bO_1cQjvuKl^HP3pN*GJ;iO63W#?^Y|=d?gwRNXbAs+?rb~tO<7PtP
                          zJu2x|Qc6*=)QSI`_C?qHm5y}P^}WrO<7>@=om@jcVcjKRJzb`Np?(#>cMw-(P)PluQpA)acXA}c4No(!XpHRlc9y6B@zfZ)h&
                          zVtP5!in%N8h2^|`Ke0>i%d!zn@bwA_4mfy!W>(n%(jIst>8LKFTLEwgwQPt}
                          zYW;#9vq4?ahn)4he|5?M9u1E9G62F51O-iS9-(V)0MvAvPOY2?hb<_%
                          z(?$W|&K{a)u9mO1imbXcz};tB*4z{(PNE_%Ty%&4VAIo)mw-|NCtKj*fJ;EvB%Q&Q
                          z9b`(T!ZpBNXi#R%{=onog;>^_ADz1~V>5(#?;!M%#qN$~@WL~H)`68VFz*Nh0-S6B
                          ztXBZd<5HB>C_j#Z*#RyutQ^d78)_QD95i9{SX|?VJqkDhKsUnWLihrhht{llkcPaI
                          z0Vi`cg_8a1*b#(B{tMhEbKxaA`aRhtXl5vS_)QpyATtxP%qZ8<@di)cYVEjOjPwU_GTujz;4#YcCep+ztyAV}pbNGMnngNaAr?
                          z3AB|N2Ei)g)GED6XVlpL^oGuJv>r&qS=3y+0r6j?y#gdL4;8osR5&a5TW@+0h&Mi!Nq2}J*WgY8~5lB=KTMj25RXY;3N52ZXnR-ZH{uf-_
                          z0BMY1m%_UQ?-O@pDV#hi-KJj?>9q8ql$J+vxCG){#>wP)K
                          zn&WcgrkT$g-LFha26J!dDB|*aC6NN?o86gsjbLYFv#*W#n$0$%KHp{$Qt8*HY$rRtbTY=fJ`xsD-
                          z;JDn(az~;F=>BsEL=w(``5X?)A;2}F7OZSc$Voa(Aiy$hmJT{Z06Ss*CJn4DHy|Lw
                          zhJkRsi4%zxl;yHBkFpV=X7(=mI0arX8IVTUOct~RW6sNr@^7Uqb6sebISgUlxj;cE
                          zu=cNwBy;t;(`#&7xE*lPs#~OuJtx*Hhrs@+?wZHLiL+^yCl8(%FouRyohQz5B5T>|
                          z*%K$_`nBS_(gvS7+_|25pIaTlWQ6xi0j&r$&C>?6u?QX4@Ze*~+Pk
                          zYxL^rhHY|L9~8zg7ZUEVMBjP-5k+^_%HHyhdZl&C7LVEoN*zkycb@q9VN0{t`n}Z+%yz00~I9*b<5K3e-g4Pj$
                          zx}R+RT{4kWG}mQ*YL6-iur^BksPULeJmg5YJF4ZY5l2W&wVRolUNrlHjF6|nG@OKf
                          z3c%(X!mCArg_k6abc^SWz_c`*FRp{eJRLV(|1%TjW@!CI@;FMNts3qIF4o3Qh6m#+AJ=
                          zRiUY0=C}8|za6<#d=dK~idNWHr
                          zNJ?kJIZCbvWkI<<(0$%B-1IWrE2mhL*m`U3;yQbtG9Si6hPI9Po{puw>^su1T-B#<
                          zI}hi3xRb3`23vH#cQnRy{DM;ZtRK_S@?PXlEBy^LnRp8}B|aWB8H1lk&{}UEJuv%k
                          zM{)8Ct>+~xQC8<60a&Tl-K}*iqyocQG9K@Wc!?8c573GCkt)R&jAY%vjoiDFrr0A^
                          z-qII2@_hqN-b?^s^2J@@-6Frz(e&ydO+NERNE;W12O4JV;2H<{;9vL>%P*DP6pF{s
                          z_S}PNqp7)}lUdsOpG9+%KD3=rEAR*v);(}7LiHRz1QY(Pw@R4*b_wK}G1p!4Ljg08
                          zB9OvtdOCz3?XI1Ez1?b7#af;_Bcy564Qd(PH3tq+fqI*+c*H8x1-)+%kxB@d8(I%7
                          z0aU=T*+?d76nIJ3;s7Dt7|@Un%qsE}o;Tb`Y)GjvW;3Bb{l+VDBbPD<(Dhp6@2EA5
                          zQa+V3ATVzQp!w*=HzMEKfXOoF=sy|W4CbO7lpT30Ya47uB9{oC=Q+B)oI5u3!#&8y
                          z(~w#7u+eZX6tP>bwp102rdpkMKIW;F9Z@K{p?g7!wiwBVD4Q4o5))Lvql{2SngBTW
                          zLA2bM2je7sgn(^2Uc}$$2#1)r%yE-7;?~En?Vnz~6*{FzRfICiBIyy94>WC-2i-5Z
                          z^4ogqR2~6~%&v;zX%ui5>v7v#p6Xloi7Tuf*hzXYmGpyfNLo%h_1NC_wr|e&Qx)%a
                          z51!5#i2^C-_kGyZA|$SZ+k!117W(fdJNhLi7d
                          zQ37#)Z3uZox?+1dy~vlFy(g#2$>5N(T+#KGR!IlQ12)f?Y~vhp
                          zj03pd)uR+U5_2l|@QF}0;k2WAPz{$gETb#lWp=UvIZfG-bF#u?QG2jIdR5tIUETxtnxn#g<@#PS`df$6Z-h@U5rxb)3n@J|YiMikUPtPz>v
                          zdgYhbJc6YVy{tvA9JY%xw^-@F~%)%Y^><9TZ);hG3rd_
                          z`M=|AoQNJ=>>UkZrq;pg_+}T@(6r3+9|BAE%p;5@YG}Tr$B=h%6!&netdD*!n9c?E1*43a8H8R!B$v1k`{cBq>#$5&
                          z$=1$yj(D9ORrPpnyHiZnkYqbYV%Ep=e5K=#)$3i2gF9EE2vtxJTH=iBHUZq7zmw56
                          zJU$}&<>m3@KF4|pOALJO{VniB7#vKdf4hs|Bjcoa&ddfuvTMLj%Q};0x${+G=QTN;x6RKY=YN;9LRLyZ58lYrT0v02qXd=%w_ALfIP
                          z^&9*(F;?t}_d0aE_91M*4Wr|~i><~#iw@Z*#hrI3#$-V9>x_-QMyXg*0cyvq0ZmmxVXG9et`v)cm#d$+;rYd%k;~h~NS~%QZ
                          z;#JQs@*T|krSFm!=)cr!C~SCmX{NuXU;3C!kv&fpj?YCY;deFhp{CnYyn~)uYsgJy
                          z!l&jNZWVVM@Qm)nB0v0Sd#v5W=(OJ32M7JGIazc}9ZnZ<_8mSpI$clXo#Vy9%7e>t
                          z|3qBm*BmbAde?^|mY+*X-1Ew!T0#eR1TXQ7og*UHs|O&cwHHLK`|*~6E92D(Wf3*u
                          zvw?#JpQBNsuYzwRM&q6)+5+M+tClI}&|q61RYo!H?xlZ{7QzjqR_E){eH3rNivql^
                          zj@DSohg<|M6tw`1!?_SfW|6s1Mp~I+a8ZJ!WPt9x1(rAj9$4zVR#niiIRm0lgNrnVFe
                          zrDWeK6U9)ri0ei|QkWRVGTDm8n8+Ar%=LZ0dY<=vf5&^g$MOFEyE<|>n7Pb#UEk&N
                          zIX~y;Ja_w}Tp0QCmi^^1DJo1wmf-esX-=9AnAotROD1?)M?c?uBg}jpV36@?KDyfQ
                          z$Af2Q;TxK#!AKQOcpB^$zfP}^j```w=Z&BXfX4M(G+T}80XAm=KUp(le)&29CKw#R
                          zY<5LJ!*JL<5QL&abC~VYZy0^VJ>m5F`!e67@HJ2DJLPU37=0o6hW9?ESyw=eLI*?|
                          z%cFEE0Dyle*9jVH&;AI2TVXF&1abg(K`2@)eJ7dcZJtPHO;6_uYXQJRB`(?FNe!nV
                          zEu?VZ1O4+Zc*4P8W8$8KgvC8eCF{D1Bg#CsrYz9=MpIPk*1f$aBrK!GsIy=JC0x@o
                          z4;YB$1(#4sr7bNhjws7bKqDmYX+penVHiw$u(gjJR(e0Ww9iDGof!~7Xx+S7?U%~o
                          zt4`eV7SqGNeZ#~7MIl^f%9^}%vtnfqS|17cy~w~Xa?J6ir6mS34SW~~(}xvYb&OkP
                          zs}-DP*{6QpQr-4({$gE7I0K{}=(l*O`&>6owb9gIi*BTZKhYuPcfW|W^{=Cro9Lxg
                          zFT68&{kC_5XyW-NWo0+QmBwb*k6`UGVyKo(qo_>$vB>=}TaMr5y@}C(@*Sk-<$Z8W
                          zE-W9@sQBP}R3>@q$Y?ZUD|`a0$4bJbM?ML_a8-+C?_kgj%bqu
                          zwlfm;sic?L6w18cz;PR^ZJ(OG&t$xCo_~}6X!kQx;gy`=KhbU@*Xw7LNyGPdnyv*_
                          zO(tLF8f*zH0pUT#iDi*bkq#CQBs+13HPa4#{@$IgtO3?yXwSx9UU^Mw##AHO&c~{U
                          z8f9K<{DKvY1fq;BQ8Wrl7DC5Dn2(!*N^J6kmY$Llv{3MsfdVO{mck4qgvI0`D@Xrq
                          z+^A$F{yh7ry6gpw2fy}j7tuPAp7)_#TEn4Hrs43|A69psK-Vv`Ru4MW$&tt5C)04
                          zJA@LrgAK(&>_uJ04=Y?%^3=Fd?Hs2!m2*Uzhme7>c2jsU6N$(O87g0lPl9-#SLT}?
                          zub^e27nC=FpZC6T{Y7pNQ^37V#{i4V;RAY{S9Ms|=vuL?wcC{f?k6n=_eg6GuN8Iq
                          zw(Wtm*uL2+~@v_0v4>+eCY;^R-J*U$0&
                          zuuOuGPWYTabu|YZ+?^lIP%#e>x{bIz3gyEZK6y}CIM_^O@LLHk*O%Oka2QJHHfERc
                          zSj+xGKD+?*%;RDqgzQ$3pL75g8c?_}gcDGqCd%bfgrRrIK%fpVYjI2`84!eW5Kja4
                          zy16HY@}N4|Lf@bedHO+`PQ`c-2Ef7S#IXa%0T~D&paA{W$321N1cdBig2PPKPbQ`q
                          z-a$Rpren|9-MWBoMTKiK3Eu$WAbNsZQGpXiv_=V??dOLP-V(w^;FyLO8L+pX;ZYcT
                          z=|RGxwrNZ~?3Lz0k%mTeC6;uv;V6P#TI}~JeN+1>BG+fdi6S2x5E0u7t_2V=59FB8~iD}RF1vtvyWio&FGkyv1!Bo
                          zRXY7I#)gx$jq91j(3tGPjDgK8DPv-&m_0E{ElOER7xv;P!oGQ+(9&A|BbMK~sj`=e
                          zaq11h5_vI$p^`8EJ7_o@F*4}vOcy!?S5F6TBIbQuv^fZsT4i)?HPb95W$vuT9&yk3
                          z%pX-~sVLH$xHu?Oe9nzlZhMq58Q4X_k0enLVV0z
                          zfVTe5#ZsPFjqlV`fW$Ya6DL;Sed{nt`*3&W=^g3R=&ak5J%tF~%xTwJBTbnYTdkOM
                          zM@=~sdH0j|^!URRKDF30Jo|Ax@jBlYw;X&wgst~lGlXQY?7nTEHEuN8jyaypq9A*k
                          z?yp;CDJ2?=PoiBonp|LQg__+IF|R(%;0jZJ(qhmg`?lvsWs&>y8qH~9QR(VeWsLRy
                          zGC1<&=qVSQ^VYVig%Fv;ut`5UH7TPtSJB&kZ2wUo(n*|2P}(=nrk
                          z=Y^YQMb42Z!%UzHdLuY?oL);c>l5#HYx`}pzB@wNbDfjAqk#=0hbAql_}F%FuAo)vSWsl846OQN#Pl!Ls5Z(hZozpJu8&Jv#&RxEja$6Pc6{WGnu!*CA+Iq#=d#U8CVBI;kL`!+*=qt
                          z!;VmGXhogGg?mcRSIPJu*>F?g?!mN)kq@oMDBJe$9V%y1g!-nUUg`nv<81*Lt%;QH
                          z(?Wsujjkm^su>jsYd33L;y5i`d44uYN&i7uO>Yn<&<`z)E)JFpwM$7zg`x*j_hy~>
                          ziz>YV+~`HPYbO(UQfxZxC1l|59AsT>l7r|B(V=f`T5CUK5A*@HjnS308IMcGR@cKxDA$V$M
                          zjy2CVZsY;GPcSFh;+k2a^E$^0Kh0!wxZDnnX@nlW0ViYvKmb}|=HnSR?E44BnJsl_
                          zd4NEnu$r+7cfzKZE_*)EJP>}f@)=JkW_10$mHiL%U_dlrBl)&2r{=}Mcn6AdKbn0a
                          zz+S+q2o!)$xX^G2>Pas`N{X32R32u2wOLr1T$Y1ki_gaZwn!fzJeXXv50%ozueL_3
                          zulCG{%BuaIg)!-hOLzx_UEN@^RNX(uAq%O}5M5xFWk`d<-;-W94X@v%;Emo-7P4j^
                          zab~O*_ef8u>|a|Rs`g7^bW!`@?`&fAi*9j7OI|x#OU49lknglRgc}!kG0F;dUmGae
                          zri^e#8H+_f``XQ(`-tNI37hoP)y-_oDbo!1d_BKHxkxeV;3%8ligFu%>vtS_wpBfr
                          zRoT35d=*AtT{>YUk_kE-&U|V-I&)5)x933jx+|Rq^Q8^=TY+x}B$9p{{!_2hIHneC
                          z{8BQ_d%<6+R@PUGIy})HZ(^?=IREZD(GPvp5=8rRJ4`zH8Uw}C1N~bXg4JF)gW4;S
                          zsrL)^b&9mN<;Cw!e{wZTRV{GCMeqxP_)TgDu5H{J^!ZGrc@`<30=N3Y7d|e}3{MiY
                          z4jw(#D01jSr?ptr>n%%%(-qMAT{jWs71#PuDaYm0;c?k?r6;1Y>tqsU
                          z)aAAX>MMJQLC-%)O&KpMG2=+sv!RH0JcA!DD^XZ)4WI|v$+4k_B>puKjdm;RS;_2w
                          z1yLWpkJjJzSvMy`K^8_RFO|b7!#o}@&n`)uc)4hX2!kW^YI&7n6
                          zt+d^YmO^lLZ-@W*;lWR@cLXjJjJ6FIaDGO5)paJS_Fw6ITqL5RIchF32u}E@zAHt)
                          zHk#8*&5A~9HBH{^o%e-TAs2#|#%GUtG@_ClL4`_4{=?
                          z=#V`@1*z9~ylEl=psomkYMl#f4IFy;e5*6_qam!ca(=>kJ->9{f;kG41=LLfyfh+w
                          zWp+@v{kR}|oh1w@=3fiv3Vwya`v2;{9C3vcw;6#;Ljnk62tWh4Gk8Eqt!1$@>u1Vo
                          zPdi!w*p~}df}Icov)X5Y*&x^V>0BuOpeozgV@ve=x3|xGIZ;S$+Y{n~vs}pi79c+<
                          zcJ-P7y%V_Igm}on>>j4G2tV-#JBjbdL;(*lBWelEZz|8esgz`eXGX{bgcA2OU9S$v
                          zO8s*W^|EBppfjEs>)+ODHxUC>DsDZ%;s3CRw$nwuLn}>7n8NR9J(%uaG)-K>%xbMD
                          zKe9)PN{ZcMY0d<r)af6q+Qkery%u_Qp{X#uvd591855ww2t`NAlHqh(123qN>y|BSQLwV%z=L8E%vp5VfZd}X|b-M*E
                          zTV&!7$jZNi%f;b!gWJq%8L6YEo!1p-$gK8?%d#xD{ftXkJ!#x?V!+%FAxK^l3VnNP
                          z`2c8`ul-sB+U#MBz*+WA)i2Yz^7Q!akPf2@qKC&Qg(1hxoYpMNQ`vsqzQ?j}y|*dR
                          zFF!%+b0Lq4QZBpMLQAoce9@2teY9Tc{MzmwEgP?q%SO4Xw{BbCR%>unMp<(!cf0hb
                          zFd2`yZw|+0NKs=DLZKa$dr4<7e$~!=iSJ&SH&T|B{P;`s%(@6|o7*CmqvE=-0wLpN
                          zpcbX5E`F;YFA0dXG5l4q
                          z&Exq<*ll&&bdkbyif`m4ns&Fj7^eK~adjdtR4q(5?gY_5S;_=2<_%BJ4z(VBWmUK@
                          zG|>L=aE0Awx%F)`b=sYZ?#*7=6WMc{G$m>K;DeLGrw6Qpjka3K!9{!?2~aj;o$GDb
                          za-pZ}DeLui%q=cvP)dul3yY^`Wu>pYQHhn8S?x7$3V@44K*)@9bzAE>StGAZ%!?S6
                          zaQDuvop!?e_IKnS|BeGenWLT}RC(7uV4y4kDiyHJlk2;ULiV&Ldj!+elfzZL+@IK6
                          ztOQ?}#l8Z&GZL-{Hj7^4;o$}~o#1&l|;bKJyETj`#>N)qc>
                          z1!|`G=yb1Oi9jut)Uj-6d*17S)q(>*TZeaU=E)Q{7}pV
                          z!8j5kfXrI?nhTb6tSSk(B{yvp${x}|TdPw6=e!?ZsKsPqqdq8X+*(B*0LB7vAl=3R
                          zxM;v{W$IoTAi_`{upU9V*xNcXD6EC^jxdS>Y9|#kJpdMu3XvW@ec2!FDRo2P$OE0Q
                          zSW2%C5)huvbNY#ZKm&9kQs@O*c)(A{x{j^1EM8@=4bIIBX?Er$B-C)Z$0Bg6e-`%n
                          z3qI)x4Of@|nMHjRW(<>)&zIa8S&;IbjTIyg_wE5g3Jp
                          zkJy;rPbN_piwa>oZdnwZs-e!vCR9*~HxY{BM=4Ne#Ui@qV%*^BjD-j8?Oo&(&xh$g
                          zLU-$%rCGvNA-P`-`i%Xr<8YM1mS10c|9Lg>{bBywOy{&&)aIN&V9wBQm
                          z!HRvgl%y@!6M`HKqpWV+_w#;Pdv4XRNJ$VNkHxm&epSpQy)L!BZ*lKq=jN~|6Ns`-
                          z!;kR#nt5HSc`BG}xF1mDdLnWTetOa`D)S)YrXRU)}wL0$JLp|79X}AET!&Myk&5BeD3Wdsn#8yO=~Qm
                          z6(!W(nWnzHd%e9b1!?kcqTD}nb$9j)I>)|J*k@i7M}&GdPzZ;_cxfdroJyPBld~g{
                          zp(Q^#_;`J2phLHDF&Yg-{mhU=1JxFdFSzIZotFzVY*{YG0qeF{IjZKIF0gm8>iW`|H#Dy1b%}(*S<#
                          zjJOlwtYFDa$}7|xW!=>|niYJ0I<^edjK0r)Xts+FAMTU`hO+%Y4WK6rU|aH-Ff61R
                          z7;7$QckkLz*^uq)qFwhh7i`uzNd>HhRpb>Q+8cF1o}VaS(OEEUwt{NPtia2wJN$O3Gc1F#5}Q
                          zdp@k9Z$qFi1^_;FfWaEP8eH}ADl+2;%0oCkI0E>jgI`M@{03N#SLbJRS{*vSKTGcK
                          zubVJ7*{ouO(dnak?b6c^aBK%3Fe2w{K>;Mz;$JaDezW-8kHwZ&wiJ!vEtkbX2|
                          zEao12Y50jtXboPe86uRI|7gh%fX*^s1?;-|vj$3|Sd*xPeA=PL-xD=1F6$v|0WDvk
                          zGEojUED`%8oPL13vSKX82175&xVw&iJZd3B@@}|q->kCay~SMEo}K5R3T^%1;RO{)
                          zXHpnoJc&~lS#KBXvI(?-dB>t<
                          z#?695O;^-3)8B|f`KV}$KUC#ryGwuRm9rr!c-)Lle}7X<4KmY2Za7#JY<;No?N(IN
                          zdaj*X)a+oLt=5WNSNt}sMAf)sDXKSvBlVM%Mx(~Ygob@I0>&A>X~eynIhkxduE}}y
                          z_s8k|=h{V~-Hy6~*r&t427=Th)eiPSX8}nWuh?%g#PcyS!E*Su>jm`7c)5QwuW254
                          zA1&Z~u{FJ4FEW%}cID|>F%ygF9>2l}iwrS2G5x-xlKhhC!fc+;5NYKer-zV|cr_iNp5xR(9={QARs7zRHYXXz8=&;|)J)|qn4>!jjItSR~zPf{%;-eD3{vom&JZr#>
                          z7lj5K2q>Y1GZ^lJ=eX*pD0L-ER@q6hb1wRd}1;<)__Z{vYSRtxGo}kL~Pn$M;}`{Oq`rjWmvS{S!>OXAO6e4ZMDLbMv47jg+$5X;;
                          z+TS1Rcc02wZ!p54+VdUhguXMOoPPgLAwHA>*gQRIL=%h)_}piq&K$gt^coE3g3PgjD@ilnv?O-WM>v9(
                          z)-Ry^RbmKFar8aC4De7Ga4K+O6cOyX`E*nXz|AP*R<2`Te0s~s0_o+;OG$RvLsSC0
                          zu;xeo!KrZQV*{a9H#k&iKnhM`X$_oJ`8cQ%a+yZ9dO^SQ^Imv=3M<9GQ#=f
                          zDq<7V{S1~N>SlOZM0KT%taP3Ge0h2#hi-*fm_s(#Oo&j
                          zkB!&^DrA#`kd?|~e^qKsDTh_0v|he+|9tdXyJe4eRhGf%skX9@iI>&h?J_J5b{oQ_
                          zjz3Xf3|?E<5MSFc*=Uvb*K4U|mnLm%)y6+evNFQb=3n+bP%eHK=xH$#7aOEjq)+7>
                          zW0Atb^4h!Ki>E(HSsSHjk$XYJ)wJ?()48HzS%;%BHeQ1})L-6ESJ?KK!B(pzQ%GJB
                          zjWYNdX&ZrKdd;Fu#Np{7zh%}0d#Ww%7PX%h(YC&xt3PYN8c<^$@yiq|2tVE4pDYajI
                          z9)DXb|2rhEL)Xm_@gkL$!YBicE^=WJG(4z9G=*|unGH4v9w2J_q5AQA7M0RWIG};q
                          z>CZKbSdHr*RcfnwZm^9Yr8jP=79}NRFw03eqrBevTX1{>b_|BcCv0x}+6{}|!{=Tc
                          zuhsHpEYw^O-EM@9nABjCI)P^1m~!u;z7bf5SOe29@@(8hg;?TMzj*-$ev~3f-Tedbc6`B}{MWlizuS
                          z0n)&;lhpBi#zstlPhH3>y4}VxI7laZh~v7H=`8h<%$E*CxU2#EzGkSB3XA8D
                          z0dz%&p8+CX01t-egg)ISBZ>&f%Y|Stb|GXUl8JRvh0K{&_V-LEno8ne3QO7ci9z;bCENNz+<2wA{;;3HrZmbM5~u9=)&mpjZ4f3S5)P=Vv~
                          zgph7iS4VJ7QX2{huG_3I6X11PKI%_lzq3TYMYOFBDZNQDOH1-kSyFVIhvYUC$qWmN
                          z$XG;qQ2%$9+0fQ1fEBoWNTTtwcsMEsDZuK;J4E%KL4O77TJfE{cRGvx=ZOZrW^JvN
                          zGZ1Rk8G;xXwZ
                          z)C`Y;JMn)Hr>(RFs7D6@uhsRy9EKufLCA=Z#et8GNg(r|IyLGUcwW3c-?R2n^U){=
                          z;qB~Ll^=h48E{hnGE;J*z1o1z;veak-<^fErkt|nz1^Cheza|#=(jJ6+;s|>s^M9c
                          zVUB-%*o8Oz^lrrVv=c+auC>6`-SFWnIV+us2?sYWXv+*zPU`78n)Eua*28CqzVSr*
                          z)SG;`xvZT{s9e#^mnpP8n0r9uzO-1>qJvuf@p5PrzFz{?5MYcOZK?b;QhYw!vCk~n
                          zJJHR+>XNODL)w|oq^Ks*3>fjEfIJe9Uf8?h^txQL;Hdi)<-h@bTh*IiPUSgJo*tf;
                          zcaQMVa@Q$~Jh(|T5-)RisKXr$w+Swdf-cc|wSsyf{Io+5lB0&xnYQ2n<
                          z#RdhnA^w1#qQYuVPFObTKr7qV-#2DPJ_{OKS`vmr;0PiW_%&GZKAex(J+@qMLgI@*
                          z2Q{{+PHDmryJAXpP~(Q))Ny68eJM*d#@0Ma`XciBDxoj;jo^%C*%VUOgb-=V#J^sE{G*Y#Wi`)Wq4zJGbQ_dw!>HYi8
                          zVAC6<;Hz|ERF!si;#hx8KVXFaWQ!IRW;9FWHF+uGugdLvIxKcEN~y)5(ctYR?9<7`
                          z>aDGFF5#heeRK?4XqO%^YEXm*H_*_?`f!x`ws!>@j>zTpTlWq3<4@1*p)gec(wzFV
                          zw?c7GaiP3gM!~=TXBM7+)(Oj|l<mxqjcVIQ!Gvq=pOsJlb~gLoadd`8WGC;|82a
                          zrSNX=N`IvzVj)pM?+&0J{@Yr8zueYtn%0L*+ia0L`pgdrE6>uU3j8Pxpy(}Lv~`_~
                          z_a)V_xi{j$h9F3i6|zCu57p})9Y@*XYF
                          zmZ)#M;IC%fDDzgb%c^^eb)(GWkd+7yV%nx_H~)3SKYsm|yAVaLgOHO-WK}AjwoWX0
                          z%-ikqymDJWq2IQ#gI4Zi#6O@5ft}P@15OQH&_9qpl(`)6#!uw|O+f5RAW35#`Wjk-zGr?eI|746bSc<|mJ2uw<|0RGs`~Evdy%F&
                          zeBa|r+NBkbsj5V^lz%Gl^Fb-P#1p&6V)D_)J^<@B=8k{(wq^vS10Z6~T=H%vtR?_L
                          z5~PjyppgH)u;k>5K01T<+B!#5c5!+tylOK*{7
                          zBLX&jjSdhL+Nrw&CWrdv%oseMscyV+*hyn3NCd+HY_d~SYL_Srr2&lI*)c*arhGSJ
                          z>j5DYC
                          z(NWRtfmV;b2e%l&ZW4K1P0Zft{gvocy)PKKA>=qg$YcV9(I=vJj1
                          zg8HbOed$fbE&Lcd%i+5Ev9GzYH3yfx2(q#=O|S-~(mHc3RHdBV+Etjbi5dh&8kcNu4Tg{d_awB(QHQ(hgo~G2rSfQ
                          zket-UR>S>5IlC^;%_5Lvvzkc6vt(C)y7yc$#gbZSp=$*h)W46qP?TQAgCNXQ>3PrV
                          zr5QbE7KIi+8iE!abuU=tD!u*aSui0M{Wn>oeag6E+v
                          z<%Ysc{!}(l%lYtagC7Z`XnmcxVz77vE{X>Vi_;5)y5Uo&45k9NBI3mlw|+383p7e*
                          z(QVc{yCpkimp*=aW3f@u?xRUZMeiTh+hy!2Zr%Ow68656wI|6Re4+YGZG+brZO^UA
                          z66&&IN@5=sHN{}#z{NC+oOLo6Bkk0xWdwK=3-&kM(l6-^`{FvUZpf2*-KEL*HnVohQWM!_6WL38UGfR7{69S$ehuVgD0?YGZbOq=JR<5?{y{rGB{?>*tA
                          zp}KG*4YHkNttP8Pv*@L1=yj~`u>hT&#+)aHE1k6$HqRd4QWsfXYU1RE0u;vdXv34$
                          z8rW#50#WXcHbZ;l>5Lxv&aX$T%xRm1e6SO6r2QwLiyE%&=DS?71YYh$LtAu
                          z{1f7Z%Mu3l+-03u3{7Qu6NEYhSoO!jkt+1cif|!7Iyhl|F7WI4vXQfn98ZTn2B=HZ
                          zts~lo!s}QbtBZp*aJfak55|h9ETEjP(%S0N`t~u(;lTFul{5~R#lYkkR>4Q$DPbA!
                          z7wCJz|F*)!=N^$qi^L8Hz0APCen<)c6fM~6Sx4voG92jmNcU6-7H>8}6y{pW{p8J;
                          zw`g87r^8N3*qj3fF2gjA23tbw>>7QWLX-o@<>k;6C&Kv)`qK&&7bO5AveS`~RJ4qK
                          ztfFS|)5$NPo3~h!5(*Do8)T4J&4h}+EeOZMnV^&sH;=>IE
                          zZqTrKhIcV5xa4We+zK%fGk#uIhu7r!g+L~6y5jVMAXpyqUln{O8mL0Dr?s_RoRx?M
                          zh>=SiPpU$xKXRTM(77601>2x)qYtTQQFR7j?>Ti`w&631Wj9&8{qSicjkzV^iGg?fFL7H%>p%b6@>!es2b^_r3D2(NSu7S|H~;t%mK1OB
                          z(ZfVUv4!HXJt3Adf6Z$~!er^;VG}XE%XHxK`GdY>mglP*b=p@Bol#1QAA-?Jcz#u;
                          zvgYVK(Tze*1C^lae0^~s_p|6fKqJ&Kg(1#`6N-Eq8W5eA~`#m>!+;AvrX<;f*d_sV8qRGw$S|S1?hhZT?2X)|@VYj^J?Qhm<
                          z%10(7<;3D#^ldJl5HmICD$8I>FF^W%^n-*yvB9TX4&ak7W6Tg5$r8kY#d?W2>PX-D
                          zYpKJtY9m$I#nY`NBfYirM%O~@$C$8LXhjz#z!8G9*QQRif^DYZ%PxI&sU~&D^6;cFBqdpIbz9TatbNP$dahhQNOV7qOG25|Se-CpPj#k!S`h=7F8fXM
                          zrdwHif6VV-c@d^ZV1(cWlcL2RwP1`Ye1O9QVVT9862!Z6kTmCO*N>K(9q?HnAcqF*$FJ&yg+dApm~A4p%Hkp_9(-qg>|0>C4TW9}z&tjstt$@?
                          z?lp$1gDz|il$G82j?eL4sLbmT5bEHfU7CVN`z@7D=`HG<+v8?teyP4n$Uvgqx`+~$
                          z8bRvnhO>gc+K74>GQsw!B8Jy0grdMc9b+eVgfIE0Xi;O7@_!Z}SxN17(_*jdjrs5g
                          z-$|>>+>xV4p6+!OJ;!;`_ch9Jj$3u=;%k%r*IrK&Y`$b1#(9haA7;bj
                          zHD}zKr;ySolclFVJlN?K_su4Nv?Aj!E}|@DcA?RU9Fe>Gj?(cfAEQ*$*L-?ENyqTd
                          z<4@V`F|+Sd}$W9IqWz-?UG
                          z)x@zuC&#D#
                          zDV-{mgb~GB(9HiCd1*-V={P=ew?s9*uNF@uY7n0o0lm~;(;P1h;QQd7sjNG}*HS?UyoKDy2~;pi
                          zq4SsbV@vA!eYD*JClVt7=uc+y0F^osOMo4@Fo6esOn#vd={D*mm4KC+vzv72h|Y00
                          zP!=n2MU3H}MSsaNX+l>bx8FmDhJls0$7?Xt2;nsN24zL$KJ!9~F{~bZ-&V`Mc6n^2
                          zj1F~o_SZkyn*M3_b8x8L!lx7Tsu$#IFQl&b^(pRgEbHOlTPQD|amzE3zsN&+wX+{$vb
                          zf*BXkI^*cp>eh0)p%3SNc_n7LP)^K6Z&YlxVDkGAgu+s5cwsH6NKN33H@!jp!{X%;
                          zw&>AN35c|w6-~nv^SxHBgrTIU^^qUYVeI^s^)Qx!N1HUE2A<;XIr__+7KYAcjqBGd
                          z^7~gW6KJfgB6C!*6jmvv|7vddgjhvve2RgRRMC*P-1PmP;s+*mrTCcfa#%|3e?j^2K+H
                          zW)y6JrOV0T5?*O;bD~^G>BGdSECW1S-G6D>A~$hTvU}^#7|&encQGcqFk^nKn#@Og
                          z3EB#?DbRS#)Y$!dgyT82x!mN|_vC%-&&TqKe^@H9&d|F8poz%BKz4y&g7sJPl&bjV
                          z`erSPTA9b;Q#k9H{hOyz$$CS2;^}b1dSi5RC8+GVpFH{A<)krF+wds|rQ5Y1SVZ~I
                          z-xl>j8=xm3(d30lSYU9sG2|5bhd7@TgSCp38&8KGTBP1cxZXBSV6$U!plVUN_bq~!
                          z?zw*oX|Ly}+Cq(c8fZYHiK(RjngZKs=qk}|v0?f4;5t5HVu6nXy*;rZ_`&1wr
                          z{~o@R3Zf1rxFTT10$?Se1#r3bhOq2NptB&sQLxpMSU+AXI9^
                          zuY?t*J)h>Y9P2ZHRt%otw_L}#S`zT}gNpzbIY1Y}xOuLsk5vn8cX$8l9|xhjA&)-`
                          z^Ji&IYf0Gb_p_PIei*jbSJZT2A%-^fTcm_LkWv!F
                          zqbrmQU>&V8v_8uX-PB?wF4+3^dOb9QgQ3ng)52Wu3?I*bXGn#{#lb!`U8ifpI0SLs
                          z>xbf-N(wVR+iJ>fo14jZY^LYnt-snHtwYSWKoVeE!+$Ci(7u^yFry0f4`O7{DRsNCWtV3=
                          zcrUW``yBMU-#>@mhg;?B?bz2$@CF=^T%SIaIPZr|^REOz?W`crUrIIoZ}K;;w~SQ#
                          z8I^tdtya{SfwFfbTQ_5Rbl?7s5wN?@Zt{))06XUBuYK=z*7e+!1M4ONYE$m2@2|6@
                          z^_o|L^L2~nldS`}>Pb(>dovF3m?}k^`K!bASfQLn{#CPCw!zU5EPn9*+K#|6FXDsz
                          zjWF`N?-xiCy{`DGVdCy0rw3
                          zj1UT|I5?AH5Bc|fh6E4-g@H1p5DZu|>5%B>#zlo@myjI@94c3JAP+GHoe8Jv7{DMD
                          za!~3cDi=(IXDz!gR{#!|Kko-gfqoDO-HN^t>LoJ)XVhwobp*9E3vSTGD&Y`##(
                          z!0tsB=e1!iI}06;LmZ`&jK?pr7R`mM9w<1nV)ANluP#c>B?y^$v$MVD8i{F7#sRap
                          zID8m-g9aa)6+&R!p*==^G(E+xPbsFQ|2Vd5?8PEn6
                          z>h^6}uYlE!@2;~#D}msAl8y<_u_H3^f%e`RQWC2f_fFTmE-ylqph3}9RL)4%BdSYZ
                          z=@Im}oi$!X9Ut9K_AY)C^QTm(2+jKL>XzxK5EmCI0yk#p%yzz&ni%0|=ss76V_RE?
                          zm6|zCCR_#reNR&?Dx&%$#}RjY4otpSC|&k^p{dj#*CRgP=J@a}<(`3{0iV!%(K;ho
                          z#t@Gb{R;@`lGQIDwH$)Usph49^kZk)A?!vT<2~{F{7z3XnmODa=7UbZ66JNMluhm)px@kT}bVA65L
                          zo5q1B@4KqcjeYGb(VU(N37=!9+5uL?i%K`pQe{VavnA|+J={VFBlTo^9zc*CVFmxJ#K?n-rfG~t5G&|@6ewfOIgBdeHGaRm3
                          z9pH=-1karo05}25^ot-RSt!jLO8W*!shtoZtTaHjyaTdigjiH^h0Mcs`PTt=o(y+O
                          z1gfg=0JI#0Q-s6CBd7pmIzu6i=>yJE#AlwSqtQJGhK>XfI0z5R#R8D`xyn
                          zNKE1QrG5sMA$)EDgS|r7y$K(?j>E0nu-xk*`Rd=%Q6H2=cFSi&1PU5`R!eH8orj7P
                          zG%b>i%olsBC5O-
                          z(aL;WZJ_d$3NfGrkeQ+UUZjr;MyMvIg~Lclou5B*c|_vo2$jPO{RwAd{z6GQuOuo<7boc7JBC+AV_tvDv}+x
                          z4^O_czCC8bicWVsGE{wL-MLr)ZprSQyeej57{?l#*>~C2ZsE*9_O+cq>m6N?_jhpp
                          z=Yk6_b>BQ-xZ5?V$^Nu;^6T@hpE?~Xl&>7^hy(ZL&r`=QX(SBC-Le1F)XU<|J<-td
                          z&e+rsy~}(`R30FLUuE^qAMe(2&AIk8fX4nj0rfgXjsTK?{KMd_LERuB9Ifk7q1@Ik
                          zudA6BCdGXCcH-H{0p3S*R50S61colZAE_XIG7;P3OY7!vdoOK^vOcV&BJ1-0h|)}_
                          zVgO(BuA|w#6Hr=BO--%HH}&q7>j&Gq73O3&h$d+$*&MNkRm6#)%le=7l@1tX>mI6<
                          zd7tfa4KhEELcQjAsQ2k|M0R7j8pkFMk9b)JUad&dDAuwe*x-M^rwO(>YE)!?Pg^cQQ&AGy1Zpc5sLARl2qP6JH{6BI;((EV2w#g)HUUu`Ul`B1Z_$;Z4pgA_j&|CXRVDz);V*VfF
                          z+V_aIQhF;X_x^gFcvhlj^ub2|;CxZ>_fc0q%4{5qBB=gXH~9bIhOp20
                          z|Hp0!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|tX*0l?k zI9LZ)!7ycb41&WcZ8;Qa&Y z3y)QBKz%oqWvMj04S*@bc~1cD9L{He!F3A|0j~$^pOO-ewQRMn&q_+f4dVtdxc|ig z4DKtypeds_v_Vv6Ey=BKgQ&8h&qO7a4P!(Eu?oC@0NXG|0E5SMIHIx=-2SmJxNQO$ z5gsSvfQy310stezV_+6WfcFnz8+fk*JSLn6Aj*dOa~z1^;Bf@7OnBDWY5(LOz?9+k z6ksZF-m@?`|A19P!{bC22A5NSVU%FD1Vr9gcuWW|C3rl-r3^jr9@H@bLf^ z7DTe}vP2AgeDUB!Io7J~x;C&X8{$qpz*y_NaJmikfg|wX@fsdr8~Tg`%!l_62SgX< zQ}Dn>zDt9t9qQfG81yd<}p=1hZ^- z8z3&;z(0U(cs3#k9pU2vFt{B8Z2*G>dk$s5&5hUwJ48?hW*p8_fWdtf7$ES95Z(qb zcJTgz2nlW@lz_&-#|U5>#)yT%#|U65a9$~)H;xg&HjEL#HjI%H8jLy22PmOcexCgK zPx%8F4({_<7(DI-3WJ8P=ddui9S0b2-s|}XBB>2?DKu1)9$v6m4S?j;+Y!kphD;uy4b4ftA!FGZP z30NG4l?B)az9?fbaJ~?Me!$~m76y-10QWY;ga9M_GuHF&vTeZUEA;0?b^umfwA zn@iDvWTlSBIk2YGc0e2m_GqHLvYm<}mV6GZ2A#t@IAHM_|7Qwo@QRr0g0G#A@6RQ4 O@E}~$(mJNPT>lGj07NqY literal 0 HcmV?d00001 diff --git a/apps/mathlib/math/test_math.sce b/apps/mathlib/math/test_math.sce new file mode 100644 index 0000000000..c3fba4729d --- /dev/null +++ b/apps/mathlib/math/test_math.sce @@ -0,0 +1,63 @@ +clc +clear +function out = float_truncate(in, digits) + out = round(in*10^digits) + out = out/10^digits +endfunction + +phi = 0.1 +theta = 0.2 +psi = 0.3 + +cosPhi = cos(phi) +cosPhi_2 = cos(phi/2) +sinPhi = sin(phi) +sinPhi_2 = sin(phi/2) + +cosTheta = cos(theta) +cosTheta_2 = cos(theta/2) +sinTheta = sin(theta) +sinTheta_2 = sin(theta/2) + +cosPsi = cos(psi) +cosPsi_2 = cos(psi/2) +sinPsi = sin(psi) +sinPsi_2 = sin(psi/2) + +C_nb = [cosTheta*cosPsi, -cosPhi*sinPsi + sinPhi*sinTheta*cosPsi, sinPhi*sinPsi + cosPhi*sinTheta*cosPsi; + cosTheta*sinPsi, cosPhi*cosPsi + sinPhi*sinTheta*sinPsi, -sinPhi*cosPsi + cosPhi*sinTheta*sinPsi; + -sinTheta, sinPhi*cosTheta, cosPhi*cosTheta] + +disp(C_nb) +//C_nb = float_truncate(C_nb,3) +//disp(C_nb) + +theta = asin(-C_nb(3,1)) +phi = atan(C_nb(3,2), C_nb(3,3)) +psi = atan(C_nb(2,1), C_nb(1,1)) +printf('phi %f\n', phi) +printf('theta %f\n', theta) +printf('psi %f\n', psi) + +q = [cosPhi_2*cosTheta_2*cosPsi_2 + sinPhi_2*sinTheta_2*sinPsi_2; + sinPhi_2*cosTheta_2*cosPsi_2 - cosPhi_2*sinTheta_2*sinPsi_2; + cosPhi_2*sinTheta_2*cosPsi_2 + sinPhi_2*cosTheta_2*sinPsi_2; + cosPhi_2*cosTheta_2*sinPsi_2 - sinPhi_2*sinTheta_2*cosPsi_2] + +//q = float_truncate(q,3) + +a = q(1) +b = q(2) +c = q(3) +d = q(4) +printf('q: %f %f %f %f\n', a, b, c, d) +a2 = a*a +b2 = b*b +c2 = c*c +d2 = d*d + +C2_nb = [a2 + b2 - c2 - d2, 2*(b*c - a*d), 2*(b*d + a*c); + 2*(b*c + a*d), a2 - b2 + c2 - d2, 2*(c*d - a*b); + 2*(b*d - a*c), 2*(c*d + a*b), a2 - b2 - c2 + d2] + +disp(C2_nb) diff --git a/apps/mavlink/mavlink.c b/apps/mavlink/mavlink.c index 2ec459ddc7..da704d9293 100644 --- a/apps/mavlink/mavlink.c +++ b/apps/mavlink/mavlink.c @@ -148,6 +148,10 @@ set_hil_on_off(bool hil_enabled) pub_hil_attitude = orb_advertise(ORB_ID(vehicle_attitude), &hil_attitude); pub_hil_global_pos = orb_advertise(ORB_ID(vehicle_global_position), &hil_global_pos); + /* sensore level hil */ + pub_hil_sensors = orb_advertise(ORB_ID(sensor_combined), &hil_sensors); + pub_hil_gps = orb_advertise(ORB_ID(vehicle_gps_position), &hil_gps); + mavlink_hil_enabled = true; /* ramp up some HIL-related subscriptions */ diff --git a/apps/mavlink/mavlink_hil.h b/apps/mavlink/mavlink_hil.h index 1eb8c32e9e..8c7a5b5142 100644 --- a/apps/mavlink/mavlink_hil.h +++ b/apps/mavlink/mavlink_hil.h @@ -43,8 +43,12 @@ extern bool mavlink_hil_enabled; extern struct vehicle_global_position_s hil_global_pos; extern struct vehicle_attitude_s hil_attitude; +extern struct sensor_combined_s hil_sensors; +extern struct vehicle_gps_position_s hil_gps; extern orb_advert_t pub_hil_global_pos; extern orb_advert_t pub_hil_attitude; +extern orb_advert_t pub_hil_sensors; +extern orb_advert_t pub_hil_gps; /** * Enable / disable Hardware in the Loop simulation mode. @@ -54,4 +58,4 @@ extern orb_advert_t pub_hil_attitude; * requested change could not be made or was * redundant. */ -extern int set_hil_on_off(bool hil_enabled); \ No newline at end of file +extern int set_hil_on_off(bool hil_enabled); diff --git a/apps/mavlink/mavlink_receiver.c b/apps/mavlink/mavlink_receiver.c index 79452f515e..0eb0b39d19 100644 --- a/apps/mavlink/mavlink_receiver.c +++ b/apps/mavlink/mavlink_receiver.c @@ -86,8 +86,12 @@ static struct offboard_control_setpoint_s offboard_control_sp; struct vehicle_global_position_s hil_global_pos; struct vehicle_attitude_s hil_attitude; +struct vehicle_gps_position_s hil_gps; +struct sensor_combined_s hil_sensors; orb_advert_t pub_hil_global_pos = -1; orb_advert_t pub_hil_attitude = -1; +orb_advert_t pub_hil_gps = -1; +orb_advert_t pub_hil_sensors = -1; static orb_advert_t cmd_pub = -1; static orb_advert_t flow_pub = -1; @@ -302,6 +306,166 @@ handle_message(mavlink_message_t *msg) if (mavlink_hil_enabled) { + uint64_t timestamp = hrt_absolute_time(); + + if (msg->msgid == MAVLINK_MSG_ID_RAW_IMU) { + + mavlink_raw_imu_t imu; + mavlink_msg_raw_imu_decode(msg, &imu); + + /* packet counter */ + static uint16_t hil_counter = 0; + static uint16_t hil_frames = 0; + static uint64_t old_timestamp = 0; + + /* hil gyro */ + static const float mrad2rad = 1.0e-3f; + hil_sensors.timestamp = timestamp; + hil_sensors.gyro_counter = hil_counter; + hil_sensors.gyro_raw[0] = imu.xgyro; + hil_sensors.gyro_raw[1] = imu.ygyro; + hil_sensors.gyro_raw[2] = imu.zgyro; + hil_sensors.gyro_rad_s[0] = imu.xgyro * mrad2rad; + hil_sensors.gyro_rad_s[1] = imu.ygyro * mrad2rad; + hil_sensors.gyro_rad_s[2] = imu.zgyro * mrad2rad; + + /* accelerometer */ + hil_sensors.accelerometer_counter = hil_counter; + static const float mg2ms2 = 9.8f / 1000.0f; + hil_sensors.accelerometer_raw[0] = imu.xacc; + hil_sensors.accelerometer_raw[1] = imu.yacc; + hil_sensors.accelerometer_raw[2] = imu.zacc; + hil_sensors.accelerometer_m_s2[0] = mg2ms2 * imu.xacc; + hil_sensors.accelerometer_m_s2[1] = mg2ms2 * imu.yacc; + hil_sensors.accelerometer_m_s2[2] = mg2ms2 * imu.zacc; + hil_sensors.accelerometer_mode = 0; // TODO what is this? + hil_sensors.accelerometer_range_m_s2 = 32.7f; // int16 + + /* adc */ + hil_sensors.adc_voltage_v[0] = 0; + hil_sensors.adc_voltage_v[1] = 0; + hil_sensors.adc_voltage_v[2] = 0; + + /* battery */ + hil_sensors.battery_voltage_counter = hil_counter; + hil_sensors.battery_voltage_v = 11.1f; + hil_sensors.battery_voltage_valid = true; + + /* magnetometer */ + float mga2ga = 1.0e-3f; + hil_sensors.magnetometer_counter = hil_counter; + hil_sensors.magnetometer_raw[0] = imu.xmag; + hil_sensors.magnetometer_raw[1] = imu.ymag; + hil_sensors.magnetometer_raw[2] = imu.zmag; + hil_sensors.magnetometer_ga[0] = imu.xmag * mga2ga; + hil_sensors.magnetometer_ga[1] = imu.ymag * mga2ga; + hil_sensors.magnetometer_ga[2] = imu.zmag * mga2ga; + hil_sensors.magnetometer_range_ga = 32.7f; // int16 + hil_sensors.magnetometer_mode = 0; // TODO what is this + hil_sensors.magnetometer_cuttoff_freq_hz = 50.0f; + + /* publish */ + orb_publish(ORB_ID(sensor_combined), pub_hil_sensors, &hil_sensors); + + // increment counters + hil_counter += 1 ; + hil_frames += 1 ; + + // output + if ((timestamp - old_timestamp) > 1000000) { + printf("receiving hil imu at %d hz\n", hil_frames); + old_timestamp = timestamp; + hil_frames = 0; + } + } + + if (msg->msgid == MAVLINK_MSG_ID_GPS_RAW_INT) { + + mavlink_gps_raw_int_t gps; + mavlink_msg_gps_raw_int_decode(msg, &gps); + + /* packet counter */ + static uint16_t hil_counter = 0; + static uint16_t hil_frames = 0; + static uint64_t old_timestamp = 0; + + /* gps */ + hil_gps.timestamp = gps.time_usec; + hil_gps.counter = hil_counter++; + hil_gps.time_gps_usec = gps.time_usec; + hil_gps.lat = gps.lat; + hil_gps.lon = gps.lon; + hil_gps.alt = gps.alt; + hil_gps.counter_pos_valid = hil_counter++; + hil_gps.eph = gps.eph; + hil_gps.epv = gps.epv; + hil_gps.s_variance = 100; + hil_gps.p_variance = 100; + hil_gps.vel = gps.vel; + hil_gps.vel_n = gps.vel / 100.0f * cosf(gps.cog / M_RAD_TO_DEG_F / 100.0f); + hil_gps.vel_e = gps.vel / 100.0f * sinf(gps.cog / M_RAD_TO_DEG_F / 100.0f); + hil_gps.vel_d = 0.0f; + hil_gps.cog = gps.cog; + hil_gps.fix_type = gps.fix_type; + hil_gps.satellites_visible = gps.satellites_visible; + + /* publish */ + orb_publish(ORB_ID(vehicle_gps_position), pub_hil_gps, &hil_gps); + + // increment counters + hil_counter += 1 ; + hil_frames += 1 ; + + // output + if ((timestamp - old_timestamp) > 1000000) { + printf("receiving hil gps at %d hz\n", hil_frames); + old_timestamp = timestamp; + hil_frames = 0; + } + } + + if (msg->msgid == MAVLINK_MSG_ID_RAW_PRESSURE) { + + mavlink_raw_pressure_t press; + mavlink_msg_raw_pressure_decode(msg, &press); + + /* packet counter */ + static uint16_t hil_counter = 0; + static uint16_t hil_frames = 0; + static uint64_t old_timestamp = 0; + + /* baro */ + /* TODO, set ground_press/ temp during calib */ + static const float ground_press = 1013.25f; // mbar + static const float ground_tempC = 21.0f; + static const float ground_alt = 0.0f; + static const float T0 = 273.15; + static const float R = 287.05f; + static const float g = 9.806f; + + float tempC = press.temperature / 100.0f; + float tempAvgK = T0 + (tempC + ground_tempC)/2.0f; + float h = ground_alt + (R/g)*tempAvgK*logf(ground_press / press.press_abs); + hil_sensors.baro_counter = hil_counter; + hil_sensors.baro_pres_mbar = press.press_abs; + hil_sensors.baro_alt_meter = h; + hil_sensors.baro_temp_celcius = tempC; + + /* publish */ + orb_publish(ORB_ID(sensor_combined), pub_hil_sensors, &hil_sensors); + + // increment counters + hil_counter += 1 ; + hil_frames += 1 ; + + // output + if ((timestamp - old_timestamp) > 1000000) { + printf("receiving hil pressure at %d hz\n", hil_frames); + old_timestamp = timestamp; + hil_frames = 0; + } + } + if (msg->msgid == MAVLINK_MSG_ID_HIL_STATE) { mavlink_hil_state_t hil_state; @@ -412,7 +576,7 @@ receive_thread(void *arg) int uart_fd = *((int *)arg); const int timeout = 1000; - uint8_t ch; + uint8_t buf[512]; mavlink_message_t msg; @@ -423,13 +587,11 @@ receive_thread(void *arg) struct pollfd fds[] = { { .fd = uart_fd, .events = POLLIN } }; if (poll(fds, 1, timeout) > 0) { - /* non-blocking read until buffer is empty */ - int nread = 0; + /* non-blocking read */ + size_t nread = read(uart_fd, buf, sizeof(buf)); - do { - nread = read(uart_fd, &ch, 1); - - if (mavlink_parse_char(chan, ch, &msg, &status)) { //parse the char + for (size_t i = 0; i < nread; i++) { + if (mavlink_parse_char(chan, buf[i], &msg, &status)) { //parse the char /* handle generic messages and commands */ handle_message(&msg); @@ -439,7 +601,7 @@ receive_thread(void *arg) /* Handle packet with parameter component */ mavlink_pm_message_handler(MAVLINK_COMM_0, &msg); } - } while (nread > 0); + } } } @@ -452,11 +614,15 @@ receive_start(int uart) pthread_attr_t receiveloop_attr; pthread_attr_init(&receiveloop_attr); + // set to non-blocking read + int flags = fcntl(uart, F_GETFL, 0); + fcntl(uart, F_SETFL, flags | O_NONBLOCK); + struct sched_param param; param.sched_priority = SCHED_PRIORITY_MAX - 40; (void)pthread_attr_setschedparam(&receiveloop_attr, ¶m); - pthread_attr_setstacksize(&receiveloop_attr, 2048); + pthread_attr_setstacksize(&receiveloop_attr, 4096); pthread_t thread; pthread_create(&thread, &receiveloop_attr, receive_thread, &uart); diff --git a/apps/uORB/topics/sensor_combined.h b/apps/uORB/topics/sensor_combined.h index 1d25af35a5..fe84aab636 100644 --- a/apps/uORB/topics/sensor_combined.h +++ b/apps/uORB/topics/sensor_combined.h @@ -99,6 +99,7 @@ struct sensor_combined_s { float baro_pres_mbar; /**< Barometric pressure, already temp. comp. */ float baro_alt_meter; /**< Altitude, already temp. comp. */ float baro_temp_celcius; /**< Temperature in degrees celsius */ + float battery_voltage_v; /**< Battery voltage in volts, filtered */ float adc_voltage_v[4]; /**< ADC voltages of ADC Chan 10/11/12/13 or -1 */ float mcu_temp_celcius; /**< Internal temperature measurement of MCU */ uint32_t baro_counter; /**< Number of raw baro measurements taken */ From a40f41d216fc40afe32e0a69bdddb13bdde5d393 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Sun, 13 Jan 2013 17:35:56 -0500 Subject: [PATCH 095/157] Change default vehicle type to fixedwing. --- apps/mavlink/mavlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/mavlink/mavlink.c b/apps/mavlink/mavlink.c index da704d9293..ceb7c25549 100644 --- a/apps/mavlink/mavlink.c +++ b/apps/mavlink/mavlink.c @@ -77,7 +77,7 @@ /* define MAVLink specific parameters */ PARAM_DEFINE_INT32(MAV_SYS_ID, 1); PARAM_DEFINE_INT32(MAV_COMP_ID, 50); -PARAM_DEFINE_INT32(MAV_TYPE, MAV_TYPE_QUADROTOR); +PARAM_DEFINE_INT32(MAV_TYPE, MAV_TYPE_FIXED_WING); __EXPORT int mavlink_main(int argc, char *argv[]); @@ -98,7 +98,7 @@ static bool mavlink_link_termination_allowed = false; mavlink_system_t mavlink_system = { 100, 50, - MAV_TYPE_QUADROTOR, + MAV_TYPE_FIXED_WING, 0, 0, 0 From 6d8983e908b40c1b74d5c937df559c580fc92e3c Mon Sep 17 00:00:00 2001 From: James Goppert Date: Sun, 13 Jan 2013 17:43:30 -0500 Subject: [PATCH 096/157] Fixed HIL state machine issue with reboot. --- apps/commander/state_machine_helper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/commander/state_machine_helper.c b/apps/commander/state_machine_helper.c index d4e88b1464..99e0f2d646 100644 --- a/apps/commander/state_machine_helper.c +++ b/apps/commander/state_machine_helper.c @@ -708,7 +708,9 @@ uint8_t update_state_machine_custom_mode_request(int status_pub, struct vehicle_ case SYSTEM_STATE_REBOOT: printf("try to reboot\n"); - if (current_system_state == SYSTEM_STATE_STANDBY || current_system_state == SYSTEM_STATE_PREFLIGHT) { + if (current_system_state == SYSTEM_STATE_STANDBY + || current_system_state == SYSTEM_STATE_PREFLIGHT + || current_status->flag_hil_enabled) { printf("system will reboot\n"); mavlink_log_critical(mavlink_fd, "Rebooting.."); usleep(200000); From ea3ce8de85ca8167ed66b1b5894f25c695c96796 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Sun, 13 Jan 2013 18:22:35 -0500 Subject: [PATCH 097/157] Reboot fix. --- apps/commander/state_machine_helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/commander/state_machine_helper.c b/apps/commander/state_machine_helper.c index 99e0f2d646..bea388a101 100644 --- a/apps/commander/state_machine_helper.c +++ b/apps/commander/state_machine_helper.c @@ -134,7 +134,8 @@ int do_state_update(int status_pub, struct vehicle_status_s *current_status, con case SYSTEM_STATE_REBOOT: if (current_status->state_machine == SYSTEM_STATE_STANDBY - || current_status->state_machine == SYSTEM_STATE_PREFLIGHT) { + || current_status->state_machine == SYSTEM_STATE_PREFLIGHT + || current_status->flag_hil_enabled) { invalid_state = false; /* set system flags according to state */ current_status->flag_system_armed = false; From 56e15ab1f42ce29ff0da429d85af4e07dabbb2ed Mon Sep 17 00:00:00 2001 From: James Goppert Date: Sun, 13 Jan 2013 18:38:09 -0500 Subject: [PATCH 098/157] Working on comments. --- apps/mathlib/math/Dcm.cpp | 30 +++++++++++++------------- apps/mathlib/math/EulerAngles.cpp | 26 +++++++++++------------ apps/mathlib/math/Quaternion.cpp | 34 +++++++++++++++--------------- apps/mavlink/mavlink_receiver.c | 5 ----- apps/uORB/topics/sensor_combined.h | 1 - 5 files changed, 45 insertions(+), 51 deletions(-) diff --git a/apps/mathlib/math/Dcm.cpp b/apps/mathlib/math/Dcm.cpp index 467c6f34ef..25f4913a60 100644 --- a/apps/mathlib/math/Dcm.cpp +++ b/apps/mathlib/math/Dcm.cpp @@ -138,25 +138,25 @@ int __EXPORT dcmTest() Matrix::identity(3))); // quaternion ctor ASSERT(matrixEqual( - Dcm(Quaternion(0.983347, 0.034271, 0.106021, 0.143572)), - Dcm( 0.9362934, -0.2750958, 0.2183507, - 0.2896295, 0.9564251, -0.0369570, - -0.1986693, 0.0978434, 0.9751703))); + Dcm(Quaternion(0.983347f, 0.034271f, 0.106021f, 0.143572f)), + Dcm( 0.9362934f, -0.2750958f, 0.2183507f, + 0.2896295f, 0.9564251f, -0.0369570f, + -0.1986693f, 0.0978434f, 0.9751703f))); // euler angle ctor ASSERT(matrixEqual( - Dcm(EulerAngles(0.1, 0.2, 0.3)), - Dcm( 0.9362934, -0.2750958, 0.2183507, - 0.2896295, 0.9564251, -0.0369570, - -0.1986693, 0.0978434, 0.9751703))); + Dcm(EulerAngles(0.1f, 0.2f, 0.3f)), + Dcm( 0.9362934f, -0.2750958f, 0.2183507f, + 0.2896295f, 0.9564251f, -0.0369570f, + -0.1986693f, 0.0978434f, 0.9751703f))); // rotations Vector3 vB(1, 2, 3); - ASSERT(vectorEqual(Vector3(-2, 1, 3), - Dcm(EulerAngles(0, 0, M_PI_2_F))*vB)); - ASSERT(vectorEqual(Vector3(3, 2, -1), - Dcm(EulerAngles(0, M_PI_2_F, 0))*vB)); - ASSERT(vectorEqual(Vector3(1, -3, 2), - Dcm(EulerAngles(M_PI_2_F, 0, 0))*vB)); - ASSERT(vectorEqual(Vector3(3, 2, -1), + ASSERT(vectorEqual(Vector3(-2.0f, 1.0f, 3.0f), + Dcm(EulerAngles(0.0f, 0.0f, M_PI_2_F))*vB)); + ASSERT(vectorEqual(Vector3(3.0f, 2.0f, -1.0f), + Dcm(EulerAngles(0.0f, M_PI_2_F, 0.0f))*vB)); + ASSERT(vectorEqual(Vector3(1.0f, -3.0f, 2.0f), + Dcm(EulerAngles(M_PI_2_F, 0.0f, 0.0f))*vB)); + ASSERT(vectorEqual(Vector3(3.0f, 2.0f, -1.0f), Dcm(EulerAngles( M_PI_2_F, M_PI_2_F, M_PI_2_F))*vB)); printf("PASS\n"); diff --git a/apps/mathlib/math/EulerAngles.cpp b/apps/mathlib/math/EulerAngles.cpp index 27ebbf8b3c..16864aec24 100644 --- a/apps/mathlib/math/EulerAngles.cpp +++ b/apps/mathlib/math/EulerAngles.cpp @@ -97,27 +97,27 @@ EulerAngles::~EulerAngles() int __EXPORT eulerAnglesTest() { printf("Test EulerAngles\t: "); - EulerAngles euler(0.1, 0.2, 0.3); + EulerAngles euler(0.1f, 0.2f, 0.3f); // test ctor - ASSERT(vectorEqual(Vector3(0.1, 0.2, 0.3), euler)); - ASSERT(equal(euler.getPhi(), 0.1)); - ASSERT(equal(euler.getTheta(), 0.2)); - ASSERT(equal(euler.getPsi(), 0.3)); + ASSERT(vectorEqual(Vector3(0.1f, 0.2f, 0.3f), euler)); + ASSERT(equal(euler.getPhi(), 0.1f)); + ASSERT(equal(euler.getTheta(), 0.2f)); + ASSERT(equal(euler.getPsi(), 0.3f)); // test dcm ctor - euler = Dcm(EulerAngles(0.1,0.2,0.3)); - ASSERT(vectorEqual(Vector3(0.1,0.2,0.3),euler)); + euler = Dcm(EulerAngles(0.1f, 0.2f, 0.3f)); + ASSERT(vectorEqual(Vector3(0.1f, 0.2f, 0.3f),euler)); // test quat ctor - euler = Quaternion(EulerAngles(0.1,0.2,0.3)); - ASSERT(vectorEqual(Vector3(0.1,0.2,0.3),euler)); + euler = Quaternion(EulerAngles(0.1f, 0.2f, 0.3f)); + ASSERT(vectorEqual(Vector3(0.1f, 0.2f, 0.3f),euler)); // test assignment - euler.setPhi(0.4); - euler.setTheta(0.5); - euler.setPsi(0.6); - ASSERT(vectorEqual(Vector3(0.4,0.5,0.6),euler)); + euler.setPhi(0.4f); + euler.setTheta(0.5f); + euler.setPsi(0.6f); + ASSERT(vectorEqual(Vector3(0.4f, 0.5f, 0.6f),euler)); printf("PASS\n"); return 0; diff --git a/apps/mathlib/math/Quaternion.cpp b/apps/mathlib/math/Quaternion.cpp index 4f07840c36..161b9d039a 100644 --- a/apps/mathlib/math/Quaternion.cpp +++ b/apps/mathlib/math/Quaternion.cpp @@ -144,29 +144,29 @@ int __EXPORT quaternionTest() printf("Test Quaternion\t\t: "); // test default ctor Quaternion q; - ASSERT(equal(q.getA(), 1)); - ASSERT(equal(q.getB(), 0)); - ASSERT(equal(q.getC(), 0)); - ASSERT(equal(q.getD(), 0)); + ASSERT(equal(q.getA(), 1.0f)); + ASSERT(equal(q.getB(), 0.0f)); + ASSERT(equal(q.getC(), 0.0f)); + ASSERT(equal(q.getD(), 0.0f)); // test float ctor - q = Quaternion(0.1825742, 0.3651484, 0.5477226, 0.7302967); - ASSERT(equal(q.getA(), 0.1825742)); - ASSERT(equal(q.getB(), 0.3651484)); - ASSERT(equal(q.getC(), 0.5477226)); - ASSERT(equal(q.getD(), 0.7302967)); + q = Quaternion(0.1825742f, 0.3651484f, 0.5477226f, 0.7302967f); + ASSERT(equal(q.getA(), 0.1825742f)); + ASSERT(equal(q.getB(), 0.3651484f)); + ASSERT(equal(q.getC(), 0.5477226f)); + ASSERT(equal(q.getD(), 0.7302967f)); // test euler ctor - q = Quaternion(EulerAngles(0.1, 0.2, 0.3)); - ASSERT(vectorEqual(q, Quaternion(0.983347, 0.034271, 0.106021, 0.143572))); + q = Quaternion(EulerAngles(0.1f, 0.2f, 0.3f)); + ASSERT(vectorEqual(q, Quaternion(0.983347f, 0.034271f, 0.106021f, 0.143572f))); // test dcm ctor q = Quaternion(Dcm()); - ASSERT(vectorEqual(q, Quaternion(1, 0, 0, 0))); + ASSERT(vectorEqual(q, Quaternion(1.0f, 0.0f, 0.0f, 0.0f))); // TODO test derivative // test accessors - q.setA(0.1); - q.setB(0.2); - q.setC(0.3); - q.setD(0.4); - ASSERT(vectorEqual(q, Quaternion(0.1, 0.2, 0.3, 0.4))); + q.setA(0.1f); + q.setB(0.2f); + q.setC(0.3f); + q.setD(0.4f); + ASSERT(vectorEqual(q, Quaternion(0.1f, 0.2f, 0.3f, 0.4f))); printf("PASS\n"); return 0; } diff --git a/apps/mavlink/mavlink_receiver.c b/apps/mavlink/mavlink_receiver.c index 0eb0b39d19..850b366a3b 100644 --- a/apps/mavlink/mavlink_receiver.c +++ b/apps/mavlink/mavlink_receiver.c @@ -346,11 +346,6 @@ handle_message(mavlink_message_t *msg) hil_sensors.adc_voltage_v[1] = 0; hil_sensors.adc_voltage_v[2] = 0; - /* battery */ - hil_sensors.battery_voltage_counter = hil_counter; - hil_sensors.battery_voltage_v = 11.1f; - hil_sensors.battery_voltage_valid = true; - /* magnetometer */ float mga2ga = 1.0e-3f; hil_sensors.magnetometer_counter = hil_counter; diff --git a/apps/uORB/topics/sensor_combined.h b/apps/uORB/topics/sensor_combined.h index fe84aab636..1d25af35a5 100644 --- a/apps/uORB/topics/sensor_combined.h +++ b/apps/uORB/topics/sensor_combined.h @@ -99,7 +99,6 @@ struct sensor_combined_s { float baro_pres_mbar; /**< Barometric pressure, already temp. comp. */ float baro_alt_meter; /**< Altitude, already temp. comp. */ float baro_temp_celcius; /**< Temperature in degrees celsius */ - float battery_voltage_v; /**< Battery voltage in volts, filtered */ float adc_voltage_v[4]; /**< ADC voltages of ADC Chan 10/11/12/13 or -1 */ float mcu_temp_celcius; /**< Internal temperature measurement of MCU */ uint32_t baro_counter; /**< Number of raw baro measurements taken */ From f7c31e4d804c81659dcf79684807fbc8bfad5365 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Sun, 13 Jan 2013 18:41:03 -0500 Subject: [PATCH 099/157] Reduced stack size for mavlink receiver. --- apps/mavlink/mavlink_receiver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/mavlink/mavlink_receiver.c b/apps/mavlink/mavlink_receiver.c index 850b366a3b..e686790f30 100644 --- a/apps/mavlink/mavlink_receiver.c +++ b/apps/mavlink/mavlink_receiver.c @@ -617,7 +617,7 @@ receive_start(int uart) param.sched_priority = SCHED_PRIORITY_MAX - 40; (void)pthread_attr_setschedparam(&receiveloop_attr, ¶m); - pthread_attr_setstacksize(&receiveloop_attr, 4096); + pthread_attr_setstacksize(&receiveloop_attr, 3072); pthread_t thread; pthread_create(&thread, &receiveloop_attr, receive_thread, &uart); From 5ad8e645f40a4e6dabb810e3f2cca2603c989cda Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Mon, 14 Jan 2013 00:42:20 +0100 Subject: [PATCH 100/157] Removed last bogus references to battery voltage from sensor combined topic --- apps/commander/commander.c | 5 +---- apps/sensors/sensors.cpp | 1 - apps/uORB/topics/sensor_combined.h | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/apps/commander/commander.c b/apps/commander/commander.c index 86f5ac106d..f3568ee8d0 100644 --- a/apps/commander/commander.c +++ b/apps/commander/commander.c @@ -1321,7 +1321,7 @@ int commander_thread_main(int argc, char *argv[]) /* Initialize to 0.0V */ float battery_voltage = 0.0f; - bool battery_voltage_valid = true; + bool battery_voltage_valid = false; bool low_battery_voltage_actions_done = false; bool critical_battery_voltage_actions_done = false; uint8_t low_voltage_counter = 0; @@ -1411,9 +1411,6 @@ int commander_thread_main(int argc, char *argv[]) if (new_data) { orb_copy(ORB_ID(sensor_combined), sensor_sub, &sensors); - - } else { - sensors.battery_voltage_valid = false; } orb_check(cmd_sub, &new_data); diff --git a/apps/sensors/sensors.cpp b/apps/sensors/sensors.cpp index c0f802e67c..2697cf3d94 100644 --- a/apps/sensors/sensors.cpp +++ b/apps/sensors/sensors.cpp @@ -1014,7 +1014,6 @@ Sensors::adc_poll(struct sensor_combined_s &raw) } } - raw.battery_voltage_counter++; _last_adc = hrt_absolute_time(); break; } diff --git a/apps/uORB/topics/sensor_combined.h b/apps/uORB/topics/sensor_combined.h index 1d25af35a5..961ee8b4a6 100644 --- a/apps/uORB/topics/sensor_combined.h +++ b/apps/uORB/topics/sensor_combined.h @@ -102,8 +102,6 @@ struct sensor_combined_s { float adc_voltage_v[4]; /**< ADC voltages of ADC Chan 10/11/12/13 or -1 */ float mcu_temp_celcius; /**< Internal temperature measurement of MCU */ uint32_t baro_counter; /**< Number of raw baro measurements taken */ - uint32_t battery_voltage_counter; /**< Number of voltage measurements taken */ - bool battery_voltage_valid; /**< True if battery voltage can be measured */ }; From e3d0e0216bfa97ecf502b37e76465a1bef02e888 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Sun, 13 Jan 2013 19:05:58 -0500 Subject: [PATCH 101/157] Fixed comment. --- apps/examples/kalman_demo/KalmanNav.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 742bfc9c13..1ddc9518ee 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -46,7 +46,7 @@ static const float omega = 7.2921150e-5f; // earth rotation rate, rad/s static const float R0 = 6378137.0f; // earth radius, m -static const float RSq = 4.0680631591e+13; // radius squared +static const float RSq = 4.0680631591e+13; // earth radius squared static const float g = 9.806f; // gravitational accel. m/s^2, XXX should be calibrated KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : From 69f6fe51bc26a49d136f2a6786f440ad7a3f4931 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Sun, 13 Jan 2013 19:08:27 -0500 Subject: [PATCH 102/157] More fixes. --- apps/mavlink/mavlink_receiver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/mavlink/mavlink_receiver.c b/apps/mavlink/mavlink_receiver.c index e686790f30..ae81dc9f98 100644 --- a/apps/mavlink/mavlink_receiver.c +++ b/apps/mavlink/mavlink_receiver.c @@ -571,7 +571,7 @@ receive_thread(void *arg) int uart_fd = *((int *)arg); const int timeout = 1000; - uint8_t buf[512]; + uint8_t buf[32]; mavlink_message_t msg; @@ -617,7 +617,7 @@ receive_start(int uart) param.sched_priority = SCHED_PRIORITY_MAX - 40; (void)pthread_attr_setschedparam(&receiveloop_attr, ¶m); - pthread_attr_setstacksize(&receiveloop_attr, 3072); + pthread_attr_setstacksize(&receiveloop_attr, 2048); pthread_t thread; pthread_create(&thread, &receiveloop_attr, receive_thread, &uart); From e02791ee8e56cbe913751cbb279cb66ab5919202 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Sun, 13 Jan 2013 19:21:40 -0500 Subject: [PATCH 103/157] Added assertion, fixed formatting. --- apps/mavlink/mavlink_receiver.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/apps/mavlink/mavlink_receiver.c b/apps/mavlink/mavlink_receiver.c index ae81dc9f98..fa63c419f0 100644 --- a/apps/mavlink/mavlink_receiver.c +++ b/apps/mavlink/mavlink_receiver.c @@ -387,22 +387,22 @@ handle_message(mavlink_message_t *msg) /* gps */ hil_gps.timestamp = gps.time_usec; hil_gps.counter = hil_counter++; - hil_gps.time_gps_usec = gps.time_usec; + hil_gps.time_gps_usec = gps.time_usec; hil_gps.lat = gps.lat; hil_gps.lon = gps.lon; hil_gps.alt = gps.alt; - hil_gps.counter_pos_valid = hil_counter++; - hil_gps.eph = gps.eph; - hil_gps.epv = gps.epv; - hil_gps.s_variance = 100; - hil_gps.p_variance = 100; - hil_gps.vel = gps.vel; + hil_gps.counter_pos_valid = hil_counter++; + hil_gps.eph = gps.eph; + hil_gps.epv = gps.epv; + hil_gps.s_variance = 100; + hil_gps.p_variance = 100; + hil_gps.vel = gps.vel; hil_gps.vel_n = gps.vel / 100.0f * cosf(gps.cog / M_RAD_TO_DEG_F / 100.0f); hil_gps.vel_e = gps.vel / 100.0f * sinf(gps.cog / M_RAD_TO_DEG_F / 100.0f); hil_gps.vel_d = 0.0f; - hil_gps.cog = gps.cog; + hil_gps.cog = gps.cog; hil_gps.fix_type = gps.fix_type; - hil_gps.satellites_visible = gps.satellites_visible; + hil_gps.satellites_visible = gps.satellites_visible; /* publish */ orb_publish(ORB_ID(vehicle_gps_position), pub_hil_gps, &hil_gps); @@ -439,8 +439,8 @@ handle_message(mavlink_message_t *msg) static const float g = 9.806f; float tempC = press.temperature / 100.0f; - float tempAvgK = T0 + (tempC + ground_tempC)/2.0f; - float h = ground_alt + (R/g)*tempAvgK*logf(ground_press / press.press_abs); + float tempAvgK = T0 + (tempC + ground_tempC) / 2.0f; + float h = ground_alt + (R / g) * tempAvgK * logf(ground_press / press.press_abs); hil_sensors.baro_counter = hil_counter; hil_sensors.baro_pres_mbar = press.press_abs; hil_sensors.baro_alt_meter = h; @@ -584,6 +584,7 @@ receive_thread(void *arg) if (poll(fds, 1, timeout) > 0) { /* non-blocking read */ size_t nread = read(uart_fd, buf, sizeof(buf)); + ASSERT(nread > 0) for (size_t i = 0; i < nread; i++) { if (mavlink_parse_char(chan, buf[i], &msg, &status)) { //parse the char From 0ccdbd78f69444c3084b927f3e6fd2fe80549d28 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Sun, 13 Jan 2013 19:23:59 -0500 Subject: [PATCH 104/157] More formatting. --- apps/mathlib/math/Dcm.cpp | 38 +++++++++++++++---------------- apps/mathlib/math/Dcm.hpp | 4 ++-- apps/mathlib/math/EulerAngles.cpp | 6 ++--- apps/mathlib/math/Quaternion.cpp | 8 +++---- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/apps/mathlib/math/Dcm.cpp b/apps/mathlib/math/Dcm.cpp index 25f4913a60..df0f09b205 100644 --- a/apps/mathlib/math/Dcm.cpp +++ b/apps/mathlib/math/Dcm.cpp @@ -53,20 +53,20 @@ Dcm::Dcm() : } Dcm::Dcm(float c00, float c01, float c02, - float c10, float c11, float c12, - float c20, float c21, float c22) : + float c10, float c11, float c12, + float c20, float c21, float c22) : Matrix(3, 3) { Dcm &dcm = *this; - dcm(0,0) = c00; - dcm(0,1) = c01; - dcm(0,2) = c02; - dcm(1,0) = c10; - dcm(1,1) = c11; - dcm(1,2) = c12; - dcm(2,0) = c20; - dcm(2,1) = c21; - dcm(2,2) = c22; + dcm(0, 0) = c00; + dcm(0, 1) = c01; + dcm(0, 2) = c02; + dcm(1, 0) = c10; + dcm(1, 1) = c11; + dcm(1, 2) = c12; + dcm(2, 0) = c20; + dcm(2, 1) = c21; + dcm(2, 2) = c22; } Dcm::Dcm(const float *data) : @@ -138,16 +138,16 @@ int __EXPORT dcmTest() Matrix::identity(3))); // quaternion ctor ASSERT(matrixEqual( - Dcm(Quaternion(0.983347f, 0.034271f, 0.106021f, 0.143572f)), - Dcm( 0.9362934f, -0.2750958f, 0.2183507f, - 0.2896295f, 0.9564251f, -0.0369570f, - -0.1986693f, 0.0978434f, 0.9751703f))); + Dcm(Quaternion(0.983347f, 0.034271f, 0.106021f, 0.143572f)), + Dcm(0.9362934f, -0.2750958f, 0.2183507f, + 0.2896295f, 0.9564251f, -0.0369570f, + -0.1986693f, 0.0978434f, 0.9751703f))); // euler angle ctor ASSERT(matrixEqual( - Dcm(EulerAngles(0.1f, 0.2f, 0.3f)), - Dcm( 0.9362934f, -0.2750958f, 0.2183507f, - 0.2896295f, 0.9564251f, -0.0369570f, - -0.1986693f, 0.0978434f, 0.9751703f))); + Dcm(EulerAngles(0.1f, 0.2f, 0.3f)), + Dcm(0.9362934f, -0.2750958f, 0.2183507f, + 0.2896295f, 0.9564251f, -0.0369570f, + -0.1986693f, 0.0978434f, 0.9751703f))); // rotations Vector3 vB(1, 2, 3); ASSERT(vectorEqual(Vector3(-2.0f, 1.0f, 3.0f), diff --git a/apps/mathlib/math/Dcm.hpp b/apps/mathlib/math/Dcm.hpp index 781933e9e5..28d840b100 100644 --- a/apps/mathlib/math/Dcm.hpp +++ b/apps/mathlib/math/Dcm.hpp @@ -68,8 +68,8 @@ public: * scalar ctor */ Dcm(float c00, float c01, float c02, - float c10, float c11, float c12, - float c20, float c21, float c22); + float c10, float c11, float c12, + float c20, float c21, float c22); /** * data ctor diff --git a/apps/mathlib/math/EulerAngles.cpp b/apps/mathlib/math/EulerAngles.cpp index 16864aec24..2e96fef4cb 100644 --- a/apps/mathlib/math/EulerAngles.cpp +++ b/apps/mathlib/math/EulerAngles.cpp @@ -107,17 +107,17 @@ int __EXPORT eulerAnglesTest() // test dcm ctor euler = Dcm(EulerAngles(0.1f, 0.2f, 0.3f)); - ASSERT(vectorEqual(Vector3(0.1f, 0.2f, 0.3f),euler)); + ASSERT(vectorEqual(Vector3(0.1f, 0.2f, 0.3f), euler)); // test quat ctor euler = Quaternion(EulerAngles(0.1f, 0.2f, 0.3f)); - ASSERT(vectorEqual(Vector3(0.1f, 0.2f, 0.3f),euler)); + ASSERT(vectorEqual(Vector3(0.1f, 0.2f, 0.3f), euler)); // test assignment euler.setPhi(0.4f); euler.setTheta(0.5f); euler.setPsi(0.6f); - ASSERT(vectorEqual(Vector3(0.4f, 0.5f, 0.6f),euler)); + ASSERT(vectorEqual(Vector3(0.4f, 0.5f, 0.6f), euler)); printf("PASS\n"); return 0; diff --git a/apps/mathlib/math/Quaternion.cpp b/apps/mathlib/math/Quaternion.cpp index 161b9d039a..78481b2868 100644 --- a/apps/mathlib/math/Quaternion.cpp +++ b/apps/mathlib/math/Quaternion.cpp @@ -82,13 +82,13 @@ Quaternion::Quaternion(const Dcm &dcm) : // avoiding singularities by not using // division equations setA(0.5 * sqrt(1.0 + - double( dcm(0, 0) + dcm(1, 1) + dcm(2, 2)))); + double(dcm(0, 0) + dcm(1, 1) + dcm(2, 2)))); setB(0.5 * sqrt(1.0 + - double( dcm(0, 0) - dcm(1, 1) - dcm(2, 2)))); + double(dcm(0, 0) - dcm(1, 1) - dcm(2, 2)))); setC(0.5 * sqrt(1.0 + - double(-dcm(0, 0) + dcm(1, 1) - dcm(2, 2)))); + double(-dcm(0, 0) + dcm(1, 1) - dcm(2, 2)))); setD(0.5 * sqrt(1.0 + - double(-dcm(0, 0) - dcm(1, 1) + dcm(2, 2)))); + double(-dcm(0, 0) - dcm(1, 1) + dcm(2, 2)))); } Quaternion::Quaternion(const EulerAngles &euler) : From 63e6ea1b9505fef13b4a45f1048f727d997d27cf Mon Sep 17 00:00:00 2001 From: James Goppert Date: Sun, 13 Jan 2013 19:51:40 -0500 Subject: [PATCH 105/157] Changed fault tolerances. --- apps/examples/kalman_demo/KalmanNav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 1ddc9518ee..240564b568 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -579,7 +579,7 @@ void KalmanNav::correctAtt() // fault detection float beta = y.dot(S.inverse() * y); - if (beta > 10.0f) { + if (beta > 1000.0f) { printf("fault in attitude: beta = %8.4f\n", (double)beta); //printf("y:\n"); y.print(); } @@ -652,7 +652,7 @@ void KalmanNav::correctPos() // fault detetcion float beta = y.dot(S.inverse() * y); - if (beta > 10.0f) { + if (beta > 1000.0f) { printf("fault in gps: beta = %8.4f\n", (double)beta); //printf("y:\n"); y.print(); } From 5745cfae385e5a7fe7948977ea90facb9360c2c7 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Sun, 13 Jan 2013 21:12:24 -0500 Subject: [PATCH 106/157] Tracking down gps ekf bug, not enough precision for GPS in rad. --- apps/examples/kalman_demo/KalmanNav.cpp | 42 +++++++++++++++++++------ 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 240564b568..18bca6d955 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -316,7 +316,11 @@ void KalmanNav::predictFast(float dt) float cosL = cosf(lat); float cosLSing = cosf(lat); - if (fabsf(cosLSing) < 0.01f) cosLSing = 0.01f; + // prevent singularity + if (fabsf(cosLSing) < 0.01f) { + if (cosLSing > 0) cosLSing = 0.01; + else cosLSing = -0.01; + } // position update // neglects angular deflections in local gravity @@ -577,11 +581,11 @@ void KalmanNav::correctAtt() P = P - K * HAtt * P; // fault detection - float beta = y.dot(S.inverse() * y); + float beta = y.dot((S*S.transpose()).inverse() * y); - if (beta > 1000.0f) { + if (beta > 1.0f) { printf("fault in attitude: beta = %8.4f\n", (double)beta); - //printf("y:\n"); y.print(); + printf("y:\n"); y.print(); } // update quaternions from euler @@ -592,7 +596,7 @@ void KalmanNav::correctAtt() void KalmanNav::correctPos() { using namespace math; - Vector y(6); + Vector y(5); y(0) = _gps.vel_n - vN; y(1) = _gps.vel_e - vE; y(2) = double(_gps.lat) / 1.0e7 / M_RAD_TO_DEG - lat; @@ -604,7 +608,10 @@ void KalmanNav::correctPos() float R = R0 + float(alt); // prevent singularity - if (fabsf(cosLSing) < 0.01f) cosLSing = 0.01f; + if (fabsf(cosLSing) < 0.01f) { + if (cosLSing > 0) cosLSing = 0.01; + else cosLSing = -0.01; + } float noiseLat = _rGpsPos.get() / R; float noiseLon = _rGpsPos.get() / (R * cosLSing); @@ -650,11 +657,23 @@ void KalmanNav::correctPos() P = P - K * HPos * P; // fault detetcion - float beta = y.dot(S.inverse() * y); + float beta = y.dot((S*S.transpose()).inverse() * y); - if (beta > 1000.0f) { + if (beta > 1.0f) { printf("fault in gps: beta = %8.4f\n", (double)beta); - //printf("y:\n"); y.print(); + printf("y:\n"); y.print(); + printf("R:\n"); RPos.print(); + printf("S:\n"); S.print(); + printf("S*S^T:\n"); (S*S.transpose()).print(); + printf("(S*S^T)^-1:\n"); ((S*S.transpose()).inverse()).print(); + printf("(S*S^T)^-1*y:\n"); ((S*S.transpose()).inverse()*y).print(); + printf("gps: vN: %8.5f, vE: %8.4f, vD: %8.4f, lat: %15.10f, lon: %15.10f, alt: %15.2f\n", + double(_gps.vel_n), double(_gps.vel_e), double(_gps.vel_d), + double(_gps.lat)/ 1.0e7 / M_RAD_TO_DEG, + double(_gps.lon)/ 1.0e7 / M_RAD_TO_DEG, + double(_gps.alt)/ 1.0e3); + printf("x : vN: %8.5f, vE: %8.4f, vD: %8.4f, lat: %15.10f, lon: %15.10f, alt: %15.2f\n", + double(vN), double(vE), double(vD), lat, lon, alt); } } @@ -692,7 +711,10 @@ void KalmanNav::updateParams() float R = R0 + float(alt); // prevent singularity - if (fabsf(cosLSing) < 0.01f) cosLSing = 0.01f; + if (fabsf(cosLSing) < 0.01f) { + if (cosLSing > 0) cosLSing = 0.01; + else cosLSing = -0.01; + } float noiseVel = _rGpsVel.get(); float noiseLat = _rGpsPos.get() / R; From 3db216380bed13fd25c21e49a1fbd66680968937 Mon Sep 17 00:00:00 2001 From: jgoppert Date: Mon, 14 Jan 2013 01:09:02 -0500 Subject: [PATCH 107/157] Changing measurement units for gps, not working well yet. --- apps/examples/kalman_demo/KalmanNav.cpp | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 18bca6d955..788cb5a716 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -141,8 +141,8 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : // HPos is constant HPos(0, 3) = 1.0f; HPos(1, 4) = 1.0f; - HPos(2, 6) = 1.0f; - HPos(3, 7) = 1.0f; + HPos(2, 6) = 1.0e7f * M_RAD_TO_DEG_F; + HPos(3, 7) = 1.0e7f * M_RAD_TO_DEG_F; HPos(4, 8) = 1.0f; // initialize all parameters @@ -599,9 +599,9 @@ void KalmanNav::correctPos() Vector y(5); y(0) = _gps.vel_n - vN; y(1) = _gps.vel_e - vE; - y(2) = double(_gps.lat) / 1.0e7 / M_RAD_TO_DEG - lat; - y(3) = double(_gps.lon) / 1.0e7 / M_RAD_TO_DEG - lon; - y(4) = double(_gps.alt) / 1.0e3 - alt; + y(2) = double(_gps.lat) - lat * 1.0e7 * M_RAD_TO_DEG; + y(3) = double(_gps.lon) - lon * 1.0e7 * M_RAD_TO_DEG; + y(4) = double(_gps.alt)/1.0e3 - alt; // update gps noise float cosLSing = cosf(lat); @@ -613,10 +613,10 @@ void KalmanNav::correctPos() else cosLSing = -0.01; } - float noiseLat = _rGpsPos.get() / R; - float noiseLon = _rGpsPos.get() / (R * cosLSing); - RPos(2, 2) = noiseLat * noiseLat; - RPos(3, 3) = noiseLon * noiseLon; + float noiseLatDegE7 = 1.0e7f * M_RAD_TO_DEG * _rGpsPos.get() / R; + float noiseLonDegE7 = noiseLatDegE7 / cosLSing; + RPos(2, 2) = noiseLatDegE7 * noiseLatDegE7; + RPos(3, 3) = noiseLonDegE7 * noiseLonDegE7; // compute correction // http://en.wikipedia.org/wiki/Extended_Kalman_filter @@ -717,12 +717,12 @@ void KalmanNav::updateParams() } float noiseVel = _rGpsVel.get(); - float noiseLat = _rGpsPos.get() / R; - float noiseLon = _rGpsPos.get() / (R * cosLSing); + float noiseLatDegE7 = 1.0e7f * M_RAD_TO_DEG * _rGpsPos.get() / R; + float noiseLonDegE7 = noiseLatDegE7 / cosLSing; float noiseAlt = _rGpsAlt.get(); RPos(0, 0) = noiseVel * noiseVel; // vn RPos(1, 1) = noiseVel * noiseVel; // ve - RPos(2, 2) = noiseLat * noiseLat; // lat - RPos(3, 3) = noiseLon * noiseLon; // lon + RPos(2, 2) = noiseLatDegE7 * noiseLatDegE7; // lat + RPos(3, 3) = noiseLonDegE7 * noiseLonDegE7; // lon RPos(4, 4) = noiseAlt * noiseAlt; // h } From f2d2aafb8d340bdad7e75e9df27b8fd002da1344 Mon Sep 17 00:00:00 2001 From: jgoppert Date: Mon, 14 Jan 2013 01:32:34 -0500 Subject: [PATCH 108/157] Fault detection working, but GPS velocity measurement causing fault. Possible error in HIL script or progpagation/ F matrix of EKF. --- apps/examples/kalman_demo/KalmanNav.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 788cb5a716..c3093fe7f5 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -613,7 +613,7 @@ void KalmanNav::correctPos() else cosLSing = -0.01; } - float noiseLatDegE7 = 1.0e7f * M_RAD_TO_DEG * _rGpsPos.get() / R; + float noiseLatDegE7 = 1.0e7f * M_RAD_TO_DEG_F * _rGpsPos.get() / R; float noiseLonDegE7 = noiseLatDegE7 / cosLSing; RPos(2, 2) = noiseLatDegE7 * noiseLatDegE7; RPos(3, 3) = noiseLonDegE7 * noiseLonDegE7; @@ -662,11 +662,11 @@ void KalmanNav::correctPos() if (beta > 1.0f) { printf("fault in gps: beta = %8.4f\n", (double)beta); printf("y:\n"); y.print(); - printf("R:\n"); RPos.print(); - printf("S:\n"); S.print(); - printf("S*S^T:\n"); (S*S.transpose()).print(); - printf("(S*S^T)^-1:\n"); ((S*S.transpose()).inverse()).print(); - printf("(S*S^T)^-1*y:\n"); ((S*S.transpose()).inverse()*y).print(); + //printf("R:\n"); RPos.print(); + //printf("S:\n"); S.print(); + //printf("S*S^T:\n"); (S*S.transpose()).print(); + //printf("(S*S^T)^-1:\n"); ((S*S.transpose()).inverse()).print(); + //printf("(S*S^T)^-1*y:\n"); ((S*S.transpose()).inverse()*y).print(); printf("gps: vN: %8.5f, vE: %8.4f, vD: %8.4f, lat: %15.10f, lon: %15.10f, alt: %15.2f\n", double(_gps.vel_n), double(_gps.vel_e), double(_gps.vel_d), double(_gps.lat)/ 1.0e7 / M_RAD_TO_DEG, @@ -717,7 +717,7 @@ void KalmanNav::updateParams() } float noiseVel = _rGpsVel.get(); - float noiseLatDegE7 = 1.0e7f * M_RAD_TO_DEG * _rGpsPos.get() / R; + float noiseLatDegE7 = 1.0e7f * M_RAD_TO_DEG_F * _rGpsPos.get() / R; float noiseLonDegE7 = noiseLatDegE7 / cosLSing; float noiseAlt = _rGpsAlt.get(); RPos(0, 0) = noiseVel * noiseVel; // vn From 8bc233846633cc0922900376f5225be6365b4293 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Mon, 14 Jan 2013 09:18:17 -0800 Subject: [PATCH 109/157] Adapted upper and lower values for test jig voltages --- apps/px4/tests/test_jig_voltages.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/px4/tests/test_jig_voltages.c b/apps/px4/tests/test_jig_voltages.c index ca6d7fb688..10c93b2649 100644 --- a/apps/px4/tests/test_jig_voltages.c +++ b/apps/px4/tests/test_jig_voltages.c @@ -120,8 +120,8 @@ int test_jig_voltages(int argc, char *argv[]) warnx("\t ADC operational.\n"); /* Expected values */ - int16_t expected_min[] = {2700, 2700, 2200, 2000}; - int16_t expected_max[] = {3000, 3000, 2500, 2200}; + int16_t expected_min[] = {2800, 2800, 1800, 800}; + int16_t expected_max[] = {3100, 3100, 2100, 1100}; char *check_res[channels]; if (channels < 4) { From 09535fef83918eff9ff7a8e77ad5a1aea6bf3c82 Mon Sep 17 00:00:00 2001 From: px4dev Date: Mon, 14 Jan 2013 09:34:33 -0800 Subject: [PATCH 110/157] Start adding PX4 firmware helper macros --- Debug/PX4 | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Debug/PX4 diff --git a/Debug/PX4 b/Debug/PX4 new file mode 100644 index 0000000000..7d59059398 --- /dev/null +++ b/Debug/PX4 @@ -0,0 +1,54 @@ +# +# Various PX4-specific macros +# +source Debug/NuttX + +echo Loading PX4 GDB macros. Use 'help px4' for more information.\n + +define px4 + echo Use 'help px4' for more information.\n +end + +document px4 +. Various macros for working with the PX4 firmware. +. +. perf +. Prints the state of all performance counters. +. +. Use 'help ' for more specific help. +end + + +define _perf_print + set $hdr = (struct perf_ctr_header *)$arg0 + printf "%p\n", $hdr + printf "%s: ", $hdr->name + # PC_COUNT + if $hdr->type == 0 + set $count = (struct perf_ctr_count *)$hdr + printf "%llu events,\n", $count->event_count; + end + # PC_ELPASED + if $hdr->type == 1 + set $elapsed = (struct perf_ctr_elapsed *)$hdr + printf "%llu events, %lluus elapsed, min %lluus, max %lluus\n", $elapsed->event_count, $elapsed->time_total, $elapsed->time_least, $elapsed->time_most + end + # PC_INTERVAL + if $hdr->type == 2 + set $interval = (struct perf_ctr_interval *)$hdr + printf "%llu events, %llu avg, min %lluus max %lluus\n", $interval->event_count, ($interval->time_last - $interval->time_first) / $interval->event_count, $interval->time_least, $interval->time_most + end +end + +define perf + set $ctr = (sq_entry_t *)(perf_counters.head) + while $ctr != 0 + _perf_print $ctr + set $ctr = $ctr->flink + end +end + +document perf +. perf +. Prints performance counters. +end From c38ad4ded570eddadeeca3579d02dfc63dcc8a9d Mon Sep 17 00:00:00 2001 From: px4dev Date: Mon, 14 Jan 2013 10:08:47 -0800 Subject: [PATCH 111/157] Fix the 'time' test, now that rand() seems to be working. --- apps/px4/tests/test_time.c | 8 ++--- apps/px4/tests/tests_main.c | 66 ++++++++++++++++++++----------------- 2 files changed, 39 insertions(+), 35 deletions(-) diff --git a/apps/px4/tests/test_time.c b/apps/px4/tests/test_time.c index 25bf02c311..8a164f3fc2 100644 --- a/apps/px4/tests/test_time.c +++ b/apps/px4/tests/test_time.c @@ -95,7 +95,7 @@ cycletime(void) lasttime = cycles; - return (basetime + cycles) / 168; + return (basetime + cycles) / 168; /* XXX magic number */ } /**************************************************************************** @@ -133,9 +133,9 @@ int test_time(int argc, char *argv[]) lowdelta = abs(delta / 100); /* loop checking the time */ - for (unsigned i = 0; i < 100000; i++) { + for (unsigned i = 0; i < 100; i++) { - usleep(rand() * 10); + usleep(rand()); uint32_t flags = irqsave(); @@ -154,7 +154,7 @@ int test_time(int argc, char *argv[]) fprintf(stderr, "h %llu c %llu d %lld\n", h, c, delta - lowdelta); } - printf("Maximum jitter %lld\n", maxdelta); + printf("Maximum jitter %lldus\n", maxdelta); return 0; } diff --git a/apps/px4/tests/tests_main.c b/apps/px4/tests/tests_main.c index d994645466..5bedd257b5 100644 --- a/apps/px4/tests/tests_main.c +++ b/apps/px4/tests/tests_main.c @@ -82,38 +82,39 @@ const struct { const char *name; int (* fn)(int argc, char *argv[]); unsigned options; - int passed; #define OPT_NOHELP (1<<0) #define OPT_NOALLTEST (1<<1) #define OPT_NOJIGTEST (1<<2) } tests[] = { - {"led", test_led, 0, 0}, - {"int", test_int, 0, 0}, - {"float", test_float, 0, 0}, - {"sensors", test_sensors, 0, 0}, - {"gpio", test_gpio, OPT_NOJIGTEST | OPT_NOALLTEST, 0}, - {"hrt", test_hrt, OPT_NOJIGTEST | OPT_NOALLTEST, 0}, - {"ppm", test_ppm, OPT_NOJIGTEST | OPT_NOALLTEST, 0}, - {"servo", test_servo, OPT_NOJIGTEST | OPT_NOALLTEST, 0}, - {"adc", test_adc, OPT_NOJIGTEST, 0}, - {"jig_voltages", test_jig_voltages, OPT_NOALLTEST, 0}, - {"uart_loopback", test_uart_loopback, OPT_NOJIGTEST | OPT_NOALLTEST, 0}, - {"uart_baudchange", test_uart_baudchange, OPT_NOJIGTEST | OPT_NOALLTEST, 0}, - {"uart_send", test_uart_send, OPT_NOJIGTEST | OPT_NOALLTEST, 0}, - {"uart_console", test_uart_console, OPT_NOJIGTEST | OPT_NOALLTEST, 0}, - {"tone", test_tone, 0, 0}, - {"sleep", test_sleep, OPT_NOJIGTEST, 0}, - {"time", test_time, OPT_NOJIGTEST, 0}, - {"perf", test_perf, OPT_NOJIGTEST, 0}, - {"all", test_all, OPT_NOALLTEST | OPT_NOJIGTEST, 0}, - {"jig", test_jig, OPT_NOJIGTEST | OPT_NOALLTEST, 0}, - {"param", test_param, 0, 0}, - {"bson", test_bson, 0, 0}, - {"file", test_file, 0, 0}, - {"help", test_help, OPT_NOALLTEST | OPT_NOHELP | OPT_NOJIGTEST, 0}, - {NULL, NULL, 0, 0} + {"led", test_led, 0}, + {"int", test_int, 0}, + {"float", test_float, 0}, + {"sensors", test_sensors, 0}, + {"gpio", test_gpio, OPT_NOJIGTEST | OPT_NOALLTEST}, + {"hrt", test_hrt, OPT_NOJIGTEST | OPT_NOALLTEST}, + {"ppm", test_ppm, OPT_NOJIGTEST | OPT_NOALLTEST}, + {"servo", test_servo, OPT_NOJIGTEST | OPT_NOALLTEST}, + {"adc", test_adc, OPT_NOJIGTEST}, + {"jig_voltages", test_jig_voltages, OPT_NOALLTEST}, + {"uart_loopback", test_uart_loopback, OPT_NOJIGTEST | OPT_NOALLTEST}, + {"uart_baudchange", test_uart_baudchange, OPT_NOJIGTEST | OPT_NOALLTEST}, + {"uart_send", test_uart_send, OPT_NOJIGTEST | OPT_NOALLTEST}, + {"uart_console", test_uart_console, OPT_NOJIGTEST | OPT_NOALLTEST}, + {"tone", test_tone, 0}, + {"sleep", test_sleep, OPT_NOJIGTEST}, + {"time", test_time, OPT_NOJIGTEST}, + {"perf", test_perf, OPT_NOJIGTEST}, + {"all", test_all, OPT_NOALLTEST | OPT_NOJIGTEST}, + {"jig", test_jig, OPT_NOJIGTEST | OPT_NOALLTEST}, + {"param", test_param, 0}, + {"bson", test_bson, 0}, + {"file", test_file, 0}, + {"help", test_help, OPT_NOALLTEST | OPT_NOHELP | OPT_NOJIGTEST}, + {NULL, NULL, 0} }; +#define NTESTS (sizeof(tests) / sizeof(tests[0])) + static int test_help(int argc, char *argv[]) { @@ -133,6 +134,7 @@ test_all(int argc, char *argv[]) unsigned i; char *args[2] = {"all", NULL}; unsigned int failcount = 0; + bool passed[NTESTS]; printf("\nRunning all tests...\n\n"); @@ -147,11 +149,11 @@ test_all(int argc, char *argv[]) fprintf(stderr, " [%s] \t\t\tFAIL\n", tests[i].name); fflush(stderr); failcount++; - + passed[i] = false; } else { - tests[i].passed = 1; printf(" [%s] \t\t\tPASS\n", tests[i].name); fflush(stdout); + passed[i] = true; } } } @@ -195,7 +197,7 @@ test_all(int argc, char *argv[]) unsigned int k; for (k = 0; k < i; k++) { - if ((tests[k].passed == 0) && !(tests[k].options & OPT_NOALLTEST)) { + if (!passed[k] && !(tests[k].options & OPT_NOALLTEST)) { printf(" [%s] to obtain details, please re-run with\n\t nsh> tests %s\n\n", tests[k].name, tests[k].name); } } @@ -242,6 +244,7 @@ int test_jig(int argc, char *argv[]) unsigned i; char *args[2] = {"jig", NULL}; unsigned int failcount = 0; + bool passed[NTESTS]; printf("\nRunning all tests...\n\n"); for (i = 0; tests[i].name; i++) { @@ -254,10 +257,11 @@ int test_jig(int argc, char *argv[]) fprintf(stderr, " [%s] \t\t\tFAIL\n", tests[i].name); fflush(stderr); failcount++; + passed[i] = false; } else { - tests[i].passed = 1; printf(" [%s] \t\t\tPASS\n", tests[i].name); fflush(stdout); + passed[i] = true; } } } @@ -296,7 +300,7 @@ int test_jig(int argc, char *argv[]) unsigned int k; for (k = 0; k < i; k++) { - if ((tests[k].passed == 0) && !(tests[k].options & OPT_NOJIGTEST)) + if (!passed[i] && !(tests[k].options & OPT_NOJIGTEST)) { printf(" [%s] to obtain details, please re-run with\n\t nsh> tests %s\n\n", tests[k].name, tests[k].name); } From a13cf90e0ac89527830b6426e70913d67ec093b2 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Mon, 14 Jan 2013 13:12:01 -0500 Subject: [PATCH 112/157] Increased KF process noise. --- apps/examples/kalman_demo/KalmanNav.cpp | 21 ++++++--------------- apps/examples/kalman_demo/params.c | 4 ++-- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index c3093fe7f5..d28cba42c9 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -583,7 +583,7 @@ void KalmanNav::correctAtt() // fault detection float beta = y.dot((S*S.transpose()).inverse() * y); - if (beta > 1.0f) { + if (beta > 10.0f) { printf("fault in attitude: beta = %8.4f\n", (double)beta); printf("y:\n"); y.print(); } @@ -613,8 +613,10 @@ void KalmanNav::correctPos() else cosLSing = -0.01; } + float noiseVel = _rGpsVel.get(); float noiseLatDegE7 = 1.0e7f * M_RAD_TO_DEG_F * _rGpsPos.get() / R; float noiseLonDegE7 = noiseLatDegE7 / cosLSing; + float noiseAlt = _rGpsAlt.get(); RPos(2, 2) = noiseLatDegE7 * noiseLatDegE7; RPos(3, 3) = noiseLonDegE7 * noiseLonDegE7; @@ -659,21 +661,10 @@ void KalmanNav::correctPos() // fault detetcion float beta = y.dot((S*S.transpose()).inverse() * y); - if (beta > 1.0f) { + if (beta > 10.0f) { printf("fault in gps: beta = %8.4f\n", (double)beta); - printf("y:\n"); y.print(); - //printf("R:\n"); RPos.print(); - //printf("S:\n"); S.print(); - //printf("S*S^T:\n"); (S*S.transpose()).print(); - //printf("(S*S^T)^-1:\n"); ((S*S.transpose()).inverse()).print(); - //printf("(S*S^T)^-1*y:\n"); ((S*S.transpose()).inverse()*y).print(); - printf("gps: vN: %8.5f, vE: %8.4f, vD: %8.4f, lat: %15.10f, lon: %15.10f, alt: %15.2f\n", - double(_gps.vel_n), double(_gps.vel_e), double(_gps.vel_d), - double(_gps.lat)/ 1.0e7 / M_RAD_TO_DEG, - double(_gps.lon)/ 1.0e7 / M_RAD_TO_DEG, - double(_gps.alt)/ 1.0e3); - printf("x : vN: %8.5f, vE: %8.4f, vD: %8.4f, lat: %15.10f, lon: %15.10f, alt: %15.2f\n", - double(vN), double(vE), double(vD), lat, lon, alt); + printf("Y/N: vN: %8.4f, vE: %8.4f, lat: %8.4f, lon: %8.4f, alt: %8.4f\n", + y(0)/noiseVel, y(1)/noiseVel, y(2)/noiseLatDegE7, y(3)/noiseLonDegE7, y(4)/noiseAlt); } } diff --git a/apps/examples/kalman_demo/params.c b/apps/examples/kalman_demo/params.c index 03cdca5ed2..f36ac334f9 100644 --- a/apps/examples/kalman_demo/params.c +++ b/apps/examples/kalman_demo/params.c @@ -1,8 +1,8 @@ #include /*PARAM_DEFINE_FLOAT(NAME,0.0f);*/ -PARAM_DEFINE_FLOAT(KF_V_GYRO, 0.01f); -PARAM_DEFINE_FLOAT(KF_V_ACCEL, 0.01f); +PARAM_DEFINE_FLOAT(KF_V_GYRO, 1.0f); +PARAM_DEFINE_FLOAT(KF_V_ACCEL, 1.0f); PARAM_DEFINE_FLOAT(KF_R_MAG, 1.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 1.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 1.0f); From c49320a03ef7f57ae01e9943fc1b4c340c648050 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Mon, 14 Jan 2013 13:49:30 -0500 Subject: [PATCH 113/157] Working on fault detection tolerances. --- apps/examples/control_demo/params.c | 4 +-- apps/examples/kalman_demo/KalmanNav.cpp | 40 ++++++++++++++----------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/apps/examples/control_demo/params.c b/apps/examples/control_demo/params.c index 8f923f5a1c..aea2603306 100644 --- a/apps/examples/control_demo/params.c +++ b/apps/examples/control_demo/params.c @@ -24,7 +24,7 @@ PARAM_DEFINE_FLOAT(FWB_PHI2P, 1.0f); // roll to roll rate PARAM_DEFINE_FLOAT(FWB_PHI_LIM_MAX, 0.5f); // roll limit, 28 deg // velocity -> theta -PARAM_DEFINE_FLOAT(FWB_V2THE_P, 0.2f); +PARAM_DEFINE_FLOAT(FWB_V2THE_P, 0.1f); PARAM_DEFINE_FLOAT(FWB_V2THE_I, 0.0f); PARAM_DEFINE_FLOAT(FWB_V2THE_D, 0.0f); PARAM_DEFINE_FLOAT(FWB_V2THE_D_LP, 0.0f); @@ -34,7 +34,7 @@ PARAM_DEFINE_FLOAT(FWB_THE_MAX, 0.5f); // theta -> q -PARAM_DEFINE_FLOAT(FWB_THE2Q_P, 1.0f); +PARAM_DEFINE_FLOAT(FWB_THE2Q_P, 2.0f); PARAM_DEFINE_FLOAT(FWB_THE2Q_I, 0.0f); PARAM_DEFINE_FLOAT(FWB_THE2Q_D, 0.0f); PARAM_DEFINE_FLOAT(FWB_THE2Q_D_LP, 0.0f); diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index d28cba42c9..e804fbca5c 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -316,11 +316,11 @@ void KalmanNav::predictFast(float dt) float cosL = cosf(lat); float cosLSing = cosf(lat); - // prevent singularity + // prevent singularity if (fabsf(cosLSing) < 0.01f) { - if (cosLSing > 0) cosLSing = 0.01; - else cosLSing = -0.01; - } + if (cosLSing > 0) cosLSing = 0.01; + else cosLSing = -0.01; + } // position update // neglects angular deflections in local gravity @@ -581,9 +581,9 @@ void KalmanNav::correctAtt() P = P - K * HAtt * P; // fault detection - float beta = y.dot((S*S.transpose()).inverse() * y); + float beta = y.dot((S * S.transpose()).inverse() * y); - if (beta > 10.0f) { + if (beta > 1000.0f) { printf("fault in attitude: beta = %8.4f\n", (double)beta); printf("y:\n"); y.print(); } @@ -601,7 +601,7 @@ void KalmanNav::correctPos() y(1) = _gps.vel_e - vE; y(2) = double(_gps.lat) - lat * 1.0e7 * M_RAD_TO_DEG; y(3) = double(_gps.lon) - lon * 1.0e7 * M_RAD_TO_DEG; - y(4) = double(_gps.alt)/1.0e3 - alt; + y(4) = double(_gps.alt) / 1.0e3 - alt; // update gps noise float cosLSing = cosf(lat); @@ -609,9 +609,9 @@ void KalmanNav::correctPos() // prevent singularity if (fabsf(cosLSing) < 0.01f) { - if (cosLSing > 0) cosLSing = 0.01; - else cosLSing = -0.01; - } + if (cosLSing > 0) cosLSing = 0.01; + else cosLSing = -0.01; + } float noiseVel = _rGpsVel.get(); float noiseLatDegE7 = 1.0e7f * M_RAD_TO_DEG_F * _rGpsPos.get() / R; @@ -659,12 +659,16 @@ void KalmanNav::correctPos() P = P - K * HPos * P; // fault detetcion - float beta = y.dot((S*S.transpose()).inverse() * y); + float beta = y.dot((S * S.transpose()).inverse() * y); - if (beta > 10.0f) { + if (beta > 1000.0f) { printf("fault in gps: beta = %8.4f\n", (double)beta); - printf("Y/N: vN: %8.4f, vE: %8.4f, lat: %8.4f, lon: %8.4f, alt: %8.4f\n", - y(0)/noiseVel, y(1)/noiseVel, y(2)/noiseLatDegE7, y(3)/noiseLonDegE7, y(4)/noiseAlt); + printf("Y/N: vN: %8.4f, vE: %8.4f, lat: %8.4f, lon: %8.4f, alt: %8.4f\n", + double(y(0) / noiseVel), + double(y(1) / noiseVel), + double(y(2) / noiseLatDegE7), + double(y(3) / noiseLonDegE7), + double(y(4) / noiseAlt)); } } @@ -702,10 +706,10 @@ void KalmanNav::updateParams() float R = R0 + float(alt); // prevent singularity - if (fabsf(cosLSing) < 0.01f) { - if (cosLSing > 0) cosLSing = 0.01; - else cosLSing = -0.01; - } + if (fabsf(cosLSing) < 0.01f) { + if (cosLSing > 0) cosLSing = 0.01; + else cosLSing = -0.01; + } float noiseVel = _rGpsVel.get(); float noiseLatDegE7 = 1.0e7f * M_RAD_TO_DEG_F * _rGpsPos.get() / R; From f0edb59d7e8ef3aa23ae14a47bacc8276c4cdf0b Mon Sep 17 00:00:00 2001 From: Marco Bauer Date: Mon, 14 Jan 2013 21:58:42 +0100 Subject: [PATCH 114/157] some major changes --- apps/drivers/blinkm/blinkm.cpp | 515 +++++++++++++++------------------ 1 file changed, 231 insertions(+), 284 deletions(-) diff --git a/apps/drivers/blinkm/blinkm.cpp b/apps/drivers/blinkm/blinkm.cpp index b1e20d4f85..aeee80905a 100644 --- a/apps/drivers/blinkm/blinkm.cpp +++ b/apps/drivers/blinkm/blinkm.cpp @@ -39,7 +39,7 @@ * Connect the BlinkM to I2C3 and put the following line to the rc startup-script: * blinkm start * - * To start the system monitor put in the next line after the blinm start: + * To start the system monitor put in the next line after the blinkm start: * blinkm systemmonitor * * @@ -66,11 +66,12 @@ * * (X = on, _=off) * - * The first 3 Blinks indicates the status of the GPS-Signal: + * The first 3 blinks indicates the status of the GPS-Signal (red): * 0-4 satellites = X-X-X-X-_-_-_-_- * 5 satellites = X-X-_-X-_-_-_-_- * 6 satellites = X-_-_-X-_-_-_-_- * >=7 satellites = _-_-_-X-_-_-_-_- + * If no GPS is found the first 3 blinks are white * * The fourth Blink indicates the Flightmode: * MANUAL : off @@ -84,6 +85,9 @@ * Battery Alert (critical Battery Level) * Continuously blinking in red X-X-X-X-X-X-X-X * + * General Error (no uOrb Data) + * Continuously blinking in white X-X-X-X-X-X-X-X + * */ #include @@ -113,6 +117,12 @@ #include #include +static const float MAX_CELL_VOLTAGE = 4.3f; +static const int LED_ONTIME = 100; +static const int LED_OFFTIME = 100; +static const int LED_BLINK = 1; +static const int LED_NOBLINK = 0; + class BlinkM : public device::I2C { public: @@ -150,19 +160,14 @@ private: MORSE_CODE }; - enum systemDefines { + enum ledColors { LED_OFF, LED_RED, LED_YELLOW, LED_PURPLE, LED_GREEN, LED_BLUE, - LED_WHITE, - LED_ONTIME=100, - LED_OFFTIME=100, - LED_NOBLINK=0, - LED_BLINK=1, - MAX_CELL_VOLTAGE=43 + LED_WHITE }; work_s _work; @@ -234,17 +239,6 @@ const char *BlinkM::script_names[] = { nullptr }; -/* -int BlinkM::led_color_1 = LED_OFF; -int BlinkM::led_color_2 = LED_OFF; -int BlinkM::led_color_3 = LED_OFF; -int BlinkM::led_color_4 = LED_OFF; -int BlinkM::led_color_5 = LED_OFF; -int BlinkM::led_color_6 = LED_OFF; -int BlinkM::led_blink = LED_NOBLINK; - -bool BlinkM::systemstate_run = false; -*/ extern "C" __EXPORT int blinkm_main(int argc, char *argv[]); @@ -277,12 +271,6 @@ BlinkM::init() return ret; } - /* set some sensible defaults */ - set_fade_speed(255); - - /* turn off by default */ - play_script(BLACK); - set_fade_speed(255); stop_script(); set_rgb(0,0,0); @@ -293,26 +281,14 @@ int BlinkM::setMode(int mode) { if(mode == 1) { - if(BlinkM::systemstate_run == false) { - /* set some sensible defaults */ - set_fade_speed(255); - - /* turn off by default */ - play_script(BLACK); + if(systemstate_run == false) { stop_script(); - //set_rgb(0,0,0); - BlinkM::systemstate_run = true; + set_rgb(0,0,0); + systemstate_run = true; work_queue(LPWORK, &_work, (worker_t)&BlinkM::led_trampoline, this, 1); } } else { - BlinkM::systemstate_run = false; - usleep(1000000); - /* set some sensible defaults */ - set_fade_speed(255); - /* turn off by default */ - play_script(BLACK); - stop_script(); - //set_rgb(0,0,0); + systemstate_run = false; } return OK; @@ -397,21 +373,19 @@ BlinkM::led() static int num_of_cells = 0; static int detected_cells_runcount = 0; - static int t_led_color_1 = 0; - static int t_led_color_2 = 0; - static int t_led_color_3 = 0; - static int t_led_color_4 = 0; - static int t_led_color_5 = 0; - static int t_led_color_6 = 0; + + static int t_led_color[6] = { 0, 0, 0, 0, 0, 0}; static int t_led_blink = 0; - static int led_thread_runcount=1; + static int led_thread_runcount=0; static int led_interval = 1000; + static int no_data_vehicle_status = 0; + static int no_data_vehicle_gps_position = 0; + static bool topic_initialized = false; static bool detected_cells_blinked = false; static bool led_thread_ready = true; - int system_voltage = 0; int num_of_used_sats = 0; if(!topic_initialized) { @@ -427,277 +401,250 @@ BlinkM::led() if(led_thread_ready == true) { if(!detected_cells_blinked) { if(num_of_cells > 0) { - t_led_color_1 = LED_PURPLE; + t_led_color[0] = LED_PURPLE; } if(num_of_cells > 1) { - t_led_color_2 = LED_PURPLE; + t_led_color[1] = LED_PURPLE; } if(num_of_cells > 2) { - t_led_color_3 = LED_PURPLE; + t_led_color[2] = LED_PURPLE; } if(num_of_cells > 3) { - t_led_color_4 = LED_PURPLE; + t_led_color[3] = LED_PURPLE; } if(num_of_cells > 4) { - t_led_color_5 = LED_PURPLE; + t_led_color[4] = LED_PURPLE; } - t_led_color_6 = LED_OFF; + t_led_color[5] = LED_OFF; t_led_blink = LED_BLINK; } else { - t_led_color_1 = BlinkM::led_color_1; - t_led_color_2 = BlinkM::led_color_2; - t_led_color_3 = BlinkM::led_color_3; - t_led_color_4 = BlinkM::led_color_4; - t_led_color_5 = BlinkM::led_color_5; - t_led_color_6 = BlinkM::led_color_6; - t_led_blink = BlinkM::led_blink; + t_led_color[0] = led_color_1; + t_led_color[1] = led_color_2; + t_led_color[2] = led_color_3; + t_led_color[3] = led_color_4; + t_led_color[4] = led_color_5; + t_led_color[5] = led_color_6; + t_led_blink = led_blink; } led_thread_ready = false; } - switch(led_thread_runcount) { - case 1: // 1. LED on - BlinkM::setLEDColor(t_led_color_1); - led_thread_runcount++; - led_interval = LED_ONTIME; - break; - case 2: // 1. LED off - if(t_led_blink == LED_BLINK) { - BlinkM::setLEDColor(LED_OFF); - } - led_thread_runcount++; - led_interval = LED_OFFTIME; - break; - case 3: // 2. LED on - BlinkM::setLEDColor(t_led_color_2); - led_thread_runcount++; - led_interval = LED_ONTIME; - break; - case 4: // 2. LED off - if(t_led_blink == LED_BLINK) { - BlinkM::setLEDColor(LED_OFF); - } - led_thread_runcount++; - led_interval = LED_OFFTIME; - break; - case 5: // 3. LED on - BlinkM::setLEDColor(t_led_color_3); - led_thread_runcount++; - led_interval = LED_ONTIME; - break; - case 6: // 3. LED off - if(t_led_blink == LED_BLINK) { - BlinkM::setLEDColor(LED_OFF); - } - led_thread_runcount++; - led_interval = LED_OFFTIME; - break; - case 7: // 4. LED on - BlinkM::setLEDColor(t_led_color_4); - led_thread_runcount++; - led_interval = LED_ONTIME; - break; - case 8: // 4. LED off - if(t_led_blink == LED_BLINK) { - BlinkM::setLEDColor(LED_OFF); - } - led_thread_runcount++; - led_interval = LED_OFFTIME; - break; - case 9: // 5. LED on - BlinkM::setLEDColor(t_led_color_5); - led_thread_runcount++; - led_interval = LED_ONTIME; - break; - case 10: // 5. LED off - if(t_led_blink == LED_BLINK) { - BlinkM::setLEDColor(LED_OFF); - } - led_thread_runcount++; - led_interval = LED_OFFTIME; - break; - case 11: // 6. LED on - BlinkM::setLEDColor(t_led_color_6); - led_thread_runcount++; - led_interval = LED_ONTIME; - break; - case 12: // 6. LED off - if(t_led_blink == LED_BLINK) { - BlinkM::setLEDColor(LED_OFF); - } - - /* obtained data for the first file descriptor */ - struct vehicle_status_s vehicle_status_raw; - struct vehicle_gps_position_s vehicle_gps_position_raw; - - bool new_data; - orb_check(vehicle_status_sub_fd, &new_data); - - if (new_data) { - orb_copy(ORB_ID(vehicle_status), vehicle_status_sub_fd, &vehicle_status_raw); - } - - orb_check(vehicle_gps_position_sub_fd, &new_data); - - if (new_data) { - orb_copy(ORB_ID(vehicle_gps_position), vehicle_gps_position_sub_fd, &vehicle_gps_position_raw); - } - - /* get actual battery voltage */ - system_voltage = (int)vehicle_status_raw.voltage_battery*10; - - /* get number of used satellites in navigation */ - num_of_used_sats = 0; - for(int satloop=0; satloop<20; satloop++) { - if(vehicle_gps_position_raw.satellite_used[satloop] == 1) { - num_of_used_sats++; - } - } - - if(num_of_cells == 0) { - /* looking for lipo cells that are connected */ - printf(" checking cells\n"); - for(num_of_cells = 2; num_of_cells < 7; num_of_cells++) { - if(system_voltage < num_of_cells * MAX_CELL_VOLTAGE) break; - } - printf(" cells found:%u\n", num_of_cells); - } else { - if(vehicle_status_raw.battery_warning == VEHICLE_BATTERY_WARNING_WARNING) { - /* LED Pattern for battery low warning */ - BlinkM::led_color_1 = LED_YELLOW; - BlinkM::led_color_2 = LED_YELLOW; - BlinkM::led_color_3 = LED_YELLOW; - BlinkM::led_color_4 = LED_YELLOW; - BlinkM::led_color_5 = LED_YELLOW; - BlinkM::led_color_6 = LED_YELLOW; - BlinkM::led_blink = LED_BLINK; - - } else if(vehicle_status_raw.battery_warning == VEHICLE_BATTERY_WARNING_ALERT) { - /* LED Pattern for battery critical alerting */ - BlinkM::led_color_1 = LED_RED; - BlinkM::led_color_2 = LED_RED; - BlinkM::led_color_3 = LED_RED; - BlinkM::led_color_4 = LED_RED; - BlinkM::led_color_5 = LED_RED; - BlinkM::led_color_6 = LED_RED; - BlinkM::led_blink = LED_BLINK; - - } else { - /* no battery warnings here */ - - if(vehicle_status_raw.flag_system_armed == false) { - /* system not armed */ - BlinkM::led_color_1 = LED_RED; - BlinkM::led_color_2 = LED_RED; - BlinkM::led_color_3 = LED_RED; - BlinkM::led_color_4 = LED_RED; - BlinkM::led_color_5 = LED_RED; - BlinkM::led_color_6 = LED_RED; - BlinkM::led_blink = LED_NOBLINK; - - } else { - /* armed system - initial led pattern */ - BlinkM::led_color_1 = LED_RED; - BlinkM::led_color_2 = LED_RED; - BlinkM::led_color_3 = LED_RED; - BlinkM::led_color_4 = LED_OFF; - BlinkM::led_color_5 = LED_OFF; - BlinkM::led_color_6 = LED_OFF; - BlinkM::led_blink = LED_BLINK; - - /* handle 4th led - flightmode indicator */ - switch((int)vehicle_status_raw.flight_mode) { - case VEHICLE_FLIGHT_MODE_MANUAL: - BlinkM::led_color_4 = LED_OFF; - break; - - case VEHICLE_FLIGHT_MODE_STAB: - BlinkM::led_color_4 = LED_YELLOW; - break; - - case VEHICLE_FLIGHT_MODE_HOLD: - BlinkM::led_color_4 = LED_BLUE; - break; - - case VEHICLE_FLIGHT_MODE_AUTO: - BlinkM::led_color_4 = LED_GREEN; - break; - } - - /* handling used sat´s */ - if(num_of_used_sats >= 7) { - BlinkM::led_color_1 = LED_OFF; - BlinkM::led_color_2 = LED_OFF; - BlinkM::led_color_3 = LED_OFF; - } else if(num_of_used_sats == 6) { - BlinkM::led_color_2 = LED_OFF; - BlinkM::led_color_3 = LED_OFF; - } else if(num_of_used_sats == 5) { - BlinkM::led_color_3 = LED_OFF; - } - } - } - } - - /* - printf( " Volt:%8.4f\tArmed:%4u\tMode:%4u\tCells:%4u\tBattWarn:%4u\tSats:%4u\tFix:%4u\tVisible:%4u\n", - vehicle_status_raw.voltage_battery, - vehicle_status_raw.flag_system_armed, - vehicle_status_raw.flight_mode, - num_of_cells, - vehicle_status_raw.battery_warning, - num_of_used_sats, - vehicle_gps_position_raw.fix_type, - vehicle_gps_position_raw.satellites_visible); - */ - - - led_thread_runcount=1; - led_thread_ready = true; - led_interval = LED_OFFTIME; - - if(detected_cells_runcount < 5){ - detected_cells_runcount++; - } else { - detected_cells_blinked = true; - } - - break; - default: - led_thread_runcount=1; - t_led_blink = 0; - led_thread_ready = true; - break; + if (led_thread_runcount & 1) { + if (t_led_blink) + setLEDColor(LED_OFF); + led_interval = LED_OFFTIME; + } else { + setLEDColor(t_led_color[(led_thread_runcount / 2) % 6]); + //led_interval = (led_thread_runcount & 1) : LED_ONTIME; + led_interval = LED_ONTIME; } - if(BlinkM::systemstate_run == true) { + if (led_thread_runcount == 11) { + /* obtained data for the first file descriptor */ + struct vehicle_status_s vehicle_status_raw; + struct vehicle_gps_position_s vehicle_gps_position_raw; + + bool new_data_vehicle_status; + bool new_data_vehicle_gps_position; + + orb_check(vehicle_status_sub_fd, &new_data_vehicle_status); + + if (new_data_vehicle_status) { + orb_copy(ORB_ID(vehicle_status), vehicle_status_sub_fd, &vehicle_status_raw); + no_data_vehicle_status = 0; + } else { + no_data_vehicle_status++; + if(no_data_vehicle_status >= 3) + no_data_vehicle_status = 3; + } + + orb_check(vehicle_gps_position_sub_fd, &new_data_vehicle_gps_position); + + if (new_data_vehicle_gps_position) { + orb_copy(ORB_ID(vehicle_gps_position), vehicle_gps_position_sub_fd, &vehicle_gps_position_raw); + no_data_vehicle_gps_position = 0; + } else { + no_data_vehicle_gps_position++; + if(no_data_vehicle_gps_position >= 3) + no_data_vehicle_gps_position = 3; + } + + + + /* get number of used satellites in navigation */ + num_of_used_sats = 0; + for(int satloop=0; satloop<20; satloop++) { + if(vehicle_gps_position_raw.satellite_used[satloop] == 1) { + num_of_used_sats++; + } + } + + if(new_data_vehicle_status || no_data_vehicle_status < 3){ + if(num_of_cells == 0) { + /* looking for lipo cells that are connected */ + printf(" checking cells\n"); + for(num_of_cells = 2; num_of_cells < 7; num_of_cells++) { + if(vehicle_status_raw.voltage_battery < num_of_cells * MAX_CELL_VOLTAGE) break; + } + printf(" cells found:%u\n", num_of_cells); + + } else { + if(vehicle_status_raw.battery_warning == VEHICLE_BATTERY_WARNING_WARNING) { + /* LED Pattern for battery low warning */ + led_color_1 = LED_YELLOW; + led_color_2 = LED_YELLOW; + led_color_3 = LED_YELLOW; + led_color_4 = LED_YELLOW; + led_color_5 = LED_YELLOW; + led_color_6 = LED_YELLOW; + led_blink = LED_BLINK; + + } else if(vehicle_status_raw.battery_warning == VEHICLE_BATTERY_WARNING_ALERT) { + /* LED Pattern for battery critical alerting */ + led_color_1 = LED_RED; + led_color_2 = LED_RED; + led_color_3 = LED_RED; + led_color_4 = LED_RED; + led_color_5 = LED_RED; + led_color_6 = LED_RED; + led_blink = LED_BLINK; + + } else { + /* no battery warnings here */ + + if(vehicle_status_raw.flag_system_armed == false) { + /* system not armed */ + led_color_1 = LED_RED; + led_color_2 = LED_RED; + led_color_3 = LED_RED; + led_color_4 = LED_RED; + led_color_5 = LED_RED; + led_color_6 = LED_RED; + led_blink = LED_NOBLINK; + + } else { + /* armed system - initial led pattern */ + led_color_1 = LED_RED; + led_color_2 = LED_RED; + led_color_3 = LED_RED; + led_color_4 = LED_OFF; + led_color_5 = LED_OFF; + led_color_6 = LED_OFF; + led_blink = LED_BLINK; + + /* handle 4th led - flightmode indicator */ + switch((int)vehicle_status_raw.flight_mode) { + case VEHICLE_FLIGHT_MODE_MANUAL: + led_color_4 = LED_OFF; + break; + + case VEHICLE_FLIGHT_MODE_STAB: + led_color_4 = LED_YELLOW; + break; + + case VEHICLE_FLIGHT_MODE_HOLD: + led_color_4 = LED_BLUE; + break; + + case VEHICLE_FLIGHT_MODE_AUTO: + led_color_4 = LED_GREEN; + break; + } + + if(new_data_vehicle_gps_position || no_data_vehicle_gps_position < 3) { + /* handling used sat´s */ + if(num_of_used_sats >= 7) { + led_color_1 = LED_OFF; + led_color_2 = LED_OFF; + led_color_3 = LED_OFF; + } else if(num_of_used_sats == 6) { + led_color_2 = LED_OFF; + led_color_3 = LED_OFF; + } else if(num_of_used_sats == 5) { + led_color_3 = LED_OFF; + } + + } else { + /* no vehicle_gps_position data */ + led_color_1 = LED_WHITE; + led_color_2 = LED_WHITE; + led_color_3 = LED_WHITE; + + } + + } + } + } + } else { + /* LED Pattern for general Error - no vehicle_status can retrieved */ + led_color_1 = LED_WHITE; + led_color_2 = LED_WHITE; + led_color_3 = LED_WHITE; + led_color_4 = LED_WHITE; + led_color_5 = LED_WHITE; + led_color_6 = LED_WHITE; + led_blink = LED_BLINK; + + } + + /* + printf( " Volt:%8.4f\tArmed:%4u\tMode:%4u\tCells:%4u\tNDVS:%4u\tNDSAT:%4u\tSats:%4u\tFix:%4u\tVisible:%4u\n", + vehicle_status_raw.voltage_battery, + vehicle_status_raw.flag_system_armed, + vehicle_status_raw.flight_mode, + num_of_cells, + no_data_vehicle_status, + no_data_vehicle_gps_position, + num_of_used_sats, + vehicle_gps_position_raw.fix_type, + vehicle_gps_position_raw.satellites_visible); + */ + + led_thread_runcount=0; + led_thread_ready = true; + led_interval = LED_OFFTIME; + + if(detected_cells_runcount < 4){ + detected_cells_runcount++; + } else { + detected_cells_blinked = true; + } + + } else { + led_thread_runcount++; + } + + if(systemstate_run == true) { /* re-queue ourselves to run again later */ work_queue(LPWORK, &_work, (worker_t)&BlinkM::led_trampoline, this, led_interval); + } else { + stop_script(); + set_rgb(0,0,0); } } void BlinkM::setLEDColor(int ledcolor) { switch (ledcolor) { case LED_OFF: // off - BlinkM::set_rgb(0,0,0); + set_rgb(0,0,0); break; case LED_RED: // red - BlinkM::set_rgb(255,0,0); + set_rgb(255,0,0); break; case LED_YELLOW: // yellow - BlinkM::set_rgb(255,70,0); + set_rgb(255,70,0); break; case LED_PURPLE: // purple - BlinkM::set_rgb(255,0,255); + set_rgb(255,0,255); break; case LED_GREEN: // green - BlinkM::set_rgb(0,255,0); + set_rgb(0,255,0); break; case LED_BLUE: // blue - BlinkM::set_rgb(0,0,255); + set_rgb(0,0,255); break; case LED_WHITE: // white - BlinkM::set_rgb(255,255,255); + set_rgb(255,255,255); break; } } From 4613d1247d0dc7091be4ac477053e73866455e2f Mon Sep 17 00:00:00 2001 From: James Goppert Date: Mon, 14 Jan 2013 17:15:43 -0500 Subject: [PATCH 115/157] Added param comments for FWB controller. --- apps/examples/control_demo/params.c | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/apps/examples/control_demo/params.c b/apps/examples/control_demo/params.c index aea2603306..422e9b90e6 100644 --- a/apps/examples/control_demo/params.c +++ b/apps/examples/control_demo/params.c @@ -24,40 +24,40 @@ PARAM_DEFINE_FLOAT(FWB_PHI2P, 1.0f); // roll to roll rate PARAM_DEFINE_FLOAT(FWB_PHI_LIM_MAX, 0.5f); // roll limit, 28 deg // velocity -> theta -PARAM_DEFINE_FLOAT(FWB_V2THE_P, 0.1f); -PARAM_DEFINE_FLOAT(FWB_V2THE_I, 0.0f); -PARAM_DEFINE_FLOAT(FWB_V2THE_D, 0.0f); -PARAM_DEFINE_FLOAT(FWB_V2THE_D_LP, 0.0f); -PARAM_DEFINE_FLOAT(FWB_V2THE_I_MAX, 0.0f); -PARAM_DEFINE_FLOAT(FWB_THE_MIN, -0.5f); -PARAM_DEFINE_FLOAT(FWB_THE_MAX, 0.5f); +PARAM_DEFINE_FLOAT(FWB_V2THE_P, 0.1f); // velocity to pitch angle PID, prop gain +PARAM_DEFINE_FLOAT(FWB_V2THE_I, 0.0f); // integral gain +PARAM_DEFINE_FLOAT(FWB_V2THE_D, 0.0f); // derivative gain +PARAM_DEFINE_FLOAT(FWB_V2THE_D_LP, 0.0f); // derivative low-pass +PARAM_DEFINE_FLOAT(FWB_V2THE_I_MAX, 0.0f); // integrator wind up guard +PARAM_DEFINE_FLOAT(FWB_THE_MIN, -0.5f); // the max commanded pitch angle +PARAM_DEFINE_FLOAT(FWB_THE_MAX, 0.5f); // the min commanded pitch angle // theta -> q -PARAM_DEFINE_FLOAT(FWB_THE2Q_P, 2.0f); +PARAM_DEFINE_FLOAT(FWB_THE2Q_P, 2.0f); // pitch angle to pitch-rate PID PARAM_DEFINE_FLOAT(FWB_THE2Q_I, 0.0f); PARAM_DEFINE_FLOAT(FWB_THE2Q_D, 0.0f); PARAM_DEFINE_FLOAT(FWB_THE2Q_D_LP, 0.0f); PARAM_DEFINE_FLOAT(FWB_THE2Q_I_MAX, 0.0f); // h -> thr -PARAM_DEFINE_FLOAT(FWB_H2THR_P, 0.01f); +PARAM_DEFINE_FLOAT(FWB_H2THR_P, 0.01f); // altitude to throttle PID PARAM_DEFINE_FLOAT(FWB_H2THR_I, 0.0f); PARAM_DEFINE_FLOAT(FWB_H2THR_D, 0.0f); PARAM_DEFINE_FLOAT(FWB_H2THR_D_LP, 0.0f); PARAM_DEFINE_FLOAT(FWB_H2THR_I_MAX, 0.0f); // crosstrack -PARAM_DEFINE_FLOAT(FWB_XT2YAW_MAX, 1.57f); // 90 deg -PARAM_DEFINE_FLOAT(FWB_XT2YAW, 0.002f); +PARAM_DEFINE_FLOAT(FWB_XT2YAW_MAX, 1.57f); // cross-track to yaw angle limit 90 deg +PARAM_DEFINE_FLOAT(FWB_XT2YAW, 0.002f); // cross-track to yaw angle gain // speed command -PARAM_DEFINE_FLOAT(FWB_V_MIN, 20.0f); -PARAM_DEFINE_FLOAT(FWB_V_CMD, 22.0f); -PARAM_DEFINE_FLOAT(FWB_V_MAX, 24.0f); +PARAM_DEFINE_FLOAT(FWB_V_MIN, 20.0f); // minimum commanded velocity +PARAM_DEFINE_FLOAT(FWB_V_CMD, 22.0f); // commanded velocity +PARAM_DEFINE_FLOAT(FWB_V_MAX, 24.0f); // maximum commanded velocity // trim -PARAM_DEFINE_FLOAT(FWB_TRIM_AIL, 0.0f); -PARAM_DEFINE_FLOAT(FWB_TRIM_ELV, 0.005f); -PARAM_DEFINE_FLOAT(FWB_TRIM_RDR, 0.0f); -PARAM_DEFINE_FLOAT(FWB_TRIM_THR, 0.81f); +PARAM_DEFINE_FLOAT(FWB_TRIM_AIL, 0.0f); // trim aileron, normalized (-1,1) +PARAM_DEFINE_FLOAT(FWB_TRIM_ELV, 0.005f); // trim elevator (-1,1) +PARAM_DEFINE_FLOAT(FWB_TRIM_RDR, 0.0f); // trim rudder (-1,1) +PARAM_DEFINE_FLOAT(FWB_TRIM_THR, 0.81f); // trim throttle (0,1) From 35f0f570a6c0434c77db50407a7510677c1fb889 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Mon, 14 Jan 2013 23:48:07 +0100 Subject: [PATCH 116/157] Hotfix for current active waypoint ID --- apps/mavlink/waypoints.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/mavlink/waypoints.c b/apps/mavlink/waypoints.c index 3832ebe708..a131b143ba 100644 --- a/apps/mavlink/waypoints.c +++ b/apps/mavlink/waypoints.c @@ -408,9 +408,10 @@ void check_waypoints_reached(uint64_t now, const struct vehicle_global_position_ cur_wp->current = 0; if (wpm->current_active_wp_id == wpm->size - 1 && wpm->size > 1) { - //the last waypoint was reached, if auto continue is - //activated restart the waypoint list from the beginning - wpm->current_active_wp_id = 1; + /* the last waypoint was reached, if auto continue is + * activated restart the waypoint list from the beginning + */ + wpm->current_active_wp_id = 0; } else { if ((uint16_t)(wpm->current_active_wp_id + 1) < wpm->size) From 5b0aa490d68741fc067923e7ef801f672dcb5819 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Mon, 14 Jan 2013 18:38:17 -0500 Subject: [PATCH 117/157] Added P0. Hid some printing. Corrected fault detection. --- apps/examples/kalman_demo/KalmanNav.cpp | 26 ++++++++++++++++++------- apps/examples/kalman_demo/KalmanNav.hpp | 1 + 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index e804fbca5c..a735de406f 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -45,8 +45,6 @@ // Titterton pg. 52 static const float omega = 7.2921150e-5f; // earth rotation rate, rad/s static const float R0 = 6378137.0f; // earth radius, m - -static const float RSq = 4.0680631591e+13; // earth radius squared static const float g = 9.806f; // gravitational accel. m/s^2, XXX should be calibrated KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : @@ -55,6 +53,7 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : F(9, 9), G(9, 6), P(9, 9), + P0(9, 9), V(6, 6), // attitude measurement ekf matrices HAtt(6, 9), @@ -100,7 +99,8 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : using namespace math; // initial state covariance matrix - P = Matrix::identity(9) * 1.0f; + P0 = Matrix::identity(9) * 1.0f; + P = P0; // wait for gps lock while (1) { @@ -132,6 +132,13 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : setLonDegE7(_gps.lon); setAltE3(_gps.alt); + printf("[kalman_demo] initializing EKF state with GPS\n"); + printf("phi: %8.4f, theta: %8.4f, psi: %8.4f\n", + double(phi), double(theta), double(psi)); + printf("vN: %8.4f, vE: %8.4f, vD: %8.4f, lat: %8.4f, lon: %8.4f, alt: %8.4f\n", + double(vN), double(vE), double(vD), + lat, lon, alt); + // initialize quaternions q = Quaternion(EulerAngles(phi, theta, psi)); @@ -335,6 +342,10 @@ void KalmanNav::predictFast(float dt) vN * LDot + g; float vEDot = fE + vN * rotRate * sinL + vDDot * rotRate * cosL; + printf("vNDot: %8.4f, vEDot: %8.4f, vDDot: %8.4f\n", + double(vNDot), double(vEDot), double(vDDot)); + printf("LDot: %8.4f, lDot: %8.4f, rotRate: %8.4f\n", + double(LDot), double(lDot), double(rotRate)); // rectangular integration //printf("dt: %8.4f\n", double(dt)); @@ -360,6 +371,7 @@ void KalmanNav::predictSlow(float dt) // prepare for matrix float R = R0 + float(alt); + float RSq = R*R; // F Matrix // Titterton pg. 291 @@ -558,7 +570,7 @@ void KalmanNav::correctAtt() // abort correction and return printf("[kalman_demo] numerical failure in att correction\n"); // reset P matrix to identity - P = Matrix::identity(9) * 1.0f; + P = P0; return; } } @@ -581,7 +593,7 @@ void KalmanNav::correctAtt() P = P - K * HAtt * P; // fault detection - float beta = y.dot((S * S.transpose()).inverse() * y); + float beta = y.dot(S.inverse()*y); if (beta > 1000.0f) { printf("fault in attitude: beta = %8.4f\n", (double)beta); @@ -641,7 +653,7 @@ void KalmanNav::correctPos() setLonDegE7(_gps.lon); setAltE3(_gps.alt); // reset P matrix to identity - P = Matrix::identity(9) * 1.0f; + P = P0; return; } } @@ -659,7 +671,7 @@ void KalmanNav::correctPos() P = P - K * HPos * P; // fault detetcion - float beta = y.dot((S * S.transpose()).inverse() * y); + float beta = y.dot(S.inverse()*y); if (beta > 1000.0f) { printf("fault in gps: beta = %8.4f\n", (double)beta); diff --git a/apps/examples/kalman_demo/KalmanNav.hpp b/apps/examples/kalman_demo/KalmanNav.hpp index 1ea46d40ff..c074cb7c31 100644 --- a/apps/examples/kalman_demo/KalmanNav.hpp +++ b/apps/examples/kalman_demo/KalmanNav.hpp @@ -81,6 +81,7 @@ protected: math::Matrix F; math::Matrix G; math::Matrix P; + math::Matrix P0; math::Matrix V; math::Matrix HAtt; math::Matrix RAtt; From 6d138a845aabad31060bd00da0d20d177d3f4be4 Mon Sep 17 00:00:00 2001 From: px4dev Date: Mon, 14 Jan 2013 20:40:38 -0800 Subject: [PATCH 118/157] Let's let folks have their own .gdbinit --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0861e7a524..be32a0c632 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ mavlink/include/mavlink/v0.9/ .*.swp .swp core +.gdbinit From d02a24ec82e35016545d519ea88d46881c42df2d Mon Sep 17 00:00:00 2001 From: James Goppert Date: Tue, 15 Jan 2013 11:00:52 -0500 Subject: [PATCH 119/157] Adding comments to ekf. --- apps/examples/kalman_demo/KalmanNav.cpp | 39 ++++---- apps/examples/kalman_demo/KalmanNav.hpp | 117 ++++++++++++++++-------- 2 files changed, 102 insertions(+), 54 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index a735de406f..5f71da58e7 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -82,8 +82,9 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : // miss counts _missFast(0), _missSlow(0), - // state + // accelerations fN(0), fE(0), fD(0), + // state phi(0), theta(0), psi(0), vN(0), vE(0), vD(0), lat(0), lon(0), alt(0), @@ -94,13 +95,15 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : _rGpsVel(this, "R_GPS_VEL"), _rGpsPos(this, "R_GPS_POS"), _rGpsAlt(this, "R_GPS_ALT"), - _rAccel(this, "R_ACCEL") + _rAccel(this, "R_ACCEL"), + _magDip(this, "MAG_DIP"), + _magDec(this, "MAG_DEC") { using namespace math; // initial state covariance matrix P0 = Matrix::identity(9) * 1.0f; - P = P0; + P = P0; // wait for gps lock while (1) { @@ -132,12 +135,12 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : setLonDegE7(_gps.lon); setAltE3(_gps.alt); - printf("[kalman_demo] initializing EKF state with GPS\n"); - printf("phi: %8.4f, theta: %8.4f, psi: %8.4f\n", - double(phi), double(theta), double(psi)); - printf("vN: %8.4f, vE: %8.4f, vD: %8.4f, lat: %8.4f, lon: %8.4f, alt: %8.4f\n", - double(vN), double(vE), double(vD), - lat, lon, alt); + printf("[kalman_demo] initializing EKF state with GPS\n"); + printf("phi: %8.4f, theta: %8.4f, psi: %8.4f\n", + double(phi), double(theta), double(psi)); + printf("vN: %8.4f, vE: %8.4f, vD: %8.4f, lat: %8.4f, lon: %8.4f, alt: %8.4f\n", + double(vN), double(vE), double(vD), + lat, lon, alt); // initialize quaternions q = Quaternion(EulerAngles(phi, theta, psi)); @@ -342,10 +345,10 @@ void KalmanNav::predictFast(float dt) vN * LDot + g; float vEDot = fE + vN * rotRate * sinL + vDDot * rotRate * cosL; - printf("vNDot: %8.4f, vEDot: %8.4f, vDDot: %8.4f\n", - double(vNDot), double(vEDot), double(vDDot)); - printf("LDot: %8.4f, lDot: %8.4f, rotRate: %8.4f\n", - double(LDot), double(lDot), double(rotRate)); + printf("vNDot: %8.4f, vEDot: %8.4f, vDDot: %8.4f\n", + double(vNDot), double(vEDot), double(vDDot)); + printf("LDot: %8.4f, lDot: %8.4f, rotRate: %8.4f\n", + double(LDot), double(lDot), double(rotRate)); // rectangular integration //printf("dt: %8.4f\n", double(dt)); @@ -371,7 +374,7 @@ void KalmanNav::predictSlow(float dt) // prepare for matrix float R = R0 + float(alt); - float RSq = R*R; + float RSq = R * R; // F Matrix // Titterton pg. 291 @@ -472,8 +475,8 @@ void KalmanNav::correctAtt() // mag predicted measurement // choosing some typical magnetic field properties, // TODO dip/dec depend on lat/ lon/ time - static const float dip = 0.0f / M_RAD_TO_DEG_F; // dip, inclination with level - static const float dec = 0.0f / M_RAD_TO_DEG_F; // declination, clockwise rotation from north + static const float dip = _magDip.get() / M_RAD_TO_DEG_F; // dip, inclination with level + static const float dec = _magDec.get() / M_RAD_TO_DEG_F; // declination, clockwise rotation from north float bN = cosf(dip) * cosf(dec); float bE = cosf(dip) * sinf(dec); float bD = sinf(dip); @@ -593,7 +596,7 @@ void KalmanNav::correctAtt() P = P - K * HAtt * P; // fault detection - float beta = y.dot(S.inverse()*y); + float beta = y.dot(S.inverse() * y); if (beta > 1000.0f) { printf("fault in attitude: beta = %8.4f\n", (double)beta); @@ -671,7 +674,7 @@ void KalmanNav::correctPos() P = P - K * HPos * P; // fault detetcion - float beta = y.dot(S.inverse()*y); + float beta = y.dot(S.inverse() * y); if (beta > 1000.0f) { printf("fault in gps: beta = %8.4f\n", (double)beta); diff --git a/apps/examples/kalman_demo/KalmanNav.hpp b/apps/examples/kalman_demo/KalmanNav.hpp index c074cb7c31..af4588e20e 100644 --- a/apps/examples/kalman_demo/KalmanNav.hpp +++ b/apps/examples/kalman_demo/KalmanNav.hpp @@ -68,53 +68,98 @@ class KalmanNav : public control::SuperBlock { public: + /** + * Constructor + */ KalmanNav(SuperBlock *parent, const char *name); + + /** + * Deconstuctor + */ + virtual ~KalmanNav() {}; + /** + * The main callback function for the class + */ void update(); + + /** + * Fast prediction + * Contains: state integration + */ virtual void updatePublications(); void predictFast(float dt); + + /** + * Slow prediction + * Contains: covariance integration + */ void predictSlow(float dt); + + /** + * Attitude correction + */ void correctAtt(); + + /** + * Position correction + */ void correctPos(); + + /** + * Overloaded update parameters + */ virtual void updateParams(); protected: - math::Matrix F; - math::Matrix G; - math::Matrix P; - math::Matrix P0; - math::Matrix V; - math::Matrix HAtt; - math::Matrix RAtt; - math::Matrix HPos; - math::Matrix RPos; - math::Dcm C_nb; - math::Quaternion q; - control::UOrbSubscription _sensors; - control::UOrbSubscription _gps; - control::UOrbSubscription _param_update; - control::UOrbPublication _pos; - control::UOrbPublication _att; - uint64_t _pubTimeStamp; - uint64_t _fastTimeStamp; - uint64_t _slowTimeStamp; - uint64_t _attTimeStamp; - uint64_t _outTimeStamp; - uint16_t _navFrames; - uint16_t _missFast; - uint16_t _missSlow; - float fN, fE, fD; + // kalman filter + math::Matrix F; /**< Jacobian(f,x), where dx/dt = f(x,u) */ + math::Matrix G; /**< noise shaping matrix for gyro/accel */ + math::Matrix P; /**< state covariance matrix */ + math::Matrix P0; /**< initial state covariance matrix */ + math::Matrix V; /**< gyro/ accel noise matrix */ + math::Matrix HAtt; /**< attitude measurement matrix */ + math::Matrix RAtt; /**< attitude measurement noise matrix */ + math::Matrix HPos; /**< position measurement jacobian matrix */ + math::Matrix RPos; /**< position measurement noise matrix */ + // attitude + math::Dcm C_nb; /**< direction cosine matrix from body to nav frame */ + math::Quaternion q; /**< quaternion from body to nav frame */ + // subscriptions + control::UOrbSubscription _sensors; /**< sensors sub. */ + control::UOrbSubscription _gps; /**< gps sub. */ + control::UOrbSubscription _param_update; /**< parameter update sub. */ + // publications + control::UOrbPublication _pos; /**< position pub. */ + control::UOrbPublication _att; /**< attitude pub. */ + // time stamps + uint64_t _pubTimeStamp; /**< output data publication time stamp */ + uint64_t _fastTimeStamp; /**< fast prediction time stamp */ + uint64_t _slowTimeStamp; /**< slow prediction time stamp */ + uint64_t _attTimeStamp; /**< attitude correction time stamp */ + uint64_t _outTimeStamp; /**< output time stamp */ + // frame count + uint16_t _navFrames; /**< navigation frames completed in output cycle */ + // miss counts + uint16_t _missFast; /**< number of times fast prediction loop missed */ + uint16_t _missSlow; /**< number of times slow prediction loop missed */ + // accelerations + float fN, fE, fD; /**< navigation frame acceleration */ // states - enum {PHI = 0, THETA, PSI, VN, VE, VD, LAT, LON, ALT}; - float phi, theta, psi; - float vN, vE, vD; - double lat, lon, alt; - control::BlockParam _vGyro; - control::BlockParam _vAccel; - control::BlockParam _rMag; - control::BlockParam _rGpsVel; - control::BlockParam _rGpsPos; - control::BlockParam _rGpsAlt; - control::BlockParam _rAccel; + enum {PHI = 0, THETA, PSI, VN, VE, VD, LAT, LON, ALT}; /**< state enumeration */ + float phi, theta, psi; /**< 3-2-1 euler angles */ + float vN, vE, vD; /**< navigation velocity, m/s */ + double lat, lon, alt; /**< lat, lon, alt, radians */ + // parameters + control::BlockParam _vGyro; /**< gyro process noise */ + control::BlockParam _vAccel; /**< accelerometer process noise */ + control::BlockParam _rMag; /**< magnetometer measurement noise */ + control::BlockParam _rGpsVel; /**< gps velocity measurement noise */ + control::BlockParam _rGpsPos; /**< gps position measurement noise */ + control::BlockParam _rGpsAlt; /**< gps altitude measurement noise */ + control::BlockParam _rAccel; /**< accelerometer measurement noise */ + control::BlockParam _magDip; /**< magnetic inclination with level */ + control::BlockParam _magDec; /**< magnetic declination, clockwise rotation */ + // accessors int32_t getLatDegE7() { return int32_t(lat * 1.0e7 * M_RAD_TO_DEG); } void setLatDegE7(int32_t val) { lat = val / 1.0e7 / M_RAD_TO_DEG; } int32_t getLonDegE7() { return int32_t(lon * 1.0e7 * M_RAD_TO_DEG); } From 8b6660fc369806da509da5b5b98acc51da83811f Mon Sep 17 00:00:00 2001 From: James Goppert Date: Tue, 15 Jan 2013 11:16:28 -0500 Subject: [PATCH 120/157] Fixed param issue. --- apps/examples/kalman_demo/KalmanNav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 5f71da58e7..081664d173 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -475,8 +475,8 @@ void KalmanNav::correctAtt() // mag predicted measurement // choosing some typical magnetic field properties, // TODO dip/dec depend on lat/ lon/ time - static const float dip = _magDip.get() / M_RAD_TO_DEG_F; // dip, inclination with level - static const float dec = _magDec.get() / M_RAD_TO_DEG_F; // declination, clockwise rotation from north + float dip = _magDip.get() / M_RAD_TO_DEG_F; // dip, inclination with level + float dec = _magDec.get() / M_RAD_TO_DEG_F; // declination, clockwise rotation from north float bN = cosf(dip) * cosf(dec); float bE = cosf(dip) * sinf(dec); float bD = sinf(dip); From 281372ef3ad14d61eb720ddbe05e701e82aabad0 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Tue, 15 Jan 2013 11:36:49 -0500 Subject: [PATCH 121/157] Added mag dip/dec as parameters. --- apps/examples/kalman_demo/params.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/examples/kalman_demo/params.c b/apps/examples/kalman_demo/params.c index f36ac334f9..93571d433b 100644 --- a/apps/examples/kalman_demo/params.c +++ b/apps/examples/kalman_demo/params.c @@ -8,3 +8,5 @@ PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 1.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 1.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_ALT, 1.0f); PARAM_DEFINE_FLOAT(KF_R_ACCEL, 1.0f); +PARAM_DEFINE_FLOAT(KF_MAG_DIP, 60.0f); +PARAM_DEFINE_FLOAT(KF_MAG_DEC, 0.0f); From 022c30ea4f8355799b8ef25d8fb31037df527bb9 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Tue, 15 Jan 2013 12:17:09 -0500 Subject: [PATCH 122/157] Enabled kf to run w/o gps. --- apps/examples/kalman_demo/KalmanNav.cpp | 68 +++++++++++-------------- apps/examples/kalman_demo/KalmanNav.hpp | 2 + 2 files changed, 33 insertions(+), 37 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 081664d173..b5c8a10738 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -97,50 +97,27 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : _rGpsAlt(this, "R_GPS_ALT"), _rAccel(this, "R_ACCEL"), _magDip(this, "MAG_DIP"), - _magDec(this, "MAG_DEC") + _magDec(this, "MAG_DEC"), + _positionInitialized(false) { using namespace math; // initial state covariance matrix - P0 = Matrix::identity(9) * 1.0f; + P0 = Matrix::identity(9) * 0.01f; P = P0; - // wait for gps lock - while (1) { - struct pollfd fds[1]; - fds[0].fd = _gps.getHandle(); - fds[0].events = POLLIN; - - // poll 10 seconds for new data - int ret = poll(fds, 1, 10000); - - if (ret > 0) { - updateSubscriptions(); - - if (_gps.fix_type > 2) break; - - } else if (ret == 0) { - printf("[kalman_demo] waiting for gps lock\n"); - } - } - // initial state phi = 0.0f; theta = 0.0f; psi = 0.0f; - vN = _gps.vel_n; - vE = _gps.vel_e; - vD = _gps.vel_d; - setLatDegE7(_gps.lat); - setLonDegE7(_gps.lon); - setAltE3(_gps.alt); + vN = 0.0f; + vE = 0.0f; + vD = 0.0f; + lat = 0.0f; + lon = 0.0f; + alt = 0.0f; + - printf("[kalman_demo] initializing EKF state with GPS\n"); - printf("phi: %8.4f, theta: %8.4f, psi: %8.4f\n", - double(phi), double(theta), double(psi)); - printf("vN: %8.4f, vE: %8.4f, vD: %8.4f, lat: %8.4f, lon: %8.4f, alt: %8.4f\n", - double(vN), double(vE), double(vD), - lat, lon, alt); // initialize quaternions q = Quaternion(EulerAngles(phi, theta, psi)); @@ -199,6 +176,23 @@ void KalmanNav::update() // abort update if no new data if (!(sensorsUpdate || gpsUpdate)) return; + // if received gps for first time, reset position to gps + if (!_positionInitialized && gpsUpdate && _gps.fix_type > 2 && _gps.counter_pos_valid > 5) { + vN = _gps.vel_n; + vE = _gps.vel_e; + vD = _gps.vel_d; + setLatDegE7(_gps.lat); + setLonDegE7(_gps.lon); + setAltE3(_gps.alt); + _positionInitialized = true; + printf("[kalman_demo] initializing EKF state with GPS\n"); + printf("phi: %8.4f, theta: %8.4f, psi: %8.4f\n", + double(phi), double(theta), double(psi)); + printf("vN: %8.4f, vE: %8.4f, vD: %8.4f, lat: %8.4f, lon: %8.4f, alt: %8.4f\n", + double(vN), double(vE), double(vD), + lat, lon, alt); + } + // fast prediciton step // note, using sensors timestamp so we can account // for packet lag @@ -345,10 +339,10 @@ void KalmanNav::predictFast(float dt) vN * LDot + g; float vEDot = fE + vN * rotRate * sinL + vDDot * rotRate * cosL; - printf("vNDot: %8.4f, vEDot: %8.4f, vDDot: %8.4f\n", - double(vNDot), double(vEDot), double(vDDot)); - printf("LDot: %8.4f, lDot: %8.4f, rotRate: %8.4f\n", - double(LDot), double(lDot), double(rotRate)); + //printf("vNDot: %8.4f, vEDot: %8.4f, vDDot: %8.4f\n", + //double(vNDot), double(vEDot), double(vDDot)); + //printf("LDot: %8.4f, lDot: %8.4f, rotRate: %8.4f\n", + //double(LDot), double(lDot), double(rotRate)); // rectangular integration //printf("dt: %8.4f\n", double(dt)); diff --git a/apps/examples/kalman_demo/KalmanNav.hpp b/apps/examples/kalman_demo/KalmanNav.hpp index af4588e20e..ba3756f468 100644 --- a/apps/examples/kalman_demo/KalmanNav.hpp +++ b/apps/examples/kalman_demo/KalmanNav.hpp @@ -159,6 +159,8 @@ protected: control::BlockParam _rAccel; /**< accelerometer measurement noise */ control::BlockParam _magDip; /**< magnetic inclination with level */ control::BlockParam _magDec; /**< magnetic declination, clockwise rotation */ + // status + bool _positionInitialized; /**< status, if position has been init. */ // accessors int32_t getLatDegE7() { return int32_t(lat * 1.0e7 * M_RAD_TO_DEG); } void setLatDegE7(int32_t val) { lat = val / 1.0e7 / M_RAD_TO_DEG; } From edf0a6bae7fa5ae8c6d4df63489dcf75ec008517 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Tue, 15 Jan 2013 12:37:12 -0500 Subject: [PATCH 123/157] Added check for valid attitude data. --- apps/examples/kalman_demo/KalmanNav.cpp | 25 +++++++++++++++++-------- apps/examples/kalman_demo/params.c | 4 ++-- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index b5c8a10738..68deae1856 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -177,7 +177,10 @@ void KalmanNav::update() if (!(sensorsUpdate || gpsUpdate)) return; // if received gps for first time, reset position to gps - if (!_positionInitialized && gpsUpdate && _gps.fix_type > 2 && _gps.counter_pos_valid > 5) { + if (!_positionInitialized && + gpsUpdate && + _gps.fix_type > 2 && + _gps.counter_pos_valid > 10) { vN = _gps.vel_n; vE = _gps.vel_e; vD = _gps.vel_d; @@ -187,10 +190,10 @@ void KalmanNav::update() _positionInitialized = true; printf("[kalman_demo] initializing EKF state with GPS\n"); printf("phi: %8.4f, theta: %8.4f, psi: %8.4f\n", - double(phi), double(theta), double(psi)); + double(phi), double(theta), double(psi)); printf("vN: %8.4f, vE: %8.4f, vD: %8.4f, lat: %8.4f, lon: %8.4f, alt: %8.4f\n", - double(vN), double(vE), double(vD), - lat, lon, alt); + double(vN), double(vE), double(vD), + lat, lon, alt); } // fast prediciton step @@ -340,9 +343,9 @@ void KalmanNav::predictFast(float dt) float vEDot = fE + vN * rotRate * sinL + vDDot * rotRate * cosL; //printf("vNDot: %8.4f, vEDot: %8.4f, vDDot: %8.4f\n", - //double(vNDot), double(vEDot), double(vDDot)); + //double(vNDot), double(vEDot), double(vDDot)); //printf("LDot: %8.4f, lDot: %8.4f, rotRate: %8.4f\n", - //double(LDot), double(lDot), double(rotRate)); + //double(LDot), double(lDot), double(rotRate)); // rectangular integration //printf("dt: %8.4f\n", double(dt)); @@ -455,6 +458,12 @@ void KalmanNav::correctAtt() { using namespace math; + // check for valid data, return if not ready + if (_sensors.accelerometer_counter < 10 || + _sensors.gyro_counter < 10 || + _sensors.magnetometer_counter < 10) + return; + // trig float cosPhi = cosf(phi); float cosTheta = cosf(theta); @@ -566,7 +575,7 @@ void KalmanNav::correctAtt() if (isnan(val) || isinf(val)) { // abort correction and return printf("[kalman_demo] numerical failure in att correction\n"); - // reset P matrix to identity + // reset P matrix to P0 P = P0; return; } @@ -649,7 +658,7 @@ void KalmanNav::correctPos() setLatDegE7(_gps.lat); setLonDegE7(_gps.lon); setAltE3(_gps.alt); - // reset P matrix to identity + // reset P matrix to P0 P = P0; return; } diff --git a/apps/examples/kalman_demo/params.c b/apps/examples/kalman_demo/params.c index 93571d433b..55be116fa5 100644 --- a/apps/examples/kalman_demo/params.c +++ b/apps/examples/kalman_demo/params.c @@ -1,8 +1,8 @@ #include /*PARAM_DEFINE_FLOAT(NAME,0.0f);*/ -PARAM_DEFINE_FLOAT(KF_V_GYRO, 1.0f); -PARAM_DEFINE_FLOAT(KF_V_ACCEL, 1.0f); +PARAM_DEFINE_FLOAT(KF_V_GYRO, 0.01f); +PARAM_DEFINE_FLOAT(KF_V_ACCEL, 0.01f); PARAM_DEFINE_FLOAT(KF_R_MAG, 1.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 1.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 1.0f); From 9cf3d51aec4e73f626cfdea29b19bdfe80eea384 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Tue, 15 Jan 2013 13:12:00 -0500 Subject: [PATCH 124/157] Made fault tolerances adjustable. --- apps/examples/kalman_demo/KalmanNav.cpp | 6 ++++-- apps/examples/kalman_demo/KalmanNav.hpp | 2 ++ apps/examples/kalman_demo/params.c | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 68deae1856..918dfd9df8 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -98,6 +98,8 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : _rAccel(this, "R_ACCEL"), _magDip(this, "MAG_DIP"), _magDec(this, "MAG_DEC"), + _faultPos(this, "FAULT_POS"), + _faultAtt(this, "FAULT_ATT"), _positionInitialized(false) { using namespace math; @@ -601,7 +603,7 @@ void KalmanNav::correctAtt() // fault detection float beta = y.dot(S.inverse() * y); - if (beta > 1000.0f) { + if (beta > _faultAtt.get()) { printf("fault in attitude: beta = %8.4f\n", (double)beta); printf("y:\n"); y.print(); } @@ -679,7 +681,7 @@ void KalmanNav::correctPos() // fault detetcion float beta = y.dot(S.inverse() * y); - if (beta > 1000.0f) { + if (beta > _faultPos.get()) { printf("fault in gps: beta = %8.4f\n", (double)beta); printf("Y/N: vN: %8.4f, vE: %8.4f, lat: %8.4f, lon: %8.4f, alt: %8.4f\n", double(y(0) / noiseVel), diff --git a/apps/examples/kalman_demo/KalmanNav.hpp b/apps/examples/kalman_demo/KalmanNav.hpp index ba3756f468..4af8bbf5c2 100644 --- a/apps/examples/kalman_demo/KalmanNav.hpp +++ b/apps/examples/kalman_demo/KalmanNav.hpp @@ -159,6 +159,8 @@ protected: control::BlockParam _rAccel; /**< accelerometer measurement noise */ control::BlockParam _magDip; /**< magnetic inclination with level */ control::BlockParam _magDec; /**< magnetic declination, clockwise rotation */ + control::BlockParam _faultPos; /**< fault detection threshold for position */ + control::BlockParam _faultAtt; /**< fault detection threshold for attitude */ // status bool _positionInitialized; /**< status, if position has been init. */ // accessors diff --git a/apps/examples/kalman_demo/params.c b/apps/examples/kalman_demo/params.c index 55be116fa5..b98dd8fd72 100644 --- a/apps/examples/kalman_demo/params.c +++ b/apps/examples/kalman_demo/params.c @@ -10,3 +10,5 @@ PARAM_DEFINE_FLOAT(KF_R_GPS_ALT, 1.0f); PARAM_DEFINE_FLOAT(KF_R_ACCEL, 1.0f); PARAM_DEFINE_FLOAT(KF_MAG_DIP, 60.0f); PARAM_DEFINE_FLOAT(KF_MAG_DEC, 0.0f); +PARAM_DEFINE_FLOAT(KF_FAULT_POS, 1000.0f); +PARAM_DEFINE_FLOAT(KF_FAULT_ATT, 10.0f); From 68b92cd4fc2c4df3de15ef19e723edb67a108ea0 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Tue, 15 Jan 2013 13:21:13 -0500 Subject: [PATCH 125/157] Slowed HIL status updates. Also prevented posCor. when gps not init. --- apps/examples/kalman_demo/KalmanNav.cpp | 8 ++++++-- apps/mavlink/mavlink_receiver.c | 12 ++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 918dfd9df8..38cdb6ca01 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -239,9 +239,10 @@ void KalmanNav::update() } // output - if (newTimeStamp - _outTimeStamp > 1e6) { // 1 Hz + if (newTimeStamp - _outTimeStamp > 10e6) { // 0.1 Hz _outTimeStamp = newTimeStamp; - printf("nav: %4d Hz, misses fast: %4d slow: %4d\n", _navFrames, _missFast, _missSlow); + printf("nav: %4d Hz, misses fast: %4d slow: %4d\n", + _navFrames/10, _missFast/10, _missSlow/10); _navFrames = 0; _missFast = 0; _missSlow = 0; @@ -616,6 +617,9 @@ void KalmanNav::correctAtt() void KalmanNav::correctPos() { using namespace math; + + if (!_positionInitialized) return; + Vector y(5); y(0) = _gps.vel_n - vN; y(1) = _gps.vel_e - vE; diff --git a/apps/mavlink/mavlink_receiver.c b/apps/mavlink/mavlink_receiver.c index fa63c419f0..0b63c30a4a 100644 --- a/apps/mavlink/mavlink_receiver.c +++ b/apps/mavlink/mavlink_receiver.c @@ -367,8 +367,8 @@ handle_message(mavlink_message_t *msg) hil_frames += 1 ; // output - if ((timestamp - old_timestamp) > 1000000) { - printf("receiving hil imu at %d hz\n", hil_frames); + if ((timestamp - old_timestamp) > 10000000) { + printf("receiving hil imu at %d hz\n", hil_frames/10); old_timestamp = timestamp; hil_frames = 0; } @@ -412,8 +412,8 @@ handle_message(mavlink_message_t *msg) hil_frames += 1 ; // output - if ((timestamp - old_timestamp) > 1000000) { - printf("receiving hil gps at %d hz\n", hil_frames); + if ((timestamp - old_timestamp) > 10000000) { + printf("receiving hil gps at %d hz\n", hil_frames/10); old_timestamp = timestamp; hil_frames = 0; } @@ -454,8 +454,8 @@ handle_message(mavlink_message_t *msg) hil_frames += 1 ; // output - if ((timestamp - old_timestamp) > 1000000) { - printf("receiving hil pressure at %d hz\n", hil_frames); + if ((timestamp - old_timestamp) > 10000000) { + printf("receiving hil pressure at %d hz\n", hil_frames/10); old_timestamp = timestamp; hil_frames = 0; } From 28ef7aa1bea97593637537c832b07459a2520b86 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Tue, 15 Jan 2013 14:03:04 -0500 Subject: [PATCH 126/157] Refactored RPos. Increased global pos output rate for debugging. --- apps/examples/kalman_demo/KalmanNav.cpp | 46 +++++++++---------------- apps/mavlink/orb_listener.c | 2 +- 2 files changed, 18 insertions(+), 30 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 38cdb6ca01..0f3069d11e 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -574,7 +574,6 @@ void KalmanNav::correctAtt() // check correciton is sane for (size_t i = 0; i < xCorrect.getRows(); i++) { float val = xCorrect(i); - if (isnan(val) || isinf(val)) { // abort correction and return printf("[kalman_demo] numerical failure in att correction\n"); @@ -589,9 +588,7 @@ void KalmanNav::correctAtt() phi += xCorrect(PHI); theta += xCorrect(THETA); } - psi += xCorrect(PSI); - // attitude also affects nav velocities vN += xCorrect(VN); vE += xCorrect(VE); @@ -603,7 +600,6 @@ void KalmanNav::correctAtt() // fault detection float beta = y.dot(S.inverse() * y); - if (beta > _faultAtt.get()) { printf("fault in attitude: beta = %8.4f\n", (double)beta); printf("y:\n"); y.print(); @@ -620,6 +616,7 @@ void KalmanNav::correctPos() if (!_positionInitialized) return; + // residual Vector y(5); y(0) = _gps.vel_n - vN; y(1) = _gps.vel_e - vE; @@ -627,23 +624,6 @@ void KalmanNav::correctPos() y(3) = double(_gps.lon) - lon * 1.0e7 * M_RAD_TO_DEG; y(4) = double(_gps.alt) / 1.0e3 - alt; - // update gps noise - float cosLSing = cosf(lat); - float R = R0 + float(alt); - - // prevent singularity - if (fabsf(cosLSing) < 0.01f) { - if (cosLSing > 0) cosLSing = 0.01; - else cosLSing = -0.01; - } - - float noiseVel = _rGpsVel.get(); - float noiseLatDegE7 = 1.0e7f * M_RAD_TO_DEG_F * _rGpsPos.get() / R; - float noiseLonDegE7 = noiseLatDegE7 / cosLSing; - float noiseAlt = _rGpsAlt.get(); - RPos(2, 2) = noiseLatDegE7 * noiseLatDegE7; - RPos(3, 3) = noiseLonDegE7 * noiseLonDegE7; - // compute correction // http://en.wikipedia.org/wiki/Extended_Kalman_filter Matrix S = HPos * P * HPos.transpose() + RPos; // residual covariance @@ -653,7 +633,6 @@ void KalmanNav::correctPos() // check correction is sane for (size_t i = 0; i < xCorrect.getRows(); i++) { float val = xCorrect(i); - if (isnan(val) || isinf(val)) { // abort correction and return printf("[kalman_demo] numerical failure in gps correction\n"); @@ -684,15 +663,14 @@ void KalmanNav::correctPos() // fault detetcion float beta = y.dot(S.inverse() * y); - if (beta > _faultPos.get()) { printf("fault in gps: beta = %8.4f\n", (double)beta); printf("Y/N: vN: %8.4f, vE: %8.4f, lat: %8.4f, lon: %8.4f, alt: %8.4f\n", - double(y(0) / noiseVel), - double(y(1) / noiseVel), - double(y(2) / noiseLatDegE7), - double(y(3) / noiseLonDegE7), - double(y(4) / noiseAlt)); + double(y(0) / sqrtf(RPos(0,0))), + double(y(1) / sqrtf(RPos(1,1))), + double(y(2) / sqrtf(RPos(2,2))), + double(y(3) / sqrtf(RPos(3,3))), + double(y(4) / sqrtf(RPos(3,3)))); } } @@ -702,7 +680,6 @@ void KalmanNav::updateParams() using namespace control; SuperBlock::updateParams(); - // gyro noise V(0, 0) = _vGyro.get(); // gyro x, rad/s V(1, 1) = _vGyro.get(); // gyro y @@ -714,13 +691,17 @@ void KalmanNav::updateParams() V(5, 5) = _vAccel.get(); // accel z // magnetometer noise + float noiseMin = 1e-6f; float noiseMagSq = _rMag.get() * _rMag.get(); + if (noiseMagSq < noiseMin) noiseMagSq = noiseMin; RAtt(0, 0) = noiseMagSq; // normalized direction RAtt(1, 1) = noiseMagSq; RAtt(2, 2) = noiseMagSq; // accelerometer noise float noiseAccelSq = _rAccel.get() * _rAccel.get(); + // bound noise to prevent singularities + if (noiseAccelSq < noiseMin) noiseAccelSq = noiseMin; RAtt(3, 3) = noiseAccelSq; // normalized direction RAtt(4, 4) = noiseAccelSq; RAtt(5, 5) = noiseAccelSq; @@ -739,9 +720,16 @@ void KalmanNav::updateParams() float noiseLatDegE7 = 1.0e7f * M_RAD_TO_DEG_F * _rGpsPos.get() / R; float noiseLonDegE7 = noiseLatDegE7 / cosLSing; float noiseAlt = _rGpsAlt.get(); + // bound noise to prevent singularities + if (noiseVel < noiseMin) noiseVel = noiseMin; + if (noiseLatDegE7 < noiseMin) noiseLatDegE7 = noiseMin; + if (noiseLonDegE7 < noiseMin) noiseLonDegE7 = noiseMin; + if (noiseAlt < noiseMin) noiseAlt = noiseMin; RPos(0, 0) = noiseVel * noiseVel; // vn RPos(1, 1) = noiseVel * noiseVel; // ve RPos(2, 2) = noiseLatDegE7 * noiseLatDegE7; // lat RPos(3, 3) = noiseLonDegE7 * noiseLonDegE7; // lon RPos(4, 4) = noiseAlt * noiseAlt; // h + // XXX, note that RPos depends on lat, so updateParams should + // be called if lat changes significantly } diff --git a/apps/mavlink/orb_listener.c b/apps/mavlink/orb_listener.c index f5253ea358..a7b43e2b9b 100644 --- a/apps/mavlink/orb_listener.c +++ b/apps/mavlink/orb_listener.c @@ -702,7 +702,7 @@ uorb_receive_start(void) /* --- GLOBAL POS VALUE --- */ mavlink_subs.global_pos_sub = orb_subscribe(ORB_ID(vehicle_global_position)); - orb_set_interval(mavlink_subs.global_pos_sub, 1000); /* 1Hz active updates */ + orb_set_interval(mavlink_subs.global_pos_sub, 5); /* 200 Hz active updates */ /* --- LOCAL POS VALUE --- */ mavlink_subs.local_pos_sub = orb_subscribe(ORB_ID(vehicle_local_position)); From afb69cd05450d6df1bf2233b95030c9b93daaf1e Mon Sep 17 00:00:00 2001 From: James Goppert Date: Tue, 15 Jan 2013 15:11:24 -0500 Subject: [PATCH 127/157] Reducing pos/att correction update rates for debugging. --- apps/examples/kalman_demo/KalmanNav.cpp | 8 +++----- apps/mavlink/orb_listener.c | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 0f3069d11e..3966b4fcd1 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -65,8 +65,8 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : C_nb(), q(), // subscriptions - _sensors(&getSubscriptions(), ORB_ID(sensor_combined), 1), // limit to 1000 Hz - _gps(&getSubscriptions(), ORB_ID(vehicle_gps_position), 100), // limit to 10 Hz + _sensors(&getSubscriptions(), ORB_ID(sensor_combined), 5), // limit to 200 Hz + _gps(&getSubscriptions(), ORB_ID(vehicle_gps_position), 1000), // limit to 1 Hz _param_update(&getSubscriptions(), ORB_ID(parameter_update), 1000), // limit to 1 Hz // publications _pos(&getPublications(), ORB_ID(vehicle_global_position)), @@ -208,7 +208,6 @@ void KalmanNav::update() predictFast(dtFast); // count fast frames _navFrames += 1; - } else _missFast++; // slow prediction step @@ -216,7 +215,6 @@ void KalmanNav::update() if (dtSlow > 1.0f / 100) { // 100 Hz _slowTimeStamp = _sensors.timestamp; - if (dtSlow < 1.0f / 50) predictSlow(dtSlow); else _missSlow ++; } @@ -227,7 +225,7 @@ void KalmanNav::update() } // attitude correction step - if (_sensors.timestamp - _attTimeStamp > 1e6 / 20) { // 20 Hz + if (_sensors.timestamp - _attTimeStamp > 1e6 / 1) { // 1 Hz _attTimeStamp = _sensors.timestamp; correctAtt(); } diff --git a/apps/mavlink/orb_listener.c b/apps/mavlink/orb_listener.c index a7b43e2b9b..43bb4fb284 100644 --- a/apps/mavlink/orb_listener.c +++ b/apps/mavlink/orb_listener.c @@ -702,7 +702,7 @@ uorb_receive_start(void) /* --- GLOBAL POS VALUE --- */ mavlink_subs.global_pos_sub = orb_subscribe(ORB_ID(vehicle_global_position)); - orb_set_interval(mavlink_subs.global_pos_sub, 5); /* 200 Hz active updates */ + orb_set_interval(mavlink_subs.global_pos_sub, 100); /* 10 Hz active updates */ /* --- LOCAL POS VALUE --- */ mavlink_subs.local_pos_sub = orb_subscribe(ORB_ID(vehicle_local_position)); From 07114f0a322613a1c3f2838df54916fdac4d8691 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 15 Jan 2013 23:17:12 +0100 Subject: [PATCH 128/157] Windows build fix attempt --- nuttx/configs/px4fmu/common/Make.defs | 4 ++-- nuttx/configs/px4io/common/Make.defs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nuttx/configs/px4fmu/common/Make.defs b/nuttx/configs/px4fmu/common/Make.defs index 52c00cd5a7..756286ccb5 100644 --- a/nuttx/configs/px4fmu/common/Make.defs +++ b/nuttx/configs/px4fmu/common/Make.defs @@ -79,7 +79,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}" @@ -88,7 +88,7 @@ ifeq ($(WINTOOL),y) else ifeq ($(PX4_WINTOOL),y) # Windows-native toolchains (MSYS) - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem $(TOPDIR)/include diff --git a/nuttx/configs/px4io/common/Make.defs b/nuttx/configs/px4io/common/Make.defs index d6d52e3d24..4958f70926 100644 --- a/nuttx/configs/px4io/common/Make.defs +++ b/nuttx/configs/px4io/common/Make.defs @@ -72,7 +72,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}" @@ -81,7 +81,7 @@ ifeq ($(WINTOOL),y) else ifeq ($(PX4_WINTOOL),y) # Windows-native toolchains (MSYS) - DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRLINK = $(TOPDIR)/tools/copydir.sh DIRUNLINK = $(TOPDIR)/tools/unlink.sh MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem $(TOPDIR)/include From 68a6a64213b5af66771a6a302bf06c4c588dc719 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Tue, 15 Jan 2013 18:25:08 -0500 Subject: [PATCH 129/157] Working on velocity errors. --- apps/examples/kalman_demo/KalmanNav.cpp | 86 ++++++++++++++----------- apps/examples/kalman_demo/KalmanNav.hpp | 1 + apps/examples/kalman_demo/params.c | 1 + apps/mavlink/mavlink_receiver.c | 7 +- 4 files changed, 57 insertions(+), 38 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 3966b4fcd1..41e948ae2d 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -45,7 +45,7 @@ // Titterton pg. 52 static const float omega = 7.2921150e-5f; // earth rotation rate, rad/s static const float R0 = 6378137.0f; // earth radius, m -static const float g = 9.806f; // gravitational accel. m/s^2, XXX should be calibrated +static const float g0 = 9.806f; // standard gravitational accel. m/s^2 KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : SuperBlock(parent, name), @@ -98,6 +98,7 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : _rAccel(this, "R_ACCEL"), _magDip(this, "MAG_DIP"), _magDec(this, "MAG_DEC"), + _g(this, "G"), _faultPos(this, "FAULT_POS"), _faultAtt(this, "FAULT_ATT"), _positionInitialized(false) @@ -119,8 +120,6 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : lon = 0.0f; alt = 0.0f; - - // initialize quaternions q = Quaternion(EulerAngles(phi, theta, psi)); @@ -142,16 +141,12 @@ void KalmanNav::update() { using namespace math; - struct pollfd fds[3]; + struct pollfd fds[1]; fds[0].fd = _sensors.getHandle(); fds[0].events = POLLIN; - fds[1].fd = _param_update.getHandle(); - fds[1].events = POLLIN; - fds[2].fd = _gps.getHandle(); - fds[2].events = POLLIN; - // poll 20 milliseconds for new data - int ret = poll(fds, 2, 20); + // poll for new data + int ret = poll(fds, 1, 1000); // check return value if (ret < 0) { @@ -202,22 +197,25 @@ void KalmanNav::update() // note, using sensors timestamp so we can account // for packet lag float dtFast = (_sensors.timestamp - _fastTimeStamp) / 1.0e6f; + printf("dtFast: %15.10f\n", double(dtFast)); _fastTimeStamp = _sensors.timestamp; - if (dtFast < 1.0f / 50) { + if (dtFast < 1.0f) { predictFast(dtFast); + predictSlow(dtFast); // count fast frames _navFrames += 1; + } else _missFast++; // slow prediction step - float dtSlow = (_sensors.timestamp - _slowTimeStamp) / 1.0e6f; + //float dtSlow = (_sensors.timestamp - _slowTimeStamp) / 1.0e6f; - if (dtSlow > 1.0f / 100) { // 100 Hz - _slowTimeStamp = _sensors.timestamp; - if (dtSlow < 1.0f / 50) predictSlow(dtSlow); - else _missSlow ++; - } + //if (dtSlow > 1.0f / 100) { // 100 Hz + //_slowTimeStamp = _sensors.timestamp; + //if (dtSlow < 1.0f / 50) predictSlow(dtSlow); + //else _missSlow ++; + //} // gps correction step if (gpsUpdate) { @@ -240,7 +238,7 @@ void KalmanNav::update() if (newTimeStamp - _outTimeStamp > 10e6) { // 0.1 Hz _outTimeStamp = newTimeStamp; printf("nav: %4d Hz, misses fast: %4d slow: %4d\n", - _navFrames/10, _missFast/10, _missSlow/10); + _navFrames / 10, _missFast / 10, _missSlow / 10); _navFrames = 0; _missFast = 0; _missSlow = 0; @@ -340,18 +338,18 @@ void KalmanNav::predictFast(float dt) float vNDot = fN - vE * rotRate * sinL + vD * LDot; float vDDot = fD - vE * rotRate * cosL - - vN * LDot + g; + vN * LDot + _g.get(); float vEDot = fE + vN * rotRate * sinL + vDDot * rotRate * cosL; - //printf("vNDot: %8.4f, vEDot: %8.4f, vDDot: %8.4f\n", - //double(vNDot), double(vEDot), double(vDDot)); - //printf("LDot: %8.4f, lDot: %8.4f, rotRate: %8.4f\n", - //double(LDot), double(lDot), double(rotRate)); + printf("vNDot: %8.4f, vEDot: %8.4f, vDDot: %8.4f\n", + double(vNDot), double(vEDot), double(vDDot)); + printf("LDot: %8.4f, lDot: %8.4f, rotRate: %8.4f\n", + double(LDot), double(lDot), double(rotRate)); // rectangular integration - //printf("dt: %8.4f\n", double(dt)); - //printf("fN: %8.4f, fE: %8.4f, fD: %8.4f\n", double(fN), double(fE), double(fD)); - //printf("vN: %8.4f, vE: %8.4f, vD: %8.4f\n", double(vN), double(vE), double(vD)); + printf("dt: %8.4f\n", double(dt)); + printf("fN: %8.4f, fE: %8.4f, fD: %8.4f\n", double(fN), double(fE), double(fD)); + printf("vN: %8.4f, vE: %8.4f, vD: %8.4f\n", double(vN), double(vE), double(vD)); vN += vNDot * dt; vE += vEDot * dt; vD += vDDot * dt; @@ -495,7 +493,7 @@ void KalmanNav::correctAtt() // ignore accel correction when accel mag not close to g Matrix RAttAdjust = RAtt; - bool ignoreAccel = fabsf(accelMag - g) > 1.1f; + bool ignoreAccel = fabsf(accelMag - _g.get()) > 1.1f; if (ignoreAccel) { RAttAdjust(3, 3) = 1.0e10; @@ -511,7 +509,7 @@ void KalmanNav::correctAtt() //Vector3 zCentrip = Vector3(0, cosf(phi), -sinf(phi))*g*tanf(phi); // accel predicted measurement - Vector3 zAccelHat = (C_nb.transpose() * Vector3(0, 0, -g) /*+ zCentrip*/).unit(); + Vector3 zAccelHat = (C_nb.transpose() * Vector3(0, 0, -_g.get()) /*+ zCentrip*/).unit(); // combined measurement Vector zAtt(6); @@ -572,6 +570,7 @@ void KalmanNav::correctAtt() // check correciton is sane for (size_t i = 0; i < xCorrect.getRows(); i++) { float val = xCorrect(i); + if (isnan(val) || isinf(val)) { // abort correction and return printf("[kalman_demo] numerical failure in att correction\n"); @@ -586,11 +585,12 @@ void KalmanNav::correctAtt() phi += xCorrect(PHI); theta += xCorrect(THETA); } + psi += xCorrect(PSI); // attitude also affects nav velocities - vN += xCorrect(VN); - vE += xCorrect(VE); - vD += xCorrect(VD); + //vN += xCorrect(VN); + //vE += xCorrect(VE); + //vD += xCorrect(VD); // update state covariance // http://en.wikipedia.org/wiki/Extended_Kalman_filter @@ -598,6 +598,7 @@ void KalmanNav::correctAtt() // fault detection float beta = y.dot(S.inverse() * y); + if (beta > _faultAtt.get()) { printf("fault in attitude: beta = %8.4f\n", (double)beta); printf("y:\n"); y.print(); @@ -631,6 +632,7 @@ void KalmanNav::correctPos() // check correction is sane for (size_t i = 0; i < xCorrect.getRows(); i++) { float val = xCorrect(i); + if (isnan(val) || isinf(val)) { // abort correction and return printf("[kalman_demo] numerical failure in gps correction\n"); @@ -661,14 +663,15 @@ void KalmanNav::correctPos() // fault detetcion float beta = y.dot(S.inverse() * y); + if (beta > _faultPos.get()) { printf("fault in gps: beta = %8.4f\n", (double)beta); printf("Y/N: vN: %8.4f, vE: %8.4f, lat: %8.4f, lon: %8.4f, alt: %8.4f\n", - double(y(0) / sqrtf(RPos(0,0))), - double(y(1) / sqrtf(RPos(1,1))), - double(y(2) / sqrtf(RPos(2,2))), - double(y(3) / sqrtf(RPos(3,3))), - double(y(4) / sqrtf(RPos(3,3)))); + double(y(0) / sqrtf(RPos(0, 0))), + double(y(1) / sqrtf(RPos(1, 1))), + double(y(2) / sqrtf(RPos(2, 2))), + double(y(3) / sqrtf(RPos(3, 3))), + double(y(4) / sqrtf(RPos(4, 4)))); } } @@ -691,22 +694,26 @@ void KalmanNav::updateParams() // magnetometer noise float noiseMin = 1e-6f; float noiseMagSq = _rMag.get() * _rMag.get(); + if (noiseMagSq < noiseMin) noiseMagSq = noiseMin; + RAtt(0, 0) = noiseMagSq; // normalized direction RAtt(1, 1) = noiseMagSq; RAtt(2, 2) = noiseMagSq; // accelerometer noise float noiseAccelSq = _rAccel.get() * _rAccel.get(); + // bound noise to prevent singularities if (noiseAccelSq < noiseMin) noiseAccelSq = noiseMin; + RAtt(3, 3) = noiseAccelSq; // normalized direction RAtt(4, 4) = noiseAccelSq; RAtt(5, 5) = noiseAccelSq; // gps noise - float cosLSing = cosf(lat); float R = R0 + float(alt); + float cosLSing = cosf(lat); // prevent singularity if (fabsf(cosLSing) < 0.01f) { @@ -718,11 +725,16 @@ void KalmanNav::updateParams() float noiseLatDegE7 = 1.0e7f * M_RAD_TO_DEG_F * _rGpsPos.get() / R; float noiseLonDegE7 = noiseLatDegE7 / cosLSing; float noiseAlt = _rGpsAlt.get(); + // bound noise to prevent singularities if (noiseVel < noiseMin) noiseVel = noiseMin; + if (noiseLatDegE7 < noiseMin) noiseLatDegE7 = noiseMin; + if (noiseLonDegE7 < noiseMin) noiseLonDegE7 = noiseMin; + if (noiseAlt < noiseMin) noiseAlt = noiseMin; + RPos(0, 0) = noiseVel * noiseVel; // vn RPos(1, 1) = noiseVel * noiseVel; // ve RPos(2, 2) = noiseLatDegE7 * noiseLatDegE7; // lat diff --git a/apps/examples/kalman_demo/KalmanNav.hpp b/apps/examples/kalman_demo/KalmanNav.hpp index 4af8bbf5c2..d7068beecf 100644 --- a/apps/examples/kalman_demo/KalmanNav.hpp +++ b/apps/examples/kalman_demo/KalmanNav.hpp @@ -159,6 +159,7 @@ protected: control::BlockParam _rAccel; /**< accelerometer measurement noise */ control::BlockParam _magDip; /**< magnetic inclination with level */ control::BlockParam _magDec; /**< magnetic declination, clockwise rotation */ + control::BlockParam _g; /**< gravitational constant */ control::BlockParam _faultPos; /**< fault detection threshold for position */ control::BlockParam _faultAtt; /**< fault detection threshold for attitude */ // status diff --git a/apps/examples/kalman_demo/params.c b/apps/examples/kalman_demo/params.c index b98dd8fd72..2cdbc1435f 100644 --- a/apps/examples/kalman_demo/params.c +++ b/apps/examples/kalman_demo/params.c @@ -12,3 +12,4 @@ PARAM_DEFINE_FLOAT(KF_MAG_DIP, 60.0f); PARAM_DEFINE_FLOAT(KF_MAG_DEC, 0.0f); PARAM_DEFINE_FLOAT(KF_FAULT_POS, 1000.0f); PARAM_DEFINE_FLOAT(KF_FAULT_ATT, 10.0f); +PARAM_DEFINE_FLOAT(KF_G, 9.806f); diff --git a/apps/mavlink/mavlink_receiver.c b/apps/mavlink/mavlink_receiver.c index 0b63c30a4a..9491ce7e3b 100644 --- a/apps/mavlink/mavlink_receiver.c +++ b/apps/mavlink/mavlink_receiver.c @@ -318,9 +318,11 @@ handle_message(mavlink_message_t *msg) static uint16_t hil_frames = 0; static uint64_t old_timestamp = 0; + /* sensors general */ + hil_sensors.timestamp = imu.time_usec; + /* hil gyro */ static const float mrad2rad = 1.0e-3f; - hil_sensors.timestamp = timestamp; hil_sensors.gyro_counter = hil_counter; hil_sensors.gyro_raw[0] = imu.xgyro; hil_sensors.gyro_raw[1] = imu.ygyro; @@ -429,6 +431,9 @@ handle_message(mavlink_message_t *msg) static uint16_t hil_frames = 0; static uint64_t old_timestamp = 0; + /* sensors general */ + hil_sensors.timestamp = press.time_usec; + /* baro */ /* TODO, set ground_press/ temp during calib */ static const float ground_press = 1013.25f; // mbar From ce3f835c637338086a18307c61deb35ccddbee05 Mon Sep 17 00:00:00 2001 From: jgoppert Date: Tue, 15 Jan 2013 23:36:01 -0500 Subject: [PATCH 130/157] Mag and velocity measurement fix. Fault detection working. --- apps/examples/kalman_demo/KalmanNav.cpp | 79 +++++++++++-------------- apps/examples/kalman_demo/KalmanNav.hpp | 29 +++++---- apps/examples/kalman_demo/params.c | 25 ++++---- 3 files changed, 62 insertions(+), 71 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 41e948ae2d..d93a7bdc6a 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -73,15 +73,13 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : _att(&getPublications(), ORB_ID(vehicle_attitude)), // timestamps _pubTimeStamp(hrt_absolute_time()), - _fastTimeStamp(hrt_absolute_time()), - _slowTimeStamp(hrt_absolute_time()), + _predictTimeStamp(hrt_absolute_time()), _attTimeStamp(hrt_absolute_time()), _outTimeStamp(hrt_absolute_time()), // frame count _navFrames(0), // miss counts - _missFast(0), - _missSlow(0), + _miss(0), // accelerations fN(0), fE(0), fD(0), // state @@ -96,9 +94,9 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : _rGpsPos(this, "R_GPS_POS"), _rGpsAlt(this, "R_GPS_ALT"), _rAccel(this, "R_ACCEL"), - _magDip(this, "MAG_DIP"), - _magDec(this, "MAG_DEC"), - _g(this, "G"), + _magDip(this, "ENV_MAG_DIP"), + _magDec(this, "ENV_MAG_DEC"), + _g(this, "ENV_G"), _faultPos(this, "FAULT_POS"), _faultAtt(this, "FAULT_ATT"), _positionInitialized(false) @@ -193,29 +191,21 @@ void KalmanNav::update() lat, lon, alt); } - // fast prediciton step - // note, using sensors timestamp so we can account - // for packet lag - float dtFast = (_sensors.timestamp - _fastTimeStamp) / 1.0e6f; - printf("dtFast: %15.10f\n", double(dtFast)); - _fastTimeStamp = _sensors.timestamp; - - if (dtFast < 1.0f) { - predictFast(dtFast); - predictSlow(dtFast); + // prediciton step + // using sensors timestamp so we can account for packet lag + float dt= (_sensors.timestamp - _predictTimeStamp) / 1.0e6f; + //printf("dt: %15.10f\n", double(dtFast)); + _predictTimeStamp = _sensors.timestamp; + // don't predict if time greater than a second + if (dt < 1.0f) { + predictState(dt); + predictStateCovariance(dt); // count fast frames _navFrames += 1; + } - } else _missFast++; - - // slow prediction step - //float dtSlow = (_sensors.timestamp - _slowTimeStamp) / 1.0e6f; - - //if (dtSlow > 1.0f / 100) { // 100 Hz - //_slowTimeStamp = _sensors.timestamp; - //if (dtSlow < 1.0f / 50) predictSlow(dtSlow); - //else _missSlow ++; - //} + // count times 100 Hz rate isn't met + if (dt > 0.01f) _miss++; // gps correction step if (gpsUpdate) { @@ -237,11 +227,10 @@ void KalmanNav::update() // output if (newTimeStamp - _outTimeStamp > 10e6) { // 0.1 Hz _outTimeStamp = newTimeStamp; - printf("nav: %4d Hz, misses fast: %4d slow: %4d\n", - _navFrames / 10, _missFast / 10, _missSlow / 10); + printf("nav: %4d Hz, miss #: %4d\n", + _navFrames / 10, _miss/ 10); _navFrames = 0; - _missFast = 0; - _missSlow = 0; + _miss= 0; } } @@ -288,7 +277,7 @@ void KalmanNav::updatePublications() SuperBlock::updatePublications(); } -void KalmanNav::predictFast(float dt) +void KalmanNav::predictState(float dt) { using namespace math; Vector3 w(_sensors.gyro_rad_s); @@ -336,20 +325,13 @@ void KalmanNav::predictFast(float dt) float lDot = vE / (cosLSing * R); float rotRate = 2 * omega + lDot; float vNDot = fN - vE * rotRate * sinL + - vD * LDot; + vD * LDot; float vDDot = fD - vE * rotRate * cosL - - vN * LDot + _g.get(); + vN * LDot + _g.get(); float vEDot = fE + vN * rotRate * sinL + - vDDot * rotRate * cosL; - printf("vNDot: %8.4f, vEDot: %8.4f, vDDot: %8.4f\n", - double(vNDot), double(vEDot), double(vDDot)); - printf("LDot: %8.4f, lDot: %8.4f, rotRate: %8.4f\n", - double(LDot), double(lDot), double(rotRate)); + vDDot * rotRate * cosL; // rectangular integration - printf("dt: %8.4f\n", double(dt)); - printf("fN: %8.4f, fE: %8.4f, fD: %8.4f\n", double(fN), double(fE), double(fD)); - printf("vN: %8.4f, vE: %8.4f, vD: %8.4f\n", double(vN), double(vE), double(vD)); vN += vNDot * dt; vE += vEDot * dt; vD += vDDot * dt; @@ -358,7 +340,7 @@ void KalmanNav::predictFast(float dt) alt += double(-vD * dt); } -void KalmanNav::predictSlow(float dt) +void KalmanNav::predictStateCovariance(float dt) { using namespace math; @@ -473,6 +455,8 @@ void KalmanNav::correctAtt() // mag measurement Vector3 zMag(_sensors.magnetometer_ga); + //float magNorm = zMag.norm(); + zMag = zMag.unit(); // mag predicted measurement // choosing some typical magnetic field properties, @@ -588,9 +572,9 @@ void KalmanNav::correctAtt() psi += xCorrect(PSI); // attitude also affects nav velocities - //vN += xCorrect(VN); - //vE += xCorrect(VE); - //vD += xCorrect(VD); + vN += xCorrect(VN); + vE += xCorrect(VE); + vD += xCorrect(VD); // update state covariance // http://en.wikipedia.org/wiki/Extended_Kalman_filter @@ -602,6 +586,9 @@ void KalmanNav::correctAtt() if (beta > _faultAtt.get()) { printf("fault in attitude: beta = %8.4f\n", (double)beta); printf("y:\n"); y.print(); + printf("zMagHat:\n"); zMagHat.print(); + printf("zMag:\n"); zMag.print(); + printf("bNav:\n"); bNav.print(); } // update quaternions from euler diff --git a/apps/examples/kalman_demo/KalmanNav.hpp b/apps/examples/kalman_demo/KalmanNav.hpp index d7068beecf..da1a7ee108 100644 --- a/apps/examples/kalman_demo/KalmanNav.hpp +++ b/apps/examples/kalman_demo/KalmanNav.hpp @@ -83,18 +83,23 @@ public: */ void update(); - /** - * Fast prediction - * Contains: state integration - */ - virtual void updatePublications(); - void predictFast(float dt); /** - * Slow prediction - * Contains: covariance integration + * Publication update */ - void predictSlow(float dt); + virtual void updatePublications(); + + /** + * State prediction + * Continuous, non-linear + */ + void predictState(float dt); + + /** + * State covariance prediction + * Continuous, linear + */ + void predictStateCovariance(float dt); /** * Attitude correction @@ -133,15 +138,13 @@ protected: control::UOrbPublication _att; /**< attitude pub. */ // time stamps uint64_t _pubTimeStamp; /**< output data publication time stamp */ - uint64_t _fastTimeStamp; /**< fast prediction time stamp */ - uint64_t _slowTimeStamp; /**< slow prediction time stamp */ + uint64_t _predictTimeStamp; /**< prediction time stamp */ uint64_t _attTimeStamp; /**< attitude correction time stamp */ uint64_t _outTimeStamp; /**< output time stamp */ // frame count uint16_t _navFrames; /**< navigation frames completed in output cycle */ // miss counts - uint16_t _missFast; /**< number of times fast prediction loop missed */ - uint16_t _missSlow; /**< number of times slow prediction loop missed */ + uint16_t _miss; /**< number of times fast prediction loop missed */ // accelerations float fN, fE, fD; /**< navigation frame acceleration */ // states diff --git a/apps/examples/kalman_demo/params.c b/apps/examples/kalman_demo/params.c index 2cdbc1435f..58ebeba3c5 100644 --- a/apps/examples/kalman_demo/params.c +++ b/apps/examples/kalman_demo/params.c @@ -1,15 +1,16 @@ #include /*PARAM_DEFINE_FLOAT(NAME,0.0f);*/ -PARAM_DEFINE_FLOAT(KF_V_GYRO, 0.01f); -PARAM_DEFINE_FLOAT(KF_V_ACCEL, 0.01f); -PARAM_DEFINE_FLOAT(KF_R_MAG, 1.0f); -PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 1.0f); -PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 1.0f); -PARAM_DEFINE_FLOAT(KF_R_GPS_ALT, 1.0f); -PARAM_DEFINE_FLOAT(KF_R_ACCEL, 1.0f); -PARAM_DEFINE_FLOAT(KF_MAG_DIP, 60.0f); -PARAM_DEFINE_FLOAT(KF_MAG_DEC, 0.0f); -PARAM_DEFINE_FLOAT(KF_FAULT_POS, 1000.0f); -PARAM_DEFINE_FLOAT(KF_FAULT_ATT, 10.0f); -PARAM_DEFINE_FLOAT(KF_G, 9.806f); +PARAM_DEFINE_FLOAT(KF_V_GYRO, 0.1f); +PARAM_DEFINE_FLOAT(KF_V_ACCEL, 0.1f); +PARAM_DEFINE_FLOAT(KF_R_MAG, 0.1f); +PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 0.1f); +PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 5.0f); +PARAM_DEFINE_FLOAT(KF_R_GPS_ALT, 5.0f); +PARAM_DEFINE_FLOAT(KF_R_ACCEL, 0.1f); +PARAM_DEFINE_FLOAT(KF_FAULT_POS, 1.0f); +PARAM_DEFINE_FLOAT(KF_FAULT_ATT, 1.0f); +PARAM_DEFINE_FLOAT(KF_ENV_G, 9.806f); +PARAM_DEFINE_FLOAT(KF_ENV_MAG_DIP, 60.0f); +PARAM_DEFINE_FLOAT(KF_ENV_MAG_DEC, 0.0f); + From f8811649cb91fc88cef7b224b29c6c5f235f1d8d Mon Sep 17 00:00:00 2001 From: jgoppert Date: Wed, 16 Jan 2013 00:24:14 -0500 Subject: [PATCH 131/157] Controller/ EKF tuning. --- apps/examples/control_demo/params.c | 12 ++++++------ apps/examples/kalman_demo/KalmanNav.cpp | 17 +++++++++-------- apps/examples/kalman_demo/params.c | 16 ++++++++-------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/apps/examples/control_demo/params.c b/apps/examples/control_demo/params.c index 422e9b90e6..3eed83b5cb 100644 --- a/apps/examples/control_demo/params.c +++ b/apps/examples/control_demo/params.c @@ -15,16 +15,16 @@ PARAM_DEFINE_FLOAT(FWB_R_HP, 1.0f); // yaw rate high pass // stabilization mode PARAM_DEFINE_FLOAT(FWB_P2AIL, 0.5f); // roll rate 2 aileron -PARAM_DEFINE_FLOAT(FWB_Q2ELV, 0.5f); // pitch rate 2 elevator +PARAM_DEFINE_FLOAT(FWB_Q2ELV, 0.2f); // pitch rate 2 elevator PARAM_DEFINE_FLOAT(FWB_R2RDR, 0.2f); // yaw rate 2 rudder // psi -> phi -> p PARAM_DEFINE_FLOAT(FWB_PSI2PHI, 0.5f); // heading 2 roll PARAM_DEFINE_FLOAT(FWB_PHI2P, 1.0f); // roll to roll rate -PARAM_DEFINE_FLOAT(FWB_PHI_LIM_MAX, 0.5f); // roll limit, 28 deg +PARAM_DEFINE_FLOAT(FWB_PHI_LIM_MAX, 0.3f); // roll limit, 28 deg // velocity -> theta -PARAM_DEFINE_FLOAT(FWB_V2THE_P, 0.1f); // velocity to pitch angle PID, prop gain +PARAM_DEFINE_FLOAT(FWB_V2THE_P, 1.0f); // velocity to pitch angle PID, prop gain PARAM_DEFINE_FLOAT(FWB_V2THE_I, 0.0f); // integral gain PARAM_DEFINE_FLOAT(FWB_V2THE_D, 0.0f); // derivative gain PARAM_DEFINE_FLOAT(FWB_V2THE_D_LP, 0.0f); // derivative low-pass @@ -34,7 +34,7 @@ PARAM_DEFINE_FLOAT(FWB_THE_MAX, 0.5f); // the min commanded pitch angle // theta -> q -PARAM_DEFINE_FLOAT(FWB_THE2Q_P, 2.0f); // pitch angle to pitch-rate PID +PARAM_DEFINE_FLOAT(FWB_THE2Q_P, 1.0f); // pitch angle to pitch-rate PID PARAM_DEFINE_FLOAT(FWB_THE2Q_I, 0.0f); PARAM_DEFINE_FLOAT(FWB_THE2Q_D, 0.0f); PARAM_DEFINE_FLOAT(FWB_THE2Q_D_LP, 0.0f); @@ -49,7 +49,7 @@ PARAM_DEFINE_FLOAT(FWB_H2THR_I_MAX, 0.0f); // crosstrack PARAM_DEFINE_FLOAT(FWB_XT2YAW_MAX, 1.57f); // cross-track to yaw angle limit 90 deg -PARAM_DEFINE_FLOAT(FWB_XT2YAW, 0.002f); // cross-track to yaw angle gain +PARAM_DEFINE_FLOAT(FWB_XT2YAW, 0.005f); // cross-track to yaw angle gain // speed command PARAM_DEFINE_FLOAT(FWB_V_MIN, 20.0f); // minimum commanded velocity @@ -60,4 +60,4 @@ PARAM_DEFINE_FLOAT(FWB_V_MAX, 24.0f); // maximum commanded velocity PARAM_DEFINE_FLOAT(FWB_TRIM_AIL, 0.0f); // trim aileron, normalized (-1,1) PARAM_DEFINE_FLOAT(FWB_TRIM_ELV, 0.005f); // trim elevator (-1,1) PARAM_DEFINE_FLOAT(FWB_TRIM_RDR, 0.0f); // trim rudder (-1,1) -PARAM_DEFINE_FLOAT(FWB_TRIM_THR, 0.81f); // trim throttle (0,1) +PARAM_DEFINE_FLOAT(FWB_TRIM_THR, 0.8f); // trim throttle (0,1) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index d93a7bdc6a..6acf39be8c 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -66,7 +66,7 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : q(), // subscriptions _sensors(&getSubscriptions(), ORB_ID(sensor_combined), 5), // limit to 200 Hz - _gps(&getSubscriptions(), ORB_ID(vehicle_gps_position), 1000), // limit to 1 Hz + _gps(&getSubscriptions(), ORB_ID(vehicle_gps_position), 100), // limit to 10 Hz _param_update(&getSubscriptions(), ORB_ID(parameter_update), 1000), // limit to 1 Hz // publications _pos(&getPublications(), ORB_ID(vehicle_global_position)), @@ -193,9 +193,10 @@ void KalmanNav::update() // prediciton step // using sensors timestamp so we can account for packet lag - float dt= (_sensors.timestamp - _predictTimeStamp) / 1.0e6f; + float dt = (_sensors.timestamp - _predictTimeStamp) / 1.0e6f; //printf("dt: %15.10f\n", double(dtFast)); _predictTimeStamp = _sensors.timestamp; + // don't predict if time greater than a second if (dt < 1.0f) { predictState(dt); @@ -213,7 +214,7 @@ void KalmanNav::update() } // attitude correction step - if (_sensors.timestamp - _attTimeStamp > 1e6 / 1) { // 1 Hz + if (_sensors.timestamp - _attTimeStamp > 1e6 / 20) { // 20 Hz _attTimeStamp = _sensors.timestamp; correctAtt(); } @@ -228,9 +229,9 @@ void KalmanNav::update() if (newTimeStamp - _outTimeStamp > 10e6) { // 0.1 Hz _outTimeStamp = newTimeStamp; printf("nav: %4d Hz, miss #: %4d\n", - _navFrames / 10, _miss/ 10); + _navFrames / 10, _miss / 10); _navFrames = 0; - _miss= 0; + _miss = 0; } } @@ -325,11 +326,11 @@ void KalmanNav::predictState(float dt) float lDot = vE / (cosLSing * R); float rotRate = 2 * omega + lDot; float vNDot = fN - vE * rotRate * sinL + - vD * LDot; + vD * LDot; float vDDot = fD - vE * rotRate * cosL - - vN * LDot + _g.get(); + vN * LDot + _g.get(); float vEDot = fE + vN * rotRate * sinL + - vDDot * rotRate * cosL; + vDDot * rotRate * cosL; // rectangular integration vN += vNDot * dt; diff --git a/apps/examples/kalman_demo/params.c b/apps/examples/kalman_demo/params.c index 58ebeba3c5..77225b4c75 100644 --- a/apps/examples/kalman_demo/params.c +++ b/apps/examples/kalman_demo/params.c @@ -1,16 +1,16 @@ #include /*PARAM_DEFINE_FLOAT(NAME,0.0f);*/ -PARAM_DEFINE_FLOAT(KF_V_GYRO, 0.1f); -PARAM_DEFINE_FLOAT(KF_V_ACCEL, 0.1f); -PARAM_DEFINE_FLOAT(KF_R_MAG, 0.1f); -PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 0.1f); +PARAM_DEFINE_FLOAT(KF_V_GYRO, 0.01f); +PARAM_DEFINE_FLOAT(KF_V_ACCEL, 0.01f); +PARAM_DEFINE_FLOAT(KF_R_MAG, 1.0f); +PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 1.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 5.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_ALT, 5.0f); -PARAM_DEFINE_FLOAT(KF_R_ACCEL, 0.1f); -PARAM_DEFINE_FLOAT(KF_FAULT_POS, 1.0f); -PARAM_DEFINE_FLOAT(KF_FAULT_ATT, 1.0f); -PARAM_DEFINE_FLOAT(KF_ENV_G, 9.806f); +PARAM_DEFINE_FLOAT(KF_R_ACCEL, 1.0f); +PARAM_DEFINE_FLOAT(KF_FAULT_POS, 10.0f); +PARAM_DEFINE_FLOAT(KF_FAULT_ATT, 10.0f); +PARAM_DEFINE_FLOAT(KF_ENV_G, 9.765f); PARAM_DEFINE_FLOAT(KF_ENV_MAG_DIP, 60.0f); PARAM_DEFINE_FLOAT(KF_ENV_MAG_DEC, 0.0f); From 41ac3fdef9e3b7210286b438f3dae50af06b814c Mon Sep 17 00:00:00 2001 From: jgoppert Date: Wed, 16 Jan 2013 00:25:53 -0500 Subject: [PATCH 132/157] Increased fault threshhold. --- apps/examples/kalman_demo/params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/examples/kalman_demo/params.c b/apps/examples/kalman_demo/params.c index 77225b4c75..bb18d5b928 100644 --- a/apps/examples/kalman_demo/params.c +++ b/apps/examples/kalman_demo/params.c @@ -8,7 +8,7 @@ PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 1.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 5.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_ALT, 5.0f); PARAM_DEFINE_FLOAT(KF_R_ACCEL, 1.0f); -PARAM_DEFINE_FLOAT(KF_FAULT_POS, 10.0f); +PARAM_DEFINE_FLOAT(KF_FAULT_POS, 1000.0f); PARAM_DEFINE_FLOAT(KF_FAULT_ATT, 10.0f); PARAM_DEFINE_FLOAT(KF_ENV_G, 9.765f); PARAM_DEFINE_FLOAT(KF_ENV_MAG_DIP, 60.0f); From ab0459c1f47689d9b4f2841111bd39f61a1d8f21 Mon Sep 17 00:00:00 2001 From: px4dev Date: Tue, 15 Jan 2013 23:03:47 -0800 Subject: [PATCH 133/157] Pass the absolute path to the compiler/assembler so that error messages include enough information for an IDE to find the file. --- nuttx/tools/Config.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nuttx/tools/Config.mk b/nuttx/tools/Config.mk index 9ac93e7d01..9f36ed4f36 100644 --- a/nuttx/tools/Config.mk +++ b/nuttx/tools/Config.mk @@ -114,7 +114,7 @@ endef define COMPILE @echo "CC: $1" - $(Q) $(CC) -c $(CFLAGS) $1 -o $2 + $(Q) $(CC) -c $(CFLAGS) $(abspath $1) -o $2 endef # COMPILEXX - Default macro to compile one C++ file @@ -128,7 +128,7 @@ endef define COMPILEXX @echo "CXX: $1" - $(Q) $(CXX) -c $(CXXFLAGS) $1 -o $2 + $(Q) $(CXX) -c $(CXXFLAGS) $(abspath $1) -o $2 endef # ASSEMBLE - Default macro to assemble one assembly language file @@ -149,7 +149,7 @@ endef define ASSEMBLE @echo "AS: $1" - $(Q) $(CC) -c $(AFLAGS) $1 -o $2 + $(Q) $(CC) -c $(AFLAGS) $(abspath $1) -o $2 endef # ARCHIVE - Add a list of files to an archive From ded442fd194442134accf0080be3fe73098481c1 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Wed, 16 Jan 2013 13:27:04 -0500 Subject: [PATCH 134/157] Added position initialization. --- apps/examples/kalman_demo/KalmanNav.cpp | 169 +++++++++++++----------- apps/examples/kalman_demo/KalmanNav.hpp | 12 +- apps/examples/kalman_demo/params.c | 2 +- 3 files changed, 102 insertions(+), 81 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 6acf39be8c..15254f7c79 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -46,6 +46,8 @@ static const float omega = 7.2921150e-5f; // earth rotation rate, rad/s static const float R0 = 6378137.0f; // earth radius, m static const float g0 = 9.806f; // standard gravitational accel. m/s^2 +static const int8_t ret_ok = 0; // no error in function +static const int8_t ret_error = -1; // error occurred KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : SuperBlock(parent, name), @@ -99,7 +101,9 @@ KalmanNav::KalmanNav(SuperBlock *parent, const char *name) : _g(this, "ENV_G"), _faultPos(this, "FAULT_POS"), _faultAtt(this, "FAULT_ATT"), - _positionInitialized(false) + _attitudeInitialized(false), + _positionInitialized(false), + _attitudeInitCounter(0) { using namespace math; @@ -146,7 +150,6 @@ void KalmanNav::update() // poll for new data int ret = poll(fds, 1, 1000); - // check return value if (ret < 0) { // XXX this is seriously bad - should be an emergency return; @@ -168,11 +171,24 @@ void KalmanNav::update() // this clears update flag updateSubscriptions(); - // abort update if no new data - if (!(sensorsUpdate || gpsUpdate)) return; + // initialize attitude when sensors online + if (!_attitudeInitialized && sensorsUpdate && + _sensors.accelerometer_counter > 10 && + _sensors.gyro_counter > 10 && + _sensors.magnetometer_counter > 10) { + if (correctAtt() == ret_ok) _attitudeInitCounter++; - // if received gps for first time, reset position to gps + if (_attitudeInitCounter > 100) { + printf("[kalman_demo] initialized EKF attitude\n"); + printf("phi: %8.4f, theta: %8.4f, psi: %8.4f\n", + double(phi), double(theta), double(psi)); + _attitudeInitialized = true; + } + } + + // initialize position when gps received if (!_positionInitialized && + _attitudeInitialized && // wait for attitude first gpsUpdate && _gps.fix_type > 2 && _gps.counter_pos_valid > 10) { @@ -183,9 +199,7 @@ void KalmanNav::update() setLonDegE7(_gps.lon); setAltE3(_gps.alt); _positionInitialized = true; - printf("[kalman_demo] initializing EKF state with GPS\n"); - printf("phi: %8.4f, theta: %8.4f, psi: %8.4f\n", - double(phi), double(theta), double(psi)); + printf("[kalman_demo] initialized EKF state with GPS\n"); printf("vN: %8.4f, vE: %8.4f, vD: %8.4f, lat: %8.4f, lon: %8.4f, alt: %8.4f\n", double(vN), double(vE), double(vD), lat, lon, alt); @@ -194,7 +208,7 @@ void KalmanNav::update() // prediciton step // using sensors timestamp so we can account for packet lag float dt = (_sensors.timestamp - _predictTimeStamp) / 1.0e6f; - //printf("dt: %15.10f\n", double(dtFast)); + //printf("dt: %15.10f\n", double(dt)); _predictTimeStamp = _sensors.timestamp; // don't predict if time greater than a second @@ -209,12 +223,15 @@ void KalmanNav::update() if (dt > 0.01f) _miss++; // gps correction step - if (gpsUpdate) { + if (_positionInitialized && gpsUpdate) { correctPos(); } // attitude correction step - if (_sensors.timestamp - _attTimeStamp > 1e6 / 20) { // 20 Hz + if (_attitudeInitialized // initialized + && sensorsUpdate // new data + && _sensors.timestamp - _attTimeStamp > 1e6 / 20 // 20 Hz + ) { _attTimeStamp = _sensors.timestamp; correctAtt(); } @@ -278,34 +295,9 @@ void KalmanNav::updatePublications() SuperBlock::updatePublications(); } -void KalmanNav::predictState(float dt) +int KalmanNav::predictState(float dt) { using namespace math; - Vector3 w(_sensors.gyro_rad_s); - - // attitude - q = q + q.derivative(w) * dt; - - // renormalize quaternion if needed - if (fabsf(q.norm() - 1.0f) > 1e-4f) { - q = q.unit(); - } - - // C_nb update - C_nb = Dcm(q); - - // euler update - EulerAngles euler(C_nb); - phi = euler.getPhi(); - theta = euler.getTheta(); - psi = euler.getPsi(); - - // specific acceleration in nav frame - Vector3 accelB(_sensors.accelerometer_m_s2); - Vector3 accelN = C_nb * accelB; - fN = accelN(0); - fE = accelN(1); - fD = accelN(2); // trig float sinL = sinf(lat); @@ -318,30 +310,63 @@ void KalmanNav::predictState(float dt) else cosLSing = -0.01; } - // position update - // neglects angular deflections in local gravity - // see Titerton pg. 70 - float R = R0 + float(alt); - float LDot = vN / R; - float lDot = vE / (cosLSing * R); - float rotRate = 2 * omega + lDot; - float vNDot = fN - vE * rotRate * sinL + - vD * LDot; - float vDDot = fD - vE * rotRate * cosL - - vN * LDot + _g.get(); - float vEDot = fE + vN * rotRate * sinL + - vDDot * rotRate * cosL; + // attitude prediction + if (_attitudeInitialized) { + Vector3 w(_sensors.gyro_rad_s); - // rectangular integration - vN += vNDot * dt; - vE += vEDot * dt; - vD += vDDot * dt; - lat += double(LDot * dt); - lon += double(lDot * dt); - alt += double(-vD * dt); + // attitude + q = q + q.derivative(w) * dt; + + // renormalize quaternion if needed + if (fabsf(q.norm() - 1.0f) > 1e-4f) { + q = q.unit(); + } + + // C_nb update + C_nb = Dcm(q); + + // euler update + EulerAngles euler(C_nb); + phi = euler.getPhi(); + theta = euler.getTheta(); + psi = euler.getPsi(); + + // specific acceleration in nav frame + Vector3 accelB(_sensors.accelerometer_m_s2); + Vector3 accelN = C_nb * accelB; + fN = accelN(0); + fE = accelN(1); + fD = accelN(2); + } + + // position prediction + if (_positionInitialized) { + // neglects angular deflections in local gravity + // see Titerton pg. 70 + float R = R0 + float(alt); + float LDot = vN / R; + float lDot = vE / (cosLSing * R); + float rotRate = 2 * omega + lDot; + float vNDot = fN - vE * rotRate * sinL + + vD * LDot; + float vDDot = fD - vE * rotRate * cosL - + vN * LDot + _g.get(); + float vEDot = fE + vN * rotRate * sinL + + vDDot * rotRate * cosL; + + // rectangular integration + vN += vNDot * dt; + vE += vEDot * dt; + vD += vDDot * dt; + lat += double(LDot * dt); + lon += double(lDot * dt); + alt += double(-vD * dt); + } + + return ret_ok; } -void KalmanNav::predictStateCovariance(float dt) +int KalmanNav::predictStateCovariance(float dt) { using namespace math; @@ -434,18 +459,14 @@ void KalmanNav::predictStateCovariance(float dt) // for discrte time EKF // http://en.wikipedia.org/wiki/Extended_Kalman_filter P = P + (F * P + P * F.transpose() + G * V * G.transpose()) * dt; + + return ret_ok; } -void KalmanNav::correctAtt() +int KalmanNav::correctAtt() { using namespace math; - // check for valid data, return if not ready - if (_sensors.accelerometer_counter < 10 || - _sensors.gyro_counter < 10 || - _sensors.magnetometer_counter < 10) - return; - // trig float cosPhi = cosf(phi); float cosTheta = cosf(theta); @@ -489,12 +510,8 @@ void KalmanNav::correctAtt() //printf("correcting attitude with accel\n"); } - // account for banked turn - // this would only work for fixed wing, so try to avoid - //Vector3 zCentrip = Vector3(0, cosf(phi), -sinf(phi))*g*tanf(phi); - // accel predicted measurement - Vector3 zAccelHat = (C_nb.transpose() * Vector3(0, 0, -_g.get()) /*+ zCentrip*/).unit(); + Vector3 zAccelHat = (C_nb.transpose() * Vector3(0, 0, -_g.get())).unit(); // combined measurement Vector zAtt(6); @@ -561,7 +578,7 @@ void KalmanNav::correctAtt() printf("[kalman_demo] numerical failure in att correction\n"); // reset P matrix to P0 P = P0; - return; + return ret_error; } } @@ -595,14 +612,14 @@ void KalmanNav::correctAtt() // update quaternions from euler // angle correction q = Quaternion(EulerAngles(phi, theta, psi)); + + return ret_ok; } -void KalmanNav::correctPos() +int KalmanNav::correctPos() { using namespace math; - if (!_positionInitialized) return; - // residual Vector y(5); y(0) = _gps.vel_n - vN; @@ -633,7 +650,7 @@ void KalmanNav::correctPos() setAltE3(_gps.alt); // reset P matrix to P0 P = P0; - return; + return ret_error; } } @@ -661,6 +678,8 @@ void KalmanNav::correctPos() double(y(3) / sqrtf(RPos(3, 3))), double(y(4) / sqrtf(RPos(4, 4)))); } + + return ret_ok; } void KalmanNav::updateParams() diff --git a/apps/examples/kalman_demo/KalmanNav.hpp b/apps/examples/kalman_demo/KalmanNav.hpp index da1a7ee108..7709ac697c 100644 --- a/apps/examples/kalman_demo/KalmanNav.hpp +++ b/apps/examples/kalman_demo/KalmanNav.hpp @@ -93,23 +93,23 @@ public: * State prediction * Continuous, non-linear */ - void predictState(float dt); + int predictState(float dt); /** * State covariance prediction * Continuous, linear */ - void predictStateCovariance(float dt); + int predictStateCovariance(float dt); /** * Attitude correction */ - void correctAtt(); + int correctAtt(); /** * Position correction */ - void correctPos(); + int correctPos(); /** * Overloaded update parameters @@ -166,7 +166,9 @@ protected: control::BlockParam _faultPos; /**< fault detection threshold for position */ control::BlockParam _faultAtt; /**< fault detection threshold for attitude */ // status - bool _positionInitialized; /**< status, if position has been init. */ + bool _attitudeInitialized; + bool _positionInitialized; + uint16_t _attitudeInitCounter; // accessors int32_t getLatDegE7() { return int32_t(lat * 1.0e7 * M_RAD_TO_DEG); } void setLatDegE7(int32_t val) { lat = val / 1.0e7 / M_RAD_TO_DEG; } diff --git a/apps/examples/kalman_demo/params.c b/apps/examples/kalman_demo/params.c index bb18d5b928..77225b4c75 100644 --- a/apps/examples/kalman_demo/params.c +++ b/apps/examples/kalman_demo/params.c @@ -8,7 +8,7 @@ PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 1.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 5.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_ALT, 5.0f); PARAM_DEFINE_FLOAT(KF_R_ACCEL, 1.0f); -PARAM_DEFINE_FLOAT(KF_FAULT_POS, 1000.0f); +PARAM_DEFINE_FLOAT(KF_FAULT_POS, 10.0f); PARAM_DEFINE_FLOAT(KF_FAULT_ATT, 10.0f); PARAM_DEFINE_FLOAT(KF_ENV_G, 9.765f); PARAM_DEFINE_FLOAT(KF_ENV_MAG_DIP, 60.0f); From 34d70bea4bb2a1719e4d081cf59081b84037d423 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Wed, 16 Jan 2013 13:55:49 -0500 Subject: [PATCH 135/157] Control tuning. --- apps/examples/control_demo/params.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/examples/control_demo/params.c b/apps/examples/control_demo/params.c index 3eed83b5cb..6525b70f56 100644 --- a/apps/examples/control_demo/params.c +++ b/apps/examples/control_demo/params.c @@ -14,9 +14,9 @@ PARAM_DEFINE_FLOAT(FWB_R_LP, 300.0f); // yaw rate low pass cut freq PARAM_DEFINE_FLOAT(FWB_R_HP, 1.0f); // yaw rate high pass // stabilization mode -PARAM_DEFINE_FLOAT(FWB_P2AIL, 0.5f); // roll rate 2 aileron -PARAM_DEFINE_FLOAT(FWB_Q2ELV, 0.2f); // pitch rate 2 elevator -PARAM_DEFINE_FLOAT(FWB_R2RDR, 0.2f); // yaw rate 2 rudder +PARAM_DEFINE_FLOAT(FWB_P2AIL, 0.3f); // roll rate 2 aileron +PARAM_DEFINE_FLOAT(FWB_Q2ELV, 0.1f); // pitch rate 2 elevator +PARAM_DEFINE_FLOAT(FWB_R2RDR, 0.1f); // yaw rate 2 rudder // psi -> phi -> p PARAM_DEFINE_FLOAT(FWB_PSI2PHI, 0.5f); // heading 2 roll From c2c0baf843aa376681fcf7bf9dfcac480177b7fb Mon Sep 17 00:00:00 2001 From: James Goppert Date: Thu, 17 Jan 2013 12:16:21 -0500 Subject: [PATCH 136/157] Increased process noise. --- apps/examples/kalman_demo/params.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/examples/kalman_demo/params.c b/apps/examples/kalman_demo/params.c index 77225b4c75..3bfe012612 100644 --- a/apps/examples/kalman_demo/params.c +++ b/apps/examples/kalman_demo/params.c @@ -1,8 +1,8 @@ #include /*PARAM_DEFINE_FLOAT(NAME,0.0f);*/ -PARAM_DEFINE_FLOAT(KF_V_GYRO, 0.01f); -PARAM_DEFINE_FLOAT(KF_V_ACCEL, 0.01f); +PARAM_DEFINE_FLOAT(KF_V_GYRO, 1.0f); +PARAM_DEFINE_FLOAT(KF_V_ACCEL, 1.0f); PARAM_DEFINE_FLOAT(KF_R_MAG, 1.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 1.0f); PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 5.0f); From 13bb814f2015154cb5cadb814e37db1b6b2e634b Mon Sep 17 00:00:00 2001 From: James Goppert Date: Thu, 17 Jan 2013 12:18:20 -0500 Subject: [PATCH 137/157] Prevented attitude correction from changing velocity when pos not init. --- apps/examples/kalman_demo/KalmanNav.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 15254f7c79..40166f3a14 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -590,9 +590,11 @@ int KalmanNav::correctAtt() psi += xCorrect(PSI); // attitude also affects nav velocities - vN += xCorrect(VN); - vE += xCorrect(VE); - vD += xCorrect(VD); + if (_positionInitialized) { + vN += xCorrect(VN); + vE += xCorrect(VE); + vD += xCorrect(VD); + } // update state covariance // http://en.wikipedia.org/wiki/Extended_Kalman_filter From dc5ddb937039fd3481009caeb2a472955986e2e4 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 16 Jan 2013 08:41:11 +0100 Subject: [PATCH 138/157] Defaulting to full auto in auto mode --- apps/commander/commander.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/commander/commander.c b/apps/commander/commander.c index f3568ee8d0..33f1832272 100644 --- a/apps/commander/commander.c +++ b/apps/commander/commander.c @@ -1845,15 +1845,16 @@ int commander_thread_main(int argc, char *argv[]) update_state_machine_mode_manual(stat_pub, ¤t_status, mavlink_fd); } else if (sp_man.manual_override_switch < -STICK_ON_OFF_LIMIT) { - /* check auto mode switch for correct mode */ - if (sp_man.auto_mode_switch > STICK_ON_OFF_LIMIT) { - /* enable guided mode */ - update_state_machine_mode_guided(stat_pub, ¤t_status, mavlink_fd); + // /* check auto mode switch for correct mode */ + // if (sp_man.auto_mode_switch > STICK_ON_OFF_LIMIT) { + // /* enable guided mode */ + // update_state_machine_mode_guided(stat_pub, ¤t_status, mavlink_fd); - } else if (sp_man.auto_mode_switch < -STICK_ON_OFF_LIMIT) { + // } else if (sp_man.auto_mode_switch < -STICK_ON_OFF_LIMIT) { + // XXX hardcode to auto for now update_state_machine_mode_auto(stat_pub, ¤t_status, mavlink_fd); - } + // } } else { /* center stick position, set SAS for all vehicle types */ From c5ecf88bfba7e359717df1977c920d2d29a90b3f Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Sun, 16 Dec 2012 19:30:43 -0800 Subject: [PATCH 139/157] Added ubx configuration CFG-NAV5 to airborne with less than 2g acceleration (compiling, not tested) --- apps/gps/ubx.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/gps/ubx.c b/apps/gps/ubx.c index e15ed4e00a..01d098871d 100644 --- a/apps/gps/ubx.c +++ b/apps/gps/ubx.c @@ -76,6 +76,11 @@ uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_SOL[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_VELNED[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x12, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}; uint8_t UBX_CONFIG_MESSAGE_MSG_RXM_SVSI[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x02, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00}; +// Set dynamic model to 7: Airborne with <2g Acceleration +uint8_t UBX_CONFIG_MESSAGE_MSG_CFG_NAV5[] = {0xB5, 0x62, 0x00, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + + + void ubx_decode_init(void) { ubx_state->ck_a = 0; @@ -587,7 +592,10 @@ int configure_gps_ubx(int *fd) //TODO: write this in a loop once it is tested //UBX_CFG_PRT_PART: write_config_message_ubx(UBX_CONFIG_MESSAGE_PRT, sizeof(UBX_CONFIG_MESSAGE_PRT) / sizeof(uint8_t) , *fd); + usleep(100000); + //CFG_NAV5 + write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_CFG_NAV5, sizeof(UBX_CONFIG_MESSAGE_MSG_CFG_NAV5) / sizeof(uint8_t), *fd); usleep(100000); //NAV_POSLLH: @@ -606,7 +614,6 @@ int configure_gps_ubx(int *fd) write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_NAV_SOL, sizeof(UBX_CONFIG_MESSAGE_MSG_NAV_SOL) / sizeof(uint8_t) , *fd); usleep(100000); - //NAV_SVINFO: write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_NAV_SVINFO, sizeof(UBX_CONFIG_MESSAGE_MSG_NAV_SVINFO) / sizeof(uint8_t) , *fd); usleep(100000); @@ -615,7 +622,6 @@ int configure_gps_ubx(int *fd) write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_NAV_VELNED, sizeof(UBX_CONFIG_MESSAGE_MSG_NAV_VELNED) / sizeof(uint8_t) , *fd); usleep(100000); - //RXM_SVSI: write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_RXM_SVSI, sizeof(UBX_CONFIG_MESSAGE_MSG_RXM_SVSI) / sizeof(uint8_t) , *fd); usleep(100000); From 80eb66c7a3f70ccaa46b3d955808a10a222241df Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Sun, 16 Dec 2012 19:46:03 -0800 Subject: [PATCH 140/157] The config message was wrong, corrected (not tested) --- apps/gps/ubx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/gps/ubx.c b/apps/gps/ubx.c index 01d098871d..a17260329f 100644 --- a/apps/gps/ubx.c +++ b/apps/gps/ubx.c @@ -77,7 +77,7 @@ uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_VELNED[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x0 uint8_t UBX_CONFIG_MESSAGE_MSG_RXM_SVSI[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x02, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00}; // Set dynamic model to 7: Airborne with <2g Acceleration -uint8_t UBX_CONFIG_MESSAGE_MSG_CFG_NAV5[] = {0xB5, 0x62, 0x00, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; +uint8_t UBX_CONFIG_MESSAGE_MSG_CFG_NAV5[] = {0xB5, 0x62, 0x06, 0x24, 0x00, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; From dce9b2d0459b8dea5aa9e072a6914f0768f1867f Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Sun, 16 Dec 2012 20:26:29 -0800 Subject: [PATCH 141/157] The CFG-NAV5 dynamic model is now checked as well --- apps/gps/ubx.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++-- apps/gps/ubx.h | 35 ++++++++++++++++++++++++++-- 2 files changed, 93 insertions(+), 4 deletions(-) diff --git a/apps/gps/ubx.c b/apps/gps/ubx.c index a17260329f..85cdcafbf7 100644 --- a/apps/gps/ubx.c +++ b/apps/gps/ubx.c @@ -54,6 +54,9 @@ #define UBX_BUFFER_SIZE 1000 +// Set dynamic model to 7: Airborne with <2g Acceleration +#define DYN_MODEL_NO 0x07 + extern bool gps_mode_try_all; extern bool gps_mode_success; extern bool terminate_gps_thread; @@ -65,6 +68,7 @@ pthread_mutex_t *ubx_mutex; gps_bin_ubx_state_t *ubx_state; static struct vehicle_gps_position_s *ubx_gps; +bool gps_nav5_conf_success = false; //Definitions for ubx, last two bytes are checksum which is calculated below uint8_t UBX_CONFIG_MESSAGE_PRT[] = {0xB5 , 0x62 , 0x06 , 0x00 , 0x14 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0xD0 , 0x08 , 0x00 , 0x00 , 0x80 , 0x25 , 0x00 , 0x00 , 0x07 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00}; @@ -76,8 +80,8 @@ uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_SOL[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_VELNED[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x12, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}; uint8_t UBX_CONFIG_MESSAGE_MSG_RXM_SVSI[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x02, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00}; -// Set dynamic model to 7: Airborne with <2g Acceleration -uint8_t UBX_CONFIG_MESSAGE_MSG_CFG_NAV5[] = {0xB5, 0x62, 0x06, 0x24, 0x00, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; +uint8_t UBX_CONFIG_MESSAGE_MSG_CFG_NAV5[] = {0xB5, 0x62, 0x06, 0x24, 0x00, 0x01, DYN_MODEL_NO, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; +uint8_t UBX_CONFIG_MESSAGE_MSG_CFG_NAV5_POLL[] = {0xB5, 0x62, 0x06, 0x00, 0x00}; @@ -137,6 +141,10 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) ubx_state->message_class = RXM; break; + case UBX_CLASS_CFG: + ubx_state->decode_state = UBX_DECODE_GOT_CLASS; + ubx_state->message_class = CFG; + break; default: //unknown class: reset state machine ubx_decode_init(); break; @@ -198,7 +206,19 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) ubx_decode_init(); break; } + break; + case CFG: + switch (b) { + case UBX_MESSAGE_CFG_NAV5: + ubx_state->decode_state = UBX_DECODE_GOT_MESSAGEID; + ubx_state->message_id = CFG_NAV5; + break; + + default: //unknown class: reset state machine, should not happen + ubx_decode_init(); + break; + } break; default: //should not happen @@ -546,6 +566,36 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) break; } + case CFG_NAV5: { + printf("GOT CFG_NAV5 MESSAGE\n"); + type_gps_bin_cfg_nav5_packet_t *packet = (type_gps_bin_cfg_nav5_packet_t *) gps_rx_buffer; + + //Check if checksum is valid + if (ubx_state->ck_a == gps_rx_buffer[ubx_state->rx_count - 1] && ubx_state->ck_b == gps_rx_buffer[ubx_state->rx_count]) { + + // check if dynamic model number is correct + if (packet->dynModel == DYN_MODEL_NO) { + printf("[gps] ubx dynamic model set successful\n"); + gps_nav5_conf_success = true; + } + else { + printf("[gps] ubx dynamic model set failed\n"); + gps_nav5_conf_success = false; + } + ret = 1; + + } else { + if (gps_verbose) printf("[gps] CFG_NAV5: checksum invalid\n"); + + ret = 0; + } + + // Reset state machine to decode next packet + ubx_decode_init(); + return ret; + + break; + } default: //something went wrong ubx_decode_init(); @@ -626,6 +676,10 @@ int configure_gps_ubx(int *fd) write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_RXM_SVSI, sizeof(UBX_CONFIG_MESSAGE_MSG_RXM_SVSI) / sizeof(uint8_t) , *fd); usleep(100000); + //send CFG_NAV5_POLL to check whether previous CFG_NAV5 has been successful + write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_CFG_NAV5_POLL, sizeof(UBX_CONFIG_MESSAGE_MSG_CFG_NAV5_POLL) / sizeof(uint8_t) , *fd); + usleep(100000); + return 0; } @@ -757,6 +811,10 @@ void *ubx_watchdog_loop(void *args) } } + // check if CFG-NAV5 is correct + if (!gps_nav5_conf_success) + all_okay = false; + pthread_mutex_unlock(ubx_mutex); if (!all_okay) { diff --git a/apps/gps/ubx.h b/apps/gps/ubx.h index f4f01df9a7..c3f2031845 100644 --- a/apps/gps/ubx.h +++ b/apps/gps/ubx.h @@ -72,6 +72,8 @@ #define UBX_MESSAGE_RXM_SVSI 0x20 #define UBX_MESSAGE_ACK_ACK 0x01 #define UBX_MESSAGE_ACK_NAK 0x00 +#define UBX_MESSAGE_CFG_NAV5 0x24 + // ************ @@ -234,6 +236,33 @@ typedef struct { typedef type_gps_bin_ack_nak_packet gps_bin_ack_nak_packet_t; +typedef struct { + uint8_t clsID; + uint8_t msgId; + + uint16_t mask; + uint8_t dynModel; + uint8_t fixMode; + int32_t fixedAlt; + uint32_t fixedAltVar; + int8_t minElev; + uint8_t drLimit; + uint16_t pDop; + uint16_t tDop; + uint16_t pAcc; + uint16_t tAcc; + uint8_t staticHoldThresh; + uint8_t dgpsTimeOut; + uint32_t reserved2; + uint32_t reserved3; + uint32_t reserved4; + + uint8_t ck_a; + uint8_t ck_b; +} type_gps_bin_cfg_nav5_packet; + +typedef type_gps_bin_cfg_nav5_packet type_gps_bin_cfg_nav5_packet_t; + // END the structures of the binary packets // ************ @@ -242,7 +271,8 @@ enum UBX_MESSAGE_CLASSES { CLASS_UNKNOWN = 0, NAV = 1, RXM = 2, - ACK = 3 + ACK = 3, + CFG = 4 }; enum UBX_MESSAGE_IDS { @@ -254,7 +284,8 @@ enum UBX_MESSAGE_IDS { NAV_DOP = 4, NAV_SVINFO = 5, NAV_VELNED = 6, - RXM_SVSI = 7 + RXM_SVSI = 7, + CFG_NAV5 = 8 }; enum UBX_DECODE_STATES { From ebaa38ad1b5c1d625467fc867480e1969edd60aa Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 16 Jan 2013 19:54:05 -0800 Subject: [PATCH 142/157] ubx with 38400 working, all messages seem to arrive, configuration procedure is still funny (work in progress) --- apps/gps/gps.c | 2 +- apps/gps/ubx.c | 323 ++++++++++++++++++++++++++++++++++++------------- apps/gps/ubx.h | 79 +++++++++++- 3 files changed, 317 insertions(+), 87 deletions(-) diff --git a/apps/gps/gps.c b/apps/gps/gps.c index 00f6ee9f89..cb9a77c511 100644 --- a/apps/gps/gps.c +++ b/apps/gps/gps.c @@ -189,7 +189,7 @@ int gps_thread_main(int argc, char *argv[]) { gps_mode_success = true; terminate_gps_thread = false; bool retry = false; - gps_verbose = false; + gps_verbose = true; int mavlink_fd = open(MAVLINK_LOG_DEVICE, 0); diff --git a/apps/gps/ubx.c b/apps/gps/ubx.c index 85cdcafbf7..33f44287b5 100644 --- a/apps/gps/ubx.c +++ b/apps/gps/ubx.c @@ -66,12 +66,16 @@ extern int current_gps_speed; pthread_mutex_t *ubx_mutex; gps_bin_ubx_state_t *ubx_state; +enum UBX_CONFIG_STATE ubx_config_state; static struct vehicle_gps_position_s *ubx_gps; bool gps_nav5_conf_success = false; +unsigned int got_ack = 0; +unsigned int got_nak = 0; + //Definitions for ubx, last two bytes are checksum which is calculated below -uint8_t UBX_CONFIG_MESSAGE_PRT[] = {0xB5 , 0x62 , 0x06 , 0x00 , 0x14 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0xD0 , 0x08 , 0x00 , 0x00 , 0x80 , 0x25 , 0x00 , 0x00 , 0x07 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00}; +uint8_t UBX_CONFIG_MESSAGE_PRT[] = {0x06, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_POSLLH[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}; uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_TIMEUTC[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}; uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_DOP[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}; @@ -80,8 +84,8 @@ uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_SOL[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_VELNED[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x12, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}; uint8_t UBX_CONFIG_MESSAGE_MSG_RXM_SVSI[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x02, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00}; -uint8_t UBX_CONFIG_MESSAGE_MSG_CFG_NAV5[] = {0xB5, 0x62, 0x06, 0x24, 0x00, 0x01, DYN_MODEL_NO, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -uint8_t UBX_CONFIG_MESSAGE_MSG_CFG_NAV5_POLL[] = {0xB5, 0x62, 0x06, 0x00, 0x00}; +//uint8_t UBX_CONFIG_MESSAGE_MSG_CFG_NAV5[] = {0xB5, 0x62, 0x06, 0x24, 0x00, 0x01, DYN_MODEL_NO, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; +//uint8_t UBX_CONFIG_MESSAGE_MSG_CFG_NAV5_POLL[] = {0xB5, 0x62, 0x06, 0x00, 0x00}; @@ -109,15 +113,17 @@ void ubx_checksum(uint8_t b, uint8_t *ck_a, uint8_t *ck_b) int ubx_parse(uint8_t b, char *gps_rx_buffer) { -// printf("b=%x\n",b); + //printf("b=%x\n",b); if (ubx_state->decode_state == UBX_DECODE_UNINIT) { - if (b == 0xb5) { + if (b == UBX_SYNC_1) { +// printf("got sync1"); ubx_state->decode_state = UBX_DECODE_GOT_SYNC1; } } else if (ubx_state->decode_state == UBX_DECODE_GOT_SYNC1) { - if (b == 0x62) { + if (b == UBX_SYNC_2) { +// printf("got sync2"); ubx_state->decode_state = UBX_DECODE_GOT_SYNC2; } else { @@ -131,12 +137,18 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) //check for known class switch (b) { - case UBX_CLASS_NAV: //NAV + case UBX_CLASS_ACK: + printf("class ack"); + ubx_state->decode_state = UBX_DECODE_GOT_CLASS; + ubx_state->message_class = ACK; + break; + + case UBX_CLASS_NAV: ubx_state->decode_state = UBX_DECODE_GOT_CLASS; ubx_state->message_class = NAV; break; - case UBX_CLASS_RXM: //RXM + case UBX_CLASS_RXM: ubx_state->decode_state = UBX_DECODE_GOT_CLASS; ubx_state->message_class = RXM; break; @@ -221,6 +233,21 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) } break; + case ACK: + switch (b) { + case UBX_MESSAGE_ACK_ACK: + ubx_state->decode_state = UBX_DECODE_GOT_MESSAGEID; + ubx_state->message_id = ACK_ACK; + break; + case UBX_MESSAGE_ACK_NAK: + ubx_state->decode_state = UBX_DECODE_GOT_MESSAGEID; + ubx_state->message_id = ACK_NAK; + break; + default: //unknown class: reset state machine, should not happen + ubx_decode_init(); + break; + } + break; default: //should not happen ubx_decode_init(); break; @@ -254,7 +281,7 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) //convert to correct struct switch (ubx_state->message_id) { //this enum is unique for all ids --> no need to check the class case NAV_POSLLH: { -// printf("GOT NAV_POSLLH MESSAGE\n"); + printf("GOT NAV_POSLLH MESSAGE\n"); gps_bin_nav_posllh_packet_t *packet = (gps_bin_nav_posllh_packet_t *) gps_rx_buffer; //Check if checksum is valid and the store the gps information @@ -287,7 +314,7 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) } case NAV_SOL: { -// printf("GOT NAV_SOL MESSAGE\n"); + printf("GOT NAV_SOL MESSAGE\n"); gps_bin_nav_sol_packet_t *packet = (gps_bin_nav_sol_packet_t *) gps_rx_buffer; //Check if checksum is valid and the store the gps information @@ -319,7 +346,7 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) } case NAV_DOP: { -// printf("GOT NAV_DOP MESSAGE\n"); + printf("GOT NAV_DOP MESSAGE\n"); gps_bin_nav_dop_packet_t *packet = (gps_bin_nav_dop_packet_t *) gps_rx_buffer; //Check if checksum is valid and the store the gps information @@ -351,7 +378,7 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) } case NAV_TIMEUTC: { -// printf("GOT NAV_TIMEUTC MESSAGE\n"); + printf("GOT NAV_TIMEUTC MESSAGE\n"); gps_bin_nav_timeutc_packet_t *packet = (gps_bin_nav_timeutc_packet_t *) gps_rx_buffer; //Check if checksum is valid and the store the gps information @@ -397,7 +424,7 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) } case NAV_SVINFO: { -// printf("GOT NAV_SVINFO MESSAGE\n"); + printf("GOT NAV_SVINFO MESSAGE\n"); //this is a more complicated message: the length depends on the number of satellites. This number is extracted from the first part of the message const int length_part1 = 8; @@ -498,7 +525,7 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) } case NAV_VELNED: { -// printf("GOT NAV_VELNED MESSAGE\n"); + printf("GOT NAV_VELNED MESSAGE\n"); gps_bin_nav_velned_packet_t *packet = (gps_bin_nav_velned_packet_t *) gps_rx_buffer; //Check if checksum is valid and the store the gps information @@ -534,7 +561,7 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) } case RXM_SVSI: { -// printf("GOT RXM_SVSI MESSAGE\n"); + printf("GOT RXM_SVSI MESSAGE\n"); const int length_part1 = 7; char gps_rx_buffer_part1[length_part1]; memcpy(gps_rx_buffer_part1, gps_rx_buffer, length_part1); @@ -566,26 +593,96 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) break; } - case CFG_NAV5: { - printf("GOT CFG_NAV5 MESSAGE\n"); - type_gps_bin_cfg_nav5_packet_t *packet = (type_gps_bin_cfg_nav5_packet_t *) gps_rx_buffer; +// case CFG_NAV5: { +// printf("GOT CFG_NAV5 MESSAGE\n"); +// type_gps_bin_cfg_nav5_packet_t *packet = (type_gps_bin_cfg_nav5_packet_t *) gps_rx_buffer; +// +// //Check if checksum is valid +// if (ubx_state->ck_a == gps_rx_buffer[ubx_state->rx_count - 1] && ubx_state->ck_b == gps_rx_buffer[ubx_state->rx_count]) { +// +// // check if dynamic model number is correct +// if (packet->dynModel == DYN_MODEL_NO) { +// printf("[gps] ubx dynamic model set successful\n"); +// gps_nav5_conf_success = true; +// } +// else { +// printf("[gps] ubx dynamic model set failed\n"); +// gps_nav5_conf_success = false; +// } +// ret = 1; +// +// } else { +// if (gps_verbose) printf("[gps] CFG_NAV5: checksum invalid\n"); +// +// ret = 0; +// } +// +// // Reset state machine to decode next packet +// ubx_decode_init(); +// return ret; +// +// break; +// } + + case ACK_ACK: { + printf("GOT ACK_ACK\n"); + gps_bin_ack_ack_packet_t *packet = (gps_bin_ack_ack_packet_t *) gps_rx_buffer; //Check if checksum is valid - if (ubx_state->ck_a == gps_rx_buffer[ubx_state->rx_count - 1] && ubx_state->ck_b == gps_rx_buffer[ubx_state->rx_count]) { + if (ubx_state->ck_a == packet->ck_a && ubx_state->ck_b == packet->ck_b) { - // check if dynamic model number is correct - if (packet->dynModel == DYN_MODEL_NO) { - printf("[gps] ubx dynamic model set successful\n"); - gps_nav5_conf_success = true; - } - else { - printf("[gps] ubx dynamic model set failed\n"); - gps_nav5_conf_success = false; + switch (ubx_config_state) { + case UBX_CONFIG_STATE_PRT: + printf("clsID: %d, msgID: %d\n", packet->clsID, packet->msgID); + if (packet->clsID == UBX_CLASS_CFG && packet->msgID == UBX_MESSAGE_CFG_PRT) + ubx_config_state++; + break; + case UBX_CONFIG_STATE_NAV5: + if (packet->clsID == UBX_CLASS_CFG && packet->msgID == UBX_MESSAGE_CFG_NAV5) + ubx_config_state++; + break; + case UBX_CONFIG_STATE_MSG_NAV_POSLLH: + case UBX_CONFIG_STATE_MSG_NAV_TIMEUTC: + case UBX_CONFIG_STATE_MSG_NAV_DOP: + case UBX_CONFIG_STATE_MSG_NAV_SVINFO: + case UBX_CONFIG_STATE_MSG_NAV_SOL: + case UBX_CONFIG_STATE_MSG_NAV_VELNED: + case UBX_CONFIG_STATE_MSG_RXM_SVSI: + if (packet->clsID == UBX_CLASS_CFG && packet->msgID == UBX_MESSAGE_CFG_MSG) + ubx_config_state++; + break; + default: + break; } + + ret = 1; } else { - if (gps_verbose) printf("[gps] CFG_NAV5: checksum invalid\n"); + if (gps_verbose) printf("[gps] ACK_ACK: checksum invalid\n"); + + ret = 0; + } + + // Reset state machine to decode next packet + ubx_decode_init(); + return ret; + + break; + } + + case ACK_NAK: { + printf("GOT ACK_NAK\n"); + gps_bin_ack_nak_packet_t *packet = (gps_bin_ack_nak_packet_t *) gps_rx_buffer; + + //Check if checksum is valid + if (ubx_state->ck_a == packet->ck_a && ubx_state->ck_b == packet->ck_b) { + + printf("[gps] the ubx gps returned: not acknowledged\n"); + ret = 1; + + } else { + if (gps_verbose) printf("[gps] ACK_NAK: checksum invalid\n"); ret = 0; } @@ -637,50 +734,93 @@ void calculate_ubx_checksum(uint8_t *message, uint8_t length) int configure_gps_ubx(int *fd) { - //fflush(((FILE *)fd)); + // only needed once like this + const type_gps_bin_cfg_prt_packet_t cfg_prt_packet = { + .clsID = UBX_CLASS_CFG, + .msgID = UBX_MESSAGE_CFG_PRT, + .length = UBX_CFG_PRT_LENGTH, + .portID = UBX_CFG_PRT_PAYLOAD_PORTID, + .mode = UBX_CFG_PRT_PAYLOAD_MODE, + .baudRate = UBX_CFG_PRT_PAYLOAD_BAUDRATE, + .inProtoMask = UBX_CFG_PRT_PAYLOAD_INPROTOMASK, + .outProtoMask = UBX_CFG_PRT_PAYLOAD_OUTPROTOMASK, + .ck_a = 0, + .ck_b = 0 + }; - //TODO: write this in a loop once it is tested - //UBX_CFG_PRT_PART: - write_config_message_ubx(UBX_CONFIG_MESSAGE_PRT, sizeof(UBX_CONFIG_MESSAGE_PRT) / sizeof(uint8_t) , *fd); - usleep(100000); + // only needed once like this + const type_gps_bin_cfg_nav5_packet_t cfg_nav5_packet = { + .clsID = UBX_CLASS_CFG, + .msgID = UBX_MESSAGE_CFG_NAV5, + .length = UBX_CFG_NAV5_LENGTH, + .mask = UBX_CFG_NAV5_PAYLOAD_MASK, + .dynModel = UBX_CFG_NAV5_PAYLOAD_DYNMODEL, + .fixMode = UBX_CFG_NAV5_PAYLOAD_FIXMODE, + .ck_a = 0, + .ck_b = 0 + }; - //CFG_NAV5 - write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_CFG_NAV5, sizeof(UBX_CONFIG_MESSAGE_MSG_CFG_NAV5) / sizeof(uint8_t), *fd); - usleep(100000); + // this message is reusable for different configuration commands, so not const + type_gps_bin_cfg_msg_packet cfg_msg_packet = { + .clsID = UBX_CLASS_CFG, + .msgID = UBX_MESSAGE_CFG_MSG, + .length = UBX_CFG_MSG_LENGTH, + .rate = UBX_CFG_MSG_PAYLOAD_RATE + }; - //NAV_POSLLH: - write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_NAV_POSLLH, sizeof(UBX_CONFIG_MESSAGE_MSG_NAV_POSLLH) / sizeof(uint8_t) , *fd); - usleep(100000); + if (gps_verbose) printf("Config state: %d\n", ubx_config_state); - //NAV_TIMEUTC: - write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_NAV_TIMEUTC, sizeof(UBX_CONFIG_MESSAGE_MSG_NAV_TIMEUTC) / sizeof(uint8_t) , *fd); - usleep(100000); + switch (ubx_config_state) { + case UBX_CONFIG_STATE_PRT: + write_config_message_ubx((uint8_t*)(&cfg_prt_packet), sizeof(cfg_prt_packet), fd); + break; + case UBX_CONFIG_STATE_NAV5: + write_config_message_ubx((uint8_t*)(&cfg_nav5_packet), sizeof(cfg_nav5_packet), fd); + break; + case UBX_CONFIG_STATE_MSG_NAV_POSLLH: + cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; + cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_POSLLH; + write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); + break; + case UBX_CONFIG_STATE_MSG_NAV_TIMEUTC: + cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; + cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_TIMEUTC; + write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); + break; + case UBX_CONFIG_STATE_MSG_NAV_DOP: + cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; + cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_DOP; + write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); + break; + case UBX_CONFIG_STATE_MSG_NAV_SVINFO: + cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; + cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_SVINFO; + write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); + break; + case UBX_CONFIG_STATE_MSG_NAV_SOL: + cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; + cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_SOL; + write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); + break; + case UBX_CONFIG_STATE_MSG_NAV_VELNED: + cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; + cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_VELNED; + write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); + break; + case UBX_CONFIG_STATE_MSG_RXM_SVSI: + cfg_msg_packet.msgClass_payload = UBX_CLASS_RXM; + cfg_msg_packet.msgID_payload = UBX_MESSAGE_RXM_SVSI; + write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); + break; + case UBX_CONFIG_STATE_CONFIGURED: + if (gps_verbose) printf("[gps] ubx configuration finished\n"); + return OK; + break; + default: + break; + } - //NAV_DOP: - write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_NAV_DOP, sizeof(UBX_CONFIG_MESSAGE_MSG_NAV_DOP) / sizeof(uint8_t) , *fd); - usleep(100000); - - //NAV_SOL: - write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_NAV_SOL, sizeof(UBX_CONFIG_MESSAGE_MSG_NAV_SOL) / sizeof(uint8_t) , *fd); - usleep(100000); - - //NAV_SVINFO: - write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_NAV_SVINFO, sizeof(UBX_CONFIG_MESSAGE_MSG_NAV_SVINFO) / sizeof(uint8_t) , *fd); - usleep(100000); - - //NAV_VELNED: - write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_NAV_VELNED, sizeof(UBX_CONFIG_MESSAGE_MSG_NAV_VELNED) / sizeof(uint8_t) , *fd); - usleep(100000); - - //RXM_SVSI: - write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_RXM_SVSI, sizeof(UBX_CONFIG_MESSAGE_MSG_RXM_SVSI) / sizeof(uint8_t) , *fd); - usleep(100000); - - //send CFG_NAV5_POLL to check whether previous CFG_NAV5 has been successful - write_config_message_ubx(UBX_CONFIG_MESSAGE_MSG_CFG_NAV5_POLL, sizeof(UBX_CONFIG_MESSAGE_MSG_CFG_NAV5_POLL) / sizeof(uint8_t) , *fd); - usleep(100000); - - return 0; + return OK; } @@ -748,7 +888,7 @@ int read_gps_ubx(int *fd, char *gps_rx_buffer, int buffer_size) return ret; } -int write_config_message_ubx(uint8_t *message, size_t length, int fd) +int write_config_message_ubx(const uint8_t *message, const size_t length, const int *fd) { //calculate and write checksum to the end uint8_t ck_a = 0; @@ -756,19 +896,38 @@ int write_config_message_ubx(uint8_t *message, size_t length, int fd) unsigned int i; - for (i = 2; i < length; i++) { + uint8_t buffer[2]; + ssize_t result_write = 0; + + for (i = 0; i < length-2; i++) { ck_a = ck_a + message[i]; ck_b = ck_b + ck_a; } -// printf("[%x,%x]\n", ck_a, ck_b); +// printf("chk: [%x,%x]\n", ck_a, ck_b); - unsigned int result_write = write(fd, message, length); - result_write += write(fd, &ck_a, 1); - result_write += write(fd, &ck_b, 1); - fsync(fd); + buffer[0] = UBX_SYNC_1; + buffer[1] = UBX_SYNC_2; - return (result_write != length + 2); //return 0 as success + result_write = write(*fd, buffer, sizeof(buffer)); + result_write += write(*fd, message, length-2); + +// for(i=0; iprint_errors = false; @@ -933,8 +1094,8 @@ void *ubx_loop(void *args) } } - if(gps_verbose) printf("[gps] ubx read is going to terminate\n"); - close(gps_pub); +// if(gps_verbose) printf("[gps] ubx read is going to terminate\n"); +// close(gps_pub); return NULL; } diff --git a/apps/gps/ubx.h b/apps/gps/ubx.h index c3f2031845..eb19d17f24 100644 --- a/apps/gps/ubx.h +++ b/apps/gps/ubx.h @@ -58,6 +58,9 @@ #define APPNAME "gps: ubx" +#define UBX_SYNC_1 0xB5 +#define UBX_SYNC_2 0x62 + //UBX Protocoll definitions (this is the subset of the messages that are parsed) #define UBX_CLASS_NAV 0x01 #define UBX_CLASS_RXM 0x02 @@ -72,8 +75,24 @@ #define UBX_MESSAGE_RXM_SVSI 0x20 #define UBX_MESSAGE_ACK_ACK 0x01 #define UBX_MESSAGE_ACK_NAK 0x00 +#define UBX_MESSAGE_CFG_PRT 0x00 #define UBX_MESSAGE_CFG_NAV5 0x24 +#define UBX_MESSAGE_CFG_MSG 0x01 +#define UBX_CFG_PRT_LENGTH 20 +#define UBX_CFG_PRT_PAYLOAD_PORTID 0x01 /**< port 1 */ +#define UBX_CFG_PRT_PAYLOAD_MODE 0x000008D0 /**< 0b0000100011010000: 8N1 */ +#define UBX_CFG_PRT_PAYLOAD_BAUDRATE 38400 /**< always choose 38400 as GPS baudrate */ +#define UBX_CFG_PRT_PAYLOAD_INPROTOMASK 0x01 /**< ubx in */ +#define UBX_CFG_PRT_PAYLOAD_OUTPROTOMASK 0x01 /**< ubx out */ + +#define UBX_CFG_NAV5_LENGTH 36 +#define UBX_CFG_NAV5_PAYLOAD_MASK 0x0001 /**< only update dynamic model and fix mode */ +#define UBX_CFG_NAV5_PAYLOAD_DYNMODEL 7 /**< 0: portable, 2: stationary, 3: pedestrian, 4: automotive, 5: sea, 6: airborne <1g, 7: airborne <2g, 8: airborne <4g */ +#define UBX_CFG_NAV5_PAYLOAD_FIXMODE 2 /**< 1: 2D only, 2: 3D only, 3: Auto 2D/3D */ + +#define UBX_CFG_MSG_LENGTH 8 +#define UBX_CFG_MSG_PAYLOAD_RATE {0x00, 0x01, 0x00, 0x00, 0x00, 0x00} /**< UART1 chosen */ // ************ @@ -218,7 +237,7 @@ typedef type_gps_bin_rxm_svsi_packet gps_bin_rxm_svsi_packet_t; typedef struct { uint8_t clsID; - uint8_t msgId; + uint8_t msgID; uint8_t ck_a; uint8_t ck_b; @@ -228,7 +247,7 @@ typedef type_gps_bin_ack_ack_packet gps_bin_ack_ack_packet_t; typedef struct { uint8_t clsID; - uint8_t msgId; + uint8_t msgID; uint8_t ck_a; uint8_t ck_b; @@ -238,8 +257,28 @@ typedef type_gps_bin_ack_nak_packet gps_bin_ack_nak_packet_t; typedef struct { uint8_t clsID; - uint8_t msgId; + uint8_t msgID; + uint16_t length; + uint8_t portID; + uint8_t res0; + uint16_t res1; + uint32_t mode; + uint32_t baudRate; + uint16_t inProtoMask; + uint16_t outProtoMask; + uint16_t flags; + uint16_t pad; + uint8_t ck_a; + uint8_t ck_b; +} type_gps_bin_cfg_prt_packet; + +typedef type_gps_bin_cfg_prt_packet type_gps_bin_cfg_prt_packet_t; + +typedef struct { + uint8_t clsID; + uint8_t msgID; + uint16_t length; uint16_t mask; uint8_t dynModel; uint8_t fixMode; @@ -263,10 +302,38 @@ typedef struct { typedef type_gps_bin_cfg_nav5_packet type_gps_bin_cfg_nav5_packet_t; +typedef struct { + uint8_t clsID; + uint8_t msgID; + uint16_t length; + uint8_t msgClass_payload; + uint8_t msgID_payload; + uint8_t rate[6]; + + uint8_t ck_a; + uint8_t ck_b; +} type_gps_bin_cfg_msg_packet; + +typedef type_gps_bin_cfg_msg_packet type_gps_bin_cfg_msg_packet_t; + // END the structures of the binary packets // ************ +enum UBX_CONFIG_STATE { + UBX_CONFIG_STATE_NONE = 0, + UBX_CONFIG_STATE_PRT = 1, + UBX_CONFIG_STATE_NAV5 = 2, + UBX_CONFIG_STATE_MSG_NAV_POSLLH = 3, + UBX_CONFIG_STATE_MSG_NAV_TIMEUTC = 4, + UBX_CONFIG_STATE_MSG_NAV_DOP = 5, + UBX_CONFIG_STATE_MSG_NAV_SVINFO = 6, + UBX_CONFIG_STATE_MSG_NAV_SOL = 7, + UBX_CONFIG_STATE_MSG_NAV_VELNED = 8, + UBX_CONFIG_STATE_MSG_RXM_SVSI = 9, + UBX_CONFIG_STATE_CONFIGURED = 10 +}; + enum UBX_MESSAGE_CLASSES { CLASS_UNKNOWN = 0, NAV = 1, @@ -285,7 +352,9 @@ enum UBX_MESSAGE_IDS { NAV_SVINFO = 5, NAV_VELNED = 6, RXM_SVSI = 7, - CFG_NAV5 = 8 + CFG_NAV5 = 8, + ACK_ACK = 9, + ACK_NAK = 10 }; enum UBX_DECODE_STATES { @@ -335,7 +404,7 @@ int configure_gps_ubx(int *fd); int read_gps_ubx(int *fd, char *gps_rx_buffer, int buffer_size); -int write_config_message_ubx(uint8_t *message, size_t length, int fd); +int write_config_message_ubx(const uint8_t *message, const size_t length, const int *fd); void calculate_ubx_checksum(uint8_t *message, uint8_t length); From 9ca472bbc7727294c039dbced0dc7bea6925789e Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Thu, 17 Jan 2013 16:53:32 -0800 Subject: [PATCH 143/157] Ubx configuration working again, gps app is still complicated and big but should be wrking better now --- apps/gps/gps.c | 7 +- apps/gps/ubx.c | 256 +++++++++++++++++-------------------------------- apps/gps/ubx.h | 7 +- 3 files changed, 93 insertions(+), 177 deletions(-) diff --git a/apps/gps/gps.c b/apps/gps/gps.c index cb9a77c511..8a95120547 100644 --- a/apps/gps/gps.c +++ b/apps/gps/gps.c @@ -107,8 +107,8 @@ enum GPS_MODES { #define AUTO_DETECTION_COUNT 8 -const int autodetection_baudrates[] = {B9600, B38400, B38400, B9600, B9600, B38400, B9600, B38400}; -const enum GPS_MODES autodetection_gpsmodes[] = {GPS_MODE_UBX, GPS_MODE_MTK, GPS_MODE_UBX, GPS_MODE_MTK, GPS_MODE_UBX, GPS_MODE_MTK, GPS_MODE_NMEA, GPS_MODE_NMEA}; //nmea is the fall-back if nothing else works, therefore we try the standard modes again before finally trying nmea +const int autodetection_baudrates[] = {B38400, B9600, B38400, B9600, B38400, B9600, B38400, B9600}; +const enum GPS_MODES autodetection_gpsmodes[] = {GPS_MODE_UBX, GPS_MODE_UBX, GPS_MODE_MTK, GPS_MODE_MTK, GPS_MODE_UBX, GPS_MODE_UBX, GPS_MODE_NMEA, GPS_MODE_NMEA}; //nmea is the fall-back if nothing else works, therefore we try the standard modes again before finally trying nmea /**************************************************************************** * Private functions @@ -189,7 +189,7 @@ int gps_thread_main(int argc, char *argv[]) { gps_mode_success = true; terminate_gps_thread = false; bool retry = false; - gps_verbose = true; + gps_verbose = false; int mavlink_fd = open(MAVLINK_LOG_DEVICE, 0); @@ -368,7 +368,6 @@ int gps_thread_main(int argc, char *argv[]) { args.thread_should_exit_ptr = &thread_should_exit; pthread_create(&ubx_thread, &ubx_loop_attr, ubx_loop, (void *)&args); - sleep(2); // XXX TODO Check if this is too short, try to lower sleeps in UBX driver pthread_attr_t ubx_wd_attr; pthread_attr_init(&ubx_wd_attr); diff --git a/apps/gps/ubx.c b/apps/gps/ubx.c index 33f44287b5..50bf579a08 100644 --- a/apps/gps/ubx.c +++ b/apps/gps/ubx.c @@ -52,10 +52,7 @@ #define UBX_HEALTH_FAIL_COUNTER_LIMIT 3 #define UBX_HEALTH_PROBE_COUNTER_LIMIT 4 -#define UBX_BUFFER_SIZE 1000 - -// Set dynamic model to 7: Airborne with <2g Acceleration -#define DYN_MODEL_NO 0x07 +#define UBX_BUFFER_SIZE 500 extern bool gps_mode_try_all; extern bool gps_mode_success; @@ -69,24 +66,6 @@ gps_bin_ubx_state_t *ubx_state; enum UBX_CONFIG_STATE ubx_config_state; static struct vehicle_gps_position_s *ubx_gps; -bool gps_nav5_conf_success = false; - -unsigned int got_ack = 0; -unsigned int got_nak = 0; - -//Definitions for ubx, last two bytes are checksum which is calculated below -uint8_t UBX_CONFIG_MESSAGE_PRT[] = {0x06, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_POSLLH[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}; -uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_TIMEUTC[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}; -uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_DOP[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}; -uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_SVINFO[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00}; -uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_SOL[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00}; -uint8_t UBX_CONFIG_MESSAGE_MSG_NAV_VELNED[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x12, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}; -uint8_t UBX_CONFIG_MESSAGE_MSG_RXM_SVSI[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x02, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00}; - -//uint8_t UBX_CONFIG_MESSAGE_MSG_CFG_NAV5[] = {0xB5, 0x62, 0x06, 0x24, 0x00, 0x01, DYN_MODEL_NO, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -//uint8_t UBX_CONFIG_MESSAGE_MSG_CFG_NAV5_POLL[] = {0xB5, 0x62, 0x06, 0x00, 0x00}; - void ubx_decode_init(void) @@ -117,13 +96,11 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) if (ubx_state->decode_state == UBX_DECODE_UNINIT) { if (b == UBX_SYNC_1) { -// printf("got sync1"); ubx_state->decode_state = UBX_DECODE_GOT_SYNC1; } } else if (ubx_state->decode_state == UBX_DECODE_GOT_SYNC1) { if (b == UBX_SYNC_2) { -// printf("got sync2"); ubx_state->decode_state = UBX_DECODE_GOT_SYNC2; } else { @@ -138,7 +115,6 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) //check for known class switch (b) { case UBX_CLASS_ACK: - printf("class ack"); ubx_state->decode_state = UBX_DECODE_GOT_CLASS; ubx_state->message_class = ACK; break; @@ -281,7 +257,7 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) //convert to correct struct switch (ubx_state->message_id) { //this enum is unique for all ids --> no need to check the class case NAV_POSLLH: { - printf("GOT NAV_POSLLH MESSAGE\n"); +// printf("GOT NAV_POSLLH MESSAGE\n"); gps_bin_nav_posllh_packet_t *packet = (gps_bin_nav_posllh_packet_t *) gps_rx_buffer; //Check if checksum is valid and the store the gps information @@ -314,7 +290,7 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) } case NAV_SOL: { - printf("GOT NAV_SOL MESSAGE\n"); +// printf("GOT NAV_SOL MESSAGE\n"); gps_bin_nav_sol_packet_t *packet = (gps_bin_nav_sol_packet_t *) gps_rx_buffer; //Check if checksum is valid and the store the gps information @@ -346,7 +322,7 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) } case NAV_DOP: { - printf("GOT NAV_DOP MESSAGE\n"); +// printf("GOT NAV_DOP MESSAGE\n"); gps_bin_nav_dop_packet_t *packet = (gps_bin_nav_dop_packet_t *) gps_rx_buffer; //Check if checksum is valid and the store the gps information @@ -378,7 +354,7 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) } case NAV_TIMEUTC: { - printf("GOT NAV_TIMEUTC MESSAGE\n"); +// printf("GOT NAV_TIMEUTC MESSAGE\n"); gps_bin_nav_timeutc_packet_t *packet = (gps_bin_nav_timeutc_packet_t *) gps_rx_buffer; //Check if checksum is valid and the store the gps information @@ -424,7 +400,7 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) } case NAV_SVINFO: { - printf("GOT NAV_SVINFO MESSAGE\n"); +// printf("GOT NAV_SVINFO MESSAGE\n"); //this is a more complicated message: the length depends on the number of satellites. This number is extracted from the first part of the message const int length_part1 = 8; @@ -525,7 +501,7 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) } case NAV_VELNED: { - printf("GOT NAV_VELNED MESSAGE\n"); +// printf("GOT NAV_VELNED MESSAGE\n"); gps_bin_nav_velned_packet_t *packet = (gps_bin_nav_velned_packet_t *) gps_rx_buffer; //Check if checksum is valid and the store the gps information @@ -561,7 +537,7 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) } case RXM_SVSI: { - printf("GOT RXM_SVSI MESSAGE\n"); +// printf("GOT RXM_SVSI MESSAGE\n"); const int length_part1 = 7; char gps_rx_buffer_part1[length_part1]; memcpy(gps_rx_buffer_part1, gps_rx_buffer, length_part1); @@ -593,39 +569,9 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) break; } -// case CFG_NAV5: { -// printf("GOT CFG_NAV5 MESSAGE\n"); -// type_gps_bin_cfg_nav5_packet_t *packet = (type_gps_bin_cfg_nav5_packet_t *) gps_rx_buffer; -// -// //Check if checksum is valid -// if (ubx_state->ck_a == gps_rx_buffer[ubx_state->rx_count - 1] && ubx_state->ck_b == gps_rx_buffer[ubx_state->rx_count]) { -// -// // check if dynamic model number is correct -// if (packet->dynModel == DYN_MODEL_NO) { -// printf("[gps] ubx dynamic model set successful\n"); -// gps_nav5_conf_success = true; -// } -// else { -// printf("[gps] ubx dynamic model set failed\n"); -// gps_nav5_conf_success = false; -// } -// ret = 1; -// -// } else { -// if (gps_verbose) printf("[gps] CFG_NAV5: checksum invalid\n"); -// -// ret = 0; -// } -// -// // Reset state machine to decode next packet -// ubx_decode_init(); -// return ret; -// -// break; -// } case ACK_ACK: { - printf("GOT ACK_ACK\n"); +// printf("GOT ACK_ACK\n"); gps_bin_ack_ack_packet_t *packet = (gps_bin_ack_ack_packet_t *) gps_rx_buffer; //Check if checksum is valid @@ -633,7 +579,6 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) switch (ubx_config_state) { case UBX_CONFIG_STATE_PRT: - printf("clsID: %d, msgID: %d\n", packet->clsID, packet->msgID); if (packet->clsID == UBX_CLASS_CFG && packet->msgID == UBX_MESSAGE_CFG_PRT) ubx_config_state++; break; @@ -672,13 +617,13 @@ int ubx_parse(uint8_t b, char *gps_rx_buffer) } case ACK_NAK: { - printf("GOT ACK_NAK\n"); +// printf("GOT ACK_NAK\n"); gps_bin_ack_nak_packet_t *packet = (gps_bin_ack_nak_packet_t *) gps_rx_buffer; //Check if checksum is valid if (ubx_state->ck_a == packet->ck_a && ubx_state->ck_b == packet->ck_b) { - printf("[gps] the ubx gps returned: not acknowledged\n"); + if (gps_verbose) printf("[gps] the ubx gps returned: not acknowledged\n"); ret = 1; } else { @@ -726,10 +671,6 @@ void calculate_ubx_checksum(uint8_t *message, uint8_t length) message[length - 2] = ck_a; message[length - 1] = ck_b; - -// printf("[%x,%x]", ck_a, ck_b); - -// printf("[%x,%x]\n", message[length-2], message[length-1]); } int configure_gps_ubx(int *fd) @@ -741,7 +682,7 @@ int configure_gps_ubx(int *fd) .length = UBX_CFG_PRT_LENGTH, .portID = UBX_CFG_PRT_PAYLOAD_PORTID, .mode = UBX_CFG_PRT_PAYLOAD_MODE, - .baudRate = UBX_CFG_PRT_PAYLOAD_BAUDRATE, + .baudRate = current_gps_speed, .inProtoMask = UBX_CFG_PRT_PAYLOAD_INPROTOMASK, .outProtoMask = UBX_CFG_PRT_PAYLOAD_OUTPROTOMASK, .ck_a = 0, @@ -768,59 +709,67 @@ int configure_gps_ubx(int *fd) .rate = UBX_CFG_MSG_PAYLOAD_RATE }; - if (gps_verbose) printf("Config state: %d\n", ubx_config_state); + uint64_t time_before_config = hrt_absolute_time(); - switch (ubx_config_state) { - case UBX_CONFIG_STATE_PRT: - write_config_message_ubx((uint8_t*)(&cfg_prt_packet), sizeof(cfg_prt_packet), fd); - break; - case UBX_CONFIG_STATE_NAV5: - write_config_message_ubx((uint8_t*)(&cfg_nav5_packet), sizeof(cfg_nav5_packet), fd); - break; - case UBX_CONFIG_STATE_MSG_NAV_POSLLH: - cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; - cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_POSLLH; - write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); - break; - case UBX_CONFIG_STATE_MSG_NAV_TIMEUTC: - cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; - cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_TIMEUTC; - write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); - break; - case UBX_CONFIG_STATE_MSG_NAV_DOP: - cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; - cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_DOP; - write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); - break; - case UBX_CONFIG_STATE_MSG_NAV_SVINFO: - cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; - cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_SVINFO; - write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); - break; - case UBX_CONFIG_STATE_MSG_NAV_SOL: - cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; - cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_SOL; - write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); - break; - case UBX_CONFIG_STATE_MSG_NAV_VELNED: - cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; - cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_VELNED; - write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); - break; - case UBX_CONFIG_STATE_MSG_RXM_SVSI: - cfg_msg_packet.msgClass_payload = UBX_CLASS_RXM; - cfg_msg_packet.msgID_payload = UBX_MESSAGE_RXM_SVSI; - write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); - break; - case UBX_CONFIG_STATE_CONFIGURED: - if (gps_verbose) printf("[gps] ubx configuration finished\n"); - return OK; - break; - default: - break; + while(hrt_absolute_time() < time_before_config + UBX_CONFIG_TIMEOUT) { + +// if (gps_verbose) printf("[gps] ubx config state: %d\n", ubx_config_state); + + switch (ubx_config_state) { + case UBX_CONFIG_STATE_PRT: +// if (gps_verbose) printf("[gps] Configuring ubx with baudrate: %d\n", cfg_prt_packet.baudRate); + + write_config_message_ubx((uint8_t*)(&cfg_prt_packet), sizeof(cfg_prt_packet), fd); + break; + case UBX_CONFIG_STATE_NAV5: + write_config_message_ubx((uint8_t*)(&cfg_nav5_packet), sizeof(cfg_nav5_packet), fd); + break; + case UBX_CONFIG_STATE_MSG_NAV_POSLLH: + cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; + cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_POSLLH; + write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); + break; + case UBX_CONFIG_STATE_MSG_NAV_TIMEUTC: + cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; + cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_TIMEUTC; + write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); + break; + case UBX_CONFIG_STATE_MSG_NAV_DOP: + cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; + cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_DOP; + write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); + break; + case UBX_CONFIG_STATE_MSG_NAV_SVINFO: + cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; + cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_SVINFO; + write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); + break; + case UBX_CONFIG_STATE_MSG_NAV_SOL: + cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; + cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_SOL; + write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); + break; + case UBX_CONFIG_STATE_MSG_NAV_VELNED: + cfg_msg_packet.msgClass_payload = UBX_CLASS_NAV; + cfg_msg_packet.msgID_payload = UBX_MESSAGE_NAV_VELNED; + write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); + break; + case UBX_CONFIG_STATE_MSG_RXM_SVSI: + cfg_msg_packet.msgClass_payload = UBX_CLASS_RXM; + cfg_msg_packet.msgID_payload = UBX_MESSAGE_RXM_SVSI; + write_config_message_ubx((uint8_t*)(&cfg_msg_packet), sizeof(cfg_msg_packet), fd); + break; + case UBX_CONFIG_STATE_CONFIGURED: + if (gps_verbose) printf("[gps] ubx configuration finished\n"); + return OK; + break; + default: + break; + } + usleep(10000); } - - return OK; + if (gps_verbose) printf("[gps] ubx configuration timeout\n"); + return ERROR; } @@ -837,22 +786,17 @@ int read_gps_ubx(int *fd, char *gps_rx_buffer, int buffer_size) fds.events = POLLIN; // UBX GPS mode - // This blocks the task until there is something on the buffer while (1) { //check if the thread should terminate if (terminate_gps_thread == true) { -// printf("terminate_gps_thread=%u ", terminate_gps_thread); -// printf("exiting mtk thread\n"); -// fflush(stdout); ret = 1; break; } - if (poll(&fds, 1, 1000) > 0) { if (read(*fd, &c, 1) > 0) { - // printf("Read %x\n",c); +// printf("Read %x\n",c); if (rx_count >= buffer_size) { // The buffer is already full and we haven't found a valid ubx sentence. // Flush the buffer and note the overflow event. @@ -871,7 +815,7 @@ int read_gps_ubx(int *fd, char *gps_rx_buffer, int buffer_size) int msg_read = ubx_parse(c, gps_rx_buffer); if (msg_read > 0) { - // printf("Found sequence\n"); + //printf("Found sequence\n"); break; } @@ -890,7 +834,6 @@ int read_gps_ubx(int *fd, char *gps_rx_buffer, int buffer_size) int write_config_message_ubx(const uint8_t *message, const size_t length, const int *fd) { - //calculate and write checksum to the end uint8_t ck_a = 0; uint8_t ck_b = 0; @@ -899,36 +842,31 @@ int write_config_message_ubx(const uint8_t *message, const size_t length, const uint8_t buffer[2]; ssize_t result_write = 0; + //calculate and write checksum to the end for (i = 0; i < length-2; i++) { ck_a = ck_a + message[i]; ck_b = ck_b + ck_a; } -// printf("chk: [%x,%x]\n", ck_a, ck_b); - + // write sync bytes first buffer[0] = UBX_SYNC_1; buffer[1] = UBX_SYNC_2; - result_write = write(*fd, buffer, sizeof(buffer)); - result_write += write(*fd, message, length-2); - -// for(i=0; ifd_ptr; bool *thread_should_exit = arguments->thread_should_exit_ptr; + /* first try to configure the GPS anyway */ + configure_gps_ubx(fd); + /* GPS watchdog error message skip counter */ bool ubx_healthy = false; @@ -970,10 +911,6 @@ void *ubx_watchdog_loop(void *args) } } -// // check if CFG-NAV5 is correct -// if (!gps_nav5_conf_success) -// all_okay = false; - pthread_mutex_unlock(ubx_mutex); if (!all_okay) { @@ -1026,7 +963,6 @@ void *ubx_watchdog_loop(void *args) if(gps_verbose) printf("[gps] ubx loop is going to terminate\n"); close(mavlink_fd); - return NULL; } @@ -1050,7 +986,6 @@ void *ubx_loop(void *args) //ubx state ubx_state = malloc(sizeof(gps_bin_ubx_state_t)); - //printf("gps: ubx_state created\n"); ubx_decode_init(); ubx_state->print_errors = false; @@ -1058,23 +993,6 @@ void *ubx_loop(void *args) /* set parameters for ubx */ - if (configure_gps_ubx(fd) != 0) { - printf("[gps] Configuration of gps module to ubx failed\n"); - - /* Write shared variable sys_status */ - // TODO enable this again - //global_data_send_subsystem_info(&ubx_present); - - } else { - if (gps_verbose) printf("[gps] Attempting to configure GPS to UBX binary protocol\n"); - - // XXX Shouldn't the system status only change if the module is known to work ok? - - /* Write shared variable sys_status */ - // TODO enable this again - //global_data_send_subsystem_info(&ubx_present_enabled); - } - struct vehicle_gps_position_s ubx_gps_d = {.counter = 0}; ubx_gps = &ubx_gps_d; @@ -1094,8 +1012,8 @@ void *ubx_loop(void *args) } } -// if(gps_verbose) printf("[gps] ubx read is going to terminate\n"); -// close(gps_pub); + if(gps_verbose) printf("[gps] ubx read is going to terminate\n"); + close(gps_pub); return NULL; } diff --git a/apps/gps/ubx.h b/apps/gps/ubx.h index eb19d17f24..e700fe3880 100644 --- a/apps/gps/ubx.h +++ b/apps/gps/ubx.h @@ -49,12 +49,11 @@ //internal definitions (not depending on the ubx protocol -#define CONFIGURE_UBX_FINISHED 0 -#define CONFIGURE_UBX_MESSAGE_ACKNOWLEDGED 1 -#define CONFIGURE_UBX_MESSAGE_NOT_ACKNOWLEDGED 2 #define UBX_NO_OF_MESSAGES 7 /**< Read 7 UBX GPS messages */ #define UBX_WATCHDOG_CRITICAL_TIME_MICROSECONDS 3000000 /**< Allow 3 seconds maximum inter-message time */ -#define UBX_WATCHDOG_WAIT_TIME_MICROSECONDS 500000 /**< Check for current state every 0.4 seconds */ +#define UBX_WATCHDOG_WAIT_TIME_MICROSECONDS 1000000 /**< Check for current state every second */ + +#define UBX_CONFIG_TIMEOUT 500000 #define APPNAME "gps: ubx" From bc35bb23dd8cb035c080f8ef8b4cd7a30d5184c2 Mon Sep 17 00:00:00 2001 From: px4dev Date: Fri, 18 Jan 2013 00:43:57 -0800 Subject: [PATCH 144/157] HOTFIX: disable interrupt-driven I2C mode, configure pessimistic I2C timeout, correct handling of the NAK generation for I2C master reads. This looks like it addresses the recent I2C lockup issue, unfortunately it also increases CPU consumption by ~5% for the I2C sensor bus. --- apps/systemcmds/eeprom/24xxxx_mtd.c | 27 +++++++++++++++++++++++++++ apps/systemcmds/eeprom/eeprom.c | 13 +++++++++++++ nuttx/arch/arm/src/stm32/stm32_i2c.c | 10 ++++++---- nuttx/configs/px4fmu/nsh/defconfig | 18 ++++++++++-------- 4 files changed, 56 insertions(+), 12 deletions(-) diff --git a/apps/systemcmds/eeprom/24xxxx_mtd.c b/apps/systemcmds/eeprom/24xxxx_mtd.c index 781b010651..e34be44e31 100644 --- a/apps/systemcmds/eeprom/24xxxx_mtd.c +++ b/apps/systemcmds/eeprom/24xxxx_mtd.c @@ -163,6 +163,8 @@ static ssize_t at24c_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, FAR const uint8_t *buf); static int at24c_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg); +void at24c_test(void); + /************************************************************************************ * Private Data ************************************************************************************/ @@ -218,6 +220,31 @@ static int at24c_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nbloc return (int)nblocks; } +/************************************************************************************ + * Name: at24c_test + ************************************************************************************/ + +void at24c_test(void) +{ + uint8_t buf[CONFIG_AT24XX_MTD_BLOCKSIZE]; + unsigned count = 0; + unsigned errors = 0; + + for (count = 0; count < 10000; count++) { + ssize_t result = at24c_bread(&g_at24c.mtd, 0, 1, buf); + if (result == ERROR) { + if (errors++ > 2) { + vdbg("too many errors\n"); + return; + } + } else if (result != 1) { + vdbg("unexpected %u\n", result); + } + if ((count % 100) == 0) + vdbg("test %u errors %u\n", count, errors); + } +} + /************************************************************************************ * Name: at24c_bread ************************************************************************************/ diff --git a/apps/systemcmds/eeprom/eeprom.c b/apps/systemcmds/eeprom/eeprom.c index b4257cda9b..49da513580 100644 --- a/apps/systemcmds/eeprom/eeprom.c +++ b/apps/systemcmds/eeprom/eeprom.c @@ -73,6 +73,7 @@ static void eeprom_erase(void); static void eeprom_ioctl(unsigned operation); static void eeprom_save(const char *name); static void eeprom_load(const char *name); +static void eeprom_test(void); static bool attached = false; static bool started = false; @@ -93,6 +94,9 @@ int eeprom_main(int argc, char *argv[]) if (!strcmp(argv[1], "erase")) eeprom_erase(); + if (!strcmp(argv[1], "test")) + eeprom_test(); + if (0) { /* these actually require a file on the filesystem... */ if (!strcmp(argv[1], "reformat")) @@ -250,3 +254,12 @@ eeprom_load(const char *name) exit(0); } + +extern void at24c_test(void); + +static void +eeprom_test(void) +{ + at24c_test(); + exit(0); +} diff --git a/nuttx/arch/arm/src/stm32/stm32_i2c.c b/nuttx/arch/arm/src/stm32/stm32_i2c.c index fd682cd5d0..10e6cac656 100644 --- a/nuttx/arch/arm/src/stm32/stm32_i2c.c +++ b/nuttx/arch/arm/src/stm32/stm32_i2c.c @@ -1245,11 +1245,11 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) /* Disable acknowledge when last byte is to be received */ + priv->dcnt--; if (priv->dcnt == 1) { stm32_i2c_modifyreg(priv, STM32_I2C_CR1_OFFSET, I2C_CR1_ACK, 0); } - priv->dcnt--; #ifdef CONFIG_I2C_POLLED irqrestore(state); @@ -1985,7 +1985,6 @@ int up_i2creset(FAR struct i2c_dev_s * dev) uint32_t scl_gpio; uint32_t sda_gpio; int ret = ERROR; - irqstate_t state; ASSERT(dev); @@ -2010,6 +2009,9 @@ int up_i2creset(FAR struct i2c_dev_s * dev) scl_gpio = MKI2C_OUTPUT(priv->config->scl_pin); sda_gpio = MKI2C_OUTPUT(priv->config->sda_pin); + /* Let SDA go high */ + stm32_gpiowrite(sda_gpio, 1); + /* Clock the bus until any slaves currently driving it let it go. */ clock_count = 0; @@ -2017,7 +2019,7 @@ int up_i2creset(FAR struct i2c_dev_s * dev) { /* Give up if we have tried too hard */ - if (clock_count++ > 1000) + if (clock_count++ > 10) { goto out; } @@ -2032,7 +2034,7 @@ int up_i2creset(FAR struct i2c_dev_s * dev) { /* Give up if we have tried too hard */ - if (stretch_count++ > 1000) + if (stretch_count++ > 10) { goto out; } diff --git a/nuttx/configs/px4fmu/nsh/defconfig b/nuttx/configs/px4fmu/nsh/defconfig index 8a76f0e052..7bb4d10036 100755 --- a/nuttx/configs/px4fmu/nsh/defconfig +++ b/nuttx/configs/px4fmu/nsh/defconfig @@ -352,17 +352,19 @@ CONFIG_CAN2_BAUD=700000 # I2C configuration # CONFIG_I2C=y -#CONFIG_I2C_POLLED=y +CONFIG_I2C_POLLED=y CONFIG_I2C_TRANSFER=y CONFIG_I2C_TRACE=n CONFIG_I2C_RESET=y -# Allow 180 us per byte, a wide margin for the 400 KHz clock we're using -# e.g. 9.6 ms for an EEPROM page write, 0.9 ms for a MAG update -CONFIG_STM32_I2CTIMEOUS_PER_BYTE=200 -# Constant overhead for generating I2C start / stop conditions -CONFIG_STM32_I2CTIMEOUS_START_STOP=700 -# XXX this is bad and we want it gone -CONFIG_I2C_WRITEREAD=y + +# Dynamic timeout +#CONFIG_STM32_I2C_DYNTIMEO=y +#CONFIG_STM32_I2C_DYNTIMEO_STARTSTOP=500 +#CONFIG_STM32_I2C_DYNTIMEO_USECPERBYTE=200 + +# Fixed per-transaction timeout +CONFIG_STM32_I2CTIMEOSEC=0 +CONFIG_STM32_I2CTIMEOMS=10 # # General build options From 4b2d1690d33c2ae9248abd9fb025e8a1a30fbe84 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Fri, 18 Jan 2013 10:21:20 -0500 Subject: [PATCH 145/157] Set kalman_demo to only publish when it has valid info. --- apps/examples/kalman_demo/KalmanNav.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index 40166f3a14..a07280515e 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -239,7 +239,10 @@ void KalmanNav::update() // publication if (newTimeStamp - _pubTimeStamp > 1e6 / 50) { // 50 Hz _pubTimeStamp = newTimeStamp; - updatePublications(); + + if (_positionInitialized) _pos.update(); + + if (_attitudeInitialized) _att.update(); } // output @@ -589,6 +592,7 @@ int KalmanNav::correctAtt() } psi += xCorrect(PSI); + // attitude also affects nav velocities if (_positionInitialized) { vN += xCorrect(VN); From 3128529c3b67e3352de6a483292b74c22dafd377 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 19 Jan 2013 01:31:05 +0100 Subject: [PATCH 146/157] Added logging improvements for microSD --- apps/sdlog/sdlog.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/apps/sdlog/sdlog.c b/apps/sdlog/sdlog.c index f8668a2e38..d79343cd91 100644 --- a/apps/sdlog/sdlog.c +++ b/apps/sdlog/sdlog.c @@ -319,8 +319,25 @@ sysvector_write_start(struct sdlog_logbuffer *logbuf) int sdlog_thread_main(int argc, char *argv[]) { + /* log every 2nd value (skip one) */ + int skip_value = 1; + + if (argc > 1) { + if (!strcmp(argv[1], "-s") && argc > 2) { + int s = atoi(argv[2]); + + if (s > 0 && s < 250) { + skip_value = s; + } else { + warnx("Ignoring skip value of %d, out of range (1..250)\n", s); + } + } + } + warnx("starting\n"); + warnx("skipping %d sensor packets between logged packets.\n", skip_value); + if (file_exist(mountpoint) != OK) { errx(1, "logging mount point %s not present, exiting.", mountpoint); } @@ -565,8 +582,6 @@ int sdlog_thread_main(int argc, char *argv[]) gyro_fd.fd = subs.sensor_sub; gyro_fd.events = POLLIN; - /* log every 2nd value (skip one) */ - int skip_value = 0; /* track skipping */ int skip_count = 0; @@ -717,7 +732,10 @@ int sdlog_thread_main(int argc, char *argv[]) pthread_mutex_lock(&sysvector_mutex); sdlog_logbuffer_write(&lb, &sysvect); /* signal the other thread new data, but not yet unlock */ - pthread_cond_signal(&sysvector_cond); + if (lb.count > lb.size / 3) { + /* only request write if several packets can be written at once */ + pthread_cond_signal(&sysvector_cond); + } /* unlock, now the writer thread may run */ pthread_mutex_unlock(&sysvector_mutex); } From d463c94ea1e96ab1052d10dbd7eee9521f0d4298 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 19 Jan 2013 12:45:23 +0100 Subject: [PATCH 147/157] Enable / disable logging while running, enabled black box logging (ringbuffer needed), enabled GPS KML logging (does not yet write outputs) --- apps/sdlog/sdlog.c | 376 ++++++++++++++++++++++----------------------- 1 file changed, 183 insertions(+), 193 deletions(-) diff --git a/apps/sdlog/sdlog.c b/apps/sdlog/sdlog.c index d79343cd91..175392afb2 100644 --- a/apps/sdlog/sdlog.c +++ b/apps/sdlog/sdlog.c @@ -73,6 +73,8 @@ #include +#include + #include "sdlog_ringbuffer.h" static bool thread_should_exit = false; /**< Deamon exit flag */ @@ -83,6 +85,7 @@ static const int MAX_NO_LOGFOLDER = 999; /**< Maximum number of log folders */ static const char *mountpoint = "/fs/microsd"; static const char *mfile_in = "/etc/logging/logconv.m"; int sysvector_file = -1; +int mavlink_fd = -1; struct sdlog_logbuffer lb; /* mutex / condition to synchronize threads */ @@ -118,6 +121,8 @@ static int file_exist(const char *filename); static int file_copy(const char *file_old, const char *file_new); +static void handle_command(struct vehicle_command_s *cmd); + /** * Print the current status. */ @@ -134,7 +139,7 @@ usage(const char *reason) if (reason) fprintf(stderr, "%s\n", reason); - errx(1, "usage: sdlog {start|stop|status} [-p ]\n\n"); + errx(1, "usage: sdlog {start|stop|status} [-s ]\n\n"); } // XXX turn this into a C++ class @@ -145,6 +150,9 @@ unsigned sysvector_bytes = 0; unsigned blackbox_file_bytes = 0; uint64_t starttime = 0; +/* logging on or off, default to true */ +bool logging_enabled = true; + /** * The sd log deamon app only briefly exists to start * the background job. The stack size assigned in the @@ -318,25 +326,44 @@ sysvector_write_start(struct sdlog_logbuffer *logbuf) int sdlog_thread_main(int argc, char *argv[]) { + mavlink_fd = open(MAVLINK_LOG_DEVICE, 0); - /* log every 2nd value (skip one) */ - int skip_value = 1; - - if (argc > 1) { - if (!strcmp(argv[1], "-s") && argc > 2) { - int s = atoi(argv[2]); - - if (s > 0 && s < 250) { - skip_value = s; - } else { - warnx("Ignoring skip value of %d, out of range (1..250)\n", s); - } - } + if (mavlink_fd < 0) { + warnx("ERROR: Failed to open MAVLink log stream, start mavlink app first.\n"); } - warnx("starting\n"); + /* log every n'th value (skip one per default) */ + int skip_value = 1; - warnx("skipping %d sensor packets between logged packets.\n", skip_value); + /* work around some stupidity in task_create's argv handling */ + argc -= 2; + argv += 2; + int ch; + + while ((ch = getopt(argc, argv, "sr")) != EOF) { + switch (ch) { + case 's': + { + /* log only every n'th (gyro clocked) value */ + unsigned s = strtoul(optarg, NULL, 10); + + if (s < 1 || s > 250) { + errx(1, "Wrong skip value of %d, out of range (1..250)\n", s); + } else { + skip_value = s; + } + } + break; + + case 'r': + /* log only on request, disable logging per default */ + logging_enabled = false; + break; + + default: + usage("unrecognized flag"); + } + } if (file_exist(mountpoint) != OK) { errx(1, "logging mount point %s not present, exiting.", mountpoint); @@ -347,31 +374,15 @@ int sdlog_thread_main(int argc, char *argv[]) if (create_logfolder(folder_path)) errx(1, "unable to create logging folder, exiting."); - /* create sensorfile */ - int sensorfile = -1; - int actuator_outputs_file = -1; - int actuator_controls_file = -1; FILE *gpsfile; FILE *blackbox_file; - // FILE *vehiclefile; - char path_buf[64] = ""; // string to hold the path to the sensorfile + /* string to hold the path to the sensorfile */ + char path_buf[64] = ""; + /* only print logging path, important to find log file later */ warnx("logging to directory %s\n", folder_path); - /* set up file path: e.g. /mnt/sdcard/session0001/sensor_combined.bin */ - sprintf(path_buf, "%s/%s.bin", folder_path, "sensor_combined"); - - if (0 == (sensorfile = open(path_buf, O_CREAT | O_WRONLY | O_DSYNC))) { - errx(1, "opening %s failed.\n", path_buf); - } - - // /* set up file path: e.g. /mnt/sdcard/session0001/actuator_outputs0.bin */ - // sprintf(path_buf, "%s/%s.bin", folder_path, "actuator_outputs0"); - // if (0 == (actuator_outputs_file = open(path_buf, O_CREAT | O_WRONLY | O_DSYNC))) { - // errx(1, "opening %s failed.\n", path_buf); - // } - /* set up file path: e.g. /mnt/sdcard/session0001/actuator_controls0.bin */ sprintf(path_buf, "%s/%s.bin", folder_path, "sysvector"); @@ -379,13 +390,6 @@ int sdlog_thread_main(int argc, char *argv[]) errx(1, "opening %s failed.\n", path_buf); } - /* set up file path: e.g. /mnt/sdcard/session0001/actuator_controls0.bin */ - sprintf(path_buf, "%s/%s.bin", folder_path, "actuator_controls0"); - - if (0 == (actuator_controls_file = open(path_buf, O_CREAT | O_WRONLY | O_DSYNC))) { - errx(1, "opening %s failed.\n", path_buf); - } - /* set up file path: e.g. /mnt/sdcard/session0001/gps.txt */ sprintf(path_buf, "%s/%s.txt", folder_path, "gps"); @@ -402,6 +406,7 @@ int sdlog_thread_main(int argc, char *argv[]) errx(1, "opening %s failed.\n", path_buf); } + // XXX for fsync() calls int blackbox_file_no = fileno(blackbox_file); /* --- IMPORTANT: DEFINE NUMBER OF ORB STRUCTS TO WAIT FOR HERE --- */ @@ -455,12 +460,18 @@ int sdlog_thread_main(int argc, char *argv[]) fds[fdsc_count].events = POLLIN; fdsc_count++; + /* --- GPS POSITION --- */ + /* subscribe to ORB for global position */ + subs.gps_pos_sub = orb_subscribe(ORB_ID(vehicle_gps_position)); + fds[fdsc_count].fd = subs.gps_pos_sub; + fds[fdsc_count].events = POLLIN; + fdsc_count++; + /* --- SENSORS RAW VALUE --- */ /* subscribe to ORB for sensors raw */ subs.sensor_sub = orb_subscribe(ORB_ID(sensor_combined)); fds[fdsc_count].fd = subs.sensor_sub; - /* rate-limit raw data updates to 200Hz */ - orb_set_interval(subs.sensor_sub, 5); + /* do not rate limit, instead use skip counter (aliasing on rate limit) */ fds[fdsc_count].events = POLLIN; fdsc_count++; @@ -513,13 +524,6 @@ int sdlog_thread_main(int argc, char *argv[]) fds[fdsc_count].events = POLLIN; fdsc_count++; - /* --- GPS POSITION --- */ - /* subscribe to ORB for global position */ - subs.gps_pos_sub = orb_subscribe(ORB_ID(vehicle_gps_position)); - fds[fdsc_count].fd = subs.gps_pos_sub; - fds[fdsc_count].events = POLLIN; - fdsc_count++; - /* --- VICON POSITION --- */ /* subscribe to ORB for vicon position */ subs.vicon_pos_sub = orb_subscribe(ORB_ID(vehicle_vicon_position)); @@ -577,18 +581,13 @@ int sdlog_thread_main(int argc, char *argv[]) starttime = hrt_absolute_time(); - // XXX clock the log for now with the gyro output rate / 2 - struct pollfd gyro_fd; - gyro_fd.fd = subs.sensor_sub; - gyro_fd.events = POLLIN; - /* track skipping */ int skip_count = 0; while (!thread_should_exit) { // XXX only use gyro for now - int poll_ret = poll(&gyro_fd, 1, 1000); + int poll_ret = poll(fds, 2, 1000); // int poll_ret = poll(fds, fdsc_count, timeout); @@ -599,145 +598,107 @@ int sdlog_thread_main(int argc, char *argv[]) /* XXX this is seriously bad - should be an emergency */ } else { - /* always copy sensors raw data into local buffer, since poll flags won't clear else */ - orb_copy(ORB_ID(sensor_combined), subs.sensor_sub, &buf.raw); - orb_copy(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, subs.controls_0_sub, &buf.act_controls); - orb_copy(ORB_ID_VEHICLE_ATTITUDE_CONTROLS_EFFECTIVE, subs.controls_effective_0_sub, &buf.act_controls_effective); - /* copy actuator data into local buffer */ - orb_copy(ORB_ID(actuator_outputs_0), subs.act_0_sub, &buf.act_outputs); - orb_copy(ORB_ID(vehicle_attitude_setpoint), subs.spa_sub, &buf.att_sp); - orb_copy(ORB_ID(vehicle_gps_position), subs.gps_pos_sub, &buf.gps_pos); - orb_copy(ORB_ID(vehicle_local_position), subs.local_pos_sub, &buf.local_pos); - orb_copy(ORB_ID(vehicle_global_position), subs.global_pos_sub, &buf.global_pos); - orb_copy(ORB_ID(vehicle_attitude), subs.att_sub, &buf.att); - orb_copy(ORB_ID(vehicle_vicon_position), subs.vicon_pos_sub, &buf.vicon_pos); - orb_copy(ORB_ID(optical_flow), subs.flow_sub, &buf.flow); + int ifds; - if (skip_count < skip_value) { - skip_count++; - /* do not log data */ - continue; - } else { - /* log data, reset */ - skip_count = 0; + /* --- VEHICLE COMMAND VALUE --- */ + if (fds[ifds++].revents & POLLIN) { + /* copy command into local buffer */ + orb_copy(ORB_ID(vehicle_command), subs.cmd_sub, &buf.cmd); + + /* always log to blackbox, even when logging disabled */ + blackbox_file_bytes += fprintf(blackbox_file, "[%10.4f\tVCMD] CMD #%d [%f\t%f\t%f\t%f\t%f\t%f\t%f]\n", hrt_absolute_time()/1000000.0d, + buf.cmd.command, (double)buf.cmd.param1, (double)buf.cmd.param2, (double)buf.cmd.param3, (double)buf.cmd.param4, + (double)buf.cmd.param5, (double)buf.cmd.param6, (double)buf.cmd.param7); + + handle_command(&buf.cmd); } - // int ifds = 0; + /* --- VEHICLE GPS VALUE --- */ + if (fds[ifds++].revents & POLLIN) { + /* copy gps position into local buffer */ + orb_copy(ORB_ID(vehicle_gps_position), subs.gps_pos_sub, &buf.gps_pos); - // if (poll_count % 5000 == 0) { - // fsync(sensorfile); - // fsync(actuator_outputs_file); - // fsync(actuator_controls_file); - // fsync(blackbox_file_no); - // } + /* if logging disabled, continue */ + if (logging_enabled) { - - - // /* --- VEHICLE COMMAND VALUE --- */ - // if (fds[ifds++].revents & POLLIN) { - // /* copy command into local buffer */ - // orb_copy(ORB_ID(vehicle_command), subs.cmd_sub, &buf.cmd); - // blackbox_file_bytes += fprintf(blackbox_file, "[%10.4f\tVCMD] CMD #%d [%f\t%f\t%f\t%f\t%f\t%f\t%f]\n", hrt_absolute_time()/1000000.0d, - // buf.cmd.command, (double)buf.cmd.param1, (double)buf.cmd.param2, (double)buf.cmd.param3, (double)buf.cmd.param4, - // (double)buf.cmd.param5, (double)buf.cmd.param6, (double)buf.cmd.param7); - // } - - // /* --- SENSORS RAW VALUE --- */ - // if (fds[ifds++].revents & POLLIN) { - - // /* copy sensors raw data into local buffer */ - // orb_copy(ORB_ID(sensor_combined), subs.sensor_sub, &buf.raw); - // /* write out */ - // sensor_combined_bytes += write(sensorfile, (const char*)&(buf.raw), sizeof(buf.raw)); - // } - - // /* --- ATTITUDE VALUE --- */ - // if (fds[ifds++].revents & POLLIN) { - - // /* copy attitude data into local buffer */ - // orb_copy(ORB_ID(vehicle_attitude), subs.att_sub, &buf.att); - - - // } - - // /* --- VEHICLE ATTITUDE SETPOINT --- */ - // if (fds[ifds++].revents & POLLIN) { - // /* copy local position data into local buffer */ - // orb_copy(ORB_ID(vehicle_attitude_setpoint), subs.spa_sub, &buf.att_sp); - - // } - - // /* --- ACTUATOR OUTPUTS 0 --- */ - // if (fds[ifds++].revents & POLLIN) { - // /* copy actuator data into local buffer */ - // orb_copy(ORB_ID(actuator_outputs_0), subs.act_0_sub, &buf.act_outputs); - // /* write out */ - // // actuator_outputs_bytes += write(actuator_outputs_file, (const char*)&buf.act_outputs, sizeof(buf.act_outputs)); - // } - - // /* --- ACTUATOR CONTROL --- */ - // if (fds[ifds++].revents & POLLIN) { - // orb_copy(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, subs.controls0_sub, &buf.act_controls); - // /* write out */ - // actuator_controls_bytes += write(actuator_controls_file, (const char*)&buf.act_controls, sizeof(buf.act_controls)); - // } - - - /* copy sensors raw data into local buffer */ - orb_copy(ORB_ID(sensor_combined), subs.sensor_sub, &buf.raw); - orb_copy(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, subs.controls_0_sub, &buf.act_controls); - orb_copy(ORB_ID_VEHICLE_ATTITUDE_CONTROLS_EFFECTIVE, subs.controls_effective_0_sub, &buf.act_controls_effective); - /* copy actuator data into local buffer */ - orb_copy(ORB_ID(actuator_outputs_0), subs.act_0_sub, &buf.act_outputs); - orb_copy(ORB_ID(vehicle_attitude_setpoint), subs.spa_sub, &buf.att_sp); - orb_copy(ORB_ID(vehicle_gps_position), subs.gps_pos_sub, &buf.gps_pos); - orb_copy(ORB_ID(vehicle_local_position), subs.local_pos_sub, &buf.local_pos); - orb_copy(ORB_ID(vehicle_global_position), subs.global_pos_sub, &buf.global_pos); - orb_copy(ORB_ID(vehicle_attitude), subs.att_sub, &buf.att); - orb_copy(ORB_ID(vehicle_vicon_position), subs.vicon_pos_sub, &buf.vicon_pos); - orb_copy(ORB_ID(optical_flow), subs.flow_sub, &buf.flow); - orb_copy(ORB_ID(differential_pressure), subs.diff_pressure_sub, &buf.diff_pressure); - orb_copy(ORB_ID(battery_status), subs.batt_sub, &buf.batt); - - struct sdlog_sysvector sysvect = { - .timestamp = buf.raw.timestamp, - .gyro = {buf.raw.gyro_rad_s[0], buf.raw.gyro_rad_s[1], buf.raw.gyro_rad_s[2]}, - .accel = {buf.raw.accelerometer_m_s2[0], buf.raw.accelerometer_m_s2[1], buf.raw.accelerometer_m_s2[2]}, - .mag = {buf.raw.magnetometer_ga[0], buf.raw.magnetometer_ga[1], buf.raw.magnetometer_ga[2]}, - .baro = buf.raw.baro_pres_mbar, - .baro_alt = buf.raw.baro_alt_meter, - .baro_temp = buf.raw.baro_temp_celcius, - .control = {buf.act_controls.control[0], buf.act_controls.control[1], buf.act_controls.control[2], buf.act_controls.control[3]}, - .actuators = { - buf.act_outputs.output[0], buf.act_outputs.output[1], buf.act_outputs.output[2], buf.act_outputs.output[3], - buf.act_outputs.output[4], buf.act_outputs.output[5], buf.act_outputs.output[6], buf.act_outputs.output[7] - }, - .vbat = buf.batt.voltage_v, - .bat_current = buf.batt.current_a, - .bat_discharged = buf.batt.discharged_mah, - .adc = {buf.raw.adc_voltage_v[0], buf.raw.adc_voltage_v[1], buf.raw.adc_voltage_v[2]}, - .local_position = {buf.local_pos.x, buf.local_pos.y, buf.local_pos.z}, - .gps_raw_position = {buf.gps_pos.lat, buf.gps_pos.lon, buf.gps_pos.alt}, - .attitude = {buf.att.pitch, buf.att.roll, buf.att.yaw}, - .rotMatrix = {buf.att.R[0][0], buf.att.R[0][1], buf.att.R[0][2], buf.att.R[1][0], buf.att.R[1][1], buf.att.R[1][2], buf.att.R[2][0], buf.att.R[2][1], buf.att.R[2][2]}, - .vicon = {buf.vicon_pos.x, buf.vicon_pos.y, buf.vicon_pos.z, buf.vicon_pos.roll, buf.vicon_pos.pitch, buf.vicon_pos.yaw}, - .control_effective = {buf.act_controls_effective.control_effective[0], buf.act_controls_effective.control_effective[1], buf.act_controls_effective.control_effective[2], buf.act_controls_effective.control_effective[3]}, - .flow = {buf.flow.flow_raw_x, buf.flow.flow_raw_y, buf.flow.flow_comp_x_m, buf.flow.flow_comp_y_m, buf.flow.ground_distance_m, buf.flow.quality}, - .diff_pressure = buf.diff_pressure.differential_pressure_mbar, - .ind_airspeed = buf.diff_pressure.indicated_airspeed_m_s, - .true_airspeed = buf.diff_pressure.true_airspeed_m_s - }; - - /* put into buffer for later IO */ - pthread_mutex_lock(&sysvector_mutex); - sdlog_logbuffer_write(&lb, &sysvect); - /* signal the other thread new data, but not yet unlock */ - if (lb.count > lb.size / 3) { - /* only request write if several packets can be written at once */ - pthread_cond_signal(&sysvector_cond); + /* write KML line */ + } } - /* unlock, now the writer thread may run */ - pthread_mutex_unlock(&sysvector_mutex); + + /* --- SENSORS RAW VALUE --- */ + if (fds[ifds++].revents & POLLIN) { + + // /* copy sensors raw data into local buffer */ + // orb_copy(ORB_ID(sensor_combined), subs.sensor_sub, &buf.raw); + // /* write out */ + // sensor_combined_bytes += write(sensorfile, (const char*)&(buf.raw), sizeof(buf.raw)); + + /* always copy sensors raw data into local buffer, since poll flags won't clear else */ + orb_copy(ORB_ID(sensor_combined), subs.sensor_sub, &buf.raw); + orb_copy(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, subs.controls_0_sub, &buf.act_controls); + orb_copy(ORB_ID_VEHICLE_ATTITUDE_CONTROLS_EFFECTIVE, subs.controls_effective_0_sub, &buf.act_controls_effective); + orb_copy(ORB_ID(actuator_outputs_0), subs.act_0_sub, &buf.act_outputs); + orb_copy(ORB_ID(vehicle_attitude_setpoint), subs.spa_sub, &buf.att_sp); + orb_copy(ORB_ID(vehicle_gps_position), subs.gps_pos_sub, &buf.gps_pos); + orb_copy(ORB_ID(vehicle_local_position), subs.local_pos_sub, &buf.local_pos); + orb_copy(ORB_ID(vehicle_global_position), subs.global_pos_sub, &buf.global_pos); + orb_copy(ORB_ID(vehicle_attitude), subs.att_sub, &buf.att); + orb_copy(ORB_ID(vehicle_vicon_position), subs.vicon_pos_sub, &buf.vicon_pos); + orb_copy(ORB_ID(optical_flow), subs.flow_sub, &buf.flow); + orb_copy(ORB_ID(differential_pressure), subs.diff_pressure_sub, &buf.diff_pressure); + orb_copy(ORB_ID(battery_status), subs.batt_sub, &buf.batt); + + /* if skipping is on or logging is disabled, ignore */ + if (skip_count < skip_value || !logging_enabled) { + skip_count++; + /* do not log data */ + continue; + } else { + /* log data, reset */ + skip_count = 0; + } + + struct sdlog_sysvector sysvect = { + .timestamp = buf.raw.timestamp, + .gyro = {buf.raw.gyro_rad_s[0], buf.raw.gyro_rad_s[1], buf.raw.gyro_rad_s[2]}, + .accel = {buf.raw.accelerometer_m_s2[0], buf.raw.accelerometer_m_s2[1], buf.raw.accelerometer_m_s2[2]}, + .mag = {buf.raw.magnetometer_ga[0], buf.raw.magnetometer_ga[1], buf.raw.magnetometer_ga[2]}, + .baro = buf.raw.baro_pres_mbar, + .baro_alt = buf.raw.baro_alt_meter, + .baro_temp = buf.raw.baro_temp_celcius, + .control = {buf.act_controls.control[0], buf.act_controls.control[1], buf.act_controls.control[2], buf.act_controls.control[3]}, + .actuators = { + buf.act_outputs.output[0], buf.act_outputs.output[1], buf.act_outputs.output[2], buf.act_outputs.output[3], + buf.act_outputs.output[4], buf.act_outputs.output[5], buf.act_outputs.output[6], buf.act_outputs.output[7] + }, + .vbat = buf.batt.voltage_v, + .bat_current = buf.batt.current_a, + .bat_discharged = buf.batt.discharged_mah, + .adc = {buf.raw.adc_voltage_v[0], buf.raw.adc_voltage_v[1], buf.raw.adc_voltage_v[2]}, + .local_position = {buf.local_pos.x, buf.local_pos.y, buf.local_pos.z}, + .gps_raw_position = {buf.gps_pos.lat, buf.gps_pos.lon, buf.gps_pos.alt}, + .attitude = {buf.att.pitch, buf.att.roll, buf.att.yaw}, + .rotMatrix = {buf.att.R[0][0], buf.att.R[0][1], buf.att.R[0][2], buf.att.R[1][0], buf.att.R[1][1], buf.att.R[1][2], buf.att.R[2][0], buf.att.R[2][1], buf.att.R[2][2]}, + .vicon = {buf.vicon_pos.x, buf.vicon_pos.y, buf.vicon_pos.z, buf.vicon_pos.roll, buf.vicon_pos.pitch, buf.vicon_pos.yaw}, + .control_effective = {buf.act_controls_effective.control_effective[0], buf.act_controls_effective.control_effective[1], buf.act_controls_effective.control_effective[2], buf.act_controls_effective.control_effective[3]}, + .flow = {buf.flow.flow_raw_x, buf.flow.flow_raw_y, buf.flow.flow_comp_x_m, buf.flow.flow_comp_y_m, buf.flow.ground_distance_m, buf.flow.quality}, + .diff_pressure = buf.diff_pressure.differential_pressure_mbar, + .ind_airspeed = buf.diff_pressure.indicated_airspeed_m_s, + .true_airspeed = buf.diff_pressure.true_airspeed_m_s + }; + + /* put into buffer for later IO */ + pthread_mutex_lock(&sysvector_mutex); + sdlog_logbuffer_write(&lb, &sysvect); + /* signal the other thread new data, but not yet unlock */ + if ((unsigned)lb.count > lb.size / 3) { + /* only request write if several packets can be written at once */ + pthread_cond_signal(&sysvector_cond); + } + /* unlock, now the writer thread may run */ + pthread_mutex_unlock(&sysvector_mutex); + } + } } @@ -752,9 +713,8 @@ int sdlog_thread_main(int argc, char *argv[]) warnx("exiting.\n"); - close(sensorfile); - close(actuator_outputs_file); - close(actuator_controls_file); + /* finish KML file */ + // XXX fclose(gpsfile); fclose(blackbox_file); @@ -821,4 +781,34 @@ int file_copy(const char *file_old, const char *file_new) return ret; } +void handle_command(struct vehicle_command_s *cmd) +{ + /* result of the command */ + uint8_t result = VEHICLE_CMD_RESULT_UNSUPPORTED; + /* request to set different system mode */ + switch (cmd->command) { + + case VEHICLE_CMD_PREFLIGHT_STORAGE: + + if (((int)(cmd->param3)) == 1) { + + /* enable logging */ + mavlink_log_info(mavlink_fd, "[log] file:"); + mavlink_log_info(mavlink_fd, "logdir"); + logging_enabled = true; + } + if (((int)(cmd->param3)) == 0) { + + /* disable logging */ + mavlink_log_info(mavlink_fd, "[log] stopped."); + logging_enabled = false; + } + break; + + default: + /* silently ignore */ + break; + } + +} From c15093bb5591b24c590fc6f8278f26d5807ac882 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 19 Jan 2013 12:52:25 +0100 Subject: [PATCH 148/157] Bringing back old I2C code, just temporary workaround --- nuttx/arch/arm/src/stm32/stm32_i2c.c | 395 +++++++++++++-------------- 1 file changed, 190 insertions(+), 205 deletions(-) diff --git a/nuttx/arch/arm/src/stm32/stm32_i2c.c b/nuttx/arch/arm/src/stm32/stm32_i2c.c index 10e6cac656..a4b10b55c6 100644 --- a/nuttx/arch/arm/src/stm32/stm32_i2c.c +++ b/nuttx/arch/arm/src/stm32/stm32_i2c.c @@ -107,23 +107,17 @@ #if !defined(CONFIG_STM32_I2CTIMEOSEC) && !defined(CONFIG_STM32_I2CTIMEOMS) # define CONFIG_STM32_I2CTIMEOSEC 0 -# define CONFIG_STM32_I2CTIMEOMS 500 /* Default is 500 milliseconds */ +# define CONFIG_STM32_I2CTIMEOMS 500 /* Default is 500 milliseconds */ #elif !defined(CONFIG_STM32_I2CTIMEOSEC) # define CONFIG_STM32_I2CTIMEOSEC 0 /* User provided milliseconds */ #elif !defined(CONFIG_STM32_I2CTIMEOMS) -# define CONFIG_STM32_I2CTIMEOMS 0 /* User provided seconds */ +# define CONFIG_STM32_I2CTIMEOMS 0 /* User provided seconds */ #endif /* Interrupt wait time timeout in system timer ticks */ -#ifndef CONFIG_STM32_I2CTIMEOTICKS -# define CONFIG_STM32_I2CTIMEOTICKS \ - (SEC2TICK(CONFIG_STM32_I2CTIMEOSEC) + MSEC2TICK(CONFIG_STM32_I2CTIMEOMS)) -#endif - -#ifndef CONFIG_STM32_I2C_DYNTIMEO_STARTSTOP -# define CONFIG_STM32_I2C_DYNTIMEO_STARTSTOP TICK2USEC(CONFIG_STM32_I2CTIMEOTICKS) -#endif +#define CONFIG_STM32_I2CTIMEOTICKS \ + (SEC2TICK(CONFIG_STM32_I2CTIMEOSEC) + MSEC2TICK(CONFIG_STM32_I2CTIMEOMS)) /* On the STM32F103ZE, there is an internal conflict between I2C1 and FSMC. In that * case, it is necessary to disable FSMC before each I2C1 access and re-enable FSMC @@ -135,18 +129,6 @@ # define I2C1_FSMC_CONFLICT #endif -/* Macros to convert a I2C pin to a GPIO output */ - -#if defined(CONFIG_STM32_STM32F10XX) -# define I2C_OUTPUT (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_CNF_OUTOD | \ - GPIO_MODE_50MHz) -#elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) -# define I2C_OUTPUT (GPIO_OUTPUT | GPIO_FLOAT | GPIO_OPENDRAIN |\ - GPIO_SPEED_50MHz | GPIO_OUTPUT_SET) -#endif - -#define MKI2C_OUTPUT(p) (((p) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | I2C_OUTPUT) - /* Debug ****************************************************************************/ /* CONFIG_DEBUG_I2C + CONFIG_DEBUG enables general I2C debug output. */ @@ -218,16 +200,18 @@ struct stm32_trace_s struct stm32_i2c_config_s { - uint32_t base; /* I2C base address */ - uint32_t clk_bit; /* Clock enable bit */ - uint32_t reset_bit; /* Reset bit */ - uint32_t scl_pin; /* GPIO configuration for SCL as SCL */ - uint32_t sda_pin; /* GPIO configuration for SDA as SDA */ + uint32_t base; /* I2C base address */ #ifndef CONFIG_I2C_POLLED - int (*isr)(int, void *); /* Interrupt handler */ - uint32_t ev_irq; /* Event IRQ */ - uint32_t er_irq; /* Error IRQ */ + int ( *isr)(int, void *); /* Interrupt handler */ #endif + uint32_t clk_bit; /* Clock enable bit */ + uint32_t reset_bit; /* Reset bit */ + uint32_t scl_pin; /* GPIO configuration for SCL as SCL */ + uint32_t scl_gpio; /* GPIO configuration for SCL as a GPIO */ + uint32_t sda_pin; /* GPIO configuration for SDA as SDA */ + uint32_t sda_gpio; /* GPIO configuration for SDA as a GPIO */ + uint32_t ev_irq; /* Event IRQ */ + uint32_t er_irq; /* Error IRQ */ }; /* I2C Device Private Data */ @@ -235,31 +219,31 @@ struct stm32_i2c_config_s struct stm32_i2c_priv_s { const struct stm32_i2c_config_s *config; /* Port configuration */ - int refs; /* Referernce count */ - sem_t sem_excl; /* Mutual exclusion semaphore */ + int refs; /* Referernce count */ + sem_t sem_excl; /* Mutual exclusion semaphore */ #ifndef CONFIG_I2C_POLLED - sem_t sem_isr; /* Interrupt wait semaphore */ + sem_t sem_isr; /* Interrupt wait semaphore */ #endif - volatile uint8_t intstate; /* Interrupt handshake (see enum stm32_intstate_e) */ + volatile uint8_t intstate; /* Interrupt handshake (see enum stm32_intstate_e) */ - uint8_t msgc; /* Message count */ - struct i2c_msg_s *msgv; /* Message list */ - uint8_t *ptr; /* Current message buffer */ - int dcnt; /* Current message length */ - uint16_t flags; /* Current message flags */ + uint8_t msgc; /* Message count */ + struct i2c_msg_s *msgv; /* Message list */ + uint8_t *ptr; /* Current message buffer */ + int dcnt; /* Current message length */ + uint16_t flags; /* Current message flags */ /* I2C trace support */ #ifdef CONFIG_I2C_TRACE - int tndx; /* Trace array index */ - uint32_t start_time; /* Time when the trace was started */ + int tndx; /* Trace array index */ + uint32_t start_time; /* Time when the trace was started */ /* The actual trace data */ struct stm32_trace_s trace[CONFIG_I2C_NTRACE]; #endif - uint32_t status; /* End of transfer SR2|SR1 status */ + uint32_t status; /* End of transfer SR2|SR1 status */ }; /* I2C Device, Instance */ @@ -286,11 +270,8 @@ static inline void stm32_i2c_modifyreg(FAR struct stm32_i2c_priv_s *priv, uint8_t offset, uint16_t clearbits, uint16_t setbits); static inline void stm32_i2c_sem_wait(FAR struct i2c_dev_s *dev); -#ifdef CONFIG_STM32_I2C_DYNTIMEO -static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs); -#endif /* CONFIG_STM32_I2C_DYNTIMEO */ -static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv); -static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv); +static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv, int timeout_us); +static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv, int timeout_us); static inline void stm32_i2c_sem_post(FAR struct i2c_dev_s *dev); static inline void stm32_i2c_sem_init(FAR struct i2c_dev_s *dev); static inline void stm32_i2c_sem_destroy(FAR struct i2c_dev_s *dev); @@ -300,7 +281,7 @@ static void stm32_i2c_tracenew(FAR struct stm32_i2c_priv_s *priv, uint32_t statu static void stm32_i2c_traceevent(FAR struct stm32_i2c_priv_s *priv, enum stm32_trace_e event, uint32_t parm); static void stm32_i2c_tracedump(FAR struct stm32_i2c_priv_s *priv); -#endif /* CONFIG_I2C_TRACE */ +#endif static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv, uint32_t frequency); static inline void stm32_i2c_sendstart(FAR struct stm32_i2c_priv_s *priv); @@ -310,7 +291,7 @@ static inline uint32_t stm32_i2c_getstatus(FAR struct stm32_i2c_priv_s *priv); #ifdef I2C1_FSMC_CONFLICT static inline uint32_t stm32_i2c_disablefsmc(FAR struct stm32_i2c_priv_s *priv); static inline void stm32_i2c_enablefsmc(uint32_t ahbenr); -#endif /* I2C1_FSMC_CONFLICT */ +#endif static int stm32_i2c_isr(struct stm32_i2c_priv_s * priv); #ifndef CONFIG_I2C_POLLED #ifdef CONFIG_STM32_I2C1 @@ -348,18 +329,27 @@ static int stm32_i2c_transfer(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *m ************************************************************************************/ #ifdef CONFIG_STM32_I2C1 +# ifndef GPIO_I2C1_SCL_GPIO +# define GPIO_I2C1_SCL_GPIO 0 +# endif +# ifndef GPIO_I2C1_SDA_GPIO +# define GPIO_I2C1_SDA_GPIO 0 +# endif + static const struct stm32_i2c_config_s stm32_i2c1_config = { .base = STM32_I2C1_BASE, +#ifndef CONFIG_I2C_POLLED + .isr = stm32_i2c1_isr, +#endif .clk_bit = RCC_APB1ENR_I2C1EN, .reset_bit = RCC_APB1RSTR_I2C1RST, .scl_pin = GPIO_I2C1_SCL, + .scl_gpio = GPIO_I2C1_SCL_GPIO, .sda_pin = GPIO_I2C1_SDA, -#ifndef CONFIG_I2C_POLLED - .isr = stm32_i2c1_isr, + .sda_gpio = GPIO_I2C1_SDA_GPIO, .ev_irq = STM32_IRQ_I2C1EV, .er_irq = STM32_IRQ_I2C1ER -#endif }; struct stm32_i2c_priv_s stm32_i2c1_priv = @@ -377,18 +367,27 @@ struct stm32_i2c_priv_s stm32_i2c1_priv = #endif #ifdef CONFIG_STM32_I2C2 +# ifndef GPIO_I2C2_SCL_GPIO +# define GPIO_I2C2_SCL_GPIO 0 +# endif +# ifndef GPIO_I2C2_SDA_GPIO +# define GPIO_I2C2_SDA_GPIO 0 +# endif + static const struct stm32_i2c_config_s stm32_i2c2_config = { .base = STM32_I2C2_BASE, +#ifndef CONFIG_I2C_POLLED + .isr = stm32_i2c2_isr, +#endif .clk_bit = RCC_APB1ENR_I2C2EN, .reset_bit = RCC_APB1RSTR_I2C2RST, .scl_pin = GPIO_I2C2_SCL, + .scl_gpio = GPIO_I2C2_SCL_GPIO, .sda_pin = GPIO_I2C2_SDA, -#ifndef CONFIG_I2C_POLLED - .isr = stm32_i2c2_isr, + .sda_gpio = GPIO_I2C2_SDA_GPIO, .ev_irq = STM32_IRQ_I2C2EV, .er_irq = STM32_IRQ_I2C2ER -#endif }; struct stm32_i2c_priv_s stm32_i2c2_priv = @@ -406,18 +405,27 @@ struct stm32_i2c_priv_s stm32_i2c2_priv = #endif #ifdef CONFIG_STM32_I2C3 +# ifndef GPIO_I2C3_SCL_GPIO +# define GPIO_I2C3_SCL_GPIO 0 +# endif +# ifndef GPIO_I2C3_SDA_GPIO +# define GPIO_I2C3_SDA_GPIO 0 +# endif + static const struct stm32_i2c_config_s stm32_i2c3_config = { .base = STM32_I2C3_BASE, +#ifndef CONFIG_I2C_POLLED + .isr = stm32_i2c3_isr, +#endif .clk_bit = RCC_APB1ENR_I2C3EN, .reset_bit = RCC_APB1RSTR_I2C3RST, .scl_pin = GPIO_I2C3_SCL, + .scl_gpio = GPIO_I2C3_SCL_GPIO, .sda_pin = GPIO_I2C3_SDA, -#ifndef CONFIG_I2C_POLLED - .isr = stm32_i2c3_isr, + .sda_gpio = GPIO_I2C3_SDA_GPIO, .ev_irq = STM32_IRQ_I2C3EV, .er_irq = STM32_IRQ_I2C3ER -#endif }; struct stm32_i2c_priv_s stm32_i2c3_priv = @@ -517,35 +525,6 @@ static inline void stm32_i2c_sem_wait(FAR struct i2c_dev_s *dev) } } -/************************************************************************************ - * Name: stm32_i2c_tousecs - * - * Description: - * Return a micro-second delay based on the number of bytes left to be processed. - * - ************************************************************************************/ - -#ifdef CONFIG_STM32_I2C_DYNTIMEO -static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs) -{ - size_t bytecount = 0; - int i; - - /* Count the number of bytes left to process */ - - for (i = 0; i < msgc; i++) - { - bytecount += msgs[i].length; - } - - /* Then return a number of microseconds based on a user provided scaling - * factor. - */ - - return (useconds_t)(CONFIG_STM32_I2C_DYNTIMEO_USECPERBYTE * bytecount); -} -#endif - /************************************************************************************ * Name: stm32_i2c_sem_waitdone * @@ -555,7 +534,7 @@ static useconds_t stm32_i2c_tousecs(int msgc, FAR struct i2c_msg_s *msgs) ************************************************************************************/ #ifndef CONFIG_I2C_POLLED -static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) +static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv, int timeout_us) { struct timespec abstime; irqstate_t flags; @@ -587,24 +566,31 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) #if CONFIG_STM32_I2CTIMEOSEC > 0 abstime.tv_sec += CONFIG_STM32_I2CTIMEOSEC; #endif +#if CONFIG_STM32_I2CTIMEOUS_PER_BYTE > 0 - /* Add a value proportional to the number of bytes in the transfer */ + /* Count the number of bytes left to process */ + int i; + int bytecount = 0; + for (i = 0; i < priv->msgc; i++) + { + bytecount += priv->msgv[i].length; + } -#ifdef CONFIG_STM32_I2C_DYNTIMEO - abstime.tv_nsec += 1000 * stm32_i2c_tousecs(priv->msgc, priv->msgv); - if (abstime.tv_nsec > 1000 * 1000 * 1000) - { - abstime.tv_sec++; - abstime.tv_nsec -= 1000 * 1000 * 1000; - } - -#elif CONFIG_STM32_I2CTIMEOMS > 0 - abstime.tv_nsec += CONFIG_STM32_I2CTIMEOMS * 1000 * 1000; + abstime.tv_nsec += (CONFIG_STM32_I2CTIMEOUS_PER_BYTE * bytecount) * 1000; if (abstime.tv_nsec > 1000 * 1000 * 1000) { abstime.tv_sec++; abstime.tv_nsec -= 1000 * 1000 * 1000; } +#else + #if CONFIG_STM32_I2CTIMEOMS > 0 + abstime.tv_nsec += CONFIG_STM32_I2CTIMEOMS * 1000 * 1000; + if (abstime.tv_nsec > 1000 * 1000 * 1000) + { + abstime.tv_sec++; + abstime.tv_nsec -= 1000 * 1000 * 1000; + } + #endif #endif /* Wait until either the transfer is complete or the timeout expires */ @@ -638,21 +624,12 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) return ret; } #else -static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) +static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv, int timeout_us) { - uint32_t timeout; uint32_t start; uint32_t elapsed; int ret; - /* Get the timeout value */ - -#ifdef CONFIG_STM32_I2C_DYNTIMEO - timeout = USEC2TICK(stm32_i2c_tousecs(priv->msgc, priv->msgv)); -#else - timeout = CONFIG_STM32_I2CTIMEOTICKS; -#endif - /* Signal the interrupt handler that we are waiting. NOTE: Interrupts * are currently disabled but will be temporarily re-enabled below when * sem_timedwait() sleeps. @@ -675,11 +652,10 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) } /* Loop until the transfer is complete. */ - - while (priv->intstate != INTSTATE_DONE && elapsed < timeout); + while (priv->intstate != INTSTATE_DONE && elapsed < USEC2TICK(timeout_us)); i2cvdbg("intstate: %d elapsed: %d threshold: %d status: %08x\n", - priv->intstate, elapsed, timeout, priv->status); + priv->intstate, elapsed, USEC2TICK(timeout_us), priv->status); /* Set the interrupt state back to IDLE */ @@ -697,22 +673,13 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) * ************************************************************************************/ -static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv) +static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv, int timeout_us) { uint32_t start; uint32_t elapsed; - uint32_t timeout; uint32_t cr1; uint32_t sr1; - /* Select a timeout */ - -#ifdef CONFIG_STM32_I2C_DYNTIMEO - timeout = USEC2TICK(CONFIG_STM32_I2C_DYNTIMEO_STARTSTOP); -#else - timeout = CONFIG_STM32_I2CTIMEOTICKS; -#endif - /* Wait as stop might still be in progress; but stop might also * be set because of a timeout error: "The [STOP] bit is set and * cleared by software, cleared by hardware when a Stop condition is @@ -745,7 +712,7 @@ static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv) /* Loop until the stop is complete or a timeout occurs. */ - while (elapsed < timeout); + while (elapsed < USEC2TICK(timeout_us)); /* If we get here then a timeout occurred with the STOP condition * still pending. @@ -965,7 +932,7 @@ static void stm32_i2c_setclock(FAR struct stm32_i2c_priv_s *priv, uint32_t frequ { /* Fast mode speed calculation with Tlow/Thigh = 16/9 */ -#ifdef CONFIG_STM32_I2C_DUTY16_9 +#ifdef CONFIG_I2C_DUTY16_9 speed = (uint16_t)(STM32_PCLK1_FREQUENCY / (frequency * 25)); /* Set DUTY and fast speed bits */ @@ -1104,7 +1071,7 @@ static inline uint32_t stm32_i2c_disablefsmc(FAR struct stm32_i2c_priv_s *priv) /* Is this I2C1 */ -#if defined(CONFIG_STM32_I2C2) || defined(CONFIG_STM32_I2C3) +#ifdef CONFIG_STM32_I2C2 if (priv->config->base == STM32_I2C1_BASE) #endif { @@ -1231,29 +1198,26 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv) { stm32_i2c_traceevent(priv, I2CEVENT_RCVBYTE, priv->dcnt); - /* No interrupts or context switches may occur in the following - * sequence. Otherwise, additional bytes may be sent by the - * device. - */ - #ifdef CONFIG_I2C_POLLED irqstate_t state = irqsave(); #endif + /* Receive a byte */ *priv->ptr++ = stm32_i2c_getreg(priv, STM32_I2C_DR_OFFSET); /* Disable acknowledge when last byte is to be received */ - priv->dcnt--; if (priv->dcnt == 1) { stm32_i2c_modifyreg(priv, STM32_I2C_CR1_OFFSET, I2C_CR1_ACK, 0); } + priv->dcnt--; #ifdef CONFIG_I2C_POLLED irqrestore(state); #endif + } } @@ -1444,6 +1408,7 @@ static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv) /* Enable power and reset the peripheral */ modifyreg32(STM32_RCC_APB1ENR, 0, priv->config->clk_bit); + modifyreg32(STM32_RCC_APB1RSTR, 0, priv->config->reset_bit); modifyreg32(STM32_RCC_APB1RSTR, priv->config->reset_bit, 0); @@ -1463,10 +1428,10 @@ static int stm32_i2c_init(FAR struct stm32_i2c_priv_s *priv) /* Attach ISRs */ #ifndef CONFIG_I2C_POLLED - irq_attach(priv->config->ev_irq, priv->config->isr); - irq_attach(priv->config->er_irq, priv->config->isr); - up_enable_irq(priv->config->ev_irq); - up_enable_irq(priv->config->er_irq); + irq_attach(priv->config->ev_irq, priv->config->isr); + irq_attach(priv->config->er_irq, priv->config->isr); + up_enable_irq(priv->config->ev_irq); + up_enable_irq(priv->config->er_irq); #endif /* Set peripheral frequency, where it must be at least 2 MHz for 100 kHz @@ -1496,23 +1461,17 @@ static int stm32_i2c_deinit(FAR struct stm32_i2c_priv_s *priv) stm32_i2c_putreg(priv, STM32_I2C_CR1_OFFSET, 0); - /* Unconfigure GPIO pins */ - stm32_unconfiggpio(priv->config->scl_pin); stm32_unconfiggpio(priv->config->sda_pin); - /* Disable and detach interrupts */ - #ifndef CONFIG_I2C_POLLED up_disable_irq(priv->config->ev_irq); up_disable_irq(priv->config->er_irq); irq_detach(priv->config->ev_irq); irq_detach(priv->config->er_irq); #endif - - /* Disable clocking */ - modifyreg32(STM32_RCC_APB1ENR, priv->config->clk_bit, 0); + return OK; } @@ -1574,14 +1533,14 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms struct stm32_i2c_inst_s *inst = (struct stm32_i2c_inst_s *)dev; FAR struct stm32_i2c_priv_s *priv = inst->priv; uint32_t status = 0; - uint32_t ahbenr; + //uint32_t ahbenr; int errval = 0; ASSERT(count); /* Disable FSMC that shares a pin with I2C1 (LBAR) */ - ahbenr = stm32_i2c_disablefsmc(priv); + (void)stm32_i2c_disablefsmc(priv); /* Wait for any STOP in progress. NOTE: If we have to disable the FSMC * then we cannot do this at the top of the loop, unfortunately. The STOP @@ -1589,7 +1548,11 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms */ #ifndef I2C1_FSMC_CONFLICT - stm32_i2c_sem_waitstop(priv); + #if CONFIG_STM32_I2CTIMEOUS_START_STOP > 0 + stm32_i2c_sem_waitstop(priv, CONFIG_STM32_I2CTIMEOUS_START_STOP); + #else + stm32_i2c_sem_waitstop(priv, CONFIG_STM32_I2CTIMEOMS + CONFIG_STM32_I2CTIMEOSEC * 1000000); + #endif #endif /* Clear any pending error interrupts */ @@ -1610,6 +1573,22 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms priv->msgv = msgs; priv->msgc = count; + /* Calculate timeout values */ + int timeout_us = 0; + #if CONFIG_STM32_I2CTIMEOUS_PER_BYTE > 0 + /* Count the number of bytes left to process */ + int i; + int bytecount = 10; + for (i = 0; i < count; i++) + { + bytecount += msgs[i].length; + } + timeout_us = CONFIG_STM32_I2CTIMEOUS_PER_BYTE * bytecount; + //i2cvdbg("i2c wait: %d\n", timeout_us); + #else + timeout_us = CONFIG_STM32_I2CTIMEOMS + CONFIG_STM32_I2CTIMEOSEC * 1000000; + #endif + /* Reset I2C trace logic */ stm32_i2c_tracereset(priv); @@ -1629,7 +1608,7 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms * the BUSY flag. */ - if (stm32_i2c_sem_waitdone(priv) < 0) + if (stm32_i2c_sem_waitdone(priv, timeout_us) < 0) { status = stm32_i2c_getstatus(priv); errval = ETIMEDOUT; @@ -1644,9 +1623,7 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms */ stm32_i2c_clrstart(priv); - - /* Clear busy flag in case of timeout */ - + // XXX also clear busy flag in case of timeout status = priv->status & 0xffff; } else @@ -1976,15 +1953,13 @@ int up_i2cuninitialize(FAR struct i2c_dev_s * dev) * ************************************************************************************/ -#ifdef CONFIG_I2C_RESET int up_i2creset(FAR struct i2c_dev_s * dev) { struct stm32_i2c_priv_s * priv; - unsigned int clock_count; - unsigned int stretch_count; - uint32_t scl_gpio; - uint32_t sda_gpio; + unsigned clock_count; + unsigned stretch_count; int ret = ERROR; + irqstate_t state; ASSERT(dev); @@ -2004,73 +1979,83 @@ int up_i2creset(FAR struct i2c_dev_s * dev) stm32_i2c_deinit(priv); - /* Use GPIO configuration to un-wedge the bus */ + /* If possible, use GPIO configuration to un-wedge the bus */ - scl_gpio = MKI2C_OUTPUT(priv->config->scl_pin); - sda_gpio = MKI2C_OUTPUT(priv->config->sda_pin); - - /* Let SDA go high */ - stm32_gpiowrite(sda_gpio, 1); - - /* Clock the bus until any slaves currently driving it let it go. */ - - clock_count = 0; - while (!stm32_gpioread(sda_gpio)) + if ((priv->config->scl_gpio != 0) && (priv->config->sda_gpio != 0)) { - /* Give up if we have tried too hard */ + stm32_configgpio(priv->config->scl_gpio); + stm32_configgpio(priv->config->sda_gpio); - if (clock_count++ > 10) - { - goto out; - } - - /* Sniff to make sure that clock stretching has finished. - * - * If the bus never relaxes, the reset has failed. + /* + * Clock the bus until any slaves currently driving it let it go. */ - stretch_count = 0; - while (!stm32_gpioread(scl_gpio)) - { + clock_count = 0; + while (!stm32_gpioread(priv->config->sda_gpio)) + { + /* Give up if we have tried too hard */ - if (stretch_count++ > 10) + if (clock_count++ > 1000) { goto out; } - up_udelay(10); + /* + * Sniff to make sure that clock stretching has finished. + * + * If the bus never relaxes, the reset has failed. + */ + + stretch_count = 0; + while (!stm32_gpioread(priv->config->scl_gpio)) + { + + /* Give up if we have tried too hard */ + + if (stretch_count++ > 1000) + { + goto out; + } + + up_udelay(10); + + } + + /* Drive SCL low */ + + stm32_gpiowrite(priv->config->scl_gpio, 0); + up_udelay(10); + + /* Drive SCL high again */ + + stm32_gpiowrite(priv->config->scl_gpio, 1); + up_udelay(10); + } - /* Drive SCL low */ + /* + * Generate a start followed by a stop to reset slave + * state machines. + */ - stm32_gpiowrite(scl_gpio, 0); + stm32_gpiowrite(priv->config->sda_gpio, 0); + up_udelay(10); + stm32_gpiowrite(priv->config->scl_gpio, 0); + up_udelay(10); + stm32_gpiowrite(priv->config->scl_gpio, 1); + up_udelay(10); + stm32_gpiowrite(priv->config->sda_gpio, 1); up_udelay(10); - /* Drive SCL high again */ + /* + * Revert the GPIO configuration. + */ + stm32_unconfiggpio(priv->config->sda_gpio); + stm32_unconfiggpio(priv->config->scl_gpio); - stm32_gpiowrite(scl_gpio, 1); - up_udelay(10); } - /* Generate a start followed by a stop to reset slave - * state machines. - */ - - stm32_gpiowrite(sda_gpio, 0); - up_udelay(10); - stm32_gpiowrite(scl_gpio, 0); - up_udelay(10); - stm32_gpiowrite(scl_gpio, 1); - up_udelay(10); - stm32_gpiowrite(sda_gpio, 1); - up_udelay(10); - - /* Revert the GPIO configuration. */ - - stm32_unconfiggpio(sda_gpio); - stm32_unconfiggpio(scl_gpio); - /* Re-init the port */ stm32_i2c_init(priv); @@ -2078,11 +2063,11 @@ int up_i2creset(FAR struct i2c_dev_s * dev) out: - /* Release the port for re-use by other clients */ + /* release the port for re-use by other clients */ stm32_i2c_sem_post(dev); + return ret; } -#endif /* CONFIG_I2C_RESET */ -#endif /* CONFIG_STM32_I2C1 || CONFIG_STM32_I2C2 || CONFIG_STM32_I2C3 */ +#endif /* defined(CONFIG_STM32_I2C1) || defined(CONFIG_STM32_I2C2) || defined(CONFIG_STM32_I2C3) */ From f119d9fbda4b942f58b47b3f1af8addd052f6d9e Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 19 Jan 2013 14:46:26 +0100 Subject: [PATCH 149/157] Added home position concept, uORB struct and MAVLink announcement of home position --- apps/commander/commander.c | 123 ++++++++++++++++--------------- apps/mavlink/orb_listener.c | 16 ++++ apps/mavlink/orb_topics.h | 2 + apps/uORB/objects_common.cpp | 3 + apps/uORB/topics/home_position.h | 77 +++++++++++++++++++ 5 files changed, 160 insertions(+), 61 deletions(-) create mode 100644 apps/uORB/topics/home_position.h diff --git a/apps/commander/commander.c b/apps/commander/commander.c index f3568ee8d0..72727867d5 100644 --- a/apps/commander/commander.c +++ b/apps/commander/commander.c @@ -72,8 +72,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -1251,6 +1253,7 @@ int commander_thread_main(int argc, char *argv[]) { /* not yet initialized */ commander_initialized = false; + bool home_position_set = false; /* set parameters */ failsafe_lowlevel_timeout_ms = 0; @@ -1302,6 +1305,11 @@ int commander_thread_main(int argc, char *argv[]) /* publish current state machine */ state_machine_publish(stat_pub, ¤t_status, mavlink_fd); + /* home position */ + orb_advert_t home_pub = -1; + struct home_position_s home; + memset(&home, 0, sizeof(home)); + if (stat_pub < 0) { warnx("ERROR: orb_advertise for topic vehicle_status failed.\n"); exit(ERROR); @@ -1332,10 +1340,6 @@ int commander_thread_main(int argc, char *argv[]) uint16_t stick_off_counter = 0; uint16_t stick_on_counter = 0; - float hdop = 65535.0f; - - int gps_quality_good_counter = 0; - /* Subscribe to manual control data */ int sp_man_sub = orb_subscribe(ORB_ID(manual_control_setpoint)); struct manual_control_setpoint_s sp_man; @@ -1356,6 +1360,15 @@ int commander_thread_main(int argc, char *argv[]) memset(&local_position, 0, sizeof(local_position)); uint64_t last_local_position_time = 0; + /* + * The home position is set based on GPS only, to prevent a dependency between + * position estimator and commander. RAW GPS is more than good enough for a + * non-flying vehicle. + */ + int gps_sub = orb_subscribe(ORB_ID(vehicle_gps_position)); + struct vehicle_gps_position_s gps_position; + memset(&gps_position, 0, sizeof(gps_position)); + int sensor_sub = orb_subscribe(ORB_ID(sensor_combined)); struct sensor_combined_s sensors; memset(&sensors, 0, sizeof(sensors)); @@ -1660,65 +1673,54 @@ int commander_thread_main(int argc, char *argv[]) state_changed = true; } + if (orb_check(ORB_ID(vehicle_gps_position), &new_data)) { - /* Check if last transition deserved an audio event */ -// #warning This code depends on state that is no longer? maintained -// #if 0 -// trigger_audio_alarm(vehicle_mode_previous, vehicle_state_previous, current_status.mode, current_status.state_machine); -// #endif + orb_copy(ORB_ID(vehicle_gps_position), gps_sub, &gps_position); - /* only check gps fix if we are outdoor */ -// if (flight_env == PX4_FLIGHT_ENVIRONMENT_OUTDOOR) { -// -// hdop = (float)(gps.eph) / 100.0f; -// -// /* check if gps fix is ok */ -// if (gps.fix_type == GPS_FIX_TYPE_3D) { //TODO: is 2d-fix ok? //see http://en.wikipedia.org/wiki/Dilution_of_precision_%28GPS%29 -// -// if (gotfix_counter >= GPS_GOTFIX_COUNTER_REQUIRED) { //TODO: add also a required time? -// update_state_machine_got_position_fix(stat_pub, ¤t_status); -// gotfix_counter = 0; -// } else { -// gotfix_counter++; -// } -// nofix_counter = 0; -// -// if (hdop < 5.0f) { //TODO: this should be a parameter -// if (gps_quality_good_counter > GPS_QUALITY_GOOD_COUNTER_LIMIT) { -// current_status.gps_valid = true;//--> position estimator can use the gps measurements -// } -// -// gps_quality_good_counter++; -// -// -//// if(counter%10 == 0)//for testing only -//// warnx("gps_quality_good_counter = %u\n", gps_quality_good_counter);//for testing only -// -// } else { -// gps_quality_good_counter = 0; -// current_status.gps_valid = false;//--> position estimator can not use the gps measurements -// } -// -// } else { -// gps_quality_good_counter = 0; -// current_status.gps_valid = false;//--> position estimator can not use the gps measurements -// -// if (nofix_counter > GPS_NOFIX_COUNTER_LIMIT) { //TODO: add also a timer limit? -// update_state_machine_no_position_fix(stat_pub, ¤t_status); -// nofix_counter = 0; -// } else { -// nofix_counter++; -// } -// gotfix_counter = 0; -// } -// -// } -// -// -// if (flight_env == PX4_FLIGHT_ENVIRONMENT_TESTING) //simulate position fix for quick indoor tests - //update_state_machine_got_position_fix(stat_pub, ¤t_status, mavlink_fd); - /* end: check gps */ + /* check for first, long-term and valid GPS lock -> set home position */ + float hdop = gps_position.eph / 100.0f; + float vdop = gps_position.epv / 100.0f; + /* check if gps fix is ok */ + // XXX magic number + + /* + * If horizontal dilution of precision (hdop / eph) + * and vertical diluation of precision (vdop / epv) + * are below a certain threshold (e.g. 4 m), AND + * home position is not yet set AND the last GPS + * GPS measurement is not older than two seconds AND + * the system is currently not armed, set home + * position to the current position. + */ + if (gps_position.fix_type == GPS_FIX_TYPE_3D && (hdop < 4.0f) + && (vdop < 4.0f) + && !home_position_set + && (hrt_absolute_time() - gps_position.timestamp < 2000000) + && !current_status.flag_system_armed) { + warnx("setting home position"); + + /* copy position data to uORB home message, store it locally as well */ + home.lat = gps_position.lat; + home.lon = gps_position.lon; + home.alt = gps_position.alt; + + home.eph = gps_position.eph; + home.epv = gps_position.epv; + + home.s_variance = gps_position.s_variance; + home.p_variance = gps_position.p_variance; + + /* announce new home position */ + if (home_pub > 0) { + orb_publish(ORB_ID(home_position), home_pub, &home); + } else { + home_pub = orb_advertise(ORB_ID(home_position), &home); + } + + tune_confirm(); + } + } /* ignore RC signals if in offboard control mode */ if (!current_status.offboard_control_signal_found_once && sp_man.timestamp != 0) { @@ -2041,4 +2043,3 @@ int commander_thread_main(int argc, char *argv[]) return 0; } - diff --git a/apps/mavlink/orb_listener.c b/apps/mavlink/orb_listener.c index f5253ea358..8920714ef5 100644 --- a/apps/mavlink/orb_listener.c +++ b/apps/mavlink/orb_listener.c @@ -114,6 +114,7 @@ static void l_vehicle_attitude_controls(struct listener *l); static void l_debug_key_value(struct listener *l); static void l_optical_flow(struct listener *l); static void l_vehicle_rates_setpoint(struct listener *l); +static void l_home(struct listener *l); struct listener listeners[] = { {l_sensor_combined, &mavlink_subs.sensor_sub, 0}, @@ -137,6 +138,7 @@ struct listener listeners[] = { {l_debug_key_value, &mavlink_subs.debug_key_value, 0}, {l_optical_flow, &mavlink_subs.optical_flow, 0}, {l_vehicle_rates_setpoint, &mavlink_subs.rates_setpoint_sub, 0}, + {l_home, &mavlink_subs.home_sub, 0}, }; static const unsigned n_listeners = sizeof(listeners) / sizeof(listeners[0]); @@ -621,6 +623,16 @@ l_optical_flow(struct listener *l) flow.flow_comp_x_m, flow.flow_comp_y_m, flow.quality, flow.ground_distance_m); } +void +l_home(struct listener *l) +{ + struct home_position_s home; + + orb_copy(ORB_ID(home_position), mavlink_subs.home_sub, &home); + + mavlink_msg_gps_global_origin_send(MAVLINK_COMM_0, home.lat, home.lon, home.alt); +} + static void * uorb_receive_thread(void *arg) { @@ -688,6 +700,10 @@ uorb_receive_start(void) mavlink_subs.gps_sub = orb_subscribe(ORB_ID(vehicle_gps_position)); orb_set_interval(mavlink_subs.gps_sub, 1000); /* 1Hz updates */ + /* --- HOME POSITION --- */ + mavlink_subs.home_sub = orb_subscribe(ORB_ID(home_position)); + orb_set_interval(mavlink_subs.home_sub, 1000); /* 1Hz updates */ + /* --- SYSTEM STATE --- */ status_sub = orb_subscribe(ORB_ID(vehicle_status)); orb_set_interval(status_sub, 300); /* max 3.33 Hz updates */ diff --git a/apps/mavlink/orb_topics.h b/apps/mavlink/orb_topics.h index 4650c49916..d61cd43dce 100644 --- a/apps/mavlink/orb_topics.h +++ b/apps/mavlink/orb_topics.h @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +82,7 @@ struct mavlink_subscriptions { int input_rc_sub; int optical_flow; int rates_setpoint_sub; + int home_sub; }; extern struct mavlink_subscriptions mavlink_subs; diff --git a/apps/uORB/objects_common.cpp b/apps/uORB/objects_common.cpp index 82893b3e9a..3f3476f62a 100644 --- a/apps/uORB/objects_common.cpp +++ b/apps/uORB/objects_common.cpp @@ -68,6 +68,9 @@ ORB_DEFINE(sensor_combined, struct sensor_combined_s); #include "topics/vehicle_gps_position.h" ORB_DEFINE(vehicle_gps_position, struct vehicle_gps_position_s); +#include "topics/home_position.h" +ORB_DEFINE(home_position, struct home_position_s); + #include "topics/vehicle_status.h" ORB_DEFINE(vehicle_status, struct vehicle_status_s); diff --git a/apps/uORB/topics/home_position.h b/apps/uORB/topics/home_position.h new file mode 100644 index 0000000000..dec34b6ab4 --- /dev/null +++ b/apps/uORB/topics/home_position.h @@ -0,0 +1,77 @@ +/**************************************************************************** + * + * Copyright (C) 2012-2013 PX4 Development Team. All rights reserved. + * Author: Lorenz Meier + * + * 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 PX4 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. + * + ****************************************************************************/ + +/** + * @file home_position.h + * Definition of the GPS home position uORB topic. + * + * @author Lorenz Meier + */ + +#ifndef TOPIC_HOME_POSITION_H_ +#define TOPIC_HOME_POSITION_H_ + +#include +#include "../uORB.h" + +/** + * @addtogroup topics + * @{ + */ + +/** + * GPS home position in WGS84 coordinates. + */ +struct home_position_s +{ + uint64_t timestamp; /**< Timestamp (microseconds since system boot) */ + uint64_t time_gps_usec; /**< Timestamp (microseconds in GPS format), this is the timestamp from the gps module */ + + int32_t lat; /**< Latitude in 1E7 degrees */ + int32_t lon; /**< Longitude in 1E7 degrees */ + int32_t alt; /**< Altitude in 1E3 meters (millimeters) above MSL */ + uint16_t eph; /**< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 */ + uint16_t epv; /**< GPS VDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 */ + float s_variance; /**< speed accuracy estimate cm/s */ + float p_variance; /**< position accuracy estimate cm */ +}; + +/** + * @} + */ + +/* register this as object request broker structure */ +ORB_DECLARE(home_position); + +#endif From a10ff0fe1cd7525fdcf9fe9b11ff9e42ea0e2926 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 19 Jan 2013 14:52:33 +0100 Subject: [PATCH 150/157] First round of testing successful - back to I2C code from Dec / Nov 2012 --- nuttx/configs/px4fmu/nsh/defconfig | 32 ++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/nuttx/configs/px4fmu/nsh/defconfig b/nuttx/configs/px4fmu/nsh/defconfig index 7bb4d10036..0b27b552e1 100755 --- a/nuttx/configs/px4fmu/nsh/defconfig +++ b/nuttx/configs/px4fmu/nsh/defconfig @@ -348,6 +348,16 @@ CONFIG_CAN_LOOPBACK=n CONFIG_CAN1_BAUD=700000 CONFIG_CAN2_BAUD=700000 + +# XXX remove after integration testing +# Allow 180 us per byte, a wide margin for the 400 KHz clock we're using +# e.g. 9.6 ms for an EEPROM page write, 0.9 ms for a MAG update +CONFIG_STM32_I2CTIMEOUS_PER_BYTE=200 +# Constant overhead for generating I2C start / stop conditions +CONFIG_STM32_I2CTIMEOUS_START_STOP=700 +# XXX this is bad and we want it gone +CONFIG_I2C_WRITEREAD=y + # # I2C configuration # @@ -357,14 +367,32 @@ CONFIG_I2C_TRANSFER=y CONFIG_I2C_TRACE=n CONFIG_I2C_RESET=y + + +# XXX re-enable after integration testing + +# +# I2C configuration +# +#CONFIG_I2C=y +#CONFIG_I2C_POLLED=y +#CONFIG_I2C_TRANSFER=y +#CONFIG_I2C_TRACE=n +#CONFIG_I2C_RESET=y + # Dynamic timeout #CONFIG_STM32_I2C_DYNTIMEO=y #CONFIG_STM32_I2C_DYNTIMEO_STARTSTOP=500 #CONFIG_STM32_I2C_DYNTIMEO_USECPERBYTE=200 # Fixed per-transaction timeout -CONFIG_STM32_I2CTIMEOSEC=0 -CONFIG_STM32_I2CTIMEOMS=10 +#CONFIG_STM32_I2CTIMEOSEC=0 +#CONFIG_STM32_I2CTIMEOMS=10 + + + + + # # General build options From d6378428253aea5b8d4cd953bcca556cb4641b69 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 19 Jan 2013 16:59:56 +0100 Subject: [PATCH 151/157] Fixed a number of smaller issues with log changes, ready to merge --- apps/sdlog/sdlog.c | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/apps/sdlog/sdlog.c b/apps/sdlog/sdlog.c index 175392afb2..4fd5fea1b9 100644 --- a/apps/sdlog/sdlog.c +++ b/apps/sdlog/sdlog.c @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -180,7 +181,7 @@ int sdlog_main(int argc, char *argv[]) SCHED_PRIORITY_DEFAULT - 30, 4096, sdlog_thread_main, - (argv) ? (const char **)&argv[2] : (const char **)NULL); + (const char **)argv); exit(0); } @@ -332,15 +333,15 @@ int sdlog_thread_main(int argc, char *argv[]) warnx("ERROR: Failed to open MAVLink log stream, start mavlink app first.\n"); } - /* log every n'th value (skip one per default) */ - int skip_value = 1; + /* log every n'th value (skip three per default) */ + int skip_value = 3; /* work around some stupidity in task_create's argv handling */ argc -= 2; argv += 2; int ch; - while ((ch = getopt(argc, argv, "sr")) != EOF) { + while ((ch = getopt(argc, argv, "s:r")) != EOF) { switch (ch) { case 's': { @@ -360,8 +361,18 @@ int sdlog_thread_main(int argc, char *argv[]) logging_enabled = false; break; + case '?': + if (optopt == 'c') { + warnx("Option -%c requires an argument.\n", optopt); + } else if (isprint(optopt)) { + warnx("Unknown option `-%c'.\n", optopt); + } else { + warnx("Unknown option character `\\x%x'.\n", optopt); + } + default: usage("unrecognized flag"); + errx(1, "exiting."); } } @@ -454,7 +465,7 @@ int sdlog_thread_main(int argc, char *argv[]) } subs; /* --- MANAGEMENT - LOGGING COMMAND --- */ - /* subscribe to ORB for sensors raw */ + /* subscribe to ORB for vehicle command */ subs.cmd_sub = orb_subscribe(ORB_ID(vehicle_command)); fds[fdsc_count].fd = subs.cmd_sub; fds[fdsc_count].events = POLLIN; @@ -586,10 +597,8 @@ int sdlog_thread_main(int argc, char *argv[]) while (!thread_should_exit) { - // XXX only use gyro for now - int poll_ret = poll(fds, 2, 1000); - - // int poll_ret = poll(fds, fdsc_count, timeout); + /* only poll for commands, gps and sensor_combined */ + int poll_ret = poll(fds, 3, 1000); /* handle the poll result */ if (poll_ret == 0) { @@ -598,7 +607,7 @@ int sdlog_thread_main(int argc, char *argv[]) /* XXX this is seriously bad - should be an emergency */ } else { - int ifds; + int ifds = 0; /* --- VEHICLE COMMAND VALUE --- */ if (fds[ifds++].revents & POLLIN) { @@ -691,7 +700,7 @@ int sdlog_thread_main(int argc, char *argv[]) pthread_mutex_lock(&sysvector_mutex); sdlog_logbuffer_write(&lb, &sysvect); /* signal the other thread new data, but not yet unlock */ - if ((unsigned)lb.count > lb.size / 3) { + if ((unsigned)lb.count > (lb.size / 2)) { /* only request write if several packets can be written at once */ pthread_cond_signal(&sysvector_cond); } @@ -705,13 +714,19 @@ int sdlog_thread_main(int argc, char *argv[]) print_sdlog_status(); + /* wake up write thread one last time */ + pthread_mutex_lock(&sysvector_mutex); + pthread_cond_signal(&sysvector_cond); + /* unlock, now the writer thread may return */ + pthread_mutex_unlock(&sysvector_mutex); + /* wait for write thread to return */ (void)pthread_join(sysvector_pthread, NULL); pthread_mutex_destroy(&sysvector_mutex); pthread_cond_destroy(&sysvector_cond); - warnx("exiting.\n"); + warnx("exiting.\n\n"); /* finish KML file */ // XXX From c9c64b3f25113eba565d0926b435f2b492a7468e Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 19 Jan 2013 17:03:35 +0100 Subject: [PATCH 152/157] Added missing flag, tested --- apps/commander/commander.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/commander/commander.c b/apps/commander/commander.c index 72727867d5..cc382c2fd7 100644 --- a/apps/commander/commander.c +++ b/apps/commander/commander.c @@ -1718,6 +1718,8 @@ int commander_thread_main(int argc, char *argv[]) home_pub = orb_advertise(ORB_ID(home_position), &home); } + /* mark home position as set */ + home_position_set = true; tune_confirm(); } } From 2542722102ce0ab3520dafe9ae695cf06caae675 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 19 Jan 2013 17:11:12 +0100 Subject: [PATCH 153/157] Fixed selective publication update --- apps/examples/kalman_demo/KalmanNav.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/apps/examples/kalman_demo/KalmanNav.cpp index a07280515e..7e89dffb20 100644 --- a/apps/examples/kalman_demo/KalmanNav.cpp +++ b/apps/examples/kalman_demo/KalmanNav.cpp @@ -240,9 +240,7 @@ void KalmanNav::update() if (newTimeStamp - _pubTimeStamp > 1e6 / 50) { // 50 Hz _pubTimeStamp = newTimeStamp; - if (_positionInitialized) _pos.update(); - - if (_attitudeInitialized) _att.update(); + updatePublications(); } // output @@ -294,8 +292,13 @@ void KalmanNav::updatePublications() _att.q_valid = true; _att.counter = _navFrames; - // update publications - SuperBlock::updatePublications(); + // selectively update publications, + // do NOT call superblock do-all method + if (_positionInitialized) + _pos.update(); + + if (_attitudeInitialized) + _att.update(); } int KalmanNav::predictState(float dt) From 4b9916eded5330b8964edb87b3cc9f4815ac7af0 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 19 Jan 2013 19:32:44 +0100 Subject: [PATCH 154/157] Made threshold a bit nicer, still a magic number --- apps/commander/commander.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/commander/commander.c b/apps/commander/commander.c index cc382c2fd7..103c53dc69 100644 --- a/apps/commander/commander.c +++ b/apps/commander/commander.c @@ -1678,11 +1678,12 @@ int commander_thread_main(int argc, char *argv[]) orb_copy(ORB_ID(vehicle_gps_position), gps_sub, &gps_position); /* check for first, long-term and valid GPS lock -> set home position */ - float hdop = gps_position.eph / 100.0f; - float vdop = gps_position.epv / 100.0f; + float hdop_m = gps_position.eph / 100.0f; + float vdop_m = gps_position.epv / 100.0f; /* check if gps fix is ok */ // XXX magic number + float dop_threshold_m = 2.0f; /* * If horizontal dilution of precision (hdop / eph) @@ -1693,8 +1694,8 @@ int commander_thread_main(int argc, char *argv[]) * the system is currently not armed, set home * position to the current position. */ - if (gps_position.fix_type == GPS_FIX_TYPE_3D && (hdop < 4.0f) - && (vdop < 4.0f) + if (gps_position.fix_type == GPS_FIX_TYPE_3D && (hdop < dop_threshold_m) + && (vdop_m < dop_threshold_m) && !home_position_set && (hrt_absolute_time() - gps_position.timestamp < 2000000) && !current_status.flag_system_armed) { From 15c85ba2cb051c542a07851a155afbad0ce76b4c Mon Sep 17 00:00:00 2001 From: px4dev Date: Sat, 19 Jan 2013 18:05:33 -0800 Subject: [PATCH 155/157] Strip some debugging --- apps/px4io/mixer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/px4io/mixer.cpp b/apps/px4io/mixer.cpp index ed7d684b6f..c24cb8e52c 100644 --- a/apps/px4io/mixer.cpp +++ b/apps/px4io/mixer.cpp @@ -100,7 +100,6 @@ mixer_tick(void) /* too many frames without FMU input, time to go to failsafe */ system_state.mixer_manual_override = true; system_state.mixer_fmu_available = false; - lib_lowprintf("RX timeout\n"); } /* From 48e497e4069a2f8773d90f2d1887967a81e487d8 Mon Sep 17 00:00:00 2001 From: px4dev Date: Sat, 19 Jan 2013 18:05:53 -0800 Subject: [PATCH 156/157] Fix a leftover from the earlier merges; building should work now. --- apps/commander/commander.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/commander/commander.c b/apps/commander/commander.c index 7654b34261..3a6fecf746 100644 --- a/apps/commander/commander.c +++ b/apps/commander/commander.c @@ -1694,7 +1694,7 @@ int commander_thread_main(int argc, char *argv[]) * the system is currently not armed, set home * position to the current position. */ - if (gps_position.fix_type == GPS_FIX_TYPE_3D && (hdop < dop_threshold_m) + if (gps_position.fix_type == GPS_FIX_TYPE_3D && (hdop_m < dop_threshold_m) && (vdop_m < dop_threshold_m) && !home_position_set && (hrt_absolute_time() - gps_position.timestamp < 2000000) From f14c90c2220fffc51bc6e6e89bac6f9e726ff505 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Mon, 21 Jan 2013 17:42:08 -0800 Subject: [PATCH 157/157] Some timeout needed to be raised for now to make ubx with baudrate 9600 working --- apps/gps/ubx.c | 5 ++++- apps/gps/ubx.h | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/gps/ubx.c b/apps/gps/ubx.c index 50bf579a08..b9f8a28a07 100644 --- a/apps/gps/ubx.c +++ b/apps/gps/ubx.c @@ -880,6 +880,7 @@ void *ubx_watchdog_loop(void *args) int *fd = arguments->fd_ptr; bool *thread_should_exit = arguments->thread_should_exit_ptr; + ubx_config_state = UBX_CONFIG_STATE_PRT; /* first try to configure the GPS anyway */ configure_gps_ubx(fd); @@ -892,7 +893,7 @@ void *ubx_watchdog_loop(void *args) bool once_ok = false; int mavlink_fd = open(MAVLINK_LOG_DEVICE, 0); - ubx_config_state = UBX_CONFIG_STATE_PRT; + //int err_skip_counter = 0; while (!(*thread_should_exit)) { @@ -940,7 +941,9 @@ void *ubx_watchdog_loop(void *args) ubx_healthy = false; ubx_success_count = 0; } + /* trying to reconfigure the gps configuration */ + ubx_config_state = UBX_CONFIG_STATE_PRT; configure_gps_ubx(fd); fflush(stdout); sleep(1); diff --git a/apps/gps/ubx.h b/apps/gps/ubx.h index e700fe3880..f3313a3c6d 100644 --- a/apps/gps/ubx.h +++ b/apps/gps/ubx.h @@ -51,9 +51,9 @@ //internal definitions (not depending on the ubx protocol #define UBX_NO_OF_MESSAGES 7 /**< Read 7 UBX GPS messages */ #define UBX_WATCHDOG_CRITICAL_TIME_MICROSECONDS 3000000 /**< Allow 3 seconds maximum inter-message time */ -#define UBX_WATCHDOG_WAIT_TIME_MICROSECONDS 1000000 /**< Check for current state every second */ +#define UBX_WATCHDOG_WAIT_TIME_MICROSECONDS 2000000 /**< Check for current state every two seconds */ -#define UBX_CONFIG_TIMEOUT 500000 +#define UBX_CONFIG_TIMEOUT 1000000 #define APPNAME "gps: ubx"