Subject: Re: kgdb in virtex port
To: Jean-Francois Boudreault <jfboudre@gel.ulaval.ca>
From: Jachym Holecek <freza@dspfpga.com>
List: port-powerpc
Date: 01/31/2007 21:05:19
Hello Jean-Francois,

# Jean-Francois Boudreault 2007-01-31:
> I've been playing with Jachym's virtex port for a while. I added support 
> for KGDB in your port but can't get it working right.

Cool!

> (gdb) b 270
> Breakpoint 1 at 0x2375b8: file 
> /usr/src/sys/arch/powerpc/powerpc/kgdb_machdep.c, line 270.
> (gdb) n
> Warning:
> Cannot insert breakpoint 1.
> Error accessing memory address 0x2375b8: Input/output error.
> (gdb)

Can you please see if the diff below helps? I don't have a chance to
test on the ML403 rigt now and my MOAB didn't arrive yet.

	-- Jachym

Index: kgdb_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/powerpc/kgdb_machdep.c,v
retrieving revision 1.16
diff -d -p -u -r1.16 kgdb_machdep.c
--- kgdb_machdep.c	5 Aug 2006 21:26:49 -0000	1.16
+++ kgdb_machdep.c	31 Jan 2007 20:03:29 -0000
@@ -125,6 +125,12 @@ kgdb_acc(vaddr_t va, size_t len)
 	}
 #endif /* (PPC_OEA) && !(PPC_OEA64) && !(PPC_OEA64_BRIDGE) */
 
+#if defined(PPC_IBM4XX)
+	/* Is it (supposed to be) TLB-reserved mapping? */
+	if (va < VM_MIN_KERNEL_ADDRESS || va > VM_MAX_KERNEL_ADDRESS)
+		return (1);
+#endif
+
 	last_va = va + len;
 	va  &= ~PGOFSET;
 	last_va &= ~PGOFSET;