${CMAKE_BINARY_DIR}/src/include/ceph_ver.h
@ONLY)
-set(arch_files
- arch/arm.c
- arch/intel.c
- arch/ppc.c
- arch/probe.cc)
-
set(auth_files
auth/AuthAuthorizeHandler.cc
auth/AuthClientHandler.cc
common/fs_types.cc
common/dns_resolve.cc
common/hostname.cc
- ${arch_files}
+ arch/probe.cc
${auth_files}
${mds_files})
+if(HAVE_ARM)
+ list(APPEND libcommon_files arch/arm.c)
+elseif(HAVE_INTEL)
+ list(APPEND libcommon_files arch/intel.c)
+elseif(HAVE_POWER8)
+ list(APPEND libcommon_files arch/ppc.c)
+endif()
if(LINUX)
list(APPEND libcommon_files msg/async/EventEpoll.cc)
message(STATUS " Using EventEpoll for events.")
{
if (ceph_arch_probed)
return 1;
-
+#if defined(__i386__) || defined(__x86_64__)
ceph_arch_intel_probe();
+#elif defined(__arm__) || defined(__aarch64__)
ceph_arch_arm_probe();
+#elif defined(__powerpc__) || defined(__ppc__)
ceph_arch_ppc_probe();
-
+#endif
ceph_arch_probed = 1;
return 1;
}
// if the CPU supports it, *and* the fast version is compiled in,
// use that.
+#if defined(__i386__) || defined(__x86_64__)
if (ceph_arch_intel_sse42 && ceph_crc32c_intel_fast_exists()) {
return ceph_crc32c_intel_fast;
}
-
+#elif defined(__arm__) || defined(__aarch64__)
if (ceph_arch_aarch64_crc32){
return ceph_crc32c_aarch64;
}
-
+#elif defined(__powerpc__) || defined(__ppc__)
if (ceph_arch_ppc_crc32) {
return ceph_crc32c_ppc;
}
-
+#endif
// default
return ceph_crc32c_sctp;
}
int factory(CompressorRef *cs,
std::ostream *ss) override
{
+#if defined(__i386__) || defined(__x86_64__)
bool isal;
if (cct->_conf->compressor_zlib_isal) {
ceph_arch_probe();
compressor = std::make_shared<ZlibCompressor>(isal);
has_isal = isal;
}
+#endif
*cs = compressor;
return 0;
}
std::cout << "intel baseline = " << rate << " MB/sec" << std::endl;
ASSERT_EQ(261108528u, val);
}
+#if defined(__arm__) || defined(__aarch64__)
if (ceph_arch_aarch64_crc32) // Skip if CRC32C instructions are not defined.
{
utime_t start = ceph_clock_now();
std::cout << "aarch64 = " << rate << " MB/sec" << std::endl;
ASSERT_EQ(261108528u, val);
}
-
+#endif
}