From patchwork Thu Jan 5 16:43:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 639290 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp326260pvb; Thu, 5 Jan 2023 08:59:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXvtEnX6Hf333zwPGcBnZ5+XTpnS5VKDovgwwppGL2xWqoEQyOx6DCsIFYqW8r0XSa0o2n/T X-Received: by 2002:a67:e417:0:b0:3cc:e60c:64bc with SMTP id d23-20020a67e417000000b003cce60c64bcmr12825261vsf.34.1672937954196; Thu, 05 Jan 2023 08:59:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672937954; cv=none; d=google.com; s=arc-20160816; b=Z0fGo1t6VgrCs2NwNbowGBvPg09D4vanSy+eQYszU0yWjiIZeljoxZy33gEJvE2jgE h896DWHJ+BCpKzGzAYb46KnKDknuXnJHRbYEal7ruu+DoeDEIE4X3bcUU15E1nNxVQ+9 GZ9ICevCYam4GuK6DP1WoXkI/WjJ8jluMVnkE2L8HLmuBLE9AKGTAdNHqdJpqh4QO5un 6Mn12lA+0am46MgA1cwMeVwJ5ykACQtPFxqKu4e2TJHlnkyJrRLwRmiRl8EFwSRERIPp Z9eOgPszrsQzGFXWFz6d2VNwaU/271bXAeqTb9cEuKSz0aPvED8QroyTkOyF6iAuKpGT JWcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Gy0/zYZetKWbyUE6WFREVjvsOrbcepCm3I2qjMJQWPs=; b=TjUIReY0Ca7ROwLICwuHA6IvI3YCPDJMgrHYGbXj5fLjTOrP/RlyTpWieZAbV5LqJq qc1hwy2D26yyCdu30vb3NrRgN5UgXVltSoxrmaxEbQ9Jk5jxp7ZYinCPJRomozI7RN85 Tvq8/BqHKeMRVW5/bXyobsFy6mGqCyS/fjbktJNReOCp0PAce9EVqGK5ne5iftcx9+P+ kT5+uJ1h2LCWX6L91Xc5WJwmz7VoHJxc5ndbweJ/c1wiMZY5FNyrvUKsINZOEf2pJ1uM 53mrshgmPmtSTdOuCo7tiOWnSJgPIdH+i1L3NY7iQskDsnNp6bYEz1crgBygBbpuQ56N ENfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bWGIh4n5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u1-20020ae9d801000000b006b941547704si18454216qkf.292.2023.01.05.08.59.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Jan 2023 08:59:14 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bWGIh4n5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDTL3-0006zM-S6; Thu, 05 Jan 2023 11:43:33 -0500 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 1pDTL2-0006y9-Jg for qemu-devel@nongnu.org; Thu, 05 Jan 2023 11:43:32 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDTKu-0006xN-QR for qemu-devel@nongnu.org; Thu, 05 Jan 2023 11:43:32 -0500 Received: by mail-wr1-x430.google.com with SMTP id bn26so17236355wrb.0 for ; Thu, 05 Jan 2023 08:43:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=Gy0/zYZetKWbyUE6WFREVjvsOrbcepCm3I2qjMJQWPs=; b=bWGIh4n5W0WXN1S+Duq3L8i3fjlHKGKmzaM11j5lC326ME8APPMaCO2+WYAbfMCv/p C6hPzerTl0i1D8oaDV8hYRpUMzolCt8X2JWmnx8FXif1Wxt48j0HwrJKEFpyRZQiFnUm m4YKa5D9Z5cCHSk4LyE/QDQ2Vsrv/vUf11TW7+5ssPiY4a7mPuI5J8GDyhbET9gKNEKw QsPWrYPHXUAogHu1uaX8oQkx1/DNifGffQbYFyx5uWxVcBYZDXijJD4OzoZBR/yjVCbO /TJEgw6RTZtc3VX+tPN+eXbIlISa3bUpMHWoNy32TEkOlv0E71CXFH1kSnabb59LyULf f6fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Gy0/zYZetKWbyUE6WFREVjvsOrbcepCm3I2qjMJQWPs=; b=g3YnVWakRLW6VSQhmn/JNsy3U0WgxyGR0XZe1vZ4wBg+OBthrM8coaNq8DG/W/vUo3 EN+BUiD4NS7GsY+x/AN4OANZnw1VW9TCuMl+aq+tZkeIdXmHkhaZ2C1Q8tpksxrxMZFp w0xr2o/1w1LcHB8p/JfwQRgfQZG0Cnlfdnk8qd6fq/+jliq9hFc2J0C/8Vv7efl9e1zr 9TZjUb+rod06KGrZXUwvX/h6xi32mb8aFgIzP+zPBON0XRL4S3i769y0cpXmWtmH8srC RBmLIfVF60Zm2fVt/FXuvH6oO9H2gS5r6x2ldW7pl4TNRflhNszgkp4pJGPvEnIOBqKC ultw== X-Gm-Message-State: AFqh2kpRIRK+AoZxEkwYxDqpzwS51AA/7Q7ZbSKBvTSRn7yvhYnbTqX5 hs4lNMhkshaaYUmKuRDop0uBMA== X-Received: by 2002:a5d:5b18:0:b0:28d:f043:490f with SMTP id bx24-20020a5d5b18000000b0028df043490fmr18704223wrb.71.1672937003380; Thu, 05 Jan 2023 08:43:23 -0800 (PST) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id o15-20020a5d684f000000b00286ad197346sm23886829wrw.70.2023.01.05.08.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 08:43:22 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9A9361FFBC; Thu, 5 Jan 2023 16:43:20 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, alex.bennee@gmail.com Cc: David Hildenbrand , Sunil Muthuswamy , Aurelien Jarno , Michael Rolnik , Aleksandar Rikalo , Greg Kurz , Ilya Leoshkevich , Thomas Huth , qemu-ppc@nongnu.org, Laurent Vivier , Max Filippov , Yanan Wang , Marek Vasut , Stafford Horne , Peter Maydell , Daniel Henrique Barboza , Palmer Dabbelt , =?utf-8?q?Alex_Benn=C3=A9e?= , Taylor Simpson , Marcel Apfelbaum , Alexandre Iooss , Chris Wulff , Richard Henderson , Eduardo Habkost , Song Gao , Mark Cave-Ayland , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= , Artyom Tarasenko , Paolo Bonzini , qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, Alistair Francis , "Edgar E. Iglesias" , Bastian Koppelmann , Jiaxun Yang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Bin Meng , Mahmoud Mandour , David Gibson , Yoshinori Sato , Xiaojuan Yang , qemu-arm@nongnu.org Subject: [PATCH v2 04/21] gdbstub: Make syscall_complete/[gs]et_reg target-agnostic typedefs Date: Thu, 5 Jan 2023 16:43:03 +0000 Message-Id: <20230105164320.2164095-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230105164320.2164095-1-alex.bennee@linaro.org> References: <20230105164320.2164095-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.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=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Prototypes using gdb_syscall_complete_cb() or gdb_?et_reg_cb() don't depend on "cpu.h", thus are not target-specific. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20221214143659.62133-1-philmd@linaro.org> Signed-off-by: Alex Bennée --- include/exec/gdbstub.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index f667014888..1636fb3841 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -71,9 +71,6 @@ struct gdb_timeval { uint64_t tv_usec; /* microsecond */ } QEMU_PACKED; -#ifdef NEED_CPU_H -#include "cpu.h" - typedef void (*gdb_syscall_complete_cb)(CPUState *cpu, uint64_t ret, int err); /** @@ -126,6 +123,7 @@ int gdb_handlesig(CPUState *, int); void gdb_signalled(CPUArchState *, int); void gdbserver_fork(CPUState *); #endif + /* Get or set a register. Returns the size of the register. */ typedef int (*gdb_get_reg_cb)(CPUArchState *env, GByteArray *buf, int reg); typedef int (*gdb_set_reg_cb)(CPUArchState *env, uint8_t *buf, int reg); @@ -133,6 +131,9 @@ void gdb_register_coprocessor(CPUState *cpu, gdb_get_reg_cb get_reg, gdb_set_reg_cb set_reg, int num_regs, const char *xml, int g_pos); +#ifdef NEED_CPU_H +#include "cpu.h" + /* * The GDB remote protocol transfers values in target byte order. As * the gdbstub may be batching up several register values we always