Commit graph

57019 commits

Author SHA1 Message Date
buxiasen
52c4408db9 document/drivertest: add more information in drivertest
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-12-11 20:35:28 +08:00
Nathan Hartman
532bf64515 Documentation: Tweak text about Zero Latency Interrupts
This is a follow-up to 366c8a5d94 (PR-15102).

* Documentation/guides/zerolatencyinterrupts.rst
  (Title): Make title case consistent.
  (Getting Back into the Game, Maskable Nested Interrupts): Clarify discussion
   about priorities.
  (Cortex-M3/4 Implementation): The first half of a sentence was deleted in
   366c8a5d9 because the Kconfig that was described there no longer exists:
   CONFIG_ARMV7M_USEBASEPRI. Write a new beginning for this sentence that
   matches current implementation.
  (Disabling the High Priority Interrupt): Change "cannot" to "must not be
   allowed to" to improve clarity.
  (Configuring High Priority Interrupts): Change "to NVIC" to "in NVIC" to
   improve clarity.
2024-12-11 20:35:28 +08:00
Xiang Xiao
34d1a7fd54 Documentation: Remove CONFIG_ARMV7M_USEBASEPRI from code base
since the basepri is always used without any configuraion

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-12-11 20:35:28 +08:00
chao an
32ab151712 libc/chdir: chdir/fchdir should not depend on environment variables
This PR will still allow basic shell operations such as cd/ls/pwd to be used even when the environment is disabled.

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-11 20:35:00 +08:00
meijian
3fdcd065cf net/tcp_timer: fix tcp RTO abnormally large after retransmission occurs
when tcp retransmission only double conn->timer in Karn(tcp_timer.c L602), after retransmission in Jacobson
M is is now rtt test will become a negative value.
```
  signed char m;
  m = conn->rto - conn->timer; // M is now rtt test

  /* This is taken directly from VJs original code in his paper */

  m = m - (conn->sa >> 3);
  conn->sa += m;              //conn->sa is a negative value
  if (m < 0)
	{
	  m = -m;
	}

  m = m - (conn->sv >> 2);
  conn->sv += m;
  conn->rto = (conn->sa >> 3) + conn->sv; //rto
```
For example,we lost one ack packet, we will set conn->timer = 6 by backoff,conn->rto still 3.
After retransmission we will Do RTT estimation, then will get
```
conn->sa = 253
conn->rto = 46
```
Then if any packets lost it will wait for a long time before triggering a retransmission.

Test method.
We can reproduce this issue by adding drop ACK packets in tcp_input, and debug conn->rto after Jacobson.

Signed-off-by: meijian <meijian@xiaomi.com>
2024-12-11 20:34:23 +08:00
hujun5
3063f2c0e0 litex_serial: use small lock in arch/risc-v/src/litex/litex_serial.c
reason:
We hope to remove all instances of spin_lock_irqsave(NULL).

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-11 00:52:20 +08:00
hujun5
7e5088f4ea cxd56_rtc.c: use small lock in arch/arm/src/cxd56xx/cxd56_rtc.c
reason:
We hope to remove all instances of spin_lock_irqsave(NULL).

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-10 21:59:17 +08:00
hujun5
ecab220c39 max32660_rtc: use small lock in arch/arm/src/max326xx/max32660/max32660_rtc.c
reason:
We hope to remove all instances of spin_lock_irqsave(NULL).

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-10 21:59:06 +08:00
simbit18
6b7722cfb4 build(CMAKE): fix pac sim elf ONLY in Linux platform
avoid SIM compilation post build issues on other platforms

same fix for build with make
https://github.com/apache/nuttx/pull/14800
2024-12-10 21:57:55 +08:00
hujun5
c8bdfb537e lc823450_dma: use small lock in arch/arm/src/lc823450/lc823450_dma.c
reason:
We hope to remove all instances of spin_lock_irqsave(NULL).

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-10 21:57:44 +08:00
hujun5
bae0b64da3 s32k3xx_serial: use small lock in arch/arm/src/s32k3xx/s32k3xx_serial.c
reason:
We hope to remove all instances of spin_lock_irqsave(NULL).

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-10 21:57:34 +08:00
simbit18
eec97064d7 fix nxstyle
Removed extra spaces from .h and .c files
2024-12-10 21:57:22 +08:00
Alan Carvalho de Assis
0164e09339 Doc: Fix kernel thread API
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-12-10 21:57:09 +08:00
Alan Carvalho de Assis
e268b2a5b9 Fix small typo in rp2040_adc.c 2024-12-10 21:57:09 +08:00
chao an
01e76ddcd9 limits/path: replace CONFIG_PATH_MAX to PATH_MAX to ensure consistency
replace CONFIG_PATH_MAX to PATH_MAX to ensure consistency

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-10 21:56:57 +08:00
wangjianyu3
7562aff615 fs/tmpfs: Skip any slash at the beginning of relpath
`tmpfs_stat()` fails when relpath start with slash.

Log

  Host
    $ adb -s 1234 pull /tmp/subdir
    adb: warning: skipping special file '/tmp/subdir/uname' (mode = 0o0)
    /tmp/subdir/: 0 files pulled. 1 file skipped.

  Device
    state_process_list (411): stat failed </tmp/subdir//uname> -1 22

Ref: https://github.com/apache/nuttx/blame/master/libs/libc/stdlib/lib_realpath.c#L111
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-09 21:20:20 +08:00
hujun5
16b63ed837 armv7/8m: fix regresion from https://github.com/apache/nuttx/pull/14881
reason:
svc call may trigger hardfault

Background
    The origin of this issue is our desire to eliminate the function of storing
"regs" in g_current_regs and instead utilize (*running_task)->xcp.regs for storage.
The benefits of this approach include faster storage speed and
avoiding multiple accesses to g_current_regs during context switching,
thus ensuring that whether returning from an interrupt or an exception,
we consistently use this_task()->xcp.regs

Issue Encountered
    However, when storing registers, we must ensure that (running_task)->xcp.regs is invalid
so that it can be safely overwritten.
According to the existing logic, the only scenario where (running_task)->xcp.regs
is valid is during restore_context. We must accurately identify this scenario.
Initially, we used the condition (running_task)==NULL for this purpose, but we deemed
this approach unsatisfactory as it did not align well with the actual logic.
(running_task) should not be NULL. Consequently, we adopted other arch-specific methods for judgment,
but due to special logic in some arch, the judgment was not accurate, leading to this issue.

Solution:
    For armv6-m, we haven't found a more suitable solution, so we are sticking with (*running_task)==NULL.
    For armv7-m/armv8-m, by removing support for primask, we can achieve accurate judgment.

    PRIMASK is a design in armv6-m, that's why arm introduce BASEPRI from armv7-m.
It's wrong to provide this option for armv7-m/armv8-m arch.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-09 21:20:06 +08:00
hujun5
702affa63b armv6m: fix regresion from https://github.com/apache/nuttx/pull/14881
reason:
svc call may trigger hardfalt

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-09 21:20:06 +08:00
Alin Jerpelea
d368c0cc04 arch/arm: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-06 22:31:35 +08:00
lipengfei28
aa1df4e9a9 pci: fix pci dev alloc bridge mem error
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-12-06 21:12:24 +08:00
wangmingrong1
6e3f8d0356 virtio: fix compile error
CC:  virtio/virtio-mmio.c virtio/virtio-mmio.c: In function 'virtio_mmio_config_virtqueue':
virtio/virtio-mmio.c:346:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  346 |       addr = (uint64_t)kasan_reset_tag((FAR void *)vq->vq_ring.desc);
      |              ^
virtio/virtio-mmio.c:350:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  350 |       addr = (uint64_t)kasan_reset_tag((FAR void *)vq->vq_ring.avail);
      |              ^
