From patchwork Wed Jun 28 20:44:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 106579 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp345571qge; Wed, 28 Jun 2017 13:50:55 -0700 (PDT) X-Received: by 10.200.58.161 with SMTP id x30mr14818876qte.69.1498683055107; Wed, 28 Jun 2017 13:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498683055; cv=none; d=google.com; s=arc-20160816; b=NXHTa7ujSDeeXGfiI3Tb3darFsvTmeYAOFOZuVnE74KXSiVokeA9mxnD3LflNOQa/E 4CwgH3SI9JB+MfQ0w7U4rGuEpNLk0hMRuWztTPSfMa/3/jEpLCTOOxY4W8WD8WKprDMO VXZZNg9PkJiCtC01I+n2TZmy9/k3kqKbebblLD/pqfdinKk1OuGDaVVFty052rY4GgnS H8wbV1h+tpUuL7Kcz3ZL1JSOyxNdew3MVEuD+S9/nECTiNSdzx+xguZdXv5S4W4wFSBT jjlOKE7zupNkKv9cXCzFf3k8aF5A8AbHSGDG8CVcGQFlVCjqvP082SF62TIMb6EjJaPt UkZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=Y5Fv+7iWxXhf12r9cxOEGwQo7dJLuXlzU+9x0qAIohw=; b=VoHFELvIvhBg4q1XuyLl/0B07w4Ox9V+p+9KFRSUKGrdko1Z1LmDEayA17r00itA8g 46dC4di2cx50bwa5USBnTNZfZKs1+tWUTudZKZVwgoj7D4QxNgUso4mHIvdUxAuqV1y0 G8XAwXn65xu9r1qPugml2OuNv6LX/0A+pU08bLHYEiFBTxZwTY+e/Rv6JUs2Oj11mByV uwz7hzB48EkMuhBk+Ak8KTq0ICvqyEXUlFPeICA1d4v/uPVW1JVrhCP30ZJ3stB8FJFd qCDJUcEsYiLO37HCgJnGYIzYa6F94bLBb9t8TNSIFEwMaLLqiaOmusRDkVZ90I1UMs1t FbOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.b=XP9VUZRR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o190si2844883qkc.109.2017.06.28.13.50.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 28 Jun 2017 13:50:55 -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; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.b=XP9VUZRR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from localhost ([::1]:35609 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQJvI-00049W-Fc for patch@linaro.org; Wed, 28 Jun 2017 16:50:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQJpo-0007en-Lk for qemu-devel@nongnu.org; Wed, 28 Jun 2017 16:45:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQJpn-0004OI-3q for qemu-devel@nongnu.org; Wed, 28 Jun 2017 16:45:12 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:33315) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dQJpm-0004M2-Qp for qemu-devel@nongnu.org; Wed, 28 Jun 2017 16:45:11 -0400 Received: by mail-pf0-x241.google.com with SMTP id e199so10343125pfh.0 for ; Wed, 28 Jun 2017 13:45:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Y5Fv+7iWxXhf12r9cxOEGwQo7dJLuXlzU+9x0qAIohw=; b=XP9VUZRR0tl7t6PN8EqZgwW2WaGTZ8DMsP0tElxspvM1EKd2Ku27LXAvPMeLgPRRLz fEG4rmHYs2iNFtgUmIbXJyLN58RX3aVJfhJbRvvrCZFrY5kFj9+dSIzaajyxUskNcmJk F/K/03KVSF6/E4yMR7PWyC6qqZ/vzD4kmrNmmG8g+UR7fdOQZEvJlgdtvH96xb1gGDwC NEs4oHR6GjLP5C/JuG55H7HQUBLyTwhgFEeGNy6fQDmb7Cnh4cSpBEhKzn4KIJwrzJ6s /rkMDl/ttPzKQ4EuNFK6jO/jGrptMeoXblF4aE+6yXOpmdXrz5HPlH+wT/NFWMf/nrTN U1VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Y5Fv+7iWxXhf12r9cxOEGwQo7dJLuXlzU+9x0qAIohw=; b=ZRLI9+hehBkLK5hpqiqtc9CMOHKNA9O8KXW+oG1iYw4QbYp2pY+OqOJlNpIUMMwmDu NvoSkG/BkvtWgtcxOgDCx4lGA8epfLATaeRAWN9M7ecNUyjgZNVDJZqd0DYJ78YrcJGl NsZ2i9ugy46WarkeOaGXUngAfAFfYUYgI5p1H9JNVBQnlByr61ASa/kaSp51tKuVLAh/ mR3Syo7dOBDsQFXyN3TIS7oCIv4olb18fDgUuRD4WUOalamuj5mg8N+ncQARZqsT8Qfb ZfkyjAtRM4qv2bYWTFBwoTUnmI7Gs4HQ8owyoYnk2o77muMUXM249iNNpq1e48/fnf+P W5vw== X-Gm-Message-State: AKS2vOxAtoEBhk2jr3kpuf+GJd6TOqxfxaHAMpU4WWQvuDvpTL9shO6o HjPgM3gjUpbmB2gV X-Received: by 10.84.217.22 with SMTP id o22mr1689404pli.19.1498682707819; Wed, 28 Jun 2017 13:45:07 -0700 (PDT) Received: from localhost.localdomain ([2601:646:8882:b8c::3df3]) by smtp.gmail.com with ESMTPSA id y66sm6979118pfa.54.2017.06.28.13.45.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jun 2017 13:45:06 -0700 (PDT) From: Khem Raj To: qemu-devel@nongnu.org Date: Wed, 28 Jun 2017 13:44:52 -0700 Message-Id: <20170628204452.41230-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.13.2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::241 Subject: [Qemu-devel] [PATCH] replace struct ucontext with ucontext_t type 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: Paolo Bonzini , Kamil Rytarowski , Riku Voipio , Khem Raj , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The ucontext_t type had a tag struct ucontext until now but newer glibc will drop it so we need to adjust and use the exposed type instead Signed-off-by: Khem Raj Cc: Kamil Rytarowski Cc: Riku Voipio Cc: Laurent Vivier Cc: Paolo Bonzini --- linux-user/host/aarch64/hostdep.h | 2 +- linux-user/host/arm/hostdep.h | 2 +- linux-user/host/i386/hostdep.h | 2 +- linux-user/host/ppc64/hostdep.h | 2 +- linux-user/host/s390x/hostdep.h | 2 +- linux-user/host/x86_64/hostdep.h | 2 +- linux-user/signal.c | 10 +++++----- tests/tcg/test-i386.c | 4 ++-- user-exec.c | 18 +++++++++--------- 9 files changed, 22 insertions(+), 22 deletions(-) -- 2.13.2 Reviewed-by: Eric Blake diff --git a/linux-user/host/aarch64/hostdep.h b/linux-user/host/aarch64/hostdep.h index 64f75cef49..a8d41a21ad 100644 --- a/linux-user/host/aarch64/hostdep.h +++ b/linux-user/host/aarch64/hostdep.h @@ -24,7 +24,7 @@ extern char safe_syscall_end[]; /* Adjust the signal context to rewind out of safe-syscall if we're in it */ static inline void rewind_if_in_safe_syscall(void *puc) { - struct ucontext *uc = puc; + ucontext_t *uc = puc; __u64 *pcreg = &uc->uc_mcontext.pc; if (*pcreg > (uintptr_t)safe_syscall_start diff --git a/linux-user/host/arm/hostdep.h b/linux-user/host/arm/hostdep.h index 5c1ae60120..9276fe6ceb 100644 --- a/linux-user/host/arm/hostdep.h +++ b/linux-user/host/arm/hostdep.h @@ -24,7 +24,7 @@ extern char safe_syscall_end[]; /* Adjust the signal context to rewind out of safe-syscall if we're in it */ static inline void rewind_if_in_safe_syscall(void *puc) { - struct ucontext *uc = puc; + ucontext_t *uc = puc; unsigned long *pcreg = &uc->uc_mcontext.arm_pc; if (*pcreg > (uintptr_t)safe_syscall_start diff --git a/linux-user/host/i386/hostdep.h b/linux-user/host/i386/hostdep.h index d834bd80ea..073be74d87 100644 --- a/linux-user/host/i386/hostdep.h +++ b/linux-user/host/i386/hostdep.h @@ -24,7 +24,7 @@ extern char safe_syscall_end[]; /* Adjust the signal context to rewind out of safe-syscall if we're in it */ static inline void rewind_if_in_safe_syscall(void *puc) { - struct ucontext *uc = puc; + ucontext_t *uc = puc; greg_t *pcreg = &uc->uc_mcontext.gregs[REG_EIP]; if (*pcreg > (uintptr_t)safe_syscall_start diff --git a/linux-user/host/ppc64/hostdep.h b/linux-user/host/ppc64/hostdep.h index 0b0f5f7821..98979ad917 100644 --- a/linux-user/host/ppc64/hostdep.h +++ b/linux-user/host/ppc64/hostdep.h @@ -24,7 +24,7 @@ extern char safe_syscall_end[]; /* Adjust the signal context to rewind out of safe-syscall if we're in it */ static inline void rewind_if_in_safe_syscall(void *puc) { - struct ucontext *uc = puc; + ucontext_t *uc = puc; unsigned long *pcreg = &uc->uc_mcontext.gp_regs[PT_NIP]; if (*pcreg > (uintptr_t)safe_syscall_start diff --git a/linux-user/host/s390x/hostdep.h b/linux-user/host/s390x/hostdep.h index 6f9da9c608..4f0171f36f 100644 --- a/linux-user/host/s390x/hostdep.h +++ b/linux-user/host/s390x/hostdep.h @@ -24,7 +24,7 @@ extern char safe_syscall_end[]; /* Adjust the signal context to rewind out of safe-syscall if we're in it */ static inline void rewind_if_in_safe_syscall(void *puc) { - struct ucontext *uc = puc; + ucontext_t *uc = puc; unsigned long *pcreg = &uc->uc_mcontext.psw.addr; if (*pcreg > (uintptr_t)safe_syscall_start diff --git a/linux-user/host/x86_64/hostdep.h b/linux-user/host/x86_64/hostdep.h index 3b4259633e..a4fefb5114 100644 --- a/linux-user/host/x86_64/hostdep.h +++ b/linux-user/host/x86_64/hostdep.h @@ -24,7 +24,7 @@ extern char safe_syscall_end[]; /* Adjust the signal context to rewind out of safe-syscall if we're in it */ static inline void rewind_if_in_safe_syscall(void *puc) { - struct ucontext *uc = puc; + ucontext_t *uc = puc; greg_t *pcreg = &uc->uc_mcontext.gregs[REG_RIP]; if (*pcreg > (uintptr_t)safe_syscall_start diff --git a/linux-user/signal.c b/linux-user/signal.c index 3d18d1b3ee..2c55a4f600 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -3346,7 +3346,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, * * a0 = signal number * a1 = pointer to siginfo_t - * a2 = pointer to struct ucontext + * a2 = pointer to ucontext_t * * $25 and PC point to the signal handler, $29 points to the * struct sigframe. @@ -3733,7 +3733,7 @@ struct target_signal_frame { struct rt_signal_frame { siginfo_t info; - struct ucontext uc; + ucontext_t uc; uint32_t tramp[2]; }; @@ -3949,7 +3949,7 @@ struct rt_signal_frame { siginfo_t *pinfo; void *puc; siginfo_t info; - struct ucontext uc; + ucontext_t uc; uint16_t retcode[4]; /* Trampoline code. */ }; @@ -4484,7 +4484,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, tswap_siginfo(&frame->info, info); } - /*err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));*/ + /*err |= __clear_user(&frame->uc, offsetof(ucontext_t, uc_mcontext));*/ __put_user(0, &frame->uc.tuc_flags); __put_user(0, &frame->uc.tuc_link); __put_user(target_sigaltstack_used.ss_sp, @@ -4976,7 +4976,7 @@ enum { struct target_ucontext { target_ulong tuc_flags; - target_ulong tuc_link; /* struct ucontext __user * */ + target_ulong tuc_link; /* ucontext_t __user * */ struct target_sigaltstack tuc_stack; #if !defined(TARGET_PPC64) int32_t tuc_pad[7]; diff --git a/tests/tcg/test-i386.c b/tests/tcg/test-i386.c index 0f7b943b0c..9599204895 100644 --- a/tests/tcg/test-i386.c +++ b/tests/tcg/test-i386.c @@ -1720,7 +1720,7 @@ int tab[2]; void sig_handler(int sig, siginfo_t *info, void *puc) { - struct ucontext *uc = puc; + ucontext_t *uc = puc; printf("si_signo=%d si_errno=%d si_code=%d", info->si_signo, info->si_errno, info->si_code); @@ -1912,7 +1912,7 @@ void test_exceptions(void) /* specific precise single step test */ void sig_trap_handler(int sig, siginfo_t *info, void *puc) { - struct ucontext *uc = puc; + ucontext_t *uc = puc; printf("EIP=" FMTLX "\n", (long)uc->uc_mcontext.gregs[REG_EIP]); } diff --git a/user-exec.c b/user-exec.c index a8f95fa1e1..2a975eaf69 100644 --- a/user-exec.c +++ b/user-exec.c @@ -167,7 +167,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, #elif defined(__OpenBSD__) struct sigcontext *uc = puc; #else - struct ucontext *uc = puc; + ucontext_t *uc = puc; #endif unsigned long pc; int trapno; @@ -222,7 +222,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, #elif defined(__OpenBSD__) struct sigcontext *uc = puc; #else - struct ucontext *uc = puc; + ucontext_t *uc = puc; #endif pc = PC_sig(uc); @@ -289,7 +289,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ucontext_t *uc = puc; #else - struct ucontext *uc = puc; + ucontext_t *uc = puc; #endif unsigned long pc; int is_write; @@ -316,7 +316,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, void *puc) { siginfo_t *info = pinfo; - struct ucontext *uc = puc; + ucontext_t *uc = puc; uint32_t *pc = uc->uc_mcontext.sc_pc; uint32_t insn = *pc; int is_write = 0; @@ -414,7 +414,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, #if defined(__NetBSD__) ucontext_t *uc = puc; #else - struct ucontext *uc = puc; + ucontext_t *uc = puc; #endif unsigned long pc; int is_write; @@ -441,7 +441,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, int cpu_signal_handler(int host_signum, void *pinfo, void *puc) { siginfo_t *info = pinfo; - struct ucontext *uc = puc; + ucontext_t *uc = puc; uintptr_t pc = uc->uc_mcontext.pc; uint32_t insn = *(uint32_t *)pc; bool is_write; @@ -474,7 +474,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, void *puc) int cpu_signal_handler(int host_signum, void *pinfo, void *puc) { siginfo_t *info = pinfo; - struct ucontext *uc = puc; + ucontext_t *uc = puc; unsigned long ip; int is_write = 0; @@ -505,7 +505,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, void *puc) { siginfo_t *info = pinfo; - struct ucontext *uc = puc; + ucontext_t *uc = puc; unsigned long pc; uint16_t *pinsn; int is_write = 0; @@ -558,7 +558,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, void *puc) { siginfo_t *info = pinfo; - struct ucontext *uc = puc; + ucontext_t *uc = puc; greg_t pc = uc->uc_mcontext.pc; int is_write;