Page MenuHomeFreeBSD

D44535.1775289348.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D44535.1775289348.diff

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 <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.
* 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);

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 4, 7:55 AM (1 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28254281
Default Alt Text
D44535.1775289348.diff (1 KB)

Event Timeline