Commit Graph

54172 Commits

Author SHA1 Message Date
chenrun1 e15100543f lib_remove.c:fix code style error
Summary:
  Warning: /home/runner/work/nuttx/nuttx/nuttx/libs/libc/stdio/lib_remove.c:59:32: warning: Wrong column position of comment right of code

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-20 13:50:15 +08:00
chenrun1 0a4770b44a lib_remove:Repair the logical judgment
Summary:
  When the deleted path is a file, the return value of get_errno is -EISDIR, so in Condition Two
(get_errno() ! = EPERM && /* .... . try to remove it. */
       rmdir(path) ! = 0)
The judgment holds directly, so it can't actually execute to rmdir

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-20 13:50:15 +08:00
nuttxs e6962942cb net/pkt: fix raw socket send data length is insufficient. 2024-08-20 13:41:49 +08:00
Rodrigo Sim 86c2e429eb arm: Fix DS1307 initialization for common STM32 logic
Signed-off-by: Rodrigo Sim rcsim10@gmail.com
2024-08-20 10:25:42 +08:00
Filipe Cavalcanti 4d4d8a6ca5 arch/risc-v/esp32c3: fix AP password memcpy typo 2024-08-20 00:50:26 +02:00
Zhe Weng 4b5585a316 netdev/upper: Delay replied packets to prevent TX quota become negated
When our netstack is replying packets when processing RX, the replied
packets will be sent without considering of TX quota because we don't
want to drop them. Now we may delay them by pushing them to a queue and
send them later, which can always keep quota working.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-08-20 06:37:46 +08:00
Filipe Cavalcanti 9b253ee165 Created pre-commit config file 2024-08-19 21:40:56 +02:00
chao an f12c88d287 assert: check COMPILE_TIME_ASSERT before define
check COMPILE_TIME_ASSERT before define

Signed-off-by: chao an <anchao@lixiang.com>
2024-08-20 02:42:35 +08:00
guoshichao 64176214a0 assert: add compile_assert macro
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-19 22:16:04 +08:00
jinxiuxu e88e3cd527 nuttx/audio: add AUDIOIOC_GETPOSITION ioctl
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2024-08-19 11:14:08 -03:00
chenrun1 a7f5c37a63 v9fs/client.c:fix in x86 qemu crash
Summary:
  In the x86 environment, memory does not necessarily start at 0, so when end is 0x0, start = end + 1, and then determine the contents of start, it will cause x86 to cause a crash when accessing an illegal address.
This problem does not occur in the arm environment because arm starts at 0x0, so the content of the 0x1 address is “\0”.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-19 11:05:40 -03:00
chenrun1 1e3e551a19 v9fs/client.h:fix array type has incomplete element type
Summary:
fix error:
v9fs/client.c: In function 'v9fs_client_walk':
v9fs/client.c:1462:16: error: array type has incomplete element type 'struct iovec'
 1462 |   struct iovec wiov[2];
      |                ^~~~
v9fs/client.c:1463:16: error: array type has incomplete element type 'struct iovec'
 1463 |   struct iovec riov[2];
      |                ^~~~
v9fs/client.c:1463:16: warning: unused variable 'riov' [-Wunused-variable]
v9fs/client.c:1462:16: warning: unused variable 'wiov' [-Wunused-variable]
 1462 |   struct iovec wiov[2];
      |                ^~~~
v9fs/client.c: In function 'v9fs_transport_done':
v9fs/client.c:1721:49: error: invalid use of undefined type 'struct iovec'
 1721 |   FAR struct v9fs_lerror_s *error = cookie->riov[0].iov_base;
      |                                                 ^
v9fs/client.c:1721:52: error: invalid use of undefined type 'struct iovec'
 1721 |   FAR struct v9fs_lerror_s *error = cookie->riov[0].iov_base;
      |                                                    ^

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-19 11:05:40 -03:00
chenrun1 fa7403db5a v9fs:Support ioctl to get relpath
Summary:
  1.The relpath information is stored in the fid structure
  2.The relative path information is only saved in the client. When the server changes, the relpath saved in the fid will not change.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-19 11:05:40 -03:00
