direct-io.hg

changeset 8355:99a1f5dc75a9

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@cl.cam.ac.uk>
author chris@ubuntu.eng.hq.xensource.com
date Tue Dec 13 19:04:14 2005 -0700 (2005-12-13)
parents 116b7c0a8534
children d48b19263e46
files linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h	Tue Dec 13 16:26:33 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h	Tue Dec 13 19:04:14 2005 -0700
     1.3 @@ -15,26 +15,19 @@
     1.4   */
     1.5  #define set_pte(pteptr, pteval) (*(pteptr) = pteval)
     1.6  
     1.7 -inline static void set_pte_at(struct mm_struct *mm, unsigned long addr, 
     1.8 -		       pte_t *ptep, pte_t val )
     1.9 -{
    1.10 -    if ( ((mm != current->mm) && (mm != &init_mm)) ||
    1.11 -	 HYPERVISOR_update_va_mapping( (addr), (val), 0 ) )
    1.12 -    {
    1.13 -        set_pte(ptep, val);
    1.14 -    }
    1.15 -}
    1.16 +#define set_pte_at(_mm,addr,ptep,pteval) do {				\
    1.17 +	if (((_mm) != current->mm && (_mm) != &init_mm) ||		\
    1.18 +	    HYPERVISOR_update_va_mapping((addr), (pteval), 0))		\
    1.19 +		set_pte((ptep), (pteval));				\
    1.20 +} while (0)
    1.21  
    1.22 -inline static void set_pte_at_sync(struct mm_struct *mm, unsigned long addr, 
    1.23 -		       pte_t *ptep, pte_t val )
    1.24 -{
    1.25 -    if ( ((mm != current->mm) && (mm != &init_mm)) ||
    1.26 -	 HYPERVISOR_update_va_mapping( (addr), (val), UVMF_INVLPG ) )
    1.27 -    {
    1.28 -        set_pte(ptep, val);
    1.29 -	xen_invlpg(addr);
    1.30 -    }
    1.31 -}
    1.32 +#define set_pte_at_sync(_mm,addr,ptep,pteval) do {			\
    1.33 +	if (((_mm) != current->mm && (_mm) != &init_mm) ||		\
    1.34 +	    HYPERVISOR_update_va_mapping((addr), (pteval), UVMF_INVLPG)) { \
    1.35 +		set_pte((ptep), (pteval));				\
    1.36 +		xen_invlpg((addr));					\
    1.37 +	}								\
    1.38 +} while (0)
    1.39  
    1.40  #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
    1.41  
     2.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h	Tue Dec 13 16:26:33 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h	Tue Dec 13 19:04:14 2005 -0700
     2.3 @@ -69,26 +69,19 @@ static inline void set_pte(pte_t *ptep, 
     2.4  # define set_pte_atomic(pteptr,pteval) set_pte(pteptr,pteval)
     2.5  #endif
     2.6  
     2.7 -inline static void set_pte_at(struct mm_struct *mm, unsigned long addr, 
     2.8 -		       pte_t *ptep, pte_t val )
     2.9 -{
    2.10 -    if ( ((mm != current->mm) && (mm != &init_mm)) ||
    2.11 -	 HYPERVISOR_update_va_mapping( (addr), (val), 0 ) )
    2.12 -    {
    2.13 -        set_pte(ptep, val);
    2.14 -    }
    2.15 -}
    2.16 +#define set_pte_at(_mm,addr,ptep,pteval) do {				\
    2.17 +	if (((_mm) != current->mm && (_mm) != &init_mm) ||		\
    2.18 +	    HYPERVISOR_update_va_mapping((addr), (pteval), 0))		\
    2.19 +		set_pte((ptep), (pteval));				\
    2.20 +} while (0)
    2.21  
    2.22 -inline static void set_pte_at_sync(struct mm_struct *mm, unsigned long addr, 
    2.23 -		       pte_t *ptep, pte_t val )
    2.24 -{
    2.25 -    if ( ((mm != current->mm) && (mm != &init_mm)) ||
    2.26 -	 HYPERVISOR_update_va_mapping( (addr), (val), UVMF_INVLPG ) )
    2.27 -    {
    2.28 -        set_pte(ptep, val);
    2.29 -	xen_invlpg(addr);
    2.30 -    }
    2.31 -}
    2.32 +#define set_pte_at_sync(_mm,addr,ptep,pteval) do {			\
    2.33 +	if (((_mm) != current->mm && (_mm) != &init_mm) ||		\
    2.34 +	    HYPERVISOR_update_va_mapping((addr), (pteval), UVMF_INVLPG)) { \
    2.35 +		set_pte((ptep), (pteval));				\
    2.36 +		xen_invlpg((addr));					\
    2.37 +	}								\
    2.38 +} while (0)
    2.39  
    2.40  #ifdef CONFIG_XEN_SHADOW_MODE
    2.41  # define set_pmd(pmdptr,pmdval) \
     3.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h	Tue Dec 13 16:26:33 2005 +0000
     3.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h	Tue Dec 13 19:04:14 2005 -0700
     3.3 @@ -266,15 +266,11 @@ static inline unsigned long pud_bad(pud_
     3.4         return val & ~(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED);      
     3.5  } 
     3.6  
     3.7 -inline static void set_pte_at(struct mm_struct *mm, unsigned long addr, 
     3.8 -		       pte_t *ptep, pte_t val )
     3.9 -{
    3.10 -    if ( ((mm != current->mm) && (mm != &init_mm)) ||
    3.11 -	 HYPERVISOR_update_va_mapping( (addr), (val), 0 ) )
    3.12 -    {
    3.13 -        set_pte(ptep, val);
    3.14 -    }
    3.15 -}
    3.16 +#define set_pte_at(_mm,addr,ptep,pteval) do {				\
    3.17 +	if (((_mm) != current->mm && (_mm) != &init_mm) ||		\
    3.18 +	    HYPERVISOR_update_va_mapping((addr), (pteval), 0))		\
    3.19 +		set_pte((ptep), (pteval));				\
    3.20 +} while (0)
    3.21  
    3.22  #define pte_none(x)	(!(x).pte)
    3.23  #define pte_present(x)	((x).pte & (_PAGE_PRESENT | _PAGE_PROTNONE))