Go to the documentation of this file.
23 #ifndef _ASM_X86_MTRR_H
24 #define _ASM_X86_MTRR_H
26 #include <linux/types.h>
28 #include <linux/errno.h>
30 #define MTRR_IOCTL_BASE 'M'
80 #define MTRR_NUM_FIXED_RANGES 88
81 #define MTRR_MAX_VAR_RANGES 256
91 #define MTRRphysBase_MSR(reg) (0x200 + 2 * (reg))
92 #define MTRRphysMask_MSR(reg) (0x200 + 2 * (reg) + 1)
95 #define MTRRIOC_ADD_ENTRY _IOW(MTRR_IOCTL_BASE, 0, struct mtrr_sentry)
96 #define MTRRIOC_SET_ENTRY _IOW(MTRR_IOCTL_BASE, 1, struct mtrr_sentry)
97 #define MTRRIOC_DEL_ENTRY _IOW(MTRR_IOCTL_BASE, 2, struct mtrr_sentry)
98 #define MTRRIOC_GET_ENTRY _IOWR(MTRR_IOCTL_BASE, 3, struct mtrr_gentry)
99 #define MTRRIOC_KILL_ENTRY _IOW(MTRR_IOCTL_BASE, 4, struct mtrr_sentry)
100 #define MTRRIOC_ADD_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 5, struct mtrr_sentry)
101 #define MTRRIOC_SET_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 6, struct mtrr_sentry)
102 #define MTRRIOC_DEL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 7, struct mtrr_sentry)
103 #define MTRRIOC_GET_PAGE_ENTRY _IOWR(MTRR_IOCTL_BASE, 8, struct mtrr_gentry)
104 #define MTRRIOC_KILL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 9, struct mtrr_sentry)
107 #define MTRR_TYPE_UNCACHABLE 0
108 #define MTRR_TYPE_WRCOMB 1
111 #define MTRR_TYPE_WRTHROUGH 4
112 #define MTRR_TYPE_WRPROT 5
113 #define MTRR_TYPE_WRBACK 6
114 #define MTRR_NUM_TYPES 7
123 extern int mtrr_add(
unsigned long base,
unsigned long size,
124 unsigned int type,
bool increment);
126 unsigned int type,
bool increment);
145 #define mtrr_save_fixed_ranges(arg) do {} while (0)
146 #define mtrr_save_state() do {} while (0)
147 static inline int mtrr_add(
unsigned long base,
unsigned long size,
148 unsigned int type,
bool increment)
153 unsigned int type,
bool increment)
157 static inline int mtrr_del(
int reg,
unsigned long base,
unsigned long size)
173 #define mtrr_ap_init() do {} while (0)
174 #define mtrr_bp_init() do {} while (0)
175 #define set_mtrr_aps_delayed_init() do {} while (0)
176 #define mtrr_aps_init() do {} while (0)
177 #define mtrr_bp_restore() do {} while (0)
183 struct mtrr_sentry32 {
189 struct mtrr_gentry32 {
196 #define MTRR_IOCTL_BASE 'M'
198 #define MTRRIOC32_ADD_ENTRY _IOW(MTRR_IOCTL_BASE, 0, struct mtrr_sentry32)
199 #define MTRRIOC32_SET_ENTRY _IOW(MTRR_IOCTL_BASE, 1, struct mtrr_sentry32)
200 #define MTRRIOC32_DEL_ENTRY _IOW(MTRR_IOCTL_BASE, 2, struct mtrr_sentry32)
201 #define MTRRIOC32_GET_ENTRY _IOWR(MTRR_IOCTL_BASE, 3, struct mtrr_gentry32)
202 #define MTRRIOC32_KILL_ENTRY _IOW(MTRR_IOCTL_BASE, 4, struct mtrr_sentry32)
203 #define MTRRIOC32_ADD_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 5, struct mtrr_sentry32)
204 #define MTRRIOC32_SET_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 6, struct mtrr_sentry32)
205 #define MTRRIOC32_DEL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 7, struct mtrr_sentry32)
206 #define MTRRIOC32_GET_PAGE_ENTRY _IOWR(MTRR_IOCTL_BASE, 8, struct mtrr_gentry32)
207 #define MTRRIOC32_KILL_PAGE_ENTRY \
208 _IOW(MTRR_IOCTL_BASE, 9, struct mtrr_sentry32)