WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-merge

[Xen-merge] [PATCH 07/23] highmem subarch headers

To: xen-merge@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-merge] [PATCH 07/23] highmem subarch headers
From: Chris Wright <chrisw@xxxxxxxx>
Date: Mon, 08 Aug 2005 00:02:43 -0700
Delivery-date: Mon, 08 Aug 2005 07:06:38 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-merge-request@lists.xensource.com?subject=help>
List-id: xen-merge <xen-merge.lists.xensource.com>
List-post: <mailto:xen-merge@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-merge>, <mailto:xen-merge-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-merge>, <mailto:xen-merge-request@lists.xensource.com?subject=unsubscribe>
References: <20050808070236.231405000@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-merge-bounces@xxxxxxxxxxxxxxxxxxx
--- 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