diff options
| author | leo <leo@NetBSD.org> | 1995-05-28 19:45:36 +0000 |
|---|---|---|
| committer | leo <leo@NetBSD.org> | 1995-05-28 19:45:36 +0000 |
| commit | 27a11d17352236a6a2840bc548161c48cb3aa76e (patch) | |
| tree | 44213c6a0af7ff16a424f848655301eae8c91fd2 /sys/arch/atari/dev | |
| parent | d66ffa3fe1af8bf01a6b610a78f04349180ae76b (diff) | |
Remove the pointer to view_t from the grf-structure, use viewview(dev)
to obtain the pointer instead. This removes a kernel-crash that happened
when something was written to the console while the console was being
resized.
Diffstat (limited to 'sys/arch/atari/dev')
| -rw-r--r-- | sys/arch/atari/dev/grf.c | 8 | ||||
| -rw-r--r-- | sys/arch/atari/dev/grfvar.h | 3 | ||||
| -rw-r--r-- | sys/arch/atari/dev/ite_cc.c | 23 | ||||
| -rw-r--r-- | sys/arch/atari/dev/view.c | 9 | ||||
| -rw-r--r-- | sys/arch/atari/dev/viewvar.h | 5 |
5 files changed, 26 insertions, 22 deletions
diff --git a/sys/arch/atari/dev/grf.c b/sys/arch/atari/dev/grf.c index 6d2e3d4ced1..dadb412e2f5 100644 --- a/sys/arch/atari/dev/grf.c +++ b/sys/arch/atari/dev/grf.c @@ -1,4 +1,4 @@ -/* $NetBSD: grf.c,v 1.3 1995/05/21 10:52:18 leo Exp $ */ +/* $NetBSD: grf.c,v 1.4 1995/05/28 19:45:36 leo Exp $ */ /* * Copyright (c) 1995 Leo Weppelman @@ -222,7 +222,6 @@ grfattach(pdp, dp, auxp) struct device *pdp, *dp; void *auxp; { - extern struct view_softc views[]; static struct grf_softc congrf; struct grf_softc *gp; int maj; @@ -243,7 +242,6 @@ void *auxp; congrf.g_flags = GF_ALIVE; congrf.g_mode = grf_mode; congrf.g_conpri = grfcc_cnprobe(); - congrf.g_view = views[0].view; /* XXX */ congrf.g_viewdev = congrf.g_unit; grfcc_iteinit(&congrf); grf_viewsync(&congrf); @@ -270,7 +268,6 @@ void *auxp; gp->g_flags = GF_ALIVE; gp->g_mode = grf_mode; gp->g_conpri = 0; - gp->g_view = views[gp->g_unit].view; /* XXX */ gp->g_viewdev = gp->g_unit; grfcc_iteinit(gp); grf_viewsync(gp); @@ -392,8 +389,7 @@ struct proc *p; * check to see whether it's a command recognized by the * view code. */ - if(gp->g_view != NULL) - return(viewioctl(gp->g_viewdev, cmd, data, flag, p)); + return(viewioctl(gp->g_viewdev, cmd, data, flag, p)); error = EINVAL; break; diff --git a/sys/arch/atari/dev/grfvar.h b/sys/arch/atari/dev/grfvar.h index 7f4fed36166..121fd265bca 100644 --- a/sys/arch/atari/dev/grfvar.h +++ b/sys/arch/atari/dev/grfvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: grfvar.h,v 1.1.1.1 1995/03/26 07:12:12 leo Exp $ */ +/* $NetBSD: grfvar.h,v 1.2 1995/05/28 19:45:38 leo Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -56,7 +56,6 @@ struct grf_softc { int g_unit; /* grf unit we want/have */ dev_t g_itedev; /* ite device number */ dev_t g_grfdev; /* grf device number */ - view_t *g_view; /* the view we're acting on */ dev_t g_viewdev; /* view device number */ caddr_t g_data; /* device dependent data */ int (*g_mode)(); diff --git a/sys/arch/atari/dev/ite_cc.c b/sys/arch/atari/dev/ite_cc.c index 9e5507b7a04..676c499e061 100644 --- a/sys/arch/atari/dev/ite_cc.c +++ b/sys/arch/atari/dev/ite_cc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ite_cc.c,v 1.3 1995/05/21 10:56:54 leo Exp $ */ +/* $NetBSD: ite_cc.c,v 1.4 1995/05/28 19:45:39 leo Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -190,12 +190,11 @@ ite_newsize(ip, winsz) struct ite_softc *ip; struct itewinsize *winsz; { - extern struct view_softc views[]; - struct view_size vs; - ipriv_t *cci = ip->priv; - u_long fbp, i, j; - int error = 0; - view_t *view; + struct view_size vs; + ipriv_t *cci = ip->priv; + u_long fbp, i, j; + int error = 0; + view_t *view; vs.x = winsz->x; vs.y = winsz->y; @@ -204,7 +203,7 @@ struct itewinsize *winsz; vs.depth = winsz->depth; error = viewioctl(ip->grf->g_viewdev, VIOCSSIZE, &vs, 0, -1); - view = ip->grf->g_view = views[ip->grf->g_viewdev].view; + view = viewview(ip->grf->g_viewdev); /* * Reinitialize our structs @@ -283,7 +282,7 @@ struct proc *p; struct itebell *ib; int error = 0; ipriv_t *cci = ip->priv; - view_t *view = ip->grf->g_view; + view_t *view = viewview(ip->grf->g_viewdev); switch (cmd) { case ITEIOCGWINSZ: @@ -300,7 +299,7 @@ struct proc *p; if(ite_newsize(ip, is)) error = ENOMEM; else { - view = ip->grf->g_view; + view = viewview(ip->grf->g_viewdev); ws.ws_row = ip->rows; ws.ws_col = ip->cols; ws.ws_xpixel = view->display.width; @@ -462,7 +461,7 @@ static void clear8(struct ite_softc *ip, int sy, int sx, int h, int w) { ipriv_t *cci = (ipriv_t *) ip->priv; - view_t *v = ip->grf->g_view; + view_t *v = viewview(ip->grf->g_viewdev); bmap_t *bm = v->bitmap; if((sx == 0) && (w == ip->cols)) { @@ -508,7 +507,7 @@ register struct ite_softc *ip; register int sy; int dir, sx, count; { - bmap_t *bm = ip->grf->g_view->bitmap; + bmap_t *bm = viewview(ip->grf->g_viewdev)->bitmap; u_char *pl = ((ipriv_t *)ip->priv)->row_ptr[sy]; if(dir == SCROLL_UP) { diff --git a/sys/arch/atari/dev/view.c b/sys/arch/atari/dev/view.c index 76ece56cd89..5bf32ccc076 100644 --- a/sys/arch/atari/dev/view.c +++ b/sys/arch/atari/dev/view.c @@ -1,4 +1,4 @@ -/* $NetBSD: view.c,v 1.4 1995/05/21 11:00:13 leo Exp $ */ +/* $NetBSD: view.c,v 1.5 1995/05/28 19:45:41 leo Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -414,3 +414,10 @@ int rw; return(0); return(1); } + +view_t * +viewview(dev) +dev_t dev; +{ + return(views[minor(dev)].view); +} diff --git a/sys/arch/atari/dev/viewvar.h b/sys/arch/atari/dev/viewvar.h index 3246a6b76c2..3c4b7c59de4 100644 --- a/sys/arch/atari/dev/viewvar.h +++ b/sys/arch/atari/dev/viewvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: viewvar.h,v 1.1.1.1 1995/03/26 07:12:14 leo Exp $ */ +/* $NetBSD: viewvar.h,v 1.2 1995/05/28 19:45:43 leo Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -58,3 +58,6 @@ enum view_unit_flags { VUF_MASK = ((1<<VUB_LAST_BIT)-1) }; +#ifdef _KERNEL +view_t *viewview __P((dev_t)); +#endif /* _KERNEL */ |
