Module Name: src Committed By: tsutsui Date: Sat Feb 12 16:40:29 UTC 2011
Modified Files: src/sys/arch/hp300/dev: diofb.c diofb_mono.c diofbreg.h diofbvar.h dvbox.c dvboxreg.h gbox.c gboxreg.h hyper.c hyperreg.h rbox.c rboxreg.h topcat.c topcatreg.h tvrx.c Log Message: - make local functions static - some KNF To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hp300/dev/diofb.c \ src/sys/arch/hp300/dev/diofb_mono.c src/sys/arch/hp300/dev/dvbox.c \ src/sys/arch/hp300/dev/dvboxreg.h src/sys/arch/hp300/dev/gbox.c \ src/sys/arch/hp300/dev/gboxreg.h src/sys/arch/hp300/dev/hyper.c \ src/sys/arch/hp300/dev/hyperreg.h src/sys/arch/hp300/dev/rbox.c \ src/sys/arch/hp300/dev/rboxreg.h src/sys/arch/hp300/dev/topcat.c \ src/sys/arch/hp300/dev/topcatreg.h src/sys/arch/hp300/dev/tvrx.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hp300/dev/diofbreg.h \ src/sys/arch/hp300/dev/diofbvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/hp300/dev/diofb.c diff -u src/sys/arch/hp300/dev/diofb.c:1.1 src/sys/arch/hp300/dev/diofb.c:1.2 --- src/sys/arch/hp300/dev/diofb.c:1.1 Sun Feb 6 18:26:51 2011 +++ src/sys/arch/hp300/dev/diofb.c Sat Feb 12 16:40:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: diofb.c,v 1.1 2011/02/06 18:26:51 tsutsui Exp $ */ +/* $NetBSD: diofb.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */ /* $OpenBSD: diofb.c,v 1.18 2010/12/26 15:40:59 miod Exp $ */ /* @@ -80,12 +80,12 @@ #include <hp300/dev/diofbreg.h> #include <hp300/dev/diofbvar.h> -void diofb_do_cursor(struct rasops_info *); -void diofb_copycols(void *, int, int, int, int); -void diofb_erasecols(void *, int, int, int, long); -void diofb_copyrows(void *, int, int, int); -void diofb_eraserows(void *, int, int, long); -int diofb_allocattr(void *, int, int, int, long *); +static void diofb_do_cursor(struct rasops_info *); +static void diofb_copycols(void *, int, int, int, int); +static void diofb_erasecols(void *, int, int, int, long); +static void diofb_copyrows(void *, int, int, int); +static void diofb_eraserows(void *, int, int, long); +static int diofb_allocattr(void *, int, int, int, long *); struct diofb diofb_cn; @@ -130,7 +130,7 @@ */ fb->fbkva = iomap(fb->fbaddr, fb->fbsize); if (fb->fbkva == NULL) - return (ENOMEM); + return ENOMEM; } if (fb->dwidth == 0 || fb->dheight == 0) { fb->dwidth = (fbr->dwmsb << 8) | fbr->dwlsb; @@ -153,7 +153,7 @@ fb->mapmode = WSDISPLAYIO_MODE_DUMBFB; - return (0); + return 0; } /* @@ -335,8 +335,9 @@ int diofb_allocattr(void *cookie, int fg, int bg, int flg, long *attr) { + if ((flg & (WSATTR_BLINK | WSATTR_HILIT)) != 0) - return (EINVAL); + return EINVAL; if ((flg & WSATTR_WSCOLORS) == 0) { fg = WSCOL_WHITE; @@ -460,14 +461,14 @@ struct rasops_info *ri = &fb->ri; if (fb->nscreens > 0) - return (ENOMEM); + return ENOMEM; *cookiep = ri; *curxp = *curyp = 0; ri->ri_ops.allocattr(ri, 0, 0, 0, attrp); fb->nscreens++; - return (0); + return 0; } void @@ -482,7 +483,8 @@ diofb_show_screen(void *v, void *cookie, int waitok, void (*cb)(void *, int, int), void *cbarg) { - return (0); + + return 0; } paddr_t @@ -491,7 +493,7 @@ struct diofb *fb = v; if ((offset & PAGE_MASK) != 0) - return (-1); + return -1; switch (fb->mapmode) { case WSDISPLAYIO_MODE_MAPPED: @@ -505,7 +507,7 @@ break; } - return (-1); + return -1; } int @@ -516,14 +518,14 @@ int error; if (index >= colcount || count > colcount - index) - return (EINVAL); + return EINVAL; if ((error = copyout(fb->cmap.r + index, cm->red, count)) != 0) - return (error); + return error; if ((error = copyout(fb->cmap.g + index, cm->green, count)) != 0) - return (error); + return error; if ((error = copyout(fb->cmap.b + index, cm->blue, count)) != 0) - return (error); + return error; - return (0); + return 0; } Index: src/sys/arch/hp300/dev/diofb_mono.c diff -u src/sys/arch/hp300/dev/diofb_mono.c:1.1 src/sys/arch/hp300/dev/diofb_mono.c:1.2 --- src/sys/arch/hp300/dev/diofb_mono.c:1.1 Sun Feb 6 18:26:51 2011 +++ src/sys/arch/hp300/dev/diofb_mono.c Sat Feb 12 16:40:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: diofb_mono.c,v 1.1 2011/02/06 18:26:51 tsutsui Exp $ */ +/* $NetBSD: diofb_mono.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */ /* $OpenBSD: diofb_mono.c,v 1.3 2006/08/11 18:33:13 miod Exp $ */ /* @@ -115,8 +115,8 @@ #include <hp300/dev/maskbits.h> int -diofb_mono_windowmove(struct diofb *fb, u_int16_t sx, u_int16_t sy, - u_int16_t dx, u_int16_t dy, u_int16_t cx, u_int16_t cy, int16_t rop, +diofb_mono_windowmove(struct diofb *fb, uint16_t sx, uint16_t sy, + uint16_t dx, uint16_t dy, uint16_t cx, uint16_t cy, int16_t rop, int16_t planemask /* ignored */) { int width; /* add to get to same position in next line */ @@ -271,5 +271,5 @@ } } - return (0); + return 0; } Index: src/sys/arch/hp300/dev/dvbox.c diff -u src/sys/arch/hp300/dev/dvbox.c:1.1 src/sys/arch/hp300/dev/dvbox.c:1.2 --- src/sys/arch/hp300/dev/dvbox.c:1.1 Sun Feb 6 18:26:51 2011 +++ src/sys/arch/hp300/dev/dvbox.c Sat Feb 12 16:40:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: dvbox.c,v 1.1 2011/02/06 18:26:51 tsutsui Exp $ */ +/* $NetBSD: dvbox.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */ /* $OpenBSD: dvbox.c,v 1.13 2006/08/11 18:33:13 miod Exp $ */ /* @@ -127,10 +127,10 @@ int sc_scode; }; -int dvbox_dio_match(device_t, cfdata_t, void *); -void dvbox_dio_attach(device_t, device_t, void *); -int dvbox_intio_match(device_t, cfdata_t, void *); -void dvbox_intio_attach(device_t, device_t, void *); +static int dvbox_dio_match(device_t, cfdata_t, void *); +static void dvbox_dio_attach(device_t, device_t, void *); +static int dvbox_intio_match(device_t, cfdata_t, void *); +static void dvbox_intio_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(dvbox_dio, sizeof(struct dvbox_softc), dvbox_dio_match, dvbox_dio_attach, NULL, NULL); @@ -138,16 +138,14 @@ CFATTACH_DECL_NEW(dvbox_intio, sizeof(struct dvbox_softc), dvbox_intio_match, dvbox_intio_attach, NULL, NULL); -int dvbox_reset(struct diofb *, int, struct diofbreg *); -void dvbox_restore(struct diofb *); -void dvbox_setcolor(struct diofb *, u_int, - u_int8_t, u_int8_t, u_int8_t); -int dvbox_windowmove(struct diofb *, u_int16_t, u_int16_t, u_int16_t, - u_int16_t, u_int16_t, u_int16_t, int16_t, int16_t); +static int dvbox_reset(struct diofb *, int, struct diofbreg *); +static void dvbox_restore(struct diofb *); +static int dvbox_windowmove(struct diofb *, uint16_t, uint16_t, uint16_t, + uint16_t, uint16_t, uint16_t, int16_t, int16_t); -int dvbox_ioctl(void *, void *, u_long, void *, int, struct lwp *); +static int dvbox_ioctl(void *, void *, u_long, void *, int, struct lwp *); -struct wsdisplay_accessops dvbox_accessops = { +static struct wsdisplay_accessops dvbox_accessops = { dvbox_ioctl, diofb_mmap, diofb_alloc_screen, @@ -172,13 +170,13 @@ fbr = (struct diofbreg *)ia->ia_addr; if (badaddr((void *)fbr)) - return (0); + return 0; if (fbr->id == GRFHWID && fbr->fbid == GID_DAVINCI) { - return (1); + return 1; } - return (0); + return 0; } void @@ -210,9 +208,9 @@ if (da->da_id == DIO_DEVICE_ID_FRAMEBUFFER && da->da_secid == DIO_DEVICE_SECID_DAVINCI) - return (1); + return 1; - return (0); + return 0; } void @@ -255,7 +253,7 @@ int rc; if ((rc = diofb_fbinquire(fb, scode, fbr)) != 0) - return (rc); + return rc; /* * Restrict the framebuffer to a monochrome view for now, until @@ -268,7 +266,7 @@ dvbox_restore(fb); diofb_fbsetup(fb); - return (0); + return 0; } /* @@ -410,14 +408,14 @@ } int -dvbox_windowmove(struct diofb *fb, u_int16_t sx, u_int16_t sy, - u_int16_t dx, u_int16_t dy, u_int16_t cx, u_int16_t cy, int16_t rop, +dvbox_windowmove(struct diofb *fb, uint16_t sx, uint16_t sy, + uint16_t dx, uint16_t dy, uint16_t cx, uint16_t cy, int16_t rop, int16_t planemask) { volatile struct dvboxfb *db = (struct dvboxfb *)fb->regkva; if (planemask != 0xff) - return (EINVAL); + return EINVAL; db_waitbusy(db); @@ -432,7 +430,7 @@ db_waitbusy(db); - return (0); + return 0; } /* Index: src/sys/arch/hp300/dev/dvboxreg.h diff -u src/sys/arch/hp300/dev/dvboxreg.h:1.1 src/sys/arch/hp300/dev/dvboxreg.h:1.2 --- src/sys/arch/hp300/dev/dvboxreg.h:1.1 Sun Feb 6 18:26:51 2011 +++ src/sys/arch/hp300/dev/dvboxreg.h Sat Feb 12 16:40:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: dvboxreg.h,v 1.1 2011/02/06 18:26:51 tsutsui Exp $ */ +/* $NetBSD: dvboxreg.h,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */ /* $OpenBSD: dvboxreg.h,v 1.2 2005/01/24 21:36:39 miod Exp $ */ /* NetBSD: grf_dvreg.h,v 1.5 1994/10/26 07:23:50 cgd Exp */ @@ -50,116 +50,116 @@ #define DVBOX_DUALROP(rop) ((rop) << 4 | (rop)) struct rgb { - u_int8_t :8, :8, :8; - u_int8_t red; - u_int8_t :8, :8, :8; - u_int8_t green; - u_int8_t :8, :8, :8; - u_int8_t blue; + uint8_t :8, :8, :8; + uint8_t red; + uint8_t :8, :8, :8; + uint8_t green; + uint8_t :8, :8, :8; + uint8_t blue; }; struct dvboxfb { struct diofbreg regs; - u_int8_t f2[16359]; - u_int8_t wbusy; /* Window move in progress 0x4047 */ - u_int8_t f3[0x405b-0x4047-1]; - u_int8_t as_busy; /* Scan accessing frame buf. 0x405B */ - u_int8_t f4[0x4090-0x405b-1]; - u_int32_t fbwen; /* Frame buffer write enable 0x4090 */ - u_int8_t f5[0x409f-0x4090-4]; - u_int8_t wmove; /* Initiate window move. 0x409F */ - u_int8_t f6[0x40b3-0x409f-1]; - u_int8_t fold; /* Byte/longword per pixel 0x40B3 */ - u_int8_t f7[0x40b7-0x40b3-1]; - u_int8_t opwen; /* Overlay plane write enable 0x40B7 */ - u_int8_t f8[0x40bf-0x40b7-1]; - u_int8_t drive; /* Select FB vs. Overlay. 0x40BF */ - - u_int8_t f8a[0x40cb-0x40bf-1]; - u_int8_t zconfig; /* Z buffer configuration 0x40CB */ - u_int8_t f8b[0x40cf-0x40cb-1]; - u_int8_t alt_rr; /* Alternate replacement rule 0x40CF */ - u_int8_t f8c[0x40d3-0x40cf-1]; - u_int8_t zrr; /* Z replacement rule 0x40D3 */ - - u_int8_t f9[0x40d7-0x40d3-1]; - u_int8_t en_scan; /* Enable scan DTACK. 0x40D7 */ - u_int8_t f10[0x40ef-0x40d7-1]; - u_int8_t rep_rule; /* Replacement rule 0x40EF */ - u_int8_t f11[0x40f2-0x40ef-1]; - u_int16_t source_x; /* Window source X origin 0x40F2 */ - u_int8_t f12[0x40f6-0x40f2-2]; - u_int16_t source_y; /* Window source Y origin 0x40F6 */ - u_int8_t f13[0x40fa-0x40f6-2]; - u_int16_t dest_x; /* Window dest X origin 0x40FA */ - u_int8_t f14[0x40fe -0x40fa-2]; - u_int16_t dest_y; /* Window dest Y origin 0x40FE */ - u_int8_t f15[0x4102-0x40fe -2]; - u_int16_t wwidth; /* Window width 0x4102 */ - u_int8_t f16[0x4106-0x4102-2]; - u_int16_t wheight; /* Window height 0x4106 */ - u_int8_t f17[0x6003-0x4106-2]; - u_int8_t cmapbank; /* Bank select (0 or 1) 0x6003 */ - u_int8_t f18[0x6007-0x6003-1]; - u_int8_t dispen; /* Display enable 0x6007 */ - - u_int8_t f18a[0x600B-0x6007-1]; - u_int8_t fbvenp; /* Frame buffer video enable 0x600B */ - u_int8_t f18b[0x6017-0x600B-1]; - u_int8_t fbvens; /* fbvenp blink counterpart 0x6017 */ - - u_int8_t f19[0x6023-0x6017-1]; - u_int8_t vdrive; /* Video display mode 0x6023 */ - u_int8_t f20[0x6083-0x6023-1]; - u_int8_t panxh; /* Pan display in X (high) 0x6083 */ - u_int8_t f21[0x6087-0x6083-1]; - u_int8_t panxl; /* Pan display in X (low) 0x6087 */ - u_int8_t f22[0x608b-0x6087-1]; - u_int8_t panyh; /* Pan display in Y (high) 0x608B */ - u_int8_t f23[0x608f-0x608b-1]; - u_int8_t panyl; /* Pan display in Y (low) 0x608F */ - u_int8_t f24[0x6093-0x608f-1]; - u_int8_t zoom; /* Zoom factor 0x6093 */ - u_int8_t f25[0x6097-0x6093-1]; - u_int8_t pz_trig; /* Pan & zoom trigger 0x6097 */ - u_int8_t f26[0x609b-0x6097-1]; - u_int8_t ovly0p; /* Overlay 0 primary map 0x609B */ - u_int8_t f27[0x609f-0x609b-1]; - u_int8_t ovly1p; /* Overlay 1 primary map 0x609F */ - u_int8_t f28[0x60a3-0x609f-1]; - u_int8_t ovly0s; /* Overlay 0 secondary map 0x60A3 */ - u_int8_t f29[0x60a7-0x60a3-1]; - u_int8_t ovly1s; /* Overlay 1 secondary map 0x60A7 */ - u_int8_t f30[0x60ab-0x60a7-1]; - u_int8_t opvenp; /* Overlay video enable 0x60AB */ - u_int8_t f31[0x60af-0x60ab-1]; - u_int8_t opvens; /* Overlay blink enable 0x60AF */ - u_int8_t f32[0x60b3-0x60af-1]; - u_int8_t fv_trig; /* Trigger control registers 0x60B3 */ - u_int8_t f33[0x60b7-0x60b3-1]; - u_int8_t cdwidth; /* Iris cdwidth timing reg. 0x60B7 */ - u_int8_t f34[0x60bb-0x60b7-1]; - u_int8_t chstart; /* Iris chstart timing reg. 0x60BB */ - u_int8_t f35[0x60bf-0x60bb-1]; - u_int8_t cvwidth; /* Iris cvwidth timing reg. 0x60BF */ - u_int8_t f36[0x6100-0x60bf-1]; + uint8_t f2[16359]; + uint8_t wbusy; /* Window move in progress 0x4047 */ + uint8_t f3[0x405b-0x4047-1]; + uint8_t as_busy; /* Scan accessing frame buf. 0x405B */ + uint8_t f4[0x4090-0x405b-1]; + uint32_t fbwen; /* Frame buffer write enable 0x4090 */ + uint8_t f5[0x409f-0x4090-4]; + uint8_t wmove; /* Initiate window move. 0x409F */ + uint8_t f6[0x40b3-0x409f-1]; + uint8_t fold; /* Byte/longword per pixel 0x40B3 */ + uint8_t f7[0x40b7-0x40b3-1]; + uint8_t opwen; /* Overlay plane write enable 0x40B7 */ + uint8_t f8[0x40bf-0x40b7-1]; + uint8_t drive; /* Select FB vs. Overlay. 0x40BF */ + + uint8_t f8a[0x40cb-0x40bf-1]; + uint8_t zconfig; /* Z buffer configuration 0x40CB */ + uint8_t f8b[0x40cf-0x40cb-1]; + uint8_t alt_rr; /* Alternate replacement rule 0x40CF */ + uint8_t f8c[0x40d3-0x40cf-1]; + uint8_t zrr; /* Z replacement rule 0x40D3 */ + + uint8_t f9[0x40d7-0x40d3-1]; + uint8_t en_scan; /* Enable scan DTACK. 0x40D7 */ + uint8_t f10[0x40ef-0x40d7-1]; + uint8_t rep_rule; /* Replacement rule 0x40EF */ + uint8_t f11[0x40f2-0x40ef-1]; + uint16_t source_x; /* Window source X origin 0x40F2 */ + uint8_t f12[0x40f6-0x40f2-2]; + uint16_t source_y; /* Window source Y origin 0x40F6 */ + uint8_t f13[0x40fa-0x40f6-2]; + uint16_t dest_x; /* Window dest X origin 0x40FA */ + uint8_t f14[0x40fe -0x40fa-2]; + uint16_t dest_y; /* Window dest Y origin 0x40FE */ + uint8_t f15[0x4102-0x40fe -2]; + uint16_t wwidth; /* Window width 0x4102 */ + uint8_t f16[0x4106-0x4102-2]; + uint16_t wheight; /* Window height 0x4106 */ + uint8_t f17[0x6003-0x4106-2]; + uint8_t cmapbank; /* Bank select (0 or 1) 0x6003 */ + uint8_t f18[0x6007-0x6003-1]; + uint8_t dispen; /* Display enable 0x6007 */ + + uint8_t f18a[0x600B-0x6007-1]; + uint8_t fbvenp; /* Frame buffer video enable 0x600B */ + uint8_t f18b[0x6017-0x600B-1]; + uint8_t fbvens; /* fbvenp blink counterpart 0x6017 */ + + uint8_t f19[0x6023-0x6017-1]; + uint8_t vdrive; /* Video display mode 0x6023 */ + uint8_t f20[0x6083-0x6023-1]; + uint8_t panxh; /* Pan display in X (high) 0x6083 */ + uint8_t f21[0x6087-0x6083-1]; + uint8_t panxl; /* Pan display in X (low) 0x6087 */ + uint8_t f22[0x608b-0x6087-1]; + uint8_t panyh; /* Pan display in Y (high) 0x608B */ + uint8_t f23[0x608f-0x608b-1]; + uint8_t panyl; /* Pan display in Y (low) 0x608F */ + uint8_t f24[0x6093-0x608f-1]; + uint8_t zoom; /* Zoom factor 0x6093 */ + uint8_t f25[0x6097-0x6093-1]; + uint8_t pz_trig; /* Pan & zoom trigger 0x6097 */ + uint8_t f26[0x609b-0x6097-1]; + uint8_t ovly0p; /* Overlay 0 primary map 0x609B */ + uint8_t f27[0x609f-0x609b-1]; + uint8_t ovly1p; /* Overlay 1 primary map 0x609F */ + uint8_t f28[0x60a3-0x609f-1]; + uint8_t ovly0s; /* Overlay 0 secondary map 0x60A3 */ + uint8_t f29[0x60a7-0x60a3-1]; + uint8_t ovly1s; /* Overlay 1 secondary map 0x60A7 */ + uint8_t f30[0x60ab-0x60a7-1]; + uint8_t opvenp; /* Overlay video enable 0x60AB */ + uint8_t f31[0x60af-0x60ab-1]; + uint8_t opvens; /* Overlay blink enable 0x60AF */ + uint8_t f32[0x60b3-0x60af-1]; + uint8_t fv_trig; /* Trigger control registers 0x60B3 */ + uint8_t f33[0x60b7-0x60b3-1]; + uint8_t cdwidth; /* Iris cdwidth timing reg. 0x60B7 */ + uint8_t f34[0x60bb-0x60b7-1]; + uint8_t chstart; /* Iris chstart timing reg. 0x60BB */ + uint8_t f35[0x60bf-0x60bb-1]; + uint8_t cvwidth; /* Iris cvwidth timing reg. 0x60BF */ + uint8_t f36[0x6100-0x60bf-1]; struct rgb rgb[8]; /* overlay color map */ - u_int8_t f37[0x6403-0x6100-sizeof(struct rgb)*8]; - u_int8_t red0; - u_int8_t f38[0x6803-0x6403-1]; - u_int8_t green0; - u_int8_t f39[0x6c03-0x6803-1]; - u_int8_t blue0; - u_int8_t f40[0x7403-0x6c03-1]; - u_int8_t red1; - u_int8_t f41[0x7803-0x7403-1]; - u_int8_t green1; - u_int8_t f42[0x7c03-0x7803-1]; - u_int8_t blue1; - u_int8_t f43[0x8012-0x7c03-1]; - u_int16_t status1; /* Master Status register 0x8012 */ - u_int8_t f44[0xC226-0x8012-2]; - u_int16_t trans; /* Transparency 0xC226 */ - u_int8_t f45[0xC23E -0xC226-2]; - u_int16_t pstop; /* Pace value control 0xc23e */ + uint8_t f37[0x6403-0x6100-sizeof(struct rgb)*8]; + uint8_t red0; + uint8_t f38[0x6803-0x6403-1]; + uint8_t green0; + uint8_t f39[0x6c03-0x6803-1]; + uint8_t blue0; + uint8_t f40[0x7403-0x6c03-1]; + uint8_t red1; + uint8_t f41[0x7803-0x7403-1]; + uint8_t green1; + uint8_t f42[0x7c03-0x7803-1]; + uint8_t blue1; + uint8_t f43[0x8012-0x7c03-1]; + uint16_t status1; /* Master Status register 0x8012 */ + uint8_t f44[0xC226-0x8012-2]; + uint16_t trans; /* Transparency 0xC226 */ + uint8_t f45[0xC23E -0xC226-2]; + uint16_t pstop; /* Pace value control 0xc23e */ }; Index: src/sys/arch/hp300/dev/gbox.c diff -u src/sys/arch/hp300/dev/gbox.c:1.1 src/sys/arch/hp300/dev/gbox.c:1.2 --- src/sys/arch/hp300/dev/gbox.c:1.1 Sun Feb 6 18:26:51 2011 +++ src/sys/arch/hp300/dev/gbox.c Sat Feb 12 16:40:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: gbox.c,v 1.1 2011/02/06 18:26:51 tsutsui Exp $ */ +/* $NetBSD: gbox.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */ /* $OpenBSD: gbox.c,v 1.15 2007/01/07 15:13:52 miod Exp $ */ /* @@ -131,10 +131,10 @@ int sc_scode; }; -int gbox_dio_match(device_t, cfdata_t, void *); -void gbox_dio_attach(device_t, device_t, void *); -int gbox_intio_match(device_t, cfdata_t, void *); -void gbox_intio_attach(device_t, device_t, void *); +static int gbox_dio_match(device_t, cfdata_t, void *); +static void gbox_dio_attach(device_t, device_t, void *); +static int gbox_intio_match(device_t, cfdata_t, void *); +static void gbox_intio_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(gbox_dio, sizeof(struct gbox_softc), gbox_dio_match, gbox_dio_attach, NULL, NULL); @@ -142,16 +142,16 @@ CFATTACH_DECL_NEW(gbox_intio, sizeof(struct gbox_softc), gbox_intio_match, gbox_intio_attach, NULL, NULL); -int gbox_reset(struct diofb *, int, struct diofbreg *); -void gbox_restore(struct diofb *); -int gbox_setcmap(struct diofb *, struct wsdisplay_cmap *); -void gbox_setcolor(struct diofb *, u_int); -int gbox_windowmove(struct diofb *, u_int16_t, u_int16_t, u_int16_t, - u_int16_t, u_int16_t, u_int16_t, int16_t, int16_t); +static int gbox_reset(struct diofb *, int, struct diofbreg *); +static void gbox_restore(struct diofb *); +static int gbox_setcmap(struct diofb *, struct wsdisplay_cmap *); +static void gbox_setcolor(struct diofb *, u_int); +static int gbox_windowmove(struct diofb *, uint16_t, uint16_t, uint16_t, + uint16_t, uint16_t, uint16_t, int16_t, int16_t); -int gbox_ioctl(void *, void *, u_long, void *, int, struct lwp *); +static int gbox_ioctl(void *, void *, u_long, void *, int, struct lwp *); -struct wsdisplay_accessops gbox_accessops = { +static struct wsdisplay_accessops gbox_accessops = { gbox_ioctl, diofb_mmap, diofb_alloc_screen, @@ -175,13 +175,13 @@ fbr = (struct diofbreg *)ia->ia_addr; if (badaddr((void *)fbr)) - return (0); + return 0; if (fbr->id == GRFHWID && fbr->fbid == GID_GATORBOX) { - return (1); + return 1; } - return (0); + return 0; } void @@ -213,13 +213,13 @@ /* We can not appear in DIO-II space */ if (DIO_ISDIOII(da->da_scode)) - return (0); + return 0; if (da->da_id == DIO_DEVICE_ID_FRAMEBUFFER && da->da_secid == DIO_DEVICE_SECID_GATORBOX) - return (1); + return 1; - return (0); + return 0; } void @@ -257,7 +257,7 @@ * Initialize hardware and display routines. */ -const u_int8_t crtc_init_data[] = { +const uint8_t crtc_init_data[] = { 0x29, 0x20, 0x23, 0x04, 0x30, 0x0b, 0x30, 0x30, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00 }; @@ -274,7 +274,7 @@ fb->dwidth = 1024; fb->dheight = 768; if ((rc = diofb_fbinquire(fb, scode, fbr)) != 0) - return (rc); + return rc; fb->bmv = gbox_windowmove; gbox_restore(fb); @@ -285,10 +285,10 @@ * a frame buffer location, see how many ones are read back. */ if (1 /* fb->planes == 0 */) { - volatile u_int8_t *fbp; - u_int8_t save; + volatile uint8_t *fbp; + uint8_t save; - fbp = (u_int8_t *)fb->fbkva; + fbp = (uint8_t *)fb->fbkva; save = *fbp; *fbp = 0xff; fb->planemask = *fbp; @@ -305,7 +305,7 @@ for (i = 0; i <= fb->planemask; i++) gbox_setcolor(fb, i); - return (0); + return 0; } void @@ -367,9 +367,9 @@ *(u_int *)data = fb->ri.ri_stride; return 0; case WSDISPLAYIO_GETCMAP: - return (diofb_getcmap(fb, (struct wsdisplay_cmap *)data)); + return diofb_getcmap(fb, (struct wsdisplay_cmap *)data); case WSDISPLAYIO_PUTCMAP: - return (gbox_setcmap(fb, (struct wsdisplay_cmap *)data)); + return gbox_setcmap(fb, (struct wsdisplay_cmap *)data); case WSDISPLAYIO_GVIDEO: case WSDISPLAYIO_SVIDEO: return EPASSTHROUGH; @@ -394,20 +394,20 @@ int gbox_setcmap(struct diofb *fb, struct wsdisplay_cmap *cm) { - u_int8_t r[256], g[256], b[256]; + uint8_t r[256], g[256], b[256]; u_int index = cm->index, count = cm->count; u_int colcount = 1 << fb->planes; int error; if (index >= colcount || count > colcount - index) - return (EINVAL); + return EINVAL; if ((error = copyin(cm->red, r, count)) != 0) - return (error); + return error; if ((error = copyin(cm->green, g, count)) != 0) - return (error); + return error; if ((error = copyin(cm->blue, b, count)) != 0) - return (error); + return error; memcpy(fb->cmap.r + index, r, count); memcpy(fb->cmap.g + index, g, count); @@ -416,19 +416,19 @@ while (count-- != 0) gbox_setcolor(fb, index++); - return (0); + return 0; } int -gbox_windowmove(struct diofb *fb, u_int16_t sx, u_int16_t sy, - u_int16_t dx, u_int16_t dy, u_int16_t cx, u_int16_t cy, int16_t rop, +gbox_windowmove(struct diofb *fb, uint16_t sx, uint16_t sy, + uint16_t dx, uint16_t dy, uint16_t cx, uint16_t cy, int16_t rop, int16_t planemask) { volatile struct gboxfb *gb = (struct gboxfb *)fb->regkva; int src, dest; if (planemask != 0xff) - return (EINVAL); + return EINVAL; src = (sy * 1024) + sx; /* upper left corner in pixels */ dest = (dy * 1024) + dx; @@ -447,12 +447,12 @@ src = src + ((cy - 4) * 1024) + (cx - 4); dest= dest + ((cy - 4) * 1024) + (cx - 4); } - *(volatile u_int8_t *)(fb->fbkva + dest) = - *(volatile u_int8_t *)(fb->fbkva + src); + *(volatile uint8_t *)(fb->fbkva + dest) = + *(volatile uint8_t *)(fb->fbkva + src); tile_mover_waitbusy(gb); - return (0); + return 0; } /* Index: src/sys/arch/hp300/dev/gboxreg.h diff -u src/sys/arch/hp300/dev/gboxreg.h:1.1 src/sys/arch/hp300/dev/gboxreg.h:1.2 --- src/sys/arch/hp300/dev/gboxreg.h:1.1 Sun Feb 6 18:26:51 2011 +++ src/sys/arch/hp300/dev/gboxreg.h Sat Feb 12 16:40:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: gboxreg.h,v 1.1 2011/02/06 18:26:51 tsutsui Exp $ */ +/* $NetBSD: gboxreg.h,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */ /* $OpenBSD: gboxreg.h,v 1.2 2005/01/24 21:36:39 miod Exp $ */ /* NetBSD: grf_gbreg.h,v 1.4 1994/10/26 07:23:53 cgd Exp */ @@ -55,52 +55,52 @@ do { \ while (((volatile struct gboxfb *)(regaddr))->regs.sec_interrupt & 0x10) \ DELAY(1); \ -} while (0) +} while (/* CONSTCOND */0) #define line_mover_waitbusy(regaddr) \ do { \ while ((((volatile struct gboxfb *)(regaddr))->status & 0x80) == 0) \ DELAY(1); \ -} while (0) +} while (/* CONSTCOND */0) #define gbcm_waitbusy(regaddr) \ do { \ while (((volatile struct gboxfb *)(regaddr))->cmap_busy != 0xff) \ DELAY(1); \ -} while (0) +} while (/* CONSTCOND */0) struct gboxfb { struct diofbreg regs; - u_int8_t f2[0x4000-0x5f-1]; - u_int8_t crtc_address; /* CTR controller address reg 0x4000 */ - u_int8_t status; /* Status register 0x4001 */ - u_int8_t crtc_data; /* CTR controller data reg 0x4002 */ - u_int8_t f3[6]; - u_int8_t line_mover_rep_rule; /* Line move rep rule */ - u_int8_t :8, :8; - u_int8_t line_mover_width; /* Line move width */ - u_int8_t f4[0xff3]; - u_int8_t width; /* width in tiles 0x5001 */ - u_int8_t :8; - u_int8_t height; /* height in tiles 0x5003 */ - u_int8_t f5[3]; - u_int8_t rep_rule; /* replacement rule 0x5007 */ - u_int8_t f6[0x6001-0x5007-1]; - u_int8_t blink1; /* blink 1 0x6001 */ - u_int8_t f7[3]; - u_int8_t blink2; /* blink 2 0x6005 */ - u_int8_t f8[3]; - u_int8_t write_protect; /* write protect 0x6009 */ - u_int8_t f9[0x6803-0x6009-1]; - u_int8_t cmap_busy; /* color map busy 0x6803 */ - u_int8_t f10[0x68b9-0x6803-1]; - u_int8_t creg_select; /* color map register select 0x68b8 */ - u_int8_t f11[0x68f1-0x68b9-1]; - u_int8_t cmap_write; /* color map write trigger 0x68f1 */ - u_int8_t f12[0x69b3-0x68f1-1]; - u_int8_t cmap_red; /* red value register 0x69b3 */ - u_int8_t :8; - u_int8_t cmap_grn; /* green value register 0x69b5 */ - u_int8_t :8; - u_int8_t cmap_blu; /* blue value register 0x69b6 */ + uint8_t f2[0x4000-0x5f-1]; + uint8_t crtc_address; /* CTR controller address reg 0x4000 */ + uint8_t status; /* Status register 0x4001 */ + uint8_t crtc_data; /* CTR controller data reg 0x4002 */ + uint8_t f3[6]; + uint8_t line_mover_rep_rule; /* Line move rep rule */ + uint8_t :8, :8; + uint8_t line_mover_width; /* Line move width */ + uint8_t f4[0xff3]; + uint8_t width; /* width in tiles 0x5001 */ + uint8_t :8; + uint8_t height; /* height in tiles 0x5003 */ + uint8_t f5[3]; + uint8_t rep_rule; /* replacement rule 0x5007 */ + uint8_t f6[0x6001-0x5007-1]; + uint8_t blink1; /* blink 1 0x6001 */ + uint8_t f7[3]; + uint8_t blink2; /* blink 2 0x6005 */ + uint8_t f8[3]; + uint8_t write_protect; /* write protect 0x6009 */ + uint8_t f9[0x6803-0x6009-1]; + uint8_t cmap_busy; /* color map busy 0x6803 */ + uint8_t f10[0x68b9-0x6803-1]; + uint8_t creg_select; /* color map register select 0x68b8 */ + uint8_t f11[0x68f1-0x68b9-1]; + uint8_t cmap_write; /* color map write trigger 0x68f1 */ + uint8_t f12[0x69b3-0x68f1-1]; + uint8_t cmap_red; /* red value register 0x69b3 */ + uint8_t :8; + uint8_t cmap_grn; /* green value register 0x69b5 */ + uint8_t :8; + uint8_t cmap_blu; /* blue value register 0x69b6 */ }; Index: src/sys/arch/hp300/dev/hyper.c diff -u src/sys/arch/hp300/dev/hyper.c:1.1 src/sys/arch/hp300/dev/hyper.c:1.2 --- src/sys/arch/hp300/dev/hyper.c:1.1 Sun Feb 6 18:26:51 2011 +++ src/sys/arch/hp300/dev/hyper.c Sat Feb 12 16:40:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: hyper.c,v 1.1 2011/02/06 18:26:51 tsutsui Exp $ */ +/* $NetBSD: hyper.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */ /* $OpenBSD: hyper.c,v 1.15 2006/04/14 21:05:43 miod Exp $ */ /* @@ -130,17 +130,17 @@ int sc_scode; }; -int hyper_match(device_t, cfdata_t, void *); -void hyper_attach(device_t, device_t, void *); +static int hyper_match(device_t, cfdata_t, void *); +static void hyper_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(hyper, sizeof(struct hyper_softc), hyper_match, hyper_attach, NULL, NULL); -int hyper_reset(struct diofb *, int, struct diofbreg *); +static int hyper_reset(struct diofb *, int, struct diofbreg *); -int hyper_ioctl(void *, void *, u_long, void *, int, struct lwp *); +static int hyper_ioctl(void *, void *, u_long, void *, int, struct lwp *); -struct wsdisplay_accessops hyper_accessops = { +static struct wsdisplay_accessops hyper_accessops = { hyper_ioctl, diofb_mmap, diofb_alloc_screen, @@ -160,9 +160,9 @@ if (da->da_id == DIO_DEVICE_ID_FRAMEBUFFER && da->da_secid == DIO_DEVICE_SECID_HYPERION) - return (1); + return 1; - return (0); + return 0; } void @@ -206,7 +206,7 @@ int rc; if ((rc = diofb_fbinquire(fb, scode, fbr)) != 0) - return (rc); + return rc; fb->bmv = diofb_mono_windowmove; @@ -216,7 +216,7 @@ /* enable display */ hy->nblank = DISP_VIDEO_ENABLE | DISP_SYNC_ENABLE; - return (0); + return 0; } int Index: src/sys/arch/hp300/dev/hyperreg.h diff -u src/sys/arch/hp300/dev/hyperreg.h:1.1 src/sys/arch/hp300/dev/hyperreg.h:1.2 --- src/sys/arch/hp300/dev/hyperreg.h:1.1 Sun Feb 6 18:26:51 2011 +++ src/sys/arch/hp300/dev/hyperreg.h Sat Feb 12 16:40:29 2011 @@ -1,5 +1,5 @@ /* $OpenBSD: hyperreg.h,v 1.3 2005/01/24 21:36:39 miod Exp $ */ -/* $NetBSD: hyperreg.h,v 1.1 2011/02/06 18:26:51 tsutsui Exp $ */ +/* $NetBSD: hyperreg.h,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */ /* * Copyright (c) 1991 University of Utah. @@ -42,8 +42,8 @@ struct hyboxfb { struct diofbreg regs; - u_int8_t f2[0x4000-0x5f-1]; - u_int8_t nblank; /* display enable planes 0x4000 */ + uint8_t f2[0x4000-0x5f-1]; + uint8_t nblank; /* display enable planes 0x4000 */ }; /* Values for nblank */ Index: src/sys/arch/hp300/dev/rbox.c diff -u src/sys/arch/hp300/dev/rbox.c:1.1 src/sys/arch/hp300/dev/rbox.c:1.2 --- src/sys/arch/hp300/dev/rbox.c:1.1 Sun Feb 6 18:26:51 2011 +++ src/sys/arch/hp300/dev/rbox.c Sat Feb 12 16:40:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rbox.c,v 1.1 2011/02/06 18:26:51 tsutsui Exp $ */ +/* $NetBSD: rbox.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */ /* $OpenBSD: rbox.c,v 1.14 2006/08/11 18:33:13 miod Exp $ */ /* @@ -127,10 +127,10 @@ int sc_scode; }; -int rbox_dio_match(device_t, cfdata_t, void *); -void rbox_dio_attach(device_t, device_t, void *); -int rbox_intio_match(device_t, cfdata_t, void *); -void rbox_intio_attach(device_t, device_t, void *); +static int rbox_dio_match(device_t, cfdata_t, void *); +static void rbox_dio_attach(device_t, device_t, void *); +static int rbox_intio_match(device_t, cfdata_t, void *); +static void rbox_intio_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(rbox_dio, sizeof(struct rbox_softc), rbox_dio_match, rbox_dio_attach, NULL, NULL); @@ -138,16 +138,14 @@ CFATTACH_DECL_NEW(rbox_intio, sizeof(struct rbox_softc), rbox_intio_match, rbox_intio_attach, NULL, NULL); -int rbox_reset(struct diofb *, int, struct diofbreg *); -void rbox_restore(struct diofb *); -void rbox_setcolor(struct diofb *, u_int, - u_int8_t, u_int8_t, u_int8_t); -int rbox_windowmove(struct diofb *, u_int16_t, u_int16_t, u_int16_t, - u_int16_t, u_int16_t, u_int16_t, int16_t, int16_t); +static int rbox_reset(struct diofb *, int, struct diofbreg *); +static void rbox_restore(struct diofb *); +static int rbox_windowmove(struct diofb *, uint16_t, uint16_t, uint16_t, + uint16_t, uint16_t, uint16_t, int16_t, int16_t); -int rbox_ioctl(void *, void *, u_long, void *, int, struct lwp *); +static int rbox_ioctl(void *, void *, u_long, void *, int, struct lwp *); -struct wsdisplay_accessops rbox_accessops = { +static struct wsdisplay_accessops rbox_accessops = { rbox_ioctl, diofb_mmap, diofb_alloc_screen, @@ -172,13 +170,13 @@ fbr = (struct diofbreg *)ia->ia_addr; if (badaddr((void *)fbr)) - return (0); + return 0; if (fbr->id == GRFHWID && fbr->fbid == GID_RENAISSANCE) { - return (1); + return 1; } - return (0); + return 0; } void @@ -210,9 +208,9 @@ if (da->da_id == DIO_DEVICE_ID_FRAMEBUFFER && da->da_secid == DIO_DEVICE_SECID_RENAISSANCE) - return (1); + return 1; - return (0); + return 0; } void @@ -255,7 +253,7 @@ int rc; if ((rc = diofb_fbinquire(fb, scode, fbr)) != 0) - return (rc); + return rc; /* * Restrict the framebuffer to a monochrome view for now, until @@ -268,7 +266,7 @@ rbox_restore(fb); diofb_fbsetup(fb); - return (0); + return 0; } void @@ -371,14 +369,14 @@ } int -rbox_windowmove(struct diofb *fb, u_int16_t sx, u_int16_t sy, - u_int16_t dx, u_int16_t dy, u_int16_t cx, u_int16_t cy, int16_t rop, +rbox_windowmove(struct diofb *fb, uint16_t sx, uint16_t sy, + uint16_t dx, uint16_t dy, uint16_t cx, uint16_t cy, int16_t rop, int16_t planemask) { volatile struct rboxfb *rb = (struct rboxfb *)fb->regkva; if (planemask != 0xff) - return (EINVAL); + return EINVAL; rb_waitbusy(rb); @@ -393,7 +391,7 @@ rb_waitbusy(rb); - return (0); + return 0; } /* Index: src/sys/arch/hp300/dev/rboxreg.h diff -u src/sys/arch/hp300/dev/rboxreg.h:1.1 src/sys/arch/hp300/dev/rboxreg.h:1.2 --- src/sys/arch/hp300/dev/rboxreg.h:1.1 Sun Feb 6 18:26:51 2011 +++ src/sys/arch/hp300/dev/rboxreg.h Sat Feb 12 16:40:29 2011 @@ -1,5 +1,5 @@ /* $OpenBSD: rboxreg.h,v 1.2 2005/01/24 21:36:39 miod Exp $ */ -/* $NetBSD: rboxreg.h,v 1.1 2011/02/06 18:26:51 tsutsui Exp $ */ +/* $NetBSD: rboxreg.h,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -47,74 +47,74 @@ do { \ while (((volatile struct rboxfb *)(regaddr))->wbusy & 0x01) \ DELAY(10); \ -} while (0) +} while (/* CONSTCOND */0) #define RBOX_DUALROP(rop) ((rop) << 4 | (rop)) -#define CM1RED(fb) ((volatile struct rencm *)((fb)->regkva + 0x6400)) -#define CM1GRN(fb) ((volatile struct rencm *)((fb)->regkva + 0x6800)) -#define CM1BLU(fb) ((volatile struct rencm *)((fb)->regkva + 0x6C00)) -#define CM2RED(fb) ((volatile struct rencm *)((fb)->regkva + 0x7400)) -#define CM2GRN(fb) ((volatile struct rencm *)((fb)->regkva + 0x7800)) -#define CM2BLU(fb) ((volatile struct rencm *)((fb)->regkva + 0x7C00)) +#define CM1RED(fb) ((volatile struct rencm *)((fb)->regkva + 0x6400)) +#define CM1GRN(fb) ((volatile struct rencm *)((fb)->regkva + 0x6800)) +#define CM1BLU(fb) ((volatile struct rencm *)((fb)->regkva + 0x6C00)) +#define CM2RED(fb) ((volatile struct rencm *)((fb)->regkva + 0x7400)) +#define CM2GRN(fb) ((volatile struct rencm *)((fb)->regkva + 0x7800)) +#define CM2BLU(fb) ((volatile struct rencm *)((fb)->regkva + 0x7C00)) struct rencm { - u_int8_t :8, :8, :8; - u_int8_t value; + uint8_t :8, :8, :8; + uint8_t value; }; struct rboxfb { struct diofbreg regs; - u_int8_t filler2[16359]; - u_int8_t wbusy; /* window mover is active 0x4047 */ - u_int8_t filler3[0x405b - 0x4048]; - u_int8_t scanbusy; /* scan converteris active 0x405B */ - u_int8_t filler3b[0x4083 - 0x405c]; - u_int8_t video_enable; /* drive vid. refresh bus 0x4083 */ - u_int8_t filler4[3]; - u_int8_t display_enable; /* enable the display 0x4087 */ - u_int8_t filler5[8]; - u_int32_t write_enable; /* write enable register 0x4090 */ - u_int8_t filler6[11]; - u_int8_t wmove; /* start window mover 0x409f */ - u_int8_t filler7[3]; - u_int8_t blink; /* blink register 0x40a3 */ - u_int8_t filler8[15]; - u_int8_t fold; /* fold register 0x40b3 */ - u_int32_t opwen; /* overlay plane write enable 0x40b4 */ - u_int8_t filler9[3]; - u_int8_t tmode; /* Tile mode size 0x40bb */ - u_int8_t filler9a[3]; - u_int8_t drive; /* drive register 0x40bf */ - u_int8_t filler10[3]; - u_int8_t vdrive; /* vdrive register 0x40c3 */ - u_int8_t filler10a[0x40cb-0x40c4]; - u_int8_t zconfig; /* Z-buffer mode 0x40cb */ - u_int8_t filler11a[2]; - u_int16_t tpatt; /* Transparency pattern 0x40ce */ - u_int8_t filler11b[3]; - u_int8_t dmode; /* dither mode 0x40d3 */ - u_int8_t filler11c[3]; - u_int8_t en_scan; /* enable scan board to DTACK 0x40d7 */ - u_int8_t filler11d[0x40ef-0x40d8]; - u_int8_t rep_rule; /* replacement rule 0x40ef */ - u_int8_t filler12[2]; - u_int16_t source_x; /* source x 0x40f2 */ - u_int8_t filler13[2]; - u_int16_t source_y; /* source y 0x40f6 */ - u_int8_t filler14[2]; - u_int16_t dest_x; /* dest x 0x40fa */ - u_int8_t filler15[2]; - u_int16_t dest_y; /* dest y 0x40fe */ - u_int8_t filler16[2]; - u_int16_t wwidth; /* window width 0x4102 */ - u_int8_t filler17[2]; - u_int16_t wheight; /* window height 0x4106 */ - u_int8_t filler18[18]; - u_int16_t patt_x; /* pattern x 0x411a */ - u_int8_t filler19[2]; - u_int16_t patt_y; /* pattern y 0x411e */ - u_int8_t filler20[0x8012 - 0x4120]; - u_int16_t te_status; /* transform engine status 0x8012 */ - u_int8_t filler21[0x1ffff-0x8014]; + uint8_t filler2[16359]; + uint8_t wbusy; /* window mover is active 0x4047 */ + uint8_t filler3[0x405b - 0x4048]; + uint8_t scanbusy; /* scan converteris active 0x405B */ + uint8_t filler3b[0x4083 - 0x405c]; + uint8_t video_enable; /* drive vid. refresh bus 0x4083 */ + uint8_t filler4[3]; + uint8_t display_enable; /* enable the display 0x4087 */ + uint8_t filler5[8]; + uint32_t write_enable; /* write enable register 0x4090 */ + uint8_t filler6[11]; + uint8_t wmove; /* start window mover 0x409f */ + uint8_t filler7[3]; + uint8_t blink; /* blink register 0x40a3 */ + uint8_t filler8[15]; + uint8_t fold; /* fold register 0x40b3 */ + uint32_t opwen; /* overlay plane write enable 0x40b4 */ + uint8_t filler9[3]; + uint8_t tmode; /* Tile mode size 0x40bb */ + uint8_t filler9a[3]; + uint8_t drive; /* drive register 0x40bf */ + uint8_t filler10[3]; + uint8_t vdrive; /* vdrive register 0x40c3 */ + uint8_t filler10a[0x40cb-0x40c4]; + uint8_t zconfig; /* Z-buffer mode 0x40cb */ + uint8_t filler11a[2]; + uint16_t tpatt; /* Transparency pattern 0x40ce */ + uint8_t filler11b[3]; + uint8_t dmode; /* dither mode 0x40d3 */ + uint8_t filler11c[3]; + uint8_t en_scan; /* enable scan board to DTACK 0x40d7 */ + uint8_t filler11d[0x40ef-0x40d8]; + uint8_t rep_rule; /* replacement rule 0x40ef */ + uint8_t filler12[2]; + uint16_t source_x; /* source x 0x40f2 */ + uint8_t filler13[2]; + uint16_t source_y; /* source y 0x40f6 */ + uint8_t filler14[2]; + uint16_t dest_x; /* dest x 0x40fa */ + uint8_t filler15[2]; + uint16_t dest_y; /* dest y 0x40fe */ + uint8_t filler16[2]; + uint16_t wwidth; /* window width 0x4102 */ + uint8_t filler17[2]; + uint16_t wheight; /* window height 0x4106 */ + uint8_t filler18[18]; + uint16_t patt_x; /* pattern x 0x411a */ + uint8_t filler19[2]; + uint16_t patt_y; /* pattern y 0x411e */ + uint8_t filler20[0x8012 - 0x4120]; + uint16_t te_status; /* transform engine status 0x8012 */ + uint8_t filler21[0x1ffff-0x8014]; }; Index: src/sys/arch/hp300/dev/topcat.c diff -u src/sys/arch/hp300/dev/topcat.c:1.1 src/sys/arch/hp300/dev/topcat.c:1.2 --- src/sys/arch/hp300/dev/topcat.c:1.1 Sun Feb 6 18:26:51 2011 +++ src/sys/arch/hp300/dev/topcat.c Sat Feb 12 16:40:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: topcat.c,v 1.1 2011/02/06 18:26:51 tsutsui Exp $ */ +/* $NetBSD: topcat.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */ /* $OpenBSD: topcat.c,v 1.15 2006/08/11 18:33:13 miod Exp $ */ /* @@ -140,13 +140,13 @@ CFATTACH_DECL_NEW(topcat_intio, sizeof(struct topcat_softc), topcat_intio_match, topcat_intio_attach, NULL, NULL); -void topcat_end_attach(struct topcat_softc *, u_int8_t); +void topcat_end_attach(struct topcat_softc *, uint8_t); int topcat_reset(struct diofb *, int, struct diofbreg *); void topcat_restore(struct diofb *); int topcat_setcmap(struct diofb *, struct wsdisplay_cmap *); void topcat_setcolor(struct diofb *, u_int); -int topcat_windowmove(struct diofb *, u_int16_t, u_int16_t, u_int16_t, - u_int16_t, u_int16_t, u_int16_t, int16_t, int16_t); +int topcat_windowmove(struct diofb *, uint16_t, uint16_t, uint16_t, + uint16_t, uint16_t, uint16_t, int16_t, int16_t); int topcat_ioctl(void *, void *, u_long, void *, int, struct lwp *); @@ -175,7 +175,7 @@ fbr = (struct diofbreg *)ia->ia_addr; if (badaddr((void *)fbr)) - return (0); + return 0; if (fbr->id == GRFHWID) { switch (fbr->fbid) { @@ -186,11 +186,11 @@ #if 0 case GID_XXXCATSEYE: #endif - return (1); + return 1; } } - return (0); + return 0; } void @@ -228,11 +228,11 @@ #if 0 case DIO_DEVICE_SECID_XXXCATSEYE: #endif - return (1); + return 1; } } - return (0); + return 0; } void @@ -266,7 +266,7 @@ } void -topcat_end_attach(struct topcat_softc *sc, u_int8_t id) +topcat_end_attach(struct topcat_softc *sc, uint8_t id) { const char *fbname = "unknown"; @@ -313,7 +313,7 @@ u_int i; if ((rc = diofb_fbinquire(fb, scode, fbr)) != 0) - return (rc); + return rc; /* * If we could not get a valid number of planes, determine it @@ -321,10 +321,10 @@ * then reading it back. */ if (fb->planes == 0) { - volatile u_int8_t *fbp; - u_int8_t save; + volatile uint8_t *fbp; + uint8_t save; - fbp = (u_int8_t *)fb->fbkva; + fbp = (uint8_t *)fb->fbkva; tc->fben = ~0; tc->wen = ~0; tc->ren = ~0; @@ -347,7 +347,7 @@ for (i = 0; i <= fb->planemask; i++) topcat_setcolor(fb, i); - return (0); + return 0; } void @@ -413,9 +413,9 @@ *(u_int *)data = fb->ri.ri_stride; return 0; case WSDISPLAYIO_GETCMAP: - return (diofb_getcmap(fb, (struct wsdisplay_cmap *)data)); + return diofb_getcmap(fb, (struct wsdisplay_cmap *)data); case WSDISPLAYIO_PUTCMAP: - return (topcat_setcmap(fb, (struct wsdisplay_cmap *)data)); + return topcat_setcmap(fb, (struct wsdisplay_cmap *)data); case WSDISPLAYIO_GVIDEO: case WSDISPLAYIO_SVIDEO: return EPASSTHROUGH; @@ -460,20 +460,20 @@ int topcat_setcmap(struct diofb *fb, struct wsdisplay_cmap *cm) { - u_int8_t r[256], g[256], b[256]; + uint8_t r[256], g[256], b[256]; u_int index = cm->index, count = cm->count; u_int colcount = 1 << fb->planes; int error; if (index >= colcount || count > colcount - index) - return (EINVAL); + return EINVAL; if ((error = copyin(cm->red, r, count)) != 0) - return (error); + return error; if ((error = copyin(cm->green, g, count)) != 0) - return (error); + return error; if ((error = copyin(cm->blue, b, count)) != 0) - return (error); + return error; memcpy(fb->cmap.r + index, r, count); memcpy(fb->cmap.g + index, g, count); @@ -482,7 +482,7 @@ while (count-- != 0) topcat_setcolor(fb, index++); - return (0); + return 0; } /* @@ -490,8 +490,8 @@ */ int -topcat_windowmove(struct diofb *fb, u_int16_t sx, u_int16_t sy, - u_int16_t dx, u_int16_t dy, u_int16_t cx, u_int16_t cy, int16_t rop, +topcat_windowmove(struct diofb *fb, uint16_t sx, uint16_t sy, + uint16_t dx, uint16_t dy, uint16_t cx, uint16_t cy, int16_t rop, int16_t planemask) { volatile struct tcboxfb *tc = (struct tcboxfb *)fb->regkva; @@ -515,7 +515,7 @@ tc_waitbusy(tc, fb->planemask); - return (0); + return 0; } Index: src/sys/arch/hp300/dev/topcatreg.h diff -u src/sys/arch/hp300/dev/topcatreg.h:1.1 src/sys/arch/hp300/dev/topcatreg.h:1.2 --- src/sys/arch/hp300/dev/topcatreg.h:1.1 Sun Feb 6 18:26:51 2011 +++ src/sys/arch/hp300/dev/topcatreg.h Sat Feb 12 16:40:29 2011 @@ -1,5 +1,5 @@ /* $OpenBSD: topcatreg.h,v 1.2 2005/01/24 21:36:39 miod Exp $ */ -/* $NetBSD: topcatreg.h,v 1.1 2011/02/06 18:26:51 tsutsui Exp $ */ +/* $NetBSD: topcatreg.h,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -43,75 +43,75 @@ do { \ while (((volatile struct tcboxfb *)(regaddr))->cmap_busy & 0x04) \ DELAY(10); \ -} while (0) +} while (/* CONSTCOND */0) #define tc_waitbusy(regaddr,planes) \ do { \ while (((volatile struct tcboxfb *)(regaddr))->busy & planes) \ DELAY(10); \ -} while (0) +} while (/* CONSTCOND */0) struct tcboxfb { struct diofbreg regs; - u_int8_t f2[0x4040-0x5f-1]; - u_int8_t vblank; /* vertical blanking 0x4040 */ - u_int8_t :8,:8,:8; - u_int8_t busy; /* window move active 0x4044 */ - u_int8_t :8,:8,:8; - u_int8_t vtrace_request; /* vert retrace intr request 0x4048 */ - u_int8_t :8,:8,:8; - u_int8_t move_request; /* window move intr request 0x404C */ - u_int8_t f3[0x4080-0x404c-1]; - u_int8_t nblank; /* display enable planes 0x4080 */ - u_int8_t f4[0x4088-0x4080-1]; - u_int8_t wen; /* write enable plane 0x4088 */ - u_int8_t f5[0x408c-0x4088-1]; - u_int8_t ren; /* read enable plane 0x408c */ - u_int8_t f6[0x4090-0x408c-1]; - u_int8_t fben; /* frame buffer write enable 0x4090 */ - u_int8_t f7[0x409c-0x4090-1]; - u_int8_t wmove; /* start window move 0x409c */ - u_int8_t f8[0x40a0-0x409c-1]; - u_int8_t blink; /* enable blink planes 0x40a0 */ - u_int8_t f9[0x40a8-0x40a0-1]; - u_int8_t altframe; /* enable alternate frame 0x40a8 */ - u_int8_t f10[0x40ac-0x40a8-1]; - u_int8_t curon; /* cursor control register 0x40ac */ - u_int8_t f11[0x40ea-0x40ac-1]; - u_int8_t prr; /* pixel replacement rule 0x40ea */ - u_int8_t f12[0x40ef-0x40ea-1]; - u_int8_t wmrr; /* move replacement rule 0x40ef */ - u_int8_t f13[0x40f2-0x40ef-1]; - u_int16_t source_x; /* source x pixel # 0x40f2 */ - u_int8_t f14[0x40f6-0x40f2-2]; - u_int16_t source_y; /* source y pixel # 0x40f6 */ - u_int8_t f15[0x40fa-0x40f6-2]; - u_int16_t dest_x; /* dest x pixel # 0x40fa */ - u_int8_t f16[0x40fe -0x40fa-2]; - u_int16_t dest_y; /* dest y pixel # 0x40fe */ - u_int8_t f17[0x4102-0x40fe -2]; - u_int16_t wwidth; /* block mover pixel width 0x4102 */ - u_int8_t f18[0x4106-0x4102-2]; - u_int16_t wheight; /* block mover pixel height 0x4106 */ + uint8_t f2[0x4040-0x5f-1]; + uint8_t vblank; /* vertical blanking 0x4040 */ + uint8_t :8,:8,:8; + uint8_t busy; /* window move active 0x4044 */ + uint8_t :8,:8,:8; + uint8_t vtrace_request; /* vert retrace intr request 0x4048 */ + uint8_t :8,:8,:8; + uint8_t move_request; /* window move intr request 0x404C */ + uint8_t f3[0x4080-0x404c-1]; + uint8_t nblank; /* display enable planes 0x4080 */ + uint8_t f4[0x4088-0x4080-1]; + uint8_t wen; /* write enable plane 0x4088 */ + uint8_t f5[0x408c-0x4088-1]; + uint8_t ren; /* read enable plane 0x408c */ + uint8_t f6[0x4090-0x408c-1]; + uint8_t fben; /* frame buffer write enable 0x4090 */ + uint8_t f7[0x409c-0x4090-1]; + uint8_t wmove; /* start window move 0x409c */ + uint8_t f8[0x40a0-0x409c-1]; + uint8_t blink; /* enable blink planes 0x40a0 */ + uint8_t f9[0x40a8-0x40a0-1]; + uint8_t altframe; /* enable alternate frame 0x40a8 */ + uint8_t f10[0x40ac-0x40a8-1]; + uint8_t curon; /* cursor control register 0x40ac */ + uint8_t f11[0x40ea-0x40ac-1]; + uint8_t prr; /* pixel replacement rule 0x40ea */ + uint8_t f12[0x40ef-0x40ea-1]; + uint8_t wmrr; /* move replacement rule 0x40ef */ + uint8_t f13[0x40f2-0x40ef-1]; + uint16_t source_x; /* source x pixel # 0x40f2 */ + uint8_t f14[0x40f6-0x40f2-2]; + uint16_t source_y; /* source y pixel # 0x40f6 */ + uint8_t f15[0x40fa-0x40f6-2]; + uint16_t dest_x; /* dest x pixel # 0x40fa */ + uint8_t f16[0x40fe -0x40fa-2]; + uint16_t dest_y; /* dest y pixel # 0x40fe */ + uint8_t f17[0x4102-0x40fe -2]; + uint16_t wwidth; /* block mover pixel width 0x4102 */ + uint8_t f18[0x4106-0x4102-2]; + uint16_t wheight; /* block mover pixel height 0x4106 */ /* Catseye */ - u_int8_t f19[0x4206-0x4106-2]; - u_int16_t rug_cmdstat; /* RUG Command/Staus 0x4206 */ - u_int8_t f20[0x4510-0x4206-2]; - u_int16_t vb_select; /* Vector/BitBlt Select 0x4510 */ - u_int16_t tcntrl; /* Three Operand Control 0x4512 */ - u_int16_t acntrl; /* BitBlt Mode 0x4514 */ - u_int16_t pncntrl; /* Plane Control 0x4516 */ - u_int8_t f21[0x4800-0x4516-2]; - u_int16_t catseye_status; /* Catseye Status 0x4800 */ + uint8_t f19[0x4206-0x4106-2]; + uint16_t rug_cmdstat; /* RUG Command/Staus 0x4206 */ + uint8_t f20[0x4510-0x4206-2]; + uint16_t vb_select; /* Vector/BitBlt Select 0x4510 */ + uint16_t tcntrl; /* Three Operand Control 0x4512 */ + uint16_t acntrl; /* BitBlt Mode 0x4514 */ + uint16_t pncntrl; /* Plane Control 0x4516 */ + uint8_t f21[0x4800-0x4516-2]; + uint16_t catseye_status; /* Catseye Status 0x4800 */ /* End of Catseye */ - u_int8_t f22[0x6002-0x4800-2]; - u_int16_t cmap_busy; /* Color Ram busy 0x6002 */ - u_int8_t f23[0x60b2-0x6002-2]; - u_int16_t rdata; /* color map red data 0x60b2 */ - u_int16_t gdata; /* color map green data 0x60b4 */ - u_int16_t bdata; /* color map blue data 0x60b6 */ - u_int16_t cindex; /* color map index 0x60b8 */ - u_int16_t plane_mask; /* plane mask select 0x60ba */ - u_int8_t f24[0x60f0-0x60ba-2]; - u_int16_t strobe; /* color map trigger 0x60f0 */ + uint8_t f22[0x6002-0x4800-2]; + uint16_t cmap_busy; /* Color Ram busy 0x6002 */ + uint8_t f23[0x60b2-0x6002-2]; + uint16_t rdata; /* color map red data 0x60b2 */ + uint16_t gdata; /* color map green data 0x60b4 */ + uint16_t bdata; /* color map blue data 0x60b6 */ + uint16_t cindex; /* color map index 0x60b8 */ + uint16_t plane_mask; /* plane mask select 0x60ba */ + uint8_t f24[0x60f0-0x60ba-2]; + uint16_t strobe; /* color map trigger 0x60f0 */ }; Index: src/sys/arch/hp300/dev/tvrx.c diff -u src/sys/arch/hp300/dev/tvrx.c:1.1 src/sys/arch/hp300/dev/tvrx.c:1.2 --- src/sys/arch/hp300/dev/tvrx.c:1.1 Sun Feb 6 18:26:51 2011 +++ src/sys/arch/hp300/dev/tvrx.c Sat Feb 12 16:40:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: tvrx.c,v 1.1 2011/02/06 18:26:51 tsutsui Exp $ */ +/* $NetBSD: tvrx.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $ */ /* $OpenBSD: tvrx.c,v 1.1 2006/04/14 21:05:43 miod Exp $ */ /* @@ -63,17 +63,17 @@ int sc_scode; }; -int tvrx_match(device_t, cfdata_t, void *); -void tvrx_attach(device_t, device_t, void *); +static int tvrx_match(device_t, cfdata_t, void *); +static void tvrx_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(tvrx, sizeof(struct tvrx_softc), tvrx_match, tvrx_attach, NULL, NULL); -int tvrx_reset(struct diofb *, int, struct diofbreg *); +static int tvrx_reset(struct diofb *, int, struct diofbreg *); -int tvrx_ioctl(void *, void *, u_long, void *, int, struct lwp *); +static int tvrx_ioctl(void *, void *, u_long, void *, int, struct lwp *); -struct wsdisplay_accessops tvrx_accessops = { +static struct wsdisplay_accessops tvrx_accessops = { tvrx_ioctl, diofb_mmap, diofb_alloc_screen, @@ -93,9 +93,9 @@ if (da->da_id != DIO_DEVICE_ID_FRAMEBUFFER || da->da_secid != DIO_DEVICE_SECID_TIGERSHARK) - return (0); + return 0; - return (1); + return 1; } void @@ -138,7 +138,7 @@ int rc; if ((rc = diofb_fbinquire(fb, scode, fbr)) != 0) - return (rc); + return rc; /* * We rely on the PROM to initialize the frame buffer in the mode @@ -153,7 +153,7 @@ fb->bmv = diofb_mono_windowmove; diofb_fbsetup(fb); - return (0); + return 0; } int Index: src/sys/arch/hp300/dev/diofbreg.h diff -u src/sys/arch/hp300/dev/diofbreg.h:1.2 src/sys/arch/hp300/dev/diofbreg.h:1.3 --- src/sys/arch/hp300/dev/diofbreg.h:1.2 Sat Feb 12 05:08:40 2011 +++ src/sys/arch/hp300/dev/diofbreg.h Sat Feb 12 16:40:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: diofbreg.h,v 1.2 2011/02/12 05:08:40 tsutsui Exp $ */ +/* $NetBSD: diofbreg.h,v 1.3 2011/02/12 16:40:29 tsutsui Exp $ */ /* $OpenBSD: diofbreg.h,v 1.3 2007/01/07 15:13:52 miod Exp $ */ /* @@ -63,33 +63,33 @@ #ifndef _LOCORE struct diofbreg { - u_int8_t :8; - u_int8_t id; /* id and reset register 0x01 */ - u_int8_t sec_interrupt; /* secondary interrupt register 0x02 */ - u_int8_t interrupt; /* interrupt register 0x03 */ - u_int8_t :8; - u_int8_t fbwmsb; /* frame buffer width MSB 0x05 */ - u_int8_t :8; - u_int8_t fbwlsb; /* frame buffer height LSB 0x07 */ - u_int8_t :8; - u_int8_t fbhmsb; /* frame buffer height MSB 0x09 */ - u_int8_t :8; - u_int8_t fbhlsb; /* frame buffer height LSB 0x0b */ - u_int8_t :8; - u_int8_t dwmsb; /* display width MSB 0x0d */ - u_int8_t :8; - u_int8_t dwlsb; /* display width LSB 0x0f */ - u_int8_t :8; - u_int8_t dhmsb; /* display height MSB 0x11 */ - u_int8_t :8; - u_int8_t dhlsb; /* display height LSB 0x13 */ - u_int8_t :8; - u_int8_t fbid; /* frame buffer id 0x15 */ - u_int8_t pad2[0x45]; - u_int8_t num_planes; /* number of color planes 0x5b */ - u_int8_t :8; - u_int8_t fbomsb; /* frame buffer offset MSB 0x5d */ - u_int8_t :8; - u_int8_t fbolsb; /* frame buffer offset LSB 0x5f */ + uint8_t :8; + uint8_t id; /* id and reset register 0x01 */ + uint8_t sec_interrupt; /* secondary interrupt register 0x02 */ + uint8_t interrupt; /* interrupt register 0x03 */ + uint8_t :8; + uint8_t fbwmsb; /* frame buffer width MSB 0x05 */ + uint8_t :8; + uint8_t fbwlsb; /* frame buffer height LSB 0x07 */ + uint8_t :8; + uint8_t fbhmsb; /* frame buffer height MSB 0x09 */ + uint8_t :8; + uint8_t fbhlsb; /* frame buffer height LSB 0x0b */ + uint8_t :8; + uint8_t dwmsb; /* display width MSB 0x0d */ + uint8_t :8; + uint8_t dwlsb; /* display width LSB 0x0f */ + uint8_t :8; + uint8_t dhmsb; /* display height MSB 0x11 */ + uint8_t :8; + uint8_t dhlsb; /* display height LSB 0x13 */ + uint8_t :8; + uint8_t fbid; /* frame buffer id 0x15 */ + uint8_t pad2[0x45]; + uint8_t num_planes; /* number of color planes 0x5b */ + uint8_t :8; + uint8_t fbomsb; /* frame buffer offset MSB 0x5d */ + uint8_t :8; + uint8_t fbolsb; /* frame buffer offset LSB 0x5f */ }; #endif Index: src/sys/arch/hp300/dev/diofbvar.h diff -u src/sys/arch/hp300/dev/diofbvar.h:1.2 src/sys/arch/hp300/dev/diofbvar.h:1.3 --- src/sys/arch/hp300/dev/diofbvar.h:1.2 Sat Feb 12 05:08:40 2011 +++ src/sys/arch/hp300/dev/diofbvar.h Sat Feb 12 16:40:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: diofbvar.h,v 1.2 2011/02/12 05:08:40 tsutsui Exp $ */ +/* $NetBSD: diofbvar.h,v 1.3 2011/02/12 16:40:29 tsutsui Exp $ */ /* $OpenBSD: diofbvar.h,v 1.10 2006/08/11 18:33:13 miod Exp $ */ /* @@ -66,7 +66,7 @@ #ifdef _KERNEL struct diocmap { - u_int8_t r[256], g[256], b[256]; + uint8_t r[256], g[256], b[256]; }; /* @@ -103,8 +103,8 @@ u_int mapmode; /* blockmove routine */ - int (*bmv)(struct diofb *, u_int16_t, u_int16_t, u_int16_t, - u_int16_t, u_int16_t, u_int16_t, int16_t, int16_t); + int (*bmv)(struct diofb *, uint16_t, uint16_t, uint16_t, + uint16_t, uint16_t, uint16_t, int16_t, int16_t); }; /* Replacement Rules (rops) */ @@ -130,8 +130,8 @@ int diofb_show_screen(void *, void *, int, void (*)(void *, int, int), void *); -int diofb_mono_windowmove(struct diofb *, u_int16_t, u_int16_t, u_int16_t, - u_int16_t, u_int16_t, u_int16_t, int16_t, int16_t); +int diofb_mono_windowmove(struct diofb *, uint16_t, uint16_t, uint16_t, + uint16_t, uint16_t, uint16_t, int16_t, int16_t); /* Console support */ int dvboxcnattach(bus_space_tag_t, bus_addr_t, int);