@@ -188,6 +188,7 @@ SYSCALL_DEF(readlink, ARG_STR, ARG_PTR, ARG_DEC);
#ifdef TARGET_NR_readlinkat
SYSCALL_DEF(readlinkat, ARG_ATDIRFD, ARG_STR, ARG_PTR, ARG_DEC);
#endif
+SYSCALL_DEF(reboot, ARG_HEX, ARG_HEX, ARG_DEC, ARG_PTR);
#ifdef TARGET_NR_rename
SYSCALL_DEF(rename, ARG_STR, ARG_STR);
#endif
@@ -532,6 +532,24 @@ SYSCALL_IMPL(nice)
}
#endif
+SYSCALL_IMPL(reboot)
+{
+ abi_long ret;
+
+ if (arg3 == LINUX_REBOOT_CMD_RESTART2) {
+ /* arg4 must be ignored in all other cases */
+ char *p = lock_user_string(arg4);
+ if (!p) {
+ return -TARGET_EFAULT;
+ }
+ ret = get_errno(reboot(arg1, arg2, arg3, p));
+ unlock_user(p, arg4, 0);
+ } else {
+ ret = get_errno(reboot(arg1, arg2, arg3, NULL));
+ }
+ return ret;
+}
+
SYSCALL_IMPL(sethostname)
{
void *p = lock_user_string(arg1);
@@ -4158,19 +4158,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
void *p;
switch(num) {
- case TARGET_NR_reboot:
- if (arg3 == LINUX_REBOOT_CMD_RESTART2) {
- /* arg4 must be ignored in all other cases */
- p = lock_user_string(arg4);
- if (!p) {
- return -TARGET_EFAULT;
- }
- ret = get_errno(reboot(arg1, arg2, arg3, p));
- unlock_user(p, arg4, 0);
- } else {
- ret = get_errno(reboot(arg1, arg2, arg3, NULL));
- }
- return ret;
#ifdef TARGET_NR_truncate
case TARGET_NR_truncate:
if (!(p = lock_user_string(arg1)))
@@ -866,9 +866,6 @@
#ifdef TARGET_NR_readdir
{ TARGET_NR_readdir, "readdir" , NULL, NULL, NULL },
#endif
-#ifdef TARGET_NR_reboot
-{ TARGET_NR_reboot, "reboot" , NULL, NULL, NULL },
-#endif
#ifdef TARGET_NR_recv
{ TARGET_NR_recv, "recv" , NULL, NULL, NULL },
#endif
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- linux-user/syscall-defs.h | 1 + linux-user/syscall-proc.inc.c | 18 ++++++++++++++++++ linux-user/syscall.c | 13 ------------- linux-user/strace.list | 3 --- 4 files changed, 19 insertions(+), 16 deletions(-) -- 2.17.1