13 cyrix_get_arr(
unsigned int reg,
unsigned long *base,
16 unsigned char arr, ccr3, rcr, shift;
25 ((
unsigned char *)base)[3] = getCx86(arr);
26 ((
unsigned char *)base)[2] = getCx86(arr + 1);
27 ((
unsigned char *)base)[1] = getCx86(arr + 2);
33 shift = ((
unsigned char *) base)[1] & 0x0f;
41 *size = (reg < 7 ? 0x1
UL : 0x40
UL) << (shift - 1);
90 cyrix_get_free_region(
unsigned long base,
unsigned long size,
int replace_reg)
92 unsigned long lbase, lsize;
96 switch (replace_reg) {
112 cyrix_get_arr(7, &lbase, &lsize, <ype);
117 for (i = 0; i < 7; i++) {
118 cyrix_get_arr(i, &lbase, &lsize, <ype);
126 cyrix_get_arr(i, &lbase, &lsize, <ype);
127 if ((lsize == 0) && (size >= 0x40))
135 static void prepare_set(
void)
158 setCx86(
CX86_CCR3, (ccr3 & 0x0f) | 0x10);
161 static void post_set(
void)
170 write_cr0(read_cr0() & 0xbfffffff);
177 static void cyrix_set_arr(
unsigned int reg,
unsigned long base,
180 unsigned char arr, arr_type, arr_size;
189 for (arr_size = 0;
size; arr_size++, size >>= 1)
227 setCx86(arr + 0, ((
unsigned char *)&base)[3]);
228 setCx86(arr + 1, ((
unsigned char *)&base)[2]);
229 setCx86(arr + 2, (((
unsigned char *)&base)[1]) | arr_size);
242 {0
UL, 0
UL, 0UL}, {0
UL, 0
UL, 0UL}, {0
UL, 0
UL, 0UL}, {0
UL, 0
UL, 0UL},
243 {0
UL, 0
UL, 0UL}, {0
UL, 0
UL, 0UL}, {0
UL, 0
UL, 0UL}, {0
UL, 0
UL, 0UL}
246 static unsigned char ccr_state[7] = { 0, 0, 0, 0, 0, 0, 0 };
248 static void cyrix_set_all(
void)
255 for (i = 0; i < 4; i++)
260 for (i = 0; i < 8; i++) {
261 cyrix_set_arr(i, arr_state[i].base,
262 arr_state[i].size, arr_state[i].type);
268 static const struct mtrr_ops cyrix_mtrr_ops = {
270 .set_all = cyrix_set_all,
271 .set = cyrix_set_arr,
272 .get = cyrix_get_arr,
273 .get_free_region = cyrix_get_free_region,