From fbd02670f0fef4b1b47585d670a56af33a267399 Mon Sep 17 00:00:00 2001 From: Namhoon Kim Date: Tue, 19 Apr 2016 14:25:35 -0400 Subject: Add admission check --- litmus/Kconfig | 1 + litmus/litmus.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/litmus/Kconfig b/litmus/Kconfig index 81daf35d9432..6e0f77c3bb8f 100644 --- a/litmus/Kconfig +++ b/litmus/Kconfig @@ -375,6 +375,7 @@ endmenu config PGMRT_SUPPORT bool "Support for PGM^RT API" default y + depends on LITMUS_LOCKING && ALLOW_EARLY_RELEASE help This option enables support for PGM^RT API. The source code of PGM^RT can be found https://github.com/GElliott/pgm . This option adds some diff --git a/litmus/litmus.c b/litmus/litmus.c index 702999191203..0f122e1e7ec1 100644 --- a/litmus/litmus.c +++ b/litmus/litmus.c @@ -168,6 +168,14 @@ asmlinkage long sys_set_rt_task_param(pid_t pid, struct rt_task __user * param) pid, tp.budget_policy); goto out_unlock; } +#ifdef CONFIG_PGMRT_SUPPORT + if (tp.pgm_type < PGM_NOT_A_NODE || tp.pgm_type > PGM_INTERNAL) { + printk(KERN_INFO "litmus: real-time task %d rejected " + "because of unknown PGM node type specified (%d)\n", + pid, tp.pgm_type); + goto out_unlock; + } +#endif target->rt_param.task_params = tp; -- cgit v1.2.2