From nobody Sun Nov 24 23:58:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1720028635; cv=none; d=zohomail.com; s=zohoarc; b=FsGaKgppwpInmfmlqTY21J3CoOq1frAceL5V/AU7tv/mAfxYuwB6sS7L6TIXYaRJSLvSf7XC7xThRha69olBBg4Bg4a7JtbLMFyTvYM0EZUNOKwW2zMNfQXvqk/clhMg1315otWQZP0oaTJOOFqUXvyXgO08e8MUjjjl8y2FLu0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720028635; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EnxIQkGUi2BYtKcUGzQDYlf64W/Zr3vE/ZFzoUY3DEc=; b=cA2NZQWI6XzoiiiJ7aOX2F2/P8Ka4q8Rd2drXv0dV2I5vSKaGEHEh2MZOkoNxqWSK0DfLxLym8Tr2irWRYkaEIk2EDH1rag1Sw5dHqQ17s427OV4QaLKg+QDxwdhdJd9YzaIKPYB7KZ+uMSaFPuwgJXql4v/Zs1MdyAr+6WQUS4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720028635350141.90169608858014; Wed, 3 Jul 2024 10:43:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sP40E-0003KN-Hf; Wed, 03 Jul 2024 13:42:46 -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 1sP406-0003IC-4n for qemu-devel@nongnu.org; Wed, 03 Jul 2024 13:42:38 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sP3zz-0005L6-7d for qemu-devel@nongnu.org; Wed, 03 Jul 2024 13:42:36 -0400 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-2c8e422c40cso3443709a91.2 for ; Wed, 03 Jul 2024 10:42:30 -0700 (PDT) Received: from stoup.. (174-21-76-141.tukw.qwest.net. [174.21.76.141]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c91d3e7d7bsm11070030a91.47.2024.07.03.10.42.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 10:42:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720028549; x=1720633349; 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=EnxIQkGUi2BYtKcUGzQDYlf64W/Zr3vE/ZFzoUY3DEc=; b=Hl9tSlaR+CSvJsvwE/cB1RTj535JwahLHOIua4/xUHMkQnI3jZyyZuP7IstoDQbPNQ cnoCbcNYOQwYEVKiQHvfMi7ayfwrvPJhKdjYKJGAWTtSPE1C/K6Mr55g5tHm82Lj1La8 8U2m2vrQHeQWnBoh45Gh6xY0wdwpLoI6tmWMPYOyi8N0EL8lbOoOSzqy15r+Tc2tbn7x 7W7UPapvVwNRVZ4D10AXgTv9aMoZsa3gA5h0MRNc4Dm/jguDa0vo4MJpUOsaIvfob9RN KkHQeIY9XVD+mZ5Xpbz0g1Ax9SFD4v0RYMQ6WZ+C4a35oDCWZUAAvx/R0igQIepz6027 VMCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720028549; x=1720633349; 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=EnxIQkGUi2BYtKcUGzQDYlf64W/Zr3vE/ZFzoUY3DEc=; b=KTb+KWvqphYIytSaFaRXe3KMPjAqaQG0fcIcXF6QIXt9iZR/GRmvAvOjoIFexuvgjz 3k+4n0UKl9dHXGS/j4xYrx+ha/oHvEMLCE5PYVfzpazl7RoMTk4kGQOD17MYfL+lqqod +aDYUMwFhETwFFB9hzcd95/FEDB4yd6zjtACA4V+C1BewAOsUjiO5eOXTisJVE7J+zd/ xcTPwb9ikebEveH+wXACEiOl7u37PcY8aTaTx8X7znFlccQdiWKeAweTmUJqSOJvXwDb YdTBEpUGtgKeRpj5cYu8eCD4+20FquzyHbkO12Bo64q8yN1/1mOPFQYlec2280aFHa2I JjnQ== X-Gm-Message-State: AOJu0Yyq8QFguweQU4eE0U4f+/tbS18jhW0Vv/xr+YcWHouap4Gbp0d9 CnILIG8VVUUIHiFWcz3X3oaq2mmvzkqfp0/U2oVLlsKbEWofsgCmzwhYP/0ctt+5jDBdnbKjCZ1 H X-Google-Smtp-Source: AGHT+IFBQUKQglZl9IfJW3f2KwwqeOQtops/qhoSKf+KR1PSz2x5h4Gdkg9I4sw4BYCRpOc1+UWgaA== X-Received: by 2002:a17:90b:4f8f:b0:2c8:7330:68b3 with SMTP id 98e67ed59e1d1-2c93d767f2bmr8007980a91.39.1720028548809; Wed, 03 Jul 2024 10:42:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Brad Smith Subject: [PULL 1/7] util/cpuinfo-ppc: Fix building on OpenBSD Date: Wed, 3 Jul 2024 10:42:20 -0700 Message-Id: <20240703174226.2117169-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240703174226.2117169-1-richard.henderson@linaro.org> References: <20240703174226.2117169-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1720028637322100006 Content-Type: text/plain; charset="utf-8" From: Brad Smith OpenBSD does not support AT_HWCAP. Signed-off-by: Brad Smith Message-Id: Signed-off-by: Richard Henderson --- util/cpuinfo-ppc.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/util/cpuinfo-ppc.c b/util/cpuinfo-ppc.c index b2d8893a06..47af55aa0c 100644 --- a/util/cpuinfo-ppc.c +++ b/util/cpuinfo-ppc.c @@ -6,11 +6,13 @@ #include "qemu/osdep.h" #include "host/cpuinfo.h" =20 -#include -#ifdef CONFIG_GETAUXVAL -# include -#else -# include "elf.h" +#ifdef CONFIG_LINUX +# include +# ifdef CONFIG_GETAUXVAL +# include +# else +# include "elf.h" +# endif #endif =20 unsigned cpuinfo; @@ -19,16 +21,17 @@ unsigned cpuinfo; unsigned __attribute__((constructor)) cpuinfo_init(void) { unsigned info =3D cpuinfo; - unsigned long hwcap, hwcap2; =20 if (info) { return info; } =20 - hwcap =3D qemu_getauxval(AT_HWCAP); - hwcap2 =3D qemu_getauxval(AT_HWCAP2); info =3D CPUINFO_ALWAYS; =20 +#ifdef CONFIG_LINUX + unsigned long hwcap =3D qemu_getauxval(AT_HWCAP); + unsigned long hwcap2 =3D qemu_getauxval(AT_HWCAP2); + /* Version numbers are monotonic, and so imply all lower versions. */ if (hwcap2 & PPC_FEATURE2_ARCH_3_1) { info |=3D CPUINFO_V3_1 | CPUINFO_V3_0 | CPUINFO_V2_07 | CPUINFO_V2= _06; @@ -58,6 +61,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(void) } } } +#endif =20 cpuinfo =3D info; return info; --=20 2.34.1