From 0f2a48f6405c1492d19b68a0e8311344bdba5b25 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 25 Dec 2015 15:19:38 -0600 Subject: [PATCH 01/29] Update submodules --- arch | 2 +- configs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch b/arch index d7d9c92a8fd..8f744224475 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit d7d9c92a8fdf84a14d03b6e1e7c099d4ad623400 +Subproject commit 8f744224475db38ca6403d6c1fb39326ebca6061 diff --git a/configs b/configs index 7bd42035e04..c1419c84912 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit 7bd42035e04fcc31e13b1a0e15e643395a591a69 +Subproject commit c1419c849126f8dc841b74e8103339d32edb85c0 From 5d95abc679de2e8fd64dffe6812335187f2ce2f5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 26 Dec 2015 12:06:05 -0600 Subject: [PATCH 02/29] Update submodules --- arch | 2 +- configs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch b/arch index 8f744224475..00031342595 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 8f744224475db38ca6403d6c1fb39326ebca6061 +Subproject commit 00031342595b03ead4fbf56debee2668e7a5369c diff --git a/configs b/configs index c1419c84912..c8b73b65e56 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit c1419c849126f8dc841b74e8103339d32edb85c0 +Subproject commit c8b73b65e56ababde5cb4eabb272d370fc880ba4 From 658272bbbf34784ee063bdccd8594af64720b808 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 26 Dec 2015 14:49:40 -0600 Subject: [PATCH 03/29] FAT: Fix some duplicate definition warnings when big-endian is enabled --- arch | 2 +- configs | 2 +- fs/fat/fs_fat32.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch b/arch index 00031342595..bc376e70244 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 00031342595b03ead4fbf56debee2668e7a5369c +Subproject commit bc376e70244b491bb8150f15fe9acad0770df703 diff --git a/configs b/configs index c8b73b65e56..77dd18490ec 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit c8b73b65e56ababde5cb4eabb272d370fc880ba4 +Subproject commit 77dd18490ec36d463577878c6c79b694395089f2 diff --git a/fs/fat/fs_fat32.h b/fs/fat/fs_fat32.h index 6c4aa846fd4..5b13b0a6c2a 100644 --- a/fs/fat/fs_fat32.h +++ b/fs/fat/fs_fat32.h @@ -495,7 +495,7 @@ # define LDIR_GETWCHAR6(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR6_11)) # define LDIR_GETWCHAR7(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+2)) # define LDIR_GETWCHAR8(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+4)) -# define LDIR_GETWCHAR8(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+6)) +# define LDIR_GETWCHAR9(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+6)) # define LDIR_GETWCHAR10(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+8)) # define LDIR_GETWCHAR11(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+10)) # define LDIR_GETWCHAR12(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR12_13)) @@ -550,7 +550,7 @@ # define LDIR_PUTWCHAR6(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR6_11),v) # define LDIR_PUTWCHAR7(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+2),v) # define LDIR_PUTWCHAR8(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+4),v) -# define LDIR_PUTWCHAR8(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+6),v) +# define LDIR_PUTWCHAR9(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+6),v) # define LDIR_PUTWCHAR10(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+8),v) # define LDIR_PUTWCHAR11(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+10),v) # define LDIR_PUTWCHAR12(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR12_13),v) From 5206f8430ff79b025f936eca0bdb8e3db72c6e9e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 26 Dec 2015 18:13:25 -0600 Subject: [PATCH 04/29] Update submodules --- arch | 2 +- configs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch b/arch index bc376e70244..126fdebf23f 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit bc376e70244b491bb8150f15fe9acad0770df703 +Subproject commit 126fdebf23f1357342a60269719040d214f59b96 diff --git a/configs b/configs index 77dd18490ec..806cc18a73c 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit 77dd18490ec36d463577878c6c79b694395089f2 +Subproject commit 806cc18a73ca00d153fe992e211ccf0193dbc3f2 From e7c753801d4f2c1f083a8a071153a51822e3d675 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 28 Dec 2015 16:22:04 -0600 Subject: [PATCH 05/29] Update submodules --- arch | 2 +- configs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch b/arch index 126fdebf23f..b4b388d0c28 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 126fdebf23f1357342a60269719040d214f59b96 +Subproject commit b4b388d0c280ebe5790a6137871269b01f41bf81 diff --git a/configs b/configs index 806cc18a73c..0c2dacaf636 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit 806cc18a73ca00d153fe992e211ccf0193dbc3f2 +Subproject commit 0c2dacaf636ddbc33f33823ff068e7f6320a78fc From fc30b31ed39066e67f39018027847dc3d17fec66 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 29 Dec 2015 13:05:34 -0600 Subject: [PATCH 06/29] Update ChangeLog --- ChangeLog | 5 +++++ Documentation | 2 +- README.txt | 2 ++ arch | 2 +- configs | 2 +- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba3080c4283..80e9b514997 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11253,3 +11253,8 @@ (2015-12-23). * arch/arm/src/stm32: Add timer input capture driver. From Pierre-Noel Bouteville (2015-12-24). + * arch/avr: Add support for the Atmega2560. From Dimitry Kloper + (2015-12-19). + * configs/arduino-mega2560: Add support for the Arduino-Mega2560. From + Dimitry Koper (2015-12-29). + diff --git a/Documentation b/Documentation index fad904fdf95..601bc2284cb 160000 --- a/Documentation +++ b/Documentation @@ -1 +1 @@ -Subproject commit fad904fdf955e20b9c96d51abe10df13eafc645d +Subproject commit 601bc2284cb4ff212ae6f1bb09cb9e0733bd1b38 diff --git a/README.txt b/README.txt index da9540d0d68..48fcea63963 100644 --- a/README.txt +++ b/README.txt @@ -1256,6 +1256,8 @@ nuttx/ |- configs/ | |- amber/ | | `- README.txt + | |- arduino-mega2560/ + | | `- README.txt | |- arduino-due/ | | `- README.txt | |- avr32dev1/ diff --git a/arch b/arch index b4b388d0c28..230f8d050f4 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit b4b388d0c280ebe5790a6137871269b01f41bf81 +Subproject commit 230f8d050f4cb535b4047ba2e5fbea8b50b70671 diff --git a/configs b/configs index 0c2dacaf636..9ab677b8e16 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit 0c2dacaf636ddbc33f33823ff068e7f6320a78fc +Subproject commit 9ab677b8e16ab2d2d1a7ac25893503ce0fadabde From b682190f52c906616556a47f8ab74f5ef1087230 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 29 Dec 2015 17:31:17 -0600 Subject: [PATCH 07/29] Rename all head files in main NuttX repository with names like *internal.h, removing the internal --- ChangeLog | 2 +- Documentation | 2 +- configs | 2 +- drivers/mmcsd/{mmcsd_internal.h => mmcsd.h} | 8 ++++---- drivers/mmcsd/mmcsd_debug.c | 2 +- drivers/mmcsd/mmcsd_sdio.c | 2 +- drivers/mmcsd/mmcsd_spi.c | 2 +- libc/aio/lio_listio.c | 2 +- libc/audio/lib_buffer.c | 2 +- libc/{lib_internal.h => libc.h} | 8 ++++---- libc/math/lib_exp.c | 2 +- libc/math/lib_expf.c | 2 +- libc/math/lib_expl.c | 2 +- libc/math/lib_sqrt.c | 2 +- libc/math/lib_sqrtf.c | 2 +- libc/math/lib_sqrtl.c | 2 +- libc/misc/lib_dbg.c | 2 +- libc/misc/lib_filesem.c | 2 +- libc/misc/lib_ioctl.c | 2 +- libc/misc/lib_sendfile.c | 2 +- libc/misc/lib_stream.c | 2 +- libc/misc/lib_streamsem.c | 2 +- libc/netdb/lib_gethostbyaddr.c | 2 +- libc/netdb/lib_gethostbyaddrr.c | 2 +- libc/netdb/lib_gethostbyname.c | 2 +- libc/netdb/lib_gethostbynamer.c | 2 +- libc/netdb/lib_parsehostfile.c | 2 +- libc/spawn/lib_psfa_addclose.c | 2 +- libc/spawn/lib_psfa_adddup2.c | 2 +- libc/spawn/lib_psfa_addopen.c | 2 +- libc/spawn/lib_psfa_destroy.c | 2 +- libc/stdio/lib_asprintf.c | 2 +- libc/stdio/lib_dtoa.c | 2 +- libc/stdio/lib_fclose.c | 2 +- libc/stdio/lib_fflush.c | 2 +- libc/stdio/lib_fgetc.c | 2 +- libc/stdio/lib_fgetpos.c | 2 +- libc/stdio/lib_fgets.c | 2 +- libc/stdio/lib_fopen.c | 2 +- libc/stdio/lib_fputc.c | 2 +- libc/stdio/lib_fputs.c | 2 +- libc/stdio/lib_fread.c | 2 +- libc/stdio/lib_freopen.c | 2 +- libc/stdio/lib_fseek.c | 2 +- libc/stdio/lib_fsetpos.c | 2 +- libc/stdio/lib_ftell.c | 2 +- libc/stdio/lib_fwrite.c | 2 +- libc/stdio/lib_gets.c | 2 +- libc/stdio/lib_gets_s.c | 2 +- libc/stdio/lib_libdtoa.c | 2 +- libc/stdio/lib_libfflush.c | 2 +- libc/stdio/lib_libfgets.c | 2 +- libc/stdio/lib_libflushall.c | 2 +- libc/stdio/lib_libfread.c | 2 +- libc/stdio/lib_libfwrite.c | 2 +- libc/stdio/lib_libnoflush.c | 2 +- libc/stdio/lib_libsnoflush.c | 2 +- libc/stdio/lib_libsprintf.c | 2 +- libc/stdio/lib_libvsprintf.c | 2 +- libc/stdio/lib_lowinstream.c | 2 +- libc/stdio/lib_lowoutstream.c | 2 +- libc/stdio/lib_meminstream.c | 2 +- libc/stdio/lib_memoutstream.c | 2 +- libc/stdio/lib_memsistream.c | 2 +- libc/stdio/lib_memsostream.c | 2 +- libc/stdio/lib_nullinstream.c | 2 +- libc/stdio/lib_nulloutstream.c | 2 +- libc/stdio/lib_printf.c | 2 +- libc/stdio/lib_puts.c | 2 +- libc/stdio/lib_rawinstream.c | 2 +- libc/stdio/lib_rawoutstream.c | 2 +- libc/stdio/lib_rawsistream.c | 2 +- libc/stdio/lib_rawsostream.c | 2 +- libc/stdio/lib_rdflush.c | 2 +- libc/stdio/lib_snprintf.c | 2 +- libc/stdio/lib_sprintf.c | 2 +- libc/stdio/lib_stdinstream.c | 2 +- libc/stdio/lib_stdoutstream.c | 2 +- libc/stdio/lib_stdsistream.c | 2 +- libc/stdio/lib_stdsostream.c | 2 +- libc/stdio/lib_ungetc.c | 2 +- libc/stdio/lib_vasprintf.c | 2 +- libc/stdio/lib_vdprintf.c | 2 +- libc/stdio/lib_vfprintf.c | 2 +- libc/stdio/lib_vsnprintf.c | 2 +- libc/stdio/lib_vsprintf.c | 2 +- libc/stdio/lib_wrflush.c | 2 +- libc/stdio/lib_zeroinstream.c | 2 +- libc/stdlib/lib_checkbase.c | 2 +- libc/stdlib/lib_strtol.c | 2 +- libc/stdlib/lib_strtoll.c | 2 +- libc/stdlib/lib_strtoul.c | 2 +- libc/stdlib/lib_strtoull.c | 2 +- libc/string/lib_isbasedigit.c | 2 +- libc/string/lib_skipspace.c | 2 +- libc/string/lib_strdup.c | 2 +- libc/string/lib_strndup.c | 2 +- libc/unistd/lib_chdir.c | 2 +- libc/unistd/lib_getcwd.c | 2 +- libnx/nxfonts/{nxfonts_internal.h => nxfonts.h} | 8 ++++---- libnx/nxfonts/nxfonts_bitmaps.c | 2 +- libnx/nxfonts/nxfonts_convert.c | 2 +- libnx/nxfonts/nxfonts_getfont.c | 2 +- libnx/nxtk/{nxtk_internal.h => nxtk.h} | 8 ++++---- libnx/nxtk/nxtk_bitmaptoolbar.c | 2 +- libnx/nxtk/nxtk_bitmapwindow.c | 2 +- libnx/nxtk/nxtk_closetoolbar.c | 2 +- libnx/nxtk/nxtk_closewindow.c | 2 +- libnx/nxtk/nxtk_containerclip.c | 2 +- libnx/nxtk/nxtk_drawframe.c | 2 +- libnx/nxtk/nxtk_events.c | 2 +- libnx/nxtk/nxtk_filltoolbar.c | 2 +- libnx/nxtk/nxtk_filltraptoolbar.c | 2 +- libnx/nxtk/nxtk_filltrapwindow.c | 2 +- libnx/nxtk/nxtk_fillwindow.c | 2 +- libnx/nxtk/nxtk_getposition.c | 2 +- libnx/nxtk/nxtk_gettoolbar.c | 2 +- libnx/nxtk/nxtk_getwindow.c | 2 +- libnx/nxtk/nxtk_lower.c | 2 +- libnx/nxtk/nxtk_movetoolbar.c | 2 +- libnx/nxtk/nxtk_movewindow.c | 2 +- libnx/nxtk/nxtk_opentoolbar.c | 2 +- libnx/nxtk/nxtk_openwindow.c | 2 +- libnx/nxtk/nxtk_raise.c | 2 +- libnx/nxtk/nxtk_setposition.c | 2 +- libnx/nxtk/nxtk_setsize.c | 2 +- libnx/nxtk/nxtk_setsubwindows.c | 2 +- libnx/nxtk/nxtk_subwindowclip.c | 2 +- libnx/nxtk/nxtk_subwindowmove.c | 2 +- libnx/nxtk/nxtk_toolbarbounds.c | 2 +- 130 files changed, 142 insertions(+), 142 deletions(-) rename drivers/mmcsd/{mmcsd_internal.h => mmcsd.h} (96%) rename libc/{lib_internal.h => libc.h} (98%) rename libnx/nxfonts/{nxfonts_internal.h => nxfonts.h} (94%) rename libnx/nxtk/{nxtk_internal.h => nxtk.h} (98%) diff --git a/ChangeLog b/ChangeLog index 80e9b514997..1dd1bee5898 100755 --- a/ChangeLog +++ b/ChangeLog @@ -2741,7 +2741,7 @@ the worker thread, disabling interrupts does not provide protected; Need to disable pre-emption. (2) Fix handling of touch ID and (2) add some logic to prevent certain kinds of data overrun. - * include/nx/nxtk.h and graphics/nx/nxtk/nxtk_internal.h: Move setting + * include/nx/nxtk.h and graphics/nx/nxtk/nxtk.h: Move setting of configuration defaults from the internal header file to a place where other logic can use the defaults. * graphics/nxtk/nxtk_events.c: Fixed an important but in the logic that diff --git a/Documentation b/Documentation index 601bc2284cb..c8259448495 160000 --- a/Documentation +++ b/Documentation @@ -1 +1 @@ -Subproject commit 601bc2284cb4ff212ae6f1bb09cb9e0733bd1b38 +Subproject commit c82594484958132e9267cd7bacb47579874a12ba diff --git a/configs b/configs index 9ab677b8e16..f6782b75481 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit 9ab677b8e16ab2d2d1a7ac25893503ce0fadabde +Subproject commit f6782b75481a49e19709a7e1593d40346716f5e4 diff --git a/drivers/mmcsd/mmcsd_internal.h b/drivers/mmcsd/mmcsd.h similarity index 96% rename from drivers/mmcsd/mmcsd_internal.h rename to drivers/mmcsd/mmcsd.h index 36843685d84..06d91348d02 100644 --- a/drivers/mmcsd/mmcsd_internal.h +++ b/drivers/mmcsd/mmcsd.h @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/mmcsd/mmcsd_internal.h + * drivers/mmcsd/mmcsd.h * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __DRIVERS_MMCSD_MMCSD_INTERNAL_H -#define __DRIVERS_MMCSD_MMCSD_INTERNAL_H +#ifndef __DRIVERS_MMCSD_MMCSD_H +#define __DRIVERS_MMCSD_MMCSD_H /**************************************************************************** * Included Files @@ -102,4 +102,4 @@ EXTERN void mmcsd_dmpcsd(FAR const uint8_t *csd, uint8_t cardtype); #if defined(__cplusplus) } #endif -#endif /* __DRIVERS_MMCSD_MMCSD_INTERNAL_H */ +#endif /* __DRIVERS_MMCSD_MMCSD_H */ diff --git a/drivers/mmcsd/mmcsd_debug.c b/drivers/mmcsd/mmcsd_debug.c index ea3788a29b6..e28b985a025 100644 --- a/drivers/mmcsd/mmcsd_debug.c +++ b/drivers/mmcsd/mmcsd_debug.c @@ -47,7 +47,7 @@ #include #include "mmcsd_csd.h" -#include "mmcsd_internal.h" +#include "mmcsd.h" /**************************************************************************** * Pre-processor Definitions diff --git a/drivers/mmcsd/mmcsd_sdio.c b/drivers/mmcsd/mmcsd_sdio.c index 2a1be9595dd..d8ae4561af7 100644 --- a/drivers/mmcsd/mmcsd_sdio.c +++ b/drivers/mmcsd/mmcsd_sdio.c @@ -65,7 +65,7 @@ #include #include -#include "mmcsd_internal.h" +#include "mmcsd.h" #include "mmcsd_sdio.h" /**************************************************************************** diff --git a/drivers/mmcsd/mmcsd_spi.c b/drivers/mmcsd/mmcsd_spi.c index 64f67a797d7..72196488452 100644 --- a/drivers/mmcsd/mmcsd_spi.c +++ b/drivers/mmcsd/mmcsd_spi.c @@ -59,7 +59,7 @@ #include "mmcsd_spi.h" #include "mmcsd_csd.h" -#include "mmcsd_internal.h" +#include "mmcsd.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/aio/lio_listio.c b/libc/aio/lio_listio.c index 0889fd9b147..b552817e091 100644 --- a/libc/aio/lio_listio.c +++ b/libc/aio/lio_listio.c @@ -45,7 +45,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #include "aio/aio.h" #ifdef CONFIG_FS_AIO diff --git a/libc/audio/lib_buffer.c b/libc/audio/lib_buffer.c index f69a2066ed2..f7e29dd033b 100644 --- a/libc/audio/lib_buffer.c +++ b/libc/audio/lib_buffer.c @@ -52,7 +52,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #if defined(CONFIG_AUDIO) diff --git a/libc/lib_internal.h b/libc/libc.h similarity index 98% rename from libc/lib_internal.h rename to libc/libc.h index 29bbd136f5c..9cb1974fa93 100644 --- a/libc/lib_internal.h +++ b/libc/libc.h @@ -1,5 +1,5 @@ /**************************************************************************** - * libc/lib_internal.h + * libc/libc.h * * Copyright (C) 2007-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __LIBC_LIB_INTERNAL_H -#define __LIBC_LIB_INTERNAL_H +#ifndef __LIBC_LIBC_H +#define __LIBC_LIBC_H /**************************************************************************** * Included Files @@ -233,4 +233,4 @@ ssize_t lib_parse_hostfile(FAR FILE *stream, FAR struct hostent *host, } #endif -#endif /* __LIBC_LIB_INTERNAL_H */ +#endif /* __LIBC_LIBC_H */ diff --git a/libc/math/lib_exp.c b/libc/math/lib_exp.c index 738bd3f76bc..211b23bf952 100644 --- a/libc/math/lib_exp.c +++ b/libc/math/lib_exp.c @@ -35,7 +35,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #ifdef CONFIG_HAVE_DOUBLE diff --git a/libc/math/lib_expf.c b/libc/math/lib_expf.c index 36788b60add..4ce5208607b 100644 --- a/libc/math/lib_expf.c +++ b/libc/math/lib_expf.c @@ -32,7 +32,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Data diff --git a/libc/math/lib_expl.c b/libc/math/lib_expl.c index 29f30ecd137..1021017ca32 100644 --- a/libc/math/lib_expl.c +++ b/libc/math/lib_expl.c @@ -35,7 +35,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #ifdef CONFIG_HAVE_LONG_DOUBLE diff --git a/libc/math/lib_sqrt.c b/libc/math/lib_sqrt.c index 7a3af561c66..8540744d21d 100644 --- a/libc/math/lib_sqrt.c +++ b/libc/math/lib_sqrt.c @@ -35,7 +35,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Public Functions diff --git a/libc/math/lib_sqrtf.c b/libc/math/lib_sqrtf.c index 0e9a55ac24f..e1a107eb8b9 100644 --- a/libc/math/lib_sqrtf.c +++ b/libc/math/lib_sqrtf.c @@ -35,7 +35,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Public Functions diff --git a/libc/math/lib_sqrtl.c b/libc/math/lib_sqrtl.c index 15280a83f9c..03a564f72d9 100644 --- a/libc/math/lib_sqrtl.c +++ b/libc/math/lib_sqrtl.c @@ -35,7 +35,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Public Functions diff --git a/libc/misc/lib_dbg.c b/libc/misc/lib_dbg.c index aa0b857bb18..14044175b79 100644 --- a/libc/misc/lib_dbg.c +++ b/libc/misc/lib_dbg.c @@ -42,7 +42,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #ifndef CONFIG_CPP_HAVE_VARARGS diff --git a/libc/misc/lib_filesem.c b/libc/misc/lib_filesem.c index da52b5ae367..2fd5d1c9ebf 100644 --- a/libc/misc/lib_filesem.c +++ b/libc/misc/lib_filesem.c @@ -45,7 +45,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #if CONFIG_STDIO_BUFFER_SIZE > 0 diff --git a/libc/misc/lib_ioctl.c b/libc/misc/lib_ioctl.c index fa0d908042f..0e7ca015d33 100644 --- a/libc/misc/lib_ioctl.c +++ b/libc/misc/lib_ioctl.c @@ -46,7 +46,7 @@ #include -#include "lib_internal.h" +#include "libc.h" #if defined(CONFIG_LIBC_IOCTL_VARIADIC) && CONFIG_NFILE_DESCRIPTORS > 0 diff --git a/libc/misc/lib_sendfile.c b/libc/misc/lib_sendfile.c index 4fa19b66a73..2313833dc77 100644 --- a/libc/misc/lib_sendfile.c +++ b/libc/misc/lib_sendfile.c @@ -45,7 +45,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #if CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0 diff --git a/libc/misc/lib_stream.c b/libc/misc/lib_stream.c index 2ad3cd740e6..f42b040cbbe 100644 --- a/libc/misc/lib_stream.c +++ b/libc/misc/lib_stream.c @@ -48,7 +48,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #if (!defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_BUILD_KERNEL)) || \ defined(__KERNEL__) diff --git a/libc/misc/lib_streamsem.c b/libc/misc/lib_streamsem.c index a403b710287..9f26d96a722 100644 --- a/libc/misc/lib_streamsem.c +++ b/libc/misc/lib_streamsem.c @@ -46,7 +46,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private types diff --git a/libc/netdb/lib_gethostbyaddr.c b/libc/netdb/lib_gethostbyaddr.c index 46c4d6dd56c..c06f1654047 100644 --- a/libc/netdb/lib_gethostbyaddr.c +++ b/libc/netdb/lib_gethostbyaddr.c @@ -42,7 +42,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #include "netdb/lib_netdb.h" #ifdef CONFIG_NETDB_HOSTFILE diff --git a/libc/netdb/lib_gethostbyaddrr.c b/libc/netdb/lib_gethostbyaddrr.c index 812b1fedb9e..6dcb8e8ab1d 100644 --- a/libc/netdb/lib_gethostbyaddrr.c +++ b/libc/netdb/lib_gethostbyaddrr.c @@ -48,7 +48,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #include "netdb/lib_netdb.h" #ifdef CONFIG_NETDB_HOSTFILE diff --git a/libc/netdb/lib_gethostbyname.c b/libc/netdb/lib_gethostbyname.c index 4aae74a204e..aa492db7792 100644 --- a/libc/netdb/lib_gethostbyname.c +++ b/libc/netdb/lib_gethostbyname.c @@ -42,7 +42,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #include "netdb/lib_netdb.h" #ifdef CONFIG_LIBC_NETDB diff --git a/libc/netdb/lib_gethostbynamer.c b/libc/netdb/lib_gethostbynamer.c index 6b005743cfc..747cf6a0c58 100644 --- a/libc/netdb/lib_gethostbynamer.c +++ b/libc/netdb/lib_gethostbynamer.c @@ -53,7 +53,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #include "netdb/lib_dns.h" #ifdef CONFIG_LIBC_NETDB diff --git a/libc/netdb/lib_parsehostfile.c b/libc/netdb/lib_parsehostfile.c index 177c00a3f39..0e2c5bdeff3 100644 --- a/libc/netdb/lib_parsehostfile.c +++ b/libc/netdb/lib_parsehostfile.c @@ -50,7 +50,7 @@ #include -#include "lib_internal.h" +#include "libc.h" #ifdef CONFIG_NETDB_HOSTFILE diff --git a/libc/spawn/lib_psfa_addclose.c b/libc/spawn/lib_psfa_addclose.c index eaf3e088923..3ee6f19083a 100644 --- a/libc/spawn/lib_psfa_addclose.c +++ b/libc/spawn/lib_psfa_addclose.c @@ -46,7 +46,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Public Functions diff --git a/libc/spawn/lib_psfa_adddup2.c b/libc/spawn/lib_psfa_adddup2.c index 5b4833c5b04..6473476275c 100644 --- a/libc/spawn/lib_psfa_adddup2.c +++ b/libc/spawn/lib_psfa_adddup2.c @@ -46,7 +46,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Public Functions diff --git a/libc/spawn/lib_psfa_addopen.c b/libc/spawn/lib_psfa_addopen.c index 4bb096efb76..7f22c06af8d 100644 --- a/libc/spawn/lib_psfa_addopen.c +++ b/libc/spawn/lib_psfa_addopen.c @@ -47,7 +47,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Public Functions diff --git a/libc/spawn/lib_psfa_destroy.c b/libc/spawn/lib_psfa_destroy.c index e4020304b1e..73a5ea25f5b 100644 --- a/libc/spawn/lib_psfa_destroy.c +++ b/libc/spawn/lib_psfa_destroy.c @@ -45,7 +45,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Public Functions diff --git a/libc/stdio/lib_asprintf.c b/libc/stdio/lib_asprintf.c index 09e6f42e93e..d61059f5b59 100644 --- a/libc/stdio/lib_asprintf.c +++ b/libc/stdio/lib_asprintf.c @@ -40,7 +40,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_dtoa.c b/libc/stdio/lib_dtoa.c index 68ae7b2098a..e3452126d86 100644 --- a/libc/stdio/lib_dtoa.c +++ b/libc/stdio/lib_dtoa.c @@ -48,7 +48,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_fclose.c b/libc/stdio/lib_fclose.c index ff54efba4c1..35301fc6bb4 100644 --- a/libc/stdio/lib_fclose.c +++ b/libc/stdio/lib_fclose.c @@ -45,7 +45,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Public Functions diff --git a/libc/stdio/lib_fflush.c b/libc/stdio/lib_fflush.c index bb3d0313cdb..d56f8fb75c6 100644 --- a/libc/stdio/lib_fflush.c +++ b/libc/stdio/lib_fflush.c @@ -46,7 +46,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_fgetc.c b/libc/stdio/lib_fgetc.c index 022aed1dcca..15ccb893dd9 100644 --- a/libc/stdio/lib_fgetc.c +++ b/libc/stdio/lib_fgetc.c @@ -42,7 +42,7 @@ ****************************************************************************/ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_fgetpos.c b/libc/stdio/lib_fgetpos.c index e2c4d0c6966..ea49abb2ce4 100644 --- a/libc/stdio/lib_fgetpos.c +++ b/libc/stdio/lib_fgetpos.c @@ -47,7 +47,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_fgets.c b/libc/stdio/lib_fgets.c index 88dfca3ad1a..bce8261e6e4 100644 --- a/libc/stdio/lib_fgets.c +++ b/libc/stdio/lib_fgets.c @@ -41,7 +41,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_fopen.c b/libc/stdio/lib_fopen.c index 957e439b191..b7208dba5fb 100644 --- a/libc/stdio/lib_fopen.c +++ b/libc/stdio/lib_fopen.c @@ -47,7 +47,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_fputc.c b/libc/stdio/lib_fputc.c index f434d442e26..9ba40a6e7da 100644 --- a/libc/stdio/lib_fputc.c +++ b/libc/stdio/lib_fputc.c @@ -42,7 +42,7 @@ ****************************************************************************/ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_fputs.c b/libc/stdio/lib_fputs.c index a1bcd89c3d5..033ff3b9b3f 100644 --- a/libc/stdio/lib_fputs.c +++ b/libc/stdio/lib_fputs.c @@ -49,7 +49,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_fread.c b/libc/stdio/lib_fread.c index 9c8b2d378a3..6acb9d7e771 100644 --- a/libc/stdio/lib_fread.c +++ b/libc/stdio/lib_fread.c @@ -42,7 +42,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_freopen.c b/libc/stdio/lib_freopen.c index f90546067e5..830ea9a78f5 100644 --- a/libc/stdio/lib_freopen.c +++ b/libc/stdio/lib_freopen.c @@ -43,7 +43,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Public Functions diff --git a/libc/stdio/lib_fseek.c b/libc/stdio/lib_fseek.c index f09155dc0ab..1016d8b37f9 100644 --- a/libc/stdio/lib_fseek.c +++ b/libc/stdio/lib_fseek.c @@ -49,7 +49,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_fsetpos.c b/libc/stdio/lib_fsetpos.c index 71093d4ce86..681aa514f9a 100644 --- a/libc/stdio/lib_fsetpos.c +++ b/libc/stdio/lib_fsetpos.c @@ -49,7 +49,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_ftell.c b/libc/stdio/lib_ftell.c index c72e4e1b85b..c13e64c9aef 100644 --- a/libc/stdio/lib_ftell.c +++ b/libc/stdio/lib_ftell.c @@ -49,7 +49,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_fwrite.c b/libc/stdio/lib_fwrite.c index ed2dce16d8a..941120ae6d2 100644 --- a/libc/stdio/lib_fwrite.c +++ b/libc/stdio/lib_fwrite.c @@ -42,7 +42,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_gets.c b/libc/stdio/lib_gets.c index f793fbc4452..e8573edca90 100644 --- a/libc/stdio/lib_gets.c +++ b/libc/stdio/lib_gets.c @@ -42,7 +42,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_gets_s.c b/libc/stdio/lib_gets_s.c index a5a4c50059b..d811bdfcfcb 100644 --- a/libc/stdio/lib_gets_s.c +++ b/libc/stdio/lib_gets_s.c @@ -42,7 +42,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_libdtoa.c b/libc/stdio/lib_libdtoa.c index 95a5dcc70bd..995b0d72c41 100644 --- a/libc/stdio/lib_libdtoa.c +++ b/libc/stdio/lib_libdtoa.c @@ -46,7 +46,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_libfflush.c b/libc/stdio/lib_libfflush.c index ff9aaece4b4..4eebac409df 100644 --- a/libc/stdio/lib_libfflush.c +++ b/libc/stdio/lib_libfflush.c @@ -47,7 +47,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_libfgets.c b/libc/stdio/lib_libfgets.c index 884cc1f535f..4c3c41db059 100644 --- a/libc/stdio/lib_libfgets.c +++ b/libc/stdio/lib_libfgets.c @@ -47,7 +47,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_libflushall.c b/libc/stdio/lib_libflushall.c index 85e807a9eaf..e040d2deb60 100644 --- a/libc/stdio/lib_libflushall.c +++ b/libc/stdio/lib_libflushall.c @@ -45,7 +45,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_libfread.c b/libc/stdio/lib_libfread.c index 48ab4ad4cf5..e4ad730e265 100644 --- a/libc/stdio/lib_libfread.c +++ b/libc/stdio/lib_libfread.c @@ -46,7 +46,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_libfwrite.c b/libc/stdio/lib_libfwrite.c index 76c8d72797f..12bfd033c87 100644 --- a/libc/stdio/lib_libfwrite.c +++ b/libc/stdio/lib_libfwrite.c @@ -46,7 +46,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_libnoflush.c b/libc/stdio/lib_libnoflush.c index 63e4d529500..6ad372a6537 100644 --- a/libc/stdio/lib_libnoflush.c +++ b/libc/stdio/lib_libnoflush.c @@ -47,7 +47,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #ifdef CONFIG_STDIO_LINEBUFFER diff --git a/libc/stdio/lib_libsnoflush.c b/libc/stdio/lib_libsnoflush.c index 1e5af1474b2..809356f1447 100644 --- a/libc/stdio/lib_libsnoflush.c +++ b/libc/stdio/lib_libsnoflush.c @@ -46,7 +46,7 @@ #include -#include "lib_internal.h" +#include "libc.h" #ifdef CONFIG_STDIO_LINEBUFFER diff --git a/libc/stdio/lib_libsprintf.c b/libc/stdio/lib_libsprintf.c index 1d8abbced70..baa493c7a73 100644 --- a/libc/stdio/lib_libsprintf.c +++ b/libc/stdio/lib_libsprintf.c @@ -38,7 +38,7 @@ ****************************************************************************/ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_libvsprintf.c b/libc/stdio/lib_libvsprintf.c index 634b172ad00..6c1b2958111 100644 --- a/libc/stdio/lib_libvsprintf.c +++ b/libc/stdio/lib_libvsprintf.c @@ -46,7 +46,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_lowinstream.c b/libc/stdio/lib_lowinstream.c index 8c11fee9072..8964b56749d 100644 --- a/libc/stdio/lib_lowinstream.c +++ b/libc/stdio/lib_lowinstream.c @@ -45,7 +45,7 @@ #include -#include "lib_internal.h" +#include "libc.h" #ifdef CONFIG_ARCH_LOWGETC diff --git a/libc/stdio/lib_lowoutstream.c b/libc/stdio/lib_lowoutstream.c index f600bc614a0..91604c90c49 100644 --- a/libc/stdio/lib_lowoutstream.c +++ b/libc/stdio/lib_lowoutstream.c @@ -46,7 +46,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdio/lib_meminstream.c b/libc/stdio/lib_meminstream.c index 195b294e4d7..c975419499e 100644 --- a/libc/stdio/lib_meminstream.c +++ b/libc/stdio/lib_meminstream.c @@ -39,7 +39,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdio/lib_memoutstream.c b/libc/stdio/lib_memoutstream.c index 492661e68aa..1c658512ea9 100644 --- a/libc/stdio/lib_memoutstream.c +++ b/libc/stdio/lib_memoutstream.c @@ -39,7 +39,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdio/lib_memsistream.c b/libc/stdio/lib_memsistream.c index d258c7fde17..af241b4c2ed 100644 --- a/libc/stdio/lib_memsistream.c +++ b/libc/stdio/lib_memsistream.c @@ -39,7 +39,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdio/lib_memsostream.c b/libc/stdio/lib_memsostream.c index 8726ea187ea..6570ef8942b 100644 --- a/libc/stdio/lib_memsostream.c +++ b/libc/stdio/lib_memsostream.c @@ -39,7 +39,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdio/lib_nullinstream.c b/libc/stdio/lib_nullinstream.c index aeb0af3790f..9ca50d6379b 100644 --- a/libc/stdio/lib_nullinstream.c +++ b/libc/stdio/lib_nullinstream.c @@ -40,7 +40,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdio/lib_nulloutstream.c b/libc/stdio/lib_nulloutstream.c index 57429534489..89a5a2524df 100644 --- a/libc/stdio/lib_nulloutstream.c +++ b/libc/stdio/lib_nulloutstream.c @@ -41,7 +41,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdio/lib_printf.c b/libc/stdio/lib_printf.c index b38257f2304..f4289c9b574 100644 --- a/libc/stdio/lib_printf.c +++ b/libc/stdio/lib_printf.c @@ -44,7 +44,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_puts.c b/libc/stdio/lib_puts.c index 4d2ab4c4ede..c30c92aaf42 100644 --- a/libc/stdio/lib_puts.c +++ b/libc/stdio/lib_puts.c @@ -42,7 +42,7 @@ ****************************************************************************/ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_rawinstream.c b/libc/stdio/lib_rawinstream.c index 19a980787d8..913a413bff4 100644 --- a/libc/stdio/lib_rawinstream.c +++ b/libc/stdio/lib_rawinstream.c @@ -41,7 +41,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdio/lib_rawoutstream.c b/libc/stdio/lib_rawoutstream.c index 7f2c5224746..aed1fc5272e 100644 --- a/libc/stdio/lib_rawoutstream.c +++ b/libc/stdio/lib_rawoutstream.c @@ -41,7 +41,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdio/lib_rawsistream.c b/libc/stdio/lib_rawsistream.c index b013e43a80f..d52fad1daf6 100644 --- a/libc/stdio/lib_rawsistream.c +++ b/libc/stdio/lib_rawsistream.c @@ -41,7 +41,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdio/lib_rawsostream.c b/libc/stdio/lib_rawsostream.c index 82db850f787..3c0b96dfa8d 100644 --- a/libc/stdio/lib_rawsostream.c +++ b/libc/stdio/lib_rawsostream.c @@ -41,7 +41,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdio/lib_rdflush.c b/libc/stdio/lib_rdflush.c index 65d37ac3568..27bd25f6fd1 100644 --- a/libc/stdio/lib_rdflush.c +++ b/libc/stdio/lib_rdflush.c @@ -48,7 +48,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_snprintf.c b/libc/stdio/lib_snprintf.c index 63d0b2a5dfd..53e9a2cbcc9 100644 --- a/libc/stdio/lib_snprintf.c +++ b/libc/stdio/lib_snprintf.c @@ -42,7 +42,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_sprintf.c b/libc/stdio/lib_sprintf.c index a0b3321bb1b..5420e1e5390 100644 --- a/libc/stdio/lib_sprintf.c +++ b/libc/stdio/lib_sprintf.c @@ -38,7 +38,7 @@ ****************************************************************************/ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_stdinstream.c b/libc/stdio/lib_stdinstream.c index 240763613fc..f1b5f3da998 100644 --- a/libc/stdio/lib_stdinstream.c +++ b/libc/stdio/lib_stdinstream.c @@ -39,7 +39,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdio/lib_stdoutstream.c b/libc/stdio/lib_stdoutstream.c index 73321c7fdb3..b30e8151608 100644 --- a/libc/stdio/lib_stdoutstream.c +++ b/libc/stdio/lib_stdoutstream.c @@ -41,7 +41,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdio/lib_stdsistream.c b/libc/stdio/lib_stdsistream.c index 0999f851324..b569bb41222 100644 --- a/libc/stdio/lib_stdsistream.c +++ b/libc/stdio/lib_stdsistream.c @@ -39,7 +39,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdio/lib_stdsostream.c b/libc/stdio/lib_stdsostream.c index ade6369c51c..4e196b1a22b 100644 --- a/libc/stdio/lib_stdsostream.c +++ b/libc/stdio/lib_stdsostream.c @@ -41,7 +41,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdio/lib_ungetc.c b/libc/stdio/lib_ungetc.c index c8baf9a2660..4ae4bc69b12 100644 --- a/libc/stdio/lib_ungetc.c +++ b/libc/stdio/lib_ungetc.c @@ -46,7 +46,7 @@ #include #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_vasprintf.c b/libc/stdio/lib_vasprintf.c index f7b24027123..53e0a157069 100644 --- a/libc/stdio/lib_vasprintf.c +++ b/libc/stdio/lib_vasprintf.c @@ -42,7 +42,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_vdprintf.c b/libc/stdio/lib_vdprintf.c index d96ca40f88f..26959b5de82 100644 --- a/libc/stdio/lib_vdprintf.c +++ b/libc/stdio/lib_vdprintf.c @@ -42,7 +42,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Public Functions diff --git a/libc/stdio/lib_vfprintf.c b/libc/stdio/lib_vfprintf.c index 8681b2151d1..328fc42f82b 100644 --- a/libc/stdio/lib_vfprintf.c +++ b/libc/stdio/lib_vfprintf.c @@ -42,7 +42,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_vsnprintf.c b/libc/stdio/lib_vsnprintf.c index 5fd300f7fe3..ad329e173e0 100644 --- a/libc/stdio/lib_vsnprintf.c +++ b/libc/stdio/lib_vsnprintf.c @@ -42,7 +42,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_vsprintf.c b/libc/stdio/lib_vsprintf.c index 57589cef565..0ad85086bf2 100644 --- a/libc/stdio/lib_vsprintf.c +++ b/libc/stdio/lib_vsprintf.c @@ -41,7 +41,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_wrflush.c b/libc/stdio/lib_wrflush.c index 0587e417ebc..0ccd007c6b5 100644 --- a/libc/stdio/lib_wrflush.c +++ b/libc/stdio/lib_wrflush.c @@ -43,7 +43,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libc/stdio/lib_zeroinstream.c b/libc/stdio/lib_zeroinstream.c index a52ecc1d069..506d0058717 100644 --- a/libc/stdio/lib_zeroinstream.c +++ b/libc/stdio/lib_zeroinstream.c @@ -39,7 +39,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdlib/lib_checkbase.c b/libc/stdlib/lib_checkbase.c index 83199bcfaed..05abe7b8968 100644 --- a/libc/stdlib/lib_checkbase.c +++ b/libc/stdlib/lib_checkbase.c @@ -42,7 +42,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdlib/lib_strtol.c b/libc/stdlib/lib_strtol.c index 55181729491..8c7f639901c 100644 --- a/libc/stdlib/lib_strtol.c +++ b/libc/stdlib/lib_strtol.c @@ -42,7 +42,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdlib/lib_strtoll.c b/libc/stdlib/lib_strtoll.c index 7ed5ecab20b..bc8cc2eb6f4 100644 --- a/libc/stdlib/lib_strtoll.c +++ b/libc/stdlib/lib_strtoll.c @@ -42,7 +42,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #ifdef CONFIG_HAVE_LONG_LONG diff --git a/libc/stdlib/lib_strtoul.c b/libc/stdlib/lib_strtoul.c index 712a658e267..3dfe5a5e60b 100644 --- a/libc/stdlib/lib_strtoul.c +++ b/libc/stdlib/lib_strtoul.c @@ -41,7 +41,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/stdlib/lib_strtoull.c b/libc/stdlib/lib_strtoull.c index 169058128ab..82adc0450ac 100644 --- a/libc/stdlib/lib_strtoull.c +++ b/libc/stdlib/lib_strtoull.c @@ -42,7 +42,7 @@ #include -#include "lib_internal.h" +#include "libc.h" #ifdef CONFIG_HAVE_LONG_LONG diff --git a/libc/string/lib_isbasedigit.c b/libc/string/lib_isbasedigit.c index dff81388113..e72e33de5cf 100644 --- a/libc/string/lib_isbasedigit.c +++ b/libc/string/lib_isbasedigit.c @@ -43,7 +43,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/string/lib_skipspace.c b/libc/string/lib_skipspace.c index 4b72b1ec378..602c03a2742 100644 --- a/libc/string/lib_skipspace.c +++ b/libc/string/lib_skipspace.c @@ -41,7 +41,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Private Functions diff --git a/libc/string/lib_strdup.c b/libc/string/lib_strdup.c index ab5c620a121..4da233d1637 100644 --- a/libc/string/lib_strdup.c +++ b/libc/string/lib_strdup.c @@ -41,7 +41,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Public Functions diff --git a/libc/string/lib_strndup.c b/libc/string/lib_strndup.c index 984b363944f..1c097de81a0 100644 --- a/libc/string/lib_strndup.c +++ b/libc/string/lib_strndup.c @@ -41,7 +41,7 @@ #include -#include "lib_internal.h" +#include "libc.h" /**************************************************************************** * Public Functions diff --git a/libc/unistd/lib_chdir.c b/libc/unistd/lib_chdir.c index 87353b546d4..4780a6b72e9 100644 --- a/libc/unistd/lib_chdir.c +++ b/libc/unistd/lib_chdir.c @@ -45,7 +45,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_ENVIRON) diff --git a/libc/unistd/lib_getcwd.c b/libc/unistd/lib_getcwd.c index 9a25399996c..851d380fb6c 100644 --- a/libc/unistd/lib_getcwd.c +++ b/libc/unistd/lib_getcwd.c @@ -45,7 +45,7 @@ #include #include -#include "lib_internal.h" +#include "libc.h" #if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_ENVIRON) diff --git a/libnx/nxfonts/nxfonts_internal.h b/libnx/nxfonts/nxfonts.h similarity index 94% rename from libnx/nxfonts/nxfonts_internal.h rename to libnx/nxfonts/nxfonts.h index 7fccd5ab4e1..1e3fa18bb3f 100644 --- a/libnx/nxfonts/nxfonts_internal.h +++ b/libnx/nxfonts/nxfonts.h @@ -1,5 +1,5 @@ /**************************************************************************** - * libnx/nxfonts/nxfonts_internal.h + * libnx/nxfonts/nxfonts.h * * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __LIBNX_NXFONTS_NXFONTS_INTERNAL_H -#define __LIBNX_NXFONTS_NXFONTS_INTERNAL_H +#ifndef __LIBNX_NXFONTS_NXFONTS_H +#define __LIBNX_NXFONTS_NXFONTS_H /**************************************************************************** * Included Files @@ -85,4 +85,4 @@ EXTERN struct nx_font_s g_fonts; } #endif -#endif /* __LIBNX_NXFONTS_NXFONTS_INTERNAL_H */ +#endif /* __LIBNX_NXFONTS_NXFONTS_H */ diff --git a/libnx/nxfonts/nxfonts_bitmaps.c b/libnx/nxfonts/nxfonts_bitmaps.c index 0a71faacfed..28e6aa18dcc 100644 --- a/libnx/nxfonts/nxfonts_bitmaps.c +++ b/libnx/nxfonts/nxfonts_bitmaps.c @@ -42,7 +42,7 @@ #include #include -#include "nxfonts_internal.h" +#include "nxfonts.h" /* Pick the fontset */ diff --git a/libnx/nxfonts/nxfonts_convert.c b/libnx/nxfonts/nxfonts_convert.c index a223c7f0a99..6d3b5a71e2c 100644 --- a/libnx/nxfonts/nxfonts_convert.c +++ b/libnx/nxfonts/nxfonts_convert.c @@ -46,7 +46,7 @@ #include #include -#include "nxfonts_internal.h" +#include "nxfonts.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxfonts/nxfonts_getfont.c b/libnx/nxfonts/nxfonts_getfont.c index fe443138df1..c52c082281c 100644 --- a/libnx/nxfonts/nxfonts_getfont.c +++ b/libnx/nxfonts/nxfonts_getfont.c @@ -46,7 +46,7 @@ #include #include -#include "nxfonts_internal.h" +#include "nxfonts.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_internal.h b/libnx/nxtk/nxtk.h similarity index 98% rename from libnx/nxtk/nxtk_internal.h rename to libnx/nxtk/nxtk.h index 7a62293413b..44d507ee015 100644 --- a/libnx/nxtk/nxtk_internal.h +++ b/libnx/nxtk/nxtk.h @@ -1,5 +1,5 @@ /**************************************************************************** - * libnx/nxtk/nxtk_internal.h + * libnx/nxtk/nxtk.h * * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __LIBNX_NXTK_NXTK_INTERNAL_H -#define __LIBNX_NXTK_NXTK_INTERNAL_H +#ifndef __LIBNX_NXTK_NXTK_H +#define __LIBNX_NXTK_NXTK_H /**************************************************************************** * Included Files @@ -222,4 +222,4 @@ int nxtk_drawframe(FAR struct nxtk_framedwindow_s *fwnd, } #endif -#endif /* __LIBNX_NXTK_NXTK_INTERNAL_H */ +#endif /* __LIBNX_NXTK_NXTK_H */ diff --git a/libnx/nxtk/nxtk_bitmaptoolbar.c b/libnx/nxtk/nxtk_bitmaptoolbar.c index abeb14d184f..abc1815b8f7 100644 --- a/libnx/nxtk/nxtk_bitmaptoolbar.c +++ b/libnx/nxtk/nxtk_bitmaptoolbar.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_bitmapwindow.c b/libnx/nxtk/nxtk_bitmapwindow.c index da814fe10ae..59a8776b626 100644 --- a/libnx/nxtk/nxtk_bitmapwindow.c +++ b/libnx/nxtk/nxtk_bitmapwindow.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_closetoolbar.c b/libnx/nxtk/nxtk_closetoolbar.c index 8f65a75a841..7be217d18de 100644 --- a/libnx/nxtk/nxtk_closetoolbar.c +++ b/libnx/nxtk/nxtk_closetoolbar.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_closewindow.c b/libnx/nxtk/nxtk_closewindow.c index 7bda3ff06b8..54857521305 100644 --- a/libnx/nxtk/nxtk_closewindow.c +++ b/libnx/nxtk/nxtk_closewindow.c @@ -47,7 +47,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_containerclip.c b/libnx/nxtk/nxtk_containerclip.c index 12dc4987b3f..67ed6cb17b1 100644 --- a/libnx/nxtk/nxtk_containerclip.c +++ b/libnx/nxtk/nxtk_containerclip.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_drawframe.c b/libnx/nxtk/nxtk_drawframe.c index ae0be64425f..adafccc5744 100644 --- a/libnx/nxtk/nxtk_drawframe.c +++ b/libnx/nxtk/nxtk_drawframe.c @@ -47,7 +47,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_events.c b/libnx/nxtk/nxtk_events.c index 33d496e19a5..d7f33e6ebed 100644 --- a/libnx/nxtk/nxtk_events.c +++ b/libnx/nxtk/nxtk_events.c @@ -48,7 +48,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libnx/nxtk/nxtk_filltoolbar.c b/libnx/nxtk/nxtk_filltoolbar.c index 13de3724982..0d62eaaf84e 100644 --- a/libnx/nxtk/nxtk_filltoolbar.c +++ b/libnx/nxtk/nxtk_filltoolbar.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_filltraptoolbar.c b/libnx/nxtk/nxtk_filltraptoolbar.c index a55d05e7e97..1b7ae272770 100644 --- a/libnx/nxtk/nxtk_filltraptoolbar.c +++ b/libnx/nxtk/nxtk_filltraptoolbar.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_filltrapwindow.c b/libnx/nxtk/nxtk_filltrapwindow.c index 66aef4184f1..bbfba26599e 100644 --- a/libnx/nxtk/nxtk_filltrapwindow.c +++ b/libnx/nxtk/nxtk_filltrapwindow.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_fillwindow.c b/libnx/nxtk/nxtk_fillwindow.c index 77f043391c8..fa0fd8d8f24 100644 --- a/libnx/nxtk/nxtk_fillwindow.c +++ b/libnx/nxtk/nxtk_fillwindow.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_getposition.c b/libnx/nxtk/nxtk_getposition.c index a0b21bedba6..1f0bdceeef7 100644 --- a/libnx/nxtk/nxtk_getposition.c +++ b/libnx/nxtk/nxtk_getposition.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_gettoolbar.c b/libnx/nxtk/nxtk_gettoolbar.c index a83a1aa3e62..593fcb09a63 100644 --- a/libnx/nxtk/nxtk_gettoolbar.c +++ b/libnx/nxtk/nxtk_gettoolbar.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_getwindow.c b/libnx/nxtk/nxtk_getwindow.c index a91ad05fc6b..b2294599737 100644 --- a/libnx/nxtk/nxtk_getwindow.c +++ b/libnx/nxtk/nxtk_getwindow.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_lower.c b/libnx/nxtk/nxtk_lower.c index de26ac509b6..08a588897d9 100644 --- a/libnx/nxtk/nxtk_lower.c +++ b/libnx/nxtk/nxtk_lower.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_movetoolbar.c b/libnx/nxtk/nxtk_movetoolbar.c index 275bb46e660..62d14e7bf85 100644 --- a/libnx/nxtk/nxtk_movetoolbar.c +++ b/libnx/nxtk/nxtk_movetoolbar.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_movewindow.c b/libnx/nxtk/nxtk_movewindow.c index 66aed9d16a7..2b34f44a8b6 100644 --- a/libnx/nxtk/nxtk_movewindow.c +++ b/libnx/nxtk/nxtk_movewindow.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_opentoolbar.c b/libnx/nxtk/nxtk_opentoolbar.c index ffdf629013f..26aa4c504f7 100644 --- a/libnx/nxtk/nxtk_opentoolbar.c +++ b/libnx/nxtk/nxtk_opentoolbar.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_openwindow.c b/libnx/nxtk/nxtk_openwindow.c index c7c050b8dad..796a57d3b70 100644 --- a/libnx/nxtk/nxtk_openwindow.c +++ b/libnx/nxtk/nxtk_openwindow.c @@ -46,7 +46,7 @@ #include #include "nxcontext.h" -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_raise.c b/libnx/nxtk/nxtk_raise.c index 2b54f81cb6f..d0273fe7048 100644 --- a/libnx/nxtk/nxtk_raise.c +++ b/libnx/nxtk/nxtk_raise.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_setposition.c b/libnx/nxtk/nxtk_setposition.c index f3ba1187269..ed856252720 100644 --- a/libnx/nxtk/nxtk_setposition.c +++ b/libnx/nxtk/nxtk_setposition.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_setsize.c b/libnx/nxtk/nxtk_setsize.c index 671aa805406..8848c717200 100644 --- a/libnx/nxtk/nxtk_setsize.c +++ b/libnx/nxtk/nxtk_setsize.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_setsubwindows.c b/libnx/nxtk/nxtk_setsubwindows.c index 5ebd5f2be74..943825a8b01 100644 --- a/libnx/nxtk/nxtk_setsubwindows.c +++ b/libnx/nxtk/nxtk_setsubwindows.c @@ -45,7 +45,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-processor Definitions diff --git a/libnx/nxtk/nxtk_subwindowclip.c b/libnx/nxtk/nxtk_subwindowclip.c index b2688a543d2..b1b4024ee7e 100644 --- a/libnx/nxtk/nxtk_subwindowclip.c +++ b/libnx/nxtk/nxtk_subwindowclip.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_subwindowmove.c b/libnx/nxtk/nxtk_subwindowmove.c index 6ae737b5804..6b80609d3da 100644 --- a/libnx/nxtk/nxtk_subwindowmove.c +++ b/libnx/nxtk/nxtk_subwindowmove.c @@ -46,7 +46,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions diff --git a/libnx/nxtk/nxtk_toolbarbounds.c b/libnx/nxtk/nxtk_toolbarbounds.c index 6303b4d20de..eacaf905731 100644 --- a/libnx/nxtk/nxtk_toolbarbounds.c +++ b/libnx/nxtk/nxtk_toolbarbounds.c @@ -45,7 +45,7 @@ #include #include -#include "nxtk_internal.h" +#include "nxtk.h" /**************************************************************************** * Pre-Processor Definitions From 695a8890a6ab9af24f34132ebc46d16ac427985c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 29 Dec 2015 18:19:03 -0600 Subject: [PATCH 08/29] Rename pm_internal.h to pm.h --- ChangeLog | 2 +- arch | 2 +- configs | 2 +- drivers/power/{pm_internal.h => pm.h} | 8 ++++---- drivers/power/pm_activity.c | 2 +- drivers/power/pm_changestate.c | 2 +- drivers/power/pm_checkstate.c | 2 +- drivers/power/pm_initialize.c | 2 +- drivers/power/pm_register.c | 2 +- drivers/power/pm_update.c | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) rename drivers/power/{pm_internal.h => pm.h} (97%) diff --git a/ChangeLog b/ChangeLog index 1dd1bee5898..a110b5a06ca 100755 --- a/ChangeLog +++ b/ChangeLog @@ -4680,7 +4680,7 @@ * arch/arm/src/kl/kl_gpio.c and .h, configs/freedom-kl25z/src/freedom-kl25z.h, and configs/freedom-kl25z/src/kl_led.c: Fixes LEDs on the Freedom KL25Z board (2013-5-6). - * arch/arm/src/kinetis/kinetis_pin.c and arch/arm/src/kinetis/kinetis_internal.h: + * arch/arm/src/kinetis/kinetis_pin.c and arch/arm/src/kinetis/kinetis.h: The Kinetis GPIO logic had some of the same issues as did the Kinetis L (2013-5-6). * arch/arm/src/stm32/stm32_idle.c: Add an option to conditionally disable diff --git a/arch b/arch index 230f8d050f4..4e962ff8a0a 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 230f8d050f4cb535b4047ba2e5fbea8b50b70671 +Subproject commit 4e962ff8a0a2f15247232d7e9aef89032c9b2898 diff --git a/configs b/configs index f6782b75481..05b30849130 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit f6782b75481a49e19709a7e1593d40346716f5e4 +Subproject commit 05b30849130f836b352cc84196b2369679fbe5ec diff --git a/drivers/power/pm_internal.h b/drivers/power/pm.h similarity index 97% rename from drivers/power/pm_internal.h rename to drivers/power/pm.h index 6499c65eaf6..8ed66d3d301 100644 --- a/drivers/power/pm_internal.h +++ b/drivers/power/pm.h @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/power/pm_internal.h + * drivers/power/pm * * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __DRIVERS_POWER_PM_INTERNAL_H -#define __DRIVERS_POWER_PM_INTERNAL_H +#ifndef __DRIVERS_POWER_PM_H +#define __DRIVERS_POWER_PM_H /**************************************************************************** * Included Files @@ -207,4 +207,4 @@ EXTERN void pm_update(int16_t accum); #endif #endif /* CONFIG_PM */ -#endif /* #define __DRIVERS_POWER_PM_INTERNAL_H */ +#endif /* #define __DRIVERS_POWER_PM_H */ diff --git a/drivers/power/pm_activity.c b/drivers/power/pm_activity.c index f6dceeea373..d80315605c4 100644 --- a/drivers/power/pm_activity.c +++ b/drivers/power/pm_activity.c @@ -43,7 +43,7 @@ #include #include -#include "pm_internal.h" +#include "pm" #ifdef CONFIG_PM diff --git a/drivers/power/pm_changestate.c b/drivers/power/pm_changestate.c index f64760f55bf..ee474052601 100644 --- a/drivers/power/pm_changestate.c +++ b/drivers/power/pm_changestate.c @@ -42,7 +42,7 @@ #include #include -#include "pm_internal.h" +#include "pm" #ifdef CONFIG_PM diff --git a/drivers/power/pm_checkstate.c b/drivers/power/pm_checkstate.c index 13adc5d5ce0..37ea02ca041 100644 --- a/drivers/power/pm_checkstate.c +++ b/drivers/power/pm_checkstate.c @@ -43,7 +43,7 @@ #include #include -#include "pm_internal.h" +#include "pm" #ifdef CONFIG_PM diff --git a/drivers/power/pm_initialize.c b/drivers/power/pm_initialize.c index b4f74587790..1fc5ff479f0 100644 --- a/drivers/power/pm_initialize.c +++ b/drivers/power/pm_initialize.c @@ -43,7 +43,7 @@ #include -#include "pm_internal.h" +#include "pm" #ifdef CONFIG_PM diff --git a/drivers/power/pm_register.c b/drivers/power/pm_register.c index 19f94cb0263..c7a61f88cc1 100644 --- a/drivers/power/pm_register.c +++ b/drivers/power/pm_register.c @@ -44,7 +44,7 @@ #include -#include "pm_internal.h" +#include "pm" #ifdef CONFIG_PM diff --git a/drivers/power/pm_update.c b/drivers/power/pm_update.c index 73920299351..0909836065d 100644 --- a/drivers/power/pm_update.c +++ b/drivers/power/pm_update.c @@ -44,7 +44,7 @@ #include #include -#include "pm_internal.h" +#include "pm" #ifdef CONFIG_PM From 426eb61e4772edab5f7ed4509b31e94020949a0d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 29 Dec 2015 18:29:24 -0600 Subject: [PATCH 09/29] Fix an error introduced in the last big set of header file renaming --- drivers/power/pm_activity.c | 5 +++-- drivers/power/pm_changestate.c | 2 +- drivers/power/pm_checkstate.c | 2 +- drivers/power/pm_initialize.c | 5 +++-- drivers/power/pm_register.c | 5 +++-- drivers/power/pm_update.c | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/power/pm_activity.c b/drivers/power/pm_activity.c index d80315605c4..e15cc78b1ec 100644 --- a/drivers/power/pm_activity.c +++ b/drivers/power/pm_activity.c @@ -43,7 +43,7 @@ #include #include -#include "pm" +#include "pm.h" #ifdef CONFIG_PM @@ -163,4 +163,5 @@ void pm_activity(int priority) } } -#endif /* CONFIG_PM */ \ No newline at end of file +#endif /* CONFIG_PM */ + diff --git a/drivers/power/pm_changestate.c b/drivers/power/pm_changestate.c index ee474052601..50aa8a07d55 100644 --- a/drivers/power/pm_changestate.c +++ b/drivers/power/pm_changestate.c @@ -42,7 +42,7 @@ #include #include -#include "pm" +#include "pm.h" #ifdef CONFIG_PM diff --git a/drivers/power/pm_checkstate.c b/drivers/power/pm_checkstate.c index 37ea02ca041..85f44153233 100644 --- a/drivers/power/pm_checkstate.c +++ b/drivers/power/pm_checkstate.c @@ -43,7 +43,7 @@ #include #include -#include "pm" +#include "pm.h" #ifdef CONFIG_PM diff --git a/drivers/power/pm_initialize.c b/drivers/power/pm_initialize.c index 1fc5ff479f0..298448974f6 100644 --- a/drivers/power/pm_initialize.c +++ b/drivers/power/pm_initialize.c @@ -43,7 +43,7 @@ #include -#include "pm" +#include "pm.h" #ifdef CONFIG_PM @@ -109,4 +109,5 @@ void pm_initialize(void) sem_init(&g_pmglobals.regsem, 0, 1); } -#endif /* CONFIG_PM */ \ No newline at end of file +#endif /* CONFIG_PM */ + diff --git a/drivers/power/pm_register.c b/drivers/power/pm_register.c index c7a61f88cc1..f8776acee2b 100644 --- a/drivers/power/pm_register.c +++ b/drivers/power/pm_register.c @@ -44,7 +44,7 @@ #include -#include "pm" +#include "pm.h" #ifdef CONFIG_PM @@ -109,4 +109,5 @@ int pm_register(FAR struct pm_callback_s *callbacks) return ret; } -#endif /* CONFIG_PM */ \ No newline at end of file +#endif /* CONFIG_PM */ + diff --git a/drivers/power/pm_update.c b/drivers/power/pm_update.c index 0909836065d..1d5a64bfff3 100644 --- a/drivers/power/pm_update.c +++ b/drivers/power/pm_update.c @@ -44,7 +44,7 @@ #include #include -#include "pm" +#include "pm.h" #ifdef CONFIG_PM From 40659d12df6b2fe644801e4bda41327e34dcf5c0 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Dec 2015 07:56:56 -0600 Subject: [PATCH 10/29] Rename libxx_internal.h to libxx.h --- configs | 2 +- libxx/{libxx_internal.hxx => libxx.h} | 2 +- libxx/libxx_cxa_atexit.cxx | 2 +- libxx/libxx_delete.cxx | 2 +- libxx/libxx_deletea.cxx | 2 +- libxx/libxx_eabi_atexit.cxx | 2 +- libxx/libxx_new.cxx | 2 +- libxx/libxx_newa.cxx | 2 +- mm/README.txt | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) rename libxx/{libxx_internal.hxx => libxx.h} (99%) diff --git a/configs b/configs index 05b30849130..bf83eb388ae 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit 05b30849130f836b352cc84196b2369679fbe5ec +Subproject commit bf83eb388aea59fb76651ba22c86f22a0da5d6dc diff --git a/libxx/libxx_internal.hxx b/libxx/libxx.h similarity index 99% rename from libxx/libxx_internal.hxx rename to libxx/libxx.h index 6669e90052d..0fcdfedb02e 100644 --- a/libxx/libxx_internal.hxx +++ b/libxx/libxx.h @@ -1,5 +1,5 @@ //*************************************************************************** -// lib/libxx_internal.h +// lib/libxx.h // // Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. // Author: Gregory Nutt diff --git a/libxx/libxx_cxa_atexit.cxx b/libxx/libxx_cxa_atexit.cxx index 5e01f99f278..cb60e1c7e2d 100644 --- a/libxx/libxx_cxa_atexit.cxx +++ b/libxx/libxx_cxa_atexit.cxx @@ -41,7 +41,7 @@ #include -#include "libxx_internal.hxx" +#include "libxx.hxx" //*************************************************************************** // Pre-processor Definitions diff --git a/libxx/libxx_delete.cxx b/libxx/libxx_delete.cxx index 9eb46a0100f..dec28a85c24 100644 --- a/libxx/libxx_delete.cxx +++ b/libxx/libxx_delete.cxx @@ -39,7 +39,7 @@ #include -#include "libxx_internal.hxx" +#include "libxx.hxx" //*************************************************************************** // Pre-processor Definitions diff --git a/libxx/libxx_deletea.cxx b/libxx/libxx_deletea.cxx index c99c18dfde2..174049efc2f 100644 --- a/libxx/libxx_deletea.cxx +++ b/libxx/libxx_deletea.cxx @@ -39,7 +39,7 @@ #include -#include "libxx_internal.hxx" +#include "libxx.hxx" //*************************************************************************** // Pre-processor Definitions diff --git a/libxx/libxx_eabi_atexit.cxx b/libxx/libxx_eabi_atexit.cxx index 25f8306a847..eea296c696d 100644 --- a/libxx/libxx_eabi_atexit.cxx +++ b/libxx/libxx_eabi_atexit.cxx @@ -40,7 +40,7 @@ #include #include -#include "libxx_internal.hxx" +#include "libxx.hxx" //*************************************************************************** // Pre-processor Definitions diff --git a/libxx/libxx_new.cxx b/libxx/libxx_new.cxx index 710528abe35..a4575519ab4 100644 --- a/libxx/libxx_new.cxx +++ b/libxx/libxx_new.cxx @@ -41,7 +41,7 @@ #include #include -#include "libxx_internal.hxx" +#include "libxx.hxx" //*************************************************************************** // Pre-processor Definitions diff --git a/libxx/libxx_newa.cxx b/libxx/libxx_newa.cxx index 8d42c628c79..c1e4dfa95d9 100644 --- a/libxx/libxx_newa.cxx +++ b/libxx/libxx_newa.cxx @@ -41,7 +41,7 @@ #include #include -#include "libxx_internal.hxx" +#include "libxx.hxx" //*************************************************************************** // Pre-processor Definitions diff --git a/mm/README.txt b/mm/README.txt index 0e9a4e7d228..f33cf49c80e 100644 --- a/mm/README.txt +++ b/mm/README.txt @@ -15,7 +15,7 @@ This directory contains the NuttX memory management logic. This include: mm_memalign.c, mm_free.c o Less-Standard Interfaces: mm_zalloc.c, mm_mallinfo.c o Internal Implementation: mm_initialize.c mm_sem.c mm_addfreechunk.c - mm_size2ndx.c mm_shrinkchunk.c, mm_internal.h + mm_size2ndx.c mm_shrinkchunk.c o Build and Configuration files: Kconfig, Makefile Memory Models: From e76e8f41c62de22bb4d3ccaf23e6e5a9ab497c35 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Dec 2015 12:18:24 -0600 Subject: [PATCH 11/29] pthread: Correct default schedule policy --- include/nuttx/pthread.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/nuttx/pthread.h b/include/nuttx/pthread.h index 7528bbda853..ffd0d29fb83 100644 --- a/include/nuttx/pthread.h +++ b/include/nuttx/pthread.h @@ -51,11 +51,17 @@ /* Default pthread attribute initializer */ +#if CONFIG_RR_INTERVAL == 0 +# define PTHREAD_DEFAULT_POLICY SCHED_FIFO +#else +# define PTHREAD_DEFAULT_POLICY SCHED_RR +#endif + #ifdef CONFIG_SCHED_SPORADIC # define PTHREAD_ATTR_INITIALIZER \ { \ PTHREAD_DEFAULT_PRIORITY, /* priority */ \ - SCHED_RR, /* policy */ \ + PTHREAD_DEFAULT_POLICY, /* policy */ \ PTHREAD_EXPLICIT_SCHED, /* inheritsched */ \ 0, /* low_priority */ \ 0, /* max_repl */ \ @@ -67,7 +73,7 @@ # define PTHREAD_ATTR_INITIALIZER \ { \ PTHREAD_DEFAULT_PRIORITY, /* priority */ \ - SCHED_RR, /* policy */ \ + PTHREAD_DEFAULT_POLICY, /* policy */ \ PTHREAD_EXPLICIT_SCHED, /* inheritsched */ \ PTHREAD_STACK_DEFAULT, /* stacksize */ \ } From 9835eeb181ebc9b2c9119803b3263191ab08c165 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Dec 2015 13:20:31 -0600 Subject: [PATCH 12/29] signals: Basic framework to support SIGEV_THREAD --- TODO | 7 +-- arch | 2 +- configs | 2 +- fs/aio/aio_signal.c | 34 ++++++------- include/nuttx/mqueue.h | 5 +- include/pthread.h | 93 ++++++++++++++++++++++++++++++++++- include/signal.h | 38 ++++++++++++-- libc/aio/lio_listio.c | 18 +++++++ sched/Kconfig | 9 ++++ sched/mqueue/mq_desclose.c | 4 +- sched/mqueue/mq_notify.c | 19 +++---- sched/mqueue/mq_sndinternal.c | 44 +++++++++++------ sched/timer/timer.h | 5 +- sched/timer/timer_create.c | 10 +--- sched/timer/timer_settime.c | 46 +++++++++++------ 15 files changed, 252 insertions(+), 84 deletions(-) diff --git a/TODO b/TODO index 3e11ed34b28..43e5bef9e7b 100644 --- a/TODO +++ b/TODO @@ -340,9 +340,10 @@ o Signals (sched/signal, arch/) embedded system. Title: SIGEV_THREAD - Description: sig_notify() logic does not support SIGEV_THREAD; structure - struct sigevent does not provide required members sigev_notify_function - or sigev_notify_attributes. + Description: Implementation of support for support for SIGEV_THREAD is incomplete; + The internal OS functin sig_notification has not been implemented (and + will be tricky!). There are also some unimplemented function call logic + in libc/aio Status: Low, there are alternative designs. However, these features are required by the POSIX standard. Priority: Low for now diff --git a/arch b/arch index 4e962ff8a0a..08f9810f592 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 4e962ff8a0a2f15247232d7e9aef89032c9b2898 +Subproject commit 08f9810f5922c627fd378ea3727faa0ba4eb0d74 diff --git a/configs b/configs index bf83eb388ae..d4540c0f833 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit bf83eb388aea59fb76651ba22c86f22a0da5d6dc +Subproject commit d4540c0f83378a6680ffd792ff1e4a8ca0ddd8b8 diff --git a/fs/aio/aio_signal.c b/fs/aio/aio_signal.c index 9545a86227e..57e37dfe713 100644 --- a/fs/aio/aio_signal.c +++ b/fs/aio/aio_signal.c @@ -51,29 +51,10 @@ #ifdef CONFIG_FS_AIO -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ + /**************************************************************************** * Name: aio_signal * @@ -126,6 +107,19 @@ int aio_signal(pid_t pid, FAR struct aiocb *aiocbp) } } +#ifdef CONFIG_SIG_EVTHREAD + /* Notify the client via a function call */ + + else if (aiocbp->aio_sigevent.sigev_notify == SIGEV_THREAD) + { + ret = sig_notification(pid, &aiocbp->aio_sigevent); + if (ret < 0) + { + fdbg("ERROR: sig_notification failed: %d\n", ret); + } + } +#endif + /* Send the poll signal in any event in case the caller is waiting * on sig_suspend(); */ diff --git a/include/nuttx/mqueue.h b/include/nuttx/mqueue.h index 68f7b1b2bf3..53fa3af9f8e 100644 --- a/include/nuttx/mqueue.h +++ b/include/nuttx/mqueue.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/nuttx/mqueue.h * - * Copyright (C) 2007, 2009, 2011, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011, 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -80,8 +80,7 @@ struct mqueue_inode_s #ifndef CONFIG_DISABLE_SIGNALS FAR struct mq_des *ntmqdes; /* Notification: Owning mqdes (NULL if none) */ pid_t ntpid; /* Notification: Receiving Task's PID */ - int ntsigno; /* Notification: Signal number */ - union sigval ntvalue; /* Notification: Signal value */ + struct sigevent ntevent; /* Notification description */ #endif }; diff --git a/include/pthread.h b/include/pthread.h index 4de07d62a22..5a380bafbce 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -158,8 +158,11 @@ extern "C" /* pthread-specific types */ -typedef int pthread_key_t; -typedef FAR void *pthread_addr_t; +typedef int pthread_key_t; +#define __PTHREAD_KEY_T_DEFINED 1 + +typedef FAR void *pthread_addr_t; +#define __PTHREAD_ADDR_T_DEFINED 1 typedef pthread_addr_t (*pthread_startroutine_t)(pthread_addr_t); typedef pthread_startroutine_t pthread_func_t; @@ -182,17 +185,24 @@ struct pthread_attr_s struct timespec budget; /* Initial budget */ #endif }; + typedef struct pthread_attr_s pthread_attr_t; +#define __PTHREAD_ATTR_T_DEFINED 1 typedef pid_t pthread_t; +#define __PTHREAD_T_DEFINED 1 typedef int pthread_condattr_t; +#define __PTHREAD_CONDATTR_T_DEFINED 1 struct pthread_cond_s { sem_t sem; }; + typedef struct pthread_cond_s pthread_cond_t; +#define __PTHREAD_COND_T_DEFINED 1 + #define PTHREAD_COND_INITIALIZER {SEM_INITIALIZER(0)} struct pthread_mutexattr_s @@ -202,7 +212,9 @@ struct pthread_mutexattr_s uint8_t type; /* Type of the mutex. See PTHREAD_MUTEX_* definitions */ #endif }; + typedef struct pthread_mutexattr_s pthread_mutexattr_t; +#define __PTHREAD_MUTEXATTR_T_DEFINED 1 struct pthread_mutex_s { @@ -213,7 +225,9 @@ struct pthread_mutex_s int nlocks; /* The number of recursive locks held */ #endif }; + typedef struct pthread_mutex_s pthread_mutex_t; +#define __PTHREAD_MUTEX_T_DEFINED 1 #ifdef CONFIG_MUTEX_TYPES # define PTHREAD_MUTEX_INITIALIZER {-1, SEM_INITIALIZER(1), PTHREAD_MUTEX_DEFAULT, 0} @@ -225,16 +239,21 @@ struct pthread_barrierattr_s { int pshared; }; + typedef struct pthread_barrierattr_s pthread_barrierattr_t; +#define __PTHREAD_BARRIERATTR_T_DEFINED 1 struct pthread_barrier_s { sem_t sem; unsigned int count; }; + typedef struct pthread_barrier_s pthread_barrier_t; +#define __PTHREAD_BARRIER_T_DEFINED 1 typedef bool pthread_once_t; +#define __PTHREAD_ONCE_T_DEFINED 1 /* Forware references */ @@ -413,4 +432,74 @@ int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset); } #endif +#else /* __INCLUDE_PTHREAD_H */ + +#include +#include + +/* Avoid a circular dependencies by assuring that simple type definitions + * are avaiable in any inclusion ordering. + */ + +#ifndef __PTHREAD_KEY_T_DEFINED +typedef int pthread_key_t; +# define __PTHREAD_KEY_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_ADDR_T_DEFINED +typedef FAR void *pthread_addr_t; +# define __PTHREAD_ADDR_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_ATTR_T_DEFINED +struct pthread_attr_s; +typedef struct pthread_attr_s pthread_attr_t; +# define __PTHREAD_ATTR_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_T_DEFINED +typedef pid_t pthread_t; +# define __PTHREAD_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_CONDATTR_T_DEFINED +typedef int pthread_condattr_t; +# define __PTHREAD_CONDATTR_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_COND_T_DEFINED +struct pthread_cond_s; +typedef struct pthread_cond_s pthread_cond_t; +# define __PTHREAD_COND_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_MUTEXATTR_T_DEFINED +struct pthread_mutexattr_s; +typedef struct pthread_mutexattr_s pthread_mutexattr_t; +# define __PTHREAD_MUTEXATTR_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_MUTEX_T_DEFINED +struct pthread_mutex_s; +typedef struct pthread_mutex_s pthread_mutex_t; +# define __PTHREAD_MUTEX_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_BARRIERATTR_T_DEFINED +struct pthread_barrierattr_s; +typedef struct pthread_barrierattr_s pthread_barrierattr_t; +# define __PTHREAD_BARRIERATTR_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_BARRIER_T_DEFINED +struct pthread_barrier_s; +typedef struct pthread_barrier_s pthread_barrier_t; +# define __PTHREAD_BARRIER_T_DEFINED 1 +#endif + +#ifndef __PTHREAD_ONCE_T_DEFINED +typedef bool pthread_once_t; +# define __PTHREAD_ONCE_T_DEFINED 1 +#endif + #endif /* __INCLUDE_PTHREAD_H */ diff --git a/include/signal.h b/include/signal.h index 18ab6b85c12..50d6ea9f018 100644 --- a/include/signal.h +++ b/include/signal.h @@ -45,6 +45,9 @@ #include #include +#ifdef CONFIG_SIG_EVTHREAD +# include /* Needed for pthread_attr_t */ +#endif /******************************************************************************** * Pre-processor Definitions @@ -162,8 +165,11 @@ /* Values for the sigev_notify field of struct sigevent */ -#define SIGEV_NONE 0 /* No notification desired */ -#define SIGEV_SIGNAL 1 /* Notify via signal */ +#define SIGEV_NONE 0 /* No asynchronous notification is delivered */ +#define SIGEV_SIGNAL 1 /* Notify via signal,with an application-defined value */ +#ifdef CONFIG_SIG_EVTHREAD +# define SIGEV_THREAD 3 /* A notification function is called */ +#endif /* Special values of of sa_handler used by sigaction and sigset. They are all * treated like NULL for now. This is okay for SIG_DFL and SIG_IGN because @@ -189,6 +195,7 @@ /* This defines a set of 32 signals (numbered 0 through 31). */ typedef uint32_t sigset_t; /* Bit set of 32 signals */ +#define __SIGSET_T_DEFINED 1 /* This defines the type of the siginfo si_value field */ @@ -205,9 +212,14 @@ union sigval struct sigevent { - uint8_t sigev_notify; /* Notification method: SIGEV_SIGNAL or SIGEV_NONE */ + uint8_t sigev_notify; /* Notification method: SIGEV_SIGNAL, SIGEV_NONE, or SIGEV_THREAD */ uint8_t sigev_signo; /* Notification signal */ union sigval sigev_value; /* Data passed with notification */ + +#ifdef CONFIG_SIG_EVTHREAD + CODE void (*sigev_notify_function)(union sigval); /* Notification function */ + FAR pthread_attr_t *sigev_notify_attributes; /* Notification attributes (not used) */ +#endif }; /* The following types is used to pass parameters to/from signal handlers */ @@ -225,6 +237,7 @@ struct siginfo }; typedef struct siginfo siginfo_t; +#define __SIGINFO_T_DEFINED 1 /* Non-standard convenience definition of signal handling function types. * These should be used only internally within the NuttX signal logic. @@ -297,4 +310,23 @@ int sigqueue(int pid, int signo, FAR void *sival_ptr); } #endif +#else /* __INCLUDE_SIGNAL_H */ + +#include + +/* Avoid a circular dependencies by assuring that simple type definitions + * are avaiable in any inclusion ordering. + */ + +#ifndef __SIGSET_T_DEFINED +typedef uint32_t sigset_t; +# define __SIGSET_T_DEFINED 1 +#endif + +#ifndef __SIGINFO_T_DEFINED +struct siginfo; +typedef struct siginfo siginfo_t; +# define __SIGINFO_T_DEFINED 1 +#endif + #endif /* __INCLUDE_SIGNAL_H */ diff --git a/libc/aio/lio_listio.c b/libc/aio/lio_listio.c index b552817e091..38efad0019f 100644 --- a/libc/aio/lio_listio.c +++ b/libc/aio/lio_listio.c @@ -213,6 +213,15 @@ static void lio_sighandler(int signo, siginfo_t *info, void *ucontext) #endif } +#ifdef CONFIG_SIG_EVTHREAD + /* Notify the client via a function call */ + + else if (ighand->sig->sigev_notify == SIGEV_THREAD) + { +#warning Missing SIGEV_THREAD logic + } +#endif + /* And free the container */ lib_free(sighand); @@ -711,6 +720,15 @@ int lio_listio(int mode, FAR struct aiocb *const list[], int nent, } } +#ifdef CONFIG_SIG_EVTHREAD + /* Notify the client via a function call */ + + else if (sig && sig->sigev_notify == SIGEV_THREAD) + { +#warning Missing SIGEV_THREAD logic + } +#endif + /* Case 3: mode == LIO_NOWAIT and sig == NULL * * Just return now. diff --git a/sched/Kconfig b/sched/Kconfig index 5aefa848c00..301558ec8d6 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -775,6 +775,15 @@ config SCHED_ONEXIT_MAX endmenu # RTOS hooks +config SIG_EVTHREAD + bool "Support SIGEV_THHREAD" + default n + depends on EXPERIMENTAL + ---help--- + Built in support for the SIGEV_THREAD signal deliver method. + + NOTE: Only partially implemented as of this writing. + menu "Signal Numbers" depends on !DISABLE_SIGNALS diff --git a/sched/mqueue/mq_desclose.c b/sched/mqueue/mq_desclose.c index ca7bfc5b8a4..881ce5499af 100644 --- a/sched/mqueue/mq_desclose.c +++ b/sched/mqueue/mq_desclose.c @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -128,9 +129,8 @@ void mq_desclose(mqd_t mqdes) #ifndef CONFIG_DISABLE_SIGNALS if (msgq->ntmqdes == mqdes) { + memset(&msgq->ntevent, 0, sizeof(struct sigevent)); msgq->ntpid = INVALID_PROCESS_ID; - msgq->ntsigno = 0; - msgq->ntvalue.sival_int = 0; msgq->ntmqdes = NULL; } #endif diff --git a/sched/mqueue/mq_notify.c b/sched/mqueue/mq_notify.c index c9836715fe7..d87c413b3ef 100644 --- a/sched/mqueue/mq_notify.c +++ b/sched/mqueue/mq_notify.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -93,7 +94,7 @@ * Parameters: * mqdes - Message queue descriptor * notification - Real-time signal structure containing: - * sigev_notify - Should be SIGEV_SIGNAL (but actually ignored) + * sigev_notify - Should be SIGEV_SIGNAL or SIGEV_THREAD * sigev_signo - The signo to use for the notification * sigev_value - Value associated with the signal * @@ -171,10 +172,11 @@ int mq_notify(mqd_t mqdes, const struct sigevent *notification) /* Yes... Assign it to the current task. */ - msgq->ntvalue.sival_ptr = notification->sigev_value.sival_ptr; - msgq->ntsigno = notification->sigev_signo; - msgq->ntpid = rtcb->pid; - msgq->ntmqdes = mqdes; + memcpy(&msgq->ntevent, ¬ification->sigev_value, + sizeof(struct sigevent)); + + msgq->ntpid = rtcb->pid; + msgq->ntmqdes = mqdes; } } @@ -197,10 +199,9 @@ int mq_notify(mqd_t mqdes, const struct sigevent *notification) * thread to detach the notification. */ - msgq->ntpid = INVALID_PROCESS_ID; - msgq->ntsigno = 0; - msgq->ntvalue.sival_ptr = NULL; - msgq->ntmqdes = NULL; + memset(&msgq->ntevent, 0, sizeof(struct sigevent)); + msgq->ntpid = INVALID_PROCESS_ID; + msgq->ntmqdes = NULL; } sched_unlock(); diff --git a/sched/mqueue/mq_sndinternal.c b/sched/mqueue/mq_sndinternal.c index f2a312f8ef8..43abe64e1f3 100644 --- a/sched/mqueue/mq_sndinternal.c +++ b/sched/mqueue/mq_sndinternal.c @@ -51,6 +51,8 @@ #include #include #include +#include + #include "sched/sched.h" #ifndef CONFIG_DISABLE_SIGNALS # include "signal/signal.h" @@ -384,30 +386,44 @@ int mq_dosend(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, FAR const char *msg, #ifndef CONFIG_DISABLE_SIGNALS if (msgq->ntmqdes) { + struct sigevent event; + pid_t pid; + /* Remove the message notification data from the message queue. */ -#ifdef CONFIG_CAN_PASS_STRUCTS - union sigval value = msgq->ntvalue; -#else - void *sival_ptr = msgq->ntvalue.sival_ptr; -#endif - int signo = msgq->ntsigno; - int pid = msgq->ntpid; + memcpy(&event, &msgq->ntevent, sizeof(struct sigevent)); + pid = msgq->ntpid; /* Detach the notification */ - msgq->ntpid = INVALID_PROCESS_ID; - msgq->ntsigno = 0; - msgq->ntvalue.sival_int = 0; - msgq->ntmqdes = NULL; + memset(&msgq->ntevent, 0, sizeof(struct sigevent)); + msgq->ntpid = INVALID_PROCESS_ID; + msgq->ntmqdes = NULL; - /* Queue the signal -- What if this returns an error? */ + /* Notification the client via signal? */ + + if (event.sigev_notify == SIGEV_SIGNAL) + { + /* Yes... Queue the signal -- What if this returns an error? */ #ifdef CONFIG_CAN_PASS_STRUCTS - sig_mqnotempty(pid, signo, value); + DEBUGVERIFY(sig_mqnotempty(pid, event.sigev_signo, + event.sigev_value)); #else - sig_mqnotempty(pid, signo, sival_ptr); + DEBUGVERIFY(sig_mqnotempty(pid, event.sigev_signo, + event.sigev_value.sival_ptr)); #endif + } + +#ifdef CONFIG_SIG_EVTHREAD + /* Notify the client via a function call */ + + else if (event.sigev_notify == SIGEV_THREAD) + { + DEBUGVERIFY(sig_notification(pid, &event)); + } +#endif + } #endif diff --git a/sched/timer/timer.h b/sched/timer/timer.h index 1f139a1f426..6165d9e847b 100644 --- a/sched/timer/timer.h +++ b/sched/timer/timer.h @@ -1,7 +1,7 @@ /******************************************************************************** * sched/timer/timer.h * - * Copyright (C) 2007-2009, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -67,12 +67,11 @@ struct posix_timer_s uint8_t pt_flags; /* See PT_FLAGS_* definitions */ uint8_t pt_crefs; /* Reference count */ - uint8_t pt_signo; /* Notification signal */ pid_t pt_owner; /* Creator of timer */ int pt_delay; /* If non-zero, used to reset repetitive timers */ int pt_last; /* Last value used to set watchdog */ WDOG_ID pt_wdog; /* The watchdog that provides the timing */ - union sigval pt_value; /* Data passed with notification */ + struct sigevent pt_event; /* Notification information */ }; /******************************************************************************** diff --git a/sched/timer/timer_create.c b/sched/timer/timer_create.c index bf6429e3bcb..27b2b0fe2b7 100644 --- a/sched/timer/timer_create.c +++ b/sched/timer/timer_create.c @@ -215,17 +215,11 @@ int timer_create(clockid_t clockid, FAR struct sigevent *evp, FAR timer_t *timer if (evp) { - ret->pt_signo = evp->sigev_signo; -#ifdef CONFIG_CAN_PASS_STRUCTS - ret->pt_value = evp->sigev_value; -#else - ret->pt_value.sival_ptr = evp->sigev_value.sival_ptr; -#endif + memcpy(&ret->pt_event, evp, sizeof(struct sigevent)); } else { - ret->pt_signo = SIGALRM; - ret->pt_value.sival_ptr = ret; + memset(&ret->pt_event, 0, sizeof(struct sigevent)); } /* Return the timer */ diff --git a/sched/timer/timer_settime.c b/sched/timer/timer_settime.c index 4df42217eeb..de8eda47e8a 100644 --- a/sched/timer/timer_settime.c +++ b/sched/timer/timer_settime.c @@ -44,6 +44,8 @@ #include #include +#include + #include "clock/clock.h" #include "signal/signal.h" #include "timer/timer.h" @@ -66,7 +68,7 @@ * Private Function Prototypes ********************************************************************************/ -static inline void timer_sigqueue(FAR struct posix_timer_s *timer); +static inline void timer_signotify(FAR struct posix_timer_s *timer); static inline void timer_restart(FAR struct posix_timer_s *timer, wdparm_t itimer); static void timer_timeout(int argc, wdparm_t itimer); @@ -75,7 +77,7 @@ static void timer_timeout(int argc, wdparm_t itimer); ********************************************************************************/ /******************************************************************************** - * Name: timer_sigqueue + * Name: timer_signotify * * Description: * This function basically reimplements sigqueue() so that the si_code can @@ -92,28 +94,42 @@ static void timer_timeout(int argc, wdparm_t itimer); * ********************************************************************************/ -static inline void timer_sigqueue(FAR struct posix_timer_s *timer) +static inline void timer_signotify(FAR struct posix_timer_s *timer) { siginfo_t info; - /* Create the siginfo structure */ + /* Notify client via a signal? */ - info.si_signo = timer->pt_signo; - info.si_code = SI_TIMER; - info.si_errno = OK; + if (timer->pt_event.sigev_notify == SIGEV_SIGNAL) + { + /* Yes.. Create the siginfo structure */ + + info.si_signo = timer->pt_event.sigev_signo; + info.si_code = SI_TIMER; + info.si_errno = OK; #ifdef CONFIG_CAN_PASS_STRUCTS - info.si_value = timer->pt_value; + info.si_value = timer->pt_event.sigev_value; #else - info.si_value.sival_ptr = timer->pt_value.sival_ptr; + info.si_value.sival_ptr = timer->pt_event.sigev_value.sival_ptr; #endif #ifdef CONFIG_SCHED_HAVE_PARENT - info.si_pid = 0; /* Not applicable */ - info.si_status = OK; + info.si_pid = 0; /* Not applicable */ + info.si_status = OK; #endif - /* Send the signal */ + /* Send the signal */ - (void)sig_dispatch(timer->pt_owner, &info); + DEBUGVERIFY(sig_dispatch(timer->pt_owner, &info)); + } + +#ifdef CONFIG_SIG_EVTHREAD + /* Notify the client via a function call */ + + else if (timer->pt_event.sigev_notify == SIGEV_THREAD) + { + DEBUGVERIFY(sig_notification(timer->pt_owner, &timer->pt_event)); + } +#endif } /******************************************************************************** @@ -187,7 +203,7 @@ static void timer_timeout(int argc, wdparm_t itimer) */ u.timer->pt_crefs++; - timer_sigqueue(u.timer); + timer_signotify(u.timer); /* Release the reference. timer_release will return nonzero if the timer * was not deleted. @@ -208,7 +224,7 @@ static void timer_timeout(int argc, wdparm_t itimer) */ timer->pt_crefs++; - timer_sigqueue(timer); + timer_signotify(timer); /* Release the reference. timer_release will return nonzero if the timer * was not deleted. From 849df03d226f5860fcb7b2b267f0169f5eec154e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Dec 2015 13:28:39 -0600 Subject: [PATCH 13/29] Update dates on files modified for SIGEV_THREAD support --- fs/aio/aio_signal.c | 2 +- include/nuttx/pthread.h | 2 +- include/nuttx/signal.h | 76 +++++++++++++++++++++++++++++++++++ sched/mqueue/mq_desclose.c | 2 +- sched/mqueue/mq_notify.c | 2 +- sched/mqueue/mq_sndinternal.c | 2 +- sched/timer/timer_create.c | 2 +- 7 files changed, 82 insertions(+), 6 deletions(-) create mode 100644 include/nuttx/signal.h diff --git a/fs/aio/aio_signal.c b/fs/aio/aio_signal.c index 57e37dfe713..5a279044c87 100644 --- a/fs/aio/aio_signal.c +++ b/fs/aio/aio_signal.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/aio/aio_signal.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/include/nuttx/pthread.h b/include/nuttx/pthread.h index ffd0d29fb83..eff079be74e 100644 --- a/include/nuttx/pthread.h +++ b/include/nuttx/pthread.h @@ -2,7 +2,7 @@ * include/nuttx/pthread.h * Non-standard, NuttX-specific pthread-related declarations. * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/include/nuttx/signal.h b/include/nuttx/signal.h new file mode 100644 index 00000000000..56c708ec869 --- /dev/null +++ b/include/nuttx/signal.h @@ -0,0 +1,76 @@ +/**************************************************************************** + * include/nuttx/signal.h + * + * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __INCLUDE_NUTTX_SIGNAL_H +#define __INCLUDE_NUTTX_SIGNAL_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#if defined(CONFIG_SIG_EVTHREAD) && defined(__KERNEL__) + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Name: sig_notification + * + * Description: + * Notify a client a signal event via a function call. This function is + * an internal OS interface that implements the common logic for signal + * event notification for the case of SIGEV_THREAD. + * + * Input Parameters: + * pid - The task/thread ID a the client thread to be signaled. + * event - The instance of struct sigevent that describes how to signal + * the client. + * + * Returned Value: + * Zero (OK) is returned on success; A negated errno value is returned + * on failure. + * + ****************************************************************************/ + +int sig_notification(pid_t pid, FAR struct sigevent *event); + +#endif /* CONFIG_SIG_EVTHREAD && __KERNEL__ */ +#endif /* __INCLUDE_NUTTX_SIGNAL_H */ diff --git a/sched/mqueue/mq_desclose.c b/sched/mqueue/mq_desclose.c index 881ce5499af..812059e0ff4 100644 --- a/sched/mqueue/mq_desclose.c +++ b/sched/mqueue/mq_desclose.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/mqueue/mq_desclose.c * - * Copyright (C) 2007, 2009, 2013-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2013-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/sched/mqueue/mq_notify.c b/sched/mqueue/mq_notify.c index d87c413b3ef..cb7a3aaffc5 100644 --- a/sched/mqueue/mq_notify.c +++ b/sched/mqueue/mq_notify.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/mqueue/mq_notify.c * - * Copyright (C) 2007, 2009, 2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/sched/mqueue/mq_sndinternal.c b/sched/mqueue/mq_sndinternal.c index 43abe64e1f3..b6580d25bb1 100644 --- a/sched/mqueue/mq_sndinternal.c +++ b/sched/mqueue/mq_sndinternal.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/mqueue/mq_send.c * - * Copyright (C) 2007, 2009, 2013-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2013-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/sched/timer/timer_create.c b/sched/timer/timer_create.c index 27b2b0fe2b7..0d5ce1b1e14 100644 --- a/sched/timer/timer_create.c +++ b/sched/timer/timer_create.c @@ -1,7 +1,7 @@ /******************************************************************************** * sched/timer/timer_create.c * - * Copyright (C) 2007-2009, 2011, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011, 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without From 9852932dcc845d6b0ec2ad2ff73518cdca905733 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Dec 2015 13:48:29 -0600 Subject: [PATCH 14/29] Fix another error from the last set of header file renaming --- libxx/{libxx.h => libxx.hxx} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename libxx/{libxx.h => libxx.hxx} (96%) diff --git a/libxx/libxx.h b/libxx/libxx.hxx similarity index 96% rename from libxx/libxx.h rename to libxx/libxx.hxx index 0fcdfedb02e..f8c1eada4a9 100644 --- a/libxx/libxx.h +++ b/libxx/libxx.hxx @@ -1,5 +1,5 @@ //*************************************************************************** -// lib/libxx.h +// lib/libxx.hxx // // Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -33,8 +33,8 @@ // //*************************************************************************** -#ifndef __LIBXX_LIBXX_INTERNAL_HXX -#define __LIBXX_LIBXX_INTERNAL_HXX +#ifndef __LIBXX_LIBXX_HXX +#define __LIBXX_LIBXX__HXX //*************************************************************************** // Included Files @@ -85,4 +85,4 @@ extern "C" FAR void *__dso_handle; extern "C" int __cxa_atexit(__cxa_exitfunc_t func, void *arg, void *dso_handle); -#endif // __LIBXX_LIBXX_INTERNAL_HXX +#endif // __LIBXX_LIBXX_HXX From c1fff4706c640b0959bf2d4b9c3ea98abeb7a015 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Dec 2015 15:01:14 -0600 Subject: [PATCH 15/29] signals: Adds a very limited, minimal implementation for SIGEV_THREAD --- include/nuttx/signal.h | 4 +- include/pthread.h | 4 + include/signal.h | 18 ++-- libc/aio/lio_listio.c | 43 ++++---- sched/Kconfig | 7 +- sched/signal/Make.defs | 4 + sched/signal/sig_notification.c | 172 ++++++++++++++++++++++++++++++++ 7 files changed, 219 insertions(+), 33 deletions(-) create mode 100644 sched/signal/sig_notification.c diff --git a/include/nuttx/signal.h b/include/nuttx/signal.h index 56c708ec869..3f4adb50216 100644 --- a/include/nuttx/signal.h +++ b/include/nuttx/signal.h @@ -45,7 +45,7 @@ #include #include -#if defined(CONFIG_SIG_EVTHREAD) && defined(__KERNEL__) +#if defined(CONFIG_SIG_EVTHREAD) && defined(CONFIG_BUILD_FLAT) /**************************************************************************** * Public Function Prototypes @@ -72,5 +72,5 @@ int sig_notification(pid_t pid, FAR struct sigevent *event); -#endif /* CONFIG_SIG_EVTHREAD && __KERNEL__ */ +#endif /* CONFIG_SIG_EVTHREAD && CONFIG_BUILD_FLAT */ #endif /* __INCLUDE_NUTTX_SIGNAL_H */ diff --git a/include/pthread.h b/include/pthread.h index 5a380bafbce..9cc2b44a41f 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -432,6 +432,10 @@ int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset); } #endif +/******************************************************************************** + * Minimal Type Definitions + ********************************************************************************/ + #else /* __INCLUDE_PTHREAD_H */ #include diff --git a/include/signal.h b/include/signal.h index 50d6ea9f018..742720cf6b8 100644 --- a/include/signal.h +++ b/include/signal.h @@ -210,6 +210,12 @@ union sigval * available on a queue */ +#ifdef CONFIG_CAN_PASS_STRUCTS +typedef CODE void (*sigev_notify_function_t)(union sigval value); +#else +typedef CODE void (*sigev_notify_function_t)(FAR void *sival_ptr); +#endif + struct sigevent { uint8_t sigev_notify; /* Notification method: SIGEV_SIGNAL, SIGEV_NONE, or SIGEV_THREAD */ @@ -217,8 +223,8 @@ struct sigevent union sigval sigev_value; /* Data passed with notification */ #ifdef CONFIG_SIG_EVTHREAD - CODE void (*sigev_notify_function)(union sigval); /* Notification function */ - FAR pthread_attr_t *sigev_notify_attributes; /* Notification attributes (not used) */ + sigev_notify_function_t sigev_notify_function; /* Notification function */ + FAR pthread_attr_t *sigev_notify_attributes; /* Notification attributes (not used) */ #endif }; @@ -264,10 +270,6 @@ struct sigaction #define sa_handler sa_u._sa_handler #define sa_sigaction sa_u._sa_sigaction -/******************************************************************************** - * Public Data - ********************************************************************************/ - /******************************************************************************** * Public Function Prototypes ********************************************************************************/ @@ -310,6 +312,10 @@ int sigqueue(int pid, int signo, FAR void *sival_ptr); } #endif +/******************************************************************************** + * Minimal Type Definitions + ********************************************************************************/ + #else /* __INCLUDE_SIGNAL_H */ #include diff --git a/libc/aio/lio_listio.c b/libc/aio/lio_listio.c index 38efad0019f..b123a4e7357 100644 --- a/libc/aio/lio_listio.c +++ b/libc/aio/lio_listio.c @@ -45,16 +45,13 @@ #include #include +#include + #include "libc.h" #include "aio/aio.h" #ifdef CONFIG_FS_AIO -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ -/* Configuration ************************************************************/ - /**************************************************************************** * Private Types ****************************************************************************/ @@ -69,14 +66,6 @@ struct lio_sighand_s struct sigaction oact; /* Signal handler to restore */ }; -/**************************************************************************** - * Private Variables - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -205,11 +194,11 @@ static void lio_sighandler(int signo, siginfo_t *info, void *ucontext) if (sighand->sig->sigev_notify == SIGEV_SIGNAL) { #ifdef CONFIG_CAN_PASS_STRUCTS - (void)sigqueue(sighand->pid, sighand->sig->sigev_signo, - sighand->sig->sigev_value); + DEBUGASSERT(sigqueue(sighand->pid, sighand->sig->sigev_signo, + sighand->sig->sigev_value)); #else - (void)sigqueue(sighand->pid, sighand->sig->sigev_signo, - sighand->sig->sigev_value.sival_ptr); + DEBUGASSERT(sigqueue(sighand->pid, sighand->sig->sigev_signo, + sighand->sig->sigev_value.sival_ptr)); #endif } @@ -218,7 +207,7 @@ static void lio_sighandler(int signo, siginfo_t *info, void *ucontext) else if (ighand->sig->sigev_notify == SIGEV_THREAD) { -#warning Missing SIGEV_THREAD logic + DEBUGASSERT(sig_notification(sighand->pid, &sighand->sig)); } #endif @@ -660,7 +649,7 @@ int lio_listio(int mode, FAR struct aiocb *const list[], int nent, */ status = lio_waitall(list, nent); - if (status < 0 && ret != OK) + if (status < 0 && ret == OK) { /* Something bad happened while waiting and this is the first * error to be reported. @@ -688,7 +677,7 @@ int lio_listio(int mode, FAR struct aiocb *const list[], int nent, /* Setup a signal handler to detect when until all I/O completes. */ status = lio_sigsetup(list, nent, sig); - if (status < 0 && ret != OK) + if (status < 0 && ret == OK) { /* Something bad happened while setting up the signal and this * is the first error to be reported. @@ -707,8 +696,7 @@ int lio_listio(int mode, FAR struct aiocb *const list[], int nent, status = sigqueue(getpid(), sig->sigev_signo, sig->sigev_value.sival_ptr); #endif - - if (status < 0 && ret != OK) + if (status < 0 && ret == OK) { /* Something bad happened while signalling ourself and this is * the first error to be reported. @@ -725,7 +713,16 @@ int lio_listio(int mode, FAR struct aiocb *const list[], int nent, else if (sig && sig->sigev_notify == SIGEV_THREAD) { -#warning Missing SIGEV_THREAD logic + status = sig_notification(sighand->pid, &sighand->sig); + if (status < 0 && ret == OK) + { + /* Something bad happened while performing the notification + * and this is the first error to be reported. + */ + + retcode = -status; + ret = ERROR; + } } #endif diff --git a/sched/Kconfig b/sched/Kconfig index 301558ec8d6..d1e72a30e86 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -778,11 +778,14 @@ endmenu # RTOS hooks config SIG_EVTHREAD bool "Support SIGEV_THHREAD" default n - depends on EXPERIMENTAL + depends on BUILD_FLAT && SCHED_WORKQUEUE ---help--- Built in support for the SIGEV_THREAD signal deliver method. - NOTE: Only partially implemented as of this writing. + NOTE: The current implementation uses a work queue to notify the + client. This, however, would only work in the FLAT build. A + different mechanism would need to be development to support this + feature on the PROTECTED or KERNEL build. menu "Signal Numbers" depends on !DISABLE_SIGNALS diff --git a/sched/signal/Make.defs b/sched/signal/Make.defs index 8521b644aa6..9d6ddda3a67 100644 --- a/sched/signal/Make.defs +++ b/sched/signal/Make.defs @@ -44,6 +44,10 @@ CSRCS += sig_removependingsignal.c sig_releasependingsignal.c sig_lowest.c CSRCS += sig_mqnotempty.c sig_cleanup.c sig_dispatch.c sig_deliver.c CSRCS += sig_pause.c sig_nanosleep.c +ifeq ($(CONFIG_SIG_EVTHREAD),y) +CSRCS += sig_notification.c +endif + # Include signal build support DEPPATH += --dep-path signal diff --git a/sched/signal/sig_notification.c b/sched/signal/sig_notification.c new file mode 100644 index 00000000000..f9a0710fbea --- /dev/null +++ b/sched/signal/sig_notification.c @@ -0,0 +1,172 @@ +/**************************************************************************** + * sched/signal/sig_notification.c + * + * Copyright (C) 2015 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 + +#ifdef CONFIG_SIG_EVTHREAD + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* Use the low-prioriry work queue is it is available */ + +#if defined(CONFIG_SCHED_LPWORK) +# define NTWORK LPWORK +#elif defined(CONFIG_SCHED_HPWORK) +# define NTWORK HPWORK +#else +# error Work queue is not enabled +#endif + +/**************************************************************************** + * Private Type Definitions + ****************************************************************************/ + +/* This structure retains all that is necessary to perform the notification */ + +struct sig_notify_s +{ + struct work_s nt_work; /* Work queue structure */ + union sigval nt_value; /* Data passed with notification */ + sigev_notify_function_t nt_func; /* Notification function */ +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: sig_ntworker + * + * Description: + * Perform the callback from the context of the worker thread. + * + * Input Parameters: + * arg - Work argument. + * + * Returned Value: + * None. + * + ****************************************************************************/ + +static void sig_ntworker(FAR void *arg) +{ + FAR struct sig_notify_s *notify = (FAR struct sig_notify_s *)arg; + + DEBUGASSERT(notify != NULL); + + /* Perform the callback */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + notify->nt_func(notify->nt_value); +#else + notify->nt_func(notify->nt_value.sival_ptr); +#endif + + /* Free the alloated notification parameters */ + + kmm_free(notify); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: sig_notification + * + * Description: + * Notify a client a signal event via a function call. This function is + * an internal OS interface that implements the common logic for signal + * event notification for the case of SIGEV_THREAD. + * + * Input Parameters: + * pid - The task/thread ID a the client thread to be signaled. + * event - The instance of struct sigevent that describes how to signal + * the client. + * + * Returned Value: + * Zero (OK) is returned on success; A negated errno value is returned + * on failure. + * + ****************************************************************************/ + +int sig_notification(pid_t pid, FAR struct sigevent *event) +{ + FAR struct sig_notify_s *notify; + DEBUGASSERT(event != NULL && event->sigev_notify_function != NULL); + int ret; + + /* Allocate a structure to hold the notification information */ + + notify = kmm_zalloc(sizeof(struct sig_notify_s)); + if (notify == NULL) + { + return -ENOMEM; + } + + /* Initialize the notification information */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + notify->nt_value = event->sigev_value; +#else + notify->nt_value.sival_ptr = event->sigev_value.sival_ptr; +#endif + notify->nt_func = event->sigev_notify_function; + + /* Then queue the work */ + + ret = work_queue(NTWORK, ¬ify->nt_work, sig_ntworker, notify, 0); + if (ret < 0) + { + kmm_free(notify); + } + + return ret; +} + +#endif /* CONFIG_SIG_EVTHREAD */ From c33724fc93e38c4a6b910d9ff3e2ba3c7175df3c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Dec 2015 15:26:30 -0600 Subject: [PATCH 16/29] Update TODO list --- TODO | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 43e5bef9e7b..43b49541714 100644 --- a/TODO +++ b/TODO @@ -340,10 +340,17 @@ o Signals (sched/signal, arch/) embedded system. Title: SIGEV_THREAD - Description: Implementation of support for support for SIGEV_THREAD is incomplete; - The internal OS functin sig_notification has not been implemented (and - will be tricky!). There are also some unimplemented function call logic - in libc/aio + Description: Implementation of support for support for SIGEV_THREAD is available + only in the FLAT build mode because it uses the OS work queues to + perform the callback. The alternative for the PROTECTED and KERNEL + builds would be to create pthreads in the user space to perform the + callbacks. That is not a very attractive solution due to performance + issues. It would also require some additional logic to specify the + TCB of the parent so that the pthread could be bound to the correct + group. + + There is also some user-space logic in libc/aio/lio_listio.c. That + logic could use the user-space work queue for the callbacks. Status: Low, there are alternative designs. However, these features are required by the POSIX standard. Priority: Low for now From 05d16f15da81cec53a1adbe5418b650ec3521408 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Dec 2015 16:33:27 -0600 Subject: [PATCH 17/29] Update ChangeLog --- ChangeLog | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a110b5a06ca..519fc28770f 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11257,4 +11257,9 @@ (2015-12-19). * configs/arduino-mega2560: Add support for the Arduino-Mega2560. From Dimitry Koper (2015-12-29). - + * sched/signal, sched/mqueue, sched/timer, include/signal.h, + include/nuttx/signal, fs/aio, libc/aio, and probably other + directories: Add support for the SIGEV_THREAD notification method in + struct sigevent. This initial implementation will only work in the + FLAT build. See the top-level TODO file for additional details + (2015-12-30). From b73a7515b63cb8c665ae4c647839eba69a076975 Mon Sep 17 00:00:00 2001 From: Chris Croswhite Date: Wed, 30 Dec 2015 19:12:42 -0600 Subject: [PATCH 18/29] Small compilation issue when selecting localtime, this patch adds the correct ifdef. --- libc/time/lib_strftime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/time/lib_strftime.c b/libc/time/lib_strftime.c index fafdedc6b47..6af92202976 100644 --- a/libc/time/lib_strftime.c +++ b/libc/time/lib_strftime.c @@ -70,7 +70,7 @@ * Private Data ****************************************************************************/ -#ifdef CONFIG_TIME_EXTENDED +#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED) static const char * const g_abbrev_wdayname[7] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" From b1938c065da507482339fd5194589d06718d50de Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 31 Dec 2015 09:05:35 -0600 Subject: [PATCH 19/29] sys/time.h: Fix timersub macro; time_t is unsigned --- ChangeLog | 1 + include/pthread.h | 6 +++--- include/signal.h | 7 ++++--- include/sys/time.h | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 519fc28770f..b23a599c807 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11263,3 +11263,4 @@ struct sigevent. This initial implementation will only work in the FLAT build. See the top-level TODO file for additional details (2015-12-30). + diff --git a/include/pthread.h b/include/pthread.h index 9cc2b44a41f..00cd95772da 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -50,7 +50,7 @@ #include /* C99 boolean types */ #include /* For getpid */ #include /* Needed for sem_t */ -#include /* Needed for sigset_t */ +#include /* Needed for sigset_t, includes this file */ #include /* Needed for struct timespec */ /******************************************************************************** @@ -441,8 +441,8 @@ int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset); #include #include -/* Avoid a circular dependencies by assuring that simple type definitions - * are avaiable in any inclusion ordering. +/* Avoid circular dependencies by assuring that simple type definitions are + * available in any inclusion ordering. */ #ifndef __PTHREAD_KEY_T_DEFINED diff --git a/include/signal.h b/include/signal.h index 742720cf6b8..57c5742d838 100644 --- a/include/signal.h +++ b/include/signal.h @@ -45,8 +45,9 @@ #include #include + #ifdef CONFIG_SIG_EVTHREAD -# include /* Needed for pthread_attr_t */ +# include /* Needed for pthread_attr_t, includes this file */ #endif /******************************************************************************** @@ -320,8 +321,8 @@ int sigqueue(int pid, int signo, FAR void *sival_ptr); #include -/* Avoid a circular dependencies by assuring that simple type definitions - * are avaiable in any inclusion ordering. +/* Avoid circular dependencies by assuring that simple type definitions are + * available in any inclusion ordering. */ #ifndef __SIGSET_T_DEFINED diff --git a/include/sys/time.h b/include/sys/time.h index ecc2fc8401b..b36e30fca9a 100644 --- a/include/sys/time.h +++ b/include/sys/time.h @@ -78,12 +78,12 @@ do \ { \ (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ - (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ - if ((vvp)->tv_usec < 0) \ + if ((uvp)->tv_usec > (tvp)->tv_usec) \ { \ (vvp)->tv_sec--; \ - (vvp)->tv_usec += 1000000; \ + (tvp)->tv_usec += 1000000; \ } \ + (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ } \ while (0) From efd5a63cf3d8777e4bcfc3bffc4b38f797e25c76 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 1 Jan 2016 12:18:04 -0600 Subject: [PATCH 20/29] Update submodules --- Documentation | 2 +- arch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation b/Documentation index c8259448495..92c4a17b043 160000 --- a/Documentation +++ b/Documentation @@ -1 +1 @@ -Subproject commit c82594484958132e9267cd7bacb47579874a12ba +Subproject commit 92c4a17b043e87524a926ad86b6170407c5b3ec0 diff --git a/arch b/arch index 08f9810f592..3d8815cc4ce 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 08f9810f5922c627fd378ea3727faa0ba4eb0d74 +Subproject commit 3d8815cc4ce2870c2774cc54c6240f7e5c6e33e1 From 63f13283de0d63c1df37e8ed3a04f943391d40d2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 3 Jan 2016 11:59:43 -0600 Subject: [PATCH 21/29] Upate TODO list --- TODO | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 43b49541714..84ee69a0661 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -NuttX TODO List (Last updated December 23, 2015) +NuttX TODO List (Last updated January 3, 2016) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This file summarizes known NuttX bugs, limitations, inconsistencies with @@ -19,6 +19,7 @@ nuttx/ (6) Binary loaders (binfmt/) (11) Network (net/, drivers/net) (4) USB (drivers/usbdev, drivers/usbhost) + (1) Other drivers (drivers/) (11) Libraries (libc/, libm/) (11) File system/Generic drivers (fs/, drivers/) (8) Graphics subsystem (graphics/) @@ -1608,6 +1609,28 @@ o Build system Status: Open Priority: Low. +o Other drivers (drivers/) + ^^^^^^^^^^^^^^^^^^^^^^^^ + + Title: I2C NOT THREAD SAFE + Description: Unlike the SPI interface, the I2C interface has no method to lock + the interface. This is a problem for all non-atomic I2C operations + in a multi-tasking I2C environment: + - I2C_SETFREQUENCY: Frequency setting can be overwritten by other + I2C usage. + - I2C_SETADDRESS used with I2C_READ, I2C_WRITE, and I2C_WRITEREAD: + Similarly, address can and will be changed by other I2C usage. + - I2C_TRANSFER: This is the only interface that is properly self + contained and protected from most mult-tasking issues. But even + this interface can suffer if there are differing frequency settings. + Status: Open + Priority: Medium-High. The fix is easy but effects a lot of software. There + are two ways to fix theses problems: (1) Add a locking method such + as is provided with the SPI interface, or (2) make each interface + self-contained and atomic: Remove the I2C_FREQUENCY and I2C_ADDRESS + methods; Add frequency to all interfaces and add the address to + I2C_READ, I2C_WRITE, and I2C_WRITEREAD. + o Linux/Cywgin simulation (arch/sim) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From b48ca00cd5aa48799cf97c6f9edab35c8954a82a Mon Sep 17 00:00:00 2001 From: Dimitry Kloper Date: Tue, 5 Jan 2016 07:58:04 -0600 Subject: [PATCH 22/29] The delay parameter has 'int' type while explicit int32_t is used in sigtimedwait() (sig_timedwait.c) This can lead to wrong argument for systems that have default int size different than int32 (namely AVR). --- Documentation | 2 +- include/nuttx/wdog.h | 2 +- sched/wdog/wd_start.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation b/Documentation index 92c4a17b043..b4e33ca73c4 160000 --- a/Documentation +++ b/Documentation @@ -1 +1 @@ -Subproject commit 92c4a17b043e87524a926ad86b6170407c5b3ec0 +Subproject commit b4e33ca73c44aaca5f6986650e6d215a4d5adcab diff --git a/include/nuttx/wdog.h b/include/nuttx/wdog.h index a5e6945d5b1..beb13880933 100644 --- a/include/nuttx/wdog.h +++ b/include/nuttx/wdog.h @@ -167,7 +167,7 @@ extern "C" WDOG_ID wd_create(void); int wd_delete(WDOG_ID wdog); -int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...); +int wd_start(WDOG_ID wdog, int32_t delay, wdentry_t wdentry, int argc, ...); int wd_cancel(WDOG_ID wdog); int wd_gettime(WDOG_ID wdog); diff --git a/sched/wdog/wd_start.c b/sched/wdog/wd_start.c index de3b05603eb..f69a4d649c3 100644 --- a/sched/wdog/wd_start.c +++ b/sched/wdog/wd_start.c @@ -225,7 +225,7 @@ static inline void wd_expiration(void) * ****************************************************************************/ -int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...) +int wd_start(WDOG_ID wdog, int32_t delay, wdentry_t wdentry, int argc, ...) { va_list ap; FAR struct wdog_s *curr; From 06d83c62610f6a56a535d796afa53ec3f5cbcbc1 Mon Sep 17 00:00:00 2001 From: Dimitry Kloper Date: Tue, 5 Jan 2016 10:29:29 -0600 Subject: [PATCH 23/29] Introduce support for Atmel toolchain in-flash strings Atmel toolchain AVR compiler provides a transparent in-flash object support using __flash and __memx symbols. The former indicates to compiler that this is a flash-based object. The later used with pointer indicates that the referenced object may reside either in flash or in RAM. The compiler automatically makes 32-bit pointer with flag indicating whether referenced object is in flash or RAM and generates code to access either in run-time. Thus, any function that accepts __memx object can transparently work with RAM and flash objects. For platforms with a Harvard architecture and a very small RAM like AVR this allows to move all constant strings used in trace messages to flash in the instruction address space, releasing resources for other things. This change introduces IOBJ and IPTR type qualifiers. The 'I' indicates that the object may like in instruction space on a Harvard architecture machine. For platforms that do not have __flash and __memx or similar symbols IOBJ and IPTR are empty, making the types equivalent to, for example, 'const char' and 'const char*'. For Atmel compiler these will become 'const __flash char' and 'const __memx char*'. All printf() functions and syslog() functions are changed so that the qualifier is used with the format parameter. From: Dimitry Kloper --- ChangeLog | 23 +++++++++++++++++++- arch | 2 +- include/nuttx/compiler.h | 35 +++++++++++++++++++++++++----- include/nuttx/streams.h | 7 +++--- include/stdio.h | 33 +++++++++++++++++------------ include/syslog.h | 9 ++++---- libc/stdio/lib_asprintf.c | 2 +- libc/stdio/lib_dprintf.c | 2 +- libc/stdio/lib_fprintf.c | 2 +- libc/stdio/lib_libsprintf.c | 3 ++- libc/stdio/lib_libvsprintf.c | 41 +++++++++++++++++++++++------------- libc/stdio/lib_printf.c | 2 +- libc/stdio/lib_snprintf.c | 2 +- libc/stdio/lib_sprintf.c | 2 +- libc/stdio/lib_vasprintf.c | 2 +- libc/stdio/lib_vdprintf.c | 2 +- libc/stdio/lib_vfprintf.c | 2 +- libc/stdio/lib_vprintf.c | 2 +- libc/stdio/lib_vsnprintf.c | 3 ++- libc/stdio/lib_vsprintf.c | 2 +- libc/syslog/lib_lowsyslog.c | 6 +++--- libc/syslog/lib_syslog.c | 6 +++--- 22 files changed, 128 insertions(+), 62 deletions(-) diff --git a/ChangeLog b/ChangeLog index b23a599c807..2d1113ba381 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11263,4 +11263,25 @@ struct sigevent. This initial implementation will only work in the FLAT build. See the top-level TODO file for additional details (2015-12-30). - + * include/nuttx/compiler.h, include/nuttx/streams.h include/stdio.h + include/syslog.h libc/stdio/, and libc/syslog: ntroduce support for + Atmel toolchain in-flash strings. Atmel toolchain AVR compiler + provides a transparent in-flash object support using __flash and + __memx symbols. The former indicates to compiler that this is a flash- + based object. The later used with pointer indicates that the referenced + object may reside either in flash or in RAM. The compiler automatically + makes 32-bit pointer with flag indicating whether referenced object is + in flash or RAM and generates code to access either in run-time. Thus, + any function that accepts __memx object can transparently work with RAM + and flash objects. + For platforms with a Harvard architecture and a very small RAM like AVR + this allows to move all constant strings used in trace messages to flash + in the instruction address space, releasing resources for other things. + This change introduces IOBJ and IPTR type qualifiers. The 'I' indicates + that the object may lie in instruction space on a Harvard architecture + machine. For platforms that do not have __flash and __memx or similar + symbols IOBJ and IPTR are empty, making the types equivalent to, for + example, 'const char' and 'const char*'. For Atmel compiler these will + become 'const __flash char' and 'const __memx char*'. All printf() + functions and syslog() functions are changed so that the qualifier is + used with the format parameter. From Dimitry Kloper. diff --git a/arch b/arch index 3d8815cc4ce..0761b677efa 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 3d8815cc4ce2870c2774cc54c6240f7e5c6e33e1 +Subproject commit 0761b677efa861b6369cea195968a59e4a6e6860 diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index f43de0b6715..4ad24004566 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -40,6 +40,8 @@ * Included Files ****************************************************************************/ +#include + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -127,6 +129,11 @@ */ #if defined(__m32c__) +/* No I-space access qualifiers */ + +# define IOBJ +# define IPTR + /* Select the small, 16-bit addressing model */ # define CONFIG_SMALL_MEMORY 1 @@ -140,6 +147,14 @@ # undef CONFIG_PTR_IS_NOT_INT #elif defined(__AVR__) + + /* I-space access qualifiers needed by Harvard architecture */ + +# if defined(CONFIG_AVR_HAS_MEMX_PTR) +# define IOBJ __flash +# define IPTR __memx +# endif + /* Select the small, 16-bit addressing model */ # define CONFIG_SMALL_MEMORY 1 @@ -159,6 +174,11 @@ # define CONFIG_HAVE_FARPOINTER 1 #elif defined(__mc68hc1x__) +/* No I-space access qualifiers */ + +# define IOBJ +# define IPTR + /* Select the small, 16-bit addressing model */ # define CONFIG_SMALL_MEMORY 1 @@ -173,20 +193,26 @@ # define CONFIG_LONG_IS_NOT_INT 1 -/* Pointers and int are the same size (16-bits) */ +/* Pointers and int are the same size (16-bits) */ # undef CONFIG_PTR_IS_NOT_INT -#else +# else /* int and long are both 32-bits */ # undef CONFIG_LONG_IS_NOT_INT -/* Pointers and int are NOT the same size */ +/* Pointers and int are NOT the same size */ # define CONFIG_PTR_IS_NOT_INT 1 -#endif +# endif #else + +/* No I-space access qualifiers */ + +# define IOBJ +# define IPTR + /* Select the large, 32-bit addressing model */ # undef CONFIG_SMALL_MEMORY @@ -491,7 +517,6 @@ extern "C" #define EXTERN extern #endif - #undef EXTERN #ifdef __cplusplus } diff --git a/include/nuttx/streams.h b/include/nuttx/streams.h index 3358765bed3..ab57b33b35d 100644 --- a/include/nuttx/streams.h +++ b/include/nuttx/streams.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/nuttx/streams.h * - * Copyright (C) 2009, 2011-2012, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011-2012, 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -413,9 +413,10 @@ int lib_snoflush(FAR struct lib_sostream_s *this); * ****************************************************************************/ -int lib_sprintf(FAR struct lib_outstream_s *obj, FAR const char *fmt, ...); +int lib_sprintf(FAR struct lib_outstream_s *obj, + FAR const IPTR char *fmt, ...); int lib_vsprintf(FAR struct lib_outstream_s *obj, - FAR const char *src, va_list ap); + FAR const IPTR char *src, va_list ap); #undef EXTERN #if defined(__cplusplus) diff --git a/include/stdio.h b/include/stdio.h index d8f0c3479ae..20994e22ffd 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -143,35 +143,40 @@ int fgetc(FAR FILE *stream); int fgetpos(FAR FILE *stream, FAR fpos_t *pos); char *fgets(FAR char *s, int n, FAR FILE *stream); FAR FILE *fopen(FAR const char *path, FAR const char *type); -int fprintf(FAR FILE *stream, FAR const char *format, ...); +int fprintf(FAR FILE *stream, FAR const IPTR char *format, ...); int fputc(int c, FAR FILE *stream); int fputs(FAR const char *s, FAR FILE *stream); size_t fread(FAR void *ptr, size_t size, size_t n_items, FAR FILE *stream); -FAR FILE *freopen(FAR const char *path, FAR const char *mode, FAR FILE *stream); +FAR FILE *freopen(FAR const char *path, FAR const char *mode, + FAR FILE *stream); int fseek(FAR FILE *stream, long int offset, int whence); int fsetpos(FAR FILE *stream, FAR fpos_t *pos); long ftell(FAR FILE *stream); -size_t fwrite(FAR const void *ptr, size_t size, size_t n_items, FAR FILE *stream); +size_t fwrite(FAR const void *ptr, size_t size, size_t n_items, + FAR FILE *stream); FAR char *gets(FAR char *s); FAR char *gets_s(FAR char *s, rsize_t n); int ungetc(int c, FAR FILE *stream); /* Operations on the stdout stream, buffers, paths, and the whole printf-family */ -int printf(FAR const char *format, ...); +int printf(FAR const IPTR char *format, ...); int puts(FAR const char *s); int rename(FAR const char *oldpath, FAR const char *newpath); -int sprintf(FAR char *buf, FAR const char *format, ...); -int asprintf (FAR char **ptr, FAR const char *fmt, ...); -int snprintf(FAR char *buf, size_t size, FAR const char *format, ...); +int sprintf(FAR char *buf, FAR const IPTR char *format, ...); +int asprintf (FAR char **ptr, FAR const IPTR char *fmt, ...); +int snprintf(FAR char *buf, size_t size, + FAR const IPTR char *format, ...); int sscanf(FAR const char *buf, FAR const char *fmt, ...); void perror(FAR const char *s); -int vprintf(FAR const char *format, va_list ap); -int vfprintf(FAR FILE *stream, const char *format, va_list ap); -int vsprintf(FAR char *buf, const char *format, va_list ap); -int vasprintf(FAR char **ptr, const char *fmt, va_list ap); -int vsnprintf(FAR char *buf, size_t size, const char *format, va_list ap); +int vprintf(FAR const IPTR FAR char *format, va_list ap); +int vfprintf(FAR FILE *stream, FAR const IPTR char *format, + va_list ap); +int vsprintf(FAR char *buf, FAR const IPTR char *format, va_list ap); +int vasprintf(FAR char **ptr, FAR const IPTR char *fmt, va_list ap); +int vsnprintf(FAR char *buf, size_t size, FAR const IPTR char *format, + va_list ap); int vsscanf(FAR const char *buf, FAR const char *s, va_list ap); /* Operations on file descriptors including: @@ -182,8 +187,8 @@ int vsscanf(FAR const char *buf, FAR const char *s, va_list ap); */ FAR FILE *fdopen(int fd, FAR const char *type); -int dprintf(int fd, FAR const char *fmt, ...); -int vdprintf(int fd, FAR const char *fmt, va_list ap); +int dprintf(int fd, FAR const IPTR char *fmt, ...); +int vdprintf(int fd, FAR const IPTR char *fmt, va_list ap); /* Operations on paths */ diff --git a/include/syslog.h b/include/syslog.h index 2dfef54b24a..6c1316a7e61 100644 --- a/include/syslog.h +++ b/include/syslog.h @@ -41,6 +41,7 @@ ****************************************************************************/ #include +#include #include #include @@ -167,8 +168,8 @@ void closelog(void); * ****************************************************************************/ -int syslog(int priority, FAR const char *format, ...); -int vsyslog(int priority, FAR const char *src, va_list ap); +int syslog(int priority, FAR const IPTR char *format, ...); +int vsyslog(int priority, FAR const IPTR char *src, va_list ap); /**************************************************************************** * Name: lowsyslog and lowvsyslog @@ -198,8 +199,8 @@ int vsyslog(int priority, FAR const char *src, va_list ap); #ifdef CONFIG_ARCH_LOWPUTC -int lowsyslog(int priority, FAR const char *format, ...); -int lowvsyslog(int priority, FAR const char *format, va_list ap); +int lowsyslog(int priority, FAR const IPTR char *format, ...); +int lowvsyslog(int priority, FAR const IPTR char *format, va_list ap); #else diff --git a/libc/stdio/lib_asprintf.c b/libc/stdio/lib_asprintf.c index d61059f5b59..4c3f85760a6 100644 --- a/libc/stdio/lib_asprintf.c +++ b/libc/stdio/lib_asprintf.c @@ -92,7 +92,7 @@ * ****************************************************************************/ -int asprintf (FAR char **ptr, const char *fmt, ...) +int asprintf (FAR char **ptr, FAR const IPTR char *fmt, ...) { va_list ap; int ret; diff --git a/libc/stdio/lib_dprintf.c b/libc/stdio/lib_dprintf.c index f3f9de8ee54..0b8f676145e 100644 --- a/libc/stdio/lib_dprintf.c +++ b/libc/stdio/lib_dprintf.c @@ -47,7 +47,7 @@ * Name: dprintf ****************************************************************************/ -int dprintf(int fd, FAR const char *fmt, ...) +int dprintf(int fd, FAR const IPTR char *fmt, ...) { va_list ap; int ret; diff --git a/libc/stdio/lib_fprintf.c b/libc/stdio/lib_fprintf.c index d4420ada23c..a0169972ebd 100644 --- a/libc/stdio/lib_fprintf.c +++ b/libc/stdio/lib_fprintf.c @@ -79,7 +79,7 @@ * Name: fprintf ****************************************************************************/ -int fprintf(FAR FILE *stream, FAR const char *fmt, ...) +int fprintf(FAR FILE *stream, FAR const IPTR char *fmt, ...) { va_list ap; int n; diff --git a/libc/stdio/lib_libsprintf.c b/libc/stdio/lib_libsprintf.c index baa493c7a73..8668a54674b 100644 --- a/libc/stdio/lib_libsprintf.c +++ b/libc/stdio/lib_libsprintf.c @@ -76,7 +76,8 @@ * Name: lib_sprintf ****************************************************************************/ -int lib_sprintf(FAR struct lib_outstream_s *obj, const char *fmt, ...) +int lib_sprintf(FAR struct lib_outstream_s *obj, FAR const IPTR char *fmt, + ...) { va_list ap; int n; diff --git a/libc/stdio/lib_libvsprintf.c b/libc/stdio/lib_libvsprintf.c index 6c1b2958111..c81e55617f7 100644 --- a/libc/stdio/lib_libvsprintf.c +++ b/libc/stdio/lib_libvsprintf.c @@ -145,7 +145,8 @@ enum /* Pointer to ASCII conversion */ #ifdef CONFIG_PTR_IS_NOT_INT -static void ptohex(FAR struct lib_outstream_s *obj, uint8_t flags, FAR void *p); +static void ptohex(FAR struct lib_outstream_s *obj, uint8_t flags, + FAR void *p); #ifndef CONFIG_NOPRINTF_FIELDWIDTH static int getsizesize(uint8_t fmt, uint8_t flags, FAR void *p) #endif /* CONFIG_NOPRINTF_FIELDWIDTH */ @@ -154,7 +155,8 @@ static int getsizesize(uint8_t fmt, uint8_t flags, FAR void *p) /* Unsigned int to ASCII conversion */ static void utodec(FAR struct lib_outstream_s *obj, unsigned int n); -static void utohex(FAR struct lib_outstream_s *obj, unsigned int n, uint8_t a); +static void utohex(FAR struct lib_outstream_s *obj, unsigned int n, + uint8_t a); static void utooct(FAR struct lib_outstream_s *obj, unsigned int n); static void utobin(FAR struct lib_outstream_s *obj, unsigned int n); static void utoascii(FAR struct lib_outstream_s *obj, uint8_t fmt, @@ -169,7 +171,8 @@ static int getusize(uint8_t fmt, uint8_t flags, unsigned int lln); #ifdef CONFIG_LONG_IS_NOT_INT static void lutodec(FAR struct lib_outstream_s *obj, unsigned long ln); -static void lutohex(FAR struct lib_outstream_s *obj, unsigned long ln, uint8_t a); +static void lutohex(FAR struct lib_outstream_s *obj, unsigned long ln, + uint8_t a); static void lutooct(FAR struct lib_outstream_s *obj, unsigned long ln); static void lutobin(FAR struct lib_outstream_s *obj, unsigned long ln); static void lutoascii(FAR struct lib_outstream_s *obj, uint8_t fmt, @@ -184,14 +187,16 @@ static int getlusize(uint8_t fmt, FAR uint8_t flags, unsigned long ln); #if defined(CONFIG_HAVE_LONG_LONG) && defined(CONFIG_LIBC_LONG_LONG) static void llutodec(FAR struct lib_outstream_s *obj, unsigned long long lln); -static void llutohex(FAR struct lib_outstream_s *obj, unsigned long long lln, uint8_t a); +static void llutohex(FAR struct lib_outstream_s *obj, unsigned long long lln, + uint8_t a); static void llutooct(FAR struct lib_outstream_s *obj, unsigned long long lln); static void llutobin(FAR struct lib_outstream_s *obj, unsigned long long lln); static void llutoascii(FAR struct lib_outstream_s *obj, uint8_t fmt, uint8_t flags, unsigned long long lln); #ifndef CONFIG_NOPRINTF_FIELDWIDTH static void llfixup(uint8_t fmt, FAR uint8_t *flags, FAR long long *lln); -static int getllusize(uint8_t fmt, FAR uint8_t flags, FAR unsigned long long lln); +static int getllusize(uint8_t fmt, FAR uint8_t flags, + FAR unsigned long long lln); #endif #endif @@ -235,7 +240,8 @@ static const char g_nullstring[] = "(null)"; ****************************************************************************/ #ifdef CONFIG_PTR_IS_NOT_INT -static void ptohex(FAR struct lib_outstream_s *obj, uint8_t flags, FAR void *p) +static void ptohex(FAR struct lib_outstream_s *obj, uint8_t flags, + FAR void *p) { union { @@ -309,7 +315,8 @@ static void utodec(FAR struct lib_outstream_s *obj, unsigned int n) * Name: utohex ****************************************************************************/ -static void utohex(FAR struct lib_outstream_s *obj, unsigned int n, uint8_t a) +static void utohex(FAR struct lib_outstream_s *obj, unsigned int n, + uint8_t a) { bool nonzero = false; uint8_t bits; @@ -376,7 +383,8 @@ static void utobin(FAR struct lib_outstream_s *obj, unsigned int n) * Name: utoascii ****************************************************************************/ -static void utoascii(FAR struct lib_outstream_s *obj, uint8_t fmt, uint8_t flags, unsigned int n) +static void utoascii(FAR struct lib_outstream_s *obj, uint8_t fmt, + uint8_t flags, unsigned int n) { /* Perform the integer conversion according to the format specifier */ @@ -577,7 +585,8 @@ static void lutodec(FAR struct lib_outstream_s *obj, unsigned long n) * Name: lutohex ****************************************************************************/ -static void lutohex(FAR struct lib_outstream_s *obj, unsigned long n, uint8_t a) +static void lutohex(FAR struct lib_outstream_s *obj, unsigned long n, + uint8_t a) { bool nonzero = false; uint8_t bits; @@ -644,7 +653,8 @@ static void lutobin(FAR struct lib_outstream_s *obj, unsigned long n) * Name: lutoascii ****************************************************************************/ -static void lutoascii(FAR struct lib_outstream_s *obj, uint8_t fmt, uint8_t flags, unsigned long ln) +static void lutoascii(FAR struct lib_outstream_s *obj, uint8_t fmt, + uint8_t flags, unsigned long ln) { /* Perform the integer conversion according to the format specifier */ @@ -827,7 +837,8 @@ static void llutodec(FAR struct lib_outstream_s *obj, unsigned long long n) * Name: llutohex ****************************************************************************/ -static void llutohex(FAR struct lib_outstream_s *obj, unsigned long long n, uint8_t a) +static void llutohex(FAR struct lib_outstream_s *obj, unsigned long long n, + uint8_t a) { bool nonzero = false; uint8_t bits; @@ -894,7 +905,8 @@ static void llutobin(FAR struct lib_outstream_s *obj, unsigned long long n) * Name: llutoascii ****************************************************************************/ -static void llutoascii(FAR struct lib_outstream_s *obj, uint8_t fmt, uint8_t flags, unsigned long long lln) +static void llutoascii(FAR struct lib_outstream_s *obj, uint8_t fmt, + uint8_t flags, unsigned long long lln) { /* Perform the integer conversion according to the format specifier */ @@ -1164,7 +1176,8 @@ static void postjustify(FAR struct lib_outstream_s *obj, uint8_t fmt, * libc/stdio/lib_vsprintf ****************************************************************************/ -int lib_vsprintf(FAR struct lib_outstream_s *obj, FAR const char *src, va_list ap) +int lib_vsprintf(FAR struct lib_outstream_s *obj, FAR const IPTR char *src, + va_list ap) { FAR char *ptmp; #ifndef CONFIG_NOPRINTF_FIELDWIDTH @@ -1616,5 +1629,3 @@ int lib_vsprintf(FAR struct lib_outstream_s *obj, FAR const char *src, va_list a return obj->nput; } - - diff --git a/libc/stdio/lib_printf.c b/libc/stdio/lib_printf.c index f4289c9b574..70884523936 100644 --- a/libc/stdio/lib_printf.c +++ b/libc/stdio/lib_printf.c @@ -86,7 +86,7 @@ * Name: printf ****************************************************************************/ -int printf(FAR const char *fmt, ...) +int printf(FAR const IPTR char *fmt, ...) { va_list ap; int ret; diff --git a/libc/stdio/lib_snprintf.c b/libc/stdio/lib_snprintf.c index 53e9a2cbcc9..ca27bb0b467 100644 --- a/libc/stdio/lib_snprintf.c +++ b/libc/stdio/lib_snprintf.c @@ -80,7 +80,7 @@ * sprintf ****************************************************************************/ -int snprintf(FAR char *buf, size_t size, const char *format, ...) +int snprintf(FAR char *buf, size_t size, FAR const IPTR char *format, ...) { union { diff --git a/libc/stdio/lib_sprintf.c b/libc/stdio/lib_sprintf.c index 5420e1e5390..e857c79cab7 100644 --- a/libc/stdio/lib_sprintf.c +++ b/libc/stdio/lib_sprintf.c @@ -76,7 +76,7 @@ * sprintf ****************************************************************************/ -int sprintf (FAR char *buf, const char *fmt, ...) +int sprintf (FAR char *buf, FAR const IPTR char *fmt, ...) { struct lib_memoutstream_s memoutstream; va_list ap; diff --git a/libc/stdio/lib_vasprintf.c b/libc/stdio/lib_vasprintf.c index 53e0a157069..e74cce46cc1 100644 --- a/libc/stdio/lib_vasprintf.c +++ b/libc/stdio/lib_vasprintf.c @@ -112,7 +112,7 @@ * ****************************************************************************/ -int vasprintf(FAR char **ptr, FAR const char *fmt, va_list ap) +int vasprintf(FAR char **ptr, FAR const IPTR char *fmt, va_list ap) { struct lib_outstream_s nulloutstream; struct lib_memoutstream_s memoutstream; diff --git a/libc/stdio/lib_vdprintf.c b/libc/stdio/lib_vdprintf.c index 26959b5de82..9c76078d6eb 100644 --- a/libc/stdio/lib_vdprintf.c +++ b/libc/stdio/lib_vdprintf.c @@ -48,7 +48,7 @@ * Public Functions ****************************************************************************/ -int vdprintf(int fd, FAR const char *fmt, va_list ap) +int vdprintf(int fd, FAR const IPTR char *fmt, va_list ap) { struct lib_rawoutstream_s rawoutstream; diff --git a/libc/stdio/lib_vfprintf.c b/libc/stdio/lib_vfprintf.c index 328fc42f82b..783dc8b916a 100644 --- a/libc/stdio/lib_vfprintf.c +++ b/libc/stdio/lib_vfprintf.c @@ -76,7 +76,7 @@ * Public Functions ****************************************************************************/ -int vfprintf(FAR FILE *stream, FAR const char *fmt, va_list ap) +int vfprintf(FAR FILE *stream, FAR const IPTR char *fmt, va_list ap) { struct lib_stdoutstream_s stdoutstream; int n = ERROR; diff --git a/libc/stdio/lib_vprintf.c b/libc/stdio/lib_vprintf.c index 52e6fc91074..ee9a227c019 100644 --- a/libc/stdio/lib_vprintf.c +++ b/libc/stdio/lib_vprintf.c @@ -83,7 +83,7 @@ * Name: vprintf ****************************************************************************/ -int vprintf(FAR const char *fmt, va_list ap) +int vprintf(FAR const IPTR char *fmt, va_list ap) { /* vfprintf into stdout */ diff --git a/libc/stdio/lib_vsnprintf.c b/libc/stdio/lib_vsnprintf.c index ad329e173e0..6952ed5ad6e 100644 --- a/libc/stdio/lib_vsnprintf.c +++ b/libc/stdio/lib_vsnprintf.c @@ -80,7 +80,8 @@ * Name: vsnprintf ****************************************************************************/ -int vsnprintf(FAR char *buf, size_t size, const char *format, va_list ap) +int vsnprintf(FAR char *buf, size_t size, FAR const IPTR char *format, + va_list ap) { struct lib_memoutstream_s memoutstream; int n; diff --git a/libc/stdio/lib_vsprintf.c b/libc/stdio/lib_vsprintf.c index 0ad85086bf2..f919de08877 100644 --- a/libc/stdio/lib_vsprintf.c +++ b/libc/stdio/lib_vsprintf.c @@ -79,7 +79,7 @@ * Name: vsprintf ****************************************************************************/ -int vsprintf(FAR char *dest, const char *src, va_list ap) +int vsprintf(FAR char *dest, FAR const IPTR char *src, va_list ap) { struct lib_memoutstream_s memoutstream; diff --git a/libc/syslog/lib_lowsyslog.c b/libc/syslog/lib_lowsyslog.c index 7cbc59180bf..1ea85407811 100644 --- a/libc/syslog/lib_lowsyslog.c +++ b/libc/syslog/lib_lowsyslog.c @@ -93,7 +93,7 @@ * ****************************************************************************/ -static inline int lowvsyslog_internal(FAR const char *fmt, va_list ap) +static inline int lowvsyslog_internal(FAR const IPTR char *fmt, va_list ap) { struct lib_outstream_s stream; @@ -121,7 +121,7 @@ static inline int lowvsyslog_internal(FAR const char *fmt, va_list ap) * ****************************************************************************/ -int lowvsyslog(int priority, FAR const char *fmt, va_list ap) +int lowvsyslog(int priority, FAR const IPTR char *fmt, va_list ap) { int ret = 0; @@ -154,7 +154,7 @@ int lowvsyslog(int priority, FAR const char *fmt, va_list ap) * ****************************************************************************/ -int lowsyslog(int priority, FAR const char *fmt, ...) +int lowsyslog(int priority, FAR const IPTR char *fmt, ...) { va_list ap; int ret; diff --git a/libc/syslog/lib_syslog.c b/libc/syslog/lib_syslog.c index 533f61bec5b..ca9ee014fc9 100644 --- a/libc/syslog/lib_syslog.c +++ b/libc/syslog/lib_syslog.c @@ -92,7 +92,7 @@ * ****************************************************************************/ -static inline int vsyslog_internal(FAR const char *fmt, va_list ap) +static inline int vsyslog_internal(FAR const IPTR char *fmt, va_list ap) { #if defined(CONFIG_SYSLOG) struct lib_outstream_s stream; @@ -190,7 +190,7 @@ static inline int vsyslog_internal(FAR const char *fmt, va_list ap) * ****************************************************************************/ -int vsyslog(int priority, FAR const char *fmt, va_list ap) +int vsyslog(int priority, FAR const IPTR char *fmt, va_list ap) { int ret = 0; @@ -220,7 +220,7 @@ int vsyslog(int priority, FAR const char *fmt, va_list ap) * ****************************************************************************/ -int syslog(int priority, FAR const char *fmt, ...) +int syslog(int priority, FAR const IPTR char *fmt, ...) { va_list ap; int ret; From ae71c9b4473443cc0d11a1ad3779b538427466fb Mon Sep 17 00:00:00 2001 From: Vladimir Komendantskiy Date: Tue, 5 Jan 2016 10:58:58 -0600 Subject: [PATCH 24/29] Fix a compile time error in drivers/net/tun.c. --- ChangeLog | 5 ++- drivers/net/tun.c | 91 ++++++++++++++++++----------------------------- 2 files changed, 39 insertions(+), 57 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d1113ba381..b7c3f724d20 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11284,4 +11284,7 @@ example, 'const char' and 'const char*'. For Atmel compiler these will become 'const __flash char' and 'const __memx char*'. All printf() functions and syslog() functions are changed so that the qualifier is - used with the format parameter. From Dimitry Kloper. + used with the format parameter. From Dimitry Kloper (2016-01-05). + * drivers/net/tun.c: Fix a compile time error in the TUN driver. From + Vladimir Komendantskiy (2016-01-05). + diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 088e063ab19..97a4fd7d266 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -425,75 +425,54 @@ static void tun_receive(FAR struct tun_device_s *priv) /* We only accept IP packets of the configured type and ARP packets */ -#ifdef CONFIG_NET_IPv4 +#if defined(CONFIG_NET_IPv4) + nllvdbg("IPv4 frame\n"); + NETDEV_RXIPV4(&priv->dev); + + /* Give the IPv4 packet to the network layer */ + + ipv4_input(&priv->dev); + + /* If the above function invocation resulted in data that should be + * sent out on the network, the field d_len will set to a value > 0. + */ + + if (priv->dev.d_len > 0) { - nllvdbg("IPv4 frame\n"); - NETDEV_RXIPV4(&priv->dev); - - /* Give the IPv4 packet to the network layer */ - - ipv4_input(&priv->dev); - - /* If the above function invocation resulted in data that should be - * sent out on the network, the field d_len will set to a value > 0. - */ - - if (priv->dev.d_len > 0) - { - priv->write_d_len = priv->dev.d_len; - tun_transmit(priv); - } - else - { - priv->write_d_len = 0; - tun_pollnotify(priv, POLLOUT); - } + priv->write_d_len = priv->dev.d_len; + tun_transmit(priv); } else -#endif - -#if 0 -#ifdef CONFIG_NET_IPv6 - if (BUF->type == HTONS(ETHTYPE_IP6)) { - nllvdbg("Iv6 frame\n"); - NETDEV_RXIPV6(&priv->dev); + priv->write_d_len = 0; + tun_pollnotify(priv, POLLOUT); + } - /* Give the IPv6 packet to the network layer */ +#elif defined(CONFIG_NET_IPv6) + nllvdbg("Iv6 frame\n"); + NETDEV_RXIPV6(&priv->dev); - ipv6_input(&priv->dev); + /* Give the IPv6 packet to the network layer */ - /* If the above function invocation resulted in data that should be - * sent out on the network, the field d_len will set to a value > 0. - */ + ipv6_input(&priv->dev); - if (priv->dev.d_len > 0) - { - /* Update the Ethernet header with the correct MAC address */ + /* If the above function invocation resulted in data that should be + * sent out on the network, the field d_len will set to a value > 0. + */ -#ifdef CONFIG_NET_IPv4 - if (IFF_IS_IPv4(priv->dev.d_flags)) - { - arp_out(&priv->dev); - } - else -#endif -#ifdef CONFIG_NET_IPv6 - { - neighbor_out(&priv->dev); - } -#endif - - /* And send the packet */ - - tun_transmit(priv); - } + if (priv->dev.d_len > 0) + { + priv->write_d_len = priv->dev.d_len; + tun_transmit(priv); } else -#endif { - NETDEV_RXDROPPED(&priv->dev); + priv->write_d_len = 0; + tun_pollnotify(priv, POLLOUT); } + +#else + NETDEV_RXDROPPED(&priv->dev); #endif } From 06438b0dcc59ba29328a7b199d697975ab8ea96d Mon Sep 17 00:00:00 2001 From: Dimitry Kloper Date: Mon, 4 Jan 2016 22:01:47 +0200 Subject: [PATCH 25/29] Fix 64-bit clock-related constant value evaluation for AVR compiler This may be specific for Atmel AVR8 toolchain compiler. The problem is that despite of being 8-bit architecture avr-gcc supports uint64_t, but the following code uint64_t value = 10000 * 1000; produces a wrong negative value in the final code (tested both with and without optimization). The work-around is simple: uint64_t value = 10000 * 1000L; The code is a reduced part from sched/signal/sig_timedwait.c where waitticks64 is calculated using NSEC_PER_TICK. This one is defined as USEC_PER_TICK * NSEC_PER_USEC which leads to the example above. --- include/nuttx/clock.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/nuttx/clock.h b/include/nuttx/clock.h index c091300dbb1..49659f04cb0 100644 --- a/include/nuttx/clock.h +++ b/include/nuttx/clock.h @@ -98,16 +98,16 @@ /* Timing constants *********************************************************/ -#define NSEC_PER_SEC 1000000000 -#define USEC_PER_SEC 1000000 -#define MSEC_PER_SEC 1000 -#define DSEC_PER_SEC 10 -#define NSEC_PER_DSEC 100000000 -#define USEC_PER_DSEC 100000 -#define MSEC_PER_DSEC 100 -#define NSEC_PER_MSEC 1000000 -#define USEC_PER_MSEC 1000 -#define NSEC_PER_USEC 1000 +#define NSEC_PER_SEC 1000000000L +#define USEC_PER_SEC 1000000L +#define MSEC_PER_SEC 1000L +#define DSEC_PER_SEC 10L +#define NSEC_PER_DSEC 100000000L +#define USEC_PER_DSEC 100000L +#define MSEC_PER_DSEC 100L +#define NSEC_PER_MSEC 1000000L +#define USEC_PER_MSEC 1000L +#define NSEC_PER_USEC 1000L /* If CONFIG_SCHED_TICKLESS is not defined, then the interrupt interval of * the system timer is given by USEC_PER_TICK. This is the expected number From 670ac9fb2f4bd6de7b43918eafc5ac590ac7a21d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 5 Jan 2016 14:46:49 -0600 Subject: [PATCH 26/29] Fix an ommission in compiler.h --- configs | 2 +- include/nuttx/compiler.h | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/configs b/configs index d4540c0f833..16d7a0dab2c 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit d4540c0f83378a6680ffd792ff1e4a8ca0ddd8b8 +Subproject commit 16d7a0dab2c4a48583d40bcf1dbf8e9a74316e91 diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index 4ad24004566..f14d55c152f 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -147,12 +147,17 @@ # undef CONFIG_PTR_IS_NOT_INT #elif defined(__AVR__) - +# if defined(CONFIG_AVR_HAS_MEMX_PTR) /* I-space access qualifiers needed by Harvard architecture */ -# if defined(CONFIG_AVR_HAS_MEMX_PTR) # define IOBJ __flash # define IPTR __memx + +# else +/* No I-space access qualifiers */ + +# define IOBJ +# define IPTR # endif /* Select the small, 16-bit addressing model */ From b28bf55fb0b1a27ba80e8f02fe1ae9f396e26309 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 5 Jan 2016 14:52:09 -0600 Subject: [PATCH 27/29] Cosmetic spacing change --- include/nuttx/compiler.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index f14d55c152f..858902f696f 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -136,11 +136,11 @@ /* Select the small, 16-bit addressing model */ -# define CONFIG_SMALL_MEMORY 1 +# define CONFIG_SMALL_MEMORY 1 /* Long and int are not the same size */ -# define CONFIG_LONG_IS_NOT_INT 1 +# define CONFIG_LONG_IS_NOT_INT 1 /* Pointers and int are the same size */ @@ -156,17 +156,17 @@ # else /* No I-space access qualifiers */ -# define IOBJ -# define IPTR +# define IOBJ +# define IPTR # endif -/* Select the small, 16-bit addressing model */ +/* Select the small, 16-bit addressing model (for D-Space) */ -# define CONFIG_SMALL_MEMORY 1 +# define CONFIG_SMALL_MEMORY 1 /* Long and int are not the same size */ -# define CONFIG_LONG_IS_NOT_INT 1 +# define CONFIG_LONG_IS_NOT_INT 1 /* Pointers and int are the same size */ @@ -186,7 +186,7 @@ /* Select the small, 16-bit addressing model */ -# define CONFIG_SMALL_MEMORY 1 +# define CONFIG_SMALL_MEMORY 1 /* Normally, mc68hc1x code is compiled with the -mshort option * which results in a 16-bit integer. If -mnoshort is defined @@ -196,7 +196,7 @@ # if __INT__ == 16 /* int is 16-bits, long is 32-bits */ -# define CONFIG_LONG_IS_NOT_INT 1 +# define CONFIG_LONG_IS_NOT_INT 1 /* Pointers and int are the same size (16-bits) */ @@ -208,7 +208,7 @@ /* Pointers and int are NOT the same size */ -# define CONFIG_PTR_IS_NOT_INT 1 +# define CONFIG_PTR_IS_NOT_INT 1 # endif #else From ce2a0b6b51c44858547470fe192fe90c7d2a5994 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 6 Jan 2016 10:05:39 -0600 Subject: [PATCH 28/29] Eliminate a warning --- arch | 2 +- configs | 2 +- drivers/serial/serial.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch b/arch index 0761b677efa..2b89cb7d768 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 0761b677efa861b6369cea195968a59e4a6e6860 +Subproject commit 2b89cb7d768c94c11a3902e85fd0858c4033ef74 diff --git a/configs b/configs index 16d7a0dab2c..dd63cfca08a 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit 16d7a0dab2c4a48583d40bcf1dbf8e9a74316e91 +Subproject commit dd63cfca08a5a3baf8e829080bf9580723765566 diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 378a696b4c4..32d2a073ad5 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -900,7 +900,7 @@ static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg) irqrestore(state); - *(int *)arg = count; + *(FAR int *)((uintptr_t)arg) = count; ret = 0; } break; @@ -923,7 +923,7 @@ static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg) irqrestore(state); - *(int *)arg = count; + *(FAR int *)((uintptr_t)arg) = count; ret = 0; } break; From 31294fb46804503e383530cd0b7ea21599e27653 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 7 Jan 2016 08:15:00 -0600 Subject: [PATCH 29/29] Update submodules --- Documentation | 2 +- arch | 2 +- configs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation b/Documentation index b4e33ca73c4..4217e1a644a 160000 --- a/Documentation +++ b/Documentation @@ -1 +1 @@ -Subproject commit b4e33ca73c44aaca5f6986650e6d215a4d5adcab +Subproject commit 4217e1a644a0dfe8f111ab07f9df38af2ea906d7 diff --git a/arch b/arch index 2b89cb7d768..ea52a0fb857 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 2b89cb7d768c94c11a3902e85fd0858c4033ef74 +Subproject commit ea52a0fb857e10b4def9c68ef355db1390be213b diff --git a/configs b/configs index dd63cfca08a..d28a8f8d19c 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit dd63cfca08a5a3baf8e829080bf9580723765566 +Subproject commit d28a8f8d19ce051147cf27eb7f85668ea588d33c