Commit Graph

264 Commits

Author SHA1 Message Date
Nathan Hartman
3aac01e843 libs/libc/machine/arm/armv7-m/arch_sqrtf.c: Fix a copy-paste typo in a #error message. 2019-09-22 16:14:30 -06:00
Juha Niskanen
5c853cd1dc libs/libc/unistd/lib_getcwd.c: remove stray sched_unlock(). Also fixes several typos. 2019-09-20 06:23:48 -06:00
Juha Niskanen
e8b5dd4528 Fix use of undefined pp-token #errror, other typos. 2019-09-19 18:19:18 -06:00
Gregory Nutt
ecb0b15fd0 libs/libc/math/Kconfig: Should select the NuttX float.h file automatically if the NuttX math library is selected. 2019-09-16 13:29:47 -06:00
Gregory Nutt
2925c28f8f All linker scripts: Preface all _edata defininitions with . = ALIGN(4). Otherwise, the last bytes in the .data section may not be initialized properly. Also convert all linker scripts indent in units of 8-spaces to units of 4-spaces. 2019-09-15 17:22:16 -06:00
Gregory Nutt
254a906409 libs/libc/builtin/: builtint_isavail() should not set the errno variable because this functions may be used by internal OS logic for which setting the rrno variable would be inappropriate. 2019-09-11 12:37:29 -06:00
Gregory Nutt
46d435fc65 Various cosmetic changes. 2019-09-09 14:47:47 -06:00
Nathan Hartman
91ef2ec394 Fix a few minor typos 2019-09-08 15:59:14 -06:00
Gregory Nutt
38ada48454 libc/libc/unistd/: Add stubs for setreuid(), and setregid(). NuttX does not currently support effective user/group IDs, but these stubs will support linkage of applications that expect these POSIX standard interfaces. 2019-09-03 11:35:31 -06:00
Gregory Nutt
a2bf7057f6 libc/libc/unistd/: Add stubs for geteuid(), getegid(), seteuid(), and setegid(). NuttX does not currently support effective user/group IDs, but these stubs will support linkage of appliations that expect these POSIX standard interfaces. 2019-09-03 10:57:51 -06:00
Pavel Pisa
f865b72433 libs/libc/libc.csv: Add ioctl() to fs_ioctl() wrapper for varidic case. 2019-08-28 07:11:02 -06:00
Gregory Nutt
5f02b0335f syscall/ and related: Fix an error found in build testing. Inconsistent conditional compilation led to link errors in certain configurations. 2019-08-27 16:41:07 -06:00
Gregory Nutt
65aabe3048 libs/symtab: move symtab/ to libs/symtab. Let's no clutter up the top level directory. Shorten CONFIG_EXECFUNCS_GENERATE_SYSTEM_SYSTAB to just CONFIG_EXECFUNCS_SYSTEM_SYMTAB. Some items in syscall/syscall.csv are only valid when CONFIG_LIB_SYSCALL is defined. That is always defined when really building the syatem calls, but causes errors in libs/symtab because they are not valid in the normal, FLAT build context. 2019-08-25 19:28:04 -06:00
Gregory Nutt
da9433a4c7 Fix another warnings and an error in typing introduced in the previous commit related to BINFS in PROTECTED mode. 2019-08-25 18:37:23 -06:00
Gregory Nutt
19b94da468 Fix a couple of warnings in last commit (one was really an error). 2019-08-25 17:37:13 -06:00
Gregory Nutt
f751aff7fe boards/boardctl.c and libs/libc/builtin: The BINFS file system uses the same builtin library and builtin arrays as does NSH. The builtin arrays are simple name-value pairs that map builtin function names with the user-space entry point. In the FLAT build, the builtin arrays are available everywhere via the backdoor left open by the FLAT address space. In the PROTECTED build, however, the kernel must maintain its own reference to the user-space builtin array. This commits adds those kernel globals and a new boardctl(BOARDIOC_BUILTINS) that can be used by applications to the provide the builtin list reference to the kernel. 2019-08-25 16:58:43 -06:00
Gregory Nutt
3c30cf1f05 Squashed commit of the following:
task_spawn() and posix_spawn() are NuttX OS interfaces.  In PROTECTED and KERNEL build modes, then can be reached from applications only via a system call.  Currently, the number of parameters in a system call is limited to six; these spawn function have seven parameters.  Rather than extend the maximum number of parameters across all architectures, I opted instead to marshal the seven parameters into a structure.
     *

