diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-31 23:29:34 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-31 23:29:34 +0000 |
commit | 966e801032745429ec2f28f9e5ab0b3fc8a68d3d (patch) | |
tree | 8c1586e169aa482558c987cd7c4a542e4a6c6d4a /nuttx | |
parent | 28a0241ccd48963a13638c1dfbef161ab1bf557e (diff) | |
download | px4-firmware-966e801032745429ec2f28f9e5ab0b3fc8a68d3d.tar.gz px4-firmware-966e801032745429ec2f28f9e5ab0b3fc8a68d3d.tar.bz2 px4-firmware-966e801032745429ec2f28f9e5ab0b3fc8a68d3d.zip |
Misc clean; mark assertions as non-returning; allow toolchain prefix to be overriden from make command line
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5591 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/ChangeLog | 5 | ||||
-rw-r--r-- | nuttx/README.txt | 11 | ||||
-rw-r--r-- | nuttx/arch/8051/src/up_assert.c | 3 | ||||
-rw-r--r-- | nuttx/arch/arm/src/arm/Toolchain.defs | 26 | ||||
-rw-r--r-- | nuttx/arch/arm/src/arm/up_assert.c | 3 | ||||
-rw-r--r-- | nuttx/arch/arm/src/armv7-m/Toolchain.defs | 42 | ||||
-rw-r--r-- | nuttx/arch/arm/src/armv7-m/up_assert.c | 3 | ||||
-rw-r--r-- | nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c | 2 | ||||
-rw-r--r-- | nuttx/arch/avr/src/avr/Toolchain.defs | 10 | ||||
-rw-r--r-- | nuttx/arch/avr/src/common/up_assert.c | 3 | ||||
-rw-r--r-- | nuttx/arch/hc/src/m9s12/m9s12_assert.c | 3 | ||||
-rw-r--r-- | nuttx/arch/mips/src/mips32/Toolchain.defs | 24 | ||||
-rw-r--r-- | nuttx/arch/mips/src/mips32/up_assert.c | 5 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_assert.c | 3 | ||||
-rw-r--r-- | nuttx/arch/x86/src/common/up_assert.c | 3 | ||||
-rw-r--r-- | nuttx/drivers/serial/serial.c | 7 | ||||
-rw-r--r-- | nuttx/include/assert.h | 21 |
17 files changed, 102 insertions, 72 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 5c41a0e9c..26b82fde4 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -4074,3 +4074,8 @@ removable serial devices (like USB serial). This support is enabled by CONFIG_SERIAL_REMOVABLE and requires VBUS sensing support from the board-specific logic. + * arch/*/src/*/Toolchain.defs: Change assignment so that we can + override CROSSDEV with a make command line argument. + * include/assert.h: Mark assertion functions as non-returning. + * arch/*/src/*/up_assert.h: Mark _up_assert() as non-returning. + diff --git a/nuttx/README.txt b/nuttx/README.txt index 340087791..571f8e04e 100644 --- a/nuttx/README.txt +++ b/nuttx/README.txt @@ -523,8 +523,15 @@ NuttX Buildroot Toolchain Disadvantages: This tool chain is not was well supported as some other toolchains. GNU tools are not my priority and so the buildroot tools - often get behind. For example, the is still no EABI support in the - NuttX buildroot toolchain for ARM. + often get behind. For example, until recently there was no EABI support + in the NuttX buildroot toolchain for ARM. + + NOTE: For Cortex-M3/4, there are OABI and EABI versions of the buildroot + toolchains. If you are using the older OABI toolchain the prefix for + the tools will be arm-nuttx-elf-; for the EABI toolchin the prefix will + be arm-nuttx-eabi-. If you are using the older OABI toolchain with + an ARM Cortex-M3/4, you will need to set CONFIG_ARMV7M_OABI_TOOLCHAIN + in the .config file in order to pick the right tool prefix. SHELLS ^^^^^^ diff --git a/nuttx/arch/8051/src/up_assert.c b/nuttx/arch/8051/src/up_assert.c index 46d731041..5e59d6af0 100644 --- a/nuttx/arch/8051/src/up_assert.c +++ b/nuttx/arch/8051/src/up_assert.c @@ -65,7 +65,8 @@ * Name: _up_assert ************************************************************************/ -static void _up_assert(int errorcode) /* noreturn_function */ +static void _up_assert(int errorcode) noreturn_function; +static void _up_assert(int errorcode) { /* Are we in an interrupt handler or the idle task? */ diff --git a/nuttx/arch/arm/src/arm/Toolchain.defs b/nuttx/arch/arm/src/arm/Toolchain.defs index daa825842..cd16d7ec9 100644 --- a/nuttx/arch/arm/src/arm/Toolchain.defs +++ b/nuttx/arch/arm/src/arm/Toolchain.defs @@ -1,7 +1,7 @@ ############################################################################ # arch/arm/src/armv/Toolchain.defs # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> # # Redistribution and use in source and binary forms, with or without @@ -103,11 +103,11 @@ endif ifeq ($(CONFIG_ARM_TOOLCHAIN),BUILDROOT) ifeq ($(CONFIG_ARM_OABI_TOOLCHAIN),y) - CROSSDEV = arm-nuttx-elf- - ARCROSSDEV = arm-nuttx-elf- + CROSSDEV ?= arm-nuttx-elf- + ARCROSSDEV ?= arm-nuttx-elf- else - CROSSDEV = arm-nuttx-eabi- - ARCROSSDEV = arm-nuttx-eabi- + CROSSDEV ?= arm-nuttx-eabi- + ARCROSSDEV ?= arm-nuttx-eabi- endif MAXOPTIMIZATION = -Os endif @@ -115,16 +115,16 @@ endif # CodeSourcery under Linux ifeq ($(CONFIG_ARM_TOOLCHAIN),CODESOURCERYL) - CROSSDEV = arm-none-eabi- - ARCROSSDEV = arm-none-eabi- + CROSSDEV ?= arm-none-eabi- + ARCROSSDEV ?= arm-none-eabi- MAXOPTIMIZATION = -O2 endif # CodeSourcery under Windows ifeq ($(CONFIG_ARM_TOOLCHAIN),CODESOURCERYW) - CROSSDEV = arm-none-eabi- - ARCROSSDEV = arm-none-eabi- + CROSSDEV ?= arm-none-eabi- + ARCROSSDEV ?= arm-none-eabi- MAXOPTIMIZATION = -O2 ifneq ($(CONFIG_WINDOWS_NATIVE),y) WINTOOL = y @@ -134,8 +134,8 @@ endif # devkitARM under Windows ifeq ($(CONFIG_ARM_TOOLCHAIN),DEVKITARM) - CROSSDEV = arm-eabi- - ARCROSSDEV = arm-eabi- + CROSSDEV ?= arm-eabi- + ARCROSSDEV ?= arm-eabi- ifneq ($(CONFIG_WINDOWS_NATIVE),y) WINTOOL = y endif @@ -144,8 +144,8 @@ endif # Generic GNU EABI toolchain on OS X, Linux or any typical Posix system ifeq ($(CONFIG_ARM_TOOLCHAIN),GNU_EABI) - CROSSDEV = arm-none-eabi- - ARCROSSDEV = arm-none-eabi- + CROSSDEV ?= arm-none-eabi- + ARCROSSDEV ?= arm-none-eabi- MAXOPTIMIZATION = -O3 endif diff --git a/nuttx/arch/arm/src/arm/up_assert.c b/nuttx/arch/arm/src/arm/up_assert.c index 3cc79df01..5f713c34d 100644 --- a/nuttx/arch/arm/src/arm/up_assert.c +++ b/nuttx/arch/arm/src/arm/up_assert.c @@ -252,7 +252,8 @@ static void up_dumpstate(void) * Name: _up_assert ****************************************************************************/ -static void _up_assert(int errorcode) /* noreturn_function */ +static void _up_assert(int errorcode) noreturn_function; +static void _up_assert(int errorcode) { /* Are we in an interrupt handler or the idle task? */ diff --git a/nuttx/arch/arm/src/armv7-m/Toolchain.defs b/nuttx/arch/arm/src/armv7-m/Toolchain.defs index 45ee9e36c..4de5b49f4 100644 --- a/nuttx/arch/arm/src/armv7-m/Toolchain.defs +++ b/nuttx/arch/arm/src/armv7-m/Toolchain.defs @@ -1,7 +1,7 @@ ############################################################################ # arch/arm/src/armv7-m/Toolchain.defs # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> # # Redistribution and use in source and binary forms, with or without @@ -141,8 +141,8 @@ endif # Atollic toolchain under Windows ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),ATOLLIC) - CROSSDEV = arm-atollic-eabi- - ARCROSSDEV = arm-atollic-eabi- + CROSSDEV ?= arm-atollic-eabi- + ARCROSSDEV ?= arm-atollic-eabi- ifneq ($(CONFIG_WINDOWS_NATIVE),y) WINTOOL = y endif @@ -161,12 +161,12 @@ endif ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),BUILDROOT) ifeq ($(CONFIG_ARMV7M_OABI_TOOLCHAIN),y) - CROSSDEV = arm-nuttx-elf- - ARCROSSDEV = arm-nuttx-elf- + CROSSDEV ?= arm-nuttx-elf- + ARCROSSDEV ?= arm-nuttx-elf- ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft else - CROSSDEV = arm-nuttx-eabi- - ARCROSSDEV = arm-nuttx-eabi- + CROSSDEV ?= arm-nuttx-eabi- + ARCROSSDEV ?= arm-nuttx-eabi- ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft endif MAXOPTIMIZATION = -Os @@ -175,8 +175,8 @@ endif # Code Red RedSuite under Linux ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),CODEREDL) - CROSSDEV = arm-none-eabi- - ARCROSSDEV = arm-none-eabi- + CROSSDEV ?= arm-none-eabi- + ARCROSSDEV ?= arm-none-eabi- ifeq ($(CONFIG_ARCH_CORTEXM4),y) ifeq ($(CONFIG_ARCH_FPU),y) ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard @@ -191,8 +191,8 @@ endif # Code Red RedSuite under Windows ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),CODEREDW) - CROSSDEV = arm-none-eabi- - ARCROSSDEV = arm-none-eabi- + CROSSDEV ?= arm-none-eabi- + ARCROSSDEV ?= arm-none-eabi- ifneq ($(CONFIG_WINDOWS_NATIVE),y) WINTOOL = y endif @@ -210,8 +210,8 @@ endif # CodeSourcery under Linux ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),CODESOURCERYL) - CROSSDEV = arm-none-eabi- - ARCROSSDEV = arm-none-eabi- + CROSSDEV ?= arm-none-eabi- + ARCROSSDEV ?= arm-none-eabi- ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft MAXOPTIMIZATION = -O2 endif @@ -219,8 +219,8 @@ endif # CodeSourcery under Windows ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),CODESOURCERYW) - CROSSDEV = arm-none-eabi- - ARCROSSDEV = arm-none-eabi- + CROSSDEV ?= arm-none-eabi- + ARCROSSDEV ?= arm-none-eabi- ifneq ($(CONFIG_WINDOWS_NATIVE),y) WINTOOL = y endif @@ -230,8 +230,8 @@ endif # devkitARM under Windows ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),DEVKITARM) - CROSSDEV = arm-eabi- - ARCROSSDEV = arm-eabi- + CROSSDEV ?= arm-eabi- + ARCROSSDEV ?= arm-eabi- ifneq ($(CONFIG_WINDOWS_NATIVE),y) WINTOOL = y endif @@ -241,8 +241,8 @@ endif # Generic GNU EABI toolchain on OS X, Linux or any typical Posix system ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),GNU_EABI) - CROSSDEV = arm-none-eabi- - ARCROSSDEV = arm-none-eabi- + CROSSDEV ?= arm-none-eabi- + ARCROSSDEV ?= arm-none-eabi- MAXOPTIMIZATION = -O3 ifeq ($(CONFIG_ARCH_CORTEXM4),y) ifeq ($(CONFIG_ARCH_FPU),y) @@ -258,8 +258,8 @@ endif # Raisonance RIDE7 under Windows ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),RAISONANCE) - CROSSDEV = arm-none-eabi- - ARCROSSDEV = arm-none-eabi- + CROSSDEV ?= arm-none-eabi- + ARCROSSDEV ?= arm-none-eabi- ifneq ($(CONFIG_WINDOWS_NATIVE),y) WINTOOL = y endif diff --git a/nuttx/arch/arm/src/armv7-m/up_assert.c b/nuttx/arch/arm/src/armv7-m/up_assert.c index 8e29bfe80..b40b1090c 100644 --- a/nuttx/arch/arm/src/armv7-m/up_assert.c +++ b/nuttx/arch/arm/src/armv7-m/up_assert.c @@ -267,7 +267,8 @@ static void up_dumpstate(void) * Name: _up_assert ****************************************************************************/ -static void _up_assert(int errorcode) /* noreturn_function */ +static void _up_assert(int errorcode) noreturn_function; +static void _up_assert(int errorcode) { /* Are we in an interrupt handler or the idle task? */ diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c b/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c index e3085ff78..84c4e7951 100644 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c @@ -452,7 +452,7 @@ static inline int lpc17_configinput(lpc17_pinset_t cfgset, unsigned int port, un #endif } -#ifdef defined(LPC176x) +#if defined(LPC176x) /* Set up PINSEL registers */ /* Configure as GPIO */ diff --git a/nuttx/arch/avr/src/avr/Toolchain.defs b/nuttx/arch/avr/src/avr/Toolchain.defs index 96eb273f6..09035a30f 100644 --- a/nuttx/arch/avr/src/avr/Toolchain.defs +++ b/nuttx/arch/avr/src/avr/Toolchain.defs @@ -1,7 +1,7 @@ ############################################################################ # arch/avr/src/avr/Toolchain.defs # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> # # Redistribution and use in source and binary forms, with or without @@ -82,7 +82,7 @@ endif # NuttX buildroot GCC toolchain under Linux or Cygwin ifeq ($(CONFIG_AVR_TOOLCHAIN),BUILDROOT) - CROSSDEV = avr-nuttx-elf- + CROSSDEV ?= avr-nuttx-elf- MAXOPTIMIZATION = -O2 LDFLAGS += -nostartfiles -nodefaultlibs endif @@ -90,7 +90,7 @@ endif # AVR CrossPack under OS X ifeq ($(CONFIG_AVR_TOOLCHAIN),CROSSPACK) - CROSSDEV = avr- + CROSSDEV ?= avr- MAXOPTIMIZATION = -O2 LDFLAGS += -nostartfiles -nodefaultlibs endif @@ -98,7 +98,7 @@ endif # GCC toolchain under Linux ifeq ($(CONFIG_AVR_TOOLCHAIN),LINUXGCC) - CROSSDEV = avr- + CROSSDEV ?= avr- MAXOPTIMIZATION = -O2 LDFLAGS += -nostartfiles -nodefaultlibs endif @@ -106,7 +106,7 @@ endif # WinAVR toolchain under Windows/Cygwin ifeq ($(CONFIG_AVR_TOOLCHAIN),WINAVR) - CROSSDEV = avr- + CROSSDEV ?= avr- ifneq ($(CONFIG_WINDOWS_NATIVE),y) WINTOOL = y endif diff --git a/nuttx/arch/avr/src/common/up_assert.c b/nuttx/arch/avr/src/common/up_assert.c index 3e90094eb..be7f635e8 100644 --- a/nuttx/arch/avr/src/common/up_assert.c +++ b/nuttx/arch/avr/src/common/up_assert.c @@ -90,7 +90,8 @@ * Name: _up_assert ****************************************************************************/ -static void _up_assert(int errorcode) /* noreturn_function */ +static void _up_assert(int errorcode) noreturn_function; +static void _up_assert(int errorcode) { /* Are we in an interrupt handler or the idle task? */ diff --git a/nuttx/arch/hc/src/m9s12/m9s12_assert.c b/nuttx/arch/hc/src/m9s12/m9s12_assert.c index 65cc75590..37ad5e30d 100644 --- a/nuttx/arch/hc/src/m9s12/m9s12_assert.c +++ b/nuttx/arch/hc/src/m9s12/m9s12_assert.c @@ -247,7 +247,8 @@ static void up_dumpstate(void) * Name: _up_assert ****************************************************************************/ -static void _up_assert(int errorcode) /* noreturn_function */ +static void _up_assert(int errorcode) noreturn_function; +static void _up_assert(int errorcode) { /* Are we in an interrupt handler or the idle task? */ diff --git a/nuttx/arch/mips/src/mips32/Toolchain.defs b/nuttx/arch/mips/src/mips32/Toolchain.defs index bd509b86c..09c68db12 100644 --- a/nuttx/arch/mips/src/mips32/Toolchain.defs +++ b/nuttx/arch/mips/src/mips32/Toolchain.defs @@ -1,7 +1,7 @@ ############################################################################ # arch/mips/src/mips32/Toolchain.defs # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> # # Redistribution and use in source and binary forms, with or without @@ -103,7 +103,7 @@ endif # including Pinguino mips-elf toolchain ifeq ($(CONFIG_MIPS32_TOOLCHAIN),GNU_ELF) - CROSSDEV = mips-elf- + CROSSDEV ?= mips-elf- MAXOPTIMIZATION = -O2 ARCHCPUFLAGS = -mlong32 -membedded-data -msoft-float -march=24kc -EL ARCHPICFLAGS = -fpic -membedded-pic @@ -114,8 +114,8 @@ endif # Microchip C32 toolchain under Linux ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPL) - CROSSDEV = pic32- - # CROSSDEV = xc32- + CROSSDEV ?= pic32- + # CROSSDEV ?= xc32- MAXOPTIMIZATION = -O2 ARCHCPUFLAGS = -mprocessor=elf32pic32mx -mno-float -mlong32 -membedded-data ARCHPICFLAGS = -fpic -membedded-pic @@ -126,8 +126,8 @@ endif # Microchip C32 toolchain under Windows ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPW) - CROSSDEV = pic32- - # CROSSDEV = xc32- + CROSSDEV ?= pic32- + # CROSSDEV ?= xc32- ifneq ($(CONFIG_WINDOWS_NATIVE),y) WINTOOL = y endif @@ -141,8 +141,8 @@ endif # Microchip C32 toolchain under Linux ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPL_LITE) - CROSSDEV = pic32- - # CROSSDEV = xc32- + CROSSDEV ?= pic32- + # CROSSDEV ?= xc32- # MAXOPTIMIZATION = -O2 ARCHCPUFLAGS = -mprocessor=elf32pic32mx -mno-float -mlong32 -membedded-data ARCHPICFLAGS = -fpic -membedded-pic @@ -153,8 +153,8 @@ endif # Microchip C32 toolchain under Windows ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPW_LITE) - CROSSDEV = pic32- - # CROSSDEV = xc32- + CROSSDEV ?= pic32- + # CROSSDEV ?= xc32- ifneq ($(CONFIG_WINDOWS_NATIVE),y) WINTOOL = y endif @@ -168,7 +168,7 @@ endif # microchipOpen toolchain under Linux ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPOPENL) - CROSSDEV = mypic32- + CROSSDEV ?= mypic32- # MAXOPTIMIZATION = -O2 ARCHCPUFLAGS = -mprocessor=elf32pic32mx -mno-float -mlong32 -membedded-data ARCHPICFLAGS = -fpic -membedded-pic @@ -179,7 +179,7 @@ endif # Pinguino mips-elf toolchain under Windows ifeq ($(CONFIG_MIPS32_TOOLCHAIN),PINGUINOW) - CROSSDEV = mips- + CROSSDEV ?= mips- ifneq ($(CONFIG_WINDOWS_NATIVE),y) WINTOOL = y endif diff --git a/nuttx/arch/mips/src/mips32/up_assert.c b/nuttx/arch/mips/src/mips32/up_assert.c index 7d98e7427..f27bc0ebe 100644 --- a/nuttx/arch/mips/src/mips32/up_assert.c +++ b/nuttx/arch/mips/src/mips32/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/src/mips32/up_assert.c * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -90,7 +90,8 @@ * Name: _up_assert ****************************************************************************/ -static void _up_assert(int errorcode) /* noreturn_function */ +static void _up_assert(int errorcode) noreturn_function; +static void _up_assert(int errorcode) { /* Are we in an interrupt handler or the idle task? */ diff --git a/nuttx/arch/sh/src/common/up_assert.c b/nuttx/arch/sh/src/common/up_assert.c index 5b56e7731..62889fa5a 100644 --- a/nuttx/arch/sh/src/common/up_assert.c +++ b/nuttx/arch/sh/src/common/up_assert.c @@ -76,7 +76,8 @@ * Name: _up_assert ****************************************************************************/ -static void _up_assert(int errorcode) /* noreturn_function */ +static void _up_assert(int errorcode) noreturn_function; +static void _up_assert(int errorcode) { /* Are we in an interrupt handler or the idle task? */ diff --git a/nuttx/arch/x86/src/common/up_assert.c b/nuttx/arch/x86/src/common/up_assert.c index 87958baa6..653e8e562 100644 --- a/nuttx/arch/x86/src/common/up_assert.c +++ b/nuttx/arch/x86/src/common/up_assert.c @@ -209,7 +209,8 @@ static void up_dumpstate(void) * Name: _up_assert ****************************************************************************/ -static void _up_assert(int errorcode) /* noreturn_function */ +static void _up_assert(int errorcode) noreturn_function; +static void _up_assert(int errorcode) { /* Are we in an interrupt handler or the idle task? */ diff --git a/nuttx/drivers/serial/serial.c b/nuttx/drivers/serial/serial.c index 0548d8c25..9c6acf2ee 100644 --- a/nuttx/drivers/serial/serial.c +++ b/nuttx/drivers/serial/serial.c @@ -1041,8 +1041,11 @@ void uart_datasent(FAR uart_dev_t *dev) #ifdef CONFIG_SERIAL_REMOVABLE void uart_connected(FAR uart_dev_t *dev, bool connected) { + irqstate_t flags; + /* Is the device disconnected? */ + flags = irqsave(); dev->disconnected = !connected; if (!connected) { @@ -1070,10 +1073,12 @@ void uart_connected(FAR uart_dev_t *dev, bool connected) (void)sem_post(&dev->recvsem); } - /* Notify all poll/select waiters that and hangup/error occurred */ + /* Notify all poll/select waiters that and hangup occurred */ uart_pollnotify(dev, (POLLERR|POLLHUP)); } + + irqrestore(flags); } #endif diff --git a/nuttx/include/assert.h b/nuttx/include/assert.h index 31c9edf48..62ffb3a6e 100644 --- a/nuttx/include/assert.h +++ b/nuttx/include/assert.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/assert.h * - * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -100,23 +100,28 @@ ****************************************************************************/ /**************************************************************************** - * Global Function Prototypes + * Public Data ****************************************************************************/ #ifdef __cplusplus #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + #ifdef CONFIG_HAVE_FILENAME -EXTERN void up_assert(FAR const uint8_t *filename, int linenum); -EXTERN void up_assert_code(FAR const uint8_t *filename, int linenum, - int errcode); +void up_assert(FAR const uint8_t *filename, int linenum) noreturn_function; +void up_assert_code(FAR const uint8_t *filename, int linenum, int errcode) + noreturn_function; #else -EXTERN void up_assert(void); -EXTERN void up_assert_code(int errcode); +void up_assert(void) noreturn_function; +void up_assert_code(int errcode) noreturn_function; #endif #undef EXTERN |