Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/vm_machdep.c
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
#ifdef VFP | #ifdef VFP | ||||
#include <machine/vfp.h> | #include <machine/vfp.h> | ||||
#endif | #endif | ||||
#include <dev/psci/psci.h> | #include <dev/psci/psci.h> | ||||
/* | /* | ||||
* psci.c is "default" in ARM64 kernel config files | |||||
* psci_reset will do nothing until/unless the psci device probes/attaches. | |||||
* Therefore, it is safe to default the cpu_reset_hook to psci_reset. | |||||
*/ | |||||
cpu_reset_hook_t cpu_reset_hook = psci_reset; | |||||
/* | |||||
* Finish a fork operation, with process p2 nearly set up. | * Finish a fork operation, with process p2 nearly set up. | ||||
* Copy and update the pcb, set up the stack so that the child | * Copy and update the pcb, set up the stack so that the child | ||||
* ready to run and return to user mode. | * ready to run and return to user mode. | ||||
*/ | */ | ||||
void | void | ||||
cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) | cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) | ||||
{ | { | ||||
struct pcb *pcb2; | struct pcb *pcb2; | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | #if defined(PERTHREAD_SSP) | ||||
arc4random_buf(&td2->td_md.md_canary, sizeof(td2->td_md.md_canary)); | arc4random_buf(&td2->td_md.md_canary, sizeof(td2->td_md.md_canary)); | ||||
#endif | #endif | ||||
} | } | ||||
void | void | ||||
cpu_reset(void) | cpu_reset(void) | ||||
{ | { | ||||
psci_reset(); | cpu_reset_hook(); | ||||
printf("cpu_reset failed"); | printf("cpu_reset failed"); | ||||
while(1) | while(1) | ||||
__asm volatile("wfi" ::: "memory"); | __asm volatile("wfi" ::: "memory"); | ||||
} | } | ||||
void | void | ||||
cpu_thread_swapin(struct thread *td) | cpu_thread_swapin(struct thread *td) | ||||
▲ Show 20 Lines • Show All 191 Lines • Show Last 20 Lines |