This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix mmap2 syscall for ColdFire


Hi,

This patch fixes mmap2 syscall on ColdFire systems.

M68K linux port expects the argument of mmap2 syscall to be counted in the memory pages. ColdFire has a non-standard page size of 8K, which libc is not yet aware of. The patch defines the MMAP2_PAGE_SHIFT macro to fix that.

--
Maxim K.
CodeSourcery
>From 5efd401d137cc14f4cd99f2f0669d60aa1c267a5 Mon Sep 17 00:00:00 2001
From: Maxim Kuvyrkov <maxim@codesourcery.com>
Date: Fri, 2 Oct 2009 14:22:47 +0400
Subject: [PATCH] Fix ColdFire's mmap2.

	* sysdeps/unix/sysv/linux/m68k/kernel-features.h (MMAP2_PAGE_SHIFT):
	Define to 13.

Signed-off-by: Maxim Kuvyrkov <maxim@codesourcery.com>
---
 sysdeps/unix/sysv/linux/m68k/kernel-features.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
index 2920943..fcff833 100644
--- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -39,3 +39,9 @@
 /* These syscalls are not implemented yet for m68k.  */
 #undef __ASSUME_PSELECT
 #undef __ASSUME_PPOLL
+
+#ifdef __mcoldfire__
+/* ColdFire kernels have PAGE_SHIFT set to 13 and expect
+   mmap2 offset to be provided in 8K pages.  */
+# define MMAP2_PAGE_SHIFT 13
+#endif
-- 
1.6.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]