Commit Graph

852 Commits

Author SHA1 Message Date
Xiang Xiao
10adf76209 libc: Add b64_ntop and b64_pton implementation
implemented by many libc(e.g. freebsd, glibc, newlib)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-12-28 13:53:20 -03:00
YAMAMOTO Takashi
b41524f0e6 libcxx: -Wno-shadow for files including filesystem_common.h
This might be specific to gcc or Linux
as I didn't see it with clang + macOS.
2020-12-24 21:57:39 -06:00
YAMAMOTO Takashi
6481b774e4 libcxx: Disable -Wshadow for locale.cpp
This might be specific to gcc or Linux
as I didn't see it with clang + macOS.

libcxx/src/locale.cpp: In member function 'void std::__1::locale::__install_ctor(const std::__1::locale&, std::__1::locale::facet*, long int)':
libcxx/src/locale.cpp:576:62: warning: declaration of 'id' shadows a member of 'std::__1::locale' [-Wshadow]
  576 | locale::__install_ctor(const locale& other, facet* f, long id)
      |                                                              ^
In file included from /Users/yamamoto/git/nuttx/nuttx/include/libcxx/locale:181,
                 from libcxx/src/locale.cpp:16:
/Users/yamamoto/git/nuttx/nuttx/include/libcxx/__locale:203:32: note: shadowed declaration is here
  203 | class _LIBCPP_TYPE_VIS locale::id
      |                                ^~
2020-12-24 21:57:39 -06:00
YAMAMOTO Takashi
884882501c libcxx: Disable -Wshadow for barrier.cpp
This might be specific to gcc or Linux
as I didn't see it with clang + macOS.

libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)':
libcxx/src/barrier.cpp:35:9: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow]
   35 |         : __expected(__expected)
      |         ^
libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here
   29 |     ptrdiff_t&         __expected;
      |                        ^~~~~~~~~~
libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)':
libcxx/src/barrier.cpp:44:5: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow]
   44 |     }
      |     ^
libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here
   29 |     ptrdiff_t&         __expected;
      |                        ^~~~~~~~~~
libcxx/src/barrier.cpp: In constructor 'std::__1::__barrier_algorithm_base::__barrier_algorithm_base(ptrdiff_t&)':
libcxx/src/barrier.cpp:44:5: warning: declaration of '__expected' shadows a member of 'std::__1::__barrier_algorithm_base' [-Wshadow]
   44 |     }
      |     ^
libcxx/src/barrier.cpp:29:24: note: shadowed declaration is here
   29 |     ptrdiff_t&         __expected;
      |                        ^~~~~~~~~~
CXX:  libcxx/src/new.cpp
In file included from libcxx/src/new.cpp:19:
/usr/include/c++/9/cxxabi.h: In member function 'virtual bool __cxxabiv1::__pbase_type_info::__pointer_catch(const __cxxabiv1::__pbase_type_info*, void**, unsigned int) const':
/usr/include/c++/9/cxxabi.h:308:23: error: 'const class std::type_info' has no member named '__do_catch'
  308 |     return __pointee->__do_catch (thrown_type->__pointee, thr_obj, outer + 2);
      |                       ^~~~~~~~~~
2020-12-24 21:57:39 -06:00
chao.an
2980792efd libs/libc: add lib_dumpvbuffer support
e.g: Encapsulation Type: Bluetooth H4: add packet type dump support

From:

lib_dumpvbuffer(NULL, data, len);

[    1.567100] 0000  03 0c 00                                         ...
[    1.890100] 0000  0e 04 01 03 0c 00                                ......
[    1.890100] 0000  03 10 00                                         ...
[    1.892900] 0000  0e 0c 01 03 10 00 ff ff 8f fe db ff 5b 87        ............[.
[    1.892900] 0000  01 10 00                                         ...
[    1.894900] 0000  0e 0c 01 01 10 00 06 bb 22 06 0a 00 bb 22        ........"...."
[    1.894900] 0000  02 10 00                                         ...
[    1.901900] 0000  0e 44 01 02 10 00 ff ff ff 03 fe ff ff ff ff ff  .D..............
[    1.901900] 0010  ff ff f3 0f e8 fe 3f f7 83 ff 1c 00 00 00 61 f7  ......?.......a.
[    1.901900] 0020  ff ff 7f 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    1.901900] 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    1.901900] 0040  00 00 00 00 00 00                                ......

To:

struct iovec bufs[2];

bufs[0].iov_base = &type;
bufs[0].iov_len = 1;
bufs[1].iov_base = data;
bufs[1].iov_len = len;

lib_dumpvbuffer(NULL, bufs, 2);

[    3.711400] 0000  01 03 0c 00                                      ....
[    4.035400] 0000  04 0e 04 01 03 0c 00                             .......
[    4.035400] 0000  01 03 10 00                                      ....
[    4.037400] 0000  04 0e 0c 01 03 10 00 ff ff 8f fe db ff 5b 87     .............[.
[    4.037400] 0000  01 01 10 00                                      ....
[    4.039400] 0000  04 0e 0c 01 01 10 00 06 bb 22 06 0a 00 bb 22     ........."...."
[    4.039400] 0000  01 02 10 00                                      ....
[    4.046400] 0000  04 0e 44 01 02 10 00 ff ff ff 03 fe ff ff ff ff  ..D.............
[    4.046400] 0010  ff ff ff f3 0f e8 fe 3f f7 83 ff 1c 00 00 00 61  .......?.......a
[    4.046400] 0020  f7 ff ff 7f 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    4.046400] 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    4.046400] 0040  00 00 00 00 00 00 00                             .......

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-23 00:11:38 -08:00
chao.an
826e74a13d libs/libc/dumpbuffer: remove the unnecessary printable characters traversal
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-23 00:11:38 -08:00
chao.an
48db71aa24 libs/libc/dumpbuffer: fix nxstyle warning
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-23 00:11:38 -08:00
chao.an
e32e341886 libs/libc/dumpbuffer: add support to recognizable from wireshark
e.g: Encapsulation Type: Bluetooth H4

From:

