mirror of
https://github.com/apache/nuttx.git
synced 2025-12-09 03:33:51 +08:00
RISC-V: Fix usage of static_assert in riscv_percpu.c
There is no alias for struct riscv_percu_s
This commit is contained in:
@@ -40,7 +40,8 @@
|
||||
|
||||
#define HART_CNT (CONFIG_ARCH_CPU_COUNT)
|
||||
|
||||
static_assert(RISCV_PERCPU_HARTID_OFFSET == offsetof(riscv_percpu_s, hartid),
|
||||
static_assert(RISCV_PERCPU_HARTID_OFFSET ==
|
||||
offsetof(struct riscv_percpu_s, hartid),
|
||||
"RISCV_PERCPU_HARTID_OFFSET with a wrong value");
|
||||
|
||||
/****************************************************************************
|
||||
@@ -115,7 +116,7 @@ uintptr_t riscv_percpu_get_hartid(void)
|
||||
uintptr_t scratch = READ_CSR(CSR_SCRATCH);
|
||||
|
||||
DEBUGASSERT(scratch >= (uintptr_t) &g_percpu &&
|
||||
scratch < (uintptr_t) &g_percpu + sizeof(g_percpu));
|
||||
scratch < (uintptr_t) &g_percpu + sizeof(g_percpu));
|
||||
|
||||
return ((struct riscv_percpu_s *)scratch)->hartid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user