diff options
Diffstat (limited to 'sys')
43 files changed, 956 insertions, 603 deletions
diff --git a/sys/arch/arm/s3c2xx0/s3c24x0_lcd.c b/sys/arch/arm/s3c2xx0/s3c24x0_lcd.c index b71c7ebea84..02fd926e028 100644 --- a/sys/arch/arm/s3c2xx0/s3c24x0_lcd.c +++ b/sys/arch/arm/s3c2xx0/s3c24x0_lcd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3c24x0_lcd.c,v 1.2 2009/01/05 20:37:16 jasper Exp $ */ +/* $OpenBSD: s3c24x0_lcd.c,v 1.3 2009/09/05 14:09:33 miod Exp $ */ /* $NetBSD: s3c24x0_lcd.c,v 1.6 2007/12/15 00:39:15 perry Exp $ */ /* @@ -706,48 +706,48 @@ s3c24x0_lcd_mapchar(void *cookie, int c, unsigned int *cp) return (* scr->rinfo.ri_ops.mapchar)(&scr->rinfo, c, cp); } -static void +static int s3c24x0_lcd_putchar(void *cookie, int row, int col, u_int uc, long attr) { struct s3c24x0_lcd_screen *scr = cookie; - (* scr->rinfo.ri_ops.putchar)(&scr->rinfo, + return (* scr->rinfo.ri_ops.putchar)(&scr->rinfo, row, col, uc, attr); } -static void +static int s3c24x0_lcd_copycols(void *cookie, int row, int src, int dst, int num) { struct s3c24x0_lcd_screen *scr = cookie; - (* scr->rinfo.ri_ops.copycols)(&scr->rinfo, + return (* scr->rinfo.ri_ops.copycols)(&scr->rinfo, row, src, dst, num); } -static void +static int s3c24x0_lcd_erasecols(void *cookie, int row, int col, int num, long attr) { struct s3c24x0_lcd_screen *scr = cookie; - (* scr->rinfo.ri_ops.erasecols)(&scr->rinfo, + return (* scr->rinfo.ri_ops.erasecols)(&scr->rinfo, row, col, num, attr); } -static void +static int s3c24x0_lcd_copyrows(void *cookie, int src, int dst, int num) { struct s3c24x0_lcd_screen *scr = cookie; - (* scr->rinfo.ri_ops.copyrows)(&scr->rinfo, + return (* scr->rinfo.ri_ops.copyrows)(&scr->rinfo, src, dst, num); } -static void +static int s3c24x0_lcd_eraserows(void *cookie, int row, int num, long attr) { struct s3c24x0_lcd_screen *scr = cookie; - (* scr->rinfo.ri_ops.eraserows)(&scr->rinfo, + return (* scr->rinfo.ri_ops.eraserows)(&scr->rinfo, row, num, attr); } diff --git a/sys/arch/hp300/dev/diofb.c b/sys/arch/hp300/dev/diofb.c index 908e1771c28..25ba07ce5d7 100644 --- a/sys/arch/hp300/dev/diofb.c +++ b/sys/arch/hp300/dev/diofb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diofb.c,v 1.16 2006/11/29 19:08:19 miod Exp $ */ +/* $OpenBSD: diofb.c,v 1.17 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -82,11 +82,11 @@ extern int rasops_alloc_cattr(void *, int, int, int, long *); int diofb_alloc_attr(void *, int, int, int, long *); -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); -void diofb_do_cursor(struct rasops_info *); +int diofb_copycols(void *, int, int, int, int); +int diofb_erasecols(void *, int, int, int, long); +int diofb_copyrows(void *, int, int, int); +int diofb_eraserows(void *, int, int, long); +int diofb_do_cursor(struct rasops_info *); /* * Frame buffer geometry initialization @@ -338,7 +338,7 @@ diofb_alloc_attr(void *cookie, int fg, int bg, int flg, long *attr) return (rasops_alloc_cattr(cookie, fg, bg, flg, attr)); } -void +int diofb_copycols(void *cookie, int row, int src, int dst, int n) { struct rasops_info *ri = cookie; @@ -352,9 +352,11 @@ diofb_copycols(void *cookie, int row, int src, int dst, int n) (*fb->bmv)(fb, ri->ri_xorigin + src, ri->ri_yorigin + row, ri->ri_xorigin + dst, ri->ri_yorigin + row, n, ri->ri_font->fontheight, RR_COPY, 0xff); + + return 0; } -void +int diofb_copyrows(void *cookie, int src, int dst, int n) { struct rasops_info *ri = cookie; @@ -367,9 +369,11 @@ diofb_copyrows(void *cookie, int src, int dst, int n) (*fb->bmv)(fb, ri->ri_xorigin, ri->ri_yorigin + src, ri->ri_xorigin, ri->ri_yorigin + dst, ri->ri_emuwidth, n, RR_COPY, 0xff); + + return 0; } -void +int diofb_erasecols(void *cookie, int row, int col, int num, long attr) { struct rasops_info *ri = cookie; @@ -390,9 +394,11 @@ diofb_erasecols(void *cookie, int row, int col, int num, long attr) if ((*fb->bmv)(fb, scol, srow, scol, srow, snum, ri->ri_font->fontheight, RR_CLEAR, 0xff ^ bg) != 0) rasops_erasecols(cookie, row, col, num, attr); + + return 0; } -void +int diofb_eraserows(void *cookie, int row, int num, long attr) { struct rasops_info *ri = cookie; @@ -415,9 +421,11 @@ diofb_eraserows(void *cookie, int row, int num, long attr) } if (rc != 0) rasops_eraserows(cookie, row, num, attr); + + return 0; } -void +int diofb_do_cursor(struct rasops_info *ri) { struct diofb *fb = ri->ri_hw; @@ -427,6 +435,8 @@ diofb_do_cursor(struct rasops_info *ri) y = ri->ri_crow * ri->ri_font->fontheight + ri->ri_yorigin; (*fb->bmv)(fb, x, y, x, y, ri->ri_font->fontwidth, ri->ri_font->fontheight, RR_INVERT, 0xff); + + return 0; } /* diff --git a/sys/arch/luna88k/dev/lunafb.c b/sys/arch/luna88k/dev/lunafb.c index 05c054d53f7..3e2c157b4b2 100644 --- a/sys/arch/luna88k/dev/lunafb.c +++ b/sys/arch/luna88k/dev/lunafb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lunafb.c,v 1.9 2008/06/26 05:42:11 ray Exp $ */ +/* $OpenBSD: lunafb.c,v 1.10 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: lunafb.c,v 1.7.6.1 2002/08/07 01:48:34 lukem Exp $ */ /*- @@ -106,12 +106,12 @@ struct om_hwdevconfig omfb_console_dc; void omfb_getdevconfig(paddr_t, struct om_hwdevconfig *); /* in omrasops.c */ -void om_cursor(void *, int, int, int); -void om_putchar(void *, int, int, u_int, long); -void om_copycols(void *, int, int, int, int); -void om_copyrows(void *, int, int, int num); -void om_erasecols(void *, int, int, int, long); -void om_eraserows(void *, int, int, long); +int om_cursor(void *, int, int, int); +int om_putchar(void *, int, int, u_int, long); +int om_copycols(void *, int, int, int, int); +int om_copyrows(void *, int, int, int num); +int om_erasecols(void *, int, int, int, long); +int om_eraserows(void *, int, int, long); struct wsscreen_descr omfb_stdscreen = { "std" diff --git a/sys/arch/luna88k/dev/omrasops.c b/sys/arch/luna88k/dev/omrasops.c index 9a457daace2..b62a36846be 100644 --- a/sys/arch/luna88k/dev/omrasops.c +++ b/sys/arch/luna88k/dev/omrasops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: omrasops.c,v 1.5 2008/06/26 05:42:11 ray Exp $ */ +/* $OpenBSD: omrasops.c,v 1.6 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: omrasops.c,v 1.1 2000/01/05 08:48:56 nisimura Exp $ */ /*- @@ -48,12 +48,12 @@ #include <dev/rasops/rasops.h> /* wscons emulator operations */ -void om_cursor(void *, int, int, int); -void om_putchar(void *, int, int, u_int, long); -void om_copycols(void *, int, int, int, int); -void om_copyrows(void *, int, int, int num); -void om_erasecols(void *, int, int, int, long); -void om_eraserows(void *, int, int, long); +int om_cursor(void *, int, int, int); +int om_putchar(void *, int, int, u_int, long); +int om_copycols(void *, int, int, int, int); +int om_copyrows(void *, int, int, int num); +int om_erasecols(void *, int, int, int, long); +int om_eraserows(void *, int, int, long); #define ALL1BITS (~0U) #define ALL0BITS (0U) @@ -67,7 +67,7 @@ void om_eraserows(void *, int, int, long); /* * Blit a character at the specified co-ordinates. */ -void +int om_putchar(cookie, row, startcol, uc, attr) void *cookie; int row, startcol; @@ -127,9 +127,11 @@ om_putchar(cookie, row, startcol, uc, attr) height--; } } + + return 0; } -void +int om_erasecols(cookie, row, startcol, ncols, attr) void *cookie; int row, startcol, ncols; @@ -179,9 +181,11 @@ om_erasecols(cookie, row, startcol, ncols, attr) height--; } } + + return 0; } -void +int om_eraserows(cookie, startrow, nrows, attr) void *cookie; int startrow, nrows; @@ -216,9 +220,11 @@ om_eraserows(cookie, startrow, nrows, attr) width = w; height--; } + + return 0; } -void +int om_copyrows(cookie, srcrow, dstrow, nrows) void *cookie; int srcrow, dstrow, nrows; @@ -257,9 +263,11 @@ om_copyrows(cookie, srcrow, dstrow, nrows) width = w; height--; } + + return 0; } -void +int om_copycols(cookie, startrow, srccol, dstcol, ncols) void *cookie; int startrow, srccol, dstcol, ncols; @@ -348,16 +356,18 @@ om_copycols(cookie, startrow, srccol, dstcol, ncols) height--; } } - return; + return 0; hardluckalignment: /* alignments painfully disagree */ + + return 0; } /* * Position|{enable|disable} the cursor at the specified location. */ -void +int om_cursor(cookie, on, row, col) void *cookie; int on, row, col; @@ -370,7 +380,7 @@ om_cursor(cookie, on, row, col) if (!on) { /* make sure it's on */ if ((ri->ri_flg & RI_CURSOR) == 0) - return; + return 0; row = ri->ri_crow; col = ri->ri_ccol; @@ -414,4 +424,6 @@ om_cursor(cookie, on, row, col) } } ri->ri_flg ^= RI_CURSOR; + + return 0; } diff --git a/sys/arch/sgi/dev/gbe.c b/sys/arch/sgi/dev/gbe.c index 734a36d027c..c60030b1c9d 100644 --- a/sys/arch/sgi/dev/gbe.c +++ b/sys/arch/sgi/dev/gbe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gbe.c,v 1.7 2009/02/24 14:37:29 jsing Exp $ */ +/* $OpenBSD: gbe.c,v 1.8 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Joel Sing <jsing@openbsd.org> @@ -136,12 +136,12 @@ void gbe_burner(void *, u_int, u_int); void gbe_rop(struct gbe_softc *, int, int, int, int, int); void gbe_copyrect(struct gbe_softc *, int, int, int, int, int, int, int); void gbe_fillrect(struct gbe_softc *, int, int, int, int, int); -void gbe_do_cursor(struct rasops_info *); -void gbe_putchar(void *, int, int, u_int, long); -void gbe_copycols(void *, int, int, int, int); -void gbe_erasecols(void *, int, int, int, long); -void gbe_copyrows(void *, int, int, int); -void gbe_eraserows(void *, int, int, long); +int gbe_do_cursor(struct rasops_info *); +int gbe_putchar(void *, int, int, u_int, long); +int gbe_copycols(void *, int, int, int, int); +int gbe_erasecols(void *, int, int, int, long); +int gbe_copyrows(void *, int, int, int); +int gbe_eraserows(void *, int, int, long); static struct gbe_screen gbe_consdata; static int gbe_console; @@ -1143,7 +1143,7 @@ gbe_fillrect(struct gbe_softc *gsc, int x, int y, int w, int h, int bg) ((x + w - 1) << 16) | ((y + h - 1) & 0xffff)); } -void +int gbe_do_cursor(struct rasops_info *ri) { struct gbe_softc *sc = ri->ri_hw; @@ -1155,9 +1155,11 @@ gbe_do_cursor(struct rasops_info *ri) y = ri->ri_yorigin + ri->ri_crow * h; gbe_rop(sc, x, y, w, h, LOGIC_OP_XOR); + + return 0; } -void +int gbe_putchar(void *cookie, int row, int col, u_int uc, long attr) { struct rasops_info *ri = cookie; @@ -1178,9 +1180,11 @@ gbe_putchar(void *cookie, int row, int col, u_int uc, long attr) screen->ro_curpos++; if ((screen->ro_curpos + 1) * w > screen->ri_tile.ri_width) screen->ro_curpos = 0; + + return 0; } -void +int gbe_copycols(void *cookie, int row, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -1194,9 +1198,11 @@ gbe_copycols(void *cookie, int row, int src, int dst, int num) gbe_copyrect(sc, BUF_TYPE_TLB_A, ri->ri_xorigin + src, ri->ri_yorigin + row, ri->ri_xorigin + dst, ri->ri_yorigin + row, num, ri->ri_font->fontheight); + + return 0; } -void +int gbe_erasecols(void *cookie, int row, int col, int num, long attr) { struct rasops_info *ri = cookie; @@ -1211,9 +1217,11 @@ gbe_erasecols(void *cookie, int row, int col, int num, long attr) gbe_fillrect(sc, ri->ri_xorigin + col, ri->ri_yorigin + row, num, ri->ri_font->fontheight, ri->ri_devcmap[bg]); + + return 0; } -void +int gbe_copyrows(void *cookie, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -1225,9 +1233,11 @@ gbe_copyrows(void *cookie, int src, int dst, int num) gbe_copyrect(sc, BUF_TYPE_TLB_A, ri->ri_xorigin, ri->ri_yorigin + src, ri->ri_xorigin, ri->ri_yorigin + dst, ri->ri_emuwidth, num); + + return 0; } -void +int gbe_eraserows(void *cookie, int row, int num, long attr) { struct rasops_info *ri = cookie; @@ -1248,6 +1258,8 @@ gbe_eraserows(void *cookie, int row, int num, long attr) } gbe_fillrect(sc, x, y, w, num, ri->ri_devcmap[bg]); + + return 0; } /* diff --git a/sys/arch/sparc/dev/cgsix.c b/sys/arch/sparc/dev/cgsix.c index 578aeae0a1b..b1f6849cc54 100644 --- a/sys/arch/sparc/dev/cgsix.c +++ b/sys/arch/sparc/dev/cgsix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgsix.c,v 1.40 2008/12/26 22:30:21 miod Exp $ */ +/* $OpenBSD: cgsix.c,v 1.41 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: cgsix.c,v 1.33 1997/08/07 19:12:30 pk Exp $ */ /* @@ -125,11 +125,11 @@ paddr_t cgsix_mmap(void *, off_t, int); void cgsix_reset(struct cgsix_softc *, u_int); void cgsix_setcolor(void *, u_int, u_int8_t, u_int8_t, u_int8_t); -void cgsix_ras_copyrows(void *, int, int, int); -void cgsix_ras_copycols(void *, int, int, int, int); -void cgsix_ras_do_cursor(struct rasops_info *); -void cgsix_ras_erasecols(void *, int, int, int, long); -void cgsix_ras_eraserows(void *, int, int, long); +int cgsix_ras_copyrows(void *, int, int, int); +int cgsix_ras_copycols(void *, int, int, int, int); +int cgsix_ras_do_cursor(struct rasops_info *); +int cgsix_ras_erasecols(void *, int, int, int, long); +int cgsix_ras_eraserows(void *, int, int, long); void cgsix_ras_init(struct cgsix_softc *); struct wsdisplay_accessops cgsix_accessops = { @@ -496,7 +496,7 @@ cgsix_ras_init(struct cgsix_softc *sc) sc->sc_fbc->fbc_mode = m; } -void +int cgsix_ras_copyrows(void *cookie, int src, int dst, int n) { struct rasops_info *ri = cookie; @@ -504,7 +504,7 @@ cgsix_ras_copyrows(void *cookie, int src, int dst, int n) volatile struct cgsix_fbc *fbc = sc->sc_fbc; if (dst == src) - return; + return 0; if (src < 0) { n += src; src = 0; @@ -518,7 +518,7 @@ cgsix_ras_copyrows(void *cookie, int src, int dst, int n) if (dst + n > ri->ri_rows) n = ri->ri_rows - dst; if (n <= 0) - return; + return 0; n *= ri->ri_font->fontheight; src *= ri->ri_font->fontheight; dst *= ri->ri_font->fontheight; @@ -542,9 +542,11 @@ cgsix_ras_copyrows(void *cookie, int src, int dst, int n) fbc->fbc_y3 = ri->ri_yorigin + dst + n - 1; CG6_BLIT_WAIT(fbc); CG6_DRAIN(fbc); + + return 0; } -void +int cgsix_ras_copycols(void *cookie, int row, int src, int dst, int n) { struct rasops_info *ri = cookie; @@ -552,9 +554,9 @@ cgsix_ras_copycols(void *cookie, int row, int src, int dst, int n) volatile struct cgsix_fbc *fbc = sc->sc_fbc; if (dst == src) - return; + return 0; if ((row < 0) || (row >= ri->ri_rows)) - return; + return 0; if (src < 0) { n += src; src = 0; @@ -568,7 +570,7 @@ cgsix_ras_copycols(void *cookie, int row, int src, int dst, int n) if (dst + n > ri->ri_cols) n = ri->ri_cols - dst; if (n <= 0) - return; + return 0; n *= ri->ri_font->fontwidth; src *= ri->ri_font->fontwidth; dst *= ri->ri_font->fontwidth; @@ -593,9 +595,11 @@ cgsix_ras_copycols(void *cookie, int row, int src, int dst, int n) fbc->fbc_y3 = ri->ri_yorigin + row + ri->ri_font->fontheight - 1; CG6_BLIT_WAIT(fbc); CG6_DRAIN(fbc); + + return 0; } -void +int cgsix_ras_erasecols(void *cookie, int row, int col, int n, long attr) { struct rasops_info *ri = cookie; @@ -604,7 +608,7 @@ cgsix_ras_erasecols(void *cookie, int row, int col, int n, long attr) int fg, bg; if ((row < 0) || (row >= ri->ri_rows)) - return; + return 0; if (col < 0) { n += col; col = 0; @@ -612,7 +616,7 @@ cgsix_ras_erasecols(void *cookie, int row, int col, int n, long attr) if (col + n > ri->ri_cols) n = ri->ri_cols - col; if (n <= 0) - return; + return 0; n *= ri->ri_font->fontwidth; col *= ri->ri_font->fontwidth; row *= ri->ri_font->fontheight; @@ -635,9 +639,11 @@ cgsix_ras_erasecols(void *cookie, int row, int col, int n, long attr) fbc->fbc_arectx = ri->ri_xorigin + col + n - 1; CG6_DRAW_WAIT(fbc); CG6_DRAIN(fbc); + + return 0; } -void +int cgsix_ras_eraserows(void *cookie, int row, int n, long attr) { struct rasops_info *ri = cookie; @@ -652,7 +658,7 @@ cgsix_ras_eraserows(void *cookie, int row, int n, long attr) if (row + n > ri->ri_rows) n = ri->ri_rows - row; if (n <= 0) - return; + return 0; ri->ri_ops.unpack_attr(cookie, attr, &fg, &bg, NULL); @@ -682,9 +688,11 @@ cgsix_ras_eraserows(void *cookie, int row, int n, long attr) } CG6_DRAW_WAIT(fbc); CG6_DRAIN(fbc); + + return 0; } -void +int cgsix_ras_do_cursor(struct rasops_info *ri) { struct cgsix_softc *sc = ri->ri_hw; @@ -708,4 +716,6 @@ cgsix_ras_do_cursor(struct rasops_info *ri) fbc->fbc_arectx = ri->ri_xorigin + col + ri->ri_font->fontwidth - 1; CG6_DRAW_WAIT(fbc); CG6_DRAIN(fbc); + + return 0; } diff --git a/sys/arch/sparc/dev/mgx.c b/sys/arch/sparc/dev/mgx.c index 4584cac7c13..aef375330c2 100644 --- a/sys/arch/sparc/dev/mgx.c +++ b/sys/arch/sparc/dev/mgx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mgx.c,v 1.15 2008/12/26 22:30:21 miod Exp $ */ +/* $OpenBSD: mgx.c,v 1.16 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. * All rights reserved. @@ -148,11 +148,11 @@ void mgx_loadcmap(struct mgx_softc *, int, int); int mgx_putcmap(u_int8_t *, struct wsdisplay_cmap *); void mgx_setcolor(void *, u_int, u_int8_t, u_int8_t, u_int8_t); -void mgx_ras_copycols(void *, int, int, int, int); -void mgx_ras_copyrows(void *, int, int, int); -void mgx_ras_do_cursor(struct rasops_info *); -void mgx_ras_erasecols(void *, int, int, int, long int); -void mgx_ras_eraserows(void *, int, int, long int); +int mgx_ras_copycols(void *, int, int, int, int); +int mgx_ras_copyrows(void *, int, int, int); +int mgx_ras_do_cursor(struct rasops_info *); +int mgx_ras_erasecols(void *, int, int, int, long int); +int mgx_ras_eraserows(void *, int, int, long int); void mgx_ras_init(struct mgx_softc *, uint); uint8_t mgx_read_1(vaddr_t, uint); @@ -620,7 +620,7 @@ mgx_ras_init(struct mgx_softc *sc, uint chipid) mgx_write_1(sc->sc_xreg, ATR_BYTEMASK, 0xff); } -void +int mgx_ras_copycols(void *v, int row, int src, int dst, int n) { struct rasops_info *ri = v; @@ -649,9 +649,11 @@ mgx_ras_copycols(void *v, int row, int src, int dst, int n) mgx_write_4(sc->sc_xreg, ATR_DST_XY, ATR_DUAL(row, dst)); mgx_write_4(sc->sc_xreg, ATR_WH, ATR_DUAL(ri->ri_font->fontheight, n)); mgx_wait_engine(sc); + + return 0; } -void +int mgx_ras_copyrows(void *v, int src, int dst, int n) { struct rasops_info *ri = v; @@ -678,9 +680,11 @@ mgx_ras_copyrows(void *v, int src, int dst, int n) mgx_write_4(sc->sc_xreg, ATR_DST_XY, ATR_DUAL(dst, ri->ri_xorigin)); mgx_write_4(sc->sc_xreg, ATR_WH, ATR_DUAL(n, ri->ri_emuwidth)); mgx_wait_engine(sc); + + return 0; } -void +int mgx_ras_erasecols(void *v, int row, int col, int n, long int attr) { struct rasops_info *ri = v; @@ -706,9 +710,11 @@ mgx_ras_erasecols(void *v, int row, int col, int n, long int attr) mgx_write_4(sc->sc_xreg, ATR_DST_XY, ATR_DUAL(row, col)); mgx_write_4(sc->sc_xreg, ATR_WH, ATR_DUAL(ri->ri_font->fontheight, n)); mgx_wait_engine(sc); + + return 0; } -void +int mgx_ras_eraserows(void *v, int row, int n, long int attr) { struct rasops_info *ri = v; @@ -739,9 +745,11 @@ mgx_ras_eraserows(void *v, int row, int n, long int attr) mgx_write_4(sc->sc_xreg, ATR_WH, ATR_DUAL(n, ri->ri_emuwidth)); } mgx_wait_engine(sc); + + return 0; } -void +int mgx_ras_do_cursor(struct rasops_info *ri) { struct mgx_softc *sc = ri->ri_hw; @@ -761,4 +769,6 @@ mgx_ras_do_cursor(struct rasops_info *ri) mgx_write_4(sc->sc_xreg, ATR_WH, ATR_DUAL(ri->ri_font->fontheight, ri->ri_font->fontwidth)); mgx_wait_engine(sc); + + return 0; } diff --git a/sys/arch/sparc/dev/p9000.c b/sys/arch/sparc/dev/p9000.c index c20dfcca05b..d8395f0abc1 100644 --- a/sys/arch/sparc/dev/p9000.c +++ b/sys/arch/sparc/dev/p9000.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p9000.c,v 1.22 2008/12/26 22:30:21 miod Exp $ */ +/* $OpenBSD: p9000.c,v 1.23 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. @@ -99,11 +99,11 @@ struct wsdisplay_accessops p9000_accessops = { NULL /* pollc */ }; -void p9000_ras_copycols(void *, int, int, int, int); -void p9000_ras_copyrows(void *, int, int, int); -void p9000_ras_do_cursor(struct rasops_info *); -void p9000_ras_erasecols(void *, int, int, int, long int); -void p9000_ras_eraserows(void *, int, int, long int); +int p9000_ras_copycols(void *, int, int, int, int); +int p9000_ras_copyrows(void *, int, int, int); +int p9000_ras_do_cursor(struct rasops_info *); +int p9000_ras_erasecols(void *, int, int, int, long int); +int p9000_ras_eraserows(void *, int, int, long int); void p9000_ras_init(struct p9000_softc *); int p9000match(struct device *, void *, void *); @@ -529,7 +529,7 @@ p9000_ras_init(struct p9000_softc *sc) P9000_COORDS(sc->sc_sunfb.sf_width - 1, sc->sc_sunfb.sf_height - 1)); } -void +int p9000_ras_copycols(void *v, int row, int src, int dst, int n) { struct rasops_info *ri = v; @@ -563,9 +563,11 @@ p9000_ras_copycols(void *v, int row, int src, int dst, int n) sc->sc_junk = P9000_READ_CMD(sc, P9000_PE_BLIT); p9000_drain(sc); + + return 0; } -void +int p9000_ras_copyrows(void *v, int src, int dst, int n) { struct rasops_info *ri = v; @@ -597,9 +599,11 @@ p9000_ras_copyrows(void *v, int src, int dst, int n) sc->sc_junk = P9000_READ_CMD(sc, P9000_PE_BLIT); p9000_drain(sc); + + return 0; } -void +int p9000_ras_erasecols(void *v, int row, int col, int n, long int attr) { struct rasops_info *ri = v; @@ -629,9 +633,11 @@ p9000_ras_erasecols(void *v, int row, int col, int n, long int attr) sc->sc_junk = P9000_READ_CMD(sc, P9000_PE_QUAD); p9000_drain(sc); + + return 0; } -void +int p9000_ras_eraserows(void *v, int row, int n, long int attr) { struct rasops_info *ri = v; @@ -666,9 +672,11 @@ p9000_ras_eraserows(void *v, int row, int n, long int attr) sc->sc_junk = P9000_READ_CMD(sc, P9000_PE_QUAD); p9000_drain(sc); + + return 0; } -void +int p9000_ras_do_cursor(struct rasops_info *ri) { struct p9000_softc *sc = ri->ri_hw; @@ -694,4 +702,6 @@ p9000_ras_do_cursor(struct rasops_info *ri) sc->sc_junk = P9000_READ_CMD(sc, P9000_PE_QUAD); p9000_drain(sc); + + return 0; } diff --git a/sys/arch/sparc/dev/p9100.c b/sys/arch/sparc/dev/p9100.c index 0303bce2221..24eb866cb39 100644 --- a/sys/arch/sparc/dev/p9100.c +++ b/sys/arch/sparc/dev/p9100.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p9100.c,v 1.48 2008/12/26 23:46:19 miod Exp $ */ +/* $OpenBSD: p9100.c,v 1.49 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2003, 2005, 2006, 2008, Miodrag Vallat. @@ -147,11 +147,11 @@ struct wsdisplay_accessops p9100_accessops = { NULL /* pollc */ }; -void p9100_ras_copycols(void *, int, int, int, int); -void p9100_ras_copyrows(void *, int, int, int); -void p9100_ras_do_cursor(struct rasops_info *); -void p9100_ras_erasecols(void *, int, int, int, long int); -void p9100_ras_eraserows(void *, int, int, long int); +int p9100_ras_copycols(void *, int, int, int, int); +int p9100_ras_copyrows(void *, int, int, int); +int p9100_ras_do_cursor(struct rasops_info *); +int p9100_ras_erasecols(void *, int, int, int, long int); +int p9100_ras_eraserows(void *, int, int, long int); void p9100_ras_init(struct p9100_softc *); int p9100match(struct device *, void *, void *); @@ -752,7 +752,7 @@ p9100_ras_init(struct p9100_softc *sc) P9000_COORDS(sc->sc_sunfb.sf_width - 1, sc->sc_sunfb.sf_height - 1)); } -void +int p9100_ras_copycols(void *v, int row, int src, int dst, int n) { struct rasops_info *ri = v; @@ -786,9 +786,11 @@ p9100_ras_copycols(void *v, int row, int src, int dst, int n) sc->sc_junk = P9100_READ_CMD(sc, P9000_PE_BLIT); p9100_drain(sc); + + return 0; } -void +int p9100_ras_copyrows(void *v, int src, int dst, int n) { struct rasops_info *ri = v; @@ -820,9 +822,11 @@ p9100_ras_copyrows(void *v, int src, int dst, int n) sc->sc_junk = P9100_READ_CMD(sc, P9000_PE_BLIT); p9100_drain(sc); + + return 0; } -void +int p9100_ras_erasecols(void *v, int row, int col, int n, long int attr) { struct rasops_info *ri = v; @@ -853,9 +857,11 @@ p9100_ras_erasecols(void *v, int row, int col, int n, long int attr) sc->sc_junk = P9100_READ_CMD(sc, P9000_PE_QUAD); p9100_drain(sc); + + return 0; } -void +int p9100_ras_eraserows(void *v, int row, int n, long int attr) { struct rasops_info *ri = v; @@ -891,9 +897,11 @@ p9100_ras_eraserows(void *v, int row, int n, long int attr) sc->sc_junk = P9100_READ_CMD(sc, P9000_PE_QUAD); p9100_drain(sc); + + return 0; } -void +int p9100_ras_do_cursor(struct rasops_info *ri) { struct p9100_softc *sc = ri->ri_hw; @@ -920,6 +928,8 @@ p9100_ras_do_cursor(struct rasops_info *ri) sc->sc_junk = P9100_READ_CMD(sc, P9000_PE_QUAD); p9100_drain(sc); + + return 0; } /* diff --git a/sys/arch/sparc/dev/tcx.c b/sys/arch/sparc/dev/tcx.c index 5cbf32027da..8c374b6c8a7 100644 --- a/sys/arch/sparc/dev/tcx.c +++ b/sys/arch/sparc/dev/tcx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcx.c,v 1.43 2008/12/26 22:30:21 miod Exp $ */ +/* $OpenBSD: tcx.c,v 1.44 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: tcx.c,v 1.8 1997/07/29 09:58:14 fair Exp $ */ /* @@ -99,25 +99,25 @@ struct tcx_softc { paddr_t sc_stipple; /* Stipple space PA */ paddr_t sc_blit; /* Blitter space PA */ int sc_blit_width; /* maximal blith width */ - void (*sc_plain_copycols)(void *, int, int, int, int); + int (*sc_plain_copycols)(void *, int, int, int, int); }; void tcx_accel_init(struct tcx_softc *, struct confargs *); void tcx_accel_plug(struct tcx_softc *, struct confargs *); void tcx_blit(struct tcx_softc *, uint32_t, uint32_t, int); void tcx_burner(void *, u_int, u_int); -void tcx_copyrows(void *, int, int, int); -void tcx_copycols(void *, int, int, int, int); -void tcx_do_cursor(struct rasops_info *); -void tcx_erasecols(void *, int, int, int, long); -void tcx_eraserows(void *, int, int, long); +int tcx_copyrows(void *, int, int, int); +int tcx_copycols(void *, int, int, int, int); +int tcx_do_cursor(struct rasops_info *); +int tcx_erasecols(void *, int, int, int, long); +int tcx_eraserows(void *, int, int, long); int tcx_intr(void *); int tcx_ioctl(void *, u_long, caddr_t, int, struct proc *); static __inline__ void tcx_loadcmap_deferred(struct tcx_softc *, u_int, u_int); paddr_t tcx_mmap(void *, off_t, int); void tcx_prom(void *); -void tcx_putchar(void *, int, int, u_int, long); +int tcx_putchar(void *, int, int, u_int, long); void tcx_reset(struct tcx_softc *, int); void tcx_s24_reset(struct tcx_softc *, int); void tcx_setcolor(void *, u_int, u_int8_t, u_int8_t, u_int8_t); @@ -660,7 +660,7 @@ tcx_accel_plug(struct tcx_softc *sc, struct confargs *ca) * to invoke it many times, and handle overlapping regions ourselves. */ -void +int tcx_copycols(void *cookie, int row, int src, int dst, int n) { struct rasops_info *ri = cookie; @@ -670,8 +670,7 @@ tcx_copycols(void *cookie, int row, int src, int dst, int n) if (dst > src && dst < src + n) { /* Areas overlap, do it the slow but safe way */ - (*sc->sc_plain_copycols)(cookie, row, src, dst, n); - return; + return (*sc->sc_plain_copycols)(cookie, row, src, dst, n); } /* Areas do not overlap dangerously, copy forwards */ @@ -692,9 +691,11 @@ tcx_copycols(void *cookie, int row, int src, int dst, int n) srcaddr += sc->sc_sunfb.sf_width; dstaddr += sc->sc_sunfb.sf_width; } + + return 0; } -void +int tcx_copyrows(void *cookie, int src, int dst, int n) { struct rasops_info *ri = cookie; @@ -733,6 +734,8 @@ tcx_copyrows(void *cookie, int src, int dst, int n) srcaddr += sc->sc_sunfb.sf_width; } } + + return 0; } /* @@ -823,7 +826,7 @@ tcx_stipple(struct tcx_softc *sc, int x, int y, int cnt, int rop, int bg) } } -void +int tcx_erasecols(void *cookie, int row, int col, int n, long attr) { struct rasops_info *ri = cookie; @@ -839,9 +842,11 @@ tcx_erasecols(void *cookie, int row, int col, int n, long attr) cury = ri->ri_yorigin + row * ri->ri_font->fontheight; for (h = ri->ri_font->fontheight; h != 0; cury++, h--) tcx_stipple(sc, sx, cury, n, GXcopy, bg); + + return 0; } -void +int tcx_eraserows(void *cookie, int row, int n, long attr) { struct rasops_info *ri = cookie; @@ -864,9 +869,11 @@ tcx_eraserows(void *cookie, int row, int n, long attr) for (; n != 0; y++, n--) tcx_stipple(sc, x, y, w, GXcopy, bg); + + return 0; } -void +int tcx_do_cursor(struct rasops_info *ri) { struct tcx_softc *sc = ri->ri_hw; @@ -877,9 +884,11 @@ tcx_do_cursor(struct rasops_info *ri) for (n = ri->ri_font->fontheight; n != 0; y++, n--) tcx_stipple(sc, x, y, ri->ri_font->fontwidth, GXinvert, 0xff); + + return 0; } -void +int tcx_putchar(void *cookie, int row, int col, u_int uc, long attr) { struct rasops_info *ri = cookie; @@ -994,4 +1003,6 @@ tcx_putchar(void *cookie, int row, int col, u_int uc, long attr) soffs += sc->sc_sunfb.sf_width << 3; } } + + return 0; } diff --git a/sys/arch/sparc/dev/zx.c b/sys/arch/sparc/dev/zx.c index 89770094a8f..1627474f2ff 100644 --- a/sys/arch/sparc/dev/zx.c +++ b/sys/arch/sparc/dev/zx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zx.c,v 1.22 2008/12/26 22:30:21 miod Exp $ */ +/* $OpenBSD: zx.c,v 1.23 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: zx.c,v 1.5 2002/10/02 16:52:46 thorpej Exp $ */ /* @@ -160,12 +160,12 @@ void zx_fillrect(struct rasops_info *, int, int, int, int, long, int); int zx_intr(void *); int zx_putcmap(struct zx_softc *); -void zx_copycols(void *, int, int, int, int); -void zx_copyrows(void *, int, int, int); -void zx_do_cursor(struct rasops_info *); -void zx_erasecols(void *, int, int, int, long); -void zx_eraserows(void *, int, int, long); -void zx_putchar(void *, int, int, u_int, long); +int zx_copycols(void *, int, int, int, int); +int zx_copyrows(void *, int, int, int); +int zx_do_cursor(struct rasops_info *); +int zx_erasecols(void *, int, int, int, long); +int zx_eraserows(void *, int, int, long); +int zx_putchar(void *, int, int, u_int, long); struct cfattach zx_ca = { sizeof(struct zx_softc), zx_match, zx_attach @@ -614,16 +614,18 @@ zx_copyrect(struct rasops_info *ri, int sx, int sy, int dx, int dy, int w, SETREG(zc->zc_copy, ZX_COORDS(dx, dy)); } -void +int zx_do_cursor(struct rasops_info *ri) { zx_fillrect(ri, ri->ri_ccol, ri->ri_crow, 1, 1, WSCOL_BLACK << 16, ZX_ROP_NEW_XOR_OLD | ZX_ATTR_WE_ENABLE | ZX_ATTR_OE_ENABLE | ZX_ATTR_FORCE_WID); + + return 0; } -void +int zx_erasecols(void *cookie, int row, int col, int num, long attr) { struct rasops_info *ri; @@ -631,9 +633,11 @@ zx_erasecols(void *cookie, int row, int col, int num, long attr) ri = (struct rasops_info *)cookie; zx_fillrect(ri, col, row, num, 1, attr, ZX_STD_ROP); + + return 0; } -void +int zx_eraserows(void *cookie, int row, int num, long attr) { struct rasops_info *ri; @@ -661,9 +665,11 @@ zx_eraserows(void *cookie, int row, int num, long attr) SETREG(zc->zc_fill, ZX_COORDS(0, 0) | ZX_EXTENT_DIR_BACKWARDS); } else zx_fillrect(ri, 0, row, ri->ri_cols, num, attr, ZX_STD_ROP); + + return 0; } -void +int zx_copyrows(void *cookie, int src, int dst, int num) { struct rasops_info *ri; @@ -671,9 +677,11 @@ zx_copyrows(void *cookie, int src, int dst, int num) ri = (struct rasops_info *)cookie; zx_copyrect(ri, 0, src, 0, dst, ri->ri_cols, num); + + return 0; } -void +int zx_copycols(void *cookie, int row, int src, int dst, int num) { struct rasops_info *ri; @@ -681,9 +689,11 @@ zx_copycols(void *cookie, int row, int src, int dst, int num) ri = (struct rasops_info *)cookie; zx_copyrect(ri, src, row, dst, row, num, 1); + + return 0; } -void +int zx_putchar(void *cookie, int row, int col, u_int uc, long attr) { struct rasops_info *ri; @@ -707,7 +717,7 @@ zx_putchar(void *cookie, int row, int col, u_int uc, long attr) if (uc == ' ') { zx_fillrect(ri, col, row, 1, 1, attr, ZX_STD_ROP); if (ul == 0) - return; + return 0; dp += font->fontheight << ZX_WWIDTH; @@ -755,6 +765,8 @@ zx_putchar(void *cookie, int row, int col, u_int uc, long attr) dp -= 2 << ZX_WWIDTH; *dp = 0xffffffff; } + + return 0; } void diff --git a/sys/arch/sparc64/dev/creator.c b/sys/arch/sparc64/dev/creator.c index 079926f817c..52593ea6a03 100644 --- a/sys/arch/sparc64/dev/creator.c +++ b/sys/arch/sparc64/dev/creator.c @@ -1,4 +1,4 @@ -/* $OpenBSD: creator.c,v 1.41 2009/07/16 21:03:09 kettenis Exp $ */ +/* $OpenBSD: creator.c,v 1.42 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -53,9 +53,9 @@ paddr_t creator_mmap(void *, off_t, int); void creator_ras_fifo_wait(struct creator_softc *, int); void creator_ras_wait(struct creator_softc *); void creator_ras_init(struct creator_softc *); -void creator_ras_copyrows(void *, int, int, int); -void creator_ras_erasecols(void *, int, int, int, long int); -void creator_ras_eraserows(void *, int, int, long int); +int creator_ras_copyrows(void *, int, int, int); +int creator_ras_erasecols(void *, int, int, int, long int); +int creator_ras_eraserows(void *, int, int, long int); void creator_ras_fill(struct creator_softc *); void creator_ras_setfg(struct creator_softc *, int32_t); int creator_setcursor(struct creator_softc *, struct wsdisplay_cursor *); @@ -578,7 +578,7 @@ creator_ras_init(sc) creator_ras_wait(sc); } -void +int creator_ras_eraserows(cookie, row, n, attr) void *cookie; int row, n; @@ -595,7 +595,7 @@ creator_ras_eraserows(cookie, row, n, attr) if (row + n > ri->ri_rows) n = ri->ri_rows - row; if (n <= 0) - return; + return 0; ri->ri_ops.unpack_attr(cookie, attr, &fg, &bg, NULL); creator_ras_fill(sc); @@ -614,9 +614,11 @@ creator_ras_eraserows(cookie, row, n, attr) FBC_WRITE(sc, FFB_FBC_BW, ri->ri_emuwidth); } creator_ras_wait(sc); + + return 0; } -void +int creator_ras_erasecols(cookie, row, col, n, attr) void *cookie; int row, col, n; @@ -627,7 +629,7 @@ creator_ras_erasecols(cookie, row, col, n, attr) int fg, bg; if ((row < 0) || (row >= ri->ri_rows)) - return; + return 0; if (col < 0) { n += col; col = 0; @@ -635,7 +637,7 @@ creator_ras_erasecols(cookie, row, col, n, attr) if (col + n > ri->ri_cols) n = ri->ri_cols - col; if (n <= 0) - return; + return 0; n *= ri->ri_font->fontwidth; col *= ri->ri_font->fontwidth; row *= ri->ri_font->fontheight; @@ -649,6 +651,8 @@ creator_ras_erasecols(cookie, row, col, n, attr) FBC_WRITE(sc, FFB_FBC_BH, ri->ri_font->fontheight); FBC_WRITE(sc, FFB_FBC_BW, n - 1); creator_ras_wait(sc); + + return 0; } void @@ -661,7 +665,7 @@ creator_ras_fill(sc) creator_ras_wait(sc); } -void +int creator_ras_copyrows(cookie, src, dst, n) void *cookie; int src, dst, n; @@ -670,7 +674,7 @@ creator_ras_copyrows(cookie, src, dst, n) struct creator_softc *sc = ri->ri_hw; if (dst == src) - return; + return 0; if (src < 0) { n += src; src = 0; @@ -684,7 +688,7 @@ creator_ras_copyrows(cookie, src, dst, n) if ((dst + n) > ri->ri_rows) n = ri->ri_rows - dst; if (n <= 0) - return; + return 0; n *= ri->ri_font->fontheight; src *= ri->ri_font->fontheight; dst *= ri->ri_font->fontheight; @@ -699,6 +703,8 @@ creator_ras_copyrows(cookie, src, dst, n) FBC_WRITE(sc, FFB_FBC_BH, n); FBC_WRITE(sc, FFB_FBC_BW, ri->ri_emuwidth); creator_ras_wait(sc); + + return 0; } void diff --git a/sys/arch/sparc64/dev/gfxp.c b/sys/arch/sparc64/dev/gfxp.c index 88ee6b44448..b3b36741d02 100644 --- a/sys/arch/sparc64/dev/gfxp.c +++ b/sys/arch/sparc64/dev/gfxp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gfxp.c,v 1.10 2009/06/28 13:40:51 kettenis Exp $ */ +/* $OpenBSD: gfxp.c,v 1.11 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2009 Mark Kettenis. @@ -155,10 +155,10 @@ int gfxp_getcmap(struct gfxp_softc *, struct wsdisplay_cmap *); int gfxp_putcmap(struct gfxp_softc *, struct wsdisplay_cmap *); void gfxp_setcolor(void *, u_int, u_int8_t, u_int8_t, u_int8_t); -void gfxp_copycols(void *, int, int, int, int); -void gfxp_erasecols(void *, int, int, int, long); -void gfxp_copyrows(void *, int, int, int); -void gfxp_eraserows(void *, int, int, long); +int gfxp_copycols(void *, int, int, int, int); +int gfxp_erasecols(void *, int, int, int, long); +int gfxp_copyrows(void *, int, int, int); +int gfxp_eraserows(void *, int, int, long); void gfxp_init(struct gfxp_softc *); void gfxp_reinit(struct gfxp_softc *); @@ -456,7 +456,7 @@ gfxp_setcolor(void *v, u_int index, u_int8_t r, u_int8_t g, u_int8_t b) * Accelerated routines. */ -void +int gfxp_copycols(void *cookie, int row, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -470,9 +470,11 @@ gfxp_copycols(void *cookie, int row, int src, int dst, int num) gfxp_copyrect(sc, ri->ri_xorigin + src, ri->ri_yorigin + row, ri->ri_xorigin + dst, ri->ri_yorigin + row, num, ri->ri_font->fontheight); + + return 0; } -void +int gfxp_erasecols(void *cookie, int row, int col, int num, long attr) { struct rasops_info *ri = cookie; @@ -487,9 +489,11 @@ gfxp_erasecols(void *cookie, int row, int col, int num, long attr) gfxp_fillrect(sc, ri->ri_xorigin + col, ri->ri_yorigin + row, num, ri->ri_font->fontheight, ri->ri_devcmap[bg]); + + return 0; } -void +int gfxp_copyrows(void *cookie, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -501,9 +505,11 @@ gfxp_copyrows(void *cookie, int src, int dst, int num) gfxp_copyrect(sc, ri->ri_xorigin, ri->ri_yorigin + src, ri->ri_xorigin, ri->ri_yorigin + dst, ri->ri_emuwidth, num); + + return 0; } -void +int gfxp_eraserows(void *cookie, int row, int num, long attr) { struct rasops_info *ri = cookie; @@ -524,6 +530,8 @@ gfxp_eraserows(void *cookie, int row, int num, long attr) w = ri->ri_emuwidth; } gfxp_fillrect(sc, x, y, w, num, ri->ri_devcmap[bg]); + + return 0; } void diff --git a/sys/arch/sparc64/dev/ifb.c b/sys/arch/sparc64/dev/ifb.c index 64b50550afa..55d63488411 100644 --- a/sys/arch/sparc64/dev/ifb.c +++ b/sys/arch/sparc64/dev/ifb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifb.c,v 1.17 2009/06/27 22:43:41 miod Exp $ */ +/* $OpenBSD: ifb.c,v 1.18 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Miodrag Vallat. @@ -338,19 +338,19 @@ void ifb_rop_ifb(void *, int, int, int, int, int, int, uint32_t, int32_t); void ifb_rop_jfb(void *, int, int, int, int, int, int, uint32_t, int32_t); int ifb_rop_wait(struct ifb_softc *); -void ifb_putchar_dumb(void *, int, int, u_int, long); -void ifb_copycols_dumb(void *, int, int, int, int); -void ifb_erasecols_dumb(void *, int, int, int, long); -void ifb_copyrows_dumb(void *, int, int, int); -void ifb_eraserows_dumb(void *, int, int, long); -void ifb_do_cursor_dumb(struct rasops_info *); +int ifb_putchar_dumb(void *, int, int, u_int, long); +int ifb_copycols_dumb(void *, int, int, int, int); +int ifb_erasecols_dumb(void *, int, int, int, long); +int ifb_copyrows_dumb(void *, int, int, int); +int ifb_eraserows_dumb(void *, int, int, long); +int ifb_do_cursor_dumb(struct rasops_info *); -void ifb_putchar(void *, int, int, u_int, long); -void ifb_copycols(void *, int, int, int, int); -void ifb_erasecols(void *, int, int, int, long); -void ifb_copyrows(void *, int, int, int); -void ifb_eraserows(void *, int, int, long); -void ifb_do_cursor(struct rasops_info *); +int ifb_putchar(void *, int, int, u_int, long); +int ifb_copycols(void *, int, int, int, int); +int ifb_erasecols(void *, int, int, int, long); +int ifb_copyrows(void *, int, int, int); +int ifb_eraserows(void *, int, int, long); +int ifb_do_cursor(struct rasops_info *); int ifbmatch(struct device *parent, void *cf, void *aux) @@ -845,7 +845,7 @@ ifb_mapregs(struct ifb_softc *sc, struct pci_attach_args *pa) * Non accelerated routines. */ -void +int ifb_putchar_dumb(void *cookie, int row, int col, u_int uc, long attr) { struct rasops_info *ri = cookie; @@ -855,9 +855,11 @@ ifb_putchar_dumb(void *cookie, int row, int col, u_int uc, long attr) sc->sc_old_ops.putchar(cookie, row, col, uc, attr); ri->ri_bits = (void *)sc->sc_fb8bank1_vaddr; sc->sc_old_ops.putchar(cookie, row, col, uc, attr); + + return 0; } -void +int ifb_copycols_dumb(void *cookie, int row, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -867,9 +869,11 @@ ifb_copycols_dumb(void *cookie, int row, int src, int dst, int num) sc->sc_old_ops.copycols(cookie, row, src, dst, num); ri->ri_bits = (void *)sc->sc_fb8bank1_vaddr; sc->sc_old_ops.copycols(cookie, row, src, dst, num); + + return 0; } -void +int ifb_erasecols_dumb(void *cookie, int row, int col, int num, long attr) { struct rasops_info *ri = cookie; @@ -879,9 +883,11 @@ ifb_erasecols_dumb(void *cookie, int row, int col, int num, long attr) sc->sc_old_ops.erasecols(cookie, row, col, num, attr); ri->ri_bits = (void *)sc->sc_fb8bank1_vaddr; sc->sc_old_ops.erasecols(cookie, row, col, num, attr); + + return 0; } -void +int ifb_copyrows_dumb(void *cookie, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -891,9 +897,11 @@ ifb_copyrows_dumb(void *cookie, int src, int dst, int num) sc->sc_old_ops.copyrows(cookie, src, dst, num); ri->ri_bits = (void *)sc->sc_fb8bank1_vaddr; sc->sc_old_ops.copyrows(cookie, src, dst, num); + + return 0; } -void +int ifb_eraserows_dumb(void *cookie, int row, int num, long attr) { struct rasops_info *ri = cookie; @@ -903,13 +911,15 @@ ifb_eraserows_dumb(void *cookie, int row, int num, long attr) sc->sc_old_ops.eraserows(cookie, row, num, attr); ri->ri_bits = (void *)sc->sc_fb8bank1_vaddr; sc->sc_old_ops.eraserows(cookie, row, num, attr); + + return 0; } /* Similar to rasops_do_cursor(), but using a 7bit pixel mask. */ #define CURSOR_MASK 0x7f7f7f7f -void +int ifb_do_cursor_dumb(struct rasops_info *ri) { struct ifb_softc *sc = ri->ri_hw; @@ -982,13 +992,15 @@ ifb_do_cursor_dumb(struct rasops_info *ri) } } } + + return 0; } /* * Accelerated routines. */ -void +int ifb_copycols(void *cookie, int row, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -1002,9 +1014,11 @@ ifb_copycols(void *cookie, int row, int src, int dst, int num) ifb_copyrect(sc, ri->ri_xorigin + src, ri->ri_yorigin + row, ri->ri_xorigin + dst, ri->ri_yorigin + row, num, ri->ri_font->fontheight); + + return 0; } -void +int ifb_erasecols(void *cookie, int row, int col, int num, long attr) { struct rasops_info *ri = cookie; @@ -1019,9 +1033,11 @@ ifb_erasecols(void *cookie, int row, int col, int num, long attr) ifb_fillrect(sc, ri->ri_xorigin + col, ri->ri_yorigin + row, num, ri->ri_font->fontheight, ri->ri_devcmap[bg]); + + return 0; } -void +int ifb_copyrows(void *cookie, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -1033,9 +1049,11 @@ ifb_copyrows(void *cookie, int src, int dst, int num) ifb_copyrect(sc, ri->ri_xorigin, ri->ri_yorigin + src, ri->ri_xorigin, ri->ri_yorigin + dst, ri->ri_emuwidth, num); + + return 0; } -void +int ifb_eraserows(void *cookie, int row, int num, long attr) { struct rasops_info *ri = cookie; @@ -1056,6 +1074,8 @@ ifb_eraserows(void *cookie, int row, int num, long attr) w = ri->ri_emuwidth; } ifb_fillrect(sc, x, y, w, num, ri->ri_devcmap[bg]); + + return 0; } void @@ -1207,7 +1227,7 @@ ifb_rop_wait(struct ifb_softc *sc) return i; } -void +int ifb_do_cursor(struct rasops_info *ri) { struct ifb_softc *sc = ri->ri_hw; @@ -1219,4 +1239,6 @@ ifb_do_cursor(struct rasops_info *ri) ifb_rop(sc, x, y, x, y, ri->ri_font->fontwidth, ri->ri_font->fontheight, IFB_ROP_XOR, IFB_PIXELMASK); ifb_rop_wait(sc); + + return 0; } diff --git a/sys/arch/sparc64/dev/machfb.c b/sys/arch/sparc64/dev/machfb.c index 61dac6d2a2e..c27fd99041f 100644 --- a/sys/arch/sparc64/dev/machfb.c +++ b/sys/arch/sparc64/dev/machfb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machfb.c,v 1.5 2009/06/05 19:16:08 kettenis Exp $ */ +/* $OpenBSD: machfb.c,v 1.6 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2009 Mark Kettenis. @@ -222,10 +222,10 @@ int machfb_getcmap(struct machfb_softc *, struct wsdisplay_cmap *); int machfb_putcmap(struct machfb_softc *, struct wsdisplay_cmap *); void machfb_setcolor(void *, u_int, u_int8_t, u_int8_t, u_int8_t); -void machfb_copycols(void *, int, int, int, int); -void machfb_erasecols(void *, int, int, int, long); -void machfb_copyrows(void *, int, int, int); -void machfb_eraserows(void *, int, int, long); +int machfb_copycols(void *, int, int, int, int); +int machfb_erasecols(void *, int, int, int, long); +int machfb_copyrows(void *, int, int, int); +int machfb_eraserows(void *, int, int, long); void machfb_init(struct machfb_softc *); int machfb_wait_fifo(struct machfb_softc *, int); @@ -514,7 +514,7 @@ machfb_setcolor(void *v, u_int index, u_int8_t r, u_int8_t g, u_int8_t b) * Accelerated routines. */ -void +int machfb_copycols(void *cookie, int row, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -528,9 +528,11 @@ machfb_copycols(void *cookie, int row, int src, int dst, int num) machfb_copyrect(sc, ri->ri_xorigin + src, ri->ri_yorigin + row, ri->ri_xorigin + dst, ri->ri_yorigin + row, num, ri->ri_font->fontheight); + + return 0; } -void +int machfb_erasecols(void *cookie, int row, int col, int num, long attr) { struct rasops_info *ri = cookie; @@ -545,9 +547,11 @@ machfb_erasecols(void *cookie, int row, int col, int num, long attr) machfb_fillrect(sc, ri->ri_xorigin + col, ri->ri_yorigin + row, num, ri->ri_font->fontheight, ri->ri_devcmap[bg]); + + return 0; } -void +int machfb_copyrows(void *cookie, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -559,9 +563,11 @@ machfb_copyrows(void *cookie, int src, int dst, int num) machfb_copyrect(sc, ri->ri_xorigin, ri->ri_yorigin + src, ri->ri_xorigin, ri->ri_yorigin + dst, ri->ri_emuwidth, num); + + return 0; } -void +int machfb_eraserows(void *cookie, int row, int num, long attr) { struct rasops_info *ri = cookie; @@ -582,6 +588,8 @@ machfb_eraserows(void *cookie, int row, int num, long attr) w = ri->ri_emuwidth; } machfb_fillrect(sc, x, y, w, num, ri->ri_devcmap[bg]); + + return 0; } void diff --git a/sys/arch/sparc64/dev/pcons.c b/sys/arch/sparc64/dev/pcons.c index 94405952402..9f738e358bc 100644 --- a/sys/arch/sparc64/dev/pcons.c +++ b/sys/arch/sparc64/dev/pcons.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcons.c,v 1.13 2007/11/14 20:43:12 kettenis Exp $ */ +/* $OpenBSD: pcons.c,v 1.14 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: pcons.c,v 1.7 2001/05/02 10:32:20 scw Exp $ */ /*- @@ -559,7 +559,7 @@ void pcons_free_screen(void *, void *); int pcons_ioctl(void *, u_long, caddr_t, int, struct proc *); int pcons_mapchar(void *, int, unsigned int *); paddr_t pcons_mmap(void *, off_t, int); -void pcons_putchar(void *, int, int, u_int, long); +int pcons_putchar(void *, int, int, u_int, long); int pcons_show_screen(void *, void *, int, void (*)(void *, int, int), void *); @@ -664,7 +664,7 @@ pcons_mapchar(void *v, int uc, unsigned int *idx) } } -void +int pcons_putchar(void *v, int row, int col, u_int uc, long attr) { u_char buf[1]; @@ -674,6 +674,8 @@ pcons_putchar(void *v, int row, int col, u_int uc, long attr) s = splhigh(); OF_write(stdout, &buf, 1); splx(s); + + return 0; } void diff --git a/sys/arch/sparc64/dev/radeonfb.c b/sys/arch/sparc64/dev/radeonfb.c index 94056d17117..935c99191bf 100644 --- a/sys/arch/sparc64/dev/radeonfb.c +++ b/sys/arch/sparc64/dev/radeonfb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radeonfb.c,v 1.1 2009/07/05 17:13:25 kettenis Exp $ */ +/* $OpenBSD: radeonfb.c,v 1.2 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2009 Mark Kettenis. @@ -149,10 +149,10 @@ int radeonfb_getcmap(struct radeonfb_softc *, struct wsdisplay_cmap *); int radeonfb_putcmap(struct radeonfb_softc *, struct wsdisplay_cmap *); void radeonfb_setcolor(void *, u_int, u_int8_t, u_int8_t, u_int8_t); -void radeonfb_copycols(void *, int, int, int, int); -void radeonfb_erasecols(void *, int, int, int, long); -void radeonfb_copyrows(void *, int, int, int); -void radeonfb_eraserows(void *, int, int, long); +int radeonfb_copycols(void *, int, int, int, int); +int radeonfb_erasecols(void *, int, int, int, long); +int radeonfb_copyrows(void *, int, int, int); +int radeonfb_eraserows(void *, int, int, long); void radeonfb_wait_fifo(struct radeonfb_softc *, int); void radeonfb_wait(struct radeonfb_softc *); @@ -463,7 +463,7 @@ radeonfb_setcolor(void *v, u_int index, u_int8_t r, u_int8_t g, u_int8_t b) * Accelerated routines. */ -void +int radeonfb_copycols(void *cookie, int row, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -477,9 +477,11 @@ radeonfb_copycols(void *cookie, int row, int src, int dst, int num) radeonfb_copyrect(sc, ri->ri_xorigin + src, ri->ri_yorigin + row, ri->ri_xorigin + dst, ri->ri_yorigin + row, num, ri->ri_font->fontheight); + + return 0; } -void +int radeonfb_erasecols(void *cookie, int row, int col, int num, long attr) { struct rasops_info *ri = cookie; @@ -494,9 +496,11 @@ radeonfb_erasecols(void *cookie, int row, int col, int num, long attr) radeonfb_fillrect(sc, ri->ri_xorigin + col, ri->ri_yorigin + row, num, ri->ri_font->fontheight, ri->ri_devcmap[bg]); + + return 0; } -void +int radeonfb_copyrows(void *cookie, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -508,9 +512,11 @@ radeonfb_copyrows(void *cookie, int src, int dst, int num) radeonfb_copyrect(sc, ri->ri_xorigin, ri->ri_yorigin + src, ri->ri_xorigin, ri->ri_yorigin + dst, ri->ri_emuwidth, num); + + return 0; } -void +int radeonfb_eraserows(void *cookie, int row, int num, long attr) { struct rasops_info *ri = cookie; @@ -531,6 +537,8 @@ radeonfb_eraserows(void *cookie, int row, int num, long attr) w = ri->ri_emuwidth; } radeonfb_fillrect(sc, x, y, w, num, ri->ri_devcmap[bg]); + + return 0; } void diff --git a/sys/arch/sparc64/dev/raptor.c b/sys/arch/sparc64/dev/raptor.c index 9bc2e31751d..834c3aa1428 100644 --- a/sys/arch/sparc64/dev/raptor.c +++ b/sys/arch/sparc64/dev/raptor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raptor.c,v 1.5 2009/03/12 19:10:22 kettenis Exp $ */ +/* $OpenBSD: raptor.c,v 1.6 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2009 Mark Kettenis. @@ -161,10 +161,10 @@ int raptor_getcmap(struct raptor_softc *, struct wsdisplay_cmap *); int raptor_putcmap(struct raptor_softc *, struct wsdisplay_cmap *); void raptor_setcolor(void *, u_int, u_int8_t, u_int8_t, u_int8_t); -void raptor_copycols(void *, int, int, int, int); -void raptor_erasecols(void *, int, int, int, long); -void raptor_copyrows(void *, int, int, int); -void raptor_eraserows(void *, int, int, long); +int raptor_copycols(void *, int, int, int, int); +int raptor_erasecols(void *, int, int, int, long); +int raptor_copyrows(void *, int, int, int); +int raptor_eraserows(void *, int, int, long); void raptor_init(struct raptor_softc *); int raptor_wait(struct raptor_softc *); @@ -428,7 +428,7 @@ raptor_setcolor(void *v, u_int index, u_int8_t r, u_int8_t g, u_int8_t b) * Accelerated routines. */ -void +int raptor_copycols(void *cookie, int row, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -442,9 +442,11 @@ raptor_copycols(void *cookie, int row, int src, int dst, int num) raptor_copyrect(sc, ri->ri_xorigin + src, ri->ri_yorigin + row, ri->ri_xorigin + dst, ri->ri_yorigin + row, num, ri->ri_font->fontheight); + + return 0; } -void +int raptor_erasecols(void *cookie, int row, int col, int num, long attr) { struct rasops_info *ri = cookie; @@ -459,9 +461,11 @@ raptor_erasecols(void *cookie, int row, int col, int num, long attr) raptor_fillrect(sc, ri->ri_xorigin + col, ri->ri_yorigin + row, num, ri->ri_font->fontheight, ri->ri_devcmap[bg]); + + return 0; } -void +int raptor_copyrows(void *cookie, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -473,9 +477,11 @@ raptor_copyrows(void *cookie, int src, int dst, int num) raptor_copyrect(sc, ri->ri_xorigin, ri->ri_yorigin + src, ri->ri_xorigin, ri->ri_yorigin + dst, ri->ri_emuwidth, num); + + return 0; } -void +int raptor_eraserows(void *cookie, int row, int num, long attr) { struct rasops_info *ri = cookie; @@ -496,6 +502,8 @@ raptor_eraserows(void *cookie, int row, int num, long attr) w = ri->ri_emuwidth; } raptor_fillrect(sc, x, y, w, num, ri->ri_devcmap[bg]); + + return 0; } void diff --git a/sys/arch/vax/mbus/legss.c b/sys/arch/vax/mbus/legss.c index b111e21a98e..2d8c2d178b2 100644 --- a/sys/arch/vax/mbus/legss.c +++ b/sys/arch/vax/mbus/legss.c @@ -1,4 +1,4 @@ -/* $OpenBSD: legss.c,v 1.3 2008/08/24 20:10:57 miod Exp $ */ +/* $OpenBSD: legss.c,v 1.4 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2008 Miodrag Vallat. @@ -163,12 +163,12 @@ const struct wsdisplay_accessops legss_accessops = { int legss_setup_screen(struct legss_screen *); void legss_clear_screen(struct legss_screen *); -void legss_copycols(void *, int, int, int, int); -void legss_copyrows(void *, int, int, int); -void legss_do_cursor(struct rasops_info *); -void legss_erasecols(void *, int, int, int, long); -void legss_eraserows(void *, int, int, long); -void legss_putchar(void *, int, int, u_int, long); +int legss_copycols(void *, int, int, int, int); +int legss_copyrows(void *, int, int, int); +int legss_do_cursor(struct rasops_info *); +int legss_erasecols(void *, int, int, int, long); +int legss_eraserows(void *, int, int, long); +int legss_putchar(void *, int, int, u_int, long); u_int legss_probe_depth(vaddr_t); @@ -488,7 +488,7 @@ legsscninit() * wsdisplay emulops */ -void +int legss_putchar(void *v, int row, int col, u_int uc, long attr) { struct rasops_info *ri = v; @@ -545,9 +545,11 @@ legss_putchar(void *v, int row, int col, u_int uc, long attr) rp++; } } + + return 0; } -void +int legss_copycols(void *v, int row, int src, int dst, int num) { struct rasops_info *ri = v; @@ -589,9 +591,11 @@ legss_copycols(void *v, int row, int src, int dst, int num) sp += ri->ri_stride; } } + + return 0; } -void +int legss_erasecols(void *v, int row, int col, int num, long attr) { struct rasops_info *ri = v; @@ -613,9 +617,11 @@ legss_erasecols(void *v, int row, int col, int num, long attr) dp++; } } + + return 0; } -void +int legss_copyrows(void *v, int src, int dst, int num) { struct rasops_info *ri = v; @@ -651,9 +657,11 @@ legss_copyrows(void *v, int src, int dst, int num) sp += 1 << 2; } } + + return 0; } -void +int legss_eraserows(void *v, int row, int num, long attr) { struct rasops_info *ri = v; @@ -675,9 +683,11 @@ legss_eraserows(void *v, int row, int num, long attr) DELTA(dp, delta, int32_t *); } + + return 0; } -void +int legss_do_cursor(struct rasops_info *ri) { struct wsdisplay_font *font = ri->ri_font; @@ -699,6 +709,8 @@ legss_do_cursor(struct rasops_info *ri) dp += 4; } } + + return 0; } /* Clear the whole screen */ diff --git a/sys/arch/vax/vsa/gpx.c b/sys/arch/vax/vsa/gpx.c index b1bf27bdb0e..39d5e8f94b6 100644 --- a/sys/arch/vax/vsa/gpx.c +++ b/sys/arch/vax/vsa/gpx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gpx.c,v 1.20 2008/12/21 21:39:50 miod Exp $ */ +/* $OpenBSD: gpx.c,v 1.21 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2006 Miodrag Vallat. * @@ -220,12 +220,12 @@ void gpx_upload_font(struct gpx_screen *); int gpx_viper_write(struct gpx_screen *, u_int, u_int16_t); int gpx_wait(struct gpx_screen *, int); -void gpx_copycols(void *, int, int, int, int); -void gpx_copyrows(void *, int, int, int); -void gpx_do_cursor(struct rasops_info *); -void gpx_erasecols(void *, int, int, int, long); -void gpx_eraserows(void *, int, int, long); -void gpx_putchar(void *, int, int, u_int, long); +int gpx_copycols(void *, int, int, int, int); +int gpx_copyrows(void *, int, int, int); +int gpx_do_cursor(struct rasops_info *); +int gpx_erasecols(void *, int, int, int, long); +int gpx_eraserows(void *, int, int, long); +int gpx_putchar(void *, int, int, u_int, long); /* * Autoconf glue @@ -507,7 +507,7 @@ gpx_burner(void *v, u_int on, u_int flags) * wsdisplay emulops */ -void +int gpx_putchar(void *v, int row, int col, u_int uc, long attr) { struct rasops_info *ri = v; @@ -560,9 +560,11 @@ gpx_putchar(void *v, int row, int col, u_int uc, long attr) gpx_fillrect(ss, dx, dy + font->fontheight - 2, font->fontwidth, 1, attr, LF_R3); /* fg fill */ } + + return 0; } -void +int gpx_copycols(void *v, int row, int src, int dst, int cnt) { struct rasops_info *ri = v; @@ -577,9 +579,11 @@ gpx_copycols(void *v, int row, int src, int dst, int cnt) h = font->fontheight; gpx_copyrect(ss, sx, y, dx, y, w, h); + + return 0; } -void +int gpx_erasecols(void *v, int row, int col, int cnt, long attr) { struct rasops_info *ri = v; @@ -593,9 +597,11 @@ gpx_erasecols(void *v, int row, int col, int cnt, long attr) dy = font->fontheight; gpx_fillrect(ss, x, y, dx, dy, attr, LF_R2); /* bg fill */ + + return 0; } -void +int gpx_copyrows(void *v, int src, int dst, int cnt) { struct rasops_info *ri = v; @@ -610,9 +616,11 @@ gpx_copyrows(void *v, int src, int dst, int cnt) h = cnt * font->fontheight; gpx_copyrect(ss, x, sy, x, dy, w, h); + + return 0; } -void +int gpx_eraserows(void *v, int row, int cnt, long attr) { struct rasops_info *ri = v; @@ -626,9 +634,11 @@ gpx_eraserows(void *v, int row, int cnt, long attr) dy = cnt * font->fontheight; gpx_fillrect(ss, x, y, dx, dy, attr, LF_R2); /* bg fill */ + + return 0; } -void +int gpx_do_cursor(struct rasops_info *ri) { struct gpx_screen *ss = ri->ri_hw; @@ -640,6 +650,8 @@ gpx_do_cursor(struct rasops_info *ri) h = ri->ri_font->fontheight; gpx_fillrect(ss, x, y, w, h, WSCOL_WHITE << 24, LF_R4); /* invert */ + + return 0; } /* diff --git a/sys/arch/vax/vsa/smg.c b/sys/arch/vax/vsa/smg.c index 319c35ce394..27d50a88095 100644 --- a/sys/arch/vax/vsa/smg.c +++ b/sys/arch/vax/vsa/smg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smg.c,v 1.22 2008/12/21 21:39:50 miod Exp $ */ +/* $OpenBSD: smg.c,v 1.23 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: smg.c,v 1.21 2000/03/23 06:46:44 thorpej Exp $ */ /* * Copyright (c) 2006, Miodrag Vallat @@ -195,8 +195,8 @@ const struct wsdisplay_accessops smg_accessops = { void smg_blockmove(struct rasops_info *, u_int, u_int, u_int, u_int, u_int, int); -void smg_copycols(void *, int, int, int, int); -void smg_erasecols(void *, int, int, int, long); +int smg_copycols(void *, int, int, int, int); +int smg_erasecols(void *, int, int, int, long); int smg_getcursor(struct smg_screen *, struct wsdisplay_cursor *); int smg_setup_screen(struct smg_screen *); @@ -775,7 +775,7 @@ smg_blockmove(struct rasops_info *ri, u_int sx, u_int y, u_int dx, u_int cx, } } -void +int smg_copycols(void *cookie, int row, int src, int dst, int n) { struct rasops_info *ri = cookie; @@ -787,9 +787,11 @@ smg_copycols(void *cookie, int row, int src, int dst, int n) smg_blockmove(ri, src, row, dst, n, ri->ri_font->fontheight, RR_COPY); + + return 0; } -void +int smg_erasecols(void *cookie, int row, int col, int num, long attr) { struct rasops_info *ri = cookie; @@ -803,6 +805,8 @@ smg_erasecols(void *cookie, int row, int col, int num, long attr) smg_blockmove(ri, col, row, col, num, ri->ri_font->fontheight, bg == 0 ? RR_CLEAR : RR_SET); + + return 0; } /* diff --git a/sys/dev/ic/pcdisplay_subr.c b/sys/dev/ic/pcdisplay_subr.c index 8eefcb84a4f..4b8ad5f68cd 100644 --- a/sys/dev/ic/pcdisplay_subr.c +++ b/sys/dev/ic/pcdisplay_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcdisplay_subr.c,v 1.7 2006/11/29 19:11:15 miod Exp $ */ +/* $OpenBSD: pcdisplay_subr.c,v 1.8 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: pcdisplay_subr.c,v 1.16 2000/06/08 07:01:19 cgd Exp $ */ /* @@ -83,7 +83,7 @@ pcdisplay_cursor_init(scr, existing) scr->cursoron = 1; } -void +int pcdisplay_cursor(id, on, row, col) void *id; int on, row, col; @@ -108,7 +108,7 @@ pcdisplay_cursor(id, on, row, col) scr->vc_ccol = col; if ((scr->cursoron = on) == 0) - return; + return 0; off = (scr->vc_crow * scr->type->ncols + scr->vc_ccol); if (scr->active) { @@ -119,6 +119,8 @@ pcdisplay_cursor(id, on, row, col) scr->cursortmp = scr->mem[off]; scr->mem[off] = scr->cursortmp ^ 0x7700; } + + return 0; #else /* PCDISPLAY_SOFTCURSOR */ struct pcdisplayscreen *scr = id; int pos; @@ -137,6 +139,8 @@ pcdisplay_cursor(id, on, row, col) pcdisplay_6845_write(scr->hdl, cursorh, pos >> 8); pcdisplay_6845_write(scr->hdl, cursorl, pos); } + + return 0; #endif /* PCDISPLAY_SOFTCURSOR */ } @@ -153,7 +157,7 @@ pcdisplay_mapchar_simple(id, uni) } #endif -void +int pcdisplay_putchar(id, row, col, c, attr) void *id; int row, col; @@ -172,6 +176,8 @@ pcdisplay_putchar(id, row, col, c, attr) c | (attr << 8)); else scr->mem[off] = c | (attr << 8); + + return 0; } int @@ -201,7 +207,7 @@ pcdisplay_getchar(id, row, col, cell) return (0); } -void +int pcdisplay_copycols(id, row, srccol, dstcol, ncols) void *id; int row, srccol, dstcol, ncols; @@ -222,9 +228,11 @@ pcdisplay_copycols(id, row, srccol, dstcol, ncols) ncols); else bcopy(&scr->mem[srcoff], &scr->mem[dstoff], ncols * 2); + + return 0; } -void +int pcdisplay_erasecols(id, row, startcol, ncols, fillattr) void *id; int row, startcol, ncols; @@ -247,9 +255,11 @@ pcdisplay_erasecols(id, row, startcol, ncols, fillattr) else for (i = 0; i < ncols; i++) scr->mem[off + i] = val; + + return 0; } -void +int pcdisplay_copyrows(id, srcrow, dstrow, nrows) void *id; int srcrow, dstrow, nrows; @@ -271,9 +281,11 @@ pcdisplay_copyrows(id, srcrow, dstrow, nrows) else bcopy(&scr->mem[srcoff], &scr->mem[dstoff], nrows * ncols * 2); + + return 0; } -void +int pcdisplay_eraserows(id, startrow, nrows, fillattr) void *id; int startrow, nrows; @@ -296,4 +308,6 @@ pcdisplay_eraserows(id, startrow, nrows, fillattr) else for (n = 0; n < count; n++) scr->mem[off + n] = val; + + return 0; } diff --git a/sys/dev/ic/pcdisplayvar.h b/sys/dev/ic/pcdisplayvar.h index 8c07f33d13a..e888919a04b 100644 --- a/sys/dev/ic/pcdisplayvar.h +++ b/sys/dev/ic/pcdisplayvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcdisplayvar.h,v 1.9 2007/02/11 20:29:22 miod Exp $ */ +/* $OpenBSD: pcdisplayvar.h,v 1.10 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: pcdisplayvar.h,v 1.8 2000/01/25 02:44:03 ad Exp $ */ /* @@ -79,15 +79,15 @@ static inline void _pcdisplay_6845_write(ph, reg, val) void pcdisplay_cursor_init(struct pcdisplayscreen *, int); void pcdisplay_cursor_reset(struct pcdisplayscreen *); -void pcdisplay_cursor(void *, int, int, int); +int pcdisplay_cursor(void *, int, int, int); #if 0 unsigned int pcdisplay_mapchar_simple(void *, int); #endif -int pcdisplay_mapchar(void *, int, unsigned int *); -void pcdisplay_putchar(void *, int, int, u_int, long); +int pcdisplay_mapchar(void *, int, unsigned int *); +int pcdisplay_putchar(void *, int, int, u_int, long); struct wsdisplay_charcell; int pcdisplay_getchar(void *, int, int, struct wsdisplay_charcell *); -void pcdisplay_copycols(void *, int, int, int,int); -void pcdisplay_erasecols(void *, int, int, int, long); -void pcdisplay_copyrows(void *, int, int, int); -void pcdisplay_eraserows(void *, int, int, long); +int pcdisplay_copycols(void *, int, int, int,int); +int pcdisplay_erasecols(void *, int, int, int, long); +int pcdisplay_copyrows(void *, int, int, int); +int pcdisplay_eraserows(void *, int, int, long); diff --git a/sys/dev/ic/sti.c b/sys/dev/ic/sti.c index a3e377ba00e..c4f292ec311 100644 --- a/sys/dev/ic/sti.c +++ b/sys/dev/ic/sti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sti.c,v 1.60 2009/02/06 22:51:04 miod Exp $ */ +/* $OpenBSD: sti.c,v 1.61 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2000-2003 Michael Shalayeff @@ -54,13 +54,13 @@ struct cfdriver sti_cd = { }; int sti_alloc_attr(void *, int, int, int, long *); -void sti_copycols(void *, int, int, int, int); -void sti_copyrows(void *, int, int, int); -void sti_cursor(void *, int, int, int); -void sti_erasecols(void *, int, int, int, long); -void sti_eraserows(void *, int, int, long); +int sti_copycols(void *, int, int, int, int); +int sti_copyrows(void *, int, int, int); +int sti_cursor(void *, int, int, int); +int sti_erasecols(void *, int, int, int, long); +int sti_eraserows(void *, int, int, long); int sti_mapchar(void *, int, u_int *); -void sti_putchar(void *, int, int, u_int, long); +int sti_putchar(void *, int, int, u_int, long); void sti_unpack_attr(void *, long, int *, int *, int *); struct wsdisplay_emulops sti_emulops = { @@ -1119,7 +1119,7 @@ sti_show_screen(void *v, void *cookie, int waitok, * wsdisplay emulops */ -void +int sti_cursor(void *v, int on, int row, int col) { struct sti_screen *scr = (struct sti_screen *)v; @@ -1129,6 +1129,8 @@ sti_cursor(void *v, int on, int row, int col) col * fp->width, row * fp->height, col * fp->width, row * fp->height, fp->height, fp->width, bmf_invert); + + return 0; } /* @@ -1187,7 +1189,7 @@ sti_mapchar(void *v, int uni, u_int *index) return (5); } -void +int sti_putchar(void *v, int row, int col, u_int uc, long attr) { struct sti_screen *scr = (struct sti_screen *)v; @@ -1244,9 +1246,11 @@ sti_putchar(void *v, int row, int col, u_int uc, long attr) (*rom->blkmv)(&a.flags, &a.in, &a.out, &scr->scr_cfg); } + + return 0; } -void +int sti_copycols(void *v, int row, int srccol, int dstcol, int ncols) { struct sti_screen *scr = (struct sti_screen *)v; @@ -1256,9 +1260,11 @@ sti_copycols(void *v, int row, int srccol, int dstcol, int ncols) srccol * fp->width, row * fp->height, dstcol * fp->width, row * fp->height, fp->height, ncols * fp->width, bmf_copy); + + return 0; } -void +int sti_erasecols(void *v, int row, int startcol, int ncols, long attr) { struct sti_screen *scr = (struct sti_screen *)v; @@ -1268,9 +1274,11 @@ sti_erasecols(void *v, int row, int startcol, int ncols, long attr) startcol * fp->width, row * fp->height, startcol * fp->width, row * fp->height, fp->height, ncols * fp->width, bmf_clear); + + return 0; } -void +int sti_copyrows(void *v, int srcrow, int dstrow, int nrows) { struct sti_screen *scr = (struct sti_screen *)v; @@ -1278,9 +1286,11 @@ sti_copyrows(void *v, int srcrow, int dstrow, int nrows) sti_bmove(scr, 0, srcrow * fp->height, 0, dstrow * fp->height, nrows * fp->height, scr->scr_cfg.scr_width, bmf_copy); + + return 0; } -void +int sti_eraserows(void *v, int srcrow, int nrows, long attr) { struct sti_screen *scr = (struct sti_screen *)v; @@ -1288,6 +1298,8 @@ sti_eraserows(void *v, int srcrow, int nrows, long attr) sti_bmove(scr, 0, srcrow * fp->height, 0, srcrow * fp->height, nrows * fp->height, scr->scr_cfg.scr_width, bmf_clear); + + return 0; } int diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c index a7565f7aa11..f351b216f9b 100644 --- a/sys/dev/ic/vga.c +++ b/sys/dev/ic/vga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga.c,v 1.51 2009/08/12 15:58:30 miod Exp $ */ +/* $OpenBSD: vga.c,v 1.52 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: vga.c,v 1.28.2.1 2000/06/30 16:27:47 simonb Exp $ */ /*- @@ -123,9 +123,9 @@ void vga_init(struct vga_config *, bus_space_tag_t, bus_space_tag_t); void vga_setfont(struct vga_config *, struct vgascreen *); int vga_mapchar(void *, int, unsigned int *); -void vga_putchar(void *, int, int, u_int, long); +int vga_putchar(void *, int, int, u_int, long); int vga_alloc_attr(void *, int, int, int, long *); -void vga_copyrows(void *, int, int, int); +int vga_copyrows(void *, int, int, int); void vga_unpack_attr(void *, long, int *, int *, int *); int displaysubmatch(struct device *, void *, void *); @@ -1067,7 +1067,7 @@ vga_unpack_attr(id, attr, fg, bg, ul) *fg += 8; } -void +int vga_copyrows(id, srcrow, dstrow, nrows) void *id; int srcrow, dstrow, nrows; @@ -1086,6 +1086,7 @@ vga_copyrows(id, srcrow, dstrow, nrows) #ifdef PCDISPLAY_SOFTCURSOR int cursoron = scr->pcs.cursoron; + /* NOTE this assumes pcdisplay_cursor() never fails */ if (cursoron) pcdisplay_cursor(&scr->pcs, 0, scr->pcs.vc_crow, scr->pcs.vc_ccol); @@ -1108,6 +1109,7 @@ vga_copyrows(id, srcrow, dstrow, nrows) vga_6845_write(&scr->cfg->hdl, startadrl, scr->pcs.dispoffset >> 1); #ifdef PCDISPLAY_SOFTCURSOR + /* NOTE this assumes pcdisplay_cursor() never fails */ if (cursoron) pcdisplay_cursor(&scr->pcs, 1, scr->pcs.vc_crow, scr->pcs.vc_ccol); @@ -1121,6 +1123,8 @@ vga_copyrows(id, srcrow, dstrow, nrows) } else bcopy(&scr->pcs.mem[srcoff], &scr->pcs.mem[dstoff], nrows * ncols * 2); + + return 0; } #ifdef WSCONS_SUPPORT_PCVTFONTS @@ -1322,7 +1326,7 @@ vga_mapchar(id, uni, index) return (res1); } -void +int vga_putchar(c, row, col, uc, attr) void *c; int row; @@ -1335,7 +1339,7 @@ vga_putchar(c, row, col, uc, attr) if (scr->pcs.visibleoffset != scr->pcs.dispoffset) vga_scrollback(scr->cfg, scr, 0); - pcdisplay_putchar(c, row, col, uc, attr); + return pcdisplay_putchar(c, row, col, uc, attr); } void diff --git a/sys/dev/isa/ega.c b/sys/dev/isa/ega.c index 2790cb02c52..4338661533a 100644 --- a/sys/dev/isa/ega.c +++ b/sys/dev/isa/ega.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ega.c,v 1.14 2009/08/12 15:58:31 miod Exp $ */ +/* $OpenBSD: ega.c,v 1.15 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: ega.c,v 1.4.4.1 2000/06/30 16:27:47 simonb Exp $ */ /* @@ -113,7 +113,7 @@ static void ega_init(struct ega_config *, static void ega_setfont(struct ega_config *, struct egascreen *); static int ega_alloc_attr(void *, int, int, int, long *); static void ega_unpack_attr(void *, long, int *, int *, int *); -void ega_copyrows(void *, int, int, int); +int ega_copyrows(void *, int, int, int); struct cfattach ega_ca = { sizeof(struct ega_softc), ega_match, ega_attach, @@ -925,7 +925,7 @@ ega_unpack_attr(id, attr, fg, bg, ul) *fg += 8; } -void +int ega_copyrows(id, srcrow, dstrow, nrows) void *id; int srcrow, dstrow, nrows; @@ -977,4 +977,6 @@ ega_copyrows(id, srcrow, dstrow, nrows) } else bcopy(&scr->pcs.mem[srcoff], &scr->pcs.mem[dstoff], nrows * ncols * 2); + + return 0; } diff --git a/sys/dev/pci/tga.c b/sys/dev/pci/tga.c index 881e013eed7..f07b9b1459f 100644 --- a/sys/dev/pci/tga.c +++ b/sys/dev/pci/tga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tga.c,v 1.32 2009/07/26 18:48:55 miod Exp $ */ +/* $OpenBSD: tga.c,v 1.33 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: tga.c,v 1.40 2002/03/13 15:05:18 ad Exp $ */ /* @@ -88,8 +88,8 @@ struct tga_devconfig tga_console_dc; int tga_ioctl(void *, u_long, caddr_t, int, struct proc *); paddr_t tga_mmap(void *, off_t, int); -void tga_copyrows(void *, int, int, int); -void tga_copycols(void *, int, int, int, int); +int tga_copyrows(void *, int, int, int); +int tga_copycols(void *, int, int, int, int); int tga_alloc_screen(void *, const struct wsscreen_descr *, void **, int *, int *, long *); void tga_free_screen(void *, void *); @@ -100,9 +100,9 @@ int tga_rop(struct rasops_info *, int, int, int, int, struct rasops_info *, int, int); int tga_rop_vtov(struct rasops_info *, int, int, int, int, struct rasops_info *, int, int ); -void tga_putchar(void *c, int row, int col, u_int uc, long attr); -void tga_eraserows(void *, int, int, long); -void tga_erasecols(void *, int, int, int, long); +int tga_putchar(void *c, int row, int col, u_int uc, long attr); +int tga_eraserows(void *, int, int, long); +int tga_erasecols(void *, int, int, int, long); void tga2_init(struct tga_devconfig *); void tga_config_interrupts(struct device *); @@ -984,7 +984,7 @@ tga_builtin_get_curmax(dc, curposp) /* * Copy columns (characters) in a row (line). */ -void +int tga_copycols(id, row, srccol, dstcol, ncols) void *id; int row, srccol, dstcol, ncols; @@ -998,12 +998,14 @@ tga_copycols(id, row, srccol, dstcol, ncols) nx = ri->ri_font->fontwidth * ncols; tga_rop(ri, dstx, y, nx, ri->ri_font->fontheight, ri, srcx, y); + + return 0; } /* * Copy rows (lines). */ -void +int tga_copyrows(id, srcrow, dstrow, nrows) void *id; int srcrow, dstrow, nrows; @@ -1016,6 +1018,8 @@ tga_copyrows(id, srcrow, dstrow, nrows) ny = ri->ri_font->fontheight * nrows; tga_rop(ri, 0, dsty, ri->ri_emuwidth, ny, ri, 0, srcy); + + return 0; } /* @@ -1247,7 +1251,7 @@ tga_rop_vtov(dst, dx, dy, w, h, src, sx, sy) } -void +int tga_putchar(c, row, col, uc, attr) void *c; int row, col; @@ -1311,9 +1315,11 @@ tga_putchar(c, row, col, uc, attr) /* Set grapics mode back to normal. */ TGAWREG(dc, TGA_REG_GMOR, 0); TGAWREG(dc, TGA_REG_GPXR_P, 0xffffffff); + + return 0; } -void +int tga_eraserows(c, row, num, attr) void *c; int row, num; @@ -1367,9 +1373,10 @@ tga_eraserows(c, row, num, attr) /* Set grapics mode back to normal. */ TGAWREG(dc, TGA_REG_GMOR, 0); + return 0; } -void +int tga_erasecols (c, row, col, num, attr) void *c; int row, col, num; @@ -1422,6 +1429,8 @@ tga_erasecols (c, row, col, num, attr) /* Set grapics mode back to normal. */ TGAWREG(dc, TGA_REG_GMOR, 0); + + return 0; } diff --git a/sys/dev/pcmcia/cfxga.c b/sys/dev/pcmcia/cfxga.c index 970505e9bab..3f21d10688c 100644 --- a/sys/dev/pcmcia/cfxga.c +++ b/sys/dev/pcmcia/cfxga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cfxga.c,v 1.17 2008/11/22 11:35:58 deraadt Exp $ */ +/* $OpenBSD: cfxga.c,v 1.18 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2005, 2006, Matthieu Herrb and Miodrag Vallat @@ -140,12 +140,12 @@ struct cfxga_screen { struct wsdisplay_charcell *scr_mem; /* backing memory */ }; -void cfxga_copycols(void *, int, int, int, int); -void cfxga_copyrows(void *, int, int, int); -void cfxga_do_cursor(struct rasops_info *); -void cfxga_erasecols(void *, int, int, int, long); -void cfxga_eraserows(void *, int, int, long); -void cfxga_putchar(void *, int, int, u_int, long); +int cfxga_copycols(void *, int, int, int, int); +int cfxga_copyrows(void *, int, int, int); +int cfxga_do_cursor(struct rasops_info *); +int cfxga_erasecols(void *, int, int, int, long); +int cfxga_eraserows(void *, int, int, long); +int cfxga_putchar(void *, int, int, u_int, long); int cfxga_install_function(struct pcmcia_function *); void cfxga_remove_function(struct pcmcia_function *); @@ -1047,7 +1047,7 @@ cfxga_standalone_rop(struct cfxga_screen *scr, u_int rop, int sx, int sy, * by only storing actual character cell values (a la mda). */ -void +int cfxga_copycols(void *cookie, int row, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -1060,17 +1060,17 @@ cfxga_copycols(void *cookie, int row, int src, int dst, int num) num * sizeof(struct wsdisplay_charcell)); if (scr != scr->scr_sc->sc_active) - return; + return 0; sx = src * ri->ri_font->fontwidth + ri->ri_xorigin; dx = dst * ri->ri_font->fontwidth + ri->ri_xorigin; y = row * ri->ri_font->fontheight + ri->ri_yorigin; cx = num * ri->ri_font->fontwidth; cy = ri->ri_font->fontheight; - cfxga_standalone_rop(scr, ROP_SRC, sx, y, dx, y, cx, cy); + return cfxga_standalone_rop(scr, ROP_SRC, sx, y, dx, y, cx, cy); } -void +int cfxga_copyrows(void *cookie, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -1083,34 +1083,34 @@ cfxga_copyrows(void *cookie, int src, int dst, int num) num * ri->ri_cols * sizeof(struct wsdisplay_charcell)); if (scr != scr->scr_sc->sc_active) - return; + return 0; x = ri->ri_xorigin; sy = src * ri->ri_font->fontheight + ri->ri_yorigin; dy = dst * ri->ri_font->fontheight + ri->ri_yorigin; cx = ri->ri_emuwidth; cy = num * ri->ri_font->fontheight; - cfxga_standalone_rop(scr, ROP_SRC, x, sy, x, dy, cx, cy); + return cfxga_standalone_rop(scr, ROP_SRC, x, sy, x, dy, cx, cy); } -void +int cfxga_do_cursor(struct rasops_info *ri) { struct cfxga_screen *scr = ri->ri_hw; int x, y, cx, cy; if (scr != scr->scr_sc->sc_active) - return; + return 0; x = ri->ri_ccol * ri->ri_font->fontwidth + ri->ri_xorigin; y = ri->ri_crow * ri->ri_font->fontheight + ri->ri_yorigin; cx = ri->ri_font->fontwidth; cy = ri->ri_font->fontheight; - cfxga_standalone_rop(scr, ROP_ONES ^ ROP_SRC /* i.e. not SRC */, + return cfxga_standalone_rop(scr, ROP_ONES ^ ROP_SRC /* i.e. not SRC */, x, y, x, y, cx, cy); } -void +int cfxga_erasecols(void *cookie, int row, int col, int num, long attr) { struct rasops_info *ri = cookie; @@ -1125,17 +1125,17 @@ cfxga_erasecols(void *cookie, int row, int col, int num, long attr) } if (scr != scr->scr_sc->sc_active) - return; + return 0; ri->ri_ops.unpack_attr(cookie, attr, &fg, &bg, NULL); x = col * ri->ri_font->fontwidth + ri->ri_xorigin; y = row * ri->ri_font->fontheight + ri->ri_yorigin; cx = num * ri->ri_font->fontwidth; cy = ri->ri_font->fontheight; - cfxga_solid_fill(scr, x, y, cx, cy, ri->ri_devcmap[bg]); + return cfxga_solid_fill(scr, x, y, cx, cy, ri->ri_devcmap[bg]); } -void +int cfxga_eraserows(void *cookie, int row, int num, long attr) { struct rasops_info *ri = cookie; @@ -1154,17 +1154,17 @@ cfxga_eraserows(void *cookie, int row, int num, long attr) ri->ri_cols * sizeof(struct wsdisplay_charcell)); if (scr != scr->scr_sc->sc_active) - return; + return 0; ri->ri_ops.unpack_attr(cookie, attr, &fg, &bg, NULL); x = ri->ri_xorigin; y = row * ri->ri_font->fontheight + ri->ri_yorigin; cx = ri->ri_emuwidth; cy = num * ri->ri_font->fontheight; - cfxga_solid_fill(scr, x, y, cx, cy, ri->ri_devcmap[bg]); + return cfxga_solid_fill(scr, x, y, cx, cy, ri->ri_devcmap[bg]); } -void +int cfxga_putchar(void *cookie, int row, int col, u_int uc, long attr) { struct rasops_info *ri = cookie; @@ -1175,7 +1175,7 @@ cfxga_putchar(void *cookie, int row, int col, u_int uc, long attr) scr->scr_mem[row * ri->ri_cols + col].attr = attr; if (scr != scr->scr_sc->sc_active) - return; + return 0; x = col * ri->ri_font->fontwidth + ri->ri_xorigin; y = row * ri->ri_font->fontheight + ri->ri_yorigin; @@ -1186,8 +1186,8 @@ cfxga_putchar(void *cookie, int row, int col, u_int uc, long attr) ri->ri_ops.unpack_attr(cookie, attr, &fg, &bg, NULL); cx = ri->ri_font->fontwidth; cy = ri->ri_font->fontheight; - cfxga_solid_fill(scr, x, y, cx, cy, ri->ri_devcmap[bg]); + return cfxga_solid_fill(scr, x, y, cx, cy, ri->ri_devcmap[bg]); } else { - cfxga_expand_char(scr, uc, x, y, attr); + return cfxga_expand_char(scr, uc, x, y, attr); } } diff --git a/sys/dev/rasops/rasops.c b/sys/dev/rasops/rasops.c index 719aa91142f..3e12b2f5fb5 100644 --- a/sys/dev/rasops/rasops.c +++ b/sys/dev/rasops/rasops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.c,v 1.19 2008/08/20 18:49:12 miod Exp $ */ +/* $OpenBSD: rasops.c,v 1.20 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops.c,v 1.35 2001/02/02 06:01:01 marcus Exp $ */ /*- @@ -131,13 +131,13 @@ const u_char rasops_isgray[16] = { }; /* Generic functions */ -void rasops_copycols(void *, int, int, int, int); -void rasops_copyrows(void *, int, int, int); +int rasops_copycols(void *, int, int, int, int); +int rasops_copyrows(void *, int, int, int); int rasops_mapchar(void *, int, u_int *); -void rasops_cursor(void *, int, int, int); +int rasops_cursor(void *, int, int, int); int rasops_alloc_cattr(void *, int, int, int, long *); int rasops_alloc_mattr(void *, int, int, int, long *); -void rasops_do_cursor(struct rasops_info *); +int rasops_do_cursor(struct rasops_info *); void rasops_init_devcmap(struct rasops_info *); void rasops_unpack_attr(void *, long, int *, int *, int *); #if NRASOPS_BSWAP > 0 @@ -145,11 +145,11 @@ static void slow_ovbcopy(void *, void *, size_t); #endif #if NRASOPS_ROTATION > 0 void rasops_copychar(void *, int, int, int, int); -void rasops_copycols_rotated(void *, int, int, int, int); -void rasops_copyrows_rotated(void *, int, int, int); -void rasops_erasecols_rotated(void *, int, int, int, long); -void rasops_eraserows_rotated(void *, int, int, long); -void rasops_putchar_rotated(void *, int, int, u_int, long); +int rasops_copycols_rotated(void *, int, int, int, int); +int rasops_copyrows_rotated(void *, int, int, int); +int rasops_erasecols_rotated(void *, int, int, int, long); +int rasops_eraserows_rotated(void *, int, int, long); +int rasops_putchar_rotated(void *, int, int, u_int, long); void rasops_rotate_font(int *); /* @@ -531,7 +531,7 @@ rasops_alloc_mattr(cookie, fg, bg, flg, attr) /* * Copy rows. */ -void +int rasops_copyrows(cookie, src, dst, num) void *cookie; int src, dst, num; @@ -544,7 +544,7 @@ rasops_copyrows(cookie, src, dst, num) #ifdef RASOPS_CLIPPING if (dst == src) - return; + return 0; if (src < 0) { num += src; @@ -563,7 +563,7 @@ rasops_copyrows(cookie, src, dst, num) num = ri->ri_rows - dst; if (num <= 0) - return; + return 0; #endif num *= ri->ri_font->fontheight; @@ -604,6 +604,8 @@ rasops_copyrows(cookie, src, dst, num) for (cnt = n1; cnt; cnt--) *dp++ = *sp++; } + + return 0; } /* @@ -612,7 +614,7 @@ rasops_copyrows(cookie, src, dst, num) * We simply cop-out here and use ovbcopy(), since it handles all of * these cases anyway. */ -void +int rasops_copycols(cookie, row, src, dst, num) void *cookie; int row, src, dst, num; @@ -625,11 +627,11 @@ rasops_copycols(cookie, row, src, dst, num) #ifdef RASOPS_CLIPPING if (dst == src) - return; + return 0; /* Catches < 0 case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if (src < 0) { num += src; @@ -648,7 +650,7 @@ rasops_copycols(cookie, row, src, dst, num) num = ri->ri_cols - dst; if (num <= 0) - return; + return 0; #endif num *= ri->ri_xscale; @@ -674,26 +676,32 @@ rasops_copycols(cookie, row, src, dst, num) sp += ri->ri_stride; } } + + return 0; } /* * Turn cursor off/on. */ -void +int rasops_cursor(cookie, on, row, col) void *cookie; int on, row, col; { struct rasops_info *ri; + int rc; ri = (struct rasops_info *)cookie; /* Turn old cursor off */ - if ((ri->ri_flg & RI_CURSOR) != 0) + if ((ri->ri_flg & RI_CURSOR) != 0) { #ifdef RASOPS_CLIPPING if ((ri->ri_flg & RI_CURSORCLIP) == 0) #endif - ri->ri_do_cursor(ri); + if ((rc = ri->ri_do_cursor(ri)) != 0) + return rc; + ri->ri_flg &= ~RI_CURSOR; + } /* Select new cursor */ #ifdef RASOPS_CLIPPING @@ -711,13 +719,15 @@ rasops_cursor(cookie, on, row, col) ri->ri_updatecursor(ri); if (on) { - ri->ri_flg |= RI_CURSOR; #ifdef RASOPS_CLIPPING if ((ri->ri_flg & RI_CURSORCLIP) == 0) #endif - ri->ri_do_cursor(ri); - } else - ri->ri_flg &= ~RI_CURSOR; + if ((rc = ri->ri_do_cursor(ri)) != 0) + return rc; + ri->ri_flg |= RI_CURSOR; + } + + return 0; } /* @@ -834,7 +844,7 @@ rasops_unpack_attr(cookie, attr, fg, bg, underline) /* * Erase rows */ -void +int rasops_eraserows(cookie, row, num, attr) void *cookie; int row, num; @@ -856,7 +866,7 @@ rasops_eraserows(cookie, row, num, attr) num = ri->ri_rows - row; if (num <= 0) - return; + return 0; #endif clr = ri->ri_devcmap[(attr >> 16) & 0xf]; @@ -901,13 +911,15 @@ rasops_eraserows(cookie, row, num, attr) DELTA(dp, delta, int32_t *); } + + return 0; } /* * Actually turn the cursor on or off. This does the dirty work for * rasops_cursor(). */ -void +int rasops_do_cursor(ri) struct rasops_info *ri; { @@ -973,12 +985,14 @@ rasops_do_cursor(ri) *(int16_t *)dp ^= ~0; } } + + return 0; } /* * Erase columns. */ -void +int rasops_erasecols(cookie, row, col, num, attr) void *cookie; int row, col, num; @@ -992,7 +1006,7 @@ rasops_erasecols(cookie, row, col, num, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if (col < 0) { num += col; @@ -1003,7 +1017,7 @@ rasops_erasecols(cookie, row, col, num, attr) num = ri->ri_cols - col; if (num <= 0) - return; + return 0; #endif num = num * ri->ri_xscale; @@ -1052,7 +1066,7 @@ rasops_erasecols(cookie, row, col, num, attr) } } - return; + return 0; } slop1 = (4 - ((long)rp & 3)) & 3; @@ -1102,6 +1116,8 @@ rasops_erasecols(cookie, row, col, num, attr) if (slop2 & 2) *(int16_t *)dp = clr; } + + return 0; } #if NRASOPS_ROTATION > 0 @@ -1186,7 +1202,7 @@ rasops_copychar(cookie, srcrow, dstrow, srccol, dstcol) } } -void +int rasops_putchar_rotated(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -1196,12 +1212,15 @@ rasops_putchar_rotated(cookie, row, col, uc, attr) struct rasops_info *ri; u_char *rp; int height; + int rc; ri = (struct rasops_info *)cookie; /* Do rotated char sans (side)underline */ - ri->ri_real_ops.putchar(cookie, col, ri->ri_rows - row - 1, uc, + rc = ri->ri_real_ops.putchar(cookie, col, ri->ri_rows - row - 1, uc, attr & ~1); + if (rc != 0) + return rc; /* Do rotated underline */ rp = ri->ri_bits + col * ri->ri_yscale + (ri->ri_rows - row - 1) * @@ -1217,9 +1236,11 @@ rasops_putchar_rotated(cookie, row, col, uc, attr) rp += ri->ri_stride; } } + + return 0; } -void +int rasops_erasecols_rotated(cookie, row, col, num, attr) void *cookie; int row, col, num; @@ -1227,15 +1248,21 @@ rasops_erasecols_rotated(cookie, row, col, num, attr) { struct rasops_info *ri; int i; + int rc; ri = (struct rasops_info *)cookie; - for (i = col; i < col + num; i++) - ri->ri_ops.putchar(cookie, row, i, ' ', attr); + for (i = col; i < col + num; i++) { + rc = ri->ri_ops.putchar(cookie, row, i, ' ', attr); + if (rc != 0) + return rc; + } + + return 0; } /* XXX: these could likely be optimised somewhat. */ -void +int rasops_copyrows_rotated(cookie, src, dst, num) void *cookie; int src, dst, num; @@ -1243,34 +1270,42 @@ rasops_copyrows_rotated(cookie, src, dst, num) struct rasops_info *ri = (struct rasops_info *)cookie; int col, roff; - if (src > dst) + if (src > dst) { for (roff = 0; roff < num; roff++) for (col = 0; col < ri->ri_cols; col++) rasops_copychar(cookie, src + roff, dst + roff, col, col); - else + } else { for (roff = num - 1; roff >= 0; roff--) for (col = 0; col < ri->ri_cols; col++) rasops_copychar(cookie, src + roff, dst + roff, col, col); + } + + return 0; } -void +int rasops_copycols_rotated(cookie, row, src, dst, num) void *cookie; int row, src, dst, num; { int coff; - if (src > dst) + if (src > dst) { for (coff = 0; coff < num; coff++) - rasops_copychar(cookie, row, row, src + coff, dst + coff); - else + rasops_copychar(cookie, row, row, src + coff, + dst + coff); + } else { for (coff = num - 1; coff >= 0; coff--) - rasops_copychar(cookie, row, row, src + coff, dst + coff); + rasops_copychar(cookie, row, row, src + coff, + dst + coff); + } + + return 0; } -void +int rasops_eraserows_rotated(cookie, row, num, attr) void *cookie; int row, num; @@ -1278,12 +1313,18 @@ rasops_eraserows_rotated(cookie, row, num, attr) { struct rasops_info *ri; int col, rn; + int rc; ri = (struct rasops_info *)cookie; for (rn = row; rn < row + num; rn++) - for (col = 0; col < ri->ri_cols; col++) - ri->ri_ops.putchar(cookie, rn, col, ' ', attr); + for (col = 0; col < ri->ri_cols; col++) { + rc = ri->ri_ops.putchar(cookie, rn, col, ' ', attr); + if (rc != 0) + return rc; + } + + return 0; } #endif /* NRASOPS_ROTATION */ diff --git a/sys/dev/rasops/rasops.h b/sys/dev/rasops/rasops.h index e6b58866a28..3848ab6f2da 100644 --- a/sys/dev/rasops/rasops.h +++ b/sys/dev/rasops/rasops.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.h,v 1.9 2008/06/26 05:42:17 ray Exp $ */ +/* $OpenBSD: rasops.h,v 1.10 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops.h,v 1.13 2000/06/13 13:36:54 ad Exp $ */ /*- @@ -105,7 +105,7 @@ struct rasops_info { int ri_caps; /* Callbacks so we can share some code */ - void (*ri_do_cursor)(struct rasops_info *); + int (*ri_do_cursor)(struct rasops_info *); void (*ri_updatecursor)(struct rasops_info *); #if NRASOPS_ROTATION > 0 @@ -145,8 +145,8 @@ void rasops32_init(struct rasops_info *); /* rasops.c */ int rasops_init(struct rasops_info *, int, int); int rasops_reconfig(struct rasops_info *, int, int); -void rasops_eraserows(void *, int, int, long); -void rasops_erasecols(void *, int, int, int, long); +int rasops_eraserows(void *, int, int, long); +int rasops_erasecols(void *, int, int, int, long); extern const u_char rasops_isgray[16]; extern const u_char rasops_cmap[256*3]; diff --git a/sys/dev/rasops/rasops1.c b/sys/dev/rasops/rasops1.c index 35c43b0c56a..bbca6a6369c 100644 --- a/sys/dev/rasops/rasops1.c +++ b/sys/dev/rasops/rasops1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops1.c,v 1.6 2008/06/26 05:42:17 ray Exp $ */ +/* $OpenBSD: rasops1.c,v 1.7 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops1.c,v 1.11 2000/04/12 14:22:29 pk Exp $ */ /*- @@ -40,13 +40,13 @@ #include <dev/rasops/rasops.h> #include <dev/rasops/rasops_masks.h> -void rasops1_copycols(void *, int, int, int, int); -void rasops1_erasecols(void *, int, int, int, long); -void rasops1_do_cursor(struct rasops_info *); -void rasops1_putchar(void *, int, int col, u_int, long); +int rasops1_copycols(void *, int, int, int, int); +int rasops1_erasecols(void *, int, int, int, long); +int rasops1_do_cursor(struct rasops_info *); +int rasops1_putchar(void *, int, int col, u_int, long); #ifndef RASOPS_SMALL -void rasops1_putchar8(void *, int, int col, u_int, long); -void rasops1_putchar16(void *, int, int col, u_int, long); +int rasops1_putchar8(void *, int, int col, u_int, long); +int rasops1_putchar16(void *, int, int col, u_int, long); #endif /* @@ -82,7 +82,7 @@ rasops1_init(ri) /* * Paint a single character. This is the generic version, this is ugly. */ -void +int rasops1_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -100,10 +100,10 @@ rasops1_putchar(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif col *= ri->ri_font->fontwidth; @@ -224,13 +224,15 @@ rasops1_putchar(cookie, row, col, uc, attr) rp[1] = (rp[1] & rmask) | (fg & ~rmask); } } + + return 0; } #ifndef RASOPS_SMALL /* * Paint a single character. This is for 8-pixel wide fonts. */ -void +int rasops1_putchar8(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -246,10 +248,10 @@ rasops1_putchar8(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif rp = ri->ri_bits + row * ri->ri_yscale + col * ri->ri_xscale; @@ -290,12 +292,14 @@ rasops1_putchar8(cookie, row, col, uc, attr) /* Do underline */ if ((attr & 1) != 0) rp[-(ri->ri_stride << 1)] = fg; + + return 0; } /* * Paint a single character. This is for 16-pixel wide fonts. */ -void +int rasops1_putchar16(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -311,10 +315,10 @@ rasops1_putchar16(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif rp = ri->ri_bits + row * ri->ri_yscale + col * ri->ri_xscale; @@ -356,6 +360,8 @@ rasops1_putchar16(cookie, row, col, uc, attr) /* Do underline */ if ((attr & 1) != 0) *(int16_t *)(rp - (ri->ri_stride << 1)) = fg; + + return 0; } #endif /* !RASOPS_SMALL */ diff --git a/sys/dev/rasops/rasops15.c b/sys/dev/rasops/rasops15.c index a344769ef0b..66a2dc95ea4 100644 --- a/sys/dev/rasops/rasops15.c +++ b/sys/dev/rasops/rasops15.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops15.c,v 1.6 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: rasops15.c,v 1.7 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops15.c,v 1.7 2000/04/12 14:22:29 pk Exp $ */ /*- @@ -38,11 +38,11 @@ #include <dev/wscons/wsconsio.h> #include <dev/rasops/rasops.h> -void rasops15_putchar(void *, int, int, u_int, long attr); +int rasops15_putchar(void *, int, int, u_int, long attr); #ifndef RASOPS_SMALL -void rasops15_putchar8(void *, int, int, u_int, long attr); -void rasops15_putchar12(void *, int, int, u_int, long attr); -void rasops15_putchar16(void *, int, int, u_int, long attr); +int rasops15_putchar8(void *, int, int, u_int, long attr); +int rasops15_putchar12(void *, int, int, u_int, long attr); +int rasops15_putchar16(void *, int, int, u_int, long attr); void rasops15_makestamp(struct rasops_info *, long); /* @@ -105,7 +105,7 @@ rasops15_init(ri) /* * Paint a single character. */ -void +int rasops15_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -121,10 +121,10 @@ rasops15_putchar(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif rp = ri->ri_bits + row * ri->ri_yscale + col * ri->ri_xscale; @@ -173,6 +173,8 @@ rasops15_putchar(cookie, row, col, uc, attr) rp += 2; } } + + return 0; } #ifndef RASOPS_SMALL @@ -209,7 +211,7 @@ rasops15_makestamp(ri, attr) /* * Paint a single character. This is for 8-pixel wide fonts. */ -void +int rasops15_putchar8(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -224,8 +226,7 @@ rasops15_putchar8(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops15_putchar(cookie, row, col, uc, attr); - return; + return rasops15_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -233,12 +234,12 @@ rasops15_putchar8(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -283,12 +284,14 @@ rasops15_putchar8(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Paint a single character. This is for 12-pixel wide fonts. */ -void +int rasops15_putchar12(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -303,8 +306,7 @@ rasops15_putchar12(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops15_putchar(cookie, row, col, uc, attr); - return; + return rasops15_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -312,12 +314,12 @@ rasops15_putchar12(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -366,12 +368,14 @@ rasops15_putchar12(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Paint a single character. This is for 16-pixel wide fonts. */ -void +int rasops15_putchar16(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -386,8 +390,7 @@ rasops15_putchar16(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops15_putchar(cookie, row, col, uc, attr); - return; + return rasops15_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -395,12 +398,12 @@ rasops15_putchar16(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -455,5 +458,7 @@ rasops15_putchar16(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } #endif /* !RASOPS_SMALL */ diff --git a/sys/dev/rasops/rasops2.c b/sys/dev/rasops/rasops2.c index 29d50162a8f..1b2546aedf9 100644 --- a/sys/dev/rasops/rasops2.c +++ b/sys/dev/rasops/rasops2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops2.c,v 1.8 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: rasops2.c,v 1.9 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops2.c,v 1.5 2000/04/12 14:22:29 pk Exp $ */ /*- @@ -40,15 +40,15 @@ #include <dev/rasops/rasops.h> #include <dev/rasops/rasops_masks.h> -void rasops2_copycols(void *, int, int, int, int); -void rasops2_erasecols(void *, int, int, int, long); -void rasops2_do_cursor(struct rasops_info *); -void rasops2_putchar(void *, int, int col, u_int, long); +int rasops2_copycols(void *, int, int, int, int); +int rasops2_erasecols(void *, int, int, int, long); +int rasops2_do_cursor(struct rasops_info *); +int rasops2_putchar(void *, int, int col, u_int, long); u_int rasops2_mergebits(u_char *, int, int); #ifndef RASOPS_SMALL -void rasops2_putchar8(void *, int, int col, u_int, long); -void rasops2_putchar12(void *, int, int col, u_int, long); -void rasops2_putchar16(void *, int, int col, u_int, long); +int rasops2_putchar8(void *, int, int col, u_int, long); +int rasops2_putchar12(void *, int, int col, u_int, long); +int rasops2_putchar16(void *, int, int col, u_int, long); void rasops2_makestamp(struct rasops_info *, long); /* @@ -116,7 +116,7 @@ rasops2_mergebits(u_char *fr, int fg, int bg) /* * Paint a single character. This is the generic version, this is ugly. */ -void +int rasops2_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -134,10 +134,10 @@ rasops2_putchar(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif width = ri->ri_font->fontwidth << 1; @@ -225,6 +225,8 @@ rasops2_putchar(cookie, row, col, uc, attr) rp[1] = (rp[1] & rmask) | (fg & ~rmask); } } + + return 0; } #ifndef RASOPS_SMALL @@ -253,7 +255,7 @@ rasops2_makestamp(ri, attr) /* * Put a single character. This is for 8-pixel wide fonts. */ -void +int rasops2_putchar8(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -267,8 +269,7 @@ rasops2_putchar8(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops2_putchar(cookie, row, col, uc, attr); - return; + return rasops2_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -277,12 +278,12 @@ rasops2_putchar8(cookie, row, col, uc, attr) /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -318,12 +319,14 @@ rasops2_putchar8(cookie, row, col, uc, attr) *(int16_t *)(rp - (ri->ri_stride << 1)) = stamp[15]; stamp_mutex--; + + return 0; } /* * Put a single character. This is for 12-pixel wide fonts. */ -void +int rasops2_putchar12(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -337,8 +340,7 @@ rasops2_putchar12(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops2_putchar(cookie, row, col, uc, attr); - return; + return rasops2_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -347,12 +349,12 @@ rasops2_putchar12(cookie, row, col, uc, attr) /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -391,12 +393,14 @@ rasops2_putchar12(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Put a single character. This is for 16-pixel wide fonts. */ -void +int rasops2_putchar16(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -410,8 +414,7 @@ rasops2_putchar16(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops2_putchar(cookie, row, col, uc, attr); - return; + return rasops2_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -420,12 +423,12 @@ rasops2_putchar16(cookie, row, col, uc, attr) /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -463,6 +466,8 @@ rasops2_putchar16(cookie, row, col, uc, attr) *(int32_t *)(rp - (ri->ri_stride << 1)) = stamp[15]; stamp_mutex--; + + return 0; } #endif /* !RASOPS_SMALL */ diff --git a/sys/dev/rasops/rasops24.c b/sys/dev/rasops/rasops24.c index 63b3ea84174..0847f7295fb 100644 --- a/sys/dev/rasops/rasops24.c +++ b/sys/dev/rasops/rasops24.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops24.c,v 1.7 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: rasops24.c,v 1.8 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops24.c,v 1.12 2000/04/12 14:22:29 pk Exp $ */ /*- @@ -40,13 +40,13 @@ #include <dev/wscons/wsconsio.h> #include <dev/rasops/rasops.h> -void rasops24_erasecols(void *, int, int, int, long); -void rasops24_eraserows(void *, int, int, long); -void rasops24_putchar(void *, int, int, u_int, long attr); +int rasops24_erasecols(void *, int, int, int, long); +int rasops24_eraserows(void *, int, int, long); +int rasops24_putchar(void *, int, int, u_int, long attr); #ifndef RASOPS_SMALL -void rasops24_putchar8(void *, int, int, u_int, long attr); -void rasops24_putchar12(void *, int, int, u_int, long attr); -void rasops24_putchar16(void *, int, int, u_int, long attr); +int rasops24_putchar8(void *, int, int, u_int, long attr); +int rasops24_putchar12(void *, int, int, u_int, long attr); +int rasops24_putchar16(void *, int, int, u_int, long attr); void rasops24_makestamp(struct rasops_info *, long); /* @@ -112,7 +112,7 @@ rasops24_init(ri) * Put a single character. This is the generic version. * XXX this bites - we should use masks. */ -void +int rasops24_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -128,10 +128,10 @@ rasops24_putchar(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif rp = ri->ri_bits + row * ri->ri_yscale + col * ri->ri_xscale; @@ -187,6 +187,8 @@ rasops24_putchar(cookie, row, col, uc, attr) *rp++ = clr[1]; } } + + return 0; } #ifndef RASOPS_SMALL @@ -236,7 +238,7 @@ rasops24_makestamp(ri, attr) /* * Put a single character. This is for 8-pixel wide fonts. */ -void +int rasops24_putchar8(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -251,8 +253,7 @@ rasops24_putchar8(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops24_putchar(cookie, row, col, uc, attr); - return; + return rasops24_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -260,12 +261,12 @@ rasops24_putchar8(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -312,12 +313,14 @@ rasops24_putchar8(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Put a single character. This is for 12-pixel wide fonts. */ -void +int rasops24_putchar12(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -332,8 +335,7 @@ rasops24_putchar12(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops24_putchar(cookie, row, col, uc, attr); - return; + return rasops24_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -341,12 +343,12 @@ rasops24_putchar12(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -400,12 +402,14 @@ rasops24_putchar12(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Put a single character. This is for 16-pixel wide fonts. */ -void +int rasops24_putchar16(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -420,8 +424,7 @@ rasops24_putchar16(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops24_putchar(cookie, row, col, uc, attr); - return; + return rasops24_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -429,12 +432,12 @@ rasops24_putchar16(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -495,13 +498,15 @@ rasops24_putchar16(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } #endif /* !RASOPS_SMALL */ /* * Erase rows. This is nice and easy due to alignment. */ -void +int rasops24_eraserows(cookie, row, num, attr) void *cookie; int row, num; @@ -515,10 +520,8 @@ rasops24_eraserows(cookie, row, num, attr) * If the color is gray, we can cheat and use the generic routines * (which are faster, hopefully) since the r,g,b values are the same. */ - if ((attr & 4) != 0) { - rasops_eraserows(cookie, row, num, attr); - return; - } + if ((attr & 4) != 0) + return rasops_eraserows(cookie, row, num, attr); ri = (struct rasops_info *)cookie; @@ -532,7 +535,7 @@ rasops24_eraserows(cookie, row, num, attr) num = ri->ri_rows - row; if (num <= 0) - return; + return 0; #endif clr = ri->ri_devcmap[(attr >> 16) & 0xf] & 0xffffff; @@ -600,12 +603,14 @@ rasops24_eraserows(cookie, row, num, attr) DELTA(dp, delta, int32_t *); } + + return 0; } /* * Erase columns. */ -void +int rasops24_erasecols(cookie, row, col, num, attr) void *cookie; int row, col, num; @@ -620,17 +625,15 @@ rasops24_erasecols(cookie, row, col, num, attr) * If the color is gray, we can cheat and use the generic routines * (which are faster, hopefully) since the r,g,b values are the same. */ - if ((attr & 4) != 0) { - rasops_erasecols(cookie, row, col, num, attr); - return; - } + if ((attr & 4) != 0) + return rasops_erasecols(cookie, row, col, num, attr); ri = (struct rasops_info *)cookie; #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if (col < 0) { num += col; @@ -641,7 +644,7 @@ rasops24_erasecols(cookie, row, col, num, attr) num = ri->ri_cols - col; if (num <= 0) - return; + return 0; #endif rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); @@ -721,4 +724,6 @@ rasops24_erasecols(cookie, row, col, num, attr) *dbp++ = clr; } } + + return 0; } diff --git a/sys/dev/rasops/rasops32.c b/sys/dev/rasops/rasops32.c index fb299b446b4..7884b9dd094 100644 --- a/sys/dev/rasops/rasops32.c +++ b/sys/dev/rasops/rasops32.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops32.c,v 1.5 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: rasops32.c,v 1.6 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops32.c,v 1.7 2000/04/12 14:22:29 pk Exp $ */ /*- @@ -38,7 +38,7 @@ #include <dev/wscons/wsconsio.h> #include <dev/rasops/rasops.h> -void rasops32_putchar(void *, int, int, u_int, long); +int rasops32_putchar(void *, int, int, u_int, long); /* * Initialize a 'rasops_info' descriptor for this depth. @@ -63,7 +63,7 @@ rasops32_init(ri) /* * Paint a single character. */ -void +int rasops32_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -80,10 +80,10 @@ rasops32_putchar(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); @@ -128,4 +128,6 @@ rasops32_putchar(cookie, row, col, uc, attr) while (width--) *rp++ = clr[1]; } + + return 0; } diff --git a/sys/dev/rasops/rasops4.c b/sys/dev/rasops/rasops4.c index cbd773b7202..856bb20117b 100644 --- a/sys/dev/rasops/rasops4.c +++ b/sys/dev/rasops/rasops4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops4.c,v 1.8 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: rasops4.c,v 1.9 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops4.c,v 1.4 2001/11/15 09:48:15 lukem Exp $ */ /*- @@ -40,14 +40,14 @@ #include <dev/rasops/rasops.h> #include <dev/rasops/rasops_masks.h> -void rasops4_copycols(void *, int, int, int, int); -void rasops4_erasecols(void *, int, int, int, long); -void rasops4_do_cursor(struct rasops_info *); -void rasops4_putchar(void *, int, int col, u_int, long); +int rasops4_copycols(void *, int, int, int, int); +int rasops4_erasecols(void *, int, int, int, long); +int rasops4_do_cursor(struct rasops_info *); +int rasops4_putchar(void *, int, int col, u_int, long); #ifndef RASOPS_SMALL -void rasops4_putchar8(void *, int, int col, u_int, long); -void rasops4_putchar12(void *, int, int col, u_int, long); -void rasops4_putchar16(void *, int, int col, u_int, long); +int rasops4_putchar8(void *, int, int col, u_int, long); +int rasops4_putchar12(void *, int, int col, u_int, long); +int rasops4_putchar16(void *, int, int col, u_int, long); void rasops4_makestamp(struct rasops_info *, long); /* @@ -96,7 +96,7 @@ rasops4_init(ri) /* * Paint a single character. This is the generic version, this is ugly. */ -void +int rasops4_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -113,10 +113,10 @@ rasops4_putchar(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif width = ri->ri_font->fontwidth << 1; @@ -205,13 +205,15 @@ rasops4_putchar(cookie, row, col, uc, attr) rp[1] = (rp[1] & rmask) | (fg & ~rmask); } } + + return 0; } #endif /* * Put a single character. This is the generic version. */ -void +int rasops4_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -220,6 +222,7 @@ rasops4_putchar(cookie, row, col, uc, attr) { /* XXX punt */ + return (EAGAIN); } #ifndef RASOPS_SMALL @@ -255,7 +258,7 @@ rasops4_makestamp(ri, attr) /* * Put a single character. This is for 8-pixel wide fonts. */ -void +int rasops4_putchar8(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -270,8 +273,7 @@ rasops4_putchar8(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops4_putchar(cookie, row, col, uc, attr); - return; + return rasops4_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -280,12 +282,12 @@ rasops4_putchar8(cookie, row, col, uc, attr) /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -325,12 +327,14 @@ rasops4_putchar8(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Put a single character. This is for 12-pixel wide fonts. */ -void +int rasops4_putchar12(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -345,8 +349,7 @@ rasops4_putchar12(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops4_putchar(cookie, row, col, uc, attr); - return; + return rasops4_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -355,12 +358,12 @@ rasops4_putchar12(cookie, row, col, uc, attr) /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -403,12 +406,14 @@ rasops4_putchar12(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Put a single character. This is for 16-pixel wide fonts. */ -void +int rasops4_putchar16(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -423,8 +428,7 @@ rasops4_putchar16(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops4_putchar(cookie, row, col, uc, attr); - return; + return rasops4_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -433,12 +437,12 @@ rasops4_putchar16(cookie, row, col, uc, attr) /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -484,6 +488,8 @@ rasops4_putchar16(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } #endif /* !RASOPS_SMALL */ diff --git a/sys/dev/rasops/rasops8.c b/sys/dev/rasops/rasops8.c index 87e580f3fbb..4a728c2a7c9 100644 --- a/sys/dev/rasops/rasops8.c +++ b/sys/dev/rasops/rasops8.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops8.c,v 1.8 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: rasops8.c,v 1.9 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops8.c,v 1.8 2000/04/12 14:22:29 pk Exp $ */ /*- @@ -38,11 +38,11 @@ #include <dev/wscons/wsconsio.h> #include <dev/rasops/rasops.h> -void rasops8_putchar(void *, int, int, u_int, long attr); +int rasops8_putchar(void *, int, int, u_int, long attr); #ifndef RASOPS_SMALL -void rasops8_putchar8(void *, int, int, u_int, long attr); -void rasops8_putchar12(void *, int, int, u_int, long attr); -void rasops8_putchar16(void *, int, int, u_int, long attr); +int rasops8_putchar8(void *, int, int, u_int, long attr); +int rasops8_putchar12(void *, int, int, u_int, long attr); +int rasops8_putchar16(void *, int, int, u_int, long attr); void rasops8_makestamp(struct rasops_info *ri, long); /* @@ -93,7 +93,7 @@ rasops8_init(ri) /* * Put a single character. */ -void +int rasops8_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -109,10 +109,10 @@ rasops8_putchar(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif rp = ri->ri_bits + row * ri->ri_yscale + col * ri->ri_xscale; @@ -158,6 +158,8 @@ rasops8_putchar(cookie, row, col, uc, attr) while (width--) *rp++ = c; } + + return 0; } #ifndef RASOPS_SMALL @@ -198,7 +200,7 @@ rasops8_makestamp(ri, attr) /* * Put a single character. This is for 8-pixel wide fonts. */ -void +int rasops8_putchar8(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -213,8 +215,7 @@ rasops8_putchar8(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops8_putchar(cookie, row, col, uc, attr); - return; + return rasops8_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -222,12 +223,12 @@ rasops8_putchar8(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -264,12 +265,14 @@ rasops8_putchar8(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Put a single character. This is for 12-pixel wide fonts. */ -void +int rasops8_putchar12(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -284,8 +287,7 @@ rasops8_putchar12(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops8_putchar(cookie, row, col, uc, attr); - return; + return rasops8_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -293,12 +295,12 @@ rasops8_putchar12(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -338,12 +340,14 @@ rasops8_putchar12(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Put a single character. This is for 16-pixel wide fonts. */ -void +int rasops8_putchar16(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -358,8 +362,7 @@ rasops8_putchar16(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops8_putchar(cookie, row, col, uc, attr); - return; + return rasops8_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -367,12 +370,12 @@ rasops8_putchar16(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -409,5 +412,7 @@ rasops8_putchar16(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } #endif /* !RASOPS_SMALL */ diff --git a/sys/dev/rasops/rasops_bitops.h b/sys/dev/rasops/rasops_bitops.h index 0c209104ce2..77206aae4ab 100644 --- a/sys/dev/rasops/rasops_bitops.h +++ b/sys/dev/rasops/rasops_bitops.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops_bitops.h,v 1.4 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: rasops_bitops.h,v 1.5 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops_bitops.h,v 1.6 2000/04/12 14:22:30 pk Exp $ */ /*- @@ -36,7 +36,7 @@ /* * Erase columns. */ -void +int NAME(erasecols)(cookie, row, col, num, attr) void *cookie; int row, col, num; @@ -51,7 +51,7 @@ NAME(erasecols)(cookie, row, col, num, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if (col < 0) { num += col; @@ -62,7 +62,7 @@ NAME(erasecols)(cookie, row, col, num, attr) num = ri->ri_cols - col; if (num <= 0) - return; + return 0; #endif col *= ri->ri_font->fontwidth << PIXEL_SHIFT; num *= ri->ri_font->fontwidth << PIXEL_SHIFT; @@ -108,12 +108,14 @@ NAME(erasecols)(cookie, row, col, num, attr) *dp = (*dp & rmask) | rclr; } } + + return 0; } /* * Actually paint the cursor. */ -void +int NAME(do_cursor)(ri) struct rasops_info *ri; { @@ -149,12 +151,14 @@ NAME(do_cursor)(ri) *dp ^= rmask; } } + + return 0; } /* * Copy columns. Ick! */ -void +int NAME(copycols)(cookie, row, src, dst, num) void *cookie; int row, src, dst, num; @@ -167,11 +171,11 @@ NAME(copycols)(cookie, row, src, dst, num) #ifdef RASOPS_CLIPPING if (dst == src) - return; + return 0; /* Catches < 0 case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if (src < 0) { num += src; @@ -190,7 +194,7 @@ NAME(copycols)(cookie, row, src, dst, num) num = ri->ri_cols - dst; if (num <= 0) - return; + return 0; #endif cnt = ri->ri_font->fontwidth << PIXEL_SHIFT; @@ -214,7 +218,7 @@ NAME(copycols)(cookie, row, src, dst, num) DELTA(drp, ri->ri_stride, int32_t *); } - return; + return 0; } lmask = rasops_rmask[db]; @@ -308,6 +312,8 @@ NAME(copycols)(cookie, row, src, dst, num) } } } + + return 0; } #endif /* _RASOPS_BITOPS_H_ */ diff --git a/sys/dev/sbus/cgsix.c b/sys/dev/sbus/cgsix.c index 6ba19025bc4..8f673614b63 100644 --- a/sys/dev/sbus/cgsix.c +++ b/sys/dev/sbus/cgsix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgsix.c,v 1.57 2008/12/27 17:23:03 miod Exp $ */ +/* $OpenBSD: cgsix.c,v 1.58 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -65,11 +65,11 @@ void cgsix_hardreset(struct cgsix_softc *); void cgsix_burner(void *, u_int, u_int); int cgsix_intr(void *); void cgsix_ras_init(struct cgsix_softc *); -void cgsix_ras_copyrows(void *, int, int, int); -void cgsix_ras_copycols(void *, int, int, int, int); -void cgsix_ras_erasecols(void *, int, int, int, long int); -void cgsix_ras_eraserows(void *, int, int, long int); -void cgsix_ras_do_cursor(struct rasops_info *); +int cgsix_ras_copyrows(void *, int, int, int); +int cgsix_ras_copycols(void *, int, int, int, int); +int cgsix_ras_erasecols(void *, int, int, int, long int); +int cgsix_ras_eraserows(void *, int, int, long int); +int cgsix_ras_do_cursor(struct rasops_info *); int cgsix_setcursor(struct cgsix_softc *, struct wsdisplay_cursor *); int cgsix_updatecursor(struct cgsix_softc *, u_int); @@ -794,14 +794,14 @@ cgsix_ras_init(struct cgsix_softc *sc) FBC_WRITE(sc, CG6_FBC_MODE, m); } -void +int cgsix_ras_copyrows(void *cookie, int src, int dst, int n) { struct rasops_info *ri = cookie; struct cgsix_softc *sc = ri->ri_hw; if (dst == src) - return; + return 0; if (src < 0) { n += src; src = 0; @@ -815,7 +815,7 @@ cgsix_ras_copyrows(void *cookie, int src, int dst, int n) if (dst + n > ri->ri_rows) n = ri->ri_rows - dst; if (n <= 0) - return; + return 0; n *= ri->ri_font->fontheight; src *= ri->ri_font->fontheight; dst *= ri->ri_font->fontheight; @@ -839,18 +839,20 @@ cgsix_ras_copyrows(void *cookie, int src, int dst, int n) FBC_WRITE(sc, CG6_FBC_Y3, ri->ri_yorigin + dst + n - 1); CG6_BLIT_WAIT(sc); CG6_DRAIN(sc); + + return 0; } -void +int cgsix_ras_copycols(void *cookie, int row, int src, int dst, int n) { struct rasops_info *ri = cookie; struct cgsix_softc *sc = ri->ri_hw; if (dst == src) - return; + return 0; if ((row < 0) || (row >= ri->ri_rows)) - return; + return 0; if (src < 0) { n += src; src = 0; @@ -864,7 +866,7 @@ cgsix_ras_copycols(void *cookie, int row, int src, int dst, int n) if (dst + n > ri->ri_cols) n = ri->ri_cols - dst; if (n <= 0) - return; + return 0; n *= ri->ri_font->fontwidth; src *= ri->ri_font->fontwidth; dst *= ri->ri_font->fontwidth; @@ -891,9 +893,11 @@ cgsix_ras_copycols(void *cookie, int row, int src, int dst, int n) ri->ri_yorigin + row + ri->ri_font->fontheight - 1); CG6_BLIT_WAIT(sc); CG6_DRAIN(sc); + + return 0; } -void +int cgsix_ras_erasecols(void *cookie, int row, int col, int n, long int attr) { struct rasops_info *ri = cookie; @@ -901,7 +905,7 @@ cgsix_ras_erasecols(void *cookie, int row, int col, int n, long int attr) int fg, bg; if ((row < 0) || (row >= ri->ri_rows)) - return; + return 0; if (col < 0) { n += col; col = 0; @@ -909,7 +913,7 @@ cgsix_ras_erasecols(void *cookie, int row, int col, int n, long int attr) if (col + n > ri->ri_cols) n = ri->ri_cols - col; if (n <= 0) - return; + return 0; n *= ri->ri_font->fontwidth; col *= ri->ri_font->fontwidth; row *= ri->ri_font->fontheight; @@ -933,9 +937,11 @@ cgsix_ras_erasecols(void *cookie, int row, int col, int n, long int attr) FBC_WRITE(sc, CG6_FBC_ARECTX, ri->ri_xorigin + col + n - 1); CG6_DRAW_WAIT(sc); CG6_DRAIN(sc); + + return 0; } -void +int cgsix_ras_eraserows(void *cookie, int row, int n, long int attr) { struct rasops_info *ri = cookie; @@ -949,7 +955,7 @@ cgsix_ras_eraserows(void *cookie, int row, int n, long int attr) if (row + n > ri->ri_rows) n = ri->ri_rows - row; if (n <= 0) - return; + return 0; ri->ri_ops.unpack_attr(cookie, attr, &fg, &bg, NULL); @@ -979,9 +985,11 @@ cgsix_ras_eraserows(void *cookie, int row, int n, long int attr) } CG6_DRAW_WAIT(sc); CG6_DRAIN(sc); + + return 0; } -void +int cgsix_ras_do_cursor(struct rasops_info *ri) { struct cgsix_softc *sc = ri->ri_hw; @@ -1006,4 +1014,6 @@ cgsix_ras_do_cursor(struct rasops_info *ri) ri->ri_xorigin + col + ri->ri_font->fontwidth - 1); CG6_DRAW_WAIT(sc); CG6_DRAIN(sc); + + return 0; } diff --git a/sys/dev/sbus/mgx.c b/sys/dev/sbus/mgx.c index 5b3a7e856a4..d0a235b0a76 100644 --- a/sys/dev/sbus/mgx.c +++ b/sys/dev/sbus/mgx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mgx.c,v 1.11 2008/12/27 17:23:03 miod Exp $ */ +/* $OpenBSD: mgx.c,v 1.12 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. * All rights reserved. @@ -149,11 +149,11 @@ void mgx_loadcmap(struct mgx_softc *, int, int); int mgx_putcmap(u_int8_t *, struct wsdisplay_cmap *); void mgx_setcolor(void *, u_int, u_int8_t, u_int8_t, u_int8_t); -void mgx_ras_copycols(void *, int, int, int, int); -void mgx_ras_copyrows(void *, int, int, int); -void mgx_ras_do_cursor(struct rasops_info *); -void mgx_ras_erasecols(void *, int, int, int, long int); -void mgx_ras_eraserows(void *, int, int, long int); +int mgx_ras_copycols(void *, int, int, int, int); +int mgx_ras_copyrows(void *, int, int, int); +int mgx_ras_do_cursor(struct rasops_info *); +int mgx_ras_erasecols(void *, int, int, int, long int); +int mgx_ras_eraserows(void *, int, int, long int); void mgx_ras_init(struct mgx_softc *, uint); uint8_t mgx_read_1(vaddr_t, uint); @@ -646,7 +646,7 @@ mgx_ras_init(struct mgx_softc *sc, uint chipid) mgx_write_1(sc->sc_xreg, ATR_BYTEMASK, 0xff); } -void +int mgx_ras_copycols(void *v, int row, int src, int dst, int n) { struct rasops_info *ri = v; @@ -675,9 +675,11 @@ mgx_ras_copycols(void *v, int row, int src, int dst, int n) mgx_write_4(sc->sc_xreg, ATR_DST_XY, ATR_DUAL(row, dst)); mgx_write_4(sc->sc_xreg, ATR_WH, ATR_DUAL(ri->ri_font->fontheight, n)); mgx_wait_engine(sc); + + return 0; } -void +int mgx_ras_copyrows(void *v, int src, int dst, int n) { struct rasops_info *ri = v; @@ -704,9 +706,11 @@ mgx_ras_copyrows(void *v, int src, int dst, int n) mgx_write_4(sc->sc_xreg, ATR_DST_XY, ATR_DUAL(dst, ri->ri_xorigin)); mgx_write_4(sc->sc_xreg, ATR_WH, ATR_DUAL(n, ri->ri_emuwidth)); mgx_wait_engine(sc); + + return 0; } -void +int mgx_ras_erasecols(void *v, int row, int col, int n, long int attr) { struct rasops_info *ri = v; @@ -732,9 +736,11 @@ mgx_ras_erasecols(void *v, int row, int col, int n, long int attr) mgx_write_4(sc->sc_xreg, ATR_DST_XY, ATR_DUAL(row, col)); mgx_write_4(sc->sc_xreg, ATR_WH, ATR_DUAL(ri->ri_font->fontheight, n)); mgx_wait_engine(sc); + + return 0; } -void +int mgx_ras_eraserows(void *v, int row, int n, long int attr) { struct rasops_info *ri = v; @@ -765,9 +771,11 @@ mgx_ras_eraserows(void *v, int row, int n, long int attr) mgx_write_4(sc->sc_xreg, ATR_WH, ATR_DUAL(n, ri->ri_emuwidth)); } mgx_wait_engine(sc); + + return 0; } -void +int mgx_ras_do_cursor(struct rasops_info *ri) { struct mgx_softc *sc = ri->ri_hw; @@ -787,4 +795,6 @@ mgx_ras_do_cursor(struct rasops_info *ri) mgx_write_4(sc->sc_xreg, ATR_WH, ATR_DUAL(ri->ri_font->fontheight, ri->ri_font->fontwidth)); mgx_wait_engine(sc); + + return 0; } diff --git a/sys/dev/sbus/zx.c b/sys/dev/sbus/zx.c index 012ab400701..7bd47b53336 100644 --- a/sys/dev/sbus/zx.c +++ b/sys/dev/sbus/zx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zx.c,v 1.16 2008/12/27 17:23:03 miod Exp $ */ +/* $OpenBSD: zx.c,v 1.17 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: zx.c,v 1.5 2002/10/02 16:52:46 thorpej Exp $ */ /* @@ -160,12 +160,12 @@ void zx_fillrect(struct rasops_info *, int, int, int, int, long, int); int zx_intr(void *); void zx_prom(void *); -void zx_putchar(void *, int, int, u_int, long); -void zx_copycols(void *, int, int, int, int); -void zx_erasecols(void *, int, int, int, long); -void zx_copyrows(void *, int, int, int); -void zx_eraserows(void *, int, int, long); -void zx_do_cursor(struct rasops_info *); +int zx_putchar(void *, int, int, u_int, long); +int zx_copycols(void *, int, int, int, int); +int zx_erasecols(void *, int, int, int, long); +int zx_copyrows(void *, int, int, int); +int zx_eraserows(void *, int, int, long); +int zx_do_cursor(struct rasops_info *); struct cfattach zx_ca = { sizeof(struct zx_softc), zx_match, zx_attach @@ -635,16 +635,18 @@ zx_copyrect(struct rasops_info *ri, int sx, int sy, int dx, int dy, int w, SETREG(zc->zc_copy, ZX_COORDS(dx, dy)); } -void +int zx_do_cursor(struct rasops_info *ri) { zx_fillrect(ri, ri->ri_ccol, ri->ri_crow, 1, 1, WSCOL_BLACK << 16, ZX_ROP_NEW_XOR_OLD | ZX_ATTR_WE_ENABLE | ZX_ATTR_OE_ENABLE | ZX_ATTR_FORCE_WID); + + return 0; } -void +int zx_erasecols(void *cookie, int row, int col, int num, long attr) { struct rasops_info *ri; @@ -652,9 +654,11 @@ zx_erasecols(void *cookie, int row, int col, int num, long attr) ri = (struct rasops_info *)cookie; zx_fillrect(ri, col, row, num, 1, attr, ZX_STD_ROP); + + return 0; } -void +int zx_eraserows(void *cookie, int row, int num, long attr) { struct rasops_info *ri; @@ -682,9 +686,11 @@ zx_eraserows(void *cookie, int row, int num, long attr) SETREG(zc->zc_fill, ZX_COORDS(0, 0) | ZX_EXTENT_DIR_BACKWARDS); } else zx_fillrect(ri, 0, row, ri->ri_cols, num, attr, ZX_STD_ROP); + + return 0; } -void +int zx_copyrows(void *cookie, int src, int dst, int num) { struct rasops_info *ri; @@ -692,9 +698,11 @@ zx_copyrows(void *cookie, int src, int dst, int num) ri = (struct rasops_info *)cookie; zx_copyrect(ri, 0, src, 0, dst, ri->ri_cols, num); + + return 0; } -void +int zx_copycols(void *cookie, int row, int src, int dst, int num) { struct rasops_info *ri; @@ -702,9 +710,11 @@ zx_copycols(void *cookie, int row, int src, int dst, int num) ri = (struct rasops_info *)cookie; zx_copyrect(ri, src, row, dst, row, num, 1); + + return 0; } -void +int zx_putchar(void *cookie, int row, int col, u_int uc, long attr) { struct rasops_info *ri; @@ -728,7 +738,7 @@ zx_putchar(void *cookie, int row, int col, u_int uc, long attr) if (uc == ' ') { zx_fillrect(ri, col, row, 1, 1, attr, ZX_STD_ROP); if (ul == 0) - return; + return 0; dp += font->fontheight << ZX_WWIDTH; @@ -776,4 +786,6 @@ zx_putchar(void *cookie, int row, int col, u_int uc, long attr) dp -= 2 << ZX_WWIDTH; *dp = 0xffffffff; } + + return 0; } diff --git a/sys/dev/usb/udl.c b/sys/dev/usb/udl.c index c346591f04d..0e8d0bd41b8 100644 --- a/sys/dev/usb/udl.c +++ b/sys/dev/usb/udl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udl.c,v 1.29 2009/08/30 12:05:23 maja Exp $ */ +/* $OpenBSD: udl.c,v 1.30 2009/09/05 14:09:35 miod Exp $ */ /* * Copyright (c) 2009 Marcus Glocker <mglocker@openbsd.org> @@ -80,12 +80,12 @@ int udl_show_screen(void *, void *, int, void (*)(void *, int, int), void *); void udl_burner(void *, u_int, u_int); -void udl_copycols(void *, int, int, int, int); -void udl_copyrows(void *, int, int, int); -void udl_erasecols(void *, int, int, int, long); -void udl_eraserows(void *, int, int, long); -void udl_putchar(void *, int, int, u_int, long); -void udl_do_cursor(struct rasops_info *); +int udl_copycols(void *, int, int, int, int); +int udl_copyrows(void *, int, int, int); +int udl_erasecols(void *, int, int, int, long); +int udl_eraserows(void *, int, int, long); +int udl_putchar(void *, int, int, u_int, long); +int udl_do_cursor(struct rasops_info *); usbd_status udl_ctrl_msg(struct udl_softc *, uint8_t, uint8_t, uint16_t, uint16_t, uint8_t *, size_t); @@ -549,7 +549,7 @@ udl_burner(void *v, u_int on, u_int flags) /* ---------- */ -void +int udl_copycols(void *cookie, int row, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -571,9 +571,11 @@ udl_copycols(void *cookie, int row, int src, int dst, int num) (sc->udl_fb_block_copy)(sc, sx, sy, dx, dy, cx, cy); (void)udl_cmd_send_async(sc); + + return 0; } -void +int udl_copyrows(void *cookie, int src, int dst, int num) { struct rasops_info *ri = cookie; @@ -597,9 +599,11 @@ udl_copyrows(void *cookie, int src, int dst, int num) (sc->udl_fb_block_copy)(sc, 0, sc->sc_ri.ri_emuheight, 0, dy, cx, cy); (void)udl_cmd_send_async(sc); + + return 0; } -void +int udl_erasecols(void *cookie, int row, int col, int num, long attr) { struct rasops_info *ri = cookie; @@ -624,9 +628,11 @@ udl_erasecols(void *cookie, int row, int col, int num, long attr) udl_fb_block_write(sc, bgc, x, y, cx, cy); (void)udl_cmd_send_async(sc); + + return 0; } -void +int udl_eraserows(void *cookie, int row, int num, long attr) { struct rasops_info *ri = cookie; @@ -650,9 +656,11 @@ udl_eraserows(void *cookie, int row, int num, long attr) udl_fb_block_write(sc, bgc, x, y, cx, cy); (void)udl_cmd_send_async(sc); + + return 0; } -void +int udl_putchar(void *cookie, int row, int col, u_int uc, long attr) { struct rasops_info *ri = cookie; @@ -687,9 +695,11 @@ udl_putchar(void *cookie, int row, int col, u_int uc, long attr) * character will be buffered until another rasops function flush * the buffer. */ + + return 0; } -void +int udl_do_cursor(struct rasops_info *ri) { struct udl_softc *sc = ri->ri_hw; @@ -728,6 +738,8 @@ udl_do_cursor(struct rasops_info *ri) } (void)udl_cmd_send_async(sc); + + return 0; } /* ---------- */ diff --git a/sys/dev/wscons/wsdisplayvar.h b/sys/dev/wscons/wsdisplayvar.h index 3ca65a69866..9f9a09ebe89 100644 --- a/sys/dev/wscons/wsdisplayvar.h +++ b/sys/dev/wscons/wsdisplayvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wsdisplayvar.h,v 1.22 2006/12/02 11:25:09 miod Exp $ */ +/* $OpenBSD: wsdisplayvar.h,v 1.23 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: wsdisplayvar.h,v 1.30 2005/02/04 02:10:49 perry Exp $ */ /* @@ -53,14 +53,14 @@ struct device; * with these functions, which is passed to them when they are invoked. */ struct wsdisplay_emulops { - void (*cursor)(void *c, int on, int row, int col); + int (*cursor)(void *c, int on, int row, int col); int (*mapchar)(void *, int, unsigned int *); - void (*putchar)(void *c, int row, int col, u_int uc, long attr); - void (*copycols)(void *c, int row, int srccol, int dstcol, + int (*putchar)(void *c, int row, int col, u_int uc, long attr); + int (*copycols)(void *c, int row, int srccol, int dstcol, int ncols); - void (*erasecols)(void *c, int row, int startcol, int ncols, long); - void (*copyrows)(void *c, int srcrow, int dstrow, int nrows); - void (*eraserows)(void *c, int row, int nrows, long attr); + int (*erasecols)(void *c, int row, int startcol, int ncols, long); + int (*copyrows)(void *c, int srcrow, int dstrow, int nrows); + int (*eraserows)(void *c, int row, int nrows, long attr); int (*alloc_attr)(void *c, int fg, int bg, int flags, long *attrp); void (*unpack_attr)(void *c, long attr, int *fg, int *bg, int *ul); /* fg / bg values. Made identical to ANSI terminal color codes. */ |