diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-03-13 22:35:18 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-03-13 22:35:18 +0000 |
commit | 98884565b10691bf36c47542378551f18b924684 (patch) | |
tree | 0e828ccfe8396ac6da5858a83ae8e83ddad1888a /sys | |
parent | 5b993a9910e52a92a3f6667bade7a3aa224f8d51 (diff) |
Put wsscreen_list array inside the softc instead of on the stack; similar fix
as happened on hp300 and sparc* yesterday.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/mac68k/dev/grf_iv.c | 3 | ||||
-rw-r--r-- | sys/arch/mac68k/dev/macfb.c | 37 | ||||
-rw-r--r-- | sys/arch/mac68k/dev/macfbvar.h | 8 |
3 files changed, 24 insertions, 24 deletions
diff --git a/sys/arch/mac68k/dev/grf_iv.c b/sys/arch/mac68k/dev/grf_iv.c index 6d986810773..6ac8c2186db 100644 --- a/sys/arch/mac68k/dev/grf_iv.c +++ b/sys/arch/mac68k/dev/grf_iv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grf_iv.c,v 1.40 2006/01/30 20:47:15 miod Exp $ */ +/* $OpenBSD: grf_iv.c,v 1.41 2006/03/13 22:35:17 miod Exp $ */ /* $NetBSD: grf_iv.c,v 1.17 1997/02/20 00:23:27 scottr Exp $ */ /* @@ -367,7 +367,6 @@ macfb_obio_attach(struct device *parent, struct device *self, void *aux) dc->dc_depth = videobitdepth; dc->dc_rowbytes = videorowbytes; dc->dc_size = dc->dc_ht * dc->dc_rowbytes; - dc->nscreens = 0; /* Perform common video attachment. */ macfb_attach_common(sc, dc); diff --git a/sys/arch/mac68k/dev/macfb.c b/sys/arch/mac68k/dev/macfb.c index 6848b7c74af..26053c73f35 100644 --- a/sys/arch/mac68k/dev/macfb.c +++ b/sys/arch/mac68k/dev/macfb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: macfb.c,v 1.14 2006/03/13 22:07:55 miod Exp $ */ +/* $OpenBSD: macfb.c,v 1.15 2006/03/13 22:35:17 miod Exp $ */ /* $NetBSD: macfb.c,v 1.11 2005/01/15 16:00:59 chs Exp $ */ /* * Copyright (c) 1998 Matt DeBergalis @@ -168,13 +168,13 @@ macfb_init(struct macfb_devconfig *dc) memset((char *)dc->dc_vaddr + dc->dc_offset, bgcolor, dc->dc_rowbytes * dc->dc_ht); - strlcpy(dc->wsd.name, "std", sizeof(dc->wsd.name)); - dc->wsd.ncols = ri->ri_cols; - dc->wsd.nrows = ri->ri_rows; - dc->wsd.textops = &ri->ri_ops; - dc->wsd.fontwidth = ri->ri_font->fontwidth; - dc->wsd.fontheight = ri->ri_font->fontheight; - dc->wsd.capabilities = ri->ri_caps; + strlcpy(dc->dc_wsd.name, "std", sizeof(dc->dc_wsd.name)); + dc->dc_wsd.ncols = ri->ri_cols; + dc->dc_wsd.nrows = ri->ri_rows; + dc->dc_wsd.textops = &ri->ri_ops; + dc->dc_wsd.fontwidth = ri->ri_font->fontwidth; + dc->dc_wsd.fontheight = ri->ri_font->fontheight; + dc->dc_wsd.capabilities = ri->ri_caps; return (0); } @@ -333,8 +333,6 @@ void macfb_attach_common(struct macfb_softc *sc, struct macfb_devconfig *dc) { struct wsemuldisplaydev_attach_args waa; - struct wsscreen_descr *scrlist[1]; - struct wsscreen_list screenlist; int isconsole; /* Print hardware characteristics. */ @@ -352,7 +350,7 @@ macfb_attach_common(struct macfb_softc *sc, struct macfb_devconfig *dc) macfb_console_dc.dc_cmapregs = dc->dc_cmapregs; free(dc, M_DEVBUF); dc = sc->sc_dc = &macfb_console_dc; - dc->nscreens = 1; + dc->dc_nscreens = 1; macfb_color_setup(dc); /* XXX at this point we should reset the emulation to have * it pick better attributes for kernel messages. Oh well. */ @@ -362,12 +360,13 @@ macfb_attach_common(struct macfb_softc *sc, struct macfb_devconfig *dc) return; } - scrlist[0] = &dc->wsd; - screenlist.nscreens = 1; - screenlist.screens = (const struct wsscreen_descr **)scrlist; + dc->dc_scrlist[0] = &dc->dc_wsd; + dc->dc_screenlist.nscreens = 1; + dc->dc_screenlist.screens = + (const struct wsscreen_descr **)dc->dc_scrlist; waa.console = isconsole; - waa.scrdata = &screenlist; + waa.scrdata = &dc->dc_screenlist; waa.accessops = &macfb_accessops; waa.accesscookie = sc; @@ -451,7 +450,7 @@ macfb_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep, struct macfb_softc *sc = v; struct rasops_info *ri = &sc->sc_dc->dc_ri; - if (sc->sc_dc->nscreens > 0) + if (sc->sc_dc->dc_nscreens > 0) return (ENOMEM); *cookiep = ri; @@ -461,7 +460,7 @@ macfb_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep, WSATTR_WSCOLORS, defattrp); else ri->ri_ops.alloc_attr(ri, 0, 0, 0, defattrp); - sc->sc_dc->nscreens++; + sc->sc_dc->dc_nscreens++; return (0); } @@ -471,7 +470,7 @@ macfb_free_screen(void *v, void *cookie) { struct macfb_softc *sc = v; - sc->sc_dc->nscreens--; + sc->sc_dc->dc_nscreens--; } int @@ -576,7 +575,7 @@ macfb_cnattach() else ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); - wsdisplay_cnattach(&dc->wsd, ri, 0, 0, defattr); + wsdisplay_cnattach(&dc->dc_wsd, ri, 0, 0, defattr); macfb_consaddr = mac68k_vidphys; return (0); diff --git a/sys/arch/mac68k/dev/macfbvar.h b/sys/arch/mac68k/dev/macfbvar.h index dbdd29ab372..01ec96f6c5d 100644 --- a/sys/arch/mac68k/dev/macfbvar.h +++ b/sys/arch/mac68k/dev/macfbvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: macfbvar.h,v 1.6 2006/03/13 22:07:56 miod Exp $ */ +/* $OpenBSD: macfbvar.h,v 1.7 2006/03/13 22:35:17 miod Exp $ */ /* $NetBSD: macfbvar.h,v 1.3 2005/01/15 16:00:59 chs Exp $ */ /* $NetBSD: grfvar.h,v 1.11 1996/08/04 06:03:58 scottr Exp $ */ /* $NetBSD: grfioctl.h,v 1.5 1995/07/02 05:26:45 briggs Exp $ */ @@ -123,8 +123,10 @@ struct macfb_devconfig { void (*dc_setcolor)(void *, u_int, u_int); /* wsdisplay information */ - struct wsscreen_descr wsd; - int nscreens; + struct wsscreen_descr dc_wsd; + struct wsscreen_descr *dc_scrlist[1]; + struct wsscreen_list dc_screenlist; + int dc_nscreens; }; struct macfb_softc { |