hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/kernel/reboot.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/kernel/reboot.c
34 *
....@@ -25,13 +26,15 @@
2526 struct pid *cad_pid;
2627 EXPORT_SYMBOL(cad_pid);
2728
28
-#if defined(CONFIG_ARM) || defined(CONFIG_UNICORE32)
29
+#if defined(CONFIG_ARM)
2930 #define DEFAULT_REBOOT_MODE = REBOOT_HARD
3031 #else
3132 #define DEFAULT_REBOOT_MODE
3233 #endif
3334 enum reboot_mode reboot_mode DEFAULT_REBOOT_MODE;
35
+EXPORT_SYMBOL_GPL(reboot_mode);
3436 enum reboot_mode panic_reboot_mode = REBOOT_UNDEFINED;
37
+EXPORT_SYMBOL_GPL(panic_reboot_mode);
3538
3639 /*
3740 * This variable is used privately to keep track of whether or not
....@@ -50,6 +53,7 @@
5053 */
5154
5255 void (*pm_power_off_prepare)(void);
56
+EXPORT_SYMBOL_GPL(pm_power_off_prepare);
5357
5458 /**
5559 * emergency_restart - reboot the system
....@@ -213,6 +217,7 @@
213217 atomic_notifier_call_chain(&restart_handler_list, reboot_mode, cmd);
214218 }
215219
220
+#ifdef CONFIG_NO_GKI
216221 static ATOMIC_NOTIFIER_HEAD(pre_restart_handler_list);
217222
218223 int register_pre_restart_handler(struct notifier_block *nb)
....@@ -231,6 +236,7 @@
231236 {
232237 atomic_notifier_call_chain(&pre_restart_handler_list, reboot_mode, cmd);
233238 }
239
+#endif
234240
235241 void migrate_to_reboot_cpu(void)
236242 {
....@@ -267,7 +273,7 @@
267273 pr_emerg("Restarting system\n");
268274 else
269275 pr_emerg("Restarting system with command '%s'\n", cmd);
270
- kmsg_dump(KMSG_DUMP_RESTART);
276
+ kmsg_dump(KMSG_DUMP_SHUTDOWN);
271277 machine_restart(cmd);
272278 }
273279 EXPORT_SYMBOL_GPL(kernel_restart);
....@@ -291,7 +297,7 @@
291297 migrate_to_reboot_cpu();
292298 syscore_shutdown();
293299 pr_emerg("System halted\n");
294
- kmsg_dump(KMSG_DUMP_HALT);
300
+ kmsg_dump(KMSG_DUMP_SHUTDOWN);
295301 machine_halt();
296302 }
297303 EXPORT_SYMBOL_GPL(kernel_halt);
....@@ -309,7 +315,7 @@
309315 migrate_to_reboot_cpu();
310316 syscore_shutdown();
311317 pr_emerg("Power down\n");
312
- kmsg_dump(KMSG_DUMP_POWEROFF);
318
+ kmsg_dump(KMSG_DUMP_SHUTDOWN);
313319 machine_power_off();
314320 }
315321 EXPORT_SYMBOL_GPL(kernel_power_off);