| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ct65550.c,v 1.8 2013/10/09 17:20:54 macallan Exp $ */ | | 1 | /* $NetBSD: ct65550.c,v 1.9 2014/01/03 15:57:12 macallan Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2006 Michael Lorenz | | 4 | * Copyright (c) 2006 Michael Lorenz |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -20,27 +20,27 @@ | | | @@ -20,27 +20,27 @@ |
20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | | 26 | */ |
27 | | | 27 | |
28 | /* | | 28 | /* |
29 | * A console driver for Chips & Technologies 65550 graphics controllers | | 29 | * A console driver for Chips & Technologies 65550 graphics controllers |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | __KERNEL_RCSID(0, "$NetBSD: ct65550.c,v 1.8 2013/10/09 17:20:54 macallan Exp $"); | | 33 | __KERNEL_RCSID(0, "$NetBSD: ct65550.c,v 1.9 2014/01/03 15:57:12 macallan Exp $"); |
34 | | | 34 | |
35 | #include <sys/param.h> | | 35 | #include <sys/param.h> |
36 | #include <sys/systm.h> | | 36 | #include <sys/systm.h> |
37 | #include <sys/kernel.h> | | 37 | #include <sys/kernel.h> |
38 | #include <sys/device.h> | | 38 | #include <sys/device.h> |
39 | #include <sys/kauth.h> | | 39 | #include <sys/kauth.h> |
40 | #include <sys/bus.h> | | 40 | #include <sys/bus.h> |
41 | #include <dev/videomode/videomode.h> | | 41 | #include <dev/videomode/videomode.h> |
42 | | | 42 | |
43 | #include <dev/ic/ct65550reg.h> | | 43 | #include <dev/ic/ct65550reg.h> |
44 | #include <dev/ic/ct65550var.h> | | 44 | #include <dev/ic/ct65550var.h> |
45 | | | 45 | |
46 | #include "opt_wsemul.h" | | 46 | #include "opt_wsemul.h" |
| @@ -141,27 +141,27 @@ chipsfb_read32(struct chipsfb_softc *sc, | | | @@ -141,27 +141,27 @@ chipsfb_read32(struct chipsfb_softc *sc, |
141 | | | 141 | |
142 | static inline void | | 142 | static inline void |
143 | chipsfb_write_vga(struct chipsfb_softc *sc, uint32_t reg, uint8_t val) | | 143 | chipsfb_write_vga(struct chipsfb_softc *sc, uint32_t reg, uint8_t val) |
144 | { | | 144 | { |
145 | bus_space_write_1(sc->sc_iot, sc->sc_ioregh, reg, val); | | 145 | bus_space_write_1(sc->sc_iot, sc->sc_ioregh, reg, val); |
146 | } | | 146 | } |
147 | | | 147 | |
148 | static inline uint8_t | | 148 | static inline uint8_t |
149 | chipsfb_read_vga(struct chipsfb_softc *sc, uint32_t reg) | | 149 | chipsfb_read_vga(struct chipsfb_softc *sc, uint32_t reg) |
150 | { | | 150 | { |
151 | return bus_space_read_1(sc->sc_iot, sc->sc_ioregh, reg); | | 151 | return bus_space_read_1(sc->sc_iot, sc->sc_ioregh, reg); |
152 | } | | 152 | } |
153 | | | 153 | |
154 | static inline uint8_t | | 154 | __unused static inline uint8_t |
155 | chipsfb_read_indexed(struct chipsfb_softc *sc, uint32_t reg, uint8_t index) | | 155 | chipsfb_read_indexed(struct chipsfb_softc *sc, uint32_t reg, uint8_t index) |
156 | { | | 156 | { |
157 | | | 157 | |
158 | chipsfb_write_vga(sc, reg & 0xfffe, index); | | 158 | chipsfb_write_vga(sc, reg & 0xfffe, index); |
159 | return chipsfb_read_vga(sc, reg | 0x0001); | | 159 | return chipsfb_read_vga(sc, reg | 0x0001); |
160 | } | | 160 | } |
161 | | | 161 | |
162 | static inline void | | 162 | static inline void |
163 | chipsfb_write_indexed(struct chipsfb_softc *sc, uint32_t reg, uint8_t index, | | 163 | chipsfb_write_indexed(struct chipsfb_softc *sc, uint32_t reg, uint8_t index, |
164 | uint8_t val) | | 164 | uint8_t val) |
165 | { | | 165 | { |
166 | | | 166 | |
167 | chipsfb_write_vga(sc, reg & 0xfffe, index); | | 167 | chipsfb_write_vga(sc, reg & 0xfffe, index); |