summaryrefslogtreecommitdiff
path: root/Structures-and-macros-use-the-default-definition-of-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Structures-and-macros-use-the-default-definition-of-.patch')
-rw-r--r--Structures-and-macros-use-the-default-definition-of-.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/Structures-and-macros-use-the-default-definition-of-.patch b/Structures-and-macros-use-the-default-definition-of-.patch
new file mode 100644
index 0000000..962dc9d
--- /dev/null
+++ b/Structures-and-macros-use-the-default-definition-of-.patch
@@ -0,0 +1,67 @@
+From 512d8df361f3afa3831fff90cdf3c3f43bbc9142 Mon Sep 17 00:00:00 2001
+From: Yang Yanchao <yangyanchao6@huawei.com>
+Date: Tue, 12 Sep 2023 10:54:05 +0800
+Subject: [PATCH] Structures and macros use the default definition of the
+ kernel
+
+Signed-off-by: Yang Yanchao <yangyanchao6@huawei.com>
+---
+ include/libgmem.h | 29 -----------------------------
+ src/libgmem.c | 1 +
+ 2 files changed, 1 insertion(+), 29 deletions(-)
+
+diff --git a/include/libgmem.h b/include/libgmem.h
+index ece13a3..35cf463 100644
+--- a/include/libgmem.h
++++ b/include/libgmem.h
+@@ -17,35 +17,6 @@
+ #include <syscall.h>
+
+ __BEGIN_DECLS
+-/*
+- * TODO: Remove these "ifndef" after kernel upgrade
+- */
+-#include <sys/ioctl.h>
+-struct hmadvise_arg {
+- int hnid;
+- unsigned long start;
+- size_t len_in;
+- int behavior;
+-};
+-struct gmem_hnid_arg {
+- int *hnuma_id;
+-};
+-#ifndef GMEM_GET_HNUMA_ID
+- #define GMEM_GET_HNUMA_ID _IOW(0x55, 1, struct gmem_hnid_arg)
+-#endif
+-
+-#ifndef GMEM_MADVISE
+- #define GMEM_MADVISE _IOW(0x55, 2, struct hmadvise_arg)
+-#endif
+-
+-#ifndef MADV_PREFETCH
+-# define MADV_PREFETCH 32
+-#endif
+-
+-#ifndef MADV_DONTNEED
+-# define MADV_DONTNEED 4
+-#endif
+-
+ /*
+ * gmemFreeEager - unmap memory data
+ * @args
+diff --git a/src/libgmem.c b/src/libgmem.c
+index 59682af..870da87 100644
+--- a/src/libgmem.c
++++ b/src/libgmem.c
+@@ -14,6 +14,7 @@
+ #include <linux/mman.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <sys/ioctl.h>
+
+ #include <libgmem.h>
+ #include <gmem_common.h>
+--
+2.41.0.windows.3
+