Commit Graph

869 Commits

Author SHA1 Message Date
zhuyanlin
5a4140f020 arch:xtensa: add setjmp xtensa function
N/A

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-11-06 07:39:27 -05:00
zhuyanlin
cfcff5f570 libc:machine:xtensa:add xtensa libc implement
N/A

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-11-06 07:39:27 -05:00
Jukka Laitinen
7e9e8a817d libs/libc/wqueue/work_usrthread.c: Correct time calculation in work_process
This fixes busylooping in work_usrthread, due to incorrect time spec given to sem_timedwait

_SEM_TIMEDWAIT works on absolute time stamps, using CLOCK_REALTIME

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-11-04 13:19:01 -05:00
Jukka Laitinen
c79d2067c7 Move timespec calculations from sched into libc/sched
Allow using these functions also outside sched, where systick
related calculations are performed

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-11-04 13:19:01 -05:00
Xiang Xiao
aa9c17e93d libc: Move lib_filesem.c and lib_stream.c to libc/stdio
since it make more sense to put all FILE functions in one place

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-02 09:00:11 +01:00
Xiang Xiao
ad2f82898a libc/misc: Add lib_ prefix to stream_semtake and tream_semgive
and merge lib_streamsem.c to lib_stream.c

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-02 09:00:11 +01:00
Jiuzhu Dong
ee29175811 libc/machine: add config LIBC_ARCH_MEMCHR
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-11-01 12:44:02 +01:00
Xiang Xiao
5f7cc04627 fs/aio: Fix compile warning
aio/lio_listio.c:227:7: warning: implicit declaration of function ‘ferr’ [-Wimplicit-function-declaration]
  227 |       ferr("ERROR: lib_zalloc failed\n");
      |       ^~~~
aio/lio_listio.c:275:3: warning: implicit declaration of function ‘finfo’ [-Wimplicit-function-declaration]
  275 |   finfo("Registering signal handler\n");

