diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-03-01 21:42:38 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-03-01 21:42:38 +0000 |
commit | 79afd37038d81c7b8f7f6e5265fb1412bbec68fd (patch) | |
tree | 44ef4bba12ef3a4b5d5fd289e8125bfa1a4e9a9d /sys/arch | |
parent | 59dcae1e0128e7bebf63bdf1d6cb852a0cf6a509 (diff) |
Replace a few magic constants with proper #defines as pointed out by miod@.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc64/dev/raptor.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/arch/sparc64/dev/raptor.c b/sys/arch/sparc64/dev/raptor.c index b79bb719999..41a9c64b940 100644 --- a/sys/arch/sparc64/dev/raptor.c +++ b/sys/arch/sparc64/dev/raptor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raptor.c,v 1.3 2009/03/01 20:36:04 kettenis Exp $ */ +/* $OpenBSD: raptor.c,v 1.4 2009/03/01 21:42:37 kettenis Exp $ */ /* * Copyright (c) 2009 Mark Kettenis. @@ -45,6 +45,10 @@ * i128 driver. */ +#define I128_PCI_MW0 0x10 +#define I128_PCI_MW1 0x14 +#define I128_PCI_RBASE 0x20 + #define I128_WR_ADR 0x0000 #define I128_PAL_DAT 0x0004 #define I128_PEL_MASK 0x0008 @@ -202,14 +206,14 @@ raptor_attach(struct device *parent, struct device *self, void *aux) model = getpropstring(node, "model"); printf("%s: %s", self->dv_xname, model); - if (pci_mapreg_map(pa, 0x10, PCI_MAPREG_TYPE_MEM, + if (pci_mapreg_map(pa, I128_PCI_MW0, PCI_MAPREG_TYPE_MEM, BUS_SPACE_MAP_LINEAR, &sc->sc_memt, &sc->sc_memh, &sc->sc_membase, &sc->sc_memsize, 0)) { printf("\n%s: can't map video memory\n", self->dv_xname); return; } - if (pci_mapreg_map(pa, 0x20, PCI_MAPREG_TYPE_MEM, 0, + if (pci_mapreg_map(pa, I128_PCI_RBASE, PCI_MAPREG_TYPE_MEM, 0, &sc->sc_mmiot, &sc->sc_mmioh, &sc->sc_mmiobase, &sc->sc_mmiosize, 0)) { bus_space_unmap(sc->sc_memt, sc->sc_memh, sc->sc_memsize); @@ -537,7 +541,7 @@ raptor_init(struct raptor_softc *sc) bus_space_write_4(sc->sc_mmiot, sc->sc_mmioh, I128_PCTRL, 0); bus_space_write_4(sc->sc_mmiot, sc->sc_mmioh, I128_CLPTL, 0); bus_space_write_4(sc->sc_mmiot, sc->sc_mmioh, I128_CLPBR, - (4095 << 16) | 2047); + I128_COORDS(4095, 2047)); #if 0 /* XXX For some reason this makes schizo(4) freak out. */ bus_space_write_4(sc->sc_mmiot, sc->sc_mmioh, I128_ACNTRL, 0); |