diff --git a/sys/arm64/arm64/vm_machdep.c b/arm64/arm64/vm_machdep.c --- a/sys/arm64/arm64/vm_machdep.c +++ b/arm64/arm64/vm_machdep.c @@ -57,6 +57,9 @@ #include + +void (*cpu_reset_hook)(void); + /* * Finish a fork operation, with process p2 nearly set up. * Copy and update the pcb, set up the stack so that the child @@ -119,7 +122,8 @@ cpu_reset(void) { - psci_reset(); + if (cpu_reset_hook != NULL) + cpu_reset_hook(); printf("cpu_reset failed"); while(1) diff --git a/sys/arm64/include/machdep.h b/arm64/include/machdep.h --- a/sys/arm64/include/machdep.h +++ b/arm64/include/machdep.h @@ -49,6 +49,7 @@ }; extern enum arm64_bus arm64_bus_method; +extern void (*cpu_reset_hook)(void); void dbg_init(void); bool has_hyp(void); diff --git a/sys/dev/psci/psci.c b/dev/psci/psci.c --- a/sys/dev/psci/psci.c +++ b/dev/psci/psci.c @@ -348,6 +348,10 @@ psci_softc = sc; +#ifdef __aarch64__ + cpu_reset_hook = psci_reset; +#endif + return (0); }