diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-12-15 13:56:49 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-12-15 13:56:49 +0000 |
commit | e4e83e0395766865b32e31ffd4c99492e95021a9 (patch) | |
tree | 3cdf19cc2481595d362927e4907c24c03ed2cea4 /sys/arch/sparc/dev/cgfour.c | |
parent | 52870c9193cefaa9a2f79fab1b0a1e8076290b55 (diff) |
new mapdev/()/mapiodev() calling convention uses "struct rom_reg *" to supply
base plus an offset
new dvma routines
Diffstat (limited to 'sys/arch/sparc/dev/cgfour.c')
-rw-r--r-- | sys/arch/sparc/dev/cgfour.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/arch/sparc/dev/cgfour.c b/sys/arch/sparc/dev/cgfour.c index 74f5b470733..96b604662b3 100644 --- a/sys/arch/sparc/dev/cgfour.c +++ b/sys/arch/sparc/dev/cgfour.c @@ -82,7 +82,8 @@ struct cgfour_softc { struct device sc_dev; /* base device */ struct fbdevice sc_fb; /* frame buffer device */ volatile struct bt_regs *sc_bt; /* Brooktree registers */ - caddr_t sc_phys; /* display RAM (phys addr) */ + struct rom_reg sc_phys; /* display RAM (phys addr) */ + int sc_bustype; /* type of bus we live on */ int sc_blanked; /* true if blanked */ union bt_cmap sc_cmap; /* Brooktree color map */ }; @@ -142,7 +143,6 @@ cgfourattach(parent, self, args) register struct confargs *ca = args; register int node = 0, ramsize, i; register volatile struct bt_regs *bt; - register struct cgfour_all *p; int isconsole; sc->sc_fb.fb_driver = &cgfourfbdriver; @@ -172,19 +172,19 @@ cgfourattach(parent, self, args) * the mmap code down below doesn't use it all. Ridiculous! */ isconsole = node == fbnode && fbconstty != NULL; - p = (struct cgfour_all *)ca->ca_ra.ra_paddr; if (ca->ca_ra.ra_vaddr == NULL) { /* this probably cannot happen, but what the heck */ - ca->ca_ra.ra_vaddr = mapiodev(p->ba_overlay, ramsize, - ca->ca_bustype); + ca->ca_ra.ra_vaddr = mapiodev(ca->ca_ra.ra_reg, 0, + ramsize, ca->ca_bustype); } sc->sc_fb.fb_pixels = (char *)((int)ca->ca_ra.ra_vaddr + CG4REG_COLOUR - CG4REG_OVERLAY); - sc->sc_bt = bt = (volatile struct bt_regs *) - mapiodev((caddr_t)&p->ba_btreg, sizeof(p->ba_btreg), - ca->ca_bustype); - sc->sc_phys = p->ba_overlay; +#define O(memb) ((u_int)(&((struct cgfour_all *)0)->memb)) + sc->sc_bt = bt = (volatile struct bt_regs *)mapiodev(ca->ca_ra.ra_reg, + O(ba_btreg), sizeof(struct bt_regs), ca->ca_bustype); + sc->sc_phys = ca->ca_ra.ra_reg[0]; + sc->sc_bustype = ca->ca_bustype; /* grab initial (current) color map */ bt->bt_addr = 0; @@ -406,5 +406,5 @@ cgfourmmap(dev, off, prot) poff = off + (CG4REG_COLOUR - CG4REG_OVERLAY) - START_COLOUR; else return (-1); - return ((u_int)sc->sc_phys + poff + PMAP_OBIO + PMAP_NC); + return (REG2PHYS(&sc->sc_phys, off, sc->sc_bustype) | PMAP_NC); } |