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-changelog

[Xen-changelog] Make set_pte_at and set_pte_at_sync macros instead of in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Make set_pte_at and set_pte_at_sync macros instead of inline functions.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Dec 2005 13:08:06 +0000
Delivery-date: Wed, 14 Dec 2005 13:09:46 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User chris@xxxxxxxxxxxxxxxxxxxxxxxxxxx
# Node ID 99a1f5dc75a9a8aa703588f423ce1bcaf2a6b8ec
# Parent  116b7c0a8534f1fee249267ccd4a69c62e61b376
Make set_pte_at and set_pte_at_sync macros instead of inline functions.
This avoids having to include sched.h to get a definition of init_mm.

Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 116b7c0a8534 -r 99a1f5dc75a9 
linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h    Tue Dec 
13 16:26:33 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h    Wed Dec 
14 02:04:14 2005
@@ -15,26 +15,19 @@
  */
 #define set_pte(pteptr, pteval) (*(pteptr) = pteval)
 
-inline static void set_pte_at(struct mm_struct *mm, unsigned long addr, 
-                      pte_t *ptep, pte_t val )
-{
-    if ( ((mm != current->mm) && (mm != &init_mm)) ||
-        HYPERVISOR_update_va_mapping( (addr), (val), 0 ) )
-    {
-        set_pte(ptep, val);
-    }
-}
+#define set_pte_at(_mm,addr,ptep,pteval) do {                          \
+       if (((_mm) != current->mm && (_mm) != &init_mm) ||              \
+           HYPERVISOR_update_va_mapping((addr), (pteval), 0))          \
+               set_pte((ptep), (pteval));                              \
+} while (0)
 
-inline static void set_pte_at_sync(struct mm_struct *mm, unsigned long addr, 
-                      pte_t *ptep, pte_t val )
-{
-    if ( ((mm != current->mm) && (mm != &init_mm)) ||
-        HYPERVISOR_update_va_mapping( (addr), (val), UVMF_INVLPG ) )
-    {
-        set_pte(ptep, val);
-       xen_invlpg(addr);
-    }
-}
+#define set_pte_at_sync(_mm,addr,ptep,pteval) do {                     \
+       if (((_mm) != current->mm && (_mm) != &init_mm) ||              \
+           HYPERVISOR_update_va_mapping((addr), (pteval), UVMF_INVLPG)) { \
+               set_pte((ptep), (pteval));                              \
+               xen_invlpg((addr));                                     \
+       }                                                               \
+} while (0)
 
 #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
 
diff -r 116b7c0a8534 -r 99a1f5dc75a9 
linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h    Tue Dec 
13 16:26:33 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h    Wed Dec 
14 02:04:14 2005
@@ -69,26 +69,19 @@
 # define set_pte_atomic(pteptr,pteval) set_pte(pteptr,pteval)
 #endif
 
-inline static void set_pte_at(struct mm_struct *mm, unsigned long addr, 
-                      pte_t *ptep, pte_t val )
-{
-    if ( ((mm != current->mm) && (mm != &init_mm)) ||
-        HYPERVISOR_update_va_mapping( (addr), (val), 0 ) )
-    {
-        set_pte(ptep, val);
-    }
-}
-
-inline static void set_pte_at_sync(struct mm_struct *mm, unsigned long addr, 
-                      pte_t *ptep, pte_t val )
-{
-    if ( ((mm != current->mm) && (mm != &init_mm)) ||
-        HYPERVISOR_update_va_mapping( (addr), (val), UVMF_INVLPG ) )
-    {
-        set_pte(ptep, val);
-       xen_invlpg(addr);
-    }
-}
+#define set_pte_at(_mm,addr,ptep,pteval) do {                          \
+       if (((_mm) != current->mm && (_mm) != &init_mm) ||              \
+           HYPERVISOR_update_va_mapping((addr), (pteval), 0))          \
+               set_pte((ptep), (pteval));                              \
+} while (0)
+
+#define set_pte_at_sync(_mm,addr,ptep,pteval) do {                     \
+       if (((_mm) != current->mm && (_mm) != &init_mm) ||              \
+           HYPERVISOR_update_va_mapping((addr), (pteval), UVMF_INVLPG)) { \
+               set_pte((ptep), (pteval));                              \
+               xen_invlpg((addr));                                     \
+       }                                                               \
+} while (0)
 
 #ifdef CONFIG_XEN_SHADOW_MODE
 # define set_pmd(pmdptr,pmdval) \
diff -r 116b7c0a8534 -r 99a1f5dc75a9 
linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h Tue Dec 13 
16:26:33 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h Wed Dec 14 
02:04:14 2005
@@ -266,15 +266,11 @@
        return val & ~(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED);      
 } 
 
-inline static void set_pte_at(struct mm_struct *mm, unsigned long addr, 
-                      pte_t *ptep, pte_t val )
-{
-    if ( ((mm != current->mm) && (mm != &init_mm)) ||
-        HYPERVISOR_update_va_mapping( (addr), (val), 0 ) )
-    {
-        set_pte(ptep, val);
-    }
-}
+#define set_pte_at(_mm,addr,ptep,pteval) do {                          \
+       if (((_mm) != current->mm && (_mm) != &init_mm) ||              \
+           HYPERVISOR_update_va_mapping((addr), (pteval), 0))          \
+               set_pte((ptep), (pteval));                              \
+} while (0)
 
 #define pte_none(x)    (!(x).pte)
 #define pte_present(x) ((x).pte & (_PAGE_PRESENT | _PAGE_PROTNONE))

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Make set_pte_at and set_pte_at_sync macros instead of inline functions., Xen patchbot -unstable <=