Commit Graph

53981 Commits

Author SHA1 Message Date
guohao15
76a1a5b2c4 inotify:fix memory alloc/free not match
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 20:25:30 +08:00
guohao15
c63adb5c14 hcreate: add alloc/free func hook for user to deallocate memory
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 20:25:30 +08:00
guohao15
43bcac952a tmpfs: old data was loaded when SEEK_SET beyond end of the file
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 20:25:03 +08:00
guohao15
7f16770b91 bch:alloc bch->buffer when offset not aligned
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 20:24:13 +08:00
guohao15
458bab9ae7 fix:uart_rpmsg_dmareceive data copy to nbuffer should start from data + length
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 09:23:12 -03:00
jinxiuxu
b874d95beb drivers/audio: fix samp rate conversion issue
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2024-08-22 09:13:51 -03:00
jinxiuxu
618a51fa84 audio: add 12K support in sim_alsa driver
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2024-08-22 09:13:51 -03:00
jinxiuxu
7355629d19 audio: add 12K sample rate support
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2024-08-22 09:13:51 -03:00
Alin Jerpelea
fe642f1cfd libc/time: remove lib_strptime
This code is licensed under BSD-4-Clause license which may render the OS unusable for some products.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-08-22 16:45:15 +08:00
Zhe Weng
acbddd11d5 net/netdev: Add periodic log for netdev statistics
Work for every network device using `CONFIG_NETDEV_STATISTICS`.

Log style:
<interface>:T{done}/{total},R({v4}+{v6})/{total} {Protocol}:T{tx},R{rx},D{drop}
Example:
wlan0:T10/10,R(10+20)/31 TCP:T0,R0,D0 UDP:T0,R10,D0 ICMP:T0,R0,D0 ICMP6:T0,R0,D0

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-08-22 16:17:56 +08:00
jianglianfang
f5fe7646ed sim: read the second buffer
It can only read the contents of the first buffer, so fblen should be changed to ensure that it can read the second buffer as well.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-22 16:17:43 +08:00
jianglianfang
4d42fdf195 video/fb: changed circbuf_write assert to warning
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-22 15:33:56 +08:00
Yanfeng Liu
01219b415c board/qemu-armv7a: add Cmake support
This adds Cmake support for `qemu-armv7a` device.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-08-22 15:25:02 +08:00
guohao15
52e5d69236 api:add lib_realpath function
FAR char *lib_realpath(FAR const char *path, FAR char *resolved, bool notfollow);

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 15:24:48 +08:00
makejian
947b24c8c1 crypto/poly1305: export poly1305 mac algorithm via /dev/crypto
Signed-off-by: makejian <makejian@xiaomi.com>
2024-08-22 13:40:24 +08:00
makejian
8628cc9c0e crypto/ripemd160: export ripemd160 algorithm via /dev/crypto
Signed-off-by: makejian <makejian@xiaomi.com>
2024-08-22 13:40:24 +08:00
simbit18
419a8ab050 CMakeLists.txt: warning D9002 on windows + msvc
Resolve compile warning

