From 500ce16976824f93048fc82f9ad0eec8c926798e Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Fri, 3 Feb 2023 07:38:15 +0000 Subject: [PATCH] util add crc_internal.h The preprocessor code will be needed in another crc-related .c file in an upcoming patch. Signed-off-by: Jim Harris Change-Id: Icc5e6f0d81f76093dfc973a9c1fe56271baf1ed8 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16687 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Tomasz Zawadzki --- lib/util/crc32c.c | 12 +----------- lib/util/crc_internal.h | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 lib/util/crc_internal.h diff --git a/lib/util/crc32c.c b/lib/util/crc32c.c index 69e99be53..7b49498de 100644 --- a/lib/util/crc32c.c +++ b/lib/util/crc32c.c @@ -4,19 +4,9 @@ */ #include "util_internal.h" +#include "crc_internal.h" #include "spdk/crc32.h" -#ifdef SPDK_CONFIG_ISAL -#define SPDK_HAVE_ISAL -#include -#elif defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) -#define SPDK_HAVE_ARM_CRC -#include -#elif defined(__x86_64__) && defined(__SSE4_2__) -#define SPDK_HAVE_SSE4_2 -#include -#endif - #ifdef SPDK_HAVE_ISAL uint32_t diff --git a/lib/util/crc_internal.h b/lib/util/crc_internal.h new file mode 100644 index 000000000..b432d0d7b --- /dev/null +++ b/lib/util/crc_internal.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (C) 2023 Intel Corporation. + * All rights reserved. + */ + +#ifndef SPDK_CRC_INTERNAL_H +#define SPDK_CRC_INTERNAL_H + +#include "spdk/config.h" + +#ifdef SPDK_CONFIG_ISAL +#define SPDK_HAVE_ISAL +#include +#elif defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) +#define SPDK_HAVE_ARM_CRC +#include +#elif defined(__x86_64__) && defined(__SSE4_2__) +#define SPDK_HAVE_SSE4_2 +#include +#endif + +#endif /* SPDK_CRC_INTERNAL_H */