Commit Graph

935 Commits

Author SHA1 Message Date
zhuyanlin 9a2e9de4bc libxx: rename NUTTX_LIBCXX
NUTTX_LIBCXX is only basic C++ support, do not support many c++
library function, NUTTX_NOCXXLIB is more suitable.
When NUTTX_NOCXXLIB is select, do not select lower level support.

Change-Id: I158937a4ba02f8fa3c76101acbdfb295d8cd736f
2021-08-28 09:39:24 +08:00
zhuyanlin 6354a78791 libc:libcxx: add support for libcxxabi.
libcxxabi is either-or select with glibcxx.

Change-Id: I4fbea19f0648ddc318379dd43bac8406f7c86927
2021-08-28 09:39:13 +08:00
zhuyanlin a4abe4bd3e libc:libxx: add new low level c++ standard library support
LLVM libc++abi is a new implementation of low level support for
a standard C++ library.

Change-Id: Ica9c81bd96fd27b169a06e352b0c394d47aed5b6
2021-08-28 09:39:03 +08:00
zhuyanlin 32ea691d5f libs:cxx.defs: bypass -Wno-missing-exception-spec flag in xcc
Xtensa-toolchain do not recognize -Wno-missing-exception-spec flags
2021-08-28 09:38:55 +08:00
Xiang Xiao 8f976669a3 libc: Remove the legacy printf support
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-28 09:26:30 +08:00
Jiuzhu Dong 7561882938 lib_vsprintf: Add %pV format support
test case:
void test(const char *fmt, ...)
{
  struct va_format vaf;
  va_list ap;

  va_start(ap, fmt);
  vaf.fmt = fmt;
  vaf.va = &ap;
  printf("func:%s, %pV, line:%d\n", __func__, &vaf, __LINE__);
  va_end(ap);
}

int main(int argc, FAR char *argv[])
{
  char str[] = "Hello Boy and Girl!";
  int count = 10;

  test("%s %d", str, count);
  return 0;
}

>> test
func:test, Hello Boy and Girl! 10, line:49

Change-Id: I6d97515dce3f10a880145a1ff7fcba5e9cbebd37
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-08-27 11:08:48 +08:00
pengyiqiang b8f12c357f libc/misc: add lib_glob.
N/A

Change-Id: I1bace79c4c580e3a7e84aaf37e7963f789a896ef
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2021-08-26 16:57:07 +08:00
丁欣童 5738f26938 vfs: writev should return the partial write size
Signed-off-by: 丁欣童 <dingxintong@xiaomi.com>
Change-Id: Id7f161fa51a9ad66dad265cab125deb3323e6602
2021-08-26 10:19:56 +08:00
pengyiqiang 01cbfec897 libc/string: fix lib_strchrnul warning.
N/A

Change-Id: I4661a42923b7e2f59155c734cba2131bddb94211
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2021-08-25 15:08:37 +08:00
pengyiqiang 57e4394dbd libc/string: add lib_strchrnul.
N/A

Change-Id: I25e2424e91b833815680d2e417f4384ed9062660
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2021-08-20 16:41:52 +08:00
liuhaitao 54f4c43e0a Add libcxxabi into .gitignore
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
Change-Id: I076f4c203b72bc039dea63b4a98e0db241628cef
2021-08-19 20:56:16 +08:00
chao.an 7f192ca255 sched/backtrace: add sched_backtrace support
Change-Id: Ia764cf54dfa215b313f9d5f1a060aac18d765982
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-08-18 19:36:38 +08:00
chao.an db06f769ff libs/libc: move the backtrace implement to sched
1. move the backtrace implement to sched
2. rename CONFIG_UNWINDER to CONFIG_SCHED_BACKTRACE

Change-Id: I8176727602bfc695184b88210a3aaf90c6acaac7
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-08-18 19:36:23 +08:00
jordi cd2fbf0b3c Kconfig: add quotes in source to clean warnings from setconfig
To avoid the setconfig warning "style: quotes recommended around xxx in
source xxx"

Change-Id: Iaec3ae59ba2ec15337652c9962b25081ff03e1d7
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-08-18 19:35:59 +08:00
Xiang Xiao 622c637832 fs/userfs: Support fchstat and chstat callback
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-11 18:18:52 +08:00
Xiang Xiao 7afb3354cc 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 21:09:35 +08:00
Xiang Xiao ad827673b2 Rename CONFIG_LIB_BOARDCTL to CONFIG_BOARDCTL
since boardctl isn't a libc feature

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: If32db0451e10fb02e0c12ed48f2b7120859b8ae3
2021-08-09 21:03:17 +08:00
Xiang Xiao 4bffde887d Rename LIB_ to LIBC_ for all libc Kconfig
follow other libc component naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I66cf8f3201560ce71576279640e94ae3147ad0a2
2021-08-09 21:03:17 +08:00
liuhaitao 6442b8ea2d Revert "libc: Implement fesetround & fegetround for arm"
The updated GNU Arm Embedded Toolchain Version 10.3-2021.07 has implemented
fesetround & fegetround.

