From patchwork Fri Apr 18 17:29:07 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: 882332 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp916859wrs; Fri, 18 Apr 2025 10:31:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVRIQvdjmutXvc7FPfiMA/8RlD0WgivbOkhvylJNEtsTgC5YvdiVCYNCclYZoUsCHsrRZ/31w==@linaro.org X-Google-Smtp-Source: AGHT+IHPM72eTvLv5WTdUZobBg/v7tL5GXGi6f10Z0Xx70P+TMahfTadWfqCX2MFP5F3gC0J4skc X-Received: by 2002:a05:6214:5007:b0:6e8:97d2:9999 with SMTP id 6a1803df08f44-6f2c4656825mr64871996d6.28.1744997480897; Fri, 18 Apr 2025 10:31:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744997480; cv=none; d=google.com; s=arc-20240605; b=At/HTeVU4Geg0cN3kgvVNeeaUTihyVE2Ezmi4pKRryP5dYQ7jLtHUUqGi6+bU8WobB RJVV00ldkeXlgNjI5nletLGto9qZfPu18SlsEp0Y0ocDqDipT5gBRRlWLX3WjMH7nolh jx4uKWRHPYdc4xqE2pl5/pP3UaKZjntlv2b1FE60C3if90SO4NnTOXevvNDXbv2O/Vvj aJgiS7GRYYDHrjkbVSfIjKP179Oi6m0Gx1+MHt7+pPZ7QkInXunoxBp9GydUwwlOOOCv i8hJZXkvJSwxdtshPWGpibu4/e6Vs81ila3rXzHCRIwAMPO46bUw1b4sh5JoUFuyVVCW hICA== 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=y6XCT/fOeWKDikZcuPLXArzjT7R3nNzglYyQ5bI5y+w=; fh=98FKcUbfHOMAWlQQi9/5y14VVYgcGa56vjU1mKYkvXI=; b=WOg5UbtZVhipGP/Us8prk5fPGZn2i9uKaZ6g6KcGz3zJ6ts6kvkWv6CMqhoK7dOLuO p+WJNzmzoY/O1TFlRZxbeDvY+AfVANcxE3BM31RQ5pCHuPrtWpajL3ZoszYT+vutCFGl IUVQ1m5I8GcdsdbzFfdQzvYdqdOV2GuhuxTOORkBKuKO9LDz19MlGBTpE2ufy/8j8QfI 8Khw3pk7Q1ZwIIzUQPyVITEzsJDmtFJcS+EN1z6M3ikDIfkrWECqTZAH0CKEnEzt3+V/ 7GQFq4oLkGOqol54x8tQ20vozUg474pFmtVkpmLpO0ufT+fv+p/USd9Kx8+/TfkFSN5N j38g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kcBt2vy8; 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 6a1803df08f44-6f2c2beb29bsi25544726d6.208.2025.04.18.10.31.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Apr 2025 10:31:20 -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=kcBt2vy8; 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 1u5pXw-0003JJ-24; Fri, 18 Apr 2025 13:30:37 -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 1u5pXb-0002o4-Il for qemu-devel@nongnu.org; Fri, 18 Apr 2025 13:30:17 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u5pXZ-00009f-MI for qemu-devel@nongnu.org; Fri, 18 Apr 2025 13:30:15 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43d0359b1fcso13862595e9.0 for ; Fri, 18 Apr 2025 10:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744997411; x=1745602211; 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=y6XCT/fOeWKDikZcuPLXArzjT7R3nNzglYyQ5bI5y+w=; b=kcBt2vy8cgIYWrHKIuvror8Ufzn62QFAI+sr64PvA3PpfFXOOsZw5VZoWK1m3FvHn3 dHn6bHbP3HlsllKZi8nsXyhTcdk3dmXSKHcmqFLaYGIlcjyljHbs1jkg7U9ldKsLtE/z mKI2oQMvokqLAIR/pIw5ekUwScsoN4tkUgYdZxGk1tIuZKoHMEMHrsSZCx+MfLm0CUzS mXpRg8CYJZ+6PRpZJNS+lWouyv7FqAgLlRWpvdSSD6xt2aqtnrUDMU8ZT9JcznSW648c 6i7WuGosC+jbQsEdEtew6Z2/zoJOhEuVC7lUd1FEovYSBJvVxL6ynfjr2vHrG2NzRxEN nMeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744997411; x=1745602211; 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=y6XCT/fOeWKDikZcuPLXArzjT7R3nNzglYyQ5bI5y+w=; b=QYReH71On7hB42teUzb/JESGXy9Ij2/KESwKuz4m3kEKmK+8l/XQ+ok71Mftgn1E8e 6QCmLZ8JF8pw0lkm/Bo4aQwL8Slqh5ufKiY+5MgzAP8bRF6r0RpysPpXIt5WzCravYi/ dKrgFMVj3vHL70fJebtpe+La/il7qyxeog5u31cCTlFW3RnlHLxc5fnqYXV//UIJLtRN Xl6FcsaEAOiHmNR5rQJ3IYClcvYa5Zfdr6Gf2O04Xya5MKNe8FcOCKS1oaxxEk3rcxx1 2rzWL1J+eVqlYAaIxiasTg1+SEn7oelHtV4J4KlcMuu5JRAApACx0qitz89pGRuyqtX2 1/zw== X-Gm-Message-State: AOJu0YywDTeJPZaFDkKdQK7v33w9h5hecX7P4aUc3bW7JW93kUFd9UZY IkQevV646kmQd2Gs0v8tT2zLG5XKGtFdafkWuwysbZz6iNKp1xzHBtfxK6EWfExZL6a0tjaV3wB T X-Gm-Gg: ASbGncvlJeeUX+f25k84TvLB4eZF8QO+m2x93VQhdvZ0MqLmF4D1CJcg/5rg1R0GCaP 32vyT+/HlljFnCBY52i05gbYszhaIHhgNFFyiBYL/7K8qeYVmi6RQgt5NKYyo2ldIRc3Nwp80dv iQ+RuKdMeBW+I7cEV/1ddndr0HMaZ6+OzxwwkEPSCTe847AuXREB2hbCgS6DEF1xuBmQWrqX2yM swAvDJBA+HrdAHW9sJ9D29acaTbp+PuZIcCkTIUi9PKOB+gSM695p2HsSmaQzIBRfcg2Ba1q2Vf JDvVHfqnAX6knyMyHfOlpcynaqRgMgZGRBZRv9dlsRirgE+y3Vpf64BzdDIkv3OSUnfIdU6+ijn 8KZKgEIiE4doG4Eo= X-Received: by 2002:a7b:cbd3:0:b0:43c:ed33:a500 with SMTP id 5b1f17b1804b1-4406979083fmr31133905e9.10.1744997411558; Fri, 18 Apr 2025 10:30:11 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39efa43d22esm3374615f8f.52.2025.04.18.10.30.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 18 Apr 2025 10:30:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Pierrick Bouvier Cc: Richard Henderson , Anton Johansson Subject: [RFC PATCH v3 13/14] qemu/target_info: Add target_aarch64() helper Date: Fri, 18 Apr 2025 19:29:07 +0200 Message-ID: <20250418172908.25147-14-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250418172908.25147-1-philmd@linaro.org> References: <20250418172908.25147-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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 Add a helper to distinct the binary is targetting Aarch64 or not. Start with a dump strcmp() implementation, leaving room for future optimizations. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/target_info.h | 7 +++++++ target_info.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/include/qemu/target_info.h b/include/qemu/target_info.h index c67b97d66f3..9b7575ce632 100644 --- a/include/qemu/target_info.h +++ b/include/qemu/target_info.h @@ -24,4 +24,11 @@ const char *target_name(void); */ const char *target_machine_typename(void); +/** + * target_aarch64: + * + * Returns whether the target architecture is Aarch64. + */ +bool target_aarch64(void); + #endif diff --git a/target_info.c b/target_info.c index 1de4334ecc5..87dd1d51778 100644 --- a/target_info.c +++ b/target_info.c @@ -19,3 +19,8 @@ const char *target_machine_typename(void) { return target_info()->machine_typename; } + +bool target_aarch64(void) +{ + return !strcmp(target_name(), "aarch64"); +}