pussuw opened a new pull request, #15652: URL: https://github.com/apache/nuttx/pull/15652
## Summary Restore kernel tp when an exception is taken, restore user tp when exception returns. Store kernel tp in CPU scratch register when running user code. This removes the need to call nxsched_self upon exception return. Later with a bit of added logic, it is possible to use tp in kernel to store and read the current tcb (read note). ## Impact - Tiny optimization for exception return. - Affects targets that have CONFIG_SYSCALL=y (kernel mode builds). - Other targets are unaffected. ## Testing rv-virt:knsh64 + ostest Note: setting tp in riscv_restorecontext is too late for this, as this_task() points to the (next) ready-to-run task, thus tp should be updated when the rtr list is updated (via up_update_task, which does not exist for risc-v yet) -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org