Fix grfmap() as well as grfmmap().
This commit is contained in:
parent
932a8fc9af
commit
ed434b457d
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: grf.c,v 1.23 1995/07/02 00:30:25 briggs Exp $ */
|
/* $NetBSD: grf.c,v 1.24 1995/07/02 00:49:52 briggs Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1988 University of Utah.
|
* Copyright (c) 1988 University of Utah.
|
||||||
|
@ -368,14 +368,11 @@ grfmap(dev, addrp, p)
|
||||||
if (grfdebug & GDB_MMAP)
|
if (grfdebug & GDB_MMAP)
|
||||||
printf("grfmap(%d): addr %x\n", p->p_pid, *addrp);
|
printf("grfmap(%d): addr %x\n", p->p_pid, *addrp);
|
||||||
#endif
|
#endif
|
||||||
len = gp->curr_mode.fbsize;
|
len = gp->curr_mode.fbsize + gp->curr_mode.fboff;
|
||||||
flags = MAP_SHARED;
|
flags = MAP_SHARED | MAP_FIXED;
|
||||||
if (*addrp)
|
|
||||||
flags |= MAP_FIXED;
|
*addrp = NUBUS_VIRT_TO_PHYS((u_int) gp->curr_mode.fbbase);
|
||||||
else {
|
|
||||||
return 12;
|
|
||||||
*addrp = (caddr_t) 0x1000000; /* XXX */
|
|
||||||
}
|
|
||||||
vn.v_type = VCHR; /* XXX */
|
vn.v_type = VCHR; /* XXX */
|
||||||
vn.v_specinfo = &si; /* XXX */
|
vn.v_specinfo = &si; /* XXX */
|
||||||
vn.v_rdev = dev; /* XXX */
|
vn.v_rdev = dev; /* XXX */
|
||||||
|
@ -387,6 +384,11 @@ grfmap(dev, addrp, p)
|
||||||
/* Offset into page: */
|
/* Offset into page: */
|
||||||
*addrp += (unsigned long) gp->curr_mode.fboff & 0xfff;
|
*addrp += (unsigned long) gp->curr_mode.fboff & 0xfff;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
if (grfdebug & GDB_MMAP)
|
||||||
|
printf("grfmap(%d): returning addr %x\n", p->p_pid, *addrp);
|
||||||
|
#endif
|
||||||
|
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue