summaryrefslogtreecommitdiffstats
path: root/src/arch/ppc.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/arch/ppc.c
parentInitial commit. (diff)
downloadceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz
ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip
Adding upstream version 18.2.2.upstream/18.2.2
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 000000000..11d3a4991
--- /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;
+}
+