From 5791b8a58882aab8685453d7aec4cfed0cb80231 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Sat, 13 Sep 2025 12:45:00 +0200 Subject: [PATCH] Print PowerPC CPUINFO Reviewed-by: Richard Levitte Reviewed-by: Paul Dale Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/28535) (cherry picked from commit 03a9584499589f14363de758fdfb887cbef84790) --- crypto/info.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crypto/info.c b/crypto/info.c index ad31c9ec31f..8ecd3e03303 100644 --- a/crypto/info.c +++ b/crypto/info.c @@ -23,6 +23,9 @@ #if defined(__arm__) || defined(__arm) || defined(__aarch64__) # include "arm_arch.h" # define CPU_INFO_STR_LEN 128 +#elif defined(__powerpc__) || defined(__POWERPC__) || defined(_ARCH_PPC) +# include "crypto/ppc_arch.h" +# define CPU_INFO_STR_LEN 128 #elif defined(__s390__) || defined(__s390x__) # include "s390x_arch.h" # define CPU_INFO_STR_LEN 2048 @@ -70,6 +73,15 @@ 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(__powerpc__) || defined(__POWERPC__) || defined(_ARCH_PPC) + const char *env; + + BIO_snprintf(ossl_cpu_info_str, sizeof(ossl_cpu_info_str), + CPUINFO_PREFIX "OPENSSL_ppccap=0x%x", OPENSSL_ppccap_P); + if ((env = getenv("OPENSSL_ppccap")) != 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; -- 2.47.3