From nobody Thu May 2 16:36:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500425941548925.8082089242318; Tue, 18 Jul 2017 17:59:01 -0700 (PDT) Received: from localhost ([::1]:59288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXdKM-0000wk-MG for importer@patchew.org; Tue, 18 Jul 2017 20:58:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXdJa-0000bk-8W for qemu-devel@nongnu.org; Tue, 18 Jul 2017 20:58:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXdJV-0004pl-E3 for qemu-devel@nongnu.org; Tue, 18 Jul 2017 20:58:10 -0400 Received: from mail-it0-f52.google.com ([209.85.214.52]:36269) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dXdJV-0004pS-7O for qemu-devel@nongnu.org; Tue, 18 Jul 2017 20:58:05 -0400 Received: by mail-it0-f52.google.com with SMTP id a62so29497640itd.1 for ; Tue, 18 Jul 2017 17:58:04 -0700 (PDT) Received: by 10.107.21.6 with HTTP; Tue, 18 Jul 2017 17:58:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=hqVg5WXM9AJTqfx3bAPA7cGqT8Ck2oIvqIrXpFim3DA=; b=iDvFPfY+V713vgY9DeSs2l1Wu6hXu3aNMCyvPwJ0c6L1oAPTYwP9v1eKKmmm6mfLRf keDGsTvC0WnhkRj0RnuGK//uPox8eszfIMOD7WSm47XjcMmsn1AOmMoMTe40D1zC4bVd nOXp/ElgPgMxOOGX4uBRyMUgUvBfwEBMBcqjqnQVl5uWKfPr7FdbVQPypb/JVTaVGxJ3 m+RERSy08IvQEozoqDLW+lkY3Zzh5h/YkC7qKPw6Eejer4iXyzdnhD8m1i34p3XgezvV HHMqaXZX3VPxH+9IEopMvDeSSxGlStCGq47y86m0oIwCiMJ93N8HJsuIX80lELA7aqbR th8A== X-Gm-Message-State: AIVw112+iI73WiRym4/mzYIyWj4F2MwAC4Y7x769eFFU8TRn5RIWxidW HUryQcOHtA0hVLbzUD7n6lcnITagwtYMDY4= X-Received: by 10.36.152.197 with SMTP id n188mr77051itd.58.1500425883202; Tue, 18 Jul 2017 17:58:03 -0700 (PDT) MIME-Version: 1.0 From: Nathaniel McCallum Date: Tue, 18 Jul 2017 20:58:02 -0400 Message-ID: To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.214.52 Subject: [Qemu-devel] [PATCH] Update references of "struct ucontext" to "ucontext_t" 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-trivial@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Glibc used to have: typedef struct ucontext { ... } ucontext_t; Glibc now has: typedef struct ucontext_t { ... } ucontext_t; However, Qemu used "struct ucontext" in declarations. This is a private name and compatiblity cannot be guaranteed. This patch updates Qemu to only use the standardized type name. Signed-off-by: Nathaniel McCallum --- 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(-) 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 =3D puc; + ucontext_t *uc =3D puc; __u64 *pcreg =3D &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 =3D puc; + ucontext_t *uc =3D puc; unsigned long *pcreg =3D &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 =3D puc; + ucontext_t *uc =3D puc; greg_t *pcreg =3D &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/hostde= p.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 =3D puc; + ucontext_t *uc =3D puc; unsigned long *pcreg =3D &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/hostde= p.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 =3D puc; + ucontext_t *uc =3D puc; unsigned long *pcreg =3D &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/host= dep.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 =3D puc; + ucontext_t *uc =3D puc; greg_t *pcreg =3D &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 =3D signal number * a1 =3D pointer to siginfo_t - * a2 =3D pointer to struct ucontext + * a2 =3D 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 |=3D __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));*/ + /*err |=3D __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 =3D puc; + ucontext_t *uc =3D puc; printf("si_signo=3D%d si_errno=3D%d si_code=3D%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 =3D puc; + ucontext_t *uc =3D puc; printf("EIP=3D" 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 =3D puc; #else - struct ucontext *uc =3D puc; + ucontext_t *uc =3D 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 =3D puc; #else - struct ucontext *uc =3D puc; + ucontext_t *uc =3D puc; #endif pc =3D 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 =3D puc; #else - struct ucontext *uc =3D puc; + ucontext_t *uc =3D 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 =3D pinfo; - struct ucontext *uc =3D puc; + ucontext_t *uc =3D puc; uint32_t *pc =3D uc->uc_mcontext.sc_pc; uint32_t insn =3D *pc; int is_write =3D 0; @@ -414,7 +414,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, #if defined(__NetBSD__) ucontext_t *uc =3D puc; #else - struct ucontext *uc =3D puc; + ucontext_t *uc =3D 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 =3D pinfo; - struct ucontext *uc =3D puc; + ucontext_t *uc =3D puc; uintptr_t pc =3D uc->uc_mcontext.pc; uint32_t insn =3D *(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 =3D pinfo; - struct ucontext *uc =3D puc; + ucontext_t *uc =3D puc; unsigned long ip; int is_write =3D 0; @@ -505,7 +505,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, void *puc) { siginfo_t *info =3D pinfo; - struct ucontext *uc =3D puc; + ucontext_t *uc =3D puc; unsigned long pc; uint16_t *pinsn; int is_write =3D 0; @@ -558,7 +558,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, void *puc) { siginfo_t *info =3D pinfo; - struct ucontext *uc =3D puc; + ucontext_t *uc =3D puc; greg_t pc =3D uc->uc_mcontext.pc; int is_write; --=20 2.13.3