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 13 of 36] x86: unify pud_page
Date: Thu, 05 Feb 2009 11:30:55 -0800 [thread overview]
Message-ID: <950c59f445771a7a67e2.1233862255@abulafia.goop.org> (raw)
In-Reply-To: <patchbomb.1233862242@abulafia.goop.org>
Impact: cleanup
Unify and demacro pud_page.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
arch/x86/include/asm/pgtable-3level.h | 2 --
arch/x86/include/asm/pgtable.h | 6 ++++++
arch/x86/include/asm/pgtable_64.h | 1 -
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h
--- a/arch/x86/include/asm/pgtable-3level.h
+++ b/arch/x86/include/asm/pgtable-3level.h
@@ -115,8 +115,6 @@
write_cr3(pgd);
}
-#define pud_page(pud) pfn_to_page(pud_val(pud) >> PAGE_SHIFT)
-
/* Find an entry in the second-level page table.. */
#define pmd_offset(pud, address) ((pmd_t *)pud_page_vaddr(*(pud)) + \
pmd_index(address))
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
@@ -471,6 +471,7 @@
#endif
#ifndef __ASSEMBLY__
+#include <linux/mm_types.h>
static inline int pte_none(pte_t pte)
{
@@ -515,6 +516,11 @@
{
return (unsigned long)__va((unsigned long)pud_val(pud) & PTE_PFN_MASK);
}
+
+static inline struct page *pud_page(pud_t pud)
+{
+ return pfn_to_page(pud_val(pud) >> PAGE_SHIFT);
+}
#endif /* PAGETABLE_LEVELS > 2 */
#if PAGETABLE_LEVELS > 3
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
@@ -184,7 +184,6 @@
/* PUD - Level3 access */
/* to find an entry in a page-table-directory. */
-#define pud_page(pud) (pfn_to_page(pud_val((pud)) >> PAGE_SHIFT))
#define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))
#define pud_offset(pgd, address) \
((pud_t *)pgd_page_vaddr(*(pgd)) + pud_index((address)))
next prev parent reply other threads:[~2009-02-05 19:36 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 ` Jeremy Fitzhardinge [this message]
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 ` [PATCH 18 of 36] x86: unify pmd_page Jeremy Fitzhardinge
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=950c59f445771a7a67e2.1233862255@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
all inboxes | Powered by JetHome®