aboutsummaryrefslogtreecommitdiff
path: root/lib/sys/reboot.h
blob: 824fbc332fdfa2dd1f5ede318ab9e66ed7b8f1ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#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_RESTART     0x4321fedc
#define REBOOT_SUSPEND     0xd000fce2
#define REBOOT_NEW_KERNEL  0x45584543
#define REBOOT_POWEROFF    0x01234567

static int reboot(int cmd)
{
	const int magic1 = 0xfee1dead;
	const int magic2 =  537993216;

	return syscall((void*)REBOOT, magic1, magic2, cmd, 0);
}

#endif