aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus/color.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/litmus/color.h')
-rw-r--r--include/litmus/color.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/include/litmus/color.h b/include/litmus/color.h
new file mode 100644
index 000000000000..eefb6c6dddf5
--- /dev/null
+++ b/include/litmus/color.h
@@ -0,0 +1,51 @@
1#ifndef LITMUS_COLOR_H
2#define LITMUS_COLOR_H
3
4#ifdef __KERNEL__
5
6#define ONE_COLOR_LEN 11
7#define ONE_COLOR_FMT "%4lu: %4d\n"
8
9struct color_cache_info {
10 unsigned long size;
11 unsigned long line_size;
12 unsigned long ways;
13 unsigned long sets;
14 unsigned long nr_colors;
15};
16
17/* defined in litmus/color.c */
18extern struct color_cache_info color_cache_info;
19extern unsigned long color_chunk;
20
21struct page* get_colored_page(unsigned long);
22void add_page_to_color_list(struct page*);
23void add_page_to_alloced_list(struct page*, struct vm_area_struct*);
24void reclaim_pages(struct vm_area_struct*);
25
26int color_server_params(int cpu, unsigned long *wcet, unsigned long *period);
27
28int color_add_pages_handler(struct ctl_table *, int, void __user *,
29 size_t *, loff_t *);
30int color_nr_pages_handler(struct ctl_table *, int, void __user *,
31 size_t *, loff_t *);
32int color_reclaim_pages_handler(struct ctl_table *, int, void __user *,
33 size_t *, loff_t *);
34
35#ifdef CONFIG_LOCKDEP
36#define LITMUS_LOCKDEP_NAME_MAX_LEN 50
37#define LOCKDEP_DYNAMIC_ALLOC(lock, key, name_buf, fmt, args...) \
38 do { \
39 snprintf(name_buf, LITMUS_LOCKDEP_NAME_MAX_LEN, \
40 fmt, ## args); \
41 lockdep_set_class_and_name(lock, key, name_buf); \
42 } while (0)
43#else
44#define LITMUS_LOCKDEP_NAME_MAX_LEN 0
45#define LOCKDEP_DYNAMIC_ALLOC(lock, key, name_buf, fmt, args) \
46 do { (void)(key); } while (0)
47#endif
48
49#endif
50
51#endif