virtio/virtio-mmio.c:354:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  354 |       addr = (uint64_t)kasan_reset_tag((FAR void *)vq->vq_ring.used)

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-06 20:32:21 +08:00
wangjianyu3
0481533833 boards: Update configs about system/usbmsc
The Kconfig of system/usbmsc has updated to support setting paths that bind to LUN at runtime.
More details: https://github.com/apache/nuttx-apps/pull/2876

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-06 13:38:23 +08:00
Andreea Luca
e6a01a0167 Integrated feedback
Integrated feedback: refreshed mqttc defconfig file.
2024-12-06 10:59:17 +08:00
Andreea Luca
666d55a8f4 Add configs for esp-sparrow-kit
Add configs for esp-sparrow-kit, to ease enabling wifi
and mqttc applications
2024-12-06 10:59:17 +08:00
hujun5
1e49cb4828 armv7-a/armv7-r/armv8-r: percpu reg store this_task
This is continue work of https://github.com/apache/nuttx/pull/13726

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.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-06 09:27:33 +08:00
Alin Jerpelea
344968b8c2 arch/arm: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-06 09:25:23 +08:00
Anner J. Bonilla
497c9b9309 Update cdc.h typo
Fixed typo
2024-12-06 09:23:55 +08:00
xuxin19
f2b4ab283f cmake(bugfix):fix CMake build break on MacOS
report by https://github.com/apache/nuttx/issues/14936

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-12-05 23:36:16 +08:00
Xiang Xiao
60fb917eda Remove FAR from 32/64bit arch
since these arch doesn't distinguish between near and far pointers

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-12-05 22:55:39 +08:00
hujun5
cbd07a86c9 s32k1xx_serial: arch/arm/src/s32k1xx/s32k1xx_serial.c
reason:
We hope to remove all instances of spin_lock_irqsave(NULL).

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-05 22:16:45 +08:00
cuiziwei
ae5c7a7fd8 libcxxabi: Soft link the libcxxabi header file to nuttx/include.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-12-05 21:56:23 +08:00
wangmingrong1
75fc19d729 virtio: Fix the problem of incorrect setting of virtio queue address under tags kasan
There is also a printing error due to https://github.com/apache/nuttx/pull/15043:
Configuration/Tool: rv-virt/virt_nsh
In file included from virtio/virtio-mmio.c:29:
virtio/virtio-mmio.c: In function 'virtio_mmio_init_device':
Error: virtio/virtio-mmio.c:826:14: error: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  826 |       vrterr("Version %d not supported!\n", vdev->id.version);
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~
      |                                                     |
      |                                                     uint32_t {aka long unsigned int}
virtio/virtio-mmio.c:826:24: note: format string is defined here
  826 |       vrterr("Version %d not supported!\n", vdev->id.version);
      |                       ~^
      |                        |
      |                        int
      |                       %ld
cc1: all warnings being treated as errors
make[1]: *** [Makefile:109: virtio-mmio.o] Error 1
make[1]: Target 'libdrivers.a' not remade because of errors.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-05 21:23:30 +08:00
hujun5
1ab1dbc0f0 wm8776: use small lock in drivers/audio/wm8776.c
reason:
We hope to remove all instances of spin_lock_irqsave(NULL).

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-05 21:22:32 +08:00
buxiasen
617fee66ff Revert "arm/rp2040: use custom vectors to make smp_call work with exception_common"
This reverts commit 9464afe7c3.
2024-12-05 20:42:22 +08:00
buxiasen
108aaf8bbb Revert "arm/lc823450: use custom vectors to make smp_call work with exception_common"
This reverts commit c2cb58ff31.
2024-12-05 20:42:22 +08:00
buxiasen
9473cee85b Revert "arm/cxd56: use chip specific vectors to allow smpcall update regs"
This reverts commit 4a1afab88e.
2024-12-05 20:42:22 +08:00
buxiasen
af3c159cff arm-v6/7/8m: sigaction forward to pendsv
For exception directly, tcb->xcp.regs should not be used.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-12-05 20:42:22 +08:00
buxiasen
55822753be arm-v6/7/8m: sigaction should use running_task
Nested irq possible cause readytorun not match with regs

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-12-05 20:42:22 +08:00
wangmingrong1
909bf2dbb4 kasan/globals: fix compile error
../../../mm/kasan/global.c:58:44: error: type of 'g_global_region' does not match original declaration [-Werror=lto-type-mismatch]
   58 | extern const struct kasan_global_region_s *g_global_region[];
      |                                            ^
