[Crash-utility] crash version 4.0-3.21 is available

Bernhard Walle bwalle at suse.de
Mon Mar 19 14:31:19 UTC 2007


* Dave Anderson <anderson at redhat.com> [2007-03-16 21:29]:
> 
> - In current 2.6 kernels, it is now possible to recognize ppc BOOKE
>   processors, which is the current default in crash.  If the processor
>   is confirmed to not be BOOKE, then page table translation is done
>   differently.  (antipov at ru.mvista.com)

The current code doesn't build on PPC32. Follwing patch fixes the
problem. However, I consider the patch as evil, so maybe it would be
better to change some data types that are involved here, but I don't
really know.


---
 ppc.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Index: crash-4.0-3.21/ppc.c
===================================================================
--- crash-4.0-3.21.orig/ppc.c
+++ crash-4.0-3.21/ppc.c
@@ -301,8 +301,8 @@ ppc_uvtop(struct task_context *tc, ulong
 	if (machdep->flags & CPU_BOOKE)
 		page_table = page_middle + (BTOP(vaddr) & (PTRS_PER_PTE - 1));
 	else
-		page_table = ((page_middle & machdep->pagemask) + machdep->kvbase) +
-			(BTOP(vaddr) & (PTRS_PER_PTE-1));
+		page_table = (ulong *)((ulong)( (((ulonglong)(ulong)page_middle & machdep->pagemask)
+						+ machdep->kvbase) + ((BTOP(vaddr)) & (PTRS_PER_PTE-1)) ));
 
 	if (verbose)
 		fprintf(fp, "  PMD: %lx => %lx\n",(ulong)page_middle, 
@@ -389,8 +389,8 @@ ppc_kvtop(struct task_context *tc, ulong
 	if (machdep->flags & CPU_BOOKE)
 		page_table = page_middle + (BTOP(kvaddr) & (PTRS_PER_PTE - 1));
 	else
-		page_table = ((page_middle & machdep->pagemask) + machdep->kvbase) +
-			(BTOP(kvaddr) & (PTRS_PER_PTE-1));
+		page_table = (ulong *)((ulong)( (((ulonglong)(ulong)page_middle & machdep->pagemask)
+						+ machdep->kvbase) + ((BTOP(kvaddr)) & (PTRS_PER_PTE-1)) ));
 
 	if (verbose)
 		fprintf(fp, "  PMD: %lx => %lx\n", (ulong)page_middle, 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20070319/b4915653/attachment.sig>


More information about the Crash-utility mailing list