The detailed description of the seven system calls are as follows: 1. rbed_schedule SYNOPSIS #defined in sched.c asmlinkage int sys_rbed_schedule(pid_t id, int p, struct sched_param *param) DESCRIPTION rbed_schedule() sets a new scheduling policy p for process with pid=id. The scheduling parameters of the process are set according to param. RETURN VALUE rbed_schedule returns the resource level (non-negative integer) at which the process can run for its next period and negative value on error. Each resource level indicates a CPU utilization (execution time / period), for example, 0 -> 80%, 1 -> 40%, 2 -> 20%, etc. 2. rbed_deadline_met SYNOPSIS #defined in sched.c asmlinkage int sys_rbed_deadline_met(pid_t id) DESCRIPTION rbed_deadline_met checks if the process with pid=id meets its deadline or not. It gets the current time using the rdtsc register, compare it to the deadline of the process. If completion time < deadline, sleep for time = deadline - completion_time, else don't sleep and start next period right away. RETURN VALUE 1) The last four (lower four) bits are for qos levels and wrap flag 0x*0..0x*9 -> 0..9 qos levels 0x*A -> wrap 2) The previous four (upper four) bits are for deadline meet flags. 0x0* for successfully making the deadline 0x1* didn't make it 0x2* apic break occurred during schedule (usually don't happen) 3. rate_adjust SYNOPSIS #defined in sched.c asmlinkage long sys_rate_adjust(long ctr_err) DESCRIPTION rate_adjust adjusts the rate for the current process according to the rescaled benefit by the control error ctr_err. This is designed for adaptive applications that needs to dynamically adjust their periods according to the available CPU utilization. RETURN VALUE rate_adjust returns the current actual period for the current process. 4. getperiod SYNOPSIS #defined in sched.c asmlinkage long sys_getperiod(int flag) DESCRIPTION getperiod gets the previous actual period or next expected period for the current SRT process according to the flag. RETURN VALUE getperiod returns the previous actual period of the current process if flag=0 and returns the next expected period if the flag=1. 5. setqos SYNOPSIS #defined in sched.c asmlinkage int sys_setqos(int flag){ DESCRIPTION setqos sets the adaptive resource allocation policy for the current process according to the flag. If flag=0, it sets the policy to "optimal" policy; if flag=1, it sets the policy to "proportional" policy. The "optimal" policy allocates all the resources to the process that has the maximum control error, which is passed into the kernel by adjust_adjust system call. The "proportional" policy allocates the resources to the processes proportionally to their control error. RETURN VALUE setqos returns the old (previous) resource allocation flag, which indicates "0: optimal" or "1: proportional" 6. rbed_tracedump SYNOPSIS #defined in sched.c asmlinkage int sys_rbed_tracedump(int *num, struct rbed_trace *tr) DESCRIPTION rbed_tracedump copies the kernel data with size of num*sizeof(struct rbed_trace) to user space structure specified by tr. This system calls is used for application to get the kernel debug information. The kernel data is saved in a kernel buffer, which only keeps the latest data. RETURN VALUE returns 0 if the kernel data does not overflow, or 1 if the kernel data overflows. 7. rbed_rt_tracedump SYNOPSIS #defined in sched.c asmlinkage int sys_rbed_rt_tracedump(int *num, struct rbed_trace *tr) DESCRIPTION Similar to rbed_tracedump, except that it only dumps the data of real-time processes. RETURN VALUE returns 0 if the kernel data does not overflow, or 1 if the kernel data overflows.