Commit Graph

1382 Commits

Author SHA1 Message Date
chao an
0f8ecc0150 libs/libc: export exit() if configured in flat mode
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-23 13:50:03 +08:00
Xiang Xiao
a05ab2ab49 libc: Remove dependence of LIBC_FLOATINGPOINT and LIBC_LONG_LONG from LIBC_NUMBERED_ARGS
since LIBC_NUMBERED_ARGS can work without both

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-22 16:37:48 +08:00
lilei19
e6e2017d3c fix a bug of strtof 2023-02-22 01:20:21 +08:00
Ville Juven
f8d3032732 libc/lib_assert.c: Remove the re-definition of abort()
This should now be irrelevant, as abort() is forwarded to _exit() instead.
2023-02-22 01:10:39 +08:00
Ville Juven
07039b8a36 lib_abort.c: Change call to userspace exit() into syscall _exit()
The POSIX standard dictates that during abnormal termination the functions
registered by atexit() are _not_ called, also flushing the streams is
optional. So in this case, it is perfectly legal / better to call the
kernel system call _exit() instead.

This fixes regression issues caused by removal exit() from the kernel.
2023-02-22 01:10:39 +08:00
chao an
5fac313df7 libs/libxx: Fix typo in shell expressions
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-22 01:05:46 +08:00
chao an
1d41182755 libs/libxx: check GCC version before set special flags
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-21 15:33:18 +08:00
chao an
e29d275ef8 libs/libcxx: Workaround -Wmaybe-uninitialized warning with "GCC 12.2"
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-20 19:26:55 +08:00
Xiang Xiao
fa3e0faffc fs: Map FD_SETSIZE to OPEN_MAX instead hardcoding 256
and change the default value of LIBC_OPEN_MAX to 256.
Here has more discussion:
https://www.mail-archive.com/dev@nuttx.apache.org/msg09095.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-19 19:17:20 +02:00
Ville Juven
e9ef70e24b sched/assert: Call abort() instead of exit() in assert
POSIX dictates that assert() terminates via abort(), even though in NuttX
abort() just calls exit(EXIT_FAILURE) it is better to use the correct
API here, if at some point a proper implementation for abort() is made.

Also, as the kernel must not use abort() which is a userspace API, direct
the exit to PANIC() if for some reason _assert() returns (it should not
but trap it here just in case).
2023-02-17 23:07:17 +08:00
Ville Juven
df1d7dd480 libc/exit: Purge calls to userspace API exit() from kernel
Remove calls to the userspace API exit() from the kernel. The problem
with doing such calls is that the exit functions are called with kernel
mode privileges which is a big security no-no.
2023-02-17 23:07:17 +08:00
Fotis Panagiotopoulos
85ceb7920e Typo fixes. 2023-02-17 11:17:11 -03:00
Takeyoshi Kikuchi
70ce4b4fc1 libc: unistd: lib_getrlimit: set cur/max value for RLIMIT_NOFILE to "OPEN_MAX".
Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
2023-02-17 18:07:30 +08:00
Takeyoshi Kikuchi
c4fc414b09 libc: unistd: lib_getrlimit: use INT_MAX as dummy rlim_max value.
Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
2023-02-17 18:07:30 +08:00
Takeyoshi Kikuchi
2e5a20612c libc: unistd: lib_getrlimit: return a value for RLIMIT_NOFILE request.
In the Nim language "selectors"(I/O multiplexing) module, the maximum
number of file descriptors is obtained with getrlimit() as follows.

        var fdLim: RLimit
        var res = int(getrlimit(RLIMIT_NOFILE, fdLim))
        if res >= 0:
          res = int(fdLim.rlim_cur) - 1

