From: Lionel Sambuc Date: Tue, 13 May 2014 12:27:52 +0000 (+0200) Subject: Message type for PM_REBOOT X-Git-Tag: v3.3.0~285 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/mdoc.3.txt?a=commitdiff_plain;h=70a744da371ca823a5e081b806d8d562e527c590;p=minix.git Message type for PM_REBOOT Change-Id: I8de1b0de1a4c79f60a7df4720943ed9d0a19725c --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 51c9103c9..7a4031149 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -106,9 +106,6 @@ /* Field names for the getmcontext(2)/setmcontext(2) calls. */ #define PM_MCONTEXT_CTX m1_p1 /* mcontext_t * */ -/* Field names for the reboot(2) call. */ -#define PM_REBOOT_HOW m1_i1 /* int */ - /*===========================================================================* * Calls to VFS * *===========================================================================*/ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 77c854a6d..03463e7ef 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -188,6 +188,13 @@ typedef struct { } mess_pm_lc_ptrace; _ASSERT_MSG_SIZE(mess_pm_lc_ptrace); +typedef struct { + int how; + + uint8_t padding[52]; +} mess_lc_pm_reboot; +_ASSERT_MSG_SIZE(mess_lc_pm_reboot); + typedef struct { int req; int field; @@ -1012,6 +1019,7 @@ typedef struct { mess_lc_pm_itimer m_lc_pm_itimer; mess_lc_pm_priority m_lc_pm_priority; mess_lc_pm_ptrace m_lc_pm_ptrace; + mess_lc_pm_reboot m_lc_pm_reboot; mess_lc_pm_sysuname m_lc_pm_sysuname; mess_lc_pm_time m_lc_pm_time; mess_lc_pm_waitpid m_lc_pm_waitpid; diff --git a/lib/libc/sys-minix/reboot.c b/lib/libc/sys-minix/reboot.c index 08a503e92..54cf580ed 100644 --- a/lib/libc/sys-minix/reboot.c +++ b/lib/libc/sys-minix/reboot.c @@ -16,6 +16,6 @@ int reboot(int how, char *bootstr) message m; memset(&m, 0, sizeof(m)); - m.PM_REBOOT_HOW = how; + m.m_lc_pm_reboot.how = how; return _syscall(PM_PROC_NR, PM_REBOOT, &m); } diff --git a/servers/pm/misc.c b/servers/pm/misc.c index 8c1d32b54..8649ad639 100644 --- a/servers/pm/misc.c +++ b/servers/pm/misc.c @@ -211,7 +211,7 @@ int do_reboot() if (mp->mp_effuid != SUPER_USER) return(EPERM); /* See how the system should be aborted. */ - abort_flag = (unsigned) m_in.PM_REBOOT_HOW; + abort_flag = m_in.m_lc_pm_reboot.how; /* notify readclock (some arm systems power off via RTC alarms) */ if (abort_flag & RB_POWERDOWN) {