cl : command line  warning D9002: ignoring unknown option '-fmacro-prefix-map=
2024-08-22 08:28:34 +08:00
fangxinyong
9b3fe17743 arch/arm/arm_mpu.c: fix build warning
armv7-m/arm_mpu.c: In function 'mpu_dump_region':
armv7-m/arm_mpu.c:621:13: warning: format '%X' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
  621 |       _info("MPU-%d, alignedbase=0%08X l2size=%"PRIu32" SRD=%X"
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
armv7-m/arm_mpu.c:621:13: warning: format '%X' expects argument of type 'unsigned int', but argument 6 has type 'long unsigned int' [-Wformat=]
  621 |       _info("MPU-%d, alignedbase=0%08X l2size=%"PRIu32" SRD=%X"
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
armv7-m/arm_mpu.c:621:13: warning: format '%X' expects argument of type 'unsigned int', but argument 7 has type 'long unsigned int' [-Wformat=]
  621 |       _info("MPU-%d, alignedbase=0%08X l2size=%"PRIu32" SRD=%X"
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
armv7-m/arm_mpu.c:621:13: warning: format '%u' expects argument of type 'unsigned int', but argument 8 has type 'long unsigned int' [-Wformat=]
  621 |       _info("MPU-%d, alignedbase=0%08X l2size=%"PRIu32" SRD=%X"

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-08-22 01:58:46 +08:00
chenrun1
3a6a23d157 xtensa_mpu:Modify the specified Region attributes
Due to the xtensa mpu feature, the size of the Region depends on the Base of the next Region. e.g.
Region[1] = 0x20000000
Region[0] = 0x30000000
Then Region[1] length = Region[0] - Region[1]
So this approach is not suitable to implement the behavior of cleaning
up the Region and such a configuration will result in affecting the very beginning (the higher) Region
Therefore, to address this feature, in this change we return the Region
value and implement the ability to modify the target Region's attributes

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:58:46 +08:00
chenrun1
054c564a2d arm_mpu:Fix mpu_initialize not taking effect
Modified the input parameters of mpu_initialize to require the caller to provide the number of entries in the table

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:58:46 +08:00
chenrun1
62f598e547 arm_mpu:Reentrant allocation Region
Changes have been completed:
1.armv7m
2.armv8m
3.armv7r
4.arm64

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:58:46 +08:00
zhanghongyu
3a25286862 usbdev/cdcncm: fix notify overwrite issue
we need to wait until the previous notify message is done to
send a new notify message

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-22 01:56:26 +08:00
zhanghongyu
9f9075c48c usbdev/cdcncm: fix ndpsign mismatch after NCM_SET_NTB_FORMAT
Otherwise, the NCM_SET_NTB_FORMAT message from the host may cause
subsequent parsing exceptions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-22 01:56:26 +08:00
zhanghongyu
418b692e21 usbdev/cdcmbim: add response notify
when the host is needed to read the data, RESPONSE_AVAILABLE must first
be sent.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-22 01:56:26 +08:00
zhanghongyu
5b24917bb9 usb_cdcmbim: add mbim device driver
./build.sh sim:usbdev -j12
sudo gdb nuttx/nuttx -ex "source nuttx/tools/gdb/__init__.py"

below command to create mbim NIC on host
nsh> conn 3

NuttX's MBIM device implementation adds an additional MBIM network
card to the NuttX system, which can debug the data communication with
the host, but this network card is unnecessary and needs to be removed
when the business actually uses this driver, And the cdcncm_receive
method needs to be re-implemented.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-22 01:56:26 +08:00
chenrun1
271f76590f fs_lock/pathbuffer:Optimize code structure
Summary:
  Adjust code logic

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:54:22 +08:00
chenrun1
36a8ff0540 lib_pathbuffer.c:Determine whether to malloc from the heap by CONFIG_LIBC_PATHBUFFER_MALLOC
Summary:
  If we disable LIB_PATHBUFFER_MALLOC, that when the path buffer is insufficient, NULL is returned to avoid applying for a buffer from the heap.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:54:22 +08:00
guohao15
16afee6f0c notify:add path tmp buffer
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 01:54:22 +08:00
chenrun1
dba77ff043 fslock:Optimize the performance overhead caused by frequent close
Summary:
  Indicate whether the file is currently locked by adding a new field locked to filep.
    0 - Unlocked
    1 - Locked
  The status of the filep at close is used to determine whether to continue with the following procedure.

  Optimizing performance:
Before
  Time taken to close the file: 33984 nsec
After
  Time taken to close the file: 23744 nsec
Improvement of about 10 msec

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:54:22 +08:00
chenrun1
c528244f19 fs_lock:Fixed the problem that in multi-threaded situations, the bucket may be deleted by other factors during the search process, resulting in assertion.
hsearch_r(item = (key = 0x61492174,data = ?),action = ?, retval = 0x6266AC44, htab = 0x6159B758) H 1tem = Ckey = 0x61492174, data= :
 · action = ?
  retval = 0x6266AC44
  htab = 0x6159B758
  haad - 0x61616300
  ie= 0×38

file_lock_find_bucket(inline)
  filepath = 0x61492174
  hretvalue = 0x6055991D
  item = (key = 0x61492174, data = 0x0)

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:54:22 +08:00
chenrun1
0bf2634631 fs_lock:Reduce stack size
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:54:22 +08:00
guohao15
a69d3d78fe inotify: add filter of notify options to reduce overload of system
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 01:50:37 +08:00
guohao15
8731368e45 inotify: group g_inotify_xxx global variables into one struct
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 01:50:37 +08:00
guohao15
57250a9602 inotify: use nx_stat instead of stat
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 01:50:37 +08:00
guohao15
bf919afcbd notify:change tempbuffer structure
In rpmsgfs case the old tempbuffer will case deadlock

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 01:50:37 +08:00
guohao15
3df638971f notify:do not noitfy when in signal context
Some signal handler may opreate files, that will cause deadlock
when the thread holding file system lock

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 01:50:37 +08:00
guohao15
048415f407 notify: change inode type check out of the lock
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 01:50:37 +08:00
guohao15
25e2d7bef2 inotify:add function filter type of inode
only mountpt/driver/pseudodir need inotify

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 01:50:37 +08:00
guohao15
03aca2c07e rpmsgfs:add support FIOC_FILEPATH for rpmsgfs_ioctl
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 01:50:37 +08:00
guohao15
68a64c1a4c inotifiy:reduce stack memory used in inotify
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 01:50:37 +08:00
guohao15
74963deceb inotify:change log level in case of flood the screen
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 01:50:37 +08:00
guohao15
a40a8e17fb fsnotify:fix bug when path="/"
fix crash when queue event to root dir's parent

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 01:50:37 +08:00
guohao15
3ced80c743 basename: return path address instead of "/" when path="/"
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 01:50:37 +08:00
guohao15
86e00896d3 fs:notify add support for inotify
support API: open close read write unlink mkdir rename fchstat rmdir symlink

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 01:50:37 +08:00
chenrun1
6e1dfe2777 include/wchar:Fix mbstate_t Redeclaration in MSVC
Summary:
  Because stdio.h references stdatomic.h in MVSC, it internally declares mbstate_t, leading to redeclarations during compilation.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:44:29 +08:00
chenrun1
aade7c7c2d atomic:support ATOMIC_VAR_INIT in others platform
Summary:
  This change mainly appears in the compilation environment of MVSC
  Since MVSC supports the c++11 standard in VS2019 preview3 (https://en.cppreference.com/w/cpp/compiler_support/11), we can do static initialization using the c++11 approach
atomic_int a = 1

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:44:29 +08:00
chenrun1
900e713cd0 atomic:Add more interfaces
Summary:
  1. add atomic_flag_test_and_set and atomic_flag_clear
  2. add typedef memory_order
  3. add atomic_flag

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:44:29 +08:00
chenrun1
cfcf347515 nuttx/atomic.h:replace ALL stdatomic.h with nuttx/stdatomic.h in nuttx/
Summary:
 1. use nuttx/atomic.h instead of stdatomic
 2. remove CONFIG_HAVE_ATOMIC,because we now support atomic on all platforms

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:44:29 +08:00
chenrun1
8e1a042eef nuttx/atomic.h:Fix missing type declarations at compile time
Summary:
  1.Modify the conditions for entering different include header files
  2.Added pre-definition for _Atomic _Bool when it is missing
  3.Added nuttx for stdatomic implementation. When toolchain does not support atomic, use lib/stdatomic to implement it

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:44:29 +08:00
chenrun1
667e92390b nuttx/atomic.h:replace ALL stdatomic.h with nuttx/stdatomic.h in nuttx/
Summary:
  1. Add nuttx/atomic.h in include
  2. Use nuttx/atomic.h instead of stdatomic.h in the nuttx directory

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:44:29 +08:00