ccflags-y += -DSLE_API_VERSION=$(SLE_API_VERSION)
endif
+FEDORA_REVISION_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/abi-fedora-version.sh $(CURDIR))
+
+ifneq ($(FEDORA_REVISION_VERSION), 0)
+ ccflags-y += -DFEDORA_REVISION_VERSION=$(FEDORA_REVISION_VERSION)
+endif
+
RT_PATCH_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/rt-patch-version.sh $(CURDIR))
ifneq ($(RT_PATCH_VERSION), 0)
--- /dev/null
+#!/bin/sh
+
+# First argument is the path to the kernel headers.
+KPATH="$1"
+
+if [ ! -f "${KPATH}/include/generated/utsrelease.h" ]; then
+ echo 0
+ exit 0
+fi
+
+# Assuming KPATH is the target kernel headers directory
+UTS_RELEASE=$(sed -rn 's/^#define UTS_RELEASE "(.*)"/\1/p' "${KPATH}/include/generated/utsrelease.h")
+FEDORA_VERSION=$(echo "${UTS_RELEASE}" | sed -n 's/.*\.fc\([0-9]*\)\..*/\1/p')
+
+if [ "x${FEDORA_VERSION}" = "x" ]; then
+ echo 0
+ exit 0
+fi
+
+FEDORA_REVISION_VERSION=$(echo "${UTS_RELEASE}" | sed -n 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\-\([0-9]*\).*/\4/p')
+echo "${FEDORA_REVISION_VERSION}"
LTTNG_SLE_VERSION_CODE < \
LTTNG_SLE_KERNEL_VERSION(a_high, b_high, c_high, d_high, e_high, f_high))
+/* Fedora */
+
+#define LTTNG_FEDORA_KERNEL_VERSION(a, b, c, d) \
+ (((((a) << 16) + ((b) << 8) + (c)) * 10000ULL) + (d))
+
+#ifdef FEDORA_REVISION_VERSION
+#define LTTNG_FEDORA_VERSION_CODE \
+ ((LINUX_VERSION_CODE * 10000ULL) + FEDORA_REVISION_VERSION)
+#else
+#define LTTNG_FEDORA_VERSION_CODE 0
+#endif
+
+#define LTTNG_FEDORA_KERNEL_RANGE(a_low, b_low, c_low, d_low, \
+ a_high, b_high, c_high, d_high) \
+ (LTTNG_FEDORA_VERSION_CODE >= \
+ LTTNG_FEDORA_KERNEL_VERSION(a_low, b_low, c_low, d_low) && \
+ LTTNG_FEDORA_VERSION_CODE < \
+ LTTNG_FEDORA_KERNEL_VERSION(a_high, b_high, c_high, d_high))
+
/* RT patch */
#define LTTNG_RT_KERNEL_VERSION(a, b, c, d) \