diff options
Diffstat (limited to 'include/litmus/affinity.h')
-rw-r--r-- | include/litmus/affinity.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/include/litmus/affinity.h b/include/litmus/affinity.h index 5eee0eaa170d..ca2e442eb547 100644 --- a/include/litmus/affinity.h +++ b/include/litmus/affinity.h | |||
@@ -24,12 +24,12 @@ void init_topology(void); /* called by Litmus module's _init_litmus() */ | |||
24 | 24 | ||
25 | /* Works like: | 25 | /* Works like: |
26 | void get_nearest_available_cpu( | 26 | void get_nearest_available_cpu( |
27 | cpu_entry_t* nearest, | 27 | cpu_entry_t **nearest, |
28 | cpu_entry_t* start, | 28 | cpu_entry_t *start, |
29 | cpu_entry_t* entries, | 29 | cpu_entry_t *entries, |
30 | int release_master) | 30 | int release_master) |
31 | 31 | ||
32 | Set release_master = -1 for no RM. | 32 | Set release_master = NO_CPU for no Release Master. |
33 | 33 | ||
34 | We use a macro here to exploit the fact that C-EDF and G-EDF | 34 | We use a macro here to exploit the fact that C-EDF and G-EDF |
35 | have similar structures for their cpu_entry_t structs, even though | 35 | have similar structures for their cpu_entry_t structs, even though |
@@ -48,13 +48,14 @@ dissertation.) | |||
48 | } else { \ | 48 | } else { \ |
49 | int __level; \ | 49 | int __level; \ |
50 | int __cpu; \ | 50 | int __cpu; \ |
51 | struct neighborhood* __neighbors = &neigh_info[(start)->cpu]; \ | 51 | int __release_master = ((release_master) == NO_CPU) ? -1 : (release_master); \ |
52 | struct neighborhood *__neighbors = &neigh_info[(start)->cpu]; \ | ||
52 | \ | 53 | \ |
53 | for (__level = 0; (__level < NUM_CACHE_LEVELS) && !(nearest); ++__level) { \ | 54 | for (__level = 0; (__level < NUM_CACHE_LEVELS) && !(nearest); ++__level) { \ |
54 | if (__neighbors->size[__level] > 1) { \ | 55 | if (__neighbors->size[__level] > 1) { \ |
55 | for_each_cpu(__cpu, __neighbors->neighbors[__level]) { \ | 56 | for_each_cpu(__cpu, __neighbors->neighbors[__level]) { \ |
56 | if (__cpu != (release_master)) { \ | 57 | if (__cpu != __release_master) { \ |
57 | cpu_entry_t* __entry = &per_cpu((entries), __cpu); \ | 58 | cpu_entry_t *__entry = &per_cpu((entries), __cpu); \ |
58 | if (!__entry->linked) { \ | 59 | if (!__entry->linked) { \ |
59 | (nearest) = __entry; \ | 60 | (nearest) = __entry; \ |
60 | break; \ | 61 | break; \ |