From: Lionel Sambuc Date: Tue, 13 May 2014 11:56:04 +0000 (+0200) Subject: Message type for PM_{S,G}ET_PRIORITY X-Git-Tag: v3.3.0~287 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.host.html?a=commitdiff_plain;h=865f7613646b76ac9ed0202a34f2a7ac64a3e00b;p=minix.git Message type for PM_{S,G}ET_PRIORITY Change-Id: I3cf77f786751ca7e5a8cd13b8716b228d0fbf7fe --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index e70fa1743..e8bd7a8d6 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -107,11 +107,6 @@ #define PM_GROUPS_NUM m1_i1 /* int */ #define PM_GROUPS_PTR m1_p1 /* gid_t * */ -/* Field names for the getpriority(2)/setpriority(2) calls. */ -#define PM_PRIORITY_WHICH m1_i1 /* int */ -#define PM_PRIORITY_WHO m1_i2 /* int */ -#define PM_PRIORITY_PRIO m1_i3 /* int */ - /* Field names for the getmcontext(2)/setmcontext(2) calls. */ #define PM_MCONTEXT_CTX m1_p1 /* mcontext_t * */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index e1ab66443..421380efb 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -154,6 +154,15 @@ typedef struct { } mess_lc_pm_itimer; _ASSERT_MSG_SIZE(mess_lc_pm_itimer); +typedef struct { + int which; + int who; + int prio; + + uint8_t padding[44]; +} mess_lc_pm_priority; +_ASSERT_MSG_SIZE(mess_lc_pm_priority); + typedef struct { pid_t pid; int req; @@ -992,6 +1001,7 @@ typedef struct { mess_fs_vfs_readwrite m_fs_vfs_readwrite; 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_sysuname m_lc_pm_sysuname; mess_lc_pm_time m_lc_pm_time; diff --git a/lib/libc/sys-minix/priority.c b/lib/libc/sys-minix/priority.c index 5e6ea7f8d..74c4be52b 100644 --- a/lib/libc/sys-minix/priority.c +++ b/lib/libc/sys-minix/priority.c @@ -19,8 +19,8 @@ int getpriority(int which, id_t who) message m; memset(&m, 0, sizeof(m)); - m.PM_PRIORITY_WHICH = which; - m.PM_PRIORITY_WHO = who; + m.m_lc_pm_priority.which = which; + m.m_lc_pm_priority.who = who; /* GETPRIORITY returns negative for error. * Otherwise, it returns the priority plus the minimum @@ -41,9 +41,9 @@ int setpriority(int which, id_t who, int prio) message m; memset(&m, 0, sizeof(m)); - m.PM_PRIORITY_WHICH = which; - m.PM_PRIORITY_WHO = who; - m.PM_PRIORITY_PRIO = prio; + m.m_lc_pm_priority.which = which; + m.m_lc_pm_priority.who = who; + m.m_lc_pm_priority.prio = prio; return _syscall(PM_PROC_NR, PM_SETPRIORITY, &m); } diff --git a/servers/pm/misc.c b/servers/pm/misc.c index 4d9e05aa3..8c1d32b54 100644 --- a/servers/pm/misc.c +++ b/servers/pm/misc.c @@ -247,9 +247,9 @@ int do_getsetpriority() int r, arg_which, arg_who, arg_pri; struct mproc *rmp; - arg_which = m_in.PM_PRIORITY_WHICH; - arg_who = m_in.PM_PRIORITY_WHO; - arg_pri = m_in.PM_PRIORITY_PRIO; /* for SETPRIORITY */ + arg_which = m_in.m_lc_pm_priority.which; + arg_who = m_in.m_lc_pm_priority.who; + arg_pri = m_in.m_lc_pm_priority.prio; /* for SETPRIORITY */ /* Code common to GETPRIORITY and SETPRIORITY. */