From: Julien Desfossez Date: Wed, 1 Oct 2014 15:05:08 +0000 (-0400) Subject: Introduce macros to check Ubuntu kernel version X-Git-Tag: v2.6.0-rc1~15 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3e5941df26200eccb6319ab765d53d00661e7c84;p=lttng-modules.git Introduce macros to check Ubuntu kernel version Signed-off-by: Julien Desfossez Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-kernel-version.h b/lttng-kernel-version.h index 0eb56b38..8fad8b09 100644 --- a/lttng-kernel-version.h +++ b/lttng-kernel-version.h @@ -24,6 +24,7 @@ */ #include +#include /* * This macro checks if the kernel version is between the two specified @@ -33,4 +34,18 @@ (LINUX_VERSION_CODE >= KERNEL_VERSION(a_low, b_low, c_low) && \ LINUX_VERSION_CODE < KERNEL_VERSION(a_high, b_high, c_high)) +#define LTTNG_UBUNTU_KERNEL_VERSION(a, b, c, d) \ + (((a) << 24) + ((b) << 16) + (c << 8) + (d)) + +#define LTTNG_UBUNTU_VERSION_CODE \ + ((LINUX_VERSION_CODE << 8) + UTS_UBUNTU_RELEASE_ABI) + +#define LTTNG_UBUNTU_KERNEL_RANGE(a_low, b_low, c_low, d_low, \ + a_high, b_high, c_high, d_high) \ + (defined(UTS_UBUNTU_RELEASE_ABI) && \ + LTTNG_UBUNTU_VERSION_CODE >= \ + LTTNG_UBUNTU_KERNEL_VERSION(a_low, b_low, c_low, d_low) && \ + LTTNG_UBUNTU_VERSION_CODE < \ + LTTNG_UBUNTU_KERNEL_VERSION(a_high, b_high, c_high, d_high)) + #endif /* _LTTNG_KERNEL_VERSION_H */