Commit Graph

54099 Commits

Author SHA1 Message Date
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
chao an 4c6f75d13c sched/irq: correct critical section to spin lock
Regression by:

| commit 2ee8aa6f2b
| Author: hujun5 <hujun5@xiaomi.com>
| Date:   Thu Jan 11 11:27:31 2024 +0800
|
|     sched: we use spin_lock_irqsave replace enter_critical_section to protect g_irqvector
|
|     enter_critical_section may be called before os initialized
|
|     Signed-off-by: hujun5 <hujun5@xiaomi.com>

Signed-off-by: chao an <anchao@lixiang.com>
2024-08-22 01:39:29 +08:00
liqinhui 4fa5451595 simwifi: Fix the error of the return value in wifidriver_set_txpower.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 23:36:26 +08:00
liqinhui 91d849b70e simwifi: Resolve the error of getting the network ID.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 23:36:26 +08:00
liqinhui 6d3fdd4f15 simwifi: Suppress the scanning times to avoid the popen crash.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 23:36:26 +08:00
liqinhui 577e2fa73f simwifi: Avoid to set the mode of wlan repeatedly.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 23:36:26 +08:00
liqinhui 01b39074a2 simwifi: Support the ioctl of SIOCGIWENCODEEXT and SIOCGIWSENS.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 23:36:26 +08:00
liqinhui be942853c4 simwifi: Add debug info and disable the wifi of networkmanager.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 23:36:26 +08:00
Pietro Albini c19cbdf8d6 cmake: fix invalid syntax when generating version.h from tags
When building from git tags, the version number in `include/version.h`
is extracted from the output of `git describe`. While that is correct,
cmake was not configured to strip trailing whitespace from the command
output, which resulted in the version number being `12.5.1\n`.

That broke the generation of `include/version.h`, as the `\n` resulted
in the terminating quote being in a new line. This commit fixes that by
instructing cmake to strip trailing whitespace.
2024-08-21 23:32:09 +08:00
liqinhui a60185cc40 net:Fix the warnings.
tcp/tcp_send_buffered.c: In function 'psock_send_eventhandler':
tcp/tcp_send_buffered.c:1025:17: warning: format '%u' expects argument of type 'unsigned int', but argument 9 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
 1025 |           ninfo("SEND: wrb=%p seq=%" PRIu32 " pktlen=%u sent=%u sndlen=%zu "
      |                 ^~~~~~~~~~~~~~~~~~~~
......
 1030 |                 conn->snd_wnd, seq, remaining_snd_wnd);
      |                 ~~~~~~~~~~~~~
      |                     |
      |                     uint32_t {aka long unsigned int}

wireless/ieee80211/bcm43xxx/bcmf_netdev.c: In function 'bcmf_addmac':
wireless/ieee80211/bcm43xxx/bcmf_netdev.c:879:26: warning: unused variable 'priv' [-Wunused-variable]
  879 |   FAR struct bcmf_dev_s *priv = (FAR struct bcmf_dev_s *)dev->d_private;
      |                          ^~~~

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 23:30:49 +08:00
liqinhui d99717765e bcm43xxx: Fix the warnings.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 23:30:49 +08:00
shizhenghui 8d1f4e9697 sim_camera: rename video to camera
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-08-21 23:29:47 +08:00
shizhenghui 04dfae545c video/v4l2_cap: fix sign extension
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-08-21 23:29:47 +08:00
shizhenghui 6ff3ed83fc m2m sim codec: add wqueue.h to fix build warning
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-08-21 23:29:47 +08:00
Tiago Medicci Serrano 568917bfd2 espressif: Fix MCUboot build on RISC-V and unify linker script
This commit fixes building MCUboot on Espressif's RISC-V SoCs and
unify the associated linker scripts to make improve readability.
2024-08-21 23:28:45 +08:00
Tiago Medicci Serrano 5680e9d5a4 espressif: Update internal libraries reference
Update internal reference to get the most updated Espressif's
libraries. Those libraries are based on branch `release/v5.1` of
the ESP-IDF and include `v5.1.4` version of it.
2024-08-21 23:28:45 +08:00
buxiasen c40358ff0d pm: update document, add pm_idle interface for not-smp case
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-08-21 23:19:50 +08:00
Karel Kočí c4d8d937d5 libs/libc/obstack: correctly append null byte at the end of string
obstack_printf and obstack_vprintf should terminate the C string with
null byte but lib_vsprintf doesn't do it. It must be done on top of
that unless we get unterminated string.

This is fix to be consistent with GlibC behavior.

