From patchwork Thu Mar 2 19:08:23 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: 658129 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp65103wrb; Thu, 2 Mar 2023 11:10:52 -0800 (PST) X-Google-Smtp-Source: AK7set8lxhheE1ffk0BJACtlOBDPq3AWEm4DEkqEXdmVSeUzZGuIIZ4KN4tfWcP6yF45ZF1HUQNX X-Received: by 2002:a05:6214:509d:b0:577:6271:a035 with SMTP id kk29-20020a056214509d00b005776271a035mr6066844qvb.1.1677784251863; Thu, 02 Mar 2023 11:10:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677784251; cv=none; d=google.com; s=arc-20160816; b=UjofuzXGZh7q7HG67ADpt9OaL3MnOlv3Sr6aUGgzHLiRbXAAIJN98NVP7FQeLRQW6O JUPuJo66xkmNZOTy6miSasOvyhgaxdNDmJWCfg2zMu8/eMyX0a1CdhfjNgtkIhjFe3N+ f8J7W7QGF/CdhIyLyZoH5OFknJH8/tS0SLfcI6xlUxMURV5bwlOQJXX+FnbhW4nGGP6U oiIU2OilIEDUXZ3nuZ+/chDzBAIs9zyTQhKrQPiJVn4BtOrOgA21MUzG1pV5q4+Nkf1B 3D1UFApbQcW4nSFdqENw5ro4U0o35xU5jP//m6bRbd/dUFf+NZtJj9vhTdvl0SszlD1m pemw== 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=vpN9HZmBiUU2swb5foi3aRB2Xz7IiTbLS73Qjjs5Gno=; b=l+bs5PJLWuBh5iBXtALY7sDiyU0SVYx3g4fxt1X6IwhxCsa3vOXFmLnUDmIoPbs1Gk sGgJrZxyywhi7WfsMY85ba5ej/crI7cJ71pTfdc3WESgLL2Iz7Q6cgHBlIIiLl5zkUKI scw8aUxasGHYCEr+Dk8hJ7s3z9Z2llqhw59UO41cyIFD2va6Rx8W3W8ovhgeB6rxfSAc slW2kkTwZaHuF3RNkxVEIn0vpjDvL0UtCGhUTIQqiISZiYvtJnIfVxlfzCBPeYQJTDfk wZVkwWv1G/mjymwolkw0OqOLIA81CLVDByAEOJKD727ofKN45s0zPz4/R+I2Jlh9OmSZ FIqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X6ZpukbX; 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 j10-20020a0c9cca000000b0057237542cd4si13218874qvf.153.2023.03.02.11.10.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Mar 2023 11:10:51 -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=X6ZpukbX; 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 1pXoIV-0007NE-SM; Thu, 02 Mar 2023 14:08:59 -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 1pXoIT-0007KI-RS for qemu-devel@nongnu.org; Thu, 02 Mar 2023 14:08:57 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXoIM-0004VH-9P for qemu-devel@nongnu.org; Thu, 02 Mar 2023 14:08:57 -0500 Received: by mail-wr1-x429.google.com with SMTP id g3so132621wri.6 for ; Thu, 02 Mar 2023 11:08:49 -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=vpN9HZmBiUU2swb5foi3aRB2Xz7IiTbLS73Qjjs5Gno=; b=X6ZpukbXB7ZQFc1ZKHqIcOrN4oUK5G/8vtg+7hvGOx4U57/FqhUHa5xkh0ATKgmuAz bVpNTe20/S+d5VqJiweBYfKEYdadM1ook/Q194p9EbRxNm5CXT+Y9eGQ5qzxY5MSDCFV QBYYyfW/1y6yV5SjCj3PGhaiWVrru80L5WWqRcyfyIbWfZW8cjCZdoEpy3ZUFrXAr5J0 Nq8sm2b6TPMo4q8nuUZ7v/o+QGqmDNn6C/dThABzyzE6qr5dE/WPmq9xUdGb99Uv35QL /44TeseRvDIZWTOQ/hCTTRPI0HCC/CaNYOPAK9iJcnmLlyz+TU/GwELecI8eQwqAosOF PAZA== 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=vpN9HZmBiUU2swb5foi3aRB2Xz7IiTbLS73Qjjs5Gno=; b=ai1JGlvz/0B0ACUw7ydyLMcpoQ38XuN5sKOKNNjnkQR1F4ev3B3SRda4k3Aa+4XxOP 2zU1dOURAhVf9srXLgIg6GaZTy3mr+j3BSsyO8P1WiHJfEXxWN8MKWgE1if5iDO4Pnza 4O9vftFDTjypToqsii3RPrJ9GjB14UB6VBGQtAFWwMduRzOmU4F5dghu0CksGV4sqJIY ZzwirzQItjc9t8DzNuqQhH5RDHW87h7DY4Dpwvk6uiOZJU5e2idweENkL1HAZxCLLPNl NsrLcV9+s7J/pq71baWROQpxficUn81g1PnjuRvphAKF3xbwDlO7KNmMHrNwbG8URYGm 9pkg== X-Gm-Message-State: AO0yUKUhDhUDI1iCtbIn4jMHerJnUbMlmdM0Hf/+g6iW+kW5ZEQAL5md 0sSaMuvBf3AMoGxA+gbybA24TQ== X-Received: by 2002:a5d:4e86:0:b0:2c7:fc61:1676 with SMTP id e6-20020a5d4e86000000b002c7fc611676mr8634371wru.7.1677784128871; Thu, 02 Mar 2023 11:08:48 -0800 (PST) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id x8-20020a1c7c08000000b003eb2e33f327sm6700116wmc.2.2023.03.02.11.08.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 11:08:47 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E33201FFBB; Thu, 2 Mar 2023 19:08:46 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Weiwei Li , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Palmer Dabbelt , Laurent Vivier , nicolas.eder@lauterbach.com, Ilya Leoshkevich , kvm@vger.kernel.org, "Edgar E. Iglesias" , David Gibson , Max Filippov , Sunil Muthuswamy , qemu-s390x@nongnu.org, Stafford Horne , Bin Meng , Marek Vasut , Greg Kurz , Song Gao , Aleksandar Rikalo , Liu Zhiwei , Alistair Francis , Chris Wulff , qemu-riscv@nongnu.org, Michael Rolnik , qemu-arm@nongnu.org, Cleber Rosa , Artyom Tarasenko , Marcel Apfelbaum , Eduardo Habkost , Yoshinori Sato , Alexandre Iooss , Daniel Henrique Barboza , Jiaxun Yang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , mads@ynddal.dk, Mark Cave-Ayland , qemu-ppc@nongnu.org, Richard Henderson , John Snow , Xiaojuan Yang , Thomas Huth , Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno , Bastian Koppelmann , Yanan Wang , David Hildenbrand , Taylor Simpson , Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v4 03/26] gdbstub: Make syscall_complete/[gs]et_reg target-agnostic typedefs Date: Thu, 2 Mar 2023 19:08:23 +0000 Message-Id: <20230302190846.2593720-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230302190846.2593720-1-alex.bennee@linaro.org> References: <20230302190846.2593720-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.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