Browse Source

Plan 9 from Bell Labs 2012-03-27

David du Colombier 12 years ago
parent
commit
1672d626f8
3 changed files with 38 additions and 19 deletions
  1. 16 9
      sys/src/9/kw/trap.c
  2. 15 9
      sys/src/9/omap/trap.c
  3. 7 1
      sys/src/libc/arm/vlrt.c

+ 16 - 9
sys/src/9/kw/trap.c

@@ -214,6 +214,7 @@ intrs(Ureg *ur, int sort)
 		iprint("spurious irq%s interrupt: %8.8lux\n", irq.name, ibits);
 		s = splfhi();
 		*irq.irq &= ibits;
+		*irq.irqmask &= ~ibits;
 		splx(s);
 	}
 }
@@ -479,16 +480,22 @@ trap(Ureg *ureg)
 		break;
 	case PsrMund:	/* undefined instruction */
 		if(user){
-			/* look for floating point instructions to interpret */
-			x = spllo();
-			rv = fpiarm(ureg);
-			splx(x);
-			if(rv == 0){
-				ldrexvalid = 0;
-				snprint(buf, sizeof buf,
-					"undefined instruction: pc %#lux",
-					ureg->pc);
+			if(seg(up, ureg->pc, 0) != nil &&
+			   *(u32int*)ureg->pc == 0xD1200070){
+				snprint(buf, sizeof buf, "sys: breakpoint");
 				postnote(up, 1, buf, NDebug);
+			}else{
+				/* look for floating point instructions to interpret */
+				x = spllo();
+				rv = fpiarm(ureg);
+				splx(x);
+				if(rv == 0){
+					ldrexvalid = 0;
+					snprint(buf, sizeof buf,
+						"undefined instruction: pc %#lux",
+						ureg->pc);
+					postnote(up, 1, buf, NDebug);
+				}
 			}
 		}else{
 			iprint("undefined instruction: pc %#lux inst %#ux\n",

+ 15 - 9
sys/src/9/omap/trap.c

@@ -573,16 +573,22 @@ trap(Ureg *ureg)
 		break;
 	case PsrMund:			/* undefined instruction */
 		if(user){
-			/* look for floating point instructions to interpret */
-			x = spllo();
-			rv = fpiarm(ureg);
-			splx(x);
-			if(rv == 0){
-				ldrexvalid = 0;
-				snprint(buf, sizeof buf,
-					"undefined instruction: pc %#lux\n",
-					ureg->pc);
+			if(seg(up, ureg->pc, 0) != nil &&
+			   *(u32int*)ureg->pc == 0xD1200070){
+				snprint(buf, sizeof buf, "sys: breakpoint");
 				postnote(up, 1, buf, NDebug);
+			}else{
+				/* look for floating point instructions to interpret */
+				x = spllo();
+				rv = fpiarm(ureg);
+				splx(x);
+				if(rv == 0){
+					ldrexvalid = 0;
+					snprint(buf, sizeof buf,
+						"undefined instruction: pc %#lux\n",
+						ureg->pc);
+					postnote(up, 1, buf, NDebug);
+				}
 			}
 		}else{
 			if (ureg->pc & 3) {

+ 7 - 1
sys/src/libc/arm/vlrt.c

@@ -15,7 +15,7 @@ struct	Vlong
 
 void	abort(void);
 
-/* called by profiler (notably ../port/profile.c); can't be profiled */
+/* needed by profiler; can't be profiled */
 #pragma profile off
 
 void
@@ -44,6 +44,8 @@ _subv(Vlong *r, Vlong a, Vlong b)
 	r->hi = hi;
 }
 
+#pragma profile on
+
 void
 _d2v(Vlong *y, double d)
 {
@@ -126,6 +128,9 @@ _v2f(Vlong x)
 	return _v2d(x);
 }
 
+/* too many of these are also needed by profiler; leave them out */
+#pragma profile off
+
 static void
 dodiv(Vlong num, Vlong den, Vlong *q, Vlong *r)
 {
@@ -500,6 +505,7 @@ _sl2v(Vlong *ret, long sl)
 	ret->hi = t >> 31;
 }
 
+
 void
 _ul2v(Vlong *ret, ulong ul)
 {