Message type for PM_{S,G}ET_PRIORITY
Change-Id: I3cf77f786751ca7e5a8cd13b8716b228d0fbf7fe
This commit is contained in:
parent
594521214a
commit
865f761364
4 changed files with 18 additions and 13 deletions
|
@ -107,11 +107,6 @@
|
||||||
#define PM_GROUPS_NUM m1_i1 /* int */
|
#define PM_GROUPS_NUM m1_i1 /* int */
|
||||||
#define PM_GROUPS_PTR m1_p1 /* gid_t * */
|
#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. */
|
/* 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 * */
|
||||||
|
|
||||||
|
|
|
@ -154,6 +154,15 @@ typedef struct {
|
||||||
} mess_lc_pm_itimer;
|
} mess_lc_pm_itimer;
|
||||||
_ASSERT_MSG_SIZE(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 {
|
typedef struct {
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
int req;
|
int req;
|
||||||
|
@ -992,6 +1001,7 @@ typedef struct {
|
||||||
mess_fs_vfs_readwrite m_fs_vfs_readwrite;
|
mess_fs_vfs_readwrite m_fs_vfs_readwrite;
|
||||||
|
|
||||||
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_ptrace m_lc_pm_ptrace;
|
mess_lc_pm_ptrace m_lc_pm_ptrace;
|
||||||
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;
|
||||||
|
|
|
@ -19,8 +19,8 @@ int getpriority(int which, id_t who)
|
||||||
message m;
|
message m;
|
||||||
|
|
||||||
memset(&m, 0, sizeof(m));
|
memset(&m, 0, sizeof(m));
|
||||||
m.PM_PRIORITY_WHICH = which;
|
m.m_lc_pm_priority.which = which;
|
||||||
m.PM_PRIORITY_WHO = who;
|
m.m_lc_pm_priority.who = who;
|
||||||
|
|
||||||
/* GETPRIORITY returns negative for error.
|
/* GETPRIORITY returns negative for error.
|
||||||
* Otherwise, it returns the priority plus the minimum
|
* Otherwise, it returns the priority plus the minimum
|
||||||
|
@ -41,9 +41,9 @@ int setpriority(int which, id_t who, int prio)
|
||||||
message m;
|
message m;
|
||||||
|
|
||||||
memset(&m, 0, sizeof(m));
|
memset(&m, 0, sizeof(m));
|
||||||
m.PM_PRIORITY_WHICH = which;
|
m.m_lc_pm_priority.which = which;
|
||||||
m.PM_PRIORITY_WHO = who;
|
m.m_lc_pm_priority.who = who;
|
||||||
m.PM_PRIORITY_PRIO = prio;
|
m.m_lc_pm_priority.prio = prio;
|
||||||
|
|
||||||
return _syscall(PM_PROC_NR, PM_SETPRIORITY, &m);
|
return _syscall(PM_PROC_NR, PM_SETPRIORITY, &m);
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,9 +247,9 @@ int do_getsetpriority()
|
||||||
int r, arg_which, arg_who, arg_pri;
|
int r, arg_which, arg_who, arg_pri;
|
||||||
struct mproc *rmp;
|
struct mproc *rmp;
|
||||||
|
|
||||||
arg_which = m_in.PM_PRIORITY_WHICH;
|
arg_which = m_in.m_lc_pm_priority.which;
|
||||||
arg_who = m_in.PM_PRIORITY_WHO;
|
arg_who = m_in.m_lc_pm_priority.who;
|
||||||
arg_pri = m_in.PM_PRIORITY_PRIO; /* for SETPRIORITY */
|
arg_pri = m_in.m_lc_pm_priority.prio; /* for SETPRIORITY */
|
||||||
|
|
||||||
/* Code common to GETPRIORITY and SETPRIORITY. */
|
/* Code common to GETPRIORITY and SETPRIORITY. */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue