FreeBSD kernel AGP device code
agp_ali.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <dev/agp/agppriv.h>
#include <dev/agp/agpreg.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
#include <vm/vm.h>
#include <vm/vm_object.h>
#include <vm/pmap.h>
Include dependency graph for agp_ali.c:

Go to the source code of this file.

Data Structures

struct  agp_ali_softc
 

Macros

#define M   1024*1024
 
#define AGP_ALI_TABLE_SIZE   nitems(agp_ali_table)
 

Functions

 __FBSDID ("$FreeBSD$")
 
static const char * agp_ali_match (device_t dev)
 
static int agp_ali_probe (device_t dev)
 
static int agp_ali_attach (device_t dev)
 
static int agp_ali_detach (device_t dev)
 
static u_int32_t agp_ali_get_aperture (device_t dev)
 
static int agp_ali_set_aperture (device_t dev, u_int32_t aperture)
 
static int agp_ali_bind_page (device_t dev, vm_offset_t offset, vm_offset_t physical)
 
static int agp_ali_unbind_page (device_t dev, vm_offset_t offset)
 
static void agp_ali_flush_tlb (device_t dev)
 
 DRIVER_MODULE (agp_ali, hostb, agp_ali_driver, agp_devclass, 0, 0)
 
 MODULE_DEPEND (agp_ali, agp, 1, 1, 1)
 
 MODULE_DEPEND (agp_ali, pci, 1, 1, 1)
 

Variables

static u_int32_t agp_ali_table []
 
static device_method_t agp_ali_methods []
 
static driver_t agp_ali_driver
 
static devclass_t agp_devclass
 

Macro Definition Documentation

◆ AGP_ALI_TABLE_SIZE

#define AGP_ALI_TABLE_SIZE   nitems(agp_ali_table)

Definition at line 176 of file agp_ali.c.

◆ M

#define M   1024*1024

Definition at line 161 of file agp_ali.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ agp_ali_attach()

static int agp_ali_attach ( device_t  dev)
static

◆ agp_ali_bind_page()

static int agp_ali_bind_page ( device_t  dev,
vm_offset_t  offset,
vm_offset_t  physical 
)
static

◆ agp_ali_detach()

static int agp_ali_detach ( device_t  dev)
static

Definition at line 141 of file agp_ali.c.

References AGP_ALI_ATTBASE, AGP_ALI_TLBCTRL, agp_free_cdev(), agp_free_gatt(), agp_free_res(), agp_ali_softc::gatt, and agp_ali_softc::initial_aperture.

Here is the call graph for this function:

◆ agp_ali_flush_tlb()

static void agp_ali_flush_tlb ( device_t  dev)
static

Definition at line 233 of file agp_ali.c.

References AGP_ALI_TLBCTRL.

◆ agp_ali_get_aperture()

static u_int32_t agp_ali_get_aperture ( device_t  dev)
static

Definition at line 179 of file agp_ali.c.

References AGP_ALI_ATTBASE, agp_ali_table, and AGP_ALI_TABLE_SIZE.

◆ agp_ali_match()

static const char * agp_ali_match ( device_t  dev)
static

Definition at line 58 of file agp_ali.c.

References agp_find_caps().

Referenced by agp_ali_probe().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ agp_ali_probe()

static int agp_ali_probe ( device_t  dev)
static

Definition at line 80 of file agp_ali.c.

References agp_ali_match().

Here is the call graph for this function:

◆ agp_ali_set_aperture()

static int agp_ali_set_aperture ( device_t  dev,
u_int32_t  aperture 
)
static

Definition at line 192 of file agp_ali.c.

References AGP_ALI_ATTBASE, agp_ali_table, AGP_ALI_TABLE_SIZE, and aperture.

◆ agp_ali_unbind_page()

static int agp_ali_unbind_page ( device_t  dev,
vm_offset_t  offset 
)
static

Definition at line 221 of file agp_ali.c.

