From: Lionel Sambuc Date: Wed, 14 May 2014 16:10:23 +0000 (+0200) Subject: Message type for SCHEDULING_SET_NICE X-Git-Tag: v3.3.0~247 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/syslog.3.html?a=commitdiff_plain;h=c6db5a91e7fb419478cc3b49160d4cf4ef1a534c;p=minix.git Message type for SCHEDULING_SET_NICE Change-Id: I4f8450b0de235627383035653ec58761fc7e3985 --- diff --git a/include/minix/com.h b/include/minix/com.h index fb432750c..9e5926d7f 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -1003,7 +1003,6 @@ /* These are used for SYS_SCHEDULE, a reply to SCHEDULING_NO_QUANTUM */ # define SCHEDULING_ENDPOINT m9_l1 #define SCHEDULING_START (SCHEDULING_BASE+2) -# define SCHEDULING_MAXPRIO m9_l4 #define SCHEDULING_STOP (SCHEDULING_BASE+3) #define SCHEDULING_SET_NICE (SCHEDULING_BASE+4) #define SCHEDULING_INHERIT (SCHEDULING_BASE+5) diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 69f8b29ed..a935eb035 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -700,6 +700,14 @@ typedef struct { } mess_pm_lc_getuid; _ASSERT_MSG_SIZE(mess_pm_lc_getuid); +typedef struct { + endpoint_t endpoint; + uint32_t maxprio; + + uint8_t padding[48]; +} mess_pm_sched_scheduling_set_nice; +_ASSERT_MSG_SIZE(mess_pm_sched_scheduling_set_nice); + typedef struct { endpoint_t endpt; int result; @@ -1241,6 +1249,8 @@ typedef struct { mess_pm_lsys_getepinfo m_pm_lsys_getepinfo; mess_pm_lsys_getprocnr m_pm_lsys_getprocnr; + mess_pm_sched_scheduling_set_nice m_pm_sched_scheduling_set_nice; + mess_rs_pm_exec_restart m_rs_pm_exec_restart; mess_rs_pm_srv_kill m_rs_pm_srv_kill; diff --git a/servers/pm/schedule.c b/servers/pm/schedule.c index 976d6ab88..11b7025fb 100644 --- a/servers/pm/schedule.c +++ b/servers/pm/schedule.c @@ -102,8 +102,8 @@ int sched_nice(struct mproc *rmp, int nice) return rv; } - m.SCHEDULING_ENDPOINT = rmp->mp_endpoint; - m.SCHEDULING_MAXPRIO = (int) maxprio; + m.m_pm_sched_scheduling_set_nice.endpoint = rmp->mp_endpoint; + m.m_pm_sched_scheduling_set_nice.maxprio = maxprio; if ((rv = _taskcall(rmp->mp_scheduler, SCHEDULING_SET_NICE, &m))) { return rv; } diff --git a/servers/sched/schedule.c b/servers/sched/schedule.c index fd5e04931..ec96fe752 100644 --- a/servers/sched/schedule.c +++ b/servers/sched/schedule.c @@ -264,14 +264,14 @@ int do_nice(message *m_ptr) if (!accept_message(m_ptr)) return EPERM; - if (sched_isokendpt(m_ptr->SCHEDULING_ENDPOINT, &proc_nr_n) != OK) { - printf("SCHED: WARNING: got an invalid endpoint in OOQ msg " - "%ld\n", m_ptr->SCHEDULING_ENDPOINT); + if (sched_isokendpt(m_ptr->m_pm_sched_scheduling_set_nice.endpoint, &proc_nr_n) != OK) { + printf("SCHED: WARNING: got an invalid endpoint in OoQ msg " + "%d\n", m_ptr->m_pm_sched_scheduling_set_nice.endpoint); return EBADEPT; } rmp = &schedproc[proc_nr_n]; - new_q = (unsigned) m_ptr->SCHEDULING_MAXPRIO; + new_q = m_ptr->m_pm_sched_scheduling_set_nice.maxprio; if (new_q >= NR_SCHED_QUEUES) { return EINVAL; }