Blame view

include/linux/reboot.h 2.11 KB
b24413180   Greg Kroah-Hartman   License cleanup: ...
1
  /* SPDX-License-Identifier: GPL-2.0 */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
2
3
  #ifndef _LINUX_REBOOT_H
  #define _LINUX_REBOOT_H
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
4
5
  
  #include <linux/notifier.h>
607ca46e9   David Howells   UAPI: (Scripted) ...
6
  #include <uapi/linux/reboot.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
7

2d8364bae   Andrey Smirnov   kernel/reboot.c: ...
8
  struct device;
c5f41752f   Amerigo Wang   notifiers: sys: m...
9
10
11
12
  #define SYS_DOWN	0x0001	/* Notify of system down */
  #define SYS_RESTART	SYS_DOWN
  #define SYS_HALT	0x0002	/* Notify of system halt */
  #define SYS_POWER_OFF	0x0003	/* Notify of system power off */
edf2b1394   Robin Holt   reboot: x86: prep...
13
  enum reboot_mode {
b287a25a7   Aaro Koskinen   panic/reboot: all...
14
  	REBOOT_UNDEFINED = -1,
edf2b1394   Robin Holt   reboot: x86: prep...
15
16
  	REBOOT_COLD = 0,
  	REBOOT_WARM,
c97a70085   Robin Holt   reboot: unicore32...
17
18
  	REBOOT_HARD,
  	REBOOT_SOFT,
7b6d864b4   Robin Holt   reboot: arm: chan...
19
  	REBOOT_GPIO,
edf2b1394   Robin Holt   reboot: x86: prep...
20
  };
1b3a5d02e   Robin Holt   reboot: move arch...
21
  extern enum reboot_mode reboot_mode;
b287a25a7   Aaro Koskinen   panic/reboot: all...
22
  extern enum reboot_mode panic_reboot_mode;
1b3a5d02e   Robin Holt   reboot: move arch...
23
24
  
  enum reboot_type {
5be44a6fb   Ingo Molnar   x86: Remove the P...
25
26
27
28
29
30
31
  	BOOT_TRIPLE	= 't',
  	BOOT_KBD	= 'k',
  	BOOT_BIOS	= 'b',
  	BOOT_ACPI	= 'a',
  	BOOT_EFI	= 'e',
  	BOOT_CF9_FORCE	= 'p',
  	BOOT_CF9_SAFE	= 'q',
1b3a5d02e   Robin Holt   reboot: move arch...
32
33
34
35
36
37
  };
  extern enum reboot_type reboot_type;
  
  extern int reboot_default;
  extern int reboot_cpu;
  extern int reboot_force;
edf2b1394   Robin Holt   reboot: x86: prep...
38

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
39
40
  extern int register_reboot_notifier(struct notifier_block *);
  extern int unregister_reboot_notifier(struct notifier_block *);
2d8364bae   Andrey Smirnov   kernel/reboot.c: ...
41
  extern int devm_register_reboot_notifier(struct device *, struct notifier_block *);
b63adb979   Guenter Roeck   kernel: add suppo...
42
43
44
  extern int register_restart_handler(struct notifier_block *);
  extern int unregister_restart_handler(struct notifier_block *);
  extern void do_kernel_restart(char *cmd);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
45
46
47
48
  
  /*
   * Architecture-specific implementations of sys_reboot commands.
   */
c97102ba9   Vivek Goyal   kexec: migrate to...
49
  extern void migrate_to_reboot_cpu(void);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
50
51
52
  extern void machine_restart(char *cmd);
  extern void machine_halt(void);
  extern void machine_power_off(void);
dc009d924   Eric W. Biederman   [PATCH] kexec: ad...
53
  extern void machine_shutdown(void);
6e274d144   Alexander Nyberg   [PATCH] kdump: Us...
54
55
  struct pt_regs;
  extern void machine_crash_shutdown(struct pt_regs *);
dc009d924   Eric W. Biederman   [PATCH] kexec: ad...
56

972ee83df   Robin Holt   reboot: checkpatc...
57
  /*
4a00ea1e1   Eric W. Biederman   [PATCH] Refactor ...
58
59
   * Architecture independent implemenations of sys_reboot commands.
   */
ca195b7f6   Huang Ying   kexec jump: remov...
60
  extern void kernel_restart_prepare(char *cmd);
4a00ea1e1   Eric W. Biederman   [PATCH] Refactor ...
61
62
63
  extern void kernel_restart(char *cmd);
  extern void kernel_halt(void);
  extern void kernel_power_off(void);
83cc5ed3c   Adrian Bunk   [PATCH] kernel/sy...
64

eb5572fed   Dave Young   sysctl extern cle...
65
  extern int C_A_D; /* for sysctl */
83cc5ed3c   Adrian Bunk   [PATCH] kernel/sy...
66
  void ctrl_alt_del(void);
4a00ea1e1   Eric W. Biederman   [PATCH] Refactor ...
67

10a0a8d4e   Jeremy Fitzhardinge   Add common orderl...
68
69
  #define POWEROFF_CMD_PATH_LEN	256
  extern char poweroff_cmd[POWEROFF_CMD_PATH_LEN];
7a54f46b3   Joel Stanley   kernel/reboot.c: ...
70
71
  extern void orderly_poweroff(bool force);
  extern void orderly_reboot(void);
10a0a8d4e   Jeremy Fitzhardinge   Add common orderl...
72

7c9034735   Eric W. Biederman   [PATCH] Add emerg...
73
74
75
76
77
78
  /*
   * Emergency restart, callable from an interrupt handler.
   */
  
  extern void emergency_restart(void);
  #include <asm/emergency-restart.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
79
  #endif /* _LINUX_REBOOT_H */