This also includes minor tweak to use obstack_1grow directly instead of
calling obstack_puts.
2024-08-21 10:21:50 -03:00
makejian ee6fdb2c85 crypto: import the ability to clone session
Signed-off-by: makejian <makejian@xiaomi.com>
2024-08-21 18:02:54 +08:00
anjiahao 9eadf61e90 toos/gdb:sync mempool memdump method
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-08-21 18:01:24 +08:00
anjiahao 9478f5b6d4 tools/gdb:add get_symbol_value api
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-08-21 18:01:24 +08:00
fangpeina dbdeaa2ada libc/execinfo: extract a common backtrace format function
Add a common method to format backtrace to buffer, so it can be used by both mm, fs and other possoble modules.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2024-08-21 18:01:24 +08:00
anjiahao a9fb366314 mempool:fix bug when deinit mpool, wrong parameters used
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-08-21 18:01:24 +08:00
anjiahao e6bf25a714 mempool:Need check mpool is NULL
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-08-21 18:01:24 +08:00
anjiahao 8f92695ee1 mempool:need unposion memory when deinit
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-08-21 18:01:24 +08:00
anjiahao 80ea8c3cc7 mempool:fix bug when free a alignment address
The mempool mistakenly considers the heap memory as its own

The recurring scenario only occurs in mempool_deinit
test code in hello_main:

int main(int argc, FAR char *argv[])
{
  void *a = malloc(1024*64);
  void *d[16];
  void *heap = mm_initialize("123", a, 1024 * 64);
  for (int i = 0; i < 16; i++)
    {
        d[i] = mm_malloc(heap,32);
    }

  for (int i = 0; i < 16; i++)
    {
      if (d[i] != NULL)
        mm_free(heap,d[i]);
    }

  mm_uninitialize(heap);
  free(a);
  return 0;
}

and crash backtrace

0  _assert (filename=0x4ea20 "mempool/mempool.c", linenum=373, msg=0x0 <up_perf_convert>, regs=0x0 <up_perf_convert>)
   at misc/assert.c:551
1  0x0000a32c in __assert (filename=0x4ea20 "mempool/mempool.c", linenum=373, msg=0x0 <mempool_multiple_foreach>)
   at assert/lib_assert.c:36
2  0x0000f92c in mempool_release (pool=0x100e7a0, blk=0x100ff80) at mempool/mempool.c:373
3  0x000109ce in mempool_multiple_free (mpool=0x100e6f8, blk=0x100ff80) at mempool/mempool_multiple.c:648
4  0x0000deac in mm_delayfree (heap=0x100e090, mem=0x1010000, delay=false) at mm_heap/mm_free.c:83
5  0x0000e21c in mm_free (heap=0x100e090, mem=0x1010000) at mm_heap/mm_free.c:242
6  0x0001021c in mempool_multiple_free_chunk (mpool=0x100e6f8, ptr=0x1010000) at mempool/mempool_multiple.c:222
7  0x0001048e in mempool_multiple_free_callback (pool=0x100e7a0, addr=0x1010080) at mempool/mempool_multiple.c:291
8  0x0000ff6e in mempool_deinit (pool=0x100e7a0) at mempool/mempool.c:644
9  0x00010cba in mempool_multiple_deinit (mpool=0x100e6f8) at mempool/mempool_multiple.c:883
10 0x0000dd0c in mm_uninitialize (heap=0x100e090) at mm_heap/mm_initialize.c:326
11 0x0002c742 in hello_main (argc=1, argv=0x100d050) at hello_main.c:54
12 0x0000a83e in nxtask_startup (entrypt=0x2c6a5 <hello_main>, argc=1, argv=0x100d050) at sched/task_startup.c:70
13 0x00005272 in nxtask_start () at task/task_start.c:112

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-08-21 18:01:24 +08:00
anjiahao 8c52317a45 mempool:fix mempool memdump address incorrect printing
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-08-21 18:01:24 +08:00
anjiahao 7c34ece5d6 mempool:fix memdump leak will hang on spinlock
root cuase is getpid use spinlock
can read mempool nodes without needing spinlock protection.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-08-21 18:01:24 +08:00
anjiahao 73f506b65f mempool: safe memdump for smp, if syslog will switch context
remove alist, switch to a convenient way to traverse
the physical address directly.

At the same time, we can use `gurad` to mark whether
it is free or alloc or out of bounds check

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-08-21 18:01:24 +08:00
yinshengkai 659f3b5ff6 mm: remove mempool_sq_count
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-08-21 18:01:24 +08:00
anjiahao 0687466223 mempool:alloc for sq head, free to sq last useful debug
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-08-21 18:01:24 +08:00
anjiahao ce4969e881 Documentation:update gdbserver Documentation
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-08-21 18:01:06 +08:00
anjiahao fcf06f6367 gdbserver:minidumpserver is powerful, so change name to gdbserver
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-08-21 18:01:06 +08:00