[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Make set_pte_at and set_pte_at_sync macros instead of inline functions.
# 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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |