68 lines
1.5 KiB
Diff
68 lines
1.5 KiB
Diff
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
|
|
|