Commit Graph

39620 Commits

Author SHA1 Message Date
Xiang Xiao 0ec76c44ca sched/signal: Implement SA_NODEFER and SA_RESETHAND
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I9baa72b272c8877022cd94722824f393c7087721
2021-03-29 12:35:58 +08:00
Xiang Xiao fabe4d1d10 sys/stat.h: Add S_IREAD, S_IWRITE and S_IEXEC macro
to be more compatible with BSD libc

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I4067f8cac6c465a3f1b06906e2e274a660792d93
2021-03-29 12:35:58 +08:00
Xiang Xiao a6d4a69e1f serial: Don't comment out ws_[x|y]pixel field from winsize struct
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3d2435c3950e8f60b50d9af8a54c65bd0d16f2e0
2021-03-29 12:35:58 +08:00
Xiang Xiao 8087067199 arm/machine: Sync with the latest newlib(1debd4d635c291c6da90)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic616d616d9fa62b6dc19233258ab3099a402bad0
2021-03-29 12:35:58 +08:00
chao.an 4a26e4a592 net/local: correct the send return length
Change-Id: I8446c44f9cbcbf11bac4fcc9defbdfc4d09bba98
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-27 12:33:47 +08:00
chao.an dc02221828 libc/string: Use Byte-Shift algorithm for very long needles
Reference here:
https://github.com/taleinat/byteshift_strstr

Change-Id: I1ef0676e01bea75e40ac688dcd50ef8b37c9a7e6
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-26 23:39:23 +08:00
YAMAMOTO Takashi 31819fba12 netdb.h: Add NI_MAXHOST and NI_MAXSERV
* These are not parts of the standards as far as I know.
* These are provided by many platforms. (GLIBC, BSD, Windows, etc)
* These are convenient.
2021-03-26 22:01:13 +08:00
Huang Qi 44ec147ff7 libc/machine: introduce optimized memchr/memcpy/memmove/strcmp/strlen
from newlib/bionic for armv7-a

N/A

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: I079d929020c353f73033a7e2189f34430e2b9c09
2021-03-26 17:21:17 +08:00
Huang Qi aedf823224 arch/arm: Use macro defined swi range in dispatch_syscall
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: Ia8503a13c5b04fa8cc13cee74b75b19623986c1d
2021-03-25 11:21:31 +08:00
chao.an c1b15fd800 boards/rcS: remove the dual-stack delay
Change-Id: Iae418065e582e906a9d57c0ef2da55dcfafb432b
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-24 22:19:26 +08:00
chao.an 823d2c6243 wireless/bluetooth: add pending command filter
Change-Id: I4243ffce4299154452cf232fa4d98b568ff86234
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-24 18:31:46 +08:00
chao.an 49dda1dd8f wireless/bluetooth: break the pending read if circbuf is available
Change-Id: Ie3496c9f46bd1890dcbab157d5bbc1d2ce2b4da1
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-24 18:29:25 +08:00
Peter Bee fe447997dd boards/sim: kvdbd no autostart when remote server
N/A
Works with kvdb remote server version

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
Change-Id: Ib79de8c1c1eda757efe533b4fecdce90b1c61f50
2021-03-24 11:49:15 +08:00
Peter Bee a84c81f4d5 net/rpmsg: add multi-iov support
N/A

Add multi-iov support for rpmsg sockets

Change-Id: I188e41972be2942799fd06d4b530e292125fbf33
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2021-03-24 10:55:17 +08:00
chao.an 2dbe215f4c net/tcp: support bind the same port with different domain
Reference here:
https://man7.org/linux/man-pages/man7/ipv6.7.html

IPV6_V6ONLY slice

Change-Id: Ia7f12a5a676536ba8d347278d30d45e33c6838f5
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-24 00:10:58 +08:00
liuhaitao df8d2fcb04 libc: correct zoneinfo genromfs source directory
Or genromfs failed to generate the right romfs.img

Change-Id: Icbcc2e89da1ede644b994d33e70f1a48662c412b
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2021-03-23 20:48:00 +08:00
ligd cfa3a9f634 sched/init/nx_start.c: enter_critical_section when check heap & stack in idle
Change-Id: I2ef95ee8e1dc1ba3e74c1d6c8c6af20f53be85c7
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-03-23 20:21:01 +08:00
liuhaitao 563c2c15cf libc: update stream getoffset to handle write case
MIRTOS-242

Change-Id: I80b01b446446d5a631d40822f220a0177a95e7e6
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2021-03-22 22:56:15 +08:00
Jiuzhu Dong 293c7e6b6f sched/dupfile: ignore dup failed when task_create
MIRTOS-517

