]> Zhao Yanbai Git Server - minix.git/commitdiff
Message type for SCHEDULING_SET_NICE
authorLionel Sambuc <lionel@minix3.org>
Wed, 14 May 2014 16:10:23 +0000 (18:10 +0200)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:05:43 +0000 (17:05 +0200)
Change-Id: I4f8450b0de235627383035653ec58761fc7e3985

include/minix/com.h
include/minix/ipc.h
servers/pm/schedule.c
servers/sched/schedule.c

index fb432750c56981d63913413d66a561b86db1f2cf..9e5926d7fb8824497b0bb972f8807996a21434b1 100644 (file)
 /* 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)
index 69f8b29ed96a1911f1d0f35774e652563c0ff1aa..a935eb03573c97239d61880656ce6d2d1dd1a94a 100644 (file)
@@ -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;
 
index 976d6ab887339c9401407f2b4ce66ccfb35df1bd..11b7025fbb1b39a128f0585df3fd3f01e78a502e 100644 (file)
@@ -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;
        }
index fd5e04931e2f9b3a57b108b87fa7cb8d4fa6aa57..ec96fe752a0c690de84b4be0c51995514a2fbce8 100644 (file)
@@ -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;
        }