This patch defines the translation bits for PPC44x. Signed-off-by : Suzuki K. Poulose <suzuki at in.ibm.com> --- arch/ppc.c | 15 +++++++++++++++ makedumpfile.h | 4 ++++ 2 files changed, 19 insertions(+), 0 deletions(-) diff --git a/arch/ppc.c b/arch/ppc.c index 0ad2cf4..b63a617 100644 --- a/arch/ppc.c +++ b/arch/ppc.c @@ -37,12 +37,27 @@ struct platform { typedef int (*probe_func_t)(char *, struct platform *); static int probe_default_platform(char *, struct platform*); +static int probe_ppc44x_platform(char *, struct platform*); probe_func_t probe_platforms[] = { + probe_ppc44x_platform, probe_default_platform, /* This should be at the end of the list */ NULL }; +static int probe_ppc44x_platform(char *s, struct platform *p) +{ + if (!strncmp(s, "ppc440", 6) || strcmp(s, "ppc470")) { + p->name = strdup(s); + p->pgdir_shift = PPC44x_PGDIR_SHIFT; + p->ptrs_per_pte = PPC44x_PTRS_PER_PTE; + p->pte_size = PPC44x_PTE_SIZE; + + return TRUE; + } + return FALSE; +} + static int probe_default_platform(char *s, struct platform *p) { /* Accept as the default platform */ diff --git a/makedumpfile.h b/makedumpfile.h index 3a5152c..430202b 100644 --- a/makedumpfile.h +++ b/makedumpfile.h @@ -543,6 +543,10 @@ do { \ #define DEFAULT_PTRS_PER_PTE (1024) #define DEFAULT_PTE_SIZE (sizeof(unsigned long)) +#define PPC44x_PGDIR_SHIFT (21) +#define PPC44x_PTRS_PER_PTE (512) +#define PPC44x_PTE_SIZE (sizeof(unsigned long long)) + #define PGDIR_SHIFT (base_platform.pgdir_shift) #define PTRS_PER_PTE (base_platform.ptrs_per_pte) #define PTE_SIZE (base_platform.pte_size)