aio/aio_read.c: In function ‘aio_read_worker’:
aio/aio_read.c:90:11: warning: implicit declaration of function ‘file_pread’; did you mean ‘aio_read’? [-Wimplicit-function-declaration]
   90 |   nread = file_pread(aioc->aioc_filep, (FAR void *)aiocbp->aio_buf,
      |           ^~~~~~~~~~
      |           aio_read

aio/aio_write.c: In function ‘aio_write_worker’:
aio/aio_write.c:85:12: warning: implicit declaration of function ‘file_fcntl’ [-Wimplicit-function-declaration]
   85 |   oflags = file_fcntl(aioc->aioc_filep, F_GETFL);
      |            ^~~~~~~~~~
CC:  mmap/fs_mmap.c
CC:  pthread/pthread_condclockwait.c
aio/aio_write.c:107:18: warning: implicit declaration of function ‘file_write’; did you mean ‘aio_write’? [-Wimplicit-function-declaration]
  107 |       nwritten = file_write(aioc->aioc_filep,
      |                  ^~~~~~~~~~
      |                  aio_write
aio/aio_write.c:113:18: warning: implicit declaration of function ‘file_pwrite’; did you mean ‘aio_write’? [-Wimplicit-function-declaration]
  113 |       nwritten = file_pwrite(aioc->aioc_filep,
      |                  ^~~~~~~~~~~
      |                  aio_write
In file included from aio/aio_write.c:34:
aio/aio_write.c:121:12: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
  121 |       ferr("ERROR: write/pwrite/send failed: %d\n", nwritten);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~
      |                                                     |
      |                                                     ssize_t {aka long int}
aio/aio_write.c:121:47: note: format string is defined here
  121 |       ferr("ERROR: write/pwrite/send failed: %d\n", nwritten);
      |                                              ~^
      |                                               |
      |                                               int
      |                                              %ld

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-31 06:30:57 -03:00
YAMAMOTO Takashi
3097f62511 Revert "lib/netdb: Change the default NETDB_DNSCLIENT_NAMESIZE to NAME_MAX"
This reverts commit 3724f6be55.

Because there is no real correlation between DNS namesize and NAME_MAX
as far as I know. The former is about network and the latter is about
filesystem. While they might happen to be similar values for
some configurations, it's very confusing to use them this way.
2021-10-29 01:15:58 -05:00
Xiang Xiao
3724f6be55 lib/netdb: Change the default NETDB_DNSCLIENT_NAMESIZE to NAME_MAX
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-25 19:50:16 -03:00
Xiang Xiao
c4472b64cb libc/netdb: Change default of NETDB_DNSCLIENT_MAXRESPONSE to NETDB_BUFSIZE
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-25 19:50:16 -03:00
Xiang Xiao
1e607a70bc libc/vsprintf_internal: Call va_copy just like vsyslog
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-11 16:39:44 -03:00
Xiang Xiao
82813472d1 lib/vasprintf: Shouldn't call va_end(ap) to avoid the double free
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-11 16:39:44 -03:00
Alin Jerpelea
f6c8e4368d libs: Omni Hoverboards: update licenses to Apache
Gregory Nutt has submitted the SGA
Omni Hoverboards has submitted the SGA
Paul Alexander Patience  has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-28 04:37:38 -07:00
FASTSHIFT
649f99ce30 libc/misc: add lib_glob.
Signed-off-by: FASTSHIFT <vifextech@foxmail.com>
2021-09-25 07:54:39 -03:00
FASTSHIFT
f3477a86d2 libc/string: add lib_strchrnul. 2021-09-22 09:20:06 -03:00
Abdelatif Guettouche
0aa4f07e93 libc/sched/sched_backtrace.c: Include unistd.h to avoid warning about
getpid function.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-09-21 09:22:28 -03:00
Juha Niskanen
17bfa18679 libc/unistd: getopt: add some NULL pointer checks
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2021-09-13 22:44:00 +08:00
Jiuzhu Dong
c68880c0d7 getaddrinfo: support AF_RPMSG
The hostname is as rp_cpu, the servname is as rp_name

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-13 08:57:44 +08:00
Jiuzhu Dong
352f636b38 getaddrinfo: support AF_LOCAL
the hostname is as sun_path.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-13 08:57:44 +08:00
Jiuzhu Dong
dfb4b6e3d8 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

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-12 21:14:46 +08:00
Jiuzhu Dong
2438403f23 libc/rexec/rexec_af: support remote execution
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-12 21:14:06 +08:00
Jiuzhu Dong
d8ea482b58 errno: use staic errno to replace tl_errno before tls initialization
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-12 11:48:31 +08:00
Jiuzhu Dong
34397094d7 lib_fread: return the number of bytes actually read when error occurs.
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-12 11:36:03 +08:00
zhuyanlin
803599faeb uClibc++:remove typeinfo.cpp that confict with libsupc++
Typeinfo.cpp already defined in libsupc++
2021-09-09 16:38:30 +08:00
Alin Jerpelea
a9bfe50fe1 author: Brennan Ashton: update licenses to Apache
Brennan Ashton has submitted the ICLA
as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-02 21:56:05 +08:00
Alin Jerpelea
abf8a72ef0 LICENSE: add libs/libc/math/ to license file
Add Sun Microsystems license for libs/libc/math/__sin.c
and libs/libc/math/__cos.c

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-02 21:56:05 +08:00
Alin Jerpelea
4e5a9b168a libs: libc: armv8-m: revert to original license
Revert to the BSD Arm lincese

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-02 21:56:05 +08:00
zhuyanlin
2ff63388b3 uClibcxx: remove function that conflict with libsupc++
The New_/del_ function already contain in libsupc++.
2021-09-02 13:59:10 +08:00
zhuyanlin
ba44da9a32 Revert "libxx:uClibxx:add-weak-function-for-new-del-operations"
This reverts commit 40a110b4a8.
2021-09-02 13:59:10 +08:00
Neo Xu
5941532fb5 libc/gettext: Initialize path field when creating mofile struct.
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2021-09-01 14:35:24 -03:00
Gustavo Henrique Nihei
c260fee516 libs/libxx: Enforce RTTI for building libcxxabi
It is okay for the application to be built without RTTI (-fno-rrti), but
libcxxabi requires RTTI at least for the library.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-09-01 21:02:17 +08:00
Xiang Xiao
c8b93ed45e libxx: Move the partial c++ abi implementation to libcxxmini sub folder
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2bc9b8be2962451a44352ab90623c9481bd162b2
2021-08-31 06:52:10 -03:00
zhuyanlin
40a110b4a8 libxx:uClibxx:add-weak-function-for-new-del-operations
Add-weak-function-for-new-del-operations

Change-Id: Ie44528529e457d714a581881e247c41f01f2231b
2021-08-31 11:23:29 +08:00
zhuyanlin
8940d85668 libxx:uClibcxx:fix-GCC-specific-definitiion error
Use __GNUC__ instead of __GCC__

Change-Id: I285bd099cf973a89e21c5c7825250d1840615f36
2021-08-31 11:23:29 +08:00
Xiang Xiao
d6c3381ef1 libxx: Remove the unused libxx_stdthrow.cxx
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-30 15:57:22 -03:00
Xiang Xiao
ce73f9cbfc libxx: Move libcxxabi special setting from libcxx.defs to libcxxabi.defs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-30 10:44:24 +02:00
Xiang Xiao
397d329966 libxx: Give VERSION make variable prefix to avoid the conflict
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-30 10:44:24 +02:00
zhuyanlin
e01e5f5008 libc:machine: add atomic_load/store/exchange API
Add atomic_load/store/exchange API

Change-Id: I6196b077d1e76cd1e0506ee66e2885e541525eb1
2021-08-30 11:10:11 +08:00
Xiang Xiao
b0c782255c libxx: Change CXX_LIBSUPCXX to LIBSUPCXX
align with other Kconfig(e.g. LIBCXXABI, LIBCXX, UCLIBCXX)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-28 17:14:48 -03:00
Xiang Xiao
ceb8bd4bce libxx: Disable CXX_EXCEPTION by default to save the code space
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I1b1fafa95f0e385a615dba78f43858b797c5ce69
2021-08-28 17:13:43 -03:00
Xiang Xiao
bdc86e85d7 libcxx: Avoid the waring: "__EXCEPTIONS" is not defined, evaluates to 0 [-Werror=undef]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-28 17:13:43 -03:00
Xiang Xiao
95ff2e16a3 libcxxabi: Avoid the waring: "__EXCEPTIONS" is not defined, evaluates to 0 [-Werror=undef]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-28 17:13:43 -03:00
zhuyanlin
3da0bb7829 libc:machine: add common atomic operation.
Add common atomic operation.

Change-Id: I9f6b891f1406d54871a3f50c217a1029b434d2e8
2021-08-28 13:17:30 -03:00
panran
2568cc1212 nuttx:Correct code comment errors
N/A

Signed-off-by: panran <panran@xiaomi.com>
Change-Id: I9c9fa0855ae7851b7268a7ace6b5a86d5562a6b1
2021-08-27 20:21:19 +02:00
zhuyanlin
528d18ef26 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-26 19:32:24 +08:00
zhuyanlin
f2fe51c22d libc:libcxx: add support for libcxxabi.
libcxxabi is either-or select with glibcxx.

Change-Id: I4fbea19f0648ddc318379dd43bac8406f7c86927
2021-08-26 19:32:24 +08:00
zhuyanlin
7f48d13c47 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-26 19:32:24 +08:00
buyuer
33320329ec vfs: writev should return the partial write size.
Signed-off-by: buyuer <dingddding@163.com>
2021-08-26 13:28:11 +08:00
Xiang Xiao
d242861c44 libc: Remove the legacy printf support
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-25 12:55:36 -07:00