Change-Id: I2387ab447f0d8ed9429960922a72de35b2730acb
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-03-22 20:56:12 +08:00
Xiang Xiao 152db4f0bf fs/littlefs: Suppport the duplication function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I64191bdeab3723b22476d27c44852493eed1b07e
2021-03-22 17:43:21 +08:00
Jiuzhu Dong 35229a917b rtc/rpmsg: support server and client to set time each other
N/A

Change-Id: I5d13f424cb636a79a9fd98c275786771c213ddb8
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-22 12:16:58 +08:00
chao.an e8ce4f7f20 sim/remoteproc: boot the usrsock at startup
Change-Id: I918eb2256f53d45a8e9b495db2478b70a6b81b97
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-20 00:25:04 +08:00
chao.an 6fe0941119 net/tcp: correct the port byte order
Change-Id: Ic68e9ff1ddd8b0f00c0a431bf108669edb8aa4fd
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-20 00:25:01 +08:00
chao.an f78bc74d6c net/usrsock: add send multi-elements support
Change-Id: I514cbc98b611f9eb6c76a00c527675cf44bef14a
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-20 00:25:01 +08:00
Huang Qi 828baa181e arch/sim: Fix warning of duplicated object
N/A

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: I91cf182a396fc8f8024faf65c1cc7bf45cf34bbc
2021-03-19 17:42:11 +08:00
chao.an a561e15406 usrsock/recv: adjust the close timing to avoid data discard
Change-Id: I7bf1cf06c3b73dc32ff38388926b7ffb979b832d
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-19 14:53:07 +08:00
zhouliang3 4735c430f0 nuttx/wamr: WAMR configuration based on NSH added
N/A

Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
Change-Id: Id17d3ae72142d83bb8c1f7a0186c66d4e66b52cf
2021-03-19 12:44:29 +08:00
chao.an 2919001e3e net/tcp: do not start the tcp monitor if unestablished
Change-Id: Iace9ccfc73086db442db04b95bc508dd48827b82
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-19 11:11:40 +08:00
chao.an 08c6d63e9a usrsock/recv: adjust the close timing to avoid data discard
Change-Id: I9dd97c8995201f7a4ca7f6198120ab2bd89d7ed9
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-19 11:11:40 +08:00
Jiuzhu Dong e364beaf87 fs/mmap: return EBADF when file descriptors is invalid
MIRTOS-504

Change-Id: I06276be2bbc67e4d6dd04bfd6b5a205bdf639d99
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-18 22:26:46 +08:00
Xiang Xiao 9d17731a81 arch/arm: Fix syscall number out of swi range in thumb mode
The immediate number is 8bits in thumb mode:
+---------------------+---------------+
|15 14 13 12 11 10 9 8|7 6 5 4 3 2 1 0|
+---------------------+---------------+
| 1  1  0  1  1  1 1 1|      imm8     |
+---------------------+---------------+

The immediate number is 24bits in arm mode:
+-----------+-------------------------------------------------------------------------+
|31 30 29 28|27 26 25 24|23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0|
+-----------+-----------+-------------------------------------------------------------+
|   cond    | 1  1  1  1|                                imm24                        |
+-----------+-----------+-------------------------------------------------------------+

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I62503cdc377fcee81864e88e981d389bce2e1b45
2021-03-18 18:03:01 +08:00
mage1 138b71fb45 LTP: fix stacke overflow bug in case ltp_interfaces_pthread_attr_setstacksize_1_1
MIRTOS-497
set PTHREAD_STACK_MIN to DEFAULT_TASK_STACKSIZE under sim platform.

Change-Id: I376f5b2bd5a2f205947f3c19b2a881db6a1c1522
2021-03-18 15:20:44 +08:00
Jiuzhu Dong ccc6ddbafb limits.h: modify _POSIX_OPEN_MAX to 255
N/A

fix ltp/ltp/testcases/open_posix_testsuite/conformance/interfaces/mq_open/speculative/26-1.c:46:8: error: size of array 'queue' is negative
  mqd_t queue[_POSIX_OPEN_MAX + _POSIX_MQ_OPEN_MAX + 1];

Change-Id: I1185ea9f84752aaa0150689b5801d01c3f52c598
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-17 22:33:05 +08:00
Jiuzhu Dong 7a6a1c1f42 fs: allocate file/socket dynamically
MIRTOS-273

