FreeBSD kernel AGP device code
agp_via.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_via.c:

Go to the source code of this file.

Data Structures

struct  agp_via_softc
 

Macros

#define REG_GARTCTRL   0
 
#define REG_APSIZE   1
 
#define REG_ATTBASE   2
 

Functions

 __FBSDID ("$FreeBSD$")
 
static const char * agp_via_match (device_t dev)
 
static int agp_via_probe (device_t dev)
 
static int agp_via_attach (device_t dev)
 
static int agp_via_detach (device_t dev)
 
static u_int32_t agp_via_get_aperture (device_t dev)
 
static int agp_via_set_aperture (device_t dev, u_int32_t aperture)
 
static int agp_via_bind_page (device_t dev, vm_offset_t offset, vm_offset_t physical)
 
static int agp_via_unbind_page (device_t dev, vm_offset_t offset)
 
static void agp_via_flush_tlb (device_t dev)
 
 DRIVER_MODULE (agp_via, hostb, agp_via_driver, agp_devclass, 0, 0)
 
 MODULE_DEPEND (agp_via, agp, 1, 1, 1)
 
 MODULE_DEPEND (agp_via, pci, 1, 1, 1)
 

Variables

static int via_v2_regs []
 
static int via_v3_regs []
 
static device_method_t agp_via_methods []
 
static driver_t agp_via_driver
 
static devclass_t agp_devclass
 

Macro Definition Documentation

◆ REG_APSIZE

#define REG_APSIZE   1

Definition at line 52 of file agp_via.c.

◆ REG_ATTBASE

#define REG_ATTBASE   2

Definition at line 53 of file agp_via.c.

◆ REG_GARTCTRL

#define REG_GARTCTRL   0

Definition at line 51 of file agp_via.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ agp_via_attach()

static int agp_via_attach ( device_t  dev)
static

◆ agp_via_bind_page()

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

◆ agp_via_detach()

static int agp_via_detach ( device_t  dev)
static

Definition at line 226 of file agp_via.c.

References agp_free_cdev(), agp_free_gatt(), agp_free_res(), agp_via_softc::gatt, agp_via_softc::initial_aperture, REG_ATTBASE, REG_GARTCTRL, and agp_via_softc::regs.

Here is the call graph for this function:

◆ agp_via_flush_tlb()

static void agp_via_flush_tlb ( device_t  dev)
static

Definition at line 377 of file agp_via.c.

References REG_GARTCTRL, agp_via_softc::regs, and via_v2_regs.

◆ agp_via_get_aperture()

static u_int32_t agp_via_get_aperture ( device_t  dev)
static

Definition at line 242 of file agp_via.c.

References REG_APSIZE, agp_via_softc::regs, and via_v2_regs.

◆ agp_via_match()

static const char * agp_via_match ( device_t  dev)
static

Definition at line 68 of file agp_via.c.

References agp_find_caps().

Referenced by agp_via_probe().

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

◆ agp_via_probe()

static int agp_via_probe ( device_t  dev)
static

Definition at line 146 of file agp_via.c.

References agp_via_match().

Here is the call graph for this function:

◆ agp_via_set_aperture()

static int agp_via_set_aperture ( device_t  dev,
u_int32_t  aperture 
)
static

Definition at line 290 of file agp_via.c.

References aperture, REG_APSIZE, agp_via_softc::regs, and via_v2_regs.

◆ agp_via_unbind_page()

static int agp_via_unbind_page ( device_t  dev,
vm_offset_t  offset 
)
static

Definition at line 365 of file agp_via.c.

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

◆ DRIVER_MODULE()

DRIVER_MODULE ( agp_via  ,
hostb  ,
agp_via_driver  ,
agp_devclass  ,
,
 
)

◆ MODULE_DEPEND() [1/2]

MODULE_DEPEND ( agp_via  ,
agp  ,
,
,
 
)

◆ MODULE_DEPEND() [2/2]

MODULE_DEPEND ( agp_via  ,
pci  ,
,
,
 
)

Variable Documentation

◆ agp_devclass

devclass_t agp_devclass
static

Definition at line 423 of file agp_via.c.

◆ agp_via_driver

driver_t agp_via_driver
static
Initial value:
= {
"agp",
sizeof(struct agp_via_softc),
}
static device_method_t agp_via_methods[]
Definition: agp_via.c:394

Definition at line 417 of file agp_via.c.

◆ agp_via_methods

device_method_t agp_via_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, agp_via_probe),
DEVMETHOD(device_attach, agp_via_attach),
DEVMETHOD(device_detach, agp_via_detach),
DEVMETHOD(device_shutdown, bus_generic_shutdown),
DEVMETHOD(device_suspend, bus_generic_suspend),
DEVMETHOD(device_resume, bus_generic_resume),
DEVMETHOD(agp_get_aperture, agp_via_get_aperture),
DEVMETHOD(agp_set_aperture, agp_via_set_aperture),
DEVMETHOD(agp_bind_page, agp_via_bind_page),
DEVMETHOD(agp_unbind_page, agp_via_unbind_page),
DEVMETHOD(agp_flush_tlb, agp_via_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 u_int32_t agp_via_get_aperture(device_t dev)
Definition: agp_via.c:242
static int agp_via_set_aperture(device_t dev, u_int32_t aperture)
Definition: agp_via.c:290
static int agp_via_unbind_page(device_t dev, vm_offset_t offset)
Definition: agp_via.c:365
static int agp_via_probe(device_t dev)
Definition: agp_via.c:146
static int agp_via_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical)
Definition: agp_via.c:353
static int agp_via_attach(device_t dev)
Definition: agp_via.c:162
static int agp_via_detach(device_t dev)
Definition: agp_via.c:226
static void agp_via_flush_tlb(device_t dev)
Definition: agp_via.c:377

Definition at line 394 of file agp_via.c.

◆ via_v2_regs

int via_v2_regs[]
static
Initial value:
#define AGP_VIA_GARTCTRL
Definition: agpreg.h:88
#define AGP_VIA_ATTBASE
Definition: agpreg.h:90
#define AGP_VIA_APSIZE
Definition: agpreg.h:89

Definition at line 62 of file agp_via.c.

Referenced by agp_via_attach(), agp_via_flush_tlb(), agp_via_get_aperture(), and agp_via_set_aperture().

◆ via_v3_regs

int via_v3_regs[]
static
Initial value:
#define AGP3_VIA_ATTBASE
Definition: agpreg.h:97
#define AGP3_VIA_APSIZE
Definition: agpreg.h:96
#define AGP3_VIA_GARTCTRL
Definition: agpreg.h:95

Definition at line 64 of file agp_via.c.

Referenced by agp_via_attach().