ofw_bus_subr.c (302408) | ofw_bus_subr.c (308333) |
---|---|
1/*- 2 * Copyright (c) 2001 - 2003 by Thomas Moestl <tmm@FreeBSD.org>. 3 * Copyright (c) 2005 Marius Strobl <marius@FreeBSD.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001 - 2003 by Thomas Moestl <tmm@FreeBSD.org>. 3 * Copyright (c) 2005 Marius Strobl <marius@FreeBSD.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: stable/11/sys/dev/ofw/ofw_bus_subr.c 301453 2016-06-05 16:20:12Z skra $"); | 31__FBSDID("$FreeBSD: stable/11/sys/dev/ofw/ofw_bus_subr.c 308333 2016-11-05 10:23:02Z mmel $"); |
32 33#include "opt_platform.h" 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/bus.h> 37#include <sys/errno.h> 38#include <sys/libkern.h> 39 --- 471 unchanged lines hidden (view full) --- 511 if (OF_hasprop(iparent, "interrupt-controller")) 512 break; 513 } 514 iparent = OF_xref_from_node(iparent); 515 } 516 return (iparent); 517} 518 | 32 33#include "opt_platform.h" 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/bus.h> 37#include <sys/errno.h> 38#include <sys/libkern.h> 39 --- 471 unchanged lines hidden (view full) --- 511 if (OF_hasprop(iparent, "interrupt-controller")) 512 break; 513 } 514 iparent = OF_xref_from_node(iparent); 515 } 516 return (iparent); 517} 518 |
519#ifndef INTRNG | |
520int 521ofw_bus_intr_to_rl(device_t dev, phandle_t node, 522 struct resource_list *rl, int *rlen) 523{ 524 phandle_t iparent; 525 uint32_t icells, *intr; 526 int err, i, irqnum, nintr, rid; 527 boolean_t extended; --- 49 unchanged lines hidden (view full) --- 577 irqnum = ofw_bus_map_intr(dev, iparent, icells, &intr[i]); 578 resource_list_add(rl, SYS_RES_IRQ, rid++, irqnum, irqnum, 1); 579 } 580 if (rlen != NULL) 581 *rlen = rid; 582 free(intr, M_OFWPROP); 583 return (err); 584} | 519int 520ofw_bus_intr_to_rl(device_t dev, phandle_t node, 521 struct resource_list *rl, int *rlen) 522{ 523 phandle_t iparent; 524 uint32_t icells, *intr; 525 int err, i, irqnum, nintr, rid; 526 boolean_t extended; --- 49 unchanged lines hidden (view full) --- 576 irqnum = ofw_bus_map_intr(dev, iparent, icells, &intr[i]); 577 resource_list_add(rl, SYS_RES_IRQ, rid++, irqnum, irqnum, 1); 578 } 579 if (rlen != NULL) 580 *rlen = rid; 581 free(intr, M_OFWPROP); 582 return (err); 583} |
585#endif | |
586 587int 588ofw_bus_intr_by_rid(device_t dev, phandle_t node, int wanted_rid, 589 phandle_t *producer, int *ncells, pcell_t **cells) 590{ 591 phandle_t iparent; 592 uint32_t icells, *intr; 593 int err, i, nintr, rid; --- 338 unchanged lines hidden --- | 584 585int 586ofw_bus_intr_by_rid(device_t dev, phandle_t node, int wanted_rid, 587 phandle_t *producer, int *ncells, pcell_t **cells) 588{ 589 phandle_t iparent; 590 uint32_t icells, *intr; 591 int err, i, nintr, rid; --- 338 unchanged lines hidden --- |