linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 15 of 36] x86: unify pud_index
Date: Thu, 05 Feb 2009 11:30:57 -0800	[thread overview]
Message-ID: <997d143cbeb1fb6719e8.1233862257@abulafia.goop.org> (raw)
In-Reply-To: <patchbomb.1233862242@abulafia.goop.org>

Impact: cleanup

Unify and demacro pud_index.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
 arch/x86/include/asm/pgtable.h    |    6 ++++++
 arch/x86/include/asm/pgtable_64.h |    2 --
 2 files changed, 6 insertions(+), 2 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
@@ -538,6 +538,12 @@
 {
 	return pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT);
 }
+
+/* to find an entry in a page-table-directory. */
+static inline unsigned pud_index(unsigned long address)
+{
+	return (address >> PUD_SHIFT) & (PTRS_PER_PUD - 1);
+}
 #endif	/* PAGETABLE_LEVELS > 3 */
 
 #endif	/* __ASSEMBLY__ */
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
@@ -182,8 +182,6 @@
 #define mk_kernel_pgd(address) __pgd((address) | _KERNPG_TABLE)
 
 /* PUD - Level3 access */
-/* to find an entry in a page-table-directory. */
-#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)))
 



  parent reply	other threads:[~2009-02-05 19:37 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 ` Jeremy Fitzhardinge [this message]
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=997d143cbeb1fb6719e8.1233862257@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).