Lines Matching +full:reboot +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/kernel/reboot.c
8 #define pr_fmt(fmt) "reboot: " fmt
15 #include <linux/reboot.h>
22 * this indicates whether you can reboot with ctrl-alt-del: the default is yes
39 * reboot_type is still set to its default value (i.e., reboot= hasn't
41 * suppress DMI scanning for reboot quirks. Without it, it's
42 * impossible to override a faulty reboot quirk without recompiling.
57 * emergency_restart - reboot the system
60 * reboot the system. This is called when we know we are in
61 * trouble so this is our best effort to reboot. This is
80 * register_reboot_notifier - Register function to be called at reboot time
84 * to be called at reboot time.
96 * unregister_reboot_notifier - Unregister previously registered reboot notifier
99 * Unregisters a previously registered reboot
102 * Returns zero on success, or %-ENOENT on failure.
123 return -ENOMEM; in devm_register_reboot_notifier()
144 * register_restart_handler - Register function to be called to reset
147 * @nb->priority: Handler priority. Handlers should follow the
163 * machine_restart function calls do_kernel_restart - see below
169 * Restart handlers are expected to be registered from non-architecture
188 * unregister_restart_handler - Unregister previously registered
194 * Returns zero on success, or %-ENOENT on failure.
203 * do_kernel_restart - Execute kernel restart handler call chain
225 /* Make certain the cpu I'm about to reboot on is online */ in migrate_to_reboot_cpu()
230 current->flags |= PF_NO_SETAFFINITY; in migrate_to_reboot_cpu()
237 * kernel_restart - reboot the system
241 * Shutdown everything and perform a clean reboot.
267 * kernel_halt - halt the system
283 * kernel_power_off - power_off the system
303 * Reboot system call: for obvious reasons only root may call it,
305 * so that some mistake won't make this reboot the whole machine.
306 * You can also set the meaning of the ctrl-alt-del-key here.
308 * reboot doesn't sync: do that yourself before calling this.
310 SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd, in SYSCALL_DEFINE4() argument
318 if (!ns_capable(pid_ns->user_ns, CAP_SYS_BOOT)) in SYSCALL_DEFINE4()
319 return -EPERM; in SYSCALL_DEFINE4()
327 return -EINVAL; in SYSCALL_DEFINE4()
369 ret = strncpy_from_user(&buffer[0], arg, sizeof(buffer) - 1); in SYSCALL_DEFINE4()
371 ret = -EFAULT; in SYSCALL_DEFINE4()
374 buffer[sizeof(buffer) - 1] = '\0'; in SYSCALL_DEFINE4()
392 ret = -EINVAL; in SYSCALL_DEFINE4()
405 * This function gets called by ctrl-alt-del - ie the keyboard interrupt.
407 * is whether to reboot at once, or just ignore the ctrl-alt-del.
420 static const char reboot_cmd[] = "/sbin/reboot";
436 ret = -ENOMEM; in run_cmd()
449 pr_warn("Failed to start orderly reboot: forcing the issue\n"); in __orderly_reboot()
488 * orderly_poweroff - Trigger an orderly system poweroff
510 * orderly_reboot - Trigger an orderly system reboot
512 * This may be called from any context to trigger a system reboot.
513 * If the orderly reboot fails, it will force an immediate reboot.
524 enum reboot_mode *mode; in reboot_setup() local
528 * reboot= will cause us to disable DMI checking in reboot_setup()
534 mode = &panic_reboot_mode; in reboot_setup()
537 mode = &reboot_mode; in reboot_setup()
542 *mode = REBOOT_WARM; in reboot_setup()
546 *mode = REBOOT_COLD; in reboot_setup()
550 *mode = REBOOT_HARD; in reboot_setup()
560 *mode = REBOOT_SOFT; in reboot_setup()
562 pr_err("Ignoring the CPU number in reboot= option. " in reboot_setup()
571 *mode = REBOOT_GPIO; in reboot_setup()
596 __setup("reboot=", reboot_setup);