mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-06 13:09:50 +00:00
Merged from sys/i386/isa/isa_dma.c revision 1.6.
This commit is contained in:
parent
3606d88937
commit
9e3aaab780
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=62201
@ -53,7 +53,10 @@
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/bus.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/module.h>
|
||||
#ifdef PC98
|
||||
#include <machine/md_var.h>
|
||||
#endif
|
||||
@ -65,8 +68,8 @@
|
||||
#else
|
||||
#include <i386/isa/isa.h>
|
||||
#endif
|
||||
#include <i386/isa/isa_dma.h>
|
||||
#include <i386/isa/ic/i8237.h>
|
||||
#include <isa/isavar.h>
|
||||
|
||||
/*
|
||||
** Register definitions for DMA controller 1 (channels 0..3):
|
||||
@ -565,3 +568,48 @@ isa_dmastop(int chan)
|
||||
}
|
||||
return(isa_dmastatus(chan));
|
||||
}
|
||||
|
||||
/*
|
||||
* Attach to the ISA PnP descriptor for the AT DMA controller
|
||||
*/
|
||||
static struct isa_pnp_id atdma_ids[] = {
|
||||
{ 0x0002d041 /* PNP0200 */, "AT DMA controller" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static int
|
||||
atdma_probe(device_t dev)
|
||||
{
|
||||
int result;
|
||||
|
||||
if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, atdma_ids)) <= 0)
|
||||
device_quiet(dev);
|
||||
return(result);
|
||||
}
|
||||
|
||||
static int
|
||||
atdma_attach(device_t dev)
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
static device_method_t atdma_methods[] = {
|
||||
/* Device interface */
|
||||
DEVMETHOD(device_probe, atdma_probe),
|
||||
DEVMETHOD(device_attach, atdma_attach),
|
||||
DEVMETHOD(device_detach, bus_generic_detach),
|
||||
DEVMETHOD(device_shutdown, bus_generic_shutdown),
|
||||
DEVMETHOD(device_suspend, bus_generic_suspend),
|
||||
DEVMETHOD(device_resume, bus_generic_resume),
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
static driver_t atdma_driver = {
|
||||
"atdma",
|
||||
atdma_methods,
|
||||
1, /* no softc */
|
||||
};
|
||||
|
||||
static devclass_t atdma_devclass;
|
||||
|
||||
DRIVER_MODULE(atdma, isa, atdma_driver, atdma_devclass, 0, 0);
|
||||
|
@ -53,7 +53,10 @@
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/bus.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/module.h>
|
||||
#ifdef PC98
|
||||
#include <machine/md_var.h>
|
||||
#endif
|
||||
@ -65,8 +68,8 @@
|
||||
#else
|
||||
#include <i386/isa/isa.h>
|
||||
#endif
|
||||
#include <i386/isa/isa_dma.h>
|
||||
#include <i386/isa/ic/i8237.h>
|
||||
#include <isa/isavar.h>
|
||||
|
||||
/*
|
||||
** Register definitions for DMA controller 1 (channels 0..3):
|
||||
@ -565,3 +568,48 @@ isa_dmastop(int chan)
|
||||
}
|
||||
return(isa_dmastatus(chan));
|
||||
}
|
||||
|
||||
/*
|
||||
* Attach to the ISA PnP descriptor for the AT DMA controller
|
||||
*/
|
||||
static struct isa_pnp_id atdma_ids[] = {
|
||||
{ 0x0002d041 /* PNP0200 */, "AT DMA controller" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static int
|
||||
atdma_probe(device_t dev)
|
||||
{
|
||||
int result;
|
||||
|
||||
if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, atdma_ids)) <= 0)
|
||||
device_quiet(dev);
|
||||
return(result);
|
||||
}
|
||||
|
||||
static int
|
||||
atdma_attach(device_t dev)
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
static device_method_t atdma_methods[] = {
|
||||
/* Device interface */
|
||||
DEVMETHOD(device_probe, atdma_probe),
|
||||
DEVMETHOD(device_attach, atdma_attach),
|
||||
DEVMETHOD(device_detach, bus_generic_detach),
|
||||
DEVMETHOD(device_shutdown, bus_generic_shutdown),
|
||||
DEVMETHOD(device_suspend, bus_generic_suspend),
|
||||
DEVMETHOD(device_resume, bus_generic_resume),
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
static driver_t atdma_driver = {
|
||||
"atdma",
|
||||
atdma_methods,
|
||||
1, /* no softc */
|
||||
};
|
||||
|
||||
static devclass_t atdma_devclass;
|
||||
|
||||
DRIVER_MODULE(atdma, isa, atdma_driver, atdma_devclass, 0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user