blob: f8c3de7aa917496795d363944466939fcbc03ad3 [file] [log] [blame]
Dmitry V. Levin9aaf88c2014-02-05 14:51:19 +00001#include "defs.h"
2#include <linux/reboot.h>
3
4static const struct xlat bootflags1[] = {
5 XLAT(LINUX_REBOOT_MAGIC1),
6 XLAT_END
7};
8
9static const struct xlat bootflags2[] = {
10 XLAT(LINUX_REBOOT_MAGIC2),
11 XLAT(LINUX_REBOOT_MAGIC2A),
12 XLAT(LINUX_REBOOT_MAGIC2B),
13 XLAT(LINUX_REBOOT_MAGIC2C),
14 XLAT_END
15};
16
17static const struct xlat bootflags3[] = {
18 XLAT(LINUX_REBOOT_CMD_RESTART),
19 XLAT(LINUX_REBOOT_CMD_HALT),
20 XLAT(LINUX_REBOOT_CMD_CAD_ON),
21 XLAT(LINUX_REBOOT_CMD_CAD_OFF),
22 XLAT(LINUX_REBOOT_CMD_POWER_OFF),
23 XLAT(LINUX_REBOOT_CMD_RESTART2),
24 XLAT(LINUX_REBOOT_CMD_SW_SUSPEND),
25 XLAT(LINUX_REBOOT_CMD_KEXEC),
26 XLAT_END
27};
28
29int
30sys_reboot(struct tcb *tcp)
31{
32 if (exiting(tcp))
33 return 0;
34
35 printflags(bootflags1, tcp->u_arg[0], "LINUX_REBOOT_MAGIC_???");
36 tprints(", ");
37 printflags(bootflags2, tcp->u_arg[1], "LINUX_REBOOT_MAGIC_???");
38 tprints(", ");
39 printflags(bootflags3, tcp->u_arg[2], "LINUX_REBOOT_CMD_???");
40 if (tcp->u_arg[2] == LINUX_REBOOT_CMD_RESTART2) {
41 tprints(", ");
42 printstr(tcp, tcp->u_arg[3], -1);
43 }
44 return 0;
45}