[    2.196000] 0000: 030c00                                                            ...
[    2.514600] 0000: 0e0401030c00                                                      ......
[    2.514600] 0000: 031000                                                            ...
[    2.517600] 0000: 0e0c01031000ffff8ffedbff5b87                                      ............[.
[    2.517600] 0000: 011000                                                            ...
[    2.520600] 0000: 0e0c0101100006bb22060a00bb22                                      ........"...."
[    2.520600] 0000: 021000                                                            ...
[    2.527600] 0000: 0e4401021000ffffff03feffffffffff fffff30fe8fe3ff783ff1c00000061f7 .D.............. ......?.......a.
[    2.527600] 0020: ffff7f00000000000000000000000000 00000000000000000000000000000000 ................ ................
[    2.527600] 0040: 000000000000                                                      ......

To:

[    1.567100] 0000  03 0c 00                                         ...
[    1.890100] 0000  0e 04 01 03 0c 00                                ......
[    1.890100] 0000  03 10 00                                         ...
[    1.892900] 0000  0e 0c 01 03 10 00 ff ff 8f fe db ff 5b 87        ............[.
[    1.892900] 0000  01 10 00                                         ...
[    1.894900] 0000  0e 0c 01 01 10 00 06 bb 22 06 0a 00 bb 22        ........"...."
[    1.894900] 0000  02 10 00                                         ...
[    1.901900] 0000  0e 44 01 02 10 00 ff ff ff 03 fe ff ff ff ff ff  .D..............
[    1.901900] 0010  ff ff f3 0f e8 fe 3f f7 83 ff 1c 00 00 00 61 f7  ......?.......a.
[    1.901900] 0020  ff ff 7f 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    1.901900] 0030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[    1.901900] 0040  00 00 00 00 00 00                                ......

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-23 00:11:38 -08:00
Xiang Xiao
922cf0612b libc/netdb: Move hostbuffer out of the stack
The length of hostbuffer come from Kconfig, it isn't safe to
allocate this variable on the stack.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I75213688153a1cba738544de2a51fa3247626dd3
2020-12-22 10:40:22 -03:00
Huang Qi
073912e232 Replace all wget with curl
wget is missing from some system (like macOS and Windows native),
it's better to use curl to simplify build environment.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2020-12-22 03:36:10 -06:00
YAMAMOTO Takashi
b1878fe099 libcxx: Don't remove the downloaded file eagerly
It's convenient during development.
Also, it can be useful for offline builds.
2020-12-20 23:16:11 -06:00
YAMAMOTO Takashi
dfa2949b69 libcxx: Make download+patch a separate target
So that it doesn't need to be done on every sethost.sh.
2020-12-20 23:16:11 -06:00
Xiang Xiao
98be50a9bc libc: Implement posix_fallocate
as specified here:
https://pubs.opengroup.org/onlinepubs/007904875/functions/posix_fallocate.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-12-14 09:20:15 +01:00
Juha Niskanen
eaa75b11f8 libs/libc: fix typos in comments
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-12-13 09:06:28 -06:00
chao.an
859e1ce63a crypto/arc4random: rename getrandom to arc4random_buf
Change-Id: I5c9f0c9acf5af71f01beceaf06ebe0a2c87676bc
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-13 08:49:51 -06:00
chao.an
866bb35d2d libs/libc/net: implement ether_aton/ether_aton_r
Reference here:
https://www.unix.com/man-page/linux/3/ether_aton

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-10 20:37:32 -06:00
Juha Niskanen
21271c44b7 libs/libc/string/lib_strcspn.c: fix function name in comment
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-12-08 12:58:40 -06:00
YAMAMOTO Takashi
f0fc385232 libs/libc/machine/risc-v/rv64/arch_elf.c: Don't assume binfo expansion 2020-12-06 09:03:09 -06:00
YAMAMOTO Takashi
c7a2ee11ca libs/libc/machine/arm/armv6-m/arch_elf.c: Appease nxstyle
The following errors are intentionally left.
They are a part of tables which are not trivial to fix.

libs/libc/machine/arm/armv6-m/arch_elf.c:228:94: error: Long line found
libs/libc/machine/arm/armv6-m/arch_elf.c:230:89: error: Long line found
libs/libc/machine/arm/armv6-m/arch_elf.c:238:94: error: Long line found
libs/libc/machine/arm/armv6-m/arch_elf.c:240:89: error: Long line found
libs/libc/machine/arm/armv6-m/arch_elf.c:401:94: error: Long line found
libs/libc/machine/arm/armv6-m/arch_elf.c:403:91: error: Long line found
libs/libc/machine/arm/armv6-m/arch_elf.c:411:94: error: Long line found
libs/libc/machine/arm/armv6-m/arch_elf.c:413:91: error: Long line found
2020-12-06 09:03:09 -06:00
YAMAMOTO Takashi
0117d2b2f6 libs/libc/machine/arm/armv7-a/arch_elf.c: Fix syslog formats 2020-12-06 07:41:37 -06:00
YAMAMOTO Takashi
51b6a3cd1a libs/libc/machine/arm/armv7-a/arch_elf.c: Appease nxstyle 2020-12-06 07:41:37 -06:00
YAMAMOTO Takashi
9579fe1444 libs/libc/spawn/lib_psa_dump.c: Fix a syslog format 2020-12-05 08:13:32 -06:00
dongjiuzhu
11617fe5ab unistd/getopt: remove count of arguments limits
For commands without "-" arguments, ex:"ls", we should always let
optind = 1 after getopt is called in order to get what follows
correctly.

Change-Id: Iac3cfbadd27fb96e47070c4e3198229306299b6b
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-12-02 02:56:23 -06:00
dongjiuzhu
9315fe21ed pthread_mutexattr_getprotocol: modify prototype
modify the return value according to posix standard

Change-Id: I6e32a8f7a5cac85fe7a395a8115710fdff61d985
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-12-02 07:52:15 +01:00
Matias N
88f1cdb915 build system: add missing --obj-path to MKDEP 2020-11-28 09:59:56 -06:00
chao.an
b1a042734f style/Document: remove unnecessary trailing whitespace
N/A

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 12:20:30 +01:00
chao.an
c56785bd0d style/Makefile: remove unnecessary trailing whitespace
N/A

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 12:20:30 +01:00
YAMAMOTO Takashi
a2a30c8813 libs/libnx/nxfonts/nxfonts_cache.c: Fix syslog formats
Note: the width of nxgl_mxpixel_t depends on configuration.
2020-11-27 05:18:57 -06:00
Xiang Xiao
d6c24312aa Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-26 18:42:18 -03:00
Xiang Xiao
afb0e33138 libc/machine/arch: Support armv8-m relocation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-26 18:42:18 -03:00
Xiang Xiao
74ab69af62 libs/libc/machine/arm: Rename armv8 to armv8-m
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-26 18:42:18 -03:00
Xiang Xiao
edca49fb5f libc/machine/arm: Use the correct arch Kconfig for variant check
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-26 18:42:18 -03:00
Xiang Xiao
baabe5e08a libs/libc/machine: Remove ARCH_CORTEXM33 dependence from LIBM_ARCH_xxx
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-26 18:42:18 -03:00
Alin Jerpelea
9f6a43d0b0 libs: audio: libsamplerate: drop local patches
The needed patches were accepted upstream and now there is no need to
carry local patches.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-11-24 10:54:57 -08:00
YAMAMOTO Takashi
5566d9ad03 libs/libc/netdb/lib_dnsquery.c: Fix a syslog format 2020-11-23 05:00:10 -08:00
YAMAMOTO Takashi
c1f9d8adb1 libs/libc/machine/risc-v/rv64/arch_elf.c: Fix syslog formats 2020-11-22 19:01:05 -08:00
Matias N
d5b6ec450f Parallelize depend file generation 2020-11-22 09:02:59 -03:00
YAMAMOTO Takashi
42a218dabb libs/libc/machine/arm/armv7-m/arch_elf.c: Fix syslog formats 2020-11-21 19:38:32 -08:00
YAMAMOTO Takashi
04f2542cc2 libs/libc/machine/arm/armv7-m/arch_elf.c: Appease nxstyle
The following errors are intentionally left.
They are a part of tables which are not trivial to fix.

libs/libc/machine/arm/armv7-m/arch_elf.c:230:94: error: Long line found
libs/libc/machine/arm/armv7-m/arch_elf.c:232:89: error: Long line found
libs/libc/machine/arm/armv7-m/arch_elf.c:240:94: error: Long line found
libs/libc/machine/arm/armv7-m/arch_elf.c:242:89: error: Long line found
libs/libc/machine/arm/armv7-m/arch_elf.c:403:94: error: Long line found
libs/libc/machine/arm/armv7-m/arch_elf.c:405:91: error: Long line found
libs/libc/machine/arm/armv7-m/arch_elf.c:413:94: error: Long line found
libs/libc/machine/arm/armv7-m/arch_elf.c:415:91: error: Long line found
2020-11-21 19:38:32 -08:00
YAMAMOTO Takashi
34cd44f8d7 libs/libc/modlib/modlib_symbols.c: Fix syslog formats 2020-11-21 19:38:32 -08:00
YAMAMOTO Takashi
6bdca69a32 libs/libc/modlib/modlib_bind.c: Fix syslog formats 2020-11-21 19:38:32 -08:00
Xiang Xiao
759b63d4be libc: implement getopt_long partially
only the short option is supported now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-21 07:01:08 -06:00
Xiang Xiao
af53bdb048 libc: Add opterr global variable
defined here:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-21 07:01:08 -06:00
YAMAMOTO Takashi
8a70c6bf47 libs/libnx/nxfonts/nxfonts_cache.c: Fix syslog formats 2020-11-20 22:22:53 -08:00
YAMAMOTO Takashi
07a67c7b96 libs/libnx/nxmu/nx_eventhandler.c: Fix syslog formats 2020-11-20 22:22:53 -08:00
YAMAMOTO Takashi
aa653fef63 libs/libnx/nxglib/nxglib_splitline.c: Fix syslog formats
Note: b16_t is int32_t.
2020-11-20 22:22:53 -08:00
YAMAMOTO Takashi
02b92c5ad9 libs/libc/pthread/pthread_attr_setstacksize.c: Fix a syslog format 2020-11-20 22:22:53 -08:00
YAMAMOTO Takashi
efe8e24fe7 libs/libnx/nxmu/nx_eventhandler.c: Appease nxstyle 2020-11-20 22:22:53 -08:00
YAMAMOTO Takashi
6d8ccccbb0 libs/libnx/nxglib/nxglib_splitline.c: Appease nxstyle 2020-11-20 22:22:53 -08:00
Alin Jerpelea
48e6f2051d audio: libsamplerate: add initial audio Sample Rate Converter
Add audio sample rate conversion library from
http://www.mega-nerd.com/SRC/index.html

Source:
https://github.com/libsndfile/libsamplerate

Add needed patches for NuttX OS and embedded boards.

NOTE:
We must use master branch until next stable release
2020-11-19 18:05:47 -08:00
YAMAMOTO Takashi
bc4780b8ba libs/libc/uuid/lib_uuid_from_string.c: Fix scanf format warnings 2020-11-18 00:44:55 -08:00
liuhaitao
fd94a32468 sysconf: add _SC_PAGESIZE sysconf support
Also implement getpagesize() based on sysconf(_SC_PAGESIZE).

Change-Id: I812eb8f34ed602f7bc12c4cafafcebc0d98fd136
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-11-17 02:03:23 -08:00
YAMAMOTO Takashi
1b4f65c7f2 libs/libc/uuid/lib_uuid_to_string.c: Fix a printf format warning 2020-11-16 08:29:00 -08:00
YAMAMOTO Takashi
9c08c53e81 libs/libc/time/lib_strftime.c: Fix a printf format warning 2020-11-16 08:29:00 -08:00
YAMAMOTO Takashi
2342b929e7 libs/libc/time/lib_strftime.c: Appease nxstyle 2020-11-16 05:46:53 -08:00
Xiang Xiao
b827565396 [libc++] Move the toolchain's macros undefinition to Make.defs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-15 08:28:36 -03:00
Xiang Xiao
8bc4a5b08a [libc++] Cherry pick patches from mainline to fix warnings
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-15 08:28:36 -03:00
Peter Bee
1f5786f5ea libc/stdlib: Fix range check in strtoul(l)
The previous implementation of strtoul(l) is flawed. The range check
assumed that when overflow happens, the truncated value is smaller than
the original value. As a counter example, passing "10000000000" to
strtol will not trigger ERANGE, but return a truncated value. This patch
adds more accurate range checks.

Change-Id: I239e034e390b4974157ed6efa17110f2e74904cf
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2020-11-12 06:01:33 -08:00
Xiang Xiao
84b90e00f0 libc/stdio: Preallocate the stdin, stdout and stderr
to handle the uninitialized stdin/stdout/stderr gracefully
report here:
https://github.com/apache/incubator-nuttx/issues/2203

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-11 09:56:10 -08:00
YAMAMOTO Takashi
f307d999e6 lib_libvsprintf.c: Implement "t" modifier for printf
Introduced by C99 for ptrdiff_t.
2020-11-10 00:03:06 -08:00
Xiang Xiao
b23bca5cb3 libcxx: Update 0001-libcxx-Port-to-NuttX-https-nuttx.apache.org-RTOS.patch
All changes come from:
from YAMAMOTO Takashi <yamamoto@midokura.com>

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-08 13:04:43 -03:00
Xiang Xiao
e160bffe28 Remove all fclose with stdin, stdout and stderr
since it is wrong to close the builtin stream and specially note
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fclose.html:

Since after the call to fclose() any use of stream results in
undefined behavior, fclose() should not be used on stdin, stdout,
or stderr except immediately before process termination (see XBD
Process Termination), so as to avoid triggering undefined behavior
in other standard interfaces that rely on these streams. If there
are any atexit() handlers registered by the application, such a
call to fclose() should not occur until the last handler is
finishing. Once fclose() has been used to close stdin, stdout, or
stderr, there is no standard way to reopen any of these streams.

and it is also unnecessary because the stream always get flushed.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-29 20:43:50 +09:00
Yoshinori Sugino
c13f869432 Modify SIGSTP to SIGTSTP
Follow the POSIX description.
SIGTSTP should be sent when the Ctrl-Z characters is encountered, not SIGSTP.

Testing:
Built with hifive1-revb:nsh (CONFIG_SERIAL_TERMIOS=y, CONFIG_SIG_DEFAULT=y and CONFIG_TTY_SIGTSTP=y)
2020-10-29 01:12:43 -07:00
YAMAMOTO Takashi
ff3fa805a4 libxx: Use Kconfig "choice" to specify an implemenetation
It doesn't make sense to enable both of LIBCXX and UCLIBCXX.
This commit reflects it to Kconfig.
2020-10-28 14:10:30 -03:00
Yoshinori Sugino
079737dd0c libs/libc/signal/sig_pause.c: Fix a comment 2020-10-28 07:12:46 +01:00
Xiang Xiao
2b9282d5ee libc: Skip close stdin/stdout/stderr in fclose
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-26 22:16:53 -07:00
ligd
b69c587dc9 stdio: remove depends on setbuf setvbuf
N/A

Cause the function realize will handle this

Change-Id: I154c21c7a40667afae423bb0ebb67de8f5fc42fd
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-10-26 22:12:02 -07:00
YAMAMOTO Takashi
07fc24ba99 libxx: Suppress -Wmissing-exception-spec on operator new 2020-10-26 22:08:40 -07:00
YAMAMOTO Takashi
4c7bf29e35 libxx: Add exception specifier to operator delete
CXX:  libxx_delete.cxx
libxx_delete.cxx:52:6: error: 'operator delete' is missing exception
      specification 'throw()' [-Werror,-Wmissing-exception-spec]
void operator delete(FAR void *ptr)
     ^
                                    throw()
1 error generated.
2020-10-26 22:08:40 -07:00
YAMAMOTO Takashi
6aef245523 libxx: Stop mentioning libs not integrated with this version of libxx 2020-10-26 22:07:39 -07:00
YAMAMOTO Takashi
caf67c817f libxx: Update README
This doc seems a bit outdated to me.
This commit is my best attempt to update it.
2020-10-26 22:07:39 -07:00
YAMAMOTO Takashi
df812d09a2 math: Make this friendly with libcxx
- Turn some macros into functions

- Implement some type-agnostic functions.
  (Just use __builtin_xxx)

- Add some missing function prototypes
  (Just prototypes, not actually implemented in this commit)
2020-10-25 07:30:14 -07:00
Yoshinori Sugino
7b3cb0a23b libs/libc/string/lib_strsignal.c: Fix a comment 2020-10-25 08:49:44 -03:00
dongjiuzhu
2b5be56bd0 serial/termios: support custom baud rate setting
N/A

Change-Id: I0cc00f6d0fda852533bd4a38ea6fc39e0d0059da
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-10-21 10:11:21 -07:00
Xiang Xiao
eb4121ce38 Change all 'Nuttx' to 'NuttX'
Unify the naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-20 01:45:06 -07:00
Xiang Xiao
9928088868 libc: Don't fclose and fopen file in freopen
to avoid FILE pointer change after this commit:
commit b0797263ca
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Thu Aug 13 18:17:29 2020 +0800

    libc/stdio: Allocate file_struct dynamically

    1.Reduce the default size of task_group_s(~512B each task)
    2.Scale better between simple and complex application

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-19 21:31:31 -07:00
Xiang Xiao
c67da1d2b5 libxx: Switch the package downloading from 11.0.0.rc1 to 11.0.0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-12 20:33:55 +01:00
Yoshinori Sugino
5a1788822d libs/libc/signal/sig_wait.c: Fix a typo 2020-10-11 13:00:25 +08:00
raiden00pl
33901969fe Fix nxstyle warnings 2020-10-10 12:24:28 -06:00
raiden00pl
24e17910b2 libdsp: Changed headers for apache 2.0 license 2020-10-10 12:24:28 -06:00
Gregory Nutt
32b0562375 Add some comments to inet_ntop()
Endian-ness issues are mind boggling sometimes.  I have been confused by the logic in inet_ntop() a few times so I thought I would add some comments so that I (and others) will understand the endian-ness issues in the future.  No change to logic, only comments changed.
2020-10-05 03:00:22 +08:00
Nathan Hartman
80ce7800a9 Sources and Docs: Fix typos and nxstyle issues
Documentation/contributing/coding_style.rst:

    * Fix repeated words: ("this this").
    * Remove trailing spaces.

boards/z80/z80/z80sim/README.txt:

    * Fix repeated words: ("this this") and rewrap lines.

graphics/Kconfig,
libs/libc/math/Kconfig:

    * Fix repeated words: ("this this").

arch/arm/src/armv7-a/arm_assert.c,
arch/arm/src/armv7-r/arm_assert.c,
arch/arm/src/imxrt/imxrt_enet.c,
arch/arm/src/kinetis/kinetis_enet.c,
arch/arm/src/kinetis/kinetis_flexcan.c,
arch/arm/src/s32k1xx/s32k1xx_enet.c,
arch/arm/src/s32k1xx/s32k1xx_flexcan.c,
arch/arm/src/stm32/stm32_pwm.c,
arch/arm/src/stm32h7/stm32_pwm.c,
arch/arm/src/stm32l4/stm32l4_pwm.c,
arch/renesas/src/rx65n/rx65n_usbdev.c,
binfmt/libnxflat/libnxflat_bind.c,
drivers/pipes/pipe_common.c,
net/igmp/igmp_input.c,
net/tcp/tcp_conn.c,
sched/sched/sched_roundrobin.c:

    * Fix typo in comment ("this this").

arch/arm/src/cxd56xx/cxd56_usbdev.c,
arch/arm/src/lc823450/lc823450_usbdev.c:

    * Fix typo in comment and rewrap lines.

arch/arm/src/imxrt/imxrt_usbdev.c,
arch/arm/src/stm32/stm32_dac.c,
arch/arm/src/stm32f0l0g0/stm32_pwm.c,
arch/arm/src/stm32f7/stm32_pwm.c,
arch/arm/src/tiva/lm/lm4f_gpio.h,
fs/nxffs/nxffs_write.c,
include/nuttx/analog/pga11x.h,
include/nuttx/usb/usbdev.h,
net/mld/mld_join.c:

    * Fix typo in comment ("this this").
    * Fix nxstyle issues.
2020-10-02 04:54:52 +02:00
YAMAMOTO Takashi
3e6561c3cf lib_libvscanf.c: Implement "j" modifier for scanf
It's a part of C99 and commonly used these days.
2020-09-23 03:28:40 -07:00
Gregory Nutt
ebdfd16f0f Move gettid() implementation to /libs/libc/unistd
Move sched/task/task/task_gettid.c to libs/libc/unistd/lib_gettid.c.  gettid() is a dumb wrapper around getpid().  It is wasteful of resources to support TWO systme calls, one for getpid() and one for gettid().  Instead, move gettid() in the C library where it calls the single sysgtem call, getpid().  Much cleaner.
2020-09-22 19:40:56 -07:00
Xiang Xiao
f4794f0b48 libc: Implement access function correctly
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6ae3abf79bd9aa8cfb54b8bbe302d69c4d9cb8ff
2020-09-22 10:30:36 +02:00
spiriou
a1c047fe53 libc/uio: enable writev() for sockets 2020-09-21 19:31:06 -07:00
Xiang Xiao
ba3f12c93f libc: Implement popcount/popcountl/popcountll
specified here:
https://www.unix.com/man-page/netbsd/3/popcountll/

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-21 07:37:04 -07:00
chao.an
216c33a5c7 libs/libc/stdlib: Implement mkdtemp(3) syscall
See the reference here:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdtemp.html

Change-Id: I49081ecafc011a843e6067b1118b53bf65d4418b
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-19 04:16:14 -07:00
chao.an
4067a9f057 libs/libc/stdio: correct the prototype of mktemp(3)
From:   int       mktemp(FAR char *path_template);
To:     FAR char *mktemp(FAR char *path_template);

See the reference here:
https://pubs.opengroup.org/onlinepubs/009695399/functions/mktemp.html

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-19 04:16:14 -07:00
chao.an
0826b827ee libs/libc/time: add stub for futimes/ns(2)
Change-Id: I231817d10b9e2071b1f642e8694839b2a64b1c4c
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-19 03:20:09 -07:00
chao.an
0f06c35640 unistd/priority: Implement [s/g]etpriority(2) syscall
See the reference here:
https://pubs.opengroup.org/onlinepubs/009695399/functions/getpriority.html

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-19 01:06:51 -07:00
chao.an
b8fa1e51d8 time/tm: add "tm_zone" member into tm
base/time/time_exploded_posix.cc:190:14: error: ‘struct tm’ has no member named ‘tm_zone’; did you mean ‘tm_mon’?
  190 |   timestruct.tm_zone = nullptr;  // not a POSIX field, so mktime/timegm ignore
      |              ^~~~~~~
      |              tm_mon

Change-Id: I9f93e63b50c0692a7a2bfc47abd9d07aa2c8e8db
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-18 20:03:05 -07:00
chao.an
614ac5b0f2 libs/libc/unistd: Implement pipe2(2) syscall
See the reference here:
https://www.man7.org/linux/man-pages/man2/pipe2.2.html

Change-Id: Ife19b9bdbde73c7421be381a094da67017819e63
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-18 20:01:26 -07:00
Matias N
166242c171 use "export" to expose TOPDIR to all child make instead of passing it around every time 2020-09-15 21:11:33 -07:00
ligd
c38c821fc2 libs/libc/time: add gethrtime() support
Change-Id: I8882207d3a7e5062f70c7b4b95205361c71f8744
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-09-15 10:28:21 -03:00
ligd
b3541ccaf8 libs/libc/unistd: add dummy getrlimit & setrlimit support
Change-Id: Iee826204596c492ace853e49ab7ff26a2ae7fe60
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-09-15 10:28:21 -03:00
ligd
c11c1dc8fd libs/libc/stdio: replace double_t to double
Modify reason:

When build Nuttx SIM, in x86_64 system:

Compile with gcc option '-m64' (default):
sizeof(double_t) = 8
sizeof(double)   = 8

Compile with gcc option '-mx32':
sizeof(double_t) = 8
sizeof(double)   = 8

Compile with gcc option '-m32':
sizeof(double_t) = 12       // long double
sizeof(double)   = 8

When use '-m32', and print sth. like this:
printf("%f\n", (double)3.0);
SIM will print out: nan

This is because sizeof(double_t) is not equal with double.

Resolve:
replace all double_t to double in libs/libc/stdio.

As a user of '-m32', you should know double_t is one type
long double, and len is 12. And you use use '%lf' to print.
like:
printf("%lf\n", (double_t)3.0);

Currently we don't support '%lf'.

Change-Id: I9b9d11853140d5296dd80416c8ed6a260a9d2d9c
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-09-15 14:42:36 +08:00
Xiang Xiao
027e2eed28 libc: Implement umask function
Here is the spec:
https://pubs.opengroup.org/onlinepubs/009695399/functions/umask.html
Note: The simple implementaton is enough since
      NuttX doesn't really support the permission

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-14 12:16:58 -03:00
dongjiuzhu
03c7951cbd libc/termios: modify termios setting follow linux and posix
Change-Id: Id323b3169e74f4153fd8d132d20926b7fb8336a3
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-09-14 09:23:46 -03:00
Matias N
34b34e2d45 Fix: ensure archive files do not carry object files from prior builds
In some cases, when NuttX configuration changes and this makes the
object list used to build one of the .a libraries change as well,
since the command used to build it is "ar crs" and this simply appends
the list of object files, the library could still include object
files from prior builds. This commit modifies the ARCHIVE macro to
erase the .a file if it already exists.

Since in some cases this behavior was actually expected (object
files from a subdirectory were appended to a library created one
level above) I added a ARCHIVE_ADD which works as ARCHIVE did.

This change should greatly improve behavior of building after
configuration changes.
2020-09-14 15:54:18 +08:00
Xiang Xiao
b0797263ca libc/stdio: Allocate file_struct dynamically
1.Reduce the default size of task_group_s(~512B each task)
2.Scale better between simple and complex application

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia872137504fddcf64d89c48d6f0593d76d582710
2020-09-11 17:58:17 +08:00
ligd
f428160dcc signal: add SIGQUIT & SIGTERM support
SIGQUIT SIGTERM are equal with SIGINT now

Change-Id: Iefc084d58db28003dc40a17f1ff3fbd7a0b716ed
2020-09-11 10:41:24 +08:00
Huang Qi
1025456ffa libs/libc/time: Add stub for utimes
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: Id4b51de943c4119d4d9ede1096475b1831593349
2020-08-29 23:21:47 +08:00
Xiang Xiao
b5f429c88b Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-22 17:37:21 -06:00
Xiang Xiao
ae356001cf Change all files come from Xiaomi/Pinecone to Apache License 2.0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-22 17:37:21 -06:00
Xiang Xiao
6670bc2b27 libc/time: Implement tm::tm_gmtoff field
defined by BSD and GNU library extension:
https://www.gnu.org/software/libc/manual/html_node/Broken_002ddown-Time.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I33113bc322f038a3602880db4fb9cf93001947ac
2020-08-21 07:48:52 -03:00
Xiang Xiao
297c294c0f libc: Change ctype macro to normal function
to avoid the argument evaluation more than once

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib59c9bc8d259731bc6e7ff542379b74ba22d6e33
2020-08-21 16:56:00 +08:00
Xiang Xiao
beb745ef92 sched/pthread: Implement pthread_attr_[get|set]detachstate
specified here:
https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getdetachstate.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I84ec2d14f14cb7118aac3f7f356f83a5f9af4e18
2020-08-20 10:46:14 +01:00
qiaowei
1d97b2ecee stack check: Support Stack Smashing Protector(SSP)
and enable on sim as a demo. Here is the paper:
ftp://gcc.gnu.org/pub/gcc/summit/2003/Stackguard.pdf

Signed-off-by: qiaowei <qiaowei@xiaomi.com>
Change-Id: I1926936328dad54eee16b322dcaad0b42f9c4a62
2020-08-18 09:58:21 -07:00
Xiang Xiao
a7a81b5126 libc: Replace all [nx]sem_xxx with _SEM_XXX
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I34f407ccd52391588ac1b720fce59d24458fe218
2020-08-18 07:59:21 -07:00
chao.an
7ce2b3fa74 libc/pthread: Implement pthread_condattr_[g|s]etclock
Reference:
https: //pubs.opengroup.org/onlinepubs/009695399/functions/pthread_condattr_setclock.html

Change-Id: I19c15d5f219fcf28dbfeb2e5a1e3fc7b38ba2259
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-08-17 19:17:08 +01:00
Xiang Xiao
79d476e423 Fix libsupc++.a(vterminate.o): undefined reference to `_impure_ptr'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ibbd9d980aa642b5a23016b54de8a7808db7b3b9f
2020-08-17 13:45:56 -03:00
Xiang Xiao
6039fb48ae libxx: Integrate libc++ latest official release
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic0a5f6dd8504382c49546c05399c2ea6470cd528
2020-08-17 13:45:56 -03:00
Xiang Xiao
4ebaf12b4b libxx: Ensure uClibc++ distclean clear
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-17 13:45:56 -03:00
chao.an
82caa786cc libc/fopen: add open for text (translated) access support
Change-Id: I5bb4e01a91a0f8ea82437cdcba191c484aa1b77f
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-08-16 00:01:36 +01:00
Huang Qi
57e1211ed6 math: Implement cbrt
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2020-08-14 07:27:55 -05:00
chao.an
7356b5a2ed libc: Implement strlcpy function
Reference:
http://www.delorie.com/djgpp/doc/libc/libc_763.html

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-08-14 03:44:26 -07:00
Xiang Xiao
4df42ba9fb libc/ftw: Fix error: cast between incompatible function types from 'ftw_cb_t' nftw_cb_t
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I9e617ac04127e1e9126de2e3d32b35f2c6d636c0
2020-08-11 08:16:58 -07:00
Xiang Xiao
b13f3212ad libc: Implement ftw and nftw function
see the reference here:
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/ftw.h.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3b368106a56b0e9d4c653f3ae16304b0a9d55fbc
2020-08-11 16:44:42 +09:00
Huang Qi
fd78f83e02 drivers/video: Refine the update region notification mechanism
1.Expose the notification through fb_vtable_s::updatearea
2.Incorporate old nx_notify_rectangle into the new updatearea callback
3.Migrate the calle of nx_notify_rectangle to fb_vtable_s::updatearea

Change-Id: Ia3d1f73e8757b2d381586d76ec6adc16c810018d
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2020-08-10 08:08:33 +02:00
Xiang Xiao
5c67eac27f libc: Change index/rindex from macro to function
to avoid the confliction with the same name variable

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-05 04:39:03 -07:00
Gregory Nutt
188d4b0fb4 user-space memalign() must not be called from within the OS.
drivers/net/ftmac100.c, libs/libc/stdlib/lib_aligned_alloc.c

A continuation of PRs #1507, #1510, and #1512.  See Issue #1481 for additional information.
2020-08-04 22:45:47 +01:00
spiriou
a4a9eb2f5a fs/vfs: Add file descriptor based events support 2020-07-31 15:09:35 -06:00
YAMAMOTO Takashi
b6316e9a03 libs/libc/modlib/modlib_sections.c: Remove a redundant assignment
Found by clang-check:

modlib/modlib_sections.c:93:3: warning: Value stored to 'buffer' is never read
  buffer    = loadinfo->iobuffer;
  ^           ~~~~~~~~~~~~~~~~~~
1 warning generated.
2020-07-30 16:16:21 +02:00
YAMAMOTO Takashi
39ed1417d8 lib_libfread.c: Replace Gregory Nutt's copyright notice with Apache 2.0
The new license text was copied from sched_getcpu.c.
2020-07-30 16:16:21 +02:00
YAMAMOTO Takashi
15590005d0 lib_libfread.c: nxstyle fixes 2020-07-30 16:16:21 +02:00
YAMAMOTO Takashi
d02354c766 libs/libc/stdio/lib_libfread.c: Remove a redundant assignment
Found by clang-check:

stdio/lib_libfread.c:75:7: warning: Value stored to 'bytes_read' is never read
      bytes_read = -1;
      ^            ~~
1 warning generated.
2020-07-30 16:16:21 +02:00
Xiang Xiao
3cff139b85 libc: Make gethostname as syscall instead of uname
simplify and symmetry the implementation in KERNEL/PROTECTED build

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iefdeea5f6ef6348c774b2ca9f7e45fe89c0c22dd
2020-07-30 10:33:08 +09:00
Xiang Xiao
1cb1fb427d libc: Replace all malloc/free to lib_malloc/lib_free
since libc can be built and used in kernel space,
we must call kmm_malloc and kmm_free in this case.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-29 10:14:27 +01:00
SPRESENSE
e249a2f82f Makefile: Fix Make.dep not updated by config changes
Make.dep file should be updated by .config changed after first make.
There are 2 cases affected for this problem:

 1) Add source files by config symbol
 2) Include header files in #ifdef directive

These 2 cases may not be included in Make.dep and this may prevent the
differential build from working correctly.
2020-07-28 03:59:45 -05:00
Masayuki Ishikawa
524f18c4cd libs: termios: Replace license header with Apache License 2.0
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-07-28 00:47:39 -05:00
Xiang Xiao
33ec242caf Implement proposed POSIX _clockwait variants of existing _timedwait functions
Here is the related glibc patchset:
https://patchwork.ozlabs.org/project/glibc/cover/cover.b0c66849a87ca79889a49f2f1f2563b1a8a15d8b.1551291557.git-series.mac@mcrowe.com/

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I0095cb34cef3d0d88a100255053da79266b73ff2
2020-07-27 20:39:59 -03:00
Xiang Xiao
6c03a4e4d5 libc: Add uuid implemenation
specified by OpenGroup here:
https://pubs.opengroup.org/onlinepubs/009629399/toc.htm

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3bc585e7f4d41f6c2ea70e170276ab0d0399b088
2020-07-21 21:48:18 -07:00
Xiang Xiao
7c54f51dc0 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-19 19:35:21 -07:00
Xiang Xiao
e1ecb3e27c libc: Don't define localtime[_r] to macro when CONFIG_LIBC_LOCALTIME not define
since libc++ declare these function in ctime by:
using ::localtime[_r];

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic0bb68b44c0cab838ab7cc34baee2aaa3ca8a9b5
2020-07-19 19:35:21 -07:00
Alan C. Assis
871613f271 libc: Typecast to avoid overflow in inet_addr for AVR
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-07-19 15:49:13 -03:00
Xiang Xiao
d6827cab60 arch: up_assert shouldn't call exit directly
since exit will be only callable from userspace and change
the 1st argument from "const uint8_t *" to "const char *"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I86487d57210ab63109148232da71dbc4d60a563b
2020-07-19 01:21:36 +01:00
Xiang Xiao
ac7e5de5ae libxx: Integrate uClibc++ latest official release
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I05377a0a7674f1cbe461ce67960bd3dc62729337
2020-07-17 21:40:34 +01:00
Xiang Xiao
6f6d61eec4 fs/vfs: Implement statvfs and fstatvfs
specified here:
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/statvfs.h.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-13 20:25:03 +01:00
Xiang Xiao
6abd03d53f libxx: Unify uClibc++ and libc++ config
code just need check CONFIG_CXX_EXCEPTION/CONFIG_CXX_LIBSUPCXX now,
instead uClibc++/libc++ specific config

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3b00a5a6701b8bf1c70de89f2d924592ca3e38b0
2020-07-13 15:08:13 -03:00
Xiang Xiao
aa0d57e8ad libc: Move unwind code to libs/libc/machine/arm
because the logic:
1.only work on arm platform
2.couple with elf format

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I25dc95b5fc7b24196e2e71fdcf82d71d621ee2d3
2020-07-11 10:34:22 -07:00
Xiang Xiao
9dff16e0e4 fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ieaf325c899d1c349d64dfa15bddcc32afd1fce42
2020-07-10 21:30:02 +01:00
Xiang Xiao
c3e256e018 libxx: Make __dso_handle weak
since sim arch has to use other instance provided by host glibc
also initialize __dso_handle to self as glibc:
https://github.com/bminor/glibc/blob/master/csu/dso_handle.c#L21

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I7531ae58fc4dbe4600bcb2c2c3a6cac021378bc1
2020-07-10 13:51:26 +09:00
Xiang Xiao
5da9cb3ae6 libxx: Eanble HAVE_CXXINITIALIZE automatically if LIBCXX or UCLIBCXX enable
otherwise the user is shocked that using cin/cout/cerr will crash the system

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I453427261f3e2a6e60f7dd2398f7d3bd1043a0d5
2020-07-09 13:19:54 +01:00
Oleg Evseev
9761235408 libs/libc/semaphore/sem_getvalue: correct get_value descriptions
avoid possible confusion and follow the description POSIX.1-2017
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_getvalue.html
2020-07-04 00:36:02 -05:00
Xiang Xiao
60fe0a0f96 libc: Refine the inline handling
1.Remove CONFIG_HAVE_INLINE macro
2.Change the ANSI C function to normal function
3.Other simple non ANSI function to macro

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-04 11:10:29 +09:00
Xiang Xiao
8153e31753 sched: Call c++ global variables constructor inside nxtask_startup
to avoid the similar code spread around each application

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I8967d647eaf2ecae47f29f83e7fa322ef1b42a02
2020-07-01 07:55:33 -06:00
Xiang Xiao
e9c7df4769 sched: Rename task_startup to nxtask_startup
to follow the naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3594d12a65e8cacea99bc295d622628304c3f9f8
2020-07-01 07:55:33 -06:00
Xiang Xiao
a102922e12 libc: Implement realpath
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie52dcd1c5c5faa4b033901eedd7182bbb9473f7a
2020-06-30 13:09:58 -06:00
ligd
0fe2884713 libs/libc/machine/risc-v: add rv32 support
Change-Id: I96a02aacea4e1d034f986f2937fe496da1f486ba
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-06-30 09:31:21 -03:00
Xiang Xiao
b71c491f00 libc/math: Fix warning: dereferencing type-punned pointer will break strict-aliasing rules
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I15aa5d664c20ea7bb95ba60e056134d2ff933db9
2020-06-29 16:25:22 +01:00
Xiang Xiao
43b613877d libc/stdio: Remove sys/types.h inclusion for printf/scanf
since double_t move from sys/types.h to math.h now and remove
math.h inclusion too because lib_dtoa_engine.h already include

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3497a73908301d999cf1cfc4a66552a7ca4868c6
2020-06-29 16:25:22 +01:00
Xiang Xiao
d17b963bca libc: Move double_t typedef from sys/types.h to math.h
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/math.h.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3497a73908301d999cf1cfc4a66552a7ca4868c6
2020-06-29 13:37:41 +01:00
Xiang Xiao
676a2b77f8 stdio.h: Implement fseeko and ftello function
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fseek.html
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftell.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-29 14:26:19 +09:00
Xiang Xiao
977f04a2b1 libc: sysconf support _SC_NPROCESSORS_CONF/_SC_NPROCESSORS_ONLN
specified here:
https://www.man7.org/linux/man-pages/man3/sysconf.3.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I87fba8476221797e59c69c1953974bebc8d0d7b3
2020-06-27 22:43:13 +01:00
Masayuki Ishikawa
edd3dd3168 libs: rv64: Fix _calc_imm() in arch_elf.c 2020-06-25 02:21:23 -05:00
YAMAMOTO Takashi
ef5d204fd2 rewind: clear the error indicator
Make rewind() clear the error indicator of the stream
as it's specified by the standards.
2020-06-24 16:56:44 +08:00
Xiang Xiao
d24bd782a9 libc: Implement pathconf and fpathconf
specified here:
https://pubs.opengroup.org/onlinepubs/009695399/functions/fpathconf.html
note: only _PC_PATH_MAX is handled now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Idd323dc10e8f31f10dd1fc64f467227808c11dbd
2020-06-23 17:34:54 +01:00
Xiang Xiao
1e166f7ecb sysconf: Implement _SC_ATEXIT_MAX query
and remove the incorrect macro ATEXIT_MAX

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia5d7dafc50e942f62f95137313c34741c6dd60ba
2020-06-23 17:34:54 +01:00
YAMAMOTO Takashi
66052f7c4c mkstemp: Only look at the trailing Xs
As it's stated in the standards.

The original code look at the first Xs. It can end up with
an unexpected behavior, if a template contains multiple series of Xs.
E.g. /tmp/XXXXXX/XXXXXX
2020-06-16 19:47:42 +08:00
Peter van der Perk
55d9e5f7af net: Add SocketCAN support 2020-06-15 08:07:19 -06:00
Xiang Xiao
5fbf52788f libc/locale: Add the mininal support for locale_t operation
include duplocale, freelocale, newlocale and uselocale

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I9912003847dec660ae5c62836d4d56ebe0718869
2020-06-15 07:20:19 -06:00
Xiang Xiao
0317eae801 libc: support CONFIG_ARCH_ROMGETC for scanf function series
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ieb524fa431ad60eb586a99d68aed4a022fb87ae7
2020-06-10 00:03:53 -07:00
Xiang Xiao
43d7c1e807 libc: Add IPTR for puts/fputs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2a83afb4d934a44ad1b56ec6dd72e654f4e112a3
2020-06-10 00:03:53 -07:00
liuhaitao
ac84a5177d libc/time: call _NX_OPEN/_NX_CLOSE instead of open/close
Change-Id: I1d8a17ae7cac11e445dba25a8699f98186910568
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-06-04 12:10:54 +01:00
Gregory Nutt
4935ab5243 printf() and vprintf() must use C buffered I/O if available.
This backs out a part of PR 1179 which has a very serious error:  If C buffered I/O is available, then printf() and vprintf MUST use it.  Otherwise, the ordering of the I/O will be screwed up.  They must not use direct file descriptor I/O UNLESS C buffered I/O is disabled.
2020-06-03 18:38:19 +01:00
Xiang Xiao
3c4fec80f8 libc: Fix warning: implicit declaration of function ‘strnlen’
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib2094a2ef0c3910e9b30685e73fc7012bf23a35f
2020-06-03 07:46:02 -06:00
Xiang Xiao
c76443f456 libc: Remove CONFIG_LIBC_TMPDIR definition from lib_mkstemp.c
since this file doesn't use this macro at all

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6042316a2568e35ed1b3dd0ab1b974ca5d23f02f
2020-06-03 07:46:02 -06:00
Xiang Xiao
4029706583 libc: tmpfile shouldn't hardcode the folder to /tmp
use P_tmpdir macro instead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-03 07:46:02 -06:00
Xiang Xiao
29f9d97420 libc: Call vdprintf in printf/vprintf for CONFIG_NFILE_STREAMS == 0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3c49ec02a9444f039ac7aac7b8ea6de5d1090340
2020-06-03 07:35:08 -06:00
Xiang Xiao
a55f8d24a2 libc: Implement vscanf() function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2421e57b2c848c43afb749b8ebfa79ec457cde26
2020-06-03 07:35:08 -06:00
Xiang Xiao
6b3ac93e78 libc: Fix a typo error in tmpfile
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic6db2c76844a5a9d503fc46bb4b930870afbd9ed
2020-06-02 10:18:55 -06:00
Xiang Xiao
9ff32427bf libc: Implement tmpfile() function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I00bdb42006b40bf1b9bc0bb6865b9b88b4acbb7b
2020-06-02 09:32:25 -06:00
Xiang Xiao
de509004fd libc: Implement mblen, mbstowcs and wcstombs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I682c39fc132a1614b91284670882e331add765a9
2020-06-02 07:13:37 -06:00
Xiang Xiao
7cbcbcde51 libc: Implement wcsrtombs, wcsnrtombs and mbsnrtowcs
and update the related stuff in libs/libc/libc.csv

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id695a7f07bf18a7b4e526297f9131c75ddb79d30
2020-06-02 07:13:37 -06:00
Xiang Xiao
f1433ee8d2 libc: Fix the typo error in wcrtomb
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id8841ca33a47cea3a1b68229979fd607049f766d
2020-06-02 07:13:37 -06:00
Xiang Xiao
57caa4e121 libc: Move MB_LEN_MAX from lib_wctob.c to limits.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3a5addac99adb02f57aba05aa9fe2e6aaf31071d
2020-06-02 07:13:37 -06:00
YAMAMOTO Takashi
86b7c20b7d Implement "j" modifier for printf format
It's a part of C99 and commonly used these days.
2020-06-02 11:18:16 +02:00
YAMAMOTO Takashi
d884dd301f Fix nxstyle complaints
various nxstyle fixed to avoid the CI warnings
2020-06-02 11:18:16 +02:00
Xiang Xiao
b932b653dd arch: Select 64bit elf base on the architecture characteristic
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I09eec5a76f255016a910cfec3b3f70cd7577525e
2020-05-31 21:38:32 -07:00
Xiang Xiao
7e5b0f81e9 build: Replace -I with INCDIR
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 20:20:12 +01:00
Xiang Xiao
23668a4b9b build: Remove the empty variable assignment
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Xiang Xiao
dd61d3d9f9 build: Remve the unnecessary .gitignore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 18:00:40 +01:00
Gregory Nutt
154a87993f fs/vfs/fd_open.c: fs_fdopen() must not set errno
Functions within the OS must never set the errno value.  fs_fdopen() was setting the errno value.  Now, after some parameter changes, it reports errors via a negated errno integer return value as do most all other internal OS functions.
2020-05-23 15:22:09 +08:00
Xiang Xiao
1a95cce1a3 build: Move .config check to the top Makefile
remove the workaround to handle the inexistence of .config/Make.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-20 17:57:34 +01:00
Xiang Xiao
7faf3c0254 build: replace ${TOPDIR} with $(TOPDIR) in Makefile
make the usage consistence

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-19 19:23:18 +01:00
Xiang Xiao
5eae32577e build: Move INCDIROPT to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00
Xiang Xiao
bd656888f2 build: Replace WINTOOL with CYGWIN_WINTOOL Kconfig
so the correct value can be determinated by Kconfig system automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00
Gregory Nutt
a569006fd8 sched/: Make more naming consistent
Rename various functions per the quidelines of https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions

    nxsem_setprotocol -> nxsem_set_protocol
    nxsem_getprotocol -> nxsem_get_protocol
    nxsem_getvalue -> nxsem_get_value
2020-05-17 14:01:00 -03:00
YAMAMOTO Takashi
76add63598 Bump the default of CONFIG_NETDB_DNSCLIENT_MAXRESPONSE
It's better to have a default working for many cases.
Usually DNS servers are not optimized for embedded clients.
Users can fine tune for their environment anyway.
2020-05-15 14:23:48 +08:00
YAMAMOTO Takashi
e783a59f9d netdb: Truncate the list of ips instead of bailing out with ERANGE
In many cases, users only care the first address anyway.
2020-05-15 14:23:48 +08:00
YAMAMOTO Takashi
b36420ef32 Bump the default of CONFIG_NETDB_BUFSIZE
The old default didn't work even for moderate cases.
(eg. strlen(name) == 17, two ipv4 addresses, on 64-bit sim)
2020-05-15 14:23:48 +08:00
liuhaitao
78c8b43b9c libs/libxx: add .cpp files build support
libcxx project has .cpp files inside, so add .cpp files build support
here.

Change-Id: Icd3bcb42f4ceafa5e07a9977149cb08d555a9ade
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-05-13 09:15:37 +02:00
Gregory Nutt
2b5ff17a85 setlogmask(): Add comments
In include/syslog.h and libs/libc/syslog/lib_setlogmask.c, add comments indicating tht setlogmask() is not thread-safe.
2020-05-11 11:32:55 -04:00
Nakamura, Yuuichi
46baccb521 Remove unnecessary enter/leave_critical_section() in setlogmask() because it is MT-unsafe. 2020-05-11 08:06:29 -06:00
Gregory Nutt
a4218e2144 include/nuttx/sched.h: Make naming of all internal names consistent:
1. Add internal scheduler functions should begin with nxsched_, not sched_
2. Follow the consistent naming patter of https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions
2020-05-09 14:19:08 -03:00
Gregory Nutt
9ce03b1660 Move pthread-specific data into TLS
1. Move pthread-specific data files from sched/pthread/ to libs/libc/pthread.
2. Remove pthread-specific data functions from syscalls.
3. Implement tls_alloc() and tls_free() with system calls.
4. Reimplement pthread_key_create() and pthread_key_free() using tls_alloc() and tls_free().
5. Reimplement pthread_set_specific() and pthread_get_specicif() using tls_set_value() and tls_get_value()
2020-05-08 18:05:04 +01:00
Gregory Nutt
3dca5eba15 Completes the Implementation of the TLS-based errno
- Remove per-thread errno from the TCB structure (pterrno)
- Remove get_errno() and set_errno() as functions.  The macros are still available as stubs and will be needed in the future if we need to access the errno from a different address environment (KERNEL mode).
- Add errno value to the tls_info_s structure definitions
- Move sched/errno to libs/libc/errno.  Replace old TCB access to the errno with TLS access to the errno.
2020-05-07 23:11:34 +01:00
Gregory Nutt
c2244a2382 Remove CONFIG_TLS
A first step in implementing the user-space error is force TLS to be enabled at all times.  It is no longer optional
2020-05-07 12:04:16 -06:00
Xiang Xiao
a2d924eea4 syscall: Fix typo error in cvs and header file
and reoder the entry in cvs file

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-07 10:31:05 -06:00
Gregory Nutt
5c7a0bd9f0 Fix nxstyle complaints from files changed by this PR 2020-05-05 18:56:33 +01:00
Gregory Nutt
bda24f09c2 libs/libc/tls/tls_getinfo.c: Add tls_get_info()
Move the logic to get TLS information from an inline function to a normal function.  For the unaligned case, it is probably too large to be inlined.

Also fixes some minor things from review of previous commits.
2020-05-05 18:56:33 +01:00
Abdelatif Guettouche
b7e7fba732 TLS_UNALIGNED (#2)
* Implement the TLS_UNALIGNED
2020-05-05 18:56:33 +01:00
Gregory Nutt
b1071cca00 libs/libc/tls/Kconfig: Add CONFIG_TLS_ALIGNED
CONFIG_TLS_ALIGNED will select the (legacy) aligned stack implementation of TLS.  If CONFIG_TLS_ALIGNED is not defined, then the new, implementation of TLS using an unaligned stack will be enabled.
2020-05-05 18:56:33 +01:00
Xiang Xiao
d9d2fc0d0a debug: Reduce CONFIG_CPP_HAVE_VARARGS usage
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-05 08:27:58 -06:00
Xiang Xiao
6604cdb3f2 fs: Remove all LIBC_IOCTL_VARIADIC related stuff
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-05 08:27:58 -06:00
Brennan Ashton
8110ea6a7a x86_64: Make sure to clone ap list in vasprintf
VA_LIST is getting clobbered because it is a pointer to a structure
on the stack and we must traverse it twice.  Clone it like we do
for x86_32
2020-05-04 08:37:22 -06:00
Xiang Xiao
32b79b22ec Rename pipe2/mkfifo2 to nx_pipe/nx_mkfifo
and don't modify errno anymore

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-04 07:20:02 -06:00
Gregory Nutt
00933cfece sched/sched: Add sched_get_stackinfo()
The new OS interface, sched_get_stackinfo() combines two pthread-specific interfaces into a single generic interface.  The existing pthread_get_stackaddr_np() and pthread_get_stacksize_np() are moved from sched/pthread to libs/libc/pthread.

There are two motivations for this change:  First, it reduces the number of system calls.  Secondly, it adds a common hook that is going to used for a future implementation of TLS.
2020-05-03 23:33:44 +01:00
Xiang Xiao
a2f6dc9b7c errno: Rename get_errno_ptr to __errno
Inrease the compatiblity with the third party library(e.g. newlib)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-03 12:15:54 -06:00
patacongo
f09e58fe73 Update libs/libc/misc/lib_ioctl.c 2020-05-03 08:17:38 -06:00
Brennan Ashton
4e7d59f6bc Fix debug assert in ioctl to check if int will fit in
unsigned long not be unsigned long

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-05-03 08:17:38 -06:00
Xiang Xiao
31c60c3b0e syscall: nx_task_spawn should exist in the flat build just like the protected build
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-02 09:56:23 -06:00
Alan Carvalho de Assis
8c0fc09853 Vik memcpy() is already defined on string/Kconfig 2020-05-02 08:41:45 -06:00
Xiang Xiao
a2f657e4cb build: Move KDEFINE to a common place(tools/Config.mk)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 15:56:55 -06:00
Xiang Xiao
f2aba8d9b7 build: Remove 'u' prefix from userspace library
so user needn't link the different library because the build type change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 15:56:55 -06:00
Xiang Xiao
f8a809eb5b Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 10:43:47 -03:00
Xiang Xiao
eca7059785 Refine __KERNEL__ and CONFIG_BUILD_xxx usage in the code base
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 10:43:47 -03:00
Xiang Xiao
fe5cb9529d builtin: Remove HAVE_BUILTIN_CONTEXT macro
it's enough to decide which code should be compiled with CONFIG_BUILTIN and CONFIG_FS_BINFS

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 10:43:47 -03:00
liuhaitao
6b4cc3011c Remove the residual files in distclean
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-05-01 04:43:15 +01:00
Ouss4
d0bb7c137a Use NuttX's signal set functions inside the OS. 2020-04-29 16:40:27 -06:00
Xiang Xiao
ddda00ea65 Kconfig: Refine BUILD_FLAT, BUILD_PROTECTED and BUILD_KERNEL usage
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-29 12:16:18 -06:00
liuhaitao
23389215bb libnx/nxfonts: change the generated file nxfonts_tom-thumb-4x6.c to nxfonts_bitmap_tom-thumb-4x6.c
Align the generated files name, so make distclean could also remove all nxfonts_bitmaps_*.c files, no
need to add one more extra DELFILE for nxfonts_tom-thumb-4x6.c.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-28 21:28:15 -07:00
Juha Niskanen
b34d7bf56d libc/netdb: support multiple DNS nameservers when not using resolv.conf
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-04-27 19:52:24 +08:00
Juha Niskanen
ba0a17ca8c libc/netdb: make getaddrinfo re-entrant also when querying with service name
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-04-27 19:52:24 +08:00
Alin Jerpelea
76c47f6b21 libc: audio: nxstyle fixes
This change is needed to be able to fix the warnings on the audio core
and includes the propagation of the fix in the audio.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-04-21 17:19:52 -06:00
YAMAMOTO Takashi
33aaefa2d1 modlib: Replace Gregory Nutt's copyright notice with Apache 2.0
While I'm here adding a new file. (modlib_loadshdrs.c)

The licence text was copied from:
    sched/sched/sched_getcpu.c
    tools/zds/Makefile
2020-04-13 09:49:22 -06:00
YAMAMOTO Takashi
7cfcea2938 Move modlib_loadshdrs to a separate file
To avoid pulling otherwise unused modlib_findsection when linking.
2020-04-13 09:49:22 -06:00
YAMAMOTO Takashi
1adc44e059 Enable modlib_findsection
This fixes unused warning on modlib_findsection
2020-04-13 09:49:22 -06:00
YAMAMOTO Takashi
6f3e127094 Appease nxstyle complaints 2020-04-13 09:49:22 -06:00
Gregory Nutt
759d8c1bfa Run nxstyle against files modified in previous commit. 2020-04-13 02:09:34 +08:00
Gregory Nutt
ca2b0a3657 Fix more warnings noted in PR checks
arp/arp_notify.c:132:43: warning: for loop has empty body [-Wempty-body]
           prev = curr, curr = curr->nt_flink);
                                              ^

    sixlowpan/sixlowpan_tcpsend.c:806:31: warning: implicit conversion from 'unsigned int' to 'uint16_t' (aka 'unsigned short') changes value from 4294967295 to 65535 [-Wconstant-conversion]
                                  _SO_TIMEOUT(psock->s_sndtimeo));
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Numerous warnings like:

    ieee802154_getreq.c:93:3: warning: implicit declaration of function 'memcpy' is invalid in C99 [-Wimplicit-function-declaration]
      IEEE802154_EADDRCOPY(eaddr, req.attrval.mac.eaddr);
      ^

    nxfonts/nxfonts_cache.c:839:35: warning: for loop has empty body [-Wempty-body]
               fcache = fcache->flink);

    bluetooth/bluetooth_finddev.c💯11: warning: implicit declaration of function 'memcmp' is invalid in C99 [-Wimplicit-function-declaration]
          if (BLUETOOTH_ADDRCMP(dev->d_mac.radio.nv_addr, match->bf_addr))
              ^

    rwbuffer.c:559:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      if (rwb->rhmaxblocks > 0 && rwb->rhnblocks > 0)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-04-13 02:09:34 +08:00
Gregory Nutt
2aabf76815 Run nxstyle against modified files in PR 2020-04-13 02:09:34 +08:00
Gregory Nutt
62c1389825 Fix warnings noted in PR build checks:
net/telnet.c:1317:40: warning: result of comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Wtautological-constant-out-of-range-compare]
                      if (priv->td_pending < CONFIG_TELNET_RXBUFFER_SIZE)
                          ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    time/lib_localtime.c:569:32: warning: sizeof on pointer operation will return size of 'char *' instead of 'char [33]' [-Wsizeof-array-decay]
              sizeof(lsp->fullname - 1) <= strlen(p) + strlen(name))
                     ~~~~~~~~~~~~~ ^
2020-04-13 02:09:34 +08:00
chao.an
c3b0848284 misc/Kconfig: enable LIBC_IOCTL_VARIADIC by default
Change-Id: I7bc23a6552af7b443eb433e4d2e3c2c8784b3956
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-04-12 09:27:41 -06:00
Gregory Nutt
72104c182c nxstyle fixes
Run all files modified by PR 766 through nxstyle and fix any resulting complaints.

NOTE:  Numerous "Mixed case identifier" errors in arch/arm/src/cxd56xx/cxd56_gnss.c were not fixed because this problem is of much larger scope than this file.
2020-04-11 21:19:47 +01:00
Gregory Nutt
67ec3d7926 Remove CONFIG_CAN_PASS_STRUCT
This commit resolves issue #620:

Remove CONFIG_CAN_PASS_STRUCTS #620

The configuration option CONFIG_CAN_PASS_STRUCTS was added many years ago to support an old version of the SDCC compiler. That compiler is currently used only with the Z80 and Z180 targets. The limitation of that old compiler was that it could not pass structures or unions as either inputs or outputs. For example:

    #ifdef CONFIG_CAN_PASS_STRUCTS
    struct mallinfo mallinfo(void);
    #else
    int      mallinfo(FAR struct mallinfo *info);
    #endif

And even leads to violation of a few POSIX interfaces like:

    #ifdef CONFIG_CAN_PASS_STRUCTS
    int  sigqueue(int pid, int signo, union sigval value);
    #else
    int  sigqueue(int pid, int signo, FAR void *sival_ptr);
    #endif

This breaks the 1st INVIOLABLES rule:

Strict POSIX compliance
-----------------------

  o Strict conformance to the portable standard OS interface as defined at
    OpenGroup.org.
  o A deeply embedded system requires some special support.  Special
    support must be minimized.
  o The portable interface must never be compromised only for the sake of
    expediency.
  o Expediency or even improved performance are not justifications for
   violation of the strict POSIX interface

Also, it appears that the current SDCC compilers have resolve this issue and so, perhaps, this is no longer a problem: z88dk/z88dk#1132

NOTE:  This commit cannot pass the PR checks because it depends on matching changes to the apps/ directory.
2020-04-11 21:19:47 +01:00
liuhaitao
459ad99373 Use EXTRAFLAGS instead of EXTRADEFINES to be used by make via command line
So call 'make EXTRAFLAGS=-Wno-cpp' could suppress the warnings with pre-processor
directive #warning in GCC.

Change-Id: Iaa618238924c9969bf91db22117b39e6d2fc9bb6
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-11 08:31:08 -06:00
ligd
cbf31bca5c global change: fix tools/checkpatch.sh warnnings
Change-Id: I88cfa979c44bcaf3a8f6e036c6bfccd3402ca85a
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-09 10:29:28 -06:00
ligd
231ad202ee global change: repace sched_xfree() to kxmm_free()
Changes:
sched_xfree() => kxmm_free()
remove garbage related APIs
remove ARCH_HAVE_GARBAGE

Cause garbage feature move to mm_heap, then don't need
garbage anymore.

Change-Id: If310790a3208155ca8ab319e8d038cb6ff92c518
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-09 10:29:28 -06:00
raiden00pl
abfb074110 libs/libdsp: fix nxstyle issues 2020-04-03 22:51:39 +01:00
YAMAMOTO Takashi
a62aa84448 MODLIB_SYSTEM_SYMTAB: Rename the generated file
To avoid conflict with ./libs/libc/modlib/modlib_symtab.c
2020-04-03 10:48:09 -06:00
YAMAMOTO Takashi
804c719319 getnameinfo: Rename a variable to avoid shadowing a global 2020-04-02 14:17:15 +08:00
YAMAMOTO Takashi
da48d912e4 gethostbyaddr_r: Fix an unsed variable warning 2020-04-02 13:38:21 +08:00
Xiang Xiao
4addf6c308 libc/netdb: query IPv6 first than IPv4
since some host have multiple IPv4 address, the dns cache may fill in all
Ipv4 address and refuse to accept any IPv6 address if we query IPv4 first

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I229a7a524fb9daa7498c66913a2de61f11d6fb43
2020-04-01 16:09:28 -06:00
Xiang Xiao
0b662d60fc libc/netdb: Add hostent_s to avoid the change of hostent
and let other function call the new internal function gethostentbyname_r

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic6137d6cf03f75d6ed33e23bf04ae74b7264e682
2020-04-01 16:09:28 -06:00
Xiang Xiao
99dc8bf4e9 libc/netdb: Return EAI_FAMILY in getaddrinfo if the final address is empty
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I510d4e8f79d2b4e78c550b35b7b07f2d0943e32d
2020-04-01 16:09:28 -06:00
Xiang Xiao
8d66a316da libc/netdb: Support save the mix of IPv4/IPv6 address into hostent
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I704d38afde14b6d90a7726096fd1f483f96ba237
2020-04-01 16:09:28 -06:00
Xiang Xiao
7f2810f73a libc/netdb: Should query both IPv4 and IPv6 address regardless the server address type
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I1ba17b3078837cd5b857a13f104550613050d3e0
2020-04-01 16:09:28 -06:00
Xiang Xiao
2e57583219 libc/netdb: Connect to the server before sending
so we can remove the server check in response

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I7ddc00807feb92bb6f0851023bb63d38bf3fdac2
2020-04-01 16:09:28 -06:00
YAMAMOTO Takashi
4dffb8c584 Fix a typo in Kconfig help 2020-04-01 10:23:56 +01:00
Xiang Xiao
15fac7743c libc/netdb: Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-03-30 09:47:28 -06:00
Xiang Xiao
d8b5362380 libc/netdb: Fix typo error in the implementation of gethostbyname_r
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6675e800ad5627881ca904e80317df94f5973eb7
2020-03-30 09:47:28 -06:00
Xiang Xiao
dd0aca6822 libc/netdb: Make host and serv optional for getnameinfo
and fix other minor style

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I107ee5b141f39e1e08967373b1ead4495bc55aa7
2020-03-30 09:47:28 -06:00
Xiang Xiao
a709c83b2e libc/netdb: Make gethostbyaddr_r callable even without CONFIG_NETDB_HOSTFILE
and fix other minor issue

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I1c12440cfb7aef4394539e02a12aeb10088f236b
2020-03-30 09:47:28 -06:00
Xiang Xiao
c85fe67ebc net/loopback: Move g_lo_* global variable to libc/net/
so netdb could reuse these global variable directly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iaa26ddbdaf416f64d43c6e8888a14bbe0c3405eb
2020-03-30 09:47:28 -06:00
Xiang Xiao
eaab17b66a libc/netdb: Change the default max number of host IP to 2 if both IPv4 and Ipv6 enable
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I02614cb34647eaa03b476a6755d0667dc8392036
2020-03-30 09:47:28 -06:00
Xiang Xiao
bd9fbade05 libc/netdb: Fix the buffer overwrite in lib_parse_hostfile
and other minor issue

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I732f63a312ac5c2ddf61ab8084c404bde1b114d4
2020-03-30 09:47:28 -06:00
Xiang Xiao
9e277c6c50 libc/netdb: Return null alias for getservbyport_r/getservbyname_r
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I82728a8ea9a5136e0154cd67ec8de70a4e0ac6ed
2020-03-30 09:47:28 -06:00
Xiang Xiao
d05de762bc libc/netdb: Don't need call dns_initialize in dns_find_answer
so let remove it

Change-Id: I6b09673caf8cb16d90cbda8b791f1ef0ba59e2a2
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-03-30 09:47:28 -06:00
Xiang Xiao
673a43d5fa libc/netdb: Need skip ':' to get port in dns_foreach_nameserver
Change-Id: Ic9555832c4404a59e1117dce06a5de13f0cc4141
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-03-30 09:47:28 -06:00
Xiang Xiao
35b98f2361 libc/netdb: Change the fopen mode from "rt" to "r"
since the text mode is the default

Change-Id: If4df0c69d998a36df541a968d14fc4d6e159db57
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-03-30 09:47:28 -06:00
Xiang Xiao
64a230df7a libc/netdb: Should use ntohs not htons for the receiving data
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I36e508c1ba952d9229790abdb47f4f9dc654d326
2020-03-30 09:47:28 -06:00
Xiang Xiao
07c3b16462 libc/netdb: Replace get_errno with errno
and fix the typo error

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I51e2e4dbdb46fea89f4e18a41d99b943b03cedab
2020-03-30 09:47:28 -06:00
YAMAMOTO Takashi
c62f806581 sim: modlib: Implement some x86_64 relocations
The boilerplate part of the code was copied from:

    libs/libc/machine/risc-v/rv64/arch_elf.c
2020-03-27 00:04:36 -05:00
YAMAMOTO Takashi
bd7829a44d modlib: Don't truncate 64-bit values 2020-03-27 00:04:36 -05:00
YAMAMOTO Takashi
f8077022bd Introduce CONFIG_DEFAULT_TASK_STACKSIZE
* The appropriate size of stack varies among archs.
  E.g. for 64-bit sim, 2048 is way too small, especially when the task
  happens to use host OS functionalities.
  I plan to allow an arch provide its own default.

* I plan to use this to replace hardcoded "STACKSIZE = 2048" in APPDIR.
2020-03-26 22:30:13 -05:00
Gregory Nutt
5c0e8e88b1 Revert "Makefile: move INCDIROPT to common place (#625)"
This reverts commit b9ace36fcc.

This change was added by PR 625 but has a serious logic flaw.  It removes all occurrences of INCDIROPT and replaces it with a definition in tools/Config.mk:

    else ifeq ($(WINTOOL),y)
      DEFINE = "$(TOPDIR)/tools/define.sh"
      INCDIR = "$(TOPDIR)/tools/incdir.sh" -w

This logic flaw is the Config.mk is included in all Make.defs files BEFORE WINTOOL is defined.  As a result, the definition is wrong in many places when building under Cygwin with a Windows native toolchain.
2020-03-26 08:50:29 -07:00
Xiang Xiao
b9ace36fcc
Makefile: move INCDIROPT to common place (#625) 2020-03-26 08:09:59 -06:00
YAMAMOTO Takashi
1ffa009c8b Revert "Don't generate .depend anymore"
This reverts commit 79af7fbf4e.

Because:

* btashton reported some issues in local builds:

  https://github.com/apache/incubator-nuttx/pull/603#issuecomment-602264860

* this might be related to the current CI breakage:

  > /bin/sh: 1: /__w/incubator-nuttx/incubator-nuttx/nuttx/tools/mkdeps: not found
2020-03-22 23:07:29 -05:00
Xiang Xiao
79af7fbf4e
Don't generate .depend anymore 2020-03-22 18:15:29 +00:00
Gregory Nutt
547a3cb3d9 Run all .c and .h files in previous commits through nxstyle. 2020-03-22 08:24:07 -05:00
Gregory Nutt
533528af01 libs/libc: Remove support CONFIG_FS_READABLE 2020-03-22 08:24:07 -05:00
Gregory Nutt
382513e997 libs/libc: Remove support for CONFIG_FS_WRITABLE
The mktemp family of functions are built unconditionally now (but not necessarily included in any  build).
2020-03-22 08:24:07 -05:00
Nathan Hartman
a5e643b0cd Fix typos in comments and documentation. 2020-03-16 20:01:11 -06:00
YAMAMOTO Takashi
df44909b30 xtensa/arch_elf.c: Ignore R_XTENSA_NONE
Now examples/sotest passes on qemu.
2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
061b796d47 Adapt dlfcn/modlib to use the instruction memory allocator 2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
e135c938d2 xtensa: Implement a few relocations 2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
2776a5bbea Replace a few Gregory Nutt's copyright notices with Apache 2.0
The text was copied from sched/sched/sched_getcpu.c.
2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
b2627225bd Update file paths of copy-and-paste'ed files 2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
c7526e551e arch_elf.c: Appease nxstyle errors 2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
5e1b24f012 xtensa: Add modlib boilerplate
This is a modified copy of armv6-m/armv7-m version.
2020-03-16 07:54:49 -06:00
Gregory Nutt
266849549a libs/libc/netdb/lib_dnsaddserver.c: Fix wrong fopen() mode.
dns_add_nameserver(): As reported by Surya Prakash Verma, call to
fopen() used nonexistent file open mode "at"; changed this to "r"
per Surya's analysis. See Surya's email to dev@ on 12 Mar 2020,
archived here: https://lists.apache.org/thread.html/rbbbee93f79dd8f4224969bb03bf093d8c96421380a1d955167a2f661%40%3Cdev.nuttx.apache.org%3E
2020-03-14 01:19:11 +01:00
Andrey Zabolotnyi
6697603162
inetaddr() more compliant with standards (especially error handling). (#524)
* inetaddr() more compliant with standards (especially error handling).

Co-authored-by: Андрей Заболотный <zapparello@ya.ru>
2020-03-10 08:17:17 -06:00
YAMAMOTO Takashi
b39ce514ea dlfcn, modlib: Appease nxstyle complaints 2020-03-10 01:53:49 -05:00
Gregory Nutt
199b4d6852 z20x: Changes to reduce serial Rx data overrun
boards/z80/ez80/z20x:  Increase RX buffer size to 4Kb, reduce BAUD to 2400 in w25boot configuration
arch/z80/src/ez80/ez80_serial.c:  Reduce Rx FIFO trigger level for eZ80F92 to 1 so that will respond more quickly to incoming data.
2020-03-09 22:51:54 +01:00
Gregory Nutt
82df8b3eba libs/libc/stdio: Names of files do not match content
Rename lib_rawinstream.c to lib_rawsistream.c and lib_rawsistream.c to lib_rawinstream.c so that the content of the files match the name of the files.  While we are at it, update the file license to Apache 2.0
2020-03-08 20:59:46 -05:00
Masayuki Ishikawa
c365e0a88f libs: risc-v: Fix typo in comment 2020-03-06 09:41:34 +01:00
Gregory Nutt
2eff5a6c63 z20X: Continued development of the W25 Bootloader.
Kconfig files.  Repartition some functionality.  Bootloader support will need to be provided in logic under arch/z80/src/ez80 so the critical configuration selections were moved the Kconfig file there.

arch/z80/src/ez80/ez80_i2c.h:  Rename arch/z80/src/ez80/ez80f91_i2c.h.  It is sharable by both ez80f91 and ez80f92.

arch/z80/src/ez80/:  Add logic to perform an additional level of interrupt redirection.  This is necessary because the the interrupt handling is part of the loader FLASH-based logic.  In order to share interrupts with the program loaded into RAM by the loader, another layer or redirection is required to get control to the interrupt handlers in the loaded program.  See ez809f2_loader.asm and ez80f92_program.asm

boards/z80/ez80/z20x/scripts:  Reduce size of the interrupt re-direction buffer from 1Kb to 512b.
2020-03-03 19:39:57 -03:00
macman88
43dfbdb348 Battery monitor support (#404)
* Adding support for BQ769x0 Battery Monitor IC (Work In Progress)
* Additional changes to support BQ769x0
* Store cell count and chip type when setting up
* Added shutdown, limits, charge/discharge switch, and clear faults operations
* Added support for current measurement; some cleanup
* Updated temperature reporting.  Fixed negative current reporting.
* When setting safety limits, update limit structure with actual values used.
* Added note on battery limit structure
* Updates to BQ769x0.  Re-ordered fault reporting, added fault cache, added ordered fault clearing
2020-02-28 18:18:50 -06:00
Gregory Nutt
d1a8a803e4 Build system: Get rid of the MOVEOBJ definition
Eliminate the MOVEOBJ definition from tools/Config.mk, Makefiles, and other locations.  The MOVEOBJ definition was used to work around the case where the object output of a compile or assemble is in a different directory than the source file.  The ZDS-II tools have no command line option to perform this move; MOVEOBJ handled the move as a post-compiler operation.

MOVEOBJ is no longer needed because this the ez80 COMPILE and ASSEMBLE definitions now handle all of the object file movement cases.
2020-02-24 22:37:28 +01:00
Xiang Xiao
bd4e8e19d3 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:45:07 -06:00
Ouss4
f8801e1bd8 libs/libc/unistd/lib_alarm.c,sched/timer/timer_getitimer.c: Silence a
warning with struct initialization.
2020-02-19 18:02:25 -06:00
Gregory Nutt
d202e2ef61 libs/libc/time/lib_gmtimer.c: Fix compile problem from PR317
PR317 removed definitions for SEC_PER_MIN, SEC_PER_HOUR, and SEC_PER_DAY because these were duplicates of definitions in include/nuttx/clock.h.  However, the PR did not include nuttx/clock.h so the removal of these definitions resulted in compilation failures.

Noted by Ouss4
2020-02-19 23:09:45 +01:00
Gregory Nutt
2ec59121fb Fix non C89 noncompliant code that was causing the ZDS-II compile to fail. 2020-02-19 23:09:10 +01:00
chao.an
4d6e275fc4 libs/libc/time/lib_gmtimer.c: Remove duplicate definition
time/lib_gmtimer.c:54: warning: "SEC_PER_MIN" redefined
   54 | #define SEC_PER_MIN  ((time_t)60)
      |
In file included from nuttx/include/nuttx/semaphore.h:48,
                 from nuttx/include/pthread.h:56,
                 from nuttx/include/signal.h:50,
                 from nuttx/include/sys/select.h:46,
                 from nuttx/include/sys/types.h:305,
                 from nuttx/include/time.h:46,
                 from time/lib_gmtimer.c:44:
nuttx/include/nuttx/clock.h:125: note: this is the location of the previous definition
  125 | #define SEC_PER_MIN                   60L
      |
time/lib_gmtimer.c:55: warning: "SEC_PER_HOUR" redefined
   55 | #define SEC_PER_HOUR ((time_t)60 * SEC_PER_MIN)
      |
In file included from nuttx/include/nuttx/semaphore.h:48,
                 from nuttx/include/pthread.h:56,
                 from nuttx/include/signal.h:50,
                 from nuttx/include/sys/select.h:46,
                 from nuttx/include/sys/types.h:305,
                 from nuttx/include/time.h:46,
                 from time/lib_gmtimer.c:44:
nuttx/include/nuttx/clock.h:138: note: this is the location of the previous definition
  138 | #define SEC_PER_HOUR           (SEC_PER_MIN  * MIN_PER_HOUR)
      |
time/lib_gmtimer.c:56: warning: "SEC_PER_DAY" redefined
   56 | #define SEC_PER_DAY  ((time_t)24 * SEC_PER_HOUR)
      |
In file included from nuttx/include/nuttx/semaphore.h:48,
                 from nuttx/include/pthread.h:56,
                 from nuttx/include/signal.h:50,
                 from nuttx/include/sys/select.h:46,
                 from nuttx/include/sys/types.h:305,
                 from nuttx/include/time.h:46,
                 from time/lib_gmtimer.c:44:
nuttx/include/nuttx/clock.h:141: note: this is the location of the previous definition
  141 | #define SEC_PER_DAY            (HOURS_PER_DAY * SEC_PER_HOUR)
      |
2020-02-19 12:51:08 -06:00
chao.an
b438d529f1 libs/libc/stdio/lib_getdelim.c: Correct the character slash 2020-02-19 12:47:25 -06:00
Xiang Xiao
e7d9260014 arch: Customize the typedef of size_t instead of intptr_t
To ensure size_t same as toolchain definition in the first place and rename CXX_NEWLONG to ARCH_SIZET_LONG.  The change also check whether __SIZE_TYPE__ exist before CONFIG_ARCH_SIZET_LONG so our definition can align with toolchain(gcc/clang) definition automatically.
2020-02-18 07:15:19 -06:00
Juha Niskanen
15b78abccf Fix typos in comments 2020-02-14 08:50:45 -06:00
YAMAMOTO Takashi
3df686e10f sim: berr() unknown relocation type 2020-02-14 14:40:15 +08:00