This source file includes following definitions.
- ttm_set_pages_array_wb
- ttm_set_pages_array_wc
- ttm_set_pages_array_uc
- ttm_set_pages_wb
- ttm_set_pages_wc
- ttm_set_pages_uc
- ttm_set_pages_array_wb
- ttm_set_pages_array_wc
- ttm_set_pages_array_uc
- ttm_set_pages_wb
- ttm_set_pages_array_wb
- ttm_set_pages_array_wc
- ttm_set_pages_array_uc
- ttm_set_pages_wb
- ttm_set_pages_wc
- ttm_set_pages_uc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 #ifndef TTM_SET_MEMORY
32 #define TTM_SET_MEMORY
33
34 #include <linux/mm.h>
35
36 #ifdef CONFIG_X86
37
38 #include <asm/set_memory.h>
39
40 static inline int ttm_set_pages_array_wb(struct page **pages, int addrinarray)
41 {
42 return set_pages_array_wb(pages, addrinarray);
43 }
44
45 static inline int ttm_set_pages_array_wc(struct page **pages, int addrinarray)
46 {
47 return set_pages_array_wc(pages, addrinarray);
48 }
49
50 static inline int ttm_set_pages_array_uc(struct page **pages, int addrinarray)
51 {
52 return set_pages_array_uc(pages, addrinarray);
53 }
54
55 static inline int ttm_set_pages_wb(struct page *page, int numpages)
56 {
57 return set_pages_wb(page, numpages);
58 }
59
60 static inline int ttm_set_pages_wc(struct page *page, int numpages)
61 {
62 unsigned long addr = (unsigned long)page_address(page);
63
64 return set_memory_wc(addr, numpages);
65 }
66
67 static inline int ttm_set_pages_uc(struct page *page, int numpages)
68 {
69 return set_pages_uc(page, numpages);
70 }
71
72 #else
73
74 #if IS_ENABLED(CONFIG_AGP)
75
76 #include <asm/agp.h>
77
78 static inline int ttm_set_pages_array_wb(struct page **pages, int addrinarray)
79 {
80 int i;
81
82 for (i = 0; i < addrinarray; i++)
83 unmap_page_from_agp(pages[i]);
84 return 0;
85 }
86
87 static inline int ttm_set_pages_array_wc(struct page **pages, int addrinarray)
88 {
89 int i;
90
91 for (i = 0; i < addrinarray; i++)
92 map_page_into_agp(pages[i]);
93 return 0;
94 }
95
96 static inline int ttm_set_pages_array_uc(struct page **pages, int addrinarray)
97 {
98 int i;
99
100 for (i = 0; i < addrinarray; i++)
101 map_page_into_agp(pages[i]);
102 return 0;
103 }
104
105 static inline int ttm_set_pages_wb(struct page *page, int numpages)
106 {
107 int i;
108
109 for (i = 0; i < numpages; i++)
110 unmap_page_from_agp(page++);
111 return 0;
112 }
113
114 #else
115
116 static inline int ttm_set_pages_array_wb(struct page **pages, int addrinarray)
117 {
118 return 0;
119 }
120
121 static inline int ttm_set_pages_array_wc(struct page **pages, int addrinarray)
122 {
123 return 0;
124 }
125
126 static inline int ttm_set_pages_array_uc(struct page **pages, int addrinarray)
127 {
128 return 0;
129 }
130
131 static inline int ttm_set_pages_wb(struct page *page, int numpages)
132 {
133 return 0;
134 }
135
136 #endif
137
138 static inline int ttm_set_pages_wc(struct page *page, int numpages)
139 {
140 return 0;
141 }
142
143 static inline int ttm_set_pages_uc(struct page *page, int numpages)
144 {
145 return 0;
146 }
147
148 #endif
149
150 #endif