Commit Graph

816 Commits

Author SHA1 Message Date
Abdelatif Guettouche
0ac02765bd libs/libxx/uClibc++.defs: Download the correct file type.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-08-18 12:19:16 -07:00
zhuyanlin
5e817e25e8 libs:cxx.defs: bypass -Wno-missing-exception-spec flag in xcc
Xtensa-toolchain do not recognize -Wno-missing-exception-spec flags
2021-08-14 14:11:34 -03:00
Xiang Xiao
a09f262f1e fs/userfs: Support fchstat and chstat callback
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-10 14:57:48 -03:00
Xiang Xiao
6c61d032db fs: Add utimens and lutimens
https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html
https://www.daemon-systems.org/man/utimens.2.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-09 17:55:44 -03:00
Xiang Xiao
b12f588140 Rename CONFIG_LIB_BOARDCTL to CONFIG_BOARDCTL
since boardctl isn't a libc feature

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-06 13:58:26 +02:00
Xiang Xiao
5025fbef8d Rename LIB_ to LIBC_ for all libc Kconfig
follow other libc component naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-05 19:45:24 +02:00
Xiang Xiao
00e0afb864 libc/gettext: Change g_domain to array
otherwise textdomain will deference NULL pointer in the default case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-05 09:41:30 -03:00
Jiuzhu Dong
8f7ad8f9ce tzset: avoid taking semaphore in interrupt for non-kernel mode
Change-Id: Ic72819eddb38621751e462fe32e9e433288fb33c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-08-04 23:17:16 -07:00
Xiang Xiao
c6c1ec81e0 Fix variable 'catd' is used uninitialized whenever 'if' condition is false
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-03 12:14:07 -03:00
Xiang Xiao
c597721633 libc: Implement gettext function
https://www.man7.org/linux/man-pages/man3/dcgettext.3.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-03 12:14:07 -03:00
Xiang Xiao
4a23737016 libc: Remove include/nuttx/lib/regex.h and libs/libc/misc/lib_match.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-03 08:59:54 -03:00
Xiang Xiao
ae7fe055fc fs: Save umask to tls_task_s for non kernel mode only
since the kernel mode has the dedicated userspace

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-02 15:59:51 -03:00
Xiang Xiao
98de773081 libc: Support message catalog function
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/nl_types.h.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-02 08:24:59 -03:00
Xiang Xiao
a262eebe34 libc: Rename match to fnmatch
specified here:
https://pubs.opengroup.org/onlinepubs/007904875/functions/fnmatch.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-02 08:23:35 -03:00
Xiang Xiao
0e2cbe9a79 libc: Add the empty nl_langinfo implementation
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-31 15:35:47 -03:00
Xiang Xiao
3c400f32fa Remove the locale fallback from libcxx
since these functions can handled by NuttX's libc now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-30 09:43:26 -03:00
Abdelatif Guettouche
9b4e44842e libc/pthread_barrierattr_destory.c: Destroy shouldn't reinitialize the
attributes.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-07-29 14:44:07 -03:00
Xiang Xiao
307cc61893 fs: Add fchstat and chstat callback into mountpt_operations
and implement all status related change function. the individual
file system change will provide in other upcoming patchset.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I8fde9db8eba9586e9c8da078b67e020c26623cf4
2021-07-29 06:33:49 -03:00
Jiuzhu Dong
23d87ff9df usrwqueue: implement order work queue
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-27 21:01:38 -07:00
Jiuzhu Dong
00854f0f94 userspace/wqueue: move exclusive access lock to mqueue inside
Change-Id: I885d5641bc81fedf698c241d4719cb3561700f17
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-27 21:01:38 -07:00
Nathan Hartman
b92aeb8209 Fix various typos
arch/arm/src/eoss3/eoss3_serial.c:
arch/arm/src/imxrt/hardware/imxrt_flexcan.h:
arch/arm/src/imxrt/imxrt_flexcan.c:
arch/arm/src/imxrt/imxrt_flexpwm.c:
arch/arm/src/imxrt/imxrt_lpi2c.c:
arch/arm/src/kinetis/kinetis_flexcan.c:
arch/arm/src/nrf52/hardware/nrf52_rtc.h:
arch/arm/src/nrf52/nrf52_clockconfig.c:
arch/arm/src/nrf52/nrf52_radio.c:
arch/arm/src/nrf52/nrf52_tim.c:
arch/arm/src/rtl8720c/amebaz_depend.c:
arch/arm/src/s32k1xx/Kconfig:
arch/arm/src/s32k1xx/s32k1xx_flexcan.c:
arch/arm/src/s32k1xx/s32k1xx_lpi2c.c:
arch/arm/src/sama5/hardware/sam_sdmmc.h:
arch/arm/src/sama5/sam_gmac.c:
arch/arm/src/samd5e5/sam_wdt.c:
arch/avr/src/avr32/up_exceptions.S:
arch/avr/src/avr32/up_fullcontextrestore.S:
arch/renesas/src/rx65n/rx65n_dtc.c:
arch/renesas/src/rx65n/rx65n_usbhost.c:
arch/risc-v/src/esp32c3/esp32c3_tickless.c:
boards/arm/stm32h7/stm32h747i-disco/include/board.h:
include/nuttx/lcd/ili9225.h:
libs/libc/stdio/lib_fgetpos.c:
libs/libc/stdio/lib_fseek.c:
libs/libc/stdio/lib_fsetpos.c:

    * Fix typos.
