Skip to content

Commit

Permalink
arm64: Stop trashing x28 in savectx
Browse files Browse the repository at this point in the history
While here make it return void, we don't set any useful return value
and nothing checks for it.

Sponsored by:	Arm Ltd
  • Loading branch information
zxombie committed Oct 15, 2024
1 parent e51ed89 commit a7c5c88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions sys/arm64/arm64/swtch.S
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,12 @@ ENTRY(savectx)
mrs x6, tpidr_el0
stp x5, x6, [x0, #PCB_SP]

/* Store the VFP registers */
#ifdef VFP
mov x28, lr
bl vfp_save_state_savectx
mov lr, x28
#endif

/* Store the VFP registers */
b vfp_save_state_savectx
#else
ret
#endif
END(savectx)

GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL)
2 changes: 1 addition & 1 deletion sys/arm64/include/pcb.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct pcb {

#ifdef _KERNEL
void makectx(struct trapframe *tf, struct pcb *pcb);
int savectx(struct pcb *pcb) __returns_twice;
void savectx(struct pcb *pcb) __returns_twice;
#endif

#endif /* !LOCORE */
Expand Down

0 comments on commit a7c5c88

Please sign in to comment.