From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, the arch/x86 maintainers <x86@kernel.org>
Subject: [PATCH 18 of 36] x86: unify pmd_page
Date: Thu, 05 Feb 2009 11:31:00 -0800 [thread overview]
Message-ID: <e1d72165d8a16de4d0af.1233862260@abulafia.goop.org> (raw)
In-Reply-To: <patchbomb.1233862242@abulafia.goop.org>
Impact: cleanup
Unify and demacro pmd_page.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
arch/x86/include/asm/pgtable.h | 5 +++++
arch/x86/include/asm/pgtable_32.h | 2 --
arch/x86/include/asm/pgtable_64.h | 2 --
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -511,6 +511,11 @@
return (unsigned long)__va(pmd_val(pmd) & PTE_PFN_MASK);
}
+static inline struct page *pmd_page(pmd_t pmd)
+{
+ return pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT);
+}
+
#if PAGETABLE_LEVELS > 2
static inline int pud_present(pud_t pud)
{
diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h
--- a/arch/x86/include/asm/pgtable_32.h
+++ b/arch/x86/include/asm/pgtable_32.h
@@ -124,8 +124,6 @@
#define pte_offset_kernel(dir, address) \
((pte_t *)pmd_page_vaddr(*(dir)) + pte_index((address)))
-#define pmd_page(pmd) (pfn_to_page(pmd_val((pmd)) >> PAGE_SHIFT))
-
#if defined(CONFIG_HIGHPTE)
#define pte_offset_map(dir, address) \
((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), KM_PTE0) + \
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -190,8 +190,6 @@
}
/* PMD - Level 2 access */
-#define pmd_page(pmd) (pfn_to_page(pmd_val((pmd)) >> PAGE_SHIFT))
-
#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))
#define pmd_offset(dir, address) ((pmd_t *)pud_page_vaddr(*(dir)) + \
pmd_index(address))
next prev parent reply other threads:[~2009-02-05 19:46 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-05 19:30 [PATCH 00 of 36] x86: clean up pte functions in pgtable*.h Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 01 of 36] x86: unify pte_none Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 02 of 36] x86: unify pte_same Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 03 of 36] x86: unify pte_present Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 04 of 36] x86: make _PAGE_HIDDEN conditional Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 05 of 36] x86: unify pte_hidden Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 06 of 36] x86: unify pud_present Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 07 of 36] x86: unify pgd_present Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 08 of 36] x86: unify pmd_present Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 09 of 36] x86: unify pmd_none Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 10 of 36] x86: unify pgd_page_vaddr Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 11 of 36] x86: unify pud_page_vaddr Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 12 of 36] x86: include pgtable_SIZE.h earlier Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 13 of 36] x86: unify pud_page Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 14 of 36] x86: unify pgd_page Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 15 of 36] x86: unify pud_index Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 16 of 36] x86: unify pud_offset Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 17 of 36] x86: unify pmd_page_vaddr Jeremy Fitzhardinge
2009-02-05 19:31 ` Jeremy Fitzhardinge [this message]
2009-02-05 19:31 ` [PATCH 19 of 36] x86: unify pmd_index Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 20 of 36] x86: unify pmd_offset Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 21 of 36] x86: remove redundant pfn_pmd definition Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 22 of 36] x86: unify pmd_pfn Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 23 " Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 24 of 36] x86: unify pte_index Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 25 of 36] x86: unify pte_offset_kernel Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 26 of 36] x86: unify pud_large Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 27 of 36] x86: unify pgd_bad Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 28 " Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 29 of 36] x86: unify pmd_bad Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 30 of 36] x86: unify pages_to_mb Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 31 of 36] x86: unify pud_none Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 32 of 36] x86: unify pgd_none Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 33 of 36] x86: unify io_remap_pfn_range Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 34 of 36] x86: add and use pgd/pud/pmd_flags Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 35 of 36] x86: make pgd/pud/pmd/pte_none consistent Jeremy Fitzhardinge
2009-02-06 15:29 ` Ian Campbell
2009-02-06 15:45 ` Ian Campbell
2009-02-06 17:43 ` Ian Campbell
2009-02-05 19:31 ` [PATCH 36 of 36] x86: make the X_bad functions consistent Jeremy Fitzhardinge
2009-02-05 20:25 ` Hugh Dickins
2009-02-05 20:39 ` Jeremy Fitzhardinge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e1d72165d8a16de4d0af.1233862260@abulafia.goop.org \
--to=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).