From e6918187568dbd01842d8d1d2c808ce16a894239 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 13:54:28 +0200 Subject: Adding upstream version 18.2.2. Signed-off-by: Daniel Baumann --- src/arch/ppc.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/arch/ppc.c (limited to 'src/arch/ppc.c') 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 + +#ifdef HAVE_PPC64LE +#include +#include +#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; +} + -- cgit v1.2.3