summaryrefslogtreecommitdiffstats
path: root/src/arch/ppc.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/arch/ppc.c
parentInitial commit. (diff)
downloadceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz
ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/arch/ppc.c')
-rw-r--r--src/arch/ppc.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/arch/ppc.c b/src/arch/ppc.c
new file mode 100644
index 00000000..11d3a499
--- /dev/null
+++ b/src/arch/ppc.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 2017 International Business Machines Corp.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#include "arch/ppc.h"
+#include "arch/probe.h"
+
+/* flags we export */
+int ceph_arch_ppc_crc32 = 0;
+
+#include <stdio.h>
+
+#ifdef HAVE_PPC64LE
+#include <sys/auxv.h>
+#include <asm/cputable.h>
+#endif /* HAVE_PPC64LE */
+
+#ifndef PPC_FEATURE2_VEC_CRYPTO
+#define PPC_FEATURE2_VEC_CRYPTO 0x02000000
+#endif
+
+#ifndef AT_HWCAP2
+#define AT_HWCAP2 26
+#endif
+
+int ceph_arch_ppc_probe(void)
+{
+ ceph_arch_ppc_crc32 = 0;
+
+#ifdef HAVE_PPC64LE
+ if (getauxval(AT_HWCAP2) & PPC_FEATURE2_VEC_CRYPTO) ceph_arch_ppc_crc32 = 1;
+#endif /* HAVE_PPC64LE */
+
+ return 0;
+}
+