From patchwork Mon Sep 5 11:54:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rabin Vincent X-Patchwork-Id: 9313557 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 95059607D3 for ; Mon, 5 Sep 2016 11:59:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84ADE289B4 for ; Mon, 5 Sep 2016 11:59:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 799A5289F7; Mon, 5 Sep 2016 11:59:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2FD3F289B4 for ; Mon, 5 Sep 2016 11:59:14 +0000 (UTC) Received: from localhost ([::1]:54031 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgsYS-0004h9-V2 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 05 Sep 2016 07:59:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgsTr-0000xY-BS for qemu-devel@nongnu.org; Mon, 05 Sep 2016 07:54:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgsTi-0001VX-7e for qemu-devel@nongnu.org; Mon, 05 Sep 2016 07:54:26 -0400 Received: from bes.se.axis.com ([195.60.68.10]:43719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgsTi-0001VI-0e for qemu-devel@nongnu.org; Mon, 05 Sep 2016 07:54:18 -0400 Received: from localhost (localhost [127.0.0.1]) by bes.se.axis.com (Postfix) with ESMTP id 47A472E31A; Mon, 5 Sep 2016 13:54:17 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bes.se.axis.com Received: from bes.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bes.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id qb+6olFa8mQl; Mon, 5 Sep 2016 13:54:14 +0200 (CEST) Received: from boulder.se.axis.com (boulder.se.axis.com [10.0.2.104]) by bes.se.axis.com (Postfix) with ESMTP id 2D1872E231; Mon, 5 Sep 2016 13:54:14 +0200 (CEST) Received: from boulder.se.axis.com (localhost [127.0.0.1]) by postfix.imss71 (Postfix) with ESMTP id 163BE1B9A; Mon, 5 Sep 2016 13:54:14 +0200 (CEST) Received: from thoth.se.axis.com (thoth.se.axis.com [10.0.2.173]) by boulder.se.axis.com (Postfix) with ESMTP id 0AEE01B88; Mon, 5 Sep 2016 13:54:14 +0200 (CEST) Received: from lnxartpec.se.axis.com (lnxartpec.se.axis.com [10.88.4.9]) by thoth.se.axis.com (Postfix) with ESMTP id 092C4344; Mon, 5 Sep 2016 13:54:14 +0200 (CEST) Received: by lnxartpec.se.axis.com (Postfix, from userid 10564) id F243F81326; Mon, 5 Sep 2016 13:54:13 +0200 (CEST) From: Rabin Vincent To: edgar.iglesias@gmail.com Date: Mon, 5 Sep 2016 13:54:05 +0200 Message-Id: <1473076452-19795-2-git-send-email-rabin.vincent@axis.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1473076452-19795-1-git-send-email-rabin.vincent@axis.com> References: <1473076452-19795-1-git-send-email-rabin.vincent@axis.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.60.68.10 Subject: [Qemu-devel] [PATCH 2/9] tests: cris: fix syscall inline asm X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, Rabin Vincent Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Rabin Vincent Add the clobbered registeres to the inline asm for the write and exit system calls. Without the correct clobbers for the write() function, correct failure messages are not printed succesfully on newer version of GCC. Signed-off-by: Rabin Vincent --- tests/tcg/cris/sys.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/tcg/cris/sys.c b/tests/tcg/cris/sys.c index 551c5dd..dfa5e1c 100644 --- a/tests/tcg/cris/sys.c +++ b/tests/tcg/cris/sys.c @@ -34,7 +34,10 @@ void *memset (void *s, int c, size_t n) { void exit (int status) { asm volatile ("moveq 1, $r9\n" /* NR_exit. */ - "break 13\n"); + "break 13\n" + : + : + : "r9", "memory" ); while(1) ; } @@ -45,7 +48,10 @@ ssize_t write (int fd, const void *buf, size_t count) { "move.d %1, $r11\n" "move.d %2, $r12\n" "moveq 4, $r9\n" /* NR_write. */ - "break 13\n" : : "r" (fd), "r" (buf), "r" (count) : "memory"); + "break 13\n" + : + : "r" (fd), "r" (buf), "r" (count) + : "r9", "r10", "r11", "r12", "memory"); asm ("move.d $r10, %0\n" : "=r" (r)); return r; }