Commit Graph

1819 Commits

Author SHA1 Message Date
dongjiuzhu1
c7eca3d176 timerfd/eventfd: using file_allocate to replace register_driver
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-12-28 22:45:25 +08:00
Xiang Xiao
72e76600c3 fs/procfs: Avoid the cast in uptime_read
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-24 11:26:48 -03: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
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
anjiahao
70791af8e2 procmeminfo:support memdump can show specific task
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-12-19 20:43:33 +08:00
zhangyuan21
3462061624 task: show thread main entry when display thread name
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2022-12-17 14:53:59 +08:00
qinwei1
a4f06660d2 fs_epoll: fix some potential issue for list operation
VELAPLATFO-4690

Summary
1. delete item before free it

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
Change-Id: Ie101a0cdba97caa8c3bbf0830dc0a35750688a41
2022-12-13 21:00:11 +02:00
chao an
b5507ea9a2 compile/attribute: minor fix for packed struct mismatch
Signed-off-by: chao an <anchao@xiaomi.com>
2022-12-06 03:50:20 +08:00
crafcat7
8b95b7ca5b littlefs: Get and return the current error status before RMDIR execution type
In some cases, deleting a folder will return unexpected results. For example, ENOENT should be returned when deleting a non-existent folder, but the result will return ENOTDIR.
2022-12-03 02:44:49 +08:00
YAMAMOTO Takashi
8ee2ed0b91 littlefs: add a few Kconfig options 2022-12-01 23:34:31 +08:00
dongjiuzhu1
b1b2a7cc0b timerfd_create: initial reference count to zero
nx_open in timerfd_create will increase reference count,
Therefore, the reference count starts with a value of 0.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-12-01 15:07:09 +08:00
Gao Feng
08f5a5a3be meminfo: buflen identify the left of buffer
It is enought to only checking the buflen's avaiable or not.
(total size means total copied size)

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-11-29 01:29:55 +08:00
ligd
11fa70d53a romfs: change lock to recursion lock
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-11-28 18:04:38 +08:00
wangbowen6
a0ded9d0d4 fs_epoll: [bug fix] epoll node use-after-free in epoll extend list
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-11-26 11:56:58 +08:00
wangbowen6
2f2176151e fs_epoll: [bug fix] EPOLL_CTL_ADD/MOD consider the teardown list too
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-11-25 21:34:09 +08:00
wangbowen6
25bfd437fe fs_epoll: support extend the epoll dynamicly.
1. epoll_ctl(EPOLL_CTL_ADD) support extend the epoll
   events dynamicly;
2. enhance the epoll performance by moving some poll setup
   and teardown process to the EPOLL_CTL_ADD/DEL/MOD;

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-11-22 21:08:56 +08:00
chao an
3727de1a93 fs/userfs: destroy nxmutex properly
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-21 01:15:48 +08:00
qinwei1
8021dfece6 sched/task/task_getpid: getpid should return process id not thread id
Summary:
   implement the right semantics:
1. getpid should return the main thread id
2. gettid should return the current thread id

Refer to:
 https://github.com/apache/incubator-nuttx/issues/2499
 https://github.com/apache/incubator-nuttx/pull/2518

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2022-11-17 17:58:08 +08:00
zhangyuan21
f27065cb9e sched/mqueue: make mqueue and mqueue sysv can disable separately 2022-11-16 20:03:40 +08:00
dongjiuzhu1
0740ebb21b fs/unionfs: fix memory leak about directory operation
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-11-14 14:31:02 +08:00
Marco Casaroli
36c511f710 fs/littlefs: set LFS_NAME_MAX to CONFIG_NAME_MAX 2022-11-13 09:12:54 +08:00
Xiang Xiao
6f33dd6ea0 mm/heap: Change TCB_FLAG_HEAPCHECK to TCB_FLAG_HEAP_CHECK
align with other flags naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-12 09:39:01 +01:00
Xiang Xiao
b72be1ddbf epoll: Call poll_notify before unlock mutex
to avoid the race condition

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-11 21:12:59 +01:00
Xiang Xiao
7e8e5c10d1 fs/epoll: Reuse fd returned from epoll for internal signaling
to avoid the usage of nuttx special extension(POLLFILE)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-11 21:12:59 +01:00
Xiang Xiao
faf16fb810 vfs/epoll: Protect epoll_ctl by mutex
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-08 22:06:46 +01:00
Xiang Xiao
7231a5f044 vfs/epoll: Replace sem_t with mutex_t for locking usage
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-08 22:06:46 +01:00
Xiang Xiao
38d1244751 mm/mempool: Remove MM_MEMPOOL option from Kconfig
since the linker can remove the unused object file from the final image

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-08 10:18:27 -03:00
anjiahao
be670c40d6 fix a mistake about nxmutex & sem
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-11-03 23:42:55 +08:00
yinshengkai
85f727f232 tools: replace INCDIR to Makefile variable
In the past, header file paths were generated by the incdir command
Now they are generated by concatenating environment variables

In this way, when executing makefile, no shell command will be executed,
it will improve the speed of executing makfile
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-03 19:59:55 +08: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
3f12b4f1e3 sched: Remove the unnecessary (FAR sem_t *) cast
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-29 21:12:40 +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
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
Xiang Xiao
4af98af376 fs/vfs: Rename files_allocate to file_allocate
align with the intention better

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-28 10:12:08 +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
Jiuzhu Dong
d6423b5527 romfs: expand file cache by CONFIG_FS_ROMFS_FCACHE_NSECTORS
The default size of file cache is size of a sector, it may
not be good size for optimizing read/write speed in physical
device. So we can set the config according to speed test profile
to optimize access IO speed.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-10-24 20:49:09 +08:00
Xiang Xiao
ab12bea1ae Fix vfs/fs_timerfd.c:73:17: error: duplicate member 'lock'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-23 12:08:30 +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
e1ca516488 use SEM_INITIALIZER inside of NXSEM_INITIALIZER
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-10-22 14:50:48 +08:00
anjiahao
5724c6b2e4 sem:remove sem default protocl
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
zhangyuan21
16b6d365e9 fs/procfs: check task status before get group info
When ps cmd is invoked during the task exit process, the group information of the task may be deleted.
So need check the task flag before get the task group information.
2022-10-21 18:47:58 +08:00
YAMAMOTO Takashi
4eee9af668 file_vopen: Retry as a directory in case of EISDIR
This allows you to open() a directory without O_DIRECTORY.
2022-10-19 21:20:35 +08:00
YAMAMOTO Takashi
aa67e0a0f4 inode_stat: handle INODE_IS_PSEUDODIR case
If you open() a directory and fstat() it, you come here.
This commit fixes the file type in that case.
2022-10-19 21:20:35 +08: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