VMM: Clean up per-cpu VMCS state
[akaros.git] / kern / arch / riscv / 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 #pragma once
11
12 /********** Page Coloring Related Macros ************/
13 // Define these to make sure that each level of the cache
14 // is initialized and managed properly
15 #define DECLARE_CACHE_COLORED_PAGE_LINKS()                    \
16         DECLARE_CACHE_COLORED_PAGE_LINK(l1)                       \
17         DECLARE_CACHE_COLORED_PAGE_LINK(l2)                       \
18         DECLARE_CACHE_COLORED_PAGE_LINK(l3)
19
20 #define DECLARE_CACHE_COLORED_PAGE_FREE_LISTS()               \
21         DECLARE_CACHE_COLORED_PAGE_FREE_LIST(l1)                  \
22         DECLARE_CACHE_COLORED_PAGE_FREE_LIST(l2)                  \
23         DECLARE_CACHE_COLORED_PAGE_FREE_LIST(l3)
24         
25 #define DECLARE_EXTERN_CACHE_COLORED_PAGE_FREE_LISTS()        \
26         DECLARE_EXTERN_CACHE_COLORED_PAGE_FREE_LIST(l1)           \
27         DECLARE_EXTERN_CACHE_COLORED_PAGE_FREE_LIST(l2)           \
28         DECLARE_EXTERN_CACHE_COLORED_PAGE_FREE_LIST(l3)
29         
30 #define DECLARE_CACHE_COLORED_PAGE_ALLOC_FUNCTIONS()          \
31         DECLARE_CACHE_COLORED_PAGE_ALLOC_FUNCTION(l1)             \
32         DECLARE_CACHE_COLORED_PAGE_ALLOC_FUNCTION(l2)             \
33         DECLARE_CACHE_COLORED_PAGE_ALLOC_FUNCTION(l3)
34
35 #define INIT_CACHE_COLORED_PAGE_FREE_LISTS()                  \
36         INIT_CACHE_COLORED_PAGE_FREE_LIST(l1)                     \
37         INIT_CACHE_COLORED_PAGE_FREE_LIST(l2)                     \
38         INIT_CACHE_COLORED_PAGE_FREE_LIST(l3)
39
40 #define REMOVE_CACHE_COLORING_PAGE_FROM_FREE_LISTS(page)      \
41         REMOVE_CACHE_COLORING_PAGE_FROM_FREE_LIST(page, l1)       \
42         REMOVE_CACHE_COLORING_PAGE_FROM_FREE_LIST(page, l2)       \
43         REMOVE_CACHE_COLORING_PAGE_FROM_FREE_LIST(page, l3)
44         
45 #define INSERT_CACHE_COLORING_PAGE_ONTO_FREE_LISTS(page)      \
46         INSERT_CACHE_COLORING_PAGE_ONTO_FREE_LIST(page, l1)       \
47         INSERT_CACHE_COLORING_PAGE_ONTO_FREE_LIST(page, l2)       \
48         INSERT_CACHE_COLORING_PAGE_ONTO_FREE_LIST(page, l3)