diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-09-05 14:09:36 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-09-05 14:09:36 +0000 |
commit | fe97057f16fd1cffc35ca63c0ad5df12f2a7b2df (patch) | |
tree | 6bcedac194b240651540f3015081e5826a73f2dd /sys/dev | |
parent | cdcddd879b0146dd3a452f32dc53867fce692d9b (diff) |
Change the wsdisplay_emulops return types from void to int; emulops will now
return zero on success and nonzero on failure.
This commit only performs mechanical changes for the existing emulops to
always return zero.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/pcdisplay_subr.c | 30 | ||||
-rw-r--r-- | sys/dev/ic/pcdisplayvar.h | 16 | ||||
-rw-r--r-- | sys/dev/ic/sti.c | 38 | ||||
-rw-r--r-- | sys/dev/ic/vga.c | 16 | ||||
-rw-r--r-- | sys/dev/isa/ega.c | 8 | ||||
-rw-r--r-- | sys/dev/pci/tga.c | 31 | ||||
-rw-r--r-- | sys/dev/pcmcia/cfxga.c | 52 | ||||
-rw-r--r-- | sys/dev/rasops/rasops.c | 135 | ||||
-rw-r--r-- | sys/dev/rasops/rasops.h | 8 | ||||
-rw-r--r-- | sys/dev/rasops/rasops1.c | 38 | ||||
-rw-r--r-- | sys/dev/rasops/rasops15.c | 51 | ||||
-rw-r--r-- | sys/dev/rasops/rasops2.c | 57 | ||||
-rw-r--r-- | sys/dev/rasops/rasops24.c | 81 | ||||
-rw-r--r-- | sys/dev/rasops/rasops32.c | 12 | ||||
-rw-r--r-- | sys/dev/rasops/rasops4.c | 60 | ||||
-rw-r--r-- | sys/dev/rasops/rasops8.c | 51 | ||||
-rw-r--r-- | sys/dev/rasops/rasops_bitops.h | 26 | ||||
-rw-r--r-- | sys/dev/sbus/cgsix.c | 48 | ||||
-rw-r--r-- | sys/dev/sbus/mgx.c | 32 | ||||
-rw-r--r-- | sys/dev/sbus/zx.c | 40 | ||||
-rw-r--r-- | sys/dev/usb/udl.c | 38 | ||||
-rw-r--r-- | sys/dev/wscons/wsdisplayvar.h | 14 |
22 files changed, 524 insertions, 358 deletions
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. */ |