uadmin: make A_REBOOT call trap_reboot
authorAlan Cox <alan@linux.intel.com>
Sat, 6 Jun 2015 23:01:43 +0000 (00:01 +0100)
committerAlan Cox <alan@linux.intel.com>
Sat, 6 Jun 2015 23:01:43 +0000 (00:01 +0100)
Kernel/include/kernel.h
Kernel/syscall_other.c

index d3b1d5b..6f4180e 100644 (file)
@@ -796,6 +796,7 @@ extern uaddr_t pagemap_mem_used(void);
 extern void map_init(void);
 extern void platform_idle(void);
 extern uint8_t rtc_secs(void);
+extern void trap_reboot(void);
 
 /* Will need a uptr_t eventually */
 extern uaddr_t ramtop;      /* Note: ramtop must be in common in some cases */
index 0e3f88a..1c409f1 100644 (file)
@@ -431,11 +431,13 @@ arg_t _uadmin(void)
 {
        if (esuper())
                return -1;
+       _sync();
        /* Wants moving into machine specific files */
-       if (cmd == A_SHUTDOWN || cmd == A_REBOOT || cmd == A_DUMP) {
-               _sync();
+       if (cmd == A_SHUTDOWN || cmd == A_DUMP)
                trap_monitor();
-       }
+       if (cmd == A_REBOOT)
+               trap_reboot();
+
        /* We don't do SWAPCTL yet */
        udata.u_error = EINVAL;
        return -1;