From 632d7a57b137ee963d58c9853eb9c4b9d66a586e Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 25 Nov 2012 18:00:40 +0000 Subject: Fixe task_exithook() bug; fix timer usage in STM32 OTGFS host driver git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5386 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/sched/task_exithook.c | 1 + 1 file changed, 1 insertion(+) (limited to 'nuttx/sched') diff --git a/nuttx/sched/task_exithook.c b/nuttx/sched/task_exithook.c index 6f52ef739..3bde8fb7a 100644 --- a/nuttx/sched/task_exithook.c +++ b/nuttx/sched/task_exithook.c @@ -126,6 +126,7 @@ static inline void task_atexit(FAR _TCB *tcb) tcb->atexitfunc = NULL; } #endif +} #else # define task_atexit(tcb) #endif -- cgit v1.2.3 From 8cad4a664b6745ba30bcc8c08c8754f6a51a6383 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 27 Nov 2012 17:22:32 +0000 Subject: Fix backward conditional compilation in work_queue.c git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5394 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 3 +++ nuttx/configs/z8f64200100kit/ostest/Make.defs | 4 ++-- nuttx/sched/work_thread.c | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'nuttx/sched') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 810e0eb40..4b0992680 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3700,3 +3700,6 @@ * cloudctrl/src/up_chipid.c and shenzhou/src/up_chipid.c: Add functions to get chip ID. Contributed by Darcy Gong. These should not be board-dependent, but should be in arch/arm/src/stm32 where they can be used from any board. + * sched/work_thread.c: Fix backward conditional compilation. This might + has caused a memory leadk. From Freddie Chopin. + diff --git a/nuttx/configs/z8f64200100kit/ostest/Make.defs b/nuttx/configs/z8f64200100kit/ostest/Make.defs index 80a79eca4..05c2b1593 100644 --- a/nuttx/configs/z8f64200100kit/ostest/Make.defs +++ b/nuttx/configs/z8f64200100kit/ostest/Make.defs @@ -41,7 +41,7 @@ include $(TOPDIR)/tools/Config.mk ZDSVERSION := 5.0.0 ifeq ($(CONFIG_WINDOWS_NATIVE),y) - ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZZDSII_Z8Encore!_$(ZDSVERSION) + ZDSINSTALLDIR := C:/PROGRA~2/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} ZDSBINDIR := $(INSTALLDIR)\bin ZDSSTDINCDIR := $(INSTALLDIR)\include\std @@ -63,7 +63,7 @@ endif ARCHUSRINCLUDES = -usrinc:. else WINTOOL := y - ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZZDSII_Z8Encore!_$(ZDSVERSION) + ZDSINSTALLDIR := C:/Program Files (x86)/ZiLOG/ZDSII_Z8Encore!_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR := $(INSTALLDIR)/bin ZDSSTDINCDIR := $(INSTALLDIR)/include/std diff --git a/nuttx/sched/work_thread.c b/nuttx/sched/work_thread.c index abd86f771..5646b06a1 100644 --- a/nuttx/sched/work_thread.c +++ b/nuttx/sched/work_thread.c @@ -208,10 +208,10 @@ int work_hpthread(int argc, char *argv[]) * that were queued because they could not be freed in that execution * context (for example, if the memory was freed from an interrupt handler). * NOTE: If the work thread is disabled, this clean-up is performed by - * the IDLE thread (at a very, very lower priority). + * the IDLE thread (at a very, very low priority). */ -#ifdef CONFIG_SCHED_LPWORK +#ifndef CONFIG_SCHED_LPWORK sched_garbagecollection(); #endif @@ -236,7 +236,7 @@ int work_lpthread(int argc, char *argv[]) * that were queued because they could not be freed in that execution * context (for example, if the memory was freed from an interrupt handler). * NOTE: If the work thread is disabled, this clean-up is performed by - * the IDLE thread (at a very, very lower priority). + * the IDLE thread (at a very, very low priority). */ sched_garbagecollection(); -- cgit v1.2.3 From 200ce6d7ff301e68d6b90ac40a22866190b4c80b Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 9 Dec 2012 17:34:53 +0000 Subject: configs/xtrs/nsh and pashello now use kconfig-frontends and build Windows native git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5422 42af7a65-404d-4744-a932-0658087f49c3 --- apps/nshlib/nsh_consolemain.c | 8 +- apps/nshlib/nsh_dbgcmds.c | 3 +- nuttx/ChangeLog | 7 +- nuttx/configs/cloudctrl/nsh/defconfig | 3 +- nuttx/configs/ez80f910200kitg/ostest/defconfig | 3 +- nuttx/configs/ez80f910200zco/ostest/defconfig | 3 +- nuttx/configs/fire-stm32v2/nsh/defconfig | 3 +- nuttx/configs/shenzhou/nsh/defconfig | 3 +- nuttx/configs/shenzhou/nxwm/defconfig | 3 +- nuttx/configs/shenzhou/thttpd/defconfig | 3 +- nuttx/configs/sim/cxxtest/defconfig | 3 +- nuttx/configs/sim/ostest/defconfig | 3 +- nuttx/configs/stm3240g-eval/discover/defconfig | 3 +- nuttx/configs/stm3240g-eval/xmlrpc/defconfig | 3 +- nuttx/configs/stm32f100rc_generic/nsh/defconfig | 3 +- nuttx/configs/stm32f100rc_generic/ostest/defconfig | 3 +- nuttx/configs/stm32f4discovery/cxxtest/defconfig | 3 +- nuttx/configs/stm32f4discovery/elf/defconfig | 3 +- nuttx/configs/stm32f4discovery/nxlines/defconfig | 3 +- nuttx/configs/stm32f4discovery/ostest/defconfig | 3 +- nuttx/configs/stm32f4discovery/winbuild/defconfig | 3 +- nuttx/configs/xtrs/README.txt | 56 +- nuttx/configs/xtrs/nsh/appconfig | 44 -- nuttx/configs/xtrs/nsh/defconfig | 611 +++++++++++++++------ nuttx/configs/xtrs/nsh/setenv.bat | 54 ++ nuttx/configs/xtrs/nsh/setenv.sh | 45 -- nuttx/configs/xtrs/ostest/defconfig | 6 +- nuttx/configs/xtrs/pashello/appconfig | 43 -- nuttx/configs/xtrs/pashello/defconfig | 551 +++++++++++++------ nuttx/configs/xtrs/pashello/setenv.bat | 54 ++ nuttx/configs/xtrs/pashello/setenv.sh | 45 -- nuttx/configs/xtrs/src/xtr_serial.c | 3 +- nuttx/configs/z16f2800100zcog/ostest/defconfig | 3 +- nuttx/configs/z16f2800100zcog/pashello/defconfig | 3 +- nuttx/configs/z80sim/README.txt | 4 +- nuttx/configs/z80sim/nsh/defconfig | 11 +- nuttx/configs/z80sim/ostest/defconfig | 12 +- nuttx/configs/z80sim/pashello/defconfig | 17 +- nuttx/configs/z8encore000zco/ostest/defconfig | 3 +- nuttx/configs/z8f64200100kit/ostest/defconfig | 3 +- nuttx/drivers/loop.c | 2 +- nuttx/drivers/serial/Kconfig | 6 +- nuttx/drivers/serial/serial.c | 4 +- nuttx/libc/string/lib_strcasestr.c | 4 +- nuttx/libc/string/lib_strstr.c | 4 +- nuttx/sched/Kconfig | 6 - nuttx/sched/prctl.c | 6 + 47 files changed, 1079 insertions(+), 593 deletions(-) delete mode 100644 nuttx/configs/xtrs/nsh/appconfig create mode 100644 nuttx/configs/xtrs/nsh/setenv.bat delete mode 100755 nuttx/configs/xtrs/nsh/setenv.sh delete mode 100644 nuttx/configs/xtrs/pashello/appconfig create mode 100644 nuttx/configs/xtrs/pashello/setenv.bat delete mode 100755 nuttx/configs/xtrs/pashello/setenv.sh (limited to 'nuttx/sched') diff --git a/apps/nshlib/nsh_consolemain.c b/apps/nshlib/nsh_consolemain.c index 6b51be470..f05447a64 100644 --- a/apps/nshlib/nsh_consolemain.c +++ b/apps/nshlib/nsh_consolemain.c @@ -160,11 +160,11 @@ int nsh_consolemain(int argc, char *argv[]) } } - /* Clean up */ + /* Clean up. We do not get here, but this is necessary to keep some + * compilers happy. But others will complain that this code is not + * reachable. + */ nsh_exit(&pstate->cn_vtbl, 0); - - /* We do not get here, but this is necessary to keep some compilers happy */ - return OK; } diff --git a/apps/nshlib/nsh_dbgcmds.c b/apps/nshlib/nsh_dbgcmds.c index 5463e0f5a..85a4ccb9c 100644 --- a/apps/nshlib/nsh_dbgcmds.c +++ b/apps/nshlib/nsh_dbgcmds.c @@ -103,7 +103,7 @@ int mem_parse(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv, pcvalue++; lvalue = (unsigned long)strtol(pcvalue, NULL, 16); - if (lvalue > 0xffffffff) + if (lvalue > 0xffffffffL) { return -EINVAL; } @@ -131,6 +131,7 @@ int mem_parse(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv, { mem->dm_count = 1; } + return OK; } diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index e77c70e8f..ffa2e719f 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3768,6 +3768,9 @@ * tools/link.bat, unlink.bat, and copydir.bat: Add Windows counterparts to the link.sh, unlink.sh, and copydir.sh Bash scripts. * configs/z80sim/pashello: Now builds correctly. - * configs/xtrs/ostest: Converted to (1) used the kconfig-frontends - configuration tool, and (2) to build natively under Windows. + * configs/xtrs/ostest, nsh, and pashello: Converted to (1) used the kconfig- + frontends configuration tool, and (2) to build natively under Windows. + * drivers/serial/Kconfig and sched/Kconfig: Two names for same configuration: + CONFIG_LOWLEVEL_CONSOLE is bogus and CONFIG_DEV_LOWCONSOLE is in the wrong + Kconfig file. Moved to drivers/serial/Kconfig replacing CONFIG_LOWLEVEL_CONSOLE. diff --git a/nuttx/configs/cloudctrl/nsh/defconfig b/nuttx/configs/cloudctrl/nsh/defconfig index 440cb3e0b..fbb5e8c13 100644 --- a/nuttx/configs/cloudctrl/nsh/defconfig +++ b/nuttx/configs/cloudctrl/nsh/defconfig @@ -264,7 +264,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=9 CONFIG_START_DAY=8 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -356,7 +355,7 @@ CONFIG_MMCSD_SPICLOCK=12500000 # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/ez80f910200kitg/ostest/defconfig b/nuttx/configs/ez80f910200kitg/ostest/defconfig index 0e399cfc7..d8be31a97 100644 --- a/nuttx/configs/ez80f910200kitg/ostest/defconfig +++ b/nuttx/configs/ez80f910200kitg/ostest/defconfig @@ -153,7 +153,6 @@ CONFIG_START_YEAR=2009 CONFIG_START_MONTH=2 CONFIG_START_DAY=25 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -232,7 +231,7 @@ CONFIG_MMCSD_SDIO=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -CONFIG_LOWLEVEL_CONSOLE=y +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART0=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/ez80f910200zco/ostest/defconfig b/nuttx/configs/ez80f910200zco/ostest/defconfig index 7597bcfd6..977dda1dc 100644 --- a/nuttx/configs/ez80f910200zco/ostest/defconfig +++ b/nuttx/configs/ez80f910200zco/ostest/defconfig @@ -156,7 +156,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=11 CONFIG_START_DAY=26 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -235,7 +234,7 @@ CONFIG_MMCSD_SDIO=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART0=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/fire-stm32v2/nsh/defconfig b/nuttx/configs/fire-stm32v2/nsh/defconfig index 8e371686b..2fb623a0d 100644 --- a/nuttx/configs/fire-stm32v2/nsh/defconfig +++ b/nuttx/configs/fire-stm32v2/nsh/defconfig @@ -257,7 +257,6 @@ CONFIG_START_YEAR=2011 CONFIG_START_MONTH=7 CONFIG_START_DAY=5 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -366,7 +365,7 @@ CONFIG_ENC28J60_FREQUENCY=20000000 # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART1=y CONFIG_ARCH_HAVE_USART2=y diff --git a/nuttx/configs/shenzhou/nsh/defconfig b/nuttx/configs/shenzhou/nsh/defconfig index 4c73b7a6c..36f8e40fc 100644 --- a/nuttx/configs/shenzhou/nsh/defconfig +++ b/nuttx/configs/shenzhou/nsh/defconfig @@ -264,7 +264,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=9 CONFIG_START_DAY=8 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -356,7 +355,7 @@ CONFIG_MMCSD_SPICLOCK=12500000 # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/shenzhou/nxwm/defconfig b/nuttx/configs/shenzhou/nxwm/defconfig index ccc411a4d..86d17c3ee 100644 --- a/nuttx/configs/shenzhou/nxwm/defconfig +++ b/nuttx/configs/shenzhou/nxwm/defconfig @@ -265,7 +265,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=9 CONFIG_START_DAY=26 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -370,7 +369,7 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/shenzhou/thttpd/defconfig b/nuttx/configs/shenzhou/thttpd/defconfig index e8f189282..ccbcf9ab2 100644 --- a/nuttx/configs/shenzhou/thttpd/defconfig +++ b/nuttx/configs/shenzhou/thttpd/defconfig @@ -251,7 +251,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=9 CONFIG_START_DAY=8 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -343,7 +342,7 @@ CONFIG_MMCSD_SPICLOCK=12500000 # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/sim/cxxtest/defconfig b/nuttx/configs/sim/cxxtest/defconfig index 9c1da5494..648a92851 100644 --- a/nuttx/configs/sim/cxxtest/defconfig +++ b/nuttx/configs/sim/cxxtest/defconfig @@ -127,7 +127,6 @@ CONFIG_START_YEAR=2007 CONFIG_START_MONTH=2 CONFIG_START_DAY=27 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set CONFIG_MUTEX_TYPES=y # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -198,7 +197,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set # CONFIG_STANDARD_SERIAL is not set # CONFIG_USBDEV is not set diff --git a/nuttx/configs/sim/ostest/defconfig b/nuttx/configs/sim/ostest/defconfig index 26d132cd0..aece17569 100644 --- a/nuttx/configs/sim/ostest/defconfig +++ b/nuttx/configs/sim/ostest/defconfig @@ -127,7 +127,6 @@ CONFIG_START_YEAR=2007 CONFIG_START_MONTH=2 CONFIG_START_DAY=27 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set CONFIG_MUTEX_TYPES=y # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -197,7 +196,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set # CONFIG_STANDARD_SERIAL is not set # CONFIG_USBDEV is not set diff --git a/nuttx/configs/stm3240g-eval/discover/defconfig b/nuttx/configs/stm3240g-eval/discover/defconfig index aefa05326..152486d1b 100644 --- a/nuttx/configs/stm3240g-eval/discover/defconfig +++ b/nuttx/configs/stm3240g-eval/discover/defconfig @@ -284,7 +284,6 @@ CONFIG_START_YEAR=2011 CONFIG_START_MONTH=12 CONFIG_START_DAY=6 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -363,7 +362,7 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART3=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm3240g-eval/xmlrpc/defconfig b/nuttx/configs/stm3240g-eval/xmlrpc/defconfig index dd72d6ab3..6b4c9af70 100644 --- a/nuttx/configs/stm3240g-eval/xmlrpc/defconfig +++ b/nuttx/configs/stm3240g-eval/xmlrpc/defconfig @@ -284,7 +284,6 @@ CONFIG_START_YEAR=2011 CONFIG_START_MONTH=12 CONFIG_START_DAY=6 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -355,7 +354,7 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART3=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm32f100rc_generic/nsh/defconfig b/nuttx/configs/stm32f100rc_generic/nsh/defconfig index 41bb86592..a0228a3de 100644 --- a/nuttx/configs/stm32f100rc_generic/nsh/defconfig +++ b/nuttx/configs/stm32f100rc_generic/nsh/defconfig @@ -240,7 +240,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=11 CONFIG_START_DAY=1 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -319,7 +318,7 @@ CONFIG_RTC=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm32f100rc_generic/ostest/defconfig b/nuttx/configs/stm32f100rc_generic/ostest/defconfig index c56503e1f..0041feb50 100644 --- a/nuttx/configs/stm32f100rc_generic/ostest/defconfig +++ b/nuttx/configs/stm32f100rc_generic/ostest/defconfig @@ -239,7 +239,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=11 CONFIG_START_DAY=1 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -310,7 +309,7 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm32f4discovery/cxxtest/defconfig b/nuttx/configs/stm32f4discovery/cxxtest/defconfig index 1b3df6d32..6487742cf 100644 --- a/nuttx/configs/stm32f4discovery/cxxtest/defconfig +++ b/nuttx/configs/stm32f4discovery/cxxtest/defconfig @@ -244,7 +244,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=11 CONFIG_START_DAY=2 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -316,7 +315,7 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm32f4discovery/elf/defconfig b/nuttx/configs/stm32f4discovery/elf/defconfig index 8d98fe696..b6c3ac593 100644 --- a/nuttx/configs/stm32f4discovery/elf/defconfig +++ b/nuttx/configs/stm32f4discovery/elf/defconfig @@ -242,7 +242,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=10 CONFIG_START_DAY=26 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -313,7 +312,7 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm32f4discovery/nxlines/defconfig b/nuttx/configs/stm32f4discovery/nxlines/defconfig index 4de3a0922..8609993ea 100644 --- a/nuttx/configs/stm32f4discovery/nxlines/defconfig +++ b/nuttx/configs/stm32f4discovery/nxlines/defconfig @@ -260,7 +260,6 @@ CONFIG_START_YEAR=2011 CONFIG_START_MONTH=12 CONFIG_START_DAY=6 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -349,7 +348,7 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm32f4discovery/ostest/defconfig b/nuttx/configs/stm32f4discovery/ostest/defconfig index d260a87cb..b29622c8e 100644 --- a/nuttx/configs/stm32f4discovery/ostest/defconfig +++ b/nuttx/configs/stm32f4discovery/ostest/defconfig @@ -259,7 +259,6 @@ CONFIG_START_YEAR=2009 CONFIG_START_MONTH=9 CONFIG_START_DAY=21 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -330,7 +329,7 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/stm32f4discovery/winbuild/defconfig b/nuttx/configs/stm32f4discovery/winbuild/defconfig index 311dd075d..ac8a18c9b 100644 --- a/nuttx/configs/stm32f4discovery/winbuild/defconfig +++ b/nuttx/configs/stm32f4discovery/winbuild/defconfig @@ -259,7 +259,6 @@ CONFIG_START_YEAR=2009 CONFIG_START_MONTH=9 CONFIG_START_DAY=21 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -330,7 +329,7 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/xtrs/README.txt b/nuttx/configs/xtrs/README.txt index 9f94ed9ad..1a63d3a90 100644 --- a/nuttx/configs/xtrs/README.txt +++ b/nuttx/configs/xtrs/README.txt @@ -54,9 +54,10 @@ Configuring NuttX 1) From a POSIX window: cd tools - ./configure.sh z80sim/pashello + ./configure.sh xtrs/ostest 2) From a CMD.exe window setenv.bat + make The setenv.bat will need to be updated to include the PATH to the XTRS hex2cmd program. @@ -72,9 +73,7 @@ Configuring NuttX which will give you the steps you would need to do to convert this configuration to build in other, Unix-like environments. - 3. This configuration was last verified sucessfully prior to the - the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run - natively under Cygwin. The current build requires ca. 3.2.1 SDCC. + 3. The current build requires ca. 3.2.1 SDCC. nsh @@ -84,10 +83,33 @@ Configuring NuttX This configuration can be selected by: + 1) From a POSIX window: cd tools ./configure.sh xtrs/nsh - cd - - . ./setenv.sh + 2) From a CMD.exe window + setenv.bat + make + + The setenv.bat will need to be updated to include the PATH to the XTRS + hex2cmd program. + + NOTES: + + 1. This configuration uses the mconf-based configuration tool. See the + "Reconfiguring" section below for information about changing this + configuration. + + 2. The default setup for this configuration uses a windows native build. + See the section entitled "Reconfiguring for Linux, OSX, or Cygwin" + which will give you the steps you would need to do to convert this + configuration to build in other, Unix-like environments. + + 3. The current build requires ca. 3.2.1 SDCC. + + 4. This configuration depends on configs/xtrs/src/xtrs_serial.c which + is incomplete. At compile time, the following symbols are undefined: + + ctrl, baud, rs232_xmtisr, rs232_recvisr, ch pashello @@ -99,10 +121,28 @@ Configuring NuttX This configuration can be selected by: + 1) From a POSIX window: cd tools ./configure.sh xtrs/pashello - cd - - . ./setenv.sh + 2) From a CMD.exe window + setenv.bat + make + + The setenv.bat will need to be updated to include the PATH to the XTRS + hex2cmd program. + + NOTES: + + 1. This configuration uses the mconf-based configuration tool. See the + "Reconfiguring" section below for information about changing this + configuration. + + 2. The default setup for this configuration uses a windows native build. + See the section entitled "Reconfiguring for Linux, OSX, or Cygwin" + which will give you the steps you would need to do to convert this + configuration to build in other, Unix-like environments. + + 3. The current build requires ca. 3.2.1 SDCC. Reconfiguring NuttX ^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/configs/xtrs/nsh/appconfig b/nuttx/configs/xtrs/nsh/appconfig deleted file mode 100644 index ef9401691..000000000 --- a/nuttx/configs/xtrs/nsh/appconfig +++ /dev/null @@ -1,44 +0,0 @@ -############################################################################ -# configs/xtrs/nsh/appconfig -# -# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - -# Path to example in apps/examples containing the user_start entry point - -CONFIGURED_APPS += examples/nsh - -# The NSH Library - -CONFIGURED_APPS += system/readline -CONFIGURED_APPS += nshlib - diff --git a/nuttx/configs/xtrs/nsh/defconfig b/nuttx/configs/xtrs/nsh/defconfig index dc4e59556..cc3d4da2f 100644 --- a/nuttx/configs/xtrs/nsh/defconfig +++ b/nuttx/configs/xtrs/nsh/defconfig @@ -1,137 +1,153 @@ -############################################################################ -# configs/xtrs/nsh/defconfig -# -# Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ -# -# Architecture selection # -CONFIG_ARCH="z80" -CONFIG_ARCH_Z80=y -CONFIG_ARCH_CHIP="z80" -CONFIG_ARCH_CHIP_Z80=y -CONFIG_ARCH_BOARD="xtrs" -CONFIG_ARCH_BOARD_XTRS=y -CONFIG_DRAM_SIZE=65536 +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_LINUX is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +CONFIG_WINDOWS_NATIVE=y +# CONFIG_WINDOWS_CYGWIN is not set +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set +# CONFIG_WINDOWS_MKLINK is not set # -# Z80sim specific device driver settings +# Build Configuration # -CONFIG_UART_RXBUFSIZE=256 -CONFIG_UART_TXBUFSIZE=256 +# CONFIG_APPS_DIR="..\apps" +# CONFIG_BUILD_2PASS is not set # -# General build options +# Binary Output Formats # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set -CONFIG_LINKER_START_AREA=0x5200 +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_SYMBOLS is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set +CONFIG_ARCH_Z80=y +CONFIG_ARCH="z80" +CONFIG_ARCH_CHIP="z80" +CONFIG_BOARD_LOOPSPERMSEC=100 +CONFIG_ARCH_CHIP_Z80=y +# CONFIG_ARCH_CHIP_Z8F6403 is not set +# CONFIG_ARCH_CHIP_Z8F6423 is not set +# CONFIG_ARCH_CHIP_EZ80F91 is not set +# CONFIG_ARCH_CHIP_EZ80F92 is not set +# CONFIG_ARCH_CHIP_EZ80F93 is not set +CONFIG_Z80_TOOLCHAIN_SDCCW=y +CONFIG_LINKER_HOME_AREA=0x5200 CONFIG_LINKER_CODE_AREA=0x5300 +CONFIG_LINKER_DATA_AREA=0x8000 CONFIG_LINKER_ROM_AT_0000=y +# CONFIG_ARCH_HAVEHEAD is not set # -# General OS setup +# Architecture Options # -CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_DEBUG=n -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y -CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=n -CONFIG_TASK_NAME_SIZE=0 -CONFIG_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=21 -CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=n -CONFIG_DEV_CONSOLE=n -CONFIG_DEV_LOWCONSOLE=n -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n -CONFIG_SDCLONE_DISABLE=y +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_IRQPRIO is not set +# CONFIG_ARCH_STACKDUMP is not set +# CONFIG_ENDIAN_BIG is not set # -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. +# Board Settings # -# There are certain dependency relationships in these -# features. +CONFIG_DRAM_START=0x0000 +CONFIG_DRAM_SIZE=65536 + # -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. +# Boot options # -CONFIG_DISABLE_CLOCK=n -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_DISABLE_PTHREAD=y -CONFIG_DISABLE_SIGNALS=n -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_DISABLE_ENVIRON=y -CONFIG_DISABLE_POLL=y +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set # -# Misc libc settings +# Board Selection # -CONFIG_NOPRINTF_FIELDWIDTH=y +CONFIG_ARCH_BOARD_XTRS=y +# CONFIG_ARCH_BOARD_Z80SIM is not set +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="xtrs" # -# Allow for architecture optimized implementations +# Common Board Options # -# The architecture can provide optimized versions of the -# following to improve sysem performance +CONFIG_NSH_MMCSDMINOR=0 + +# +# Board-Specific Options # -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n + +# +# RTOS Features +# +CONFIG_MSEC_PER_TICK=10 +CONFIG_RR_INTERVAL=0 +# CONFIG_SCHED_INSTRUMENTATION is not set +CONFIG_TASK_NAME_SIZE=0 +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2012 +CONFIG_START_MONTH=12 +CONFIG_START_DAY=9 +CONFIG_DEV_CONSOLE=y +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_DISABLE_OS_API=y +# CONFIG_DISABLE_CLOCK is not set +CONFIG_DISABLE_POSIX_TIMERS=y +CONFIG_DISABLE_PTHREAD=y +# CONFIG_DISABLE_SIGNALS is not set +CONFIG_DISABLE_MQUEUE=y +CONFIG_DISABLE_MOUNTPOINT=y +CONFIG_DISABLE_ENVIRON=y +CONFIG_DISABLE_POLL=y # # Sizes of configurable things (0 disables) @@ -142,8 +158,6 @@ CONFIG_NPTHREAD_KEYS=0 CONFIG_NFILE_DESCRIPTORS=6 CONFIG_NFILE_STREAMS=6 CONFIG_NAME_MAX=32 -CONFIG_STDIO_BUFFER_SIZE=0 -CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_MQ_MSGS=0 CONFIG_MQ_MAXMSGSIZE=0 CONFIG_MAX_WDOGPARMS=2 @@ -151,77 +165,340 @@ CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 # -# TCP/IP and UDP support via uIP +# Stack and heap information +# +# CONFIG_CUSTOM_STACK is not set +CONFIG_IDLETHREAD_STACKSIZE=1024 +CONFIG_USERMAIN_STACKSIZE=1024 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=1024 + +# +# Device Drivers +# +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +# CONFIG_DEV_LOWCONSOLE is not set +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +# CONFIG_UART_SERIAL_CONSOLE is not set +CONFIG_NO_SERIAL_CONSOLE=y + +# +# UART Configuration +# +CONFIG_UART_RXBUFSIZE=64 +CONFIG_UART_TXBUFSIZE=64 +CONFIG_UART_BAUD=115200 +CONFIG_UART_BITS=8 +CONFIG_UART_PARITY=0 +CONFIG_UART_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set + +# +# System Logging Device Options +# + +# +# System Logging +# +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_NET is not set + +# +# File Systems +# + +# +# File system configuration +# +# CONFIG_FS_RAMMAP is not set + +# +# System Logging +# +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0x00000000 +CONFIG_HEAP2_SIZE=0 +# CONFIG_GRAN is not set + +# +# Binary Formats # -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set # -# UIP Network Utilities +# Library Routines # -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 +CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=0 +# CONFIG_LIBM is not set +CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set # -# Settings for examples/nsh +# Basic CXX Support # +# CONFIG_C99_BOOL8 is not set +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Named Applications +# +# CONFIG_NAMEDAPP is not set + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_NETTEST is not set +CONFIG_EXAMPLES_NSH=y +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +# CONFIG_EXAMPLES_OSTEST is not set +# CONFIG_EXAMPLES_PASHELLO is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WLAN is not set + +# +# Interpreters +# + +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# ModBus +# + +# +# FreeModbus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +CONFIG_NSH_LIBRARY=y + +# +# Disable Individual commands +# +# CONFIG_NSH_DISABLE_CAT is not set +# CONFIG_NSH_DISABLE_CD is not set +# CONFIG_NSH_DISABLE_CP is not set +# CONFIG_NSH_DISABLE_DD is not set +# CONFIG_NSH_DISABLE_ECHO is not set +# CONFIG_NSH_DISABLE_EXEC is not set +# CONFIG_NSH_DISABLE_EXIT is not set +# CONFIG_NSH_DISABLE_FREE is not set +# CONFIG_NSH_DISABLE_GET is not set +# CONFIG_NSH_DISABLE_HELP is not set +# CONFIG_NSH_DISABLE_HEXDUMP is not set +# CONFIG_NSH_DISABLE_IFCONFIG is not set +# CONFIG_NSH_DISABLE_KILL is not set +# CONFIG_NSH_DISABLE_LOSETUP is not set +# CONFIG_NSH_DISABLE_LS is not set +# CONFIG_NSH_DISABLE_MB is not set +# CONFIG_NSH_DISABLE_MKDIR is not set +# CONFIG_NSH_DISABLE_MKFATFS is not set +# CONFIG_NSH_DISABLE_MKFIFO is not set +# CONFIG_NSH_DISABLE_MKRD is not set +# CONFIG_NSH_DISABLE_MH is not set +# CONFIG_NSH_DISABLE_MOUNT is not set +# CONFIG_NSH_DISABLE_MW is not set +# CONFIG_NSH_DISABLE_NSFMOUNT is not set +# CONFIG_NSH_DISABLE_PS is not set +# CONFIG_NSH_DISABLE_PING is not set +# CONFIG_NSH_DISABLE_PUT is not set +# CONFIG_NSH_DISABLE_PWD is not set +# CONFIG_NSH_DISABLE_RM is not set +# CONFIG_NSH_DISABLE_RMDIR is not set +# CONFIG_NSH_DISABLE_SET is not set +# CONFIG_NSH_DISABLE_SH is not set +# CONFIG_NSH_DISABLE_SLEEP is not set +# CONFIG_NSH_DISABLE_TEST is not set +# CONFIG_NSH_DISABLE_UMOUNT is not set +# CONFIG_NSH_DISABLE_UNSET is not set +# CONFIG_NSH_DISABLE_USLEEP is not set +# CONFIG_NSH_DISABLE_WGET is not set +# CONFIG_NSH_DISABLE_XD is not set +CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_FILEIOSIZE=1024 -CONFIG_NSH_STRERROR=n CONFIG_NSH_LINELEN=40 CONFIG_NSH_NESTDEPTH=3 -CONFIG_NSH_DISABLESCRIPT=n -CONFIG_NSH_DISABLEBG=n -CONFIG_NSH_ROMFSETC=n +# CONFIG_NSH_DISABLESCRIPT is not set +# CONFIG_NSH_DISABLEBG is not set CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 -CONFIG_NSH_ROMFSMOUNTPT="/etc" -CONFIG_NSH_INITSCRIPT="init.d/rcS" -CONFIG_NSH_ROMFSDEVNO=0 -CONFIG_NSH_ROMFSSECTSIZE=64 -CONFIG_NSH_FATDEVNO=1 -CONFIG_NSH_FATSECTSIZE=512 -CONFIG_NSH_FATNSECTORS=1024 -CONFIG_NSH_FATMOUNTPT="/tmp" +# CONFIG_NSH_CONDEV is not set +# CONFIG_NSH_ARCHINIT is not set # -# Stack and heap information +# NxWidgets/NxWM +# + +# +# System NSH Add-Ons +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=1024 -CONFIG_USERMAIN_STACKSIZE=1024 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# FLASH Program Installation # +# CONFIG_SYSTEM_INSTALL is not set -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# readline() +# +CONFIG_SYSTEM_READLINE=y +CONFIG_READLINE_ECHO=y + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set diff --git a/nuttx/configs/xtrs/nsh/setenv.bat b/nuttx/configs/xtrs/nsh/setenv.bat new file mode 100644 index 000000000..0df2ba4b6 --- /dev/null +++ b/nuttx/configs/xtrs/nsh/setenv.bat @@ -0,0 +1,54 @@ +@echo off + +rem configs/xtrs/nsh/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the SDCC toolchain for windows. + +set PATH=C:\Program Files (x86)\SDCC/bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% + +rem This is the location where the XTRS hex2cmd program is available +rem set PATH=????:%PATH% + +echo %PATH% diff --git a/nuttx/configs/xtrs/nsh/setenv.sh b/nuttx/configs/xtrs/nsh/setenv.sh deleted file mode 100755 index 99d45f97a..000000000 --- a/nuttx/configs/xtrs/nsh/setenv.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# configs/xtrs/nsh/setenv.sh -# -# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - -export SDCC_BIN=/usr/local/bin -export PATH=${SDCC_BIN}:/sbin:/usr/sbin:${PATH_ORIG} - -echo "PATH : ${PATH}" diff --git a/nuttx/configs/xtrs/ostest/defconfig b/nuttx/configs/xtrs/ostest/defconfig index 32a7711fc..cf87886a2 100644 --- a/nuttx/configs/xtrs/ostest/defconfig +++ b/nuttx/configs/xtrs/ostest/defconfig @@ -69,7 +69,6 @@ CONFIG_ARCH_CHIP_Z80=y # CONFIG_ARCH_CHIP_EZ80F91 is not set # CONFIG_ARCH_CHIP_EZ80F92 is not set # CONFIG_ARCH_CHIP_EZ80F93 is not set -# CONFIG_Z80_TOOLCHAIN_SDCCL is not set CONFIG_Z80_TOOLCHAIN_SDCCW=y CONFIG_LINKER_HOME_AREA=0x5200 CONFIG_LINKER_CODE_AREA=0x5300 @@ -89,7 +88,7 @@ CONFIG_LINKER_ROM_AT_0000=y # # Board Settings # -CONFIG_DRAM_START= +CONFIG_DRAM_START=0x0000 CONFIG_DRAM_SIZE=65536 # @@ -129,7 +128,6 @@ CONFIG_START_YEAR=2008 CONFIG_START_MONTH=2 CONFIG_START_DAY=21 # CONFIG_DEV_CONSOLE is not set -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -199,7 +197,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/xtrs/pashello/appconfig b/nuttx/configs/xtrs/pashello/appconfig deleted file mode 100644 index 7cb5a7cf2..000000000 --- a/nuttx/configs/xtrs/pashello/appconfig +++ /dev/null @@ -1,43 +0,0 @@ -############################################################################ -# configs/xtrs/pashello/appconfig -# -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - -# Path to example in apps/examples containing the user_start entry point - -CONFIGURED_APPS += examples/pashello - -# Path to the Pascal p-code runtime interpreter module - -CONFIGURED_APPS += interpreters/pcode - diff --git a/nuttx/configs/xtrs/pashello/defconfig b/nuttx/configs/xtrs/pashello/defconfig index 52d4e6b83..d0b5d8245 100644 --- a/nuttx/configs/xtrs/pashello/defconfig +++ b/nuttx/configs/xtrs/pashello/defconfig @@ -1,138 +1,154 @@ -############################################################################ -# configs/xtrs/pashello/defconfig -# -# Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ -# -# Architecture selection # -CONFIG_ARCH="z80" +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_LINUX is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +CONFIG_WINDOWS_NATIVE=y +# CONFIG_WINDOWS_CYGWIN is not set +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set +# CONFIG_WINDOWS_MKLINK is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="..\apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_SYMBOLS is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set CONFIG_ARCH_Z80=y +CONFIG_ARCH="z80" CONFIG_ARCH_CHIP="z80" +CONFIG_BOARD_LOOPSPERMSEC=100 CONFIG_ARCH_CHIP_Z80=y -CONFIG_ARCH_BOARD="xtrs" -CONFIG_ARCH_BOARD_XTRS=y -CONFIG_DRAM_SIZE=65536 +# CONFIG_ARCH_CHIP_Z8F6403 is not set +# CONFIG_ARCH_CHIP_Z8F6423 is not set +# CONFIG_ARCH_CHIP_EZ80F91 is not set +# CONFIG_ARCH_CHIP_EZ80F92 is not set +# CONFIG_ARCH_CHIP_EZ80F93 is not set +# CONFIG_Z80_TOOLCHAIN_SDCCL is not set +CONFIG_Z80_TOOLCHAIN_SDCCW=y +CONFIG_LINKER_HOME_AREA=0x5200 +CONFIG_LINKER_CODE_AREA=0x5300 +CONFIG_LINKER_DATA_AREA=0x8000 +CONFIG_LINKER_ROM_AT_0000=y +# CONFIG_ARCH_HAVEHEAD is not set # -# xtrs specific device driver settings +# Architecture Options # -CONFIG_UART_RXBUFSIZE=256 -CONFIG_UART_TXBUFSIZE=256 +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_IRQPRIO is not set +# CONFIG_ARCH_STACKDUMP is not set +# CONFIG_ENDIAN_BIG is not set # -# General build options +# Board Settings # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=n -CONFIG_RAW_BINARY=n +CONFIG_DRAM_START=0x0000 +CONFIG_DRAM_SIZE=65536 -CONFIG_LINKER_START_AREA=0x5200 -CONFIG_LINKER_CODE_AREA=0x5300 -CONFIG_LINKER_ROM_AT_0000=y +# +# Boot options +# +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set # -# General OS setup +# Board Selection # -CONFIG_USER_ENTRYPOINT="pashello_main" -CONFIG_DEBUG=n -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y -CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=n -CONFIG_TASK_NAME_SIZE=0 -CONFIG_START_YEAR=2008 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=21 -CONFIG_JULIAN_TIME=n -CONFIG_HAVE_LOWUARTINIT=n -CONFIG_DEV_CONSOLE=n -CONFIG_DEV_LOWCONSOLE=n -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n -CONFIG_SDCLONE_DISABLE=y +CONFIG_ARCH_BOARD_XTRS=y +# CONFIG_ARCH_BOARD_Z80SIM is not set +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="xtrs" # -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. +# Common Board Options # -# There are certain dependency relationships in these -# features. + # -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. +# Board-Specific Options # + +# +# RTOS Features +# +CONFIG_MSEC_PER_TICK=10 +CONFIG_RR_INTERVAL=0 +# CONFIG_SCHED_INSTRUMENTATION is not set +CONFIG_TASK_NAME_SIZE=0 +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2012 +CONFIG_START_MONTH=12 +CONFIG_START_DAY=9 +CONFIG_DEV_CONSOLE=y +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="pashello_main" +CONFIG_DISABLE_OS_API=y CONFIG_DISABLE_CLOCK=y CONFIG_DISABLE_POSIX_TIMERS=y CONFIG_DISABLE_PTHREAD=y CONFIG_DISABLE_SIGNALS=y CONFIG_DISABLE_MQUEUE=y CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_DISABLE_ENVIRON=y +# CONFIG_DISABLE_ENVIRON is not set CONFIG_DISABLE_POLL=y -# -# Misc libc settings -# -CONFIG_NOPRINTF_FIELDWIDTH=y - -# -# Allow for architecture optimized implementations -# -# The architecture can provide optimized versions of the -# following to improve sysem performance -# -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n - # # Sizes of configurable things (0 disables) # @@ -142,8 +158,6 @@ CONFIG_NPTHREAD_KEYS=0 CONFIG_NFILE_DESCRIPTORS=4 CONFIG_NFILE_STREAMS=4 CONFIG_NAME_MAX=32 -CONFIG_STDIO_BUFFER_SIZE=0 -CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_MQ_MSGS=0 CONFIG_MQ_MAXMSGSIZE=0 CONFIG_MAX_WDOGPARMS=2 @@ -151,62 +165,287 @@ CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=0 # -# TCP/IP and UDP support via uIP +# Stack and heap information +# +# CONFIG_CUSTOM_STACK is not set +CONFIG_IDLETHREAD_STACKSIZE=1024 +CONFIG_USERMAIN_STACKSIZE=1024 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=1024 + +# +# Device Drivers +# +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +CONFIG_DEV_LOWCONSOLE=y +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART=y +CONFIG_MCU_SERIAL=y +CONFIG_UART_SERIAL_CONSOLE=y +# CONFIG_NO_SERIAL_CONSOLE is not set + # -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n +# UART Configuration +# +CONFIG_UART_RXBUFSIZE=64 +CONFIG_UART_TXBUFSIZE=64 +CONFIG_UART_BAUD=115200 +CONFIG_UART_BITS=8 +CONFIG_UART_PARITY=0 +CONFIG_UART_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set # -# UIP Network Utilities +# System Logging Device Options # -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 # -# Settings for examples/nsh -CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_CMD_SIZE=40 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 +# System Logging +# +# CONFIG_RAMLOG is not set # -# Stack and heap information +# Networking Support +# +# CONFIG_NET is not set + +# +# File Systems # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=1024 -CONFIG_USERMAIN_STACKSIZE=1024 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_SIZE= -CONFIG_HEAP_BASE= # -# Maintain legacy build behavior (revisit) +# File system configuration # +# CONFIG_FS_RAMMAP is not set -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MMCSD_SDIO=y +# +# System Logging +# +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0x00000000 +CONFIG_HEAP2_SIZE=0 +# CONFIG_GRAN is not set + +# +# Binary Formats +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# +CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=0 +CONFIG_LIB_HOMEDIR="/" +# CONFIG_LIBM is not set +CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_C99_BOOL8 is not set +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Named Applications +# +# CONFIG_NAMEDAPP is not set + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_NETTEST is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +# CONFIG_EXAMPLES_OSTEST is not set +CONFIG_EXAMPLES_PASHELLO=y +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WLAN is not set + +# +# Interpreters +# + +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +CONFIG_INTERPRETERS_PCODE=y + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# ModBus +# + +# +# FreeModbus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM +# + +# +# System NSH Add-Ons +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set diff --git a/nuttx/configs/xtrs/pashello/setenv.bat b/nuttx/configs/xtrs/pashello/setenv.bat new file mode 100644 index 000000000..fbedd244a --- /dev/null +++ b/nuttx/configs/xtrs/pashello/setenv.bat @@ -0,0 +1,54 @@ +@echo off + +rem configs/xtrs/pashello/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the SDCC toolchain for windows. + +set PATH=C:\Program Files (x86)\SDCC/bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% + +rem This is the location where the XTRS hex2cmd program is available +rem set PATH=????:%PATH% + +echo %PATH% diff --git a/nuttx/configs/xtrs/pashello/setenv.sh b/nuttx/configs/xtrs/pashello/setenv.sh deleted file mode 100755 index 4e2e98e31..000000000 --- a/nuttx/configs/xtrs/pashello/setenv.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# configs/xtrs/pashello/setenv.sh -# -# Copyright (C) 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - -export SDCC_BIN=/usr/local/bin -export PATH=${SDCC_BIN}:/sbin:/usr/sbin:${PATH_ORIG} - -echo "PATH : ${PATH}" diff --git a/nuttx/configs/xtrs/src/xtr_serial.c b/nuttx/configs/xtrs/src/xtr_serial.c index 1a84abee5..eb6846179 100644 --- a/nuttx/configs/xtrs/src/xtr_serial.c +++ b/nuttx/configs/xtrs/src/xtr_serial.c @@ -55,12 +55,13 @@ #include #include #include +#include #include "up_arch.h" #include "os_internal.h" #include "up_internal.h" -#ifdef USE_SERIAL_DRIVER +#ifdef USE_SERIALDRIVER /**************************************************************************** * Definitions diff --git a/nuttx/configs/z16f2800100zcog/ostest/defconfig b/nuttx/configs/z16f2800100zcog/ostest/defconfig index f9ed65727..defd3d5ef 100644 --- a/nuttx/configs/z16f2800100zcog/ostest/defconfig +++ b/nuttx/configs/z16f2800100zcog/ostest/defconfig @@ -153,7 +153,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=11 CONFIG_START_DAY=29 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -223,7 +222,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART0=y CONFIG_ARCH_HAVE_UART1=y diff --git a/nuttx/configs/z16f2800100zcog/pashello/defconfig b/nuttx/configs/z16f2800100zcog/pashello/defconfig index aa0fb0b1a..f3067a9e7 100644 --- a/nuttx/configs/z16f2800100zcog/pashello/defconfig +++ b/nuttx/configs/z16f2800100zcog/pashello/defconfig @@ -153,7 +153,6 @@ CONFIG_START_YEAR=2008 CONFIG_START_MONTH=1 CONFIG_START_DAY=28 CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -223,7 +222,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART0=y CONFIG_ARCH_HAVE_UART1=y diff --git a/nuttx/configs/z80sim/README.txt b/nuttx/configs/z80sim/README.txt index 50e2c7028..595a17783 100644 --- a/nuttx/configs/z80sim/README.txt +++ b/nuttx/configs/z80sim/README.txt @@ -27,7 +27,7 @@ Configuring NuttX 1) From a POSIX window: cd tools - ./configure.sh z80sim/pashello + ./configure.sh z80sim/ostest 2) From a CMD.exe window setenv.bat @@ -56,7 +56,7 @@ Configuring NuttX 1) From a POSIX window: cd tools - ./configure.sh z80sim/pashello + ./configure.sh z80sim/nsh 2) From a CMD.exe window setenv.bat diff --git a/nuttx/configs/z80sim/nsh/defconfig b/nuttx/configs/z80sim/nsh/defconfig index 5b21b97bf..1f8edacb1 100644 --- a/nuttx/configs/z80sim/nsh/defconfig +++ b/nuttx/configs/z80sim/nsh/defconfig @@ -69,8 +69,12 @@ CONFIG_ARCH_CHIP_Z80=y # CONFIG_ARCH_CHIP_EZ80F91 is not set # CONFIG_ARCH_CHIP_EZ80F92 is not set # CONFIG_ARCH_CHIP_EZ80F93 is not set -# CONFIG_Z80_TOOLCHAIN_SDCCL is not set CONFIG_Z80_TOOLCHAIN_SDCCW=y +CONFIG_LINKER_HOME_AREA=0x0000 +CONFIG_LINKER_CODE_AREA=0x0200 +CONFIG_LINKER_DATA_AREA=0x8000 +# CONFIG_LINKER_ROM_AT_0000 is not set +# CONFIG_ARCH_HAVEHEAD is not set # # Architecture Options @@ -84,7 +88,7 @@ CONFIG_Z80_TOOLCHAIN_SDCCW=y # # Board Settings # -CONFIG_DRAM_START= +CONFIG_DRAM_START=0x0000 CONFIG_DRAM_SIZE=65536 # @@ -125,7 +129,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=12 CONFIG_START_DAY=7 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -195,7 +198,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART=y CONFIG_MCU_SERIAL=y diff --git a/nuttx/configs/z80sim/ostest/defconfig b/nuttx/configs/z80sim/ostest/defconfig index 656f71fd1..a961d550d 100644 --- a/nuttx/configs/z80sim/ostest/defconfig +++ b/nuttx/configs/z80sim/ostest/defconfig @@ -69,8 +69,12 @@ CONFIG_ARCH_CHIP_Z80=y # CONFIG_ARCH_CHIP_EZ80F91 is not set # CONFIG_ARCH_CHIP_EZ80F92 is not set # CONFIG_ARCH_CHIP_EZ80F93 is not set -# CONFIG_Z80_TOOLCHAIN_SDCCL is not set CONFIG_Z80_TOOLCHAIN_SDCCW=y +CONFIG_LINKER_HOME_AREA=0x0000 +CONFIG_LINKER_CODE_AREA=0x0200 +CONFIG_LINKER_DATA_AREA=0x8000 +# CONFIG_LINKER_ROM_AT_0000 is not set +# CONFIG_ARCH_HAVEHEAD is not set # # Architecture Options @@ -84,7 +88,7 @@ CONFIG_Z80_TOOLCHAIN_SDCCW=y # # Board Settings # -CONFIG_DRAM_START= +CONFIG_DRAM_START=0x0000 CONFIG_DRAM_SIZE=65536 # @@ -124,7 +128,6 @@ CONFIG_START_YEAR=2007 CONFIG_START_MONTH=2 CONFIG_START_DAY=21 # CONFIG_DEV_CONSOLE is not set -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -194,7 +197,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART=y CONFIG_MCU_SERIAL=y @@ -289,6 +292,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # # Basic CXX Support # +# CONFIG_C99_BOOL8 is not set # CONFIG_HAVE_CXX is not set # diff --git a/nuttx/configs/z80sim/pashello/defconfig b/nuttx/configs/z80sim/pashello/defconfig index 16124f39b..a8d565ce2 100644 --- a/nuttx/configs/z80sim/pashello/defconfig +++ b/nuttx/configs/z80sim/pashello/defconfig @@ -69,8 +69,12 @@ CONFIG_ARCH_CHIP_Z80=y # CONFIG_ARCH_CHIP_EZ80F91 is not set # CONFIG_ARCH_CHIP_EZ80F92 is not set # CONFIG_ARCH_CHIP_EZ80F93 is not set -# CONFIG_Z80_TOOLCHAIN_SDCCL is not set CONFIG_Z80_TOOLCHAIN_SDCCW=y +CONFIG_LINKER_HOME_AREA=0x0000 +CONFIG_LINKER_CODE_AREA=0x0200 +CONFIG_LINKER_DATA_AREA=0x8000 +# CONFIG_LINKER_ROM_AT_0000 is not set +# CONFIG_ARCH_HAVEHEAD is not set # # Architecture Options @@ -84,7 +88,7 @@ CONFIG_Z80_TOOLCHAIN_SDCCW=y # # Board Settings # -CONFIG_DRAM_START= +CONFIG_DRAM_START=0x0000 CONFIG_DRAM_SIZE=65536 # @@ -124,7 +128,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=12 CONFIG_START_DAY=7 CONFIG_DEV_CONSOLE=y -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -194,13 +197,12 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART=y CONFIG_MCU_SERIAL=y -CONFIG_STANDARD_SERIAL=y -# CONFIG_UART_SERIAL_CONSOLE is not set -CONFIG_NO_SERIAL_CONSOLE=y +CONFIG_UART_SERIAL_CONSOLE=y +# CONFIG_NO_SERIAL_CONSOLE is not set # # UART Configuration @@ -272,6 +274,7 @@ CONFIG_HEAP2_SIZE=0 CONFIG_STDIO_BUFFER_SIZE=0 CONFIG_STDIO_LINEBUFFER=y CONFIG_NUNGET_CHARS=0 +CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBM is not set CONFIG_NOPRINTF_FIELDWIDTH=y # CONFIG_LIBC_FLOATINGPOINT is not set diff --git a/nuttx/configs/z8encore000zco/ostest/defconfig b/nuttx/configs/z8encore000zco/ostest/defconfig index 7ff44faae..b098c682b 100644 --- a/nuttx/configs/z8encore000zco/ostest/defconfig +++ b/nuttx/configs/z8encore000zco/ostest/defconfig @@ -144,7 +144,6 @@ CONFIG_START_YEAR=2012 CONFIG_START_MONTH=11 CONFIG_START_DAY=28 # CONFIG_DEV_CONSOLE is not set -CONFIG_DEV_LOWCONSOLE=y # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -214,7 +213,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART0=y CONFIG_ARCH_HAVE_UART1=y diff --git a/nuttx/configs/z8f64200100kit/ostest/defconfig b/nuttx/configs/z8f64200100kit/ostest/defconfig index 1650600cd..caa685419 100644 --- a/nuttx/configs/z8f64200100kit/ostest/defconfig +++ b/nuttx/configs/z8f64200100kit/ostest/defconfig @@ -144,7 +144,6 @@ CONFIG_START_YEAR=2008 CONFIG_START_MONTH=2 CONFIG_START_DAY=17 # CONFIG_DEV_CONSOLE is not set -# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_MUTEX_TYPES is not set # CONFIG_PRIORITY_INHERITANCE is not set # CONFIG_FDCLONE_DISABLE is not set @@ -214,7 +213,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_LOWLEVEL_CONSOLE is not set +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_UART0=y CONFIG_ARCH_HAVE_UART1=y diff --git a/nuttx/drivers/loop.c b/nuttx/drivers/loop.c index df96da59f..b5b5d82d8 100644 --- a/nuttx/drivers/loop.c +++ b/nuttx/drivers/loop.c @@ -215,7 +215,7 @@ static ssize_t loop_read(FAR struct inode *inode, unsigned char *buffer, size_t start_sector, unsigned int nsectors) { FAR struct loop_struct_s *dev; - size_t nbytesread; + ssize_t nbytesread; off_t offset; int ret; diff --git a/nuttx/drivers/serial/Kconfig b/nuttx/drivers/serial/Kconfig index 3dfd23dd1..a1e0dff49 100644 --- a/nuttx/drivers/serial/Kconfig +++ b/nuttx/drivers/serial/Kconfig @@ -3,10 +3,12 @@ # see misc/tools/kconfig-language.txt. # -config LOWLEVEL_CONSOLE +config DEV_LOWCONSOLE bool "Low-level console support" default n depends on ARCH_LOWPUTC + ---help--- + Use the simple, low-level, write-only serial console driver (minimal support) config 16550_UART bool "16550 UART Chip support" @@ -317,7 +319,7 @@ config STANDARD_SERIAL bool "Enable standard \"upper-half\" serial driver" default y if MCU_SERIAL default n if !MCU_SERIAL - depends on !LOWLEVEL_CONSOLE + depends on !DEV_LOWCONSOLE ---help--- Enable the standard, upper-half serial driver used by most MCU serial peripherals. diff --git a/nuttx/drivers/serial/serial.c b/nuttx/drivers/serial/serial.c index 9ffcd75dc..9708eb5bc 100644 --- a/nuttx/drivers/serial/serial.c +++ b/nuttx/drivers/serial/serial.c @@ -232,7 +232,9 @@ static int uart_putxmitchar(FAR uart_dev_t *dev, int ch) } } - /* We won't get here */ + /* We won't get here. Some compilers may complain that this code is + * unreachable. + */ return OK; } diff --git a/nuttx/libc/string/lib_strcasestr.c b/nuttx/libc/string/lib_strcasestr.c index 5a8d53bee..7f17a686d 100644 --- a/nuttx/libc/string/lib_strcasestr.c +++ b/nuttx/libc/string/lib_strcasestr.c @@ -127,7 +127,9 @@ FAR char *strcasestr(FAR const char *str, FAR const char *substr) candidate++; } - /* Won't get here, but some compilers might complain */ + /* Won't get here, but some compilers might complain. Others might complain + * about this code being unreachable too. + */ return NULL; } diff --git a/nuttx/libc/string/lib_strstr.c b/nuttx/libc/string/lib_strstr.c index 02f4809d2..7a60a680d 100644 --- a/nuttx/libc/string/lib_strstr.c +++ b/nuttx/libc/string/lib_strstr.c @@ -97,7 +97,9 @@ char *strstr(const char *str, const char *substr) candidate++; } - /* Won't get here, but some compilers might complain */ + /* Won't get here, but some compilers might complain. Other compilers + * might complain about this code being unreachable too. + */ return NULL; } diff --git a/nuttx/sched/Kconfig b/nuttx/sched/Kconfig index 4a3e87745..ab0de5b47 100644 --- a/nuttx/sched/Kconfig +++ b/nuttx/sched/Kconfig @@ -57,12 +57,6 @@ config DEV_CONSOLE Set if architecture-specific logic provides /dev/console. Enables stdout, stderr, stdin. -config DEV_LOWCONSOLE - bool "enable low-level serial console" - default n - ---help--- - Use the simple, low-level, write-only serial console driver (minimul support) - config MUTEX_TYPES: bool "Enable mutex types" default n diff --git a/nuttx/sched/prctl.c b/nuttx/sched/prctl.c index d71a0e174..3db83d3d7 100644 --- a/nuttx/sched/prctl.c +++ b/nuttx/sched/prctl.c @@ -157,8 +157,14 @@ int prctl(int option, ...) goto errout; } + /* Not reachable unless CONFIG_TASK_NAME_SIZE is > 0. NOTE: This might + * change if additional commands are supported. + */ + +#if CONFIG_TASK_NAME_SIZE > 0 va_end(ap); return OK; +#endif errout: va_end(ap); -- cgit v1.2.3 From 7978ac907ba023c523f51244f6da2882a1455b2e Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 11 Dec 2012 18:04:04 +0000 Subject: Add support for the Z180 MMU and generic hooks for processes git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5428 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 3 + nuttx/Documentation/NuttxPortingGuide.html | 5 +- nuttx/Documentation/README.html | 5 +- nuttx/README.txt | 2 +- nuttx/arch/Kconfig | 9 + nuttx/arch/z80/Kconfig | 54 +++- nuttx/arch/z80/include/z180/irq.h | 83 ++++-- nuttx/arch/z80/src/z180/Kconfig | 101 ++++++- nuttx/arch/z80/src/z180/Make.defs | 25 +- nuttx/arch/z80/src/z180/z180_head.asm | 16 +- nuttx/arch/z80/src/z180/z180_mmu.c | 405 ++++++++++++++++++++++++++++ nuttx/arch/z80/src/z180/z180_mmu.h | 149 ++++++++++ nuttx/arch/z80/src/z180/z180_mmu.txt | 114 ++++++++ nuttx/binfmt/Kconfig | 5 + nuttx/configs/README.txt | 3 + nuttx/configs/pic32-starterkit/src/up_spi.c | 4 +- nuttx/configs/pic32mx7mmb/src/up_spi.c | 4 +- nuttx/include/nuttx/arch.h | 170 +++++++++--- nuttx/mm/mm_graninit.c | 1 - nuttx/sched/Kconfig | 10 +- 20 files changed, 1057 insertions(+), 111 deletions(-) create mode 100644 nuttx/arch/z80/src/z180/z180_mmu.c create mode 100644 nuttx/arch/z80/src/z180/z180_mmu.h create mode 100644 nuttx/arch/z80/src/z180/z180_mmu.txt (limited to 'nuttx/sched') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 7a2a2cbff..7e3b2a43f 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3777,4 +3777,7 @@ are just clones of z80 header files. * arch/z80/src/z180: Add source files for z180 chips. Initial versions are just clones of z80 source files. + * include/nuttx/arch.h: Add address environment control interfaces (for use + with CPUs the provide MCUs and support process-like address environments). + * arch/z80/src/z180/z180_mmu.*: Add MMU support for z180 tasks. diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html index c3f6286df..0ed46cba1 100644 --- a/nuttx/Documentation/NuttxPortingGuide.html +++ b/nuttx/Documentation/NuttxPortingGuide.html @@ -12,7 +12,7 @@

