34#include <sys/malloc.h>
35#include <sys/kernel.h>
36#include <sys/module.h>
44#include <dev/pci/pcivar.h>
45#include <dev/pci/pcireg.h>
48#include <vm/vm_object.h>
60 if (pci_get_class(dev) != PCIC_BRIDGE
61 || pci_get_subclass(dev) != PCIS_BRIDGE_HOST)
67 switch (pci_get_devid(dev)) {
69 return (
"Ali M1671 host to AGP bridge");
71 return (
"Ali M1541 host to AGP bridge");
73 return (
"Ali M1621 host to AGP bridge");
84 if (resource_disabled(
"agp", device_get_unit(dev)))
88 device_set_desc(dev, desc);
89 return BUS_PROBE_DEFAULT;
109 device_printf(dev,
"bad initial aperture size, disabling\n");
122 if (AGP_SET_APERTURE(dev, AGP_GET_APERTURE(dev) / 2)) {
132 (attbase & 0xfff), 4);
176#define AGP_ALI_TABLE_SIZE nitems(agp_ali_table)
244 DEVMETHOD(device_shutdown, bus_generic_shutdown),
245 DEVMETHOD(device_suspend, bus_generic_suspend),
246 DEVMETHOD(device_resume, bus_generic_resume),
struct agp_memory * agp_generic_alloc_memory(device_t dev, int type, vm_size_t size)
int agp_bind_memory(device_t dev, void *handle, vm_offset_t offset)
void agp_free_memory(device_t dev, void *handle)
int agp_generic_bind_memory(device_t dev, struct agp_memory *mem, vm_offset_t offset)
int agp_generic_unbind_memory(device_t dev, struct agp_memory *mem)
int agp_unbind_memory(device_t dev, void *handle)
int agp_generic_detach(device_t dev)
int agp_generic_attach(device_t dev)
int agp_generic_free_memory(device_t dev, struct agp_memory *mem)
u_int8_t agp_find_caps(device_t dev)
void agp_free_res(device_t dev)
void agp_free_cdev(device_t dev)
void * agp_alloc_memory(device_t dev, int type, vm_size_t bytes)
void agp_free_gatt(struct agp_gatt *gatt)
struct agp_gatt * agp_alloc_gatt(device_t dev)
int agp_generic_enable(device_t dev, u_int32_t mode)
int agp_enable(device_t dev, u_int32_t mode)
MODULE_DEPEND(agp_ali, agp, 1, 1, 1)
static u_int32_t agp_ali_table[]
static int agp_ali_set_aperture(device_t dev, u_int32_t aperture)
static void agp_ali_flush_tlb(device_t dev)
static int agp_ali_probe(device_t dev)
static u_int32_t agp_ali_get_aperture(device_t dev)
DRIVER_MODULE(agp_ali, hostb, agp_ali_driver, agp_devclass, 0, 0)
#define AGP_ALI_TABLE_SIZE
static const char * agp_ali_match(device_t dev)
static int agp_ali_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical)
static devclass_t agp_devclass
static device_method_t agp_ali_methods[]
static int agp_ali_detach(device_t dev)
static int agp_ali_unbind_page(device_t dev, vm_offset_t offset)
static driver_t agp_ali_driver
static int agp_ali_attach(device_t dev)
u_int32_t initial_aperture