Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Anthony Green <green@moxielogic.com>
To: gdb-patches@sourceware.org
Subject: [patch, moxie] sim tweak for NOP instruction
Date: Wed, 03 Feb 2010 11:30:00 -0000	[thread overview]
Message-ID: <1265196644.19156.16.camel@localhost> (raw)

[-- Attachment #1: Type: text/plain, Size: 131 bytes --]

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



[-- Attachment #2: moxie-sim.patch --]
[-- Type: text/x-patch, Size: 1262 bytes --]

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");

                 reply	other threads:[~2010-02-03 11:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1265196644.19156.16.camel@localhost \
    --to=green@moxielogic.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox