Skip to content

Commit

Permalink
add ppm_version.h to patch
Browse files Browse the repository at this point in the history
  • Loading branch information
robbycochran committed Sep 25, 2019
1 parent 1232f3e commit bd85cad
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,27 @@ index 70a05e1..405ce66 100644
}

void task_cputime(struct task_struct *t, cputime_t *utime, cputime_t *stime)
diff --git a/ppm_version.h b/ppm_version.h
new file mode 100644
index 0000000..4c7c400
--- /dev/null
+++ b/ppm_version.h
@@ -0,0 +1,18 @@
+#include <linux/version.h>
+
+/**
+ * for RHEL kernels, export the release code (which is equal to e.g.
+ * RHEL_RELEASE_CODE(8, 1)) under our own name.
+ * For other kernels, just use zeros.
+ *
+ * We need macros that are always defined to use in preprocessor directives
+ * to express the required kernel version in a single expression, without
+ * a multiline #ifdef soup.
+ */
+#ifdef RHEL_RELEASE_CODE
+#define PPM_RHEL_RELEASE_CODE RHEL_RELEASE_CODE
+#define PPM_RHEL_RELEASE_VERSION(x,y) RHEL_RELEASE_VERSION(x,y)
+#else
+#define PPM_RHEL_RELEASE_CODE 0
+#define PPM_RHEL_RELEASE_VERSION(x,y) 0
+#endif

0 comments on commit bd85cad

Please sign in to comment.