X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=lttng-kernel-version.h;fp=lttng-kernel-version.h;h=280a398a93e370db16f95b416802fb0ef0946213;hb=5fa38800d965d5fa35a2c0c9a93e330711ec87e0;hp=0000000000000000000000000000000000000000;hpb=d3ac4d63d21c643df5b09d9d7888eb0c4122379c;p=lttng-modules.git diff --git a/lttng-kernel-version.h b/lttng-kernel-version.h new file mode 100644 index 00000000..280a398a --- /dev/null +++ b/lttng-kernel-version.h @@ -0,0 +1,36 @@ +#ifndef _LTTNG_KERNEL_VERSION_H +#define _LTTNG_KERNEL_VERSION_H + +/* + * lttng-kernel-version.h + * + * Contains helpers to check more complex kernel version conditions. + * + * Copyright (C) 2012 Mathieu Desnoyers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; only + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +/* + * This macro checks if the kernel version is between the two specified + * versions (inclusive). + */ +#define LTTNG_KERNEL_RANGE(a_low, b_low, c_low, a_high, b_high, c_high) \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(a_low, b_low, c_low) && \ + LINUX_VERSION_CODE <= KERNEL_VERSION(a_high, b_high, c_high)) + +#endif /* _LTTNG_KERNEL_VERSION_H */