chenrun1 97338c9f3d idr:New idr_find interface
Different from idr_get_next, if idr_find directly when could not find the node id return an error

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-19 11:05:40 -03:00
chenrun1 a1ccf15e39 idr:Tool for associating discrete ids with addresses
This is a tool for associating discrete IDs with addresses.
This tool is implemented through the red-black tree method provided by <sys/tree.h>, and the time complexity when calling, searching, and deleting is optimized to O(logn)
The implementation is the moving node operation of two red-black trees
1. When applying for a node, it will first check whether there is an available node in the "removed" tree. If so, the memory address of the node will be reused and moved to the "alloced" tree.
2. If the "removed" tree is an "empty tree", then the node will be requested from the memory and added to the "alloced" tree
3. Similarly, when removing a node, we set the address pointed to in the node to "NULL" and move it to the "removed" tree. Next time we alloc the node, we can reduce the overhead caused by memory application
For now, we still have something that can be optimized, and that is the memory elimination mechanism of the "removed tree". The current implementation will only release all the content under the "removed" tree when the idtree is destroyed.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-19 11:05:40 -03:00
chenrun1 aee9125350 v9fs:File system based on 9P2000L.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-19 11:05:40 -03:00
chenrun1 af5d679e18 fs.h:Added definition CH_STAT_SIZE
Define a CH_STAT_SIZE in fs.h

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-19 11:05:40 -03:00
liuhongchao fb37391ea6 drivers/input: enable touch/kbd/mouse for virtio input
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2024-08-19 20:08:50 +08:00
meijian 580f7387a1 [driver][bcm43xxx] reset tx_seq of sido-bus when ifdown wlan-if
Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-19 19:56:40 +08:00
meijian a8843a073f getrlimit:implement RLIMIT_STACK return limit stack size
Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-19 19:55:59 +08:00
cuiziwei 837410fad2 nuttx/sim:By default, stack-use-after-return is not checked when enabling SIM_ASAN.
==263401==ERROR: AddressSanitizer: stack-use-after-return on address 0xf515f260 at pc 0x042434f0 bp 0x9ac24e78 sp 0x9ac24e68
WRITE of size 4 at 0xf515f260 thread T0
    #0 0x42434ef in nxsem_get_value semaphore/sem_getvalue.c:65
    #1 0x413110d in work_thread wqueue/kwork_thread.c:195
    #2 0x412c4f6 in nxtask_start task/task_start.c:129
    #3 0x427b1fc in pre_start sim/sim_initialstate.c:52

Address 0xf515f260 is located in stack of thread T0 at offset 32 in frame
    #0 0x928c9e3 in host_settimer sim/posix/sim_hosttime.c:104

  This frame has 1 object(s):
    [32, 48) 'it' (line 105) <== Memory access at offset 32 is inside this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
      (longjmp and C++ exceptions *are* supported)

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-08-19 19:54:17 +08:00
xinbingnan 942081ec6c minidumpserver: fix parsing bug
stack dump add new region `show stacks`, but this script is not support
now this is fixed with adding check condition for all lines contains stack word

