From patchwork Tue Mar 7 17:04:04 2023 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: 659750 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2497782wrb; Tue, 7 Mar 2023 09:04:39 -0800 (PST) X-Google-Smtp-Source: AK7set/V2oKxW0E6JQglr8wBIkCupgIUs/IBlFxnFVWw5m1+vxw06D4YGrvlsG4d9+und+o2c3Zr X-Received: by 2002:a1f:fe8d:0:b0:3d5:d2a3:f63 with SMTP id l135-20020a1ffe8d000000b003d5d2a30f63mr7331241vki.1.1678208679404; Tue, 07 Mar 2023 09:04:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678208679; cv=none; d=google.com; s=arc-20160816; b=LnObLBny0QXnj/+iSrZsr4K0cz5DwY0RrCrUjrZ84gd4juYCRFviKSd7uDPgoWzG/r We60fFVC64UOHi1Zg+MirKWyAjU07ZjETn3rMcSpUMhfXXJ93wn5kvTcvv/JHPi1/dnu 2iAytpHpBy6o9fcMbSo1ygrOyqrndxzvAYdphwRNAuuncIKRd5rbm36yzI19yVutWlDX FZ9R1+L2sAy/FNIFCsPVlyjyB5V3mXXgG4PiKi0cfFdFflWD9Vw7RivG/6dR62Q9zIzm RLihcAbe+t+bkil6QYkWU+LQFeVVJrgpLm0GKoJlHELHiXPhY0h8DfDZk7BXotwcbDlU 1zTA== 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=xBM/DjzpI+y3ZjCT4Wal/gzOcTCGOW/UQZGqC6Mn2C8=; b=WUEubhMElg9C+Wh9aRgcKYs4d0EL3jDSFZzAejjbyMWEUPGlVPXFew/EbBlng5RBZR kVrinsyv+zLFgTrpm476SbItBHNqOmaOYmFUxSPoourdH5LX5wZFozNrGAdCkySIQ30r 7EcgRldnAmI/HG5URZiGRqcQZh7FUnTERmuBEbNzpQHXNrT8ceJmXdn8HkRB+iVPz/fT wlEI9z4IVBl+1coI1Hzgvh0WtAe7FnkxNYFYFl0HQcPseudXa6FMKtmAkVV+P9qFUdxZ KINGrRN1MPmh9poWH6EA4smZOwrfpu1CnH209CpEbVkWl/34K3ZK/tDPufSVJAmfN+zp cdrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rRvwqqWf; 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 j142-20020a1fa094000000b004018aec40eesi3911891vke.218.2023.03.07.09.04.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 09:04:39 -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=rRvwqqWf; 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 1pZaji-00068t-43; Tue, 07 Mar 2023 12:04:27 -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 1pZajW-0005yE-Nq for qemu-devel@nongnu.org; Tue, 07 Mar 2023 12:04:16 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZajU-0003q7-G8 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 12:04:14 -0500 Received: by mail-wm1-x333.google.com with SMTP id t25-20020a1c7719000000b003eb052cc5ccso10866750wmi.4 for ; Tue, 07 Mar 2023 09:04:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678208650; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=xBM/DjzpI+y3ZjCT4Wal/gzOcTCGOW/UQZGqC6Mn2C8=; b=rRvwqqWf2haTfVB4M3EkK71yJUDBo8ztmXWSIkBnTUnpIJ3JDsp9V7bRaMSmaLnH7d vU0H0Hk538txuFjTe7lfebeqzSmSFTBXS2a6IfgHBsNuwMAzwkfHzPr7PDSyoZXYPVZM 1D+HuejSWogVw8RSdMve1J73jIBp2D7cFUlSzXjij0/PIez6BtaBlfHHK8akMGK3Gcoj 9j5BMVdF7zVfaqMAZFL3nC+YnWWMnSZBkMdTjLS3odLvxjD49XmX4sijD8K8NCWXm1Hf 3HHcyduJD9wJOXWg0uCCmMmxIsOWlU6unWJ5PIl+N48l4CMfISyOQOWtBvLYCxMmgtX2 35LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678208650; 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=xBM/DjzpI+y3ZjCT4Wal/gzOcTCGOW/UQZGqC6Mn2C8=; b=TTS+OeftiU8ZYCORxUqHR2b/B9UMaFAStJRBWjSdTUK2RFE20w3iOFMpGwrIoNxp9Q yHEB34/SwtBCRQ1HTtnD154fnEybI+Q2QpGNILQk67b2K6uQbGkafYDRBA1l1rCMVqiZ Oe/JvXw8GrHGN9AwgYcK8OLcvKGTJkqQlZbKkekJO+vsF95E7rGn+iPLU+7JUJNCJkov t+4JOHtxiCtwk9ANwI24BN1D3/W+lHI+Q0Qli6EDjYIlv+nahtbVl7Sh95ZXxknFUqHn 086xB3A3A+DkCjoUZ6NQtWuqzLdmK9bTBimimIhEbavSWAMjiXh0Wbs6lnsyhbxwXxTj qJCw== X-Gm-Message-State: AO0yUKUOV9eboMUBboiLILLd7G4vEVViKy6x9zGeol/XQpSbC2sGy75z oaWt6lLH3pKmFXm9GYSIPkonbA== X-Received: by 2002:a05:600c:4750:b0:3eb:395b:8b62 with SMTP id w16-20020a05600c475000b003eb395b8b62mr13830762wmo.39.1678208649811; Tue, 07 Mar 2023 09:04:09 -0800 (PST) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id k21-20020a7bc415000000b003e206cc7237sm17342505wmi.24.2023.03.07.09.04.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 09:04:09 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0C2781FFB7; Tue, 7 Mar 2023 17:04:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini Subject: [RFC PATCH] stubs: split semihosting_get_target from system only stubs Date: Tue, 7 Mar 2023 17:04:04 +0000 Message-Id: <20230307170405.796822-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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, DIET_1=0.001, 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 As we are about to have a common syscalls.c for gdbstub we need to stub out one semihosting helper function for all targets. Signed-off-by: Alex Bennée Cc: Richard Henderson Reviewed-by: Richard Henderson --- stubs/semihost-all.c | 17 +++++++++++++++++ stubs/semihost.c | 5 ----- stubs/meson.build | 1 + 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 stubs/semihost-all.c diff --git a/stubs/semihost-all.c b/stubs/semihost-all.c new file mode 100644 index 0000000000..a2a1fc9c6f --- /dev/null +++ b/stubs/semihost-all.c @@ -0,0 +1,17 @@ +/* + * Semihosting Stubs for all targets + * + * Copyright (c) 2023 Linaro Ltd + * + * Stubs for all targets that don't actually do semihosting. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "semihosting/semihost.h" + +SemihostingTarget semihosting_get_target(void) +{ + return SEMIHOSTING_TARGET_AUTO; +} diff --git a/stubs/semihost.c b/stubs/semihost.c index d65c9fd5dc..aad7a70353 100644 --- a/stubs/semihost.c +++ b/stubs/semihost.c @@ -28,11 +28,6 @@ bool semihosting_enabled(bool is_user) return false; } -SemihostingTarget semihosting_get_target(void) -{ - return SEMIHOSTING_TARGET_AUTO; -} - /* * All the rest are empty subs. We could g_assert_not_reached() but * that adds extra weight to the final binary. Waste not want not. diff --git a/stubs/meson.build b/stubs/meson.build index 7657467a5d..b2b5956d97 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -61,4 +61,5 @@ if have_system else stub_ss.add(files('qdev.c')) endif +stub_ss.add(files('semihost-all.c')) stub_ss.add(when: 'CONFIG_VFIO_USER_SERVER', if_false: files('vfio-user-obj.c'))