summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/mips/mmap_info.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/mips/mmap_info.h')
-rw-r--r--sysdeps/unix/sysv/linux/mips/mmap_info.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/mips/mmap_info.h b/sysdeps/unix/sysv/linux/mips/mmap_info.h
new file mode 100644
index 0000000000..07c9e3a044
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mmap_info.h
@@ -0,0 +1,13 @@
+/* mips64n32 uses __NR_mmap for mmap64 while still having sizeof (off_t)
+ smaller than sizeof (off64_t). So it allows mapping large offsets
+ using mmap64 than 32-bit archs which uses __NR_mmap2. */
+
+static inline uint64_t
+mmap64_maximum_offset (long int page_shift)
+{
+#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
+ return UINT64_MAX;
+#else
+ return (UINT64_C(1) << (page_shift + (8 * sizeof (off_t)))) - 1;
+#endif
+}