From: Alan Cox Date: Sat, 6 Jun 2015 23:01:43 +0000 (+0100) Subject: uadmin: make A_REBOOT call trap_reboot X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e9b9fd770050536eb1d66322026e0df93670a506;p=FUZIX.git uadmin: make A_REBOOT call trap_reboot --- diff --git a/Kernel/include/kernel.h b/Kernel/include/kernel.h index d3b1d5bc..6f4180e7 100644 --- a/Kernel/include/kernel.h +++ b/Kernel/include/kernel.h @@ -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 */ diff --git a/Kernel/syscall_other.c b/Kernel/syscall_other.c index 0e3f88ad..1c409f14 100644 --- a/Kernel/syscall_other.c +++ b/Kernel/syscall_other.c @@ -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;