NuttX RTOS Porting Guide

-

Last Updated: October 30, 2012

+

Last Updated: December 11, 2012

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

    NuttX README Files

    -

    Last Updated: October 27, 2012

    +

    Last Updated: December 11, 2012

    @@ -49,7 +49,8 @@ | | | |- src/z80 | | | | `- README.txt | | | `- src/z180 - | | | `- README.txt + | | | |- README.txt + | | | `- z180_mmu.txt | | `- README.txt | |- configs/ | | |- amber/ diff --git a/nuttx/README.txt b/nuttx/README.txt index c94947279..55f42339c 100644 --- a/nuttx/README.txt +++ b/nuttx/README.txt @@ -750,7 +750,7 @@ nuttx | `- z80/ | | `- src/ | | |- z80/README.txt - | | `- z180/README.txt + | | `- z180/README.txt, z180_mmu.txt | `- README.txt |- configs/ | |- amber/ diff --git a/nuttx/arch/Kconfig b/nuttx/arch/Kconfig index 6e55a5744..f19228143 100644 --- a/nuttx/arch/Kconfig +++ b/nuttx/arch/Kconfig @@ -9,6 +9,7 @@ choice config ARCH_8051 bool "8051" + select CUSTOM_STACK ---help--- Intel 8051 architectures and derivaties @@ -115,6 +116,14 @@ config ARCH_IRQPRIO bool default n +config CUSTOM_STACK + bool + default n + +config ADDRENV + bool + default n + config ARCH_STACKDUMP bool "Dump stack on assertions" default n diff --git a/nuttx/arch/z80/Kconfig b/nuttx/arch/z80/Kconfig index 91aedba8f..4dcc8255e 100644 --- a/nuttx/arch/z80/Kconfig +++ b/nuttx/arch/z80/Kconfig @@ -17,6 +17,7 @@ config ARCH_CHIP_Z8018006VSG bool "Z8018006VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z80180 @@ -24,6 +25,7 @@ config ARCH_CHIP_Z8018010VSG bool "Z8018010VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z80180 @@ -31,6 +33,7 @@ config ARCH_CHIP_Z8018008VSG bool "Z8018008VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z80180 @@ -38,6 +41,7 @@ config ARCH_CHIP_Z8018010FSG bool "Z8018010FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 80-pin QFP (11 pins N/C) Z80180 @@ -45,6 +49,7 @@ config ARCH_CHIP_Z8018008VEG bool "Z8018008VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z80180 @@ -52,6 +57,7 @@ config ARCH_CHIP_Z8018006VEG bool "Z8018006VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z80180 @@ -59,6 +65,7 @@ config ARCH_CHIP_Z8018006PSG bool "Z8018006PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 64-pin DIP 6 MHz 5V Z80180 @@ -66,6 +73,7 @@ config ARCH_CHIP_Z8018008FSG bool "Z8018008FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 80-pin QFP (11 pins N/C) 8MHz 5V Z80180 @@ -73,6 +81,7 @@ config ARCH_CHIP_Z8018010PSG bool "Z8018010PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 64-pin DIP 10MHz 5V Z80180 @@ -80,6 +89,7 @@ config ARCH_CHIP_Z8018006PEG bool "Z8018006PEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 64-pin DIP 6MHz 5V Z80180 @@ -87,6 +97,7 @@ config ARCH_CHIP_Z8018010VEG bool "Z8018010VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- 68-pin PLCC 10MHz 5V Z80180 @@ -94,6 +105,7 @@ config ARCH_CHIP_Z8018010PEG bool "Z8018010PEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 64-pin DIP 10MHz 5V Z80180 @@ -101,6 +113,7 @@ config ARCH_CHIP_Z8018008PSG bool "Z8018008PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- Z180: 64-pin DIP 8MHz 5V Z80180 @@ -108,33 +121,39 @@ config ARCH_CHIP_Z8018006FSG bool "Z8018006FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV ---help--- - 80-pin QFP (11 pins N/C) 6MHz 5V Z80180 + Z180: 80-pin QFP (11 pins N/C) 6MHz 5V Z80180 config ARCH_CHIP_Z8018000XSO bool "Z8018000XSO" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV config ARCH_CHIP_Z8018010FEG bool "Z8018010FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV config ARCH_CHIP_Z8018000WSO bool "Z8018000WSO" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV config ARCH_CHIP_Z8018008PEG bool "Z8018008PEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80180 + select ADDRENV config ARCH_CHIP_Z8018110FEG bool "Z8018110FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80181 + select ADDRENV ---help--- Z180: 100-pin QFP Z80181 @@ -142,6 +161,7 @@ config ARCH_CHIP_Z8018233FSG bool "Z8018233FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 + select ADDRENV ---help--- 100-pin QFP Z80182 @@ -149,6 +169,7 @@ config ARCH_CHIP_Z8018220AEG bool "Z8018220AEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 + select ADDRENV ---help--- Z180: 100-pin LQFP 20MHz 5V Z80182 @@ -156,6 +177,7 @@ config ARCH_CHIP_Z8018216FSG bool "Z8018216FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 + select ADDRENV ---help--- Z180: 100-pin QFP 16MHz 5V Z80182 @@ -163,6 +185,7 @@ config ARCH_CHIP_Z8018216ASG bool "Z8018216ASG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 + select ADDRENV ---help--- Z180: 100-pin LQFP Z80182 @@ -170,6 +193,7 @@ config ARCH_CHIP_Z8018233ASG bool "Z8018233ASG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80182 + select ADDRENV ---help--- Z180: 100-pin LQFP 33MHz 5V Z80182 @@ -177,6 +201,7 @@ config ARCH_CHIP_Z8019520FSG bool "Z8019520FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80195 + select ADDRENV ---help--- Z180: 100-pin QFP 20MHz 5V Z80195 @@ -184,6 +209,7 @@ config ARCH_CHIP_Z8019533FSG bool "Z8019533FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z80195 + select ADDRENV ---help--- Z180: 100-pin QFP 33MHz 5V Z80195 @@ -191,6 +217,7 @@ config ARCH_CHIP_Z8L18020VSG bool "Z8L18020VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L180 + select ADDRENV ---help--- Z180: 68-pinn PLCC Z8L180 @@ -198,6 +225,7 @@ config ARCH_CHIP_Z8L18020FSG bool "Z8L18020FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L180 + select ADDRENV ---help--- Z180: 80-pin GFP 20MHz 3.3V Z8L180 @@ -205,11 +233,13 @@ config ARCH_CHIP_Z8L18020PSG bool "Z8L18020PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L180 + select ADDRENV config ARCH_CHIP_Z8L18220ASG bool "Z8L18220ASG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L182 + select ADDRENV ---help--- Z180: 100-pin LQFP Z8L182 @@ -217,6 +247,7 @@ config ARCH_CHIP_Z8L18220FSG bool "Z8L18220FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L182 + select ADDRENV ---help--- 100-pin QFP 20MHz 3.3V Z8L182 @@ -224,11 +255,13 @@ config ARCH_CHIP_Z8L18220AEG bool "Z8L18220AEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8L182 + select ADDRENV config ARCH_CHIP_Z8S18020VSG bool "Z8S18020VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z8S180 @@ -236,6 +269,7 @@ config ARCH_CHIP_Z8S18020VSG1960 bool "Z8S18020VSG1960" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z8S180 @@ -243,6 +277,7 @@ config ARCH_CHIP_Z8S18033VSG bool "Z8S18033VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z8S180 @@ -250,6 +285,7 @@ config ARCH_CHIP_Z8S18010FSG bool "Z8S18010FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- 80-pin QFP Z8S180 @@ -257,6 +293,7 @@ config ARCH_CHIP_Z8S18010VEG bool "Z8S18010VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z8S180 @@ -264,6 +301,7 @@ config ARCH_CHIP_Z8S18020VEG bool "Z8S18020VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z8S180 @@ -271,6 +309,7 @@ config ARCH_CHIP_Z8S18010VSG bool "Z8S18010VSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 68-pin PLCC Z8S180 @@ -278,6 +317,7 @@ config ARCH_CHIP_Z8S18020PSG bool "Z8S18020PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- 64-pin DIP 10Mhz 5V Z8S180 @@ -285,6 +325,7 @@ config ARCH_CHIP_Z8S18033FSG bool "Z8S18033FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 80-pin QFP 33MHz 5V Z8S180 @@ -292,6 +333,7 @@ config ARCH_CHIP_Z8S18033FEG bool "Z8S18033FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 80-pin QFP 33MHz 5V Z8S180 @@ -299,13 +341,15 @@ config ARCH_CHIP_Z8S18020FSG bool "Z8S18020FSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- - 80-pin QFP 20MHz 5V Z8S180 + Z180: 80-pin QFP 20MHz 5V Z8S180 config ARCH_CHIP_Z8S18033VEG bool "Z8S18033VEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- Z180: 68-pin PLCC 33MHz 5V Z8S180 @@ -313,23 +357,27 @@ config ARCH_CHIP_Z8S18010PSG bool "Z8S18010PSG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV ---help--- - 64-pin DIP 10MHz 5V Z8S180 + Z180: 64-pin DIP 10MHz 5V Z8S180 config ARCH_CHIP_Z8S18020FEG bool "Z8S18020FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV config ARCH_CHIP_Z8S18010PEG bool "Z8S18010PEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV config ARCH_CHIP_Z8S18010FEG bool "Z8S18010FEG" select ARCH_CHIP_Z180 select ARCH_CHIP_Z8S180 + select ADDRENV config ARCH_CHIP_Z8F6403 bool "Z8F6403" diff --git a/nuttx/arch/z80/include/z180/irq.h b/nuttx/arch/z80/include/z180/irq.h index 3f058591f..a72cf4708 100644 --- a/nuttx/arch/z80/include/z180/irq.h +++ b/nuttx/arch/z80/include/z180/irq.h @@ -55,17 +55,17 @@ /* Z180 Interrupts */ -#define Z180_RST0 (0) -#define Z180_RST1 (1) -#define Z180_RST2 (2) -#define Z180_RST3 (3) -#define Z180_RST4 (4) -#define Z180_RST5 (5) -#define Z180_RST6 (6) -#define Z180_RST7 (7) +#define Z180_RST0 (0) +#define Z180_RST1 (1) +#define Z180_RST2 (2) +#define Z180_RST3 (3) +#define Z180_RST4 (4) +#define Z180_RST5 (5) +#define Z180_RST6 (6) +#define Z180_RST7 (7) #define Z180_IRQ_SYSTIMER Z180_RST7 -#define NR_IRQS (8) +#define NR_IRQS (8) /* IRQ Stack Frame Format * @@ -73,18 +73,33 @@ * in the TCB to many context switches. */ -#define XCPT_I (0) /* Offset 0: Saved I w/interrupt state in carry */ -#define XCPT_BC (1) /* Offset 1: Saved BC register */ -#define XCPT_DE (2) /* Offset 2: Saved DE register */ -#define XCPT_IX (3) /* Offset 3: Saved IX register */ -#define XCPT_IY (4) /* Offset 4: Saved IY register */ -#define XCPT_SP (5) /* Offset 5: Offset to SP at time of interrupt */ -#define XCPT_HL (6) /* Offset 6: Saved HL register */ -#define XCPT_AF (7) /* Offset 7: Saved AF register */ -#define XCPT_PC (8) /* Offset 8: Offset to PC at time of interrupt */ - -#define XCPTCONTEXT_REGS (9) -#define XCPTCONTEXT_SIZE (2 * XCPTCONTEXT_REGS) +#define XCPT_I (0) /* Offset 0: Saved I w/interrupt state in carry */ +#define XCPT_BC (1) /* Offset 1: Saved BC register */ +#define XCPT_DE (2) /* Offset 2: Saved DE register */ +#define XCPT_IX (3) /* Offset 3: Saved IX register */ +#define XCPT_IY (4) /* Offset 4: Saved IY register */ +#define XCPT_SP (5) /* Offset 5: Offset to SP at time of interrupt */ +#define XCPT_HL (6) /* Offset 6: Saved HL register */ +#define XCPT_AF (7) /* Offset 7: Saved AF register */ +#define XCPT_PC (8) /* Offset 8: Offset to PC at time of interrupt */ + +#define XCPTCONTEXT_REGS (9) +#define XCPTCONTEXT_SIZE (2 * XCPTCONTEXT_REGS) + +/* Interrupt vectors (offsets) for Z180 internal interrupts */ + +#define Z180_INT1_VECTOR 0x00 /* External /INT1 */ +#define Z180_INT2_VECTOR 0x02 /* External /INT2 */ +#define Z180_PRT0_VECTOR 0x04 /* PRT channel 0 */ +#define Z180_PRT1_VECTOR 0x06 /* PRT channel 1 */ +#define Z180_DMA0_VECTOR 0x08 /* DMA channel 0 */ +#define Z180_DMA1_VECTOR 0x0a /* DMA Channel 1 */ +#define Z180_CSIO_VECTOR 0x0c /* Clocked serial I/O */ +#define Z180_ASCI0_VECTOR 0x0e /* Async channel 0 */ +#define Z180_ASCI1_VECTOR 0x10 /* Async channel 1 */ +#define Z180_INCAP_VECTOR 0x12 /* Input capture */ +#define Z180_OUTCMP_VECTOR 0x14 /* Output compare */ +#define Z180_TIMOV_VECTOR 0x16 /* Timer overflow */ /**************************************************************************** * Public Types @@ -96,10 +111,34 @@ typedef uint16_t chipreg_t; -/* This struct defines the way the registers are stored. */ +/* Common Area 1 holds the code and data that is unique to a particular task + * and shared by all pthreads created from that task. Each task will then + * have its own copy of struct z180_cbr_s. This structure is created with + * a reference count of one when the task is created. + * + * When the task creates additional threads, the reference count is + * incremented and the CBR value is shared. When each thread exits, the + * reference count id decremented. When the reference count is decremented, + * the physical memory underlying the CBR is finally released. + */ + +struct z180_cbr_s +{ + uint8_t cbr; /* The CBR value used by the thread */ + uint8_t crefs; /* The number of threads sharing this CBR value */ + uint8_t pages; /* The number of 4KB pages of physical memory in the allocation */ +}; + +/* This struct defines the way the registers and z180-state information are + * stored. + */ struct xcptcontext { + /* CBR allocation */ + + FAR struct z180_cbr_s *cbr; + /* Register save area */ chipreg_t regs[XCPTCONTEXT_REGS]; diff --git a/nuttx/arch/z80/src/z180/Kconfig b/nuttx/arch/z80/src/z180/Kconfig index 4eafa8da8..58abbd6f2 100644 --- a/nuttx/arch/z80/src/z180/Kconfig +++ b/nuttx/arch/z80/src/z180/Kconfig @@ -21,30 +21,115 @@ config Z180_TOOLCHAIN_SDCCW endchoice config LINKER_HOME_AREA - hex "Start of _HOME area" + hex "Physical start of _HOME area" default 0x0000 ---help--- - Start of the linker HOME area. Default: 0x0000 + Physical address of the start of the linker HOME area. Default: 0x0000 config LINKER_CODE_AREA - hex "Start of _CODE area" + hex "Physical start of _CODE area" default 0x0200 ---help--- - Start of the linker _CODE area. Default: 0x0200 + Physical address of the start of the linker _CODE area. Default: 0x0200 config LINKER_DATA_AREA - hex "Start of _DATA area" + hex "Physical start of _DATA area" default 0x8000 ---help--- - Start of the linker _DATA area. Default: 0x8000 + Physical address of the start of the linker _DATA area. Default: 0x8000 config LINKER_ROM_AT_0000 - bool "ROM at 0x0000" + bool "ROM at Physical 0x0000" default n ---help--- - Some architectures may have ROM located at address zero. In this + Some architectures may have ROM located at physical address zero. In this case, a special version of the "head" file must be used. +config Z180_BANKAREA_VIRTBASE + hex "Virtual Start of Bank Area" + default 0x8000 + ---help--- + This setting provides the virtual address of the start of the Bank Area. + NOTE that 0x0000 <= Z180_BANKAREA_BASE <= Z180_COMMONAREA_BASE is required! + Default: 0x8000 + + NuttX Memory Organization: + + Common Area 0: This area holds the common NuttX code that is + directly call-able from all application threads. Common Area + always starts at virtual address 0x0000 and extends to the + Bank Area + + Base Area: This area holds the common NuttX data (including the + share-able heap) that is accessible from all applications and + extends to Common Area 1. + + NOTE: That is execution from RAM, the common NuttX code and + data may be contiguous and lie in the same region (either + Common Area 0 or the Bank Area). The two regions above would + apply in a ROM'ed system, where Common Area 1 is ROM and the + Base Area is RAM. + + Common Area 1: This area holds the code and data that is unique + to a particular task. his area extends to the end of the virtual + address space. All tasks share the same virtual Common Area 2 + virtual address (but each has a unique mapping to different, + underlying physical addresses). + +config Z180_BANKAREA_PHYSBASE + hex "Physical Start of Bank Area" + default 0x08000 + ---help--- + This setting provides the physical address of the start of the Bank Area. + Default: 0x08000 + +config Z180_COMMON1AREA_VIRTBASE + hex "Virtual Start of Common Area 1" + default 0xc000 + ---help--- + This setting provides the virtual address of the start of the Common + Area 1. NOTE that 0x0000 <= Z180_BANKAREA_BASE <= Z180_COMMONAREA_BASE + is required! Default: 0xc000 + + NuttX Memory Organization: + + Common Area 0: This area holds the common NuttX code that is + directly call-able from all application threads. Common Area + always starts at virtual address 0x0000 and extends to the + Bank Area + + Base Area: This area holds the common NuttX data (including the + share-able heap) that is accessible from all applications and + extends to Common Area 1. + + NOTE: That is execution from RAM, the common NuttX code and + data may be contiguous and lie in the same region (either + Common Area 0 or the Bank Area). The two regions above would + apply in a ROM'ed system, where Common Area 1 is ROM and the + Base Area is RAM. + + Common Area 1: This area holds the code and data that is unique + to a particular task. his area extends to the end of the virtual + address space. All tasks share the same virtual Common Area 2 + virtual address (but each has a unique mapping to different, + underlying physical addresses). + +config Z180_PHYSHEAP_START + hex "Physical Start of Free Memory" + default 0x0c000 + ---help--- + This setting provides the physical address of the start of free physical + memory that will be used to allocate memory for tasks (Common Area 1). + Default: 0x0c000 + +config Z180_PHYSHEAP_END + hex "Physical End(+1) of Free Memory" + default 0x100000 + ---help--- + This setting provides the physical address of the end(+1) of free physical + memory that will be used to allocate memory for tasks (Common Area 1). + Default: 0x100000 + config ARCH_HAVEHEAD bool "Board-specific Head File" default n diff --git a/nuttx/arch/z80/src/z180/Make.defs b/nuttx/arch/z80/src/z180/Make.defs index d371a5d22..069f36204 100644 --- a/nuttx/arch/z80/src/z180/Make.defs +++ b/nuttx/arch/z80/src/z180/Make.defs @@ -35,21 +35,20 @@ ifeq ($(CONFIG_ARCH_HAVEHEAD),) ifeq ($(CONFIG_LINKER_ROM_AT_0000),y) -HEAD_ASRC = z180_rom.asm +HEAD_ASRC = z180_rom.asm else -HEAD_ASRC = z180_head.asm +HEAD_ASRC = z180_head.asm endif endif -CMN_ASRCS = -CMN_CSRCS = up_initialize.c up_allocateheap.c up_createstack.c \ - up_releasestack.c up_interruptcontext.c up_blocktask.c \ - up_unblocktask.c up_exit.c up_releasepending.c \ - up_reprioritizertr.c up_idle.c up_assert.c up_doirq.c \ - up_mdelay.c up_udelay.c up_usestack.c - -CHIP_ASRCS = z180_saveusercontext.asm z180_restoreusercontext.asm -CHIP_CSRCS = z180_initialstate.c z180_io.c z180_irq.c z180_copystate.c \ - z180_schedulesigaction.c z180_sigdeliver.c \ - z180_registerdump.c +CMN_ASRCS = +CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_createstack.c +CMN_CSRCS += up_doirq.c up_exit.c up_idle.c up_initialize.c +CMN_CSRCS += up_interruptcontext.c up_mdelay.c up_releasepending.c +CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_unblocktask.c +CMN_CSRCS += up_udelay.c up_usestack.c +CHIP_ASRCS = z180_restoreusercontext.asm z180_saveusercontext.asm +CHIP_CSRCS = z180_copystate.c z180_initialstate.c z180_io.c z180_irq.c +CHIP_CSRCS += z180_mmu.c z180_registerdump.c z180_schedulesigaction.c +CHIP_CSRCS += z180_sigdeliver.c diff --git a/nuttx/arch/z80/src/z180/z180_head.asm b/nuttx/arch/z80/src/z180/z180_head.asm index ca064160a..ddd0283e9 100644 --- a/nuttx/arch/z80/src/z180/z180_head.asm +++ b/nuttx/arch/z80/src/z180/z180_head.asm @@ -60,8 +60,9 @@ ; Global symbols used ;************************************************************************** - .globl _os_start ; OS entry point - .globl _up_doirq ; Interrupt decoding logic + .globl _os_start ; OS entry point + .globl _up_doirq ; Interrupt decoding logic + .globl z180_mmu_lowinit ; MMU initialization logic ;************************************************************************** ; Reset entry point @@ -70,9 +71,9 @@ .area _HEADER (ABS) .org 0x0000 - di ; Disable interrupts - im 1 ; Set interrupt mode 1 - jr _up_reset ; And boot the system + di ; Disable interrupts + im 1 ; Set interrupt mode 1 + jr _up_reset ; And boot the system ;************************************************************************** ; Other reset handlers @@ -168,6 +169,11 @@ _up_reset: ld SP, #CONFIG_STACK_END ; Set stack pointer + ; Configure the MMU so that things will lie at the addresses that we + ; expect them to + + call z180_mmu_lowinit ; Initialize the MMU + ; Performed initialization unique to the SDCC toolchain call gsinit ; Initialize the data section diff --git a/nuttx/arch/z80/src/z180/z180_mmu.c b/nuttx/arch/z80/src/z180/z180_mmu.c new file mode 100644 index 000000000..c71f59755 --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_mmu.c @@ -0,0 +1,405 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_mmu.c + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/* See arch/z80/src/z180/z180_mmu.txt for additional information */ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include "z180_mmu.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* Configuration ************************************************************/ + +#ifndef CONFIG_ADDRENV +# warning "OS address environment support is required (CONFIG_ADDRENV)" +#endif + +#ifndef CONFIG_GRAN +# warning "This file requires the granual allocator (CONFIG_GRAN)" +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +#ifndef CONFIG_GRAN_SINGLE +static GRAN_HANDLE g_physhandle; +#endif +static struct z180_cbr_s g_cbrs[CONFIG_MAX_TASKS]; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: z180_mmu_findcbr + * + * Description: + * Find an unused struture in g_cbrs (i.e., one with reference count == 0). + * If a structure is found, its reference count is set to one and a pointer + * to the structure is returned. + * + ****************************************************************************/ + +static FAR struct z180_cbr_s *z180_mmu_findcbr(void) +{ + int i; + + for (i = 0; i < CONFIG_MAX_TASKS; i++) + { + FAR struct z180_cbr_s *cbr = &g_cbrs[i]; + if (cbr->crefs == 0) + { + cbr->crefs = 1; + return cbr; + } + } + + return NULL; +} + +/**************************************************************************** + * Name: z180_mmu_freecbr + * + * Description: + * Free a struture in g_cbrs by setting its reference count to 0; + * + ****************************************************************************/ + +#define z180_mmu_freecbr(cbr) (cbr)->crefs = 0 + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: z180_mmu_lowinit + * + * Description: + * Low-level, power-up initialization of the z180 MMU. this must be + * called very early in the boot process to get the basic operating + * memory configuration correct. This function does *not* perform all + * necessray MMU initialization... only the basics needed at power-up. + * z180_mmu_init() must be called later to complete the entire MMU + * initialization. + * + ****************************************************************************/ + +void z180_mmu_lowinit(void) __naked +{ + __asm + ld c, #Z180_MMU_CBR ; port + ld a, #Z180_CBAR_VALUE ; value + out (c), a + + ld c, #Z180_MMU_BBR ; port + ld a, #Z180_BBR_VALUE ; value + out (c), a + __endasm; +} + +/**************************************************************************** + * Name: z180_mmu_init + * + * Description: + * Perform higher level initializatin of the MMU and physical memory + * memory management logic. + * + ****************************************************************************/ + +int z180_mmu_init(void) +{ + /* Here we use the granule allocator as a page allocator. We lie and + * say that 1 page is 1 byte. + */ + +#ifdef CONFIG_GRAN_SINGLE +return gran_initialize((FAR void *)Z180_PHYSHEAP_STARTPAGE, + Z180_PHYSHEAP_NPAGES, 0, 0); +#else +g_physhandle = gran_initialize((FAR void *)Z180_PHYSHEAP_STARTPAGE, + Z180_PHYSHEAP_NPAGES, 0, 0); +return g_physhandle ? OK : -ENOMEM; +#endif +} + +/**************************************************************************** + * Name: up_addrenv_create + * + * Description: + * This function is called from the binary loader logic when a new + * task is created in RAM in order to instantiate an address environment for + * the task. + * + * Input Parameters: + * tcb - The TCB of the task needing the address environment. + * envsize - The size (in bytes) of the address environment needed by the + * task. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +int up_addrenv_create(FAR _TCB *tcb, size_t envsize) +{ + FAR struct z180_cbr_s *cbr; + irqstate_t flags; + uintptr_t alloc; + unsigned int npages; + int ret; + + /* Make sure that there is no address environment in place on this TCB */ + + DEBUGASSERT(tcb->xcp.cbr == NULL); + + /* Convert the size from bytes to numbers of pages */ + + npages = PHYS_ALIGNUP(envsize); + if (npages < 1) + { + /* No address environment... but I suppose that is not an error */ + + sdbg("ERROR: npages is zero\n"); + return OK; + } + + /* Allocate a structure in the common .bss to hold information about the + * task's address environment. NOTE that this is not a part of the TCB, + * but rather a break-away structure that can be shared by the task as + * well as other threads. That is necessary because the life of the + * address of environment might be longer than the life of the task. + */ + + flags = irqsave(); + cbr = z180_mmu_findcbr(); + if (!cbr) + { + sdbg("ERROR: No free CBR structures\n"); + ret = -ENOMEM; + goto errout_with_irq + } + + /* Now allocate the physical memory to back up the address environment */ + + +#ifdef CONFIG_GRAN_SINGLE + alloc = (uintptr_t)gran_alloc(npages); +#else + alloc = (uintptr_t)gran_alloc(g_physhandle, npages); +#endif + if (!alloc) + { + sdbg("ERROR: Failed to allocate %d pages\n", npages); + ret = -ENOMEM; + goto errout_with_cbr; + } + + /* Save the information in the CBR structure. Note that alloc is in + * 4KB pages, already in the right form for the CBR. + */ + + DEBUGASSERT(alloc <= 0xff); + + cbr->cbr = alloc; + cbr->pages = npages; + tcb->xcp.cbr = cbr; + + irqrestore(flags); + return OK; + +errout_with_cbr: + z180_mmu_freecbr(cbr); + +errout_with_irq: + irqrestore(flags); + return ret; +} + +/**************************************************************************** + * Name: up_addrenv_clone + * + * Description: + * This function is called from the core scheduler logic when a thread + * is created that needs to share the address ennvironment of its parent + * task. In this case, the parent's address environment needs to be + * "cloned" for the child. + * + * Input Parameters: + * ptcb - The TCB of the parent task that has the address environment. + * ctcb - The TCB of the child thread needing the address environment. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +int up_addrenv_clone(FAR const _TCB *ptcb, FAR _TCB *ctcb) +{ + irqstate_t flags; + + /* Make sure that the child has no address environment. It is okay if + * if the parent does not have one. + */ + + DEBUGASSERT(ctcb->xcp.cbr == NULL); + + flags = irqsave(); + if (ptcb->xcp.cbr) + { + /* Clone the CBR by incrementing the reference counting and saving a + * copy in the child thread's TCB. + */ + + ptcb->xcp.cbr.crefs++; + ctcb->xcp.cbr = ptcb->xcp.cbr; + } + + irqrestore(flags); + return OK; +} +#endif + +/**************************************************************************** + * Name: up_addrenv_instantiate + * + * Description: + * After an address environment has been established for a task (via + * up_addrenv_create(). This function may be called to to instantiate + * that address environment in the virtual address space. this might be + * necessary, for example, to load the code for the task from a file or + * to access address environment private data. + * + * Input Parameters: + * tcb - The TCB of the task or thread whose the address environment will + * be instantiated. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +int up_addrenv_instantiate(FAR _TCB *tcb) +{ + irqstate_t flags; + + /* Check if the task has an address environment. */ + + flags = irqsave(); + if (tcb->xcp.cbr) + { + /* Yes... write the CBR value into CBR register */ + + outp(Z180_MMU_CBR, tcb->xcp.cbr.cbr); + /* Clone the CBR by incrementing the reference counting and saving a + * copy in the child thread's TCB. + */ + + ptcb->xcp.cbr.crefs++; + ctcb->xcp.cbr = ptcb->xcp.cbr; + } + + irqrestore(flags); + return OK; +} +#endif + +/**************************************************************************** + * Name: up_addrenv_release + * + * Description: + * This function is called when a task or thread exits in order to release + * its reference to an address environment. When there are no further + * references to an address environment, that address environment should + * be destroyed. + * + * Input Parameters: + * tcb - The TCB of the task or thread whose the address environment will + * be released. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +int up_addrenv_release(FAR _TCB *tcb) +{ + FAR struct z180_cbr_s *cbr; + irqstate_t flags; + + /* Check if the task has an address environment. */ + + flags = irqsave(); + cbr = tcb->xcp.cbr; + if (cbr) + { + /* Nullify the reference to the CBR structgure and decrement the number + * of references on the CBR. + */ + + tcb->xcp.cbr = NULL; + + /* If the reference count would decrement to zero, then free the CBR + * structure. + */ + + if (cbr->crefs <= 1) + { + z180_mmu_freecbr(cbr); + } + else + { + /* Otherwise, just decrement the reference count */ + + cbr->crefs--; + } + } + + irqrestore(flags); + return OK; +} +#endif + diff --git a/nuttx/arch/z80/src/z180/z180_mmu.h b/nuttx/arch/z80/src/z180/z180_mmu.h new file mode 100644 index 000000000..1a4c03406 --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_mmu.h @@ -0,0 +1,149 @@ +/**************************************************************************** + * arch/z80/src/z180/z180_mmu.h + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __ARCH_Z80_SRC_Z180_Z180_MMU_H +#define __ARCH_Z80_SRC_Z180_Z180_MMU_H + +/* See arch/z80/src/z180/z180_mmu.txt for additional information */ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "z180_iomap.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* Configuration ************************************************************/ + +/* Virtual addresses */ + +#ifndef CONFIG_Z180_BANKAREA_VIRTBASE +# warning "Assuming Bank Area at virtual address 0x8000" +# define CONFIG_Z180_BANKAREA_VIRTBASE 0x8000 +#endif + +#ifndef CONFIG_Z180_COMMON1AREA_VIRTBASE +# warning "Assuming Common Area 1 at virtual address 0xc000" +# define CONFIG_Z180_COMMON1AREA_VIRTBASE 0xc000 +#endif + +#if CONFIG_Z180_BANKAREA_VIRTBASE > CONFIG_Z180_COMMON1AREA_VIRTBASE +# error "CONFIG_Z180_BANKAREA_VIRTBASE > CONFIG_Z180_COMMON1AREA_VIRTBASE" +#endif + +/* Physical addresses */ + +#ifndef CONFIG_Z180_BANKAREA_PHYSBASE +# warning "Assuming Bank Area 1 at physical address 0x080000" +# define CONFIG_Z180_BANKAREA_PHYSBASE 0x08000 +#endif + +#ifndef CONFIG_Z180_PHYSHEAP_START +# warning "Assuming physical heap starts at physical address 0x0c000" +# define CONFIG_Z180_PHYSHEAP_START 0x0c000 +#endif + +#ifndef CONFIG_Z180_PHYSHEAP_END +# warning "Assuming physical heap ends at physical address 0x100000" +# define CONFIG_Z180_PHYSHEAP_END 0x100000 +#endif + +#if CONFIG_Z180_BANKAREA_PHYSBASE > CONFIG_Z180_PHYSHEAP_START +# error "CONFIG_Z180_BANKAREA_PHYSBASE > CONFIG_Z180_PHYSHEAP_START" +#endif + +#if CONFIG_Z180_PHYSHEAP_START > CONFIG_Z180_PHYSHEAP_END +# error "CONFIG_Z180_PHYSHEAP_START > CONFIG_Z180_PHYSHEAP_END" +#endif + +/* Each page is 4KB */ + +#define Z180_PAGESHIFT (12) +#define Z180_PAGESIZE (1 << Z180_PAGESHIFT) +#define Z180_PAGEMASK (Z180_PAGESIZE - 1) +#define PHYS_ALIGN(phys) ((phys) >> Z180_PAGESHIFT) +#define PHYS_ALIGNUP(phys) (((phys) + Z180_PAGEMASK) >> Z180_PAGESHIFT) + +/* Physical pages */ + +#define Z180_BANKAREA_PHYSPAGE PHYS_ALIGN(CONFIG_Z180_BANKAREA_PHYSBASE) +#define Z180_PHYSHEAP_STARTPAGE PHYS_ALIGN(CONFIG_Z180_PHYSHEAP_START) +#define Z180_PHYSHEAP_ENDPAGE PHYS_ALIGN(CONFIG_Z180_PHYSHEAP_END) +#define Z180_PHYSHEAP_NPAGES (Z180_PHYSHEAP_ENDPAGE - Z180_PHYSHEAP_STARTPAGE + 1) + +/* MMU register values */ + +#define Z180_CBAR_VALUE \ + ((((CONFIG_Z180_BANKAREA_VIRTBASE >> 12) & 0x0f) << CBAR_BA_SHIFT) \ + (((CONFIG_Z180_COMMON1AREA_VIRTBASE >> 12) & 0x0f) << CBAR_CA_SHIFT)) + +#define Z180_BBR_VALUE \ + ((CONFIG_Z180_BANKAREA_PHYSBASE >> 12) & 0xff) + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: z180_mmu_lowinit + * + * Description: + * Low-level, power-up initialization of the z180 MMU. this must be + * called very early in the boot process to get the basic operating + * memory configuration correct. This function does *not* perform all + * necessray MMU initialization... only the basics needed at power-up. + * z180_mmu_init() must be called later to complete the entire MMU + * initialization. + * + ****************************************************************************/ + +void z180_mmu_lowinit(void) __naked; + +/**************************************************************************** + * Name: z180_mmu_init + * + * Description: + * Perform higher level initializatin of the MMU and physical memory + * memory management logic. + * + ****************************************************************************/ + +void z180_mmu_init(void); + +#endif /* __ARCH_Z80_SRC_Z180_Z180_MMU_H */ diff --git a/nuttx/arch/z80/src/z180/z180_mmu.txt b/nuttx/arch/z80/src/z180/z180_mmu.txt new file mode 100644 index 000000000..e12f41e9b --- /dev/null +++ b/nuttx/arch/z80/src/z180/z180_mmu.txt @@ -0,0 +1,114 @@ +The MMU translates every memory address from 16 to 20 bits. The MMU uses +three internal control registers. On reset the MMU gives a straight logical +to physical mapping, simulating the Z80 and, of course, limiting the address +space to 64k. + +Logical Address Spaces +====================== + +The 64KB CPU logical address space is interpreted by the MMU as consisting +of up to three separate logical address areas: + + Common Area 0, + Bank Area, and + Common Area 1. + +Common 0, if it exists, always starts at logical address 0000 and runs up +to the Bank Area. The Bank Area then runs to the start of Common Area 1. + +Registers +========= + +CBAR (Comman/Bank Area Register) + + CBAR is an 8 bit I/O port that can be accessed by the processor's OUT and + IN instructions. The lower 4-bits of CBAR (BA) specify the starting logical + address of the Bank Area, and the upper 4-bits (CA) give the start of + Common Area 1. These bits determine the upper four bits of the 16-bit + address. If CBAR were 0xa8, then the Base Area starts at logical address + 0x8000 and Common Area 1 starts at logical address 0xa000. This gives a + mapping granualarity of 4Kb in the logical address space. + + The CA and BA fields of CBAR may be freely programmed subject only to the + restriction that CA may never be less than BA. + +BBAR (Base Area Bank Register) + + BBR specifies the starting physical address of the base area (the logical + start address is in CBAR). + +CBR (Common Bank Register) + + CBR provides the same information for Common Area 1. + +Both the BBAR and the CBR specify the upper 8-bits of the 20-bit physical +address in the mapping. Hence, mapping is performed with a granularity of +4Kb in the physical address space. + +Physical to Logical Address Mapping +=================================== + +A simple formula gives the translation from logical to physical address for +the Bank Area: + + Physical = Logical + (BBR * 4096) + +The same formula gives Common Area 1: + + Physical = Logical + (CBR * 4096) + +Reset Configuration +=================== + +On reset, the CBAR is set to 0xf0, and CBR and BBR are set to 0x00. This +maps logical to physical with no translation; the Bank Area starts at +logical address 0x0000 and Common 1 at 0xf000. The Bank Area starts at +phsycial address 0x00000 (BBR=0), as does Common Area 1 (CBR=0). If the +logical address is 0x1000, then the MMU allocates this to the Bank Area +and adds the physical base of bank to it (0x00000), giving a translated +address of 0x01000. Similarly, logical 0xf800 is in Common Area 1, and +translates to 0x0f800. + +Configurations +============== + +You can divide the logical address space into one, two, or three areas. + +1) Three areas: + + CBAR:CA > CBAR:BA > 0x0000 + +2a) Two areas (Bank Area and Common Area 1): + + CBAR:CA > CBAR:BA = 0x0000 + +2a) Two areas (Common Area 0 and Common Area 1): + + CBAR:CA = CBAR:BA > 0x0000 + +3) One area (Common Area 1): + + CBAR:CA = CBAR:BA = 0x0000 + +NuttX Memory Organization +========================= + +Common Area 0: This area holds the common NuttX code that is directly +call-able from all application threads. Common Area always starts at +logical address 0x0000 and extends to the Bank Area + +Base Area: This area holds the common NuttX data (including the share- +able heap) that is accessible from all applications and extends to +Common Area 1. + +NOTE: That is execution from RAM, the common NuttX code and data may +be contiguous and lie in the same areas (either Common Area 0 or the +Bank Area). The two areas above would apply in a ROM'ed system, where +Common Area 1 is ROM and the Base Area is RAM. + +Common Area 1: This area holds the code and data that is unique to +a particular task. This area extends to the end of the logical address +space. All tasks share the same logical Common Area 2 logical address +(in the CBAR), but each has a unique mapping to different, underlying +physical addresses. Each task will then have its own, unique CBR value +that must be restored with each context switch to the task. diff --git a/nuttx/binfmt/Kconfig b/nuttx/binfmt/Kconfig index ae02c276a..cbf909327 100644 --- a/nuttx/binfmt/Kconfig +++ b/nuttx/binfmt/Kconfig @@ -15,6 +15,7 @@ if !BINFMT_DISABLE config NXFLAT bool "Enable the NXFLAT Binary Format" default n + select PIC ---help--- Enable support for the NXFLAT binary format. Default: n @@ -34,6 +35,10 @@ endif endif +config PIC + bool + default n + config BINFMT_CONSTRUCTORS bool "C++ Static Constructor Support" default n diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt index b4700433b..23f5e4380 100644 --- a/nuttx/configs/README.txt +++ b/nuttx/configs/README.txt @@ -160,6 +160,9 @@ defconfig -- This is a configuration file similar to the Linux CONFIG_ARCH_IRQPRIO Define if the architecture suports prioritizaton of interrupts and the up_prioritize_irq() API. + CONFIG_ADDRENV + The CPU supports an MMU and CPU port supports provision of address + environments for tasks (making the, perhaps, processes). Some architectures require a description of the RAM configuration: diff --git a/nuttx/configs/pic32-starterkit/src/up_spi.c b/nuttx/configs/pic32-starterkit/src/up_spi.c index 52d46af89..42e7c4b9c 100644 --- a/nuttx/configs/pic32-starterkit/src/up_spi.c +++ b/nuttx/configs/pic32-starterkit/src/up_spi.c @@ -154,7 +154,7 @@ int pic32mx_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #endif #endif -#ifdef CONFIG_PIC31MX_SPI1 +#ifdef CONFIG_PIC32MX_SPI1 void pic31mx_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); @@ -176,7 +176,7 @@ int pic31mx_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #endif #endif -#ifdef CONFIG_PIC31MX_SPI3 +#ifdef CONFIG_PIC32MX_SPI3 void pic32mx_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); diff --git a/nuttx/configs/pic32mx7mmb/src/up_spi.c b/nuttx/configs/pic32mx7mmb/src/up_spi.c index a15881868..add2b2d65 100644 --- a/nuttx/configs/pic32mx7mmb/src/up_spi.c +++ b/nuttx/configs/pic32mx7mmb/src/up_spi.c @@ -192,7 +192,7 @@ int pic32mx_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #endif #endif -#ifdef CONFIG_PIC31MX_SPI2 +#ifdef CONFIG_PIC32MX_SPI2 void pic31mx_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); @@ -215,7 +215,7 @@ int pic31mx_spi2cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cm #endif #endif -#ifdef CONFIG_PIC31MX_SPI3 +#ifdef CONFIG_PIC32MX_SPI3 void pic32mx_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); diff --git a/nuttx/include/nuttx/arch.h b/nuttx/include/nuttx/arch.h index c836a7557..54c234d8d 100644 --- a/nuttx/include/nuttx/arch.h +++ b/nuttx/include/nuttx/arch.h @@ -67,10 +67,8 @@ typedef CODE void (*sig_deliver_t)(FAR _TCB *tcb); ****************************************************************************/ #ifdef __cplusplus -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern +extern "C" +{ #endif /**************************************************************************** @@ -98,7 +96,7 @@ extern "C" { * ****************************************************************************/ -EXTERN void up_initialize(void); +void up_initialize(void); /**************************************************************************** * Name: up_idle @@ -114,7 +112,7 @@ EXTERN void up_initialize(void); * ****************************************************************************/ -EXTERN void up_idle(void); +void up_idle(void); /**************************************************************************** * Name: up_initial_state @@ -130,7 +128,7 @@ EXTERN void up_idle(void); * ****************************************************************************/ -EXTERN void up_initial_state(FAR _TCB *tcb); +void up_initial_state(FAR _TCB *tcb); /**************************************************************************** * Name: up_create_stack @@ -155,7 +153,7 @@ EXTERN void up_initial_state(FAR _TCB *tcb); ****************************************************************************/ #ifndef CONFIG_CUSTOM_STACK -EXTERN int up_create_stack(FAR _TCB *tcb, size_t stack_size); +int up_create_stack(FAR _TCB *tcb, size_t stack_size); #endif /**************************************************************************** @@ -180,7 +178,7 @@ EXTERN int up_create_stack(FAR _TCB *tcb, size_t stack_size); ****************************************************************************/ #ifndef CONFIG_CUSTOM_STACK -EXTERN int up_use_stack(FAR _TCB *tcb, FAR void *stack, size_t stack_size); +int up_use_stack(FAR _TCB *tcb, FAR void *stack, size_t stack_size); #endif /**************************************************************************** @@ -193,7 +191,7 @@ EXTERN int up_use_stack(FAR _TCB *tcb, FAR void *stack, size_t stack_size); ****************************************************************************/ #ifndef CONFIG_CUSTOM_STACK -EXTERN void up_release_stack(FAR _TCB *dtcb); +void up_release_stack(FAR _TCB *dtcb); #endif /**************************************************************************** @@ -216,7 +214,7 @@ EXTERN void up_release_stack(FAR _TCB *dtcb); * ****************************************************************************/ -EXTERN void up_unblock_task(FAR _TCB *tcb); +void up_unblock_task(FAR _TCB *tcb); /**************************************************************************** * Name: up_block_task @@ -242,7 +240,7 @@ EXTERN void up_unblock_task(FAR _TCB *tcb); * ****************************************************************************/ -EXTERN void up_block_task(FAR _TCB *tcb, tstate_t task_state); +void up_block_task(FAR _TCB *tcb, tstate_t task_state); /**************************************************************************** * Name: up_release_pending @@ -261,7 +259,7 @@ EXTERN void up_block_task(FAR _TCB *tcb, tstate_t task_state); * ****************************************************************************/ -EXTERN void up_release_pending(void); +void up_release_pending(void); /**************************************************************************** * Name: up_reprioritize_rtr @@ -287,7 +285,7 @@ EXTERN void up_release_pending(void); * ****************************************************************************/ -EXTERN void up_reprioritize_rtr(FAR _TCB *tcb, uint8_t priority); +void up_reprioritize_rtr(FAR _TCB *tcb, uint8_t priority); /**************************************************************************** * Name: _exit @@ -349,7 +347,7 @@ EXTERN void up_reprioritize_rtr(FAR _TCB *tcb, uint8_t priority); ****************************************************************************/ #ifndef CONFIG_DISABLE_SIGNALS -EXTERN void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver); +void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver); #endif /**************************************************************************** @@ -363,7 +361,7 @@ EXTERN void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver); ****************************************************************************/ #ifndef CONFIG_HEAP_BASE -EXTERN void up_allocate_heap(FAR void **heap_start, size_t *heap_size); +void up_allocate_heap(FAR void **heap_start, size_t *heap_size); #endif /**************************************************************************** @@ -382,6 +380,95 @@ EXTERN void up_allocate_heap(FAR void **heap_start, size_t *heap_size); # define up_getpicbase(ppicbase) #endif +/**************************************************************************** + * Name: up_addrenv_create + * + * Description: + * This function is called from the binary loader logic when a new + * task is created in RAM in order to instantiate an address environment for + * the task. + * + * Input Parameters: + * tcb - The TCB of the task needing the address environment. + * envsize - The size (in bytes) of the address environment needed by the + * task. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +int up_addrenv_create(FAR _TCB *tcb, size_t envsize); +#endif + +/**************************************************************************** + * Name: up_addrenv_clone + * + * Description: + * This function is called from the core scheduler logic when a thread + * is created that needs to share the address ennvironment of its parent + * task. In this case, the parent's address environment needs to be + * "cloned" for the child. + * + * Input Parameters: + * ptcb - The TCB of the parent task that has the address environment. + * ctcb - The TCB of the child thread needing the address environment. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +int up_addrenv_clone(FAR const _TCB *ptcb, FAR _TCB *ctcb); +#endif + +/**************************************************************************** + * Name: up_addrenv_instantiate + * + * Description: + * After an address environment has been established for a task (via + * up_addrenv_create(). This function may be called to to instantiate + * that address environment in the virtual address space. this might be + * necessary, for example, to load the code for the task from a file or + * to access address environment private data. + * + * Input Parameters: + * tcb - The TCB of the task or thread whose the address environment will + * be instantiated. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +int up_addrenv_instantiate(FAR _TCB *tcb); +#endif + +/**************************************************************************** + * Name: up_addrenv_release + * + * Description: + * This function is called when a task or thread exits in order to release + * its reference to an address environment. When there are no further + * references to an address environment, that address environment should + * be destroyed. + * + * Input Parameters: + * tcb - The TCB of the task or thread whose the address environment will + * be released. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +int up_addrenv_release(FAR _TCB *tcb); +#endif + /**************************************************************************** * Name: up_interrupt_context * @@ -391,7 +478,7 @@ EXTERN void up_allocate_heap(FAR void **heap_start, size_t *heap_size); * ****************************************************************************/ -EXTERN bool up_interrupt_context(void); +bool up_interrupt_context(void); /**************************************************************************** * Name: up_enable_irq @@ -413,7 +500,7 @@ EXTERN bool up_interrupt_context(void); ****************************************************************************/ #ifndef CONFIG_ARCH_NOINTC -EXTERN void up_enable_irq(int irq); +void up_enable_irq(int irq); #endif /**************************************************************************** @@ -431,7 +518,7 @@ EXTERN void up_enable_irq(int irq); ****************************************************************************/ #ifndef CONFIG_ARCH_NOINTC -EXTERN void up_disable_irq(int irq); +void up_disable_irq(int irq); #endif /**************************************************************************** @@ -446,7 +533,7 @@ EXTERN void up_disable_irq(int irq); ****************************************************************************/ #ifdef CONFIG_ARCH_IRQPRIO -EXTERN int up_prioritize_irq(int irq, int priority); +int up_prioritize_irq(int irq, int priority); #endif /**************************************************************************** @@ -483,7 +570,7 @@ EXTERN int up_prioritize_irq(int irq, int priority); ****************************************************************************/ #ifdef CONFIG_ARCH_ROMGETC -EXTERN char up_romgetc(FAR const char *ptr); +char up_romgetc(FAR const char *ptr); #else # define up_romgetc(ptr) (*ptr) #endif @@ -497,8 +584,8 @@ EXTERN char up_romgetc(FAR const char *ptr); * ***************************************************************************/ -EXTERN void up_mdelay(unsigned int milliseconds); -EXTERN void up_udelay(useconds_t microseconds); +void up_mdelay(unsigned int milliseconds); +void up_udelay(useconds_t microseconds); /**************************************************************************** * Name: up_cxxinitialize @@ -517,7 +604,7 @@ EXTERN void up_udelay(useconds_t microseconds); ***************************************************************************/ #if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) -EXTERN void up_cxxinitialize(void); +void up_cxxinitialize(void); #endif /**************************************************************************** @@ -537,7 +624,7 @@ EXTERN void up_cxxinitialize(void); * ****************************************************************************/ -EXTERN void sched_process_timer(void); +void sched_process_timer(void); /**************************************************************************** * Name: irq_dispatch @@ -549,7 +636,7 @@ EXTERN void sched_process_timer(void); * ***************************************************************************/ -EXTERN void irq_dispatch(int irq, FAR void *context); +void irq_dispatch(int irq, FAR void *context); /**************************************************************************** * Board-specific button interfaces exported by the board-specific logic @@ -571,7 +658,7 @@ EXTERN void irq_dispatch(int irq, FAR void *context); ****************************************************************************/ #ifdef CONFIG_ARCH_BUTTONS -EXTERN void up_buttoninit(void); +void up_buttoninit(void); #endif /**************************************************************************** @@ -592,7 +679,7 @@ EXTERN void up_buttoninit(void); ****************************************************************************/ #ifdef CONFIG_ARCH_BUTTONS -EXTERN uint8_t up_buttons(void); +uint8_t up_buttons(void); #endif /**************************************************************************** @@ -613,7 +700,7 @@ EXTERN uint8_t up_buttons(void); ****************************************************************************/ #ifdef CONFIG_ARCH_IRQBUTTONS -EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler); +xcpt_t up_irqbutton(int id, xcpt_t irqhandler); #endif /************************************************************************************ @@ -625,17 +712,17 @@ EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler); ************************************************************************************/ #ifdef CONFIG_ARCH_RELAYS -EXTERN void up_relaysinit(void); -EXTERN void relays_setstat(int relays, bool stat); -EXTERN bool relays_getstat(int relays); -EXTERN void relays_setstats(uint32_t relays_stat); -EXTERN uint32_t relays_getstats(void); -EXTERN void relays_onoff(int relays, uint32_t mdelay); -EXTERN void relays_onoffs(uint32_t relays_stat, uint32_t mdelay); -EXTERN void relays_resetmode(int relays); -EXTERN void relays_powermode(int relays); -EXTERN void relays_resetmodes(uint32_t relays_stat); -EXTERN void relays_powermodes(uint32_t relays_stat); +void up_relaysinit(void); +void relays_setstat(int relays, bool stat); +bool relays_getstat(int relays); +void relays_setstats(uint32_t relays_stat); +uint32_t relays_getstats(void); +void relays_onoff(int relays, uint32_t mdelay); +void relays_onoffs(uint32_t relays_stat, uint32_t mdelay); +void relays_resetmode(int relays); +void relays_powermode(int relays); +void relays_resetmodes(uint32_t relays_stat); +void relays_powermodes(uint32_t relays_stat); #endif /**************************************************************************** @@ -650,9 +737,8 @@ EXTERN void relays_powermodes(uint32_t relays_stat); * ****************************************************************************/ -EXTERN int up_putc(int ch); +int up_putc(int ch); -#undef EXTERN #ifdef __cplusplus } #endif diff --git a/nuttx/mm/mm_graninit.c b/nuttx/mm/mm_graninit.c index e43839ad6..54b729988 100644 --- a/nuttx/mm/mm_graninit.c +++ b/nuttx/mm/mm_graninit.c @@ -74,7 +74,6 @@ FAR struct gran_s *g_graninfo; * Perfrom common GRAN initialization. * * Input Parameters: - * info - Private granule data structure pointer * heapstart - Start of the granule allocation heap * heapsize - Size of heap in bytes * log2gran - Log base 2 of the size of one granule. 0->1 byte, diff --git a/nuttx/sched/Kconfig b/nuttx/sched/Kconfig index ab0de5b47..afb35c1c0 100644 --- a/nuttx/sched/Kconfig +++ b/nuttx/sched/Kconfig @@ -40,7 +40,7 @@ config JULIAN_TIME config START_YEAR int "start year" - default 2010 + default 2013 config START_MONTH int "start month" @@ -384,14 +384,6 @@ config PREALLOC_TIMERS comment "Stack and heap information" -config CUSTOM_STACK - bool "Enable custom stack" - default n - ---help--- - The up_ implementation will handle all stack operations outside of the - nuttx model. This is necessary for certain architectures that have - have hardware stacks (such as the 8051 family). - config IDLETHREAD_STACKSIZE int "Idle thread stack size" default 1024 -- cgit v1.2.3 From b09b1b66b02ca5bd8241050b21d7030bec344d4a Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 11 Dec 2012 21:42:15 +0000 Subject: configs/p112: Add a configuration for the Z180 P112 board git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5429 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 2 + nuttx/Documentation/README.html | 2 + nuttx/README.txt | 2 + nuttx/arch/z80/src/common/up_doirq.c | 1 + nuttx/arch/z80/src/common/up_initialize.c | 8 + nuttx/arch/z80/src/common/up_internal.h | 6 + nuttx/arch/z80/src/z180/Kconfig | 13 + nuttx/arch/z80/src/z180/switch.h | 103 +++++- nuttx/arch/z80/src/z180/z180_mmu.c | 71 ++-- nuttx/arch/z80/src/z180/z180_mmu.h | 6 +- nuttx/arch/z80/src/z180/z180_registerdump.c | 2 + nuttx/configs/Kconfig | 28 ++ nuttx/configs/README.txt | 27 +- nuttx/configs/p112/Kconfig | 4 + nuttx/configs/p112/README.txt | 26 ++ nuttx/configs/p112/include/board.h | 60 ++++ nuttx/configs/p112/ostest/Make.defs | 167 +++++++++ nuttx/configs/p112/ostest/defconfig | 530 ++++++++++++++++++++++++++++ nuttx/configs/p112/ostest/setenv.bat | 50 +++ nuttx/configs/p112/scripts/setenv.bat | 50 +++ nuttx/configs/p112/scripts/setenv.sh | 66 ++++ nuttx/configs/p112/src/Makefile | 77 ++++ nuttx/configs/z80sim/src/Makefile | 2 +- nuttx/include/nuttx/arch.h | 26 +- nuttx/sched/Kconfig | 8 +- nuttx/sched/env_internal.h | 2 +- nuttx/sched/pthread_create.c | 63 ++-- nuttx/sched/sched_releasetcb.c | 6 + 28 files changed, 1332 insertions(+), 76 deletions(-) create mode 100644 nuttx/configs/p112/Kconfig create mode 100644 nuttx/configs/p112/README.txt create mode 100644 nuttx/configs/p112/include/board.h create mode 100644 nuttx/configs/p112/ostest/Make.defs create mode 100644 nuttx/configs/p112/ostest/defconfig create mode 100644 nuttx/configs/p112/ostest/setenv.bat create mode 100644 nuttx/configs/p112/scripts/setenv.bat create mode 100755 nuttx/configs/p112/scripts/setenv.sh create mode 100644 nuttx/configs/p112/src/Makefile (limited to 'nuttx/sched') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 7e3b2a43f..11e8b200b 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3780,4 +3780,6 @@ * include/nuttx/arch.h: Add address environment control interfaces (for use with CPUs the provide MCUs and support process-like address environments). * arch/z80/src/z180/z180_mmu.*: Add MMU support for z180 tasks. + * configs/p112: Add very basic board support and an examples/ostest + configuration for the venerable P112 board. diff --git a/nuttx/Documentation/README.html b/nuttx/Documentation/README.html index 7dd23ac3d..281b738b8 100644 --- a/nuttx/Documentation/README.html +++ b/nuttx/Documentation/README.html @@ -150,6 +150,8 @@ | | | |- include/README.txt | | | |- src/README.txt | | | `- README.txt + | | |- p112/ + | | | `- README.txt | | |- pcblogic-pic32mx/ | | | `- README.txt | | |- pic32-starterkit/ diff --git a/nuttx/README.txt b/nuttx/README.txt index 55f42339c..9ad499d3f 100644 --- a/nuttx/README.txt +++ b/nuttx/README.txt @@ -849,6 +849,8 @@ nuttx | | |- include/README.txt | | |- src/README.txt | | `- README.txt + | |- p112/ + | | `- README.txt | |- pcblogic-pic32mx/ | | `- README.txt | |- pic32-starterkit/ diff --git a/nuttx/arch/z80/src/common/up_doirq.c b/nuttx/arch/z80/src/common/up_doirq.c index a4bb830fd..4b57f8f7b 100644 --- a/nuttx/arch/z80/src/common/up_doirq.c +++ b/nuttx/arch/z80/src/common/up_doirq.c @@ -102,6 +102,7 @@ FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs) IRQ_LEAVE(irq); } + up_ledoff(LED_INIRQ); return regs; #endif diff --git a/nuttx/arch/z80/src/common/up_initialize.c b/nuttx/arch/z80/src/common/up_initialize.c index 1ae927831..e0b46f7ec 100644 --- a/nuttx/arch/z80/src/common/up_initialize.c +++ b/nuttx/arch/z80/src/common/up_initialize.c @@ -145,6 +145,14 @@ void up_initialize(void) up_timerinit(); #endif + /* Initialize the CPU for those that use it (only for the Z180). This + * needs to be done before any tasks are created). + */ + +#if CONFIG_ADDRENV + (void)up_mmuinit(); +#endif + /* Register devices */ #if CONFIG_NFILE_DESCRIPTORS > 0 diff --git a/nuttx/arch/z80/src/common/up_internal.h b/nuttx/arch/z80/src/common/up_internal.h index 1989f99d0..3adb02a39 100644 --- a/nuttx/arch/z80/src/common/up_internal.h +++ b/nuttx/arch/z80/src/common/up_internal.h @@ -117,6 +117,12 @@ EXTERN FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs); EXTERN void up_sigdeliver(void); +/* Defined in CPU-specific logic (only for Z180) */ + +#if CONFIG_ADDRENV +int up_mmuinit(void); +#endif + /* Defined in up_allocateheap.c */ #if CONFIG_MM_REGIONS > 1 diff --git a/nuttx/arch/z80/src/z180/Kconfig b/nuttx/arch/z80/src/z180/Kconfig index 58abbd6f2..3082e69cb 100644 --- a/nuttx/arch/z80/src/z180/Kconfig +++ b/nuttx/arch/z80/src/z180/Kconfig @@ -137,4 +137,17 @@ config ARCH_HAVEHEAD Use a board-specific version of the "head" file in the configs//src directory +menu "Z180 Peripheral Support" + +config Z180_UART0 + bool "UART0" + default n + select ARCH_HAVE_UART0 + +config Z180_UART1 + bool "UART1" + default n + select ARCH_HAVE_UART1 + +endmenu endif diff --git a/nuttx/arch/z80/src/z180/switch.h b/nuttx/arch/z80/src/z180/switch.h index 38054e4b8..aa33bd1e1 100644 --- a/nuttx/arch/z80/src/z180/switch.h +++ b/nuttx/arch/z80/src/z180/switch.h @@ -44,6 +44,7 @@ #include #include +#include "z180_iomap.h" #include "up_internal.h" /************************************************************************************ @@ -58,56 +59,116 @@ /* Initialize the IRQ state */ -#define INIT_IRQCONTEXT() current_regs = NULL +#define INIT_IRQCONTEXT() \ + current_regs = NULL /* IN_INTERRUPT returns true if the system is currently operating in the interrupt * context. IN_INTERRUPT is the inline equivalent of up_interrupt_context(). */ -#define IN_INTERRUPT() (current_regs != NULL) +#define IN_INTERRUPT() \ + (current_regs != NULL) -/* The following macro is used when the system enters interrupt handling logic */ +/* The following macro declares the variables need by IRQ_ENTER and IRQ_LEAVE. + * These variables are used to support nested interrupts. + * + * - savestate holds the previous value of current_state. + * - savecpr holds the previous value of current_cpr. + * + * TODO: I think this logic is bad... I do not thing that this will really + * handle nested interrupts correctly. What if we are nested and then a + * context switch occurs? current_regs will not be updated correctly! + */ #define DECL_SAVESTATE() \ - FAR chipreg_t *savestate + FAR chipreg_t *savestate; \ + uint8_t savecbr; -#define IRQ_ENTER(irq, regs) \ - do { \ - savestate = (FAR chipreg_t *)current_regs; \ - current_regs = (regs); \ - } while (0) +/* The following macro is used when the system enters interrupt handling logic. + * The entry values of current_regs and current_cbr and stored in local variables. + * Then current_regs and current_cbr are set to the values of the interrupted + * task. + */ -/* The following macro is used when the system exits interrupt handling logic */ +#define IRQ_ENTER(irq, regs) \ + do \ + { \ + savestate = (FAR chipreg_t *)current_regs; \ + savecbr = current_cbr; \ + current_regs = (regs); \ + current_cbr = inp(Z180_MMU_CBR); \ + } \ + while (0) + +/* The following macro is used when the system exits interrupt handling logic. + * The value of current_regs is restored. If we are not processing a nested + * interrupt (meaning that we going to return to the user task), then also + * set the MMU's CBR register. + */ -#define IRQ_LEAVE(irq) current_regs = savestate +#define IRQ_LEAVE(irq) \ + do \ + { \ + current_regs = savestate; \ + if (current_regs) \ + { \ + current_cbr = savecbr; \ + } \ + else \ + { \ + outp(Z180_MMU_CBR, savecbr); \ + } \ + } /* The following macro is used to sample the interrupt state (as a opaque handle) */ -#define IRQ_STATE() (current_regs) +#define IRQ_STATE() \ + (current_regs) /* Save the current IRQ context in the specified TCB */ -#define SAVE_IRQCONTEXT(tcb) z180_copystate((tcb)->xcp.regs, (FAR chipreg_t*)current_regs) +#define SAVE_IRQCONTEXT(tcb) \ + z180_copystate((tcb)->xcp.regs, (FAR chipreg_t*)current_regs) /* Set the current IRQ context to the state specified in the TCB */ -#define SET_IRQCONTEXT(tcb) z180_copystate((FAR chipreg_t*)current_regs, (tcb)->xcp.regs) +#define SET_IRQCONTEXT(tcb) \ + do \ + { \ + if ((tcb)->xcp.cbr.cbr) \ + { \ + current_cbr = (tcb)->xcp.cbr->cbr); \ + } \ + z180_copystate((FAR chipreg_t*)current_regs, (tcb)->xcp.regs); \ + } \ + while (0) /* Save the user context in the specified TCB. User context saves can be simpler * because only those registers normally saved in a C called need be stored. */ -#define SAVE_USERCONTEXT(tcb) z180_saveusercontext((tcb)->xcp.regs) +#define SAVE_USERCONTEXT(tcb) \ + z180_saveusercontext((tcb)->xcp.regs) /* Restore the full context -- either a simple user state save or the full, * IRQ state save. */ -#define RESTORE_USERCONTEXT(tcb) z180_restoreusercontext((tcb)->xcp.regs) +#define RESTORE_USERCONTEXT(tcb) \ + do \ + { \ + if ((tcb)->xcp.cbr.cbr) \ + { \ + outp(Z180_MMU_CBR, (tcb)->xcp.cbr->cbr); \ + } \ + z180_restoreusercontext((tcb)->xcp.regs); \ + } \ + while (0) /* Dump the current machine registers */ -#define _REGISTER_DUMP() z180_registerdump() +#define _REGISTER_DUMP() \ + z180_registerdump() /************************************************************************************ * Public Types @@ -123,6 +184,14 @@ */ extern volatile chipreg_t *current_regs; + +/* This holds the value of the MMU's CBR register. This value is set to the + * interrupted tasks's CBR on interrupt entry, changed to the new task's CBR if + * an interrrupt level context switch occurs, and restored on interrupt exit. In + * this way, the CBR is always correct on interrupt exit. + */ + +extern uint8_t current_cbr; #endif /************************************************************************************ diff --git a/nuttx/arch/z80/src/z180/z180_mmu.c b/nuttx/arch/z80/src/z180/z180_mmu.c index c71f59755..076d91bef 100644 --- a/nuttx/arch/z80/src/z180/z180_mmu.c +++ b/nuttx/arch/z80/src/z180/z180_mmu.c @@ -120,15 +120,21 @@ static FAR struct z180_cbr_s *z180_mmu_findcbr(void) * called very early in the boot process to get the basic operating * memory configuration correct. This function does *not* perform all * necessray MMU initialization... only the basics needed at power-up. - * z180_mmu_init() must be called later to complete the entire MMU + * up_mmuinit() must be called later to complete the entire MMU * initialization. * ****************************************************************************/ void z180_mmu_lowinit(void) __naked { + /* Set the CBAR register to set up the virtual address of the Bank Area and + * Common Area 1. Set the BBR register to set up the physical mapping for + * the Bank Area (the physical mapping for Common Area 1 will not be done + * until the first task is started. + */ + __asm - ld c, #Z180_MMU_CBR ; port + ld c, #Z180_MMU_CBAR ; port ld a, #Z180_CBAR_VALUE ; value out (c), a @@ -139,15 +145,15 @@ void z180_mmu_lowinit(void) __naked } /**************************************************************************** - * Name: z180_mmu_init + * Name: up_mmuinit * * Description: - * Perform higher level initializatin of the MMU and physical memory + * Perform higher level initialization of the MMU and physical memory * memory management logic. * ****************************************************************************/ -int z180_mmu_init(void) +int up_mmuinit(void) { /* Here we use the granule allocator as a page allocator. We lie and * say that 1 page is 1 byte. @@ -257,7 +263,7 @@ errout_with_irq: } /**************************************************************************** - * Name: up_addrenv_clone + * Name: up_addrenv_share * * Description: * This function is called from the core scheduler logic when a thread @@ -274,8 +280,7 @@ errout_with_irq: * ****************************************************************************/ -#ifdef CONFIG_ADDRENV -int up_addrenv_clone(FAR const _TCB *ptcb, FAR _TCB *ctcb) +int up_addrenv_share(FAR const _TCB *ptcb, FAR _TCB *ctcb) { irqstate_t flags; @@ -299,7 +304,6 @@ int up_addrenv_clone(FAR const _TCB *ptcb, FAR _TCB *ctcb) irqrestore(flags); return OK; } -#endif /**************************************************************************** * Name: up_addrenv_instantiate @@ -316,35 +320,55 @@ int up_addrenv_clone(FAR const _TCB *ptcb, FAR _TCB *ctcb) * be instantiated. * * Returned Value: - * Zero (OK) on success; a negated errno value on failure. + * A handle that may be used with up_addrenv_restore() to restore the + * address environment before up_addrenv_instantiate() was called. * ****************************************************************************/ -#ifdef CONFIG_ADDRENV -int up_addrenv_instantiate(FAR _TCB *tcb) +FAR void *up_addrenv_instantiate(FAR _TCB *tcb) { + uint8_t oldcbr; irqstate_t flags; - /* Check if the task has an address environment. */ + /* Get the current CBR value from the CBR register */ flags = irqsave(); + cbr = inp(Z180_MMU_CBR); + + /* Check if the task has an address environment. */ + if (tcb->xcp.cbr) { - /* Yes... write the CBR value into CBR register */ + /* Yes.. Write the new CBR value into CBR register */ outp(Z180_MMU_CBR, tcb->xcp.cbr.cbr); - /* Clone the CBR by incrementing the reference counting and saving a - * copy in the child thread's TCB. - */ - - ptcb->xcp.cbr.crefs++; - ctcb->xcp.cbr = ptcb->xcp.cbr; } irqrestore(flags); - return OK; + return (FAR void *)cbr; +} + +/**************************************************************************** + * Name: up_addrenv_restore + * + * Description: + * Restore an address environment using a handle previously returned by + * up_addrenv_instantiate(). + * + * Input Parameters: + * handle - A handle previously returned by up_addrenv_instantiate. + * + * Returned Value: + * Zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +int up_addrenv_restore(FAR void *handle) +{ + /* Restore the CBR value */ + + outp(Z180_MMU_CBR, (uint8_t)handle); } -#endif /**************************************************************************** * Name: up_addrenv_release @@ -364,7 +388,6 @@ int up_addrenv_instantiate(FAR _TCB *tcb) * ****************************************************************************/ -#ifdef CONFIG_ADDRENV int up_addrenv_release(FAR _TCB *tcb) { FAR struct z180_cbr_s *cbr; @@ -401,5 +424,3 @@ int up_addrenv_release(FAR _TCB *tcb) irqrestore(flags); return OK; } -#endif - diff --git a/nuttx/arch/z80/src/z180/z180_mmu.h b/nuttx/arch/z80/src/z180/z180_mmu.h index 1a4c03406..74463427a 100644 --- a/nuttx/arch/z80/src/z180/z180_mmu.h +++ b/nuttx/arch/z80/src/z180/z180_mmu.h @@ -128,7 +128,7 @@ * called very early in the boot process to get the basic operating * memory configuration correct. This function does *not* perform all * necessray MMU initialization... only the basics needed at power-up. - * z180_mmu_init() must be called later to complete the entire MMU + * up_mmuinit() must be called later to complete the entire MMU * initialization. * ****************************************************************************/ @@ -136,7 +136,7 @@ void z180_mmu_lowinit(void) __naked; /**************************************************************************** - * Name: z180_mmu_init + * Name: up_mmuinit * * Description: * Perform higher level initializatin of the MMU and physical memory @@ -144,6 +144,6 @@ void z180_mmu_lowinit(void) __naked; * ****************************************************************************/ -void z180_mmu_init(void); +void up_mmuinit(void); #endif /* __ARCH_Z80_SRC_Z180_Z180_MMU_H */ diff --git a/nuttx/arch/z80/src/z180/z180_registerdump.c b/nuttx/arch/z80/src/z180/z180_registerdump.c index 2ccfc2f99..65ae791db 100644 --- a/nuttx/arch/z80/src/z180/z180_registerdump.c +++ b/nuttx/arch/z80/src/z180/z180_registerdump.c @@ -86,6 +86,8 @@ static void z180_registerdump(void) current_regs[XCPT_IX], current_regs[XCPT_IY]); lldbg("SP: %04x PC: %04x\n" current_regs[XCPT_SP], current_regs[XCPT_PC]); + lldbg("CBAR: %02x BBR: %02x CBR: %02x\n" + inp(Z180_MMU_CBAR), inp(Z180_MMU_BBR), inp(Z180_MMU_CBR)); } } #endif diff --git a/nuttx/configs/Kconfig b/nuttx/configs/Kconfig index 50e1cc600..bba1444c4 100644 --- a/nuttx/configs/Kconfig +++ b/nuttx/configs/Kconfig @@ -346,6 +346,33 @@ config ARCH_BOARD_OLIMEX_STM32P107 Linux or Cygwin. See the http://www.olimex.com for further information. This board features the STMicro STM32F107VC MCU +config ARCH_BOARD_P112 + bool "P112 Z180-based platform" + depends on ARCH_CHIP_Z8018216FSG + ---help--- + The P112 is notable because it was the first of the hobbyist single board + computers to reach the production stage. The P112 hobbyist computers + were relatively widespread and inspired other hobbyist centered home brew + computing projects such as N8VEM home brew computing project. The P112 + project still maintains many devoted enthusiasts and has an online + repository of software and other information. + + The P112 computer originated as a commercial product of "D-X Designs Pty + Ltd" of Australia. They describe the computer as "The P112 is a stand-alone + 8-bit CPU board. Typically running CP/M (tm) or a similar operating system, + it provides a Z80182 (Z-80 upgrade) CPU with up to 1MB of memory, serial, + parallel and diskette IO, and realtime clock, in a 3.5-inch drive form factor. + Powered solely from 5V, it draws 150mA (nominal: not including disk drives) + with a 16MHz CPU clock. Clock speeds up to 24.576MHz are possible." + + The P112 board was last available new in 1996 by Dave Brooks. In late 2004 + on the Usenet Newsgroup comp.os.cpm, talk about making another run of P112 + boards was discussed. David Griffith decided to produce additional P112 kits + with Dave Brooks blessing and the assistance of others. In addition Terry + Gulczynski makes additional P112 derivative hobbyist home brew computers. + Hal Bower was very active in the mid 1990's on the P112 project and ported + the "Banked/Portable BIOS". + config ARCH_BOARD_PCBLOGICPIC32MX bool "PIC32MX board from PCB Logic Design Co" depends on ARCH_CHIP_PIC32MX460F512L @@ -647,6 +674,7 @@ config ARCH_BOARD default "olimex-lpc2378" if ARCH_BOARD_OLIMEXLPC2378 default "olimex-stm32-p107" if ARCH_BOARD_OLIMEX_STM32P107 default "olimex-strp711" if ARCH_BOARD_OLIMEX_STRP711 + default "p112" if ARCH_BOARD_P112 default "pcblogic-pic32mx" if ARCH_BOARD_PCBLOGICPIC32MX default "pic32-starterkit" if ARCH_BOARD_PIC32_STARTERKIT default "pic32mx7mmb" if ARCH_BOARD_PIC32_PIC32MX7MMB diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt index 23f5e4380..e7f73f945 100644 --- a/nuttx/configs/README.txt +++ b/nuttx/configs/README.txt @@ -1780,14 +1780,36 @@ configs/pcblogic-pic32mx STATUS: Code complete but testing has been stalled due to tool related problems (PICkit 2 does not work with the PIC32). -configs/pic32-starterkit +configs/p112 + The P112 is notable because it was the first of the hobbyist single board + computers to reach the production stage. The P112 hobbyist computers + were relatively widespread and inspired other hobbyist centered home brew + computing projects such as N8VEM home brew computing project. The P112 + project still maintains many devoted enthusiasts and has an online + repository of software and other information. + + The P112 computer originated as a commercial product of "D-X Designs Pty + Ltd" of Australia. They describe the computer as "The P112 is a stand-alone + 8-bit CPU board. Typically running CP/M (tm) or a similar operating system, + it provides a Z80182 (Z-80 upgrade) CPU with up to 1MB of memory, serial, + parallel and diskette IO, and realtime clock, in a 3.5-inch drive form factor. + Powered solely from 5V, it draws 150mA (nominal: not including disk drives) + with a 16MHz CPU clock. Clock speeds up to 24.576MHz are possible." + + The P112 board was last available new in 1996 by Dave Brooks. In late 2004 + on the Usenet Newsgroup comp.os.cpm, talk about making another run of P112 + boards was discussed. David Griffith decided to produce additional P112 kits + with Dave Brooks blessing and the assistance of others. In addition Terry + Gulczynski makes additional P112 derivative hobbyist home brew computers. + Hal Bower was very active in the mid 1990's on the P112 project and ported + the "Banked/Portable BIOS". +configs/pic32-starterkit This directory contains the port of NuttX to the Microchip PIC32 Ethernet Starter Kit (DM320004) with the Multimedia Expansion Board (MEB, DM320005). See www.microchip.com for further information. configs/pic32mx7mmb - This directory will (eventually) contain the port of NuttX to the Mikroelektronika PIC32MX7 Multimedia Board (MMB). See http://www.mikroe.com/ for further information. @@ -1797,7 +1819,6 @@ configs/pjrc-8051 and the SDCC toolchain. This port is not quite ready for prime time. configs/qemu-i486 - Port of NuttX to QEMU in i486 mode. This port will also run on real i486 hardwared (Google the Bifferboard). diff --git a/nuttx/configs/p112/Kconfig b/nuttx/configs/p112/Kconfig new file mode 100644 index 000000000..ae2bf3130 --- /dev/null +++ b/nuttx/configs/p112/Kconfig @@ -0,0 +1,4 @@ +# +# For a description of the syntax of this configuration file, +# see misc/tools/kconfig-language.txt. +# diff --git a/nuttx/configs/p112/README.txt b/nuttx/configs/p112/README.txt new file mode 100644 index 000000000..6b6f5964d --- /dev/null +++ b/nuttx/configs/p112/README.txt @@ -0,0 +1,26 @@ +P112 README +^^^^^^^^^^^ + +The P112 is notable because it was the first of the hobbyist single board +computers to reach the production stage. The P112 hobbyist computers +were relatively widespread and inspired other hobbyist centered home brew +computing projects such as N8VEM home brew computing project. The P112 +project still maintains many devoted enthusiasts and has an online +repository of software and other information. + +The P112 computer originated as a commercial product of "D-X Designs Pty +Ltd" of Australia. They describe the computer as "The P112 is a stand-alone +8-bit CPU board. Typically running CP/M (tm) or a similar operating system, +it provides a Z80182 (Z-80 upgrade) CPU with up to 1MB of memory, serial, +parallel and diskette IO, and realtime clock, in a 3.5-inch drive form factor. +Powered solely from 5V, it draws 150mA (nominal: not including disk drives) +with a 16MHz CPU clock. Clock speeds up to 24.576MHz are possible." + +The P112 board was last available new in 1996 by Dave Brooks. In late 2004 +on the Usenet Newsgroup comp.os.cpm, talk about making another run of P112 +boards was discussed. David Griffith decided to produce additional P112 kits +with Dave Brooks blessing and the assistance of others. In addition Terry +Gulczynski makes additional P112 derivative hobbyist home brew computers. +Hal Bower was very active in the mid 1990's on the P112 project and ported +the "Banked/Portable BIOS". + diff --git a/nuttx/configs/p112/include/board.h b/nuttx/configs/p112/include/board.h new file mode 100644 index 000000000..55077709d --- /dev/null +++ b/nuttx/configs/p112/include/board.h @@ -0,0 +1,60 @@ +/************************************************************ + * configs/p112/include/board.h + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ************************************************************/ + +#ifndef __CONFIGS_P112_INCLUDE_BOARD_H +#define __CONFIGS_P112_INCLUDE_BOARD_H + +/************************************************************ + * Included Files + ************************************************************/ + +/************************************************************ + * Definitions + ************************************************************/ + +/************************************************************ + * Public Functions + ************************************************************/ + +#if defined(__cplusplus) +extern "C" +{ +#endif + +#if defined(__cplusplus) +} +#endif + +#endif /* __CONFIGS_P112_INCLUDE_BOARD_H */ diff --git a/nuttx/configs/p112/ostest/Make.defs b/nuttx/configs/p112/ostest/Make.defs new file mode 100644 index 000000000..e64c7b5dd --- /dev/null +++ b/nuttx/configs/p112/ostest/Make.defs @@ -0,0 +1,167 @@ +############################################################################ +# configs/p112/ostest/Make.defs +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +include ${TOPDIR}/.config +include ${TOPDIR}/tools/Config.mk + +# These are the directories where the SDCC toolchain is installed. NOTE +# that short 8.3 path names are used in order to avoid spaces. On my machine +# I have: +# +# C:\PROGRA~1\ = C:\Profram Files\ +# C:\PROGRA~2\ = C:\Program Files (x86)\ +# +# Your PC may be configured differently. + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + SDCC_INSTALLDIR = C:\PROGRA~2\SDCC + SDCC_BINDIR = $(SDCC_INSTALLDIR)\bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)\lib\z180 +else + SDCC_INSTALLDIR = /usr/local + SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin + SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z180 +endif + +CROSSDEV = +CC = sdcc +CPP = sdcpp +LD = sdldz80 +AS = sdasz80 +AR = sdar -r +ARCHCPUFLAGS = -mz180 + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + ARCHOPTIMIZATION = --debug +else + ARCHOPTIMIZATION = +endif + +ARCHPICFLAGS = +ARCHWARNINGS = +ARCHDEFINES = +ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include + +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = -x -a -l -o -s -g + +SDCCLIB = z180.lib + +ASMEXT = .asm +OBJEXT = .o +LIBEXT = .lib +EXEEXT = .hex + +# Custom ASSEMBLE definition. The most common toolchain, GCC, uses the +# compiler to assemble files because this has the advantage of running the C +# Pre-Processor against. This is not possible with other SDCC; we need to +# define AS and over-ride the common definition in order to use the assembler +# directly. + +define ASSEMBLE + @echo "AS: $1" + $(Q) $(AS) $(AFLAGS) $2 $1 +endef + +# Custom CLEAN definition + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) +define CLEAN + $(Q) if exist *.o (del /f /q *.o) + $(Q) if exist *.asm (del /f /q *.asm) + $(Q) if exist *.rel (del /f /q *.rel) + $(Q) if exist *.lst (del /f /q *.lst) + $(Q) if exist *.rst (del /f /q *.rst) + $(Q) if exist *.sym (del /f /q *.sym) + $(Q) if exist *.adb (del /f /q *.adb) + $(Q) if exist *.lnk (del /f /q *.lnk) + $(Q) if exist *.map (del /f /q *.map) + $(Q) if exist *.mem (del /f /q *.mem) + $(Q) if exist *.hex (del /f /q *.hex) + $(Q) if exist *.cmd (del /f /q *.cmd) +endef +else +define CLEAN + $(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd +endef +endif + +# Windows native host tool definitions + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + HOSTCC = mingw32-gcc.exe + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + HOSTEXEEXT = .exe + + # Windows-native host tools + + MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative + + # Use NTFS links or directory copies + +ifeq ($(CONFIG_WINDOWS_MKLINK),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.bat +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.bat +endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.bat + +else + +# Linux/Cygwin host tool definitions + + HOSTCC = gcc + HOSTINCLUDES = -I. + HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe + HOSTLDFLAGS = + + # This is the tool to use for dependencies (i.e., none) + + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + + # SDCC for Linux, OSX, or Cygwin understands symbolic links. Windows SDCC + # running under Cygwin does not + +ifeq ($(WINTOOL),y) + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh +else + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh +endif +DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + +endif diff --git a/nuttx/configs/p112/ostest/defconfig b/nuttx/configs/p112/ostest/defconfig new file mode 100644 index 000000000..2cdc13ba5 --- /dev/null +++ b/nuttx/configs/p112/ostest/defconfig @@ -0,0 +1,530 @@ +# +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_LINUX is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +CONFIG_WINDOWS_NATIVE=y +# CONFIG_WINDOWS_CYGWIN is not set +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set +# CONFIG_WINDOWS_MKLINK is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="..\apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set + +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_SYMBOLS is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set +CONFIG_ARCH_Z80=y +CONFIG_ARCH="z80" +CONFIG_ARCH_CHIP="z180" +CONFIG_BOARD_LOOPSPERMSEC=100 +# CONFIG_ARCH_CHIP_Z80 is not set +# CONFIG_ARCH_CHIP_Z8018006VSG is not set +# CONFIG_ARCH_CHIP_Z8018010VSG is not set +# CONFIG_ARCH_CHIP_Z8018008VSG is not set +# CONFIG_ARCH_CHIP_Z8018010FSG is not set +# CONFIG_ARCH_CHIP_Z8018008VEG is not set +# CONFIG_ARCH_CHIP_Z8018006VEG is not set +# CONFIG_ARCH_CHIP_Z8018006PSG is not set +# CONFIG_ARCH_CHIP_Z8018008FSG is not set +# CONFIG_ARCH_CHIP_Z8018010PSG is not set +# CONFIG_ARCH_CHIP_Z8018006PEG is not set +# CONFIG_ARCH_CHIP_Z8018010VEG is not set +# CONFIG_ARCH_CHIP_Z8018010PEG is not set +# CONFIG_ARCH_CHIP_Z8018008PSG is not set +# CONFIG_ARCH_CHIP_Z8018006FSG is not set +# CONFIG_ARCH_CHIP_Z8018000XSO is not set +# CONFIG_ARCH_CHIP_Z8018010FEG is not set +# CONFIG_ARCH_CHIP_Z8018000WSO is not set +# CONFIG_ARCH_CHIP_Z8018008PEG is not set +# CONFIG_ARCH_CHIP_Z8018110FEG is not set +# CONFIG_ARCH_CHIP_Z8018233FSG is not set +# CONFIG_ARCH_CHIP_Z8018220AEG is not set +CONFIG_ARCH_CHIP_Z8018216FSG=y +# CONFIG_ARCH_CHIP_Z8018216ASG is not set +# CONFIG_ARCH_CHIP_Z8018233ASG is not set +# CONFIG_ARCH_CHIP_Z8019520FSG is not set +# CONFIG_ARCH_CHIP_Z8019533FSG is not set +# CONFIG_ARCH_CHIP_Z8L18020VSG is not set +# CONFIG_ARCH_CHIP_Z8L18020FSG is not set +# CONFIG_ARCH_CHIP_Z8L18020PSG is not set +# CONFIG_ARCH_CHIP_Z8L18220ASG is not set +# CONFIG_ARCH_CHIP_Z8L18220FSG is not set +# CONFIG_ARCH_CHIP_Z8L18220AEG is not set +# CONFIG_ARCH_CHIP_Z8S18020VSG is not set +# CONFIG_ARCH_CHIP_Z8S18020VSG1960 is not set +# CONFIG_ARCH_CHIP_Z8S18033VSG is not set +# CONFIG_ARCH_CHIP_Z8S18010FSG is not set +# CONFIG_ARCH_CHIP_Z8S18010VEG is not set +# CONFIG_ARCH_CHIP_Z8S18020VEG is not set +# CONFIG_ARCH_CHIP_Z8S18010VSG is not set +# CONFIG_ARCH_CHIP_Z8S18020PSG is not set +# CONFIG_ARCH_CHIP_Z8S18033FSG is not set +# CONFIG_ARCH_CHIP_Z8S18033FEG is not set +# CONFIG_ARCH_CHIP_Z8S18020FSG is not set +# CONFIG_ARCH_CHIP_Z8S18033VEG is not set +# CONFIG_ARCH_CHIP_Z8S18010PSG is not set +# CONFIG_ARCH_CHIP_Z8S18020FEG is not set +# CONFIG_ARCH_CHIP_Z8S18010PEG is not set +# CONFIG_ARCH_CHIP_Z8S18010FEG is not set +# CONFIG_ARCH_CHIP_Z8F6403 is not set +# CONFIG_ARCH_CHIP_Z8F6423 is not set +# CONFIG_ARCH_CHIP_EZ80F91 is not set +# CONFIG_ARCH_CHIP_EZ80F92 is not set +# CONFIG_ARCH_CHIP_EZ80F93 is not set +CONFIG_ARCH_CHIP_Z180=y +CONFIG_ARCH_CHIP_Z80182=y +CONFIG_LINKER_HOME_AREA=0x0000 +CONFIG_LINKER_CODE_AREA=0x0200 +CONFIG_LINKER_DATA_AREA=0x8000 +# CONFIG_LINKER_ROM_AT_0000 is not set +# CONFIG_ARCH_HAVEHEAD is not set +# CONFIG_Z180_TOOLCHAIN_SDCCL is not set +CONFIG_Z180_TOOLCHAIN_SDCCW=y +CONFIG_Z180_BANKAREA_VIRTBASE=0x8000 +CONFIG_Z180_BANKAREA_PHYSBASE=0x08000 +CONFIG_Z180_COMMON1AREA_VIRTBASE=0xc000 +CONFIG_Z180_PHYSHEAP_START=0x0c000 +CONFIG_Z180_PHYSHEAP_END=0x100000 + +# +# Z180 Peripheral Support +# +CONFIG_Z180_UART0=y +CONFIG_Z180_UART1=y + +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_IRQPRIO is not set +# CONFIG_CUSTOM_STACK is not set +CONFIG_ADDRENV=y +# CONFIG_ARCH_STACKDUMP is not set +# CONFIG_ENDIAN_BIG is not set + +# +# Board Settings +# +CONFIG_DRAM_START=0x0000 +CONFIG_DRAM_SIZE=65536 + +# +# Boot options +# +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set + +# +# Board Selection +# +CONFIG_ARCH_BOARD_P112=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="p112" + +# +# Common Board Options +# + +# +# Board-Specific Options +# + +# +# RTOS Features +# +CONFIG_MSEC_PER_TICK=10 +CONFIG_RR_INTERVAL=0 +# CONFIG_SCHED_INSTRUMENTATION is not set +CONFIG_TASK_NAME_SIZE=0 +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2007 +CONFIG_START_MONTH=2 +CONFIG_START_DAY=21 +# CONFIG_DEV_CONSOLE is not set +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="ostest_main" +CONFIG_DISABLE_OS_API=y +CONFIG_DISABLE_CLOCK=y +CONFIG_DISABLE_POSIX_TIMERS=y +CONFIG_DISABLE_PTHREAD=y +CONFIG_DISABLE_SIGNALS=y +CONFIG_DISABLE_MQUEUE=y +CONFIG_DISABLE_MOUNTPOINT=y +CONFIG_DISABLE_ENVIRON=y +CONFIG_DISABLE_POLL=y + +# +# Sizes of configurable things (0 disables) +# +CONFIG_MAX_TASKS=8 +CONFIG_MAX_TASK_ARGS=4 +CONFIG_NPTHREAD_KEYS=0 +CONFIG_NFILE_DESCRIPTORS=0 +CONFIG_NFILE_STREAMS=0 +CONFIG_NAME_MAX=32 +CONFIG_PREALLOC_MQ_MSGS=0 +CONFIG_MQ_MAXMSGSIZE=0 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=4 +CONFIG_PREALLOC_TIMERS=0 + +# +# Stack and heap information +# +CONFIG_IDLETHREAD_STACKSIZE=1024 +CONFIG_USERMAIN_STACKSIZE=1024 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=1024 + +# +# Device Drivers +# +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +CONFIG_DEV_LOWCONSOLE=y +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART0=y +CONFIG_ARCH_HAVE_UART1=y +CONFIG_MCU_SERIAL=y +CONFIG_UART0_SERIAL_CONSOLE=y +# CONFIG_UART1_SERIAL_CONSOLE is not set +# CONFIG_NO_SERIAL_CONSOLE is not set + +# +# UART0 Configuration +# +CONFIG_UART0_RXBUFSIZE=64 +CONFIG_UART0_TXBUFSIZE=64 +CONFIG_UART0_BAUD=115200 +CONFIG_UART0_BITS=8 +CONFIG_UART0_PARITY=0 +CONFIG_UART0_2STOP=0 + +# +# UART1 Configuration +# +CONFIG_UART1_RXBUFSIZE=64 +CONFIG_UART1_TXBUFSIZE=64 +CONFIG_UART1_BAUD=115200 +CONFIG_UART1_BITS=8 +CONFIG_UART1_PARITY=0 +CONFIG_UART1_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set + +# +# System Logging Device Options +# + +# +# System Logging +# +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_NET is not set + +# +# File Systems +# + +# +# File system configuration +# +# CONFIG_FS_RAMMAP is not set + +# +# System Logging +# +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0x00000000 +CONFIG_HEAP2_SIZE=0 +# CONFIG_GRAN is not set + +# +# Binary Formats +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_PIC is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# +CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=0 +# CONFIG_LIBM is not set +CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_C99_BOOL8 is not set +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Named Applications +# +# CONFIG_NAMEDAPP is not set + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_NETTEST is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +CONFIG_EXAMPLES_OSTEST=y +# CONFIG_EXAMPLES_OSTEST_BUILTIN is not set +CONFIG_EXAMPLES_OSTEST_LOOPS=1 +CONFIG_EXAMPLES_OSTEST_STACKSIZE=1024 +CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=4 +CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000 +CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 +# CONFIG_EXAMPLES_PASHELLO is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WLAN is not set + +# +# Interpreters +# + +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# ModBus +# + +# +# FreeModbus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM +# + +# +# System NSH Add-Ons +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set diff --git a/nuttx/configs/p112/ostest/setenv.bat b/nuttx/configs/p112/ostest/setenv.bat new file mode 100644 index 000000000..19ca1ef57 --- /dev/null +++ b/nuttx/configs/p112/ostest/setenv.bat @@ -0,0 +1,50 @@ +@echo off + +rem configs/p112/ostest/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the SDCC toolchain for windows. + +set PATH=C:\Program Files (x86)\SDCC/bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% +echo %PATH% diff --git a/nuttx/configs/p112/scripts/setenv.bat b/nuttx/configs/p112/scripts/setenv.bat new file mode 100644 index 000000000..dc214445f --- /dev/null +++ b/nuttx/configs/p112/scripts/setenv.bat @@ -0,0 +1,50 @@ +@echo off + +rem configs/p112/scripts/setenv.bat +rem +rem Copyright (C) 2012 Gregory Nutt. All rights reserved. +rem Author: Gregory Nutt +rem +rem Redistribution and use in source and binary forms, with or without +rem modification, are permitted provided that the following conditions +rem are met: +rem +rem 1. Redistributions of source code must retain the above copyright +rem notice, this list of conditions and the following disclaimer. +rem 2. Redistributions in binary form must reproduce the above copyright +rem notice, this list of conditions and the following disclaimer in +rem the documentation and/or other materials provided with the +rem distribution. +rem 3. Neither the name NuttX nor the names of its contributors may be +rem used to endorse or promote products derived from this software +rem without specific prior written permission. +rem +rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +rem POSSIBILITY OF SUCH DAMAGE. + +rem This is the location where I installed in the MinGW compiler. With +rem this configuration, it is recommended that you do NOT install the +rem MSYS tools; they conflict with the GNUWin32 tools. See +rem http://www.mingw.org/ for further info. + +set PATH=C:\MinGW\bin;%PATH% + +rem This is the location where I installed the SDCC toolchain for windows. + +set PATH=C:\Program Files (x86)\SDCC/bin;%PATH% + +rem This is the location where I installed the GNUWin32 tools. See +rem http://gnuwin32.sourceforge.net/. + +set PATH=C:\gnuwin32\bin;%PATH% +echo %PATH% diff --git a/nuttx/configs/p112/scripts/setenv.sh b/nuttx/configs/p112/scripts/setenv.sh new file mode 100755 index 000000000..c55027d62 --- /dev/null +++ b/nuttx/configs/p112/scripts/setenv.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# configs/p112/ostest/setenv.sh +# +# Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +if [ "$_" = "$0" ] ; then + echo "You must source this script, not run it!" 1>&2 + exit 1 +fi + +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# +# This is the normal installation directory for SDCC under Linux, OSX +# or Linux: +# +export TOOLCHAIN_BIN=/usr/local/bin + +# +# This is the normal installation directory for SDCC under Windows +# +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/SDCC/bin" + +# +# Add the path to the toolchain to the PATH varialble +# +export PATH="${TOOLCHAIN_BIN}":/sbin:/usr/sbin:${PATH_ORIG} + +echo "PATH : ${PATH}" diff --git a/nuttx/configs/p112/src/Makefile b/nuttx/configs/p112/src/Makefile new file mode 100644 index 000000000..087e1ab2b --- /dev/null +++ b/nuttx/configs/p112/src/Makefile @@ -0,0 +1,77 @@ +############################################################################ +# configs/p112/src/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +-include $(TOPDIR)/Make.defs + +CFLAGS += -I$(TOPDIR)$(DELIM)sched +CFLAGS += -I$(TOPDIR)$(DELIM)arch$(DELIM)z80$(DELIM)src$(DELIM)common +CFLAGS += -I$(TOPDIR)$(DELIM)arch$(DELIM)z80$(DELIM)src$(DELIM)z180 + +ASRCS = +AOBJS = $(ASRCS:$(ASMEXT)=$(OBJEXT)) +CSRCS = +COBJS = $(CSRCS:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +CFLAGS += -I $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src + +all: libboard$(LIBEXT) + +$(AOBJS): %$(OBJEXT): %$(ASMEXT) + $(call ASSEMBLE, $<, $@) + +$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +libboard$(LIBEXT): $(OBJS) + $(call ARCHIVE, $@, $(OBJS)) + +.depend: Makefile $(SRCS) + $(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ + +depend: .depend + +clean: + $(call DELFILE, libboard$(LIBEXT)) + $(call CLEAN) + +distclean: clean + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + +-include Make.dep diff --git a/nuttx/configs/z80sim/src/Makefile b/nuttx/configs/z80sim/src/Makefile index 99d557850..9ace92912 100644 --- a/nuttx/configs/z80sim/src/Makefile +++ b/nuttx/configs/z80sim/src/Makefile @@ -36,7 +36,7 @@ -include $(TOPDIR)/Make.defs CFLAGS += -I$(TOPDIR)$(DELIM)sched -CFLAGS += -I$(TOPDIR)$(DELIM)arch$(DELIM)z80$(DELIM)src$(DELIM)common -I$(TOPDIR)$(DELIM)arch$(DELIM)z80$(DELIM)src$(DELIM)z80 +CFLAGS += -I$(TOPDIR)$(DELIM)arch$(DELIM)z80$(DELIM)src$(DELIM)common CFLAGS += -I$(TOPDIR)$(DELIM)arch$(DELIM)z80$(DELIM)src$(DELIM)z80 ASRCS = diff --git a/nuttx/include/nuttx/arch.h b/nuttx/include/nuttx/arch.h index 54c234d8d..7c444602e 100644 --- a/nuttx/include/nuttx/arch.h +++ b/nuttx/include/nuttx/arch.h @@ -403,7 +403,7 @@ int up_addrenv_create(FAR _TCB *tcb, size_t envsize); #endif /**************************************************************************** - * Name: up_addrenv_clone + * Name: up_addrenv_share * * Description: * This function is called from the core scheduler logic when a thread @@ -421,7 +421,7 @@ int up_addrenv_create(FAR _TCB *tcb, size_t envsize); ****************************************************************************/ #ifdef CONFIG_ADDRENV -int up_addrenv_clone(FAR const _TCB *ptcb, FAR _TCB *ctcb); +int up_addrenv_share(FAR const _TCB *ptcb, FAR _TCB *ctcb); #endif /**************************************************************************** @@ -439,12 +439,32 @@ int up_addrenv_clone(FAR const _TCB *ptcb, FAR _TCB *ctcb); * be instantiated. * * Returned Value: + * A handle that may be used with up_addrenv_restore() to restore the + * address environment before up_addrenv_instantiate() was called. + * + ****************************************************************************/ + +#ifdef CONFIG_ADDRENV +FAR void *up_addrenv_instantiate(FAR _TCB *tcb); +#endif + +/**************************************************************************** + * Name: up_addrenv_restore + * + * Description: + * Restore an address environment using a handle previously returned by + * up_addrenv_instantiate(). + * + * Input Parameters: + * handle - A handle previously returned by up_addrenv_instantiate. + * + * Returned Value: * Zero (OK) on success; a negated errno value on failure. * ****************************************************************************/ #ifdef CONFIG_ADDRENV -int up_addrenv_instantiate(FAR _TCB *tcb); +int up_addrenv_restore(FAR void *handle); #endif /**************************************************************************** diff --git a/nuttx/sched/Kconfig b/nuttx/sched/Kconfig index afb35c1c0..bfaec3b5d 100644 --- a/nuttx/sched/Kconfig +++ b/nuttx/sched/Kconfig @@ -22,7 +22,13 @@ config SCHED_INSTRUMENTATION bool "Monitor system performance" default n ---help--- - enables instrumentation in scheduler to monitor system performance. + Enables instrumentation in scheduler to monitor system performance. + If enabled, then the board-specific logic must provide the following + functions (see include/sched.h): + + void sched_note_start(FAR _TCB *tcb); + void sched_note_stop(FAR _TCB *tcb); + void sched_note_switch(FAR _TCB *pFromTcb, FAR _TCB *pToTcb); config TASK_NAME_SIZE int "Maximum task name size" diff --git a/nuttx/sched/env_internal.h b/nuttx/sched/env_internal.h index a6205d658..5370da059 100644 --- a/nuttx/sched/env_internal.h +++ b/nuttx/sched/env_internal.h @@ -80,7 +80,7 @@ EXTERN int env_dup(FAR _TCB *ptcb); EXTERN int env_share(FAR _TCB *ptcb); EXTERN int env_release(FAR _TCB *ptcb); -/* functions used internally the environment handling logic */ +/* functions used internally by the environment handling logic */ EXTERN FAR char *env_findvar(environ_t *envp, const char *pname); EXTERN int env_removevar(environ_t *envp, char *pvar); diff --git a/nuttx/sched/pthread_create.c b/nuttx/sched/pthread_create.c index 5fdf3b88d..dc2db2916 100644 --- a/nuttx/sched/pthread_create.c +++ b/nuttx/sched/pthread_create.c @@ -246,7 +246,7 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, { FAR _TCB *ptcb; FAR join_t *pjoin; - int status; + int ret; int priority; #if CONFIG_RR_INTERVAL > 0 int policy; @@ -268,13 +268,27 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, return ENOMEM; } + /* Share the address environment of the parent task. NOTE: Only tasks + * created throught the nuttx/binfmt loaders may have an address + * environment. + */ + +#ifdef CONFIG_ADDRENV + ret = up_addrenv_share((FAR const _TCB *)g_readytorun.head, ptcb); + if (ret < 0) + { + sched_releasetcb(ptcb); + return -ret; + } +#endif + /* Associate file descriptors with the new task */ - status = sched_setuppthreadfiles(ptcb); - if (status != OK) + ret = sched_setuppthreadfiles(ptcb); + if (ret != OK) { sched_releasetcb(ptcb); - return status; + return ret; } /* Share the parent's envionment */ @@ -292,8 +306,8 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, /* Allocate the stack for the TCB */ - status = up_create_stack(ptcb, attr->stacksize); - if (status != OK) + ret = up_create_stack(ptcb, attr->stacksize); + if (ret != OK) { sched_releasetcb(ptcb); sched_free(pjoin); @@ -310,8 +324,8 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, /* Get the priority for this thread. */ struct sched_param param; - status = sched_getparam(0, ¶m); - if (status == OK) + ret = sched_getparam(0, ¶m); + if (ret == OK) { priority = param.sched_priority; } @@ -348,11 +362,9 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, /* Initialize the task control block */ - status = task_schedsetup(ptcb, priority, pthread_start, - (main_t)start_routine); - if (status != OK) + ret = task_schedsetup(ptcb, priority, pthread_start, (main_t)start_routine); + if (ret != OK) { - sched_releasetcb(ptcb); sched_free(pjoin); return EBUSY; @@ -390,21 +402,21 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, /* Initialize the semaphores in the join structure to zero. */ - status = sem_init(&pjoin->data_sem, 0, 0); - if (status == OK) + ret = sem_init(&pjoin->data_sem, 0, 0); + if (ret == OK) { - status = sem_init(&pjoin->exit_sem, 0, 0); + ret = sem_init(&pjoin->exit_sem, 0, 0); } /* Activate the task */ sched_lock(); - if (status == OK) + if (ret == OK) { - status = task_activate(ptcb); + ret = task_activate(ptcb); } - if (status == OK) + if (ret == OK) { /* Wait for the task to actually get running and to register * its join_t @@ -414,8 +426,15 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, /* Return the thread information to the caller */ - if (thread) *thread = (pthread_t)pid; - if (!pjoin->started) status = ERROR; + if (thread) + { + *thread = (pthread_t)pid; + } + + if (!pjoin->started) + { + ret = EINVAL; + } sched_unlock(); (void)sem_destroy(&pjoin->data_sem); @@ -428,8 +447,8 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr, (void)sem_destroy(&pjoin->exit_sem); sched_releasetcb(ptcb); sched_free(pjoin); - return EIO; + ret = EIO; } - return OK; + return ret; } diff --git a/nuttx/sched/sched_releasetcb.c b/nuttx/sched/sched_releasetcb.c index 21837262d..0557c829b 100644 --- a/nuttx/sched/sched_releasetcb.c +++ b/nuttx/sched/sched_releasetcb.c @@ -171,6 +171,12 @@ int sched_releasetcb(FAR _TCB *tcb) (void)env_release(tcb); + /* Release this thread's reference to the address environment */ + +#ifdef CONFIG_ADDRENV + ret = up_addrenv_release(tcb); +#endif + /* And, finally, release the TCB itself */ sched_free(tcb); -- cgit v1.2.3 From 14a896b20509dfc4657778fa21246cffb2ec2b55 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 16 Dec 2012 21:15:27 +0000 Subject: Add basic hooks to support a PATH variable (more is needed) git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5440 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 9 ++ nuttx/TODO | 28 +++- nuttx/binfmt/Kconfig | 16 ++ nuttx/binfmt/Makefile | 16 +- nuttx/binfmt/binfmt_exepath.c | 285 ++++++++++++++++++++++++++++++++++++ nuttx/configs/sim/ostest/defconfig | 21 ++- nuttx/include/nuttx/binfmt/binfmt.h | 112 ++++++++++++-- nuttx/sched/env_clearenv.c | 2 - nuttx/sched/env_release.c | 4 +- nuttx/sched/os_bringup.c | 19 +++ nuttx/sched/os_start.c | 4 +- 11 files changed, 485 insertions(+), 31 deletions(-) create mode 100644 nuttx/binfmt/binfmt_exepath.c (limited to 'nuttx/sched') diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 11e8b200b..c61b28f69 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3782,4 +3782,13 @@ * arch/z80/src/z180/z180_mmu.*: Add MMU support for z180 tasks. * configs/p112: Add very basic board support and an examples/ostest configuration for the venerable P112 board. + * sched/os_bringup.c: If CONFIG_PATH_INITIAL is defined, then the initial + environment of the task started by os_bringup() will have the PATH + environment variable defined to be that string. + * binfmt/binfmt_exepath.c: If CONFIG_BINFMT_EXEPATH is defined, then this + file will be built. In contains logic to search for regular files at + the absolutes paths found in the current PATH environment variable + setting. This is untested and not yet hooked into the binfmt exec() + logic on initial check-in + diff --git a/nuttx/TODO b/nuttx/TODO index fcc418a0e..85a89b41f 100644 --- a/nuttx/TODO +++ b/nuttx/TODO @@ -35,12 +35,12 @@ nuttx/ (4) ARM/STM32 (arch/arm/src/stm32/) (3) AVR (arch/avr) (0) Intel x86 (arch/x86) - (4) 8051 / MCS51 (arch/8051/) + (5) 8051 / MCS51 (arch/8051/) (3) MIPS/PIC32 (arch/mips) (1) Hitachi/Renesas SH-1 (arch/sh/src/sh1) (4) Renesas M16C/26 (arch/sh/src/m16c) (10) z80/z8/ez80 (arch/z80/) - (8) z16 (arch/z16/) + (9) z16 (arch/z16/) (1) mc68hc1x (arch/hc) apps/ @@ -1505,6 +1505,16 @@ o 8051 / MCS51 (arch/8051/) Status: Open Priority: Low -- only because there as so many other issues with 8051 + Title: 8051 BUILD BROKEN + Description: The last time I tried to build the pjrc-8051 configurtion using + the SDCC 3.2.1 toolchain (for Windows). I got compilation + errors in sched/os_bringup.c. It complained about type + mis-matches. What I gather from Googling, this is a problem + with the --stack-auto option. At any rate, this problem will + need to be fixed if you want to resurrect the 8051 NuttX port. + Status: Open + Priority: Low -- I don't think anyone uses the 8051 port. + o MIPS/PIC32(arch/mips) ^^^^^^^^^^^^^^^^^^^^^ @@ -1833,9 +1843,17 @@ o z16 (arch/z16) Internal Error(0503) On line 2504 of "MMCSD\MMCSD_SDIO.C" File , Args(562,46) - Status: Open. Recommended workaround: remove mmcsd_sdio.c from - drivers/mmcsd/Make.defs. There is no SDIO support for the Z16 anyway - Priority: Low + Status: Open. Recommended workaround: remove mmcsd_sdio.c from + drivers/mmcsd/Make.defs. There is no SDIO support for the Z16 anyway + Priority: Low + + Title: NATIVE BUILD PROBLEMS + Description: When last tested (ca.12/12), there were some missing .obj files in + arch/z16/src. A little additional TLC will be needed to get a + reliable Windows native build. As of this writing, the Cygwin + based build has not been re-verified. + Status: Open + Priority: Low -- I don't think anyone uses the Z16 port. o mc68hc1x (arch/hc) ^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/binfmt/Kconfig b/nuttx/binfmt/Kconfig index cbf909327..495bd050f 100644 --- a/nuttx/binfmt/Kconfig +++ b/nuttx/binfmt/Kconfig @@ -12,6 +12,22 @@ config BINFMT_DISABLE if !BINFMT_DISABLE +config BINFMT_EXEPATH + bool "Support PATH variable" + default n + depends on !DISABLE_ENVIRON + ---help--- + Use the contents of the PATH environment variable to locate executable + files. Default: n + +config PATH_INITIAL + string "Initial PATH Value" + default "" + depends on BINFMT_EXEPATH + ---help--- + The initial value of the PATH variable. This is the colon-separated + list of absolute paths. E.g., "/bin:/usr/bin:/sbin" + config NXFLAT bool "Enable the NXFLAT Binary Format" default n diff --git a/nuttx/binfmt/Makefile b/nuttx/binfmt/Makefile index bda9602ac..8ec0d877c 100644 --- a/nuttx/binfmt/Makefile +++ b/nuttx/binfmt/Makefile @@ -43,15 +43,19 @@ CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(TOPDIR)$(DELIM)sched"} # Basic BINFMT source files -BINFMT_ASRCS = -BINFMT_CSRCS = binfmt_globals.c binfmt_register.c binfmt_unregister.c \ - binfmt_loadmodule.c binfmt_unloadmodule.c binfmt_execmodule.c \ - binfmt_exec.c binfmt_dumpmodule.c +BINFMT_ASRCS = +BINFMT_CSRCS = binfmt_globals.c binfmt_register.c binfmt_unregister.c +BINFMT_CSRCS += binfmt_loadmodule.c binfmt_unloadmodule.c binfmt_execmodule.c +BINFMT_CSRCS += binfmt_exec.c binfmt_dumpmodule.c + +ifeq ($(CONFIG_BINFMT_EXEPATH),y) +BINFMT_CSRCS += binfmt_exepath.c +endif # Symbol table source files -BINFMT_CSRCS += symtab_findbyname.c symtab_findbyvalue.c \ - symtab_findorderedbyname.c symtab_findorderedbyvalue.c +BINFMT_CSRCS += symtab_findbyname.c symtab_findbyvalue.c +BINFMT_CSRCS += symtab_findorderedbyname.c symtab_findorderedbyvalue.c # Add configured binary modules diff --git a/nuttx/binfmt/binfmt_exepath.c b/nuttx/binfmt/binfmt_exepath.c new file mode 100644 index 000000000..c81588975 --- /dev/null +++ b/nuttx/binfmt/binfmt_exepath.c @@ -0,0 +1,285 @@ +/**************************************************************************** + * binfmt/binfmt_exepath.c + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#if !defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_BINFMT_EXEPATH) + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +struct exepath_s +{ + FAR char *next; /* Pointer to the next (unterminated) value in the PATH variable */ + char path[1]; +}; +#define SIZEOF_EXEPATH_S(n) (sizeof(struct exepath_s) + (n) - 1) + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: exepath_init + * + * Description: + * Initialize for the traversal of each value in the PATH variable. The + * usage is sequence is as follows: + * + * 1) Call exepath_init() to initialze for the traversal. exepath_init() + * will return an opaque handle that can then be provided to + * exepath_next() and exepath_release(). + * 2) Call exepath_next() repeatedly to examine every file that lies + * in the directories of the PATH variable + * 3) Call exepath_release() to free resources set aside by exepath_init(). + * + * Input Parameters: + * None + * + * Returned Value: + * On success, exepath_init() return a non-NULL, opaque handle that may + * subsequently be used in calls to exepath_next() and exepath_release(). + * On error, a NULL handle value will be returned. The most likely cause + * of an error would be that the there is no value associated with the + * PATH variable. + * + ****************************************************************************/ + +EXEPATH_HANDLE exepath_init(void) +{ + FAR struct exepath_s *exepath; + FAR char *path; + + /* Get the value of the PATH variable */ + + path = getenv("PATH"); + if (!path) + { + /* getenv() will return a NULL value if the PATH variable does not + * exist in the environment. + */ + + return (EXEPATH_HANDLE)NULL; + } + + /* Allocate a container for the PATH variable contents */ + + exepath = (FAR struct exepath_s *)kmalloc(SIZEOF_EXEPATH_S(strlen(path) + 1)); + if (!exepath) + { + /* Ooops.. we are out of memory */ + + return (EXEPATH_HANDLE)NULL; + } + + /* Populate the container */ + + strcpy(exepath->path, path); + exepath->next = exepath->path; + + /* And return the containing cast to an opaque handle */ + + return (EXEPATH_HANDLE)exepath; +} + + /**************************************************************************** + * Name: exepath_next + * + * Description: + * Traverse all possible values in the PATH variable in attempt to find + * the full path to an executable file when only a relative path is + * provided. + * + * Input Parameters: + * handle - The handle value returned by exepath_init + * relpath - The relative path to the file to be found. + * + * Returned Value: + * On success, a non-NULL pointer to a null-terminated string is provided. + * This is the full path to a file that exists in the file system. This + * function will verify that the file exists (but will not verify that it + * is marked executable). + * + * NOTE: The string pointer return in the success case points to allocated + * memory. This memory must be freed by the called by calling kfree(). + * + * NULL is returned if no path is found to any file with the provided + * 'relpath' from any absolute path in the file variable. In this case, + * there is no point in calling exepath_next() further; exepath_release() + * must be called to release resources set aside by expath_init(). + * + ****************************************************************************/ + +FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath) +{ + FAR struct exepath_s *exepath = (FAR struct exepath_s *)handle; + struct stat buf; + FAR char *endptr; + FAR char *path; + FAR char *fullpath; + int pathlen; + int ret; + + /* Verify that a value handle and relative path were provided */ + + DEBUGASSERT(exepath && relpath); + DEBUGASSERT(relpath[0] != '\0' && relpath[0] != '/'); + + /* Loop until (1) we find a file with this relative path from one of the + * absolute paths in the PATH variable, or (2) all of the absolute paths + * in the PATH variable have been considered. + */ + + for (;;) + { + /* Make sure that exepath->next points to the beginning of a string */ + + path = exepath->next; + if (*path == '\0') + { + /* If it points to a NULL it means that either (1) the PATH varialbe + * is empty, or (2) we have already examined all of the paths in the + * path variable. + */ + + return (FAR char *)NULL; + } + + /* Okay... 'path' points to the beginning of the string. The string may + * be termined either with (1) ':' which separates the path from the + * next path in the list, or (2) NUL which marks the end of the list. + */ + + endptr = strchr(path, ':'); + if (!endptr) + { + /* If strchr returns NUL it means that ':' does not appear in the + * string. Therefore, this must be the final path in the PATH + * variable content. + */ + + endptr = &path[strlen(path)]; + exepath->next = endptr; + DEBUGASSERT(*endptr == '\0'); + } + else + { + DEBUGASSERT(*endptr == ':'); + exepath->next = endptr + 1; + *endptr = '\0'; + } + + pathlen = strlen(path) + strlen(relpath) + 2; + fullpath = (FAR char *)kmalloc(pathlen); + if (!fullpath) + { + /* Failed to allocate memory */ + + return (FAR char *)NULL; + } + + /* Construct the full path */ + + sprintf(fullpath, "%s/%s", path, relpath); + + /* Verify that a regular file exists at this path */ + + ret = stat(fullpath, &buf);; + if (ret == OK && S_ISREG(buf.st_mode)) + { + return fullpath; + } + + /* Failed to stat the file. Just free the allocated memory and + * continue to try the next path. + */ + + kfree(fullpath); + } + + /* We will not get here */ +} + +/**************************************************************************** + * Name: exepath_release + * + * Description: + * Release all resources set aside by exepath_release when the handle value + * was created. The handle value is invalid on return from this function. + * Attempts to all exepath_next() or exepath_release() with such a 'stale' + * handle will result in undefined (i.e., not good) behavior. + * + * Input Parameters: + * handle - The handle value returned by exepath_init + * + * Returned Value: + * None + * + ****************************************************************************/ + +void exepath_release(EXEPATH_HANDLE handle) +{ + kfree(handle); +} + +#endif /* !CONFIG_BINFMT_DISABLE && CONFIG_BINFMT_EXEPATH */ + diff --git a/nuttx/configs/sim/ostest/defconfig b/nuttx/configs/sim/ostest/defconfig index aece17569..beee30639 100644 --- a/nuttx/configs/sim/ostest/defconfig +++ b/nuttx/configs/sim/ostest/defconfig @@ -8,6 +8,10 @@ CONFIG_NUTTX_NEWCONFIG=y # Build Setup # # CONFIG_EXPERIMENTAL is not set +CONFIG_HOST_LINUX=y +# CONFIG_HOST_OSX is not set +# CONFIG_HOST_WINDOWS is not set +# CONFIG_HOST_OTHER is not set # # Build Configuration @@ -83,7 +87,11 @@ CONFIG_BOARD_LOOPSPERMSEC=100 # # CONFIG_ARCH_NOINTC is not set # CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_IRQPRIO is not set +# CONFIG_CUSTOM_STACK is not set +# CONFIG_ADDRENV is not set # CONFIG_ARCH_STACKDUMP is not set +# CONFIG_ENDIAN_BIG is not set # # Board Settings @@ -165,7 +173,6 @@ CONFIG_PREALLOC_TIMERS=8 # # Stack and heap information # -# CONFIG_CUSTOM_STACK is not set CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 @@ -250,8 +257,10 @@ CONFIG_MM_REGIONS=1 # Binary Formats # # CONFIG_BINFMT_DISABLE is not set +# CONFIG_BINFMT_EXEPATH is not set # CONFIG_NXFLAT is not set # CONFIG_ELF is not set +# CONFIG_PIC is not set # CONFIG_SYMTAB_ORDEREDBYNAME is not set # @@ -274,9 +283,12 @@ CONFIG_ARCH_LOWPUTC=y CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Basic CXX Support +# +# CONFIG_C99_BOOL8 is not set # CONFIG_HAVE_CXX is not set -# CONFIG_HAVE_CXXINITIALIZE is not set -# CONFIG_CXX_NEWLONG is not set # # Application Configuration @@ -302,6 +314,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_EXAMPLES_HELLOXX is not set # CONFIG_EXAMPLES_JSON is not set # CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set # CONFIG_EXAMPLES_IGMP is not set # CONFIG_EXAMPLES_LCDRW is not set # CONFIG_EXAMPLES_MM is not set @@ -323,6 +336,8 @@ CONFIG_EXAMPLES_OSTEST=y CONFIG_EXAMPLES_OSTEST_LOOPS=100 CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192 CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=8 +CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000 +CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_PASHELLO is not set # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POLL is not set diff --git a/nuttx/include/nuttx/binfmt/binfmt.h b/nuttx/include/nuttx/binfmt/binfmt.h index 49ab37264..80c0e7c7b 100644 --- a/nuttx/include/nuttx/binfmt/binfmt.h +++ b/nuttx/include/nuttx/binfmt/binfmt.h @@ -54,6 +54,14 @@ /**************************************************************************** * Public Types ****************************************************************************/ +/* EXEPATH_HANDLE is an opaque handle used to traverse the absolute paths + * assigned to the PATH environment variable. + */ + +#if !defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_BINFMT_EXEPATH) +typedef FAR void *EXEPATH_HANDLE; +#endif + /* The type of one C++ constructor or destructor */ typedef FAR void (*binfmt_ctor_t)(void); @@ -100,12 +108,9 @@ struct binfmt_s * Public Data ****************************************************************************/ -#undef EXTERN #if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern +extern "C" +{ #endif /**************************************************************************** @@ -125,7 +130,7 @@ extern "C" { * ****************************************************************************/ -EXTERN int register_binfmt(FAR struct binfmt_s *binfmt); +int register_binfmt(FAR struct binfmt_s *binfmt); /**************************************************************************** * Name: unregister_binfmt @@ -140,7 +145,7 @@ EXTERN int register_binfmt(FAR struct binfmt_s *binfmt); * ****************************************************************************/ -EXTERN int unregister_binfmt(FAR struct binfmt_s *binfmt); +int unregister_binfmt(FAR struct binfmt_s *binfmt); /**************************************************************************** * Name: load_module @@ -156,7 +161,7 @@ EXTERN int unregister_binfmt(FAR struct binfmt_s *binfmt); * ****************************************************************************/ -EXTERN int load_module(FAR struct binary_s *bin); +int load_module(FAR struct binary_s *bin); /**************************************************************************** * Name: unload_module @@ -177,7 +182,7 @@ EXTERN int load_module(FAR struct binary_s *bin); * ****************************************************************************/ -EXTERN int unload_module(FAR const struct binary_s *bin); +int unload_module(FAR const struct binary_s *bin); /**************************************************************************** * Name: exec_module @@ -192,7 +197,7 @@ EXTERN int unload_module(FAR const struct binary_s *bin); * ****************************************************************************/ -EXTERN int exec_module(FAR const struct binary_s *bin, int priority); +int exec_module(FAR const struct binary_s *bin, int priority); /**************************************************************************** * Name: exec @@ -214,8 +219,91 @@ EXTERN int exec_module(FAR const struct binary_s *bin, int priority); * ****************************************************************************/ -EXTERN int exec(FAR const char *filename, FAR const char **argv, - FAR const struct symtab_s *exports, int nexports); +int exec(FAR const char *filename, FAR const char **argv, + FAR const struct symtab_s *exports, int nexports); + +/**************************************************************************** + * Name: exepath_init + * + * Description: + * Initialize for the traversal of each value in the PATH variable. The + * usage is sequence is as follows: + * + * 1) Call exepath_init() to initialze for the traversal. exepath_init() + * will return an opaque handle that can then be provided to + * exepath_next() and exepath_release(). + * 2) Call exepath_next() repeatedly to examine every file that lies + * in the directories of the PATH variable + * 3) Call exepath_release() to free resources set aside by exepath_init(). + * + * Input Parameters: + * None + * + * Returned Value: + * On success, exepath_init() return a non-NULL, opaque handle that may + * subsequently be used in calls to exepath_next() and exepath_release(). + * On error, a NULL handle value will be returned. The most likely cause + * of an error would be that the there is no value associated with the + * PATH variable. + * + ****************************************************************************/ + +#if !defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_BINFMT_EXEPATH) +EXEPATH_HANDLE exepath_init(void); +#endif + + /**************************************************************************** + * Name: exepath_next + * + * Description: + * Traverse all possible values in the PATH variable in attempt to find + * the full path to an executable file when only a relative path is + * provided. + * + * Input Parameters: + * handle - The handle value returned by exepath_init + * relpath - The relative path to the file to be found. + * + * Returned Value: + * On success, a non-NULL pointer to a null-terminated string is provided. + * This is the full path to a file that exists in the file system. This + * function will verify that the file exists (but will not verify that it + * is marked executable). + * + * NOTE: The string pointer return in the success case points to allocated + * memory. This memory must be freed by the called by calling kfree(). + * + * NULL is returned if no path is found to any file with the provided + * 'relpath' from any absolute path in the file variable. In this case, + * there is no point in calling exepath_next() further; exepath_release() + * must be called to release resources set aside by expath_init(). + * + ****************************************************************************/ + +#if !defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_BINFMT_EXEPATH) +FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath); +#endif + +/**************************************************************************** + * Name: exepath_release + * + * Description: + * Release all resources set aside by exepath_release when the handle value + * was created. The handle value is invalid on return from this function. + * Attempts to all exepath_next() or exepath_release() with such a 'stale' + * handle will result in undefined (i.e., not good) behavior. + * + * Input Parameters: + * handle - The handle value returned by exepath_init + * + * Returned Value: + * None + * + ****************************************************************************/ + +#if !defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_BINFMT_EXEPATH) +void exepath_release(EXEPATH_HANDLE handle); +#endif #undef EXTERN #if defined(__cplusplus) diff --git a/nuttx/sched/env_clearenv.c b/nuttx/sched/env_clearenv.c index 7fe97a911..75890f3bc 100644 --- a/nuttx/sched/env_clearenv.c +++ b/nuttx/sched/env_clearenv.c @@ -79,5 +79,3 @@ int clearenv(void) #endif /* CONFIG_DISABLE_ENVIRON */ - - diff --git a/nuttx/sched/env_release.c b/nuttx/sched/env_release.c index 83e65dbb5..8bc8d2205 100644 --- a/nuttx/sched/env_release.c +++ b/nuttx/sched/env_release.c @@ -94,11 +94,11 @@ int env_release(FAR _TCB *ptcb) { /* Check the reference count on the environment structure */ - if ( envp->ev_crefs <= 1) + if (envp->ev_crefs <= 1) { /* Decrementing the reference count will destroy the environment */ - sched_free( envp ); /* plain free() should be fine here */ + sched_free(envp); } else { diff --git a/nuttx/sched/os_bringup.c b/nuttx/sched/os_bringup.c index ec6152891..e0a236bbe 100644 --- a/nuttx/sched/os_bringup.c +++ b/nuttx/sched/os_bringup.c @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -129,6 +130,17 @@ int os_bringup(void) #endif int init_taskid; + /* Setup up the initial environment for the idle task. At present, this + * may consist of only the initial PATH variable. The PATH variable is + * (probably) not used by the IDLE task. However, the environment + * containing the PATH variable will be inherited by all of the threads + * created by the IDLE task. + */ + +#if !defined(CONFIG_DISABLE_ENVIRON) && defined(CONFIG_PATH_INITIAL) + (void)setenv("PATH", CONFIG_PATH_INITIAL, 1); +#endif + /* Start the page fill worker kernel thread that will resolve page faults. * This should always be the first thread started because it may have to * resolve page faults in other threads @@ -190,5 +202,12 @@ int os_bringup(void) (main_t)CONFIG_USER_ENTRYPOINT, (const char **)NULL); #endif ASSERT(init_taskid != ERROR); + + /* We an save a few bytes by discarding the IDLE thread's environment. */ + +#if !defined(CONFIG_DISABLE_ENVIRON) && defined(CONFIG_PATH_INITIAL) + (void)clearenv(); +#endif + return OK; } diff --git a/nuttx/sched/os_start.c b/nuttx/sched/os_start.c index c0b16236d..a53ac2aa8 100644 --- a/nuttx/sched/os_start.c +++ b/nuttx/sched/os_start.c @@ -426,7 +426,9 @@ void os_start(void) lib_initialize(); } - /* Create stdout, stderr, stdin */ + /* Create stdout, stderr, stdin on the IDLE task. These will be + * inherited by all of the threads created by the IDLE task. + */ (void)sched_setupidlefiles(&g_idletcb); -- cgit v1.2.3