From patchwork Thu Jan 16 16:02:35 2025 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: 857907 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp280320wrb; Thu, 16 Jan 2025 08:11:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUl0etMhFXvTl6mHx+tkfzb/ldUhxvJSO+MZauJS196aITcAVz7M/ChiDD0dUMQeB3NVC9VcQ==@linaro.org X-Google-Smtp-Source: AGHT+IGglKzNXHUHqSK2o08HFAdo+HpVEt2pPMCFJbxNO55Yk9rAyfdDs7WM5drladOBLo9qBG68 X-Received: by 2002:a05:620a:46a1:b0:7b7:2e7:7a88 with SMTP id af79cd13be357-7bcd9761f5emr5122937285a.44.1737043901896; Thu, 16 Jan 2025 08:11:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737043901; cv=none; d=google.com; s=arc-20240605; b=k4c7Gm30Ucfg951Pai1Q5aslJe6g92R2USp9ejYijP5N6L2bOflV+vqXD4+6c+zx1F pL0vdLmKLMER8q8l0swSyCrl9liIMm78p+twU1iHmqbnt6DMt4uSDZtAJ607EImLhHZE j1wU+Popf7D1//1jU0xfGw9+N0w3yPJH15mFNwMrvFuvA2Gzgc6FJ2JOsrDugsKY/LGN Ff7mFSWOBG3DAlMx5XgjKJcXcMOwUHPycpHVAgPCufoPo1W+wn/bZzJ72b71ZPYP1TwK k1v9HL/2ZYObY0IMM5PimXhqPlM+LeY/s4cFkXIb83iNB4snGplhylNeU7UiPNwDVar5 CLTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=q0SipZjZSJ8RGOzW6wWIIrmkUJqEseFLNGa6w4kFsPM=; fh=LWJxUxOPIoAG7kV40OipmNLMiNyFM+gQ1dWz4vBqJQ4=; b=cCBr9ToXAJWeGeZk7qL5qa74E4g8zI3xXZtt+u3XQGHMI5fQenIGYFX0ZstOjaUxMU Zget8LcusrlzeFCy02PEX+Y5piGsaAvMvP0StjdppUxoib/oBEMVE5Ltusx7w7FKEVoy ofwQPUIaGzLCLNiqFCxg1qfPeCq3qmFzHGQ0kXc76urRu2W+CGRFUC6IM5abtFuaQA8s jwp19VXUg/3aV2EghH4jAoU1z+pyLsFrS+XBSsl2QYyRTrIc/hSwi9IIpft7yH4DwXkJ jZMabiWTEvYDGNuf7Vf5K71GIarSMhx3LPX5wab5TsLpGl0nw9Jx+ZiGmNpC7wt9XHp/ reyQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r8aAlNmk; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614bfe1bsi36457985a.265.2025.01.16.08.11.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Jan 2025 08:11:41 -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=r8aAlNmk; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYSMp-0005Wj-DR; Thu, 16 Jan 2025 11:05:11 -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 1tYSL5-0003WX-3Y for qemu-devel@nongnu.org; Thu, 16 Jan 2025 11:03:29 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYSKw-0001Fi-VC for qemu-devel@nongnu.org; Thu, 16 Jan 2025 11:03:21 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43635796b48so7481515e9.0 for ; Thu, 16 Jan 2025 08:03:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737043393; x=1737648193; darn=nongnu.org; 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=q0SipZjZSJ8RGOzW6wWIIrmkUJqEseFLNGa6w4kFsPM=; b=r8aAlNmk8qPIKDTMOTIThybdafb6ITsKuIwyeLPXys8Kk4O+lqgofUHQgMShyLTOOa HR+nfZw9fu4ZDGhuH6Gdf7OHVH+bZrPR4HhbhkYiztjVkaW/27YgpjWhRvn4ztP9jabr xRaXQ0EUSXW5ojbXrB9fVU1VF7+XAVQMj/RAt+lETSnIfstB5f3Cwye0o3ud2z2JfdSP PveMUg7A7Cnabe7EF8T/c30NyqUangT9mAGn1MrErPG0Hau5XScGEHkQHT8PpyAkuczE ZSnhfduN2C5ZrrJoNhj6adXnZeQvOIRCZadriHnwrWRggCaIwzPvj7znzmMcwrnb8675 sm2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737043393; x=1737648193; 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=q0SipZjZSJ8RGOzW6wWIIrmkUJqEseFLNGa6w4kFsPM=; b=HXZblrBk3yDQbKcFOHqRgwmt4UlpmFJFqh17OCtJAWcmQSffB5w01GbAwtpzQx0NKc qwrAjmV4+Mt8EA4ZMEG1EP2PVhVosbeOV6a3nRn4VbHX27oS1w8IY0NbMUVgIzG9douE XZndeebO9VSswICYcQJQGGfZ08dlOK2fOZm4Vf/2c+38eSfGU+csnVs7QUWkUqhQSscf qbm3ffqurHTfpgoOh5qYj0bkW1kdSjCkwEkyrH8i3scy0UX9cvH+z7yuwHWv1D/2zwqX AJIdZ7wIyxQ9STkV4XKSi5V5VFSzS8pTQDPLxh8/QGipVh+ZWhWO6QHLFivcDy/Xhij4 KLwA== X-Gm-Message-State: AOJu0YxfL3ydwD1VNonNT2sy+6HjAbdA+g5WCigx5qsPIXsYKT3muPIm 6Y30xQLCxv979qKl5wSKTXo4G3KFSlx4sbFE8dDlwmtfrvyhW5r5IcrTAvu2weE= X-Gm-Gg: ASbGncvy/Exvy8cYgMXi5OkBu4RergCZk93AyIJQsyjze7OMSG2No8EHpLuH2imQSUX cKKH+uDTmzNOTfY3L+YoBXrLWorSCHCbxzDeIX9CXpmeQZ8gRxRm19y5Xc7ApIRmGSi8CSRCOW5 jhJbVT9r/UIZl2+1XrUhHJsbUPTN4outXTSAudrrqw9UHtZNSk10LALlaIrCOdRitStOpWS/akS NKC57Xw/JLptMa0K6JRQyzDn6GMJbyAJoMn1Dur6TTBrnqIHcVvHaI= X-Received: by 2002:a05:600c:1e29:b0:434:e892:1033 with SMTP id 5b1f17b1804b1-437c6b7b184mr70429135e9.2.1737043391766; Thu, 16 Jan 2025 08:03:11 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4389046885esm3193275e9.36.2025.01.16.08.03.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2025 08:03:09 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 0191A60859; Thu, 16 Jan 2025 16:03:07 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Markus Armbruster , Yuri Benditovich , Jason Wang , Cleber Rosa , "Dr. David Alan Gilbert" , Peter Xu , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Stefano Garzarella , qemu-arm@nongnu.org, Michael Roth , Laurent Vivier , Mahmoud Mandour , Andrew Melnychenko , Konstantin Kostiuk , Kyle Evans , Richard Henderson , =?utf-8?q?Marc-Andr=C3=A9?= =?utf-8?q?_Lureau?= , John Snow , David Hildenbrand , Fabiano Rosas , Alexandre Iooss , Eric Blake , =?utf-8?q?Alex_Benn=C3=A9e?= , Vladimir Sementsov-Ogievskiy , Pierrick Bouvier , Kevin Wolf , Peter Maydell , Laurent Vivier , "Michael S. Tsirkin" , Thomas Huth , Warner Losh , =?utf-8?q?Dan?= =?utf-8?q?iel_P=2E_Berrang=C3=A9?= Subject: [PATCH v3 06/37] semihosting/console: Avoid including 'cpu.h' Date: Thu, 16 Jan 2025 16:02:35 +0000 Message-Id: <20250116160306.1709518-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250116160306.1709518-1-alex.bennee@linaro.org> References: <20250116160306.1709518-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.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é The CPUState structure is declared in "hw/core/cpu.h", the EXCP_HALTED definition in "exec/cpu-common.h". Both headers are indirectly include by "cpu.h". In order to remove "cpu.h" from "semihosting/console.h", explicitly include them in console.c, otherwise we'd get: ../semihosting/console.c:88:11: error: incomplete definition of type 'struct CPUState' 88 | cs->exception_index = EXCP_HALTED; | ~~^ ../semihosting/console.c:88:31: error: use of undeclared identifier 'EXCP_HALTED' 88 | cs->exception_index = EXCP_HALTED; | ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250103171037.11265-5-philmd@linaro.org> Signed-off-by: Alex Bennée --- include/semihosting/console.h | 2 -- semihosting/console.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/semihosting/console.h b/include/semihosting/console.h index bd78e5f03f..1c12e178ee 100644 --- a/include/semihosting/console.h +++ b/include/semihosting/console.h @@ -9,8 +9,6 @@ #ifndef SEMIHOST_CONSOLE_H #define SEMIHOST_CONSOLE_H -#include "cpu.h" - /** * qemu_semihosting_console_read: * @cs: CPUState diff --git a/semihosting/console.c b/semihosting/console.c index 60102bbab6..c3683a1566 100644 --- a/semihosting/console.c +++ b/semihosting/console.c @@ -18,14 +18,15 @@ #include "qemu/osdep.h" #include "semihosting/semihost.h" #include "semihosting/console.h" +#include "exec/cpu-common.h" #include "exec/gdbstub.h" -#include "exec/exec-all.h" #include "qemu/log.h" #include "chardev/char.h" #include "chardev/char-fe.h" #include "qemu/main-loop.h" #include "qapi/error.h" #include "qemu/fifo8.h" +#include "hw/core/cpu.h" /* Access to this structure is protected by the BQL */ typedef struct SemihostingConsole {