From nobody Sun Sep 28 16:34:29 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1756570006; cv=none; d=zohomail.com; s=zohoarc; b=hQKHEV+SXmjTixCkC5xR4j25DdGINmZ1YdyN9wXnTVAZ0VvDyIEugviGPTCYvKanYtWM2g92H3XoFaWfxazw1uIcXeqtEW6b3293AdbKoghgAjXC9lNPhr1uTG/8dLSusygVRWqHZKXzBhBdR+w2acGiZ5rYEPBJs31Gtr1UULU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756570006; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=f5I/NtM7Pi+1byAnsGGTmyqoepcDZYWEIZxl5JuqsYk=; b=eaeNHFZUvuxA12XMCfEnBoWK4DD7O0dNl5ihcCd+G/Wn/KILzqQ9VQ+zg+G/EegPKxJkaC7g36ibGQpZ4dXq/oEIBKX/Qeayktr2AHDva9JHbY3J93fiIxtg1BbCIHovESeG7Uk0IvCf5MLT7YeDYIb7wUwBykV1qee3JyDmJGk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756570006852597.0989721328958; Sat, 30 Aug 2025 09:06:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNjl-00075k-8o; Sat, 30 Aug 2025 11:43:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1us7We-0002fU-2L for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:52 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1us7Wa-0002b4-OQ for qemu-devel@nongnu.org; Fri, 29 Aug 2025 18:24:51 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-7704f3c4708so3116926b3a.1 for ; Fri, 29 Aug 2025 15:24:48 -0700 (PDT) Received: from stoup.. (122-150-204-12.dyn.ip.vocus.au. [122.150.204.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7722a71c60bsm3302493b3a.103.2025.08.29.15.24.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 15:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756506287; x=1757111087; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f5I/NtM7Pi+1byAnsGGTmyqoepcDZYWEIZxl5JuqsYk=; b=DxzyeTe+o4lcbIR9v+7saHyJdzQCCMY8W9oNb6UhghPRcAVQl2YvRfsFd3nmopl3yQ u3oAmpFLoGeRIfMOEUleYjxjHQh/ZNCcDFu1CWtqHl9CnalooTMTkKl0vzN9cDOwbmqx g4ES87DmJZqTZdV0FsCBY/yFG8vyeYs3fffdUraztAc2F/06djy0qBUVD4Yn8TMG1MYk 5jdGuSKAhO2jWFKWREXeNNs5ql7eoAo9E0jIbG/5H/74tK7zGs5Qj23NLJ72cfZyZ92n wtMZ7wfwu9dQ7+148jPfglXZqwY+NpzC7RTrZd9KXt3EZC3F+m84spvYkIvaUpT/cB2U KW1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756506287; x=1757111087; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f5I/NtM7Pi+1byAnsGGTmyqoepcDZYWEIZxl5JuqsYk=; b=c3qcdmALcItF+SzlEwJK6d08gN6OnaEuBnmdpSqt2Go7m7zA5iRsQCUCtf+4OrtrMj E8ASo/hZK2Apy5MkuiwabsH3kLbvNhzn/6HsvEe50UA/CDrfqgnEW3ekn8S1PqVigWhs +mSjkGtRD3d61V162PL3z1F5NkfJXsDockoDojpJlBdLu0Rzs0tvQKg5W1Pic6i0Xgxa 7IGT1yayvqhlVskbJ9GOEoQUs/+OaypQuQkmVaT3RfLaQIOvg1zrqdtwmUvuF1BIP5L8 klsfiOGEK8LDy+Ucp7UYp8b/D2QLdpYHAowAvK2VBAMYWhVscUeqL2XpV/gJYk6HVVEj h0hg== X-Gm-Message-State: AOJu0YwucgDMrE5lb3m46j7nAv+EKaQKovmhtbJBYAay+v//YG2/BAUH IOu73RMMztGbf0voOp0bvMbhdBi6AbjCohYcqWvxBbOvJfl2IHQ8fVx8D/TsCKz5Qn7YPnYnoXo /xGfQgl8= X-Gm-Gg: ASbGncuIhRlT0UGo6kEN/ih11KFCHbN956hHmg+3QyvUUYDcUdMllMzdPwuwy3wdiGm l05yVtSyeC6btJeITpuRDEBKTHY4JPQ32Zn33ait+iNwEuSsIJM9156SSD0c/tcNc/XSgFtKeYa ZVVwTrZTttFeqFyGWmKRJ9nvuqmo5qTWZg8q5FlDZkvC9l7z2acgIjmIc7OY55p90nWVRXTtYdd G4gpR7Nfhbc+znA9V0615v1GOSrTchgdXraedcUMhi35g56Dyz6M164UyV5Y+qtDVOijSb/SdN8 JhCBWilYsOkX/twNcQLmPd9aEduwHFimE28OlCuRd2x00+UmfXXPl1zPpKozOFT9fbv90EIwyyd LDPnSVXysBQsW7+jEALfz7axY85GVGyLd4YYbp8vr9l9MuyifCVge3k8A9Rvfzi950LIuJyY= X-Google-Smtp-Source: AGHT+IHTehE9+fW/jscaj6Rdo1FqDTGrBWryGjvOxEmdYxNNZHcl748Terk6JGHjaU2tKTod3sTamQ== X-Received: by 2002:a05:6a00:1495:b0:772:2850:783d with SMTP id d2e1a72fcca58-7723e387ed0mr284737b3a.22.1756506286787; Fri, 29 Aug 2025 15:24:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 05/91] linux-user/x86_64: Convert target_elf_gregset_t to a struct Date: Sat, 30 Aug 2025 08:23:01 +1000 Message-ID: <20250829222427.289668-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250829222427.289668-1-richard.henderson@linaro.org> References: <20250829222427.289668-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1756570007692116600 Content-Type: text/plain; charset="utf-8" A structure typedef may be abstract, while an array typedef cannot. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 60 +++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index fce4c05674..ba205c5a19 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -154,7 +154,9 @@ typedef abi_int target_pid_t; #define ELF_ARCH EM_X86_64 =20 #define ELF_NREG 27 -typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; +typedef struct target_elf_gregset_t { + target_elf_greg_t regs[ELF_NREG]; +} target_elf_gregset_t; =20 /* * Note that ELF_NREG should be 29 as there should be place for @@ -163,35 +165,35 @@ typedef target_elf_greg_t target_elf_gregset_t[ELF_N= REG]; * * See linux kernel: arch/x86/include/asm/elf.h */ -static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUX86Sta= te *env) +static void elf_core_copy_regs(target_elf_gregset_t *r, const CPUX86State = *env) { - (*regs)[0] =3D tswapreg(env->regs[15]); - (*regs)[1] =3D tswapreg(env->regs[14]); - (*regs)[2] =3D tswapreg(env->regs[13]); - (*regs)[3] =3D tswapreg(env->regs[12]); - (*regs)[4] =3D tswapreg(env->regs[R_EBP]); - (*regs)[5] =3D tswapreg(env->regs[R_EBX]); - (*regs)[6] =3D tswapreg(env->regs[11]); - (*regs)[7] =3D tswapreg(env->regs[10]); - (*regs)[8] =3D tswapreg(env->regs[9]); - (*regs)[9] =3D tswapreg(env->regs[8]); - (*regs)[10] =3D tswapreg(env->regs[R_EAX]); - (*regs)[11] =3D tswapreg(env->regs[R_ECX]); - (*regs)[12] =3D tswapreg(env->regs[R_EDX]); - (*regs)[13] =3D tswapreg(env->regs[R_ESI]); - (*regs)[14] =3D tswapreg(env->regs[R_EDI]); - (*regs)[15] =3D tswapreg(get_task_state(env_cpu_const(env))->orig_ax); - (*regs)[16] =3D tswapreg(env->eip); - (*regs)[17] =3D tswapreg(env->segs[R_CS].selector & 0xffff); - (*regs)[18] =3D tswapreg(env->eflags); - (*regs)[19] =3D tswapreg(env->regs[R_ESP]); - (*regs)[20] =3D tswapreg(env->segs[R_SS].selector & 0xffff); - (*regs)[21] =3D tswapreg(env->segs[R_FS].selector & 0xffff); - (*regs)[22] =3D tswapreg(env->segs[R_GS].selector & 0xffff); - (*regs)[23] =3D tswapreg(env->segs[R_DS].selector & 0xffff); - (*regs)[24] =3D tswapreg(env->segs[R_ES].selector & 0xffff); - (*regs)[25] =3D tswapreg(env->segs[R_FS].selector & 0xffff); - (*regs)[26] =3D tswapreg(env->segs[R_GS].selector & 0xffff); + r->regs[0] =3D tswapreg(env->regs[15]); + r->regs[1] =3D tswapreg(env->regs[14]); + r->regs[2] =3D tswapreg(env->regs[13]); + r->regs[3] =3D tswapreg(env->regs[12]); + r->regs[4] =3D tswapreg(env->regs[R_EBP]); + r->regs[5] =3D tswapreg(env->regs[R_EBX]); + r->regs[6] =3D tswapreg(env->regs[11]); + r->regs[7] =3D tswapreg(env->regs[10]); + r->regs[8] =3D tswapreg(env->regs[9]); + r->regs[9] =3D tswapreg(env->regs[8]); + r->regs[10] =3D tswapreg(env->regs[R_EAX]); + r->regs[11] =3D tswapreg(env->regs[R_ECX]); + r->regs[12] =3D tswapreg(env->regs[R_EDX]); + r->regs[13] =3D tswapreg(env->regs[R_ESI]); + r->regs[14] =3D tswapreg(env->regs[R_EDI]); + r->regs[15] =3D tswapreg(get_task_state(env_cpu_const(env))->orig_ax); + r->regs[16] =3D tswapreg(env->eip); + r->regs[17] =3D tswapreg(env->segs[R_CS].selector & 0xffff); + r->regs[18] =3D tswapreg(env->eflags); + r->regs[19] =3D tswapreg(env->regs[R_ESP]); + r->regs[20] =3D tswapreg(env->segs[R_SS].selector & 0xffff); + r->regs[21] =3D tswapreg(env->segs[R_FS].selector & 0xffff); + r->regs[22] =3D tswapreg(env->segs[R_GS].selector & 0xffff); + r->regs[23] =3D tswapreg(env->segs[R_DS].selector & 0xffff); + r->regs[24] =3D tswapreg(env->segs[R_ES].selector & 0xffff); + r->regs[25] =3D tswapreg(env->segs[R_FS].selector & 0xffff); + r->regs[26] =3D tswapreg(env->segs[R_GS].selector & 0xffff); } =20 #if ULONG_MAX > UINT32_MAX --=20 2.43.0