]> Zhao Yanbai Git Server - minix.git/commitdiff
Message type for PM_{S,G}ET_PRIORITY
authorLionel Sambuc <lionel@minix3.org>
Tue, 13 May 2014 11:56:04 +0000 (13:56 +0200)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:05:36 +0000 (17:05 +0200)
Change-Id: I3cf77f786751ca7e5a8cd13b8716b228d0fbf7fe

include/minix/callnr.h
include/minix/ipc.h
lib/libc/sys-minix/priority.c
servers/pm/misc.c

index e70fa17435f5b6ccafac78dc9f5047a17d58debd..e8bd7a8d63fec54d16ecc37a7ffe00e3a7951de3 100644 (file)
 #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 * */
 
index e1ab66443ac9f3676b5a647674252c578bdce72d..421380efb7e966b3a97765bbf2ca67a1f995f8c9 100644 (file)
@@ -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;
index 5e6ea7f8d6a5f3d0f709f0a8f2ac1afeeae1742a..74c4be52bd6a386beca8c318964787c529a796fa 100644 (file)
@@ -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);
 }
index 4d9e05aa3936ff960452e6852cb3a4e30e88ec87..8c1d32b54cc4bebbcb86d9c5bca0bfc063db648b 100644 (file)
@@ -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. */