22MALLOC_DEFINE(M_AARCH64_THREAD,
"aarch64-thread",
"aarch64 thread structure");
124 arch->
ctx.
lr = entry;
void aarch64_jump_user(uintptr_t pc, uintptr_t sp, uintptr_t x0, uintptr_t x1, uintptr_t x2, uintptr_t kstack)
void aarch64_ctx_load(struct aarch64_ctx *ctx)
void aarch64_goto(uintptr_t fn, uintptr_t sp)
struct aarch64_thread * aarch64_thread_new(void)
Makes a thread's aarch64 state, with its kernel stack.
int arch_thread_create(struct thread *thread, uintptr_t stack, uintptr_t entry, uintptr_t uentry, uintptr_t arg)
Sets up a new user thread's CPU state and kernel stack, for pthread_create().
static void thread_spawn(void)
Runs a thread for the first time: lets go of the kernel lock, and drops to user mode.
void arch_kthread_create(struct thread *thread, uintptr_t entry)
Sets up a kernel thread's CPU state.
void arch_thread_switch(struct thread *thread)
Switches to a thread that has run before: its address space, its kernel stack, then where it stopped.
void arch_thread_kill(struct thread *thread)
Frees a thread's CPU state and kernel stack.
void arch_thread_spawn(struct thread *thread)
Runs a thread for the first time: switches to its address space and kernel stack, and starts 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,...
#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 kernel_unlock(void)
Lets go of the kernel lock, for the next CPU waiting for it.
struct pmap * pmap_switch(struct pmap *pmap)
Switches this CPU to an address space's page tables.
A thread's aarch64 state (thread->arch).
struct vm_space vm_space
its address space
void * arch
the architecture's own data: its registers, its kernel stack
struct proc * owner
its process
struct pmap * pmap
its page tables (the architecture's)