Linux 4.6-rc6
[linux/fpc-iii.git] / arch / x86 / mm / pat_internal.h
bloba739bfc40690b77537ca774b74092fe1beefdcce
1 #ifndef __PAT_INTERNAL_H_
2 #define __PAT_INTERNAL_H_
4 extern int pat_debug_enable;
6 #define dprintk(fmt, arg...) \
7 do { if (pat_debug_enable) pr_info("x86/PAT: " fmt, ##arg); } while (0)
9 struct memtype {
10 u64 start;
11 u64 end;
12 u64 subtree_max_end;
13 enum page_cache_mode type;
14 struct rb_node rb;
17 static inline char *cattr_name(enum page_cache_mode pcm)
19 switch (pcm) {
20 case _PAGE_CACHE_MODE_UC: return "uncached";
21 case _PAGE_CACHE_MODE_UC_MINUS: return "uncached-minus";
22 case _PAGE_CACHE_MODE_WB: return "write-back";
23 case _PAGE_CACHE_MODE_WC: return "write-combining";
24 case _PAGE_CACHE_MODE_WT: return "write-through";
25 case _PAGE_CACHE_MODE_WP: return "write-protected";
26 default: return "broken";
30 #ifdef CONFIG_X86_PAT
31 extern int rbt_memtype_check_insert(struct memtype *new,
32 enum page_cache_mode *new_type);
33 extern struct memtype *rbt_memtype_erase(u64 start, u64 end);
34 extern struct memtype *rbt_memtype_lookup(u64 addr);
35 extern int rbt_memtype_copy_nth_element(struct memtype *out, loff_t pos);
36 #else
37 static inline int rbt_memtype_check_insert(struct memtype *new,
38 enum page_cache_mode *new_type)
39 { return 0; }
40 static inline struct memtype *rbt_memtype_erase(u64 start, u64 end)
41 { return NULL; }
42 static inline struct memtype *rbt_memtype_lookup(u64 addr)
43 { return NULL; }
44 static inline int rbt_memtype_copy_nth_element(struct memtype *out, loff_t pos)
45 { return 0; }
46 #endif
48 #endif /* __PAT_INTERNAL_H_ */