This reverts commit 5c0a079aea.

Change-Id: I6418c1f47a6c1a319a2973f01340480d50f54e8e
2021-08-09 20:02:47 +08:00
Xiang Xiao e783f6e648 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 12:14:52 +08:00
Xiang Xiao 43e98a5d2d Fix variable 'catd' is used uninitialized whenever 'if' condition is false
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-04 14:02:30 +08:00
Xiang Xiao b2b4ad864b libc: Implement gettext function
https://www.man7.org/linux/man-pages/man3/dcgettext.3.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I5817bb8114a1bb05c4dfa133baa084d1cd5f1b06
2021-08-04 14:02:16 +08:00
Xiang Xiao b7ca3dbbc8 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-03 14:43:34 +08:00
Xiang Xiao af26bc798d 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 14:39:11 +08:00
Jiuzhu Dong b05bce3090 tzset: avoid taking semaphore in interrupt for non-kernel mode
Change-Id: Ic72819eddb38621751e462fe32e9e433288fb33c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-08-02 20:45:34 +08:00
Xiang Xiao 31f761cd48 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 19:47:20 +08:00
Xiang Xiao 400db72d79 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 12:02:39 +08:00
Xiang Xiao 14c6bd1a5d 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-08-02 09:49:11 +08:00
Xiang Xiao 4574d83d0c 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 10:52:58 +08:00
Jiuzhu Dong e09737b061 wqueue: optimize work_s structure
Change-Id: I908ac2fcead3a6fed3078b2339392ed93d2e4809
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-27 15:53:52 +08:00
Jiuzhu Dong c4e5410fa5 usrwqueue: implement order work queue
N/A

Change-Id: I9b6a76dec96f669c0b55bef39a9e5a2a71dde50b
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-25 00:12:40 +08:00
Xiang Xiao cd8be916d4 pthread: Shouldn't check the uninitialized field in pthread_barrier_init
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I4d22e3945bba92020376a9c8485897533562d0b4
2021-07-23 13:58:17 +08:00
Xiang Xiao cfee19f9a6 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 19:50:54 +08:00
Xiang Xiao 84b11713be libc/sysconf: Implement the query of _SC_CLK_TCK
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I36a62d97b14ea06bbc2054ee96fd2319b2f6897c
2021-07-21 19:49:02 +08:00
ligd 45f9a11b29 netdb: fix access within misaligned address error
netdb/lib_dnsquery.c:444:14: runtime error: member access within misaligned address 0xef2f5a1b for type 'struct dns_question_s', which requires 2 byte alignment
0xef2f5a1b: note: pointer points here
 63  6f 6d 00 00 01 00 01 c0  0c 00 05 00 01 00 00 00  1c 00 1a 05 6d 75 73 69  63 06 6e 74 65 73 35
              ^
netdb/lib_dnsquery.c:445:14: runtime error: member access within misaligned address 0xef2f5a1b for type 'struct dns_question_s', which requires 2 byte alignment
0xef2f5a1b: note: pointer points here
 63  6f 6d 00 00 01 00 01 c0  0c 00 05 00 01 00 00 00  1c 00 1a 05 6d 75 73 69  63 06 6e 74 65 73 35
              ^

Change-Id: Id20d1f2eed5aa5e78a42233de0f5f2b51876dd44
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-20 15:32:58 +08:00
Jiuzhu Dong eb6dd4fdc7 userspace/wqueue: move exclusive access lock to mqueue inside
Change-Id: I885d5641bc81fedf698c241d4719cb3561700f17
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-19 11:40:44 +08:00
Xiang Xiao e5c60da2f5 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 04:58:40 -07:00
Xiang Xiao 3f86e553f9 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-16 11:16:10 +08:00
haopengxiang 6de765342c delete small to big endian marco to avoid byte alignment
Change-Id: I24076bfeeae5b462756bcae9f166bce20ae4ad90
2021-07-15 15:33:59 +08:00
Xiang Xiao c8f1eeed57 Merge commit '2e43815c929acb818b34a5ff8828494b0c6f6891' into dev
Change-Id: Idcbac12fec435abff01cfb4efd5a26a02eb08f93
2021-07-13 03:14:34 +08: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 8692c316ff libc: Implement futimes on top of futimens
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie54de66ca1bc26a68f2922861e1edd1fdabb8f33
2021-07-10 19:33:18 +08:00
Xiang Xiao b47cdeb910 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-10 19:32:48 +08:00
Xiang Xiao a7c2343c32 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-10 19:22:58 +08: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
Xiang Xiao 78b5e4c657 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 15:46:00 +08:00