25MALLOC_DEFINE(M_FPSIMD,
"fpsimd",
"a thread's FP/SIMD registers");
28#define CPACR_FPEN_EL0_TRAP (1UL << 20)
29#define CPACR_FPEN_NONE (3UL << 20)
37#define fp_thread (curcpu()->arch.fp_thread)
160 if (state && arch->
fpsimd)
#define FPSIMD_STATE_SIZE
#define write_sysreg(r, v)
void * aarch64_fpsimd_current(struct thread *thread)
Returns a thread's FP/SIMD state as it is now, saving it from the registers first if they hold it.
void aarch64_fpsimd_drop(struct thread *thread)
Throws away a thread's FP/SIMD state, when it goes or execs a new program, and the registers' values ...
void aarch64_fpsimd_save(void *state)
void aarch64_fpsimd_switch(struct thread *thread)
Gets the registers ready for a thread that is about to run: its use of them traps,...
static void fpen(uint64_t v)
Sets CPACR_EL1.FPEN: whether user mode's use traps.
int aarch64_fpsimd_fork(struct thread *parent, struct aarch64_thread *child)
Gives a child of fork() a copy of its parent's FP/SIMD state, if the parent has one.
int aarch64_fpsimd_trap(void)
Handles the trap of user mode's use of the registers: they get the running thread's values,...
void aarch64_fpsimd_restore(struct thread *thread, const void *state)
Gives a thread back the FP/SIMD state that a signal frame kept, for sigreturn().
void aarch64_fpsimd_load(const void *state)
#define CPACR_FPEN_EL0_TRAP
#define MALLOC_DEFINE(type, _name, _desc)
void * kmalloc(size_t size, struct malloc_type *type, int flags)
Allocates memory for one of the kernel's structures.
void kfree(void *)
Frees an object that kmalloc() gave.
void * memset(void *dst, int c, size_t n)
Sets n bytes to c.
void * memcpy(void *dst, const void *src, size_t n)
Copies n bytes; dst and src must not overlap.
unsigned long long int uint64_t
A thread's aarch64 state (thread->arch).
void * arch
the architecture's own data: its registers, its kernel stack