Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Use vga_raw_read/vga_raw_write instead of spellin...



details:   https://anonhg.NetBSD.org/src/rev/75c6950e0fec
branches:  trunk
changeset: 780854:75c6950e0fec
user:      uwe <uwe%NetBSD.org@localhost>
date:      Thu Aug 09 20:25:05 2012 +0000

description:
Use vga_raw_read/vga_raw_write instead of spelling bus space ops explicitly.
Same object code is produced.

diffstat:

 sys/dev/ic/vga_subr.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (52 lines):

diff -r 3de1c309aacc -r 75c6950e0fec sys/dev/ic/vga_subr.c
--- a/sys/dev/ic/vga_subr.c     Thu Aug 09 14:40:52 2012 +0000
+++ b/sys/dev/ic/vga_subr.c     Thu Aug 09 20:25:05 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vga_subr.c,v 1.24 2009/02/02 15:59:20 tsutsui Exp $ */
+/* $NetBSD: vga_subr.c,v 1.25 2012/08/09 20:25:05 uwe Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vga_subr.c,v 1.24 2009/02/02 15:59:20 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vga_subr.c,v 1.25 2012/08/09 20:25:05 uwe Exp $");
 
 /* for WSDISPLAY_BORDER_COLOR */
 #include "opt_wsdisplay_border.h"
@@ -225,7 +225,7 @@
        if (bus_space_map(vh->vh_iot, 0x3c0, 0x10, 0, &vh->vh_ioh_vga))
                return;
 
-       reg = bus_space_read_1(vh->vh_iot, vh->vh_ioh_vga, VGA_MISC_DATAR);
+       reg = vga_raw_read(vh, VGA_MISC_DATAR);
        vh->vh_mono = !(reg & 0x01);
 
        if (bus_space_map(vh->vh_iot, vh->vh_mono ? 0x3b0 : 0x3d0, 0x10,
@@ -402,19 +402,19 @@
        /* set DAC palette */
        if (!vh->vh_mono) {
                for (i = 0; i < 16; i++) {
-                       bus_space_write_1(vh->vh_iot, vh->vh_ioh_vga,
+                       vga_raw_write(vh,
                            VGA_DAC_ADDRW, vga_atc[i]);
-                       bus_space_write_1(vh->vh_iot, vh->vh_ioh_vga,
+                       vga_raw_write(vh,
                            VGA_DAC_PALETTE, vga_dacpal[i * 3 + 0]);
-                       bus_space_write_1(vh->vh_iot, vh->vh_ioh_vga,
+                       vga_raw_write(vh,
                            VGA_DAC_PALETTE, vga_dacpal[i * 3 + 1]);
-                       bus_space_write_1(vh->vh_iot, vh->vh_ioh_vga,
+                       vga_raw_write(vh,
                            VGA_DAC_PALETTE, vga_dacpal[i * 3 + 2]);
                }
        }
 
        /* set misc output register */
-       bus_space_write_1(vh->vh_iot, vh->vh_ioh_vga,
+       vga_raw_write(vh,
            VGA_MISC_DATAW, VGA_MISCOUT | (vh->vh_mono ? 0 : 0x01));
 
        /* reenable video */



Home | Main Index | Thread Index | Old Index