Deleted Added
full compact
ofw_pci.c (256846) ofw_pci.c (256994)
1/*-
2 * Copyright (c) 2011 Nathan Whitehorn
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2011 Nathan Whitehorn
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/powerpc/ofw/ofw_pci.c 256846 2013-10-21 13:57:34Z nwhitehorn $");
28__FBSDID("$FreeBSD: head/sys/powerpc/ofw/ofw_pci.c 256994 2013-10-23 17:24:21Z nwhitehorn $");
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/module.h>
32#include <sys/bus.h>
33#include <sys/conf.h>
34#include <sys/kernel.h>
35
36#include <dev/ofw/openfirm.h>

--- 230 unchanged lines hidden (view full) ---

267 bzero(&reg, sizeof(reg));
268 reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) |
269 (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) |
270 (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT);
271
272 if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, &reg,
273 sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr),
274 &iparent, maskbuf))
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/module.h>
32#include <sys/bus.h>
33#include <sys/conf.h>
34#include <sys/kernel.h>
35
36#include <dev/ofw/openfirm.h>

--- 230 unchanged lines hidden (view full) ---

267 bzero(&reg, sizeof(reg));
268 reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) |
269 (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) |
270 (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT);
271
272 if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, &reg,
273 sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr),
274 &iparent, maskbuf))
275 return (MAP_IRQ(iparent, mintr));
275 return (ofw_bus_map_intr(dev, iparent, mintr));
276
277 /* Maybe it's a real interrupt, not an intpin */
278 if (pin > 4)
279 return (pin);
280
281 device_printf(bus, "could not route pin %d for device %d.%d\n",
282 pin, pci_get_slot(dev), pci_get_function(dev));
283 return (PCI_INVALID_IRQ);

--- 275 unchanged lines hidden ---
276
277 /* Maybe it's a real interrupt, not an intpin */
278 if (pin > 4)
279 return (pin);
280
281 device_printf(bus, "could not route pin %d for device %d.%d\n",
282 pin, pci_get_slot(dev), pci_get_function(dev));
283 return (PCI_INVALID_IRQ);

--- 275 unchanged lines hidden ---