BXE: min->MIN, plus an spatch
[akaros.git] / kern / arch / x86 / colored_page_alloc.h
1 /*
2  * Copyright (c) 2009 The Regents of the University  of California.  
3  * See the COPYRIGHT files at the top of this source tree for full 
4  * license information.
5  */
6 /**
7  * @author Kevin Klues <klueska@cs.berkeley.edu>
8  */
9  
10 #ifndef ROS_KERN_ARCH_COLORED_PAGE_ALLOC_H
11 #define ROS_KERN_ARCH_COLORED_PAGE_ALLOC_H
12
13 /********** Page Coloring Related Macros ************/
14 // Define these to make sure that each level of the cache
15 // is initialized and managed properly
16 #define DECLARE_CACHE_COLORED_PAGE_LINKS()                    \
17         DECLARE_CACHE_COLORED_PAGE_LINK(l1)                       \
18         DECLARE_CACHE_COLORED_PAGE_LINK(l2)                       \
19         DECLARE_CACHE_COLORED_PAGE_LINK(l3)
20
21 #define DECLARE_CACHE_COLORED_PAGE_FREE_LISTS()               \
22         DECLARE_CACHE_COLORED_PAGE_FREE_LIST(l1)                  \
23         DECLARE_CACHE_COLORED_PAGE_FREE_LIST(l2)                  \
24         DECLARE_CACHE_COLORED_PAGE_FREE_LIST(l3)
25         
26 #define DECLARE_EXTERN_CACHE_COLORED_PAGE_FREE_LISTS()        \
27         DECLARE_EXTERN_CACHE_COLORED_PAGE_FREE_LIST(l1)           \
28         DECLARE_EXTERN_CACHE_COLORED_PAGE_FREE_LIST(l2)           \
29         DECLARE_EXTERN_CACHE_COLORED_PAGE_FREE_LIST(l3)
30         
31 #define DECLARE_CACHE_COLORED_PAGE_ALLOC_FUNCTIONS()          \
32         DECLARE_CACHE_COLORED_PAGE_ALLOC_FUNCTION(l1)             \
33         DECLARE_CACHE_COLORED_PAGE_ALLOC_FUNCTION(l2)             \
34         DECLARE_CACHE_COLORED_PAGE_ALLOC_FUNCTION(l3)
35
36 #define INIT_CACHE_COLORED_PAGE_FREE_LISTS()                  \
37         INIT_CACHE_COLORED_PAGE_FREE_LIST(l1)                     \
38         INIT_CACHE_COLORED_PAGE_FREE_LIST(l2)                     \
39         INIT_CACHE_COLORED_PAGE_FREE_LIST(l3)
40
41 #define REMOVE_CACHE_COLORING_PAGE_FROM_FREE_LISTS(page)      \
42         REMOVE_CACHE_COLORING_PAGE_FROM_FREE_LIST(page, l1)       \
43         REMOVE_CACHE_COLORING_PAGE_FROM_FREE_LIST(page, l2)       \
44         REMOVE_CACHE_COLORING_PAGE_FROM_FREE_LIST(page, l3)
45         
46 #define INSERT_CACHE_COLORING_PAGE_ONTO_FREE_LISTS(page)      \
47         INSERT_CACHE_COLORING_PAGE_ONTO_FREE_LIST(page, l1)       \
48         INSERT_CACHE_COLORING_PAGE_ONTO_FREE_LIST(page, l2)       \
49         INSERT_CACHE_COLORING_PAGE_ONTO_FREE_LIST(page, l3)
50
51 #endif // CACHE_COLORING_PAGE_ALLOC_H