Commit Graph

5837 Commits

Author SHA1 Message Date
Xiang Xiao
28947517ca sched/spawn: Rename task_spawnattr_[get|set]stack[size|addr] to posix_spawnattr_[get|set]stack[size|addr]
since they can be not only used in task_spawn but also in posix_spawn

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 09:51:18 +09:00
chao an
e0a3fdf982 sched/posix/timer: handle invaild timerid correctly
TIMER_SETTIME(2)

NAME
       timer_settime, timer_gettime - arm/disarm and fetch state of POSIX per-process timer

SYNOPSIS
       #include <time.h>

       int timer_settime(timer_t timerid, int flags,
                         const struct itimerspec *new_value,
                         struct itimerspec *old_value);
       int timer_gettime(timer_t timerid, struct itimerspec *curr_value);
...
ERRORS
...
       EINVAL timerid is invalid.

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-31 19:59:29 -03:00
Xiang Xiao
e08c296a8e Change the type of tg_joinlock, mm_lock and md_lock from sem_t to mutex_t
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 10:35:53 +01:00
Xiang Xiao
64e7833cbc sched/spawn: Support task_spawnattr_[set|get]stackaddr
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 12:46:58 +09:00
Xiang Xiao
b9b032af72 sched/spawn: Support task_spawnattr_[set|get]stacksize in kernel mode
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-31 12:46:58 +09:00
anjiahao
d7b4e91dda Call nxsem_destroy or nxmutex_destry in the error path
1.Don't check the return value of nxsem_init or nxmutex_init
2.Fix some style issue

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 13:56:52 +01:00
Xiang Xiao
732092570e sched/mutex: NXMUTEX_INITIALIZER should enable priority inheritance
and remove the unused macro PRIOINHERIT_FLAGS_DISABLE

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-29 21:37:06 +02:00
zhanghongyu
f00c11aec4 socket: separation error code EBADF and ENOTSOCK
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-10-29 08:18:02 +02:00
yinshengkai
65dc1fe0fc mm: add kmm/umm_memdump
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-10-29 11:35:27 +08:00
Xiang Xiao
5bee68ebac sched: remove the unused function nx_wait and nx_waitid
This partially reverts commit de2a9d8a77.
2022-10-28 21:19:46 +02:00
dongjiuzhu1
6f208524a1 lib/math32.h: support LOG2_CEIL/LOG2_FLOOR function at compile time
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-10-29 00:12:02 +08:00
dongjiuzhu1
5828e5bb88 mm/mempool: add new api: xx_realloc and xx_alloc_size
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-10-28 21:31:35 +08:00
Jiuzhu Dong
8994c8efa2 mm/mempool: support specifying alloc and free function
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-10-28 21:31:35 +08:00
Jiuzhu Dong
a01f3beefd mm/mempool: support multiple memory pool
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-10-28 21:31:35 +08:00
Xiang Xiao
488a56280a fs: Correct the comment of file_allocate
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-28 10:12:08 +02:00
Xiang Xiao
604eea453b fs/vfs: Let caller control whether add the reference count of inode in file_allocate
to simplify the caller in some special case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-28 10:12:08 +02:00
Xiang Xiao
4d4bb458da fs/vfs: Move file_allocate from fs/inode/inode.h to include/nuttx/fs/fs.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-28 10:12:08 +02:00
chao an
a8d3286258 net: move device buffer define to common header
Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-28 00:32:16 -04:00
Xiang Xiao
6940ca8677 fs: Remove the duplication umount macro
which is already defined in include/sys/mount.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 23:14:25 +02:00
Xiang Xiao
19bded4738 fs: Remove the unused nx_pipe to prefer file_pipe for kernel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 23:14:25 +02:00
Xiang Xiao
fc1efe2c0b fs: Remove the unused nx_fcntl to prefer file_fcntl for kernel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 23:14:25 +02:00
Xiang Xiao
b22cc1e2b8 fs: Remove the unused nx_dup to prefer file_dup for kernel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 23:14:25 +02:00
Xiang Xiao
cf21319d3a fs: Remove the unused nx_poll to prefer file_poll for kernel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 23:14:25 +02:00
Xiang Xiao
aa31648c9f fs: Remove the unused nx_[v]ioctl to prefer file_[v]ioctl for kernel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 23:14:25 +02:00
Minh Nguyen
153060d34d Update errno to match asm-generic
Modify some comment.
2022-10-28 02:19:26 +08:00
wangbowen6
f56710c121 rpmsgblk: rpmsg block device support
Like rpmsgdev and rpmsgmtd, rpmsgblk allow the local cpu to
access the block device in the remote cpu.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-10-28 01:13:58 +08:00
Xiang Xiao
05d40eeeff net: Remove the unused nx_recv[from] to prefer psock_recv[from] for kernel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 16:47:32 +02:00
Xiang Xiao
3e982b6556 net: Remove the unused nx_send to prefer psock_send for kernel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 16:47:32 +02:00
Petro Karashchenko
fdff92fd19 libs/libc/time: mktime normalize struct tm
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-27 21:22:08 +08:00
Tiago Medicci Serrano
6f1fbc29ee audio/i2s: add i2s_mclkfrequency method to the I2S lower half
This method allows the codec driver to set a specific mclk
frequency for the I2S lower half. This provides support to change
it on run time according to the supported master clock frequency
of the audio codec, the sample rate and the data width.
2022-10-27 00:09:01 +08:00
Karel Kočí
61b1791584 libs/libc: add obstack 2022-10-26 09:11:52 +08:00
SPRESENSE
277c8e368b drivers/video: Update API to dump register for debug 2022-10-26 03:57:26 +08:00
SPRESENSE
1332bdb9a7 drivers/video: Add get frame interval API 2022-10-26 03:57:26 +08:00
SPRESENSE
306029e6e4 lte: Include nuttx/fs/ioctl.h instead of wireless.h
lte command definitions are separated from wireless ioctl.
2022-10-24 13:09:29 +08:00
Petro Karashchenko
2fd7e18a16 include/sys: fix style issues in queue.h
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-24 12:59:24 +08:00
Miguel Herranz
819ebe7356 libc/stdio: Add stdio file locking functions
Add flockfile(), ftrylockfile() and funlockfile() functions [1].

