44#define FPSIMD_STATE_SIZE 528
60#define USER_STACK (0x0000800000000000UL)
61#define USER_STACK_BASE (USER_STACK - USER_STACK_SIZE)
65#define SIGCODE_ADDR (USER_STACK_BASE - 0x1000)
68#define KERN_STACK_SIZE (16384U)
73 asm volatile (
"msr daifclr, #2" :::
"memory");
79 asm volatile (
"msr daifset, #2" :::
"memory");
97#include_next <core/arch.h>
void aarch64_return_to_user(struct aarch64_regs *r, int syscall)
Takes the current thread's signals on its way back to user mode, and restarts or fails the system cal...
int aarch64_ctx_save(struct aarch64_ctx *ctx)
void aarch64_jump_user(uintptr_t pc, uintptr_t sp, uintptr_t x0, uintptr_t x1, uintptr_t x2, uintptr_t kstack)
void arch_syscall(struct aarch64_regs *r)
void aarch64_ctx_load(struct aarch64_ctx *ctx)
static void arch_interrupts_disable(void)
Masks IRQs.
void aarch64_goto(uintptr_t fn, uintptr_t sp)
static void arch_interrupts_enable(void)
Unmasks IRQs (DAIF.I).
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_switch(struct thread *thread)
Gets the registers ready for a thread that is about to run: its use of them 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().
#define MALLOC_DECLARE(type)
unsigned long long int uint64_t
Where a thread goes on in the kernel when it runs again: the registers that a function call keeps (AA...
What an exception saves on the kernel stack (cpu/vectors.S): the context it interrupted.
A thread's aarch64 state (thread->arch).
struct aarch64_regs * regs