Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
generic.c File Reference
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/pagemap.h>
#include <linux/miscdevice.h>
#include <linux/pm.h>
#include <linux/agp_backend.h>
#include <linux/vmalloc.h>
#include <linux/dma-mapping.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <asm/io.h>
#include <asm/cacheflush.h>
#include <asm/pgtable.h>
#include "agp.h"

Go to the source code of this file.


#define ENTRIES_PER_PAGE   (PAGE_SIZE / sizeof(unsigned long))


 EXPORT_SYMBOL_GPL (agp_memory_reserved)
void agp_free_key (int key)
 EXPORT_SYMBOL (agp_free_key)
void agp_alloc_page_array (size_t size, struct agp_memory *mem)
 EXPORT_SYMBOL (agp_alloc_page_array)
void agp_free_page_array (struct agp_memory *mem)
 EXPORT_SYMBOL (agp_free_page_array)
struct agp_memoryagp_create_memory (int scratch_pages)
 EXPORT_SYMBOL (agp_create_memory)
void agp_free_memory (struct agp_memory *curr)
 EXPORT_SYMBOL (agp_free_memory)
struct agp_memoryagp_allocate_memory (struct agp_bridge_data *bridge, size_t page_count, u32 type)
 EXPORT_SYMBOL (agp_allocate_memory)
int agp_num_entries (void)
 EXPORT_SYMBOL_GPL (agp_num_entries)
int agp_copy_info (struct agp_bridge_data *bridge, struct agp_kern_info *info)
 EXPORT_SYMBOL (agp_copy_info)
int agp_bind_memory (struct agp_memory *curr, off_t pg_start)
 EXPORT_SYMBOL (agp_bind_memory)
int agp_unbind_memory (struct agp_memory *curr)
 EXPORT_SYMBOL (agp_unbind_memory)
u32 agp_collect_device_status (struct agp_bridge_data *bridge, u32 requested_mode, u32 bridge_agpstat)
 EXPORT_SYMBOL (agp_collect_device_status)
void agp_device_command (u32 bridge_agpstat, bool agp_v3)
 EXPORT_SYMBOL (agp_device_command)
void get_agp_version (struct agp_bridge_data *bridge)
 EXPORT_SYMBOL (get_agp_version)
void agp_generic_enable (struct agp_bridge_data *bridge, u32 requested_mode)
 EXPORT_SYMBOL (agp_generic_enable)
int agp_generic_create_gatt_table (struct agp_bridge_data *bridge)
 EXPORT_SYMBOL (agp_generic_create_gatt_table)
int agp_generic_free_gatt_table (struct agp_bridge_data *bridge)
 EXPORT_SYMBOL (agp_generic_free_gatt_table)
int agp_generic_insert_memory (struct agp_memory *mem, off_t pg_start, int type)
 EXPORT_SYMBOL (agp_generic_insert_memory)
int agp_generic_remove_memory (struct agp_memory *mem, off_t pg_start, int type)
 EXPORT_SYMBOL (agp_generic_remove_memory)
struct agp_memoryagp_generic_alloc_by_type (size_t page_count, int type)
 EXPORT_SYMBOL (agp_generic_alloc_by_type)
void agp_generic_free_by_type (struct agp_memory *curr)
 EXPORT_SYMBOL (agp_generic_free_by_type)
struct agp_memoryagp_generic_alloc_user (size_t page_count, int type)
 EXPORT_SYMBOL (agp_generic_alloc_user)
int agp_generic_alloc_pages (struct agp_bridge_data *bridge, struct agp_memory *mem, size_t num_pages)
 EXPORT_SYMBOL (agp_generic_alloc_pages)
struct pageagp_generic_alloc_page (struct agp_bridge_data *bridge)
 EXPORT_SYMBOL (agp_generic_alloc_page)
void agp_generic_destroy_pages (struct agp_memory *mem)
 EXPORT_SYMBOL (agp_generic_destroy_pages)
void agp_generic_destroy_page (struct page *page, int flags)
 EXPORT_SYMBOL (agp_generic_destroy_page)
void agp_enable (struct agp_bridge_data *bridge, u32 mode)
 EXPORT_SYMBOL (agp_enable)
struct agp_bridge_dataagp_generic_find_bridge (struct pci_dev *pdev)
void global_cache_flush (void)
 EXPORT_SYMBOL (global_cache_flush)
unsigned long agp_generic_mask_memory (struct agp_bridge_data *bridge, dma_addr_t addr, int type)
 EXPORT_SYMBOL (agp_generic_mask_memory)
int agp_generic_type_to_mask_type (struct agp_bridge_data *bridge, int type)
 EXPORT_SYMBOL (agp_generic_type_to_mask_type)
int agp3_generic_fetch_size (void)
 EXPORT_SYMBOL (agp3_generic_fetch_size)