2021-07-25 18:36:53 -07:00
jordi
f3af6edf93 Kconfig: add quotes in source to clean warnings from setconfig
To avoid the setconfig warning "style: quotes recommended around xxx in
source xxx"
2021-07-23 02:32:19 -07:00
Xiang Xiao
af1dceb3e3 libc: Implement times function
https://pubs.opengroup.org/onlinepubs/009604599/functions/times.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: If2cccfedd532a77f86035d16d36d94ae38d8f09c
2021-07-21 13:11:54 -03:00
Xiang Xiao
df0e2a65b2 libc/sysconf: Implement the query of _SC_CLK_TCK
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I36a62d97b14ea06bbc2054ee96fd2319b2f6897c
2021-07-21 13:11:54 -03:00
SPRESENSE
25b7bdf943 libs/libxx/libcxx.defs: Fix build error on Windows platform
The libcxx-X.Y.Z.src.tar.xz contains a symbolic link to a directory
that not exist as below.

`libcxx-X.Y.Z.src/test/std/pstl -> ../../../pstl/test/std`

Linux and macOS environment have no problem, but it causes an error
when extracting tarball on Windows platform. This symbolic link is not
actually used, so exclude it from extracting the tarball.
2021-07-21 08:59:22 -07:00
Nathan Hartman
609ee6b54b Fix typos in comments and identifiers 2021-07-19 22:55:30 -03:00
Xiang Xiao
663104a2e9 fs: Simplify sendfile implementation
and avoid call nx_ file API in the kernel space

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id951ca161df2c2ee267dc4b5a0d7dfa67df4c1e6
2021-07-17 07:39:15 -03:00
Nathan Hartman
af1fd49fb0 wqueue: Fix typos
include/nuttx/wqueue.h:
libs/libc/wqueue/work_cancel.c:
libs/libc/wqueue/work_queue.c:
sched/wqueue/kwork_cancel.c:
sched/wqueue/kwork_queue.c:

    * Fix spelling, grammar, and typos.
    * Improve wording in a few areas.
    * These changes affect comments only. No functional changes.
2021-07-16 19:54:08 -03:00
mage1
def007e2d7 add #undef for some libc function
since it's useful to redirect these functions to others
sometime(e.g. validate the memory before write).

