This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
My current glibc patch for ia64
- To: GNU C Library <libc-alpha at sourceware dot cygnus dot com>
- Subject: My current glibc patch for ia64
- From: "H . J . Lu" <hjl at valinux dot com>
- Date: Fri, 8 Dec 2000 13:52:23 -0800
- Cc: ia64-tools at napali dot hpl dot hp dot com
There is an unaligned access in obstack.c on ia64. I am enclosing a
patch for it. IA64 has to use "char" or memmove. memmove may be faster.
I am enclosing my getpagesize patch for ia64.
H.J.
-----
2000-12-08 H.J. Lu <hjl@gnu.org>
* sysdeps/ia64/Makefile (CPPFLAGS-obstack.c): Add -DCOPYING_UNIT=0.
* malloc/obstack.c (COPYING_UNIT): Use memove if COPYING_UNIT is 0.
2000-11-21 H.J. Lu <hjl@gnu.org>
* sysdeps/unix/sysv/linux/ia64/getpagesize.c (__getpagesize):
Don't call __syscall_getpagesize. Set to 16K by default.
* sysdeps/unix/sysv/linux/ia64/syscalls.list (s_getpagesize):
Removed.
Index: sysdeps/ia64/Makefile
===================================================================
RCS file: /work/cvs/gnu/glibc/sysdeps/ia64/Makefile,v
retrieving revision 1.1.1.5
diff -u -p -r1.1.1.5 Makefile
--- sysdeps/ia64/Makefile 2000/11/28 19:57:17 1.1.1.5
+++ sysdeps/ia64/Makefile 2000/12/08 21:37:31
@@ -14,3 +14,7 @@ sysdep-dl-routines += dl-symaddr dl-fptr
sysdep_routines += $(sysdep-dl-routines)
sysdep-rtld-routines += $(sysdep-dl-routines)
endif
+
+ifeq ($(subdir),malloc)
+CPPFLAGS-obstack.c += -DCOPYING_UNIT=0
+endif
Index: malloc/obstack.c
===================================================================
RCS file: /work/cvs/gnu/glibc/malloc/obstack.c,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 obstack.c
--- malloc/obstack.c 2000/11/10 06:01:15 1.1.1.4
+++ malloc/obstack.c 2000/12/08 21:36:49
@@ -70,7 +70,8 @@ union fooround {long x; double d;};
/* When we copy a long block of data, this is the unit to do it with.
On some machines, copying successive ints does not work;
in such a case, redefine COPYING_UNIT to `long' (if that works)
- or `char' as a last resort. */
+ or `char' as a last resort. Or define COPYING_UNIT to 0, which will
+ use memmove. */
#ifndef COPYING_UNIT
#define COPYING_UNIT int
#endif
@@ -280,9 +281,11 @@ _obstack_newchunk (h, length)
register struct _obstack_chunk *new_chunk;
register long new_size;
register long obj_size = h->next_free - h->object_base;
+ char *object_base;
+#if COPYING_UNIT
register long i;
long already;
- char *object_base;
+#endif
/* Compute size for new chunk. */
new_size = (obj_size + length) + (obj_size >> 3) + h->alignment_mask + 100;
@@ -302,6 +305,7 @@ _obstack_newchunk (h, length)
__INT_TO_PTR ((__PTR_TO_INT (new_chunk->contents) + h->alignment_mask)
& ~ (h->alignment_mask));
+#if COPYING_UNIT
/* Move the existing object to the new chunk.
Word at a time is fast and is safe if the object
is sufficiently aligned. */
@@ -321,6 +325,9 @@ _obstack_newchunk (h, length)
/* Copy remaining bytes one by one. */
for (i = already; i < obj_size; i++)
object_base[i] = h->object_base[i];
+#else
+ memmove (object_base, h->object_base, obj_size);
+#endif
/* If the object just copied was the only data in OLD_CHUNK,
free that chunk and remove it from the chain.
Index: sysdeps/unix/sysv/linux/ia64/getpagesize.c
===================================================================
RCS file: /work/cvs/gnu/glibc/sysdeps/unix/sysv/linux/ia64/getpagesize.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 getpagesize.c
--- sysdeps/unix/sysv/linux/ia64/getpagesize.c 2000/06/25 16:02:54 1.1.1.1
+++ sysdeps/unix/sysv/linux/ia64/getpagesize.c 2000/11/21 22:26:21
@@ -27,19 +27,13 @@
determine the page size to ensure proper alignment for calls such
as mmap and friends. --davidm 99/11/30 */
-/* If we are not a static program, this value is collected from the system
- via the AT_PAGESZ auxiliary argument. If we are a static program, we
- use the getpagesize system call. */
-
extern size_t _dl_pagesize;
-extern size_t __syscall_getpagesize (void);
-
int
__getpagesize ()
{
if (_dl_pagesize == 0)
- _dl_pagesize = INLINE_SYSCALL (getpagesize, 0);
+ _dl_pagesize = 0x4000; /* use a reasonable default */
return _dl_pagesize;
}
Index: sysdeps/unix/sysv/linux/ia64/syscalls.list
===================================================================
RCS file: /work/cvs/gnu/glibc/sysdeps/unix/sysv/linux/ia64/syscalls.list,v
retrieving revision 1.1.1.8
diff -u -p -r1.1.1.8 syscalls.list
--- sysdeps/unix/sysv/linux/ia64/syscalls.list 2000/09/16 06:41:37 1.1.1.8
+++ sysdeps/unix/sysv/linux/ia64/syscalls.list 2000/11/21 16:47:02
@@ -72,7 +72,6 @@ s_getdents64 getdents64 getdents64 i:ipi
s_mknod xmknod mknod i:sii __syscall_mknod
s_readv readv readv i:ipi __syscall_readv
s_writev writev writev i:ipi __syscall_writev
-s_getpagesize getpagesize getpagesize 0 __syscall_getpagesize
s_poll poll poll i:pii __syscall_poll
s_reboot reboot reboot i:iii __syscall_reboot
s_ustat ustat ustat i:ip __syscall_ustat