u_intNN_t -> uintNN_t Same code before and after.diff -r1.11 -r1.12 src/sys/dev/ic/sti.c
(skrll)
--- src/sys/dev/ic/sti.c 2010/10/31 15:47:53 1.11
+++ src/sys/dev/ic/sti.c 2010/11/01 06:41:50 1.12
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: sti.c,v 1.11 2010/10/31 15:47:53 skrll Exp $ */ | 1 | /* $NetBSD: sti.c,v 1.12 2010/11/01 06:41:50 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: sti.c,v 1.35 2003/12/16 06:07:13 mickey Exp $ */ | 3 | /* $OpenBSD: sti.c,v 1.35 2003/12/16 06:07:13 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 2000-2003 Michael Shalayeff | 6 | * Copyright (c) 2000-2003 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -25,27 +25,27 @@ | @@ -25,27 +25,27 @@ | |||
25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
26 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | 26 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
27 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | 27 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | |
28 | * THE POSSIBILITY OF SUCH DAMAGE. | 28 | * THE POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | /* | 30 | /* | |
31 | * TODO: | 31 | * TODO: | |
32 | * call sti procs asynchronously; | 32 | * call sti procs asynchronously; | |
33 | * implement console scroll-back; | 33 | * implement console scroll-back; | |
34 | * X11 support. | 34 | * X11 support. | |
35 | */ | 35 | */ | |
36 | 36 | |||
37 | #include <sys/cdefs.h> | 37 | #include <sys/cdefs.h> | |
38 | __KERNEL_RCSID(0, "$NetBSD: sti.c,v 1.11 2010/10/31 15:47:53 skrll Exp $"); | 38 | __KERNEL_RCSID(0, "$NetBSD: sti.c,v 1.12 2010/11/01 06:41:50 skrll Exp $"); | |
39 | 39 | |||
40 | #include "wsdisplay.h" | 40 | #include "wsdisplay.h" | |
41 | 41 | |||
42 | #include <sys/param.h> | 42 | #include <sys/param.h> | |
43 | #include <sys/systm.h> | 43 | #include <sys/systm.h> | |
44 | #include <sys/device.h> | 44 | #include <sys/device.h> | |
45 | #include <sys/malloc.h> | 45 | #include <sys/malloc.h> | |
46 | 46 | |||
47 | #include <uvm/uvm.h> | 47 | #include <uvm/uvm.h> | |
48 | 48 | |||
49 | #include <sys/bus.h> | 49 | #include <sys/bus.h> | |
50 | 50 | |||
51 | #include <dev/wscons/wsdisplayvar.h> | 51 | #include <dev/wscons/wsdisplayvar.h> | |
@@ -106,42 +106,42 @@ struct wsscreen_list sti_default_screenl | @@ -106,42 +106,42 @@ struct wsscreen_list sti_default_screenl | |||
106 | sizeof(sti_default_scrlist) / sizeof(sti_default_scrlist[0]), | 106 | sizeof(sti_default_scrlist) / sizeof(sti_default_scrlist[0]), | |
107 | sti_default_scrlist | 107 | sti_default_scrlist | |
108 | }; | 108 | }; | |
109 | 109 | |||
110 | enum sti_bmove_funcs { | 110 | enum sti_bmove_funcs { | |
111 | bmf_clear, bmf_copy, bmf_invert, bmf_underline | 111 | bmf_clear, bmf_copy, bmf_invert, bmf_underline | |
112 | }; | 112 | }; | |
113 | 113 | |||
114 | int sti_init(struct sti_softc *, int); | 114 | int sti_init(struct sti_softc *, int); | |
115 | int sti_inqcfg(struct sti_softc *, struct sti_inqconfout *); | 115 | int sti_inqcfg(struct sti_softc *, struct sti_inqconfout *); | |
116 | void sti_bmove(struct sti_softc *, int, int, int, int, int, int, | 116 | void sti_bmove(struct sti_softc *, int, int, int, int, int, int, | |
117 | enum sti_bmove_funcs); | 117 | enum sti_bmove_funcs); | |
118 | int sti_setcment(struct sti_softc *, u_int, u_char, u_char, u_char); | 118 | int sti_setcment(struct sti_softc *, u_int, u_char, u_char, u_char); | |
119 | int sti_fetchfonts(struct sti_softc *, struct sti_inqconfout *, u_int32_t); | 119 | int sti_fetchfonts(struct sti_softc *, struct sti_inqconfout *, uint32_t); | |
120 | void sti_attach_deferred(device_t); | 120 | void sti_attach_deferred(device_t); | |
121 | 121 | |||
122 | void | 122 | void | |
123 | sti_attach_common(struct sti_softc *sc) | 123 | sti_attach_common(struct sti_softc *sc) | |
124 | { | 124 | { | |
125 | struct sti_inqconfout cfg; | 125 | struct sti_inqconfout cfg; | |
126 | struct sti_einqconfout ecfg; | 126 | struct sti_einqconfout ecfg; | |
127 | bus_space_handle_t fbh; | 127 | bus_space_handle_t fbh; | |
128 | struct sti_dd *dd; | 128 | struct sti_dd *dd; | |
129 | struct sti_cfg *cc; | 129 | struct sti_cfg *cc; | |
130 | int error, size, i; | 130 | int error, size, i; | |
131 | u_int8_t *p = (u_int8_t *)sc->sc_code; | 131 | uint8_t *p = (uint8_t *)sc->sc_code; | |
132 | u_int32_t addr, eaddr; | 132 | uint32_t addr, eaddr; | |
133 | struct sti_region r; | 133 | struct sti_region r; | |
134 | u_int32_t *q; | 134 | uint32_t *q; | |
135 | uint32_t tmp; | 135 | uint32_t tmp; | |
136 | 136 | |||
137 | dd = &sc->sc_dd; | 137 | dd = &sc->sc_dd; | |
138 | if (sc->sc_devtype == STI_DEVTYPE1) { | 138 | if (sc->sc_devtype == STI_DEVTYPE1) { | |
139 | #define parseshort(o) \ | 139 | #define parseshort(o) \ | |
140 | ((bus_space_read_1(sc->memt, sc->romh, (o) + 3) << 8) | \ | 140 | ((bus_space_read_1(sc->memt, sc->romh, (o) + 3) << 8) | \ | |
141 | (bus_space_read_1(sc->memt, sc->romh, (o) + 7))) | 141 | (bus_space_read_1(sc->memt, sc->romh, (o) + 7))) | |
142 | #define parseword(o) \ | 142 | #define parseword(o) \ | |
143 | ((bus_space_read_1(sc->memt, sc->romh, (o) + 3) << 24) | \ | 143 | ((bus_space_read_1(sc->memt, sc->romh, (o) + 3) << 24) | \ | |
144 | (bus_space_read_1(sc->memt, sc->romh, (o) + 7) << 16) | \ | 144 | (bus_space_read_1(sc->memt, sc->romh, (o) + 7) << 16) | \ | |
145 | (bus_space_read_1(sc->memt, sc->romh, (o) + 11) << 8) | \ | 145 | (bus_space_read_1(sc->memt, sc->romh, (o) + 11) << 8) | \ | |
146 | (bus_space_read_1(sc->memt, sc->romh, (o) + 15))) | 146 | (bus_space_read_1(sc->memt, sc->romh, (o) + 15))) | |
147 | 147 | |||
@@ -177,37 +177,37 @@ sti_attach_common(struct sti_softc *sc) | @@ -177,37 +177,37 @@ sti_attach_common(struct sti_softc *sc) | |||
177 | dd->dd_pacode[0x4] = parseword(0x140) & ~3; | 177 | dd->dd_pacode[0x4] = parseword(0x140) & ~3; | |
178 | dd->dd_pacode[0x5] = parseword(0x150) & ~3; | 178 | dd->dd_pacode[0x5] = parseword(0x150) & ~3; | |
179 | dd->dd_pacode[0x6] = parseword(0x160) & ~3; | 179 | dd->dd_pacode[0x6] = parseword(0x160) & ~3; | |
180 | dd->dd_pacode[0x7] = parseword(0x170) & ~3; | 180 | dd->dd_pacode[0x7] = parseword(0x170) & ~3; | |
181 | dd->dd_pacode[0x8] = parseword(0x180) & ~3; | 181 | dd->dd_pacode[0x8] = parseword(0x180) & ~3; | |
182 | dd->dd_pacode[0x9] = parseword(0x190) & ~3; | 182 | dd->dd_pacode[0x9] = parseword(0x190) & ~3; | |
183 | dd->dd_pacode[0xa] = parseword(0x1a0) & ~3; | 183 | dd->dd_pacode[0xa] = parseword(0x1a0) & ~3; | |
184 | dd->dd_pacode[0xb] = parseword(0x1b0) & ~3; | 184 | dd->dd_pacode[0xb] = parseword(0x1b0) & ~3; | |
185 | dd->dd_pacode[0xc] = parseword(0x1c0) & ~3; | 185 | dd->dd_pacode[0xc] = parseword(0x1c0) & ~3; | |
186 | dd->dd_pacode[0xd] = parseword(0x1d0) & ~3; | 186 | dd->dd_pacode[0xd] = parseword(0x1d0) & ~3; | |
187 | dd->dd_pacode[0xe] = parseword(0x1e0) & ~3; | 187 | dd->dd_pacode[0xe] = parseword(0x1e0) & ~3; | |
188 | dd->dd_pacode[0xf] = parseword(0x1f0) & ~3; | 188 | dd->dd_pacode[0xf] = parseword(0x1f0) & ~3; | |
189 | } else /* STI_DEVTYPE4 */ | 189 | } else /* STI_DEVTYPE4 */ | |
190 | bus_space_read_region_4(sc->memt, sc->romh, 0, (u_int32_t *)dd, | 190 | bus_space_read_region_4(sc->memt, sc->romh, 0, (uint32_t *)dd, | |
191 | sizeof(*dd) / 4); | 191 | sizeof(*dd) / 4); | |
192 | 192 | |||
193 | #ifdef STIDEBUG | 193 | #ifdef STIDEBUG | |
194 | printf("dd:\n" | 194 | printf("dd:\n" | |
195 | "devtype=%x, rev=%x;%d, altt=%x, gid=%016llx, font=%x, mss=%x\n" | 195 | "devtype=%x, rev=%x;%d, altt=%x, gid=%016llx, font=%x, mss=%x\n" | |
196 | "end=%x, regions=%x, msto=%x, timo=%d, mont=%x, user=%x[%x]\n" | 196 | "end=%x, regions=%x, msto=%x, timo=%d, mont=%x, user=%x[%x]\n" | |
197 | "memrq=%x, pwr=%d, bus=%x, ebus=%x, cfb=%x\n" | 197 | "memrq=%x, pwr=%d, bus=%x, ebus=%x, cfb=%x\n" | |
198 | "code=", | 198 | "code=", | |
199 | dd->dd_type & 0xff, dd->dd_grrev, dd->dd_lrrev, dd->dd_altcodet, | 199 | dd->dd_type & 0xff, dd->dd_grrev, dd->dd_lrrev, dd->dd_altcodet, | |
200 | *(u_int64_t *)dd->dd_grid, dd->dd_fntaddr, dd->dd_maxst, | 200 | *(uint64_t *)dd->dd_grid, dd->dd_fntaddr, dd->dd_maxst, | |
201 | dd->dd_romend, dd->dd_reglst, dd->dd_maxreent, dd->dd_maxtimo, | 201 | dd->dd_romend, dd->dd_reglst, dd->dd_maxreent, dd->dd_maxtimo, | |
202 | dd->dd_montbl, dd->dd_udaddr, dd->dd_udsize, dd->dd_stimemreq, | 202 | dd->dd_montbl, dd->dd_udaddr, dd->dd_udsize, dd->dd_stimemreq, | |
203 | dd->dd_pwruse, dd->dd_bussup, dd->dd_ebussup, dd->dd_cfbaddr); | 203 | dd->dd_pwruse, dd->dd_bussup, dd->dd_ebussup, dd->dd_cfbaddr); | |
204 | printf("%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x\n", | 204 | printf("%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x\n", | |
205 | dd->dd_pacode[0x0], dd->dd_pacode[0x1], dd->dd_pacode[0x2], | 205 | dd->dd_pacode[0x0], dd->dd_pacode[0x1], dd->dd_pacode[0x2], | |
206 | dd->dd_pacode[0x3], dd->dd_pacode[0x4], dd->dd_pacode[0x5], | 206 | dd->dd_pacode[0x3], dd->dd_pacode[0x4], dd->dd_pacode[0x5], | |
207 | dd->dd_pacode[0x6], dd->dd_pacode[0x7], dd->dd_pacode[0x8], | 207 | dd->dd_pacode[0x6], dd->dd_pacode[0x7], dd->dd_pacode[0x8], | |
208 | dd->dd_pacode[0x9], dd->dd_pacode[0xa], dd->dd_pacode[0xb], | 208 | dd->dd_pacode[0x9], dd->dd_pacode[0xa], dd->dd_pacode[0xb], | |
209 | dd->dd_pacode[0xc], dd->dd_pacode[0xd], dd->dd_pacode[0xe], | 209 | dd->dd_pacode[0xc], dd->dd_pacode[0xd], dd->dd_pacode[0xe], | |
210 | dd->dd_pacode[0xf]); | 210 | dd->dd_pacode[0xf]); | |
211 | #endif | 211 | #endif | |
212 | /* divise code size, could be less than STI_END entries */ | 212 | /* divise code size, could be less than STI_END entries */ | |
213 | for (i = STI_END; !dd->dd_pacode[i]; i--); | 213 | for (i = STI_END; !dd->dd_pacode[i]; i--); | |
@@ -215,35 +215,35 @@ sti_attach_common(struct sti_softc *sc) | @@ -215,35 +215,35 @@ sti_attach_common(struct sti_softc *sc) | |||
215 | if (sc->sc_devtype == STI_DEVTYPE1) | 215 | if (sc->sc_devtype == STI_DEVTYPE1) | |
216 | size = (size + 3) / 4; | 216 | size = (size + 3) / 4; | |
217 | if (!(sc->sc_code = uvm_km_alloc(kernel_map, round_page(size), 0, | 217 | if (!(sc->sc_code = uvm_km_alloc(kernel_map, round_page(size), 0, | |
218 | UVM_KMF_WIRED))) { | 218 | UVM_KMF_WIRED))) { | |
219 | printf(": cannot allocate %u bytes for code\n", size); | 219 | printf(": cannot allocate %u bytes for code\n", size); | |
220 | return; | 220 | return; | |
221 | } | 221 | } | |
222 | #ifdef STIDEBUG | 222 | #ifdef STIDEBUG | |
223 | printf("code=0x%x[%x]\n", (uint)sc->sc_code, size); | 223 | printf("code=0x%x[%x]\n", (uint)sc->sc_code, size); | |
224 | #endif | 224 | #endif | |
225 | 225 | |||
226 | /* copy code into memory */ | 226 | /* copy code into memory */ | |
227 | if (sc->sc_devtype == STI_DEVTYPE1) { | 227 | if (sc->sc_devtype == STI_DEVTYPE1) { | |
228 | p = (u_int8_t *)sc->sc_code; | 228 | p = (uint8_t *)sc->sc_code; | |
229 | for (addr = dd->dd_pacode[STI_BEGIN], eaddr = addr + size * 4; | 229 | for (addr = dd->dd_pacode[STI_BEGIN], eaddr = addr + size * 4; | |
230 | addr < eaddr; addr += 4 ) | 230 | addr < eaddr; addr += 4 ) | |
231 | *p++ = bus_space_read_4(sc->memt, sc->romh, addr) | 231 | *p++ = bus_space_read_4(sc->memt, sc->romh, addr) | |
232 | & 0xff; | 232 | & 0xff; | |
233 | 233 | |||
234 | } else /* STI_DEVTYPE4 */ | 234 | } else /* STI_DEVTYPE4 */ | |
235 | bus_space_read_region_4(sc->memt, sc->romh, | 235 | bus_space_read_region_4(sc->memt, sc->romh, | |
236 | dd->dd_pacode[STI_BEGIN], (u_int32_t *)sc->sc_code, | 236 | dd->dd_pacode[STI_BEGIN], (uint32_t *)sc->sc_code, | |
237 | size / 4); | 237 | size / 4); | |
238 | 238 | |||
239 | #define O(i) (dd->dd_pacode[(i)] ? (sc->sc_code + \ | 239 | #define O(i) (dd->dd_pacode[(i)] ? (sc->sc_code + \ | |
240 | (dd->dd_pacode[(i)] - dd->dd_pacode[0]) / \ | 240 | (dd->dd_pacode[(i)] - dd->dd_pacode[0]) / \ | |
241 | (sc->sc_devtype == STI_DEVTYPE1 ? 4 : 1)) : 0) | 241 | (sc->sc_devtype == STI_DEVTYPE1 ? 4 : 1)) : 0) | |
242 | sc->init = (sti_init_t) O(STI_INIT_GRAPH); | 242 | sc->init = (sti_init_t) O(STI_INIT_GRAPH); | |
243 | sc->mgmt = (sti_mgmt_t) O(STI_STATE_MGMT); | 243 | sc->mgmt = (sti_mgmt_t) O(STI_STATE_MGMT); | |
244 | sc->unpmv = (sti_unpmv_t) O(STI_FONT_UNPMV); | 244 | sc->unpmv = (sti_unpmv_t) O(STI_FONT_UNPMV); | |
245 | sc->blkmv = (sti_blkmv_t) O(STI_BLOCK_MOVE); | 245 | sc->blkmv = (sti_blkmv_t) O(STI_BLOCK_MOVE); | |
246 | sc->test = (sti_test_t) O(STI_SELF_TEST); | 246 | sc->test = (sti_test_t) O(STI_SELF_TEST); | |
247 | sc->exhdl = (sti_exhdl_t) O(STI_EXCEP_HDLR); | 247 | sc->exhdl = (sti_exhdl_t) O(STI_EXCEP_HDLR); | |
248 | sc->inqconf = (sti_inqconf_t)O(STI_INQ_CONF); | 248 | sc->inqconf = (sti_inqconf_t)O(STI_INQ_CONF); | |
249 | sc->scment = (sti_scment_t)O(STI_SCM_ENT); | 249 | sc->scment = (sti_scment_t)O(STI_SCM_ENT); | |
@@ -323,27 +323,27 @@ sti_attach_common(struct sti_softc *sc) | @@ -323,27 +323,27 @@ sti_attach_common(struct sti_softc *sc) | |||
323 | 323 | |||
324 | #ifdef STIDEBUG | 324 | #ifdef STIDEBUG | |
325 | printf("conf: bpp=%d planes=%d attr=%d\n" | 325 | printf("conf: bpp=%d planes=%d attr=%d\n" | |
326 | "crt=0x%x:0x%x:0x%x hw=0x%x:0x%x:0x%x\n", | 326 | "crt=0x%x:0x%x:0x%x hw=0x%x:0x%x:0x%x\n", | |
327 | cfg.bpp, cfg.planes, cfg.attributes, | 327 | cfg.bpp, cfg.planes, cfg.attributes, | |
328 | ecfg.crt_config[0], ecfg.crt_config[1], ecfg.crt_config[2], | 328 | ecfg.crt_config[0], ecfg.crt_config[1], ecfg.crt_config[2], | |
329 | ecfg.crt_hw[0], ecfg.crt_hw[1], ecfg.crt_hw[2]); | 329 | ecfg.crt_hw[0], ecfg.crt_hw[1], ecfg.crt_hw[2]); | |
330 | #endif | 330 | #endif | |
331 | sc->sc_wsmode = WSDISPLAYIO_MODE_EMUL; | 331 | sc->sc_wsmode = WSDISPLAYIO_MODE_EMUL; | |
332 | sc->sc_bpp = cfg.bppu; | 332 | sc->sc_bpp = cfg.bppu; | |
333 | printf(": %s rev %d.%02d;%d, ID 0x%016llX\n" | 333 | printf(": %s rev %d.%02d;%d, ID 0x%016llX\n" | |
334 | "%s: %dx%d frame buffer, %dx%dx%d display, offset %dx%d\n", | 334 | "%s: %dx%d frame buffer, %dx%dx%d display, offset %dx%d\n", | |
335 | cfg.name, dd->dd_grrev >> 4, dd->dd_grrev & 0xf, dd->dd_lrrev, | 335 | cfg.name, dd->dd_grrev >> 4, dd->dd_grrev & 0xf, dd->dd_lrrev, | |
336 | *(u_int64_t *)dd->dd_grid, device_xname(sc->sc_dev), cfg.fbwidth, | 336 | *(uint64_t *)dd->dd_grid, device_xname(sc->sc_dev), cfg.fbwidth, | |
337 | cfg.fbheight, cfg.width, cfg.height, cfg.bppu, cfg.owidth, | 337 | cfg.fbheight, cfg.width, cfg.height, cfg.bppu, cfg.owidth, | |
338 | cfg.oheight); | 338 | cfg.oheight); | |
339 | 339 | |||
340 | if ((error = sti_fetchfonts(sc, &cfg, dd->dd_fntaddr))) { | 340 | if ((error = sti_fetchfonts(sc, &cfg, dd->dd_fntaddr))) { | |
341 | aprint_error_dev(sc->sc_dev, "cannot fetch fonts (%d)\n", | 341 | aprint_error_dev(sc->sc_dev, "cannot fetch fonts (%d)\n", | |
342 | error); | 342 | error); | |
343 | return; | 343 | return; | |
344 | } | 344 | } | |
345 | 345 | |||
346 | /* | 346 | /* | |
347 | * parse screen descriptions: | 347 | * parse screen descriptions: | |
348 | * figure number of fonts supported; | 348 | * figure number of fonts supported; | |
349 | * allocate wscons structures; | 349 | * allocate wscons structures; | |
@@ -374,27 +374,27 @@ sti_attach_deferred(device_t dev) | @@ -374,27 +374,27 @@ sti_attach_deferred(device_t dev) | |||
374 | waa.accesscookie = sc; | 374 | waa.accesscookie = sc; | |
375 | 375 | |||
376 | /* attach as console if required */ | 376 | /* attach as console if required */ | |
377 | if (waa.console) { | 377 | if (waa.console) { | |
378 | sti_alloc_attr(sc, 0, 0, 0, &defattr); | 378 | sti_alloc_attr(sc, 0, 0, 0, &defattr); | |
379 | wsdisplay_cnattach(&sti_default_screen, sc, | 379 | wsdisplay_cnattach(&sti_default_screen, sc, | |
380 | 0, sti_default_screen.nrows - 1, defattr); | 380 | 0, sti_default_screen.nrows - 1, defattr); | |
381 | } | 381 | } | |
382 | 382 | |||
383 | config_found(sc->sc_dev, &waa, wsemuldisplaydevprint); | 383 | config_found(sc->sc_dev, &waa, wsemuldisplaydevprint); | |
384 | } | 384 | } | |
385 | 385 | |||
386 | int | 386 | int | |
387 | sti_fetchfonts(struct sti_softc *sc, struct sti_inqconfout *cfg, u_int32_t addr) | 387 | sti_fetchfonts(struct sti_softc *sc, struct sti_inqconfout *cfg, uint32_t addr) | |
388 | { | 388 | { | |
389 | struct sti_font *fp = &sc->sc_curfont; | 389 | struct sti_font *fp = &sc->sc_curfont; | |
390 | int size; | 390 | int size; | |
391 | #ifdef notyet | 391 | #ifdef notyet | |
392 | int uc; | 392 | int uc; | |
393 | struct { | 393 | struct { | |
394 | struct sti_unpmvflags flags; | 394 | struct sti_unpmvflags flags; | |
395 | struct sti_unpmvin in; | 395 | struct sti_unpmvin in; | |
396 | struct sti_unpmvout out; | 396 | struct sti_unpmvout out; | |
397 | } a; | 397 | } a; | |
398 | #endif | 398 | #endif | |
399 | 399 | |||
400 | /* | 400 | /* | |
@@ -409,42 +409,42 @@ sti_fetchfonts(struct sti_softc *sc, str | @@ -409,42 +409,42 @@ sti_fetchfonts(struct sti_softc *sc, str | |||
409 | fp->height = bus_space_read_1(sc->memt, sc->romh, | 409 | fp->height = bus_space_read_1(sc->memt, sc->romh, | |
410 | addr + 0x17); | 410 | addr + 0x17); | |
411 | fp->type = bus_space_read_1(sc->memt, sc->romh, | 411 | fp->type = bus_space_read_1(sc->memt, sc->romh, | |
412 | addr + 0x1b); | 412 | addr + 0x1b); | |
413 | fp->bpc = bus_space_read_1(sc->memt, sc->romh, | 413 | fp->bpc = bus_space_read_1(sc->memt, sc->romh, | |
414 | addr + 0x1f); | 414 | addr + 0x1f); | |
415 | fp->next = parseword(addr + 0x23); | 415 | fp->next = parseword(addr + 0x23); | |
416 | fp->uheight= bus_space_read_1(sc->memt, sc->romh, | 416 | fp->uheight= bus_space_read_1(sc->memt, sc->romh, | |
417 | addr + 0x33); | 417 | addr + 0x33); | |
418 | fp->uoffset= bus_space_read_1(sc->memt, sc->romh, | 418 | fp->uoffset= bus_space_read_1(sc->memt, sc->romh, | |
419 | addr + 0x37); | 419 | addr + 0x37); | |
420 | } else /* STI_DEVTYPE4 */ | 420 | } else /* STI_DEVTYPE4 */ | |
421 | bus_space_read_region_4(sc->memt, sc->romh, addr, | 421 | bus_space_read_region_4(sc->memt, sc->romh, addr, | |
422 | (u_int32_t *)fp, sizeof(struct sti_font) / 4); | 422 | (uint32_t *)fp, sizeof(struct sti_font) / 4); | |
423 | 423 | |||
424 | printf("%s: %dx%d font type %d, %d bpc, charset %d-%d\n", | 424 | printf("%s: %dx%d font type %d, %d bpc, charset %d-%d\n", | |
425 | device_xname(sc->sc_dev), fp->width, fp->height, fp->type, | 425 | device_xname(sc->sc_dev), fp->width, fp->height, fp->type, | |
426 | fp->bpc, fp->first, fp->last); | 426 | fp->bpc, fp->first, fp->last); | |
427 | 427 | |||
428 | size = sizeof(struct sti_font) + | 428 | size = sizeof(struct sti_font) + | |
429 | (fp->last - fp->first + 1) * fp->bpc; | 429 | (fp->last - fp->first + 1) * fp->bpc; | |
430 | if (sc->sc_devtype == STI_DEVTYPE1) | 430 | if (sc->sc_devtype == STI_DEVTYPE1) | |
431 | size *= 4; | 431 | size *= 4; | |
432 | sc->sc_romfont = malloc(size, M_DEVBUF, M_NOWAIT); | 432 | sc->sc_romfont = malloc(size, M_DEVBUF, M_NOWAIT); | |
433 | if (sc->sc_romfont == NULL) | 433 | if (sc->sc_romfont == NULL) | |
434 | return (ENOMEM); | 434 | return (ENOMEM); | |
435 | 435 | |||
436 | bus_space_read_region_4(sc->memt, sc->romh, addr, | 436 | bus_space_read_region_4(sc->memt, sc->romh, addr, | |
437 | (u_int32_t *)sc->sc_romfont, size / 4); | 437 | (uint32_t *)sc->sc_romfont, size / 4); | |
438 | 438 | |||
439 | addr = 0; /* fp->next */ | 439 | addr = 0; /* fp->next */ | |
440 | } while (addr); | 440 | } while (addr); | |
441 | 441 | |||
442 | #ifdef notyet | 442 | #ifdef notyet | |
443 | /* | 443 | /* | |
444 | * If there is enough room in the off-screen framebuffer memory, | 444 | * If there is enough room in the off-screen framebuffer memory, | |
445 | * display all the characters there in order to display them | 445 | * display all the characters there in order to display them | |
446 | * faster with blkmv operations rather than unpmv later on. | 446 | * faster with blkmv operations rather than unpmv later on. | |
447 | */ | 447 | */ | |
448 | if (size <= cfg->fbheight * | 448 | if (size <= cfg->fbheight * | |
449 | (cfg->fbwidth - cfg->width - cfg->owidth)) { | 449 | (cfg->fbwidth - cfg->width - cfg->owidth)) { | |
450 | memset(&a, 0, sizeof(a)); | 450 | memset(&a, 0, sizeof(a)); |
--- src/sys/dev/ic/stireg.h 2010/10/31 15:47:53 1.3
+++ src/sys/dev/ic/stireg.h 2010/11/01 06:41:50 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: stireg.h,v 1.3 2010/10/31 15:47:53 skrll Exp $ */ | 1 | /* $NetBSD: stireg.h,v 1.4 2010/11/01 06:41:50 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: stireg.h,v 1.8 2003/08/19 02:52:38 mickey Exp $ */ | 3 | /* $OpenBSD: stireg.h,v 1.8 2003/08/19 02:52:38 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 2000 Michael Shalayeff | 6 | * Copyright (c) 2000 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -100,507 +100,507 @@ | @@ -100,507 +100,507 @@ | |||
100 | #define STI_COLOUR_BLACK 0 | 100 | #define STI_COLOUR_BLACK 0 | |
101 | #define STI_COLOUR_WHITE 1 | 101 | #define STI_COLOUR_WHITE 1 | |
102 | #define STI_COLOUR_RED 2 | 102 | #define STI_COLOUR_RED 2 | |
103 | #define STI_COLOUR_YELLOW 3 | 103 | #define STI_COLOUR_YELLOW 3 | |
104 | #define STI_COLOUR_GREEN 4 | 104 | #define STI_COLOUR_GREEN 4 | |
105 | #define STI_COLOUR_CYAN 5 | 105 | #define STI_COLOUR_CYAN 5 | |
106 | #define STI_COLOUR_BLUE 6 | 106 | #define STI_COLOUR_BLUE 6 | |
107 | #define STI_COLOUR_MAGENTA 7 | 107 | #define STI_COLOUR_MAGENTA 7 | |
108 | 108 | |||
109 | #pragma pack(1) | 109 | #pragma pack(1) | |
110 | 110 | |||
111 | /* LSB high */ | 111 | /* LSB high */ | |
112 | struct sti_dd { | 112 | struct sti_dd { | |
113 | u_int32_t dd_type; /* 0x00 device type */ | 113 | uint32_t dd_type; /* 0x00 device type */ | |
114 | #define STI_DEVTYPE1 1 | 114 | #define STI_DEVTYPE1 1 | |
115 | #define STI_DEVTYPE4 3 | 115 | #define STI_DEVTYPE4 3 | |
116 | u_int8_t dd_unused; | 116 | uint8_t dd_unused; | |
117 | u_int8_t dd_nmon; /* 0x05 number monitor rates */ | 117 | uint8_t dd_nmon; /* 0x05 number monitor rates */ | |
118 | u_int8_t dd_grrev; /* 0x06 global rom revision */ | 118 | uint8_t dd_grrev; /* 0x06 global rom revision */ | |
119 | u_int8_t dd_lrrev; /* 0x07 local rom revision */ | 119 | uint8_t dd_lrrev; /* 0x07 local rom revision */ | |
120 | u_int8_t dd_grid[8]; /* 0x08 graphics id */ | 120 | uint8_t dd_grid[8]; /* 0x08 graphics id */ | |
121 | #define STI_DEV4_DD_GRID 0x08 /* offset for STI_DEVTYPE4 */ | 121 | #define STI_DEV4_DD_GRID 0x08 /* offset for STI_DEVTYPE4 */ | |
122 | #define STI_DEV1_DD_GRID 0x10 /* offset for STI_DEVTYPE1 */ | 122 | #define STI_DEV1_DD_GRID 0x10 /* offset for STI_DEVTYPE1 */ | |
123 | u_int32_t dd_fntaddr; /* 0x10 font start address */ | 123 | uint32_t dd_fntaddr; /* 0x10 font start address */ | |
124 | u_int32_t dd_maxst; /* 0x14 max state storage */ | 124 | uint32_t dd_maxst; /* 0x14 max state storage */ | |
125 | u_int32_t dd_romend; /* 0x18 rom last address */ | 125 | uint32_t dd_romend; /* 0x18 rom last address */ | |
126 | #define STI_DEV4_DD_ROMEND 0x18 /* offset for STI_DEVTYPE4 */ | 126 | #define STI_DEV4_DD_ROMEND 0x18 /* offset for STI_DEVTYPE4 */ | |
127 | #define STI_DEV1_DD_ROMEND 0x50 /* offset for STI_DEVTYPE1 */ | 127 | #define STI_DEV1_DD_ROMEND 0x50 /* offset for STI_DEVTYPE1 */ | |
128 | u_int32_t dd_reglst; /* 0x1c device region list */ | 128 | uint32_t dd_reglst; /* 0x1c device region list */ | |
129 | u_int16_t dd_maxreent; /* 0x20 max reent storage */ | 129 | uint16_t dd_maxreent; /* 0x20 max reent storage */ | |
130 | u_int16_t dd_maxtimo; /* 0x22 max execution timeout .1 sec */ | 130 | uint16_t dd_maxtimo; /* 0x22 max execution timeout .1 sec */ | |
131 | u_int32_t dd_montbl; /* 0x24 mon table address, array of | 131 | uint32_t dd_montbl; /* 0x24 mon table address, array of | |
132 | names num of dd_nmon */ | 132 | names num of dd_nmon */ | |
133 | u_int32_t dd_udaddr; /* 0x28 user data address */ | 133 | uint32_t dd_udaddr; /* 0x28 user data address */ | |
134 | u_int32_t dd_stimemreq; /* 0x2c sti memory request */ | 134 | uint32_t dd_stimemreq; /* 0x2c sti memory request */ | |
135 | u_int32_t dd_udsize; /* 0x30 user data size */ | 135 | uint32_t dd_udsize; /* 0x30 user data size */ | |
136 | u_int16_t dd_pwruse; /* 0x34 power usage */ | 136 | uint16_t dd_pwruse; /* 0x34 power usage */ | |
137 | u_int8_t dd_bussup; /* 0x36 bus support */ | 137 | uint8_t dd_bussup; /* 0x36 bus support */ | |
138 | #define STI_BUSSUPPORT_GSCINTL 0x01 /* supports pulling INTL for int */ | 138 | #define STI_BUSSUPPORT_GSCINTL 0x01 /* supports pulling INTL for int */ | |
139 | #define STI_BUSSUPPORT_GSC15X 0x02 /* supports GSC 1.5X */ | 139 | #define STI_BUSSUPPORT_GSC15X 0x02 /* supports GSC 1.5X */ | |
140 | #define STI_BUSSUPPORT_GSC2X 0x04 /* supports GSC 2.X */ | 140 | #define STI_BUSSUPPORT_GSC2X 0x04 /* supports GSC 2.X */ | |
141 | #define STI_BUSSUPPORT_PCIIOEIM 0x08 /* will use directed int */ | 141 | #define STI_BUSSUPPORT_PCIIOEIM 0x08 /* will use directed int */ | |
142 | #define STI_BUSSUPPORT_PCISTD 0x10 /* will use std PCI int */ | 142 | #define STI_BUSSUPPORT_PCISTD 0x10 /* will use std PCI int */ | |
143 | #define STI_BUSSUPPORT_ILOCK 0x20 /* supports implicit locking */ | 143 | #define STI_BUSSUPPORT_ILOCK 0x20 /* supports implicit locking */ | |
144 | #define STI_BUSSUPPORT_ROMMAP 0x40 /* rom is only in pci erom space */ | 144 | #define STI_BUSSUPPORT_ROMMAP 0x40 /* rom is only in pci erom space */ | |
145 | #define STI_BUSSUPPORT_2DECODE 0x80 /* single address decoder */ | 145 | #define STI_BUSSUPPORT_2DECODE 0x80 /* single address decoder */ | |
146 | u_int8_t dd_ebussup; /* 0x37 extended bus support */ | 146 | uint8_t dd_ebussup; /* 0x37 extended bus support */ | |
147 | #define STI_EBUSSUPPORT_DMA 0x01 /* supports dma */ | 147 | #define STI_EBUSSUPPORT_DMA 0x01 /* supports dma */ | |
148 | #define STI_EBUSSUPPORT_PIOLOCK 0x02 /* no implicit locking for dma */ | 148 | #define STI_EBUSSUPPORT_PIOLOCK 0x02 /* no implicit locking for dma */ | |
149 | u_int8_t dd_altcodet; /* 0x38 alternate code type */ | 149 | uint8_t dd_altcodet; /* 0x38 alternate code type */ | |
150 | #define STI_ALTCODE_UNKNOWN 0x00 | 150 | #define STI_ALTCODE_UNKNOWN 0x00 | |
151 | #define STI_ALTCODE_PA64 0x01 /* alt code is in pa64 */ | 151 | #define STI_ALTCODE_PA64 0x01 /* alt code is in pa64 */ | |
152 | u_int8_t dd_eddst[3]; /* 0x39 extended DD struct */ | 152 | uint8_t dd_eddst[3]; /* 0x39 extended DD struct */ | |
153 | u_int32_t dd_cfbaddr; /* 0x3c CFB address, location of | 153 | uint32_t dd_cfbaddr; /* 0x3c CFB address, location of | |
154 | X11 driver to be used for | 154 | X11 driver to be used for | |
155 | servers w/o accel */ | 155 | servers w/o accel */ | |
156 | u_int32_t dd_pacode[16]; /* 0x40 routines for pa-risc */ | 156 | uint32_t dd_pacode[16]; /* 0x40 routines for pa-risc */ | |
157 | u_int32_t dd_altcode[16]; /* 0x80 routines for m68k/i386 */ | 157 | uint32_t dd_altcode[16]; /* 0x80 routines for m68k/i386 */ | |
158 | }; | 158 | }; | |
159 | 159 | |||
160 | /* after the last region there is one indirect list ptr */ | 160 | /* after the last region there is one indirect list ptr */ | |
161 | struct sti_region { | 161 | struct sti_region { | |
162 | u_int offset :14; /* page offset dev io space relative */ | 162 | u_int offset :14; /* page offset dev io space relative */ | |
163 | u_int sys_only: 1; /* whether allow user access */ | 163 | u_int sys_only: 1; /* whether allow user access */ | |
164 | u_int cache : 1; /* map in cache */ | 164 | u_int cache : 1; /* map in cache */ | |
165 | u_int btlb : 1; /* should use BTLB if available */ | 165 | u_int btlb : 1; /* should use BTLB if available */ | |
166 | u_int last : 1; /* last region in the list */ | 166 | u_int last : 1; /* last region in the list */ | |
167 | u_int length :14; /* size in pages */ | 167 | u_int length :14; /* size in pages */ | |
168 | }; | 168 | }; | |
169 | 169 | |||
170 | struct sti_font { | 170 | struct sti_font { | |
171 | u_int16_t first; | 171 | uint16_t first; | |
172 | u_int16_t last; | 172 | uint16_t last; | |
173 | u_int8_t width; | 173 | uint8_t width; | |
174 | u_int8_t height; | 174 | uint8_t height; | |
175 | u_int8_t type; | 175 | uint8_t type; | |
176 | #define STI_FONT_HPROMAN8 1 | 176 | #define STI_FONT_HPROMAN8 1 | |
177 | #define STI_FONT_KANA8 2 | 177 | #define STI_FONT_KANA8 2 | |
178 | u_int8_t bpc; | 178 | uint8_t bpc; | |
179 | u_int32_t next; | 179 | uint32_t next; | |
180 | u_int8_t uheight; | 180 | uint8_t uheight; | |
181 | u_int8_t uoffset; | 181 | uint8_t uoffset; | |
182 | u_int8_t unused[2]; | 182 | uint8_t unused[2]; | |
183 | }; | 183 | }; | |
184 | 184 | |||
185 | struct sti_fontcfg { | 185 | struct sti_fontcfg { | |
186 | u_int16_t first; | 186 | uint16_t first; | |
187 | u_int16_t last; | 187 | uint16_t last; | |
188 | u_int8_t width; | 188 | uint8_t width; | |
189 | u_int8_t height; | 189 | uint8_t height; | |
190 | u_int8_t type; | 190 | uint8_t type; | |
191 | u_int8_t bpc; | 191 | uint8_t bpc; | |
192 | u_int8_t uheight; | 192 | uint8_t uheight; | |
193 | u_int8_t uoffset; | 193 | uint8_t uoffset; | |
194 | }; | 194 | }; | |
195 | 195 | |||
196 | typedef struct sti_ecfg { | 196 | typedef struct sti_ecfg { | |
197 | u_int8_t current_monitor; | 197 | uint8_t current_monitor; | |
198 | u_int8_t uf_boot; | 198 | uint8_t uf_boot; | |
199 | u_int16_t power; /* power dissipation Watts */ | 199 | uint16_t power; /* power dissipation Watts */ | |
200 | u_int32_t freq_ref; | 200 | uint32_t freq_ref; | |
201 | u_int32_t *addr; /* memory block of size dd_stimemreq */ | 201 | uint32_t *addr; /* memory block of size dd_stimemreq */ | |
202 | void *future; | 202 | void *future; | |
203 | } *sti_ecfg_t; | 203 | } *sti_ecfg_t; | |
204 | 204 | |||
205 | typedef struct sti_cfg { | 205 | typedef struct sti_cfg { | |
206 | u_int32_t text_planes; | 206 | uint32_t text_planes; | |
207 | u_int16_t scr_width; | 207 | uint16_t scr_width; | |
208 | u_int16_t scr_height; | 208 | uint16_t scr_height; | |
209 | u_int16_t oscr_width; | 209 | uint16_t oscr_width; | |
210 | u_int16_t oscr_height; | 210 | uint16_t oscr_height; | |
211 | u_int16_t fb_width; | 211 | uint16_t fb_width; | |
212 | u_int16_t fb_height; | 212 | uint16_t fb_height; | |
213 | u_int32_t regions[STI_REGION_MAX]; | 213 | uint32_t regions[STI_REGION_MAX]; | |
214 | u_int32_t reent_level; | 214 | uint32_t reent_level; | |
215 | u_int32_t *save_addr; | 215 | uint32_t *save_addr; | |
216 | sti_ecfg_t ext_cfg; | 216 | sti_ecfg_t ext_cfg; | |
217 | } *sti_cfg_t; | 217 | } *sti_cfg_t; | |
218 | 218 | |||
219 | 219 | |||
220 | /* routine types */ | 220 | /* routine types */ | |
221 | #define STI_DEP(n) \ | 221 | #define STI_DEP(n) \ | |
222 | typedef int (*sti_##n##_t)( \ | 222 | typedef int (*sti_##n##_t)( \ | |
223 | sti_##n##flags_t, sti_##n##in_t, sti_##n##out_t, sti_cfg_t); | 223 | sti_##n##flags_t, sti_##n##in_t, sti_##n##out_t, sti_cfg_t); | |
224 | 224 | |||
225 | typedef struct sti_initflags { | 225 | typedef struct sti_initflags { | |
226 | u_int32_t flags; | 226 | uint32_t flags; | |
227 | #define STI_INITF_WAIT 0x80000000 | 227 | #define STI_INITF_WAIT 0x80000000 | |
228 | #define STI_INITF_RESET 0x40000000 | 228 | #define STI_INITF_RESET 0x40000000 | |
229 | #define STI_INITF_TEXT 0x20000000 | 229 | #define STI_INITF_TEXT 0x20000000 | |
230 | #define STI_INITF_NTEXT 0x10000000 | 230 | #define STI_INITF_NTEXT 0x10000000 | |
231 | #define STI_INITF_CLEAR 0x08000000 | 231 | #define STI_INITF_CLEAR 0x08000000 | |
232 | #define STI_INITF_CMB 0x04000000 /* non-text planes cmap black */ | 232 | #define STI_INITF_CMB 0x04000000 /* non-text planes cmap black */ | |
233 | #define STI_INITF_EBET 0x02000000 /* enable bus error timer */ | 233 | #define STI_INITF_EBET 0x02000000 /* enable bus error timer */ | |
234 | #define STI_INITF_EBETI 0x01000000 /* enable bus error timer interrupt */ | 234 | #define STI_INITF_EBETI 0x01000000 /* enable bus error timer interrupt */ | |
235 | #define STI_INITF_PTS 0x00800000 /* preserve text settings */ | 235 | #define STI_INITF_PTS 0x00800000 /* preserve text settings */ | |
236 | #define STI_INITF_PNTS 0x00400000 /* preserve non-text settings */ | 236 | #define STI_INITF_PNTS 0x00400000 /* preserve non-text settings */ | |
237 | #define STI_INITF_PBET 0x00200000 /* preserve BET settings */ | 237 | #define STI_INITF_PBET 0x00200000 /* preserve BET settings */ | |
238 | #define STI_INITF_PBETI 0x00100000 /* preserve BETI settings */ | 238 | #define STI_INITF_PBETI 0x00100000 /* preserve BETI settings */ | |
239 | #define STI_INITF_ICMT 0x00080000 /* init cmap for text planes */ | 239 | #define STI_INITF_ICMT 0x00080000 /* init cmap for text planes */ | |
240 | #define STI_INITF_SCMT 0x00040000 /* change current monitor type */ | 240 | #define STI_INITF_SCMT 0x00040000 /* change current monitor type */ | |
241 | #define STI_INITF_RIE 0x00020000 /* retain int enables */ | 241 | #define STI_INITF_RIE 0x00020000 /* retain int enables */ | |
242 | void *future; | 242 | void *future; | |
243 | } *sti_initflags_t; | 243 | } *sti_initflags_t; | |
244 | 244 | |||
245 | typedef struct sti_einitin { | 245 | typedef struct sti_einitin { | |
246 | u_int8_t mon_type; | 246 | uint8_t mon_type; | |
247 | u_int8_t pad; | 247 | uint8_t pad; | |
248 | u_int16_t inflight; /* possible on pci */ | 248 | uint16_t inflight; /* possible on pci */ | |
249 | void *future; | 249 | void *future; | |
250 | } *sti_einitin_t; | 250 | } *sti_einitin_t; | |
251 | 251 | |||
252 | typedef struct sti_initin { | 252 | typedef struct sti_initin { | |
253 | u_int32_t text_planes; /* number of planes for text */ | 253 | uint32_t text_planes; /* number of planes for text */ | |
254 | sti_einitin_t ext_in; | 254 | sti_einitin_t ext_in; | |
255 | } *sti_initin_t; | 255 | } *sti_initin_t; | |
256 | 256 | |||
257 | typedef struct sti_initout { | 257 | typedef struct sti_initout { | |
258 | int32_t errno; | 258 | int32_t errno; | |
259 | u_int32_t text_planes; /* number of planes used for text */ | 259 | uint32_t text_planes; /* number of planes used for text */ | |
260 | void *future; | 260 | void *future; | |
261 | } *sti_initout_t; | 261 | } *sti_initout_t; | |
262 | 262 | |||
263 | STI_DEP(init); | 263 | STI_DEP(init); | |
264 | 264 | |||
265 | typedef struct sti_mgmtflags { | 265 | typedef struct sti_mgmtflags { | |
266 | u_int32_t flags; | 266 | uint32_t flags; | |
267 | #define STI_MGMTF_WAIT 0x80000000 | 267 | #define STI_MGMTF_WAIT 0x80000000 | |
268 | #define STI_MGMTF_SAVE 0x40000000 | 268 | #define STI_MGMTF_SAVE 0x40000000 | |
269 | #define STI_MGMTF_RALL 0x20000000 /* restore all display planes */ | 269 | #define STI_MGMTF_RALL 0x20000000 /* restore all display planes */ | |
270 | void *future; | 270 | void *future; | |
271 | } *sti_mgmtflags_t; | 271 | } *sti_mgmtflags_t; | |
272 | 272 | |||
273 | typedef struct sti_mgmtin { | 273 | typedef struct sti_mgmtin { | |
274 | void *addr; | 274 | void *addr; | |
275 | void *future; | 275 | void *future; | |
276 | } *sti_mgmtin_t; | 276 | } *sti_mgmtin_t; | |
277 | 277 | |||
278 | typedef struct sti_mgmtout { | 278 | typedef struct sti_mgmtout { | |
279 | int32_t errno; | 279 | int32_t errno; | |
280 | void *future; | 280 | void *future; | |
281 | } *sti_mgmtout_t; | 281 | } *sti_mgmtout_t; | |
282 | 282 | |||
283 | STI_DEP(mgmt); | 283 | STI_DEP(mgmt); | |
284 | 284 | |||
285 | typedef struct sti_unpmvflags { | 285 | typedef struct sti_unpmvflags { | |
286 | u_int32_t flags; | 286 | uint32_t flags; | |
287 | #define STI_UNPMVF_WAIT 0x80000000 | 287 | #define STI_UNPMVF_WAIT 0x80000000 | |
288 | #define STI_UNPMVF_NTXT 0x40000000 /* intp non-text planes */ | 288 | #define STI_UNPMVF_NTXT 0x40000000 /* intp non-text planes */ | |
289 | void *future; | 289 | void *future; | |
290 | } *sti_unpmvflags_t; | 290 | } *sti_unpmvflags_t; | |
291 | 291 | |||
292 | typedef struct sti_unpmvin { | 292 | typedef struct sti_unpmvin { | |
293 | u_int32_t *font_addr; /* font */ | 293 | uint32_t *font_addr; /* font */ | |
294 | u_int16_t index; /* character index in the font */ | 294 | uint16_t index; /* character index in the font */ | |
295 | u_int8_t fg_colour; | 295 | uint8_t fg_colour; | |
296 | u_int8_t bg_colour; | 296 | uint8_t bg_colour; | |
297 | u_int16_t x, y; | 297 | uint16_t x, y; | |
298 | void *future; | 298 | void *future; | |
299 | } *sti_unpmvin_t; | 299 | } *sti_unpmvin_t; | |
300 | 300 | |||
301 | typedef struct sti_unpmvout { | 301 | typedef struct sti_unpmvout { | |
302 | u_int32_t errno; | 302 | uint32_t errno; | |
303 | void *future; | 303 | void *future; | |
304 | } *sti_unpmvout_t; | 304 | } *sti_unpmvout_t; | |
305 | 305 | |||
306 | STI_DEP(unpmv); | 306 | STI_DEP(unpmv); | |
307 | 307 | |||
308 | typedef struct sti_blkmvflags { | 308 | typedef struct sti_blkmvflags { | |
309 | u_int32_t flags; | 309 | uint32_t flags; | |
310 | #define STI_BLKMVF_WAIT 0x80000000 | 310 | #define STI_BLKMVF_WAIT 0x80000000 | |
311 | #define STI_BLKMVF_COLR 0x40000000 /* change colour on move */ | 311 | #define STI_BLKMVF_COLR 0x40000000 /* change colour on move */ | |
312 | #define STI_BLKMVF_CLR 0x20000000 /* clear on move */ | 312 | #define STI_BLKMVF_CLR 0x20000000 /* clear on move */ | |
313 | #define STI_BLKMVF_NTXT 0x10000000 /* move in non-text planes */ | 313 | #define STI_BLKMVF_NTXT 0x10000000 /* move in non-text planes */ | |
314 | void *future; | 314 | void *future; | |
315 | } *sti_blkmvflags_t; | 315 | } *sti_blkmvflags_t; | |
316 | 316 | |||
317 | typedef struct sti_blkmvin { | 317 | typedef struct sti_blkmvin { | |
318 | u_int8_t fg_colour; | 318 | uint8_t fg_colour; | |
319 | u_int8_t bg_colour; | 319 | uint8_t bg_colour; | |
320 | u_int16_t srcx, srcy, dstx, dsty; | 320 | uint16_t srcx, srcy, dstx, dsty; | |
321 | u_int16_t width, height; | 321 | uint16_t width, height; | |
322 | u_int16_t pad; | 322 | uint16_t pad; | |
323 | void *future; | 323 | void *future; | |
324 | } *sti_blkmvin_t; | 324 | } *sti_blkmvin_t; | |
325 | 325 | |||
326 | typedef struct sti_blkmvout { | 326 | typedef struct sti_blkmvout { | |
327 | u_int32_t errno; | 327 | uint32_t errno; | |
328 | void *future; | 328 | void *future; | |
329 | } *sti_blkmvout_t; | 329 | } *sti_blkmvout_t; | |
330 | 330 | |||
331 | STI_DEP(blkmv); | 331 | STI_DEP(blkmv); | |
332 | 332 | |||
333 | typedef struct sti_testflags { | 333 | typedef struct sti_testflags { | |
334 | u_int32_t flags; | 334 | uint32_t flags; | |
335 | #define STI_TESTF_WAIT 0x80000000 | 335 | #define STI_TESTF_WAIT 0x80000000 | |
336 | #define STI_TESTF_ETST 0x40000000 | 336 | #define STI_TESTF_ETST 0x40000000 | |
337 | void *future; | 337 | void *future; | |
338 | } *sti_testflags_t; | 338 | } *sti_testflags_t; | |
339 | 339 | |||
340 | typedef struct sti_testin { | 340 | typedef struct sti_testin { | |
341 | void *future; | 341 | void *future; | |
342 | } *sti_testin_t; | 342 | } *sti_testin_t; | |
343 | 343 | |||
344 | typedef struct sti_testout { | 344 | typedef struct sti_testout { | |
345 | u_int32_t errno; | 345 | uint32_t errno; | |
346 | u_int32_t result; | 346 | uint32_t result; | |
347 | void *future; | 347 | void *future; | |
348 | } *sti_testout_t; | 348 | } *sti_testout_t; | |
349 | 349 | |||
350 | STI_DEP(test); | 350 | STI_DEP(test); | |
351 | 351 | |||
352 | typedef struct sti_exhdlflags { | 352 | typedef struct sti_exhdlflags { | |
353 | u_int32_t flags; | 353 | uint32_t flags; | |
354 | #define STI_EXHDLF_WAIT 0x80000000 | 354 | #define STI_EXHDLF_WAIT 0x80000000 | |
355 | #define STI_EXHDLF_CINT 0x40000000 /* clear int */ | 355 | #define STI_EXHDLF_CINT 0x40000000 /* clear int */ | |
356 | #define STI_EXHDLF_CBE 0x20000000 /* clear BE */ | 356 | #define STI_EXHDLF_CBE 0x20000000 /* clear BE */ | |
357 | #define STI_EXHDLF_PINT 0x10000000 /* preserve int */ | 357 | #define STI_EXHDLF_PINT 0x10000000 /* preserve int */ | |
358 | #define STI_EXHDLF_RINT 0x08000000 /* restore int */ | 358 | #define STI_EXHDLF_RINT 0x08000000 /* restore int */ | |
359 | #define STI_EXHDLF_WEIM 0x04000000 /* write eim w/ sti_eexhdlin */ | 359 | #define STI_EXHDLF_WEIM 0x04000000 /* write eim w/ sti_eexhdlin */ | |
360 | #define STI_EXHDLF_REIM 0x02000000 /* read eim to sti_eexhdlout */ | 360 | #define STI_EXHDLF_REIM 0x02000000 /* read eim to sti_eexhdlout */ | |
361 | #define STI_EXHDLF_GIE 0x01000000 /* global int enable */ | 361 | #define STI_EXHDLF_GIE 0x01000000 /* global int enable */ | |
362 | #define STI_EXHDLF_PGIE 0x00800000 | 362 | #define STI_EXHDLF_PGIE 0x00800000 | |
363 | #define STI_EXHDLF_WIEM 0x00400000 | 363 | #define STI_EXHDLF_WIEM 0x00400000 | |
364 | #define STI_EXHDLF_EIEM 0x00200000 | 364 | #define STI_EXHDLF_EIEM 0x00200000 | |
365 | #define STI_EXHDLF_BIC 0x00100000 /* begin int cycle */ | 365 | #define STI_EXHDLF_BIC 0x00100000 /* begin int cycle */ | |
366 | #define STI_EXHDLF_EIC 0x00080000 /* end int cycle */ | 366 | #define STI_EXHDLF_EIC 0x00080000 /* end int cycle */ | |
367 | #define STI_EXHDLF_RIE 0x00040000 /* reset do not clear int enables */ | 367 | #define STI_EXHDLF_RIE 0x00040000 /* reset do not clear int enables */ | |
368 | void *future; | 368 | void *future; | |
369 | } *sti_exhdlflags_t; | 369 | } *sti_exhdlflags_t; | |
370 | 370 | |||
371 | typedef struct sti_eexhdlin { | 371 | typedef struct sti_eexhdlin { | |
372 | u_int32_t eim_addr; | 372 | uint32_t eim_addr; | |
373 | u_int32_t eim_data; | 373 | uint32_t eim_data; | |
374 | u_int32_t iem; /* enable mask */ | 374 | uint32_t iem; /* enable mask */ | |
375 | u_int32_t icm; /* clear mask */ | 375 | uint32_t icm; /* clear mask */ | |
376 | void *future; | 376 | void *future; | |
377 | } *sti_eexhdlin_t; | 377 | } *sti_eexhdlin_t; | |
378 | 378 | |||
379 | typedef struct sti_exhdlint { | 379 | typedef struct sti_exhdlint { | |
380 | u_int32_t flags; | 380 | uint32_t flags; | |
381 | #define STI_EXHDLINT_BET 0x80000000 /* bus error timer */ | 381 | #define STI_EXHDLINT_BET 0x80000000 /* bus error timer */ | |
382 | #define STI_EXHDLINT_HW 0x40000000 /* high water */ | 382 | #define STI_EXHDLINT_HW 0x40000000 /* high water */ | |
383 | #define STI_EXHDLINT_LW 0x20000000 /* low water */ | 383 | #define STI_EXHDLINT_LW 0x20000000 /* low water */ | |
384 | #define STI_EXHDLINT_TM 0x10000000 /* texture map */ | 384 | #define STI_EXHDLINT_TM 0x10000000 /* texture map */ | |
385 | #define STI_EXHDLINT_VB 0x08000000 /* vertical blank */ | 385 | #define STI_EXHDLINT_VB 0x08000000 /* vertical blank */ | |
386 | #define STI_EXHDLINT_UDC 0x04000000 /* unbuffered dma complete */ | 386 | #define STI_EXHDLINT_UDC 0x04000000 /* unbuffered dma complete */ | |
387 | #define STI_EXHDLINT_BDC 0x02000000 /* buffered dma complete */ | 387 | #define STI_EXHDLINT_BDC 0x02000000 /* buffered dma complete */ | |
388 | #define STI_EXHDLINT_UDPC 0x01000000 /* unbuf priv dma complete */ | 388 | #define STI_EXHDLINT_UDPC 0x01000000 /* unbuf priv dma complete */ | |
389 | #define STI_EXHDLINT_BDPC 0x00800000 /* buffered priv dma complete */ | 389 | #define STI_EXHDLINT_BDPC 0x00800000 /* buffered priv dma complete */ | |
390 | } *sti_exhdlint_t; | 390 | } *sti_exhdlint_t; | |
391 | 391 | |||
392 | typedef struct sti_exhdlin { | 392 | typedef struct sti_exhdlin { | |
393 | sti_exhdlint_t addr; | 393 | sti_exhdlint_t addr; | |
394 | sti_eexhdlin_t ext; | 394 | sti_eexhdlin_t ext; | |
395 | } *sti_exhdlin_t; | 395 | } *sti_exhdlin_t; | |
396 | 396 | |||
397 | typedef struct sti_eexhdlout { | 397 | typedef struct sti_eexhdlout { | |
398 | u_int32_t eim_addr; | 398 | uint32_t eim_addr; | |
399 | u_int32_t eim_data; | 399 | uint32_t eim_data; | |
400 | u_int32_t iem; /* enable mask */ | 400 | uint32_t iem; /* enable mask */ | |
401 | u_int32_t icm; /* clear mask */ | 401 | uint32_t icm; /* clear mask */ | |
402 | void *future; | 402 | void *future; | |
403 | } *sti_eexhdlout_t; | 403 | } *sti_eexhdlout_t; | |
404 | 404 | |||
405 | typedef struct sti_exhdlout { | 405 | typedef struct sti_exhdlout { | |
406 | u_int32_t errno; | 406 | uint32_t errno; | |
407 | u_int32_t flags; | 407 | uint32_t flags; | |
408 | #define STI_EXHDLO_BE 0x80000000 /* BE was intercepted */ | 408 | #define STI_EXHDLO_BE 0x80000000 /* BE was intercepted */ | |
409 | #define STI_EXHDLO_IP 0x40000000 /* there is int pending */ | 409 | #define STI_EXHDLO_IP 0x40000000 /* there is int pending */ | |
410 | #define STI_EXHDLO_IE 0x20000000 /* global enable set */ | 410 | #define STI_EXHDLO_IE 0x20000000 /* global enable set */ | |
411 | sti_eexhdlout_t ext; | 411 | sti_eexhdlout_t ext; | |
412 | } *sti_exhdlout_t; | 412 | } *sti_exhdlout_t; | |
413 | 413 | |||
414 | STI_DEP(exhdl); | 414 | STI_DEP(exhdl); | |
415 | 415 | |||
416 | typedef struct sti_inqconfflags { | 416 | typedef struct sti_inqconfflags { | |
417 | u_int32_t flags; | 417 | uint32_t flags; | |
418 | #define STI_INQCONFF_WAIT 0x80000000 | 418 | #define STI_INQCONFF_WAIT 0x80000000 | |
419 | void *future; | 419 | void *future; | |
420 | } *sti_inqconfflags_t; | 420 | } *sti_inqconfflags_t; | |
421 | 421 | |||
422 | typedef struct sti_inqconfin { | 422 | typedef struct sti_inqconfin { | |
423 | void *future; | 423 | void *future; | |
424 | } *sti_inqconfin_t; | 424 | } *sti_inqconfin_t; | |
425 | 425 | |||
426 | typedef struct sti_einqconfout { | 426 | typedef struct sti_einqconfout { | |
427 | u_int32_t crt_config[3]; | 427 | uint32_t crt_config[3]; | |
428 | u_int32_t crt_hw[3]; | 428 | uint32_t crt_hw[3]; | |
429 | void *future; | 429 | void *future; | |
430 | } *sti_einqconfout_t; | 430 | } *sti_einqconfout_t; | |
431 | 431 | |||
432 | typedef struct sti_inqconfout { | 432 | typedef struct sti_inqconfout { | |
433 | u_int32_t errno; | 433 | uint32_t errno; | |
434 | u_int16_t width, height, owidth, oheight, fbwidth, fbheight; | 434 | uint16_t width, height, owidth, oheight, fbwidth, fbheight; | |
435 | u_int32_t bpp; /* bits per pixel */ | 435 | uint32_t bpp; /* bits per pixel */ | |
436 | u_int32_t bppu; /* accessible bpp */ | 436 | uint32_t bppu; /* accessible bpp */ | |
437 | u_int32_t planes; | 437 | uint32_t planes; | |
438 | u_int8_t name[STI_DEVNAME_LEN]; | 438 | uint8_t name[STI_DEVNAME_LEN]; | |
439 | u_int32_t attributes; | 439 | uint32_t attributes; | |
440 | #define STI_INQCONF_Y2X 0x0001 /* pixel is higher tan wider */ | 440 | #define STI_INQCONF_Y2X 0x0001 /* pixel is higher tan wider */ | |
441 | #define STI_INQCONF_HWBLKMV 0x0002 /* hw blkmv is present */ | 441 | #define STI_INQCONF_HWBLKMV 0x0002 /* hw blkmv is present */ | |
442 | #define STI_INQCONF_AHW 0x0004 /* adv hw accel */ | 442 | #define STI_INQCONF_AHW 0x0004 /* adv hw accel */ | |
443 | #define STI_INQCONF_INT 0x0008 /* can interrupt */ | 443 | #define STI_INQCONF_INT 0x0008 /* can interrupt */ | |
444 | #define STI_INQCONF_GONOFF 0x0010 /* supports on/off */ | 444 | #define STI_INQCONF_GONOFF 0x0010 /* supports on/off */ | |
445 | #define STI_INQCONF_AONOFF 0x0020 /* supports alpha on/off */ | 445 | #define STI_INQCONF_AONOFF 0x0020 /* supports alpha on/off */ | |
446 | #define STI_INQCONF_VARY 0x0040 /* variable fb height */ | 446 | #define STI_INQCONF_VARY 0x0040 /* variable fb height */ | |
447 | #define STI_INQCONF_ODDBYTES 0x0080 /* use only odd fb bytes */ | 447 | #define STI_INQCONF_ODDBYTES 0x0080 /* use only odd fb bytes */ | |
448 | #define STI_INQCONF_FLUSH 0x0100 /* fb cache requires flushing */ | 448 | #define STI_INQCONF_FLUSH 0x0100 /* fb cache requires flushing */ | |
449 | #define STI_INQCONF_DMA 0x0200 /* supports dma */ | 449 | #define STI_INQCONF_DMA 0x0200 /* supports dma */ | |
450 | #define STI_INQCONF_VDMA 0x0400 /* supports vdma */ | 450 | #define STI_INQCONF_VDMA 0x0400 /* supports vdma */ | |
451 | #define STI_INQCONF_YUV1 0x2000 /* supports YUV type 1 */ | 451 | #define STI_INQCONF_YUV1 0x2000 /* supports YUV type 1 */ | |
452 | #define STI_INQCONF_YUV2 0x4000 /* supports YUV type 2 */ | 452 | #define STI_INQCONF_YUV2 0x4000 /* supports YUV type 2 */ | |
453 | #define STI_INQCONF_BITS \ | 453 | #define STI_INQCONF_BITS \ | |
454 | "\020\001y2x\002hwblkmv\003ahw\004int\005gonoff\006aonoff\007vary"\ | 454 | "\020\001y2x\002hwblkmv\003ahw\004int\005gonoff\006aonoff\007vary"\ | |
455 | "\010oddb\011flush\012dma\013vdma\016yuv1\017yuv2" | 455 | "\010oddb\011flush\012dma\013vdma\016yuv1\017yuv2" | |
456 | sti_einqconfout_t ext; | 456 | sti_einqconfout_t ext; | |
457 | } *sti_inqconfout_t; | 457 | } *sti_inqconfout_t; | |
458 | 458 | |||
459 | STI_DEP(inqconf); | 459 | STI_DEP(inqconf); | |
460 | 460 | |||
461 | typedef struct sti_scmentflags { | 461 | typedef struct sti_scmentflags { | |
462 | u_int32_t flags; | 462 | uint32_t flags; | |
463 | #define STI_SCMENTF_WAIT 0x80000000 | 463 | #define STI_SCMENTF_WAIT 0x80000000 | |
464 | void *future; | 464 | void *future; | |
465 | } *sti_scmentflags_t; | 465 | } *sti_scmentflags_t; | |
466 | 466 | |||
467 | typedef struct sti_scmentin { | 467 | typedef struct sti_scmentin { | |
468 | u_int32_t entry; | 468 | uint32_t entry; | |
469 | u_int32_t value; | 469 | uint32_t value; | |
470 | void *future; | 470 | void *future; | |
471 | } *sti_scmentin_t; | 471 | } *sti_scmentin_t; | |
472 | 472 | |||
473 | typedef struct sti_scmentout { | 473 | typedef struct sti_scmentout { | |
474 | u_int32_t errno; | 474 | uint32_t errno; | |
475 | void *future; | 475 | void *future; | |
476 | } *sti_scmentout_t; | 476 | } *sti_scmentout_t; | |
477 | 477 | |||
478 | STI_DEP(scment); | 478 | STI_DEP(scment); | |
479 | 479 | |||
480 | typedef struct sti_dmacflags { | 480 | typedef struct sti_dmacflags { | |
481 | u_int32_t flags; | 481 | uint32_t flags; | |
482 | #define STI_DMACF_WAIT 0x80000000 | 482 | #define STI_DMACF_WAIT 0x80000000 | |
483 | #define STI_DMACF_PRIV 0x40000000 /* priv dma */ | 483 | #define STI_DMACF_PRIV 0x40000000 /* priv dma */ | |
484 | #define STI_DMACF_DIS 0x20000000 /* disable */ | 484 | #define STI_DMACF_DIS 0x20000000 /* disable */ | |
485 | #define STI_DMACF_BUF 0x10000000 /* buffered */ | 485 | #define STI_DMACF_BUF 0x10000000 /* buffered */ | |
486 | #define STI_DMACF_MRK 0x08000000 /* write a marker */ | 486 | #define STI_DMACF_MRK 0x08000000 /* write a marker */ | |
487 | #define STI_DMACF_ABRT 0x04000000 /* abort dma xfer */ | 487 | #define STI_DMACF_ABRT 0x04000000 /* abort dma xfer */ | |
488 | void *future; | 488 | void *future; | |
489 | } *sti_dmacflags_t; | 489 | } *sti_dmacflags_t; | |
490 | 490 | |||
491 | typedef struct sti_dmacin { | 491 | typedef struct sti_dmacin { | |
492 | u_int32_t pa_upper; | 492 | uint32_t pa_upper; | |
493 | u_int32_t pa_lower; | 493 | uint32_t pa_lower; | |
494 | u_int32_t len; | 494 | uint32_t len; | |
495 | u_int32_t mrk_data; | 495 | uint32_t mrk_data; | |
496 | u_int32_t mrk_off; | 496 | uint32_t mrk_off; | |
497 | void *future; | 497 | void *future; | |
498 | } *sti_dmacin_t; | 498 | } *sti_dmacin_t; | |
499 | 499 | |||
500 | typedef struct sti_dmacout { | 500 | typedef struct sti_dmacout { | |
501 | u_int32_t errno; | 501 | uint32_t errno; | |
502 | void *future; | 502 | void *future; | |
503 | } *sti_dmacout_t; | 503 | } *sti_dmacout_t; | |
504 | 504 | |||
505 | STI_DEP(dmac); | 505 | STI_DEP(dmac); | |
506 | 506 | |||
507 | typedef struct sti_flowcflags { | 507 | typedef struct sti_flowcflags { | |
508 | u_int32_t flags; | 508 | uint32_t flags; | |
509 | #define STI_FLOWCF_WAIT 0x80000000 | 509 | #define STI_FLOWCF_WAIT 0x80000000 | |
510 | #define STI_FLOWCF_CHW 0x40000000 /* check high water */ | 510 | #define STI_FLOWCF_CHW 0x40000000 /* check high water */ | |
511 | #define STI_FLOWCF_WHW 0x20000000 /* write high water */ | 511 | #define STI_FLOWCF_WHW 0x20000000 /* write high water */ | |
512 | #define STI_FLOWCF_WLW 0x10000000 /* write low water */ | 512 | #define STI_FLOWCF_WLW 0x10000000 /* write low water */ | |
513 | #define STI_FLOWCF_PCSE 0x08000000 /* preserve cse */ | 513 | #define STI_FLOWCF_PCSE 0x08000000 /* preserve cse */ | |
514 | #define STI_FLOWCF_CSE 0x04000000 | 514 | #define STI_FLOWCF_CSE 0x04000000 | |
515 | #define STI_FLOWCF_CSWF 0x02000000 /* cs write fine */ | 515 | #define STI_FLOWCF_CSWF 0x02000000 /* cs write fine */ | |
516 | #define STI_FLOWCF_CSWC 0x01000000 /* cs write coarse */ | 516 | #define STI_FLOWCF_CSWC 0x01000000 /* cs write coarse */ | |
517 | #define STI_FLOWCF_CSWQ 0x00800000 /* cs write fifo */ | 517 | #define STI_FLOWCF_CSWQ 0x00800000 /* cs write fifo */ | |
518 | void *future; | 518 | void *future; | |
519 | } *sti_flowcflags_t; | 519 | } *sti_flowcflags_t; | |
520 | 520 | |||
521 | typedef struct sti_flowcin { | 521 | typedef struct sti_flowcin { | |
522 | u_int32_t retry; | 522 | uint32_t retry; | |
523 | u_int32_t bufz; | 523 | uint32_t bufz; | |
524 | u_int32_t hwcnt; | 524 | uint32_t hwcnt; | |
525 | u_int32_t lwcnt; | 525 | uint32_t lwcnt; | |
526 | u_int32_t csfv; /* cs fine value */ | 526 | uint32_t csfv; /* cs fine value */ | |
527 | u_int32_t cscv; /* cs coarse value */ | 527 | uint32_t cscv; /* cs coarse value */ | |
528 | u_int32_t csqc; /* cs fifo count */ | 528 | uint32_t csqc; /* cs fifo count */ | |
529 | void *future; | 529 | void *future; | |
530 | } *sti_flowcin_t; | 530 | } *sti_flowcin_t; | |
531 | 531 | |||
532 | typedef struct sti_flowcout { | 532 | typedef struct sti_flowcout { | |
533 | u_int32_t errno; | 533 | uint32_t errno; | |
534 | u_int32_t retry_result; | 534 | uint32_t retry_result; | |
535 | u_int32_t fifo_size; | 535 | uint32_t fifo_size; | |
536 | void *future; | 536 | void *future; | |
537 | } *sti_flowcout_t; | 537 | } *sti_flowcout_t; | |
538 | 538 | |||
539 | STI_DEP(flowc); | 539 | STI_DEP(flowc); | |
540 | 540 | |||
541 | typedef struct sti_utimingflags { | 541 | typedef struct sti_utimingflags { | |
542 | u_int32_t flags; | 542 | uint32_t flags; | |
543 | #define STI_UTIMF_WAIT 0x80000000 | 543 | #define STI_UTIMF_WAIT 0x80000000 | |
544 | #define STI_UTIMF_HKS 0x40000000 /* has kbuf_size */ | 544 | #define STI_UTIMF_HKS 0x40000000 /* has kbuf_size */ | |
545 | void *future; | 545 | void *future; | |
546 | } *sti_utimingflags_t; | 546 | } *sti_utimingflags_t; | |
547 | 547 | |||
548 | typedef struct sti_utimingin { | 548 | typedef struct sti_utimingin { | |
549 | void *data; | 549 | void *data; | |
550 | void *kbuf; | 550 | void *kbuf; | |
551 | void *future; | 551 | void *future; | |
552 | } *sti_utimingin_t; | 552 | } *sti_utimingin_t; | |
553 | 553 | |||
554 | typedef struct sti_utimingout { | 554 | typedef struct sti_utimingout { | |
555 | u_int32_t errno; | 555 | uint32_t errno; | |
556 | u_int32_t kbuf_size; /* buffer required size */ | 556 | uint32_t kbuf_size; /* buffer required size */ | |
557 | void *future; | 557 | void *future; | |
558 | } *sti_utimingout_t; | 558 | } *sti_utimingout_t; | |
559 | 559 | |||
560 | STI_DEP(utiming); | 560 | STI_DEP(utiming); | |
561 | 561 | |||
562 | typedef struct sti_pmgrflags { | 562 | typedef struct sti_pmgrflags { | |
563 | u_int32_t flags; | 563 | uint32_t flags; | |
564 | #define STI_UTIMF_WAIT 0x80000000 | 564 | #define STI_UTIMF_WAIT 0x80000000 | |
565 | #define STI_UTIMOP_CLEANUP 0x00000000 | 565 | #define STI_UTIMOP_CLEANUP 0x00000000 | |
566 | #define STI_UTIMOP_BAC 0x10000000 | 566 | #define STI_UTIMOP_BAC 0x10000000 | |
567 | #define STI_UTIMF_CRIT 0x04000000 | 567 | #define STI_UTIMF_CRIT 0x04000000 | |
568 | #define STI_UTIMF_BUFF 0x02000000 | 568 | #define STI_UTIMF_BUFF 0x02000000 | |
569 | #define STI_UTIMF_IBUFF 0x01000000 | 569 | #define STI_UTIMF_IBUFF 0x01000000 | |
570 | void *future; | 570 | void *future; | |
571 | } *sti_pmgrflags_t; | 571 | } *sti_pmgrflags_t; | |
572 | 572 | |||
573 | typedef struct sti_pmgrin { | 573 | typedef struct sti_pmgrin { | |
574 | u_int32_t reserved[4]; | 574 | uint32_t reserved[4]; | |
575 | void *future; | 575 | void *future; | |
576 | } *sti_pmgrin_t; | 576 | } *sti_pmgrin_t; | |
577 | 577 | |||
578 | typedef struct sti_pmgrout { | 578 | typedef struct sti_pmgrout { | |
579 | int32_t errno; | 579 | int32_t errno; | |
580 | void *future; | 580 | void *future; | |
581 | } *sti_pmgrout_t; | 581 | } *sti_pmgrout_t; | |
582 | 582 | |||
583 | STI_DEP(pmgr); | 583 | STI_DEP(pmgr); | |
584 | 584 | |||
585 | typedef struct sti_utilflags { | 585 | typedef struct sti_utilflags { | |
586 | u_int32_t flags; | 586 | uint32_t flags; | |
587 | #define STI_UTILF_ROOT 0x80000000 /* was called as root */ | 587 | #define STI_UTILF_ROOT 0x80000000 /* was called as root */ | |
588 | void *future; | 588 | void *future; | |
589 | } *sti_utilflags_t; | 589 | } *sti_utilflags_t; | |
590 | 590 | |||
591 | typedef struct sti_utilin { | 591 | typedef struct sti_utilin { | |
592 | u_int32_t in_size; | 592 | uint32_t in_size; | |
593 | u_int32_t out_size; | 593 | uint32_t out_size; | |
594 | u_int8_t *buf; | 594 | uint8_t *buf; | |
595 | } *sti_utilin_t; | 595 | } *sti_utilin_t; | |
596 | 596 | |||
597 | typedef struct sti_utilout { | 597 | typedef struct sti_utilout { | |
598 | int32_t errno; | 598 | int32_t errno; | |
599 | void *future; | 599 | void *future; | |
600 | } *sti_utilout_t; | 600 | } *sti_utilout_t; | |
601 | 601 | |||
602 | STI_DEP(util); | 602 | STI_DEP(util); | |
603 | 603 | |||
604 | #pragma pack() | 604 | #pragma pack() | |
605 | 605 | |||
606 | #endif /* _IC_STIREG_H_ */ | 606 | #endif /* _IC_STIREG_H_ */ |
--- src/sys/dev/ic/stivar.h 2010/10/31 15:47:53 1.4
+++ src/sys/dev/ic/stivar.h 2010/11/01 06:41:50 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: stivar.h,v 1.4 2010/10/31 15:47:53 skrll Exp $ */ | 1 | /* $NetBSD: stivar.h,v 1.5 2010/11/01 06:41:50 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: stivar.h,v 1.15 2003/12/16 06:07:13 mickey Exp $ */ | 3 | /* $OpenBSD: stivar.h,v 1.15 2003/12/16 06:07:13 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 2000-2003 Michael Shalayeff | 6 | * Copyright (c) 2000-2003 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -48,27 +48,27 @@ struct sti_softc { | @@ -48,27 +48,27 @@ struct sti_softc { | |||
48 | bus_space_handle_t romh; | 48 | bus_space_handle_t romh; | |
49 | bus_addr_t base, fbaddr; | 49 | bus_addr_t base, fbaddr; | |
50 | bus_size_t fblen; | 50 | bus_size_t fblen; | |
51 | 51 | |||
52 | struct sti_dd sc_dd; /* in word format */ | 52 | struct sti_dd sc_dd; /* in word format */ | |
53 | struct sti_font sc_curfont; | 53 | struct sti_font sc_curfont; | |
54 | struct sti_cfg sc_cfg; | 54 | struct sti_cfg sc_cfg; | |
55 | struct sti_ecfg sc_ecfg; | 55 | struct sti_ecfg sc_ecfg; | |
56 | 56 | |||
57 | void *sc_romfont; /* ROM font copy, either in memory... */ | 57 | void *sc_romfont; /* ROM font copy, either in memory... */ | |
58 | u_int sc_fontmaxcol; /* ...or in off-screen frame buffer */ | 58 | u_int sc_fontmaxcol; /* ...or in off-screen frame buffer */ | |
59 | u_int sc_fontbase; | 59 | u_int sc_fontbase; | |
60 | 60 | |||
61 | u_int8_t sc_rcmap[STI_NCMAP], sc_gcmap[STI_NCMAP], sc_bcmap[STI_NCMAP]; | 61 | uint8_t sc_rcmap[STI_NCMAP], sc_gcmap[STI_NCMAP], sc_bcmap[STI_NCMAP]; | |
62 | vaddr_t sc_code; | 62 | vaddr_t sc_code; | |
63 | 63 | |||
64 | sti_init_t init; | 64 | sti_init_t init; | |
65 | sti_mgmt_t mgmt; | 65 | sti_mgmt_t mgmt; | |
66 | sti_unpmv_t unpmv; | 66 | sti_unpmv_t unpmv; | |
67 | sti_blkmv_t blkmv; | 67 | sti_blkmv_t blkmv; | |
68 | sti_test_t test; | 68 | sti_test_t test; | |
69 | sti_exhdl_t exhdl; | 69 | sti_exhdl_t exhdl; | |
70 | sti_inqconf_t inqconf; | 70 | sti_inqconf_t inqconf; | |
71 | sti_scment_t scment; | 71 | sti_scment_t scment; | |
72 | sti_dmac_t dmac; | 72 | sti_dmac_t dmac; | |
73 | sti_flowc_t flowc; | 73 | sti_flowc_t flowc; | |
74 | sti_utiming_t utiming; | 74 | sti_utiming_t utiming; |