void agp3_generic_tlbflush (struct agp_memory *mem)
 EXPORT_SYMBOL (agp3_generic_tlbflush)
int agp3_generic_configure (void)
 EXPORT_SYMBOL (agp3_generic_configure)
void agp3_generic_cleanup (void)
 EXPORT_SYMBOL (agp3_generic_cleanup)
 EXPORT_SYMBOL (agp3_generic_sizes)


int agp_memory_reserved
struct aper_size_info_16 agp3_generic_sizes [AGP_GENERIC_SIZES_ENTRIES]

Macro Definition Documentation

#define ENTRIES_PER_PAGE   (PAGE_SIZE / sizeof(unsigned long))

Definition at line 221 of file generic.c.

Function Documentation

void agp3_generic_cleanup ( void  )

Definition at line 1413 of file generic.c.

int agp3_generic_configure ( void  )

Definition at line 1392 of file generic.c.

int agp3_generic_fetch_size ( void  )

Definition at line 1361 of file generic.c.

void agp3_generic_tlbflush ( struct agp_memory mem)

Definition at line 1383 of file generic.c.

void agp_alloc_page_array ( size_t  size,
struct agp_memory mem 

Definition at line 90 of file generic.c.

struct agp_memory* agp_allocate_memory ( struct agp_bridge_data bridge,
size_t  page_count,
u32  type 

agp_allocate_memory - allocate a group of pages of a certain type.

: size_t argument of the number of pages : u32 argument of the type of memory to be allocated.

Every agp bridge device will allow you to allocate AGP_NORMAL_MEMORY which maps to physical ram. Any other type is device dependent.

It returns NULL whenever memory is unavailable.

Definition at line 234 of file generic.c.

int agp_bind_memory ( struct agp_memory curr,
off_t  pg_start 

agp_bind_memory - Bind an agp_memory structure into the GATT.

: agp_memory pointer : an offset into the graphics aperture translation table

It returns -EINVAL if the pointer == NULL. It returns -EBUSY if the area of the table requested is already in use.

Definition at line 423 of file generic.c.

u32 agp_collect_device_status ( struct agp_bridge_data bridge,
u32  requested_mode,
u32  bridge_agpstat 

agp_collect_device_status - determine correct agp_cmd from various agp_stat's : an agp_bridge_data struct allocated for the AGP host bridge. : requested agp_stat from userspace (Typically from X) : current agp_stat from AGP bridge.

This function will hunt for an AGP graphics card, and try to match the requested mode to the capabilities of both the bridge and the card.

Definition at line 736 of file generic.c.

int agp_copy_info ( struct agp_bridge_data bridge,
struct agp_kern_info info 

agp_copy_info - copy bridge state information

: agp_kern_info pointer. The caller should insure that this pointer is valid.

This function copies information about the agp bridge device and the state of the agp backend into an agp_kern_info pointer.

Definition at line 379 of file generic.c.

struct agp_memory* agp_create_memory ( int  scratch_pages)

Definition at line 143 of file generic.c.

void agp_device_command ( u32  bridge_agpstat,
bool  agp_v3 

Definition at line 782 of file generic.c.

void agp_enable ( struct agp_bridge_data bridge,
u32  mode 

agp_enable - initialise the agp point-to-point connection.

: agp mode register value to configure with.

Definition at line 1303 of file generic.c.

void agp_free_key ( int  key)

Definition at line 61 of file generic.c.

void agp_free_memory ( struct agp_memory curr)

agp_free_memory - free memory associated with an agp_memory pointer.

: agp_memory pointer to be freed.

It is the only function that can be called when the backend is not owned by the caller. (So it can free memory on client death.)

Definition at line 179 of file generic.c.

void agp_free_page_array ( struct agp_memory mem)

Definition at line 102 of file generic.c.

struct agp_memory* agp_generic_alloc_by_type ( size_t  page_count,
int  type 

Definition at line 1165 of file generic.c.

struct page* agp_generic_alloc_page ( struct agp_bridge_data bridge)

Definition at line 1237 of file generic.c.

int agp_generic_alloc_pages ( struct agp_bridge_data bridge,
struct agp_memory mem,
size_t  num_pages 

Definition at line 1207 of file generic.c.

struct agp_memory* agp_generic_alloc_user ( size_t  page_count,
int  type 

Definition at line 1179 of file generic.c.

int agp_generic_create_gatt_table ( struct agp_bridge_data bridge)

Definition at line 865 of file generic.c.

void agp_generic_destroy_page ( struct page page,
int  flags 

Definition at line 1279 of file generic.c.

void agp_generic_destroy_pages ( struct agp_memory mem)

Definition at line 1253 of file generic.c.

void agp_generic_enable ( struct agp_bridge_data bridge,
u32  requested_mode 

Definition at line 819 of file generic.c.

struct agp_bridge_data* agp_generic_find_bridge ( struct pci_dev pdev)

Definition at line 1315 of file generic.c.

void agp_generic_free_by_type ( struct agp_memory curr)

Definition at line 1171 of file generic.c.

int agp_generic_free_gatt_table ( struct agp_bridge_data bridge)

Definition at line 988 of file generic.c.

int agp_generic_insert_memory ( struct agp_memory mem,
off_t  pg_start,
int  type 

Definition at line 1045 of file generic.c.

unsigned long agp_generic_mask_memory ( struct agp_bridge_data bridge,
dma_addr_t  addr,
int  type 

Definition at line 1335 of file generic.c.

int agp_generic_remove_memory ( struct agp_memory mem,
off_t  pg_start,
int  type 

Definition at line 1127 of file generic.c.

int agp_generic_type_to_mask_type ( struct agp_bridge_data bridge,
int  type 

Definition at line 1346 of file generic.c.

int agp_num_entries ( void  )

Definition at line 335 of file generic.c.

int agp_unbind_memory ( struct agp_memory curr)

agp_unbind_memory - Removes an agp_memory structure from the GATT

: agp_memory pointer to be removed from the GATT.

It returns -EINVAL if this piece of agp_memory is not currently bound to the graphics aperture translation table or if the agp_memory pointer == NULL

Definition at line 463 of file generic.c.

EXPORT_SYMBOL ( agp_free_key  )
EXPORT_SYMBOL ( agp_alloc_page_array  )
EXPORT_SYMBOL ( agp_free_page_array  )
EXPORT_SYMBOL ( agp_create_memory  )
EXPORT_SYMBOL ( agp_free_memory  )
EXPORT_SYMBOL ( agp_allocate_memory  )
EXPORT_SYMBOL ( agp_copy_info  )
EXPORT_SYMBOL ( agp_bind_memory  )
EXPORT_SYMBOL ( agp_unbind_memory  )
EXPORT_SYMBOL ( agp_collect_device_status  )
EXPORT_SYMBOL ( agp_device_command  )
EXPORT_SYMBOL ( get_agp_version  )
EXPORT_SYMBOL ( agp_generic_enable  )
EXPORT_SYMBOL ( agp_generic_create_gatt_table  )
EXPORT_SYMBOL ( agp_generic_free_gatt_table  )
EXPORT_SYMBOL ( agp_generic_insert_memory  )
EXPORT_SYMBOL ( agp_generic_remove_memory  )
EXPORT_SYMBOL ( agp_generic_alloc_by_type  )
EXPORT_SYMBOL ( agp_generic_free_by_type  )
EXPORT_SYMBOL ( agp_generic_alloc_user  )
EXPORT_SYMBOL ( agp_generic_alloc_pages  )
EXPORT_SYMBOL ( agp_generic_alloc_page  )
EXPORT_SYMBOL ( agp_generic_destroy_pages  )
EXPORT_SYMBOL ( agp_generic_destroy_page  )
EXPORT_SYMBOL ( agp_enable  )
EXPORT_SYMBOL ( global_cache_flush  )
EXPORT_SYMBOL ( agp_generic_mask_memory  )
EXPORT_SYMBOL ( agp_generic_type_to_mask_type  )
EXPORT_SYMBOL ( agp3_generic_fetch_size  )
EXPORT_SYMBOL ( agp3_generic_tlbflush  )
EXPORT_SYMBOL ( agp3_generic_configure  )
EXPORT_SYMBOL ( agp3_generic_cleanup  )
EXPORT_SYMBOL ( agp3_generic_sizes  )
EXPORT_SYMBOL_GPL ( agp_memory_reserved  )
EXPORT_SYMBOL_GPL ( agp_num_entries  )
void get_agp_version ( struct agp_bridge_data bridge)

Definition at line 804 of file generic.c.

void global_cache_flush ( void  )

Definition at line 1328 of file generic.c.

Variable Documentation

Initial value:
{4096, 1048576, 10,0x000},
{2048, 524288, 9, 0x800},
{1024, 262144, 8, 0xc00},
{ 512, 131072, 7, 0xe00},
{ 256, 65536, 6, 0xf00},
{ 128, 32768, 5, 0xf20},
{ 64, 16384, 4, 0xf30},
{ 32, 8192, 3, 0xf38},
{ 16, 4096, 2, 0xf3c},
{ 8, 2048, 1, 0xf3e},
{ 4, 1024, 0, 0xf3f}

Definition at line 1421 of file generic.c.

__u32* agp_gatt_table

Definition at line 47 of file generic.c.

int agp_memory_reserved

Definition at line 48 of file generic.c.