anchao commented on code in PR #18388:
URL: https://github.com/apache/nuttx/pull/18388#discussion_r2802100240
##########
sched/wqueue/kwork_thread.c:
##########
@@ -599,14 +606,21 @@ int work_start_lowpri(void)
sinfo("Starting low-priority kernel worker thread(s)\n");
#ifdef SCHED_LPWORKSTACKSECTION
- static uint8_t lp_work_stack[CONFIG_SCHED_LPNTHREADS]
- [CONFIG_SCHED_LPWORKSTACKSIZE]
+ /* Ensure each stack is properly aligned by rounding up the stack size.
+ * This is critical when CONFIG_SCHED_LPNTHREADS > 1 to ensure all
+ * thread stacks start at properly aligned addresses.
+ */
+
+#define LP_WORK_STACK_SIZE STACK_ALIGN_UP(CONFIG_SCHED_LPWORKSTACKSIZE)
Review Comment:
move define to `Pre-processor Definitions` section
##########
sched/wqueue/kwork_thread.c:
##########
Review Comment:
replace to LP_WORK_STACK_SIZE
--
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]