Commit Graph

382 Commits

Author SHA1 Message Date
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
athan Hartman
6d7e0feea1 Remove 'executable' bit on several files 2019-08-01 14:13:55 -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
6253a8995f apps/graphics/nxglyphs: Remove some warnings due to coupling with NXWM. 2019-05-17 08:41:23 -06:00
Gregory Nutt
f371679f58 libs/libnx/nxglib/nxglib_intersecting.c: Correct bogus logic in nxgl_interesting. Good to know I was stupid then to and that is it not just a recent thing. 2019-05-13 09:06:14 -06:00
Gregory Nutt
4f31eec94e libs/libnx/nxmu/: Add a few bad input parameter checks. configs/lpcxpresso-lpc54628/twm4nx/defconfig: Need to enable the NX library. 2019-05-12 14:42:27 -06:00
Gregory Nutt
392809fae5 libs/libnx/nxtk/nxtk_opentoolbar.c: Refuse to open a toolbar of height zero. 2019-05-10 08:30:09 -06:00
Gregory Nutt
05ce221523 graphics/: Add new NX interfaces to query if a window is hidden or not. 2019-05-09 08:27:12 -06:00
Gregory Nutt
04a0a7c8bb Documentation/NXGraphicsSubsystem.html: Add documentatin for new nx[tk]_modal() and nx[tk]_setvisibility() interfaces. 2019-05-08 11:03:06 -06:00
Gregory Nutt
a312503ed2 libs/libnx/nxtk/nxtk_events: Fix an error in handling mouse events for framed windows. When drawing, NX may report mouse positions outside of the Window. The is only for NX windows, but the outside-the-side positions were being discarded by nxtk_events(). 2019-05-07 18:17:59 -06:00
Gregory Nutt
b05e940135 graphics/: Windows can now be created in the hidden state. This can be used to clean up initial window presentation which may involve several steps. This makes those steps all invisible until nx[tk]_setvisibility() is called to make the windows visible. 2019-05-07 08:49:16 -06:00
Gregory Nutt
da314276a1 NX graphics: This commit adds support for hiding windows. This features is needed by Twm4Nx: When a window is iconfied, the icon should appear on the background and the window should disappear (i.e., be hidden). The windows needs to remain healthy and to be updated in all ways, but it cannot affect the display content.
Converserely, when the icon is clicked, the icon needs to be hidden on the backgound and the window needs to be restored in its current state (which may be different than the state of the window at the time it was iconified.

Squashed commit of the following:

    graphics/:  Add checks in all places that I can think to avoid doing something stupid with hidden windows

    Improve some naming

    Add a new file missing in last commit.

    graphics/:  Initial, incomplete support for hiding windows.
2019-05-05 15:21:52 -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
Gregory Nutt
4179b8416f graphics/: Clean up some C and Kconfig comments. Remove Kconfig dependency on EXPERIMENTAL. 2019-04-13 16:54:55 -06:00
Gregory Nutt
ad76ca674b graphics/nxbe: Some bugfix found early in cursor testing. 2019-04-10 12:31:43 -06:00
Gregory Nutt
4aadcc8c28 Adds support for cursors with differing pixel depths on multiple displays
Squashed commit of the following:

    Update .gitignore
    Fix some compile-related issues.
    Add support for cursors of differing pixeldepth.
    Various compile-related fixes.
    graphics/nxglib:  Separate cursor rendering routines in nxglib/ (like all other rendering logic).  graphics/nxbe:  Flesh out remaining cursor methods.
2019-04-09 11:33:59 -06:00
Gregory Nutt
2c2729521b Abandon attempt to get common data structures for NX and the raw framebuffer cursor interface. This backs out several changes. 2019-04-07 18:00:40 -06:00
Gregory Nutt
e5c56aaab6 graphics: A little more progress with software cursors. 2019-04-07 16:04:21 -06:00
Gregory Nutt
79b83f0c05 graphics: Extend the definition of the cursor image structure. 2019-04-07 13:25:20 -06:00
Gregory Nutt
42e2c9139c Squashed commit of the following:
libs/libnx/nxme:  Add front-end, client, message handling needed for cursor support.  Still actual cursor logic yet, just message handling.

    graphics/nxmu and graphics/nxbe:  Add back-end message handling needed for cursor support.  No actual cursor logic yet, just message handling.
2019-04-06 14:34:56 -06:00
Gregory Nutt
0b3375cb78 graphics/, lib/libnx, include/nutt/nx: Add support for modal windows. 2019-04-05 08:24:46 -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
ebbd91b441 Grrr.. Once again I forget to 'add' files before committing them. 2019-03-25 13:50:01 -06:00
Gregory Nutt
10388e9123 exmamples/, graphics/NxWidgets: Implement new interfaces nx_synch() and nxtk_synch(). This are used to syncrhonize the NX server with the window client. Currently most of the logic is equivalent to nx_block() and nxtk_block(), but with slightly different semantics. The are separate now because they are likely to diverge in the future. 2019-03-25 13:48:27 -06:00
Gregory Nutt
f5e8dc60f4 graphics/nxmu, include/nuttx/nx/nxmu.h, libs/libnx: Add new server->client callback to notify the window client of server events. Remove the old 'blocked' callback and just make it one case of an 'event' callback. 2019-03-25 13:00:13 -06:00
Gregory Nutt
5812bbeb04 Update ReleaseNotes in preparation for NuttX-7.29 release. 2019-03-24 17:58:51 -06:00
Gregory Nutt
372e8b86a4 libs/libnx/nxmu/nx_filltrapezoid.c: Fix a coordinate system error. When no clipping rectangle is falls, it falls back to use the entire window as for the clip. However, that window must then then be in window relative coordinates, not in absoute device coordinates. 2019-03-20 12:26:45 -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
zhangyuan7
acd1a57bd1 libs/libxx/Makefile: Always add libxx_cxa_guard.cxx for uclibcxx. 2019-03-19 10:10:29 -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
Gregory Nutt
683cd4c045 libs/libnx/nxtk: Fix more cases where we were using the wrong coordinate system. 2019-03-18 13:29:58 -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
Gregory Nutt
5fda638cf0 libs/libnx/nxtk: Add logic to re-draw the frame when the toolbar is added or removed. 2019-03-18 12:13:22 -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
10b73fde9d graphics/: Correct logic for copy of bit maps with resolution less than 8 bits from the per-window framebuffer to the device. 2019-03-18 09:45:09 -06:00
Gregory Nutt
4d4ae87cb7 libs/libnx/nxtk/nxtk_setsize.c: Add logic to redraw NXTK borders for the case of per-window framebuffers. There are no redraw callbacks in this case, so we cannot rely on the callbacks to redraw the borders. 2019-03-17 14:37:57 -06:00
Gregory Nutt
a90364d14f libs/libnx/nxtk/nxtk_drawframe.c: Fix a one character typo in a comment 2019-03-17 13:47:10 -06:00
Gregory Nutt
92554257b9 Squashed commit of the following:
graphics/nxbe/nxbe_bitmap.c:  Fix another coordinate system problem.

    graphics/:  Review use of device coordinate system with window frambebuffer and make fixes accordingly.

    graphics/nxbe/nxbe_fill.c:  Fix a coordinate system bug.  Was trying to update the window fraembuffer using the device coordinate system.  Need to use the relative coordinate system.

    graphics/:  Use DEBUGASSERT instead of return an error since the is no user to handle the errors within the NX server.  Use CONFIG_DEBUG_GRAPHICS instead of CONFIG_DEBUG_FEATURES in most cases.

    graphics/:  Nothing under graphics/ should set the errno.
2019-03-17 11:34:45 -06:00
Gregory Nutt
f2d90e6298 graphics: For consistency, rename fields fb->fbmem as in other structures. 2019-03-14 12:19:01 -06:00
Gregory Nutt
419c4cb6be A little more progress toward the implementation of per-window framebuffers. Still missing:
- Logic that generates the low lever framebuffer renderers for the per-window framebuffers,
- The logic that picks off the per-window framebuffer updates from normal graphics device updates.  This logic must update both the per-window framebuffer and the graphics device (from the framebuffer).

Squashed commit of the following:

    graphics:  Add logic to allocate the per-window framebuffer.

    graphics:  A few fragmentary thoughts on how a per-window framebuffer could be represented and allocated.
2019-03-14 11:20:14 -06:00
Gregory Nutt
8a46b1f488 Squashed commit of the following:
graphics:  nx_openwindow() and nxtk_openwindow() now accept an addtional 'flag' parameter.  This argument is not used at present but will, eventually enable a RAM backed, per-window framebuffer.

    graphics/Kconfig:  Add configuration to support a rambacked framebuffer. Current marked as EXPERIMENTAL because this is a work in progress.
2019-03-13 12:34:13 -06:00
Gregory Nutt
0454ae2a10 This commit removes naming associated with and naming for the now non-existent NXFE graphics layer.
Squashed commit of the following:

    graphics/:  Rename nxfe_reportposition to nxmu_reportposition.  The is no longer an nxfe layer.

    graphics/:  Renmae nxfe_redrawreq to nxmu_redrawreq.  The is no longer an nxfe layer.

    graphics/nxmu/nxmu.h:  Renmae nxfe.h to nxmu.h.  There is no long an nxfe layer.

    graphics/: Rename nxfe_state_s to nxmu_state_s.  There is no longer an nxfe layer.

    graphics/: Rename nxfe_conn_s to nxmu_conn_s.  There is no longer an nxfe layer.
2019-03-13 09:16:30 -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
1f22ebfac3 libs/libnx/nxfonts: Fix a memory leak in the font cache. With a busy NxTerm display, this could drain off all the memory pretty quickly! 2019-03-08 11:52:49 -06:00
Gregory Nutt
aefacb05ca Minor NxTerm-related clean-up 2019-03-08 08:43:16 -06:00
Gregory Nutt
2d4ce4e047 graphics/nxterm and configs/open1788: Various fixes to get the NxTerm example working in PROTECTED mode with the Open1788 knxterm configuration. Basically works until the screen becomes full and it starts scrolling. Then characters are missing from the display. Needs more debug and test. 2019-03-07 15:57:34 -06: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
Gregory Nutt
72bc331217 Cosmetic update to some comments. 2019-02-15 18:26:06 -06:00
Gregory Nutt
c271151d57 libs/libc/stdio: Remove unused, non-standard functions lib_sscanf() and lib_sprintf(). 2019-02-15 18:01:39 -06:00
Gregory Nutt
928108036c libs/libc/stdio: In the recent changes we lost the implementation of vsscanf(). This commit restores vsscanf(). sscanf() is not just a front end for vsscanf(). 2019-02-15 17:31:58 -06:00
Gregory Nutt
d0bd4c959d arch/arm/src/tiva/hardware/tiva_ssi.h: Fix typo error found in build testing. libs/libc/stdio/lib_libsscanf.c: Fix warnings found in build testing. 2019-02-15 14:38:06 -06:00
Gregory Nutt
4dc0636f1e libs/libc/stdio: Add support for %g format which, for these purpose, is equivalent to %f except that trailing zeroes are suppressed. 2019-02-15 11:45:25 -06:00
Gregory Nutt
5739179109 Upate Kconfig comments 2019-02-15 10:04:57 -06:00
Gregory Nutt
38e93ede2b Revert "libs/libc/stdio: Fix the %f floating point output format."
The previous implementation was probably corect.  On Cygwin with GCC I see this:

int main(int argc, char **argv)
{
  printf("Value 1.2 is: [%f]\n", 1.2);
  printf("Value 0.1 is: [%f]\n", 0.1);
  printf("Value 0.0: [%f]\n", 0.0);
  printf("Value 347.6872: [%f]\n", 347.6872);
}

Generates output

Value 1.2 is: [1.200000]
Value 0.1 is: [0.100000]
Value 0.0: [0.000000]
Value 347.6872: [347.687200]

This reverts commit eb0223bc7f.
2019-02-15 10:01:44 -06:00
Gregory Nutt
eb0223bc7f libs/libc/stdio: Fix the %f floating point output format. 2019-02-15 09:56:58 -06:00
Johannes
7b9d02d496 libs/libc/stdio/lib_libvsprintf.c: No precision specifier resulted in precision 0 but should be precision 6. 2019-02-15 08:42:07 -06:00
Gregory Nutt
b8c7e5fcc0 Minor fixes to some spacing. 2019-02-14 15:57:15 -06:00
Johannes
479363ae3b libs/libc/stdio/lib_libsscanf.c: Initialized the lastc pointer to avoid the checks for NULL. Removed a bug in the floating point parsing which allowed several signs after each other. 2019-02-14 15:43:21 -06:00
Johannes
350295d009 Squashed commit of the following:
Author: Gregory Nutt <gnutt@nuttx.org>

    TODO:  Remove 'Missing fscanf()' bug
    Clean up remaining complaints for tools/nxstyle
    Apply tools/detab, rmcr, convert-comments, lowhex, and indent.sh to the new and highly modified files.

Author: Johannes <nivus.entwicklung@gmail.com>

    - Move vscanf logic to lib_sscanf.c  Switched to stream interface (tricky, because the old implementation used massive read ahead, which isn't suitable for streams, chars already read are gone).
    - Added scanf and fscanf
    - Added hh, h, and ll modifiers
    - Fixes for standard compliance in scanf
    - Fixes for standard compliance in strto... function family (don't consume single '-' or '+', allow sign in strotul(l))
2019-02-14 07:03:02 -06:00
Gregory Nutt
efe65749ce Fix condition logic: The setup seems to support a network without sockets. That is not the case.
Squashed commit of the following:

    sched/sched/sched_getsockets.c:  Fix an error in conditional compilation.
    fs/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    Documentation/:  Remove all references to CONFIG_NSOCKET_DESCRIPTORS == 0
    include/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    libs/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    net/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    sched/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    syscall/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    tools/:  Fixups for CONFIG_NSOCKET_DESCRIPTORS no longer used to disable sockets.
2019-02-11 15:47:25 -06:00
Gregory Nutt
a64869aa67 CONFIG_NFILE_DESCRIPTORS=0 can no longer be used to disable the file system. NuttX with no file system does not make sense.
Squashed commit of the following:

    configs/:  The few configurations that formerly set CONFIG_NFILE_DESCRIPTORS=0 should not default, rather they should set the number of descriptors to 3.
    fs/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    tools/:  Tools updates for changes to usage of CONFIG_NFILE_DESCRIPTORS.
    syscall/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    libs/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    include/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    drivers/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    Documentation/:  Remove all references to CONFIG_NFILE_DESCRIPTORS == 0
    binfmt/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    arch/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    net/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    sched/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    sched/Kconfig:  CONFIG_NFILE_DESCRIPTORS may no longer to set to a value less than 3
    configs/:  Remove all settings for CONFIG_NFILE_DESCRIPTORS < 3
2019-02-11 12:09:26 -06:00
Gregory Nutt
675a9a170a lib_sscanf.c: Remove some redundancy in debug output. 2019-02-10 07:49:42 -06:00
Gregory Nutt
810b5de41b Update TODO list. 2019-02-10 07:49:25 -06:00
Gregory Nutt
3ba777bb27 include/: Correct naming of standard header file. Should be dlfcn.h, not dllfcn.h. I am surprised no one ever noticed before now. 2019-02-09 14:09:28 -06:00
Gregory Nutt
6a30e22ad4 Update a README; improvie some Kconfig defaults. 2019-02-09 12:19:32 -06:00
Gregory Nutt
7ac9bd671b libs/libc/stdio/Kconfig: Update some help comments. 2019-02-07 18:47:27 -06:00
Gregory Nutt
adf28d8903 libs/libc/stdio/Kconfig: CONFIG_NANO_PRINTF should depend on CONFIG_LIBC_LONG_LONG=n. Default should be y if CONFIG_DEFAULT_MALL=yi (as suggested by Alan Carvalho de Assis). 2019-02-07 17:37:43 -06:00
Alan Carvalho de Assis
38508e72b9 libs/libc/stdio/nano_libvsprintf.c: Remove not used sign variable that was stopping the compilation 2019-02-07 16:48:38 -06:00
Gregory Nutt
e5ea84c1ff libs/libc/stdio: A few more coding standard fixes for nano-printf file: all global data names must begin with g_. All structure names must end with _s. 2019-02-06 17:05:01 -06:00
Keith Packard
e05149b745 libs/libc/stdio: Add newlib-nano fprintf as an option. This fprintf code was originally adapted from AVR libc and provides improved floating point output support, including 'g' mode and making 'f' mode include digits past the decimal by default. However, this version does not have any long long support. On a demonstration cortex M4 build, this version saves about 5kB of ROM. The newlib version can be found here: https://salsa.debian.org/electronics-team/toolchains/newlib-nano . That project is GPL overall, but the newlib-nano printf portions are BSD licensed as described in the COPYING.NEWLIB file. 2019-02-06 15:50:52 -06:00
Xiang Xiao
659852acd5 libs/libc/unistd/lib_getopt.c: Add logic to reinitialize the stale context for the FLAT/PROTECTED builds. In these builds getopt() global varriables may be shared by many tasks. If any task exits the getopt() loop before all command line arguments have been parsed, then getopt() global variables will be left in a bad state. The next time getopt() is called, this logic should detect the bad state and force the state of getopt() to be re-initialized so that it can be reused. This logic is not full proof (it would fail, for example, if you tried to parse the same command line twice) but should catch the typical misuse cases. 2019-02-05 10:30:59 -06:00
Xiang Xiao
964f0ab304 aio_cancel need signal caller after the succeed and fix minor issue in the error handler 2019-01-27 09:39:33 -06:00
Xiang Xiao
fb63c0a293 sched/signal and related changes to other OS subsystems. 2019-01-27 09:28:59 -06:00
Gregory Nutt
7dd81cc5c2 libs/libxx/Kconfig: utomatically select CONFIG_LIBC_WCHAR and CONFIG_TIME_EXTENDED when CONFIG_LIBCXX is selected since libcxx compile fails if without these two option 2019-01-27 07:00:07 -06:00
Xiang Xiao
dc8013ab76 Remove the unused libs/libc/endian/Kconfig 2019-01-27 06:58:01 -06:00
Xiang Xiao
16850297f3 libs/unistd and other affected files: Hostname support no longer depends on CONFIG_NET since the host name is also useful in the non-network environment. CONFIG_NET_HOSTNAME changed to CONFIG_LIB_HOSTNAME. 2019-01-27 06:56:16 -06:00
Gregory Nutt
c40daffb5b libs/libc/misc/lib_utsname.c: Add build date and time to uname output (like Linux). 2019-01-27 06:24:24 -06:00
ligd
d6740a6678 libs/libc/stdio/lib_libvsprintf.c: Correct justification for alternate forms of %p and %P 2019-01-27 06:22:01 -06:00
Alan Carvalho de Assis
db0b9b7c34 arch/arm/src/samd2l2 serial: Fix SAMD2L2 serial driver it needs sam_usart_enable() to work 2019-01-26 12:51:51 -06:00
Xiang Xiao
8763e51583 libs/libc/symtab/symtab_findorderedbyvalue.c: Remove unused symtab_findorderedbyvalue. 2019-01-26 12:42:30 -06:00
Xiang Xiao
8812a3315d libs/libc/machine/arm: Fix the minor issue in libc arm machine folder; MOVW/MOVT should use zero(not sign) extension. 2019-01-26 11:59:27 -06:00
anchao
98add65c14 libs/libc/machine/arm/armv7-m/arch_elf.c: Add support for the R_ARM_THM_JUMP11 relocation type. This relocation type may be generated when LTO optimization is enabled. 2019-01-26 11:52:57 -06:00
Xiang Xiao
c43e4673ab sched/Kconfig, libs/libc/dllfcn/Kconfig, libs/libc/modlib/Kconfig: Refine ELF related configurations. 2019-01-26 11:50:09 -06:00
anchao
88efb84847 libs/libc/dllfcn, sched/init: Add LD_LIBRARY_PATH environment variable support. 2019-01-26 11:47:14 -06:00
Xiang Xiao
9e2238f6cd libs/libc/dllfcn: Implement dlerror using strerror. 2019-01-26 11:39:05 -06:00
Xiang Xiao
0edcd6b85e binfmt/libelf, libs/libc/modlib: Optimize elf load speed: (1) Don't zero out memory, (2) Reduce the initial buffer size to 32 bytes. 2019-01-26 11:34:40 -06:00
Xiang Xiao
38ffb98f1b Kconfig files, binfmt/libelf, libs/libc/machin, libs/libxx: Correct libcxx exception handling by introducing the generic config(CXX_EXCEPTION and CXX_LIBSUPCXX) 2019-01-26 11:23:31 -06:00
Xiang Xiao
095e28d45e binfmt/, binfmt/libelf/, include/nuttx, libs/libc/machine, libs/libc/modlib, and others: Move elf related arch function to include/nuttx/elf.h because the implementation is located in libs/libc/machine and in order to avoid the conflict with the 3rd party libraries and clean up the file inclusion: (1) Remove redundant elf32.h, (2) Remove nuttx/binfmt/elf.h in libs/libc/machine, (2) Remove nuttx/binfmt/elf.h in modlib, and (4) Rmove nuttx/module.h in modlib. 2019-01-26 11:18:45 -06:00
Gregory Nutt
3def509f4e libs/libc/stdio/lib_libfread.c: fread() should always set EOF if fewer than the requested number of bytes was not read. Per Anthony Merlino. 2018-12-07 12:18:40 -06:00
David Sidrane
5433ec589b fs/driver/fs_blockpartition.c: Fix void pointer warning.
libs/libc/unistd/lib_daemon.c:  Fix compiler error is streams disabled.
sched/irq/irq_procfs.c:  Fix warning
sched/task/task_vfork.c: Fix void * math warning
2018-12-03 17:54:21 -06:00
Mateusz Szafoni
d2b98cc150 Merged in raiden00/nuttx_pe (pull request #771)
Use STM32 DMA IP core version instead of chip family names and some minor improvements

arch/arm/src/stm32/chip/stm32_adc.h: raise error if two IP cores seleceted

libs/libdsp/Kconfig: cosmetic change

arch/arm/src/stm32/Kconfig: hide TIMER menu, HRTIM menu and USB Host debug menu if peripherals not enabled

configs/stm32f429i-disco/highpri/defconfig: fix configuration warning

Approved-by: GregoryN <gnutt@nuttx.org>
2018-12-02 11:49:25 +00:00
Juha Niskanen
3e7281e699 libs/libc/netdb: Support multiple IP addresses per hostname 2018-11-23 07:09:47 -06:00
uha Niskanen
23aa2839c3 libs/libc/netdb/lib_dnsquery.c: harden against DNS spoofing. This commit implements most of the RFC 5452 guidelines for making DNS more resilient. We now verify response matches against what was queried and use unpredictable query IDs. It is also checked that response come from correct DNS server. Also fixes a buffer overflow when querying hostnames longer than CONFIG_NETDB_DNSCLIENT_NAMESIZE. 2018-11-16 06:56:45 -06:00
Juha Niskanen
5129e4dd60 ibs/libc/netdb: Make DNS retries configurable 2018-11-14 06:30:49 -06:00
Gregory Nutt
1a754deaa0 Cosmetic updates from review of last PR. 2018-11-12 09:43:33 -06:00
Petteri Aimonen
fe0532c226 Merged in paimonen/nuttx/pullreq_libc_libnx_updates (pull request #757)
Pullreq libc libnx updates

* NuttX: make strerror() return 'Success' for 0

* NuttX: fix strrchr() so that it considers null terminator as part of string

    From strrchr(3) man page:
    "The terminating null byte is considered part of the string, so that if c
    is specified as '\0', these functions return a pointer to the terminator."

* NuttX: mm_free(): Add DEBUGASSERT()'s to catch memory corruption early.

    It's easier to find the source when asserts fail already when freeing
    an overflowed buffer, than if the corruption is only detected on next
    malloc().

* MM_FILL_ALLOCATIONS: Add debug option to fill all mallocs()

    This is helpful for detecting uninitialized variables,
    especially in C++ code. I seem to be forgetting to initialize
    member variables and then they just get random values..

* NuttX: nxtk_bitmapwindow: Fix warning message when bitmap is fully off-screen.

* nxfonts_getfont: Avoid unnecessary warnings for other whitespace chars also.

* NuttX: Fix kerning of 'I' in Sans17x22 font

    The I character was running together with some other
    characters, e.g. in sequence "IMI".

* NXMU: Revalidate window pointer for mouse events.

    NXMU caches the previous window pointer so that further mouse
    events can be sent to the same window. However, if the window
    is destroyed while mouse button is held down, the pointer may
    become invalid and cause a crash. This patch revalidates the
    pointer before using it.

Approved-by: GregoryN <gnutt@nuttx.org>
2018-11-12 15:36:35 +00:00
ligd
4a8b750ecd ibs/libc/net: Add basic implementation for recvmsg and sendmsg per OpenGroup.org specification. 2018-11-09 11:39:05 -06:00
Xiang Xiao
cb095ea3d3 libs/libc/misc/lib_envpath.c: Fix typo error 2018-11-09 09:35:25 -06:00
Xiang Xiao
18f971aa35 libs/libc/aio/lio_listio.c: Fix a typograpical error. 2018-11-08 19:09:47 -06:00
Xiang Xiao
e27b6c46ec libs/libc/stdio/lib_libvsprintf.c: Eliminate recursive in conversion functions of lib_vsprintf(). 2018-11-08 08:43:15 -06:00
Xiang Xiao
5ab668ffae libs/libc/string/lib_memrchr.c: Add memrchr() function 2018-11-08 08:37:34 -06:00
ligd
ec00670eb7 libs/libc/netdb/lib_dnsbind.c: Make DNS recevie timeout configurable. 2018-11-08 08:33:13 -06:00
Xiang Xiao
a9ff43d93c fs/aio, libs/libc/aio, sched/mqueue, sched/timer, and sched/signal: Remove the code duplication for SIGEV_THREAD. 2018-11-08 08:19:17 -06:00
nchao
6509a0c0ca binfmt/ and libs/libc: Make exepath_*() more common:
1. Move exepath_*() related code to libc/misc
  1. Rename exepath_ to envpath_
  2. Rename BINFMT_EXEPATH to LIB_ENVPATH

libs/libc/modlib:  Add pre module library symbol table support
2018-11-08 07:27:14 -06:00
Alan Carvalho de Assis
ea1689409f libs/libc/misc/lib_crc8ccitt.c: Adds implementation of CRC8-CCITT. 2018-10-27 16:29:32 -06:00
Lokesh B V
56b4bc8bcb libs/libc: Correct some errors in psignal() and stpncpy(). 2018-10-24 17:15:51 -06:00
Gregory Nutt
efe2ff3933 libs/libc/stdio/Kconfig: Commit d0254b1c79 removed all usage of CONFIG_NOPRINTF_FIELDWIDTH but failed to remove the selection from the Kconfig file. 2018-10-06 10:33:29 -06:00
Gregory Nutt
0487fa90f8 libs/libc/stdio/lib_libvsprintf.c: Correct another discrepancy between NuttX printf() output and glibc printf() output. 2018-10-06 09:57:06 -06:00
Gregory Nutt
079fedaa3d Update TODO list. Costmetic (only) changes to libs/libc/stdio/lib_libvsprintf.c 2018-10-05 16:09:53 -06:00
Gregory Nutt
055810d9a4 libs/libc/stdio/lib_libvsprintf.c: Correct handling of integer 'precision' in all justification types for values 9, 99, 999, 9999, 99999:
Right justification:
  009   099   999  9999 99999  %5.3u
    9    99   999  9999 99999  %5u

Right justification, zero padding
  009   099   999  9999 99999  %05.3u
00009 00099 00999 09999 99999  %05u

Left justification
009   099   999   9999  99999  %-5.3u
9     99    999   9999  99999  %-5u
2018-10-05 13:54:36 -06:00
Gregory Nutt
c958dc0f22 libs/libc/stdio/lib_libvsprintf.c: Back out most of commit d0254b1c79. While logic seemed correct, verify against glibc showed differs. The output now matches the output form glibc:
This code sequence:

  printf("%3.3u %3.3u %3.3u %3.3u %3.3u\n",
         9, 99, 999, 9999, 99999);
  printf("%3u %3u %3u %3u %3u\n",
         9, 99, 999, 9999, 99999);
  printf("%3.3lu %3.3lu %3.3lu %3.3lu %3.3lu\n",
         9L, 99L, 999L, 9999L, 99999L);
  printf("%3u %3u %3u %3u %3u\n",
         9L, 99L, 999L, 9999L, 99999L);
  printf("%3.3llu %3.3llu %3.3llu %3.3llu %3.3llu\n",
         9LL, 99LL, 999LL, 9999LL, 99999LL);
  printf("%3llu %3llu %3llu %3llu %3llu\n",
         9LL, 99LL, 999LL, 9999LL, 99999LL);

Generates:

009 099 999 9999 99999
  9  99 999 9999 99999
009 099 999 9999 99999
  9  99 999 9999 99999
009 099 999 9999 99999
  9  99 999 9999 99999

For both NuttX and glibc.
2018-10-05 13:00:18 -06:00
Gregory Nutt
d0254b1c79 Squashed commit of the following:
libs/libc/stdio/lib_libvsprintf.c:  Resolves the integer field width problem if Issue 35 for the cases of long and long long integer types.

    libs/libc/stdio/lib_libvsprintf.c:  Resolves the integer field width problem if Issue 35 for the case of integer types.

    libs/libc/stdio:  Remove CONFIG_NOPRINTF_FIELDWIDTH.  That option does, indeed, make the printf family of functions much smaller.  But it also adds a lot of complexity and makes the functions non-standard.  Removing this might break some of the tinier platforms but it is the best thing to do for long term maintanance for for OpenGroup.org compliance.
2018-10-05 09:33:48 -06:00
Gregory Nutt
8eac8ee52a Trivial updates after review of last merge. 2018-10-03 11:22:22 -06:00
Mihai Serban
b01e6e5f2a libs/libc/stdio/lib_sscanf.c: Fix conversion for format specifiers that appear right after a floating point format specifier
When performing a floating point conversion the parsing code could
consume more than required characters from the input buffer. This made
impossible to convert input of form "1.1K" using format "%f%c".

Fix the issue by advancing the input buffer with the actual characters
converted as a float point number.

Signed-off-by: Mihai Serban <mihai.serban@gmail.com>
2018-10-03 11:15:44 -06:00
Gregory Nutt
faefa6cd9f libs/libc/netdb/lib_getaddrinfo.c: Fix a warning found in build testing. 2018-10-02 11:16:47 -06:00
Anthony Merlino
5e69b6e09f Merged in antmerlino/nuttx/getaddrinfo-improvements (pull request #726)
A few improvements to getaddrinfo:

- Use the protocol and socktype hints in returned address
  - Ignore AI_PASSIVE argument if hostname is not NULL

Approved-by: GregoryN <gnutt@nuttx.org>
2018-09-25 17:00:57 +00:00
Gregory Nutt
3950398841 libs/libc/string/lib_stpncpy.c: Correct the return poineter value for the case where the NUL terminator is transferred. 2018-09-18 06:43:10 -06:00
Gregory Nutt
68d4c1d4ed C library: Add some new functions defined in POSIX.1-2017: stpncpy(), strsignal(), psignal(), psiginfo(). 2018-09-17 13:55:33 -06:00
Gregory Nutt
7769bd490c sched/signal/sig_nanosleep.c: Fix an error introduced with recent commit. Noted by Jussi Kivilinna. 2018-09-17 06:21:25 -06:00
Rajan Gill
d647127d14 libs/libc/math: Small change to log() and logf() that improves accuracy and convergence time 2018-09-16 15:14:15 -06:00
Rajan Gill
6da2658fdd libs/libc/math: Add variable convergence in log() and logf() to avoid hangs caused by failure to converge for very specific input values. 2018-09-16 12:22:36 -06:00
Gregory Nutt
9f8f1cc5cf libs/libc/wqueue/work_usrthread.c: Fix some errors that I introduced in a recent commit. 2018-09-16 11:07:24 -06:00
Gregory Nutt
a7fd58c4db Squashed commit of the following:
many locations:  Change occurences of open() followed by file_detach() to file_open().  Change most non-controversion calls to open() to nx_open().

    fs/inode/fs_fileopen.c:  Flesh out file_open() with some interim, placeholder logic.

    fs/inode/fs_fileopen.c:  Add a framework for a file_open() implementation (no real logic in place yet).

    fs/vfs/fs_open.c:  Add nx_open() which is the same as open() except that it does not create a cancellation point nor does it modify the errno variable.
2018-09-15 10:49:41 -06:00
Gregory Nutt
dc48263a6a libs/libc/wqueue/work_usrthread.c: Revise commit 49e725625a. Use sigprocmask() so tht we do not lose a signal, not sched_lock() which will not do the job in SMP mode. 2018-09-14 09:02:03 -06:00
Gregory Nutt
49e725625a libs/libc/wqueue/work_usrthread.c: Eliminate a race condition noted by Xiang Xiao. 2018-09-14 07:51:31 -06:00
Gregory Nutt
9546481054 Fix some typographical errors. 2018-09-14 06:55:45 -06:00
Gregory Nutt
a04d2eeb10 tools/Directories.mk: Correct the path to the installed libcxx directory. 2018-09-13 14:03:09 -06:00
Gregory Nutt
fc127fd297 sched/signal: Add a generic signal notification facility. Modify the custom IOB available notifier so that it is now just a wrapper around this generic signal notification. This generic signal notification faility will, eventually, be used to support network polling.
Squashed commit of the following:

    mm/iob:  The IOB available notifier is now just a wrapper around the common signal notifier.

    sched/signal:  Add a generic signal notification facility.

    sched/signal/sig_evthread.c:  More trivial naming changes.

    sched/signal:  Rename nxsig_notification() to nxsig_evthread() to make forthcoming naming additions more consistent.
2018-09-09 08:32:37 -06:00
Xiang Xiao
6129136329 libs/libc/stdio/lib_setvbuf.c: Fix warning: 'newbuf may be used uninitialized' 2018-08-29 06:10:52 -06:00
Xiang Xiao
d025162542 libs/libc/audio/lib_buffer.c: Call nxsem_destroy in apb_free 2018-08-27 07:49:23 -06:00
ZhongAn
4d115e925f include/nuttx/audio/audio.h: Change member samp of apb to pointer so driver can customize sample buffer allocation 2018-08-27 07:45:27 -06:00
anchao
2e8eba35ff libs/libc/syslog/lib_syslog.c: Fix syslog crash on 64bit simulation. 2018-08-26 06:50:47 -06:00
xuanlin
7e63b0b288 sched/wqueue, libs/libc/wqueue, configs: Remove work queue polling delay to simplify the code logic and save the power. 2018-08-25 14:58:07 -06:00
ligd
631071cded Squashed commit of the following:
sched/wqueue:  Modify high priority work queue to support multiple threads.

    sched/wqueue and libs/libc/wqueue:  workqueues don't need set global data to zero since .bss is cleared automatically.  Removing this unnecessary initialization also avoids the loss the work items queued before initialization.
2018-08-25 14:52:13 -06:00
Xiang Xiao
e1202d2ed3 Replace all ASSERT with DEBUGASSERT to save the code space 2018-08-24 06:58:30 -06:00
Xiang Xiao
467d2a58ea Replace non critical PANIC with DEBUGPANIC to save the code space 2018-08-24 06:21:15 -06:00
Gregory Nutt
2722fd8192 tools/nxstyle.c: Add capability to detect multiple blank lines. Single spacing required by the coding standard. Also coding standard fixes to server .c files for problems found during testing nxstyle. 2018-08-24 05:51:44 -06:00
xuanlin
2c93467436 pthreads: Add support static pthread stack. Add standard pthread_attr_setstack() and pthread_attr_getstack(). In all cases where the stack is released, add check to see which allocator must be used to free the stack: The user or the kernel allocator. 2018-08-23 09:49:20 -06:00
Gregory Nutt
8e203e09d4 Costmetic changes 2018-08-19 11:19:43 -06:00
Gregory Nutt
ed4aae0fe0 include/endian.h and libs/libc/endian: Add support for endian.h. 2018-08-19 07:44:04 -06:00
Gregory Nutt
8c61c2f31b Remove trailing spaces at the end of lines. 2018-08-13 07:39:38 -06:00