diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2024-04-15 12:01:47 +0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2024-04-16 09:45:29 +0900 |
commit | db8dacb578b687574ba900298a4159c887dd18d0 (patch) | |
tree | f1328efabf6bd05977991f02c5ec49dc1382d00b /kern/ipc_mig.h | |
parent | cf8afe49af2c7c77dfc6701da70d6700f7e6f1b5 (diff) | |
download | gnumach-db8dacb578b687574ba900298a4159c887dd18d0.tar.gz gnumach-db8dacb578b687574ba900298a4159c887dd18d0.tar.bz2 gnumach-db8dacb578b687574ba900298a4159c887dd18d0.zip |
aarch64: Add thread state types
Notes:
* TPIDR_EL0, the TLS pointer, is included in the generic state directly.
* TPIDR2_EL0, part of the SME extension, is not included in the generic
state. If we add SME support, it will be a part of something like
aarch64_sme_state.
* CPSR is not a real register in AArch64 (unlike in AArch32), but a
collection of individually accessible bits and pieces from PSTATE.
Due to how the kernel accesses user mode's PSTATE (via SPSR), it's
convenient to represent PSTATE as a pseudo-register in the same
format as SPSR. This is also what QEMU and XNU do.
* There is no hardware-enforced 'natural' order to place the registers
in, since no registers get pushed onto the stack on exception entry.
Saving and restoring registers from an instance of struct
aarch64_thread_state is implemented entirely in software, and the
format is essentially arbitrary.
* aarch64_float_state includes registers of a 128-bit type; this may
create issues for compilers other than GCC.
* fp_reserved is not a register, but a placeholder. If and when Arm
adds another floating-point meta-register, this will be changed to
represent it, and that would not be considered a compatibility break,
so don't access fp_reserved by name, or its value, from userland.
Instead, memset the whole structure to 0 if starting from scratch, or
memcpy an existing structure.
More thread state types could be added in the future, such as
aarch64_debug_state, aarch64_virt_state (for hardware-accelerated
virtualization), potentially ones for PAC, SVE/SME, etc.
Message-ID: <20240415090149.38358-8-bugaevc@gmail.com>
Diffstat (limited to 'kern/ipc_mig.h')
0 files changed, 0 insertions, 0 deletions