[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/38] linux-user: Provide MADV_* definitions
From: |
Laurent Vivier |
Subject: |
[PULL 13/38] linux-user: Provide MADV_* definitions |
Date: |
Wed, 28 Sep 2022 10:14:52 +0200 |
From: Ilya Leoshkevich <iii@linux.ibm.com>
Provide MADV_* definitions using target_mman.h header, similar to what
kernel does. Most architectures use the same values, with the exception
of alpha and hppa.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220906000839.1672934-2-iii@linux.ibm.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/aarch64/target_mman.h | 1 +
linux-user/alpha/target_mman.h | 8 +++
linux-user/arm/target_mman.h | 1 +
linux-user/cris/target_mman.h | 1 +
linux-user/generic/target_mman.h | 92 ++++++++++++++++++++++++++++
linux-user/hexagon/target_mman.h | 1 +
linux-user/hppa/target_mman.h | 15 +++++
linux-user/i386/target_mman.h | 1 +
linux-user/loongarch64/target_mman.h | 1 +
linux-user/m68k/target_mman.h | 1 +
linux-user/microblaze/target_mman.h | 1 +
linux-user/mips/target_mman.h | 1 +
linux-user/mips64/target_mman.h | 1 +
linux-user/nios2/target_mman.h | 1 +
linux-user/openrisc/target_mman.h | 1 +
linux-user/ppc/target_mman.h | 1 +
linux-user/riscv/target_mman.h | 1 +
linux-user/s390x/target_mman.h | 1 +
linux-user/sh4/target_mman.h | 1 +
linux-user/sparc/target_mman.h | 1 +
linux-user/x86_64/target_mman.h | 1 +
linux-user/xtensa/target_mman.h | 1 +
22 files changed, 134 insertions(+)
create mode 100644 linux-user/aarch64/target_mman.h
create mode 100644 linux-user/alpha/target_mman.h
create mode 100644 linux-user/arm/target_mman.h
create mode 100644 linux-user/cris/target_mman.h
create mode 100644 linux-user/generic/target_mman.h
create mode 100644 linux-user/hexagon/target_mman.h
create mode 100644 linux-user/hppa/target_mman.h
create mode 100644 linux-user/i386/target_mman.h
create mode 100644 linux-user/loongarch64/target_mman.h
create mode 100644 linux-user/m68k/target_mman.h
create mode 100644 linux-user/microblaze/target_mman.h
create mode 100644 linux-user/mips/target_mman.h
create mode 100644 linux-user/mips64/target_mman.h
create mode 100644 linux-user/nios2/target_mman.h
create mode 100644 linux-user/openrisc/target_mman.h
create mode 100644 linux-user/ppc/target_mman.h
create mode 100644 linux-user/riscv/target_mman.h
create mode 100644 linux-user/s390x/target_mman.h
create mode 100644 linux-user/sh4/target_mman.h
create mode 100644 linux-user/sparc/target_mman.h
create mode 100644 linux-user/x86_64/target_mman.h
create mode 100644 linux-user/xtensa/target_mman.h
diff --git a/linux-user/aarch64/target_mman.h b/linux-user/aarch64/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/aarch64/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/alpha/target_mman.h b/linux-user/alpha/target_mman.h
new file mode 100644
index 000000000000..cd6e3d70a604
--- /dev/null
+++ b/linux-user/alpha/target_mman.h
@@ -0,0 +1,8 @@
+#ifndef ALPHA_TARGET_MMAN_H
+#define ALPHA_TARGET_MMAN_H
+
+#define TARGET_MADV_DONTNEED 6
+
+#include "../generic/target_mman.h"
+
+#endif
diff --git a/linux-user/arm/target_mman.h b/linux-user/arm/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/arm/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/cris/target_mman.h b/linux-user/cris/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/cris/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/generic/target_mman.h b/linux-user/generic/target_mman.h
new file mode 100644
index 000000000000..1436a3c54308
--- /dev/null
+++ b/linux-user/generic/target_mman.h
@@ -0,0 +1,92 @@
+#ifndef LINUX_USER_TARGET_MMAN_H
+#define LINUX_USER_TARGET_MMAN_H
+
+#ifndef TARGET_MADV_NORMAL
+#define TARGET_MADV_NORMAL 0
+#endif
+
+#ifndef TARGET_MADV_RANDOM
+#define TARGET_MADV_RANDOM 1
+#endif
+
+#ifndef TARGET_MADV_SEQUENTIAL
+#define TARGET_MADV_SEQUENTIAL 2
+#endif
+
+#ifndef TARGET_MADV_WILLNEED
+#define TARGET_MADV_WILLNEED 3
+#endif
+
+#ifndef TARGET_MADV_DONTNEED
+#define TARGET_MADV_DONTNEED 4
+#endif
+
+#ifndef TARGET_MADV_FREE
+#define TARGET_MADV_FREE 8
+#endif
+
+#ifndef TARGET_MADV_REMOVE
+#define TARGET_MADV_REMOVE 9
+#endif
+
+#ifndef TARGET_MADV_DONTFORK
+#define TARGET_MADV_DONTFORK 10
+#endif
+
+#ifndef TARGET_MADV_DOFORK
+#define TARGET_MADV_DOFORK 11
+#endif
+
+#ifndef TARGET_MADV_MERGEABLE
+#define TARGET_MADV_MERGEABLE 12
+#endif
+
+#ifndef TARGET_MADV_UNMERGEABLE
+#define TARGET_MADV_UNMERGEABLE 13
+#endif
+
+#ifndef TARGET_MADV_HUGEPAGE
+#define TARGET_MADV_HUGEPAGE 14
+#endif
+
+#ifndef TARGET_MADV_NOHUGEPAGE
+#define TARGET_MADV_NOHUGEPAGE 15
+#endif
+
+#ifndef TARGET_MADV_DONTDUMP
+#define TARGET_MADV_DONTDUMP 16
+#endif
+
+#ifndef TARGET_MADV_DODUMP
+#define TARGET_MADV_DODUMP 17
+#endif
+
+#ifndef TARGET_MADV_WIPEONFORK
+#define TARGET_MADV_WIPEONFORK 18
+#endif
+
+#ifndef TARGET_MADV_KEEPONFORK
+#define TARGET_MADV_KEEPONFORK 19
+#endif
+
+#ifndef TARGET_MADV_COLD
+#define TARGET_MADV_COLD 20
+#endif
+
+#ifndef TARGET_MADV_PAGEOUT
+#define TARGET_MADV_PAGEOUT 21
+#endif
+
+#ifndef TARGET_MADV_POPULATE_READ
+#define TARGET_MADV_POPULATE_READ 22
+#endif
+
+#ifndef TARGET_MADV_POPULATE_WRITE
+#define TARGET_MADV_POPULATE_WRITE 23
+#endif
+
+#ifndef TARGET_MADV_DONTNEED_LOCKED
+#define TARGET_MADV_DONTNEED_LOCKED 24
+#endif
+
+#endif
diff --git a/linux-user/hexagon/target_mman.h b/linux-user/hexagon/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/hexagon/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/hppa/target_mman.h b/linux-user/hppa/target_mman.h
new file mode 100644
index 000000000000..66dd9f79414e
--- /dev/null
+++ b/linux-user/hppa/target_mman.h
@@ -0,0 +1,15 @@
+#ifndef HPPA_TARGET_MMAN_H
+#define HPPA_TARGET_MMAN_H
+
+#define TARGET_MADV_MERGEABLE 65
+#define TARGET_MADV_UNMERGEABLE 66
+#define TARGET_MADV_HUGEPAGE 67
+#define TARGET_MADV_NOHUGEPAGE 68
+#define TARGET_MADV_DONTDUMP 69
+#define TARGET_MADV_DODUMP 70
+#define TARGET_MADV_WIPEONFORK 71
+#define TARGET_MADV_KEEPONFORK 72
+
+#include "../generic/target_mman.h"
+
+#endif
diff --git a/linux-user/i386/target_mman.h b/linux-user/i386/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/i386/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/loongarch64/target_mman.h
b/linux-user/loongarch64/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/loongarch64/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/m68k/target_mman.h b/linux-user/m68k/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/m68k/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/microblaze/target_mman.h
b/linux-user/microblaze/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/microblaze/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/mips/target_mman.h b/linux-user/mips/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/mips/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/mips64/target_mman.h b/linux-user/mips64/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/mips64/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/nios2/target_mman.h b/linux-user/nios2/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/nios2/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/openrisc/target_mman.h
b/linux-user/openrisc/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/openrisc/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/ppc/target_mman.h b/linux-user/ppc/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/ppc/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/riscv/target_mman.h b/linux-user/riscv/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/riscv/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/s390x/target_mman.h b/linux-user/s390x/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/s390x/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/sh4/target_mman.h b/linux-user/sh4/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/sh4/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/sparc/target_mman.h b/linux-user/sparc/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/sparc/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/x86_64/target_mman.h b/linux-user/x86_64/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/x86_64/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
diff --git a/linux-user/xtensa/target_mman.h b/linux-user/xtensa/target_mman.h
new file mode 100644
index 000000000000..e7ba6070fe7c
--- /dev/null
+++ b/linux-user/xtensa/target_mman.h
@@ -0,0 +1 @@
+#include "../generic/target_mman.h"
--
2.37.3
- [PULL 09/38] linux-user: Fix strace of chmod() if mode == 0, (continued)
- [PULL 09/38] linux-user: Fix strace of chmod() if mode == 0, Laurent Vivier, 2022/09/28
- [PULL 08/38] linux-user/hppa: Dump IIR on register dump, Laurent Vivier, 2022/09/28
- [PULL 04/38] linux-user: Add missing clock_gettime64() syscall strace, Laurent Vivier, 2022/09/28
- [PULL 07/38] linux-user/hppa: Use EXCP_DUMP() to show enhanced debug info, Laurent Vivier, 2022/09/28
- [PULL 02/38] linux-user: fix readlinkat handling with magic exe symlink, Laurent Vivier, 2022/09/28
- [PULL 18/38] linux-user: Fix TARGET_PROT_SEM for XTENSA, Laurent Vivier, 2022/09/28
- [PULL 19/38] linux-user: Add proper strace format strings for getdents()/getdents64(), Laurent Vivier, 2022/09/28
- [PULL 14/38] linux-user: Fix madvise(MADV_DONTNEED) on alpha, Laurent Vivier, 2022/09/28
- [PULL 05/38] linux-user: Add pidfd_open(), pidfd_send_signal() and pidfd_getfd() syscalls, Laurent Vivier, 2022/09/28
- [PULL 10/38] linux-user/hppa: Set TASK_UNMAPPED_BASE to 0xfa000000 for hppa arch, Laurent Vivier, 2022/09/28
- [PULL 13/38] linux-user: Provide MADV_* definitions,
Laurent Vivier <=
- [PULL 23/38] linux-user/hppa: Allow PROT_GROWSUP and PROT_GROWSDOWN in mprotect(), Laurent Vivier, 2022/09/28
- [PULL 17/38] tests/tcg/linux-test: Add linux-madvise test, Laurent Vivier, 2022/09/28
- [PULL 12/38] linux-user: Show timespec on strace for futex(), Laurent Vivier, 2022/09/28
- [PULL 01/38] linux-user: use 'max' instead of 'qemu32' / 'qemu64' by default, Laurent Vivier, 2022/09/28
- [PULL 06/38] linux-user: Log failing executable in EXCP_DUMP(), Laurent Vivier, 2022/09/28
- [PULL 30/38] linux-user: Combine do_futex and do_futex_time64, Laurent Vivier, 2022/09/28
- [PULL 26/38] linux-user: Don't assume 0 is not a valid host timer_t value, Laurent Vivier, 2022/09/28
- [PULL 27/38] linux-user/s390x: Save/restore fpc when handling a signal, Laurent Vivier, 2022/09/28