aboutsummaryrefslogtreecommitdiff
path: root/lib/sys/reboot.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sys/reboot.h')
-rw-r--r--lib/sys/reboot.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/sys/reboot.h b/lib/sys/reboot.h
new file mode 100644
index 0000000..fd119c5
--- /dev/null
+++ b/lib/sys/reboot.h
@@ -0,0 +1,21 @@
+#ifndef SHUTDOWN_H
+#define SHUTDOWN_H
+
+#include "syscalls.h"
+
+#define REBOOT_HALT_SYSTEM 0xcdef0123
+#define REBOOT_HARD_RESET 0x01234567
+#define REBOOT_ENABLE_CAD 0x89abcdef
+#define REBOOT_DISABLE_CAD 0
+#define REBOOT_POWEROFF 0x4321fedc
+#define REBOOT_SUSPEND 0xd000fce2
+#define REBOOT_NEW_KERNEL 0x45584543
+
+static int reboot(int cmd) {
+ const int magic1 = 0xfee1dead;
+ const int magic2 = 537993216;
+
+ return syscall((void*)REBOOT, magic1, magic2, cmd, 0);
+}
+
+#endif