arch/riscv/include: Cast 'id' to int in OTHER_HLS()
The 'id' in OTHER_HSL macro is non-typed, downflow would occur when ‘id’ is unsigned and less greater than hart_id. Cast it to int. Change-Id: I777337b7e374024aff6fb36de603b799b1a65371 Signed-off-by: Ziang Wang <wangziang.ok@bytedance.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/89338 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
This commit is contained in:
parent
67a3fb6abe
commit
c1e0384367
1 changed files with 2 additions and 1 deletions
|
|
@ -62,7 +62,8 @@ register uintptr_t current_stack_pointer asm("sp");
|
|||
|
||||
// hart-local storage, at top of stack
|
||||
#define HLS() ((struct hls *)(MACHINE_STACK_TOP() - HLS_SIZE))
|
||||
#define OTHER_HLS(id) ((struct hls *)((void *)HLS() + RISCV_PGSIZE * ((id) - HLS()->hart_id)))
|
||||
#define OTHER_HLS(id) \
|
||||
((struct hls *)((void *)HLS() + RISCV_PGSIZE * (((int)id) - HLS()->hart_id)))
|
||||
|
||||
#define MACHINE_STACK_SIZE RISCV_PGSIZE
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue