pussuw commented on code in PR #15081:
URL: https://github.com/apache/nuttx/pull/15081#discussion_r1877656774
##########
arch/risc-v/include/arch.h:
##########
@@ -108,6 +208,31 @@ typedef struct arch_addrenv_s arch_addrenv_t;
#endif /* __ASSEMBLY__ */
#endif /* CONFIG_ARCH_ADDRENV */
+#ifndef __ASSEMBLY__
+
+/* Per CPU save area. Access to this structure can be gained via the scratch
+ * ([m/s]scratch) register. Prior to this, every CPU that
+ * wishes to access this information must call riscv_percpu_add_hart() which
+ * will set up [m/s]scratch to point to the CPUs own area
+ */
+
+union riscv_percpu_s
+{
+ union riscv_percpu_s *next; /* For sl list linkage */
+ struct
+ {
+ struct tcb_s *tcb; /* Current thread TCB */
+ uintreg_t hartid; /* Hart ID */
+ uintreg_t irq_stack; /* Interrupt stack */
+ uintreg_t usp; /* Area to store user sp */
+ uintreg_t ksp; /* Area to load kernel sp */
+ };
+};
+
+typedef union riscv_percpu_s riscv_percpu_t;
Review Comment:
arch_percpu_t
--
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]