Xiang Xiao
6ab3dd1e7c
fs: Move the default ioctl handle from nx_vioctl to file_vioctl
...
ensure the behaviour is same in all ioctl function variant
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: Ie67cfbc579004c8488ef5004c9be7fb179e77041
2021-07-08 17:29:12 +08:00
Jiuzhu Dong
2d9b18a8ea
smp: fix pid assign issue
...
example:lack pid:4 when CONFIG_SMP_NCPUS=4
nsh> ps
PID PPID CPU PRI POLICY TYPE NPX STATE EVENT SIGMASK STACK COMMAND
0 0 0 0 FIFO Kthread N-- Assigned 00000000 000944 CPU0 IDLE
1 0 1 0 FIFO Kthread N-- Running 00000000 000000 CPU1 IDLE
2 0 2 0 FIFO Kthread N-- Running 00000000 000000 CPU2 IDLE
3 0 3 0 FIFO Kthread N-- Running 00000000 000000 CPU3 IDLE
5 0 0 100 FIFO Task --- Running 00000000 065504 init
Change-Id: I30a7e50c418332ec89edfd42473d9bebb2b02bbc
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com >
2021-07-08 15:16:35 +08:00
Jiuzhu Dong
1ecbc99b21
sim/smp: fix smp can't start, caused by signal too busy
...
N/A
Change-Id: Ia9cad04759a869f9bed871fa0acd002115eefb0a
Signed-off-by: ligd <liguiding1@xiaomi.com >
2021-07-08 15:16:35 +08:00
Jiuzhu Dong
4c867f3b6d
syslog: optimize init logic for early buffer initialize
...
N/A
Change-Id: I3295803977fa51e8ed8dedf7f0966b9604f8204d
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com >
2021-07-08 14:16:21 +08:00
Jiuzhu Dong
e63fe68980
ramlog: init head and tail when buffer is empty on boot
...
N/A
Change-Id: I6963ef6256c3a93ac7a63115c303033ceafa321f
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com >
2021-07-08 14:05:13 +08:00
Jiuzhu Dong
c5e6c0a99f
Revert "fix(ramlog): fix initial ramlog buffer pointer overflow"
...
This reverts commit 76242c5ee1 .
2021-07-08 11:43:23 +08:00
Xiang Xiao
0fe1c85ba4
mm: Remove mm_heap_impl_s struct
...
it's more simple to make mm_heap_s opaque outside of mm
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: I5c8e435f6baba6d22b10c5f7e8d9191104fb5af2
2021-07-07 02:14:53 -07:00
chenwei23
76242c5ee1
fix(ramlog): fix initial ramlog buffer pointer overflow
...
description: modify function ramlog_initbuf in
drvers/syslog/ramlog.c to fix initial ramlog buffer
pointer overflow
Signed-off-by: chenwei23 <chenwei23@xiaomi.com >
Change-Id: I38e2d5c726e3af11c4b47245197fec5cbe4af1f6
2021-07-07 14:33:19 +08:00
Xiang Xiao
bf83a3253f
fs/procfs: layout the output of meminfo correctly
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: Ic30e70772e19a43e2ad3b298e3ba1ac77f2f2219
2021-07-06 23:25:39 +08:00
ligd
560a86ff57
sim: fix loop add delaylist when mm_free in IDLE thread
...
Change-Id: I1827c663275f47c9dc30d63e17e3d016b0000166
Signed-off-by: ligd <liguiding1@xiaomi.com >
2021-07-06 11:16:05 +08:00
zhouliang3
07b2bd769e
Increase the function of crc8 to use custom polynomials
...
N/A
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com >
Change-Id: I3c53bf25541c1811a05d025b39dfe24cb0613b72
2021-07-06 09:20:56 +08:00
chao.an
55c032d061
net/socketpair: move socketpair implement into socket internal
...
Change-Id: Ibf84671a1d59122ee5a3c5161048ea4f00356b1c
Signed-off-by: chao.an <anchao@xiaomi.com >
2021-07-05 12:13:40 +08:00
xiatian6
cf9baa0178
feature(nuttx sensor driver): add ak09919c mag sensor dirver.
...
Add ak09919c mag sensor dirver.
Change-Id: Ie90149689a50dc4f68aa1802d00bb818092ed795
Signed-off-by: xiatian6 <xiatian6@xiaomi.com >
2021-07-05 09:22:04 +08:00
Xiang Xiao
8cea82708a
mm/tlsf: don't do mm_checkcorruption in IRQ
...
because this not safe in SMP mode, port from:
commit 34f63bdc13
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: I288f373e10aa4a68034fc9d9a0f87a0dc3f36cd5
2021-07-04 10:36:58 -07:00
Xiang Xiao
9ad74b2c3a
arch/sim: Fixup_heap.c:154:3: error: 'heap_impl' undeclared
...
and up_heap.c:58:33: error: field 'mm_procfs' has incomplete type
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: I4e871e397758c5b0a54803b6cfd1e0c697bef5d8
2021-07-04 10:36:20 -07:00
Xiang Xiao
4adf7ad09d
mm/tlsf: Register mem procfs in mm_initialize
...
follow up this change:
commit 268d66173d
Author: Xiang Xiao <xiaoxiang@xiaomi.com >
Date: Sat Jul 3 21:25:14 2021 +0800
mm: Move procfs_register_meminfo into common place
to avoid the code duplication and ensure the consistent behaviour
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: Ifd9f6ff67f0cb6de54d733f929474154830dc46b
2021-07-04 00:56:24 -07:00
Xiang Xiao
69cb1d7086
mm: Move the real implementation of mm_sbrk to sbrk
...
and remove mm_sbrk and kmm_sbrk since it's wrong to expose
sbrk to other heaps except the default userspace heap.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: I78fdf34c271585ec8fdb81eacedda9fc9f2431fb
2021-07-04 00:53:07 -07:00
Xiang Xiao
9cd1252109
mm: Call memalign in malloc if ARCH_ADDRENV and BUILD_KERNEL are defined
...
to reuse the sbrk logic inside memalign
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
2021-07-04 15:35:13 +08:00
Xiang Xiao
268d66173d
mm: Move procfs_register_meminfo into common place
...
to avoid the code duplication and ensure the consistent behaviour
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: I3fa9ba13d3f8abf882907782708f52c788d0c813
2021-07-04 15:33:19 +08:00
Virus.V
bb6273d4d1
netlink: fix compile error when enable netlink
...
Signed-off-by: Virus.V <virusv@live.com >
2021-07-02 14:57:22 +08:00
mage1
f6a4c17838
sim: fix sim runtime err under sanitize check mode.
...
since gcc sanitize can not stub proper code in nuttx kernel code.
Change-Id: I0910bddee71538c202c6a0a8faab76bcc65f5cd2
2021-07-02 10:49:13 +08:00
Jiuzhu Dong
1dac6f93fd
fs/procfs: add StackAlloc field for task stack info
...
N/A
Change-Id: I4b74191896a4223bb889bbe759694e0b229db71c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com >
2021-07-01 22:04:46 +08:00
liuhaitao
b072d4709a
mm: correct typo error to fix build break
...
Change-Id: Ieb053b4e58e127121fa5e9a93cb7da6ec7b0474a
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com >
2021-07-01 21:16:30 +08:00
Jiuzhu Dong
5d51a3c3ec
wqueue: fix assert about work was cancelled when work doesn't occur.
...
N/A
Change-Id: I04916e041b1b3329287214c052d3ba5fc259235c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com >
2021-07-01 19:10:50 +08:00
ligd
1438eca2a7
sched/waitpid: handle waitpid waitting tcb->group is NULL
...
Fail case:
exit -> nxtask_terminate -> nxtask_exithook -> nxsched_release_tcb
group_leave || nxsched_releasepid & group_leave
/\
/ \
switch out & waitpid()
Thread A group_leave in nxtask_exithook, switch out,
Thread B do waitpid(thread A) then meet traget thread A group is NULL, error.
Change-Id: Ia181d7a13aa645ec1c3141a45839fbf79db35b17
Signed-off-by: ligd <liguiding1@xiaomi.com >
2021-07-01 18:26:20 +08:00
ligd
17e65242d3
sched: add depends on ARCH_INTERRUPTSTACK to SMP
...
Change-Id: I7edbbcf314045c5567e30b39b0693672e5d10e9a
Signed-off-by: ligd <liguiding1@xiaomi.com >
2021-07-01 18:26:20 +08:00
ligd
03b7bd9cf1
fs: move out nx_close from filelock
...
Change-Id: Ia6c4ec88d90db0330134d0aaa30e94cb71c8a066
Signed-off-by: ligd <liguiding1@xiaomi.com >
2021-07-01 18:26:20 +08:00
ligd
dcea2afd7e
mm: fix memory corruption when loop create/exit thread in SMP mode
...
Root casue:
when do thread exit, need add free stack operation to mm_delaylist,
but in SMP mode, CPU0 thread1 exit, at this time, CPU1 call malloc
and free mm_delaylist.
Fix:
Divide mm_delaylist for per CPU in SMP mode.
Change-Id: Ibf7d04614ea2f99fb5b506356b7346a0d94f0590
Signed-off-by: ligd <liguiding1@xiaomi.com >
2021-07-01 18:26:20 +08:00
ligd
772044bbdf
serial: add ioctl TIOCNOTTY
...
Change-Id: I14ab1304d6330578423e0775f42faa8e19886fef
Signed-off-by: ligd <liguiding1@xiaomi.com >
2021-07-01 18:26:20 +08:00
ligd
5c7166f9dd
sched: add STACK_USAGE_SAFE_PERCENT for stack overflow check
...
Change-Id: Ia70e243b36401e28c31fcd7e1b480b79374c27ef
Signed-off-by: ligd <liguiding1@xiaomi.com >
2021-07-01 18:26:20 +08:00
ligd
2d71063825
sched: fix stack check crash in idle thread
...
Change-Id: Iea7c096ffcab181f318edcc1bfe1717785831b7a
Signed-off-by: ligd <liguiding1@xiaomi.com >
2021-07-01 18:26:20 +08:00
ligd
34f63bdc13
mm: don't do mm_checkcorruption in IRQ
...
because this not safe in SMP mode
Change-Id: Ifaf49818c51ee4283f0e280ae3e4e23cbd0dba08
Signed-off-by: ligd <liguiding1@xiaomi.com >
2021-07-01 18:26:20 +08:00
ligd
23f948aa7f
syslog: add CPU id to system when open CONFIG_SMP
...
Change-Id: Ie8aaf44583ff4146b79b1392d1410b31806a81e8
Signed-off-by: ligd <liguiding1@xiaomi.com >
2021-07-01 18:26:20 +08:00
Xiang Xiao
82047fe3c4
mm: Add kmm_malloc_size and mm_malloc_size
...
make malloc_size implementation align with malloc
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: I8d7781925f06e58a880437a16569dccbfd2ea035
2021-07-01 18:08:54 +08:00
Xiang Xiao
1c5b37a1f5
libc: Remove the duplication lib_xxx macro
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: I73c876ed40811c013dad83b8b2aeb7bdc3041913
2021-07-01 18:08:54 +08:00
Xiang Xiao
3dd31cba2c
Move aligned_alloc, posix_memalign and valloc from mm/umm to libs/libc/stdlib
...
since the similar functions(e.g. strdup/strndup) put into libs/libc/string
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: Ifb2c0c51298b09014748e5ee8275db51213d6911
2021-07-01 18:08:54 +08:00
Xiang Xiao
da028e391b
fs: Initialize fs_allmaps_s::exclsem in declaration directly
...
and then remove rammap_initialize and caller
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: Ife9f04d409b3a14a3be4bbb61c23da6e7a9f8a3d
2021-07-01 12:52:01 +08:00
Xiang Xiao
2cfb3f673a
mmap: Implement the minial but reasonable mlock/munlock/mprotect
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: I538e0d78ecd0680374a2e0f56adbc61d7a4e6d1f
2021-07-01 12:31:17 +08:00
Xiang Xiao
6c9e7a1b21
libc/debug: Rename CONFIG_EABI_UNWINDER to CONFIG_UNWINDER
...
since the unwinder not only work with arm but also other arch(e.g. riscv)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: I56cc54f2c99560c858362ab2dfba524097385716
2021-06-30 22:14:18 +08:00
nietingting
97c6d983b5
sim: create symlink for mirtos_test
...
N/A
Signed-off-by: nietingting <nietingting@xiaomi.com >
Change-Id: Ie54e6d0107cf5bc7f2c851105302b604f2dc16ba
2021-06-30 20:40:51 +08:00
丁欣童
cf3d397dd7
sensor/fakesenor: fix set_interval fail sometime.
...
N/A
When fakesensor was activated, csv file is not opened timely, so
the sensor->interval that set_interval() seted will be coverd by
interval form csv file.
Signed-off-by: 丁欣童 <dingxintong@xiaomi.com >
Change-Id: I611587f886c4d2eb6ddb6c28e575e0a0d2ac9cec
2021-06-30 15:00:10 +08:00
liuhaitao
bf711cf263
sim: remove the obsolete mirtos/mirtos_test symlink configs
...
Change-Id: I713fe8affce38eb9ec72343959ec50c5985c0e17
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com >
2021-06-29 22:16:30 +08:00
Jiuzhu Dong
d78b1ff5b3
ramlog: fix compile break
...
Change-Id: I03afb41790dbba1d3290c566b099fe511771de3c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com >
2021-06-29 16:56:35 +08:00
Jiuzhu Dong
482b151d73
work_queue: schedule the work queue using the timer mechanism
...
N/A
Change-Id: I6488e8d3b63f04d43832efaf75f5083e9184d717
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com >
2021-06-28 23:35:56 +08:00
Xiang Xiao
4b7c156321
arch/sim: Implement mm_mallinfo for the custom heap
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: Idf07081869a4659490109aacf8d7905bdb485835
2021-06-28 21:26:09 +08:00
Xiang Xiao
a9f917e44d
arch/sim: Implement malloc_size for the custom heap
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
2021-06-28 21:26:09 +08:00
Xiang Xiao
62ac1e1b6d
arch/sim: Remove host_malloc and host_calloc
...
use host_realloc instead
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: I41e5a722532830b9ec26dd7b32bfab9f30b443c2
2021-06-28 21:26:09 +08:00
Xiang Xiao
4e3c1ed8af
mm: Support malloc_size function
...
and rename malloc_usable_size to malloc_size
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com >
Change-Id: I8d83e9148d70e752142af26d7dd9a291123fdd14
2021-06-28 21:26:09 +08:00
liuhaitao
29d1bc9e87
Add exfat directory into .gitignore
...
Change-Id: I86b94644157af2b1204bcc0d52b118a61c683f53
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com >
2021-06-28 20:24:31 +08:00
Jiuzhu Dong
6d883bbb5d
driver/sensor: fix crash casued by closing the handle during the reading.
...
N/A
Change-Id: I0632f3f81192b3924302f9b363497822b1117032
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com >
2021-06-28 19:53:40 +08:00