mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
Replace __RMAN_RESOURCE_VISIBLE with calls to public entry points
in rman module.
This commit is contained in:
parent
2b35175c8a
commit
39f718f3ca
8 changed files with 28 additions and 33 deletions
|
|
@ -27,7 +27,6 @@
|
|||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
|
|
@ -430,7 +429,7 @@ mcpcia_setup_intr(device_t dev, device_t child, struct resource *ir, int flags,
|
|||
struct mcpcia_softc *sc = MCPCIA_SOFTC(dev);
|
||||
int mid, birq, irq, error, h;
|
||||
|
||||
irq = ir->r_start;
|
||||
irq = rman_get_start(ir);
|
||||
mid = mcbus_get_mid(dev);
|
||||
|
||||
error = rman_activate_resource(ir);
|
||||
|
|
@ -469,7 +468,7 @@ mcpcia_teardown_intr(device_t dev, device_t child, struct resource *i, void *c)
|
|||
struct mcpcia_softc *sc = MCPCIA_SOFTC(dev);
|
||||
|
||||
mtx_lock_spin(&icu_lock);
|
||||
mcpcia_disable_intr(sc, i->r_start);
|
||||
mcpcia_disable_intr(sc, rman_get_start(i));
|
||||
mtx_unlock_spin(&icu_lock);
|
||||
alpha_teardown_intr(c);
|
||||
return (rman_deactivate_resource(i));
|
||||
|
|
|
|||
|
|
@ -91,7 +91,6 @@ __FBSDID("$FreeBSD$");
|
|||
|
||||
#include "opt_cpu.h"
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
|
|
@ -545,27 +544,27 @@ cia_setup_intr(device_t dev, device_t child,
|
|||
struct resource *irq, int flags,
|
||||
driver_intr_t *intr, void *arg, void **cookiep)
|
||||
{
|
||||
int error;
|
||||
int error, start;
|
||||
|
||||
error = rman_activate_resource(irq);
|
||||
if (error)
|
||||
return error;
|
||||
start = rman_get_start(irq);
|
||||
|
||||
error = alpha_setup_intr(
|
||||
device_get_nameunit(child ? child : dev),
|
||||
0x900 + (irq->r_start << 4), intr, arg, flags, cookiep,
|
||||
&intrcnt[INTRCNT_EB164_IRQ + irq->r_start],
|
||||
0x900 + (start << 4), intr, arg, flags, cookiep,
|
||||
&intrcnt[INTRCNT_EB164_IRQ + start],
|
||||
cia_disable_intr, cia_enable_intr);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
/* Enable PCI interrupt */
|
||||
mtx_lock_spin(&icu_lock);
|
||||
platform.pci_intr_enable(irq->r_start);
|
||||
platform.pci_intr_enable(start);
|
||||
mtx_unlock_spin(&icu_lock);
|
||||
|
||||
device_printf(child, "interrupting at CIA irq %d\n",
|
||||
(int) irq->r_start);
|
||||
device_printf(child, "interrupting at CIA irq %d\n", start);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$");
|
|||
|
||||
#include "opt_isa.h"
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
|
|
@ -160,7 +159,7 @@ alpha_platform_pci_setup_intr(device_t dev, device_t child,
|
|||
* XXX - If we aren't the resource manager for this IRQ, assume that
|
||||
* it is actually handled by the ISA PIC.
|
||||
*/
|
||||
if(irq->r_rm != &irq_rman)
|
||||
if (!rman_is_region_manager(irq, &irq_rman))
|
||||
return isa_setup_intr(dev, child, irq, flags, intr, arg,
|
||||
cookiep);
|
||||
else
|
||||
|
|
@ -178,7 +177,7 @@ alpha_platform_pci_teardown_intr(device_t dev, device_t child,
|
|||
* XXX - If we aren't the resource manager for this IRQ, assume that
|
||||
* it is actually handled by the ISA PIC.
|
||||
*/
|
||||
if(irq->r_rm != &irq_rman)
|
||||
if (!rman_is_region_manager(irq, &irq_rman))
|
||||
return isa_teardown_intr(dev, child, irq, cookie);
|
||||
else
|
||||
#endif
|
||||
|
|
@ -224,6 +223,7 @@ alpha_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
|||
struct rman *rm;
|
||||
struct resource *rv;
|
||||
void *va;
|
||||
int rstart;
|
||||
|
||||
switch (type) {
|
||||
case SYS_RES_IRQ:
|
||||
|
|
@ -252,17 +252,18 @@ alpha_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
|||
if (rv == 0)
|
||||
return 0;
|
||||
|
||||
rstart = rman_get_start(rv);
|
||||
rman_set_bustag(rv, ALPHAPCI_GET_BUSTAG(bus, type));
|
||||
rman_set_bushandle(rv, rv->r_start);
|
||||
rman_set_bushandle(rv, rstart);
|
||||
switch (type) {
|
||||
case SYS_RES_MEMORY:
|
||||
va = 0;
|
||||
if (flags & PCI_RF_DENSE)
|
||||
va = ALPHAPCI_CVT_DENSE(bus, rv->r_start);
|
||||
va = ALPHAPCI_CVT_DENSE(bus, rstart);
|
||||
else if (flags & PCI_RF_BWX)
|
||||
va = ALPHAPCI_CVT_BWX(bus, rv->r_start);
|
||||
va = ALPHAPCI_CVT_BWX(bus, rstart);
|
||||
else
|
||||
va = (void *)ALPHA_PHYS_TO_K0SEG(rv->r_start);
|
||||
va = (void *)ALPHA_PHYS_TO_K0SEG(rstart);
|
||||
rman_set_virtual(rv, va);
|
||||
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@
|
|||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
|
|
@ -536,12 +535,12 @@ t2_setup_intr(device_t dev, device_t child,
|
|||
struct resource *irq, int flags,
|
||||
void *intr, void *arg, void **cookiep)
|
||||
{
|
||||
int error, vector, stdio_irq;
|
||||
int error, vector, stdio_irq, start;
|
||||
const char *name;
|
||||
device_t bus, parent;
|
||||
|
||||
name = device_get_nameunit(dev);
|
||||
stdio_irq = irq->r_start;
|
||||
start = stdio_irq = rman_get_start(irq);
|
||||
if (strncmp(name, "eisa", 4) == 0) {
|
||||
if ((stdio_irq != 6 ) && (stdio_irq != 3 )) {
|
||||
stdio_irq =
|
||||
|
|
@ -568,7 +567,7 @@ t2_setup_intr(device_t dev, device_t child,
|
|||
|
||||
error = alpha_setup_intr(device_get_nameunit(child ? child : dev),
|
||||
vector, intr, arg, flags, cookiep,
|
||||
&intrcnt[irq->r_start], t2_disable_vec, t2_enable_vec);
|
||||
&intrcnt[start], t2_disable_vec, t2_enable_vec);
|
||||
|
||||
if (error)
|
||||
return error;
|
||||
|
|
@ -579,7 +578,7 @@ t2_setup_intr(device_t dev, device_t child,
|
|||
if (bootverbose != 0)
|
||||
device_printf(child,
|
||||
"interrupting at T2 irq %d (stdio irq %d)\n",
|
||||
(int) irq->r_start, stdio_irq);
|
||||
start, stdio_irq);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -589,7 +588,7 @@ t2_teardown_intr(device_t dev, device_t child,
|
|||
{
|
||||
int mask;
|
||||
|
||||
mask = irq_to_mask[irq->r_start];
|
||||
mask = irq_to_mask[rman_get_start(irq)];
|
||||
|
||||
/* Disable interrupt */
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$");
|
|||
|
||||
#include "opt_cpu.h"
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
|
|
@ -337,26 +336,27 @@ tsunami_setup_intr(device_t dev, device_t child,
|
|||
struct resource *irq, int flags,
|
||||
driver_intr_t *intr, void *arg, void **cookiep)
|
||||
{
|
||||
int error;
|
||||
int error, start;
|
||||
|
||||
error = rman_activate_resource(irq);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
start = rman_get_start(irq);
|
||||
|
||||
error = alpha_setup_intr(device_get_nameunit(child ? child : dev),
|
||||
0x900 + (irq->r_start << 4), intr, arg, flags, cookiep,
|
||||
&intrcnt[INTRCNT_EB164_IRQ + irq->r_start],
|
||||
0x900 + (start << 4), intr, arg, flags, cookiep,
|
||||
&intrcnt[INTRCNT_EB164_IRQ + start],
|
||||
tsunami_disable_intr_vec, tsunami_enable_intr_vec);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
/* Enable PCI interrupt */
|
||||
mtx_lock_spin(&icu_lock);
|
||||
platform.pci_intr_enable(irq->r_start);
|
||||
platform.pci_intr_enable(start);
|
||||
mtx_unlock_spin(&icu_lock);
|
||||
|
||||
device_printf(child, "interrupting at TSUNAMI irq %d\n",
|
||||
(int) irq->r_start);
|
||||
device_printf(child, "interrupting at TSUNAMI irq %d\n", start);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@
|
|||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#define __RMAN_RESOURCE_VISIBLE
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
|
|
|
|||
Loading…
Reference in a new issue