To be able to use the same implementation as other POSIX-based OS,
getrlimit() should return a value.
(For now, let it return 128.)

Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
2023-02-17 18:07:30 +08:00
crafcat7
33b22f51da libc/lib_memcpy.c: Add mempcpy method.
Signed-off-by: crafcat7 <chenrun1@xiaomi.com>
2023-02-17 15:15:19 +08:00
Nathan Hartman
409e2f3701 drivers/serial, libc/termios: Implement tcsendbreak
The TERMIOS(3) function tcsendbreak() and the IOCTLs TCSBRK and TCSBRKP
transmit a serial line Break.

Previously NuttX included an extern declaration for tcsendbreak() and
defines for TCSBRK and TCSBRKP but none of these were implemented.
Attempting to build programs that called tcsendbreak() would fail with
a linker error; attempting to use TCSBRK and TCSBRKP would result in an
error at runtime.

This changeset adds the tcsendbreak() function and handling for TCSBRK
and TCSBRKP; tcsendbreak() is implemented in terms of TCSBRK. Both
TCSBRK and TCSBRKP are implemented in terms of the BSD-compatible Break
IOCTLs TIOCSBRK and TIOCCBRK, which must be provided by the lower half
serial driver. Currently, not all lower half serial drivers in NuttX
support these IOCTLs. Those that do implement them may need one or more
Kconfig options to be set, such as `CONFIG_*_U[S]ART_BREAKS` and, on
some architectures, a separate `CONFIG_*_SERIALBRK_BSDCOMPAT`.

* drivers/serial/serial.c
  (uart_tcsendbreak): New function.
  (uart_ioctl): Implement TCSBRK and TCSBRKP.

* libs/libc/termios/lib_tcsendbreak.c
  (): New file.

* libs/libc/termios/Make.defs
  (CSRCS): Add lib_tcsendbreak.c to the build.

Thanks to Xiang Xiao for PR feedback.

Co-authored-by: Xiang Xiao <xiaoxiang781216@gmail.com>
2023-02-15 07:50:02 +08:00
Xiang Xiao
dc2e9b8771 libc: Move memfd related stuff to sys/mman.h
follow the freebsd definition:
https://github.com/freebsd/freebsd-src/blob/master/sys/sys/mman.h#L207-L228

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-13 16:00:37 +01:00
Huang Qi
a66f0a6369 stdlib: Guard fflush in exit with CONFIG_FILE_STREAM
If CONFIG_FILE_STREAM disabled, fflush is a undefined function.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-02-12 00:09:29 +08:00
lilei19
23344846f6 fix some bug of strtold
with the test of sim:lua ,I have fixed some bug of error output
  1.input: "  " and error output string is "NULL"
  2.input: "1.2e+", error output string is "NULL"
  3.input: "."      error output string is "NULL"
2023-02-10 22:45:24 +08:00
chao an
634baa5a2f libs: workaround for Visual Studio(MSVC) Compiler Error C2124
D:\archer\code\nuttx\libs\libc\stdlib\lib_strtod.c: error C2124: divide or mod by zero

Windows MSVC restrictions, MSVC doesn't allow division through a
zero literal, but allows it through const variable set to zero

Reference:
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2124?view=msvc-170

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-09 20:11:55 +08:00
chao an
8761cc9bfc libs: fix visual studio Compiler Error C2036
D:\code\nuttx\libs\libc\net\lib_inetpton.c(300,52): error C2036: "void *" : unknown size

Reference:
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2036?view=msvc-170

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-09 20:11:55 +08:00
chao an
e942a7c55e build/Kconfig: fix warnings detected by kconfiglib
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-09 20:07:46 +08:00
chao an
3a0fdb019d nuttx: replace all ARRAY_SIZE()/ARRAYSIZE() to nitems()
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-09 20:05:44 +08:00
dongjiuzhu1
14f8a6c2dd fs: support openat/fchmodat/mkfifoat/fstatat/...at api
Refs to:
https://linux.die.net/man/2/openat

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-02-07 03:45:38 +08:00
lilei19
de21025702 fix a bug of strtold
if input is -1e308,The output should be -100000000......
  but the output is -inf