Change-Id: I6253a9231af8809e8362f4bc5a1bd67fb094c3b0
2021-07-14 15:09:58 -03:00
Xiang Xiao
a0f2f6c362 fs: Move umask to task_info_s
and implement the related semantic correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I0587341e2c505e41b5e24e55dba039ed200d65f2
2021-07-14 10:35:15 -03:00
Huang Qi
73a0c1d095 libc/string: Skip compile the c version when the optimization is enabled
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: Idbdea04f748243fb9baf7b39d0ed997f7e9a8e3c
2021-07-13 09:42:23 -03:00
zhouliang3
f230ba7b34 Increase the function of crc8 to use custom polynomials
N/A

Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
Change-Id: I3c53bf25541c1811a05d025b39dfe24cb0613b72
(cherry picked from commit 07b2bd769e608d4c46f8e039d091514b1b3d3ff0)
2021-07-12 20:33:21 -07:00
Peter Bee
695935217b libc/sysconf: Add MONOTONIC_CLOCK for consistency
MIRTOS-107

Add _SC_MONOTONIC_CLOCK to sysconf when CONFIG_CLOCK_MONOTONIC is set

Change-Id: I0ae57798ebe89247a10ccb517e128866d1f907de
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2021-07-12 16:07:25 -03:00
zhanghu
36db69af96 nuttx net warning:cancel the conflict between weak and inline in unwind_arch_adjustment 2021-07-12 11:27:50 -03:00
zhanghu
7b0347c66c nuttx net warning:add initialization of pointer *aiocbp in lio_listio
Change-Id: I0ac7571ca27191b69acdc31f5bc07943c4d87e58
2021-07-12 11:27:50 -03:00
SPRESENSE
2e80d5e38e libs/libc/math: Fix calculation error of log function
Fix a problem where the log function would loop infinitely by
calculation error when a specific value was passed. For example,
in the following case, the log function loops infinitely and
never returns. So, this commit fixes to return the right value.

  double a = 7883961.5;
  double b = log(a);
2021-07-10 12:28:34 -07:00
SPRESENSE
012158cce8 libc/math: Add fmax and fmin functions
Add fmax and fmin functions.
- fmax, fmaxf, fmaxl
- fmin, fminf, fminl
2021-07-10 11:00:07 -03:00
Xiang Xiao
2fa1e55628 libc: Implement ttyname and ttyname_r
Note: this patch can get file path from root pseudo file handle,
but a general infrastructure is setup for other file system too.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I86cd79ebb741f2f43fdd398bb7498c40687d949b
2021-07-09 18:23:34 -03:00
Xiang Xiao
76cd9c89bb libc: Implement futimes on top of futimens
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie54de66ca1bc26a68f2922861e1edd1fdabb8f33
2021-07-09 15:51:28 -03:00
Xiang Xiao
800acff10e libc: Implement utime on top of utimes
https://man7.org/linux/man-pages/man2/utime.2.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia10574fdd0d07eabbc93aceeea5a0b953e30339a
2021-07-09 15:51:28 -03:00
Xiang Xiao
bae265274a libc: Move the declaration of futimens from sys/time.h to sys/stat.h
to follow the spec here:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id8e418794bd43827c01af772ce704a8d3e7681c5
2021-07-09 15:51:28 -03:00
chao.an
940a07e1e5 net/socketpair: move socketpair implement into socket internal
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-07-08 03:05:43 -05:00
Nathan Hartman
ce20211357 Fix various typos in comments and documentation
Fix typos in these files:
    * Documentation/components/drivers/character/foc.rst
    * Documentation/guides/cpp_cmake.rst
    * Kconfig
    * arch/arm/src/imxrt/imxrt_lpspi.c
    * arch/arm/src/kinetis/kinetis_spi.c
    * arch/arm/src/kl/kl_spi.c
    * arch/arm/src/lpc31xx/lpc31_spi.c
    * arch/arm/src/nrf52/nrf52_radio.h
    * arch/arm/src/s32k1xx/s32k1xx_lpspi.c
    * arch/arm/src/stm32/Kconfig
    * arch/arm/src/stm32/stm32_adc.c
    * arch/arm/src/stm32/stm32_foc.c
    * arch/arm/src/stm32/stm32_foc.h
    * arch/arm/src/stm32/stm32_pwm.c
    * arch/arm/src/stm32/stm32_spi.c
    * arch/arm/src/stm32f0l0g0/stm32_spi.c
    * arch/arm/src/stm32f7/Kconfig
    * arch/arm/src/stm32f7/stm32_spi.c
    * arch/arm/src/stm32h7/Kconfig
    * arch/arm/src/stm32h7/stm32_allocateheap.c
    * arch/arm/src/stm32h7/stm32_fmc.c
    * arch/arm/src/stm32h7/stm32_fmc.h
    * arch/arm/src/stm32h7/stm32_pwm.c
    * arch/arm/src/stm32h7/stm32_qspi.c
    * arch/arm/src/stm32h7/stm32_spi.c
    * arch/arm/src/stm32l4/stm32l4_pwm.c
    * arch/arm/src/stm32l4/stm32l4_spi.c
    * arch/arm/src/stm32l5/Kconfig
    * arch/arm/src/stm32l5/stm32l5_spi.c
    * arch/renesas/src/rx65n/rx65n_dtc.c
    * arch/renesas/src/rx65n/rx65n_usbdev.c
    * arch/risc-v/src/rv32m1/rv32m1_serial.c
    * boards/arm/stm32/b-g431b-esc1/src/stm32_foc.c
    * boards/arm/stm32/nucleo-f103rb/src/stm32_foc_ihm07m1.c
    * boards/arm/stm32/nucleo-f302r8/src/stm32_foc_ihm07m1.c
    * boards/arm/stm32h7/nucleo-h743zi2/README.txt
    * boards/risc-v/rv32m1/rv32m1-vega/README.txt
    * boards/sim/sim/sim/scripts/Make.defs
    * drivers/1wire/1wire.c
    * drivers/1wire/1wire_internal.h
    * drivers/lcd/Kconfig
    * drivers/syslog/ramlog.c
    * fs/fat/Kconfig
    * libs/libc/debug/Kconfig
    * libs/libc/machine/Kconfig
    * libs/libc/stdio/lib_libvsprintf.c
    * libs/libc/stdlib/lib_div.c
    * libs/libc/stdlib/lib_ldiv.c
    * libs/libc/stdlib/lib_lldiv.c
    * libs/libdsp/lib_observer.c
2021-07-04 11:23:26 -05:00
Huang Qi
50c08bf45b libc: Move pthread_key_destructor to task_info_s
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-07-04 07:36:44 -05:00
SPRESENSE
f75437d3f3 libs: libnx: nxfonts: Fix prefix of generated fonts data
This commit fixes a compile error caused by the following commit.
fe9ccff libs: libnx: nxfonts: fix Mixed case identifier
Change the prefix of generated font data to lower case.
2021-07-03 23:14:19 -05:00
Xiang Xiao
e2d827cb6d libc/time: Initialize tm_zone field correctly
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ief32aedc72ec062d428f8538a25ddfe4f81d7e29
2021-07-02 09:27:23 -07:00
Xiang Xiao
d72655e74c libc/time: Fix nxstyle issue in lib_localtime.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2e98d92e62b47ade375bda3f043175841d9fa1b7
2021-07-02 09:27:23 -07:00
Xiang Xiao
3e4511978a libc/time: Rename lclptr/gmtptr to g_lcl_ptr/g_gmt_ptr
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I380f28c15ffe3d98734016bfedb1618b20a5f400
2021-07-02 09:27:23 -07:00
Xiang Xiao
dcad420127 libc/time: Update g_lcl_tzname only after the success
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I0117c5b43bee3affb36d118e0b97f6dd7137080b
2021-07-02 09:27:23 -07:00
Xiang Xiao
26908f472e libc/time: Avoid modify the global variables concurrently in tzset
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I7fb6439c3a669ef07c1756ccc294cd487805a510
2021-07-02 09:27:23 -07:00