[PATCH v2] Consolidate mm_context_t definition in mmu.h

STALE6963d

3 messages, 2 authors, 2007-07-11 · open the first message on its own page

[PATCH v2] Consolidate mm_context_t definition in mmu.h

From: Josh Boyer <hidden>
Date: 2007-07-10 17:52:35

All of the platforms except PPC64 share a common mm_context_t definition.
Defining it in mmu.h avoids duplicating it in the platform specific mmu
header files.  We further consolidate it by having the PPC32 definition
share the mm_context_id_t type for the id member.

Signed-off-by: Josh Boyer <redacted>

---
 include/asm-powerpc/mmu-44x.h       |    5 -----
 include/asm-powerpc/mmu-8xx.h       |    4 ----
 include/asm-powerpc/mmu-fsl-booke.h |    4 ----
 include/asm-powerpc/mmu-hash32.h    |    5 -----
 include/asm-powerpc/mmu-hash64.h    |   16 ----------------
 include/asm-powerpc/mmu.h           |   21 +++++++++++++++++++++
 6 files changed, 21 insertions(+), 34 deletions(-)
--- linux-2.6.orig/include/asm-powerpc/mmu-44x.h
+++ linux-2.6/include/asm-powerpc/mmu-44x.h
@@ -55,11 +55,6 @@
 
 typedef unsigned long long phys_addr_t;
 
-typedef struct {
-	unsigned long id;
-	unsigned long vdso_base;
-} mm_context_t;
-
 #endif /* !__ASSEMBLY__ */
 
 #ifndef CONFIG_PPC_EARLY_DEBUG_44x
--- linux-2.6.orig/include/asm-powerpc/mmu-8xx.h
+++ linux-2.6/include/asm-powerpc/mmu-8xx.h
@@ -138,10 +138,6 @@
 #ifndef __ASSEMBLY__
 typedef unsigned long phys_addr_t;
 
-typedef struct {
-	unsigned long id;
-	unsigned long vdso_base;
-} mm_context_t;
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_POWERPC_MMU_8XX_H_ */
--- linux-2.6.orig/include/asm-powerpc/mmu-fsl-booke.h
+++ linux-2.6/include/asm-powerpc/mmu-fsl-booke.h
@@ -79,10 +79,6 @@ typedef unsigned long phys_addr_t;
 typedef unsigned long long phys_addr_t;
 #endif
 
-typedef struct {
-	unsigned long id;
-	unsigned long vdso_base;
-} mm_context_t;
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_POWERPC_MMU_FSL_BOOKE_H_ */
--- linux-2.6.orig/include/asm-powerpc/mmu-hash32.h
+++ linux-2.6/include/asm-powerpc/mmu-hash32.h
@@ -79,11 +79,6 @@ struct hash_pte {
 	unsigned long pp:2;	/* Page protection */
 };
 
-typedef struct {
-	unsigned long id;
-	unsigned long vdso_base;
-} mm_context_t;
-
 typedef unsigned long phys_addr_t;
 
 #endif /* !__ASSEMBLY__ */
--- linux-2.6.orig/include/asm-powerpc/mmu-hash64.h
+++ linux-2.6/include/asm-powerpc/mmu-hash64.h
@@ -359,22 +359,6 @@ extern void stab_initialize(unsigned lon
 
 #ifndef __ASSEMBLY__
 
-typedef unsigned long mm_context_id_t;
-
-typedef struct {
-	mm_context_id_t id;
-	u16 user_psize;		/* page size index */
-
-#ifdef CONFIG_PPC_MM_SLICES
-	u64 low_slices_psize;	/* SLB page size encodings */
-	u64 high_slices_psize;  /* 4 bits per slice for now */
-#else
-	u16 sllp;		/* SLB page size encoding */
-#endif
-	unsigned long vdso_base;
-} mm_context_t;
-
-
 static inline unsigned long vsid_scramble(unsigned long protovsid)
 {
 #if 0
--- linux-2.6.orig/include/asm-powerpc/mmu.h
+++ linux-2.6/include/asm-powerpc/mmu.h
@@ -19,5 +19,26 @@
 #  include <asm/mmu-8xx.h>
 #endif
 
+#ifndef __ASSEMBLY__
+
+typedef unsigned long mm_context_id_t;
+
+typedef struct {
+	mm_context_id_t id;
+#ifdef CONFIG_PPC64
+	u16 user_psize;		/* page size index */
+
+#ifdef CONFIG_PPC_MM_SLICES
+	u64 low_slices_psize;	/* SLB page size encodings */
+	u64 high_slices_psize;  /* 4 bits per slice for now */
+#else
+	u16 sllp;		/* SLB page size encoding */
+#endif
+#endif /* CONFIG_PPC64 */
+	unsigned long vdso_base;
+} mm_context_t;
+
+#endif /* !__ASSEMBLY__ */
+
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_MMU_H_ */

Re: [PATCH v2] Consolidate mm_context_t definition in mmu.h

From: Paul Mackerras <hidden>
Date: 2007-07-10 23:10:37

Josh Boyer writes:
All of the platforms except PPC64 share a common mm_context_t definition.
Defining it in mmu.h avoids duplicating it in the platform specific mmu
header files.  We further consolidate it by having the PPC32 definition
share the mm_context_id_t type for the id member.
Unfortunately the string of ifdefs in your consolidated version makes
my eyes water.  I'm not sure it isn't better the way it is.

Paul.

Re: [PATCH v2] Consolidate mm_context_t definition in mmu.h

From: Josh Boyer <hidden>
Date: 2007-07-11 02:11:20

On Wed, Jul 11, 2007 at 09:10:37AM +1000, Paul Mackerras wrote:
Josh Boyer writes:
quoted
All of the platforms except PPC64 share a common mm_context_t definition.
Defining it in mmu.h avoids duplicating it in the platform specific mmu
header files.  We further consolidate it by having the PPC32 definition
share the mm_context_id_t type for the id member.
Unfortunately the string of ifdefs in your consolidated version makes
my eyes water.  I'm not sure it isn't better the way it is.
Eh, you're the maintainer.  No worries.

Though realistically, I only added a single ifdef set in the structure.  The
rest are all Ben's ;)

josh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help