arm64: Save/restore TPIDR_EL0 in _arch_context_swap

It's not used for anything by the OS but userspace might want
to use it for its own purposes.

Change-Id: Icda4bcd6de9d68596555e81293c8bd075f80a2a4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7511
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
milek7 2024-03-07 15:12:46 +01:00 committed by waddlesplash
parent ea989da7f1
commit 51edf9322c
2 changed files with 5 additions and 3 deletions

View File

@ -18,7 +18,7 @@ struct iframe_stack {
struct arch_thread {
uint64 regs[13]; // x19-x30, sp
uint64 regs[14]; // x19-x30, sp, tpidr_el0
uint64 fp_regs[8]; // d8-d15
// used to track interrupts on this thread

View File

@ -253,7 +253,8 @@ FUNCTION(_arch_context_swap):
stp x29, x30, [x0], #16
mov x2, sp
str x2, [x0], #8
mrs x3, TPIDR_EL0
stp x2, x3, [x0], #16
stp d8, d9, [x0], #16
stp d10, d11, [x0], #16
@ -268,8 +269,9 @@ FUNCTION(_arch_context_swap):
ldp x27, x28, [x1], #16
ldp x29, x30, [x1], #16
ldr x2, [x1], #8
ldp x2, x3, [x1], #16
mov sp, x2
msr TPIDR_EL0, x3
ldp d8, d9, [x1], #16
ldp d10, d11, [x1], #16