Commit b1b90ea8 authored by Dave Jones's avatar Dave Jones

[AGPGART] EXPORT_SYMBOL cleanups. Also move the global_cache_flush routine to generic.c

parent c77f460c
...@@ -34,24 +34,6 @@ extern struct agp_bridge_data *agp_bridge; ...@@ -34,24 +34,6 @@ extern struct agp_bridge_data *agp_bridge;
#define PFX "agpgart: " #define PFX "agpgart: "
#ifdef CONFIG_SMP
static void ipi_handler(void *null)
{
flush_agp_cache();
}
static void __attribute__((unused)) global_cache_flush(void)
{
if (on_each_cpu(ipi_handler, NULL, 1, 1) != 0)
panic(PFX "timed out waiting for the other CPUs!\n");
}
#else
static void global_cache_flush(void)
{
flush_agp_cache();
}
#endif /* !CONFIG_SMP */
enum aper_size_type { enum aper_size_type {
U8_APER_SIZE, U8_APER_SIZE,
U16_APER_SIZE, U16_APER_SIZE,
...@@ -411,6 +393,7 @@ int agp_unregister_driver(struct agp_driver *drv); ...@@ -411,6 +393,7 @@ int agp_unregister_driver(struct agp_driver *drv);
u32 agp_collect_device_status(u32 mode, u32 command); u32 agp_collect_device_status(u32 mode, u32 command);
void agp_device_command(u32 command, int agp_v3); void agp_device_command(u32 command, int agp_v3);
int agp_3_0_node_enable(u32 mode, u32 minor); int agp_3_0_node_enable(u32 mode, u32 minor);
void global_cache_flush(void);
/* Standard agp registers */ /* Standard agp registers */
#define AGPSTAT 0x4 #define AGPSTAT 0x4
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
struct agp_bridge_data agp_bridge_dummy = { .type = NOT_SUPPORTED }; struct agp_bridge_data agp_bridge_dummy = { .type = NOT_SUPPORTED };
struct agp_bridge_data *agp_bridge = &agp_bridge_dummy; struct agp_bridge_data *agp_bridge = &agp_bridge_dummy;
EXPORT_SYMBOL(agp_bridge);
int agp_backend_acquire(void) int agp_backend_acquire(void)
{ {
......
/* /*
* AGPGART driver. * AGPGART driver.
* Copyright (C) 2002 Dave Jones. * Copyright (C) 2002-2003 Dave Jones.
* Copyright (C) 1999 Jeff Hartmann. * Copyright (C) 1999 Jeff Hartmann.
* Copyright (C) 1999 Precision Insight, Inc. * Copyright (C) 1999 Precision Insight, Inc.
* Copyright (C) 1999 Xi Graphics, Inc. * Copyright (C) 1999 Xi Graphics, Inc.
...@@ -48,13 +48,14 @@ int agp_memory_reserved; ...@@ -48,13 +48,14 @@ int agp_memory_reserved;
void agp_free_key(int key) void agp_free_key(int key)
{ {
if (key < 0) if (key < 0)
return; return;
if (key < MAXKEY) if (key < MAXKEY)
clear_bit(key, agp_bridge->key_list); clear_bit(key, agp_bridge->key_list);
} }
EXPORT_SYMBOL(agp_free_key);
static int agp_get_key(void) static int agp_get_key(void)
{ {
...@@ -68,6 +69,7 @@ static int agp_get_key(void) ...@@ -68,6 +69,7 @@ static int agp_get_key(void)
return -1; return -1;
} }
agp_memory *agp_create_memory(int scratch_pages) agp_memory *agp_create_memory(int scratch_pages)
{ {
agp_memory *new; agp_memory *new;
...@@ -94,6 +96,8 @@ agp_memory *agp_create_memory(int scratch_pages) ...@@ -94,6 +96,8 @@ agp_memory *agp_create_memory(int scratch_pages)
new->num_scratch_pages = scratch_pages; new->num_scratch_pages = scratch_pages;
return new; return new;
} }
EXPORT_SYMBOL(agp_create_memory);
void agp_free_memory(agp_memory * curr) void agp_free_memory(agp_memory * curr)
{ {
...@@ -118,9 +122,11 @@ void agp_free_memory(agp_memory * curr) ...@@ -118,9 +122,11 @@ void agp_free_memory(agp_memory * curr)
vfree(curr->memory); vfree(curr->memory);
kfree(curr); kfree(curr);
} }
EXPORT_SYMBOL(agp_free_memory);
#define ENTRIES_PER_PAGE (PAGE_SIZE / sizeof(unsigned long)) #define ENTRIES_PER_PAGE (PAGE_SIZE / sizeof(unsigned long))
agp_memory *agp_allocate_memory(size_t page_count, u32 type) agp_memory *agp_allocate_memory(size_t page_count, u32 type)
{ {
int scratch_pages; int scratch_pages;
...@@ -160,9 +166,12 @@ agp_memory *agp_allocate_memory(size_t page_count, u32 type) ...@@ -160,9 +166,12 @@ agp_memory *agp_allocate_memory(size_t page_count, u32 type)
return new; return new;
} }
EXPORT_SYMBOL(agp_allocate_memory);
/* End - Generic routines for handling agp_memory structures */ /* End - Generic routines for handling agp_memory structures */
static int agp_return_size(void) static int agp_return_size(void)
{ {
int current_size; int current_size;
...@@ -197,6 +206,7 @@ static int agp_return_size(void) ...@@ -197,6 +206,7 @@ static int agp_return_size(void)
return current_size; return current_size;
} }
int agp_num_entries(void) int agp_num_entries(void)
{ {
int num_entries; int num_entries;
...@@ -230,9 +240,10 @@ int agp_num_entries(void) ...@@ -230,9 +240,10 @@ int agp_num_entries(void)
num_entries = 0; num_entries = 0;
return num_entries; return num_entries;
} }
EXPORT_SYMBOL_GPL(agp_num_entries);
/* Routine to copy over information structure */
/* Routine to copy over information structure */
int agp_copy_info(agp_kern_info * info) int agp_copy_info(agp_kern_info * info)
{ {
memset(info, 0, sizeof(agp_kern_info)); memset(info, 0, sizeof(agp_kern_info));
...@@ -254,9 +265,12 @@ int agp_copy_info(agp_kern_info * info) ...@@ -254,9 +265,12 @@ int agp_copy_info(agp_kern_info * info)
info->page_mask = ~0UL; info->page_mask = ~0UL;
return 0; return 0;
} }
EXPORT_SYMBOL(agp_copy_info);
/* End - Routine to copy over information structure */ /* End - Routine to copy over information structure */
/* /*
* Routines for handling swapping of agp_memory into the GATT - * Routines for handling swapping of agp_memory into the GATT -
* These routines take agp_memory and insert them into the GATT. * These routines take agp_memory and insert them into the GATT.
...@@ -284,6 +298,8 @@ int agp_bind_memory(agp_memory * curr, off_t pg_start) ...@@ -284,6 +298,8 @@ int agp_bind_memory(agp_memory * curr, off_t pg_start)
curr->pg_start = pg_start; curr->pg_start = pg_start;
return 0; return 0;
} }
EXPORT_SYMBOL(agp_bind_memory);
int agp_unbind_memory(agp_memory * curr) int agp_unbind_memory(agp_memory * curr)
{ {
...@@ -304,6 +320,7 @@ int agp_unbind_memory(agp_memory * curr) ...@@ -304,6 +320,7 @@ int agp_unbind_memory(agp_memory * curr)
curr->pg_start = 0; curr->pg_start = 0;
return 0; return 0;
} }
EXPORT_SYMBOL(agp_unbind_memory);
/* End - Routines for handling swapping of agp_memory into the GATT */ /* End - Routines for handling swapping of agp_memory into the GATT */
...@@ -364,6 +381,8 @@ u32 agp_collect_device_status(u32 mode, u32 command) ...@@ -364,6 +381,8 @@ u32 agp_collect_device_status(u32 mode, u32 command)
return command; return command;
} }
EXPORT_SYMBOL(agp_collect_device_status);
void agp_device_command(u32 command, int agp_v3) void agp_device_command(u32 command, int agp_v3)
{ {
...@@ -384,6 +403,8 @@ void agp_device_command(u32 command, int agp_v3) ...@@ -384,6 +403,8 @@ void agp_device_command(u32 command, int agp_v3)
pci_write_config_dword(device, agp + PCI_AGP_COMMAND, command); pci_write_config_dword(device, agp + PCI_AGP_COMMAND, command);
} }
} }
EXPORT_SYMBOL(agp_device_command);
void agp_generic_enable(u32 mode) void agp_generic_enable(u32 mode)
{ {
...@@ -418,6 +439,8 @@ void agp_generic_enable(u32 mode) ...@@ -418,6 +439,8 @@ void agp_generic_enable(u32 mode)
agp_bridge->capndx + PCI_AGP_COMMAND, command); agp_bridge->capndx + PCI_AGP_COMMAND, command);
agp_device_command(command, 0); agp_device_command(command, 0);
} }
EXPORT_SYMBOL(agp_generic_enable);
int agp_generic_create_gatt_table(void) int agp_generic_create_gatt_table(void)
{ {
...@@ -535,16 +558,22 @@ int agp_generic_create_gatt_table(void) ...@@ -535,16 +558,22 @@ int agp_generic_create_gatt_table(void)
return 0; return 0;
} }
EXPORT_SYMBOL(agp_generic_create_gatt_table);
int agp_generic_suspend(void) int agp_generic_suspend(void)
{ {
return 0; return 0;
} }
EXPORT_SYMBOL(agp_generic_suspend);
void agp_generic_resume(void) void agp_generic_resume(void)
{ {
return; return;
} }
EXPORT_SYMBOL(agp_generic_resume);
int agp_generic_free_gatt_table(void) int agp_generic_free_gatt_table(void)
{ {
...@@ -592,6 +621,8 @@ int agp_generic_free_gatt_table(void) ...@@ -592,6 +621,8 @@ int agp_generic_free_gatt_table(void)
free_pages((unsigned long) agp_bridge->gatt_table_real, page_order); free_pages((unsigned long) agp_bridge->gatt_table_real, page_order);
return 0; return 0;
} }
EXPORT_SYMBOL(agp_generic_free_gatt_table);
int agp_generic_insert_memory(agp_memory * mem, off_t pg_start, int type) int agp_generic_insert_memory(agp_memory * mem, off_t pg_start, int type)
{ {
...@@ -657,6 +688,8 @@ int agp_generic_insert_memory(agp_memory * mem, off_t pg_start, int type) ...@@ -657,6 +688,8 @@ int agp_generic_insert_memory(agp_memory * mem, off_t pg_start, int type)
agp_bridge->tlb_flush(mem); agp_bridge->tlb_flush(mem);
return 0; return 0;
} }
EXPORT_SYMBOL(agp_generic_insert_memory);
int agp_generic_remove_memory(agp_memory * mem, off_t pg_start, int type) int agp_generic_remove_memory(agp_memory * mem, off_t pg_start, int type)
{ {
...@@ -676,11 +709,15 @@ int agp_generic_remove_memory(agp_memory * mem, off_t pg_start, int type) ...@@ -676,11 +709,15 @@ int agp_generic_remove_memory(agp_memory * mem, off_t pg_start, int type)
agp_bridge->tlb_flush(mem); agp_bridge->tlb_flush(mem);
return 0; return 0;
} }
EXPORT_SYMBOL(agp_generic_remove_memory);
agp_memory *agp_generic_alloc_by_type(size_t page_count, int type) agp_memory *agp_generic_alloc_by_type(size_t page_count, int type)
{ {
return NULL; return NULL;
} }
EXPORT_SYMBOL(agp_generic_alloc_by_type);
void agp_generic_free_by_type(agp_memory * curr) void agp_generic_free_by_type(agp_memory * curr)
{ {
...@@ -690,6 +727,8 @@ void agp_generic_free_by_type(agp_memory * curr) ...@@ -690,6 +727,8 @@ void agp_generic_free_by_type(agp_memory * curr)
agp_free_key(curr->key); agp_free_key(curr->key);
kfree(curr); kfree(curr);
} }
EXPORT_SYMBOL(agp_generic_free_by_type);
/* /*
* Basic Page Allocation Routines - * Basic Page Allocation Routines -
...@@ -715,6 +754,8 @@ void *agp_generic_alloc_page(void) ...@@ -715,6 +754,8 @@ void *agp_generic_alloc_page(void)
atomic_inc(&agp_bridge->current_memory_agp); atomic_inc(&agp_bridge->current_memory_agp);
return page_address(page); return page_address(page);
} }
EXPORT_SYMBOL(agp_generic_alloc_page);
void agp_generic_destroy_page(void *addr) void agp_generic_destroy_page(void *addr)
{ {
...@@ -730,6 +771,7 @@ void agp_generic_destroy_page(void *addr) ...@@ -730,6 +771,7 @@ void agp_generic_destroy_page(void *addr)
free_page((unsigned long)addr); free_page((unsigned long)addr);
atomic_dec(&agp_bridge->current_memory_agp); atomic_dec(&agp_bridge->current_memory_agp);
} }
EXPORT_SYMBOL(agp_generic_destroy_page);
/* End Basic Page Allocation Routines */ /* End Basic Page Allocation Routines */
...@@ -739,32 +781,23 @@ void agp_enable(u32 mode) ...@@ -739,32 +781,23 @@ void agp_enable(u32 mode)
return; return;
agp_bridge->agp_enable(mode); agp_bridge->agp_enable(mode);
} }
EXPORT_SYMBOL(agp_free_memory);
EXPORT_SYMBOL(agp_allocate_memory);
EXPORT_SYMBOL(agp_copy_info);
EXPORT_SYMBOL(agp_create_memory);
EXPORT_SYMBOL(agp_bind_memory);
EXPORT_SYMBOL(agp_unbind_memory);
EXPORT_SYMBOL(agp_free_key);
EXPORT_SYMBOL(agp_enable); EXPORT_SYMBOL(agp_enable);
EXPORT_SYMBOL(agp_bridge);
EXPORT_SYMBOL(agp_generic_alloc_page); #ifdef CONFIG_SMP
EXPORT_SYMBOL(agp_generic_destroy_page); static void ipi_handler(void *null)
EXPORT_SYMBOL(agp_generic_suspend); {
EXPORT_SYMBOL(agp_generic_resume); flush_agp_cache();
EXPORT_SYMBOL(agp_generic_enable); }
EXPORT_SYMBOL(agp_generic_create_gatt_table); #endif
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(global_cache_flush);
EXPORT_SYMBOL(agp_device_command);
EXPORT_SYMBOL(agp_collect_device_status);
EXPORT_SYMBOL_GPL(agp_num_entries); void global_cache_flush(void)
{
#ifdef CONFIG_SMP
if (on_each_cpu(ipi_handler, NULL, 1, 1) != 0)
panic(PFX "timed out waiting for the other CPUs!\n");
#else
flush_agp_cache();
#endif
}
EXPORT_SYMBOL(global_cache_flush);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment