aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2009-02-05 14:31:12 -0500
committerJeremy Fitzhardinge <jeremy@goop.org>2009-02-06 15:31:51 -0500
commitcc290ca38cc4c78b0d6175633232f05b8d8732ab (patch)
tree4adcd8b37d41be0206140e7302d5035474b7f586 /arch/x86/include/asm
parent99510238bb428091e7caba020bc5e18b5f30b619 (diff)
x86: unify pages_to_mb
Impact: cleanup Unify and demacro pages_to_mb. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r--arch/x86/include/asm/pgtable.h5
-rw-r--r--arch/x86/include/asm/pgtable_32.h2
-rw-r--r--arch/x86/include/asm/pgtable_64.h2
3 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 72bf53ef60bf..d4cbc8188c8a 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -519,6 +519,11 @@ static inline int pmd_bad(pmd_t pmd)
519 return (pmd_val(pmd) & ~(PTE_PFN_MASK | _PAGE_USER)) != _KERNPG_TABLE; 519 return (pmd_val(pmd) & ~(PTE_PFN_MASK | _PAGE_USER)) != _KERNPG_TABLE;
520} 520}
521 521
522static inline unsigned long pages_to_mb(unsigned long npg)
523{
524 return npg >> (20 - PAGE_SHIFT);
525}
526
522#if PAGETABLE_LEVELS > 2 527#if PAGETABLE_LEVELS > 2
523static inline int pud_present(pud_t pud) 528static inline int pud_present(pud_t pud)
524{ 529{
diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h
index 5362632df75b..10c71abae075 100644
--- a/arch/x86/include/asm/pgtable_32.h
+++ b/arch/x86/include/asm/pgtable_32.h
@@ -85,8 +85,6 @@ extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t);
85/* The boot page tables (all created as a single array) */ 85/* The boot page tables (all created as a single array) */
86extern unsigned long pg0[]; 86extern unsigned long pg0[];
87 87
88#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
89
90#ifdef CONFIG_X86_PAE 88#ifdef CONFIG_X86_PAE
91# include <asm/pgtable-3level.h> 89# include <asm/pgtable-3level.h>
92#else 90#else
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index d230e28a5f37..6c6c3c34bc5b 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -154,8 +154,6 @@ static inline void native_pgd_clear(pgd_t *pgd)
154 154
155#ifndef __ASSEMBLY__ 155#ifndef __ASSEMBLY__
156 156
157#define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT)) /* FIXME: is this right? */
158
159/* 157/*
160 * Conversion functions: convert a page and protection to a page entry, 158 * Conversion functions: convert a page and protection to a page entry,
161 * and a page entry and page directory to the page they refer to. 159 * and a page entry and page directory to the page they refer to.