From patchwork Fri Jan 17 13:42:25 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: 858197 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp706487wrb; Fri, 17 Jan 2025 05:48:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWSlRUOImbxXOEpB5KfI3H+Xsbjt0bUD9w0vIoalgn2sIbSTYvQ2IjONTU8JHjEMnWXDRbyzA==@linaro.org X-Google-Smtp-Source: AGHT+IEowHa9FHWEjx3OgejbuNt8XaCF+YVapGOX5QIlsJ/PT4qGPW3GcV9BEJCXZOzDL2ZmoSSp X-Received: by 2002:a05:620a:258e:b0:7be:5bc1:9460 with SMTP id af79cd13be357-7be63278e84mr364340485a.35.1737121716980; Fri, 17 Jan 2025 05:48:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737121716; cv=none; d=google.com; s=arc-20240605; b=cpfndlIIuM4jxua4fpX7PGZTkFV9eHZz5exh92Hhy7R4P+xFREdUaSF3/YorhYMy9y HbFyggIOfvfxIxmDdxBGPF1UInhZtr87mjfIgDvjQ5UDjTYTcR6k2W2vIDq7tjRARK8E cDXg/aoM4iriVz2C1PRCXlPpt2Uusvv3npuBgp5Y9TszwkPdVji2CbgmScrQUWc8zVUx w+MwMVoZmAPY8tavWjSv5mIjzsPOtoHl0wqdWaVhVGJh2bsncmKmrHx9iMap2MM/0rz1 c3B+3gPTmQF9oyZETF7j10Tb5lEt+HdpjUgQ4lKI3owhL5nayfbxGkjLZAzCoJD6Aqvi WZXQ== 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=MTfYyauxFj85w9TzqXO1KGgQnkDy6owgJRE7biN3a3w=; fh=Blf2oUU/YG0QI3K9EaXy3qgSFUqguV8JMcvhxUv3o9M=; b=BbyEmc/q9QGhioztOSnXO+991lcRjpZQaR2PtQyteper+pI6dEktCoROvC7YIeKCtg FWkuR5ItkYUfEUs2cGtYXGs+zWphwd4sGrgqKltqBPVbTzOqGddxtg+EgECdUJvZPzte 3SDQcvX1+oDktyAondFqkBUjv5D2Ul8CUoMeSt0kvIaPx8N77/SOo+GpcXTSsX5ID060 TBMKf6OrdyzinaAhTd03DxkGLrn2nxtiClwGaiHFcSlTwKdRUxZsM4Le3gxoaxVm8ixY DrLakAUYjvfIb33Jt8sCgKVxPCUN9rFDU5hdo0+IfyzQN4/QO9WxomsISsaenAisdAWB 73DA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xidxAFHW; 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-7be614bed90si265472885a.303.2025.01.17.05.48.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Jan 2025 05:48:36 -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=xidxAFHW; 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 1tYmdt-00020J-OU; Fri, 17 Jan 2025 08:44:09 -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 1tYmcu-0000x3-HD for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:08 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmcq-0002Cn-9o for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:08 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-aaf60d85238so360725066b.0 for ; Fri, 17 Jan 2025 05:43:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121380; x=1737726180; 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=MTfYyauxFj85w9TzqXO1KGgQnkDy6owgJRE7biN3a3w=; b=xidxAFHWp4qPn3kKJJ9H8zTtzNfaCibSiZDV2Spp6VvynrkAkCVQwHDOGUQfBP04a2 gHhNiw2xVnV+9oTQt269rJkmAaGm3TQEc1370ABcncTKiecV0WD4Z76qwVc/VRvpdPd8 xZpWCsVg309/h9woD+2GYRHkgbwEef5ZtKE7NNYHBzSgiXvDHz/z4ccUBhsgxJ1FNVAb jXrC+9M9V2QQCqpod2LgOtTD/K6NbxOzRJgu5IZ5nOPj2WkVd+DBU4VKUqL/l9SQBK1h px2F0JjgrNOX+6dHb2Mxi1D+ujXM9bUP1Brwk/EfNsJYvXTxuvIh0EBNiSPPiF9O3K09 4oNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121380; x=1737726180; 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=MTfYyauxFj85w9TzqXO1KGgQnkDy6owgJRE7biN3a3w=; b=jVM2CZ8h/jnYPct/80YyYzuzZ9PGxIa15QZ34KC4r6AGxUYapfSB7LGTleleFAU9Sx 55aRnF1FhjJULnktZpW8nGgmYnZsEB7QZg37a7xMAxVcpD8dPi3njTHZlLGlvGx3DGef SC02o7FSkkuXWCYQo9czMuTd1XFgGSUWuJevKC/kuLhlLNyGv7DylASYxVvV9BysVXn1 WCClVE+6n1x11T5jBo3lX5OzuVY4ulCdNbX5zM7WwJjU6tMmQJ1AKAVBR8I/v+j8b1Or 8E3R3d1Mk31o6yoYm0M0/kHxSd3E7Eb/WWmP3CYTTU43sUQG/uKybxH2cJfMG2j6Yh76 KFug== X-Gm-Message-State: AOJu0YyE0bJny4kxb68dpuxRfQkstxMV8Z1tQRa+XBL4dB56BVcvAv6M mwhQt3QdeCa03V2wM037iFItOB/pBxYCRjLvshXIFz+xxPoY2mbxkOG7YaO6TGblqnNRKzKSxtA /dKY= X-Gm-Gg: ASbGncuozYUhgs4xuvX8aMvQ0xJtFi10LWOVnme9mUkZaukBzXNdztHHhruSsneU3YH ALyNsSbdCrnOx7iOWHLXx18zy9LXhw8pz744H2oMd3j4zC5DNFPKXVMPB73+HQKnwH+flXnpZ9t LiL349+xCijkAnmdawPBObUs21Q0yIlwkIZ8nkmSVSZDsyAhMLw3RSmTRk4gLC/L8qMoPJjw3Rn 1nrNyqoYLJxtnYpc9neJD8WoqlCwQ+v4yz0RbmNOJRyJcK+BYIqCbk= X-Received: by 2002:a17:907:1b15:b0:aae:b259:ef5e with SMTP id a640c23a62f3a-ab38aedb10amr290897166b.0.1737121380098; Fri, 17 Jan 2025 05:43:00 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384fc35ffsm170338066b.160.2025.01.17.05.42.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:42:58 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6E49260866; Fri, 17 Jan 2025 13:42:57 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PULL 06/37] semihosting/console: Avoid including 'cpu.h' Date: Fri, 17 Jan 2025 13:42:25 +0000 Message-Id: <20250117134256.2079356-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x633.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é 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 Message-Id: <20250116160306.1709518-7-alex.bennee@linaro.org> 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 {