Commit Graph

310 Commits

Author SHA1 Message Date
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
Gregory Nutt
17c18a1347 tools/kconfig2html.c: Update tool to handle tristate types. Fix a few errors detected in Kconfig files. 2018-08-10 17:30:17 -06:00
Gregory Nutt
1af1ac24a5 Review of previous PR: Add some comments. Change should not apply in the FLAT build mode. 2018-07-25 06:32:50 -06:00
Masayuki Ishikawa
5340027e4e Merged in masayuki2009/nuttx.nuttx/fix_build_error_with_protected_build (pull request #695)
libs/libc/netdb: Fix a link error in lib_gethostbynamer.c with protected build.

NOTE: g_lo_ipv4addr also exists in net/loopback/lo_globals.c which
can be linked with kernel build only.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: GregoryN <gnutt@nuttx.org>
2018-07-25 12:23:45 +00:00
Gregory Nutt
b75103e264 Update some comments. 2018-07-22 05:56:11 -06:00
Gregory Nutt
4e92314d96 Update some comments 2018-07-20 09:36:22 -06:00
Gregory Nutt
5a89459783 libs/libc/unistd/: Add a crippled version of daemon(). 2018-07-20 07:56:09 -06:00
Gregory Nutt
12d216fa5e Fix another error found in build testing. 2018-07-19 15:19:36 -06:00
Gregory Nutt
58bbb66481 libs/libc/stdlib and include/stdlib.h: Add implementation of random() and srandom(). 2018-07-19 11:21:49 -06:00
Gregory Nutt
4c67062457 Squashed commit of the following:
binfmt/, libs/libc/unistd, and others:  Rename CONFIG_EXECFUNCS_SYMTAB to CONFIG_EXECFUNCS_SYMTAB_ARRAY.  Rename CONFIG_EXECFUNCS_NSYMBOLS to CONFIG_EXECFUNCS_NSYMBOLS_VAR.  Unlike CONFIG_EXECFUNCS_NSYMBOLS, CONFIG_EXECFUNCS_NSYMBOLS_VAR holds the name of an 'int' variable that contains the number of symbols in the symbol table.

    configs/sama5d4-ek:  Partial update to knsh build instructions.
2018-07-15 11:20:37 -06:00
Gregory Nutt
903a4d866a libs/libc/unistd/Kconfig: Revisiting 664af2a69b, the problem was not that the default should be 'not set', the problem is that the conditionals were backward. 2018-07-14 10:34:55 -06:00
Gregory Nutt
29474a2b08 Trivial update to some comments and debug statement formats. 2018-07-14 07:11:25 -06:00
Gregory Nutt
664af2a69b Default for CONFIG_EXECFUNCS_HAVE_SYMTAB should be 'not set' 2018-07-13 14:56:45 -06:00
Gregory Nutt
6368a0d6a7 Fix trivial coding standard issue 2018-07-11 15:36:33 -06:00
Alan Carvalho de Assis
283b73edc5 Fix lots of typos in C comments and Kconfig help text 2018-07-08 18:24:45 -06:00
Mateusz Szafoni
078fd78af7 Merged in raiden00/nuttx (pull request #669)
libdsp/lib_motor.c: ouch, forgot to change variable name

* libdsp: initial commit

* libdsp: cosmetics

* stm32f334-disco/buckboost: use a PID controller from libdsp

* stm32_adc.h: fix typo

* stm32_dac.c: set OUTEN bit for DAC1CH2 and DAC2CH1

* stm32_hrtim: cosmetic changes

* power/motor: direction parameter is now int8 + add overload fault

* libdsp: all floats with f-sufix

    libdsp: add precision option for library

    libdsp: add debug option for library and assertions in functions

    libdsp: add current samples correction for SVM3

    libds: add some motor control specific functions

    libdsp: add basic speed observer

    libdsp: fix phase shift in SMO observer

    libdsp: add more logic to FOC

    config/sim/dsptest: add dsptest configuration

* libdsp/lib_motor.c: remove unused comparation

* libdsp/lib_observer.c: update some comments

* libdsp/lib_motor.c: ouch, forgot to change variable name

Approved-by: GregoryN <gnutt@nuttx.org>
2018-07-07 18:17:42 +00:00
Mateusz Szafoni
8416d9a966 Merged in raiden00/nuttx (pull request #668)
Master

* libdsp: initial commit

* libdsp: cosmetics

* stm32f334-disco/buckboost: use a PID controller from libdsp

* stm32_adc.h: fix typo

* stm32_dac.c: set OUTEN bit for DAC1CH2 and DAC2CH1

* stm32_hrtim: cosmetic changes

* power/motor: direction parameter is now int8 + add overload fault

* libdsp: all floats with f-sufix

    libdsp: add precision option for library

    libdsp: add debug option for library and assertions in functions

    libdsp: add current samples correction for SVM3

    libds: add some motor control specific functions

    libdsp: add basic speed observer

    libdsp: fix phase shift in SMO observer

    libdsp: add more logic to FOC

    config/sim/dsptest: add dsptest configuration

* libdsp/lib_motor.c: remove unused comparation

* libdsp/lib_observer.c: update some comments

Approved-by: GregoryN <gnutt@nuttx.org>
2018-07-07 17:04:57 +00:00
Gregory Nutt
5db2f993f9 Trivial updates from review of vecto I/O logic. 2018-06-23 09:01:42 -06:00
Gregory Nutt
01b740c66b arch/arm/src/efm32: Support for common vector handling is forced for all EFM32 chips. Yes the architecture provides support for the old-style dedicated vector handling which can never be compiled. Furthermore, the old-style dedicated vector handling is deprecated in favor of common vector handling. The commit resolves this inconsistency be removing support for the dedicated vector handling from the EFM32 architecture support. 2018-06-19 13:37:00 -06:00
Gregory Nutt
e4e530e1bf libs/libc/netdb/lib_getaddrinfo.c: The 'port' argument to the static alloc_ai() function is always in network byte order. However, that static function was still calling HTTONS() on the port, incorrectly converting it back to host byte order. 2018-06-18 10:08:15 -06:00
Gregory Nutt
8fca244f36 syscall: clock_systimer() is no longer a system call. It has been replaced with the equivalent, standard interface clock() as the system call.
sched/clock:  Move the implementation of clock() from libs/libc/time to sched/clock.  This is necessary because it calls the (now) internal OS function clock_systimer.  clock() is now accessed only via a system call in certain configuratins.
libs/libc/wqueue:  Replace calls to clock_systimer() with calls to the equivalent clock().
2018-06-16 12:50:28 -06:00
Gregory Nutt
8fdbb1e0a4 Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t
Squashed commit of the following:

    sched:  Rename all use of system_t to clock_t.
    syscall:  Rename all use of system_t to clock_t.
    net:  Rename all use of system_t to clock_t.
    libs:  Rename all use of system_t to clock_t.
    fs:  Rename all use of system_t to clock_t.
    drivers:  Rename all use of system_t to clock_t.
    arch:  Rename all use of system_t to clock_t.
    include:  Remove definition of systime_t; rename all use of system_t to clock_t.
2018-06-16 12:16:13 -06:00
Gregory Nutt
fd4398142c libs/libc/netdb: Remove another use of the restrict keyword. 2018-06-12 21:42:59 -06:00
Masayuki Ishikawa
9f682056f9 Merged in masayuki2009/nuttx.nuttx/termios_branch (pull request #655)
libs/libc/termios: Add lib_cfmakeraw.c

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: GregoryN <gnutt@nuttx.org>
2018-06-12 14:05:39 +00:00
Juha Niskanen
1f4a1eab6d libs/libc/netdb: Add getaddrinfo() and friends. 2018-06-08 07:07:21 -06:00
Juha Niskanen
5c8a975d79 libs/libc/net: Add inet_aton() 2018-06-08 07:06:27 -06:00
Gregory Nutt
a6a88198c0 sched/modules: Be consistent use of binary loader debug instrumentation. Was mixed system and binary loader debug. libs/libc/modlib: Switch from systemb to binary load debug to be consistent with sched/modules. 2018-06-01 10:10:17 -06:00
Gregory Nutt
12de93dd36 libs/libc/modlib/modlib_verify.c: Fix backward test for an error. 2018-06-01 09:21:47 -06:00
Gregory Nutt
1c4bdfd8fc libs/libdsp: Trivial typo fixes from review of last PR; hook README file into documentation. 2018-05-30 06:49:48 -06:00
Mateusz Szafoni
b5ec5349b0 Merged in raiden00/nuttx (pull request #648)
libdsp: initial commit

* libdsp: initial commit

* libdsp: cosmetics

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-05-30 12:36:06 +00:00
Gregory Nutt
a0c663edc9 tools: Missed a couple of changes of libcxx to libxx. 2018-05-29 18:16:43 -06:00
Gregory Nutt
4697a74cc7 libs/: Add a README file. 2018-05-29 13:44:12 -06:00
Gregory Nutt
cf99fb40c9 This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now.
Squashed commit of the following:

    libs/libxx:  Fix some confusing in naming.  If the directory is called libxx, then the library must be libxx.a (unless perhaps LIBCXX is selected).
    libs/:  Fix paths in moved library directories.
    libs:  Brute force move of libc, libnx, and libxx to libs.  Cannot yet build it in that configuration.
2018-05-29 13:21:26 -06:00