From patchwork Tue Mar 7 21:21:12 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: 659848 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2605951wrb; Tue, 7 Mar 2023 13:23:27 -0800 (PST) X-Google-Smtp-Source: AK7set+Nxnhfod5OQaTepSlSvoA23XMaeoK/sH9KLfU+CgYvNk7Ipk8tHc6QEMztcu1Q0S2p/FUG X-Received: by 2002:a05:6214:21ee:b0:574:97e9:e21c with SMTP id p14-20020a05621421ee00b0057497e9e21cmr24958693qvj.4.1678224207727; Tue, 07 Mar 2023 13:23:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678224207; cv=none; d=google.com; s=arc-20160816; b=NqhI/fNmZgjKyZYlyo62fxDMTouupBb4yxaKcV6HOmtqCvjnvzkmxfnGbAg5Et4G0t H061ROZdp+e3NxLZkJUNo/OwUvkeHxZ7dioXjxH5YsNJQ4F3QrX5pzhQS0GWXG4GGqo2 dJoSu3x7BZkGn2Ho27DTcX5a/pxd31zIIRF+2K5WVTM/1oMkwO6kQ69dvlgN/ODpGyLk B80xyHbMDzCIUS+d+wOTI9iVk7PQNWdpVpWsjqKEFp4LRMLDd0DmkvpBsxenmgdC0VWb r9GOTdT04n4vadaXJ6WuWXTBX69DQu1/qrmY/cocCLF7ESDT1d9PY0VsZaEr8cF8vXiB Aviw== 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=BX3YvcmSLRF9NpgkkXb0E1NzJghZEbcg5m5XOvkqtlQ=; b=0PREjIZXKPmT9odZR2SOluqaPQW9MhX5kMW/9aBPO8WhYJ1mdjowVLQ4cXFr5N6nri v16vqLRwhnmGbM9dznIZTuUv0Tp8+P7K4b/MAlA7gsfXD0kVnTMuaYke2lYqyyKY3NBw gSYce8qKJzx3Z7f4wAPXbJ40s4qFi1PeC6h20lfqXuR7Mqn2nt+A1cmN2FP6T/bN7MIL Ppl9t2T9Upx4L3ShxI6AQdtr22pT+qgrPvdTcmPLo6biZYjyjaa6SEglLKAtW3Sl8PHt VEizGrtdLJSUApurwHR9h14w045DUmAHqcsrh+ncF0ToXgsV5y2BSwqMq8LaPaWe0Iwk c7Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e4cga0wq; 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 i9-20020a0c9c89000000b005726afd5ceasi10249575qvf.246.2023.03.07.13.23.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 13:23:27 -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=e4cga0wq; 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 1pZekm-0001eB-0n; Tue, 07 Mar 2023 16:21:48 -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 1pZekj-0001Wq-7Y for qemu-devel@nongnu.org; Tue, 07 Mar 2023 16:21:45 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZekh-00081X-EN for qemu-devel@nongnu.org; Tue, 07 Mar 2023 16:21:44 -0500 Received: by mail-wr1-x431.google.com with SMTP id e13so13482265wro.10 for ; Tue, 07 Mar 2023 13:21:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678224101; 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=BX3YvcmSLRF9NpgkkXb0E1NzJghZEbcg5m5XOvkqtlQ=; b=e4cga0wqy0cKs4XIbDjANpjXFfd+4flPndWLTTkHHsOtuW7fTvjKTAU5E/cTox1JGB 2e5yXJsVLQ/7KLx0h1pHa1vWtURa2Rw0GDdGXHuDBi+sXlAOX+apooAxhnThQ2svSUE/ l6P7shIaRdaltJ20IA+XGJj+cROddw3fp2fYj4iTT392AKeQEm+dIHoOWYDP/HopfRGB 3dxkPmYlpvNJ7/TbJ/nPtGI9Q6wLqIKyhQPfLaA1EWECyx4sspPR1K/mno0LXCDO76jQ wf+uF5y+bbQbsvKnK+a1BKmqOt3eulX1FFGsMlR4434N1Lvb5bRufuIqKdvvrNlB+gBl 9qGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678224101; 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=BX3YvcmSLRF9NpgkkXb0E1NzJghZEbcg5m5XOvkqtlQ=; b=y6UFiIsl51mZHisujr5IBdwanK96K1S7rZV5r7in3nDOeKWRQNcnYjSaeadAzozWmC aV2Gw7evQi8PX+pWPHe0OdL4/AMSno5QNa0BCP1IyI7qwxbaCN34gGaDADG7FrESAVF4 M+ulfi9oeC3yRbUjAQBtU+xi73LCYLSPy4Haru/idrvBD/5vuvG3VgEmZiFhqshez4tl 07XV4DOpKLrzqH7GzW+AeypqxzzIhFFWk8vmjCF5vNhxFf+ywneZF7Dkxu8/ISec4hI7 sYA76j6Gn9Zne3JkcA44/3EC+oUKUO4IyMJOvhxQuW3PJ1Jx3MfyqCxB4joBK+4kz0xA V8yA== X-Gm-Message-State: AO0yUKWqBQqcuQidGtPdL1zMz8mYOp9S+0XVD7kcYK90LaxBocAuqc8l JjWY/RnPBQAS2OtSzCZNax/HK0CdI2CIhQ49Vyc= X-Received: by 2002:a05:6000:128a:b0:2c7:17a0:c6b5 with SMTP id f10-20020a056000128a00b002c717a0c6b5mr10896128wrx.34.1678224101504; Tue, 07 Mar 2023 13:21:41 -0800 (PST) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n1-20020adffe01000000b002c4084d3472sm13684889wrr.58.2023.03.07.13.21.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 13:21:40 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 817451FFBB; Tue, 7 Mar 2023 21:21:39 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PULL 03/30] gdbstub: Make syscall_complete/[gs]et_reg target-agnostic typedefs Date: Tue, 7 Mar 2023 21:21:12 +0000 Message-Id: <20230307212139.883112-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307212139.883112-1-alex.bennee@linaro.org> References: <20230307212139.883112-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x431.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+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 Message-Id: <20230302190846.2593720-4-alex.bennee@linaro.org> Message-Id: <20230303025805.625589-4-richard.henderson@linaro.org> 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