diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-04-10 22:44:32 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-04-10 22:44:32 -0400 |
commit | b91f30c8f0e03ea4bf7ec861469819c5435eb2d9 (patch) | |
tree | e1c18d263a01e20b9c3f4651a82ff95ce1332d6a /litmus/rt_server.c | |
parent | d5b900860ddcfa271fbde9ea6cd9666704696a36 (diff) |
sched_color: Refactored for locking
Diffstat (limited to 'litmus/rt_server.c')
-rw-r--r-- | litmus/rt_server.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/litmus/rt_server.c b/litmus/rt_server.c new file mode 100644 index 000000000000..35f7d4dea079 --- /dev/null +++ b/litmus/rt_server.c | |||
@@ -0,0 +1,33 @@ | |||
1 | #include <litmus/rt_server.h> | ||
2 | |||
3 | |||
4 | static struct task_struct* default_server_take(struct rt_server *srv) | ||
5 | { | ||
6 | return __take_ready(srv->domain); | ||
7 | } | ||
8 | |||
9 | static void default_server_update(struct rt_server *srv) | ||
10 | { | ||
11 | } | ||
12 | |||
13 | void init_rt_server(struct rt_server *server, | ||
14 | int sid, rt_domain_t *domain, | ||
15 | need_preempt_t need_preempt, | ||
16 | server_requeue_t requeue, | ||
17 | server_update_t update, | ||
18 | server_take_t take) | ||
19 | { | ||
20 | if (!need_preempt || !requeue) | ||
21 | BUG_ON(1); | ||
22 | |||
23 | server->need_preempt = need_preempt; | ||
24 | server->requeue = requeue; | ||
25 | |||
26 | server->update = (update) ? update : default_server_update; | ||
27 | server->take = (take) ? take : default_server_take; | ||
28 | |||
29 | server->sid = sid; | ||
30 | server->linked = NULL; | ||
31 | server->domain = domain; | ||
32 | server->running = 0; | ||
33 | } | ||