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
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
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
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
Xiang Xiao
d37d8e00a5
mtd: Add MTDIOC_FLUSH IOCTL like MTDIOC_XIPBASE
...
since the old design reuse BIOC_FLUSH for
MTD device which make some confusion
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-28 18:06:52 +08:00
Xiang Xiao
5cd03beaf1
sched: Add kthread_create_with_stack
...
let caller customize the stack buffer
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I878818ec1ce5650165dbbe2d72a4618cb2e6a094
2021-06-28 10:57:42 +08:00
Xiang Xiao
811bcd413d
net: Add if_nameindex and if_freenameindex API
...
Specified here:
https://man7.org/linux/man-pages/man3/if_nameindex.3.html
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia5daed775bd11fa5978d54860632554da8f7b416
2021-06-26 19:45:21 -07:00
Xiang Xiao
87709b3a7c
sched/wdog: Remove flags field from wdog_s to save memory
...
since WDOG_ISACTIVE can check func field instead
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I21d7f9cfe6195c8ccb6cc5925ff66f3c89822f9d
2021-06-25 23:40:19 +08:00
yangjiukui
b112e70f8b
L61: Sensor: Add driver for OPT3006 light sensor.
...
N/A
Add light sensor.
Signed-off-by: yangjiukui <yangjiukui@xiaomi.com>
Change-Id: If0695aaec21476e68d739c420db732b184c178bb
2021-06-25 17:47:55 +08:00
Jiuzhu Dong
b41923aad3
Revert "sched/wqueue: replace the notification mech from signal to semaphore"
...
This reverts commit a3a0f578bc .
2021-06-25 17:04:36 +08:00
Huang Qi
5c0a079aea
libc: Implement fesetround & fegetround for arm
...
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-06-25 12:24:24 +08:00
Xiang Xiao
fea4cfe91c
libc/sched: Implement nice API
...
Specified here:
https://pubs.opengroup.org/onlinepubs/007904875/functions/nice.html
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib25be28c8dc1c9288e8c78ad756c91ec6ef325a7
2021-06-24 20:56:02 +08:00
Xiang Xiao
30ee11470c
libc/sched: Map the nice value more correctly
...
from https://pubs.opengroup.org/onlinepubs/007904875/functions/setpriority.html :
1.The nice value shall in the range [-{NZERO},{NZERO} -1]
2.Lower nice value shall cause more favorable scheduling
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I5ad60d92abc3b69fbaa406da68cec2e40ca3fa6d
2021-06-24 20:55:53 +08:00
Xiang Xiao
5e70d212b9
sys/select.h: Should include sys/time.h instead of time.h
...
because struct timeval is defined in sys/time.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I767347fc3e0a4cdb3280307c7dfcac53fbddd24e
2021-06-24 20:55:24 +08:00
Xiang Xiao
fed064f45e
libc/time: Implement timegm function
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id988ae077cf54597b2522546c4309b66416b8b0e
2021-06-24 20:53:17 +08:00
Xiang Xiao
b3bcc02a04
sched: Identify the stack need to free by TCB_FLAG_FREE_STACK
...
instead calling kmm_heapmember or umm_heapmember because:
1.The stack supplied by caller may allocate from heap too
2.It's hard to implement these two function in ASan case
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I196377822b7c4643ab4f29b7c1dc41dcd7c4dab1
2021-06-18 20:59:03 +08:00
chao.an
a3a0f578bc
sched/wqueue: replace the notification mech from signal to semaphore
...
Change-Id: I57596eb661083e914c8718b7c3c1b7190bfa2863
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-18 20:44:04 +08:00
Jiuzhu Dong
2e6932316e
syslog/ramlog_channel: fix log confusion when multi task writing together
...
N/A
Change-Id: I2a17a81028862ccdd3936862e2548f93c4837ae1
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
(cherry picked from commit a96a9ef5279f50f7fb7fb262cb2b1cd5285f2d8b)
2021-06-17 22:02:39 +08:00
anchao
d24b879e63
Revert "net/socketpair: move socketpair implement into socket internal"
...
This reverts commit a66e18bc53 .
Reason for revert: <N/A>
Change-Id: I3b707a2f6f52fb4a9eb2ab649b686b955b879d65
2021-06-17 20:23:59 +08:00
chao.an
a66e18bc53
net/socketpair: move socketpair implement into socket internal
...
Change-Id: I1c6d7178e2631e43d9fcc99918456eec36f730ce
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-16 15:19:44 +08:00
chao.an
70135e1e45
sys/poll: add POLLRDHUP definition
...
Change-Id: I1117279d9a620138789256d699ae32d47eab3a90
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-16 14:15:14 +08:00
Xiang Xiao
1c02246a78
Revert "sched/posix_spawn: Don't insert name at the begin of argv"
...
This reverts commit 032086870d .
2021-06-15 21:55:30 -07:00
chao.an
693bd87cab
net/sock: move the psock calloc out of sockfd_allocate
...
Change-Id: I3b5373ffe9a4034c2ac2cd83389fd46c47dc9047
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-15 11:23:13 +08:00
Xiang Xiao
a8ca032acc
sched/posix_spawn: Don't insert name at the begin of argv
...
since the standard require the caller pass the name explicitly
https://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html :
The argument argv is an array of character pointers to null-terminated strings.
The last member of this array shall be a null pointer and is not counted in argc.
These strings constitute the argument list available to the new process image.
The value in argv[0] should point to a filename that is associated with the
process image being started by the posix_spawn() or posix_spawnp() function.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id79ffcc501ae9552dc4e908418ff555f498be7f1
2021-06-13 01:16:06 -07:00
Xiang Xiao
0655a39c91
binfmt: Remove filename/exports/nexports from binary_s
...
to simplify the life cycle management
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-13 00:31:22 -07:00
Xiang Xiao
5c55a1d7fd
binfmt: Move argv copy into exec_module
...
and remove the related fields from struct binary_s
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-13 00:31:12 -07:00
Xiang Xiao
c997bf0f52
sched/task: Simplify the syscall handling of task_spawn
...
It's better to save one argument by returning pid directly.
This change also follow the convention of task_create.
BTW, it is reasonable to adjust the function prototype a
little bit from both implementation and consistency since
task_spawn is NuttX specific API.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id74f4dd1ef26dfd8f7c473684cf1a45fbeee13cf
2021-06-13 00:30:57 -07:00
Xiang Xiao
4d66266a8e
sched: Don't include nuttx/sched.h inside sched.h
...
But let nuttx/sched.h include sched.h instead to
avoid expose nuttx kernel API to userspace.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6fe673364be9eb1259381e6575d4c1a9fea58097
2021-06-13 00:25:26 -07:00
Xiang Xiao
2331ba972a
Don't include errno.h from spawn.h
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-13 00:22:14 -07:00
Xiang Xiao
5db8fc1f3a
sched/spawn: Support the stack address argument
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-13 00:04:59 -07:00
Xiang Xiao
35035f5c89
arch: Rename xxx_getsp to up_getsp
...
All modern desgin support stack pointer and it's also an
important information, so let's standardize this interface.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-11 11:37:19 +08:00
chao.an
2152a35662
net: fix build break
...
Change-Id: I662580ded8d1c98ddcfbcfae961978eb3512e3b9
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-09 22:07:45 +08:00
chao.an
af44043ec0
net: add support of FIONREAD
...
Change-Id: Iebfdd960f4e9b184558e390f78ec7f8369753b5b
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-09 09:47:59 +08:00
chao.an
600671fe86
netinet: move the byte ordering convert functions to "netinet/in.h"
...
Change-Id: Ida4916fe062f20258dbbcd794e59e686d4d5c35e
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-08 22:21:58 +08:00
chao.an
2fd5872449
mm/iob: add iob_get_queue_size() helper
...
Change-Id: I117530f364cbef1e011638ff6d14087b7447bde7
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-08 11:57:52 +08:00
Xiang Xiao
3c33d253b4
drivers/syslog: Remove emergstream implementation and caller
...
since emergstream always call syslog_force, but syslog_force is designed
for the interrupt context, and then doesn't mean any emergency thing.
On the other hand, emergstream has other bad side effect:
1.Can't output to file or dev channel
2.Can't work well with the interrupt buffer
Change-Id: I1c7af74f82da93ffa4ebe0e6ac25634aeb73a890
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-04 13:46:41 +08:00
chao.an
e223790148
serial/uart/h4: add bt h4 uart serial driver
...
Change-Id: I456622ce097006447cc8b050e4a44ee96865ddfe
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-03 18:33:20 +08:00
chao.an
8f0cc709d4
wireless/bluetooth: decoupling bt_driver_s and bt_buf_s
...
Change-Id: I12879c364cf8ca63898da94621e94d8fc23a4f6f
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-03 18:33:14 +08:00
chao.an
df71da9450
bluetooth/filter: add more OGF into ble blacklist
...
Change-Id: I4f1b98dc63ab2d9eeb523b8040aae88ea285bb9a
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-05-31 21:00:01 +08:00
chao.an
caecd75b41
wirelss/bluetooth/bt_buf: add ISO buffer type
...
Change-Id: I9de3506e9c8f70bbcefafda3319be194dcb7cb0b
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-05-25 21:56:12 +08:00
Xiang Xiao
191e010c5f
include/spawn.h: Add POSIX_SPAWN_SETSID definition
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I7ad654a1cb9b74a9f27f52c88fffa8b487a48f33
2021-05-17 20:03:49 +08:00
Xiang Xiao
88326eac8d
libc/pwd: Add NSS_BUFLEN_PASSWD macro
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I739679038b2004cc45d78f540831ba81b088a586
2021-05-17 19:58:28 +08:00
Xiang Xiao
6bb3366fe2
libc: Implement openpty function
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I36e02af0145cd6e740766e7484cc9d5ce410e5e4
2021-05-17 19:58:06 +08:00
Xiang Xiao
874e564c89
drivers/serial: Change the default value of SERIAL_NPOLLWAITERS to 4
...
since the console is normally opened three time as stdin, stdout and
stderr and remove the dependence on STANDARD_SERIAL because other type
of serial drivers also support the poll through the same codebase.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie68322c4647cc838b295491329969869d6ba310b
2021-05-17 19:55:40 +08:00
Byron Ellacott
70ab250c5d
Add experimental support for an eZ80 toolchain using llvm and GNU binutils.
...
An additional fix for the RTC driver to lock the RTC after setting values instead of unlocking it is included.
2021-05-10 19:23:33 +08:00
ligd
74d29cf864
sched_critmon: add thread run time to critmonitor
...
Change-Id: Ib44e45f0f9a1b249b4067db324c9dbdf0cf3f288
Signed-off-by: ligd <liguiding1@xiaomi.com>
(cherry picked from commit 08aeeb5981aeb8787a9d259506185650638b9970)
2021-05-08 20:49:40 +08:00
Xiang Xiao
71c942ea51
libc/pty: Make ptsname[_r] support PSEUDOTERM_BSD config too
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I82a60ded48ea3437bd5f2b4fe328294d7077b040
2021-05-08 20:49:11 +08:00
Jiuzhu Dong
c5cd15a72e
include/termios: left shift of 1 by 31 places cannot be represented in type 'int'
...
N/A
cu_main.c:172:22: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
by asan
Change-Id: I224345bddb11523db0c4a91c16617a3200fad034
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-08 20:45:42 +08:00
Jiuzhu Dong
9a956df67b
sim_addrenv: support add addrenv dynamically multiple times.
...
N/A
Change-Id: Ie34f6c59bc16fb147c7103978253dbe9403990d3
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-08 20:26:39 +08:00