Fix buglet that was missed when converting nubus to non pa==va mapping.
This commit is contained in:
parent
bc09c2e1b0
commit
3401cca400
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: grf.c,v 1.21 1995/04/29 20:23:39 briggs Exp $ */
|
||||
/* $NetBSD: grf.c,v 1.22 1995/07/01 23:40:38 briggs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
@ -289,7 +289,11 @@ grfmmap(dev, off, prot)
|
||||
int off;
|
||||
int prot;
|
||||
{
|
||||
return (grfaddr(grfcd.cd_devs[GRFUNIT(dev)], off));
|
||||
int unit = GRFUNIT(dev);
|
||||
struct grf_softc *gp;
|
||||
|
||||
gp = grfcd.cd_devs[unit];
|
||||
return (grfaddr(gp, off));
|
||||
}
|
||||
|
||||
int
|
||||
@ -337,9 +341,11 @@ grfaddr(gp, off)
|
||||
register int off;
|
||||
{
|
||||
register struct grfmode *gm = &gp->curr_mode;
|
||||
u_long addr;
|
||||
|
||||
if (off < gm->fbsize) {
|
||||
return (((u_int) gm->fbbase + off) >> PGSHIFT);
|
||||
addr = NUBUS_VIRT_TO_PHYS((u_int) gm->fbbase) + off;
|
||||
return mac68k_btop(addr);
|
||||
}
|
||||
/* bogus */
|
||||
return (-1);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nubus.h,v 1.7 1995/06/21 02:57:19 briggs Exp $ */
|
||||
/* $NetBSD: nubus.h,v 1.8 1995/07/01 23:40:40 briggs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Allen Briggs. All rights reserved.
|
||||
@ -218,6 +218,8 @@ typedef struct _NUBUS_EXEC_BLOCK {
|
||||
NUBUS_MIN_SLOT)
|
||||
#define NUBUS_SLOT_TO_BASE(x) (NuBusBase + \
|
||||
((((x)-NUBUS_MIN_SLOT) & 0xF) << 24))
|
||||
#define NUBUS_VIRT_TO_PHYS(x) ((x - NuBusBase) + \
|
||||
((0xF0 | NUBUS_MIN_SLOT) << 24))
|
||||
|
||||
struct nubus_softc {
|
||||
struct device sc_dev;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nubus.h,v 1.7 1995/06/21 02:57:19 briggs Exp $ */
|
||||
/* $NetBSD: nubus.h,v 1.8 1995/07/01 23:40:40 briggs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Allen Briggs. All rights reserved.
|
||||
@ -218,6 +218,8 @@ typedef struct _NUBUS_EXEC_BLOCK {
|
||||
NUBUS_MIN_SLOT)
|
||||
#define NUBUS_SLOT_TO_BASE(x) (NuBusBase + \
|
||||
((((x)-NUBUS_MIN_SLOT) & 0xF) << 24))
|
||||
#define NUBUS_VIRT_TO_PHYS(x) ((x - NuBusBase) + \
|
||||
((0xF0 | NUBUS_MIN_SLOT) << 24))
|
||||
|
||||
struct nubus_softc {
|
||||
struct device sc_dev;
|
||||
|
Loading…
Reference in New Issue
Block a user