]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
info: Print CPUINFO for SPARCv9 processors
authornia <nia@NetBSD.org>
Mon, 10 Nov 2025 22:36:18 +0000 (23:36 +0100)
committerTomas Mraz <tomas@openssl.org>
Thu, 13 Nov 2025 11:16:32 +0000 (12:16 +0100)
Signed-off-by: Nia Alarie <nia@NetBSD.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29116)

crypto/info.c

index 7a256a7de640c38611443566408e6115b70b124b..272512707709f61dca88d629f9d8547986bc7f9b 100644 (file)
@@ -26,6 +26,9 @@
 #elif defined(__powerpc__) || defined(__POWERPC__) || defined(_ARCH_PPC)
 # include "crypto/ppc_arch.h"
 # define CPU_INFO_STR_LEN 128
+#elif defined(__sparcv9) || defined(__sparcv9__)
+# include "crypto/sparc_arch.h"
+# define CPU_INFO_STR_LEN 128
 #elif defined(__s390__) || defined(__s390x__)
 # include "s390x_arch.h"
 # define CPU_INFO_STR_LEN 2048
@@ -89,6 +92,16 @@ DEFINE_RUN_ONCE_STATIC(init_info_strings)
         BIO_snprintf(ossl_cpu_info_str + strlen(ossl_cpu_info_str),
                      sizeof(ossl_cpu_info_str) - strlen(ossl_cpu_info_str),
                      " env:%s", env);
+# elif defined(__sparcv9) || defined(__sparcv9__)
+    const char *env;
+
+    BIO_snprintf(ossl_cpu_info_str, sizeof(ossl_cpu_info_str),
+                 CPUINFO_PREFIX "OPENSSL_sparcv9cap=0x%x:0x%x",
+                 OPENSSL_sparcv9cap_P[0], OPENSSL_sparcv9cap_P[1]);
+    if ((env = getenv("OPENSSL_sparcv9cap")) != NULL)
+        BIO_snprintf(ossl_cpu_info_str + strlen(ossl_cpu_info_str),
+                     sizeof(ossl_cpu_info_str) - strlen(ossl_cpu_info_str),
+                     " env:%s", env);
 # elif defined(__s390__) || defined(__s390x__)
     const char *env;