diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-05-03 16:46:21 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-05-03 16:46:21 -0400 |
commit | b71e2f3c0796b66d118fd0166ae80c7d9a547740 (patch) | |
tree | e6d5843888e3ba43cbc9b5b705c892b00c88f2f1 /include | |
parent | ff87ca319b0cd76f96f78f0347ad9aaa967bb16e (diff) | |
parent | 7bd1ec8308f63bffda37127d02a178c5fc91dac3 (diff) |
Removed mixed-criticality codewip-color-jlh
Diffstat (limited to 'include')
-rw-r--r-- | include/color.h | 9 | ||||
-rw-r--r-- | include/internal.h | 5 | ||||
-rw-r--r-- | include/litmus.h | 1 | ||||
-rw-r--r-- | include/perfcounters.h | 36 |
4 files changed, 51 insertions, 0 deletions
diff --git a/include/color.h b/include/color.h new file mode 100644 index 0000000..dc1b1cc --- /dev/null +++ b/include/color.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef COLOR_H | ||
2 | #define COLOR_H | ||
3 | |||
4 | #include <stddef.h> /* for size_t */ | ||
5 | |||
6 | int map_color_ctrl(void **); | ||
7 | void* color_malloc(size_t); | ||
8 | |||
9 | #endif | ||
diff --git a/include/internal.h b/include/internal.h index 07253b7..f30ce61 100644 --- a/include/internal.h +++ b/include/internal.h | |||
@@ -18,8 +18,13 @@ int __launch_rt_task(rt_fn_t rt_prog, void *rt_arg, | |||
18 | } | 18 | } |
19 | 19 | ||
20 | 20 | ||
21 | /* taken from the kernel */ | ||
22 | |||
21 | #define likely(x) __builtin_expect((x), 1) | 23 | #define likely(x) __builtin_expect((x), 1) |
22 | #define unlikely(x) __builtin_expect((x), 0) | 24 | #define unlikely(x) __builtin_expect((x), 0) |
23 | 25 | ||
26 | #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) | ||
27 | #define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_ZERO(condition)) | ||
28 | |||
24 | #endif | 29 | #endif |
25 | 30 | ||
diff --git a/include/litmus.h b/include/litmus.h index 045579e..82e2ba2 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
@@ -99,6 +99,7 @@ task_class_t str2class(const char* str); | |||
99 | /* non-preemptive section support */ | 99 | /* non-preemptive section support */ |
100 | void enter_np(void); | 100 | void enter_np(void); |
101 | void exit_np(void); | 101 | void exit_np(void); |
102 | int requested_to_preempt(void); | ||
102 | 103 | ||
103 | /* task system support */ | 104 | /* task system support */ |
104 | int wait_for_ts_release(void); | 105 | int wait_for_ts_release(void); |
diff --git a/include/perfcounters.h b/include/perfcounters.h new file mode 100644 index 0000000..03f94fb --- /dev/null +++ b/include/perfcounters.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef PERFCOUNTERS_H | ||
2 | #define PERFCOUNTERS_H | ||
3 | |||
4 | #include <stdint.h> | ||
5 | |||
6 | #include "../../litmus-rt/include/linux/perf_event.h" | ||
7 | |||
8 | #define NR_PERF_COUNTERS 4 | ||
9 | |||
10 | /* | ||
11 | * Retain this information with a performance counter file descriptor. | ||
12 | */ | ||
13 | struct perf_counter { | ||
14 | int fd; | ||
15 | enum perf_type_id type; | ||
16 | uint64_t config; | ||
17 | }; | ||
18 | |||
19 | |||
20 | /* | ||
21 | * Initialize a set of counters for a CPU. | ||
22 | * | ||
23 | * This is NOT thread safe! | ||
24 | * | ||
25 | * @cpu CPU | ||
26 | * @group_leader group leader PID or -1 make a new group | ||
27 | * @perf_counter array | ||
28 | * @return 0 or error | ||
29 | */ | ||
30 | int setup_cpu_perf(const int, const int, struct perf_counter*); | ||
31 | |||
32 | const char* get_perf_name(const struct perf_counter*); | ||
33 | |||
34 | int read_perf_counter(const struct perf_counter*, uint64_t*); | ||
35 | |||
36 | #endif | ||