inochisa commented on code in PR #12178:
URL: https://github.com/apache/nuttx/pull/12178#discussion_r1581998798
##########
arch/risc-v/src/common/riscv_internal.h:
##########
@@ -294,6 +294,18 @@ int riscv_check_pmp_access(uintptr_t attr, uintptr_t base,
uintptr_t size);
int riscv_configured_pmp_regions(void);
int riscv_next_free_pmp_region(void);
+/* RISC-V Memorymap Config **************************************************/
+
+static inline void riscv_set_basestack(uintptr_t base, uintptr_t size)
+{
+ unsigned int i;
+
+ for (i = 0; i < CONFIG_SMP_NCPUS; i++)
+ {
+ g_cpux_idlestack[i] = (const uint8_t *)(base + size * i);
Review Comment:
I agree, initializing this array statically does have benefits. The only
problem is how to achieve it.The only way I find at now is just generating
`g_cpux_idlestack` based on the `CONFIG_SMP_NCPUS` . Could you have some better
idea?
--
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]