linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave@linux.vnet.ibm.com>
To: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Dave Hansen <dave@linux.vnet.ibm.com>
Subject: [RFC][PATCH 21/35] create linux/ptemap.h for arch-independent pte mapping funcs
Date: Fri, 01 May 2009 07:42:34 -0700	[thread overview]
Message-ID: <20090501144234.8A919A8F@kernel> (raw)
In-Reply-To: <20090501144201.D31EF417@kernel>


linux/mm.h has a couple of completely arch-independent 
pte mapping functions.  Let's move them to their own header
to help separate out their dependencies from the rest of
mm.h.

I'll get the callsites in the next patch.  For now, just
include the new header where its functions used to be.
I'll remove this in the next patch.

Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
---

 linux-2.6.git-dave/include/linux/mm.h     |   26 ----------------------
 linux-2.6.git-dave/include/linux/ptemap.h |   34 ++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 26 deletions(-)

diff -puN include/linux/mm.h~linux-ptemap-h include/linux/mm.h
--- linux-2.6.git/include/linux/mm.h~linux-ptemap-h	2009-04-30 15:11:04.000000000 -0700
+++ linux-2.6.git-dave/include/linux/mm.h	2009-04-30 15:11:04.000000000 -0700
@@ -969,32 +969,6 @@ static inline void pgtable_page_dtor(str
 	dec_zone_page_state(page, NR_PAGETABLE);
 }
 
-#define pte_offset_map_lock(mm, pmd, address, ptlp)	\
-({							\
-	spinlock_t *__ptl = pte_lockptr(mm, pmd);	\
-	pte_t *__pte = pte_offset_map(pmd, address);	\
-	*(ptlp) = __ptl;				\
-	spin_lock(__ptl);				\
-	__pte;						\
-})
-
-#define pte_unmap_unlock(pte, ptl)	do {		\
-	spin_unlock(ptl);				\
-	pte_unmap(pte);					\
-} while (0)
-
-#define pte_alloc_map(mm, pmd, address)			\
-	((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \
-		NULL: pte_offset_map(pmd, address))
-
-#define pte_alloc_map_lock(mm, pmd, address, ptlp)	\
-	((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \
-		NULL: pte_offset_map_lock(mm, pmd, address, ptlp))
-
-#define pte_alloc_kernel(pmd, address)			\
-	((unlikely(!pmd_present(*(pmd))) && __pte_alloc_kernel(pmd, address))? \
-		NULL: pte_offset_kernel(pmd, address))
-
 extern void free_area_init(unsigned long * zones_size);
 extern void free_area_init_node(int nid, unsigned long * zones_size,
 		unsigned long zone_start_pfn, unsigned long *zholes_size);
diff -puN include/linux/ptemap.h~linux-ptemap-h include/linux/ptemap.h
--- linux-2.6.git/include/linux/ptemap.h~linux-ptemap-h	2009-04-30 15:11:04.000000000 -0700
+++ linux-2.6.git-dave/include/linux/ptemap.h	2009-04-30 15:11:04.000000000 -0700
@@ -0,0 +1,34 @@
+#ifndef _LINUX_PTE_MAP_H
+#define _LINUX_PTE_MAP_H
+
+#include <linux/mm.h>
+#include <asm/ptemap.h>
+
+#define pte_offset_map_lock(mm, pmd, address, ptlp)	\
+({							\
+	spinlock_t *__ptl = pte_lockptr(mm, pmd);	\
+	pte_t *__pte = pte_offset_map(pmd, address);	\
+	*(ptlp) = __ptl;				\
+	spin_lock(__ptl);				\
+	__pte;						\
+})
+
+#define pte_unmap_unlock(pte, ptl)	do {		\
+	spin_unlock(ptl);				\
+	pte_unmap(pte);					\
+} while (0)
+
+#define pte_alloc_map(mm, pmd, address)			\
+	((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \
+		NULL: pte_offset_map(pmd, address))
+
+#define pte_alloc_map_lock(mm, pmd, address, ptlp)	\
+	((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \
+		NULL: pte_offset_map_lock(mm, pmd, address, ptlp))
+
+#define pte_alloc_kernel(pmd, address)			\
+	((unlikely(!pmd_present(*(pmd))) && __pte_alloc_kernel(pmd, address))? \
+		NULL: pte_offset_kernel(pmd, address))
+
+
+#endif /* _LINUX_PTE_MAP_H */
_

  parent reply	other threads:[~2009-05-01 14:42 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-01 14:42 [RFC][PATCH 00/35] consolidate pte mapping functions across all architectures Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 01/35] rename arm and frv's __pte_index() Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 02/35] rework sparc pte functions to be consistent with other arches Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 03/35] alpha: create ptemap.h Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 04/35] arm: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 05/35] avr32: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 06/35] cris: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 07/35] frv: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 08/35] ia64: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 09/35] m32r: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 10/35] m68k: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 11/35] mips: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 12/35] mn10300: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 13/35] parisc: " Dave Hansen
2009-05-02 14:29   ` Kyle McMartin
2009-05-02 21:45     ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 14/35] powerpc: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 15/35] s390: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 16/35] sh: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 17/35] sparc: " Dave Hansen
2009-05-02  7:02   ` Daniel K.
2009-05-02 21:42     ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 18/35] um: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 19/35] x86: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 20/35] xtensa: " Dave Hansen
2009-05-01 14:42 ` Dave Hansen [this message]
2009-05-01 14:42 ` [RFC][PATCH 22/35] include linux/ptemap.h at all use sites Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 23/35] factor x86 pte mapping code Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 24/35] arm: use pte_offset_kernel() as base for pte_offset_map*() Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 25/35] cris: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 26/35] frv: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 27/35] m32r: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 28/35] mips: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 29/35] um: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 30/35] m68k: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 31/35] mn10300: " Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 32/35] Move users to asm-generic/ptemap.h Dave Hansen
2009-05-01 17:43   ` Christoph Hellwig
2009-05-01 18:08     ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 33/35] asm-generic/ptemap.h for HIGHPTE users Dave Hansen
2009-05-01 17:51   ` Luck, Tony
2009-05-01 18:10     ` Dave Hansen
2009-05-01 18:29       ` Luck, Tony
2009-05-01 18:32         ` Dave Hansen
2009-05-01 14:42 ` [RFC][PATCH 34/35] powerpc use generic ptemap.h Dave Hansen
2009-05-01 17:46   ` Christoph Hellwig
2009-05-01 17:58     ` Dave Hansen
2009-05-17  3:55   ` Benjamin Herrenschmidt
2009-05-01 14:42 ` [RFC][PATCH 35/35] remove old ptemap.h includes Dave Hansen
2009-05-01 14:59   ` Ingo Molnar
2009-05-01 15:02     ` Dave Hansen

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=20090501144234.8A919A8F@kernel \
    --to=dave@linux.vnet.ibm.com \
    --cc=linux-arch@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).