This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch, moxie] sim tweak for NOP instruction


A while ago I moved the NOP opcode from 0x00 to 0x0f, but the simulator
patch got lost in the mix.  I'm committing this fix.

AG


2010-02-03  Anthony Green  <green@moxielogic.com>

	* interp.c (sim_resume): nop is 0x0f, and 0x00 is an illegal
	instruction.


Index: moxie/interp.c
===================================================================
RCS file: /cvs/src/src/sim/moxie/interp.c,v
retrieving revision 1.8
diff -u -r1.8 interp.c
--- moxie/interp.c	13 Jan 2010 14:08:36 -0000	1.8
+++ moxie/interp.c	3 Feb 2010 10:13:55 -0000
@@ -414,7 +414,10 @@
 	  int opcode = inst >> 8;
 	  switch (opcode)
 	    {
-	    case 0x00: /* nop */
+	    case 0x00: /* bad */
+	      opc = opcode;
+	      TRACE("SIGILL0");
+	      cpu.asregs.exception = SIGILL;
 	      break;
 	    case 0x01: /* ldi.l (immediate) */
 	      {
@@ -587,16 +590,17 @@
 		cpu.asregs.cc = cc;
 	      }
 	      break;
-	    case 0x0f:
-	    case 0x10:
-	    case 0x11:
-	    case 0x12:
-	    case 0x13:
-	    case 0x14:
-	    case 0x15:
-	    case 0x16:
-	    case 0x17:
-	    case 0x18:
+	    case 0x0f: /* nop */
+	      break;
+	    case 0x10: /* bad */
+	    case 0x11: /* bad */
+	    case 0x12: /* bad */
+	    case 0x13: /* bad */
+	    case 0x14: /* bad */
+	    case 0x15: /* bad */
+	    case 0x16: /* bad */
+	    case 0x17: /* bad */
+	    case 0x18: /* bad */
 	      {
 		opc = opcode;
 		TRACE("SIGILL0");

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]