[Crash-utility] [PATCH v2 3/3] [ppc] virtual address translation bits for PPC440

Suzuki K. Poulose suzuki at in.ibm.com
Thu Feb 2 08:47:30 UTC 2012


This patch adds the definition for PPC440 virtual address translation.

On ppc44x, the virtual-address is split as below :

Bits   |0      10|11      19|20          31|
       -------------------------------------
       |   PGD   |    PMD   | PAGE_OFFSET  |
        -----------------------------------

Also the physical address is 64bit.

Signed-off-by: Suzuki K. Poulose <suzuki at in.ibm.com>
---

 defs.h |    5 +++++
 ppc.c  |   14 ++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/defs.h b/defs.h
index aba13ea..7410412 100755
--- a/defs.h
+++ b/defs.h
@@ -2609,6 +2609,11 @@ struct load_module {
 #define DEFAULT_PTRS_PER_PGD	(1024)
 #define DEFAULT_PTE_SIZE	sizeof(ulong)
 
+/* PPC440 translation bits */
+#define PPC440_PGDIR_SHIFT	(21)
+#define PPC440_PTRS_PER_PTE	(512)
+#define PPC440_PTRS_PER_PGD	(2048)
+#define PPC440_PTE_SIZE   	sizeof(unsigned long long)
 
 #define PGDIR_SHIFT		(base_platform->pgdir_shift)
 #define PTRS_PER_PTE		(base_platform->ptrs_per_pte)
diff --git a/ppc.c b/ppc.c
index 600df34..ea7247b 100755
--- a/ppc.c
+++ b/ppc.c
@@ -83,6 +83,20 @@ struct platform {
 		.pte_size = DEFAULT_PTE_SIZE,
 	},
 	{
+		.name = "ppc440",
+		.pgdir_shift = PPC440_PGDIR_SHIFT,
+		.ptrs_per_pgd = PPC440_PTRS_PER_PGD,
+		.ptrs_per_pte = PPC440_PTRS_PER_PTE,
+		.pte_size = PPC440_PTE_SIZE,
+	},
+	{
+		.name = "ppc440gp",
+		.pgdir_shift = PPC440_PGDIR_SHIFT,
+		.ptrs_per_pgd = PPC440_PTRS_PER_PGD,
+		.ptrs_per_pte = PPC440_PTRS_PER_PTE,
+		.pte_size = PPC440_PTE_SIZE,
+	},
+	{
 		/* Keep this at the end */
 		.name = NULL,
 	}




More information about the Crash-utility mailing list