diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2014-03-13 13:41:01 -0400 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2014-03-13 13:41:01 -0400 |
commit | b93e4210f9fa88450b1ffddf4307b41e6d87beff (patch) | |
tree | fc51be0885903bece8205c58f688560becdac06d | |
parent | d67113062e8de502868356b90a12e32b77212cea (diff) |
Make comparators take const operands.
This patch updates various parts of litmus that
utilize binheap and bheaps to use const operands.
-rw-r--r-- | include/litmus/edf_common.h | 20 | ||||
-rw-r--r-- | include/litmus/fp_common.h | 6 | ||||
-rw-r--r-- | include/litmus/sched_plugin.h | 6 | ||||
-rw-r--r-- | litmus/aux_tasks.c | 12 | ||||
-rw-r--r-- | litmus/edf_common.c | 36 | ||||
-rw-r--r-- | litmus/fp_common.c | 10 | ||||
-rw-r--r-- | litmus/nvidia_info.c | 4 | ||||
-rw-r--r-- | litmus/r2dglp_lock.c | 35 | ||||
-rw-r--r-- | litmus/rt_domain.c | 2 | ||||
-rw-r--r-- | litmus/sched_cedf.c | 28 | ||||
-rw-r--r-- | litmus/sched_gsn_edf.c | 8 | ||||
-rw-r--r-- | litmus/sched_plugin.c | 6 |
12 files changed, 87 insertions, 86 deletions
diff --git a/include/litmus/edf_common.h b/include/litmus/edf_common.h index e4b8b91e8d01..0eb7289f313b 100644 --- a/include/litmus/edf_common.h +++ b/include/litmus/edf_common.h | |||
@@ -15,21 +15,21 @@ | |||
15 | void edf_domain_init(rt_domain_t* rt, check_resched_needed_t resched, | 15 | void edf_domain_init(rt_domain_t* rt, check_resched_needed_t resched, |
16 | release_jobs_t release); | 16 | release_jobs_t release); |
17 | 17 | ||
18 | int edf_higher_prio(struct task_struct* first, struct task_struct* second); | 18 | int edf_higher_prio(const struct task_struct* first, const struct task_struct* second); |
19 | 19 | ||
20 | int edf_ready_order(struct bheap_node* a, struct bheap_node* b); | 20 | int edf_ready_order(const struct bheap_node* a, const struct bheap_node* b); |
21 | 21 | ||
22 | /* binheap_nodes must be embedded within 'struct litmus_lock' */ | 22 | /* binheap_nodes must be embedded within 'struct litmus_lock' */ |
23 | int edf_max_heap_order(struct binheap_node *a, struct binheap_node *b); | 23 | int edf_max_heap_order(const struct binheap_node *a, const struct binheap_node *b); |
24 | int edf_min_heap_order(struct binheap_node *a, struct binheap_node *b); | 24 | int edf_min_heap_order(const struct binheap_node *a, const struct binheap_node *b); |
25 | int edf_max_heap_base_priority_order(struct binheap_node *a, | 25 | int edf_max_heap_base_priority_order(const struct binheap_node *a, |
26 | struct binheap_node *b); | 26 | const struct binheap_node *b); |
27 | int edf_min_heap_base_priority_order(struct binheap_node *a, | 27 | int edf_min_heap_base_priority_order(const struct binheap_node *a, |
28 | struct binheap_node *b); | 28 | const struct binheap_node *b); |
29 | int edf_preemption_needed(rt_domain_t* rt, struct task_struct *t); | 29 | int edf_preemption_needed(rt_domain_t* rt, struct task_struct *t); |
30 | #ifdef CONFIG_LITMUS_NESTED_LOCKING | 30 | #ifdef CONFIG_LITMUS_NESTED_LOCKING |
31 | int __edf_higher_prio(struct task_struct* first, comparison_mode_t first_mode, | 31 | int __edf_higher_prio(const struct task_struct* first, comparison_mode_t first_mode, |
32 | struct task_struct* second, comparison_mode_t second_mode); | 32 | const struct task_struct* second, comparison_mode_t second_mode); |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | #endif | 35 | #endif |
diff --git a/include/litmus/fp_common.h b/include/litmus/fp_common.h index 19356c0fa6c1..e4ebb0b0b4ff 100644 --- a/include/litmus/fp_common.h +++ b/include/litmus/fp_common.h | |||
@@ -12,10 +12,10 @@ | |||
12 | void fp_domain_init(rt_domain_t* rt, check_resched_needed_t resched, | 12 | void fp_domain_init(rt_domain_t* rt, check_resched_needed_t resched, |
13 | release_jobs_t release); | 13 | release_jobs_t release); |
14 | 14 | ||
15 | int fp_higher_prio(struct task_struct* first, | 15 | int fp_higher_prio(const struct task_struct* first, |
16 | struct task_struct* second); | 16 | const struct task_struct* second); |
17 | 17 | ||
18 | int fp_ready_order(struct bheap_node* a, struct bheap_node* b); | 18 | int fp_ready_order(const struct bheap_node* a, const struct bheap_node* b); |
19 | 19 | ||
20 | #define FP_PRIO_BIT_WORDS (LITMUS_MAX_PRIORITY / BITS_PER_LONG) | 20 | #define FP_PRIO_BIT_WORDS (LITMUS_MAX_PRIORITY / BITS_PER_LONG) |
21 | 21 | ||
diff --git a/include/litmus/sched_plugin.h b/include/litmus/sched_plugin.h index fe15ce3e9e43..5a451859d281 100644 --- a/include/litmus/sched_plugin.h +++ b/include/litmus/sched_plugin.h | |||
@@ -63,7 +63,7 @@ typedef void (*task_cleanup_t) (struct task_struct *); | |||
63 | /**************************** misc ***************************/ | 63 | /**************************** misc ***************************/ |
64 | 64 | ||
65 | /* Called to compare the scheduling priorities between two tasks */ | 65 | /* Called to compare the scheduling priorities between two tasks */ |
66 | typedef int (*higher_prio_t)(struct task_struct* a, struct task_struct* b); | 66 | typedef int (*higher_prio_t)(const struct task_struct* a, const struct task_struct* b); |
67 | 67 | ||
68 | /************** locking and inheritance routines *************/ | 68 | /************** locking and inheritance routines *************/ |
69 | #ifdef CONFIG_LITMUS_LOCKING | 69 | #ifdef CONFIG_LITMUS_LOCKING |
@@ -94,8 +94,8 @@ typedef void (*nested_increase_prio_t)(struct task_struct* t, | |||
94 | typedef void (*nested_decrease_prio_t)(struct task_struct* t, | 94 | typedef void (*nested_decrease_prio_t)(struct task_struct* t, |
95 | struct task_struct* prio_inh, raw_spinlock_t *to_unlock, | 95 | struct task_struct* prio_inh, raw_spinlock_t *to_unlock, |
96 | unsigned long irqflags, int budget_triggered); | 96 | unsigned long irqflags, int budget_triggered); |
97 | typedef int (*__higher_prio_t)(struct task_struct* a, comparison_mode_t a_mod, | 97 | typedef int (*__higher_prio_t)(const struct task_struct* a, comparison_mode_t a_mod, |
98 | struct task_struct* b, comparison_mode_t b_mod); | 98 | const struct task_struct* b, comparison_mode_t b_mod); |
99 | #endif /* end LITMUS_NESTED_LOCKING */ | 99 | #endif /* end LITMUS_NESTED_LOCKING */ |
100 | 100 | ||
101 | #ifdef CONFIG_LITMUS_DGL_SUPPORT | 101 | #ifdef CONFIG_LITMUS_DGL_SUPPORT |
diff --git a/litmus/aux_tasks.c b/litmus/aux_tasks.c index a562dae87c75..1a085e226596 100644 --- a/litmus/aux_tasks.c +++ b/litmus/aux_tasks.c | |||
@@ -387,15 +387,15 @@ out: | |||
387 | return retval; | 387 | return retval; |
388 | } | 388 | } |
389 | 389 | ||
390 | static int aux_task_owner_max_priority_order(struct binheap_node *a, | 390 | static int aux_task_owner_max_priority_order(const struct binheap_node *a, |
391 | struct binheap_node *b) | 391 | const struct binheap_node *b) |
392 | { | 392 | { |
393 | struct task_struct *d_a = | 393 | const struct task_struct *d_a = |
394 | container_of(binheap_entry(a, struct rt_param, aux_task_owner_node), | 394 | container_of(binheap_entry(a, struct rt_param, aux_task_owner_node), |
395 | struct task_struct, rt_param); | 395 | struct task_struct, rt_param); |
396 | struct task_struct *d_b = | 396 | const struct task_struct *d_b = |
397 | container_of(binheap_entry(b, struct rt_param, aux_task_owner_node), | 397 | container_of(binheap_entry(b, struct rt_param, aux_task_owner_node), |
398 | struct task_struct, rt_param); | 398 | struct task_struct, rt_param); |
399 | 399 | ||
400 | BUG_ON(!d_a); | 400 | BUG_ON(!d_a); |
401 | BUG_ON(!d_b); | 401 | BUG_ON(!d_b); |
diff --git a/litmus/edf_common.c b/litmus/edf_common.c index e0d066e64504..eabd3bcb9e38 100644 --- a/litmus/edf_common.c +++ b/litmus/edf_common.c | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #ifdef CONFIG_EDF_TIE_BREAK_HASH | 25 | #ifdef CONFIG_EDF_TIE_BREAK_HASH |
26 | #include <linux/hash.h> | 26 | #include <linux/hash.h> |
27 | static inline long edf_hash(struct task_struct *t) | 27 | static inline long edf_hash(const struct task_struct *t) |
28 | { | 28 | { |
29 | /* pid is 32 bits, so normally we would shove that into the | 29 | /* pid is 32 bits, so normally we would shove that into the |
30 | * upper 32-bits and and put the job number in the bottom | 30 | * upper 32-bits and and put the job number in the bottom |
@@ -52,14 +52,14 @@ static inline long edf_hash(struct task_struct *t) | |||
52 | */ | 52 | */ |
53 | #ifdef CONFIG_LITMUS_NESTED_LOCKING | 53 | #ifdef CONFIG_LITMUS_NESTED_LOCKING |
54 | int __edf_higher_prio( | 54 | int __edf_higher_prio( |
55 | struct task_struct* first, comparison_mode_t first_mode, | 55 | const struct task_struct* first, comparison_mode_t first_mode, |
56 | struct task_struct* second, comparison_mode_t second_mode) | 56 | const struct task_struct* second, comparison_mode_t second_mode) |
57 | #else | 57 | #else |
58 | int edf_higher_prio(struct task_struct* first, struct task_struct* second) | 58 | int edf_higher_prio(const struct task_struct* first, const struct task_struct* second) |
59 | #endif | 59 | #endif |
60 | { | 60 | { |
61 | struct task_struct *first_task = first; | 61 | const struct task_struct *first_task = first; |
62 | struct task_struct *second_task = second; | 62 | const struct task_struct *second_task = second; |
63 | 63 | ||
64 | /* There is no point in comparing a task to itself. */ | 64 | /* There is no point in comparing a task to itself. */ |
65 | if (unlikely(first && first == second)) { | 65 | if (unlikely(first && first == second)) { |
@@ -326,47 +326,47 @@ klmirqd_tie_break: | |||
326 | } | 326 | } |
327 | 327 | ||
328 | #ifdef CONFIG_LITMUS_NESTED_LOCKING | 328 | #ifdef CONFIG_LITMUS_NESTED_LOCKING |
329 | int edf_higher_prio(struct task_struct* first, struct task_struct* second) | 329 | int edf_higher_prio(const struct task_struct* first, const struct task_struct* second) |
330 | { | 330 | { |
331 | return __edf_higher_prio(first, EFFECTIVE, second, EFFECTIVE); | 331 | return __edf_higher_prio(first, EFFECTIVE, second, EFFECTIVE); |
332 | } | 332 | } |
333 | 333 | ||
334 | int edf_max_heap_order(struct binheap_node *a, struct binheap_node *b) | 334 | int edf_max_heap_order(const struct binheap_node *a, const struct binheap_node *b) |
335 | { | 335 | { |
336 | struct nested_info *l_a = (struct nested_info *)binheap_entry(a, | 336 | const struct nested_info *l_a = (struct nested_info *)binheap_entry(a, |
337 | struct nested_info, hp_binheap_node); | 337 | struct nested_info, hp_binheap_node); |
338 | struct nested_info *l_b = (struct nested_info *)binheap_entry(b, | 338 | const struct nested_info *l_b = (struct nested_info *)binheap_entry(b, |
339 | struct nested_info, hp_binheap_node); | 339 | struct nested_info, hp_binheap_node); |
340 | 340 | ||
341 | return __edf_higher_prio(l_a->hp_waiter_eff_prio, EFFECTIVE, | 341 | return __edf_higher_prio(l_a->hp_waiter_eff_prio, EFFECTIVE, |
342 | l_b->hp_waiter_eff_prio, EFFECTIVE); | 342 | l_b->hp_waiter_eff_prio, EFFECTIVE); |
343 | } | 343 | } |
344 | 344 | ||
345 | int edf_min_heap_order(struct binheap_node *a, struct binheap_node *b) | 345 | int edf_min_heap_order(const struct binheap_node *a, const struct binheap_node *b) |
346 | { | 346 | { |
347 | return edf_max_heap_order(b, a); /* swap comparison */ | 347 | return edf_max_heap_order(b, a); /* swap comparison */ |
348 | } | 348 | } |
349 | 349 | ||
350 | int edf_max_heap_base_priority_order(struct binheap_node *a, | 350 | int edf_max_heap_base_priority_order(const struct binheap_node *a, |
351 | struct binheap_node *b) | 351 | const struct binheap_node *b) |
352 | { | 352 | { |
353 | struct nested_info *l_a = (struct nested_info *)binheap_entry(a, | 353 | const struct nested_info *l_a = (struct nested_info *)binheap_entry(a, |
354 | struct nested_info, hp_binheap_node); | 354 | struct nested_info, hp_binheap_node); |
355 | struct nested_info *l_b = (struct nested_info *)binheap_entry(b, | 355 | const struct nested_info *l_b = (struct nested_info *)binheap_entry(b, |
356 | struct nested_info, hp_binheap_node); | 356 | struct nested_info, hp_binheap_node); |
357 | 357 | ||
358 | return __edf_higher_prio(l_a->hp_waiter_eff_prio, BASE, | 358 | return __edf_higher_prio(l_a->hp_waiter_eff_prio, BASE, |
359 | l_b->hp_waiter_eff_prio, BASE); | 359 | l_b->hp_waiter_eff_prio, BASE); |
360 | } | 360 | } |
361 | 361 | ||
362 | int edf_min_heap_base_priority_order(struct binheap_node *a, | 362 | int edf_min_heap_base_priority_order(const struct binheap_node *a, |
363 | struct binheap_node *b) | 363 | const struct binheap_node *b) |
364 | { | 364 | { |
365 | return edf_max_heap_base_priority_order(b, a); /* swap comparison */ | 365 | return edf_max_heap_base_priority_order(b, a); /* swap comparison */ |
366 | } | 366 | } |
367 | #endif | 367 | #endif |
368 | 368 | ||
369 | int edf_ready_order(struct bheap_node* a, struct bheap_node* b) | 369 | int edf_ready_order(const struct bheap_node* a, const struct bheap_node* b) |
370 | { | 370 | { |
371 | return edf_higher_prio(bheap2task(a), bheap2task(b)); | 371 | return edf_higher_prio(bheap2task(a), bheap2task(b)); |
372 | } | 372 | } |
diff --git a/litmus/fp_common.c b/litmus/fp_common.c index 964a4729deff..1e97175756c7 100644 --- a/litmus/fp_common.c +++ b/litmus/fp_common.c | |||
@@ -19,11 +19,11 @@ | |||
19 | * | 19 | * |
20 | * both first and second may be NULL | 20 | * both first and second may be NULL |
21 | */ | 21 | */ |
22 | int fp_higher_prio(struct task_struct* first, | 22 | int fp_higher_prio(const struct task_struct* first, |
23 | struct task_struct* second) | 23 | const struct task_struct* second) |
24 | { | 24 | { |
25 | struct task_struct *first_task = first; | 25 | const struct task_struct *first_task = first; |
26 | struct task_struct *second_task = second; | 26 | const struct task_struct *second_task = second; |
27 | 27 | ||
28 | /* There is no point in comparing a task to itself. */ | 28 | /* There is no point in comparing a task to itself. */ |
29 | if (unlikely(first && first == second)) { | 29 | if (unlikely(first && first == second)) { |
@@ -80,7 +80,7 @@ int fp_higher_prio(struct task_struct* first, | |||
80 | return 0; | 80 | return 0; |
81 | } | 81 | } |
82 | 82 | ||
83 | int fp_ready_order(struct bheap_node* a, struct bheap_node* b) | 83 | int fp_ready_order(const struct bheap_node* a, const struct bheap_node* b) |
84 | { | 84 | { |
85 | return fp_higher_prio(bheap2task(a), bheap2task(b)); | 85 | return fp_higher_prio(bheap2task(a), bheap2task(b)); |
86 | } | 86 | } |
diff --git a/litmus/nvidia_info.c b/litmus/nvidia_info.c index d2fe0a6c1012..fd9b0a2a9bc6 100644 --- a/litmus/nvidia_info.c +++ b/litmus/nvidia_info.c | |||
@@ -642,8 +642,8 @@ static enum hrtimer_restart nvklmirqd_timer_func(struct hrtimer *timer) | |||
642 | #endif | 642 | #endif |
643 | 643 | ||
644 | 644 | ||
645 | static int gpu_owner_max_priority_order(struct binheap_node *a, | 645 | static int gpu_owner_max_priority_order(const struct binheap_node *a, |
646 | struct binheap_node *b) | 646 | const struct binheap_node *b) |
647 | { | 647 | { |
648 | struct task_struct *d_a = | 648 | struct task_struct *d_a = |
649 | container_of( | 649 | container_of( |
diff --git a/litmus/r2dglp_lock.c b/litmus/r2dglp_lock.c index fd03b43c97cf..e37fafb8c8cd 100644 --- a/litmus/r2dglp_lock.c +++ b/litmus/r2dglp_lock.c | |||
@@ -16,11 +16,11 @@ | |||
16 | 16 | ||
17 | #define R2DGLP_INVAL_DISTANCE 0x7FFFFFFF | 17 | #define R2DGLP_INVAL_DISTANCE 0x7FFFFFFF |
18 | 18 | ||
19 | int r2dglp_max_heap_base_priority_order(struct binheap_node *a, | 19 | int r2dglp_max_heap_base_priority_order(const struct binheap_node *a, |
20 | struct binheap_node *b) | 20 | const struct binheap_node *b) |
21 | { | 21 | { |
22 | r2dglp_heap_node_t *d_a = binheap_entry(a, r2dglp_heap_node_t, node); | 22 | const r2dglp_heap_node_t *d_a = binheap_entry(a, r2dglp_heap_node_t, node); |
23 | r2dglp_heap_node_t *d_b = binheap_entry(b, r2dglp_heap_node_t, node); | 23 | const r2dglp_heap_node_t *d_b = binheap_entry(b, r2dglp_heap_node_t, node); |
24 | 24 | ||
25 | BUG_ON(!d_a); | 25 | BUG_ON(!d_a); |
26 | BUG_ON(!d_b); | 26 | BUG_ON(!d_b); |
@@ -28,33 +28,34 @@ int r2dglp_max_heap_base_priority_order(struct binheap_node *a, | |||
28 | return litmus->__compare(d_a->task, BASE, d_b->task, BASE); | 28 | return litmus->__compare(d_a->task, BASE, d_b->task, BASE); |
29 | } | 29 | } |
30 | 30 | ||
31 | int r2dglp_min_heap_base_priority_order(struct binheap_node *a, | 31 | int r2dglp_min_heap_base_priority_order(const struct binheap_node *a, |
32 | struct binheap_node *b) | 32 | const struct binheap_node *b) |
33 | { | 33 | { |
34 | r2dglp_heap_node_t *d_a = binheap_entry(a, r2dglp_heap_node_t, node); | 34 | const r2dglp_heap_node_t *d_a = binheap_entry(a, r2dglp_heap_node_t, node); |
35 | r2dglp_heap_node_t *d_b = binheap_entry(b, r2dglp_heap_node_t, node); | 35 | const r2dglp_heap_node_t *d_b = binheap_entry(b, r2dglp_heap_node_t, node); |
36 | 36 | ||
37 | return litmus->__compare(d_b->task, BASE, d_a->task, BASE); | 37 | return litmus->__compare(d_b->task, BASE, d_a->task, BASE); |
38 | } | 38 | } |
39 | 39 | ||
40 | int r2dglp_donor_max_heap_base_priority_order(struct binheap_node *a, | 40 | int r2dglp_donor_max_heap_base_priority_order(const struct binheap_node *a, |
41 | struct binheap_node *b) | 41 | const struct binheap_node *b) |
42 | { | 42 | { |
43 | r2dglp_wait_state_t *d_a = binheap_entry(a, r2dglp_wait_state_t, node); | 43 | const r2dglp_wait_state_t *d_a = binheap_entry(a, r2dglp_wait_state_t, node); |
44 | r2dglp_wait_state_t *d_b = binheap_entry(b, r2dglp_wait_state_t, node); | 44 | const r2dglp_wait_state_t *d_b = binheap_entry(b, r2dglp_wait_state_t, node); |
45 | 45 | ||
46 | return litmus->__compare(d_a->task, BASE, d_b->task, BASE); | 46 | return litmus->__compare(d_a->task, BASE, d_b->task, BASE); |
47 | } | 47 | } |
48 | 48 | ||
49 | 49 | ||
50 | int r2dglp_min_heap_donee_order(struct binheap_node *a, | 50 | int r2dglp_min_heap_donee_order(const struct binheap_node *a, |
51 | struct binheap_node *b) | 51 | const struct binheap_node *b) |
52 | { | 52 | { |
53 | struct task_struct *prio_a, *prio_b; | 53 | const struct task_struct *prio_a; |
54 | const struct task_struct *prio_b; | ||
54 | 55 | ||
55 | r2dglp_donee_heap_node_t *d_a = | 56 | const r2dglp_donee_heap_node_t *d_a = |
56 | binheap_entry(a, r2dglp_donee_heap_node_t, node); | 57 | binheap_entry(a, r2dglp_donee_heap_node_t, node); |
57 | r2dglp_donee_heap_node_t *d_b = | 58 | const r2dglp_donee_heap_node_t *d_b = |
58 | binheap_entry(b, r2dglp_donee_heap_node_t, node); | 59 | binheap_entry(b, r2dglp_donee_heap_node_t, node); |
59 | 60 | ||
60 | if(!d_a->donor_info) { | 61 | if(!d_a->donor_info) { |
diff --git a/litmus/rt_domain.c b/litmus/rt_domain.c index c5e7ca592d2b..db43c0a5e9d9 100644 --- a/litmus/rt_domain.c +++ b/litmus/rt_domain.c | |||
@@ -35,7 +35,7 @@ static int dummy_resched(rt_domain_t *rt) | |||
35 | return 0; | 35 | return 0; |
36 | } | 36 | } |
37 | 37 | ||
38 | static int dummy_order(struct bheap_node* a, struct bheap_node* b) | 38 | static int dummy_order(const struct bheap_node* a, const struct bheap_node* b) |
39 | { | 39 | { |
40 | return 0; | 40 | return 0; |
41 | } | 41 | } |
diff --git a/litmus/sched_cedf.c b/litmus/sched_cedf.c index ed391ec0de55..b95ff3967633 100644 --- a/litmus/sched_cedf.c +++ b/litmus/sched_cedf.c | |||
@@ -159,11 +159,11 @@ static int num_gpu_clusters; | |||
159 | static unsigned int gpu_cluster_size; | 159 | static unsigned int gpu_cluster_size; |
160 | #endif | 160 | #endif |
161 | 161 | ||
162 | inline static struct task_struct* binheap_node_to_task(struct binheap_node *bn) | 162 | inline static const struct task_struct* binheap_node_to_task(const struct binheap_node *bn) |
163 | { | 163 | { |
164 | struct budget_tracker *bt = | 164 | const struct budget_tracker *bt = |
165 | binheap_entry(bn, struct budget_tracker, top_m_node); | 165 | binheap_entry(bn, struct budget_tracker, top_m_node); |
166 | struct task_struct *t = | 166 | const struct task_struct *t = |
167 | container_of( | 167 | container_of( |
168 | container_of(bt, struct rt_param, budget), | 168 | container_of(bt, struct rt_param, budget), |
169 | struct task_struct, | 169 | struct task_struct, |
@@ -171,19 +171,19 @@ inline static struct task_struct* binheap_node_to_task(struct binheap_node *bn) | |||
171 | return t; | 171 | return t; |
172 | } | 172 | } |
173 | 173 | ||
174 | static int cedf_max_heap_base_priority_order(struct binheap_node *a, | 174 | static int cedf_max_heap_base_priority_order(const struct binheap_node *a, |
175 | struct binheap_node *b) | 175 | const struct binheap_node *b) |
176 | { | 176 | { |
177 | struct task_struct* t_a = binheap_node_to_task(a); | 177 | const struct task_struct* t_a = binheap_node_to_task(a); |
178 | struct task_struct* t_b = binheap_node_to_task(b); | 178 | const struct task_struct* t_b = binheap_node_to_task(b); |
179 | return __edf_higher_prio(t_a, BASE, t_b, BASE); | 179 | return __edf_higher_prio(t_a, BASE, t_b, BASE); |
180 | } | 180 | } |
181 | 181 | ||
182 | static int cedf_min_heap_base_priority_order(struct binheap_node *a, | 182 | static int cedf_min_heap_base_priority_order(const struct binheap_node *a, |
183 | struct binheap_node *b) | 183 | const struct binheap_node *b) |
184 | { | 184 | { |
185 | struct task_struct* t_a = binheap_node_to_task(a); | 185 | const struct task_struct* t_a = binheap_node_to_task(a); |
186 | struct task_struct* t_b = binheap_node_to_task(b); | 186 | const struct task_struct* t_b = binheap_node_to_task(b); |
187 | return __edf_higher_prio(t_b, BASE, t_a, BASE); | 187 | return __edf_higher_prio(t_b, BASE, t_a, BASE); |
188 | } | 188 | } |
189 | 189 | ||
@@ -299,10 +299,10 @@ static raw_spinlock_t* cedf_get_dgl_spinlock(struct task_struct *t) | |||
299 | */ | 299 | */ |
300 | #define VERBOSE_INIT | 300 | #define VERBOSE_INIT |
301 | 301 | ||
302 | static int cpu_lower_prio(struct binheap_node *_a, struct binheap_node *_b) | 302 | static int cpu_lower_prio(const struct binheap_node *_a, const struct binheap_node *_b) |
303 | { | 303 | { |
304 | cpu_entry_t *a = binheap_entry(_a, cpu_entry_t, hn); | 304 | const cpu_entry_t *a = binheap_entry(_a, cpu_entry_t, hn); |
305 | cpu_entry_t *b = binheap_entry(_b, cpu_entry_t, hn); | 305 | const cpu_entry_t *b = binheap_entry(_b, cpu_entry_t, hn); |
306 | 306 | ||
307 | /* Note that a and b are inverted: we want the lowest-priority CPU at | 307 | /* Note that a and b are inverted: we want the lowest-priority CPU at |
308 | * the top of the heap. | 308 | * the top of the heap. |
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c index ae322e75756e..c7f65abe6539 100644 --- a/litmus/sched_gsn_edf.c +++ b/litmus/sched_gsn_edf.c | |||
@@ -126,11 +126,11 @@ static rt_domain_t gsnedf; | |||
126 | #define WANT_ALL_SCHED_EVENTS | 126 | #define WANT_ALL_SCHED_EVENTS |
127 | */ | 127 | */ |
128 | 128 | ||
129 | static int cpu_lower_prio(struct bheap_node *_a, struct bheap_node *_b) | 129 | static int cpu_lower_prio(const struct bheap_node *_a, const struct bheap_node *_b) |
130 | { | 130 | { |
131 | cpu_entry_t *a, *b; | 131 | const cpu_entry_t *a = _a->value; |
132 | a = _a->value; | 132 | const cpu_entry_t *b = _b->value; |
133 | b = _b->value; | 133 | |
134 | /* Note that a and b are inverted: we want the lowest-priority CPU at | 134 | /* Note that a and b are inverted: we want the lowest-priority CPU at |
135 | * the top of the heap. | 135 | * the top of the heap. |
136 | */ | 136 | */ |
diff --git a/litmus/sched_plugin.c b/litmus/sched_plugin.c index 54613534c7f0..333403b12654 100644 --- a/litmus/sched_plugin.c +++ b/litmus/sched_plugin.c | |||
@@ -123,7 +123,7 @@ static long litmus_dummy_get_domain_proc_info(struct domain_proc_info **d) | |||
123 | } | 123 | } |
124 | 124 | ||
125 | #ifdef CONFIG_LITMUS_LOCKING | 125 | #ifdef CONFIG_LITMUS_LOCKING |
126 | static int litmus_dummy_compare(struct task_struct* a, struct task_struct* b) | 126 | static int litmus_dummy_compare(const struct task_struct* a, const struct task_struct* b) |
127 | { | 127 | { |
128 | TRACE_CUR("WARNING: Dummy compare function called!\n"); | 128 | TRACE_CUR("WARNING: Dummy compare function called!\n"); |
129 | return 0; | 129 | return 0; |
@@ -175,8 +175,8 @@ static void litmus_dummy_nested_decrease_prio(struct task_struct* t, | |||
175 | } | 175 | } |
176 | 176 | ||
177 | static int litmus_dummy___compare( | 177 | static int litmus_dummy___compare( |
178 | struct task_struct* a, comparison_mode_t a_mod, | 178 | const struct task_struct* a, comparison_mode_t a_mod, |
179 | struct task_struct* b, comparison_mode_t b_mode) | 179 | const struct task_struct* b, comparison_mode_t b_mode) |
180 | { | 180 | { |
181 | TRACE_CUR("WARNING: Dummy compare function called!\n"); | 181 | TRACE_CUR("WARNING: Dummy compare function called!\n"); |
182 | return 0; | 182 | return 0; |