[1] POSIX.1-2008 / System Interfaces / flockfile
    https://pubs.opengroup.org/onlinepubs/9699919799.2008edition/functions/flockfile.html

Signed-off-by: Miguel Herranz <miguel@midokura.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-22 23:34:45 +08:00
anjiahao
577e550698 libc/semaphore:sem_init change defult protocol
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-10-22 14:50:48 +08:00
chao an
205c8934a3 sched/msgq: add support of System V message queue
https://man.openbsd.org/msgget.2

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-22 12:58:11 +08:00
chao an
96c3debe6a sched/mqueue: decoupling condition member to common prologue
Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-22 12:58:11 +08:00
Alin Jerpelea
06c8e43df9 drivers: modem: update altair modem
update Altair modem with the ALT1250 implementation

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-10-22 09:00:32 +08:00
raiden00pl
36ae5316b7 include/nuttx/can.h: make error definitions compatible with Linux 2022-10-21 18:47:29 +08:00
Xiang Xiao
942513cd37 time: Typedef time_t to int64_t if CONFIG_SYSTEM_TIME64 is defined
to handle 2038 problem correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-20 22:17:52 +02:00
Xiang Xiao
1e6a8f56d3 sched/spawn: Fix the minor typo error
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-20 21:51:40 +02:00
YAMAMOTO Takashi
8a972817e0 sched.h: Simplify HAVE_GROUP_MEMBERS logic
After the retirement of CONFIG_SCHED_EXIT_KILL_CHILDREN, [1]
the behavior is now effectively controlled by
CONFIG_SCHED_CHILD_STATUS, which is IMO confusing.
(It was even surprising me.)

This commit solves it by making HAVE_GROUP_MEMBERS
a synonym of !CONFIG_DISABLE_PTHREAD. I guess this change aligns
the intention of the CONFIG_SCHED_EXIT_KILL_CHILDREN retirement.
That is, always tries to be similar to the standard behavior.

Another option would be to revive CONFIG_SCHED_EXIT_KILL_CHILDREN
and make the HAVE_GROUP_MEMBERS logic aware of it.
It might be a good idea if we want a finer-grained control of
code to build. (One can argue his application uses pthread
but does never _exit. In that case, it might be a waste to maintain
group membership. I suspect it might not be too rare in embedded
world.)

[1] commit 6982eb35fe
2022-10-19 21:32:30 +08:00
YAMAMOTO Takashi
f100a4bb92 Implement fdopendir 2022-10-19 21:20:35 +08:00
Xiang Xiao
e2a18ad339 sched: Support envp argument of task_spawn and nxtask_create
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-19 08:22:56 +09:00
Xiang Xiao
6b31918b42 Remove the unnecessary cast for main_t, NULL and argv
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 08:51:45 +02:00
anjiahao
d1d46335df Replace nxsem API when used as a lock with nxmutex API
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
Xiang Xiao
6854cce059 sched/spawn: Add the dummy task_spawnattr_xxxstackyyy in the kernel mode
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 19:13:42 +02:00
Xiang Xiao
78f6a02bc8 boards: Remove the duplicated prototype of CONFIG_INIT_ENTRYPOINT
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 19:02:44 +02:00