Commit 4ec5e62d authored by Linus Torvalds's avatar Linus Torvalds

Do __iomem annotations on VGA state handling

parent 6c4b867b
...@@ -32,21 +32,21 @@ struct regstate { ...@@ -32,21 +32,21 @@ struct regstate {
__u8 misc; __u8 misc;
}; };
static inline unsigned char vga_rcrtcs(caddr_t regbase, unsigned short iobase, static inline unsigned char vga_rcrtcs(void __iomem *regbase, unsigned short iobase,
unsigned char reg) unsigned char reg)
{ {
vga_w(regbase, iobase + 0x4, reg); vga_w(regbase, iobase + 0x4, reg);
return vga_r(regbase, iobase + 0x5); return vga_r(regbase, iobase + 0x5);
} }
static inline void vga_wcrtcs(caddr_t regbase, unsigned short iobase, static inline void vga_wcrtcs(void __iomem *regbase, unsigned short iobase,
unsigned char reg, unsigned char val) unsigned char reg, unsigned char val)
{ {
vga_w(regbase, iobase + 0x4, reg); vga_w(regbase, iobase + 0x4, reg);
vga_w(regbase, iobase + 0x5, val); vga_w(regbase, iobase + 0x5, val);
} }
static void save_vga_text(struct vgastate *state, caddr_t fbbase) static void save_vga_text(struct vgastate *state, void __iomem *fbbase)
{ {
struct regstate *saved = (struct regstate *) state->vidstate; struct regstate *saved = (struct regstate *) state->vidstate;
int i; int i;
...@@ -134,7 +134,7 @@ static void save_vga_text(struct vgastate *state, caddr_t fbbase) ...@@ -134,7 +134,7 @@ static void save_vga_text(struct vgastate *state, caddr_t fbbase)
vga_wseq(state->vgabase, VGA_SEQ_CLOCK_MODE, seq1); vga_wseq(state->vgabase, VGA_SEQ_CLOCK_MODE, seq1);
} }
static void restore_vga_text(struct vgastate *state, caddr_t fbbase) static void restore_vga_text(struct vgastate *state, void __iomem *fbbase)
{ {
struct regstate *saved = (struct regstate *) state->vidstate; struct regstate *saved = (struct regstate *) state->vidstate;
int i; int i;
...@@ -403,7 +403,7 @@ int save_vga(struct vgastate *state) ...@@ -403,7 +403,7 @@ int save_vga(struct vgastate *state)
} }
if (state->flags & VGA_SAVE_FONTS) { if (state->flags & VGA_SAVE_FONTS) {
caddr_t fbbase; void __iomem *fbbase;
/* exit if window is less than 32K */ /* exit if window is less than 32K */
if (state->memsize && state->memsize < 4 * 8192) { if (state->memsize && state->memsize < 4 * 8192) {
...@@ -473,7 +473,7 @@ int restore_vga (struct vgastate *state) ...@@ -473,7 +473,7 @@ int restore_vga (struct vgastate *state)
restore_vga_mode(state); restore_vga_mode(state);
if (state->flags & VGA_SAVE_FONTS) { if (state->flags & VGA_SAVE_FONTS) {
caddr_t fbbase = ioremap(state->membase, state->memsize); void __iomem *fbbase = ioremap(state->membase, state->memsize);
if (!fbbase) { if (!fbbase) {
vga_cleanup(state); vga_cleanup(state);
......
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
#define VGA_SAVE_CMAP 16 /* save/restore color map/DAC */ #define VGA_SAVE_CMAP 16 /* save/restore color map/DAC */
struct vgastate { struct vgastate {
caddr_t vgabase; /* mmio base, if supported */ void __iomem *vgabase; /* mmio base, if supported */
unsigned long membase; /* VGA window base, 0 for default - 0xA000 */ unsigned long membase; /* VGA window base, 0 for default - 0xA000 */
__u32 memsize; /* VGA window size, 0 for default 64K */ __u32 memsize; /* VGA window size, 0 for default 64K */
__u32 flags; /* what state[s] to save (see VGA_SAVE_*) */ __u32 flags; /* what state[s] to save (see VGA_SAVE_*) */
...@@ -238,23 +238,23 @@ static inline void vga_io_w_fast (unsigned short port, unsigned char reg, ...@@ -238,23 +238,23 @@ static inline void vga_io_w_fast (unsigned short port, unsigned char reg,
outw(VGA_OUT16VAL (val, reg), port); outw(VGA_OUT16VAL (val, reg), port);
} }
static inline unsigned char vga_mm_r (caddr_t regbase, unsigned short port) static inline unsigned char vga_mm_r (void __iomem *regbase, unsigned short port)
{ {
return readb (regbase + port); return readb (regbase + port);
} }
static inline void vga_mm_w (caddr_t regbase, unsigned short port, unsigned char val) static inline void vga_mm_w (void __iomem *regbase, unsigned short port, unsigned char val)
{ {
writeb (val, regbase + port); writeb (val, regbase + port);
} }
static inline void vga_mm_w_fast (caddr_t regbase, unsigned short port, static inline void vga_mm_w_fast (void __iomem *regbase, unsigned short port,
unsigned char reg, unsigned char val) unsigned char reg, unsigned char val)
{ {
writew (VGA_OUT16VAL (val, reg), regbase + port); writew (VGA_OUT16VAL (val, reg), regbase + port);
} }
static inline unsigned char vga_r (caddr_t regbase, unsigned short port) static inline unsigned char vga_r (void __iomem *regbase, unsigned short port)
{ {
if (regbase) if (regbase)
return vga_mm_r (regbase, port); return vga_mm_r (regbase, port);
...@@ -262,7 +262,7 @@ static inline unsigned char vga_r (caddr_t regbase, unsigned short port) ...@@ -262,7 +262,7 @@ static inline unsigned char vga_r (caddr_t regbase, unsigned short port)
return vga_io_r (port); return vga_io_r (port);
} }
static inline void vga_w (caddr_t regbase, unsigned short port, unsigned char val) static inline void vga_w (void __iomem *regbase, unsigned short port, unsigned char val)
{ {
if (regbase) if (regbase)
vga_mm_w (regbase, port, val); vga_mm_w (regbase, port, val);
...@@ -271,7 +271,7 @@ static inline void vga_w (caddr_t regbase, unsigned short port, unsigned char va ...@@ -271,7 +271,7 @@ static inline void vga_w (caddr_t regbase, unsigned short port, unsigned char va
} }
static inline void vga_w_fast (caddr_t regbase, unsigned short port, static inline void vga_w_fast (void __iomem *regbase, unsigned short port,
unsigned char reg, unsigned char val) unsigned char reg, unsigned char val)
{ {
if (regbase) if (regbase)
...@@ -285,13 +285,13 @@ static inline void vga_w_fast (caddr_t regbase, unsigned short port, ...@@ -285,13 +285,13 @@ static inline void vga_w_fast (caddr_t regbase, unsigned short port,
* VGA CRTC register read/write * VGA CRTC register read/write
*/ */
static inline unsigned char vga_rcrt (caddr_t regbase, unsigned char reg) static inline unsigned char vga_rcrt (void __iomem *regbase, unsigned char reg)
{ {
vga_w (regbase, VGA_CRT_IC, reg); vga_w (regbase, VGA_CRT_IC, reg);
return vga_r (regbase, VGA_CRT_DC); return vga_r (regbase, VGA_CRT_DC);
} }
static inline void vga_wcrt (caddr_t regbase, unsigned char reg, unsigned char val) static inline void vga_wcrt (void __iomem *regbase, unsigned char reg, unsigned char val)
{ {
#ifdef VGA_OUTW_WRITE #ifdef VGA_OUTW_WRITE
vga_w_fast (regbase, VGA_CRT_IC, reg, val); vga_w_fast (regbase, VGA_CRT_IC, reg, val);
...@@ -317,13 +317,13 @@ static inline void vga_io_wcrt (unsigned char reg, unsigned char val) ...@@ -317,13 +317,13 @@ static inline void vga_io_wcrt (unsigned char reg, unsigned char val)
#endif /* VGA_OUTW_WRITE */ #endif /* VGA_OUTW_WRITE */
} }
static inline unsigned char vga_mm_rcrt (caddr_t regbase, unsigned char reg) static inline unsigned char vga_mm_rcrt (void __iomem *regbase, unsigned char reg)
{ {
vga_mm_w (regbase, VGA_CRT_IC, reg); vga_mm_w (regbase, VGA_CRT_IC, reg);
return vga_mm_r (regbase, VGA_CRT_DC); return vga_mm_r (regbase, VGA_CRT_DC);
} }
static inline void vga_mm_wcrt (caddr_t regbase, unsigned char reg, unsigned char val) static inline void vga_mm_wcrt (void __iomem *regbase, unsigned char reg, unsigned char val)
{ {
#ifdef VGA_OUTW_WRITE #ifdef VGA_OUTW_WRITE
vga_mm_w_fast (regbase, VGA_CRT_IC, reg, val); vga_mm_w_fast (regbase, VGA_CRT_IC, reg, val);
...@@ -338,13 +338,13 @@ static inline void vga_mm_wcrt (caddr_t regbase, unsigned char reg, unsigned cha ...@@ -338,13 +338,13 @@ static inline void vga_mm_wcrt (caddr_t regbase, unsigned char reg, unsigned cha
* VGA sequencer register read/write * VGA sequencer register read/write
*/ */
static inline unsigned char vga_rseq (caddr_t regbase, unsigned char reg) static inline unsigned char vga_rseq (void __iomem *regbase, unsigned char reg)
{ {
vga_w (regbase, VGA_SEQ_I, reg); vga_w (regbase, VGA_SEQ_I, reg);
return vga_r (regbase, VGA_SEQ_D); return vga_r (regbase, VGA_SEQ_D);
} }
static inline void vga_wseq (caddr_t regbase, unsigned char reg, unsigned char val) static inline void vga_wseq (void __iomem *regbase, unsigned char reg, unsigned char val)
{ {
#ifdef VGA_OUTW_WRITE #ifdef VGA_OUTW_WRITE
vga_w_fast (regbase, VGA_SEQ_I, reg, val); vga_w_fast (regbase, VGA_SEQ_I, reg, val);
...@@ -370,13 +370,13 @@ static inline void vga_io_wseq (unsigned char reg, unsigned char val) ...@@ -370,13 +370,13 @@ static inline void vga_io_wseq (unsigned char reg, unsigned char val)
#endif /* VGA_OUTW_WRITE */ #endif /* VGA_OUTW_WRITE */
} }
static inline unsigned char vga_mm_rseq (caddr_t regbase, unsigned char reg) static inline unsigned char vga_mm_rseq (void __iomem *regbase, unsigned char reg)
{ {
vga_mm_w (regbase, VGA_SEQ_I, reg); vga_mm_w (regbase, VGA_SEQ_I, reg);
return vga_mm_r (regbase, VGA_SEQ_D); return vga_mm_r (regbase, VGA_SEQ_D);
} }
static inline void vga_mm_wseq (caddr_t regbase, unsigned char reg, unsigned char val) static inline void vga_mm_wseq (void __iomem *regbase, unsigned char reg, unsigned char val)
{ {
#ifdef VGA_OUTW_WRITE #ifdef VGA_OUTW_WRITE
vga_mm_w_fast (regbase, VGA_SEQ_I, reg, val); vga_mm_w_fast (regbase, VGA_SEQ_I, reg, val);
...@@ -390,13 +390,13 @@ static inline void vga_mm_wseq (caddr_t regbase, unsigned char reg, unsigned cha ...@@ -390,13 +390,13 @@ static inline void vga_mm_wseq (caddr_t regbase, unsigned char reg, unsigned cha
* VGA graphics controller register read/write * VGA graphics controller register read/write
*/ */
static inline unsigned char vga_rgfx (caddr_t regbase, unsigned char reg) static inline unsigned char vga_rgfx (void __iomem *regbase, unsigned char reg)
{ {
vga_w (regbase, VGA_GFX_I, reg); vga_w (regbase, VGA_GFX_I, reg);
return vga_r (regbase, VGA_GFX_D); return vga_r (regbase, VGA_GFX_D);
} }
static inline void vga_wgfx (caddr_t regbase, unsigned char reg, unsigned char val) static inline void vga_wgfx (void __iomem *regbase, unsigned char reg, unsigned char val)
{ {
#ifdef VGA_OUTW_WRITE #ifdef VGA_OUTW_WRITE
vga_w_fast (regbase, VGA_GFX_I, reg, val); vga_w_fast (regbase, VGA_GFX_I, reg, val);
...@@ -422,13 +422,13 @@ static inline void vga_io_wgfx (unsigned char reg, unsigned char val) ...@@ -422,13 +422,13 @@ static inline void vga_io_wgfx (unsigned char reg, unsigned char val)
#endif /* VGA_OUTW_WRITE */ #endif /* VGA_OUTW_WRITE */
} }
static inline unsigned char vga_mm_rgfx (caddr_t regbase, unsigned char reg) static inline unsigned char vga_mm_rgfx (void __iomem *regbase, unsigned char reg)
{ {
vga_mm_w (regbase, VGA_GFX_I, reg); vga_mm_w (regbase, VGA_GFX_I, reg);
return vga_mm_r (regbase, VGA_GFX_D); return vga_mm_r (regbase, VGA_GFX_D);
} }
static inline void vga_mm_wgfx (caddr_t regbase, unsigned char reg, unsigned char val) static inline void vga_mm_wgfx (void __iomem *regbase, unsigned char reg, unsigned char val)
{ {
#ifdef VGA_OUTW_WRITE #ifdef VGA_OUTW_WRITE
vga_mm_w_fast (regbase, VGA_GFX_I, reg, val); vga_mm_w_fast (regbase, VGA_GFX_I, reg, val);
...@@ -443,13 +443,13 @@ static inline void vga_mm_wgfx (caddr_t regbase, unsigned char reg, unsigned cha ...@@ -443,13 +443,13 @@ static inline void vga_mm_wgfx (caddr_t regbase, unsigned char reg, unsigned cha
* VGA attribute controller register read/write * VGA attribute controller register read/write
*/ */
static inline unsigned char vga_rattr (caddr_t regbase, unsigned char reg) static inline unsigned char vga_rattr (void __iomem *regbase, unsigned char reg)
{ {
vga_w (regbase, VGA_ATT_IW, reg); vga_w (regbase, VGA_ATT_IW, reg);
return vga_r (regbase, VGA_ATT_R); return vga_r (regbase, VGA_ATT_R);
} }
static inline void vga_wattr (caddr_t regbase, unsigned char reg, unsigned char val) static inline void vga_wattr (void __iomem *regbase, unsigned char reg, unsigned char val)
{ {
vga_w (regbase, VGA_ATT_IW, reg); vga_w (regbase, VGA_ATT_IW, reg);
vga_w (regbase, VGA_ATT_W, val); vga_w (regbase, VGA_ATT_W, val);
...@@ -467,13 +467,13 @@ static inline void vga_io_wattr (unsigned char reg, unsigned char val) ...@@ -467,13 +467,13 @@ static inline void vga_io_wattr (unsigned char reg, unsigned char val)
vga_io_w (VGA_ATT_W, val); vga_io_w (VGA_ATT_W, val);
} }
static inline unsigned char vga_mm_rattr (caddr_t regbase, unsigned char reg) static inline unsigned char vga_mm_rattr (void __iomem *regbase, unsigned char reg)
{ {
vga_mm_w (regbase, VGA_ATT_IW, reg); vga_mm_w (regbase, VGA_ATT_IW, reg);
return vga_mm_r (regbase, VGA_ATT_R); return vga_mm_r (regbase, VGA_ATT_R);
} }
static inline void vga_mm_wattr (caddr_t regbase, unsigned char reg, unsigned char val) static inline void vga_mm_wattr (void __iomem *regbase, unsigned char reg, unsigned char val)
{ {
vga_mm_w (regbase, VGA_ATT_IW, reg); vga_mm_w (regbase, VGA_ATT_IW, reg);
vga_mm_w (regbase, VGA_ATT_W, val); vga_mm_w (regbase, VGA_ATT_W, val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment