lkml.org 
[lkml]   [2009]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[RFC][PATCH 23/35] factor x86 pte mapping code
From
Date

x86 contains three separate pte_offset_map() implementations:
1. 32-bit highpte
2. 32-bit direct mapped
3. 64-bit direct mapped

This patch consolidates the 32-bit direct map and 64-bit
implementations. You can look back at the 00 patch in this
series to see a bit of proof about why

#define pte_offset_map(dir, address) \
((pte_t *)page_address(pmd_page(*(dir))) + pte_index((address)))

and

#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))

are actually interchangable.

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

linux-2.6.git-dave/arch/x86/include/asm/ptemap.h | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)

diff -puN arch/x86/include/asm/ptemap.h~factor-x86 arch/x86/include/asm/ptemap.h
--- linux-2.6.git/arch/x86/include/asm/ptemap.h~factor-x86 2009-04-30 15:11:06.000000000 -0700
+++ linux-2.6.git-dave/arch/x86/include/asm/ptemap.h 2009-04-30 15:11:06.000000000 -0700
@@ -1,10 +1,7 @@
#ifndef _X86_ASM_PTEMAP_H
#define _X86_ASM_PTEMAP_H

-#ifdef CONFIG_X86_32
-
#if defined(CONFIG_HIGHPTE)
-
#define pte_offset_map(dir, address) \
((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), KM_PTE0) + \
pte_index((address)))
@@ -13,21 +10,13 @@
pte_index((address)))
#define pte_unmap(pte) kunmap_atomic((pte), KM_PTE0)
#define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1)
-#else
-#define pte_offset_map(dir, address) \
- ((pte_t *)page_address(pmd_page(*(dir))) + pte_index((address)))
-#define pte_offset_map_nested(dir, address) pte_offset_map((dir), (address))
-#define pte_unmap(pte) do { } while (0)
-#define pte_unmap_nested(pte) do { } while (0)
-#endif

-#else /* x86-64 */
+#else /* !CONFIG_HIGHPTE */

-/* x86-64 always has all page tables mapped. */
#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))
#define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address))
-#define pte_unmap(pte) /* NOP */
-#define pte_unmap_nested(pte) /* NOP */
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)

#endif

_

\
 
 \ /
  Last update: 2009-05-01 16:53    [W:0.176 / U:16.308 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site