From 28cef80c0b9da0184ef736ae131b6146c5976422 Mon Sep 17 00:00:00 2001 From: Ming Yang Date: Thu, 11 Feb 2016 20:31:16 -0500 Subject: Manually patched mc^2 related code --- include/litmus/mc2_common.h | 31 +++++++++++++++++++++++++++++++ include/litmus/rt_param.h | 4 ++++ include/litmus/unistd_32.h | 3 ++- include/litmus/unistd_64.h | 5 +++-- 4 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 include/litmus/mc2_common.h (limited to 'include') diff --git a/include/litmus/mc2_common.h b/include/litmus/mc2_common.h new file mode 100644 index 000000000000..e3c0af28f1b9 --- /dev/null +++ b/include/litmus/mc2_common.h @@ -0,0 +1,31 @@ +/* + * MC^2 common data structures + */ + +#ifndef __UNC_MC2_COMMON_H__ +#define __UNC_MC2_COMMON_H__ + +enum crit_level { + CRIT_LEVEL_A = 0, + CRIT_LEVEL_B = 1, + CRIT_LEVEL_C = 2, + NUM_CRIT_LEVELS = 3, +}; + +struct mc2_task { + enum crit_level crit; + unsigned int res_id; +}; + +#ifdef __KERNEL__ + +#include + +#define tsk_mc2_data(t) (tsk_rt(t)->mc2_data) + +long mc2_task_client_init(struct task_client *tc, struct mc2_task *mc2_param, struct task_struct *tsk, + struct reservation *res); + +#endif /* __KERNEL__ */ + +#endif \ No newline at end of file diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index e626bbbe60d5..26dfa33c1e5e 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h @@ -206,6 +206,7 @@ struct rt_job { }; struct pfair_param; +struct mc2_task; /* RT task parameters for scheduling extensions * These parameters are inherited during clone and therefore must @@ -322,6 +323,9 @@ struct rt_param { /* Pointer to the page shared between userspace and kernel. */ struct control_page * ctrl_page; + + /* Mixed-criticality specific data */ + struct mc2_task* mc2_data; }; #endif diff --git a/include/litmus/unistd_32.h b/include/litmus/unistd_32.h index 5f6a2749c6a7..202f439a62ae 100644 --- a/include/litmus/unistd_32.h +++ b/include/litmus/unistd_32.h @@ -19,5 +19,6 @@ #define __NR_null_call __LSC(11) #define __NR_reservation_create __LSC(12) #define __NR_reservation_destroy __LSC(13) +#define __NR_set_mc2_task_param __LSC(14) -#define NR_litmus_syscalls 14 +#define NR_litmus_syscalls 15 diff --git a/include/litmus/unistd_64.h b/include/litmus/unistd_64.h index 3e6b1d330336..ba2c91c5bf8c 100644 --- a/include/litmus/unistd_64.h +++ b/include/litmus/unistd_64.h @@ -33,6 +33,7 @@ __SYSCALL(__NR_null_call, sys_null_call) __SYSCALL(__NR_reservation_create, sys_reservation_create) #define __NR_reservation_destroy __LSC(13) __SYSCALL(__NR_reservation_destroy, sys_reservation_destroy) +#define __NR_set_mc2_task_param __LSC(14) +__SYSCALL(__NR_set_mc2_task_param, sys_set_mc2_task_param) - -#define NR_litmus_syscalls 14 +#define NR_litmus_syscalls 15 -- cgit v1.2.2