diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -54,6 +54,13 @@ #include +/* + * 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. * Copy and update the pcb, set up the stack so that the child @@ -123,7 +130,7 @@ cpu_reset(void) { - psci_reset(); + cpu_reset_hook(); printf("cpu_reset failed"); while(1) diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h --- a/sys/arm64/include/cpu.h +++ b/sys/arm64/include/cpu.h @@ -206,6 +206,9 @@ struct arm64_addr_mask; extern struct arm64_addr_mask elf64_addr_mask; +typedef void (*cpu_reset_hook_t)(void); +extern cpu_reset_hook_t cpu_reset_hook; + void cpu_halt(void) __dead2; void cpu_reset(void) __dead2; void fork_trampoline(void);