Signed-off-by: xinbingnan <xinbingnan@xiaomi.com>
2024-08-19 19:54:06 +08:00
Yanfeng Liu 3166c6d9c6 riscv/qemu-rv: add RPTUN cmake
This adds cmake support for RPTUN.
2024-08-19 19:53:03 +08:00
Windrow14 5c8adefc67 drivers/mmcsd/Kconfig|mmcsd_sdio.c: check ready without sleep
If per tick is set to 10ms, it will cause nxsig_usleep(1000) in the
sdio driver to sleep for 19ms, which is much longer than the
expected 1ms, resulting in very low write performance. Add option to
reduce CPU hogging by using sched_yield(), though it may also affect
write performance when the CPU is busy.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2024-08-19 19:52:39 +08:00
Windrow14 190c8787ff arch/xtensa/src/esp32s3/Kconfig|Make.defs|esp32s3_sdmmc.c,
arch/xtensa/src/esp32s3/hardware/esp32s3_sdmmc.h|esp32s3_soc.h,
boards/xtensa/esp32s3/common/include/esp32s3_board_sdmmc.h,
boards/xtensa/esp32s3/common/src/Make.defs|esp32s3_board_sdmmc.c,
boards/xtensa/esp32s3/esp32s3-devkit/src/esp32s3_bringup.c: add SD/mmc driver

Support 1-bit bus width and 4-bit bus width. Support eMMC high speed SDR mode.
Support transfer data with DMA. Support SD clock frequency up to 40MHZ.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2024-08-19 19:52:39 +08:00
Windrow14 c96a33a12f drivers/mmcsd/mmcsd_sdio.c: enable clock before issue CMD0
In mmcsd_cardidentify(), the clock is not enabled before issuing
CMD0, and the clock has been disabled in mmcsd_removed(). It makes
no sense to enable the clock after issuing CMD0, because when CMD0
is issued, it will exit with error due to the clock is not enabled.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2024-08-19 19:52:39 +08:00
Windrow14 d07e73e684 drivers/mmcsd/mmcsd_sdio.c: show eMMC information after initialization is completed
Prompts for capacity, speed mode and bus width after eMMC
initialization is completed.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2024-08-19 19:52:39 +08:00
Windrow14 49cbcfb5e6 drivers/mmcsd/mmcsd.h|mmcsd_sdio.c|mmcsd_sdio.h: support MMC high speed SDR mode
According to the eMMC specification, in Backwards Compatibility
with legacy MMC card mode, the frequency of the SD clock must be
0-26 MHZ; in high speed SDR mode, it must be 0-52MHZ. So we should
switch to high speed SDR mode if the clock frequency is higher than
26MHZ.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2024-08-19 19:52:39 +08:00
Windrow14 08ce36d292 drivers/mmcsd/mmcsd_sdio.c|h: optimize macros for setting EXT_CSD
CMD6 can use these macros to set any writable EXT_CSD field, not
just the bus width, so optimize these macro definitions to make
them general.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2024-08-19 19:52:39 +08:00
Windrow14 4f7f751d2a drivers/mmcsd/mmcsd_sdio.c: fix unable to switch eMMC device to 4-bit bus width mode
All eMMC devices support 4-bit bus width, so we should mark the
device as supporting 4-bit bus width after detecting that the
device type is eMMC.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2024-08-19 19:52:39 +08:00
zhanghongyu ce0599f46c net/icmpv6/icmpv6_input.c: fix undefined build error
When CONFIG_NETDB_RESOLVCONF is enabled, CONFIG_NETDB_DNSSERVER_NAMESERVERS
will undefined, could cause net/icmpv6/icmpv6_input.c build error.
just add one nameserver to avoid overwrite ipv4 nameserver.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-19 19:50:44 +08:00
zhanghongyu 986ddc83ce netinet/in.h: add macro definitions to resolve compilation errors
solve the compiling problem of the third-party library,
add IN6_IS_ADDR_MC_LINKLOCAL and IN6_IS_ADDR_SITELOCAL definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-19 19:49:42 +08:00
cuiziwei e21885b84a nuttx/boards:Uniform initialization format for init_array.
(1) Keep the `.init_array` and `.ctors` symbols and sort them according to their initialization priority.
(2) Exclude symbols ending with crtend.* and crtbegin.* to support c++
application.if we not exclude crtend.* crtbegin.* frame_dummy will be
added when enable any c++ application with global variables, this symbol
execution is problematic, removing it does not affect the application.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-08-19 19:48:32 +08:00
zhanghongyu 87ebdb850c net/pkt: fix issue that set nonblock by fcntl does not take effect
pkt_sockcaps returns SOCKCAP_NONBLOCKING to indicate that pkt supports
nonblock configuration.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-19 16:45:15 +08:00
halyssonJr b832638b15 add support to LTDC for Linum board 2024-08-19 16:44:53 +08:00
cuiziwei 17a06ce2cd fs/mmap: Fix build warning with [-Wmaybe-uninitialized].
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-08-19 16:40:58 +08:00
cuiziwei 6071102c90 nuttx/note:fix missing the last character when printing custom labels.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-08-19 14:04:50 +08:00
jianglianfang db78cc9c0f input: fix goldfish input and lvgl input device name mismatch problem
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-19 14:03:32 +08:00
chenrun1 12318bd947 xtensa_cache:add up_get_cachesize api
Summary:
  Added up_get_dcache_size and up_get_icache_size common APIs

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-19 13:54:53 +08:00
halyssonJr 3c1d52ac19 add configuration to use the gpio example and update interrupt gpio according to the pinout description. 2024-08-19 13:54:11 +08:00
cuiziwei 4c70918888 tools/parsetrace.py:fix parsetrace script error.
Traceback (most recent call last):
  File nuttx/tools/parsetrace.py, line 29, in <module>
    from pycstruct import pycstruct
