Deleted Added
full compact
31c31
< * $FreeBSD: head/sys/sparc64/pci/psycho.c 88371 2001-12-21 21:35:47Z tmm $
---
> * $FreeBSD: head/sys/sparc64/pci/psycho.c 88823 2002-01-02 18:27:13Z tmm $
270c270
< struct ofw_nexus_reg *reg;
---
> struct upa_regs *reg;
275c275
< u_long pci_ctl;
---
> u_long pci_ctl, mlen;
277c277
< int n, i, nreg;
---
> int n, i, nreg, rid;
290d289
< sc->sc_bustag = nexus_get_bustag(dev);
322,324c321
< sc->sc_basepaddr = (vm_offset_t)reg[2].or_paddr;
<
< if (nreg <= 2) {
---
> if (nreg <= 2)
326,330c323,325
< }
< if (sparc64_bus_mem_map(UPA_BUS_SPACE, reg[2].or_paddr,
< reg[2].or_len, 0, NULL, (void **)&sc->sc_regs))
< panic("psycho_attach: cannot map regs");
< pci_ctl = reg[0].or_paddr;
---
> sc->sc_basepaddr = (vm_offset_t)UPA_REG_PHYS(&reg[2]);
> mlen = UPA_REG_SIZE(&reg[2]);
> pci_ctl = UPA_REG_PHYS(&reg[0]);
332,334c327
< sc->sc_basepaddr = (vm_offset_t)reg[0].or_paddr;
<
< if (nreg <= 0) {
---
> if (nreg <= 0)
336,340c329,331
< }
< if (sparc64_bus_mem_map(UPA_BUS_SPACE, reg[0].or_paddr,
< reg[0].or_len, 0, NULL, (void **)&sc->sc_regs))
< panic("psycho_attach: cannot map regs");
< pci_ctl = reg[0].or_paddr +
---
> sc->sc_basepaddr = (vm_offset_t)UPA_REG_PHYS(&reg[0]);
> mlen = UPA_REG_SIZE(reg);
> pci_ctl = sc->sc_basepaddr +
343a335,348
> if (pci_ctl < sc->sc_basepaddr)
> panic("psycho_attach: bogus pci control register location");
> pci_ctl -= sc->sc_basepaddr;
> rid = 0;
> sc->sc_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
> sc->sc_basepaddr, sc->sc_basepaddr + mlen - 1, mlen, RF_ACTIVE);
> if (sc->sc_mem_res == NULL ||
> rman_get_start(sc->sc_mem_res) != sc->sc_basepaddr)
> panic("psycho_attach: could not allocate device memory");
> sc->sc_bustag = rman_get_bustag(sc->sc_mem_res);
> sc->sc_bushandle = rman_get_bushandle(sc->sc_mem_res);
> if (sparc64_bus_mem_map(UPA_BUS_SPACE, sc->sc_basepaddr, mlen, 0, NULL,
> (void **)&sc->sc_regs))
> panic("psycho_attach: cannot map regs");
378,379c383,384
< csr = bus_space_read_8(sc->sc_bustag,
< (bus_space_handle_t)pci_ctl, offsetof(struct pci_ctl, pci_csr));
---
> csr = bus_space_read_8(sc->sc_bustag, sc->sc_bushandle,
> pci_ctl + offsetof(struct pci_ctl, pci_csr));
388,390c393,394
< bus_space_write_8(sc->sc_bustag,
< (bus_space_handle_t)pci_ctl, offsetof(struct pci_ctl, pci_csr),
< csr);
---
> bus_space_write_8(sc->sc_bustag, sc->sc_bushandle,
> pci_ctl + offsetof(struct pci_ctl, pci_csr), csr);
593c597
< sc->sc_irq[index] = bus_alloc_resource(dev, SYS_RES_IRQ, &rid,
---
> sc->sc_irq_res[index] = bus_alloc_resource(dev, SYS_RES_IRQ, &rid,
595c599
< if (sc->sc_irq[index] == NULL)
---
> if (sc->sc_irq_res[index] == NULL)
597c601
< bus_setup_intr(dev, sc->sc_irq[index], INTR_TYPE_MISC | iflags,
---
> bus_setup_intr(dev, sc->sc_irq_res[index], INTR_TYPE_MISC | iflags,