In order to support builtin in function in protected mode, a task_spawn() system call must be supported.  Unfortunately this is overly complex because there is a (soft) limit of 6 parameters in a system call; task_spawn has seven paramters.  This is a soft limit but still difficult to extend because it involves assembly language changes to numerous architectures.  Better to get more creative.
2019-08-23 13:20:52 -06:00
Gregory Nutt
a2d8e108a6 libs/libc/Kconfig: Correct a typo in Kconfig file. 2019-08-23 11:07:09 -06:00
Gregory Nutt
dd97fb991b This commit moves shared builtin information out of binfmt/libbuiltin and into libs/libc/builtin where it can be shared. This should permit builtin application in the PROTECTED build where binfmt/libbuiltin is not available in user space.
Squashed commit of the following:

    Correct some additional compile-related issues.

    Move  include/nuttx/binfmt/builtin.h to include/nuttx/lib/builtin.h.  Move apps/builtin/lib_builtin_forindex.c to libs/libc/builtin/lib_builtin_forindex.c.

    Move binfmt/libbuiltin to libs/libc/builtin.  There are calls made directly from apps/nshlib into this logic and hence, must be part of a library that can be shared between the OS and applications.
2019-08-23 09:07:40 -06:00
Pavel Pisa
c7a4720a51 libs/libc/libc.csv: Add some missing C library functions. 2019-08-15 14:35:00 -06:00
Pavel Pisa
380198c985 symtab/, tools/: NuttX provides lists of available syscalls and library functions and tools to process them. The lists can be used to build symbol table which allows runtime program loading which can reuse functions already compiled into NuttX system image. List processing, compilation and linking to the final system image has been possible only under manual control until now.
Provided changes add option (CONFIG_EXECFUNCS_GENERATE_SYSTEM_SYMTAB) to build complete list of available functions and syscalls automatically.  The symbolic table is generated in form libsymtab.a which can be reused by application or directly pull in when "g_symtab" and "g_nsymbols" variables are requested by EXECFUNCS configuration.

I have tried to follow mechanisms for library compilation in different kernel protection modes but tested only flat no-MMU build. The basic assumption is that this library and libraries providing syscall stubs and C-library functions are available in user-space context and initial application (usually NSH) registers the symbol table through IOCTL.  The table can be reused then by another applications in their address space as kernel allows. Simple for flat or protected mode, I am not sure if really support in MMU mode. It is highly probable that I have made some mistake, overlooked something, but functionality is optional (should not cause troubles in any mode if disabled) and main purpose is to lower memory overhead when more applications are loaded on memory constrained system which usually use direct kernel calling without protection or address space separation. If the table should be provided by kernel to applications then makefiles has to be adjusted.
2019-08-13 09:09:43 -06:00
Pavel Pisa
e3c2a0238a libs/libc/libc.csv: Correct dependency of setlocale on CONFIG_LIBC_LOCALE. 2019-08-13 08:58:04 -06:00
Pavel Pisa
2d9fb956aa libs/libc/math.csv: Correct format of some function entries. 2019-08-13 08:56:38 -06:00
Gregory Nutt
eb5a8c7cea libs/libc/grp and pwd: Revisit file looks. Use uintptr_t vs void* to incode mixed pointers and integer values. 2019-08-11 11:26:09 -06:00
Gregory Nutt
e6da85deb3 sched/group/group_setuid.c and group_setguid.c: Verify that the UID/GID is within range. 2019-08-10 10:42:53 -06:00
Gregory Nutt
240926c995 Beginning to update comments to reflect new organization of the boards/ sub-directory. 2019-08-08 08:46:54 -06:00
Gregory Nutt
ec5120f69e sched/group and syscall/: Implement 'real' setuid, getuid, setgid, and getgid interfaces. These will be inheritance by all child task groups. 2019-08-06 14:13:43 -06:00
Gregory Nutt
945e27d85c libs/libc/unistd.h: Add getuid() and getgid() to match Michael Jung's setuid() and setgid(). 2019-08-06 12:38:43 -06:00
Michael Jung
e8af615578 libs/libc/unistd: Stubs for setuid and setgid. Added stubbed implementations of setuid and setgid. These functions are essentially stubs pretending that NuttX supported users and groups and that the only configured user and group in the system were both 'root' with a uid and a gid of 0, respectively. The intent is not to provide meaningful new features, but to ease porting of foreign source code to NuttX. 2019-08-06 07:17:23 -06:00
Gregory Nutt
721994846c tools/: Change preferred argument of configurations tools to use ':' as the delimiter between <board-name> and <config-name>. This is to emphasize that this is not a path; it is configuration specification.
The legacy '/' delimiter is still supported but not recommend and not advertised.

Squashed commit of the following:

    Update configurations instructions in more README.txt files to show ':' delimiter vs '/' delimiter.
    Update configurations instructions in various README.txt file to show ':' delimiter vs '/' delimiter.
    tools:  Update all configuration-related tools to accept ':' separator between board and configuration name.
2019-08-05 16:55:51 -06:00
Gregory Nutt
615c0ea7ee Change naming configs/ to boards in comments, Documentation, etc. Still a few more to go. 2019-08-05 07:13:48 -06:00
Gregory Nutt
89da9f2fea libs/libc/pwd and libs/libc/grp: Modify to giet user/group data from /etc/passwd and /etc/group if so configurated.
Squashed commit of the following:

    Last minute clean-up
    libs/libc/grp/lib_find_grpfile.c:  Fix some problems found in testing.
    libs/libc/pwd:  Finishes off implementation using /etc/passwd.
    libs/libc/grp:  Finishes off implementation using /etc/group.
    libs/libc/pwd/lib_find_pwdfile.c:  Add logic to look up user information in /etc/passwd file, if available.
    libs/libc/grp/lib_find_grpfile.c:  Add logic to look up group information in /etc/group file, if available.
2019-08-04 13:32:36 -06:00
Michael Jung
f3c85bd253 libc/pwd: Added stubbed implementations
Added stubbed implementations of getpwuid, getpwuid_r, getpwnam, and
getpwnam_r.  These functions are essentially stubs pretending that NuttX
supported users and that the only configured user in the system was 'root'
with uid 0.  The intend is not to provide meaningful new features, but to ease
porting of foreign source code to NuttX.
2019-08-04 07:18:58 -06:00
Gregory Nutt
2fcff93d20 libs/libc/grp/lib_grp.c: Fix a warning when compiling on a 64-bit simulation. Cannot cast a pointer to unsigned in that case because unsigned (int) is only 32-bits, but the pointer is 64-bits. 2019-08-03 08:41:55 -06:00
Michael Jung
1af4c94391 libc/grp: Added stubbed implementations of getgrgid, getgrgid_r, getgrnam, getgrnam_r, and initgroups. These functions are essentially stubs pretending that NuttX supported groups and that the only configured group in the system was 'root' with gid 0. The intend is not to provide meaningful new features, but to ease porting of foreign source code to NuttX. 2019-08-03 08:23:04 -06:00
Gregory Nutt
534acb8281 libs/libc/dirent/lib_scandir.c: Do not build in PROTECTED or KERNEL mode builds. Add FAR to some pointers. Minor comment updates. 2019-07-31 11:16:18 -06:00
Michael Jung
ded8711261 libs/libc/dirent/: Added alphasort, scandir and DT_* defines
- Added an alphasort implementation
- Added a scandir implementation
- Added DT_* literals to include/dirent.h: Apparently those are not required by POSIX, but are part of 4.3BSD and available in glibc as well.
2019-07-31 07:53:14 -06:00
Masayuki Ishikawa
5bf674a99f Merged in masayuki2009/nuttx.nuttx/fix_build_error_for_elf (pull request #959)
libs/libc/machine/arm/armv7-m: Fix build error for elf

Signed-off-by: Masayuki Ishikawa <masayuki.ishikawa@gmail.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-07-30 13:08:59 +00:00
David S. Alessio
f2b96016ad libs/libc/machine/arm/armv7-m: Add Cortex M4F mach optimized fabsf and sqrtf. 2019-07-29 20:27:33 -06:00
Gregory Nutt
9f24fb5b4b sched/: Add some missing FAR. Update some comments. 2019-07-29 15:04:39 -06:00
Gregory Nutt
eef2f4599e Commit 933e9e407b broke the simulator on a 64-bit platform. 2019-07-29 14:34:29 -06:00
David Sidrane
933e9e407b libs/libc/stdio/lib_libvsprintf.c: Add support for the size_t integer qualifier 'z'. This is kind of tricky due the variety of sizeof(size_t) on different platforms. 2019-07-24 12:49:56 -06:00
Michael Jung
b9d2e516ef libs/libc/netdb: Implemented the netdb functions getnameinfo(), getservbyport(), and getservbyport_r(). 2019-06-30 15:12:34 -06:00
Eduard Niesner
056eebd9da arch/arm/src/stm32h7: Ported the QEncoder from F7 to H7. 2019-06-27 07:07:55 -06:00
Gregory Nutt
40179da030 Squashed commit of the following:
libs/libc/misc/Make.defs:  For platforms whose CPP tool does not support a variable number arguments to pre-processor macros, we may still need to build the debug functions even when CONFIG_DEBUG_FEATURES is not selected.  For example, __alert() may be needed is CONFIG_ARCH_STACKDUMP is set.

    configs/makerlisp:  Add an sdboot configuration that will load .hex files from the SD card.
2019-06-26 14:37:19 -06:00
Adam Porter
3505cce201 drivers/usbhost/usbhost_composite.c: The cfgdesc pointer was initialized after the buffer had been advanced, so it was not pointing where it should. The totallen operations at the end of the function ended up overwriting memory belonging to the first copied interface descriptor. 2019-06-22 07:27:15 -06:00
Gregory Nutt
611eb12074 configs/makerlisp: Add Smart Flash Programmer project. Updae a README. 2019-06-12 07:38:54 -06:00
Gregory Nutt
417e681cbb libs/libc/time/lib_gmtimer.c: Spurious reorganization of a loop to work around and ZDD-II internal compiler error. Might be a little bigger now, but is also probably a more structured use of C. 2019-06-10 09:50:33 -06:00
Gregory Nutt
4e98980045 Add initial support for the MakerLisp eZ80 board. Ref: https://makerlisp.com/
Squashed commit of the following:

    configs/makerlisp:  Update comments about use of serial console.

    configs/makerlisp:  Add LED support, remove vestiges of button support (the board has no user buttons).  Add support for SPI-based MMC/SD card slot.

    arch/z80/src/ez80:  Fix some link problems.

    libs/libc/syslog/lib_syslog.c:  The ZDS-II toolchain does not declare va_coy in stdarg.h.  I think that the use of va_copy in vsyslog() is no necessary.

    configs/makerlisp:  Initial configuration directories cloned from ez80f910200zco with little more than naming changes.
2019-06-04 11:12:17 -06:00
Gregory Nutt
622c272ea3 Clean up some variouis compiler problems using SDCC to compiler Z180. 2019-06-03 18:16:23 -06:00
Gregory Nutt
7ab149d8e9 Various fixes to get a clean compile with the SDCC compiler. Compile is 'almost' clean. 2019-06-03 16:53:11 -06:00
Gregory Nutt
84a57f8fa0 Fix several ZNeo compile issues. There are more. Pthreads: Fix a could of places where FAR was added when it is not appropriate. This matters to ZNeo which depends on definitions of NEAR and FAR points. 2019-06-03 13:06:58 -06:00
Gregory Nutt
25f42dd076 libs/libc/time/: Costmetic changes to make gmtime() and gmtimer() follow the coding standard more closely. 2019-06-03 11:18:17 -06:00
Gregory Nutt
2dae0ef0db mm/mm_heap/mm_sem.c: Fix error that occurs when CONFIG_CPP_HAVE_VARARGS is not defined. In that case, the arguments to the debug macro will all be evaluated even though they are not used any variables that are references must at least be defined. 2019-06-03 09:02:55 -06:00
Gregory Nutt
d375a26a6c libs/libc/stdio: Fix long long usage in all of the newer printf-related logic: The selection CONFIG_LIBC_LONG_LONG must be ignored if the architecture does not support long long types. 2019-06-03 08:45:57 -06:00
Gregory Nutt
abf6965c24 Squashed commit of the following:
libs/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    syscall/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    wireless/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    Documentation/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    include/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    drivers/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    sched/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    configs:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/xtensa:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/z80:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/x86:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/renesas and arch/risc-v:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/or1k:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/misoc:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/mips:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/avr:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/arm:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
2019-04-29 14:52:05 -06:00
Joao Matos
a095dcd6bf libs/libc/misc/lib_utsname.c: Fixed return code in uname(). 2019-04-04 10:40:39 -06:00
Joao Matos
251009de3a libs/libc/locale/lib_setlocale.c: Improved error handling in setlocale(). 2019-04-04 10:38:57 -06:00
Joao Matos
8f5a94c5e5 include/pthread.h and libs/libcpthread: Fixed pthread_attr_get/setstacksize param type to size_t. 2019-04-04 10:33:57 -06:00
Jussi Kivilinna
fd4db67b43 libs/libc/stdio/lib_libvsprintf.c: Restore support for printing NULL string as "(null)". Legacy printf supported printing "(null)" in place for NULL string:
printf("null: %s\n", NULL); => null: (null).

This commit restores this functionality for new printf library.
2019-04-04 06:31:25 -06:00
Gregory Nutt
5812bbeb04 Update ReleaseNotes in preparation for NuttX-7.29 release. 2019-03-24 17:58:51 -06:00
Gregory Nutt
0e4051a6b6 libs/libc/string/lib_strsep.c: Fix typo that I introduced in the review. 2019-03-19 12:17:04 -06:00
zhangyuan7
471a18ee4d arch/arm: Add the initial cortex-a7 archtiecture support 2019-03-19 11:51:29 -06:00
Xiang Xiao
64252a298f arch/: Unify the cache interface for all architectures 2019-03-19 10:37:13 -06:00
Xiang Xiao
2f208fdde8 arch/Kconfig: Move FPU options to a common place and unify the usage by removing ARCH_CORTEXRxF. 2019-03-19 10:26:15 -06:00
anchao
bb8648e7a0 ibs/libc/Makefile, libs/libnx/Makefile, and mm/Makefile: Remove obj-path MKDEPS option since make dependency target (MT) is not supported by some toolchains. 2019-03-19 10:14:50 -06:00
Xiang Xiao
e26fa54252 libs/libc/netdb: Support the nameserver change notification then we can pass dns info from server to client in usrsock case. 2019-03-19 10:02:10 -06:00
anchao
6e69dba341 binfmt/libelf/ and libs/libc/modlib: Add symbol buffer table to reduce filesystem access. 2019-03-19 09:13:50 -06:00
anchao
2f2d432f7c binfmt/libelf and libs/libc/modlib: Add relocation buffer table to reduce access fs. 2019-03-19 08:57:13 -06:00
Xiang Xiao
756c9f4eac libs/libc/string/lib_strsep.c: Add strsep BSD/Linux function. 2019-03-19 08:25:29 -06:00
Joao Matos
7b92f1417b libs/libc/libc.csv: Needed for correct compilation if not using CONFIG_LIBC_WCHAR 2019-03-18 12:26:43 -06:00
Joao Matos
a51b52ffac libs/libc/libc.csv: Should be locale.h not local.h. 2019-03-18 11:26:31 -06:00
Gregory Nutt
db2310bd5a lib_gethostbyaddrr.c edited online with Bitbucket 2019-03-11 03:55:08 +00:00
Kejun ZHOU
f33ed3c8c0 *Merged in zhoukejun/nuttx_nucleo-f767zi (pull request #838)
Add three patches  about STM32 intherupts and network loopback files

* Add the missing macro STM32_IRQ_NIRQS used by ./arch/arm/src/stm32f7/stm32_irq.c

    Signed-off-by: Kejun ZHOU <zhoukejun@outlook.com>

* The struct in_addr doesn't have the member sin_addr.

    Signed-off-by: Kejun ZHOU <zhoukejun@outlook.com>

* The function lib_lo_ipv6match() is for IPv6.
    Correct the function it calls from lib_lo_ipv4matchto() to lib_lo_ipv6match().
    Also add CONFIG_NET_IPv6 for configuration.

    Signed-off-by: Kejun ZHOU <zhoukejun@outlook.com>
2019-03-11 03:44:57 +00:00
Gregory Nutt
d851ba56e1 Update README and C comments. 2019-03-05 06:33:42 -06:00
Gregory Nutt
5fe6981c9a Squashed commit of the following:
libs/libc/pthread/pthread_spinlock.c:  Resolve several TODO issues by accessing up_testset() via the boardctl() interface rather than attempting to call it directly.

    configs/boardctl.c, include/sys/boardctl.h:  Add access to architecture-specific up_testset() via boardctl().

    arch/Kconfig's, sched/Kconfig, and include/nuttx/spinlock.h:  Spinlocks are not available unless the architecture supports the up_testset() operation.
2019-03-04 14:22:50 -06:00
Gregory Nutt
b2f110e0b0 include/pthread.h and libs/libc/pthread/pthread_spinlock.c: Add a very preliminary implementation of the new POSIX pthread_spinlock_* interfaces. This feature is marked EXPERIMENTAL. There are usage model issues to be examined and there are also architectural issues that currently limit the implemantion to the FLAT build (that is, however, fixable when the APIs are needed. 2019-02-28 10:21:05 -06:00
Gregory Nutt
dc8c814ca3 Squashed commit of the following:
Fixed coding standard error in several files.  Use of while( is incorrect; a space is required between while and (.  Also ran tools/nxstyle and fix thoses complaints as well in most files.

    Changes to comply with coding standard.  Mostly focused on files with missing space after keyword in if(, switch(, and for(.  Offending files also got changes to comply with tools nxstyle.  If there were logs of nxstyle complaints, the file also got a taste of tools/indent.sh.  Still need to fix occurrences of while( with missing space.  There are a lot of them.
2019-02-27 08:41:08 -06:00
Gregory Nutt
0951151c33 libs/libc/pthread, syscall/, and include/sys/syscall.h: Support for pthread_mutex_timedlock() was added recently, however no new system call was added for the API make is usable only in the FLAT build. With a pthread_mutex_timedlock() system call, there is no reason for a pthread_mutex_lock() system call since it is now nothing more than an wrapper around pthread_mutex_timedlock(), passing NULL for the time value. The pthread_mutex_lock() syscall was removed and the pthread_mutex_lock() implemented was moved from /sched/pthread to where it now belows in libs/libc/pthread. 2019-02-25 18:19:13 -06:00
Gregory Nutt
40889daf97 libs/libc/stdio/lib_libvsprintf.c and include/limits.h: Some minor corrections. 2019-02-21 14:52:44 -06:00
Gregory Nutt
d7586c27a5 libs/libc/stdio/Kconfig: Add 'range 9 999999' to CONFIG_LIBC_NL_ARGMAX. Per OpenGroup.org, the minimum value for NL_ARGMAX is 9. 2019-02-21 14:04:46 -06:00
Gregory Nutt
533fd0636e libs/libc/lib_libvsprintf.c and Kconfig: Remove CONFIG_LIBC_PRINT_MINIMAL. The output in that configuration is unsatisfactory and inappropriate for use with NuttX. For example, the output from many NSH commands become corrupted and useless. Doesn't belong in this context. 2019-02-21 13:53:34 -06:00
Johannes
0059a5a88e libs/libc/stdio/lib_vsprintf.c and Kconfig:
- Numbered arguments now work by using two pass parsing and an argument list.
    The maximum number of numbered args is determined by CONFIG_LIBC_NL_ARGMAX
    which is then copied into NL_ARGMAX.
  - Size of pointer argument ('p') is determined before output.

include/limits.h:  Define NL_ARGMAX (as well as some of the other 'invariant
  values' per http://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html)
2019-02-21 13:26:33 -06:00
Gregory Nutt
146c398eff libs/libc/stdio/lib_libvsprintf.c: Fix typo: PRINTF_LEVEL, not PRINT_LEVEL. 2019-02-20 08:40:27 -06:00
Gregory Nutt
05a68d175b libs/libc/stdio/Kconfig: CONFIG_LIBC_NUMBERED_ARGS now depends on EXPERIMENTAL. Per Johannes: I tested numbered arguments on i.mx rt 1050, and it isn't working. Only on Linux/MSYS 64bit all relevant data types are size 8 bytes, and therefore my loop through the arg list is working. On 32bit systems, all is 4 bytes except floating point variables which is implicit 8 byte double. 2019-02-20 08:00:35 -06:00
Johannes
88130512b8 libs/libc/stdio/lib_libvsprintf.c: Cleaned naming and allow for leading zeros in argument number (which doesn't make sense but should be). 2019-02-19 13:08:54 -06:00
Gregory Nutt
a76e137ce2 Squashed commit of the following:
sched/init/nx_start.c:  Add support for CONFIG_BOARD_DRIVER_INITIALIZE.  If this option is selected then nx_start() will call a board-provided function board_driver_initialize() immediately after calling up_initialize().

    Rename CONFIG_BOARD_INITIALIZE to CONFIG_BOARD_LATE_INITIALIZE.

    Raname board_initialize() to board_late_initialize()
2019-02-18 15:32:00 -06:00
Johannes
77aa1f1179 libs/libc/stdio/Kconfig: Need to guard LIBC_NUMBERED_ARGS against LIBC_LEGACY_PRINTF 2019-02-18 15:26:41 -06:00
Johannes
698d942f8d libs/libc/stdio/lib_libvsprintf.c: Adds configurable support for numbered arguments. 2019-02-18 11:51:22 -06:00
Gregory Nutt
a971171695 libs/libc/stdio/Make.defs: Make that else, not #else. 2019-02-17 16:07:54 -06:00
Gregory Nutt
3ff42a846e libs/libc/stdio: Rename all nano_*.c and nano_*.h files to lib_*.c and lib_*.h to emphasize that these are now the defaults, not an optional implementation. 2019-02-17 12:29:50 -06:00
Gregory Nutt
f12eda8a05 libs/libc/stdio: Rename lib_dtoa.c to legacy_dtoa.c; rename lib_libvsprint.c to legacy_libvsprintf.c 2019-02-17 12:29:35 -06:00
Gregory Nutt
76a2f6c2a2 libs/libc/stdio: This commits makes the nano-printf the defualt logic for the printf family. The legacy printf is still available via CONFIG_LIBC_PRINT_LEGACY. This commit also modifies the nano-prinf configure: The PRINT_LEVEL is not long selectable. Instead, a not CONFIG_LIBC_PRINT_MINIMAL boolean setting was added and the PRINT_LEVEL is derived from a combination of CONFIG_LIBC_PRINT_MINIMAL, CONFIG_LIBC_FLOATINGPOINT, and CONFIG_LIBC_LONG_LONG. 2019-02-17 12:29:20 -06:00
Gregory Nutt
bc5908d9fd tools/nxstyle.c: Beef up logic that detects multiple variable definitions per line. 2019-02-17 10:57:28 -06:00
Johannes
af75330012 libs/libc/stdio/nano_libvsprintf.c: Added hh type modifier (without extending the flag variable). 2019-02-17 07:27:47 -06:00
Gregory Nutt
67b16613ba libs/libc/stdio/lib_dtoa.c: Lots of risky turmoil to get this file closer to the NuttX coding style. Seems to check out, but still risky. libs/libc/stdio/lib_libdtoa.c: A fix for the %g format. The algorithm will sometimes generate number greater than the precision of type double. This adds a check if the precision has been exceeded and logic to remove the least significant garbage. 2019-02-16 18:08:38 -06:00
Gregory Nutt
653ff2c34e Restore lib_sprintf(). It was removed because I thought was not used. But I was wrong; there is logic in drivers/syslog that depends on lib_sprintf().
This commits reverts a part of commit c271151d57.  That commit also removed lib_sscanf() which really is not needed.
2019-02-16 12:29:00 -06:00
Johannes
739561ab34 libs/libc/stdio/Make.defs: lib_dtoa.c is only used in the LIBC_CONFIG_NANO_PRINTF=n case. 2019-02-16 09:45:13 -06:00
Gregory Nutt
4bd2a9e1b2 libs/libc/stdio/nano_libvsprintf.c: Fix compile error introduced by my review of last commit. Fix some coding standard violations and a few other cosmetics. 2019-02-16 06:28:23 -06:00
Johannes
41a4a40879 libs/libc/stdio/nano_libvsprintf.c: Add long long support. CONFIG_LIBC_LONG_LONG needs at least CONFIG_NANO_PRINTLEVEL 2. Code size for compile without CONFIG_LIBC_LONG_LONG shouldn't be affected. 2019-02-15 19:10:40 -06:00