2023-02-06 20:26:45 +08:00
chao an
02a9e76f73 misc/mutex: fix assertion if nxmutex_reset() before nxmutex_unlock()
sim/rpserver

NuttShell (NSH) NuttX-12.0.0
server> cu
_assert: Current Version: NuttX server 12.0.0 3ead669e7a-dirty Feb  2 2023 23:53:48 sim
_assert: Assertion failed : at file: libs/libc/misc/lib_mutex.c:303 task: cu 0x5662fff4

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-04 02:13:15 +08:00
chao an
7625126c91 Remove the remain MIN/MAX like macro
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-03 23:22:41 +08:00
yinshengkai
35ae47788b libc: Keep printf("%pS", p) behavior consistent
When ALLSYMS is not turned on, %pS will be treated as %p

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-02-03 09:19:06 +02:00
chao an
4c8d244fae sched/getpid: replace syscall getpid/tid/ppid() to kernel version
NuttX kernel should not use the syscall functions, especially after
enabling CONFIG_SCHED_INSTRUMENTATION_SYSCALL, all system functions
will be traced to backend, which will impact system performance.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 10:33:01 +08:00
chao an
c9981036a5 nuttx/mutex: move mutex implement to libc
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 10:33:01 +08:00
Gustavo Henrique Nihei
e6b204f438 nuttx: Use MIN/MAX definitions from "sys/param.h"
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-02-01 23:47:44 +08:00
Huang Qi
4caf24a00c libc/stdio: Minor comments fix
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-02-01 21:47:30 +08:00
yinshengkai
ab2b09e557 Revert "Makefile: fix redundant delimiters when using make V=1"
This reverts commit 64d39a8b7b.
2023-02-01 20:39:52 +08:00
Nathan Hartman
c65a632788 libc/termios: Fix comment in cfmakeraw docstring. 2023-02-01 09:47:55 +08:00
yinshengkai
64d39a8b7b Makefile: fix redundant delimiters when using make V=1
rm-none-eabi-ar rcs  libc.a    bin//lib_assert.o  bin//lib_builtin_getname.o
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-31 15:12:36 -03:00
Zhe Weng
8819eeaf15 net: Implement shutdown() interface and tcp shutdown
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-01-31 11:15:01 +08:00
lilei19
1d8af7e105 add holder for mutex
Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-01-31 12:08:05 +09:00
Nathan Hartman
6b89b6f945 Remove executable permissions from source files
* arch/arm/src/sama5/sam_flexcom_spi.h,
  arch/risc-v/src/mpfs/mpfs_ihc_sbi.c,
  drivers/usbdev/adb.c,
  libs/libc/math/lib_scalbn.c,
  libs/libc/math/lib_scalbnf.c,
  net/ipfrag/Make.defs,
  net/ipfrag/ipfrag.c,
  net/ipfrag/ipfrag.h,
  net/ipfrag/ipv4_frag.c,
  net/ipfrag/ipv6_frag.c: Remove executable permission.
