Skip to content
Snippets Groups Projects
Commit 3772b6a0 authored by ManuelWelte's avatar ManuelWelte
Browse files

Check errors; Remove warnings

parent b63a6a0e
No related branches found
No related tags found
No related merge requests found
...@@ -14,22 +14,37 @@ typedef struct pb_plan pb_plan_t; ...@@ -14,22 +14,37 @@ typedef struct pb_plan pb_plan_t;
typedef struct pb_plan_info pb_plan_info_t; typedef struct pb_plan_info pb_plan_info_t;
SYSCALL_DEFINE1(pb_set_plan_debug, pb_plan_info_t*, plan_info) { SYSCALL_DEFINE1(pb_set_plan_debug, pb_plan_info_t*, plan_info) {
pb_plan_info_t _plan_info; pb_plan_info_t _plan_info;
struct task_struct* task;
struct rq* rq;
struct pb_rq* pb_rq;
unsigned long copied;
unsigned int i;
int res; int res;
res = copy_from_user(&_plan_info, plan_info, sizeof(pb_plan_info_t));
struct task_struct* task = find_task_by_vpid(_plan_info.pid); copied = copy_from_user(&_plan_info, plan_info, sizeof(pb_plan_info_t));
if(copied != sizeof(pb_plan_info_t)){
return -1;
}
task = find_task_by_vpid(_plan_info.pid);
if(!task) {
return -1;
}
task->sched_class = &pb_sched_class; task->sched_class = &pb_sched_class;
struct rq* rq;
rq = this_rq(); rq = this_rq();
struct pb_rq *pb_rq = &rq->pb; pb_rq = &rq->pb;
set_pb_plan_size(pb_rq, _plan_info.num_tasks); set_pb_plan_size(pb_rq, _plan_info.num_tasks);
unsigned int i;
for(i = 0; i < _plan_info.num_tasks; i++ ) { for(i = 0; i < _plan_info.num_tasks; i++ ) {
set_pb_plan_entry( set_pb_plan_entry(
pb_rq, pb_rq,
...@@ -40,10 +55,15 @@ SYSCALL_DEFINE1(pb_set_plan_debug, pb_plan_info_t*, plan_info) { ...@@ -40,10 +55,15 @@ SYSCALL_DEFINE1(pb_set_plan_debug, pb_plan_info_t*, plan_info) {
); );
} }
pb_submit_plan(rq); res = pb_submit_plan(rq);
if(res == -1) {
return res;
}
// TODO: // TODO:
// - perf_event stuff // - perf_event stuff
// - syscall for error message retrieval?
// - ... // - ...
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment