Include "ioconf.h" instead of extern struct cfdriver foo_cd decls.diff -r1.21 -r1.22 src/sys/dev/sbus/agten.c
(tsutsui)
--- src/sys/dev/sbus/agten.c 2009/09/17 16:28:12 1.21
+++ src/sys/dev/sbus/agten.c 2009/09/17 16:39:48 1.22
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: agten.c,v 1.21 2009/09/17 16:28:12 tsutsui Exp $ */ | 1 | /* $NetBSD: agten.c,v 1.22 2009/09/17 16:39:48 tsutsui Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2007 Michael Lorenz | 4 | * Copyright (c) 2007 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. | |
@@ -17,27 +17,27 @@ | @@ -17,27 +17,27 @@ | |||
17 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 17 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | 26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #include <sys/cdefs.h> | 29 | #include <sys/cdefs.h> | |
30 | __KERNEL_RCSID(0, "$NetBSD: agten.c,v 1.21 2009/09/17 16:28:12 tsutsui Exp $"); | 30 | __KERNEL_RCSID(0, "$NetBSD: agten.c,v 1.22 2009/09/17 16:39:48 tsutsui Exp $"); | |
31 | 31 | |||
32 | /* | 32 | /* | |
33 | * a driver for the Fujitsu AG-10e SBus framebuffer | 33 | * a driver for the Fujitsu AG-10e SBus framebuffer | |
34 | * | 34 | * | |
35 | * this thing is Frankenstein's Monster among graphics boards. | 35 | * this thing is Frankenstein's Monster among graphics boards. | |
36 | * it contains three graphics chips: | 36 | * it contains three graphics chips: | |
37 | * a GLint - 24bit stuff, double-buffered | 37 | * a GLint - 24bit stuff, double-buffered | |
38 | * an Imagine 128 which provides an 8bit overlay | 38 | * an Imagine 128 which provides an 8bit overlay | |
39 | * a Weitek P9100 which provides WIDs | 39 | * a Weitek P9100 which provides WIDs | |
40 | * so here we need to mess only with the P9100 and the I128 - for X we just | 40 | * so here we need to mess only with the P9100 and the I128 - for X we just | |
41 | * hide the overlay and let the Xserver mess with the GLint | 41 | * hide the overlay and let the Xserver mess with the GLint | |
42 | */ | 42 | */ | |
43 | 43 | |||
@@ -65,26 +65,27 @@ __KERNEL_RCSID(0, "$NetBSD: agten.c,v 1. | @@ -65,26 +65,27 @@ __KERNEL_RCSID(0, "$NetBSD: agten.c,v 1. | |||
65 | #include <dev/wscons/wsconsio.h> | 65 | #include <dev/wscons/wsconsio.h> | |
66 | #include <dev/wscons/wsdisplayvar.h> | 66 | #include <dev/wscons/wsdisplayvar.h> | |
67 | #include <dev/rasops/rasops.h> | 67 | #include <dev/rasops/rasops.h> | |
68 | #include <dev/wsfont/wsfont.h> | 68 | #include <dev/wsfont/wsfont.h> | |
69 | 69 | |||
70 | #include <dev/wscons/wsdisplay_vconsvar.h> | 70 | #include <dev/wscons/wsdisplay_vconsvar.h> | |
71 | 71 | |||
72 | #include <dev/sbus/p9100reg.h> | 72 | #include <dev/sbus/p9100reg.h> | |
73 | #include <dev/ic/ibm561reg.h> | 73 | #include <dev/ic/ibm561reg.h> | |
74 | #include <dev/ic/i128reg.h> | 74 | #include <dev/ic/i128reg.h> | |
75 | #include <dev/ic/i128var.h> | 75 | #include <dev/ic/i128var.h> | |
76 | 76 | |||
77 | #include "opt_agten.h" | 77 | #include "opt_agten.h" | |
78 | #include "ioconf.h" | |||
78 | 79 | |||
79 | static int agten_match(device_t, cfdata_t, void *); | 80 | static int agten_match(device_t, cfdata_t, void *); | |
80 | static void agten_attach(device_t, device_t, void *); | 81 | static void agten_attach(device_t, device_t, void *); | |
81 | 82 | |||
82 | static int agten_ioctl(void *, void *, u_long, void *, int, struct lwp *); | 83 | static int agten_ioctl(void *, void *, u_long, void *, int, struct lwp *); | |
83 | static paddr_t agten_mmap(void *, void *, off_t, int); | 84 | static paddr_t agten_mmap(void *, void *, off_t, int); | |
84 | static void agten_init_screen(void *, struct vcons_screen *, int, long *); | 85 | static void agten_init_screen(void *, struct vcons_screen *, int, long *); | |
85 | 86 | |||
86 | struct agten_softc { | 87 | struct agten_softc { | |
87 | device_t sc_dev; /* base device */ | 88 | device_t sc_dev; /* base device */ | |
88 | struct fbdevice sc_fb; /* frame buffer device */ | 89 | struct fbdevice sc_fb; /* frame buffer device */ | |
89 | 90 | |||
90 | struct vcons_screen sc_console_screen; | 91 | struct vcons_screen sc_console_screen; | |
@@ -152,27 +153,26 @@ extern const u_char rasops_cmap[768]; | @@ -152,27 +153,26 @@ extern const u_char rasops_cmap[768]; | |||
152 | 153 | |||
153 | struct wsdisplay_accessops agten_accessops = { | 154 | struct wsdisplay_accessops agten_accessops = { | |
154 | agten_ioctl, | 155 | agten_ioctl, | |
155 | agten_mmap, | 156 | agten_mmap, | |
156 | NULL, /* alloc_screen */ | 157 | NULL, /* alloc_screen */ | |
157 | NULL, /* free_screen */ | 158 | NULL, /* free_screen */ | |
158 | NULL, /* show_screen */ | 159 | NULL, /* show_screen */ | |
159 | NULL, /* load_font */ | 160 | NULL, /* load_font */ | |
160 | NULL, /* pollc */ | 161 | NULL, /* pollc */ | |
161 | NULL /* scroll */ | 162 | NULL /* scroll */ | |
162 | }; | 163 | }; | |
163 | 164 | |||
164 | /* /dev/fb* stuff */ | 165 | /* /dev/fb* stuff */ | |
165 | extern struct cfdriver agten_cd; | |||
166 | 166 | |||
167 | static int agten_fb_open(dev_t, int, int, struct lwp *); | 167 | static int agten_fb_open(dev_t, int, int, struct lwp *); | |
168 | static int agten_fb_close(dev_t, int, int, struct lwp *); | 168 | static int agten_fb_close(dev_t, int, int, struct lwp *); | |
169 | static int agten_fb_ioctl(dev_t, u_long, void *, int, struct lwp *); | 169 | static int agten_fb_ioctl(dev_t, u_long, void *, int, struct lwp *); | |
170 | static paddr_t agten_fb_mmap(dev_t, off_t, int); | 170 | static paddr_t agten_fb_mmap(dev_t, off_t, int); | |
171 | static void agten_fb_unblank(device_t); | 171 | static void agten_fb_unblank(device_t); | |
172 | 172 | |||
173 | static struct fbdriver agtenfbdriver = { | 173 | static struct fbdriver agtenfbdriver = { | |
174 | agten_fb_unblank, agten_fb_open, agten_fb_close, agten_fb_ioctl, | 174 | agten_fb_unblank, agten_fb_open, agten_fb_close, agten_fb_ioctl, | |
175 | nopoll, agten_fb_mmap, nokqfilter | 175 | nopoll, agten_fb_mmap, nokqfilter | |
176 | }; | 176 | }; | |
177 | 177 | |||
178 | static inline void | 178 | static inline void |
--- src/sys/dev/sbus/magma.c 2009/09/17 16:28:12 1.53
+++ src/sys/dev/sbus/magma.c 2009/09/17 16:39:48 1.54
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: magma.c,v 1.53 2009/09/17 16:28:12 tsutsui Exp $ */ | 1 | /* $NetBSD: magma.c,v 1.54 2009/09/17 16:39:48 tsutsui Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1998 Iain Hibbert | 4 | * Copyright (c) 1998 Iain Hibbert | |
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. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
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 | * Driver for Magma SBus Serial/Parallel cards using the Cirrus Logic | 29 | * Driver for Magma SBus Serial/Parallel cards using the Cirrus Logic | |
30 | * CD1400 & CD1190 chips | 30 | * CD1400 & CD1190 chips | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | #include <sys/cdefs.h> | 33 | #include <sys/cdefs.h> | |
34 | __KERNEL_RCSID(0, "$NetBSD: magma.c,v 1.53 2009/09/17 16:28:12 tsutsui Exp $"); | 34 | __KERNEL_RCSID(0, "$NetBSD: magma.c,v 1.54 2009/09/17 16:39:48 tsutsui Exp $"); | |
35 | 35 | |||
36 | #if 0 | 36 | #if 0 | |
37 | #define MAGMA_DEBUG | 37 | #define MAGMA_DEBUG | |
38 | #endif | 38 | #endif | |
39 | 39 | |||
40 | #include "magma.h" | 40 | #include "magma.h" | |
41 | #if NMAGMA > 0 | 41 | #if NMAGMA > 0 | |
42 | 42 | |||
43 | #include <sys/param.h> | 43 | #include <sys/param.h> | |
44 | #include <sys/systm.h> | 44 | #include <sys/systm.h> | |
45 | #include <sys/proc.h> | 45 | #include <sys/proc.h> | |
46 | #include <sys/device.h> | 46 | #include <sys/device.h> | |
47 | #include <sys/file.h> | 47 | #include <sys/file.h> | |
@@ -57,26 +57,28 @@ __KERNEL_RCSID(0, "$NetBSD: magma.c,v 1. | @@ -57,26 +57,28 @@ __KERNEL_RCSID(0, "$NetBSD: magma.c,v 1. | |||
57 | #include <sys/intr.h> | 57 | #include <sys/intr.h> | |
58 | 58 | |||
59 | #include <sys/bus.h> | 59 | #include <sys/bus.h> | |
60 | #include <machine/autoconf.h> | 60 | #include <machine/autoconf.h> | |
61 | 61 | |||
62 | #include <dev/sbus/sbusvar.h> | 62 | #include <dev/sbus/sbusvar.h> | |
63 | 63 | |||
64 | #include <dev/ic/cd1400reg.h> | 64 | #include <dev/ic/cd1400reg.h> | |
65 | #include <dev/ic/cd1190reg.h> | 65 | #include <dev/ic/cd1190reg.h> | |
66 | 66 | |||
67 | #include <dev/sbus/mbppio.h> | 67 | #include <dev/sbus/mbppio.h> | |
68 | #include <dev/sbus/magmareg.h> | 68 | #include <dev/sbus/magmareg.h> | |
69 | 69 | |||
70 | #include "ioconf.h" | |||
71 | ||||
70 | /* supported cards | 72 | /* supported cards | |
71 | * | 73 | * | |
72 | * The table below lists the cards that this driver is likely to | 74 | * The table below lists the cards that this driver is likely to | |
73 | * be able to support. | 75 | * be able to support. | |
74 | * | 76 | * | |
75 | * Cards with parallel ports: except for the LC2+1Sp, they all use | 77 | * Cards with parallel ports: except for the LC2+1Sp, they all use | |
76 | * the CD1190 chip which I know nothing about. I've tried to leave | 78 | * the CD1190 chip which I know nothing about. I've tried to leave | |
77 | * hooks for it so it shouldn't be too hard to add support later. | 79 | * hooks for it so it shouldn't be too hard to add support later. | |
78 | * (I think somebody is working on this separately) | 80 | * (I think somebody is working on this separately) | |
79 | * | 81 | * | |
80 | * Thanks to Bruce at Magma for telling me the hardware offsets. | 82 | * Thanks to Bruce at Magma for telling me the hardware offsets. | |
81 | */ | 83 | */ | |
82 | static struct magma_board_info supported_cards[] = { | 84 | static struct magma_board_info supported_cards[] = { | |
@@ -166,29 +168,26 @@ static struct magma_board_info supported | @@ -166,29 +168,26 @@ static struct magma_board_info supported | |||
166 | * | 168 | * | |
167 | * Autoconfig Stuff | 169 | * Autoconfig Stuff | |
168 | */ | 170 | */ | |
169 | 171 | |||
170 | CFATTACH_DECL(magma, sizeof(struct magma_softc), | 172 | CFATTACH_DECL(magma, sizeof(struct magma_softc), | |
171 | magma_match, magma_attach, NULL, NULL); | 173 | magma_match, magma_attach, NULL, NULL); | |
172 | 174 | |||
173 | CFATTACH_DECL(mtty, sizeof(struct mtty_softc), | 175 | CFATTACH_DECL(mtty, sizeof(struct mtty_softc), | |
174 | mtty_match, mtty_attach, NULL, NULL); | 176 | mtty_match, mtty_attach, NULL, NULL); | |
175 | 177 | |||
176 | CFATTACH_DECL(mbpp, sizeof(struct mbpp_softc), | 178 | CFATTACH_DECL(mbpp, sizeof(struct mbpp_softc), | |
177 | mbpp_match, mbpp_attach, NULL, NULL); | 179 | mbpp_match, mbpp_attach, NULL, NULL); | |
178 | 180 | |||
179 | extern struct cfdriver mtty_cd; | |||
180 | extern struct cfdriver mbpp_cd; | |||
181 | ||||
182 | dev_type_open(mttyopen); | 181 | dev_type_open(mttyopen); | |
183 | dev_type_close(mttyclose); | 182 | dev_type_close(mttyclose); | |
184 | dev_type_read(mttyread); | 183 | dev_type_read(mttyread); | |
185 | dev_type_write(mttywrite); | 184 | dev_type_write(mttywrite); | |
186 | dev_type_ioctl(mttyioctl); | 185 | dev_type_ioctl(mttyioctl); | |
187 | dev_type_stop(mttystop); | 186 | dev_type_stop(mttystop); | |
188 | dev_type_tty(mttytty); | 187 | dev_type_tty(mttytty); | |
189 | dev_type_poll(mttypoll); | 188 | dev_type_poll(mttypoll); | |
190 | 189 | |||
191 | const struct cdevsw mtty_cdevsw = { | 190 | const struct cdevsw mtty_cdevsw = { | |
192 | mttyopen, mttyclose, mttyread, mttywrite, mttyioctl, | 191 | mttyopen, mttyclose, mttyread, mttywrite, mttyioctl, | |
193 | mttystop, mttytty, mttypoll, nommap, ttykqfilter, D_TTY | 192 | mttystop, mttytty, mttypoll, nommap, ttykqfilter, D_TTY | |
194 | }; | 193 | }; |
--- src/sys/dev/sbus/p9100.c 2009/09/17 16:28:12 1.48
+++ src/sys/dev/sbus/p9100.c 2009/09/17 16:39:48 1.49
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: p9100.c,v 1.48 2009/09/17 16:28:12 tsutsui Exp $ */ | 1 | /* $NetBSD: p9100.c,v 1.49 2009/09/17 16:39:48 tsutsui Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1998, 2005, 2006 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1998, 2005, 2006 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas. | 8 | * by Matt Thomas. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -28,27 +28,27 @@ | @@ -28,27 +28,27 @@ | |||
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | /* | 32 | /* | |
33 | * color display (p9100) driver. | 33 | * color display (p9100) driver. | |
34 | * | 34 | * | |
35 | * Does not handle interrupts, even though they can occur. | 35 | * Does not handle interrupts, even though they can occur. | |
36 | * | 36 | * | |
37 | * XXX should defer colormap updates to vertical retrace interrupts | 37 | * XXX should defer colormap updates to vertical retrace interrupts | |
38 | */ | 38 | */ | |
39 | 39 | |||
40 | #include <sys/cdefs.h> | 40 | #include <sys/cdefs.h> | |
41 | __KERNEL_RCSID(0, "$NetBSD: p9100.c,v 1.48 2009/09/17 16:28:12 tsutsui Exp $"); | 41 | __KERNEL_RCSID(0, "$NetBSD: p9100.c,v 1.49 2009/09/17 16:39:48 tsutsui Exp $"); | |
42 | 42 | |||
43 | #include <sys/param.h> | 43 | #include <sys/param.h> | |
44 | #include <sys/systm.h> | 44 | #include <sys/systm.h> | |
45 | #include <sys/buf.h> | 45 | #include <sys/buf.h> | |
46 | #include <sys/device.h> | 46 | #include <sys/device.h> | |
47 | #include <sys/ioctl.h> | 47 | #include <sys/ioctl.h> | |
48 | #include <sys/malloc.h> | 48 | #include <sys/malloc.h> | |
49 | #include <sys/mman.h> | 49 | #include <sys/mman.h> | |
50 | #include <sys/tty.h> | 50 | #include <sys/tty.h> | |
51 | #include <sys/conf.h> | 51 | #include <sys/conf.h> | |
52 | 52 | |||
53 | #include <sys/bus.h> | 53 | #include <sys/bus.h> | |
54 | #include <machine/autoconf.h> | 54 | #include <machine/autoconf.h> | |
@@ -63,26 +63,28 @@ __KERNEL_RCSID(0, "$NetBSD: p9100.c,v 1. | @@ -63,26 +63,28 @@ __KERNEL_RCSID(0, "$NetBSD: p9100.c,v 1. | |||
63 | #include <dev/sbus/sbusvar.h> | 63 | #include <dev/sbus/sbusvar.h> | |
64 | 64 | |||
65 | #include <dev/wscons/wsdisplayvar.h> | 65 | #include <dev/wscons/wsdisplayvar.h> | |
66 | #include <dev/wscons/wsconsio.h> | 66 | #include <dev/wscons/wsconsio.h> | |
67 | #include <dev/wsfont/wsfont.h> | 67 | #include <dev/wsfont/wsfont.h> | |
68 | #include <dev/rasops/rasops.h> | 68 | #include <dev/rasops/rasops.h> | |
69 | 69 | |||
70 | #include <dev/wscons/wsdisplay_vconsvar.h> | 70 | #include <dev/wscons/wsdisplay_vconsvar.h> | |
71 | 71 | |||
72 | #include "opt_wsemul.h" | 72 | #include "opt_wsemul.h" | |
73 | #include "rasops_glue.h" | 73 | #include "rasops_glue.h" | |
74 | #include "opt_pnozz.h" | 74 | #include "opt_pnozz.h" | |
75 | 75 | |||
76 | #include "ioconf.h" | |||
77 | ||||
76 | #include "tctrl.h" | 78 | #include "tctrl.h" | |
77 | #if NTCTRL > 0 | 79 | #if NTCTRL > 0 | |
78 | #include <machine/tctrl.h> | 80 | #include <machine/tctrl.h> | |
79 | #include <sparc/dev/tctrlvar.h> /*XXX*/ | 81 | #include <sparc/dev/tctrlvar.h> /*XXX*/ | |
80 | #endif | 82 | #endif | |
81 | 83 | |||
82 | #ifdef PNOZZ_DEBUG | 84 | #ifdef PNOZZ_DEBUG | |
83 | #define DPRINTF aprint_normal | 85 | #define DPRINTF aprint_normal | |
84 | #else | 86 | #else | |
85 | #define DPRINTF while (0) aprint_normal | 87 | #define DPRINTF while (0) aprint_normal | |
86 | #endif | 88 | #endif | |
87 | 89 | |||
88 | struct pnozz_cursor { | 90 | struct pnozz_cursor { | |
@@ -153,28 +155,26 @@ struct wsscreen_list p9100_screenlist = | @@ -153,28 +155,26 @@ struct wsscreen_list p9100_screenlist = | |||
153 | sizeof(_p9100_scrlist) / sizeof(struct wsscreen_descr *), | 155 | sizeof(_p9100_scrlist) / sizeof(struct wsscreen_descr *), | |
154 | _p9100_scrlist | 156 | _p9100_scrlist | |
155 | }; | 157 | }; | |
156 | 158 | |||
157 | /* autoconfiguration driver */ | 159 | /* autoconfiguration driver */ | |
158 | static int p9100_sbus_match(device_t, cfdata_t, void *); | 160 | static int p9100_sbus_match(device_t, cfdata_t, void *); | |
159 | static void p9100_sbus_attach(device_t, device_t, void *); | 161 | static void p9100_sbus_attach(device_t, device_t, void *); | |
160 | 162 | |||
161 | static void p9100unblank(device_t); | 163 | static void p9100unblank(device_t); | |
162 | 164 | |||
163 | CFATTACH_DECL_NEW(pnozz, sizeof(struct p9100_softc), | 165 | CFATTACH_DECL_NEW(pnozz, sizeof(struct p9100_softc), | |
164 | p9100_sbus_match, p9100_sbus_attach, NULL, NULL); | 166 | p9100_sbus_match, p9100_sbus_attach, NULL, NULL); | |
165 | 167 | |||
166 | extern struct cfdriver pnozz_cd; | |||
167 | ||||
168 | static dev_type_open(p9100open); | 168 | static dev_type_open(p9100open); | |
169 | static dev_type_ioctl(p9100ioctl); | 169 | static dev_type_ioctl(p9100ioctl); | |
170 | static dev_type_mmap(p9100mmap); | 170 | static dev_type_mmap(p9100mmap); | |
171 | 171 | |||
172 | const struct cdevsw pnozz_cdevsw = { | 172 | const struct cdevsw pnozz_cdevsw = { | |
173 | p9100open, nullclose, noread, nowrite, p9100ioctl, | 173 | p9100open, nullclose, noread, nowrite, p9100ioctl, | |
174 | nostop, notty, nopoll, p9100mmap, nokqfilter, | 174 | nostop, notty, nopoll, p9100mmap, nokqfilter, | |
175 | }; | 175 | }; | |
176 | 176 | |||
177 | /* frame buffer generic driver */ | 177 | /* frame buffer generic driver */ | |
178 | static struct fbdriver p9100fbdriver = { | 178 | static struct fbdriver p9100fbdriver = { | |
179 | p9100unblank, p9100open, nullclose, p9100ioctl, nopoll, | 179 | p9100unblank, p9100open, nullclose, p9100ioctl, nopoll, | |
180 | p9100mmap, nokqfilter | 180 | p9100mmap, nokqfilter |
--- src/sys/dev/sbus/spif.c 2009/05/12 14:43:59 1.23
+++ src/sys/dev/sbus/spif.c 2009/09/17 16:39:48 1.24
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: spif.c,v 1.23 2009/05/12 14:43:59 cegger Exp $ */ | 1 | /* $NetBSD: spif.c,v 1.24 2009/09/17 16:39:48 tsutsui Exp $ */ | |
2 | /* $OpenBSD: spif.c,v 1.12 2003/10/03 16:44:51 miod Exp $ */ | 2 | /* $OpenBSD: spif.c,v 1.12 2003/10/03 16:44:51 miod Exp $ */ | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * Copyright (c) 1999-2002 Jason L. Wright (jason@thought.net) | 5 | * Copyright (c) 1999-2002 Jason L. Wright (jason@thought.net) | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * | 7 | * | |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without | |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions | |
10 | * are met: | 10 | * are met: | |
11 | * 1. Redistributions of source code must retain the above copyright | 11 | * 1. Redistributions of source code must retain the above copyright | |
12 | * notice, this list of conditions and the following disclaimer. | 12 | * notice, this list of conditions and the following disclaimer. | |
13 | * 2. Redistributions in binary form must reproduce the above copyright | 13 | * 2. Redistributions in binary form must reproduce the above copyright | |
14 | * notice, this list of conditions and the following disclaimer in the | 14 | * notice, this list of conditions and the following disclaimer in the | |
@@ -31,27 +31,27 @@ | @@ -31,27 +31,27 @@ | |||
31 | * Materiel Command, USAF, under agreement number F30602-01-2-0537. | 31 | * Materiel Command, USAF, under agreement number F30602-01-2-0537. | |
32 | * | 32 | * | |
33 | */ | 33 | */ | |
34 | 34 | |||
35 | /* | 35 | /* | |
36 | * Driver for the SUNW,spif: 8 serial, 1 parallel sbus board | 36 | * Driver for the SUNW,spif: 8 serial, 1 parallel sbus board | |
37 | * based heavily on Iain Hibbert's driver for the MAGMA cards | 37 | * based heavily on Iain Hibbert's driver for the MAGMA cards | |
38 | */ | 38 | */ | |
39 | 39 | |||
40 | /* Ported to NetBSD 2.0 by Hauke Fath */ | 40 | /* Ported to NetBSD 2.0 by Hauke Fath */ | |
41 | 41 | |||
42 | 42 | |||
43 | #include <sys/cdefs.h> | 43 | #include <sys/cdefs.h> | |
44 | __KERNEL_RCSID(0, "$NetBSD: spif.c,v 1.23 2009/05/12 14:43:59 cegger Exp $"); | 44 | __KERNEL_RCSID(0, "$NetBSD: spif.c,v 1.24 2009/09/17 16:39:48 tsutsui Exp $"); | |
45 | 45 | |||
46 | #include "spif.h" | 46 | #include "spif.h" | |
47 | #if NSPIF > 0 | 47 | #if NSPIF > 0 | |
48 | 48 | |||
49 | #include <sys/param.h> | 49 | #include <sys/param.h> | |
50 | #include <sys/systm.h> | 50 | #include <sys/systm.h> | |
51 | #include <sys/proc.h> | 51 | #include <sys/proc.h> | |
52 | #include <sys/device.h> | 52 | #include <sys/device.h> | |
53 | #include <sys/file.h> | 53 | #include <sys/file.h> | |
54 | #include <sys/ioctl.h> | 54 | #include <sys/ioctl.h> | |
55 | #include <sys/malloc.h> | 55 | #include <sys/malloc.h> | |
56 | #include <sys/tty.h> | 56 | #include <sys/tty.h> | |
57 | #include <sys/time.h> | 57 | #include <sys/time.h> | |
@@ -61,42 +61,39 @@ __KERNEL_RCSID(0, "$NetBSD: spif.c,v 1.2 | @@ -61,42 +61,39 @@ __KERNEL_RCSID(0, "$NetBSD: spif.c,v 1.2 | |||
61 | #include <sys/errno.h> | 61 | #include <sys/errno.h> | |
62 | #include <sys/kauth.h> | 62 | #include <sys/kauth.h> | |
63 | #include <sys/intr.h> | 63 | #include <sys/intr.h> | |
64 | 64 | |||
65 | #include <sys/bus.h> | 65 | #include <sys/bus.h> | |
66 | #include <machine/autoconf.h> | 66 | #include <machine/autoconf.h> | |
67 | #include <machine/promlib.h> | 67 | #include <machine/promlib.h> | |
68 | 68 | |||
69 | #include <dev/sbus/sbusvar.h> | 69 | #include <dev/sbus/sbusvar.h> | |
70 | 70 | |||
71 | #include <dev/sbus/spifvar.h> | 71 | #include <dev/sbus/spifvar.h> | |
72 | #include <dev/sbus/spifreg.h> | 72 | #include <dev/sbus/spifreg.h> | |
73 | 73 | |||
74 | #include "ioconf.h" | |||
74 | 75 | |||
75 | /* Autoconfig stuff */ | 76 | /* Autoconfig stuff */ | |
76 | 77 | |||
77 | CFATTACH_DECL(spif, sizeof(struct spif_softc), | 78 | CFATTACH_DECL(spif, sizeof(struct spif_softc), | |
78 | spif_match, spif_attach, NULL, NULL); | 79 | spif_match, spif_attach, NULL, NULL); | |
79 | 80 | |||
80 | CFATTACH_DECL(stty, sizeof(struct stty_softc), | 81 | CFATTACH_DECL(stty, sizeof(struct stty_softc), | |
81 | stty_match, stty_attach, NULL, NULL); | 82 | stty_match, stty_attach, NULL, NULL); | |
82 | 83 | |||
83 | CFATTACH_DECL(sbpp, sizeof(struct sbpp_softc), | 84 | CFATTACH_DECL(sbpp, sizeof(struct sbpp_softc), | |
84 | sbpp_match, sbpp_attach, NULL, NULL); | 85 | sbpp_match, sbpp_attach, NULL, NULL); | |
85 | 86 | |||
86 | extern struct cfdriver spif_cd; | |||
87 | extern struct cfdriver stty_cd; | |||
88 | extern struct cfdriver sbpp_cd; | |||
89 | ||||
90 | dev_type_open(stty_open); | 87 | dev_type_open(stty_open); | |
91 | dev_type_close(stty_close); | 88 | dev_type_close(stty_close); | |
92 | dev_type_read(stty_read); | 89 | dev_type_read(stty_read); | |
93 | dev_type_write(stty_write); | 90 | dev_type_write(stty_write); | |
94 | dev_type_ioctl(stty_ioctl); | 91 | dev_type_ioctl(stty_ioctl); | |
95 | dev_type_stop(stty_stop); | 92 | dev_type_stop(stty_stop); | |
96 | dev_type_tty(stty_tty); | 93 | dev_type_tty(stty_tty); | |
97 | dev_type_poll(stty_poll); | 94 | dev_type_poll(stty_poll); | |
98 | 95 | |||
99 | const struct cdevsw stty_cdevsw = { | 96 | const struct cdevsw stty_cdevsw = { | |
100 | stty_open, stty_close, stty_read, stty_write, stty_ioctl, | 97 | stty_open, stty_close, stty_read, stty_write, stty_ioctl, | |
101 | stty_stop, stty_tty, stty_poll, nommap, ttykqfilter, D_TTY | 98 | stty_stop, stty_tty, stty_poll, nommap, ttykqfilter, D_TTY | |
102 | }; | 99 | }; |
--- src/sys/dev/sbus/tcx.c 2009/09/17 16:28:13 1.41
+++ src/sys/dev/sbus/tcx.c 2009/09/17 16:39:48 1.42
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: tcx.c,v 1.41 2009/09/17 16:28:13 tsutsui Exp $ */ | 1 | /* $NetBSD: tcx.c,v 1.42 2009/09/17 16:39:48 tsutsui Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1996, 1998, 2009 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1996, 1998, 2009 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Paul Kranenburg and Michael Lorenz. | 8 | * by Paul Kranenburg and Michael Lorenz. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -28,27 +28,27 @@ | @@ -28,27 +28,27 @@ | |||
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | /* | 32 | /* | |
33 | * color display (TCX) driver. | 33 | * color display (TCX) driver. | |
34 | * | 34 | * | |
35 | * Does not handle interrupts, even though they can occur. | 35 | * Does not handle interrupts, even though they can occur. | |
36 | * | 36 | * | |
37 | * XXX should defer colormap updates to vertical retrace interrupts | 37 | * XXX should defer colormap updates to vertical retrace interrupts | |
38 | */ | 38 | */ | |
39 | 39 | |||
40 | #include <sys/cdefs.h> | 40 | #include <sys/cdefs.h> | |
41 | __KERNEL_RCSID(0, "$NetBSD: tcx.c,v 1.41 2009/09/17 16:28:13 tsutsui Exp $"); | 41 | __KERNEL_RCSID(0, "$NetBSD: tcx.c,v 1.42 2009/09/17 16:39:48 tsutsui Exp $"); | |
42 | 42 | |||
43 | /* | 43 | /* | |
44 | * define for cg8 emulation on S24 (24-bit version of tcx) for the SS5; | 44 | * define for cg8 emulation on S24 (24-bit version of tcx) for the SS5; | |
45 | * it is bypassed on the 8-bit version (onboard framebuffer for SS4) | 45 | * it is bypassed on the 8-bit version (onboard framebuffer for SS4) | |
46 | */ | 46 | */ | |
47 | #undef TCX_CG8 | 47 | #undef TCX_CG8 | |
48 | 48 | |||
49 | #include <sys/param.h> | 49 | #include <sys/param.h> | |
50 | #include <sys/systm.h> | 50 | #include <sys/systm.h> | |
51 | #include <sys/buf.h> | 51 | #include <sys/buf.h> | |
52 | #include <sys/device.h> | 52 | #include <sys/device.h> | |
53 | #include <sys/ioctl.h> | 53 | #include <sys/ioctl.h> | |
54 | #include <sys/malloc.h> | 54 | #include <sys/malloc.h> | |
@@ -71,26 +71,28 @@ __KERNEL_RCSID(0, "$NetBSD: tcx.c,v 1.41 | @@ -71,26 +71,28 @@ __KERNEL_RCSID(0, "$NetBSD: tcx.c,v 1.41 | |||
71 | 71 | |||
72 | #include <dev/sbus/sbusvar.h> | 72 | #include <dev/sbus/sbusvar.h> | |
73 | #include <dev/sbus/tcxreg.h> | 73 | #include <dev/sbus/tcxreg.h> | |
74 | 74 | |||
75 | #include <dev/wscons/wsdisplayvar.h> | 75 | #include <dev/wscons/wsdisplayvar.h> | |
76 | #include <dev/wscons/wsconsio.h> | 76 | #include <dev/wscons/wsconsio.h> | |
77 | #include <dev/wsfont/wsfont.h> | 77 | #include <dev/wsfont/wsfont.h> | |
78 | #include <dev/rasops/rasops.h> | 78 | #include <dev/rasops/rasops.h> | |
79 | 79 | |||
80 | #include <dev/wscons/wsdisplay_vconsvar.h> | 80 | #include <dev/wscons/wsdisplay_vconsvar.h> | |
81 | 81 | |||
82 | #include "opt_wsemul.h" | 82 | #include "opt_wsemul.h" | |
83 | 83 | |||
84 | #include "ioconf.h" | |||
85 | ||||
84 | /* per-display variables */ | 86 | /* per-display variables */ | |
85 | struct tcx_softc { | 87 | struct tcx_softc { | |
86 | device_t sc_dev; /* base device */ | 88 | device_t sc_dev; /* base device */ | |
87 | struct fbdevice sc_fb; /* frame buffer device */ | 89 | struct fbdevice sc_fb; /* frame buffer device */ | |
88 | bus_space_tag_t sc_bustag; | 90 | bus_space_tag_t sc_bustag; | |
89 | struct openprom_addr sc_physaddr[TCX_NREG];/* phys addr of h/w */ | 91 | struct openprom_addr sc_physaddr[TCX_NREG];/* phys addr of h/w */ | |
90 | 92 | |||
91 | bus_space_handle_t sc_bt; /* Brooktree registers */ | 93 | bus_space_handle_t sc_bt; /* Brooktree registers */ | |
92 | bus_space_handle_t sc_thc; /* THC registers */ | 94 | bus_space_handle_t sc_thc; /* THC registers */ | |
93 | uint8_t *sc_fbaddr; /* framebuffer */ | 95 | uint8_t *sc_fbaddr; /* framebuffer */ | |
94 | uint64_t *sc_rblit; /* blitspace */ | 96 | uint64_t *sc_rblit; /* blitspace */ | |
95 | uint64_t *sc_rstip; /* stipple space */ | 97 | uint64_t *sc_rstip; /* stipple space */ | |
96 | 98 | |||
@@ -140,28 +142,26 @@ struct wsscreen_list tcx_screenlist = { | @@ -140,28 +142,26 @@ struct wsscreen_list tcx_screenlist = { | |||
140 | #define TCX_CTL_8_MAPPED 0x00000000 /* 8 bits, uses color map */ | 142 | #define TCX_CTL_8_MAPPED 0x00000000 /* 8 bits, uses color map */ | |
141 | #define TCX_CTL_24_MAPPED 0x01000000 /* 24 bits, uses color map */ | 143 | #define TCX_CTL_24_MAPPED 0x01000000 /* 24 bits, uses color map */ | |
142 | #define TCX_CTL_24_LEVEL 0x03000000 /* 24 bits, ignores color map */ | 144 | #define TCX_CTL_24_LEVEL 0x03000000 /* 24 bits, ignores color map */ | |
143 | #define TCX_CTL_PIXELMASK 0x00FFFFFF /* mask for index/level */ | 145 | #define TCX_CTL_PIXELMASK 0x00FFFFFF /* mask for index/level */ | |
144 | 146 | |||
145 | /* autoconfiguration driver */ | 147 | /* autoconfiguration driver */ | |
146 | static void tcxattach(device_t, device_t, void *); | 148 | static void tcxattach(device_t, device_t, void *); | |
147 | static int tcxmatch(device_t, cfdata_t, void *); | 149 | static int tcxmatch(device_t, cfdata_t, void *); | |
148 | static void tcx_unblank(device_t); | 150 | static void tcx_unblank(device_t); | |
149 | 151 | |||
150 | CFATTACH_DECL_NEW(tcx, sizeof(struct tcx_softc), | 152 | CFATTACH_DECL_NEW(tcx, sizeof(struct tcx_softc), | |
151 | tcxmatch, tcxattach, NULL, NULL); | 153 | tcxmatch, tcxattach, NULL, NULL); | |
152 | 154 | |||
153 | extern struct cfdriver tcx_cd; | |||
154 | ||||
155 | dev_type_open(tcxopen); | 155 | dev_type_open(tcxopen); | |
156 | dev_type_close(tcxclose); | 156 | dev_type_close(tcxclose); | |
157 | dev_type_ioctl(tcxioctl); | 157 | dev_type_ioctl(tcxioctl); | |
158 | dev_type_mmap(tcxmmap); | 158 | dev_type_mmap(tcxmmap); | |
159 | 159 | |||
160 | const struct cdevsw tcx_cdevsw = { | 160 | const struct cdevsw tcx_cdevsw = { | |
161 | tcxopen, tcxclose, noread, nowrite, tcxioctl, | 161 | tcxopen, tcxclose, noread, nowrite, tcxioctl, | |
162 | nostop, notty, nopoll, tcxmmap, nokqfilter, | 162 | nostop, notty, nopoll, tcxmmap, nokqfilter, | |
163 | }; | 163 | }; | |
164 | 164 | |||
165 | /* frame buffer generic driver */ | 165 | /* frame buffer generic driver */ | |
166 | static struct fbdriver tcx_fbdriver = { | 166 | static struct fbdriver tcx_fbdriver = { | |
167 | tcx_unblank, tcxopen, tcxclose, tcxioctl, nopoll, tcxmmap, | 167 | tcx_unblank, tcxopen, tcxclose, tcxioctl, nopoll, tcxmmap, |
--- src/sys/dev/sbus/zx.c 2009/09/17 16:28:13 1.31
+++ src/sys/dev/sbus/zx.c 2009/09/17 16:39:48 1.32
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: zx.c,v 1.31 2009/09/17 16:28:13 tsutsui Exp $ */ | 1 | /* $NetBSD: zx.c,v 1.32 2009/09/17 16:39:48 tsutsui Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2002 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2002 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Andrew Doran. | 8 | * by Andrew Doran. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -35,27 +35,27 @@ | @@ -35,27 +35,27 @@ | |||
35 | * drivers were used as "living documentation" when writing this; thanks | 35 | * drivers were used as "living documentation" when writing this; thanks | |
36 | * to the authors. | 36 | * to the authors. | |
37 | * | 37 | * | |
38 | * Issues (which can be solved with wscons, happily enough): | 38 | * Issues (which can be solved with wscons, happily enough): | |
39 | * | 39 | * | |
40 | * o There is lots of unnecessary mucking about rasops in here, primarily | 40 | * o There is lots of unnecessary mucking about rasops in here, primarily | |
41 | * to appease the sparc fb code. | 41 | * to appease the sparc fb code. | |
42 | * | 42 | * | |
43 | * o RASTERCONSOLE is required. X needs the board set up correctly, and | 43 | * o RASTERCONSOLE is required. X needs the board set up correctly, and | |
44 | * that's difficult to reconcile with using the PROM for output. | 44 | * that's difficult to reconcile with using the PROM for output. | |
45 | */ | 45 | */ | |
46 | 46 | |||
47 | #include <sys/cdefs.h> | 47 | #include <sys/cdefs.h> | |
48 | __KERNEL_RCSID(0, "$NetBSD: zx.c,v 1.31 2009/09/17 16:28:13 tsutsui Exp $"); | 48 | __KERNEL_RCSID(0, "$NetBSD: zx.c,v 1.32 2009/09/17 16:39:48 tsutsui Exp $"); | |
49 | 49 | |||
50 | #include <sys/param.h> | 50 | #include <sys/param.h> | |
51 | #include <sys/systm.h> | 51 | #include <sys/systm.h> | |
52 | #include <sys/device.h> | 52 | #include <sys/device.h> | |
53 | #include <sys/ioctl.h> | 53 | #include <sys/ioctl.h> | |
54 | #include <sys/malloc.h> | 54 | #include <sys/malloc.h> | |
55 | #include <sys/mman.h> | 55 | #include <sys/mman.h> | |
56 | #include <sys/tty.h> | 56 | #include <sys/tty.h> | |
57 | #include <sys/conf.h> | 57 | #include <sys/conf.h> | |
58 | #include <sys/syslog.h> | 58 | #include <sys/syslog.h> | |
59 | #include <sys/buf.h> | 59 | #include <sys/buf.h> | |
60 | 60 | |||
61 | #include <sys/bus.h> | 61 | #include <sys/bus.h> | |
@@ -72,26 +72,28 @@ __KERNEL_RCSID(0, "$NetBSD: zx.c,v 1.31 | @@ -72,26 +72,28 @@ __KERNEL_RCSID(0, "$NetBSD: zx.c,v 1.31 | |||
72 | #include <dev/wsfont/wsfont.h> | 72 | #include <dev/wsfont/wsfont.h> | |
73 | #include <dev/rasops/rasops.h> | 73 | #include <dev/rasops/rasops.h> | |
74 | #include <dev/wscons/wsdisplay_vconsvar.h> | 74 | #include <dev/wscons/wsdisplay_vconsvar.h> | |
75 | 75 | |||
76 | #include "opt_wsemul.h" | 76 | #include "opt_wsemul.h" | |
77 | #endif | 77 | #endif | |
78 | 78 | |||
79 | #include <dev/sbus/zxreg.h> | 79 | #include <dev/sbus/zxreg.h> | |
80 | #include <dev/sbus/zxvar.h> | 80 | #include <dev/sbus/zxvar.h> | |
81 | #include <dev/sbus/sbusvar.h> | 81 | #include <dev/sbus/sbusvar.h> | |
82 | 82 | |||
83 | #include <dev/wscons/wsconsio.h> | 83 | #include <dev/wscons/wsconsio.h> | |
84 | 84 | |||
85 | #include "ioconf.h" | |||
86 | ||||
85 | #if (NWSDISPLAY == 0) && !defined(RASTERCONSOLE) | 87 | #if (NWSDISPLAY == 0) && !defined(RASTERCONSOLE) | |
86 | #error Sorry, this driver needs WSCONS or RASTERCONSOLE | 88 | #error Sorry, this driver needs WSCONS or RASTERCONSOLE | |
87 | #endif | 89 | #endif | |
88 | 90 | |||
89 | #if (NWSDISPLAY > 0) && defined(RASTERCONSOLE) | 91 | #if (NWSDISPLAY > 0) && defined(RASTERCONSOLE) | |
90 | #error Sorry, RASTERCONSOLE and WSCONS are mutually exclusive | 92 | #error Sorry, RASTERCONSOLE and WSCONS are mutually exclusive | |
91 | #endif | 93 | #endif | |
92 | 94 | |||
93 | #define ZX_STD_ROP (ZX_ROP_NEW | ZX_ATTR_WE_ENABLE | \ | 95 | #define ZX_STD_ROP (ZX_ROP_NEW | ZX_ATTR_WE_ENABLE | \ | |
94 | ZX_ATTR_OE_ENABLE | ZX_ATTR_FORCE_WID) | 96 | ZX_ATTR_OE_ENABLE | ZX_ATTR_FORCE_WID) | |
95 | 97 | |||
96 | static void zx_attach(device_t, device_t, void *); | 98 | static void zx_attach(device_t, device_t, void *); | |
97 | static int zx_match(device_t, cfdata_t, void *); | 99 | static int zx_match(device_t, cfdata_t, void *); | |
@@ -130,28 +132,26 @@ struct zx_mmo { | @@ -130,28 +132,26 @@ struct zx_mmo { | |||
130 | { ZX_LX0_CURSOR_VOFF, ZX_OFF_LX_CURSOR, 0x00001000 }, | 132 | { ZX_LX0_CURSOR_VOFF, ZX_OFF_LX_CURSOR, 0x00001000 }, | |
131 | { ZX_FB1_VOFF, ZX_OFF_SS1, 0x00800000 }, | 133 | { ZX_FB1_VOFF, ZX_OFF_SS1, 0x00800000 }, | |
132 | { ZX_LC1_VOFF, ZX_OFF_LC_SS1_USR, 0x00001000 }, | 134 | { ZX_LC1_VOFF, ZX_OFF_LC_SS1_USR, 0x00001000 }, | |
133 | { ZX_LD1_VOFF, ZX_OFF_LD_SS1, 0x00001000 }, | 135 | { ZX_LD1_VOFF, ZX_OFF_LD_SS1, 0x00001000 }, | |
134 | { ZX_LX_KRN_VOFF, ZX_OFF_LX_CROSS, 0x00001000 }, | 136 | { ZX_LX_KRN_VOFF, ZX_OFF_LX_CROSS, 0x00001000 }, | |
135 | { ZX_LC0_KRN_VOFF, ZX_OFF_LC_SS0_KRN, 0x00001000 }, | 137 | { ZX_LC0_KRN_VOFF, ZX_OFF_LC_SS0_KRN, 0x00001000 }, | |
136 | { ZX_LC1_KRN_VOFF, ZX_OFF_LC_SS1_KRN, 0x00001000 }, | 138 | { ZX_LC1_KRN_VOFF, ZX_OFF_LC_SS1_KRN, 0x00001000 }, | |
137 | { ZX_LD_GBL_VOFF, ZX_OFF_LD_GBL, 0x00001000 }, | 139 | { ZX_LD_GBL_VOFF, ZX_OFF_LD_GBL, 0x00001000 }, | |
138 | }; | 140 | }; | |
139 | 141 | |||
140 | CFATTACH_DECL_NEW(zx, sizeof(struct zx_softc), | 142 | CFATTACH_DECL_NEW(zx, sizeof(struct zx_softc), | |
141 | zx_match, zx_attach, NULL, NULL); | 143 | zx_match, zx_attach, NULL, NULL); | |
142 | 144 | |||
143 | extern struct cfdriver zx_cd; | |||
144 | ||||
145 | static dev_type_open(zxopen); | 145 | static dev_type_open(zxopen); | |
146 | static dev_type_close(zxclose); | 146 | static dev_type_close(zxclose); | |
147 | static dev_type_ioctl(zxioctl); | 147 | static dev_type_ioctl(zxioctl); | |
148 | static dev_type_mmap(zxmmap); | 148 | static dev_type_mmap(zxmmap); | |
149 | 149 | |||
150 | static struct fbdriver zx_fbdriver = { | 150 | static struct fbdriver zx_fbdriver = { | |
151 | zx_unblank, zxopen, zxclose, zxioctl, nopoll, zxmmap | 151 | zx_unblank, zxopen, zxclose, zxioctl, nopoll, zxmmap | |
152 | }; | 152 | }; | |
153 | 153 | |||
154 | #if NWSDISPLAY > 0 | 154 | #if NWSDISPLAY > 0 | |
155 | struct wsscreen_descr zx_defaultscreen = { | 155 | struct wsscreen_descr zx_defaultscreen = { | |
156 | "std", | 156 | "std", | |
157 | 0, 0, /* will be filled in -- XXX shouldn't, it's global */ | 157 | 0, 0, /* will be filled in -- XXX shouldn't, it's global */ |