From patchwork Wed Dec 14 14:36:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 633879 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp363334pvb; Wed, 14 Dec 2022 07:01:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf5NSS5m/7UjUEAkCWBwfLo8f8Njf1YPpBpR2mvIAKb5yPJUr5x/7cKIHx+PkvpOHcV+8iOf X-Received: by 2002:ad4:4d42:0:b0:4bb:783e:f008 with SMTP id m2-20020ad44d42000000b004bb783ef008mr33740064qvm.3.1671030072452; Wed, 14 Dec 2022 07:01:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671030072; cv=none; d=google.com; s=arc-20160816; b=gR/yIpK/vmW8n8If23U2LAGV2lpYSGtQHGM2sTD1coIkKidoUNEG3SNzA57WUIiEMw dWnYF+qh1jbUjOrRrnmRmwegA/+tY7hSrDGWoxo0ujdNE9oBD0mCgDqcH3GpDGPBsDvP S3nyjbDCOAn/8uPjQHxBj6Ac/XMTwiH7vwLS+joUX5yWfI5k9KI8Ntd5ogzPLx+VU8AV 3jSh2dQbclYx2pVTa+KCIxvTo6EnibqPRr6006hyGLx6EQjTPVwNNCZLNuZjSwr+fW4l oeJ0bgrECYODFVJJKuzXnobAA2ar0OkPjKI6nSyV8ozc00cWCCHKJdfnlRkW9PWSWWZw 2u8g== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=YIcurVs+8wS1im41pBmnVSuxZrkSMUiPco+Xx7dzfFw=; b=lCH7o4/ew/8Wj0y9Scno1jSkdomqU5CEtivzdx6IDAXDwvFWlOWOijOpDZySjpkCAw N/9AXfGB6HATddOzdnL61G4CqsfzqX16tCUXnkYvOOgBShSdFKCAcskLqZV0WnPECTgb oFVp+DcWWmAs//D7FwOHHvunBKhcRbD24AwVk5DAluL2uMDCtQnbt0Y9ZSOFN/tRMgoH R6S9DjRQcRmrc8YjlSjourX2b4Yf8oboETrQFcCObZICY6LsKcvAI3BJxpI4p8fkEFwm hdeo1gBU2gU8rxl+CYY2YfzhKD54VAPpK0fW17hjrR9Ho8wmpRWwjtwPyS2DpIxFSAkM /Gqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aQjPqdbo; 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 jo23-20020a056214501700b004e164c4c53asi4722qvb.16.2022.12.14.07.01.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Dec 2022 07:01:12 -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=aQjPqdbo; 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 1p5Ssj-00081Z-IU; Wed, 14 Dec 2022 09:37:21 -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 1p5Ssc-0007zX-3C for qemu-devel@nongnu.org; Wed, 14 Dec 2022 09:37:06 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5SsZ-0005wR-HI for qemu-devel@nongnu.org; Wed, 14 Dec 2022 09:37:05 -0500 Received: by mail-wm1-x32d.google.com with SMTP id c65-20020a1c3544000000b003cfffd00fc0so10749087wma.1 for ; Wed, 14 Dec 2022 06:37:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=YIcurVs+8wS1im41pBmnVSuxZrkSMUiPco+Xx7dzfFw=; b=aQjPqdboHgzJC0lsiJJ1GKBfntzi4O81+qny/iARtL2RYz5SXrQN3VVP+IEsHFEZcj PFOQ4TB4irHjzJ6XF3GhyD5seps273qqFZ6s6aVCR/aoDJBPS7XfX3NGjOI4rMQ6edqI pNjrelwRVqGZKr5gw8W+yzFILMsRuOno6md+0M5LFd3TYrulbCgC+zC+6MhxtoqX26Oa YmH0isSO63ZwO5aqOZUzTK5wI6wqmQ/bI1lNcWUeeKAwFZGzCCi5p+T2tUrKspTfgQmo Jv6iiH/hp76KziGqGVh+A751DXWLkeIbgG+4LgcAOQ1Stu9PVtygT7UJCFBhpZwUEP+p TC1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YIcurVs+8wS1im41pBmnVSuxZrkSMUiPco+Xx7dzfFw=; b=GljBAOO6g/Jp8tHV3weFuz2G6FvT8jchdCSRmL7rv3MSFtL5WHswmAifDJhlOPgQ3u sjRsRHHthNcUmf9I9UwwxTBncTZRDWbRgaXKsMWPneoGKn2A1+XQ4C12I+BbGzmvF94v ZSdSuVO7HFD2e8Ox77ukuvB7tJhBFsxBxLJ1U0qXzpE4KxOTC7aC9NzU5CNeHM846J8d lQHfpvSMzEleoncFc+G6fkv26PICAcgf6yjupbqgEPCWou4ZnY37JcRgL5F0euUlKKpN O+DrpCv0tYRIBWveWpbYC7QjAZPjs7kXq6iz1mdOLGybcHNZvnWuMavDBZjhkc6sA84m E26g== X-Gm-Message-State: ANoB5pkQVzHdwodX06Gz++p5qz3zYF3bOG3g712gp1d8iJAkfHQDDo+h 2sw/R00LETpvfzngG+JzgMG0Y99TZeAG+49h4SM= X-Received: by 2002:a1c:4b16:0:b0:3c6:e61e:ae74 with SMTP id y22-20020a1c4b16000000b003c6e61eae74mr22941668wma.4.1671028621764; Wed, 14 Dec 2022 06:37:01 -0800 (PST) Received: from localhost.localdomain ([84.76.199.78]) by smtp.gmail.com with ESMTPSA id v17-20020a05600c445100b003cff309807esm3166012wmn.23.2022.12.14.06.37.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 14 Dec 2022 06:37:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH] gdbstub: Have syscall_complete/[gs]et_reg to target agnostic typedefs Date: Wed, 14 Dec 2022 15:36:59 +0100 Message-Id: <20221214143659.62133-1-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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 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 --- 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