FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 02-13-2012, 06:14 AM
"Suzuki K. Poulose"
 
Default virtual address translation bits for PPC44x

This patch adds the definition for PPC44x 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@in.ibm.com>
---

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

diff --git a/defs.h b/defs.h
index 603a583..094a442 100755
--- a/defs.h
+++ b/defs.h
@@ -2647,6 +2647,11 @@ struct load_module {
#define DEFAULT_PTRS_PER_PGD (1024)
#define DEFAULT_PTE_SIZE sizeof(ulong)

+/* PPC44x translation bits */
+#define PPC44x_PGDIR_SHIFT (21)
+#define PPC44x_PTRS_PER_PTE (512)
+#define PPC44x_PTRS_PER_PGD (2048)
+#define PPC44x_PTE_SIZE sizeof(ulonglong)

#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 0e934ca..b36bffc 100755
--- a/ppc.c
+++ b/ppc.c
@@ -82,17 +82,36 @@ static void ppc_display_machine_stats(void);
static void ppc_dump_line_number(ulong);
static struct line_number_hook ppc_line_number_hooks[];

+static int probe_ppc44x_platform(char *, struct platform *);
static int probe_default_platform(char *, struct platform *);
static void ppc_probe_base_platform(void);

typedef int (*probe_func_t) (char *, struct platform *);

probe_func_t probe_platforms[] = {
+ probe_ppc44x_platform, /* 44x chipsets */
probe_default_platform, /* This should be at the end */
NULL
};

static int
+probe_ppc44x_platform(char *name, struct platform *p)
+{
+ /* 44x include ppc440* and ppc470 */
+ if (STRNEQ(name, "ppc440") || STREQ(name, "ppc470")) {
+ p->pgdir_shift = PPC44x_PGDIR_SHIFT;
+ p->ptrs_per_pgd = PPC44x_PTRS_PER_PGD;
+ p->ptrs_per_pte = PPC44x_PTRS_PER_PTE;
+ p->pte_size = PPC44x_PTE_SIZE;
+ p->name = strdup(name);
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static int
probe_default_platform(char *name, struct platform *p)
{
/* Use the default definitions */

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 02-20-2012, 10:07 AM
"Suzuki K. Poulose"
 
Default virtual address translation bits for PPC44x

This patch adds the definition for PPC44x virtual address translation.

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

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

Also the physical address is 64bit.

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

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

diff --git a/defs.h b/defs.h
index 0c5558e..6a6011f 100755
--- a/defs.h
+++ b/defs.h
@@ -2654,6 +2654,12 @@ struct load_module {
#define DEFAULT_PTRS_PER_PGD (1024)
#define DEFAULT_PTE_SIZE sizeof(ulong)

+/* PPC44x translation bits */
+#define PPC44x_PGDIR_SHIFT (21)
+#define PPC44x_PTRS_PER_PTE (512)
+#define PPC44x_PTRS_PER_PGD (2048)
+#define PPC44x_PTE_SIZE sizeof(ulonglong)
+
/* PAGE flags */
#define _PAGE_PRESENT (machdep->machspec->_page_present) /* software: pte contains a translation */
#define _PAGE_USER (machdep->machspec->_page_user) /* matches one of the PP bits */
@@ -2680,6 +2686,19 @@ struct load_module {
#define DEFAULT_PAGE_HWWRITE 0x200
#define DEFAULT_PAGE_SHARED 0

+/* PPC44x PAGE flags: Values from kernel asm/pte-44x.h */
+#define PPC44x_PAGE_PRESENT 0x001
+#define PPC44x_PAGE_RW 0x002
+#define PPC44x_PAGE_ACCESSED 0x008
+#define PPC44x_PAGE_DIRTY 0x010
+#define PPC44x_PAGE_USER 0x040
+#define PPC44x_PAGE_GUARDED 0x100
+#define PPC44x_PAGE_COHERENT 0x200
+#define PPC44x_PAGE_NO_CACHE 0x400
+#define PPC44x_PAGE_WRITETHRU 0x800
+#define PPC44x_PAGE_HWWRITE 0
+#define PPC44x_PAGE_SHARED 0
+
#define SWP_TYPE(entry) (((entry) >> 1) & 0x7f)
#define SWP_OFFSET(entry) ((entry) >> 8)
#define __swp_type(entry) SWP_TYPE(entry)
diff --git a/ppc.c b/ppc.c
index 9f765b6..2cde018 100755
--- a/ppc.c
+++ b/ppc.c
@@ -73,16 +73,51 @@ static struct line_number_hook ppc_line_number_hooks[];

static struct machine_specific ppc_machine_specific = { 0 };
static int probe_default_platform(char *);
+static int probe_ppc44x_platform(char *);
static void ppc_probe_base_platform(void);

typedef int (*probe_func_t) (char *);

probe_func_t probe_platforms[] = {
+ probe_ppc44x_platform, /* 44x chipsets */
probe_default_platform, /* This should be at the end */
NULL
};

static int
+probe_ppc44x_platform(char *name)
+{
+ struct machine_specific *machspec = machdep->machspec;
+
+ /* 44x include ppc440* and ppc470 */
+ if (STRNEQ(name, "ppc440") || STREQ(name, "ppc470")) {
+
+ machspec->platform = strdup(name);
+
+ machspec->pgdir_shift = PPC44x_PGDIR_SHIFT;
+ machspec->ptrs_per_pgd = PPC44x_PTRS_PER_PGD;
+ machspec->ptrs_per_pte = PPC44x_PTRS_PER_PTE;
+ machspec->pte_size = PPC44x_PTE_SIZE;
+
+ machspec->_page_present = PPC44x_PAGE_PRESENT;
+ machspec->_page_user = PPC44x_PAGE_USER;
+ machspec->_page_rw = PPC44x_PAGE_RW;
+ machspec->_page_guarded = PPC44x_PAGE_GUARDED;
+ machspec->_page_coherent = PPC44x_PAGE_COHERENT;
+ machspec->_page_no_cache = PPC44x_PAGE_NO_CACHE;
+ machspec->_page_writethru = PPC44x_PAGE_WRITETHRU;
+ machspec->_page_dirty = PPC44x_PAGE_DIRTY;
+ machspec->_page_accessed = PPC44x_PAGE_ACCESSED;
+ machspec->_page_hwwrite = PPC44x_PAGE_HWWRITE;
+ machspec->_page_shared = PPC44x_PAGE_SHARED;
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static int
probe_default_platform(char *name)
{
struct machine_specific *machspec = machdep->machspec;

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 

Thread Tools




All times are GMT. The time now is 05:14 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org