Commit Graph

2303 Commits

Author SHA1 Message Date
wangchen addfe127a9 socketpair.c:Replace kmm with fs heap
due to https://github.com/apache/nuttx/pull/13722/commits, In the socketpair.c,fs_heap interface replaces kmm interface

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-10-16 20:56:39 +08:00
dongjiuzhu1 8e2f8be671 fs/rpmsgfs: return real err value when open failed
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-16 18:12:21 +08:00
hujun5 a567148888 sched: add up_this_task and up_change_task macro stub
reason:
We can utilize percpu storage to hold information about the
current running task. If we intend to implement this feature, we would
need to define two macros that help us manage this percpu information
effectively.

up_this_task: This macro is designed to read the contents of the percpu
              register to retrieve information about the current
              running task.This allows us to quickly access
              task-specific data without having to disable interrupts,
              access global variables and obtain the current cpu index.

up_update_task: This macro is responsible for updating the contents of
                the percpu register.It is typically called during
                initialization or when a context switch occurs to ensure
                that the percpu register reflects the information of the
                newly running task.

Configuring NuttX and compile:
$ ./tools/configure.sh -l qemu-armv8a:nsh_smp
$ make
Running with qemu
$ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
   -machine virt,virtualization=on,gic-version=3 \
   -net none -chardev stdio,id=con,mux=on -serial chardev:con \
   -mon chardev=con,mode=readline -kernel ./nuttx

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-15 15:25:55 +08:00
dongjiuzhu1 5a38c8bfe3 fs/readlink: fix minor issue
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-14 18:08:14 -03:00
chenrun1 b613863bad fs:replase all asprintf / strdup in fs with fs_heap_xxx
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-10-15 01:16:48 +08:00
yintao e435fca0e2 fs_file.c: modify files_countlist comments
Signed-off-by: yintao <yintao@xiaomi.com>
2024-10-13 02:27:02 +08:00
xuxin19 351781d601 cmake:refine nuttx cmake build system fix CMake build missing part
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-13 02:25:06 +08:00
yinshengkai c23878e442 sched: modify CONFIG_DUMP_ON_EXIT to CONFIG_SCHED_DUMP_ON_EXIT
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-13 02:06:38 +08:00
guohao15 69f3774f30 littlefs:remove the '/' in the end of relpath in mkdir
mkdir /data/log   success
mkdir /data/log/  failed  in littlefs (but fatfs/yaffs/tmpfs success)

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-11 15:46:02 +08:00
ligd da5839c6f2 littlefs: fix warnings
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-11 15:46:02 +08:00
zhouliang3 8f6ea8896f fs/littlefs: revert fstat and use lfs_file_attr function
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2024-10-11 15:46:02 +08:00
Jiuzhu Dong c5779297cf littlefs/stat: return OK when stat success
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2024-10-11 15:46:02 +08:00
zhouliang3 0ab637f57e fs/littlefs: Add attr to dirA
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2024-10-11 15:46:02 +08:00
zhouliang3 f70de1c65f fs/littlefs: Fix the bug of missing file types
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2024-10-11 15:46:02 +08:00
zhouliang3 44992c8821 fs/littlefs: Implement fchstat and chstat of littlefs
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2024-10-11 15:46:02 +08:00
guohao15 38f0056dcd romfs:extend romfs to enable write part4
add sem for write safe

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-11 10:42:20 +08:00
Xiang Xiao 322765b442 fs/romfs: Align up the file size to 16 bytes
and set volume size to 96 bytes in romfs_mkfs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-11 10:42:20 +08:00
Xiang Xiao 7814c40a99 fs/romfs: Replace strlcpy and strcmp with memcpy and memcmp
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-11 10:42:20 +08:00
Xiang Xiao 4d9512f0d4 fs/romfs: Add romfs_devstrcpy and romfs_devmemcpy
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-11 10:42:20 +08:00
Xiang Xiao 808beabc83 fs/romfs: Compute rf_endsector correctly when the file end on the sector boundary
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-11 10:42:20 +08:00
Xiang Xiao cca7b7cb37 fs/romfs: romfs_read return the partail read size instead error code
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-11 10:42:20 +08:00
Xiang Xiao 96900845a5 fs/romfs: Change the type of num from uint8_t to uint16_t
to support the directory with more than 255 files

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-11 10:42:20 +08:00
Xiang Xiao 4ebcc130b9 fs/romfs: Remove the reference to OK and ERROR
and fix the minor style issue

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-11 10:42:20 +08:00
guohao15 23aef2d7b4 romfs:extend romfs to enable write part3
add romfs_mkfs to support autoformat && forceformat

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-11 10:42:20 +08:00
guohao15 7d8d766018 romfs:bugfix use origoffset instead of offset
origoffset represent the offset of current node
offset represent the offset of the file when
the current node is a soft or hard link

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-11 10:42:20 +08:00
guohao15 3e58620ccc romfs:bugfix romfs_statfs
fix for df cmd infomation of romfs

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-11 10:42:20 +08:00
guohao15 c61734a469 romfs:extend romfs to enable write part2
add sparelist api

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-11 10:42:20 +08:00
guohao15 f3840cf141 romfs:extend romfs to enable write part1
change romfs_cachenode to find all headers

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-11 10:42:20 +08:00
yinshengkai e4e355d164 fs: Set the poll return value according to the man manual
The man manual describes that poll only has EFAULT, EINTR, EINVAL, and ENOMEM return values.
If a file returns an error, the POLLERR event should be set and OK should be returned
https://man7.org/linux/man-pages/man2/poll.2.html

