xref: /linux/tools/include/nolibc/sys/reboot.h (revision 015a99fa76650e7d6efa3e36f20c0f5b346fe9ce)
1 /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2 /*
3  * Reboot definitions for NOLIBC
4  * Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
5  */
6 
7 /* make sure to include all global symbols */
8 #include "../nolibc.h"
9 
10 #ifndef _NOLIBC_SYS_REBOOT_H
11 #define _NOLIBC_SYS_REBOOT_H
12 
13 #include "../sys.h"
14 
15 #include <linux/reboot.h>
16 
17 /*
18  * int reboot(int cmd);
19  * <cmd> is among LINUX_REBOOT_CMD_*
20  */
21 
22 static __attribute__((unused))
sys_reboot(int magic1,int magic2,int cmd,void * arg)23 ssize_t sys_reboot(int magic1, int magic2, int cmd, void *arg)
24 {
25 	return my_syscall4(__NR_reboot, magic1, magic2, cmd, arg);
26 }
27 
28 static __attribute__((unused))
reboot(int cmd)29 int reboot(int cmd)
30 {
31 	return __sysret(sys_reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, 0));
32 }
33 
34 #endif /* _NOLIBC_SYS_REBOOT_H */
35