aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2007-04-02 09:50:14 -0400
committerDave Jones <davej@redhat.com>2007-04-26 14:22:50 -0400
commit9eeee244142562cba4f9fbc93962acf6a61847b5 (patch)
tree647ff0de4f6bdf9dacf9a5c80a9514bd073f3016
parent77ec430ec3b5c6b9bd6dcb0ff9764d9c95bbd227 (diff)
[AGPGART] Move [un]map_page_into_agp into asm/agp.h
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>
-rw-r--r--drivers/char/agp/generic.c22
-rw-r--r--include/asm-i386/agp.h6
-rw-r--r--include/asm-x86_64/agp.h6
3 files changed, 8 insertions, 26 deletions
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index f902d71947ba..45aeb917ec63 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -51,28 +51,6 @@ int agp_memory_reserved;
51 */ 51 */
52EXPORT_SYMBOL_GPL(agp_memory_reserved); 52EXPORT_SYMBOL_GPL(agp_memory_reserved);
53 53
54#if defined(CONFIG_X86)
55int map_page_into_agp(struct page *page)
56{
57 int i;
58 i = change_page_attr(page, 1, PAGE_KERNEL_NOCACHE);
59 /* Caller's responsibility to call global_flush_tlb() for
60 * performance reasons */
61 return i;
62}
63EXPORT_SYMBOL_GPL(map_page_into_agp);
64
65int unmap_page_from_agp(struct page *page)
66{
67 int i;
68 i = change_page_attr(page, 1, PAGE_KERNEL);
69 /* Caller's responsibility to call global_flush_tlb() for
70 * performance reasons */
71 return i;
72}
73EXPORT_SYMBOL_GPL(unmap_page_from_agp);
74#endif
75
76/* 54/*
77 * Generic routines for handling agp_memory structures - 55 * Generic routines for handling agp_memory structures -
78 * They use the basic page allocation routines to do the brunt of the work. 56 * They use the basic page allocation routines to do the brunt of the work.
diff --git a/include/asm-i386/agp.h b/include/asm-i386/agp.h
index 9075083bab76..6af173dbf123 100644
--- a/include/asm-i386/agp.h
+++ b/include/asm-i386/agp.h
@@ -12,8 +12,10 @@
12 * data corruption on some CPUs. 12 * data corruption on some CPUs.
13 */ 13 */
14 14
15int map_page_into_agp(struct page *page); 15/* Caller's responsibility to call global_flush_tlb() for
16int unmap_page_from_agp(struct page *page); 16 * performance reasons */
17#define map_page_into_agp(page) change_page_attr(page, 1, PAGE_KERNEL_NOCACHE)
18#define unmap_page_from_agp(page) change_page_attr(page, 1, PAGE_KERNEL)
17#define flush_agp_mappings() global_flush_tlb() 19#define flush_agp_mappings() global_flush_tlb()
18 20
19/* Could use CLFLUSH here if the cpu supports it. But then it would 21/* Could use CLFLUSH here if the cpu supports it. But then it would
diff --git a/include/asm-x86_64/agp.h b/include/asm-x86_64/agp.h
index 06c52ee9c06b..de338666f3f9 100644
--- a/include/asm-x86_64/agp.h
+++ b/include/asm-x86_64/agp.h
@@ -10,8 +10,10 @@
10 * with different cachability attributes for the same page. 10 * with different cachability attributes for the same page.
11 */ 11 */
12 12
13int map_page_into_agp(struct page *page); 13/* Caller's responsibility to call global_flush_tlb() for
14int unmap_page_from_agp(struct page *page); 14 * performance reasons */
15#define map_page_into_agp(page) change_page_attr(page, 1, PAGE_KERNEL_NOCACHE)
16#define unmap_page_from_agp(page) change_page_attr(page, 1, PAGE_KERNEL)
15#define flush_agp_mappings() global_flush_tlb() 17#define flush_agp_mappings() global_flush_tlb()
16 18
17/* Could use CLFLUSH here if the cpu supports it. But then it would 19/* Could use CLFLUSH here if the cpu supports it. But then it would