From patchwork Thu Sep 13 23:37:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Ungerer X-Patchwork-Id: 183767 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D0B802C007D for ; Fri, 14 Sep 2012 09:34:39 +1000 (EST) Received: from localhost ([::1]:33498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCIvd-0008KI-Ve for incoming@patchwork.ozlabs.org; Thu, 13 Sep 2012 19:34:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCIvX-0008KD-H6 for qemu-devel@nongnu.org; Thu, 13 Sep 2012 19:34:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCIvW-0004FD-G8 for qemu-devel@nongnu.org; Thu, 13 Sep 2012 19:34:31 -0400 Received: from dnvwsmailout1.mcafee.com ([161.69.31.173]:13804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCIvW-0004F8-7V for qemu-devel@nongnu.org; Thu, 13 Sep 2012 19:34:30 -0400 Received: from SNCEXHT1.corp.nai.org (unknown [10.68.5.51]) by DNVWSMAILOUT1.mcafee.com with smtp id 2657_d8e0_5dc0765b_32b3_4baa_9c91_b42ee23cdf4b; Thu, 13 Sep 2012 18:34:29 -0500 Received: from SNCEXAMMB3.corp.nai.org (10.68.48.8) by SNCEXHT1.corp.nai.org (10.68.5.51) with Microsoft SMTP Server (TLS) id 8.3.279.1; Thu, 13 Sep 2012 16:34:28 -0700 Received: from localhost.localdomain (172.22.196.22) by mail.na.nai.com (10.68.48.8) with Microsoft SMTP Server id 8.3.279.1; Thu, 13 Sep 2012 16:34:27 -0700 From: To: , Date: Fri, 14 Sep 2012 09:37:55 +1000 Message-ID: <1347579475-9293-1-git-send-email-gerg@snapgear.com> X-Mailer: git-send-email 1.5.5.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 161.69.31.173 Cc: Greg Ungerer Subject: [Qemu-devel] [PATCH v2] m68k: implement move to/from usp register instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Greg Ungerer Fill out the code support for the move to/from usp instructions. They are being decoded, but there is no code to support their actions. So add it. Current versions of Linux running on the ColdFire 5208 use these instructions. Signed-off-by: Greg Ungerer Reviewed-by: Richard Henderson --- target-m68k/translate.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target-m68k/translate.c b/target-m68k/translate.c index 9fc1e31..7b55747 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -1980,8 +1980,8 @@ DISAS_INSN(move_from_usp) gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); return; } - /* TODO: Implement USP. */ - gen_exception(s, s->pc - 2, EXCP_ILLEGAL); + tcg_gen_ld_i32(AREG(insn, 0), cpu_env, + offsetof(CPUM68KState, sp[M68K_USP])); } DISAS_INSN(move_to_usp) @@ -1990,8 +1990,8 @@ DISAS_INSN(move_to_usp) gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); return; } - /* TODO: Implement USP. */ - gen_exception(s, s->pc - 2, EXCP_ILLEGAL); + tcg_gen_st_i32(AREG(insn, 0), cpu_env, + offsetof(CPUM68KState, sp[M68K_USP])); } DISAS_INSN(halt)