ModuleNotFoundError: No module named 'pycstruct'

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-08-19 13:53:30 +08:00
Alan Carvalho de Assis df612b9e10 doc: Fix documentation typo and missing git package 2024-08-19 13:53:15 +08:00
cuiziwei 71d10bd8cf nuttx/fs:Rename node with inode.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-08-19 13:35:56 +08:00
guoshichao 29e50ebed8 greenhills: add dummy implementation for unused function
add dummy implementation to avoid the link error

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-19 10:37:54 +08:00
guoshichao c95a9fc304 greenhills: add empty "__extension__" definition to fix build error
"libcxxmini/libxx_cxa_guard.cxx", line 47: error #77-D: this declaration has
          no storage class or type specifier
  __extension__ typedef int __guard __attribute__((mode(__DI__)));
  ^

"libcxxmini/libxx_cxa_guard.cxx", line 47: error #65: expected a ";"
  __extension__ typedef int __guard __attribute__((mode(__DI__)));
                ^

"libcxxmini/libxx_cxa_guard.cxx", line 64: error #20: identifier "__guard" is
          undefined
    int __cxa_guard_acquire(FAR __guard *g)
                                ^

"libcxxmini/libxx_cxa_guard.cxx", line 64: error #20: identifier "g" is
          undefined
    int __cxa_guard_acquire(FAR __guard *g)
                                         ^

"libcxxmini/libxx_cxa_guard.cxx", line 65: error #65: expected a ";"
    {
    ^

"libcxxmini/libxx_cxa_guard.cxx", line 93: warning #12-D: parsing restarts
          here after previous syntax error
  }

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-19 10:37:54 +08:00
yanghuatao b3627bb8c6 toolchain/ghs: Fix zero used for undefined preprocessing identifier "NR_IRQS" warnings
CC:  unistd/lib_setregid.c "/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/irq.h", line 53: warning #193-D:
          zero used for undefined preprocessing identifier "NR_IRQS"
  #  if NR_IRQS <= 256
        ^
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/irq.h", line 82: warning #193-D:
          zero used for undefined preprocessing identifier "NR_IRQS"
  #if NR_IRQS <= 256
CC:  mount/fs_umount2.c "/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/irq.h", line 72: warning #193-D:
          zero used for undefined preprocessing identifier "NR_IRQS"
  #if NR_IRQS <= 256

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-08-19 10:37:54 +08:00
guoshichao b2a739a67a greenhills: fix the can.h build error
CC:  src/algslib_sha256.c "comlin.c", line 189: error #1982-D: target stack alignment is insufficient to
          guarantee alignment of this variable
      struct can_frame lin_err_frame = comlin_rx_frame[chlId];
                       ^

"comlin.c", line 282: error #1982-D: target stack alignment is insufficient to
          guarantee alignment of this variable
      struct can_frame frame;
                       ^

"comlin.c", line 321: error #1982-D: target stack alignment is insufficient to
          guarantee alignment of this variable
      struct can_frame frame;

"DiagServer_IsoTp.c", line 220: error #1982-D: target stack alignment is
          insufficient to guarantee alignment of this variable
      struct canfd_frame frame = {0};
                         ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-19 10:37:54 +08:00
guoshichao 0cf0bece2e arch/strarg: provide the stdarg implementation for greenhills compiler
the greenhills compiler provide its own implementation of va_start,
va_end, va_arg, va_copy. so if we are build vela with greenhills
compiler, we should using the stdarg implementation provided by
greenhills, not our own

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-19 10:37:54 +08:00
yanghuatao 681122bc23 toolchain/ghs: Fix green hills toolchain build Vela MIN_MANT error
"stdio/lib_dtoa_engine.c", line 102: error #166: invalid floating constant
        if (x < MIN_MANT)
                ^

"stdio/lib_dtoa_engine.c", line 102: warning #1626-D: concatenation with "("
          in macro "PASTE" does not create a valid token
        if (x < MIN_MANT)
                ^

"stdio/lib_dtoa_engine.c", line 102: error #109: expression preceding
          parentheses of apparent call must have (pointer-to-) function type
        if (x < MIN_MANT)
                ^

"stdio/lib_dtoa_engine.c", line 107: error #166: invalid floating constant
                if (y < MAX_MANT)
                        ^

"stdio/lib_dtoa_engine.c", line 107: warning #1626-D: concatenation with "("
          in macro "PASTE" does not create a valid token
                if (y < MAX_MANT)
                        ^

"stdio/lib_dtoa_engine.c", line 107: error #109: expression preceding
          parentheses of apparent call must have (pointer-to-) function type
                if (y < MAX_MANT)
                        ^

"stdio/lib_dtoa_engine.c", line 119: error #166: invalid floating constant
                if (y >= MIN_MANT)
                         ^

"stdio/lib_dtoa_engine.c", line 119: warning #1626-D: concatenation with "("
          in macro "PASTE" does not create a valid token
                if (y >= MIN_MANT)
                         ^

"stdio/lib_dtoa_engine.c", line 119: error #109: expression preceding
          parentheses of apparent call must have (pointer-to-) function type
                if (y >= MIN_MANT)
                         ^

"stdio/lib_dtoa_engine.c", line 144: error #166: invalid floating constant
        if (x >= MAX_MANT)
                 ^

"stdio/lib_dtoa_engine.c", line 144: warning #1626-D: concatenation with "("
          in macro "PASTE" does not create a valid token
        if (x >= MAX_MANT)
                 ^

"stdio/lib_dtoa_engine.c", line 144: error #109: expression preceding
          parentheses of apparent call must have (pointer-to-) function type
        if (x >= MAX_MANT)
                 ^

"stdio/lib_dtoa_engine.c", line 153: error #166: invalid floating constant
        uint64_t decimal = MIN_MANT_INT;
                           ^

"stdio/lib_dtoa_engine.c", line 153: warning #1626-D: concatenation with "("
          in macro "PASTE" does not create a valid token
        uint64_t decimal = MIN_MANT_INT;
                           ^

"stdio/lib_dtoa_engine.c", line 153: error #109: expression preceding
          parentheses of apparent call must have (pointer-to-) function type
        uint64_t decimal = MIN_MANT_INT;

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-08-19 10:37:54 +08:00
yanghuatao 2ae4ea3f99 toolchain/ghs: Fix green hills toolchain build Vela link error
[elxr] (error #412) unresolved symbols:
 __builtin_signbit     from libc.a(lib_dtoa_engine.o)

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-08-19 10:37:54 +08:00