mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-22 17:24:23 +01:00
Update to new interrupt api.
This commit is contained in:
parent
45c95fa1d6
commit
d538e9fca6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37593
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: dwlpx.c,v 1.1 1998/06/10 10:55:41 dfr Exp $
|
||||
* $Id: dwlpx.c,v 1.2 1998/06/14 13:45:21 dfr Exp $
|
||||
*/
|
||||
|
||||
#include "opt_simos.h"
|
||||
@ -264,10 +264,12 @@ static int
|
||||
dwlpx_attach(device_t dev)
|
||||
{
|
||||
struct dwlpx_softc* sc = DWLPX_SOFTC(dev);
|
||||
device_t parent = device_get_parent(dev);
|
||||
vm_offset_t regs;
|
||||
dwlpx0 = dev;
|
||||
|
||||
chipset = dwlpx_chipset;
|
||||
chipset.bridge = dev;
|
||||
|
||||
regs = KV(DWLPX_BASE(kft_get_node(dev), kft_get_hosenum(dev)));
|
||||
sc->dmem_base = regs + (0L << 32);
|
||||
@ -277,7 +279,9 @@ dwlpx_attach(device_t dev)
|
||||
|
||||
*(u_int32_t*) (regs + PCIA_CTL(0)) = 1; /* Type1 config cycles */
|
||||
|
||||
BUS_MAP_INTR(device_get_parent(dev), dev, dwlpx_intr, 0);
|
||||
BUS_CONNECT_INTR(parent,
|
||||
BUS_CREATE_INTR(parent, dev,
|
||||
0, dwlpx_intr, 0));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -92,7 +92,8 @@ static device_method_t gbus_methods[] = {
|
||||
DEVMETHOD(bus_print_child, gbus_print_child),
|
||||
DEVMETHOD(bus_read_ivar, gbus_read_ivar),
|
||||
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
|
||||
DEVMETHOD(bus_map_intr, bus_generic_map_intr),
|
||||
DEVMETHOD(bus_create_intr, bus_generic_create_intr),
|
||||
DEVMETHOD(bus_connect_intr, bus_generic_connect_intr),
|
||||
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: kftxx.c,v 1.1 1998/06/10 10:55:49 dfr Exp $ */
|
||||
/* $Id: kftxx.c,v 1.2 1998/06/14 13:45:24 dfr Exp $ */
|
||||
/* $NetBSD: kftxx.c,v 1.9 1998/05/14 00:01:32 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
@ -89,7 +89,8 @@ static device_method_t kft_methods[] = {
|
||||
DEVMETHOD(bus_print_child, kft_print_child),
|
||||
DEVMETHOD(bus_read_ivar, kft_read_ivar),
|
||||
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
|
||||
DEVMETHOD(bus_map_intr, bus_generic_map_intr),
|
||||
DEVMETHOD(bus_create_intr, bus_generic_create_intr),
|
||||
DEVMETHOD(bus_connect_intr, bus_generic_connect_intr),
|
||||
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
@ -95,7 +95,8 @@ static devclass_t tlsb_devclass;
|
||||
static int tlsb_probe(device_t dev);
|
||||
static void tlsb_print_child(device_t dev, device_t child);
|
||||
static int tlsb_read_ivar(device_t dev, device_t child, int which, u_long* result);
|
||||
static int tlsb_map_intr(device_t dev, device_t child, driver_intr_t *intr, void *arg);
|
||||
static void *tlsb_create_intr(device_t dev, device_t child, int irq, driver_intr_t *intr, void *arg);
|
||||
static int tlsb_connect_intr(device_t dev, void* ih);
|
||||
|
||||
static device_method_t tlsb_methods[] = {
|
||||
/* Device interface */
|
||||
@ -108,7 +109,8 @@ static device_method_t tlsb_methods[] = {
|
||||
DEVMETHOD(bus_print_child, tlsb_print_child),
|
||||
DEVMETHOD(bus_read_ivar, tlsb_read_ivar),
|
||||
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
|
||||
DEVMETHOD(bus_map_intr, tlsb_map_intr),
|
||||
DEVMETHOD(bus_create_intr, tlsb_create_intr),
|
||||
DEVMETHOD(bus_connect_intr, tlsb_connect_intr),
|
||||
|
||||
{ 0, 0 }
|
||||
};
|
||||
@ -263,18 +265,27 @@ tlsb_read_ivar(device_t dev, device_t child,
|
||||
return ENOENT;
|
||||
}
|
||||
|
||||
static int
|
||||
tlsb_map_intr(device_t dev, device_t child, driver_intr_t *intr, void *arg)
|
||||
static void *
|
||||
tlsb_create_intr(device_t dev, device_t child,
|
||||
int irq, driver_intr_t *intr, void *arg)
|
||||
{
|
||||
struct tlsb_softc* sc = device_get_softc(dev);
|
||||
struct intr_mapping* i;
|
||||
i = malloc(sizeof(struct intr_mapping), M_DEVBUF, M_NOWAIT);
|
||||
if (!i)
|
||||
return ENOMEM;
|
||||
return NULL;
|
||||
i->intr = intr;
|
||||
i->arg = arg;
|
||||
STAILQ_INSERT_TAIL(&sc->intr_handlers, i, queue);
|
||||
return i;
|
||||
}
|
||||
|
||||
static int
|
||||
tlsb_connect_intr(device_t dev, void *ih)
|
||||
{
|
||||
struct tlsb_softc* sc = device_get_softc(dev);
|
||||
struct intr_mapping* i = ih;
|
||||
|
||||
STAILQ_INSERT_TAIL(&sc->intr_handlers, i, queue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: zs_tlsb.c,v 1.2 1998/06/14 13:45:28 dfr Exp $
|
||||
* $Id: zs_tlsb.c,v 1.3 1998/07/05 12:16:54 dfr Exp $
|
||||
*/
|
||||
/*
|
||||
* This driver is a hopeless hack to get the SimOS console working. A real
|
||||
@ -404,7 +404,8 @@ static device_method_t zsc_tlsb_methods[] = {
|
||||
DEVMETHOD(bus_print_child, zsc_tlsb_print_child),
|
||||
DEVMETHOD(bus_read_ivar, bus_generic_read_ivar),
|
||||
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
|
||||
DEVMETHOD(bus_map_intr, bus_generic_map_intr),
|
||||
DEVMETHOD(bus_create_intr, bus_generic_create_intr),
|
||||
DEVMETHOD(bus_connect_intr, bus_generic_connect_intr),
|
||||
|
||||
{ 0, 0 }
|
||||
};
|
||||
@ -453,6 +454,7 @@ static int
|
||||
zsc_tlsb_attach(device_t dev)
|
||||
{
|
||||
struct zsc_softc* sc = device_get_softc(dev);
|
||||
device_t parent = device_get_parent(dev);
|
||||
|
||||
bus_generic_attach(dev);
|
||||
|
||||
@ -460,7 +462,9 @@ zsc_tlsb_attach(device_t dev)
|
||||
sc->sc_a = ZS_SOFTC(0);
|
||||
sc->sc_b = ZS_SOFTC(1);
|
||||
|
||||
BUS_MAP_INTR(device_get_parent(dev), dev, zsc_tlsb_intr, sc);
|
||||
BUS_CONNECT_INTR(parent,
|
||||
BUS_CREATE_INTR(parent, dev,
|
||||
1, zsc_tlsb_intr, sc));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user