kasan_globals.tmp:3:21: note: 'g_global_region' was previously declared here
    3 | const unsigned long g_global_region[] = {
      |                     ^
lto1: all warnings being treated as errors

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-05 20:37:47 +08:00
wangmingrong1
e2729f58d4 arm64/qemu: Enable lto compilation by default
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-05 20:36:37 +08:00
wangmingrong1
ee20aa888b kasan/lto: Turn off lto by default anyway
Of course, there is an error here, that is, the conditional judgment of
  ifeq ($(CONFIG_LTO_NONE),n)
    CFLAGS += -fno-lto
  endif
 is wrong, it should be judged as "ifneq ($(CONFIG_LTO_NONE),)"

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-05 20:36:37 +08:00
Ville Juven
fed3da9f03 mm_grantable.c: Fix infinite loop due to memory fragmentation
The search algorithm does not work with the ctz approach at all, if there
is a free range of granules that does not fit a specific allocation (i.e.
the granule allocation is fragmented) it will cause an infinite loop as
the algorithm will try to find free space from the same (free) starting
granule, causing an infinite loop.

The clz approach works for all cases, it will find the last used granule
and the search will continue from the next free granule.

Also, offsetting a full GAT must be sizeof(gat[0] - 1), which is 31 in
this case. The reason is that the upper level search function increments
the value by +1.
2024-12-05 20:36:04 +08:00
chenxiaoyi
f313ee5715 xtensa: inline up_switch_context
Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-05 20:32:45 +08:00
zhangyuan29
060fda032b drivers/net: change netdev_lower_quota_load to macro.
Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-12-05 13:26:22 +08:00
wangmingrong1
79758c5150 arm64/lto: Fix link error after opening lto
CPP:  /mnt/vela/github/NX/nuttx/boards/arm64/qemu/qemu-armv8a/scripts/dramboot.ld-> /mnt/vela/github/NX/nutLD: nuttx
Please update the link script, section ['.kasan.global'] cannot be found
`.eh_frame' referenced in section `.text.frame_dummy' of /mnt/vela/github/Toolchains/arm64-gcc-13/bin/../lib/gcc/aarch64-none-elf/13.2.1/crtbegin.o: defined in discarded section `.eh_frame' of /mnt/vela/github/Toolchains/arm64-gcc-13/bin/../lib/gcc/aarch64-none-elf/13.2.1/crtbegin.o
`.eh_frame' referenced in section `.text.frame_dummy' of /mnt/vela/github/Toolchains/arm64-gcc-13/bin/../lib/gcc/aarch64-none-elf/13.2.1/crtbegin.o: defined in discarded section `.eh_frame' of /mnt/vela/github/Toolchains/arm64-gcc-13/bin/../lib/gcc/aarch64-none-elf/13.2.1/crtbegin.o
Memory region         Used Size  Region Size  %age Used

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-05 13:23:59 +08:00
wangmingrong1
fe5ee0c6ac arm64/toolchain: Fix toolchain judgment after opening lto
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-05 13:23:13 +08:00
hujun5
3e3701b272 riscv: Some judgments are missing
This commit fixes the regression from https://github.com/apache/nuttx/pull/14984

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-05 00:07:38 +08:00
zhangyuan29
1dc1e65202 arch/xtensa: use arch atomic when enable iram heap
S32C1I instructions may target cached, cache-bypass,
and data RAM memory locations. S32C1I instructions
are not permitted to access memory addresses in data ROM,
instruction memory or the address region allocated to
the XLMI port. Attempts to direct the S32C1I at these
addresses will cause an exception.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-12-05 00:05:15 +08:00
hujun5
dabf589940 remove redundant judgments *running_task != NULL
reason:
In irq, g_running_tasks is always valid.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-04 22:50:08 +08:00
wangmingrong1
cc88063646 debug symbol level: Use config instead
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-04 22:36:45 +08:00