#define SCHEDULING_NO_QUANTUM (SCHEDULING_BASE+1)
/* These are used for SYS_SCHEDULE, a reply to SCHEDULING_NO_QUANTUM */
# define SCHEDULING_ENDPOINT m9_l1
-# define SCHEDULING_QUANTUM m9_l2
-
-/*
- * SCHEDULING_START uses _ENDPOINT, _PRIORITY and _QUANTUM from
- * SCHEDULING_NO_QUANTUM/SYS_SCHEDULE
- */
#define SCHEDULING_START (SCHEDULING_BASE+2)
-# define SCHEDULING_SCHEDULER m9_l1 /* Overrides _ENDPOINT on return*/
-# define SCHEDULING_PARENT m9_l3
# define SCHEDULING_MAXPRIO m9_l4
-
#define SCHEDULING_STOP (SCHEDULING_BASE+3)
-
#define SCHEDULING_SET_NICE (SCHEDULING_BASE+4)
-
-/* SCHEDULING_INHERIT is like SCHEDULING_START, but without _QUANTUM field */
#define SCHEDULING_INHERIT (SCHEDULING_BASE+5)
/*===========================================================================*
} mess_lsys_pm_srv_fork;
_ASSERT_MSG_SIZE(mess_lsys_pm_srv_fork);
+typedef struct {
+ endpoint_t endpoint;
+ endpoint_t parent;
+ int maxprio;
+ int quantum;
+
+ uint8_t padding[40];
+} mess_lsys_sched_scheduling_start;
+_ASSERT_MSG_SIZE(mess_lsys_sched_scheduling_start);
+
+typedef struct {
+ endpoint_t scheduler;
+
+ uint8_t padding[52];
+} mess_sched_lsys_scheduling_start;
+_ASSERT_MSG_SIZE(mess_sched_lsys_scheduling_start);
+
typedef struct {
endpoint_t endpt;
cp_grant_id_t grant;
mess_lsys_pm_getprocnr m_lsys_pm_getprocnr;
mess_lsys_pm_srv_fork m_lsys_pm_srv_fork;
+ mess_lsys_sched_scheduling_start m_lsys_sched_scheduling_start;
+
mess_lsys_vfs_checkperms m_lsys_vfs_checkperms;
mess_lsys_vfs_copyfd m_lsys_vfs_copyfd;
mess_lsys_vfs_mapdriver m_lsys_vfs_mapdriver;
mess_rs_pm_exec_restart m_rs_pm_exec_restart;
mess_rs_pm_srv_kill m_rs_pm_srv_kill;
+ mess_sched_lsys_scheduling_start m_sched_lsys_scheduling_start;
+
mess_vfs_fs_breadwrite m_vfs_fs_breadwrite;
mess_vfs_fs_chmod m_vfs_fs_chmod;
mess_vfs_fs_chown m_vfs_fs_chown;
assert(newscheduler_e);
memset(&m, 0, sizeof(m));
- m.SCHEDULING_ENDPOINT = schedulee_e;
- m.SCHEDULING_PARENT = parent_e;
- m.SCHEDULING_MAXPRIO = (int) maxprio;
+ m.m_lsys_sched_scheduling_start.endpoint = schedulee_e;
+ m.m_lsys_sched_scheduling_start.parent = parent_e;
+ m.m_lsys_sched_scheduling_start.maxprio = maxprio;
/* Send the request to the scheduler */
if ((rv = _taskcall(scheduler_e, SCHEDULING_INHERIT, &m))) {
* might have forwarded the scheduling message on to another scheduler
* before returning the message.
*/
- *newscheduler_e = m.SCHEDULING_SCHEDULER;
+ *newscheduler_e = m.m_sched_lsys_scheduling_start.scheduler;
return (OK);
}
/* A user-space scheduler must schedule this process. */
memset(&m, 0, sizeof(m));
- m.SCHEDULING_ENDPOINT = schedulee_e;
- m.SCHEDULING_PARENT = parent_e;
- m.SCHEDULING_MAXPRIO = (int) maxprio;
- m.SCHEDULING_QUANTUM = (int) quantum;
+ m.m_lsys_sched_scheduling_start.endpoint = schedulee_e;
+ m.m_lsys_sched_scheduling_start.parent = parent_e;
+ m.m_lsys_sched_scheduling_start.maxprio = maxprio;
+ m.m_lsys_sched_scheduling_start.quantum = quantum;
/* Send the request to the scheduler */
if ((rv = _taskcall(scheduler_e, SCHEDULING_START, &m))) {
* might have forwarded the scheduling message on to another scheduler
* before returning the message.
*/
- *newscheduler_e = m.SCHEDULING_SCHEDULER;
+ *newscheduler_e = m.m_sched_lsys_scheduling_start.scheduler;
return (OK);
}
return EPERM;
/* Resolve endpoint to proc slot. */
- if ((rv = sched_isemtyendpt(m_ptr->SCHEDULING_ENDPOINT, &proc_nr_n))
- != OK) {
+ if ((rv = sched_isemtyendpt(m_ptr->m_lsys_sched_scheduling_start.endpoint,
+ &proc_nr_n)) != OK) {
return rv;
}
rmp = &schedproc[proc_nr_n];
/* Populate process slot */
- rmp->endpoint = m_ptr->SCHEDULING_ENDPOINT;
- rmp->parent = m_ptr->SCHEDULING_PARENT;
- rmp->max_priority = (unsigned) m_ptr->SCHEDULING_MAXPRIO;
+ rmp->endpoint = m_ptr->m_lsys_sched_scheduling_start.endpoint;
+ rmp->parent = m_ptr->m_lsys_sched_scheduling_start.parent;
+ rmp->max_priority = m_ptr->m_lsys_sched_scheduling_start.maxprio;
if (rmp->max_priority >= NR_SCHED_QUEUES) {
return EINVAL;
}
* quanum and priority are set explicitly rather than inherited
* from the parent */
rmp->priority = rmp->max_priority;
- rmp->time_slice = (unsigned) m_ptr->SCHEDULING_QUANTUM;
+ rmp->time_slice = m_ptr->m_lsys_sched_scheduling_start.quantum;
break;
case SCHEDULING_INHERIT:
/* Inherit current priority and time slice from parent. Since there
* is currently only one scheduler scheduling the whole system, this
* value is local and we assert that the parent endpoint is valid */
- if ((rv = sched_isokendpt(m_ptr->SCHEDULING_PARENT,
+ if ((rv = sched_isokendpt(m_ptr->m_lsys_sched_scheduling_start.parent,
&parent_nr_n)) != OK)
return rv;
* By default, processes are scheduled by the parents scheduler. In case
* this scheduler would want to delegate scheduling to another
* scheduler, it could do so and then write the endpoint of that
- * scheduler into SCHEDULING_SCHEDULER
+ * scheduler into the "scheduler" field.
*/
- m_ptr->SCHEDULING_SCHEDULER = SCHED_PROC_NR;
+ m_ptr->m_sched_lsys_scheduling_start.scheduler = SCHED_PROC_NR;
return OK;
}