--- linux-2.6.12-xen0-arch.orig/include/asm-i386/highmem.h
+++ linux-2.6.12-xen0-arch/include/asm-i386/highmem.h
@@ -69,9 +69,13 @@ extern void FASTCALL(kunmap_high(struct
void *kmap(struct page *page);
void kunmap(struct page *page);
void *kmap_atomic(struct page *page, enum km_type type);
+void *__kmap_atomic(struct page *page, enum km_type type, pgprot_t prot);
void kunmap_atomic(void *kvaddr, enum km_type type);
struct page *kmap_atomic_to_page(void *ptr);
+/* for kmap_atomic_pte */
+#include <mach_highmem.h>
+
#define flush_cache_kmaps() do { } while (0)
#endif /* __KERNEL__ */
--- /dev/null
+++ linux-2.6.12-xen0-arch/include/asm-i386/mach-default/mach_highmem.h
@@ -0,0 +1,6 @@
+#ifndef __ASM_MACH_HIGHEMEM_H
+#define __ASM_MACH_HIGHEMEM_H
+
+#define kmap_atomic_pte(_p,_t) kmap_atomic(_p,_t)
+
+#endif
--- linux-2.6.12-xen0-arch.orig/arch/i386/mm/highmem.c
+++ linux-2.6.12-xen0-arch/arch/i386/mm/highmem.c
@@ -25,7 +25,7 @@ void kunmap(struct page *page)
* However when holding an atomic kmap is is not legal to sleep, so atomic
* kmaps are appropriate for short, tight code paths only.
*/
-void *kmap_atomic(struct page *page, enum km_type type)
+void *__kmap_atomic(struct page *page, enum km_type type, pgprot_t prot)
{
enum fixed_addresses idx;
unsigned long vaddr;
@@ -41,12 +41,17 @@ void *kmap_atomic(struct page *page, enu
if (!pte_none(*(kmap_pte-idx)))
BUG();
#endif
- set_pte(kmap_pte-idx, mk_pte(page, kmap_prot));
+ set_pte(kmap_pte-idx, mk_pte(page, prot));
__flush_tlb_one(vaddr);
return (void*) vaddr;
}
+void *kmap_atomic(struct page *page, enum km_type type)
+{
+ return __kmap_atomic(page, type, kmap_prot);
+}
+
void kunmap_atomic(void *kvaddr, enum km_type type)
{
#ifdef CONFIG_DEBUG_HIGHMEM
--- linux-2.6.12-xen0/include/asm-i386/mach-xen/mach_highmem.h 1969-12-31
16:00:00.000000000 -0800
+++ linux-2.6.12-xen0-arch/include/asm-i386/mach-xen/mach_highmem.h
2005-07-30 10:56:00.000000000 -0700
@@ -0,0 +1,10 @@
+#ifndef __ASM_MACH_HIGHEMEM_H
+#define __ASM_MACH_HIGHEMEM_H
+
+/* Same as kmap_atomic but with PAGE_KERNEL_RO page protection. */
+static inline void *kmap_atomic_pte(struct page *page, enum km_type type)
+{
+ return __kmap_atomic(page, type, PAGE_KERNEL_RO);
+}
+
+#endif
--
_______________________________________________
Xen-merge mailing list
Xen-merge@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-merge
|