Change-Id: I8aea63eaf0275f47f21fc8d5482b51ffecd5c906
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-17 21:15:26 +08:00
Jiuzhu Dong d07669e2ed fs: delete NFILE_DESCRIPTORS for allocating dynamically
N/A

Change-Id: Id06d215063796d222b9792d25ab2d6742167729f
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-17 21:15:04 +08:00
mage1 c3304df1bc sim: fix sim runtime err under sanitize check mode.
since gcc sanitize can not stub proper code in nuttx kernel code.

Change-Id: Ibceab92011087bd1b0b2b5a64f1f97a049ac213f
2021-03-17 16:23:28 +08:00
ligd 1052b2a048 rpmsg_socket: fix rpmsg_socket_device_destroy() multi-access
Reason:
When user call rpmsg_socket_close() at the same time
rpmsg_socket_ns_unbind() is called by remote CPU,
then will meet multi-access to rpmsg_socket_device_destroy()

Fix:
reuse recvlock to handle this

Change-Id: I8f33658f19c56a4000382ff9355ff052c45afea0
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-03-17 14:44:33 +08:00
ligd d24728997f libs/libc/spawn: fix posix_spawn_file_actions_adddup2 alloc size error
Change-Id: I9f6f2c87b0d54c1c1a71056073a1d358b87dd1fd
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-03-16 20:45:56 +08:00
ligd 90a75dfedf mm/tlsf: fix mm_checkcorruption failed, caused by mm_takesemaphore() param error
Change-Id: Id3fc81754f623c53151ba2ae02c0271008d5f3e3
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-03-16 20:45:56 +08:00
mage1 f5805d25c0 sim: fix signal deliver calling error on sim platform
since the signal deliver handler should be called in signal owner task.

Change-Id: Ic55c08d1a880069864eddda8dab945ce677792d7
2021-03-16 18:53:18 +08:00
ligd 1da573d2b0 boards/romfs: fix romfs folder size increase when append-compile rcS
Change-Id: I29b2a745d61147da6dfa9dfc08ddc81aabecf507
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-03-16 18:16:35 +08:00
Jiuzhu Dong e966c30cb7 rpserver/rpproxy: support set/get rtc time by rpmsg
N/A

Change-Id: Ib223fd85f7862241bc3c2dd897b3364d7b0fede3
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-16 15:16:16 +08:00
Jiuzhu Dong 07a69b728c rpmsg/rtc: add server to response client request about getting time
N/A

Change-Id: I1380adcb8a4f489353666b98f7143fe171d7d798
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-16 15:16:12 +08:00
ligd 93604983eb bluetooth: fix ascan report error
wireless/bluetooth/bt_uart_filter.c:238:26: runtime error: left shift of negative value -3

Change-Id: Ibd34af7e37b4b16a6168d67460573fc47df35935
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-03-15 21:27:18 +08:00
ligd d82e263654 select: fix asan report error
vfs/fs_select.c:116:25: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
vfs/fs_select.c:153:22: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Change-Id: I2e32bb8a3db8ff5a5955b83b382ac2fa5756122c
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-03-15 21:27:12 +08:00
ligd 25f61c731d crypto: fix asan report error
random_pool.c:466:14: runtime error: left shift of 305919453 by 17 places cannot be represented in type 'long int'
random_pool.c:178:11: runtime error: shift exponent 32 is too large for 32-bit type 'unsigned int'

Change-Id: I714f42b68f4af43249946aed8537cd848e569194
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-03-15 21:26:09 +08:00
mage1 2053e3a596 mm: add heap policy and anta logic to support mm debug on sim platform
since atan tool will enhance memory debug operation.

Change-Id: Ic953755faff156832e84b6a764452751dc14f0e3
2021-03-12 23:30:59 +08:00
ligd b8acb6f4c3 boards/sim/rcS: hostfs mount to server if CONFIG_FS_HOSTFS_RPMSG=y
Change-Id: I90758f4e4fcf6ae4f802da80e4b17a287e74c7c0
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-03-12 22:39:43 +08:00
chao.an 001f549e2c net/if: remove the macro expansion of the public structure
This is a compatibility issue if different structures included
in the usrsock server/client scene, usrsock client has no habit
of actively choosing of config CONFIG_NETDEV_IFINDEX at most of the time

Change-Id: Ib18b0ee12c76de759f6e8a54375c3adcdc31353a
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-12 18:19:30 +08:00
zhouliang3 e5281760f5 nuttx/wamr: Add the most basic configuration of WAMR to the sim
N/A

Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
Change-Id: I4ff67816eaa6e15232d1b375c86e2b7559c789aa
2021-03-12 16:56:26 +08:00