From patchwork Fri May 2 19:15:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 29573 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EC372203F3 for ; Fri, 2 May 2014 19:16:58 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cm18sf10576118qab.5 for ; Fri, 02 May 2014 12:16:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=wHjZEuPca6aHWKD7qPaPHQ9pbhPNcTZjBCMwQ0yuJU0=; b=V9TKMmCZX8UmrKnTCeSULLgXs3h0baDnXa/iLaVYvkeo3knr8duaO7LSPreWHDCN6T /LS6z44qOMqAqsYjhW+MKnVhP5jLLVScxNQg8hecU2Zzdztigcfdp7U+SNPlQDYknFTm 9FpmANI7/RI0RRDvgbKMSX0z0wRYxlOc3K9LILECnoLLIGwikAmXVXOiauwPwjj9DB42 a7HxTJ9+bWlSVteU+XzXig2RP9KSzwS1kPpTk4ihE1pDFqINHetZ/PFPNU9OaoLhZ0/1 Km3IqBYXFa/8WTaQOwzHwXceLnfvqHW4XCNR6XxkukLgDOe6mzzCYJJ+r/EOiIAIpAmx /euQ== X-Gm-Message-State: ALoCoQm9OvDJsB9FPet3gsi1ot8uUJbYnRQeDjFplspDVBcgRrlsyHpBy63+7DnitZML4KxpoLGf X-Received: by 10.58.88.136 with SMTP id bg8mr10687297veb.21.1399058218695; Fri, 02 May 2014 12:16:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.48 with SMTP id a45ls1607696qge.72.gmail; Fri, 02 May 2014 12:16:58 -0700 (PDT) X-Received: by 10.220.87.211 with SMTP id x19mr1002721vcl.68.1399058218534; Fri, 02 May 2014 12:16:58 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id ud8si6908626vdc.33.2014.05.02.12.16.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 May 2014 12:16:58 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id db12so2419780veb.11 for ; Fri, 02 May 2014 12:16:58 -0700 (PDT) X-Received: by 10.220.5.129 with SMTP id 1mr30546vcv.71.1399058218470; Fri, 02 May 2014 12:16:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp125796vcb; Fri, 2 May 2014 12:16:58 -0700 (PDT) X-Received: by 10.224.68.2 with SMTP id t2mr24921028qai.71.1399058217927; Fri, 02 May 2014 12:16:57 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id a1si1005039qcn.30.2014.05.02.12.16.57 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 02 May 2014 12:16:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:45943 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgIx7-0000kx-Cw for patch@linaro.org; Fri, 02 May 2014 15:16:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgIwD-000825-Hl for qemu-devel@nongnu.org; Fri, 02 May 2014 15:16:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WgIw5-0000B7-CE for qemu-devel@nongnu.org; Fri, 02 May 2014 15:16:01 -0400 Received: from afflict.kos.to ([92.243.29.197]:48075) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgIw5-00009c-49 for qemu-devel@nongnu.org; Fri, 02 May 2014 15:15:53 -0400 Received: from localhost.localdomain (afflict [92.243.29.197]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id D138E264CD; Fri, 2 May 2014 21:15:50 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 2 May 2014 22:15:41 +0300 Message-Id: <34d6086236baeb59f4b46e2380f2b271acd6f6cf.1399057853.git.riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: peter.maydell@linaro.org, Natanael Copa Subject: [Qemu-devel] [PULL 06/14] linux-user: avoid using glibc internals in _syscall5 and in definition of target_sigevent struct 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Natanael Copa Use the public sigset_t instead of the glibc specific internal __sigset_t in _syscall. Calculate the sigevent pad size is calculated in similar way as kernel does it instead of using glibc internal field _pad. This is needed for building with musl libc. Signed-off-by: Natanael Copa Signed-off-by: Riku Voipio Reviewed-by: Peter Maydell --- linux-user/syscall.c | 2 +- linux-user/syscall_defs.h | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 15de6f8..af0bb35 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -411,7 +411,7 @@ static int sys_inotify_init1(int flags) #endif #define __NR_sys_ppoll __NR_ppoll _syscall5(int, sys_ppoll, struct pollfd *, fds, nfds_t, nfds, - struct timespec *, timeout, const __sigset_t *, sigmask, + struct timespec *, timeout, const sigset_t *, sigmask, size_t, sigsetsize) #endif diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index fdf9a47..69c3982 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2552,12 +2552,26 @@ struct target_timer_t { abi_ulong ptr; }; +#define TARGET_SIGEV_MAX_SIZE 64 + +/* This is architecture-specific but most architectures use the default */ +#ifdef TARGET_MIPS +#define TARGET_SIGEV_PREAMBLE_SIZE (sizeof(int32_t) * 2 + sizeof(abi_long)) +#else +#define TARGET_SIGEV_PREAMBLE_SIZE (sizeof(int32_t) * 2 \ + + sizeof(target_sigval_t)) +#endif + +#define TARGET_SIGEV_PAD_SIZE ((TARGET_SIGEV_MAX_SIZE \ + - TARGET_SIGEV_PREAMBLE_SIZE) \ + / sizeof(int32_t)) + struct target_sigevent { target_sigval_t sigev_value; int32_t sigev_signo; int32_t sigev_notify; union { - int32_t _pad[ARRAY_SIZE(((struct sigevent *)0)->_sigev_un._pad)]; + int32_t _pad[TARGET_SIGEV_PAD_SIZE]; int32_t _tid; struct {