Message type for PM_REBOOT

Change-Id: I8de1b0de1a4c79f60a7df4720943ed9d0a19725c
This commit is contained in:
Lionel Sambuc 2014-05-13 14:27:52 +02:00
parent c3629bba0b
commit 70a744da37
4 changed files with 10 additions and 5 deletions

View file

@ -106,9 +106,6 @@
/* Field names for the getmcontext(2)/setmcontext(2) calls. */ /* Field names for the getmcontext(2)/setmcontext(2) calls. */
#define PM_MCONTEXT_CTX m1_p1 /* mcontext_t * */ #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 * * Calls to VFS *
*===========================================================================*/ *===========================================================================*/

View file

@ -188,6 +188,13 @@ typedef struct {
} mess_pm_lc_ptrace; } mess_pm_lc_ptrace;
_ASSERT_MSG_SIZE(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 { typedef struct {
int req; int req;
int field; int field;
@ -1012,6 +1019,7 @@ typedef struct {
mess_lc_pm_itimer m_lc_pm_itimer; mess_lc_pm_itimer m_lc_pm_itimer;
mess_lc_pm_priority m_lc_pm_priority; mess_lc_pm_priority m_lc_pm_priority;
mess_lc_pm_ptrace m_lc_pm_ptrace; 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_sysuname m_lc_pm_sysuname;
mess_lc_pm_time m_lc_pm_time; mess_lc_pm_time m_lc_pm_time;
mess_lc_pm_waitpid m_lc_pm_waitpid; mess_lc_pm_waitpid m_lc_pm_waitpid;

View file

@ -16,6 +16,6 @@ int reboot(int how, char *bootstr)
message m; message m;
memset(&m, 0, sizeof(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); return _syscall(PM_PROC_NR, PM_REBOOT, &m);
} }

View file

@ -211,7 +211,7 @@ int do_reboot()
if (mp->mp_effuid != SUPER_USER) return(EPERM); if (mp->mp_effuid != SUPER_USER) return(EPERM);
/* See how the system should be aborted. */ /* 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) */ /* notify readclock (some arm systems power off via RTC alarms) */
if (abort_flag & RB_POWERDOWN) { if (abort_flag & RB_POWERDOWN) {