2023-01-30 20:34:51 -03:00
wangxuedong
ba016eb5eb libc/stdio: fix rounding errors for fractional values less than 1
Signed-off-by: wangxuedong <wangxuedong@xiaomi.com>
2023-01-30 23:39:56 +08:00
chao an
fa63da22ae libs/netdb: add sanity check to avoid null pointer reference
Signed-off-by: chao an <anchao@xiaomi.com>
2023-01-30 23:37:29 +08:00
yinshengkai
2466c07aa3 libc/stream: fix syslogstream_addstring length error
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-30 14:27:04 +01:00
Xiang Xiao
631a8da1e2 sched: Map SCHED_OTHER to SCHED_FIFO or SCHED_RR
this behaviour is explicitly specified here:
https://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_08.html
and map SCHED_NORMAL to SCHED_OTHER like Linux:
https://man7.org/linux/man-pages/man7/sched.7.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-30 03:01:03 +02:00
zhanghongyu
4de0e626d0 Revert "netdb: fix access within misaligned address error"
This reverts commit 3f94828f6b.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-01-29 14:35:01 +08:00
liangchaozhong
d8777fa77d invalid dns cache entry after ttl expires
Log ttl after receive dns query and invalid dns cache entry when ttl expires.

Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2023-01-29 14:32:33 +08:00
anjiahao
fcdc7afcb5 libc:lib_psfa_dddup2,add return check
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-01-28 23:23:47 +02:00
ligd
367fa640c1 asctime_r: add param check to asctime_r() 2023-01-28 23:23:12 +02:00
Xiang Xiao
7d66a16c53 Minor style clean up
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-28 19:53:20 +02:00
anjiahao
287467b81b netdb: Add return check in rexec_af
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-01-27 15:31:28 -03:00
Xiang Xiao
819fbd22cc sched: Implement tkill/tgkill
https://linux.die.net/man/2/tgkill

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-26 08:11:56 +02:00
Petro Karashchenko
f952b8456c assert: switch from ASSERT(0/false) to PANIC
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-01-26 10:15:34 +08:00
Xiang Xiao
c05cdd6598 libc: Move on_exit and __cxa_atexit in lib_atexit.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-25 14:31:37 +02:00
Xiang Xiao
5333c30d45 libc: abort should always call exit not pthread_exit
since pthread_exit just exit the calling thread not the whole process

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-25 14:31:37 +02:00
Xiang Xiao
bcd1ebf260 libc: Implement quick_exit and at_quick_exit
Defined by c11:
https://en.cppreference.com/w/c/program/quick_exit
https://en.cppreference.com/w/c/program/at_quick_exit

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-25 14:31:37 +02:00
Xiang Xiao
43e7b13697 assert: Log the assertion expression in case of fail
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-24 15:00:19 -03:00
Xiang Xiao
8bf693b362 libc/pthread: Implement pthread_condattr_[set|get]pshared
https://pubs.opengroup.org/onlinepubs/009696799/functions/pthread_condattr_getpshared.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-24 13:53:02 -03:00
Xiang Xiao
c11cd7f103 libc/pthread: Implement pthread_attr_[set|get]stackaddr
https://pubs.opengroup.org/onlinepubs/009696799/functions/pthread_attr_getstackaddr.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-24 13:53:02 -03:00
Xiang Xiao
36b74bab02 libc/pthread: Implement pthread_rwlockattr API
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlockattr_getpshared.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-24 13:53:02 -03:00
Xiang Xiao
82550887c2 c++: Change the default value of CXX_STANDARD from c++17 to gnu++17
since many 3rd party code use some gnu c++ extension

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-19 08:21:48 +01:00
Masayuki Ishikawa
dc454765fb Revert "add holder for mutex"
This reverts commit fc176addeb.
2023-01-19 06:04:48 +09:00
lilei19
fc176addeb add holder for mutex
Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-01-18 17:40:58 +08:00
zhangyuan21
acd108a5ed pthread: fixed pthread_cancel and pthread_exit crash in SMP mode
1. When pthread exit, set the default cancellability state to NONCANCELABLE state.
2. Make sure modify tcb->flags is atomic operations.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-01-18 11:57:40 +08:00
Xiang Xiao
f64da13e9b libxx: Add CXX_STANDARD to select -std=c++??
and default to "c++17"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-16 15:41:57 +02:00
lilei19
04f15d9dc1 fix the bug of strtold 2023-01-15 19:57:56 +08:00
Xiang Xiao
ee9787a254 libc: Let _SC_PAGESIZE return 4096 when CONFIG_MM_PGSIZE isn't defined
since most application doesn't expect the page size equals one

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-15 08:39:19 +02:00
dongjiuzhu1
28027d0bee libc/versionsort: support versionsort and strverscmp
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-01-15 11:24:40 +08:00
lilei19
1f95cfdde8 fix the some else bug of strtold
I accidentally changed it when I was optimizing the code

Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-01-13 15:11:20 +02:00
Xiang Xiao
695f42f8d2 net: Move accept to libc after https://github.com/apache/nuttx/pull/8083
since accept can simply forward to kernel accept4 function

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-13 11:23:42 +02:00
lilei19
120594079a add function for strtof 2023-01-12 23:46:23 +08:00
zhanghongyu
4de3387eb2 getaddrinfo: add AI_NUMERICHOST flag handle
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-01-12 01:40:11 +08:00
Xuxingliang
431e31b6b2 libc/math: add simple implementation for sincos API
Signed-off-by: Xuxingliang <xuxingliang@xiaomi.com>
2023-01-12 00:07:44 +08:00
Xiang Xiao
ef65d443ad sem: Remove PRIOINHERIT_FLAGS_ENABLE and use SEM_PRIO_INHERIT instead
and refine the code to prepare the support of new flags

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-11 17:35:28 +02:00
zhangyuan21
e34f79aa28 libc: don't redefined __ARM_ARCH_XXX when __ARM_ARCH defined
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-01-10 14:58:35 +02:00
zhangyuan21
fae5aef4fe libc: add arm64 libc function
Porting memory and string optimize functions from newlib and bionic

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-01-10 11:31:26 +08:00
zhangyuan21
f8f29c8147 libc: add risc-v libc function
Porting memory and string optimize functions from newlib and bionic

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-01-10 11:31:26 +08:00
zhangyuan21
fc9aeb8c70 libc: add armv7-r libc function
Porting memory and string optimize functions from newlib and bionic

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-01-10 11:31:26 +08:00
zhangyuan21
650f17169a libc: add armv7-a armv7-m armv8-m libc function
Porting memory and string optimize functions from newlib and bionic

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-01-10 11:31:26 +08:00
zhanghongyu
e019b0d0b8 libc/net: add inet_network function
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-01-06 22:20:19 +08:00
yinshengkai
05f8c588fd libc/syslog: improve streamsyslog, add puts funtions
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-05 02:00:43 +08:00
Jiuzhu Dong
c623ee20f1 stdlib: generate uniformly distributed pseudo-random numbers
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-01-04 20:53:05 +08:00
yinshengkai
275b2e70a4 syslog: fix extra line breaks in syslog when SYSLOG_COLOR_OUTPUT is enabled
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-02 21:22:46 +08:00
dongjiuzhu1
5826e8eeb1 libc/passwd: add pw_gecos field(userinfo)
The pw_gecos field is not specified in POSIX, but is
present on most implementations.
passwd file format:
name:uid:gid:gecos:dir:shell
ex: gdm127:133:Gnome Display Manager:/var/lib/gdm3:/bin/false

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-12-30 00:21:15 +08:00
dongjiuzhu1
8f05661a53 syslog: A trailing newline is added if none is present.
refs:
https://www.manpagez.com/man/3/syslog/

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-12-30 00:20:33 +08:00
YAMAMOTO Takashi
bf7db14feb Suppress -Wsign-compare warning on a few places 2022-12-26 18:23:41 +08:00
Ville Juven
172b209f2d sched/assert: Re-implement assert() into user space
_assert is a kernel procedure, entered via system call to make the core
dump in privileged mode.