When using libuv to poll the socket, the socket poll returned an EBUSY error, causing libuv to abort.

The expected logic should be to return OK, allowing libuv to notify the event listener that the POLLERR event occurred.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-11 03:08:05 +08:00
yinshengkai 36ddb46dba fs/poll: remove poll_teardown unused parameter
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-11 03:08:05 +08:00
zhengyu9 bc7114ab16 fs/vfs: result_independent_of_operands
timeout is a type of int
in MSEC2TICK, timeout may be multiplied by USEC_PER_MSEC
and the result may be out of range of int
Besides, this will induce following ERROR while running simulator:
vfs/fs_poll.c:498:38: runtime error: signed integer overflow:
19768268 * 1000 cannot be represented in type 'int'

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-11 03:08:05 +08:00
Neo Xu d598da80e4 Rename group_argvstr to nxtask_argvstr
Now argument vector is stored to TLS, task_argvstr fits better.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-10 23:13:37 +08:00
dongjiuzhu1 5a29652d2a fs/inode: using read-lock to protect inode_find
inode_find don't need to modify inode tree

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-10 16:42:15 +08:00
yintao 37a30023f5 nuttx/drivers: add ept_release_cb for destroy server resource
use ept_release_cb to destory rpmsg services server dile resource
to avoid the used-after-free issue

Signed-off-by: yintao <yintao@xiaomi.com>
2024-10-10 08:44:29 +08:00
Yongrong Wang 60ab9ae37e virtio_9p.c: fix compile error in OpenAMP upgrade feature reflow to dev
v9fs/virtio_9p.c:223:3: error: too few arguments to function 'virtio_negotiate_features'
  223 |   virtio_negotiate_features(vdev, 1 << VIRTIO_9P_MOUNT_TAG);
v9fs/virtio_9p.c:245:9: error: too few arguments to function 'virtio_create_virtqueues'
  245 |   ret = virtio_create_virtqueues(vdev, 0, 1, vqname, callback);

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-10-09 23:32:58 +08:00
wangyongrong 8e799ff823 rpmsg: upgrade API passing on parameters with the upgrade of OpenAMP
All the rpmsg transport layer and rpmsg services sync the API
with new OpenAMP

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-10-09 23:32:58 +08:00
zhangshoukui 10c0d00e6d Fix to compile parameters not taking effect When cmake version is greater than 3.18
https://cmake.org/cmake/help/latest/command/set_source_files_properties.html

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-10-09 18:12:50 +08:00
cuiziwei e98d018265 nuttx/fs:Rename node with inode.
In ./fs/inode directory, the variable name FAR struct inode *node is named inconsistently, with some using node and others using inode. To facilitate understanding, we will standardize the naming to FAR struct inode *inode.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-09 14:16:09 +08:00
Xiang Xiao 35d3365577 fs/vfs: Avoid calling stat with oldrelpath twice in mountptrename
and return error directly if stat return failure

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-09 12:38:12 +08:00
xuxingliang 3d31e84749 fs: fix wrong config for FS_SHMFS
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-09 10:18:15 +08:00
ligd d473fa24a7 mq: correct inode release in mq_inode_release()
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-09 10:17:24 +08:00
fangxinyong f2cc9e8410 fs: support VFS-based named event group
This extension for the event group, to establish a connection between
named event groups and a task. The task may reference the event group
associated with a VFS-based name. Then the event group can be used
in subsequent calls to nxevent_wait() or nxevent_post().

This is an internal OS interface and should not be used by applications.

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-10-09 01:40:00 +08:00
xuxingliang 74725b9412 procfs: access tcb in critical section
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-08 23:55:59 +08:00
anjiahao fb176c02ca gdb/thread.py:Remove dependence on g_current_regs
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-08 23:55:59 +08:00
buxiasen 067ec7bab1 fs/procfs: fix cmake no mm_pressure, fix kernel build error
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-08 23:55:59 +08:00
anjiahao 60aa08e365 procfsmeminfo:move heap name to last,avoid display misalignment
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-08 23:55:59 +08:00
buxiasen 9f2b08a91a memdump: add dump for the orphan nodes(neighbor of free node)
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-08 23:55:59 +08:00
buxiasen fd9a9f67cc memdump: add biggest allocated node dump
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-08 23:55:59 +08:00
buxiasen fd6634ecb5 mm/dump: make macro more common, fix help prompt
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-08 23:55:59 +08:00
xuxingliang 3a86098c9e fs: fix compile break
/home/neo/projects/vela/nuttx/fs/vfs/fs_dup2.c: In function 'file_dup3':
/home/neo/projects/vela/nuttx/fs/inode/inode.h:73:35: error: implicit declaration of function '_SCHED_GETTID' [-Werror=implicit-function-declaration]
   73 |           int n = sched_backtrace(_SCHED_GETTID(), \
      |                                   ^~~~~~~~~~~~~
/home/neo/projects/vela/nuttx/fs/vfs/fs_dup2.c:177:3: note: in expansion of macro 'FS_ADD_BACKTRACE'
  177 |   FS_ADD_BACKTRACE(filep2);

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-08 23:24:13 +08:00