diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2011-08-29 22:22:54 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2011-08-29 22:22:54 -0400 |
commit | d5e965b0074d6ef10f5a77112fc3671613a2150f (patch) | |
tree | b11079f42a7f20b58b2410bdf2e886d038c28e91 /include | |
parent | 6dd87915584e687f014a546a83ec56a0396e2eb5 (diff) |
missed files
Diffstat (limited to 'include')
-rw-r--r-- | include/litmus/domain.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/litmus/domain.h b/include/litmus/domain.h new file mode 100644 index 000000000000..eeef068d9ce2 --- /dev/null +++ b/include/litmus/domain.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /** | ||
2 | * --Todo-- | ||
3 | * Naming: this should become rt_domain while the old rt_domain should be | ||
4 | * changed to sd_domain (sporadic) or pd_domain (periodic). | ||
5 | */ | ||
6 | #ifndef _LITMUS_DOMAIN_H_ | ||
7 | #define _LITMUS_DOMAIN_H_ | ||
8 | |||
9 | struct domain; | ||
10 | |||
11 | typedef void (*requeue_t)(struct domain*, struct task_struct*); | ||
12 | typedef struct task_struct* (*peek_ready_t)(struct domain*); | ||
13 | typedef struct task_struct* (*take_ready_t)(struct domain*); | ||
14 | typedef int (*preempt_needed_t)(struct domain*, struct task_struct*); | ||
15 | |||
16 | typedef struct domain { | ||
17 | raw_spinlock_t* lock; /* for coarse serialization */ | ||
18 | struct list_head list; /* list membership */ | ||
19 | void* data; /* implementation-specific data */ | ||
20 | |||
21 | /* add a task to the domain */ | ||
22 | requeue_t requeue; | ||
23 | /* return next ready task */ | ||
24 | peek_ready_t peek_ready; | ||
25 | /* remove and return next ready task */ | ||
26 | take_ready_t take_ready; | ||
27 | /* return true if the domain has a higher priority ready task */ | ||
28 | preempt_needed_t preempt_needed; | ||
29 | } domain_t; | ||
30 | |||
31 | void domain_init(domain_t *dom, raw_spinlock_t *lock, | ||
32 | requeue_t requeue, | ||
33 | peek_ready_t peek_ready, | ||
34 | take_ready_t take_ready, | ||
35 | preempt_needed_t preempt_needed); | ||
36 | |||
37 | #endif | ||