Running exit() from this context is not OK as it runs the registered
exit functions and flushes streams, which must not be done
from privileged mode as it is a security hole.

Thus, implement assert() into user space (again) and remove the exit()
call from the kernel procedure.
2022-12-22 21:07:47 +08:00
Ville Juven
3be81e649f libc/stdio: Flush streams in userspace when process exits
This fixes a long standing issue, where the kernel does flushing of file
streams, although it should not handle such streams at all.
2022-12-22 20:16:11 +08:00
Ville Juven
2ed51d026c fs/streams: Move the file streams from the group structure into TLS
This is preparation for flushing streams from user space, like it should
be done.

- Move tg_streamlist (group, kernel space) ->
       ta_streamlist (TLS, user space)
- Access stream list via tg_info in kernel
- Access stream list via TLS in user space
- Remove / rename nxsched_get_streams -> lib_getstreams
- Remove system call for nxsched_get_streams
2022-12-22 20:16:11 +08:00
flyingfish89
035656661e 1 2022-12-22 11:52:00 +08:00
Petro Karashchenko
7f564e0d86 nuttx: add some missing FAR
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-12-21 10:56:45 +08:00
Petro Karashchenko
b107e4f417 nuttx: unify MIN, MAX and ABS macro definition across the code
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-12-21 09:31:28 +08:00
Xiang Xiao
fd0d6a9bf5 compiler.h: Add _ between format|printf|syslog|scanf|strftime and like
align with other macro naming style

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-21 01:05:19 +02:00
chao an
01eb4d586b mm/iob: iob members are initialized after allocate
Signed-off-by: chao an <anchao@xiaomi.com>
2022-12-16 09:51:53 +08:00
chao an
0c21bc4e53 netdb/dns: add support of send timeout
Signed-off-by: chao an <anchao@xiaomi.com>
2022-12-16 09:51:15 +08:00
Lee Lup Yuen
b895207489 arm64/a64: Add driver for MIPI DSI
This PR adds the driver for Allwinner A64's MIPI Display Serial Interface (DSI) and MIPI Display Physical Layer (D-PHY).

This driver will be used by the upcoming Display Driver for PINE64 PinePhone.

- `include/nuttx/crc16.h`: Added 16-bit CRC-CCITT

- `libs/libc/misc/Make.defs`: Added 16-bit CRC-CCITT to Makefile

- `arch/arm64/src/a64/Kconfig`: Added the Kconfig option for "A64 Peripheral Selection > MIPI DSI" (`CONFIG_A64_MIPI_DSI`), which enables the MIPI DSI Driver

- `arch/arm64/src/a64/hardware/a64_memorymap.h`: Added the Base Address for MIPI DSI

- `arch/arm64/src/a64/Make.defs`: Added the MIPI DSI Driver to the Makefile

- `libs/libc/misc/lib_crc16ccitt.c`: Compute 16-bit CRC-CCITT

- `arch/arm64/src/a64/mipi_dsi.c`, `mipi_dsi.h`: Compose MIPI DSI Packets (Long, Short, Short with Parameter)

- `arch/arm64/src/a64/a64_mipi_dsi.c`, `a64_mipi_dsi.h`: MIPI DSI Driver for Allwinner A64

- `arch/arm64/src/a64/a64_mipi_dphy.c`, `a64_mipi_dphy.h`: MIPI D-PHY Driver for Allwinner A64

- `platforms/arm/a64/boards/pinephone/index.rst`: Added MIPI DSI as supported peripheral for PinePhone

Co-Authored-By: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-12-14 22:37:32 +08:00
Xu Xingliang
252c6a1844 libc/netdb: add proto.c
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2022-12-10 02:36:24 +08:00
田昕
2719869ab2 Move _assert to kernel space.
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-12-06 18:33:21 +08:00
Xiang Xiao
055f1f33eb libc/stream: Rename [lib_stream_](put|get) to [lib_stream_](putc|getc)
to make the naming style consistent with each other

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 14:27:55 +01:00
Xiang Xiao
4be9ec774b Don't download tarballs if a local git repo found
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:47:36 +01:00
chao an
d12ddf56df arm/arm: sync ARM_THUMB support from cortex-a
Signed-off-by: chao an <anchao@xiaomi.com>
2022-12-05 01:09:31 +08:00
chao an
4b70e4ff77 arm/cortex-r: sync ARM_THUMB support from cortex-a
Signed-off-by: chao an <anchao@xiaomi.com>
2022-12-04 20:12:31 +08:00