From patchwork Fri Dec 16 11:21:59 2022 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: 634409 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp739546pvb; Fri, 16 Dec 2022 03:23:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Ahk7de3kUoDmI7sQgv4OO+De5UmcG53WGTrfdN+vr2RvJHfPbdqvDd+Fk5xSFP94RMrki X-Received: by 2002:a05:622a:4892:b0:3a3:56f7:196a with SMTP id fc18-20020a05622a489200b003a356f7196amr50807205qtb.7.1671189819003; Fri, 16 Dec 2022 03:23:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671189818; cv=none; d=google.com; s=arc-20160816; b=gWVNfYhh5Aytpy+AHhL+JyM8p7oeY1vQzGHOGkBCuPRIfIhawIfmcYiQmiWtX3+fWy 4TZJM2vPrpidoICIdm0KdQI13G6mRxhRCCnL/kIn1ykEJqLBsk5yxHSB2QenmcesDKMU DEze8fYy3s1bvmd3uaKA3LXvBOgoMTMGlfpVLgaFH5BBaGueI0inwH7wuj/rmpM1Cmca BRrHE6Tbh3HyZECkcIADlpHpAPsj14XjnR+hiGSiH90RygUib3p+AqHTnU6vr7bzg0nT XAOEzzt2NioqGkYcNWbnWAcm9CRMvCggQZKYAriF1BL0cbhy2QCEMSPFXHd3i+fUgOuG Y4sw== 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=GFAq5aou6SnU6jWpxMFh2xKUKeRgPEjt2tOWj58kZ4lEH85A7HQlMlOjEbXRjHVe4S KKPBa7UT03gW9fXRuy9oNOiaSXOccL/vfaDuzLwLJ8fmrED+exf0bgxcqtPfCVZHeTVe QjfOkAH4eyxS/3gCVMvyK+HK7GIinoabdDxPmPBxix25PL+Jf74mRAnGkHxnCO+bi3S/ s8T02Fz2+GFgiWvep5NnPWnNDzmsH7DQvid042Fq1d56GhyBsYsOOqBbiL1zqLjGr9RQ cdfK7dHaF3fYjJEX2/E+/o5D5SM4ktN1PW3V3PnNAlyptTaELLxsypZWFZJSBV9lGIhK xoOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ppDJiOmH; 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 ge13-20020a05622a5c8d00b003a540863defsi981865qtb.377.2022.12.16.03.23.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Dec 2022 03:23:38 -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=ppDJiOmH; 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 1p68n9-000238-5F; Fri, 16 Dec 2022 06:22:15 -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 1p68n6-00021f-Qj for qemu-devel@nongnu.org; Fri, 16 Dec 2022 06:22:12 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p68n5-00067f-4i for qemu-devel@nongnu.org; Fri, 16 Dec 2022 06:22:12 -0500 Received: by mail-wr1-x434.google.com with SMTP id i7so2153263wrv.8 for ; Fri, 16 Dec 2022 03:22:10 -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=ppDJiOmHgtESgFUqdzTRWldALcCqZlXjSutua5UJYvMdt4LZC7wrjHwKle2ZVY8kIa NsuQxq1S+82jUQVvnusSgy6Wx4qVPSPzJHY8nUg9sD4AhWVrJlDadmAce4cOPjZnyuVT YkzZXmgigjR5zmsKcWn2kLSq11Y74bX5upZCYvNat8gEzCXClqNrKeEL/bV+bWoXNi2n bo9HUJRSE4xUWktOw3VRpickVKmQdxPWqk8axKTZJRMBxxFRzo+k8cgCBzIpVaF3mWNk JZCZdawRhWhPZ6ZIv0kiz1MOYdQGgh2cY+Uid80iaNZevutLoTBuVz7jmkaflVarP0Ie dADw== 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=V1z1+2gA2gGyCN5X1jNIMLMKw6csE1hb5J+4p/FQwvPAVUPPW1W6ywnGouqN8+pqW+ O1hHsHflstvckGPC0RK2n8vXFuOS5LwecxNK4tx9CuFvK11WNAueNOclMVcGk8fzrqHK Www1OuSx1GD8UaQzEUZ90KWrwoWvXS3h2BJu81LF2Bth5KcidKylOlbNz0QwQxpKNcJi N7XvquVVO2wYlHqt64noivG5COmekRIhs90KCJY82wZRR2s88HWUNNoMwdwbtd8br2AB C9rZnrASzA9ZEYpScoKHUIURaEhM3zi4/eqgQXDO/Srzn2PAGYCtaLjCrk0jzdxzuHOd GqPA== X-Gm-Message-State: ANoB5plLugirq4or/XVLKT/JgbUmoVHpx0vqKOB76vvxh7CrUQ0H9Iba GfsOzSETGLnhcnnxiqFYuu5EnA== X-Received: by 2002:a5d:68c8:0:b0:242:15e1:5805 with SMTP id p8-20020a5d68c8000000b0024215e15805mr20414440wrw.55.1671189729617; Fri, 16 Dec 2022 03:22:09 -0800 (PST) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id bh10-20020a05600005ca00b00242442c8ebdsm2014931wrb.111.2022.12.16.03.22.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 03:22:08 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2D4B41FFBB; Fri, 16 Dec 2022 11:22:07 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: f4bug@amsat.org, mads@ynddal.dk, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PATCH v1 03/10] gdbstub: Make syscall_complete/[gs]et_reg target-agnostic typedefs Date: Fri, 16 Dec 2022 11:21:59 +0000 Message-Id: <20221216112206.3171578-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221216112206.3171578-1-alex.bennee@linaro.org> References: <20221216112206.3171578-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.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 --- 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