From patchwork Fri Jul 8 13:08:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wesley W. Terpstra" X-Patchwork-Id: 103843 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DA0B2B6F7D for ; Fri, 8 Jul 2011 23:23:33 +1000 (EST) Received: from localhost ([::1]:51528 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfB1m-00079x-AM for incoming@patchwork.ozlabs.org; Fri, 08 Jul 2011 09:23:30 -0400 Received: from eggs.gnu.org ([140.186.70.92]:44071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfAnH-000445-H2 for qemu-devel@nongnu.org; Fri, 08 Jul 2011 09:08:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QfAnG-0001EW-2l for qemu-devel@nongnu.org; Fri, 08 Jul 2011 09:08:31 -0400 Received: from mail-iy0-f173.google.com ([209.85.210.173]:40710) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfAnF-0001EF-QR for qemu-devel@nongnu.org; Fri, 08 Jul 2011 09:08:29 -0400 Received: by iyb3 with SMTP id 3so2045184iyb.4 for ; Fri, 08 Jul 2011 06:08:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.124.167 with SMTP id u39mr1691690ibr.103.1310130508786; Fri, 08 Jul 2011 06:08:28 -0700 (PDT) Received: by 10.231.159.139 with HTTP; Fri, 8 Jul 2011 06:08:28 -0700 (PDT) Date: Fri, 8 Jul 2011 15:08:28 +0200 X-Google-Sender-Auth: EHYPx_s-noeNFYPxHB6b1bIaFBk Message-ID: From: "Wesley W. Terpstra" To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.173 Subject: [Qemu-devel] [PATCH 6/6] mips: eabi syscall support for 64-bit args 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 mips uses the eabi calling convention. For 64-bit values this means some registers are skipped. This patch replicates the behaviour of arm/eabi for mips targets. This affects ftruncate64, creating insane sized fails (or just failing). Signed-off-by: Wesley W. Terpstra diff --git a/linux-user/syscall.c b/linux-user/syscall.c index fed7a8f..0b0a3d0 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4367,6 +4367,10 @@ arg3 = arg4; } #endif +#ifdef TARGET_MIPS + arg2 = arg3; + arg3 = arg4; +#endif return get_errno(truncate64(arg1, target_offset64(arg2, arg3))); } #endif @@ -4384,6 +4388,10 @@ arg3 = arg4; } #endif +#ifdef TARGET_MIPS + arg2 = arg3; + arg3 = arg4; +#endif return get_errno(ftruncate64(arg1, target_offset64(arg2, arg3))); } #endif @@ -6841,6 +6849,9 @@ if (((CPUARMState *)cpu_env)->eabi) arg4 = arg5; #endif +#ifdef TARGET_MIPS + arg4 = arg5; +#endif if (!(p = lock_user(VERIFY_WRITE, arg2, arg3, 0))) goto efault; ret = get_errno(pread(arg1, p, arg3, arg4)); @@ -6851,6 +6862,9 @@ if (((CPUARMState *)cpu_env)->eabi) arg4 = arg5; #endif +#ifdef TARGET_MIPS + arg4 = arg5; +#endif if (!(p = lock_user(VERIFY_READ, arg2, arg3, 1))) goto efault; ret = get_errno(pwrite(arg1, p, arg3, arg4)); @@ -7609,6 +7623,11 @@ arg4 = arg5; } #endif +#ifdef TARGET_MIPS + arg2 = arg3; + arg3 = arg4; + arg4 = arg5; +#endif ret = get_errno(readahead(arg1, ((off64_t)arg3 << 32) | arg2, arg4)); #else ret = get_errno(readahead(arg1, arg2, arg3));