diff options
author | 2020-05-25 06:45:25 +0000 | |
---|---|---|
committer | 2020-05-25 06:45:25 +0000 | |
commit | fc223b232cff7e51a9474209d53006b4ae5898e7 (patch) | |
tree | d686bcf653c8636db97661bfec3b878368cb166d | |
parent | Kill unused cdev_pc_init(). (diff) | |
download | wireguard-openbsd-fc223b232cff7e51a9474209d53006b4ae5898e7.tar.xz wireguard-openbsd-fc223b232cff7e51a9474209d53006b4ae5898e7.zip |
rename wsdisplay alloc_attr() to pack_attr()
Suggested by John Carmack. miod agrees a rename would make sense and
explained it was initially thought drivers may need to allocate storage
but in practice they don't need more than 32 bits for an attribute.
ok mpi@
36 files changed, 119 insertions, 120 deletions
diff --git a/sys/arch/amd64/amd64/efifb.c b/sys/arch/amd64/amd64/efifb.c index 69d6a01bad4..656bbd2b057 100644 --- a/sys/arch/amd64/amd64/efifb.c +++ b/sys/arch/amd64/amd64/efifb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efifb.c,v 1.27 2020/01/24 05:27:31 kettenis Exp $ */ +/* $OpenBSD: efifb.c,v 1.28 2020/05/25 06:45:25 jsg Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net> @@ -222,7 +222,7 @@ efifb_attach(struct device *parent, struct device *self, void *aux) rasops_init(ri, efifb_std_descr.nrows, efifb_std_descr.ncols); - ri->ri_ops.alloc_attr(ri->ri_active, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri->ri_active, 0, 0, 0, &defattr); wsdisplay_cnattach(&efifb_std_descr, ri->ri_active, ccol, crow, defattr); } @@ -445,7 +445,7 @@ efifb_cnattach_common(void) efifb_std_descr.fontheight = ri->ri_font->fontheight; efifb_std_descr.capabilities = ri->ri_caps; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &defattr); wsdisplay_cnattach(&efifb_std_descr, ri, 0, 0, defattr); } diff --git a/sys/arch/armv7/exynos/exdisplay.c b/sys/arch/armv7/exynos/exdisplay.c index a80171fcc2b..e0507d0ed06 100644 --- a/sys/arch/armv7/exynos/exdisplay.c +++ b/sys/arch/armv7/exynos/exdisplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exdisplay.c,v 1.4 2016/07/26 22:10:10 patrick Exp $ */ +/* $OpenBSD: exdisplay.c,v 1.5 2020/05/25 06:45:25 jsg Exp $ */ /* * Copyright (c) 2013 Patrick Wildt <patrick@blueri.se> * @@ -152,7 +152,7 @@ exdisplay_attach(struct device *parent, struct device *self, void *args) ri->ri_bits = (u_char *)sc->sc_fbioh; exdisplay_setup_rasops(ri, &exdisplay_stdscreen); - ri->ri_ops.alloc_attr(ri->ri_active, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri->ri_active, 0, 0, 0, &defattr); wsdisplay_cnattach(&exdisplay_stdscreen, ri->ri_active, 0, 0, defattr); } @@ -184,7 +184,7 @@ exdisplay_cnattach(bus_space_tag_t iot, bus_addr_t iobase, size_t size) exdisplay_setup_rasops(ri, descr); /* assumes 16 bpp */ - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &defattr); wsdisplay_cnattach(descr, ri, ri->ri_ccol, ri->ri_crow, defattr); diff --git a/sys/arch/armv7/omap/omdisplay.c b/sys/arch/armv7/omap/omdisplay.c index 7935b36ce19..bb982a7d200 100644 --- a/sys/arch/armv7/omap/omdisplay.c +++ b/sys/arch/armv7/omap/omdisplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: omdisplay.c,v 1.6 2019/05/06 03:45:58 mlarkin Exp $ */ +/* $OpenBSD: omdisplay.c,v 1.7 2020/05/25 06:45:25 jsg Exp $ */ /* * Copyright (c) 2007 Dale Rahn <drahn@openbsd.org> * @@ -1170,7 +1170,7 @@ omdisplay_alloc_screen(void *v, const struct wsscreen_descr *_type, omdisplay_setup_rasops(sc, ri); /* assumes 16 bpp */ - ri->ri_ops.alloc_attr(ri, 0, 0, 0, attrp); + ri->ri_ops.pack_attr(ri, 0, 0, 0, attrp); *cookiep = ri; *curxp = 0; diff --git a/sys/arch/loongson/dev/radeonfb.c b/sys/arch/loongson/dev/radeonfb.c index 294910452b6..18e8b36f39b 100644 --- a/sys/arch/loongson/dev/radeonfb.c +++ b/sys/arch/loongson/dev/radeonfb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radeonfb.c,v 1.2 2017/01/15 20:22:33 fcambus Exp $ */ +/* $OpenBSD: radeonfb.c,v 1.3 2020/05/25 06:45:25 jsg Exp $ */ /* * Copyright (c) 2009 Mark Kettenis. @@ -263,7 +263,7 @@ radeonfb_alloc_screen(void *v, const struct wsscreen_descr *type, *cookiep = ri; *curxp = *curyp = 0; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, attrp); + ri->ri_ops.pack_attr(ri, 0, 0, 0, attrp); sc->sc_nscr++; return 0; @@ -722,7 +722,7 @@ radeonfb_cnattach(bus_space_tag_t memt, bus_space_tag_t iot, pcitag_t tag, return rc; ri = &radeonfbcn.ri; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &defattr); wsdisplay_cnattach(&radeonfbcn.wsd, ri, 0, 0, defattr); return 0; diff --git a/sys/arch/loongson/dev/sisfb.c b/sys/arch/loongson/dev/sisfb.c index 4268ea1d8dc..c3c17a28927 100644 --- a/sys/arch/loongson/dev/sisfb.c +++ b/sys/arch/loongson/dev/sisfb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sisfb.c,v 1.5 2017/01/15 20:22:33 fcambus Exp $ */ +/* $OpenBSD: sisfb.c,v 1.6 2020/05/25 06:45:25 jsg Exp $ */ /* * Copyright (c) 2010 Miodrag Vallat. @@ -278,7 +278,7 @@ sisfb_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep, *cookiep = ri; *curxp = *curyp = 0; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, attrp); + ri->ri_ops.pack_attr(ri, 0, 0, 0, attrp); sc->sc_nscr++; return 0; @@ -652,7 +652,7 @@ sisfb_cnattach(bus_space_tag_t memt, bus_space_tag_t iot, pcitag_t tag, return rc; ri = &sisfbcn.ri; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &defattr); wsdisplay_cnattach(&sisfbcn.wsd, ri, 0, 0, defattr); return 0; diff --git a/sys/arch/loongson/dev/smfb.c b/sys/arch/loongson/dev/smfb.c index cc104bdc234..def3d6dfc1c 100644 --- a/sys/arch/loongson/dev/smfb.c +++ b/sys/arch/loongson/dev/smfb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smfb.c,v 1.17 2017/01/10 08:26:41 fcambus Exp $ */ +/* $OpenBSD: smfb.c,v 1.18 2020/05/25 06:45:25 jsg Exp $ */ /* * Copyright (c) 2009, 2010 Miodrag Vallat. @@ -251,7 +251,7 @@ smfb_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep, *cookiep = ri; *curxp = *curyp = 0; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, attrp); + ri->ri_ops.pack_attr(ri, 0, 0, 0, attrp); sc->sc_nscr++; return 0; @@ -721,7 +721,7 @@ smfb_cnattach(bus_space_tag_t memt, bus_space_tag_t iot, pcitag_t tag, return rc; ri = &smfbcn.ri; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &defattr); wsdisplay_cnattach(&smfbcn.wsd, ri, 0, 0, defattr); return 0; diff --git a/sys/arch/luna88k/dev/lunafb.c b/sys/arch/luna88k/dev/lunafb.c index 80d39488b9c..4ec577993f5 100644 --- a/sys/arch/luna88k/dev/lunafb.c +++ b/sys/arch/luna88k/dev/lunafb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lunafb.c,v 1.25 2017/11/03 06:54:06 aoyama Exp $ */ +/* $OpenBSD: lunafb.c,v 1.26 2020/05/25 06:45:25 jsg Exp $ */ /* $NetBSD: lunafb.c,v 1.7.6.1 2002/08/07 01:48:34 lukem Exp $ */ /*- @@ -221,7 +221,7 @@ omfb_cnattach(void) long defattr; omfb_getdevconfig(OMFB_FB_WADDR, dc); - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &defattr); wsdisplay_cnattach(&omfb_stdscreen, ri, 0, 0, defattr); omfb_console = 1; return (0); @@ -480,7 +480,7 @@ omfb_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep, *cookiep = ri; *curxp = 0; *curyp = 0; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, attrp); + ri->ri_ops.pack_attr(ri, 0, 0, 0, attrp); sc->nscreens++; return (0); } diff --git a/sys/arch/luna88k/dev/omrasops.c b/sys/arch/luna88k/dev/omrasops.c index 5c7cb6f2b15..70328f2df3e 100644 --- a/sys/arch/luna88k/dev/omrasops.c +++ b/sys/arch/luna88k/dev/omrasops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: omrasops.c,v 1.14 2017/03/20 19:37:54 miod Exp $ */ +/* $OpenBSD: omrasops.c,v 1.15 2020/05/25 06:45:25 jsg Exp $ */ /* $NetBSD: omrasops.c,v 1.1 2000/01/05 08:48:56 nisimura Exp $ */ /*- @@ -74,7 +74,7 @@ int om4_windowmove(struct rasops_info *, u_int16_t, u_int16_t, u_int16_t, u_int16_t, u_int16_t, u_int16_t, int16_t, int16_t); /* MI function in src/sys/dev/rasops/rasops.c */ -int rasops_alloc_cattr(void *, int, int, int, long *); +int rasops_pack_cattr(void *, int, int, int, long *); static int (*om_windowmove)(struct rasops_info *, u_int16_t, u_int16_t, u_int16_t, u_int16_t, u_int16_t, u_int16_t, int16_t, int16_t); @@ -534,8 +534,8 @@ setup_omrasops4(struct rasops_info *ri) = WSSCREEN_HILIT | WSSCREEN_WSCOLORS | WSSCREEN_REVERSE; /* * Since we set ri->ri_depth == 1, rasops_init() set - * rasops_alloc_mattr for us. But we use the color version, - * rasops_alloc_cattr, on 4bpp/8bpp frame buffer. + * rasops_pack_mattr for us. But we use the color version, + * rasops_pack_cattr, on 4bpp/8bpp frame buffer. */ - ri->ri_ops.alloc_attr = rasops_alloc_cattr; + ri->ri_ops.pack_attr = rasops_pack_cattr; } diff --git a/sys/arch/macppc/macppc/ofw_machdep.c b/sys/arch/macppc/macppc/ofw_machdep.c index ed9232f80c8..23a8d2cc3f8 100644 --- a/sys/arch/macppc/macppc/ofw_machdep.c +++ b/sys/arch/macppc/macppc/ofw_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_machdep.c,v 1.57 2019/09/03 17:51:52 deraadt Exp $ */ +/* $OpenBSD: ofw_machdep.c,v 1.58 2020/05/25 06:45:25 jsg Exp $ */ /* $NetBSD: ofw_machdep.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */ /* @@ -511,7 +511,7 @@ of_display_console(void) fb->ofw_wsd.fontheight = ri->ri_font->fontheight; #endif - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &defattr); wsdisplay_cnattach(&fb->ofw_wsd, ri, 0, 0, defattr); } #endif diff --git a/sys/arch/macppc/pci/vgafb.c b/sys/arch/macppc/pci/vgafb.c index 1e9def6fcca..b18979f78be 100644 --- a/sys/arch/macppc/pci/vgafb.c +++ b/sys/arch/macppc/pci/vgafb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vgafb.c,v 1.60 2014/07/28 15:00:27 jsg Exp $ */ +/* $OpenBSD: vgafb.c,v 1.61 2020/05/25 06:45:25 jsg Exp $ */ /* $NetBSD: vga.c,v 1.3 1996/12/02 22:24:54 cgd Exp $ */ /* @@ -196,7 +196,7 @@ vgafb_console_init(struct vgafb_softc *sc) sc->sc_wsd.fontwidth = ri->ri_font->fontwidth; sc->sc_wsd.fontheight = ri->ri_font->fontheight; - ri->ri_ops.alloc_attr(ri->ri_active, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri->ri_active, 0, 0, 0, &defattr); wsdisplay_cnattach(&sc->sc_wsd, ri->ri_active, ri->ri_ccol, ri->ri_crow, defattr); diff --git a/sys/arch/sgi/dev/gbe.c b/sys/arch/sgi/dev/gbe.c index fb862387e9c..437a7c5508b 100644 --- a/sys/arch/sgi/dev/gbe.c +++ b/sys/arch/sgi/dev/gbe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gbe.c,v 1.21 2013/10/21 10:36:16 miod Exp $ */ +/* $OpenBSD: gbe.c,v 1.22 2020/05/25 06:45:25 jsg Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Joel Sing <jsing@openbsd.org> @@ -401,7 +401,7 @@ gbe_attach(struct device *parent, struct device *self, void *aux) /* Attach as console if necessary. */ if (strncmp(bios_console, "video", 5) == 0) { - screen->ri.ri_ops.alloc_attr(&screen->ri, 0, 0, 0, &attr); + screen->ri.ri_ops.pack_attr(&screen->ri, 0, 0, 0, &attr); wsdisplay_cnattach(&gbe_stdscreen, &screen->ri, 0, 0, attr); gsc->console = 1; } @@ -964,7 +964,7 @@ gbe_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep, *curyp = 0; /* Correct screen attributes. */ - screen->ri.ri_ops.alloc_attr(&screen->ri, 0, 0, 0, attrp); + screen->ri.ri_ops.pack_attr(&screen->ri, 0, 0, 0, attrp); return (0); } @@ -1402,7 +1402,7 @@ gbe_cnattach(bus_space_tag_t iot, bus_addr_t addr) /* * Attach wsdisplay. */ - gbe_consdata.ri.ri_ops.alloc_attr(&gbe_consdata.ri, 0, 0, 0, &attr); + gbe_consdata.ri.ri_ops.pack_attr(&gbe_consdata.ri, 0, 0, 0, &attr); wsdisplay_cnattach(&gbe_stdscreen, &gbe_consdata.ri, 0, 0, attr); gbe_console = 1; diff --git a/sys/arch/sgi/dev/impact.c b/sys/arch/sgi/dev/impact.c index 7c181e267e6..0d79d017ca7 100644 --- a/sys/arch/sgi/dev/impact.c +++ b/sys/arch/sgi/dev/impact.c @@ -1,4 +1,4 @@ -/* $OpenBSD: impact.c,v 1.9 2017/09/08 05:36:52 deraadt Exp $ */ +/* $OpenBSD: impact.c,v 1.10 2020/05/25 06:45:25 jsg Exp $ */ /* * Copyright (c) 2010, 2012 Miodrag Vallat. @@ -448,7 +448,7 @@ impact_alloc_screen(void *v, const struct wsscreen_descr *type, *cookiep = ri; *curxp = 0; *curyp = 0; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &scr->defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &scr->defattr); *attrp = scr->defattr; return 0; @@ -769,7 +769,7 @@ impact_cnattach_common(bus_space_tag_t iot, bus_space_handle_t ioh, int has_hq4) if (rc != 0) return rc; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &scr->defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &scr->defattr); wsdisplay_cnattach(&scr->wsd, ri, 0, 0, scr->defattr); return 0; diff --git a/sys/arch/sgi/gio/grtwo.c b/sys/arch/sgi/gio/grtwo.c index 85065c79453..527f003ec30 100644 --- a/sys/arch/sgi/gio/grtwo.c +++ b/sys/arch/sgi/gio/grtwo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grtwo.c,v 1.13 2017/01/15 20:22:33 fcambus Exp $ */ +/* $OpenBSD: grtwo.c,v 1.14 2020/05/25 06:45:25 jsg Exp $ */ /* $NetBSD: grtwo.c,v 1.11 2009/11/22 19:09:15 mbalmer Exp $ */ /* @@ -469,7 +469,7 @@ grtwo_cnattach(struct gio_attach_args *ga) if (rc != 0) return rc; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &defattr); cell = grtwo_console_bs; for (i = ri->ri_cols * ri->ri_rows; i != 0; i--, cell++) cell->attr = defattr; @@ -828,7 +828,7 @@ grtwo_alloc_screen(void *v, const struct wsscreen_descr * type, void **cookiep, *cookiep = ri; *curxp = *curyp = 0; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &dc->dc_defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &dc->dc_defattr); *attrp = dc->dc_defattr; cell = dc->dc_bs; diff --git a/sys/arch/sgi/gio/light.c b/sys/arch/sgi/gio/light.c index 39a77a58fe6..5d221623cf9 100644 --- a/sys/arch/sgi/gio/light.c +++ b/sys/arch/sgi/gio/light.c @@ -1,4 +1,4 @@ -/* $OpenBSD: light.c,v 1.8 2017/01/15 20:22:33 fcambus Exp $ */ +/* $OpenBSD: light.c,v 1.9 2020/05/25 06:45:25 jsg Exp $ */ /* $NetBSD: light.c,v 1.5 2007/03/04 06:00:39 christos Exp $ */ /* @@ -447,7 +447,7 @@ light_cnattach(struct gio_attach_args *ga) light_attach_common(&light_console_dc, ga); light_init_screen(&light_console_dc); - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &defattr); wsdisplay_cnattach(&light_console_dc.dc_wsd, ri, 0, 0, defattr); return 0; @@ -743,7 +743,7 @@ light_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep, *cookiep = ri; *curxp = *curyp = 0; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &dc->dc_defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &dc->dc_defattr); *attrp = dc->dc_defattr; return 0; diff --git a/sys/arch/sgi/gio/newport.c b/sys/arch/sgi/gio/newport.c index 97e0f43597e..dfc31e78f06 100644 --- a/sys/arch/sgi/gio/newport.c +++ b/sys/arch/sgi/gio/newport.c @@ -1,4 +1,4 @@ -/* $OpenBSD: newport.c,v 1.11 2017/01/15 20:22:33 fcambus Exp $ */ +/* $OpenBSD: newport.c,v 1.12 2020/05/25 06:45:25 jsg Exp $ */ /* $NetBSD: newport.c,v 1.15 2009/05/12 23:51:25 macallan Exp $ */ /* @@ -588,7 +588,7 @@ newport_cnattach(struct gio_attach_args *ga) if (rc != 0) return rc; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &defattr); wsdisplay_cnattach(&newport_console_dc.dc_wsd, ri, 0, 0, defattr); return 0; @@ -823,7 +823,7 @@ newport_alloc_screen(void *v, const struct wsscreen_descr *type, *cookiep = ri; *curxp = *curyp = 0; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &dc->dc_defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &dc->dc_defattr); *attrp = dc->dc_defattr; return 0; diff --git a/sys/arch/sgi/xbow/odyssey.c b/sys/arch/sgi/xbow/odyssey.c index 64c46aee053..d606eff1140 100644 --- a/sys/arch/sgi/xbow/odyssey.c +++ b/sys/arch/sgi/xbow/odyssey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: odyssey.c,v 1.12 2017/09/08 05:36:52 deraadt Exp $ */ +/* $OpenBSD: odyssey.c,v 1.13 2020/05/25 06:45:25 jsg Exp $ */ /* * Copyright (c) 2009, 2010 Joel Sing <jsing@openbsd.org> * @@ -672,7 +672,7 @@ odyssey_alloc_screen(void *v, const struct wsscreen_descr *type, *curyp = 0; /* Correct screen attributes. */ - screen->ri.ri_ops.alloc_attr(&screen->ri, 0, 0, 0, attrp); + screen->ri.ri_ops.pack_attr(&screen->ri, 0, 0, 0, attrp); screen->attr = *attrp; return (0); @@ -1135,7 +1135,7 @@ odyssey_cnattach() /* * Attach wsdisplay. */ - screen->ri.ri_ops.alloc_attr(&screen->ri, 0, 0, 0, &screen->attr); + screen->ri.ri_ops.pack_attr(&screen->ri, 0, 0, 0, &screen->attr); wsdisplay_cnattach(&odyssey_stdscreen, &screen->ri, 0, 0, screen->attr); return 0; diff --git a/sys/arch/sparc64/dev/creator.c b/sys/arch/sparc64/dev/creator.c index 8edeb55c36c..9c090cd504c 100644 --- a/sys/arch/sparc64/dev/creator.c +++ b/sys/arch/sparc64/dev/creator.c @@ -1,4 +1,4 @@ -/* $OpenBSD: creator.c,v 1.51 2017/09/08 05:36:52 deraadt Exp $ */ +/* $OpenBSD: creator.c,v 1.52 2020/05/25 06:45:25 jsg Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -248,7 +248,7 @@ creator_ioctl(v, cmd, data, flags, p) creator_ras_init(sc); /* Clear screen. */ - ri->ri_ops.alloc_attr(ri, + ri->ri_ops.pack_attr(ri, WSCOL_BLACK, WSCOL_WHITE, WSATTR_WSCOLORS, &attr); ri->ri_ops.eraserows(ri, 0, ri->ri_rows, attr); } diff --git a/sys/arch/sparc64/dev/fb.c b/sys/arch/sparc64/dev/fb.c index 4cc28492c86..20866cce071 100644 --- a/sys/arch/sparc64/dev/fb.c +++ b/sys/arch/sparc64/dev/fb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fb.c,v 1.28 2016/03/29 22:06:50 kettenis Exp $ */ +/* $OpenBSD: fb.c,v 1.29 2020/05/25 06:45:25 jsg Exp $ */ /* $NetBSD: fb.c,v 1.23 1997/07/07 23:30:22 pk Exp $ */ /* @@ -363,10 +363,10 @@ fbwscons_console_init(struct sunfb *sf, int row) cookie = ri; if (ISSET(ri->ri_caps, WSSCREEN_WSCOLORS)) - ri->ri_ops.alloc_attr(cookie, + ri->ri_ops.pack_attr(cookie, WSCOL_BLACK, WSCOL_WHITE, WSATTR_WSCOLORS, &defattr); else - ri->ri_ops.alloc_attr(cookie, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(cookie, 0, 0, 0, &defattr); fb_initwsd(sf); wsdisplay_cnattach(&sf->sf_wsd, cookie, @@ -462,10 +462,10 @@ fb_alloc_screen(void *v, const struct wsscreen_descr *type, *curyp = 0; *curxp = 0; if (ISSET(ri->ri_caps, WSSCREEN_WSCOLORS)) - ri->ri_ops.alloc_attr(cookie, + ri->ri_ops.pack_attr(cookie, WSCOL_BLACK, WSCOL_WHITE, WSATTR_WSCOLORS, attrp); else - ri->ri_ops.alloc_attr(cookie, 0, 0, 0, attrp); + ri->ri_ops.pack_attr(cookie, 0, 0, 0, attrp); sf->sf_nscreens++; return (0); } diff --git a/sys/dev/fdt/rkdrm.c b/sys/dev/fdt/rkdrm.c index edaec683e4c..1b9a1ebddee 100644 --- a/sys/dev/fdt/rkdrm.c +++ b/sys/dev/fdt/rkdrm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rkdrm.c,v 1.7 2020/04/08 11:30:48 kettenis Exp $ */ +/* $OpenBSD: rkdrm.c,v 1.8 2020/05/25 06:45:25 jsg Exp $ */ /* $NetBSD: rk_drm.c,v 1.3 2019/12/15 01:00:58 mrg Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill <jmcneill@invisible.ca> @@ -522,7 +522,7 @@ rkdrm_attachhook(struct device *dev) rkdrm_stdscreen.fontheight = ri->ri_font->fontheight; if (console) { - ri->ri_ops.alloc_attr(ri->ri_active, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri->ri_active, 0, 0, 0, &defattr); wsdisplay_cnattach(&rkdrm_stdscreen, ri->ri_active, ri->ri_ccol, ri->ri_crow, defattr); } diff --git a/sys/dev/fdt/simplefb.c b/sys/dev/fdt/simplefb.c index 5f911d74a45..c14a25e7dc4 100644 --- a/sys/dev/fdt/simplefb.c +++ b/sys/dev/fdt/simplefb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: simplefb.c,v 1.8 2020/01/22 05:25:05 patrick Exp $ */ +/* $OpenBSD: simplefb.c,v 1.9 2020/05/25 06:45:25 jsg Exp $ */ /* * Copyright (c) 2016 Mark Kettenis * @@ -177,7 +177,7 @@ simplefb_attach(struct device *parent, struct device *self, void *aux) sc->sc_wsl.screens = (const struct wsscreen_descr **)sc->sc_scrlist; if (console) { - ri->ri_ops.alloc_attr(ri->ri_active, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri->ri_active, 0, 0, 0, &defattr); wsdisplay_cnattach(&sc->sc_wsd, ri->ri_active, simplefb_ri.ri_ccol, simplefb_ri.ri_crow, defattr); } @@ -343,7 +343,7 @@ simplefb_init_cons(bus_space_tag_t iot) simplefb_wsd.fontwidth = ri->ri_font->fontwidth; simplefb_wsd.fontheight = ri->ri_font->fontheight; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri, 0, 0, 0, &defattr); wsdisplay_cnattach(&simplefb_wsd, ri, 0, 0, defattr); #if NUKBD > 0 diff --git a/sys/dev/ic/sti.c b/sys/dev/ic/sti.c index 8be71bcdfa2..098e0da5962 100644 --- a/sys/dev/ic/sti.c +++ b/sys/dev/ic/sti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sti.c,v 1.78 2017/06/11 02:06:36 deraadt Exp $ */ +/* $OpenBSD: sti.c,v 1.79 2020/05/25 06:45:26 jsg Exp $ */ /* * Copyright (c) 2000-2003 Michael Shalayeff @@ -53,7 +53,7 @@ struct cfdriver sti_cd = { NULL, "sti", DV_DULL }; -int sti_alloc_attr(void *, int, int, int, long *); +int sti_pack_attr(void *, int, 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); @@ -71,7 +71,7 @@ struct wsdisplay_emulops sti_emulops = { .erasecols = sti_erasecols, .copyrows = sti_copyrows, .eraserows = sti_eraserows, - .alloc_attr = sti_alloc_attr, + .pack_attr = sti_pack_attr, .unpack_attr = sti_unpack_attr }; @@ -772,7 +772,7 @@ sti_end_attach_screen(struct sti_softc *sc, struct sti_screen *scr, int console) if (console && !ISSET(sc->sc_flags, STI_ATTACHED)) { long defattr; - sti_alloc_attr(scr, 0, 0, 0, &defattr); + sti_pack_attr(scr, 0, 0, 0, &defattr); wsdisplay_cnattach(&scr->scr_wsd, scr, 0, scr->scr_wsd.nrows - 1, defattr); sc->sc_flags |= STI_ATTACHED; @@ -1205,7 +1205,7 @@ sti_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep, *cookiep = scr; *cxp = 0; *cyp = 0; - sti_alloc_attr(scr, 0, 0, 0, defattr); + sti_pack_attr(scr, 0, 0, 0, defattr); scr->scr_nscreens++; return 0; } @@ -1419,7 +1419,7 @@ sti_eraserows(void *v, int srcrow, int nrows, long attr) } int -sti_alloc_attr(void *v, int fg, int bg, int flags, long *pattr) +sti_pack_attr(void *v, int fg, int bg, int flags, long *pattr) { #if 0 struct sti_screen *scr = (struct sti_screen *)v; diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c index cf8bfbab7a8..8e35b14b164 100644 --- a/sys/dev/ic/vga.c +++ b/sys/dev/ic/vga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga.c,v 1.71 2020/05/17 14:06:02 jsg Exp $ */ +/* $OpenBSD: vga.c,v 1.72 2020/05/25 06:45:26 jsg Exp $ */ /* $NetBSD: vga.c,v 1.28.2.1 2000/06/30 16:27:47 simonb Exp $ */ /*- @@ -113,7 +113,7 @@ void vga_pick_monitor_type(struct vga_config *); int vga_mapchar(void *, int, unsigned int *); int vga_putchar(void *, int, int, u_int, long); -int vga_alloc_attr(void *, int, int, int, long *); +int vga_pack_attr(void *, int, int, int, long *); int vga_copyrows(void *, int, int, int); void vga_unpack_attr(void *, long, int *, int *, int *); @@ -125,7 +125,7 @@ static const struct wsdisplay_emulops vga_emulops = { pcdisplay_erasecols, vga_copyrows, pcdisplay_eraserows, - vga_alloc_attr, + vga_pack_attr, vga_unpack_attr }; @@ -439,11 +439,11 @@ vga_init_screen(struct vga_config *vc, struct vgascreen *scr, /* * DEC firmware uses a blue background. */ - res = vga_alloc_attr(scr, WSCOL_WHITE, WSCOL_BLUE, + res = vga_pack_attr(scr, WSCOL_WHITE, WSCOL_BLUE, WSATTR_WSCOLORS, attrp); else #endif - res = vga_alloc_attr(scr, 0, 0, 0, attrp); + res = vga_pack_attr(scr, 0, 0, 0, attrp); #ifdef DIAGNOSTIC if (res) panic("vga_init_screen: attribute botch"); @@ -985,7 +985,7 @@ vga_scrollback(void *v, void *cookie, int lines) } int -vga_alloc_attr(void *id, int fg, int bg, int flags, long *attrp) +vga_pack_attr(void *id, int fg, int bg, int flags, long *attrp) { struct vgascreen *scr = id; struct vga_config *vc = scr->cfg; diff --git a/sys/dev/isa/pcdisplay.c b/sys/dev/isa/pcdisplay.c index 8b581588ecb..9105fd28f30 100644 --- a/sys/dev/isa/pcdisplay.c +++ b/sys/dev/isa/pcdisplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcdisplay.c,v 1.12 2013/10/20 20:07:29 miod Exp $ */ +/* $OpenBSD: pcdisplay.c,v 1.13 2020/05/25 06:45:26 jsg Exp $ */ /* $NetBSD: pcdisplay.c,v 1.9.4.1 2000/06/30 16:27:48 simonb Exp $ */ /* @@ -70,7 +70,7 @@ static int pcdisplay_probe_mono(bus_space_tag_t, bus_space_tag_t); static void pcdisplay_init(struct pcdisplay_config *, bus_space_tag_t, bus_space_tag_t, int); -static int pcdisplay_alloc_attr(void *, int, int, int, long *); +static int pcdisplay_pack_attr(void *, int, int, int, long *); static void pcdisplay_unpack_attr(void *, long, int *, int *, int *); struct cfattach pcdisplay_ca = { @@ -85,7 +85,7 @@ const struct wsdisplay_emulops pcdisplay_emulops = { pcdisplay_erasecols, pcdisplay_copyrows, pcdisplay_eraserows, - pcdisplay_alloc_attr, + pcdisplay_pack_attr, pcdisplay_unpack_attr }; @@ -375,7 +375,7 @@ pcdisplay_show_screen(void *v, void *cookie, int waitok, } static int -pcdisplay_alloc_attr(void *id, int fg, int bg, int flags, long *attrp) +pcdisplay_pack_attr(void *id, int fg, int bg, int flags, long *attrp) { if (flags & WSATTR_REVERSE) *attrp = FG_BLACK | BG_LIGHTGREY; diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c index 619e8289840..4d76c319407 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c @@ -1828,7 +1828,7 @@ amdgpu_attachhook(struct device *self) if (adev->console) { long defattr; - ri->ri_ops.alloc_attr(ri->ri_active, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri->ri_active, 0, 0, 0, &defattr); wsdisplay_cnattach(&amdgpu_stdscreen, ri->ri_active, ri->ri_ccol, ri->ri_crow, defattr); } diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c index 78e503090c3..c245e7e058c 100644 --- a/sys/dev/pci/drm/i915/i915_drv.c +++ b/sys/dev/pci/drm/i915/i915_drv.c @@ -3667,7 +3667,7 @@ inteldrm_attachhook(struct device *self) if (ri->ri_flg & (RI_ROTATE_CW | RI_ROTATE_CCW)) memset(ri->ri_bits, 0, ri->ri_height * ri->ri_stride); - ri->ri_ops.alloc_attr(ri->ri_active, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri->ri_active, 0, 0, 0, &defattr); wsdisplay_cnattach(&inteldrm_stdscreen, ri->ri_active, 0, 0, defattr); } diff --git a/sys/dev/pci/drm/radeon/radeon_kms.c b/sys/dev/pci/drm/radeon/radeon_kms.c index 9d2fd579380..c942930d6d8 100644 --- a/sys/dev/pci/drm/radeon/radeon_kms.c +++ b/sys/dev/pci/drm/radeon/radeon_kms.c @@ -797,7 +797,7 @@ radeondrm_attachhook(struct device *self) if (rdev->console) { long defattr; - ri->ri_ops.alloc_attr(ri->ri_active, 0, 0, 0, &defattr); + ri->ri_ops.pack_attr(ri->ri_active, 0, 0, 0, &defattr); wsdisplay_cnattach(&radeondrm_stdscreen, ri->ri_active, ri->ri_ccol, ri->ri_crow, defattr); } diff --git a/sys/dev/pci/tga.c b/sys/dev/pci/tga.c index 94bad789fe5..8dc41e9f6dd 100644 --- a/sys/dev/pci/tga.c +++ b/sys/dev/pci/tga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tga.c,v 1.38 2013/10/21 10:36:23 miod Exp $ */ +/* $OpenBSD: tga.c,v 1.39 2020/05/25 06:45:26 jsg Exp $ */ /* $NetBSD: tga.c,v 1.40 2002/03/13 15:05:18 ad Exp $ */ /* @@ -742,7 +742,7 @@ tga_alloc_screen(v, type, cookiep, curxp, curyp, attrp) *cookiep = &sc->sc_dc->dc_rinfo; /* one and only for now */ *curxp = 0; *curyp = 0; - sc->sc_dc->dc_rinfo.ri_ops.alloc_attr(&sc->sc_dc->dc_rinfo, + sc->sc_dc->dc_rinfo.ri_ops.pack_attr(&sc->sc_dc->dc_rinfo, 0, 0, 0, &defattr); *attrp = defattr; sc->nscreens++; @@ -871,7 +871,7 @@ tga_cnattach(iot, memt, pc, bus, device, function) tga_bt463_rd); } } - dcp->dc_rinfo.ri_ops.alloc_attr(&dcp->dc_rinfo, 0, 0, 0, &defattr); + dcp->dc_rinfo.ri_ops.pack_attr(&dcp->dc_rinfo, 0, 0, 0, &defattr); wsdisplay_cnattach(&tga_stdscreen, &dcp->dc_rinfo, 0, 0, defattr); return(0); diff --git a/sys/dev/pcmcia/cfxga.c b/sys/dev/pcmcia/cfxga.c index 318710d9c14..ae30be1cd58 100644 --- a/sys/dev/pcmcia/cfxga.c +++ b/sys/dev/pcmcia/cfxga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cfxga.c,v 1.29 2014/12/13 21:05:33 doug Exp $ */ +/* $OpenBSD: cfxga.c,v 1.30 2020/05/25 06:45:26 jsg Exp $ */ /* * Copyright (c) 2005, 2006, Matthieu Herrb and Miodrag Vallat @@ -536,7 +536,7 @@ cfxga_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep, LIST_INSERT_HEAD(&sc->sc_scr, scr, scr_link); sc->sc_nscreens++; - ri->ri_ops.alloc_attr(ri, 0, 0, 0, attrp); + ri->ri_ops.pack_attr(ri, 0, 0, 0, attrp); *cookiep = ri; *curxp = *curyp = 0; diff --git a/sys/dev/rasops/rasops.c b/sys/dev/rasops/rasops.c index 6bb38705211..53e44fc165a 100644 --- a/sys/dev/rasops/rasops.c +++ b/sys/dev/rasops/rasops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.c,v 1.59 2019/03/18 16:10:39 fcambus Exp $ */ +/* $OpenBSD: rasops.c,v 1.60 2020/05/25 06:45:26 jsg Exp $ */ /* $NetBSD: rasops.c,v 1.35 2001/02/02 06:01:01 marcus Exp $ */ /*- @@ -151,8 +151,8 @@ int rasops_copycols(void *, int, int, int, int); int rasops_copyrows(void *, int, int, int); int rasops_mapchar(void *, int, u_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 *); +int rasops_pack_cattr(void *, int, int, int, long *); +int rasops_pack_mattr(void *, int, int, int, long *); int rasops_do_cursor(struct rasops_info *); void rasops_init_devcmap(struct rasops_info *); void rasops_unpack_attr(void *, long, int *, int *, int *); @@ -187,7 +187,7 @@ int rasops_vcons_copycols(void *, int, int, int, int); int rasops_vcons_erasecols(void *, int, int, int, long); int rasops_vcons_copyrows(void *, int, int, int); int rasops_vcons_eraserows(void *, int, int, long); -int rasops_vcons_alloc_attr(void *, int, int, int, long *); +int rasops_vcons_pack_attr(void *, int, int, int, long *); void rasops_vcons_unpack_attr(void *, long, int *, int *, int *); int rasops_wronly_putchar(void *, int, int, u_int, long); @@ -283,7 +283,7 @@ rasops_init(struct rasops_info *ri, int wantrows, int wantcols) ri->ri_erasecols = ri->ri_ops.erasecols; ri->ri_copyrows = ri->ri_ops.copyrows; ri->ri_eraserows = ri->ri_ops.eraserows; - ri->ri_alloc_attr = ri->ri_ops.alloc_attr; + ri->ri_pack_attr = ri->ri_ops.pack_attr; if (ri->ri_flg & RI_VCONS) { void *cookie; @@ -304,7 +304,7 @@ rasops_init(struct rasops_info *ri, int wantrows, int wantcols) ri->ri_ops.erasecols = rasops_vcons_erasecols; ri->ri_ops.copyrows = rasops_vcons_copyrows; ri->ri_ops.eraserows = rasops_vcons_eraserows; - ri->ri_ops.alloc_attr = rasops_vcons_alloc_attr; + ri->ri_ops.pack_attr = rasops_vcons_pack_attr; ri->ri_ops.unpack_attr = rasops_vcons_unpack_attr; ri->ri_do_cursor = rasops_wronly_do_cursor; } else if ((ri->ri_flg & RI_WRONLY) && ri->ri_bs != NULL) { @@ -319,7 +319,7 @@ rasops_init(struct rasops_info *ri, int wantrows, int wantcols) ri->ri_do_cursor = rasops_wronly_do_cursor; if (ri->ri_flg & RI_CLEAR) { - ri->ri_alloc_attr(ri, 0, 0, 0, &attr); + ri->ri_pack_attr(ri, 0, 0, 0, &attr); for (i = 0; i < ri->ri_rows * ri->ri_cols; i++) { ri->ri_bs[i].uc = ' '; ri->ri_bs[i].attr = attr; @@ -446,10 +446,10 @@ rasops_reconfig(struct rasops_info *ri, int wantrows, int wantcols) ri->ri_updatecursor = NULL; if (ri->ri_depth < 8 || (ri->ri_flg & RI_FORCEMONO) != 0) { - ri->ri_ops.alloc_attr = rasops_alloc_mattr; + ri->ri_ops.pack_attr = rasops_pack_mattr; ri->ri_caps = WSSCREEN_UNDERLINE | WSSCREEN_REVERSE; } else { - ri->ri_ops.alloc_attr = rasops_alloc_cattr; + ri->ri_ops.pack_attr = rasops_pack_cattr; ri->ri_caps = WSSCREEN_UNDERLINE | WSSCREEN_HILIT | WSSCREEN_WSCOLORS | WSSCREEN_REVERSE; } @@ -548,10 +548,10 @@ rasops_mapchar(void *cookie, int c, u_int *cp) } /* - * Allocate a color attribute. + * Pack a color attribute. */ int -rasops_alloc_cattr(void *cookie, int fg, int bg, int flg, long *attr) +rasops_pack_cattr(void *cookie, int fg, int bg, int flg, long *attr) { int swap; @@ -589,10 +589,10 @@ rasops_alloc_cattr(void *cookie, int fg, int bg, int flg, long *attr) } /* - * Allocate a mono attribute. + * Pack a mono attribute. */ int -rasops_alloc_mattr(void *cookie, int fg, int bg, int flg, long *attr) +rasops_pack_mattr(void *cookie, int fg, int bg, int flg, long *attr) { int swap; @@ -1423,7 +1423,7 @@ rasops_alloc_screen(void *v, void **cookiep, *cookiep = scr; *curxp = 0; *curyp = 0; - ri->ri_alloc_attr(ri, 0, 0, 0, attrp); + ri->ri_pack_attr(ri, 0, 0, 0, attrp); scr->rs_ri = ri; scr->rs_visible = (ri->ri_nscreens == 0); @@ -1678,11 +1678,11 @@ rasops_vcons_eraserows(void *cookie, int row, int num, long attr) } int -rasops_vcons_alloc_attr(void *cookie, int fg, int bg, int flg, long *attr) +rasops_vcons_pack_attr(void *cookie, int fg, int bg, int flg, long *attr) { struct rasops_screen *scr = cookie; - return scr->rs_ri->ri_alloc_attr(scr->rs_ri, fg, bg, flg, attr); + return scr->rs_ri->ri_pack_attr(scr->rs_ri, fg, bg, flg, attr); } void diff --git a/sys/dev/rasops/rasops.h b/sys/dev/rasops/rasops.h index 89de261be89..b292f464dcf 100644 --- a/sys/dev/rasops/rasops.h +++ b/sys/dev/rasops/rasops.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.h,v 1.23 2018/08/27 09:30:07 kettenis Exp $ */ +/* $OpenBSD: rasops.h,v 1.24 2020/05/25 06:45:26 jsg Exp $ */ /* $NetBSD: rasops.h,v 1.13 2000/06/13 13:36:54 ad Exp $ */ /*- @@ -135,7 +135,7 @@ struct rasops_info { int (*ri_erasecols)(void *, int, int, int, long); int (*ri_copyrows)(void *, int, int, int); int (*ri_eraserows)(void *, int, int, long); - int (*ri_alloc_attr)(void *, int, int, int, long *); + int (*ri_pack_attr)(void *, int, int, int, long *); }; #define DELTA(p, d, cast) ((p) = (cast)((caddr_t)(p) + (d))) diff --git a/sys/dev/usb/udl.c b/sys/dev/usb/udl.c index 7c59abc1382..bb1e9a184ac 100644 --- a/sys/dev/usb/udl.c +++ b/sys/dev/usb/udl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udl.c,v 1.91 2020/01/09 14:36:26 mpi Exp $ */ +/* $OpenBSD: udl.c,v 1.92 2020/05/25 06:45:26 jsg Exp $ */ /* * Copyright (c) 2009 Marcus Glocker <mglocker@openbsd.org> @@ -627,7 +627,7 @@ udl_alloc_screen(void *v, const struct wsscreen_descr *type, sc->sc_ri.ri_ops.putchar = udl_putchar; sc->sc_ri.ri_do_cursor = udl_do_cursor; - sc->sc_ri.ri_ops.alloc_attr(&sc->sc_ri, 0, 0, 0, attrp); + sc->sc_ri.ri_ops.pack_attr(&sc->sc_ri, 0, 0, 0, attrp); udl_stdscreen.nrows = sc->sc_ri.ri_rows; udl_stdscreen.ncols = sc->sc_ri.ri_cols; diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c index 7433d3a0ff4..ba5dd0bfae3 100644 --- a/sys/dev/wscons/wsdisplay.c +++ b/sys/dev/wscons/wsdisplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsdisplay.c,v 1.139 2020/05/10 20:50:55 kettenis Exp $ */ +/* $OpenBSD: wsdisplay.c,v 1.140 2020/05/25 06:45:26 jsg Exp $ */ /* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */ /* @@ -2692,7 +2692,7 @@ inverse_char(struct wsscreen *scr, u_int pos) } else if (dconf->scrdata->capabilities & WSSCREEN_REVERSE) { flags |= WSATTR_REVERSE; } - if ((*dconf->emulops->alloc_attr)(dconf->emulcookie, fg, bg, flags | + if ((*dconf->emulops->pack_attr)(dconf->emulcookie, fg, bg, flags | (ul ? WSATTR_UNDERLINE : 0), &attr) == 0) { cell.attr = attr; PUTCHAR(dconf, pos, cell.uc, cell.attr); diff --git a/sys/dev/wscons/wsdisplayvar.h b/sys/dev/wscons/wsdisplayvar.h index 170180a7363..c98824f564d 100644 --- a/sys/dev/wscons/wsdisplayvar.h +++ b/sys/dev/wscons/wsdisplayvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wsdisplayvar.h,v 1.35 2020/04/19 15:05:14 kettenis Exp $ */ +/* $OpenBSD: wsdisplayvar.h,v 1.36 2020/05/25 06:45:26 jsg Exp $ */ /* $NetBSD: wsdisplayvar.h,v 1.30 2005/02/04 02:10:49 perry Exp $ */ /* @@ -79,7 +79,7 @@ struct wsdisplay_emulops { 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); + int (*pack_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. */ #define WSCOL_BLACK 0 @@ -96,7 +96,6 @@ struct wsdisplay_emulops { #define WSATTR_BLINK 4 #define WSATTR_UNDERLINE 8 #define WSATTR_WSCOLORS 16 - /* XXX need a free_attr() ??? */ }; #define WSSCREEN_NAME_SIZE 16 diff --git a/sys/dev/wscons/wsemul_sun.c b/sys/dev/wscons/wsemul_sun.c index 4d2f02d046a..17bafbc4b5a 100644 --- a/sys/dev/wscons/wsemul_sun.c +++ b/sys/dev/wscons/wsemul_sun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsemul_sun.c,v 1.32 2015/08/28 00:03:53 deraadt Exp $ */ +/* $OpenBSD: wsemul_sun.c,v 1.33 2020/05/25 06:45:26 jsg Exp $ */ /* $NetBSD: wsemul_sun.c,v 1.11 2000/01/05 11:19:36 drochner Exp $ */ /* @@ -213,12 +213,12 @@ wsemul_sun_cnattach(const struct wsscreen_descr *type, void *cookie, int ccol, #define WS_KERNEL_MONOATTR 0 #endif if (type->capabilities & WSSCREEN_WSCOLORS) - res = (*edp->emulops->alloc_attr)(cookie, + res = (*edp->emulops->pack_attr)(cookie, WS_KERNEL_FG, WS_KERNEL_BG, WS_KERNEL_COLATTR | WSATTR_WSCOLORS, &edp->kernattr); else - res = (*edp->emulops->alloc_attr)(cookie, 0, 0, + res = (*edp->emulops->pack_attr)(cookie, 0, 0, WS_KERNEL_MONOATTR, &edp->kernattr); if (res) @@ -899,7 +899,7 @@ wsemul_sun_selectattribute(struct wsemul_sun_emuldata *edp, int flags, flags |= WSATTR_WSCOLORS; } - error = (*edp->emulops->alloc_attr)(edp->emulcookie, fgcol, bgcol, + error = (*edp->emulops->pack_attr)(edp->emulcookie, fgcol, bgcol, flags & WSATTR_WSCOLORS, bkgdattr); if (error) return (error); @@ -936,7 +936,7 @@ wsemul_sun_selectattribute(struct wsemul_sun_emuldata *edp, int flags, flags |= WSATTR_WSCOLORS; } } - error = (*edp->emulops->alloc_attr)(edp->emulcookie, fgcol, bgcol, + error = (*edp->emulops->pack_attr)(edp->emulcookie, fgcol, bgcol, flags, attr); if (error) return (error); diff --git a/sys/dev/wscons/wsemul_vt100.c b/sys/dev/wscons/wsemul_vt100.c index 7c032293bb8..077855a8ab8 100644 --- a/sys/dev/wscons/wsemul_vt100.c +++ b/sys/dev/wscons/wsemul_vt100.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsemul_vt100.c,v 1.37 2020/03/22 07:59:59 anton Exp $ */ +/* $OpenBSD: wsemul_vt100.c,v 1.38 2020/05/25 06:45:26 jsg Exp $ */ /* $NetBSD: wsemul_vt100.c,v 1.13 2000/04/28 21:56:16 mycroft Exp $ */ /* @@ -177,11 +177,11 @@ wsemul_vt100_cnattach(const struct wsscreen_descr *type, void *cookie, int ccol, #define WS_KERNEL_MONOATTR 0 #endif if (type->capabilities & WSSCREEN_WSCOLORS) - res = (*edp->emulops->alloc_attr)(cookie, + res = (*edp->emulops->pack_attr)(cookie, WS_KERNEL_FG, WS_KERNEL_BG, WS_KERNEL_COLATTR | WSATTR_WSCOLORS, &edp->kernattr); else - res = (*edp->emulops->alloc_attr)(cookie, 0, 0, + res = (*edp->emulops->pack_attr)(cookie, 0, 0, WS_KERNEL_MONOATTR, &edp->kernattr); if (res) edp->kernattr = defattr; diff --git a/sys/dev/wscons/wsemul_vt100_subr.c b/sys/dev/wscons/wsemul_vt100_subr.c index bcde0e6f6c9..5a4cda85819 100644 --- a/sys/dev/wscons/wsemul_vt100_subr.c +++ b/sys/dev/wscons/wsemul_vt100_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsemul_vt100_subr.c,v 1.22 2020/03/22 07:59:59 anton Exp $ */ +/* $OpenBSD: wsemul_vt100_subr.c,v 1.23 2020/05/25 06:45:26 jsg Exp $ */ /* $NetBSD: wsemul_vt100_subr.c,v 1.7 2000/04/28 21:56:16 mycroft Exp $ */ /* @@ -712,7 +712,7 @@ vt100_selectattribute(struct wsemul_vt100_emuldata *edp, int flags, int fgcol, printf("colors ignored (impossible)\n"); #endif } - error = (*edp->emulops->alloc_attr)(edp->emulcookie, fgcol, bgcol, + error = (*edp->emulops->pack_attr)(edp->emulcookie, fgcol, bgcol, flags & WSATTR_WSCOLORS, bkgdattr); if (error) return (error); @@ -764,7 +764,7 @@ vt100_selectattribute(struct wsemul_vt100_emuldata *edp, int flags, int fgcol, #endif } } - error = (*edp->emulops->alloc_attr)(edp->emulcookie, fgcol, bgcol, + error = (*edp->emulops->pack_attr)(edp->emulcookie, fgcol, bgcol, flags, attr); if (error) return (error); |