16 #include <linux/module.h>
17 #include <linux/slab.h>
34 static inline unsigned char vga_rcrtcs(
void __iomem *regbase,
unsigned short iobase,
37 vga_w(regbase, iobase + 0x4, reg);
38 return vga_r(regbase, iobase + 0x5);
41 static inline void vga_wcrtcs(
void __iomem *regbase,
unsigned short iobase,
42 unsigned char reg,
unsigned char val)
44 vga_w(regbase, iobase + 0x4, reg);
45 vga_w(regbase, iobase + 0x5, val);
57 iobase = (misc & 1) ? 0x3d0 : 0x3b0;
61 attr10 = vga_rattr(state->
vgabase, 0x10);
88 for (
i = 0;
i < 4 * 8192;
i++)
110 for (
i = 0;
i < 8192;
i++)
118 for (
i = 0;
i < 8192;
i++)
119 saved->
vga_text[8192+
i] = vga_r(fbbase + 2 * 8192,
i);
138 static void restore_vga_text(
struct vgastate *state,
void __iomem *fbbase)
161 if (state->
depth == 4) {
174 for (
i = 0;
i < 4 * 8192;
i++)
196 for (
i = 0;
i < 8192;
i++)
204 for (
i = 0;
i < 8192;
i++)
226 static void save_vga_mode(
struct vgastate *state)
257 static void restore_vga_mode(
struct vgastate *state)
309 static void save_vga_cmap(
struct vgastate *state)
318 for (
i = 0;
i < 768;
i++)
322 static void restore_vga_cmap(
struct vgastate *state)
331 for (
i = 0;
i < 768;
i++)
335 static void vga_cleanup(
struct vgastate *state)
367 save_vga_cmap(state);
393 save_vga_mode(state);
452 save_vga_text(state, fbbase);
464 restore_vga_mode(state);
473 restore_vga_text(state, fbbase);
478 restore_vga_cmap(state);