Fix-Point opened a new pull request, #17971:
URL: https://github.com/apache/nuttx/pull/17971
## Summary
This pull request consists of five commits addressing distinct issues and
improvements across the NuttX codebase:
1. **Architecture Fix (Intel64):** Fixes a potential integer overflow in
the frequency calculation.
2. **Data Structure modification (Linked List):** Restructures the generic
linked list implementation to resolve header inclusion conflicts and optimize
memory layout.
* Splits the `struct list_node` type definition into a new header file
(`list_type.h`) to prevent conflicts when the same structure name is used
elsewhere (e.g., in `wdog.h` and `wqueue.h`).
* Optimizes the `struct list_node` by placing the `next` pointer
before the `prev` pointer. This can improve performance on some architectures
due to more sequential access patterns during common traversal operations.
3. **Kernel Feature (Work Queues):** Adds configuration options to place
High-Priority (HPWORK) and Low-Priority (LPWORK) kernel worker thread stacks
into user-specified memory sections.
* New Kconfig options `SCHED_HPWORKSTACKSECTION` and
`SCHED_LPWORKSTACKSECTION` allow defining a custom section (e.g., in fast SRAM).
* Build system updates (`CMakeLists.txt`, `Make.defs`) pass the
configuration to the compiler.
* Code in `kwork_thread.c` allocates the stack arrays in the
configured section.
* Fixes a bug in `work_thread_create()` where passing a `NULL` value
for the `stack_addr` parameter would lead to incorrect stack pointer
calculation and potential crashes during thread creation for multi-thread work
queues. The fix ensures the stack pointer is only offset from the base address
when `stack_addr` is not `NULL`.
## Impact
Modifications to lists may slightly improve performance on some platforms
and separating `list_type.h` allows us to avoid conflicts with the user-space
list.h.
## Testing
Tested on `rv-virt:smp`, `ostest` passed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]