References agp_gatt::ag_entries, agp_gatt::ag_virtual, agp_ali_softc::gatt, and offset.

◆ DRIVER_MODULE()

DRIVER_MODULE ( agp_ali  ,
hostb  ,
agp_ali_driver  ,
agp_devclass  ,
,
 
)

◆ MODULE_DEPEND() [1/2]

MODULE_DEPEND ( agp_ali  ,
agp  ,
,
,
 
)

◆ MODULE_DEPEND() [2/2]

MODULE_DEPEND ( agp_ali  ,
pci  ,
,
,
 
)

Variable Documentation

◆ agp_ali_driver

driver_t agp_ali_driver
static
Initial value:
= {
"agp",
sizeof(struct agp_ali_softc),
}
static device_method_t agp_ali_methods[]
Definition: agp_ali.c:239

Definition at line 262 of file agp_ali.c.

◆ agp_ali_methods

device_method_t agp_ali_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, agp_ali_probe),
DEVMETHOD(device_attach, agp_ali_attach),
DEVMETHOD(device_detach, agp_ali_detach),
DEVMETHOD(device_shutdown, bus_generic_shutdown),
DEVMETHOD(device_suspend, bus_generic_suspend),
DEVMETHOD(device_resume, bus_generic_resume),
DEVMETHOD(agp_get_aperture, agp_ali_get_aperture),
DEVMETHOD(agp_set_aperture, agp_ali_set_aperture),
DEVMETHOD(agp_bind_page, agp_ali_bind_page),
DEVMETHOD(agp_unbind_page, agp_ali_unbind_page),
DEVMETHOD(agp_flush_tlb, agp_ali_flush_tlb),
{ 0, 0 }
}
struct agp_memory * agp_generic_alloc_memory(device_t dev, int type, vm_size_t size)
Definition: agp.c:496
int agp_bind_memory(device_t dev, void *handle, vm_offset_t offset)
Definition: agp.c:982
void agp_free_memory(device_t dev, void *handle)
Definition: agp.c:976
int agp_generic_bind_memory(device_t dev, struct agp_memory *mem, vm_offset_t offset)
Definition: agp.c:543
int agp_generic_unbind_memory(device_t dev, struct agp_memory *mem)
Definition: agp.c:649
int agp_unbind_memory(device_t dev, void *handle)
Definition: agp.c:988
int agp_generic_free_memory(device_t dev, struct agp_memory *mem)
Definition: agp.c:528
void * agp_alloc_memory(device_t dev, int type, vm_size_t bytes)
Definition: agp.c:971
int agp_generic_enable(device_t dev, u_int32_t mode)
Definition: agp.c:466
int agp_enable(device_t dev, u_int32_t mode)
Definition: agp.c:966
static int agp_ali_set_aperture(device_t dev, u_int32_t aperture)
Definition: agp_ali.c:192
static void agp_ali_flush_tlb(device_t dev)
Definition: agp_ali.c:233
static int agp_ali_probe(device_t dev)
Definition: agp_ali.c:80
static u_int32_t agp_ali_get_aperture(device_t dev)
Definition: agp_ali.c:179
static int agp_ali_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical)
Definition: agp_ali.c:209
static int agp_ali_detach(device_t dev)
Definition: agp_ali.c:141
static int agp_ali_unbind_page(device_t dev, vm_offset_t offset)
Definition: agp_ali.c:221
static int agp_ali_attach(device_t dev)
Definition: agp_ali.c:96

Definition at line 239 of file agp_ali.c.

◆ agp_ali_table

u_int32_t agp_ali_table[]
static
Initial value:
= {
0,
1,
2,
4*M,
8*M,
0,
16*M,
32*M,
64*M,
128*M,
256*M,
}
#define M
Definition: agp_ali.c:161

Definition at line 163 of file agp_ali.c.

Referenced by agp_ali_get_aperture(), and agp_ali_set_aperture().

◆ agp_devclass

devclass_t agp_devclass
static

Definition at line 268 of file agp_ali.c.