Skip to content

Commit

Permalink
[AGPGART] Move [un]map_page_into_agp into asm/agp.h
Browse files Browse the repository at this point in the history
Remove an arch-dependent hunk in favor of #define-ing the respective bits in
asm-<arch>/agp.h (allowing easier overriding in para-virtualized environments).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Dave Jones <davej@redhat.com>
  • Loading branch information
Jan Beulich authored and Dave Jones committed Apr 26, 2007
1 parent 77ec430 commit 9eeee24
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 26 deletions.
22 changes: 0 additions & 22 deletions drivers/char/agp/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,6 @@ int agp_memory_reserved;
*/
EXPORT_SYMBOL_GPL(agp_memory_reserved);

#if defined(CONFIG_X86)
int map_page_into_agp(struct page *page)
{
int i;
i = change_page_attr(page, 1, PAGE_KERNEL_NOCACHE);
/* Caller's responsibility to call global_flush_tlb() for
* performance reasons */
return i;
}
EXPORT_SYMBOL_GPL(map_page_into_agp);

int unmap_page_from_agp(struct page *page)
{
int i;
i = change_page_attr(page, 1, PAGE_KERNEL);
/* Caller's responsibility to call global_flush_tlb() for
* performance reasons */
return i;
}
EXPORT_SYMBOL_GPL(unmap_page_from_agp);
#endif

/*
* Generic routines for handling agp_memory structures -
* They use the basic page allocation routines to do the brunt of the work.
Expand Down
6 changes: 4 additions & 2 deletions include/asm-i386/agp.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
* data corruption on some CPUs.
*/

int map_page_into_agp(struct page *page);
int unmap_page_from_agp(struct page *page);
/* Caller's responsibility to call global_flush_tlb() for
* performance reasons */
#define map_page_into_agp(page) change_page_attr(page, 1, PAGE_KERNEL_NOCACHE)
#define unmap_page_from_agp(page) change_page_attr(page, 1, PAGE_KERNEL)
#define flush_agp_mappings() global_flush_tlb()

/* Could use CLFLUSH here if the cpu supports it. But then it would
Expand Down
6 changes: 4 additions & 2 deletions include/asm-x86_64/agp.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
* with different cachability attributes for the same page.
*/

int map_page_into_agp(struct page *page);
int unmap_page_from_agp(struct page *page);
/* Caller's responsibility to call global_flush_tlb() for
* performance reasons */
#define map_page_into_agp(page) change_page_attr(page, 1, PAGE_KERNEL_NOCACHE)
#define unmap_page_from_agp(page) change_page_attr(page, 1, PAGE_KERNEL)
#define flush_agp_mappings() global_flush_tlb()

/* Could use CLFLUSH here if the cpu supports it. But then it would
Expand Down

0 comments on commit 9eeee24

Please sign in to comment.