|
AquilaOS documentation
How it works, and its code
|
aarch64: fork()'s child thread, which returns to user mode as its parent does, from a copy of its parent's saved registers at the top of its own kernel stack. More...
#include <core/system.h>#include <core/string.h>#include <core/arch.h>#include <sys/proc.h>#include <sys/sched.h>#include <aquila/errno.h>Go to the source code of this file.
Functions | |
| struct aarch64_thread * | aarch64_thread_new (void) |
| Makes a thread's aarch64 state, with its kernel stack. | |
| int | arch_proc_fork (struct thread *thread, struct proc *fork) |
| Sets up the CPU state of a fork() child's thread: a copy of the parent's kernel stack, registers and FPU state, so that the child returns from fork() as its parent does. | |
aarch64: fork()'s child thread, which returns to user mode as its parent does, from a copy of its parent's saved registers at the top of its own kernel stack.
Definition in file fork.c.
| struct aarch64_thread * aarch64_thread_new | ( | void | ) |
Makes a thread's aarch64 state, with its kernel stack.
Definition at line 30 of file thread.c.
References aarch64_thread_new(), KERN_STACK_SIZE, kfree(), kmalloc(), aarch64_thread::kstack, aarch64_thread::kstack_base, M_ZERO, and NULL.
Referenced by aarch64_thread_new(), arch_kthread_create(), arch_proc_fork(), arch_proc_init(), and arch_thread_create().
Sets up the CPU state of a fork() child's thread: a copy of the parent's kernel stack, registers and FPU state, so that the child returns from fork() as its parent does.
| thread | the thread that called fork() |
| fork | the child process, whose one thread gets the state |
Definition at line 21 of file fork.c.
References aarch64_fpsimd_fork(), aarch64_thread_new(), thread::arch, arch_proc_fork(), aarch64_thread::ctx, aarch64_ctx::fp, queue::head, kfree(), aarch64_thread::kstack, aarch64_thread::kstack_base, aarch64_ctx::lr, aarch64_thread::regs, aarch64_ctx::sp, proc::threads, and qnode::value.
Referenced by arch_proc_fork(), and proc_fork().