From patchwork Fri Jan 10 18:09:09 2025 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: 856277 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp361563wrc; Fri, 10 Jan 2025 10:10:02 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWC1pIDxK1C7PYehufmHiVG/ab9m+EWezXrK3xX0D7vvaw/6TzdXZy9t+fqlXDImVGch152jg==@linaro.org X-Google-Smtp-Source: AGHT+IG/mjP0i6hvDzBCgW8WhRq8rw71xEgh8thlxGzHUSXR3+uvcm9Om6U7Zl7rNyJGxk2bp7tm X-Received: by 2002:a05:622a:15d4:b0:46a:2876:d667 with SMTP id d75a77b69052e-46c7108fcc3mr184028511cf.18.1736532602582; Fri, 10 Jan 2025 10:10:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736532602; cv=none; d=google.com; s=arc-20240605; b=gWboipzZ1NRdXaWFXxqY9yZhl+hTdloKYLuWefjVzV9YwDR+vnpqq+6SruXXSGvnFd qONpPKQCkckjvIilfUILLhsbpBD7djSiERfxrmG46edXuRKmw3K9EBAmNQL6tuB91ZEL 72ehpOr1Lou1FoEKcihcuWCo1o6xo8AQ0y6rDRdj2EJWdCUe3HsiV69qqToVmKE6Q/7x NXT4Hdmag1nQFhgJGI+bKEG/2MZPQQnO6HtkGqbE9GIM/BG3VKbBBdM3FUKx2pBbGsgS ld0QFydKoenQq2ea1rpIFMeJxFOcbOED/el3K/Su/WK/3t1YarnkOGTi57jjqarGh/sQ EHgw== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=94dPOddxHoStyFe5gHQ+E8+YoIAsJ120fCrM5/9xEVo=; fh=mSubbzz3vpq58Il4H++9Yj5DgQPtOE3o2ggoZeDJvls=; b=Mb1M1YhnT4HlXdv3AeFoO+pXmXkLgaz+DD1ifJK8RkhwCKqU/V4zzy9RjjWZy9JZu+ TZBK0vKqD1eHpFWLCbTQ5paW4EIBTBifLn6bhXZttVJuz4LLC3ZDv658IDiiqJCq5Jqs 4LLh1GDSShN2sCTO2hzI9eW18d3basMzNj+yaRxUTeHdutL37nPSPBO3Z2RZxsC+qFSf Fp9Qvglo2B3Pv/JY+7C4O7O10B0HzzaMSa6q+1dSYUtHuYA4hljhumoWDV4KZb+59XyH beGDXRHzn0i+hc12LvQaG48lZ+99PIH3l9+GyiA90TilkQQvEppXZNFMtjpe+5rsT8Su RhEg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="d6x/+AdL"; 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 d75a77b69052e-46c87331995si24905121cf.34.2025.01.10.10.10.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Jan 2025 10:10:02 -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="d6x/+AdL"; 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 1tWJRe-0004u4-3X; Fri, 10 Jan 2025 13:09:18 -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 1tWJRc-0004tf-GX for qemu-devel@nongnu.org; Fri, 10 Jan 2025 13:09:16 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWJRa-0004ev-Ii for qemu-devel@nongnu.org; Fri, 10 Jan 2025 13:09:16 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4361fe642ddso25165045e9.2 for ; Fri, 10 Jan 2025 10:09:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736532551; x=1737137351; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=94dPOddxHoStyFe5gHQ+E8+YoIAsJ120fCrM5/9xEVo=; b=d6x/+AdLWP8z9/4jpms8hXb73jsxCZXGcsvxuxI7699/5kr2r/pttL56RZZu5Q2FPW g6DN4olr12eEkqS94CND8TdSVpSiM4B4LqoDUHYCkU02r2AeKMbC6ulA+ebdgoYytduH fyncjNJYbjbecNiWhEHCDUap3P08EusOHuXYKP9cOTBVtasor3MJGBAgfTr/tJn65N7Q AJOZejM+jFCZGilIXkwDXBUTlJ6EhBxOwq8XgLAMXXMRwKKsyb547LTg+bCuki4IgTTE TLBrR3U/9ojCKw65qauAnQgIdJ0h8To86/C2l7JGLDKQmh96oUzjTt2wcePNwbcx2Ecg FMLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736532551; x=1737137351; 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=94dPOddxHoStyFe5gHQ+E8+YoIAsJ120fCrM5/9xEVo=; b=kbSUbYlCw0A07+Qy8RUYa4YzFU7ZWCl+G+W+9I1T/zW7kfKPdfzUXWOChqYvc2jquZ w6YytF3Oong3PgDmAuiLx+vc5RNVrpVFwmwsXuAwlAXGIYmc/SYLq32dbI1R2KjXnfQ7 vmcn/CarBV3TLpidnKX/yWdHfCHFSlzjkSc9/WFf5fG5uH1O8nTAC5vJTHaqq2WPXQVg 6/E3JK01as7Pj1RhMxuUlzS7Q3mWfjYjk0ehjhiKPZ+LYsCmLJ/3hcFHaJyDetWEVU97 mj/3Qm6Ok2Q3rKOLUR3CcjUAKzawoIGtExb3ba0zMgXLrI+qIlB2yYqPxxROdECKIqGa sArA== X-Gm-Message-State: AOJu0Yyd24Ez2rh8oE2rlEEWeKttS3vK6KgG3bS1bPgIXXwqMaunqxEM 5kUZzM+psFnjZLDzpHd1wyGvxwmY0aRjQl+LMa9dkn2AnIlwUwH2FUwe8tNm1Bun5vY4MfQgTuk XHjQ= X-Gm-Gg: ASbGncsiTKu6oT4SoLkTGe42iiqUzFIjeoROkLwWw7C4F5E4NAEBzururcCdshblOKT 1EawW62fczGVJRjtSytauHffBMvpn5aWhvPmQgnKAqvpf2opsDHNVUd/WlFMH6ttRb9IqczN0yu u8KeKoJgLdayVmRhfVq53yad5VMZh1YuGTIFMUcDI2LB1PpGhvkK6VkWEWPINgF0+2IjlglzSv1 ODnc34nXvCgetVW3f46kRC8T0i65W1Fysvz5GEIU87gLxdfVmGjiCauoXnRJPZTSetJszN21zA0 tBaX3jiE0+meEy5znV56ARjsxozVmrY= X-Received: by 2002:a05:600c:1d07:b0:434:fa73:a907 with SMTP id 5b1f17b1804b1-436e269a5f5mr111516085e9.13.1736532550547; Fri, 10 Jan 2025 10:09:10 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2da66e6sm94655495e9.4.2025.01.10.10.09.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Jan 2025 10:09:10 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Bastian Koppelmann , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PATCH] hw/tricore/triboard: Remove use of &first_cpu Date: Fri, 10 Jan 2025 19:09:09 +0100 Message-ID: <20250110180909.83165-1-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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 triboard_machine_init() has access to the single CPU via: TriBoardMachineState { TC27XSoCState { TriCoreCPU cpu; ... } tc27x_soc; } ms; Pass it as argument to tricore_load_kernel() so we can remove the &first_cpu global use. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- hw/tricore/triboard.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/tricore/triboard.c b/hw/tricore/triboard.c index 4dba0259cd3..9cc8d282ff2 100644 --- a/hw/tricore/triboard.c +++ b/hw/tricore/triboard.c @@ -31,11 +31,10 @@ #include "hw/tricore/triboard.h" #include "hw/tricore/tc27x_soc.h" -static void tricore_load_kernel(const char *kernel_filename) +static void tricore_load_kernel(TriCoreCPU *cpu, const char *kernel_filename) { uint64_t entry; long kernel_size; - TriCoreCPU *cpu; CPUTriCoreState *env; kernel_size = load_elf(kernel_filename, NULL, @@ -46,7 +45,6 @@ static void tricore_load_kernel(const char *kernel_filename) error_report("no kernel file '%s'", kernel_filename); exit(1); } - cpu = TRICORE_CPU(first_cpu); env = &cpu->env; env->PC = entry; } @@ -62,7 +60,7 @@ static void triboard_machine_init(MachineState *machine) sysbus_realize(SYS_BUS_DEVICE(&ms->tc27x_soc), &error_fatal); if (machine->kernel_filename) { - tricore_load_kernel(machine->kernel_filename); + tricore_load_kernel(&ms->tc27x_soc.cpu, machine->kernel_filename); } }