no1wudi commented on code in PR #15081: URL: https://github.com/apache/nuttx/pull/15081#discussion_r1875588872
########## arch/risc-v/include/irq.h: ########## @@ -703,6 +703,17 @@ irqstate_t up_irq_enable(void); int up_cpu_index(void) noinstrument_function; #endif /* CONFIG_ARCH_HAVE_MULTICPU */ +/**************************************************************************** + * Schedule acceleration macros + ****************************************************************************/ + +#ifdef CONFIG_RISCV_PERCPU_SCRATCH +#define up_current_regs() (this_task()->xcp.regs) +#define up_this_task() (*((struct tcb_s **)READ_CSR(CSR_SCRATCH))) Review Comment: I haven't done a formal test yet. In theory, ```c #define up_this_task() (*((struct tcb_s **)READ_CSR(CSR_SCRATCH))) ``` should be more faster than: https://github.com/apache/nuttx/blob/0e1b432dd068880d353ae91c01e610f85b4a16ea/sched/sched/sched.h#L367-L387 (It would be faster in an SMP scenario) -- 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]
