This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The changes in this PR will not take effect until the next PR, which will switch `build.yml` to use the rules in this PR.
In this PR, we refactor the CI Build Rules into a separate Reusable Workflow `arch.yml`. The original rules were migrated to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
New and Updated Rules:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
At line 236, we may set the null terminate to the priv->buffer,
when flushing the priv->buffer, we should use up_putc() instead up_nputs()
to ensure all the data has been output, because up_nputs() will check
the null terminate but up_putc() not.
Signed-off-by: yuanyongjian <yuanyongjian@xiaomi.com>
misc/rpmsgblk.c:616:29: warning: implicit declaration of function ‘rpmsg_virtio_get_buffer_size’; did you mean ‘rpmsg_get_rx_buffer_size’? [-Wimplicit-function-declaration]
616 | if (MAX(msglen, rsplen) > rpmsg_virtio_get_buffer_size(priv->ept.rdev))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| rpmsg_get_rx_buffer_size
Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
1. Kconfig - Removed USART1 config option from STM32_STM32G47XX. Not necessary to adding LPUART functionality. 2. stm32_lowput.c - Added extra check from STM32G4 board because that is the only with LPUART functionality. 2. stm32_serial.c - Removed unneeded function (stm32_serial_get_lpuart). Fixed up_putc return bug. Added configuration for DMAMAP_LPUART RX and TX for STM32G4XXX only. The G4 is the only in this family with LPUART and uses a DMAMUX unlike the others.
1. Removed 1WIRE LPUART refereences in Kconfig and stm32_uart.h. There is no support for LPUART currently in stm32_1wire.c. 2. Removed references to LPUART under DMA_V2 ifdefs. STM32G4 uses DMA_V1, and I saw that none of the chips DMA_V2 (F20, F4) have LPUARTs. AFAIK the only chip in the stm32 folder that has LPUART peripherals is the STM32G4.
Removed unnecessary brackets and empty lines
Added lpuartnsh (LPUART NuttShell) config to the nucleo-g474re board configurations. nsh uses USART3 by default. lpuartnsh uses nsh as a template, changes the serial console to LPUART1, and adds the DMA configs to enable DMA for the LPUART.
Added support for using the lpuart prescaler register. Without prescaling the apbclock, 9600 baud is not supported on the G474RE. By utilizing the prescaler, when necessary, we can support nearly any baud rate (300 baud to 30M Mbaud). lowputc defaults to a prescaler of 16 for the lpuart so standard baud rates (9600 to 115200) are supported early in the boot process. Later in stm32_serial.c the ideal prescaler and BRR values are determined.
Added ifdef statements for LPUART code sections not compatible with other chips.
Changed LPUART BRR calcuation to use 64-bit integers.
Feedback from nuttx pull request. Added brackets around single line if/else statements. Reordered lpuartnsh defconfig file.
Fix lpuart brr calculation after attempting to break the calculation into 2 lines.
Removed TAB
reason:
In the kernel, we are planning to remove all occurrences of up_cpu_pause as one of the steps to
simplify the implementation of critical sections. The goal is to enable spin_lock_irqsave to encapsulate critical sections,
thereby facilitating the replacement of critical sections(big lock) with smaller spin_lock_irqsave(small lock)
Signed-off-by: hujun5 <hujun5@xiaomi.com>
1. Use the virtqueue_xxx_lock() api;
2. Add spinlock for some virtio and vhost drivers that do not
use spinlock to protect the virtqueues;
Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
the virtqueue should be protected by the spinlock, because the virtqueues are used
both in worker and interrupt.
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
For remoteproc transport layer, the virtio drivers can not use the malloced
memory from the default system heap to communicate with the virtio devices,
the buffers placed in virtqueue should be in the share memory region
(mallcoed virtio_alloc_buf()).
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
By setting config CONFIG_DRIVERS_VIRTIO_SERIAL_NAME to "ttyXX0;ttyXX1;..."
to customize the virtio serial name.
For example:
If CONFIG_DRIVERS_VIRTIO_SERIAL_NAME="ttyBT;ttyTest0;ttyTest1",
virtio-serial will register three uart devices with names:
"/dev/ttyBT", "/dev/ttyTest0", "/dev/ttyTest1" to the VFS.
nsh> ls dev
/dev:
console
null
telnet
ttyBT
ttyS0
ttyTest0
ttyTest1
zero
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
In secure state, call virtio_register_mmio_device_secure() to
register the secure virtio mmio device;
In non-secure state, call virtio_register_mmio_device() to
register the non-secure virtio mmio device;
Board should ensure not mixed use the secure and non-seucre mmio
device.
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Summary:
Fixed the problem of releasing the bucket prematurely in multi-threaded flock scenarios.
A thread setlk
B thread setlk_wait
A thread releases lock but fails to determine if nwaiter causes the bucket to be released prematurely
post B thread causes crash due to heap use after free
https://github.com/apache/nuttx/issues/13821
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>