From: "Paolo 'Blaisorblade' Giarrusso" <blaisorblade@yahoo.it>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/7] i386: little pgtable.h consolidation vs 2/3level
Date: Tue, 20 Sep 2005 20:45:32 +0200 [thread overview]
Message-ID: <20050920184531.14557.8668.stgit@zion.home.lan> (raw)
In-Reply-To: <20050920184513.14557.8152.stgit@zion.home.lan>
Join together some common functions (pmd_page{,_kernel}) over 2level and
3level pages.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---
include/asm-i386/pgtable-2level.h | 5 -----
include/asm-i386/pgtable-3level.h | 5 -----
include/asm-i386/pgtable.h | 5 +++++
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h
--- a/include/asm-i386/pgtable-2level.h
+++ b/include/asm-i386/pgtable-2level.h
@@ -26,11 +26,6 @@
#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
#define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
-#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
-
-#define pmd_page_kernel(pmd) \
-((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
-
/*
* All present user pages are user-executable:
*/
diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h
--- a/include/asm-i386/pgtable-3level.h
+++ b/include/asm-i386/pgtable-3level.h
@@ -74,11 +74,6 @@ static inline void set_pte(pte_t *ptep,
*/
static inline void pud_clear (pud_t * pud) { }
-#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
-
-#define pmd_page_kernel(pmd) \
-((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
-
#define pud_page(pud) \
((struct page *) __va(pud_val(pud) & PAGE_MASK))
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -368,6 +368,11 @@ static inline pte_t pte_modify(pte_t pte
#define pte_offset_kernel(dir, address) \
((pte_t *) pmd_page_kernel(*(dir)) + pte_index(address))
+#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
+
+#define pmd_page_kernel(pmd) \
+((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
+
/*
* Helper function that returns the kernel pagetable entry controlling
* the virtual address 'address'. NULL means no pagetable entry present.
next prev parent reply other threads:[~2005-09-20 18:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-20 18:45 [PATCH 1/7] Add dm-snapshot tutorial in Documentation Paolo 'Blaisorblade' Giarrusso
2005-09-20 18:45 ` Paolo 'Blaisorblade' Giarrusso [this message]
2005-09-20 18:45 ` [PATCH 3/7] fix locking comment in unmap_region() Paolo 'Blaisorblade' Giarrusso
2005-09-20 18:45 ` [PATCH 4/7] README update from the stone age Paolo 'Blaisorblade' Giarrusso
2005-09-20 23:53 ` Randy.Dunlap
2005-09-20 18:45 ` [PATCH 5/7] Clearify comment in swapfile.c Paolo 'Blaisorblade' Giarrusso
2005-09-20 18:45 ` [PATCH 6/7] update stale comment for removal of page->list Paolo 'Blaisorblade' Giarrusso
2005-09-20 18:46 ` [PATCH 7/7] Add a note about partially hardcoded VM_* flags Paolo 'Blaisorblade' Giarrusso
2005-09-20 22:13 ` [PATCH 1/7] Add dm-snapshot tutorial in Documentation Nix
2005-09-21 15:04 ` Blaisorblade
2005-09-21 16:11 ` Nix
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=20050920184531.14557.8668.stgit@zion.home.lan \
--to=blaisorblade@yahoo.it \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.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®