[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commits] r23423 - in /trunk/localedef: ChangeLog.eglibc include/libc-internal.h include/libc-mmap.h
- To: commits@xxxxxxxxxx
- Subject: [Commits] r23423 - in /trunk/localedef: ChangeLog.eglibc include/libc-internal.h include/libc-mmap.h
- From: joseph@xxxxxxxxxx
- Date: Tue, 02 Jul 2013 15:25:04 -0000
Author: joseph
Date: Tue Jul 2 15:25:03 2013
New Revision: 23423
Log:
* include/libc-mmap.h: Copy from glibc.
* include/libc-internal.h: Copy from glibc (cut down).
Added:
trunk/localedef/include/libc-internal.h
trunk/localedef/include/libc-mmap.h
Modified:
trunk/localedef/ChangeLog.eglibc
Modified: trunk/localedef/ChangeLog.eglibc
==============================================================================
--- trunk/localedef/ChangeLog.eglibc (original)
+++ trunk/localedef/ChangeLog.eglibc Tue Jul 2 15:25:03 2013
@@ -1,3 +1,8 @@
+2013-07-02 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
+
+ * include/libc-mmap.h: Copy from glibc.
+ * include/libc-internal.h: Copy from glibc (cut down).
+
2013-03-06 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
* include/sys/cdefs.h (__attribute_malloc__): Define if not
Added: trunk/localedef/include/libc-internal.h
==============================================================================
--- trunk/localedef/include/libc-internal.h (added)
+++ trunk/localedef/include/libc-internal.h Tue Jul 2 15:25:03 2013
@@ -1,0 +1,27 @@
+/* This file contains a number of internal prototype declarations that
+ don't fit anywhere else. */
+
+#ifndef _LIBC_INTERNAL
+# define _LIBC_INTERNAL 1
+
+/* Align a value by rounding down to closest size.
+ e.g. Using size of 4096, we get this behavior:
+ {4095, 4096, 4097} = {0, 4096, 4096}. */
+#define ALIGN_DOWN(base, size) ((base) & -((__typeof__ (base)) (size)))
+
+/* Align a value by rounding up to closest size.
+ e.g. Using size of 4096, we get this behavior:
+ {4095, 4096, 4097} = {4096, 4096, 8192}.
+
+ Note: The size argument has side effects (expanded multiple times). */
+#define ALIGN_UP(base, size) ALIGN_DOWN ((base) + (size) - 1, (size))
+
+/* Same as ALIGN_DOWN(), but automatically casts when base is a pointer. */
+#define PTR_ALIGN_DOWN(base, size) \
+ ((__typeof__ (base)) ALIGN_DOWN ((uintptr_t) (base), (size)))
+
+/* Same as ALIGN_UP(), but automatically casts when base is a pointer. */
+#define PTR_ALIGN_UP(base, size) \
+ ((__typeof__ (base)) ALIGN_UP ((uintptr_t) (base), (size)))
+
+#endif /* _LIBC_INTERNAL */
Added: trunk/localedef/include/libc-mmap.h
==============================================================================
--- trunk/localedef/include/libc-mmap.h (added)
+++ trunk/localedef/include/libc-mmap.h Tue Jul 2 15:25:03 2013
@@ -1,0 +1,26 @@
+/* Internal logic for dealing with mmap quirks.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC_MMAP_H
+#define _LIBC_MMAP_H 1
+
+/* Using MAP_FIXED with mmap sometimes requires larger alignment. */
+#include <sys/shm.h>
+#define MAP_FIXED_ALIGNMENT SHMLBA
+
+#endif
_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits