PERFORCE change 54877 for review

Marcel Moolenaar marcel at FreeBSD.org
Mon Jun 14 00:59:25 GMT 2004


http://perforce.freebsd.org/chv.cgi?CH=54877

Change 54877 by marcel at marcel_nfs on 2004/06/14 00:58:39

	Convert from trapframe to PCB. Followup to previous commits.

Affected files ...

.. //depot/projects/gdb/sys/ia64/ia64/gdb_machdep.c#8 edit

Differences ...

==== //depot/projects/gdb/sys/ia64/ia64/gdb_machdep.c#8 (text+ko) ====

@@ -34,8 +34,9 @@
 #include <sys/proc.h>
 #include <sys/signal.h>
 
-#include <machine/frame.h>
 #include <machine/gdb_machdep.h>
+#include <machine/md_var.h>
+#include <machine/pcb.h>
 #include <machine/reg.h>
 
 #include <gdb/gdb.h>
@@ -45,88 +46,65 @@
 gdb_cpu_getreg(int regnum, size_t *regsz)
 {
 	static uint64_t synth;
-	struct trapframe *tf = kdb_frame;
+	uint64_t cfm;
 
 	*regsz = gdb_cpu_regsz(regnum);
 	switch (regnum) {
 	/* Registers 0-127: general registers. */
-	case 1:  return (&tf->tf_special.gp);
-	case 2:  return (&tf->tf_scratch.gr2);
-	case 3:  return (&tf->tf_scratch.gr3);
-	case 8:  return (&tf->tf_scratch.gr8);
-	case 9:  return (&tf->tf_scratch.gr9);
-	case 10: return (&tf->tf_scratch.gr10);
-	case 11: return (&tf->tf_scratch.gr11);
-	case 12: return (&tf->tf_special.sp);
-	case 13: return (&tf->tf_special.tp);
-	case 14: return (&tf->tf_scratch.gr14);
-	case 15: return (&tf->tf_scratch.gr15);
-	case 16: return (&tf->tf_scratch.gr16);
-	case 17: return (&tf->tf_scratch.gr17);
-	case 18: return (&tf->tf_scratch.gr18);
-	case 19: return (&tf->tf_scratch.gr19);
-	case 20: return (&tf->tf_scratch.gr20);
-	case 21: return (&tf->tf_scratch.gr21);
-	case 22: return (&tf->tf_scratch.gr22);
-	case 23: return (&tf->tf_scratch.gr23);
-	case 24: return (&tf->tf_scratch.gr24);
-	case 25: return (&tf->tf_scratch.gr25);
-	case 26: return (&tf->tf_scratch.gr26);
-	case 27: return (&tf->tf_scratch.gr27);
-	case 28: return (&tf->tf_scratch.gr28);
-	case 29: return (&tf->tf_scratch.gr29);
-	case 30: return (&tf->tf_scratch.gr30);
-	case 31: return (&tf->tf_scratch.gr31);
+	case 1:  return (&kdb_thrctx->pcb_special.gp);
+	case 4:  return (&kdb_thrctx->pcb_preserved.gr4);
+	case 5:  return (&kdb_thrctx->pcb_preserved.gr5);
+	case 6:  return (&kdb_thrctx->pcb_preserved.gr6);
+	case 7:  return (&kdb_thrctx->pcb_preserved.gr7);
+	case 12: return (&kdb_thrctx->pcb_special.sp);
+	case 13: return (&kdb_thrctx->pcb_special.tp);
 	/* Registers 128-255: floating-point registers. */
-	case 134: return (&tf->tf_scratch_fp.fr6);
-	case 135: return (&tf->tf_scratch_fp.fr7);
-	case 136: return (&tf->tf_scratch_fp.fr8);
-	case 137: return (&tf->tf_scratch_fp.fr9);
-	case 138: return (&tf->tf_scratch_fp.fr10);
-	case 139: return (&tf->tf_scratch_fp.fr11);
-	case 140: return (&tf->tf_scratch_fp.fr12);
-	case 141: return (&tf->tf_scratch_fp.fr13);
-	case 142: return (&tf->tf_scratch_fp.fr14);
-	case 143: return (&tf->tf_scratch_fp.fr15);
+	case 130: return (&kdb_thrctx->pcb_preserved_fp.fr2);
+	case 131: return (&kdb_thrctx->pcb_preserved_fp.fr3);
+	case 132: return (&kdb_thrctx->pcb_preserved_fp.fr4);
+	case 133: return (&kdb_thrctx->pcb_preserved_fp.fr5);
+	case 144: return (&kdb_thrctx->pcb_preserved_fp.fr16);
+	case 145: return (&kdb_thrctx->pcb_preserved_fp.fr17);
+	case 146: return (&kdb_thrctx->pcb_preserved_fp.fr18);
+	case 147: return (&kdb_thrctx->pcb_preserved_fp.fr19);
+	case 148: return (&kdb_thrctx->pcb_preserved_fp.fr20);
+	case 149: return (&kdb_thrctx->pcb_preserved_fp.fr21);
+	case 150: return (&kdb_thrctx->pcb_preserved_fp.fr22);
+	case 151: return (&kdb_thrctx->pcb_preserved_fp.fr23);
+	case 152: return (&kdb_thrctx->pcb_preserved_fp.fr24);
+	case 153: return (&kdb_thrctx->pcb_preserved_fp.fr25);
+	case 154: return (&kdb_thrctx->pcb_preserved_fp.fr26);
+	case 155: return (&kdb_thrctx->pcb_preserved_fp.fr27);
+	case 156: return (&kdb_thrctx->pcb_preserved_fp.fr28);
+	case 157: return (&kdb_thrctx->pcb_preserved_fp.fr29);
+	case 158: return (&kdb_thrctx->pcb_preserved_fp.fr30);
+	case 159: return (&kdb_thrctx->pcb_preserved_fp.fr31);
 	/* Registers 320-327: branch registers. */
-	case 320: return (&tf->tf_special.rp);
-	case 326: return (&tf->tf_scratch.br6);
-	case 327: return (&tf->tf_scratch.br7);
+	case 321: return (&kdb_thrctx->pcb_preserved.br1);
+	case 322: return (&kdb_thrctx->pcb_preserved.br2);
+	case 323: return (&kdb_thrctx->pcb_preserved.br3);
+	case 324: return (&kdb_thrctx->pcb_preserved.br4);
+	case 325: return (&kdb_thrctx->pcb_preserved.br5);
 	/* Registers 328-333: misc. other registers. */
-	case 330: return (&tf->tf_special.pr);
-	case 331: return (&tf->tf_special.iip);
-	case 332: return (&tf->tf_special.psr);
-	case 333: return (&tf->tf_special.cfm);
+	case 330: return (&kdb_thrctx->pcb_special.pr);
+	case 331: return (&kdb_thrctx->pcb_special.rp);
+	case 333: return (&kdb_thrctx->pcb_special.pfs);
 	/* Registers 334-461: application registers. */
-	case 350: return (&tf->tf_special.rsc);
-	case 353: return (&tf->tf_special.rnat);
-	case 359: return (&tf->tf_scratch.csd);
-	case 360: return (&tf->tf_scratch.ssd);
-	case 366: return (&tf->tf_scratch.ccv);
-	case 370: return (&tf->tf_special.unat);
-	case 374: return (&tf->tf_special.fpsr);
-	case 398: return (&tf->tf_special.pfs);
+	case 350: return (&kdb_thrctx->pcb_special.rsc);
+	case 351: /* bsp */
+	case 352: /* bspstore. */
+		synth = kdb_thrctx->pcb_special.bspstore;
+		cfm = kdb_thrctx->pcb_special.pfs;
+		synth = ia64_bsp_adjust(synth,
+		    IA64_CFM_SOF(cfm) - IA64_CFM_SOL(cfm));
+		return (&synth);
+	case 353: return (&kdb_thrctx->pcb_special.rnat);
+	case 370: return (&kdb_thrctx->pcb_special.unat);
+	case 374: return (&kdb_thrctx->pcb_special.fpsr);
+	case 399: return (&kdb_thrctx->pcb_preserved.lc);
 	/* Synthesized registers. */	
-	case 351: /* bsp */
-		/*
-		 * If the trapframe belongs to a kernel entry from user
-		 * space, setup bspstore to point to the base of the
-		 * kernel stack.
-		 */
-		synth = (tf->tf_special.bspstore >= IA64_RR_BASE(5)) ?
-		    tf->tf_special.bspstore : (kdb_thread->td_kstack +
-			(tf->tf_special.bspstore & 0x1ffUL));
-		synth += tf->tf_special.ndirty;
 		return (&synth);
-	case 352: /* bspstore. */
-		/*
-		 * If the trapframe belongs to a kernel entry from user
-		 * space, setup bacpstore to point to the base of the
-		 * kernel stack.
-		 */
-		synth = (tf->tf_special.bspstore >= IA64_RR_BASE(5)) ?
-		    tf->tf_special.bspstore : (kdb_thread->td_kstack +
-			(tf->tf_special.bspstore & 0x1ffUL));
+		synth = kdb_thrctx->pcb_special.bspstore;
 		return (&synth);
 	}
 	return (NULL);
@@ -144,7 +122,9 @@
 int
 gdb_cpu_query(void)
 {
+#if 0
 	uint64_t bspstore, *kstack;
+#endif
 	uintmax_t slot;
 
 	if (!gdb_rx_equal("Part:dirty:read::"))
@@ -155,9 +135,12 @@
 		return (-1);
 	}
 
+	gdb_tx_err(EINVAL);
+	return (-1);
+
+#if 0
 	/* slot is unsigned. No need to test for negative values. */
 	if (slot >= (kdb_frame->tf_special.ndirty >> 3)) {
-		gdb_tx_err(EINVAL);
 		return (-1);
 	}
 
@@ -173,4 +156,5 @@
 	gdb_tx_mem((void*)(kstack + slot), 8);
 	gdb_tx_end();
 	return (1);
+#endif
 }


More information about the p4-projects mailing list