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
81 * register_reboot_notifier - Register function to be called at reboot time
85 * to be called at reboot time.
97 * unregister_reboot_notifier - Unregister previously registered reboot notifier
100 * Unregisters a previously registered reboot
103 * Returns zero on success, or %-ENOENT on failure.
124 return -ENOMEM; in devm_register_reboot_notifier()
145 * register_restart_handler - Register function to be called to reset
148 * @nb->priority: Handler priority. Handlers should follow the
164 * machine_restart function calls do_kernel_restart - see below
170 * Restart handlers are expected to be registered from non-architecture
189 * unregister_restart_handler - Unregister previously registered
195 * Returns zero on success, or %-ENOENT on failure.
204 * do_kernel_restart - Execute kernel restart handler call chain
226 /* Make certain the cpu I'm about to reboot on is online */ in migrate_to_reboot_cpu()
231 current->flags |= PF_NO_SETAFFINITY; in migrate_to_reboot_cpu()
238 * kernel_restart - reboot the system
242 * Shutdown everything and perform a clean reboot.
268 * kernel_halt - halt the system
284 * kernel_power_off - power_off the system
304 * Reboot system call: for obvious reasons only root may call it,
306 * so that some mistake won't make this reboot the whole machine.
307 * You can also set the meaning of the ctrl-alt-del-key here.
309 * reboot doesn't sync: do that yourself before calling this.
311 SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd, in SYSCALL_DEFINE4() argument
319 if (!ns_capable(pid_ns->user_ns, CAP_SYS_BOOT)) in SYSCALL_DEFINE4()
320 return -EPERM; in SYSCALL_DEFINE4()
328 return -EINVAL; in SYSCALL_DEFINE4()
370 ret = strncpy_from_user(&buffer[0], arg, sizeof(buffer) - 1); in SYSCALL_DEFINE4()
372 ret = -EFAULT; in SYSCALL_DEFINE4()
375 buffer[sizeof(buffer) - 1] = '\0'; in SYSCALL_DEFINE4()
393 ret = -EINVAL; in SYSCALL_DEFINE4()
406 * This function gets called by ctrl-alt-del - ie the keyboard interrupt.
408 * is whether to reboot at once, or just ignore the ctrl-alt-del.
421 static const char reboot_cmd[] = "/sbin/reboot";
437 ret = -ENOMEM; in run_cmd()
450 pr_warn("Failed to start orderly reboot: forcing the issue\n"); in __orderly_reboot()
489 * orderly_poweroff - Trigger an orderly system poweroff
511 * orderly_reboot - Trigger an orderly system reboot
513 * This may be called from any context to trigger a system reboot.
514 * If the orderly reboot fails, it will force an immediate reboot.
525 enum reboot_mode *mode; in reboot_setup() local
529 * reboot= will cause us to disable DMI checking in reboot_setup()
535 mode = &panic_reboot_mode; in reboot_setup()
538 mode = &reboot_mode; in reboot_setup()
543 *mode = REBOOT_WARM; in reboot_setup()
547 *mode = REBOOT_COLD; in reboot_setup()
551 *mode = REBOOT_HARD; in reboot_setup()
561 *mode = REBOOT_SOFT; in reboot_setup()
563 pr_err("Ignoring the CPU number in reboot= option. " in reboot_setup()
572 *mode = REBOOT_GPIO; in reboot_setup()
597 __setup("reboot=", reboot_setup);