From patchwork Thu Jul 18 09:45:18 2024 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: 813156 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp208985wro; Thu, 18 Jul 2024 02:47:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWVPgdnFTAjeRq4h+T7Kic3wYvMO05FYLD946syKwxzKnRlw+z53PmZTTkeSltjWjcODHoSBWhBF0qK40f9287h X-Google-Smtp-Source: AGHT+IEAjSUyxjxvccXkMZksmE+Lk1CHD5nbHKWl4SfR+wDG2MazH5hRuuPdt96r3Z6TuEeo99s0 X-Received: by 2002:a05:6902:2005:b0:e08:548b:db5b with SMTP id 3f1490d57ef6-e08548bdd21mr628462276.22.1721296027007; Thu, 18 Jul 2024 02:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721296026; cv=none; d=google.com; s=arc-20160816; b=qycZ7PWPtLQ8yaMq3iSHEH6NFqw9LKT8RH7iuk2ucZAr4cbm3wcohDuq9rrQV/+YxB VkHNisZ3ceHbU3mwnvIH9N1IUt3BlhV9/K+j5foXIqyYiyROppNCy0FnYq9Sf8zrqWJM EPq0pQOkrteWZ2KPE3b4o00EyM2rG5fXcTKXqkEd0Ig96pNmRWZ9KA9oUtL3c22rgCNW KLmv+Z7ysRw8Xd9u87gXalPVADwEZNE01XPPjour8lbwlsWYEUi2zOg1+zNCpEGVvbp+ 97MMr7bweUhiGjGYvN1NnhDWRMJVAu0GGJ6YHwJ9/gZBDUQ/JsZd8WitqnivtVDoL1xI MeCA== 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=LQ57eYhV+4NmhOZrvCDoI18cEKYxHnDZEqAzqcJTJWw=; fh=9YDXP0Rf0yv/AwWPNsV02EolRzh1/Mdt9TUvb0lyfwE=; b=Ak791DxZ2Ju67uvOxog+wCVsCW66hSZhb76cbNGTuv1+Dp+ScouqRvv5SphjMtotCd 2u9ihNEh6WzScU2bydr0Osqu+UvK/0BZiEXGdx/M4tIVZk7iHLYOTA5qsAz8cvUDy0HF ht5009X7taNrtaWKqkD9KUaEQTo/mAu6pw1o+0lDGN4xwu9a2KfmqH0nPjvjTV+hQfte Cx4cEiWGU62LKLOxHRCEJCyt1ydI63ek0EGWgomsFTcb9wfshxspn4b4Vi9ztEhqXlEr vIDD1rIZMOHeivkw4fU52/3UjOpXDMoakSwu4NLY5cimH8wT2FocF6A3m5Q03j5+YOOt FwUw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A9OwHH+O; 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-7a19399040csi17618585a.489.2024.07.18.02.47.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jul 2024 02:47:06 -0700 (PDT) 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=A9OwHH+O; 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 1sUNho-00042z-9f; Thu, 18 Jul 2024 05:45:44 -0400 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 1sUNhm-0003uM-Gk for qemu-devel@nongnu.org; Thu, 18 Jul 2024 05:45:42 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sUNhg-0007fc-9Y for qemu-devel@nongnu.org; Thu, 18 Jul 2024 05:45:42 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a6fd513f18bso60828566b.3 for ; Thu, 18 Jul 2024 02:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721295935; x=1721900735; 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=LQ57eYhV+4NmhOZrvCDoI18cEKYxHnDZEqAzqcJTJWw=; b=A9OwHH+OVNAENWVCNcYlM9gWl6SLB51nXpJ4u8b9ebdGxdycL2RfZ6BFZzixZCBQHy ScId/NLb/d9mC9QbxooccQU+7Ht4HCe5MCz85fRyW1iafuLXTpkoY1NMoFrWCvfr178f R5V/6bfMa+SnZRXZItBe4L/OUijt6oF1Cj40BOWDV7BKFnu7HB94UFf88xE+jwnaMyPB GMAWoWRC4HMisj6RW3/WCl3h8GMmqSBigSr7+UNjAcMEZ1L5gJUkjJHbVqrWSzWFil3Q 7A1um8lCQcAP9sBG+Yt7ZYGUOeRpTLsGvPtXs6EKsBnCqfQkzbv07V/3WIPQYwbFd1bc G4fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721295935; x=1721900735; 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=LQ57eYhV+4NmhOZrvCDoI18cEKYxHnDZEqAzqcJTJWw=; b=Ti4q3TAL1FZmbj25uB1Iz3NDAEYqzzErG4JJTfcCcgAJcu/euUtX5QBvd3c9Hp3nEF hQdHirNyL7+Sy8Fkm7r7w2W4M7VF6rO51bgV7XwGgWT9WhkfIRZT0PKR2k14Y4g12heM LvSaOf+6Bkcs9fDcP/7f1zdRDWlvB1bD2PxcQa8FvuUm0aUzdD5wiqxKaNGL10Dc23wa kTYTc7uTCCOjnO8jUQeHzAsLhRw6PNWNSz3P8BSvVaxvV1iHy7ZBH+lThVd7VfhKcrRo rSSJ8HLQ5xpcuSgadPmCTyzDjOcBbOAMDlz3aUIUP0NZ8CCAerINOwBLHsVz4+Vm6fzv S4WA== X-Gm-Message-State: AOJu0YxmTKwR+pu4XII/QLbhyW1uxhZCYrI0DdBZY3ScoVSKVejwq8ua bQPjx2dHt1/urNn1/TEaVHvhZC7dxEyAw4PukI4KiExhqNFR+wF2Itsv9Mtcznz33PiGwpVwEDT U X-Received: by 2002:a17:907:b9ca:b0:a77:daa9:401 with SMTP id a640c23a62f3a-a7a0119df30mr259401266b.35.1721295934214; Thu, 18 Jul 2024 02:45:34 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a79bc5b4f87sm537915366b.48.2024.07.18.02.45.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 02:45:28 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id F1C575FA43; Thu, 18 Jul 2024 10:45:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Aurelien Jarno , Thomas Huth , Daniel Henrique Barboza , Alexandre Iooss , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , qemu-arm@nongnu.org, Bin Meng , qemu-riscv@nongnu.org, Aleksandar Rikalo , Pierrick Bouvier , Liu Zhiwei , Peter Maydell , Wainer dos Santos Moschetta , Palmer Dabbelt , Beraldo Leal , Li-Wen Hsu , Ed Maste , Richard Henderson , Weiwei Li , Alistair Francis , Max Filippov , Mahmoud Mandour , Paolo Bonzini , Laurent Vivier Subject: [PATCH 10/15] target/mips: Add semihosting stub Date: Thu, 18 Jul 2024 10:45:18 +0100 Message-Id: <20240718094523.1198645-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240718094523.1198645-1-alex.bennee@linaro.org> References: <20240718094523.1198645-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62e.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é Since the SEMIHOSTING feature is optional, we need a stub to link when it is disabled. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240717105723.58965-4-philmd@linaro.org> Signed-off-by: Alex Bennée --- target/mips/tcg/sysemu/semihosting-stub.c | 15 +++++++++++++++ target/mips/tcg/sysemu/meson.build | 6 ++++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 target/mips/tcg/sysemu/semihosting-stub.c diff --git a/target/mips/tcg/sysemu/semihosting-stub.c b/target/mips/tcg/sysemu/semihosting-stub.c new file mode 100644 index 0000000000..7ae27d746f --- /dev/null +++ b/target/mips/tcg/sysemu/semihosting-stub.c @@ -0,0 +1,15 @@ +/* + * MIPS semihosting stub + * + * SPDX-FileContributor: Philippe Mathieu-Daudé + * SPDX-FileCopyrightText: 2024 Linaro Ltd. + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "internal.h" + +void mips_semihosting(CPUMIPSState *env) +{ + g_assert_not_reached(); +} diff --git a/target/mips/tcg/sysemu/meson.build b/target/mips/tcg/sysemu/meson.build index ec665a4b1e..911341ac37 100644 --- a/target/mips/tcg/sysemu/meson.build +++ b/target/mips/tcg/sysemu/meson.build @@ -1,10 +1,12 @@ mips_system_ss.add(files( 'cp0_helper.c', - 'mips-semi.c', 'special_helper.c', 'tlb_helper.c', )) - +mips_system_ss.add(when: ['CONFIG_SEMIHOSTING'], + if_true: files('mips-semi.c'), + if_false: files('semihosting-stub.c') +) mips_system_ss.add(when: 'TARGET_MIPS64', if_true: files( 'lcsr_helper.c', ))