Skip to content

Commit

Permalink
arch/arm64/src/common: Remove void * arithmetic
Browse files Browse the repository at this point in the history
Signed-off-by: Jukka Laitinen <[email protected]>
  • Loading branch information
jlaitine committed Mar 21, 2024
1 parent ca5230d commit a74c09c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions arch/arm64/src/common/arm64_copystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
int arch_save_fpucontext(void *saveregs)
{
irqstate_t flags;
uint64_t *p_save;
uintptr_t p_save;

/* Take a snapshot of the thread context right now */

flags = enter_critical_section();

p_save = saveregs + XCPTCONTEXT_GP_SIZE;
p_save = (uintptr_t)saveregs + XCPTCONTEXT_GP_SIZE;
arm64_fpu_save((struct fpu_reg *)p_save);
ARM64_DSB();

Expand Down
6 changes: 4 additions & 2 deletions arch/arm64/src/common/arm64_fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,10 @@ void arm64_fpu_disable(void)

bool up_fpucmp(const void *saveregs1, const void *saveregs2)
{
const uint64_t *regs1 = saveregs1 + XCPTCONTEXT_GP_SIZE;
const uint64_t *regs2 = saveregs2 + XCPTCONTEXT_GP_SIZE;
const uint64_t *regs1 = (uint64_t *)((uintptr_t)saveregs1 +
XCPTCONTEXT_GP_SIZE);
const uint64_t *regs2 = (uint64_t *)((uintptr_t)saveregs2 +
XCPTCONTEXT_GP_SIZE);

/* Only compare callee-saved registers, caller-saved registers do not
* need to be preserved.
Expand Down
4 changes: 2 additions & 2 deletions arch/arm64/src/common/arm64_initialstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

void arm64_new_task(struct tcb_s * tcb)
{
char *stack_ptr = tcb->stack_base_ptr + tcb->adj_stack_size;
uint64_t stack_ptr = (uintptr_t)tcb->stack_base_ptr + tcb->adj_stack_size;
struct regs_context *pinitctx;

#ifdef CONFIG_ARCH_FPU
Expand All @@ -67,7 +67,7 @@ void arm64_new_task(struct tcb_s * tcb)
/* set fpu context */

arm64_init_fpu(tcb);
stack_ptr = (char *)pfpuctx;
stack_ptr = (uintptr_t)pfpuctx;
#endif

pinitctx = STACK_PTR_TO_FRAME(struct regs_context, stack_ptr);
Expand Down

0 comments on commit a74c09c

Please sign in to comment.