]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Updated to fedora-glibc-20060102T1045
authorJakub Jelinek <jakub@redhat.com>
Mon, 2 Jan 2006 10:52:59 +0000 (10:52 +0000)
committerJakub Jelinek <jakub@redhat.com>
Mon, 2 Jan 2006 10:52:59 +0000 (10:52 +0000)
151 files changed:
ChangeLog
Makeconfig
catgets/gencat.c
config.make.in
configure
configure.in
csu/version.c
debug/catchsegv.sh
debug/xtrace.sh
dlfcn/bug-atexit1.c
elf/ldconfig.c
elf/ldd.bash.in
elf/order2mod2.c
elf/rtld.c
elf/sprof.c
elf/tst-tls13.c
fedora/branch.mk
fedora/glibc.spec.in
hurd/lookup-retry.c
hurd/report-wait.c
hurd/sigunwind.c
iconv/iconv_prog.c
iconv/iconvconfig.c
iconvdata/bug-iconv4.c
include/sys/xattr.h [new file with mode: 0644]
libio/iogetwline.c
libio/obprintf.c
locale/programs/locale.c
locale/programs/localedef.c
locale/programs/simple-hash.c
malloc/memusage.sh
malloc/mtrace.pl
manual/filesys.texi
nptl/ChangeLog
nptl/Makefile
nptl/sigaction.c [moved from nptl/sysdeps/pthread/sigaction.c with 66% similarity]
nptl/sysdeps/alpha/jmpbuf-unwind.h
nptl/sysdeps/i386/jmpbuf-unwind.h
nptl/sysdeps/mips/jmpbuf-unwind.h
nptl/sysdeps/powerpc/jmpbuf-unwind.h
nptl/sysdeps/s390/jmpbuf-unwind.h
nptl/sysdeps/sh/jmpbuf-unwind.h
nptl/sysdeps/sparc/sparc32/jmpbuf-unwind.h
nptl/sysdeps/sparc/sparc64/jmpbuf-unwind.h
nptl/sysdeps/unix/sysv/linux/Makefile
nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
nptl/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
nptl/sysdeps/x86_64/jmpbuf-unwind.h
nptl/tst-robust7.c [new file with mode: 0644]
nptl/tst-signal7.c [new file with mode: 0644]
nptl/version.c
nscd/connections.c
nscd/nscd.c
nscd/nscd.h
nscd/selinux.c
nss/getent.c
posix/bug-regex22.c
posix/bug-regex5.c
posix/getconf.c
posix/transbug.c
posix/tst-execle1.c
posix/tst-execle2.c
resolv/gethnamaddr.c
resolv/herror.c
resolv/res_debug.c
stdio-common/tst-fgets.c
stdio-common/tstdiomisc.c
string/test-memccpy.c
string/test-memchr.c
string/test-memcmp.c
string/test-memcpy.c
string/test-memmove.c
string/test-strcat.c
string/test-strchr.c
string/test-strcmp.c
string/test-strcpy.c
string/test-strlen.c
string/test-strncpy.c
string/test-strpbrk.c
string/test-strrchr.c
string/test-strspn.c
sysdeps/alpha/bits/setjmp.h
sysdeps/hppa/bits/setjmp.h
sysdeps/i386/__longjmp.S
sysdeps/i386/bits/setjmp.h
sysdeps/i386/bsd-_setjmp.S
sysdeps/i386/bsd-setjmp.S
sysdeps/i386/setjmp.S
sysdeps/m68k/bits/setjmp.h
sysdeps/mach/hurd/errno.c [new file with mode: 0644]
sysdeps/mach/hurd/ioctl.c
sysdeps/mach/hurd/jmp-unwind.c
sysdeps/mips/bits/setjmp.h
sysdeps/posix/libc_fatal.c
sysdeps/powerpc/bits/setjmp.h
sysdeps/powerpc/powerpc32/__longjmp-common.S
sysdeps/powerpc/powerpc32/dl-start.S
sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
sysdeps/powerpc/powerpc32/hp-timing.h [new file with mode: 0644]
sysdeps/powerpc/powerpc32/setjmp-common.S
sysdeps/powerpc/powerpc64/__longjmp-common.S
sysdeps/powerpc/powerpc64/setjmp-common.S
sysdeps/s390/bits/setjmp.h
sysdeps/sh/_mcount.S
sysdeps/sh/bits/setjmp.h
sysdeps/sh/sysdep.h
sysdeps/sparc/sparc32/bits/setjmp.h
sysdeps/unix/sh/sysdep.S
sysdeps/unix/sysv/linux/clock_getres.c
sysdeps/unix/sysv/linux/clock_gettime.c
sysdeps/unix/sysv/linux/i386/sigaction.c
sysdeps/unix/sysv/linux/ia64/bits/setjmp.h
sysdeps/unix/sysv/linux/ia64/sigaction.c
sysdeps/unix/sysv/linux/mips/bits/socket.h
sysdeps/unix/sysv/linux/powerpc/Makefile
sysdeps/unix/sysv/linux/powerpc/Versions [new file with mode: 0644]
sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/powerpc/dl-vdso.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/powerpc/dl-vdso.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c
sysdeps/unix/sysv/linux/powerpc/gettimeofday.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/powerpc/libc-start.c [moved from sysdeps/powerpc/elf/libc-start.c with 54% similarity]
sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S [new file with mode: 0644]
sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S
sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S [new file with mode: 0644]
sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S
sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S [new file with mode: 0644]
sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S
sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.sym
sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c
sysdeps/unix/sysv/linux/sh/makecontext.S
sysdeps/unix/sysv/linux/sh/sh3/getcontext.S
sysdeps/unix/sysv/linux/sh/sh3/setcontext.S
sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S
sysdeps/unix/sysv/linux/sh/sh4/getcontext.S
sysdeps/unix/sysv/linux/sh/sh4/setcontext.S
sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S
sysdeps/unix/sysv/linux/sh/socket.S
sysdeps/unix/sysv/linux/sh/sysdep.S
sysdeps/unix/sysv/linux/sh/sysdep.h
sysdeps/unix/sysv/linux/sigaction.c
sysdeps/unix/sysv/linux/sparc/bits/setjmp.h
sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
sysdeps/unix/sysv/linux/x86_64/sigaction.c
sysdeps/x86_64/__longjmp.S
sysdeps/x86_64/bits/setjmp.h
wcsmbs/tst-mbsrtowcs.c

index 8d7a003cc003e998dce10913948315a610d71776..02bd5423f10df351a154ae55a04eddfc2acdaab8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,283 @@
+2006-01-01  Ulrich Drepper  <drepper@redhat.com>
+
+       * posix/getconf.c: Update copyright year.
+       * nss/getent.c: Likewise.
+       * iconv/iconvconfig.c: Likewise.
+       * iconv/iconv_prog.c: Likewise.
+       * elf/ldconfig.c: Likewise.
+       * catgets/gencat.c: Likewise.
+       * csu/version.c: Likewise.
+       * elf/ldd.bash.in: Likewise.
+       * elf/sprof.c (print_version): Likewise.
+       * locale/programs/locale.c: Likewise.
+       * locale/programs/localedef.c: Likewise.
+       * nscd/nscd.c (print_version): Likewise.
+       * debug/xtrace.sh: Likewise.
+       * malloc/memusage.sh: Likewise.
+       * malloc/mtrace.pl: Likewise.
+       * debug/catchsegv.sh: Likewise.
+
+2005-12-31  Andreas Jaeger  <aj@suse.de>
+
+       [BZ #1395]
+       * manual/filesys.texi (Symbolic Links): Fix description of
+       canonicalize_file_name based on patch by Oskar Liljeblad
+       <oskar@osk.mine.nu>.
+
+2005-12-29  Andreas Jaeger  <aj@suse.de>
+
+       * resolv/res_debug.c (latlon2ul): Use ISO C function definition.
+       (precsize_aton): Likewise.
+       (precsize_ntoa): Likewise.
+
+       * resolv/gethnamaddr.c (_gethtbyname): Remove extra prototype.
+       (gethostbyname2): Likewise.
+       (gethostbyaddr): Likewise.
+       (getanswer): Use ISO C function definition.
+
+2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
+
+       * sysdeps/sh/sysdep.h: Add cfi instrumentation to asm fragments.
+       * sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise.
+       * sysdeps/sh/_mcount.S: Add cfi instrumentation.
+       * sysdeps/unix/sh/sysdep.S: Likewise.
+       * sysdeps/unix/sysv/linux/sh/makecontext.S: Adjust cfi_startproc.
+       * sysdeps/unix/sysv/linux/sh/sh4/getcontext.S: Remove now duplicate
+       cfi_startproc and cfi_endproc.
+       * sysdeps/unix/sysv/linux/sh/sh4/setcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/sh/sh3/getcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/sh/sh3/setcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/sh/socket.S: Likewise.
+       * sysdeps/unix/sysv/linux/sh/sysdep.S: Add cfi_endproc.
+
+2005-12-30  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/powerpc/powerpc64/setjmp-common.S: Make sure pointer guard
+       value doesn't survive in a registers when the function returns.
+       * sysdeps/powerpc/powerpc32/fpu/setjmp-common.S: Likewise.
+       * sysdeps/powerpc/powerpc32/setjmp-common.S: Likewise.
+
+2005-12-30  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Define
+       PTR_MANGLE2.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Define
+       PTR_MANGLE2 and PTR_DEMANGLE2.
+       * sysdeps/powerpc/powerpc64/__longjmp-common.S: Use PTR_DEMANGLE2.
+       * sysdeps/powerpc/powerpc64/setjmp-common.S: Use PTR_MANGLE2.
+       * sysdeps/powerpc/powerpc32/fpu/setjmp-common.S: Likewise.
+       * sysdeps/powerpc/powerpc32/setjmp-common.S: Likewise.
+
+2005-12-30  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/sysv/linux/ia64/bits/setjmp.h (_JMPBUF_UNWINDS):
+       Don't use _demangle parameter for now.
+
+       [BZ #2080]
+       * libio/iogetwline.c (_IO_getwline_info): Move return to correct
+       location.
+
+       * nscd/connections.c: Remove last remnants of -S option support.
+       * nscd/nscd.c: Likewise.
+       * nscd/nscd.h: Likewise.
+
+2005-12-30  Andreas Jaeger  <aj@suse.de>
+
+       [BZ #1067]
+       * sysdeps/unix/sysv/linux/mips/bits/socket.h: Fix struct msghdr
+       for 64-bit mips kernel.
+
+2005-12-08  Steven Munroe  <sjmunroe@us.ibm.com>
+            Tom Gall <tom_gall@vnet.ibm.com>
+
+       * elf/rtld.c (dl_main): Initialize l_local_scope for sysinfo_map.
+       * sysdeps/powerpc/elf/libc-start.c: Move this...
+       * sysdeps/unix/sysv/linux/powerpc/libc-start.c: ...to here.
+       * sysdeps/powerpc/powerpc32/dl-start.S: Add _dl_main_dispatch label.
+       * sysdeps/powerpc/powerpc32/hp-timing.h: New file.
+       * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
+       * sysdeps/unix/sysv/linux/clock_getres.c: If HAVE_CLOCK_GETRES_VSYSCALL
+       is not defined, redefine INTERNAL_VSYSCALL and INLINE_VSYSCALL to
+       INTERNAL_SYSCALL and INLINE_SYSCALL respectively.  Otherwise include
+       <bits/libc-vdso.h>.  Use INLINE_VSYSCALL and INTERNAL_SYSCALL instead
+       of the normal versions throughout the code.
+       * sysdeps/unix/sysv/linux/clock_gettime.c: Likewise if
+       HAVE_CLOCK_GETTIME_VSYSCALL is defined.
+       * sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h: New file.
+       * sysdeps/unix/sysv/linux/powerpc/dl-vdso.c: New file.
+       * sysdeps/unix/sysv/linux/powerpc/dl-vdso.h: New file.
+       * sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c: Use vDSO.
+       * sysdeps/unix/sysv/linux/powerpc/gettimeofday.c: New file.
+       * sysdeps/unix/sysv/linux/powerpc/Makefile: Add dl-vdso to routines.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Define
+       INLINE_VSYSCALL, INTERNAL_VSYSCALL, INTERNAL_SYSCALL_NCS,
+       INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK, HAVE_CLOCK_GETRES_VSYSCALL,
+       and HAVE_CLOCK_GETTIME_VSYSCALL.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise.
+
+2005-12-29  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h [ASSEMBLER]:
+       Define PTR_DEMANGLE2.
+       * sysdeps/powerpc/powerpc32/setjmp-common.S [PTR_MANGLE]: Also
+       mangle r1.
+       * sysdeps/powerpc/powerpc32/__longjmp-common.S [PTR_DEMANGLE]: Also
+       demangle r1.
+       * sysdeps/powerpc/powerpc32/fpu/setjmp-common.S [PTR_MANGLE]: Mangle
+       r0 and r1.
+       * sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S [PTR_DEMANGLE]:
+       Demangle r0 and r1.
+
+       * sysdeps/powerpc/powerpc64/setjmp-common.S [PTR_MANGLE]: Also
+       mangle r1.
+       * sysdeps/powerpc/powerpc64/__longjmp-common.S [PTR_DEMANGLE]: Also
+       demangle  r1.
+
+2005-12-26  Steven Munroe  <sjmunroe@us.ibm.com>
+
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S:
+       Move common function to...
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S:
+       New file.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S:
+       Move common function to...
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S:
+       New file.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S:
+       Move common function to...
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S:
+       New file.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.sym
+       (_FRAME_BACKCHAIN, _FRAME_LR_SAVE, _FRAME_PARM_SAVE1,
+       _FRAME_PARM_SAVE2, _FRAME_PARM_SAVE3, _FRAME_PARM_SAVE4):
+       Remove unrelated stack frame defines.
+
+2005-12-29  Ulrich Drepper  <drepper@redhat.com>
+
+       * stdio-common/tstdiomisc.c [FLT_EVAL_METHOD!=2] (dbl_max):
+       Defining as macro as before the last change.
+
+       * sysdeps/unix/sysv/linux/sigaction.c: If WRAPPER_INCLUDE is defined,
+       include the named file.
+       * sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/sigaction.c: Likewise.
+       * sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c: Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise.
+
+2005-12-29  Roland McGrath  <roland@frob.com>
+
+       * sysdeps/mach/hurd/errno.c: New file.
+
+       * sysdeps/mach/hurd/ioctl.c (__ioctl): Use a union to avoid a cast.
+
+       * sysdeps/posix/libc_fatal.c (__libc_message): Add a const, a cast.
+
+       * hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Fix cast.
+       * hurd/report-wait.c (_S_msg_report_wait): Likewise.
+
+       * include/sys/xattr.h: New file.
+
+2005-12-28  Roland McGrath  <roland@redhat.com>
+
+       * hurd/sigunwind.c: Include <stdint.h>.
+       * sysdeps/mach/hurd/jmp-unwind.c: Likewise.
+
+2005-12-28  Ulrich Drepper  <drepper@redhat.com>
+
+       * nscd/selinux.c (log_callback): Use audit_log_user_avc_message.
+       Don't do anything if audit_fd is invalid.
+       (audit_init): Don't complain if kernel support is missing.
+       Patch by Steve Grubb <sgrubb@redhat.com>.
+
+       * sysdeps/i386/__longjmp.S [PTR_DEMANGLE]: Also demangle stack
+       pointer.  Add CFI.
+       * sysdeps/i386/bsd-_setjmp.S [PTR_MANGLE]: Also mangle stack pointer.
+       * sysdeps/i386/bsd-setjmp.S: Likewise.
+       * sysdeps/i386/setjmp.S: Likewise.
+
+       * sysdeps/x86_64/__longjmp.S: No need to make sure return value is
+       != 0, the caller did that.
+
+2005-12-27  Roland McGrath  <roland@redhat.com>
+
+       * sysdeps/x86_64/__longjmp.S: Don't confuse unwinder by loading
+       mangled values in %rbp and %rsp registers and by wrong cfi.
+
+       * config.make.in (c++-sysincludes): New substituted variable.
+       * configure.in (CXX_SYSINCLUDES): New substituted variable.
+       * configure: Regenerated.
+       * Makeconfig (CXXFLAGS): Prepend $(c++-sysincludes) here.
+
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
+       (PTR_MANGLE): Fix cast.
+
+       * sysdeps/alpha/bits/setjmp.h (_JMPBUF_UNWINDS): Take third argument
+       DEMANGLE, and pass SP value through it.
+       * sysdeps/hppa/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise.
+       * sysdeps/i386/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise.
+       * sysdeps/m68k/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise.
+       * sysdeps/mips/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise.
+       * sysdeps/powerpc/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise.
+       * sysdeps/s390/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise.
+       * sysdeps/sh/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise.
+       * sysdeps/sparc/sparc32/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise.
+       * sysdeps/unix/sysv/linux/ia64/bits/setjmp.h: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/bits/setjmp.h: Likewise.
+       * sysdeps/x86_64/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise.
+       * hurd/sigunwind.c (_hurdsig_longjmp_from_handler): Pass inline
+       demangler function to _JMPBUF_UNWINDS.
+       * sysdeps/mach/hurd/jmp-unwind.c (demangle_ptr): New function.
+       (_longjmp_unwind): Pass it to _JMPBUF_UNWINDS.
+
+       * posix/tst-execle1.c (do_test): Add a const.
+       * posix/tst-execle2.c (do_test): Likewise.
+
+       * posix/transbug.c (run_test): Add some casts.
+       * posix/bug-regex22.c (main): Likewise.
+       * posix/bug-regex5.c (main): Likewise.
+       * wcsmbs/tst-mbsrtowcs.c (main): Likewise.
+       * string/test-strspn.c (do_test, do_random_tests): Likewise.
+       * string/test-strrchr.c (do_test, do_random_tests): Likewise.
+       * string/test-strlen.c (do_random_tests): Likewise.
+       * string/test-strpbrk.c (do_test, do_random_tests): Likewise.
+       * string/test-strcmp.c (do_random_tests): Likewise.
+       * string/test-strchr.c (do_test, do_random_tests): Likewise.
+       * string/test-strcat.c (do_test, do_random_tests): Likewise.
+       * string/test-strncpy.c (do_random_tests): Likewise.
+       * string/test-strcpy.c (do_test, do_random_tests): Likewise.
+       * string/test-memccpy.c (do_test): Likewise.
+       * string/test-memmove.c (do_test, do_random_tests): Likewise.
+       * string/test-memcpy.c (do_test, do_random_tests): Likewise.
+       * string/test-memcmp.c (do_test, do_random_tests): Likewise.
+       * string/test-memchr.c (do_test, do_random_tests): Likewise.
+       * dlfcn/bug-atexit1.c (do_test): Fix up prototype in cast.
+       * stdio-common/tst-fgets.c (do_test): Add a cast.
+       * iconvdata/bug-iconv4.c (xiconv): Add a cast.
+
+       * locale/programs/simple-hash.c (insert_entry_2): Remove useless casts.
+
+       * resolv/herror.c (herror): Remove unused extern decl.
+
+       * libio/obprintf.c: Include "strfile.h".
+
+       * elf/order2mod2.c (init): Cast ignored value to void.
+
 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
 
        * elf/ldconfig.c (search_dir): Skip prelink temporaries.
 
 2005-12-27  Ulrich Drepper  <drepper@redhat.com>
 
+       * elf/tst-tls13.c (do_test): Avoid using the library path when
+       looking for tst-tlsmod13a.so.
+
+       * stdio-common/tstdiomisc.c: If FLT_EVAL_METHOD is 2, use long
+       double math to generate NaN results.
+
        * sysdeps/unix/sysv/linux/sparc/bits/errno.h: Define EOWNERDEAD
        and ENOTRECOVERABLE if not already defined.
        * sysdeps/unix/sysv/linux/alpha/bits/errno.h: Likewise.
index f32a19eab64b0a3b0a679b5991c2ee456ad81367..67f85c09051a8069ae2b2f62e75e69c3a0d26c12 100644 (file)
@@ -651,7 +651,8 @@ override CFLAGS     = -std=gnu99 \
                  $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
                  $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
                  $(CFLAGS-$(@F))
-override CXXFLAGS = $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
+override CXXFLAGS = $(c++-sysincludes) \
+                   $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
                    $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
 
 # If everything is compiled with -fPIC (implicitly) we must tell this by
index 2afecadcbecdecd28a843acae38c915f56f41e8e..e72754d526c768a5a40487e2877076ed923b8934 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 1996.
 
@@ -246,7 +246,7 @@ print_version (FILE *stream, struct argp_state *state)
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2005");
+"), "2006");
   fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
 }
 
index 3af1e396e946134af676480d6ab486fab32a6648..871c5d60ded8c0837e12ccf3b8ff38828afe2dec 100644 (file)
@@ -34,6 +34,7 @@ with-cpu = @submachine@
 
 defines = @DEFINES@
 sysincludes = @SYSINCLUDES@
+c++-sysincludes = @CXX_SYSINCLUDES@
 all-warnings = @all_warnings@
 
 elf = @elf@
index e8e8b363f17d3e49456cf41d862af5b9bda1cde2..d46bb19fb0d87ea08b9071dd1af14ed9732a1fba 100755 (executable)
--- a/configure
+++ b/configure
@@ -313,7 +313,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons base_machine submachine sysnames INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_asm_protected_directive libc_cv_cc_with_libunwind libc_cv_z_nodelete libc_cv_z_nodlopen libc_cv_z_initfirst libc_cv_z_relro libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie fno_unit_at_a_time libc_cv_ssp libc_cv_have_initfini no_whole_archive exceptions LIBGD have_libaudit have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons base_machine submachine sysnames INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES CXX_SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_asm_protected_directive libc_cv_cc_with_libunwind libc_cv_z_nodelete libc_cv_z_nodlopen libc_cv_z_initfirst libc_cv_z_relro libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie fno_unit_at_a_time libc_cv_ssp libc_cv_have_initfini no_whole_archive exceptions LIBGD have_libaudit have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -4487,9 +4487,17 @@ if test -n "$sysheaders"; then
   ccheaders=`$CC -print-file-name=include`
   SYSINCLUDES="-nostdinc -isystem $ccheaders \
 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
+  if test -n "$CXX"; then
+    cxxversion=`$CXX -dumpversion 2>&5` &&
+    cxxmachine=`$CXX -dumpmachine 2>&5` &&
+    cxxheaders=`$CXX -print-file-name=../../../../include/c++/`"$cxxversion" &&
+    CXX_SYSINCLUDES="-isystem $cxxheaders \
+-isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
+  fi
 fi
 
 
+
 # check if ranlib is necessary
 echo "$as_me:$LINENO: checking whether ranlib is necessary" >&5
 echo $ECHO_N "checking whether ranlib is necessary... $ECHO_C" >&6
@@ -8401,6 +8409,7 @@ s,@MAKEINFO@,$MAKEINFO,;t t
 s,@SED@,$SED,;t t
 s,@AUTOCONF@,$AUTOCONF,;t t
 s,@SYSINCLUDES@,$SYSINCLUDES,;t t
+s,@CXX_SYSINCLUDES@,$CXX_SYSINCLUDES,;t t
 s,@libc_cv_gcc_static_libgcc@,$libc_cv_gcc_static_libgcc,;t t
 s,@BASH@,$BASH,;t t
 s,@libc_cv_have_bash2@,$libc_cv_have_bash2,;t t
index ba7ca30b2f4e90afd0c0ed8c9298be5a10f0a376..4ae30ae2c9fd9a9dfcd559e448b306dda71c65dd 100644 (file)
@@ -838,8 +838,16 @@ if test -n "$sysheaders"; then
   ccheaders=`$CC -print-file-name=include`
   SYSINCLUDES="-nostdinc -isystem $ccheaders \
 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
+  if test -n "$CXX"; then
+    cxxversion=`$CXX -dumpversion 2>&AS_MESSAGE_LOG_FD` &&
+    cxxmachine=`$CXX -dumpmachine 2>&AS_MESSAGE_LOG_FD` &&
+    cxxheaders=`$CXX -print-file-name=../../../../include/c++/`"$cxxversion" &&
+    CXX_SYSINCLUDES="-isystem $cxxheaders \
+-isystem $cxxheaders/$cxxmachine -isystem $cxxheaders/backward"
+  fi
 fi
 AC_SUBST(SYSINCLUDES)
+AC_SUBST(CXX_SYSINCLUDES)
 
 # check if ranlib is necessary
 AC_CACHE_CHECK(whether ranlib is necessary, libc_cv_ranlib_necessary, [dnl
index 606246a6e13262cb55178173d3bc41d1b588e357..2196d204325050a0ee6cd690498d82af0418f328 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2002, 2003, 2004, 2006 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
@@ -25,7 +25,7 @@ static const char __libc_version[] = VERSION;
 
 static const char banner[] =
 "GNU C Library "RELEASE" release version "VERSION", by Roland McGrath et al.\n\
-Copyright (C) 2005 Free Software Foundation, Inc.\n\
+Copyright (C) 2006 Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.\n\
 There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
 PARTICULAR PURPOSE.\n\
index f7e79bce42e89b1a70aa0e369a8ab09d9b44f026..f4d971e34b3c402892cefe5b8cf6ba34d963a81e 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998, 1999, 2001, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1998,1999,2001,2003,2004,2006 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 # Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -39,7 +39,7 @@ if test $# -eq 0; then
       ;;
     --v | --ve | --ver | --vers | --versi | --versio | --version)
       echo 'catchsegv (GNU libc) @VERSION@'
-      echo 'Copyright (C) 2005 Free Software Foundation, Inc.
+      echo 'Copyright (C) 2006 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 Written by Ulrich Drepper.'
index 077b58bd1f3e86531f8152e01c94dc257fffe2a1..950ea5d20732e99d85953cdfbf6943a91deacc6b 100755 (executable)
@@ -1,5 +1,5 @@
 #! @BASH@
-# Copyright (C) 1999, 2001-2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001-2004, 2005, 2006 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 # Contributed by Ulrich Drepper <drepper@gnu.org>, 1999.
 
@@ -64,7 +64,7 @@ do_version() {
   printf $"Copyright (C) %s Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-" "2005"
+" "2006"
   printf $"Written by %s.
 " "Ulrich Drepper"
   exit 0
index 3bdb5587b1a0682a77885379498ff2ba73779583..e2d1d2f77676c4d54061946f4e39b0fa7661ca26 100644 (file)
@@ -10,7 +10,7 @@ do_test (void)
   for (int i = 0; i < 2; ++i)
     {
       void *dso = dlopen ("$ORIGIN/bug-atexit1-lib.so", RTLD_NOW);
-      void (*fn) (void) = (void (*)()) dlsym (dso, "foo");
+      void (*fn) (void) = (void (*) (void)) dlsym (dso, "foo");
       fn ();
       dlclose (dso);
       puts ("round done");
index beece51ad89be50922aee514e7a6b725bc0a88ba..3963627aa07ac0161a242cd1b40bb911e16978e0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2004, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>, 1999.
 
@@ -286,7 +286,7 @@ print_version (FILE *stream, struct argp_state *state)
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2005");
+"), "2006");
   fprintf (stream, gettext ("Written by %s.\n"),
           "Andreas Jaeger");
 }
index 4587efd1cb9f33ad88672c9b161daab1a73e32c2..100d2335d2be2519229800e9328027e0be07c1eb 100644 (file)
@@ -1,5 +1,5 @@
 #! @BASH@
-# Copyright (C) 1996-2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1996-2004, 2005, 2006 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
@@ -39,7 +39,7 @@ while test $# -gt 0; do
     printf $"Copyright (C) %s Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-" "2005"
+" "2006"
     printf $"Written by %s and %s.
 " "Roland McGrath" "Ulrich Drepper"
     exit 0
index b03fb60fa3897640f7833931f82ab133d1617c9b..026cd2acc46825ccee15d7b1437c0d9881a4a998 100644 (file)
@@ -7,7 +7,7 @@ void
 __attribute__ ((constructor))
 init (void)
 {
-  foo () - bar ();
+  (void) (foo () - bar ());
 }
 
 static void
index 71bcf0ab7149218cc5331f63267b05da22b64c49..76d129a0a035c3dab1145fbe4ba7e0263bec72e0 100644 (file)
@@ -1307,6 +1307,13 @@ ld.so does not support TLS, but program uses it!\n");
          _dl_setup_hash (l);
          l->l_relocated = 1;
 
+         /* Initialize l_local_scope to contain just this map.  This allows
+            the use of dl_lookup_symbol_x to resolve symbols within the vdso.
+            So we create a single entry list pointing to l_real as its only
+            element */
+         l->l_local_scope[0]->r_nlist = 1;
+         l->l_local_scope[0]->r_list = &l->l_real;
+
          /* Now that we have the info handy, use the DSO image's soname
             so this object can be looked up by name.  Note that we do not
             set l_name here.  That field gives the file name of the DSO,
index 9567e4689fdbd2ecbdd3704e012e216b4f596c91..e53a7ba7a36d4ef320bb5afd41381e0f211e8201 100644 (file)
@@ -1,5 +1,5 @@
 /* Read and display shared object profiling data.
-   Copyright (C) 1997-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1997-2004, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -357,7 +357,7 @@ Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
 "),
-          "2005");
+          "2006");
   fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
 }
 
index 55fb62e540cac10551fb157705c181f1721d4ebd..06bfbacb5cf5939b03368c700319bc3f3297f76a 100644 (file)
@@ -2,17 +2,17 @@
 #include <dlfcn.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 
 static int
 do_test (void)
 {
-  int i;
-  for (i = 0; i < 1000;)
+  for (int i = 0; i < 1000;)
     {
       printf ("round %d\n",++i);
 
-      void *h = dlopen ("tst-tlsmod13a.so", RTLD_LAZY);
+      void *h = dlopen ("$ORIGIN/tst-tlsmod13a.so", RTLD_LAZY);
       if (h == NULL)
        {
          printf ("cannot load: %s\n", dlerror ());
index eb64c97cd43e5a533cfd5f0b70f3a4b1652bd31d..bb723f9637a48531630907de1ed492dcf9cbdf42 100644 (file)
@@ -3,5 +3,5 @@ glibc-branch := fedora
 glibc-base := HEAD
 DIST_BRANCH := devel
 COLLECTION := dist-fc4
-fedora-sync-date := 2005-12-27 14:26 UTC
-fedora-sync-tag := fedora-glibc-20051227T1426
+fedora-sync-date := 2006-01-02 10:45 UTC
+fedora-sync-tag := fedora-glibc-20060102T1045
index 1d11a42b9e6a8ef589dacb6e53ca284079dc1de4..ff6b489d910a55252ae764535799e814443710e3 100644 (file)
@@ -602,7 +602,7 @@ rm -f $RPM_BUILD_ROOT/%{_lib}/libNoVersion*
 
 # NPTL <bits/stdio-lock.h> is not usable outside of glibc, so include
 # the generic one (#162634)
-cp -a sysdeps/generic/bits/stdio-lock.h $RPM_BUILD_ROOT%{_prefix}/include/bits/stdio-lock.h
+cp -a bits/stdio-lock.h $RPM_BUILD_ROOT%{_prefix}/include/bits/stdio-lock.h
 
 if [ -d $RPM_BUILD_ROOT%{_prefix}/info -a "%{_infodir}" != "%{_prefix}/info" ]; then
     mkdir -p $RPM_BUILD_ROOT%{_infodir}
index 1f53f911a78b6da0bfbd2ac6d2755d6315d3cc7b..0a886229f045736b210c84e45e35ccbfd981c2db 100644 (file)
@@ -1,5 +1,5 @@
 /* hairy bits of Hurd file name lookup
-   Copyright (C) 1992,1993,1994,1995,1996,1997,1999,2001,2002,2003
+   Copyright (C) 1992,1993,1994,1995,1996,1997,1999,2001,2002,2003,2005
        Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -247,7 +247,7 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)
                  char *p;
                  /* XXX want client's host */
                  if (err = __host_info (__mach_host_self (), HOST_BASIC_INFO,
-                                        (natural_t *) &hostinfo,
+                                        (integer_t *) &hostinfo,
                                         &hostinfocnt))
                    return err;
                  if (hostinfocnt != HOST_BASIC_INFO_COUNT)
index da0ca3bdb27265bc5cdb39861a996d539f2c722e..296b2eec42b3c82cf0da49366a555f1da65c04ff 100644 (file)
@@ -140,7 +140,7 @@ _S_msg_report_wait (mach_port_t msgport, thread_t thread,
          error_t err;
 
          err = __thread_get_state (thread, MACHINE_THREAD_STATE_FLAVOR,
-                                   (integer_t *) &state, &count);
+                                   (natural_t *) &state, &count);
          if (err)
            return err;
          assert (count == MACHINE_THREAD_STATE_COUNT);
index 2231518bd05dada6b8492e5eeac5ff177ef6b982..67f78c1ce5a132db7ce034bc8aa05b979ea963ea 100644 (file)
@@ -21,6 +21,7 @@
 #include <thread_state.h>
 #include <setjmp.h>
 #include <assert.h>
+#include <stdint.h>
 
 
 /* _hurd_setup_sighandler puts a link on the `active resources' chain so that
@@ -70,11 +71,19 @@ _hurdsig_longjmp_from_handler (void *data, jmp_buf env, int val)
 
       struct hurd_userlink *link;
 
+      inline uintptr_t demangle_ptr (uintptr_t x)
+       {
+# ifdef PTR_DEMANGLE
+         PTR_DEMANGLE (x);
+# endif
+         return x;
+       }
+
       /* Continue _longjmp_unwind's job of running the unwind
         forms for frames being unwound, since we will not
         return to its loop like this one, which called us.  */
       for (link = ss->active_resources;
-          link && _JMPBUF_UNWINDS (env[0].__jmpbuf, link);
+          link && _JMPBUF_UNWINDS (env[0].__jmpbuf, link, demangle_ptr);
           link = link->thread.next)
        if (_hurd_userlink_unlink (link))
          {
index a7036af99c0a1f4c47e68693dc6f49bbbd30a7e6..033cd93f23bfe932658e332f1e61d259e73f6ebc 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert text in given files from the specified from-set to the to-set.
-   Copyright (C) 1998-2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1998-2004, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -426,7 +426,7 @@ print_version (FILE *stream, struct argp_state *state)
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2005");
+"), "2006");
   fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
 }
 
index 96a86191e9afad4b507209714cecc73aa7824cfc..9d235203148fced408a67b9901be17b20dc94a76 100644 (file)
@@ -1,5 +1,5 @@
 /* Generate fastloading iconv module configuration files.
-   Copyright (C) 2000-2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2000-2004, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2000.
 
@@ -395,7 +395,7 @@ print_version (FILE *stream, struct argp_state *state)
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2005");
+"), "2006");
   fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
 }
 
index f6bfebd39f3aef468ed4faa0fdbf3a61a8946785..4469034b93e5912f1a45850914b1d32e826834f6 100644 (file)
@@ -15,7 +15,7 @@ xiconv (iconv_t cd, int out_size)
 {
   unsigned char euc[4];
   char *inp = (char *) UCS_STR;
-  char *outp = euc;
+  char *outp = (char *) euc;
   size_t inbytesleft = strlen (UCS_STR);
   size_t outbytesleft = out_size;
   size_t ret;
diff --git a/include/sys/xattr.h b/include/sys/xattr.h
new file mode 100644 (file)
index 0000000..64f8f56
--- /dev/null
@@ -0,0 +1 @@
+#include <misc/sys/xattr.h>
index e529b7d832ab211743f3fe11db07eef76e5115ca..45db478423d1019026414d3ab7b8332dcf279865 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1997,1998,1999,2000,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1993,1997-2000,2002,2005 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
@@ -87,9 +87,9 @@ _IO_getwline_info (fp, buf, n, delim, extract_delim, eof)
                *ptr++ = wc;
              else if (extract_delim < 0)
                INTUSE(_IO_sputbackc) (fp, wc);
-             return ptr - buf;
              if (extract_delim > 0)
                ++len;
+             return ptr - buf;
            }
          *ptr++ = wc;
          n--;
index 19300e80a32f7392b05be90ef5e483b246e31e1c..1167a93d0bed67978713791b59101e14ca95364d 100644 (file)
@@ -1,5 +1,6 @@
 /* Print output of stream to given obstack.
-   Copyright (C) 1996,1997,1999-2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1996,1997,1999,2000,2001,2002,2003,2004,2005
+       Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -23,6 +24,7 @@
 #include <stdlib.h>
 #endif
 #include "libioP.h"
+#include "strfile.h"
 #include <assert.h>
 #include <string.h>
 #include <errno.h>
index 526eb2b929b5f077b17daf773418373992b0ade6..a03974e8a13d1619960c9c4b2a5dee5db2efc709 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the locale program according to POSIX 9945-2.
-   Copyright (C) 1995-1997, 1999-2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1995-1997, 1999-2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1995.
 
@@ -275,7 +275,7 @@ print_version (FILE *stream, struct argp_state *state)
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2005");
+"), "2006");
   fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
 }
 
index dfabaa9f8acabede4c6c85fab0f00a35bfdd3c19..645a803c0624601569f08a92ebbc8a3f2c8c169f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2004, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1995.
 
@@ -387,7 +387,7 @@ print_version (FILE *stream, struct argp_state *state)
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2005");
+"), "2006");
   fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
 }
 
index 86bbdd5b13b68a52ce937f22fe658da4f50bda6d..de8998cc7a607e017ff5e49aabff3bf617fafe2a 100644 (file)
@@ -146,13 +146,13 @@ insert_entry_2 (htab, key, keylen, hval, idx, data)
   if ((hash_entry *) htab->first == NULL)
     {
       table[idx].next = &table[idx];
-      *(hash_entry **) &htab->first = &table[idx];
+      htab->first = &table[idx];
     }
   else
     {
       table[idx].next = ((hash_entry *) htab->first)->next;
       ((hash_entry *) htab->first)->next = &table[idx];
-      *(hash_entry **) &htab->first = &table[idx];
+      htab->first = &table[idx];
     }
 
   ++htab->filled;
index b2e08c6039ea52b3053962151e9a8372254e4e91..16413cf868372fca3e8d44ee4810e918fca8c67f 100755 (executable)
@@ -1,5 +1,5 @@
 #! @BASH@
-# Copyright (C) 1999-2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1999-2004, 2005, 2006 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 # Contributed by Ulrich Drepper <drepper@gnu.org>, 1999.
 
@@ -71,7 +71,7 @@ do_version() {
   printf $"Copyright (C) %s Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-" "2005"
+" "2006"
   printf $"Written by %s.
 " "Ulrich Drepper"
   exit 0
index 0036f33f5918ffacc3041d9ee5d34cc41678eecf..8a0fbc7e95b47337572724005bd5ba44fc287bfc 100644 (file)
@@ -1,7 +1,7 @@
 #! @PERL@
 eval "exec @PERL@ -S $0 $*"
     if 0;
-# Copyright (C) 1997-2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1997-2004, 2005, 2006 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 # Contributed by Ulrich Drepper <drepper@gnu.org>, 1997.
 # Based on the mtrace.awk script.
@@ -45,7 +45,7 @@ arglist: while (@ARGV) {
        $ARGV[0] eq "--vers" || $ARGV[0] eq "--versi" ||
        $ARGV[0] eq "--versio" || $ARGV[0] eq "--version") {
        print "mtrace (GNU $PACKAGE) $VERSION\n";
-       print "Copyright (C) 2005 Free Software Foundation, Inc.\n";
+       print "Copyright (C) 2006 Free Software Foundation, Inc.\n";
        print "This is free software; see the source for copying conditions.  There is NO\n";
        print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
        print "Written by Ulrich Drepper <drepper\@gnu.org>\n";
index dbc97f2f12f79e31fb51b1911dfd1f31b2a86dc5..c8ae3772662d27d60570bdda14c6ad9fd75a6582 100644 (file)
@@ -1250,10 +1250,10 @@ result is passed back as the return value of the function in a block of
 memory allocated with @code{malloc}.  If the result is not used anymore
 the memory should be freed with a call to @code{free}.
 
-In any of the path components except the last one is missing the
-function returns a NULL pointer.  This is also what is returned if the
-length of the path reaches or exceeds @code{PATH_MAX} characters.  In
-any case @code{errno} is set accordingly.
+If any of the path components is missing the function returns a NULL
+pointer.  This is also what is returned if the length of the path
+reaches or exceeds @code{PATH_MAX} characters.  In any case
+@code{errno} is set accordingly.
 
 @table @code
 @item ENAMETOOLONG
index 0b29a61e0decbd684f377858a45271bf2d15d3b7..b56a261696ccd4694733a19e3394a35b42474089 100644 (file)
@@ -1,3 +1,43 @@
+2006-01-01  Ulrich Drepper  <drepper@redhat.com>
+
+       * version.c: Update copyright year.
+
+2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
+
+       * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
+       .eh_frame section, use cfi_* directives.
+       * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
+
+2005-12-30  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
+       now.
+
+2005-12-29  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/pthread/sigaction.c: Removed.
+       * sigaction.c: New file.
+       * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
+
+2005-12-28  Ulrich Drepper  <drepper@redhat.com>
+
+       * Makefile (tests): Add tst-signal7.
+       * tst-signal7.c: New file.
+
+2005-12-27  Roland McGrath  <roland@redhat.com>
+
+       * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
+       (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
+       * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
+       * sysdeps/i386/jmpbuf-unwind.h: Likewise.
+       * sysdeps/mips/jmpbuf-unwind.h: Likewise.
+       * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
+       * sysdeps/s390/jmpbuf-unwind.h: Likewise.
+       * sysdeps/sh/jmpbuf-unwind.h: Likewise.
+       * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
+       * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
+
 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
index a3b11730a11ecf4f3149b348860190e53b26d3ed..b15b8ad23a95528421f41a409f998bb22f41009c 100644 (file)
@@ -229,7 +229,7 @@ tests = tst-typesizes \
        tst-cleanup0 tst-cleanup1 tst-cleanup2 tst-cleanup3 tst-cleanup4 \
        tst-flock1 tst-flock2 \
        tst-signal1 tst-signal2 tst-signal3 tst-signal4 tst-signal5 \
-       tst-signal6 \
+       tst-signal6 tst-signal7 \
        tst-exec1 tst-exec2 tst-exec3 tst-exec4 \
        tst-exit1 tst-exit2 tst-exit3 \
        tst-stdio1 tst-stdio2 \
similarity index 66%
rename from nptl/sysdeps/pthread/sigaction.c
rename to nptl/sigaction.c
index 445a2cb36fae1448cbb9e157d2c62a491d019548..60e1f1d355e9e586b4faaa313a8344a560890628 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-/* This is tricky.  GCC doesn't like #include_next in the primary
-   source file and even if it did, the first #include_next is this
-   exact file anyway.  */
-#ifndef LIBC_SIGACTION
+
+/* This is no complete implementation.  The file is meant to be
+   included in the real implementation to provide the wrapper around
+   __libc_sigaction.  */
 
 #include <nptl/pthreadP.h>
 
 /* We use the libc implementation but we tell it to not allow
    SIGCANCEL or SIGTIMER to be handled.  */
-# define LIBC_SIGACTION        1
+#define LIBC_SIGACTION 1
 
-/* Note this include must be one that isn't found using a -I directory such
-   as -I. or -I.. for using an explicit <sysdeps/...> path, because that
-   would reset the search path starting position for the #include_next
-   below, to after that -I directory, and skip the search we want to do.  */
-# include "sigaction.c"
 
 int
 __sigaction (sig, act, oact)
@@ -50,9 +45,3 @@ __sigaction (sig, act, oact)
 }
 libc_hidden_weak (__sigaction)
 weak_alias (__sigaction, sigaction)
-
-#else
-
-# include_next <sigaction.c>
-
-#endif /* LIBC_SIGACTION */
index 5cef8b1cf54d23987f6a80381fa9228cd4075fc5..83b7a01a0e9b14db400d108e824c43133d36e692 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 
 #include <setjmp.h>
 #include <stdint.h>
 #include <unwind.h>
+#include <sysdep.h>
 
 #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
   _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
 
+static inline uintptr_t __attribute__ ((unused))
+_jmpbuf_sp (__jmp_buf regs)
+{
+  uintptr_t sp = regs[JB_SP];
+#ifdef PTR_DEMANGLE
+  PTR_DEMANGLE (sp);
+#endif
+  return sp;
+}
+
 #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
-  ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
+  ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
 
 /* We use the normal lobngjmp for unwinding.  */
 #define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
index 5cef8b1cf54d23987f6a80381fa9228cd4075fc5..83b7a01a0e9b14db400d108e824c43133d36e692 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 
 #include <setjmp.h>
 #include <stdint.h>
 #include <unwind.h>
+#include <sysdep.h>
 
 #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
   _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
 
+static inline uintptr_t __attribute__ ((unused))
+_jmpbuf_sp (__jmp_buf regs)
+{
+  uintptr_t sp = regs[JB_SP];
+#ifdef PTR_DEMANGLE
+  PTR_DEMANGLE (sp);
+#endif
+  return sp;
+}
+
 #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
-  ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
+  ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
 
 /* We use the normal lobngjmp for unwinding.  */
 #define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
index 67cc969663cd154a04367a88e3666a2c3cf381ef..9ee03100e6b54760fbc778bc8c74c6b362dda4c6 100644 (file)
 #include <setjmp.h>
 #include <stdint.h>
 #include <unwind.h>
+#include <sysdep.h>
 
 #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
   _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
 
+static inline uintptr_t __attribute__ ((unused))
+_jmpbuf_sp (__jmp_buf regs)
+{
+  uintptr_t sp = regs[0].__sp;
+#ifdef PTR_DEMANGLE
+  PTR_DEMANGLE (sp);
+#endif
+  return sp;
+}
+
 #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
-  ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[0].__sp - (_adj))
+  ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
 
 /* We use the normal longjmp for unwinding.  */
 #define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
index 0b817160d36508b41c7d13777b75f300838eb825..d9090a591dc21eb54b16c1ec33a15103e184e353 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 
 #include <setjmp.h>
 #include <stdint.h>
 #include <unwind.h>
+#include <sysdep.h>
 
 #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
   _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
 
+static inline uintptr_t __attribute__ ((unused))
+_jmpbuf_sp (__jmp_buf regs)
+{
+  uintptr_t sp = regs[JB_GPR1];
+#ifdef PTR_DEMANGLE
+  PTR_DEMANGLE (sp);
+#endif
+  return sp;
+}
+
 #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
-  ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_GPR1] - (_adj))
+  ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
 
 /* We use the normal lobngjmp for unwinding.  */
 #define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
index 9f7e1ad5839130886a885f4ce1c7d6ae9ba70ea3..81fa5825400581d7b285249faa8ac48dd4505098 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 
@@ -21,6 +21,7 @@
 #include <stdint.h>
 #include <unwind.h>
 #include <bits/wordsize.h>
+#include <sysdep.h>
 
 /* On s390{,x}, CFA is always 96 (resp. 160) bytes above actual
    %r15.  */
                       (void *) (_Unwind_GetCFA (_context)      \
                                 - 32 - 2 * __WORDSIZE), _adj)
 
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj)           \
-  ((uintptr_t) (_address) - (_adj)                             \
-   < (uintptr_t) (_jmpbuf)->__gregs[__JB_GPR15] - (_adj))
+static inline uintptr_t __attribute__ ((unused))
+_jmpbuf_sp (__jmp_buf regs)
+{
+  uintptr_t sp = regs[0].__gregs[__JB_GPR15];
+#ifdef PTR_DEMANGLE
+  PTR_DEMANGLE (sp);
+#endif
+  return sp;
+}
+
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
+  ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
 
 /* We use the normal longjmp for unwinding.  */
 #define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
index cf6d25f04145c8a150a5d158507cfd471d83cd29..3ef178b4d644d3e3800e15d9da04370c93363492 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 
 #include <setjmp.h>
 #include <stdint.h>
 #include <unwind.h>
+#include <sysdep.h>
 
 #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
   _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
 
-#define _JMPBUF_UNWINDS_ADJ(jmpbuf, address, adj) \
-  ((uintptr_t) (address) - (adj) < (uintptr_t) (jmpbuf)[0].__regs[7] - (adj))
+static inline uintptr_t __attribute__ ((unused))
+_jmpbuf_sp (__jmp_buf regs)
+{
+  uintptr_t sp = regs[0].__regs[7];
+#ifdef PTR_DEMANGLE
+  PTR_DEMANGLE (sp);
+#endif
+  return sp;
+}
+
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
+  ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
 
 /* We use the normal lobngjmp for unwinding.  */
 #define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
index 5cef8b1cf54d23987f6a80381fa9228cd4075fc5..83b7a01a0e9b14db400d108e824c43133d36e692 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 
 #include <setjmp.h>
 #include <stdint.h>
 #include <unwind.h>
+#include <sysdep.h>
 
 #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
   _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
 
+static inline uintptr_t __attribute__ ((unused))
+_jmpbuf_sp (__jmp_buf regs)
+{
+  uintptr_t sp = regs[JB_SP];
+#ifdef PTR_DEMANGLE
+  PTR_DEMANGLE (sp);
+#endif
+  return sp;
+}
+
 #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
-  ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
+  ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
 
 /* We use the normal lobngjmp for unwinding.  */
 #define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
index 77321aad3fdd620c5ade11d932ee0e16b00ce830..7752fe971ec5cc915647357e89c66887f315b6a5 100644 (file)
 #include <setjmp.h>
 #include <stdint.h>
 #include <unwind.h>
+#include <sysdep.h>
 
 #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
   _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
 
+static inline uintptr_t __attribute__ ((unused))
+_jmpbuf_sp (__jmp_buf regs)
+{
+  uintptr_t sp = regs[0].uc_mcontext.mc_fp;
+#ifdef PTR_DEMANGLE
+  PTR_DEMANGLE (sp);
+#endif
+  return sp;
+}
+
 #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
-  ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[0].uc_mcontext.mc_fp - (_adj))
+  ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
 
 /* We use the normal lobngjmp for unwinding.  */
 #define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
index 991398242a4c15053a423f284cd47874b4d81277..14f513c127fd48c56f6ec98cb63d372baff65188 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 # Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -32,3 +32,6 @@ CFLAGS-fork.c = -D_IO_MTSAFE_IO
 CFLAGS-getpid.o = -fomit-frame-pointer
 CFLAGS-getpid.os = -fomit-frame-pointer
 endif
+
+# Needed in both the signal and nptl subdir.
+CFLAGS-sigaction.c = -DWRAPPER_INCLUDE='<nptl/sigaction.c>'
index b4826ef7aaa32a57e22a5ed3f20c06e2550d3d29..ac3169889fcc125a5ec499ca7a180fc9e580f8f1 100644 (file)
        .type   __lll_mutex_lock_wait,@function
        .hidden __lll_mutex_lock_wait
        .align  5
+       cfi_startproc
 __lll_mutex_lock_wait:
        mov.l   r8, @-r15
+       cfi_adjust_cfa_offset(4)
+       cfi_rel_offset (r8, 0)
        mov     r4, r6
        mov     r5, r8
        mov     #0, r7          /* No timeout.  */
@@ -59,6 +62,7 @@ __lll_mutex_lock_wait:
        mov.l   @r15+, r8
        ret
         mov    r2, r0
+       cfi_endproc
        .size   __lll_mutex_lock_wait,.-__lll_mutex_lock_wait
 
 
@@ -67,6 +71,7 @@ __lll_mutex_lock_wait:
        .type   __lll_mutex_timedlock_wait,@function
        .hidden __lll_mutex_timedlock_wait
        .align  5
+       cfi_startproc
 __lll_mutex_timedlock_wait:
        /* Check for a valid timeout value.  */
        mov.l   @(4,r6), r1
@@ -75,14 +80,21 @@ __lll_mutex_timedlock_wait:
        bt      3f
 
        mov.l   r10, @-r15
+       cfi_adjust_cfa_offset(4)
+       cfi_rel_offset (r10, 0)
        mov.l   r9, @-r15
+       cfi_adjust_cfa_offset(4)
+       cfi_rel_offset (r9, 0)
        mov.l   r8, @-r15
+       cfi_adjust_cfa_offset(4)
+       cfi_rel_offset (r8, 0)
        mov     r4, r10
        mov     r6, r9
        mov     r5, r8
 
        /* Stack frame for the timespec and timeval structs.  */
        add     #-8, r15
+       cfi_adjust_cfa_offset(8)
 
 1:
        /* Get current time.  */
@@ -162,6 +174,7 @@ __lll_mutex_timedlock_wait:
 5:
        bra     6b
         mov    #ETIMEDOUT, r0
+       cfi_endproc
 
 .L1k:
        .word   1000
@@ -178,6 +191,7 @@ __lll_mutex_timedlock_wait:
        .type   lll_unlock_wake_cb,@function
        .hidden lll_unlock_wake_cb
        .align  5
+       cfi_startproc
 lll_unlock_wake_cb:
        DEC     (@r4, r2)
        tst     r2, r2
@@ -195,6 +209,7 @@ lll_unlock_wake_cb:
 1:     
        rts
         nop
+       cfi_endproc
        .size   lll_unlock_wake_cb,.-lll_unlock_wake_cb
 #endif
 
@@ -203,6 +218,7 @@ lll_unlock_wake_cb:
        .type   __lll_mutex_unlock_wake,@function
        .hidden __lll_mutex_unlock_wake
        .align  5
+       cfi_startproc
 __lll_mutex_unlock_wake:
        mov     #FUTEX_WAKE, r5
        mov     #1, r6          /* Wake one thread.  */
@@ -214,6 +230,7 @@ __lll_mutex_unlock_wake:
        SYSCALL_INST_PAD
        rts
         nop
+       cfi_endproc
        .size   __lll_mutex_unlock_wake,.-__lll_mutex_unlock_wake
 
 
@@ -222,14 +239,20 @@ __lll_mutex_unlock_wake:
        .type   __lll_timedwait_tid,@function
        .hidden __lll_timedwait_tid
        .align  5
+       cfi_startproc
 __lll_timedwait_tid:
        mov.l   r9, @-r15
+       cfi_adjust_cfa_offset(4)
+       cfi_rel_offset (r9, 0)
        mov.l   r8, @-r15
+       cfi_adjust_cfa_offset(4)
+       cfi_rel_offset (r8, 0)
        mov     r4, r8
        mov     r5, r9
 
        /* Stack frame for the timespec and timeval structs.  */
        add     #-8, r15
+       cfi_adjust_cfa_offset(8)
 
 2:
        /* Get current time.  */
@@ -292,6 +315,7 @@ __lll_timedwait_tid:
 6:
        bra     3b
         mov    #ETIMEDOUT, r0
+       cfi_endproc
 
 .L1k2:
        .word   1000
index fc3c2340b6055d6320205d9427363906ebffa082..9a967eaf5372cf7e0b894f950cc227170afe4b1a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005 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
     .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
  .Lpseudo_cancel: \
     sts.l pr,@-r15; \
- .LCFI0: \
+    cfi_adjust_cfa_offset (4); \
+    cfi_rel_offset (pr, 0); \
     add _IMM16,r15; \
+    cfi_adjust_cfa_offset (16); \
     SAVE_ARGS_##args; \
- .LCFI1: \
     CENABLE; \
     LOAD_ARGS_##args; \
     add _IMP16,r15; \
.LCFI2: \
   cfi_adjust_cfa_offset (-16); \
     lds.l @r15+,pr; \
- .LCFI3: \
+    cfi_adjust_cfa_offset (-4); \
+    cfi_restore (pr); \
     DO_CALL(syscall_name, args); \
     SYSCALL_INST_PAD; \
     sts.l pr,@-r15; \
- .LCFI4: \
+    cfi_adjust_cfa_offset (4); \
+    cfi_rel_offset (pr, 0); \
     mov.l r0,@-r15; \
- .LCFI5: \
+    cfi_adjust_cfa_offset (4); \
+    cfi_rel_offset (r0, 0); \
     CDISABLE; \
     mov.l @r15+,r0; \
.LCFI6: \
   cfi_adjust_cfa_offset (-4); \
     lds.l @r15+,pr; \
- .LCFI7: \
+    cfi_adjust_cfa_offset (-4); \
+    cfi_restore (pr); \
     mov r0,r1; \
     mov _IMM12,r2; \
     shad r2,r1; \
     bf .Lpseudo_end; \
  .Lsyscall_error: \
     SYSCALL_ERROR_HANDLER; \
- .Lpseudo_end: \
- /* Create unwinding information for the syscall wrapper.  */ \
- .section .eh_frame,"a",@progbits; \
- .Lframe1: \
-    .ualong .LECIE1-.LSCIE1; \
- .LSCIE1: \
-    .ualong 0x0; \
-    .byte   0x1; \
-    AUGMENTATION_STRING; \
-    .uleb128 0x1; \
-    .sleb128 -4; \
-    .byte   0x11; \
-    AUGMENTATION_PARAM; \
-    .byte   0xc; \
-    .uleb128 0xf; \
-    .uleb128 0x0; \
-    .align 2; \
- .LECIE1: \
- .LSFDE1: \
-    .ualong .LEFDE1-.LASFDE1; \
- .LASFDE1: \
-    .ualong .LASFDE1-.Lframe1; \
-    START_SYMBOL_REF; \
-    .ualong .Lpseudo_end - .Lpseudo_start; \
-    AUGMENTATION_PARAM_FDE; \
-    .byte   0x4; \
-    .ualong .LCFI0-.Lpseudo_start; \
-    .byte   0xe; \
-    .uleb128 0x4; \
-    .byte   0x91; \
-    .uleb128 0x1; \
-    .byte   0x4; \
-    .ualong .LCFI1-.LCFI0; \
-    .byte   0xe; \
-    .uleb128 0x14; \
-    FRAME_REG_##args; \
-    .byte   0x4; \
-    .ualong .LCFI2-.LCFI1; \
-    .byte   0xe; \
-    .uleb128 0x4; \
-    .byte   0x4; \
-    .ualong .LCFI3-.LCFI2; \
-    .byte   0xe; \
-    .uleb128 0x0; \
-    .byte   0xd1; \
-    .byte   0x4; \
-    .ualong .LCFI4-.LCFI3; \
-    .byte   0xe; \
-    .uleb128 0x4; \
-    .byte   0x91; \
-    .uleb128 0x1; \
-    .byte   0x4; \
-    .ualong .LCFI5-.LCFI4; \
-    .byte   0xe; \
-    .uleb128 0x8; \
-    .byte   0x80; \
-    .uleb128 0x2; \
-    .byte   0x4; \
-    .ualong .LCFI6-.LCFI5; \
-    .byte   0xe; \
-    .uleb128 0x4; \
-    .byte   0xc0; \
-    .byte   0x4; \
-    .ualong .LCFI7-.LCFI6; \
-    .byte   0xe; \
-    .uleb128 0x0; \
-    .byte   0xd1; \
-    .align 2; \
- .LEFDE1: \
- .previous
-
-# ifdef SHARED
-#  define AUGMENTATION_STRING .string "zR"
-#  define AUGMENTATION_PARAM .uleb128 1; .byte 0x1b
-#  define AUGMENTATION_PARAM_FDE .uleb128 0
-#  define START_SYMBOL_REF .long .Lpseudo_start-.
-# else
-#  define AUGMENTATION_STRING .ascii "\0"
-#  define AUGMENTATION_PARAM
-#  define AUGMENTATION_PARAM_FDE
-#  define START_SYMBOL_REF .long .Lpseudo_start
-# endif
-
-# define FRAME_REG_0   /* Nothing.  */
-# define FRAME_REG_1   FRAME_REG_0; .byte 0x84; .uleb128 5
-# define FRAME_REG_2   FRAME_REG_1; .byte 0x85; .uleb128 4
-# define FRAME_REG_3   FRAME_REG_2; .byte 0x86; .uleb128 3
-# define FRAME_REG_4   FRAME_REG_3; .byte 0x87; .uleb128 2
-# define FRAME_REG_5   FRAME_REG_4
-# define FRAME_REG_6   FRAME_REG_5
+ .Lpseudo_end:
 
 # undef PSEUDO_END
 # define PSEUDO_END(sym) \
   END (sym)
 
 # define SAVE_ARGS_0   /* Nothing.  */
-# define SAVE_ARGS_1   SAVE_ARGS_0; mov.l r4,@(0,r15)
-# define SAVE_ARGS_2   SAVE_ARGS_1; mov.l r5,@(4,r15)
-# define SAVE_ARGS_3   SAVE_ARGS_2; mov.l r6,@(8,r15)
-# define SAVE_ARGS_4   SAVE_ARGS_3; mov.l r7,@(12,r15)
+# define SAVE_ARGS_1   SAVE_ARGS_0; mov.l r4,@(0,r15); cfi_offset (r4,-4)
+# define SAVE_ARGS_2   SAVE_ARGS_1; mov.l r5,@(4,r15); cfi_offset (r5,-8)
+# define SAVE_ARGS_3   SAVE_ARGS_2; mov.l r6,@(8,r15); cfi_offset (r6,-12)
+# define SAVE_ARGS_4   SAVE_ARGS_3; mov.l r7,@(12,r15); cfi_offset (r7,-16)
 # define SAVE_ARGS_5   SAVE_ARGS_4
 # define SAVE_ARGS_6   SAVE_ARGS_5
 
index 345ed557c5e2fab685b45d7a7311f7814c3d6296..1a36c53d119d95523d493905821fb86fbb07eaed 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 
 #include <setjmp.h>
 #include <stdint.h>
 #include <unwind.h>
+#include <sysdep.h>
 
 #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
   _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
 
+static inline uintptr_t __attribute__ ((unused))
+_jmpbuf_sp (__jmp_buf regs)
+{
+  uintptr_t sp = regs[JB_RSP];
+#ifdef PTR_DEMANGLE
+  PTR_DEMANGLE (sp);
+#endif
+  return sp;
+}
+
 #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
-  ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_RSP] - (_adj))
+  ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
 
 /* We use the normal lobngjmp for unwinding.  */
 #define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
diff --git a/nptl/tst-robust7.c b/nptl/tst-robust7.c
new file mode 100644 (file)
index 0000000..2c5acb4
--- /dev/null
@@ -0,0 +1,195 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2005.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <pthread.h>
+#include <stdbool.h>
+#include <stdio.h>
+
+
+static pthread_barrier_t b;
+static pthread_cond_t c = PTHREAD_COND_INITIALIZER;
+static pthread_mutex_t m;
+static bool first = true;
+
+
+static void *
+tf (void *arg)
+{
+  long int n = (long int) arg;
+
+  if (pthread_mutex_lock (&m) != 0)
+    {
+      printf ("thread %ld: mutex_lock failed\n", n + 1);
+      exit (1);
+    }
+
+  int e = pthread_barrier_wait (&b);
+  if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
+    {
+      printf ("thread %ld: barrier_wait failed\n", n + 1);
+      exit (1);
+    }
+
+  e = pthread_cond_wait (&c, &m);
+  if (first)
+    {
+      if (e != 0)
+       {
+         printf ("thread %ld: cond_wait failed\n", n + 1);
+         exit (1);
+       }
+      first = false;
+    }
+  else
+    {
+      if (e != EOWNERDEAD)
+       {
+         printf ("thread %ld: cond_wait did not return EOWNERDEAD\n", n + 1);
+         exit (1);
+       }
+    }
+
+  if (pthread_cancel (pthread_self ()) != 0)
+    {
+      printf ("thread %ld: cancel failed\n", n + 1);
+      exit (1);
+    }
+
+  pthread_testcancel ();
+
+  printf ("thread %ld: testcancel returned\n", n + 1);
+  exit (1);
+}
+
+
+static int
+do_test (void)
+{
+  pthread_mutexattr_t a;
+  if (pthread_mutexattr_init (&a) != 0)
+    {
+      puts ("mutexattr_init failed");
+      return 1;
+    }
+
+  if (pthread_mutexattr_setrobust_np (&a, PTHREAD_MUTEX_ROBUST_NP) != 0)
+    {
+      puts ("mutexattr_setrobust failed");
+      return 1;
+    }
+
+  if (pthread_mutex_init (&m, &a) != 0)
+    {
+      puts ("mutex_init failed");
+      return 1;
+    }
+
+  if (pthread_mutexattr_destroy (&a) != 0)
+    {
+      puts ("mutexattr_destroy failed");
+      return 1;
+    }
+
+  if (pthread_barrier_init (&b, NULL, 2) != 0)
+    {
+      puts ("barrier_init failed");
+      return 1;
+    }
+
+#define N 5
+  pthread_t th[N];
+  for (long int n = 0; n < N; ++n)
+    {
+      if (pthread_create (&th[n], NULL, tf, (void *) n) != 0)
+       {
+         printf ("pthread_create loop %ld failed\n", n + 1);
+         return 1;
+       }
+
+      int e = pthread_barrier_wait (&b);
+      if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
+       {
+         printf ("parent: barrier_wait failed in round %ld\n", n + 1);
+         return 1;
+       }
+    }
+
+  if (pthread_mutex_lock (&m) != 0)
+    {
+      puts ("parent: mutex_lock failed");
+      return 1;
+    }
+
+  if (pthread_mutex_unlock (&m) != 0)
+    {
+      puts ("parent: mutex_unlock failed");
+      return 1;
+    }
+
+  if (pthread_cond_broadcast (&c) != 0)
+    {
+      puts ("cond_broadcast failed");
+      return 1;
+    }
+
+  for (int n = 0; n < N; ++n)
+    {
+      void *res;
+      if (pthread_join (th[n], &res) != 0)
+       {
+         printf ("join round %d failed\n", n + 1);
+         return 1;
+       }
+      if (res != PTHREAD_CANCELED)
+       {
+         printf ("thread %d not canceled\n", n + 1);
+         return 1;
+       }
+    }
+
+  int e = pthread_mutex_lock (&m);
+  if (e == 0)
+    {
+      puts ("parent: 2nd mutex_lock succeeded");
+      return 1;
+    }
+  if (e != EOWNERDEAD)
+    {
+      puts ("parent: mutex_lock did not return EOWNERDEAD");
+      return 1;
+    }
+
+  if (pthread_mutex_unlock (&m) != 0)
+    {
+      puts ("parent: 2nd mutex_unlock failed");
+      return 1;
+    }
+
+  if (pthread_mutex_destroy (&m) != 0)
+    {
+      puts ("mutex_destroy failed");
+      return 1;
+    }
+
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/nptl/tst-signal7.c b/nptl/tst-signal7.c
new file mode 100644 (file)
index 0000000..82ef11c
--- /dev/null
@@ -0,0 +1,59 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2005.
+
+   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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <pthreadP.h>
+#include <signal.h>
+#include <stdio.h>
+
+
+static int
+do_test (void)
+{
+  int result = 0;
+
+  errno = 0;
+  if (sigaction (SIGCANCEL, NULL, NULL) == 0)
+    {
+      puts ("sigaction(SIGCANCEL) did not fail");
+      result = 1;
+    }
+  else if (errno != EINVAL)
+    {
+      puts ("sigaction(SIGCANCEL) did not set errno to EINVAL");
+      result = 1;
+    }
+
+  errno = 0;
+  if (sigaction (SIGSETXID, NULL, NULL) == 0)
+    {
+      puts ("sigaction(SIGSETXID) did not fail");
+      result = 1;
+    }
+  else if (errno != EINVAL)
+    {
+      puts ("sigaction(SIGSETXID) did not set errno to EINVAL");
+      result = 1;
+    }
+
+  return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
index 1be6b7f4a57621f151c46eb2d440e08effcb169a..b69556e948aa1e336093b94c082617afb56a9aec 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -23,7 +23,7 @@
 
 static const char banner[] =
 #include "banner.h"
-"Copyright (C) 2005 Free Software Foundation, Inc.\n\
+"Copyright (C) 2006 Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.\n\
 There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
 PARTICULAR PURPOSE.\n"
index 632635845b24f585985a655a97585d1ec28c19ce..9c096e2e05486724d3d9d6725f02237d4de9c0f9 100644 (file)
@@ -431,7 +431,7 @@ void
 nscd_init (void)
 {
   /* Secure mode and unprivileged mode are incompatible */
-  if (server_user != NULL && secure_in_use)
+  if (server_user != NULL)
     {
       dbg_log (_("Cannot run nscd in secure mode as unprivileged user"));
       exit (4);
@@ -1060,29 +1060,28 @@ cannot handle old request version %d; current version is %d"),
     case GETSTAT:
     case SHUTDOWN:
     case INVALIDATE:
-      if (! secure_in_use)
-       {
-         /* Get the callers credentials.  */
+      {
+       /* Get the callers credentials.  */
 #ifdef SO_PEERCRED
-         struct ucred caller;
-         socklen_t optlen = sizeof (caller);
+       struct ucred caller;
+       socklen_t optlen = sizeof (caller);
 
-         if (getsockopt (fd, SOL_SOCKET, SO_PEERCRED, &caller, &optlen) < 0)
-           {
-             char buf[256];
+       if (getsockopt (fd, SOL_SOCKET, SO_PEERCRED, &caller, &optlen) < 0)
+         {
+           char buf[256];
 
-             dbg_log (_("error getting callers id: %s"),
-                      strerror_r (errno, buf, sizeof (buf)));
-             break;
-           }
+           dbg_log (_("error getting callers id: %s"),
+                    strerror_r (errno, buf, sizeof (buf)));
+           break;
+         }
 
-         uid = caller.uid;
+       uid = caller.uid;
 #else
-         /* Some systems have no SO_PEERCRED implementation.  They don't
-            care about security so we don't as well.  */
-         uid = 0;
+       /* Some systems have no SO_PEERCRED implementation.  They don't
+          care about security so we don't as well.  */
+       uid = 0;
 #endif
-       }
+      }
 
       /* Accept shutdown, getstat and invalidate only from root.  For
         the stat call also allow the user specified in the config file.  */
@@ -1376,25 +1375,7 @@ nscd_run (void *p)
 #ifdef SO_PEERCRED
       pid_t pid = 0;
 
-      if (secure_in_use)
-       {
-         struct ucred caller;
-         socklen_t optlen = sizeof (caller);
-
-         if (getsockopt (fd, SOL_SOCKET, SO_PEERCRED, &caller, &optlen) < 0)
-           {
-             dbg_log (_("error getting callers id: %s"),
-                      strerror_r (errno, buf, sizeof (buf)));
-             goto close_and_out;
-           }
-
-         if (req.type < GETPWBYNAME || req.type > LASTDBREQ
-             || serv2db[req.type]->secure)
-           uid = caller.uid;
-
-         pid = caller.pid;
-       }
-      else if (__builtin_expect (debug_level > 0, 0))
+      if (__builtin_expect (debug_level > 0, 0))
        {
          struct ucred caller;
          socklen_t optlen = sizeof (caller);
index 3c65e20a602fe73263ef7b535f935b3e6551a24d..2941cbdc159a5e39529c375cd72d37b6ee18a88e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998-2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (c) 1998-2003, 2004, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998.
 
@@ -70,7 +70,6 @@ int disabled_passwd;
 int disabled_group;
 int go_background = 1;
 
-int secure_in_use;
 static const char *conffile = _PATH_NSCDCONF;
 
 time_t start_time;
@@ -370,16 +369,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
       break;
 
     case 'S':
-#if 0
-      if (strcmp (arg, "passwd,yes") == 0)
-       secure_in_use = dbs[pwddb].secure = 1;
-      else if (strcmp (arg, "group,yes") == 0)
-       secure_in_use = dbs[grpdb].secure = 1;
-      else if (strcmp (arg, "hosts,yes") == 0)
-       secure_in_use = dbs[hstdb].secure = 1;
-#else
       error (0, 0, _("secure services not implemented anymore"));
-#endif
       break;
 
     default:
@@ -398,7 +388,7 @@ print_version (FILE *stream, struct argp_state *state)
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2005");
+"), "2006");
   fprintf (stream, gettext ("Written by %s.\n"),
           "Thorsten Kukuk and Ulrich Drepper");
 }
index 3859d95d0195dae45290fa5e05990f3a9e3ca19b..ed686bea7e2a9fc69e30daa41604db6f244b462e 100644 (file)
@@ -68,7 +68,6 @@ struct database_dyn
   const char *db_filename;
   time_t file_mtime;
   size_t suggested_module;
-  int secure;
 
   unsigned long int postimeout;        /* In seconds.  */
   unsigned long int negtimeout;        /* In seconds.  */
@@ -122,9 +121,6 @@ extern int nthreads;
 /* Maximum number of threads to use.  */
 extern int max_nthreads;
 
-/* Tables for which we cache data with uid.  */
-extern int secure_in_use; /* Is one of the above 1?  */
-
 /* User name to run server processes as.  */
 extern const char *server_user;
 
index a15e522958ec7b58c3547883e6cbfcd29dc83e86..138d96d23afcc0fc78e46e58471718301585c341 100644 (file)
@@ -27,6 +27,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <syslog.h>
+#include <unistd.h>
 #include <selinux/av_permissions.h>
 #include <selinux/avc.h>
 #include <selinux/flask.h>
@@ -114,11 +115,28 @@ static int audit_fd = -1;
 static void
 log_callback (const char *fmt, ...)
 {
-  va_list ap;
+  if (audit_fd >= 0)
+    {
+      va_list ap;
+      va_start (ap, fmt);
+
+      char *buf;
+      int e = vasprintf (&buf, fmt, ap);
+      if (e < 0)
+       {
+         buf = alloca (BUFSIZ);
+         vsnprintf (buf, BUFSIZ, fmt, ap);
+       }
+
+      /* FIXME: need to attribute this to real user, using getuid for now */
+      audit_log_user_avc_message (audit_fd, AUDIT_USER_AVC, buf, NULL, NULL,
+                                 NULL, getuid ());
 
-  va_start (ap, fmt);
-  audit_log_avc (audit_fd, AUDIT_USER_AVC, fmt, ap);
-  va_end (ap);
+      if (e >= 0)
+       free (buf);
+
+      va_end (ap);
+    }
 }
 
 /* Initialize the connection to the audit system */
@@ -126,7 +144,9 @@ static void
 audit_init (void)
 {
   audit_fd = audit_open ();
-  if (audit_fd < 0)
+  if (audit_fd < 0
+      /* If kernel doesn't support audit, bail out */
+      && errno != EINVAL && errno != EPROTONOSUPPORT && errno != EAFNOSUPPORT)
     dbg_log (_("Failed opening connection to the audit subsystem: %m"));
 }
 #endif /* HAVE_LIBAUDIT */
index 489420ef79bee1652b80ecd125f207c2db5e7320..14ec3c475591bad3ec69a4f44a773810639b448c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998-2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (c) 1998-2003, 2004, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998.
 
@@ -84,7 +84,7 @@ print_version (FILE *stream, struct argp_state *state)
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2005");
+"), "2006");
   fprintf (stream, gettext ("Written by %s.\n"), "Thorsten Kukuk");
 }
 
index 1636202d366817e6639b0bb95e5843d275f3bd77..c5bc94869ba8907bd7992f703056e237e66c2097 100644 (file)
@@ -1,5 +1,5 @@
 /* Test re.translate != NULL.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
 
@@ -40,7 +40,7 @@ main (void)
   re_set_syntax (RE_SYNTAX_POSIX_EGREP);
 
   memset (&re, 0, sizeof (re));
-  re.translate = trans;
+  re.translate = (unsigned char *) trans;
   s = re_compile_pattern ("\\W", 2, &re);
 
   if (s != NULL)
@@ -68,7 +68,7 @@ main (void)
     }
 
   memset (&re, 0, sizeof (re));
-  re.translate = trans;
+  re.translate = (unsigned char *) trans;
   s = re_compile_pattern ("\\w", 2, &re);
 
   if (s != NULL)
@@ -96,7 +96,7 @@ main (void)
     }
 
   memset (&re, 0, sizeof (re));
-  re.translate = trans;
+  re.translate = (unsigned char *) trans;
   s = re_compile_pattern ("[[:DIGIT:]]", 11, &re);
   if (s == NULL)
     {
@@ -106,7 +106,7 @@ main (void)
     }
 
   memset (&re, 0, sizeof (re));
-  re.translate = trans;
+  re.translate = (unsigned char *) trans;
   s = re_compile_pattern ("[[:DIGIT:]]", 2, &re);
   if (s == NULL)
     {
index ee4d65215746f94b99ddcfbc144f1d65e4a39eb4..f199ffbfd358c3bef7a35610874676be1f5f46fa 100644 (file)
@@ -41,7 +41,7 @@ main (void)
        {
          char elem[256];
          idx = symb_table[2 * i + 1];
-         strncpy (elem, extra + idx + 1, extra[idx]);
+         strncpy (elem, (const char *) (extra + idx + 1), extra[idx]);
          elem[extra[idx]] = '\0';
          printf ("Found a collating element: %s\n", elem);
          ++found;
index 57c1d6a5d6cc54a39fa522ea01b3f93a1dc64fe2..66e582e995e74b6f228408e3cf160eeeb8a090ac 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 1995-2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 1995-2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
@@ -1007,7 +1007,7 @@ main (int argc, char *argv[])
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2005");
+"), "2006");
       fprintf (stderr, gettext ("Written by %s.\n"), "Roland McGrath");
       return 0;
     }
index 3ae4929593dc01b292424fe64db4dee770fb5273..d0983b4d44d04fd2342ee653099b5aeefed32103 100755 (executable)
@@ -79,7 +79,7 @@ run_test (const char *pattern, struct re_registers *regs)
       exit (1);
     }
 
-  pat.translate = (char *) casetable;
+  pat.translate = (unsigned char *) casetable;
 
   err = re_compile_pattern (pattern, strlen (pattern), &pat);
   if (err != NULL)
index bacf51b1a2815918393655f9a49ebde1b0fc9e0b..84470703f1f306bf496d1fdce5cece0d01068148 100644 (file)
@@ -6,7 +6,7 @@ static int
 do_test (void)
 {
   static const char prog[] = "does-not-exist";
-  char *env [] = {"FOO=BAR", NULL};
+  const char *env [] = {"FOO=BAR", NULL};
   errno = 0;
   execle (prog, prog, NULL, env);
 
index 002d4c938fd7856d97201478c344506221eaea7f..0430b7b573c7d1dd6a5054486a587c2fbf35ff60 100644 (file)
@@ -45,7 +45,7 @@ prepare (int argc, char *argv[])
 static int
 do_test (void)
 {
-  char *env[] = {"FOO=BAR", NULL};
+  const char *env[] = {"FOO=BAR", NULL};
   errno = 0;
   execle (copy, copy, NULL, env);
 
index bab2535cebadb4bfc982596926a211e788f11e83..7be23158d01e5c89ca508098a840cba8f3602fb3 100644 (file)
@@ -176,11 +176,7 @@ Dprintf(msg, num)
 
 
 static struct hostent *
-getanswer(answer, anslen, qname, qtype)
-       const querybuf *answer;
-       int anslen;
-       const char *qname;
-       int qtype;
+getanswer (const querybuf *answer, int anslen, const char *qname, int qtype)
 {
        register const HEADER *hp;
        register const u_char *cp;
@@ -522,7 +518,6 @@ gethostbyname2(name, af)
        char *bp;
        int n, size, type, len;
        struct hostent *ret;
-       extern struct hostent *_gethtbyname2();
 
        if (__res_maybe_init (&_res, 0) == -1) {
                __set_h_errno (NETDB_INTERNAL);
@@ -666,7 +661,6 @@ gethostbyaddr(addr, len, af)
        u_long old_options;
        char hname2[MAXDNAME+1];
 #endif /*SUNSECURITY*/
-       extern struct hostent *_gethtbyaddr();
 
        if (__res_maybe_init (&_res, 0) == -1) {
                __set_h_errno (NETDB_INTERNAL);
@@ -879,7 +873,6 @@ struct hostent *
 _gethtbyname(name)
        const char *name;
 {
-       extern struct hostent *_gethtbyname2();
        struct hostent *hp;
 
        if (_res.options & RES_USE_INET6) {
index c143cec28c1e021000b24e545006472f53846114..0aaf29f9db724bb3e64c696da613e96a69cd32bb 100644 (file)
@@ -80,7 +80,6 @@ const int     h_nerr = { sizeof h_errlist / sizeof h_errlist[0] };
 void
 herror(const char *s) {
        struct iovec iov[4], *v = iov;
-       extern int * __h_errno();
 
        if (s != NULL && *s != '\0') {
                v->iov_base = (/*noconst*/ char *)s;
index 839069de3da49c6930a10286f43194d7088bba4f..9b308b189a6d4fb26a557362080e1942589e018e 100644 (file)
@@ -626,8 +626,7 @@ static const unsigned int poweroften[10]=
 
 /* takes an XeY precision/size value, returns a string representation. */
 static const char *
-precsize_ntoa(prec)
-       u_int8_t prec;
+precsize_ntoa (u_int8_t prec)
 {
        static char retbuf[sizeof "90000000.00"];       /* XXX nonreentrant */
        unsigned long val;
@@ -644,8 +643,7 @@ precsize_ntoa(prec)
 
 /* converts ascii size/precision X * 10**Y(cm) to 0xXY.  moves pointer. */
 static u_int8_t
-precsize_aton(strptr)
-       const char **strptr;
+precsize_aton (const char **strptr)
 {
        unsigned int mval = 0, cmval = 0;
        u_int8_t retval = 0;
@@ -686,9 +684,7 @@ precsize_aton(strptr)
 
 /* converts ascii lat/lon to unsigned encoded 32-bit number.  moves pointer. */
 static u_int32_t
-latlon2ul(latlonstrptr,which)
-       const char **latlonstrptr;
-       int *which;
+latlon2ul (const char **latlonstrptr, int *which)
 {
        const char *cp;
        u_int32_t retval;
index b8e205c7dcf23f5a89525be6f2ba141f03cd73f7..0aa9030e3ae7b845e2df420dc98efc1b759f477e 100644 (file)
@@ -5,7 +5,7 @@
 static int
 do_test (void)
 {
-  FILE *fp = fmemopen ("hello", 5, "r");
+  FILE *fp = fmemopen ((char *) "hello", 5, "r");
   char buf[2];
   char *bp = fgets (buf, sizeof (buf), fp);
   printf ("fgets: %s\n", bp == buf ? "OK" : "ERROR");
index 452a21f9cb5bc3362ef271aff575b37b3f4ae59a..e89487cb458b25029767473ac57dd72042437d07 100644 (file)
@@ -46,6 +46,16 @@ t2 (void)
   return result;
 }
 
+#if FLT_EVAL_METHOD == 2
+volatile long double dbl_max = LDBL_MAX;
+# define FLT_FLT_FMT "%Lf %LF"
+# define FLT_FLT_WFMT L"%Lf %LF"
+#else
+# define dbl_max DBL_MAX
+# define FLT_FLT_FMT "%f %F"
+# define FLT_FLT_WFMT L"%f %F"
+#endif
+
 static int
 F (void)
 {
@@ -53,8 +63,9 @@ F (void)
   wchar_t wbuf[10];
   int result;
 
-  snprintf (buf, sizeof buf, "%f %F", DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX,
-           DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX);
+  snprintf (buf, sizeof buf, FLT_FLT_FMT,
+           dbl_max * dbl_max - dbl_max * dbl_max,
+           dbl_max * dbl_max - dbl_max * dbl_max);
   result = strcmp (buf, "nan NAN") != 0;
   printf ("expected \"nan NAN\", got \"%s\"\n", buf);
 
@@ -62,9 +73,9 @@ F (void)
   result |= strcmp (buf, "inf INF") != 0;
   printf ("expected \"inf INF\", got \"%s\"\n", buf);
 
-  swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%f %F",
-           DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX,
-           DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX);
+  swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), FLT_FLT_WFMT,
+           dbl_max * dbl_max - dbl_max * dbl_max,
+           dbl_max * dbl_max - dbl_max * dbl_max);
   result |= wcscmp (wbuf, L"nan NAN") != 0;
   printf ("expected L\"nan NAN\", got L\"%S\"\n", wbuf);
 
index b581408f37103f7b00120df30d91074a48a030d6..26532633df576b4cd7c54e9cb1465cbb14e8af8a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test and measure memccpy functions.
-   Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@redhat.com>, 1999.
 
@@ -109,8 +109,8 @@ do_test (size_t align1, size_t align2, int c, size_t len, size_t n,
   if (align2 + len >= page_size)
     return;
 
-  s1 = buf1 + align1;
-  s2 = buf2 + align2;
+  s1 = (char *) (buf1 + align1);
+  s2 = (char *) (buf2 + align2);
 
   for (i = 0; i < len - 1; ++i)
     {
index df866fe2d7bac2ccd8d3489ae5f3b2c5c497f008..c233ead5ddfc57dab33944b1823d062084f2d9d1 100644 (file)
@@ -1,5 +1,5 @@
 /* Test and measure memchr functions.
-   Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@redhat.com>, 1999.
 
@@ -89,7 +89,7 @@ do_test (size_t align, size_t pos, size_t len, int seek_char)
     {
       buf1[align + pos] = seek_char;
       buf1[align + len] = -seek_char;
-      result = buf1 + align + pos;
+      result = (char *) (buf1 + align + pos);
     }
   else
     {
@@ -101,7 +101,7 @@ do_test (size_t align, size_t pos, size_t len, int seek_char)
     printf ("Length %4zd, alignment %2zd:", pos, align);
 
   FOR_EACH_IMPL (impl, 0)
-    do_one_test (impl, buf1 + align, seek_char, len, result);
+    do_one_test (impl, (char *) (buf1 + align), seek_char, len, result);
 
   if (HP_TIMING_AVAIL)
     putchar ('\n');
@@ -144,16 +144,17 @@ do_random_tests (void)
        }
 
       if (pos < len)
-       result = p + pos + align;
+       result = (char *) (p + pos + align);
       else
        result = NULL;
 
       FOR_EACH_IMPL (impl, 1)
-       if (CALL (impl, p + align, seek_char, len) != result)
+       if (CALL (impl, (char *) (p + align), seek_char, len) != result)
          {
            error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %d, %zd, %zd) %p != %p, p %p",
                   n, impl->name, align, seek_char, len, pos,
-                  CALL (impl, p + align, seek_char, len), result, p);
+                  CALL (impl, (char *) (p + align), seek_char, len),
+                  result, p);
            ret = 1;
          }
     }
index 89c104386bc4fac665478deb09d8eb59c9e51c9a..af07a5e59935dc042a24955b86ec78343b4c9b79 100644 (file)
@@ -1,5 +1,5 @@
 /* Test and measure memcmp functions.
-   Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@redhat.com>, 1999.
 
@@ -88,8 +88,8 @@ do_test (size_t align1, size_t align2, size_t len, int exp_result)
   if (align2 + len >= page_size)
     return;
 
-  s1 = buf1 + align1;
-  s2 = buf2 + align2;
+  s1 = (char *) (buf1 + align1);
+  s2 = (char *) (buf2 + align2);
 
   for (i = 0; i < len; i++)
     s1[i] = s2[i] = 1 + 23 * i % 255;
@@ -161,7 +161,7 @@ do_random_tests (void)
 
       FOR_EACH_IMPL (impl, 1)
        {
-         r = CALL (impl, p1 + align1, p2 + align2, len);
+         r = CALL (impl, (char *) (p1 + align1), (char *) (p2 + align2), len);
          /* Test whether on 64-bit architectures where ABI requires
             callee to promote has the promotion been done.  */
          asm ("" : "=g" (r) : "0" (r));
index adc90da7675eb01085aaf9d2c3999f49b3ef949e..7b0723a65a3cadc8cfc51fe206f8fda301cb9c65 100644 (file)
@@ -1,5 +1,5 @@
 /* Test and measure memcpy functions.
-   Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@redhat.com>, 1999.
 
@@ -102,8 +102,8 @@ do_test (size_t align1, size_t align2, size_t len)
   if (align2 + len >= page_size)
     return;
 
-  s1 = buf1 + align1;
-  s2 = buf2 + align2;
+  s1 = (char *) (buf1 + align1);
+  s2 = (char *) (buf2 + align2);
 
   for (i = 0, j = 1; i < len; i++, j += 23)
     s1[i] = j;
@@ -190,7 +190,9 @@ do_random_tests (void)
          if (j > size2)
            j = size2;
          memset (p2, c, j);
-         res = CALL (impl, p2 + align2, p1 + align1, len);
+         res = (unsigned char *) CALL (impl,
+                                       (char *) (p2 + align2),
+                                       (char *) (p1 + align1), len);
          if (res != MEMCPY_RESULT (p2 + align2, len))
            {
              error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd) %p != %p",
index 9531aa82d80315d2fd7d2cd5ad23708e56612dc5..2f3a8f76317784b13c286b4287ee19d97ad68648 100644 (file)
@@ -101,8 +101,8 @@ do_test (size_t align1, size_t align2, size_t len)
   if (align2 + len >= page_size)
     return;
 
-  s1 = buf1 + align1;
-  s2 = buf2 + align2;
+  s1 = (char *) (buf1 + align1);
+  s2 = (char *) (buf2 + align2);
 
   for (i = 0, j = 1; i < len; i++, j += 23)
     s1[i] = j;
@@ -111,7 +111,7 @@ do_test (size_t align1, size_t align2, size_t len)
     printf ("Length %4zd, alignment %2zd/%2zd:", len, align1, align2);
 
   FOR_EACH_IMPL (impl, 0)
-    do_one_test (impl, s2, buf2 + align1, s1, len);
+    do_one_test (impl, s2, (char *) (buf2 + align1), s1, len);
 
   if (HP_TIMING_AVAIL)
     putchar ('\n');
@@ -179,7 +179,9 @@ do_random_tests (void)
        {
          memset (p2 + dststart, c, dstend - dststart);
          memcpy (p2 + srcstart, p1 + srcstart, srcend - srcstart);
-         res = CALL (impl, p2 + align2, p2 + align1, len);
+         res = (unsigned char *) CALL (impl,
+                                       (char *) (p2 + align2),
+                                       (char *) (p2 + align1), len);
          if (res != p2 + align2)
            {
              error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd) %p != %p",
index 53c84628394d8e5ee4039dccbe5fb45cb5b24d59..443752069c04edf1e20ce4610821459cb9907383 100644 (file)
@@ -1,5 +1,5 @@
 /* Test and measure strcat functions.
-   Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@redhat.com>, 1999.
 
@@ -91,8 +91,8 @@ do_test (size_t align1, size_t align2, size_t len1, size_t len2, int max_char)
   if (align2 + len1 + len2 >= page_size)
     return;
 
-  s1 = buf1 + align1;
-  s2 = buf2 + align2;
+  s1 = (char *) (buf1 + align1);
+  s2 = (char *) (buf2 + align2);
 
   for (i = 0; i < len1; ++i)
     s1[i] = 32 + 23 * i % (max_char - 32);
@@ -175,7 +175,8 @@ do_random_tests (void)
          memset (p2 - 64, '\1', align2 + 64);
          memset (p2 + align2 + len2 + 1, '\1', 512 - align2 - len2 - 1);
          memcpy (p2 + align2, buf1, len2 + 1);
-         res = CALL (impl, p2 + align2, p1 + align1);
+         res = (unsigned char *) CALL (impl, (char *) (p2 + align2),
+                                       (char *) (p1 + align1));
          if (res != p2 + align2)
            {
              error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd %zd) %p != %p",
index 1333ebc8bca1e5bbceda5df96957d4abd39fa0aa..cf25b449d954e0e313ab094e9c5e1ebcd0a7ed3a 100644 (file)
@@ -101,10 +101,10 @@ do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char)
   if (pos < len)
     {
       buf1[align + pos] = seek_char;
-      result = buf1 + align + pos;
+      result = (char *) (buf1 + align + pos);
     }
   else if (seek_char == 0)
-    result = buf1 + align + len;
+    result = (char *) (buf1 + align + len);
   else
     result = NULL;
 
@@ -112,7 +112,7 @@ do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char)
     printf ("Length %4zd, alignment %2zd:", pos, align);
 
   FOR_EACH_IMPL (impl, 0)
-    do_one_test (impl, buf1 + align, seek_char, result);
+    do_one_test (impl, (char *) (buf1 + align), seek_char, result);
 
   if (HP_TIMING_AVAIL)
     putchar ('\n');
@@ -166,18 +166,18 @@ do_random_tests (void)
        }
 
       if (pos <= len)
-       result = p + pos + align;
+       result = (char *) (p + pos + align);
       else if (seek_char == 0)
-       result = p + len + align;
+       result = (char *) (p + len + align);
       else
        result = NULL;
 
       FOR_EACH_IMPL (impl, 1)
-       if (CALL (impl, p + align, seek_char) != result)
+       if (CALL (impl, (char *) (p + align), seek_char) != result)
          {
            error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %d, %zd, %zd) %p != %p, p %p",
                   n, impl->name, align, seek_char, len, pos,
-                  CALL (impl, p + align, seek_char), result, p);
+                  CALL (impl, (char *) (p + align), seek_char), result, p);
            ret = 1;
          }
     }
index af49f14fe16299a5b93da135c2e2dbf37d018ff5..769e9828fddb8b019ec4f6c3d80cb37e77a0f490 100644 (file)
@@ -1,5 +1,5 @@
 /* Test and measure strcmp functions.
-   Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@redhat.com>, 1999.
 
@@ -103,8 +103,8 @@ do_test (size_t align1, size_t align2, size_t len, int max_char,
   if (align2 + len + 1 >= page_size)
     return;
 
-  s1 = buf1 + align1;
-  s2 = buf2 + align2;
+  s1 = (char *) (buf1 + align1);
+  s2 = (char *) (buf2 + align2);
 
   for (i = 0; i < len; i++)
     s1[i] = s2[i] = 1 + 23 * i % max_char;
@@ -198,7 +198,7 @@ do_random_tests (void)
 
       FOR_EACH_IMPL (impl, 1)
        {
-         r = CALL (impl, p1 + align1, p2 + align2);
+         r = CALL (impl, (char *) (p1 + align1), (char *) (p2 + align2));
          /* Test whether on 64-bit architectures where ABI requires
             callee to promote has the promotion been done.  */
          asm ("" : "=g" (r) : "0" (r));
index dbfbb9294d4b80fbd9813fc3568e260693166867..6a2ea2510e3b5d31174d588a8461ccbf26220c55 100644 (file)
@@ -1,5 +1,5 @@
 /* Test and measure strcpy functions.
-   Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@redhat.com>, 1999.
 
@@ -92,8 +92,8 @@ do_test (size_t align1, size_t align2, size_t len, int max_char)
   if (align2 + len >= page_size)
     return;
 
-  s1 = buf1 + align1;
-  s2 = buf2 + align2;
+  s1 = (char *) (buf1 + align1);
+  s2 = (char *) (buf2 + align2);
 
   for (i = 0; i < len; i++)
     s1[i] = 32 + 23 * i % (max_char - 32);
@@ -148,7 +148,8 @@ do_random_tests (void)
       FOR_EACH_IMPL (impl, 1)
        {
          memset (p2 - 64, '\1', 512 + 64);
-         res = CALL (impl, p2 + align2, p1 + align1);
+         res = (unsigned char *) CALL (impl, (char *) (p2 + align2),
+                                       (char *) (p1 + align1));
          if (res != STRCPY_RESULT (p2 + align2, len))
            {
              error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd) %p != %p",
index 82ad95e5ccd3f8f66d758f00b9e31d8543bca160..e01befbf4625f472055dddd507933ba6c96a2600 100644 (file)
@@ -1,5 +1,5 @@
 /* Test and measure strlen functions.
-   Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@redhat.com>, 1999.
 
@@ -92,7 +92,7 @@ do_test (size_t align, size_t len, int max_char)
     printf ("Length %4zd, alignment %2zd:", len, align);
 
   FOR_EACH_IMPL (impl, 0)
-    do_one_test (impl, buf1 + align, len);
+    do_one_test (impl, (char *) (buf1 + align), len);
 
   if (HP_TIMING_AVAIL)
     putchar ('\n');
@@ -127,10 +127,11 @@ do_random_tests (void)
        }
 
       FOR_EACH_IMPL (impl, 1)
-       if (CALL (impl, p + align) != len)
+       if (CALL (impl, (char *) (p + align)) != len)
          {
            error (0, 0, "Iteration %zd - wrong result in function %s (%zd) %zd != %zd, p %p",
-                  n, impl->name, align, CALL (impl, p + align), len, p);
+                  n, impl->name, align, CALL (impl, (char *) (p + align)),
+                  len, p);
            ret = 1;
          }
     }
index 62b83166a35d5a613adbee0c3618452f3345b7f5..d7a714cef136ee0efa212c51582970da84218d91 100644 (file)
@@ -1,5 +1,5 @@
 /* Test and measure strncpy functions.
-   Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@redhat.com>, 1999.
 
@@ -124,8 +124,8 @@ do_test (size_t align1, size_t align2, size_t len, size_t n, int max_char)
   if (align2 + len >= page_size)
     return;
 
-  s1 = buf1 + align1;
-  s2 = buf2 + align2;
+  s1 = (char *) (buf1 + align1);
+  s2 = (char *) (buf2 + align2);
 
   for (i = 0; i < len; ++i)
     s1[i] = 32 + 23 * i % (max_char - 32);
@@ -215,7 +215,9 @@ do_random_tests (void)
       FOR_EACH_IMPL (impl, 1)
        {
          memset (p2 - 64, '\1', 512 + 64);
-         res = CALL (impl, p2 + align2, p1 + align1, size);
+         res = (unsigned char *) CALL (impl,
+                                       (char *) (p2 + align2),
+                                       (char *) (p1 + align1), size);
          if (res != STRNCPY_RESULT (p2 + align2, len, size))
            {
              error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd) %p != %p",
index 2ec52fd28623e4d72c5d3a1f6ea4eccbc42fe55a..f3ed2080bc9e5f70b3bcd2508c8e30b1728ab6bd 100644 (file)
@@ -1,5 +1,5 @@
 /* Test and measure strpbrk functions.
-   Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@redhat.com>, 1999.
 
@@ -102,8 +102,8 @@ do_test (size_t align, size_t pos, size_t len)
   if (align + pos + 10 >= page_size || len > 240)
     return;
 
-  rej = buf2 + (random () & 255);
-  s = buf1 + align;
+  rej = (char *) (buf2 + (random () & 255));
+  s = (char *) (buf1 + align);
 
   for (i = 0; i < len; ++i)
     {
@@ -182,7 +182,7 @@ do_random_tests (void)
        }
       rej[i] = '\0';
       for (c = 1; c <= 255; ++c)
-       if (strchr (rej, c) == NULL)
+       if (strchr ((char *) rej, c) == NULL)
          break;
       j = (pos > len ? pos : len) + align + 64;
       if (j > 512)
@@ -199,23 +199,24 @@ do_random_tests (void)
          else
            {
              p[i] = random () & 255;
-             if (strchr (rej, p[i]))
+             if (strchr ((char *) rej, p[i]))
                {
                  p[i] = random () & 255;
-                 if (strchr (rej, p[i]))
+                 if (strchr ((char *) rej, p[i]))
                    p[i] = c;
                }
            }
        }
 
-      result = STRPBRK_RESULT (p + align, pos < len ? pos : len);
+      result = STRPBRK_RESULT ((char *) (p + align), pos < len ? pos : len);
 
       FOR_EACH_IMPL (impl, 1)
-       if (CALL (impl, p + align, rej) != result)
+       if (CALL (impl, (char *) (p + align), (char *) rej) != result)
          {
            error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %p, %zd, %zd, %zd) %p != %p",
                   n, impl->name, align, rej, rlen, pos, len,
-                  (void *) CALL (impl, p + align, rej), (void *) result);
+                  (void *) CALL (impl, (char *) (p + align), (char *) rej),
+                  (void *) result);
            ret = 1;
          }
     }
index 5aff75aebaf791e1a97f522523045f5301145e9b..92e8ab1bb16bad3eab667f97778762e9a328f9e1 100644 (file)
@@ -1,5 +1,5 @@
 /* Test and measure strrchr functions.
-   Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@redhat.com>, 1999.
 
@@ -95,10 +95,10 @@ do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char)
   if (pos < len)
     {
       buf1[align + pos] = seek_char;
-      result = buf1 + align + pos;
+      result = (char *) (buf1 + align + pos);
     }
   else if (seek_char == 0)
-    result = buf1 + align + len;
+    result = (char *) (buf1 + align + len);
   else
     result = NULL;
 
@@ -106,7 +106,7 @@ do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char)
     printf ("Length %4zd, alignment %2zd:", pos, align);
 
   FOR_EACH_IMPL (impl, 0)
-    do_one_test (impl, buf1 + align, seek_char, result);
+    do_one_test (impl, (char *) (buf1 + align), seek_char, result);
 
   if (HP_TIMING_AVAIL)
     putchar ('\n');
@@ -165,18 +165,18 @@ do_random_tests (void)
        }
 
       if (pos <= len)
-       result = p + pos + align;
+       result = (char *) (p + pos + align);
       else if (seek_char == 0)
-        result = p + len + align;
+        result = (char *) (p + len + align);
       else
        result = NULL;
 
       FOR_EACH_IMPL (impl, 1)
-       if (CALL (impl, p + align, seek_char) != result)
+       if (CALL (impl, (char *) (p + align), seek_char) != result)
          {
            error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %d, %zd, %zd) %p != %p, p %p",
                   n, impl->name, align, seek_char, len, pos,
-                  CALL (impl, p + align, seek_char), result, p);
+                  CALL (impl, (char *) (p + align), seek_char), result, p);
            ret = 1;
          }
     }
index de7351fe8c236a1092c9756da38b5cd8fb0bcd08..15cf4923f0d551769e95f348183be16208394631 100644 (file)
@@ -1,5 +1,5 @@
 /* Test and measure strspn functions.
-   Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999,2002,2003,2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@redhat.com>, 1999.
 
@@ -104,8 +104,8 @@ do_test (size_t align, size_t pos, size_t len)
   if (align + pos + 10 >= page_size || len > 240 || ! len)
     return;
 
-  acc = buf2 + (random () & 255);
-  s = buf1 + align;
+  acc = (char *) (buf2 + (random () & 255));
+  s = (char *) (buf1 + align);
 
   for (i = 0; i < len; ++i)
     {
@@ -183,7 +183,7 @@ do_random_tests (void)
          else if (i == pos + align)
            {
              p[i] = random () & 255;
-             if (strchr (acc, p[i]))
+             if (strchr ((char *) acc, p[i]))
                p[i] = '\0';
            }
          else if (i < align || i > pos + align)
@@ -193,11 +193,13 @@ do_random_tests (void)
        }
 
       FOR_EACH_IMPL (impl, 1)
-       if (CALL (impl, p + align, acc) != (pos < len ? pos : len))
+       if (CALL (impl, (char *) (p + align),
+                 (char *) acc) != (pos < len ? pos : len))
          {
            error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %p, %zd, %zd, %zd) %zd != %zd",
                   n, impl->name, align, acc, alen, pos, len,
-                  CALL (impl, p + align, acc), (pos < len ? pos : len));
+                  CALL (impl, (char *) (p + align), (char *) acc),
+                  (pos < len ? pos : len));
            ret = 1;
          }
     }
index c603a355545ba6cc2c422f85ead8432124b399c8..71b7738c3742a39d180140f070277d96bb111a23 100644 (file)
@@ -1,5 +1,5 @@
 /* Define the machine-dependent type `jmp_buf'.  Alpha version.
-   Copyright (C) 1992, 1997, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1997, 2003, 2005 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
@@ -80,8 +80,8 @@ typedef long int __jmp_buf[17];
 
 /* Test if longjmp to JMPBUF would unwind the frame containing a local
    variable at ADDRESS.  */
-#define _JMPBUF_UNWINDS(_jmpbuf, _address)                             \
-     ((void *)(_address) < (void *)((_jmpbuf)[JB_SP]))
+#define _JMPBUF_UNWINDS(_jmpbuf, _address, _demangle) \
+  ((void *)(_address) < (void *) _demangle ((_jmpbuf)[JB_SP]))
 #endif
 
 #endif  /* bits/setjmp.h */
index 4395b8f5626a234a621ee9ab57fedff5f5036e14..07ea01eb97599d07e838ec3bfeb7092a5d7fa0ec 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2005 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
@@ -39,7 +39,8 @@ typedef double __jmp_buf[21];
 
 /* Test if longjmp to JMPBUF would unwind the frame containing a local
    variable at ADDRESS.  */
-#define _JMPBUF_UNWINDS(_jmpbuf, _address)                             \
-     ((void *)(_address) > (void *)(((unsigned long *) _jmpbuf)[JB_SP]))
+#define _JMPBUF_UNWINDS(_jmpbuf, _address, _demangle)                  \
+  ((void *) (_address) >                                               \
+   (void *) _demangle ((((unsigned long *) _jmpbuf)[JB_SP])))
 
 #endif /* bits/setjmp.h */
index aced5f42c907f4a49928de9d5c0e1fb846798502..10a4650fb05ea1f2647c39ec0c8f662f8a94914b 100644 (file)
 ENTRY (BP_SYM (__longjmp))
        ENTER
 
+#ifdef PTR_DEMANGLE
+       movl JBUF(%esp), %eax   /* User's jmp_buf in %eax.  */
+       CHECK_BOUNDS_BOTH_WIDE (%eax, JBUF(%esp), $JB_SIZE)
+
+       /* Save the return address now.  */
+       movl (JB_PC*4)(%eax), %edx
+       /* Get the stack pointer.  */
+       movl (JB_SP*4)(%eax), %ecx
+       PTR_DEMANGLE (%edx)
+       PTR_DEMANGLE (%ecx)
+       cfi_def_cfa(%eax, 0)
+       cfi_register(%eip, %edx)
+       cfi_register(%esp, %ecx)
+       cfi_offset(%ebx, JB_BX*4)
+       cfi_offset(%esi, JB_SI*4)
+       cfi_offset(%edi, JB_DI*4)
+       cfi_offset(%ebp, JB_BP*4)
+       /* Restore registers.  */
+       movl (JB_BX*4)(%eax), %ebx
+       movl (JB_SI*4)(%eax), %esi
+       movl (JB_DI*4)(%eax), %edi
+       movl (JB_BP*4)(%eax), %ebp
+       cfi_restore(%ebx)
+       cfi_restore(%esi)
+       cfi_restore(%edi)
+       cfi_restore(%ebp)
+
+       movl VAL(%esp), %eax    /* Second argument is return value.  */
+       movl %ecx, %esp
+#else
        movl JBUF(%esp), %ecx   /* User's jmp_buf in %ecx.  */
        CHECK_BOUNDS_BOTH_WIDE (%ecx, JBUF(%esp), $JB_SIZE)
 
@@ -44,8 +74,6 @@ ENTRY (BP_SYM (__longjmp))
        movl (JB_DI*4)(%ecx), %edi
        movl (JB_BP*4)(%ecx), %ebp
        movl (JB_SP*4)(%ecx), %esp
-#ifdef PTR_DEMANGLE
-       PTR_DEMANGLE (%edx)
 #endif
        /* Jump to saved PC.  */
        jmp *%edx
index 107fe58b356d8c6698f941c6c8f5e36d4a6b4b27..d99a726ba34febe7f2a274cccf17d0e2e6392e89 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2001, 2003, 2005 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
@@ -40,7 +40,7 @@ typedef int __jmp_buf[6];
 
 /* Test if longjmp to JMPBUF would unwind the frame
    containing a local variable at ADDRESS.  */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
-  ((void *) (address) < (void *) (jmpbuf)[JB_SP])
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+  ((void *) (address) < (void *) demangle ((jmpbuf)[JB_SP]))
 
 #endif /* bits/setjmp.h */
index f80d239323551640e8979118e34e02893700ae9e..99cc79160ad6fa52833b42617cbfc31f12738e6b 100644 (file)
@@ -44,6 +44,9 @@ ENTRY (BP_SYM (_setjmp))
        movl %esi, (JB_SI*4)(%edx)
        movl %edi, (JB_DI*4)(%edx)
        leal JMPBUF(%esp), %ecx /* Save SP as it will be after we return.  */
+#ifdef PTR_MANGLE
+       PTR_MANGLE (%ecx)
+#endif
        movl %ecx, (JB_SP*4)(%edx)
        movl PCOFF(%esp), %ecx  /* Save PC we are returning to now.  */
 #ifdef PTR_MANGLE
index f4257a0dc5fc72174410af801aaa1526e520c044..02c76a8c79a7147f626c5708f42b9131dd8d0456 100644 (file)
@@ -46,6 +46,9 @@ ENTRY (BP_SYM (setjmp))
        movl %esi, (JB_SI*4)(%eax)
        movl %edi, (JB_DI*4)(%eax)
        leal JMPBUF(%esp), %ecx /* Save SP as it will be after we return.  */
+#ifdef PTR_MANGLE
+       PTR_MANGLE (%ecx)
+#endif
        movl %ecx, (JB_SP*4)(%eax)
        movl PCOFF(%esp), %ecx  /* Save PC we are returning to now.  */
 #ifdef PTR_MANGLE
index 747499adc2a2788c4b52ba150ffc8039bf0d9657..94dcbf2e1fdb3158b0e7cc08958692b5ebe1d078 100644 (file)
@@ -40,6 +40,9 @@ ENTRY (BP_SYM (__sigsetjmp))
        movl %esi, (JB_SI*4)(%eax)
        movl %edi, (JB_DI*4)(%eax)
        leal JMPBUF(%esp), %ecx /* Save SP as it will be after we return.  */
+#ifdef PTR_MANGLE
+       PTR_MANGLE (%ecx)
+#endif
        movl %ecx, (JB_SP*4)(%eax)
        movl PCOFF(%esp), %ecx  /* Save PC we are returning to now.  */
 #ifdef PTR_MANGLE
index 193eec3509450ac6291cefbae7efba939c9930c1..612582af26fee55dab313d33c0d0023f30a4eb70 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2005 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
@@ -44,7 +44,7 @@ typedef struct
 
 /* Test if longjmp to JMPBUF would unwind the frame
    containing a local variable at ADDRESS.  */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
-  ((void *) (address) < (void *) (jmpbuf)->__sp)
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle)             \
+  ((void *) (address) < (void *) demangle ((jmpbuf)->__sp))
 
 #endif /* bits/setjmp.h */
diff --git a/sysdeps/mach/hurd/errno.c b/sysdeps/mach/hurd/errno.c
new file mode 100644 (file)
index 0000000..a29091b
--- /dev/null
@@ -0,0 +1 @@
+/* No definition of `errno' variable on the Hurd.  */
index 6a540241a492af0ab2ae5e1ccb515cd1c8db617f..bcc78bc84edd80c710335ef8e3c51f4dfd35172b 100644 (file)
@@ -58,7 +58,16 @@ __ioctl (int fd, unsigned long int request, ...)
   struct
   {
 #ifdef MACH_MSG_TYPE_BIT
-    mig_reply_header_t header;
+    union
+    {
+      mig_reply_header_t header;
+      struct
+      {
+       mach_msg_header_t       Head;
+       int                     RetCodeType;
+       kern_return_t           RetCode;
+      } header_typecheck;
+    };
     char data[3 * sizeof (mach_msg_type_t) +
             msg_align (_IOT_COUNT0 (type) * typesize (_IOT_TYPE0 (type))) +
             msg_align (_IOT_COUNT1 (type) * typesize (_IOT_TYPE1 (type))) +
@@ -192,7 +201,7 @@ __ioctl (int fd, unsigned long int request, ...)
        return MIG_TYPE_ERROR;
 
 #ifdef MACH_MSG_TYPE_BIT
-      if (*(int *) &msg.header.RetCodeType !=
+      if (msg.header_typecheck.RetCodeType !=
          ((union { mach_msg_type_t t; int i; })
           { t: io2mach_type (1, _IOTS (msg.header.RetCode)) }).i)
        return MIG_TYPE_ERROR;
index 4624ad9e26355bc2059bb82062d25043af47591d..a522aa715af8e254405ff449b62f2030a74abef5 100644 (file)
@@ -1,5 +1,5 @@
 /* _longjmp_unwind -- Clean up stack frames unwound by longjmp.  Hurd version.
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2005 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
 #include <hurd/signal.h>
 #include <hurd/sigpreempt.h>
 #include <assert.h>
+#include <stdint.h>
 
 
 #ifndef _JMPBUF_UNWINDS
 #error "<bits/setjmp.h> fails to define _JMPBUF_UNWINDS"
 #endif
 
+static inline uintptr_t
+demangle_ptr (uintptr_t x)
+{
+# ifdef PTR_DEMANGLE
+  PTR_DEMANGLE (x);
+# endif
+  return x;
+}
+
 /* This function is called by `longjmp' (with its arguments) to restore
    active resources to a sane state before the frames code using them are
    jumped out of.  */
@@ -46,7 +56,7 @@ _longjmp_unwind (jmp_buf env, int val)
 
   /* Remove local signal preemptors being unwound past.  */
   while (ss->preemptors &&
-        _JMPBUF_UNWINDS (env[0].__jmpbuf, ss->preemptors))
+        _JMPBUF_UNWINDS (env[0].__jmpbuf, ss->preemptors, demangle_ptr))
     ss->preemptors = ss->preemptors->next;
 
   __spin_unlock (&ss->lock);
@@ -56,7 +66,7 @@ _longjmp_unwind (jmp_buf env, int val)
      in stack frames being unwound by this jump.  */
 
   for (link = ss->active_resources;
-       link && _JMPBUF_UNWINDS (env[0].__jmpbuf, link);
+       link && _JMPBUF_UNWINDS (env[0].__jmpbuf, link, demangle_ptr);
        link = link->thread.next)
     /* Remove this link from the resource's users list,
        since the frame using the resource is being unwound.
index 74caae8cba2029b76d13dff6b9cd28a8b348c7f0..5f7c82b86482fcd880cc96124e6cd3e3f66ce0e9 100644 (file)
@@ -80,7 +80,7 @@ typedef struct
 
 /* Test if longjmp to JMPBUF would unwind the frame
    containing a local variable at ADDRESS.  */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
-  ((void *) (address) < (void *) (jmpbuf)[0].__sp)
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle)             \
+  ((void *) (address) < (void *) demangle ((jmpbuf)[0].__sp))
 
 #endif /* _MIPS_BITS_SETJMP_H */
index 9dfac6800669008f459a8ff29f187288b2fd134f..c611b84363aaaee1be5536a38f327bd6265c3950 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1993,1994,1995,1997,2000,2004 Free Software Foundation, Inc.
+/* Copyright (C) 1993,1994,1995,1997,2000,2004,2005
+       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
@@ -73,7 +74,7 @@ __libc_message (int do_abort, const char *fmt, ...)
   while (*cp != '\0')
     {
       /* Find the next "%s" or the end of the string.  */
-      char *next = cp;
+      const char *next = cp;
       while (next[0] != '%' || next[1] != 's')
        {
          next = __strchrnul (next + 1, '%');
@@ -114,7 +115,7 @@ __libc_message (int do_abort, const char *fmt, ...)
 
       for (int cnt = nlist - 1; cnt >= 0; --cnt)
        {
-         iov[cnt].iov_base = list->str;
+         iov[cnt].iov_base = (char *) list->str;
          iov[cnt].iov_len = list->len;
          total += list->len;
          list = list->next;
index 3134916a51798ef4eceb62728224a196e0a0f4d8..6b35fb440b014f94935cdedf12e5b6313ea71989 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2003, 2004, 2005 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
@@ -74,7 +74,7 @@ typedef long int __jmp_buf[64 + (12 * 4)] __attribute__ ((__aligned__ (16)));
 
 /* Test if longjmp to JMPBUF would unwind the frame
    containing a local variable at ADDRESS.  */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
-  ((void *) (address) < (void *) (jmpbuf)[JB_GPR1])
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle)                     \
+  ((void *) (address) < (void *) demangle ((jmpbuf)[JB_GPR1]))
 
 #endif  /* bits/setjmp.h */
index 80f59052088ef8f5bb08dc963298afb92fe26945..d3f554557944a2f075463f276c706d607a28d854 100644 (file)
@@ -43,6 +43,7 @@ ENTRY (BP_SYM (__longjmp))
        lwz r20,((JB_GPRS+6)*4)(r3)
 #ifdef PTR_DEMANGLE
        PTR_DEMANGLE (r0, r25)
+       PTR_DEMANGLE2 (r1, r25)
 #endif
        mtlr r0
        lwz r21,((JB_GPRS+7)*4)(r3)
index e1f7f6e24ae2cf3f9a986392aacc92952b6c2f2a..7403a352fad4a4b28ff7b0a2a009b84d6d09c6c0 100644 (file)
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF startup code.  PowerPC version.
-   Copyright (C) 1995-2000, 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1995-2000, 2002, 2004, 2005 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
@@ -98,6 +98,7 @@ ENTRY(_dl_start_user)
    Take the opportunity to clear LR, so anyone who accidentally returns
    from _start gets SEGV.  Also clear the next few words of the stack.  */
 
+ENTRY(_dl_main_dispatch)
        li      r31,0
        stw     r31,0(r1)
        mtlr    r31
index 73cc8181f9ee4ea1a4ca6b82b7b7e0c27791600a..022d7ebbadbbbb3ef34a5f56e31b5d7918c45bc9 100644 (file)
@@ -1,5 +1,5 @@
 /* longjmp for PowerPC.
-   Copyright (C) 1995-99, 2000, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1995-99, 2000, 2003, 2004, 2005 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
@@ -128,6 +128,10 @@ L(no_vmx):
        lfd fp19,((JB_FPRS+5*2)*4)(r3)
        lwz r20,((JB_GPRS+6)*4)(r3)
        lfd fp20,((JB_FPRS+6*2)*4)(r3)
+#ifdef PTR_DEMANGLE
+       PTR_DEMANGLE (r0, r25)
+       PTR_DEMANGLE2 (r1, r25)
+#endif
        mtlr r0
        lwz r21,((JB_GPRS+7)*4)(r3)
        lfd fp21,((JB_FPRS+7*2)*4)(r3)
index cf3f215f2d3e13e9d568c16c58f24e3ff43019df..3afcf66fb980b19f881ee7af6f0a5dff5ac1b6ba 100644 (file)
@@ -1,5 +1,5 @@
 /* setjmp for PowerPC.
-   Copyright (C) 1995-99, 2000, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1995-2000, 2003, 2004, 2005 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
 ENTRY (BP_SYM (__sigsetjmp))
        CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
 
+#ifdef PTR_MANGLE
+       mr   r5,r1
+       PTR_MANGLE(r5, r6)
+       stw  r5,(JB_GPR1*4)(3)
+#else
        stw  r1,(JB_GPR1*4)(3)
+#endif
        mflr r0
        stw  r14,((JB_GPRS+0)*4)(3)
        stfd fp14,((JB_FPRS+0*2)*4)(3)
+#ifdef PTR_MANGLE
+       PTR_MANGLE2 (r0, r6)
+#endif
        stw  r0,(JB_LR*4)(3)
        stw  r15,((JB_GPRS+1)*4)(3)
        stfd fp15,((JB_FPRS+1*2)*4)(3)
@@ -95,9 +104,9 @@ ENTRY (BP_SYM (__sigsetjmp))
        lwz     r5,0(r5)
 #  endif
 # else
-       lis     r5,_dl_hwcap@ha
-       lwz     r5,_dl_hwcap@l(r5)
-#endif
+       lis     r6,_dl_hwcap@ha
+       lwz     r5,_dl_hwcap@l(r6)
+# endif
        andis.  r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16)
        beq     L(no_vmx)
        la      r5,((JB_VRS)*4)(3)
diff --git a/sysdeps/powerpc/powerpc32/hp-timing.h b/sysdeps/powerpc/powerpc32/hp-timing.h
new file mode 100644 (file)
index 0000000..b62b0f2
--- /dev/null
@@ -0,0 +1,82 @@
+/* High precision, low overhead timing functions.  Linux/PPC32 version.
+   Copyright (C) 2005 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _HP_TIMING_H
+#define _HP_TIMING_H   1
+
+
+/* There are no generic definitions for the times.  We could write something
+   using the `gettimeofday' system call where available but the overhead of
+   the system call might be too high.
+
+   In case a platform supports timers in the hardware the following macros
+   and types must be defined:
+
+   - HP_TIMING_AVAIL: test for availability.
+
+   - HP_TIMING_INLINE: this macro is non-zero if the functionality is not
+     implemented using function calls but instead uses some inlined code
+     which might simply consist of a few assembler instructions.  We have to
+     know this since we might want to use the macros here in places where we
+     cannot make function calls.
+
+   - hp_timing_t: This is the type for variables used to store the time
+     values.
+
+   - HP_TIMING_ZERO: clear `hp_timing_t' object.
+
+   - HP_TIMING_NOW: place timestamp for current time in variable given as
+     parameter.
+
+   - HP_TIMING_DIFF_INIT: do whatever is necessary to be able to use the
+     HP_TIMING_DIFF macro.
+
+   - HP_TIMING_DIFF: compute difference between two times and store it
+     in a third.  Source and destination might overlap.
+
+   - HP_TIMING_ACCUM: add time difference to another variable.  This might
+     be a bit more complicated to implement for some platforms as the
+     operation should be thread-safe and 64bit arithmetic on 32bit platforms
+     is not.
+
+   - HP_TIMING_ACCUM_NT: this is the variant for situations where we know
+     there are no threads involved.
+
+   - HP_TIMING_PRINT: write decimal representation of the timing value into
+     the given string.  This operation need not be inline even though
+     HP_TIMING_INLINE is specified.
+
+*/
+
+/* Provide dummy definitions.  */
+#define HP_TIMING_AVAIL                (0)
+#define HP_TIMING_INLINE       (0)
+typedef unsigned long long int hp_timing_t;
+#define HP_TIMING_ZERO(Var)
+#define HP_TIMING_NOW(var)
+#define HP_TIMING_DIFF_INIT()
+#define HP_TIMING_DIFF(Diff, Start, End)
+#define HP_TIMING_ACCUM(Sum, Diff)
+#define HP_TIMING_ACCUM_NT(Sum, Diff)
+#define HP_TIMING_PRINT(Buf, Len, Val)
+
+/* Since this implementation is not available we tell the user about it.  */
+#define HP_TIMING_NONAVAIL     1
+
+#endif /* hp-timing.h */
index 750075459cc96d22cbb2c28cd32802d534b2c58c..69d36cce03a6e6609543b304bcb6ca5a08f3ea94 100644 (file)
 ENTRY (BP_SYM (__sigsetjmp))
        CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
 
+#ifdef PTR_MANGLE
+       mr   r5,r1
+       PTR_MANGLE(r5, r10)
+       stw  r5,(JB_GPR1*4)(3)
+#else
        stw  r1,(JB_GPR1*4)(3)
+#endif
        mflr r0
        stw  r14,((JB_GPRS+0)*4)(3)
 #ifdef PTR_MANGLE
-       PTR_MANGLE (r0, r10)
+       PTR_MANGLE2 (r0, r10)
+       li   r10,0
 #endif
        stw  r0,(JB_LR*4)(3)
        stw  r15,((JB_GPRS+1)*4)(3)
index 73967e00932364b8d5b307a24c535d9d6a95544a..bf7e32446d65788b1f0ebbe0fc8e976a7702b4e2 100644 (file)
@@ -109,6 +109,9 @@ aligned_restore_vmx:
 L(no_vmx):
 #endif
        ld r1,(JB_GPR1*8)(r3)
+#ifdef PTR_DEMANGLE
+       PTR_DEMANGLE (r1, r25)
+#endif
        ld r2,(JB_GPR2*8)(r3)
        ld r0,(JB_LR*8)(r3)
        ld r14,((JB_GPRS+0)*8)(r3)
@@ -129,7 +132,7 @@ L(no_vmx):
        ld r20,((JB_GPRS+6)*8)(r3)
        lfd fp20,((JB_FPRS+6)*8)(r3)
 #ifdef PTR_DEMANGLE
-       PTR_DEMANGLE (r0, r25)
+       PTR_DEMANGLE2 (r0, r25)
 #endif
        mtlr r0
 /*     std r2,40(r1)   Restore the TOC save area.  */
index 4098fd63f5ea90c8955675b4eb73d8fd77429a02..11ecedf2c13aee755087fa2dff00e14f1e3c2ed6 100644 (file)
@@ -46,7 +46,13 @@ ENTRY (BP_SYM (__sigsetjmp))
        .hidden JUMPTARGET(GLUE(__sigsetjmp,_ent))
 JUMPTARGET(GLUE(__sigsetjmp,_ent)):
        CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
+#ifdef PTR_MANGLE
+       mr   r5, r1
+       PTR_MANGLE (r5, r6)
+       std  r5,(JB_GPR1*8)(3)
+#else
        std  r1,(JB_GPR1*8)(3)
+#endif
        mflr r0
 #if defined SHARED && !defined IS_IN_rtld
        ld   r5,40(r1)  /* Retrieve the callers TOC.  */
@@ -57,7 +63,7 @@ JUMPTARGET(GLUE(__sigsetjmp,_ent)):
        std  r14,((JB_GPRS+0)*8)(3)
        stfd fp14,((JB_FPRS+0)*8)(3)
 #ifdef PTR_MANGLE
-       PTR_MANGLE (r0, r10)
+       PTR_MANGLE2 (r0, r6)
 #endif
        std  r0,(JB_LR*8)(3)
        std  r15,((JB_GPRS+1)*8)(3)
@@ -97,14 +103,14 @@ JUMPTARGET(GLUE(__sigsetjmp,_ent)):
        std  r31,((JB_GPRS+17)*8)(3)
        stfd fp31,((JB_FPRS+17)*8)(3)
 #ifndef __NO_VMX__
-       ld    r5,.LC__dl_hwcap@toc(r2)
+       ld    r6,.LC__dl_hwcap@toc(r2)
 # ifdef SHARED
        /* Load _rtld-global._dl_hwcap.  */
-       ld    r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r5)
+       ld    r6,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r6)
 # else
-       ld    r5,0(r5) /* Load extern _dl_hwcap.  */
+       ld    r6,0(r6) /* Load extern _dl_hwcap.  */
 # endif
-       andis.  r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16)
+       andis.  r6,r6,(PPC_FEATURE_HAS_ALTIVEC >> 16)
        beq     L(no_vmx)
        la      r5,((JB_VRS)*8)(3)
        andi.   r6,r5,0xf
@@ -179,6 +185,8 @@ L(aligned_save_vmx):
        stvx    30,0,r5
        stvx    31,0,r6
 L(no_vmx):
+#else
+       li      r6,0
 #endif
 #if defined NOT_IN_libc && defined IS_IN_rtld
        li      r3,0
index 400951476386d28da841e5dcf1cfa673ff46db57..01533ca367c1f89446f7818f868965316e5f2935 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002, 2005 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
@@ -57,7 +57,7 @@ typedef struct {
 
 /* Test if longjmp to JMPBUF would unwind the frame
    containing a local variable at ADDRESS.  */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
-  ((void *) (address) < (void *) (jmpbuf)->__gregs[__JB_GPR15])
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle)                     \
+  ((void *) (address) < (void *) demangle ((jmpbuf)->__gregs[__JB_GPR15]))
 
 #endif /* __S390_SETJMP_H__ */
index 1e7a1d95c98c103b45529a61dc02ddb9f3e5298b..069da13e98aace6d0a8b0508ef11e0a822f3cdc9 100644 (file)
@@ -1,5 +1,5 @@
 /* Machine-specific calling sequence for `mcount' profiling function.  SuperH
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2005 Free Software Foundation, Inc.
    Contributed by NIIBE Yutaka <gniibe@m17n.org>
    This file is part of the GNU C Library.
 
 
        ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(_mcount)
        ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(_mcount),function)
+       cfi_startproc
        .align  5
 C_LABEL(_mcount)
        /* Save registers.  */
        mov.l   r4,@-r15
+       cfi_adjust_cfa_offset (4)
+       cfi_rel_offset (r4, 0)
        mov.l   r5,@-r15
+       cfi_adjust_cfa_offset (4)
+       cfi_rel_offset (r5, 0)
        mov.l   r6,@-r15
+       cfi_adjust_cfa_offset (4)
+       cfi_rel_offset (r6, 0)
        mov.l   r7,@-r15
+       cfi_adjust_cfa_offset (4)
+       cfi_rel_offset (r7, 0)
        sts.l   pr,@-r15
+       cfi_adjust_cfa_offset (4)
+       cfi_rel_offset (pr, 0)
 
        mov.l   @(20,r15),r4
        sts     pr,r5
@@ -61,6 +72,7 @@ C_LABEL(_mcount)
 #else
 1:     .long   C_SYMBOL_NAME(__mcount_internal)
 #endif
+       cfi_endproc
 ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(_mcount))
 
 #undef mcount
index 242720ca53c7e60b52319757ed47d353c2a9c998..8ebb5c598e44e785d07b38ecb5a18d1aea0fdae7 100644 (file)
@@ -50,7 +50,7 @@ typedef struct
 
 /* Test if longjmp to JMPBUF would unwind the frame
    containing a local variable at ADDRESS.  */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
-  ((void *) (address) < (void *) (jmpbuf)[0].__regs[7])
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle)             \
+  ((void *) (address) < (void *) demangle ((jmpbuf)[0].__regs[7]))
 
 #endif  /* bits/setjmp.h */
index 202c701a107a3650aed4458f6ed84810b8775762..743631ad7130c51e1d492c69c27ad70ef70d50a0 100644 (file)
@@ -1,5 +1,5 @@
 /* Assembler macros for SH.
-   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2005 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
   ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function)                          \
   .align ALIGNARG(5);                                                        \
   C_LABEL(name)                                                                      \
+  cfi_startproc;                                                             \
   CALL_MCOUNT
 
 #undef END
 #define END(name)                                                            \
+  cfi_endproc;                                                               \
   ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(name))
 
 /* If compiled for profiling, call `mcount' at the start of each function.  */
 #define CALL_MCOUNT                                    \
        mov.l   1f,r1;                                  \
        sts.l   pr,@-r15;                               \
+       cfi_adjust_cfa_offset (4);                      \
+       cfi_rel_offset (pr, 0);                         \
        mova    2f,r0;                                  \
        jmp     @r1;                                    \
         lds    r0,pr;                                  \
        .align  2;                                      \
 1:     .long   mcount;                                 \
-2:     lds.l   @r15+,pr
+2:     lds.l   @r15+,pr;                               \
+       cfi_adjust_cfa_offset (-4);                     \
+       cfi_restore (pr)
+
 #else
 #define CALL_MCOUNT            /* Do nothing.  */
 #endif
index 76d7af02c7dd40e9e97e4cab69a92c2705031388..12250d69809dfa0988451f8d8b4d152f9ee5306b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2005 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
@@ -34,5 +34,5 @@ typedef int __jmp_buf[3];
 
 /* Test if longjmp to JMPBUF would unwind the frame
    containing a local variable at ADDRESS.  */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
-  ((int) (address) < (jmpbuf)[JB_SP])
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+  ((int) (address) < demangle ((jmpbuf)[JB_SP]))
index 6e4798e45af2ac0969f56b6c720c50b17d1c6de7..802d51f3bee617f3d150481db21308a8d0be79f8 100644 (file)
@@ -40,14 +40,21 @@ skip:
 #else
        mov.l   .L3, r1
        sts.l   pr, @-r15
+       cfi_adjust_cfa_offset (4)
+       cfi_rel_offset (pr, 0)
        jsr     @r1
         mov.l  r0, @-r15
+       cfi_adjust_cfa_offset (4)
        mov.l   @r15+, r1
+       cfi_adjust_cfa_offset (-4)
        lds.l   @r15+, pr
+       cfi_adjust_cfa_offset (-4)
        mov.l   r1, @r0
 #endif
 #else
        mov.l   r12, @-r15
+       cfi_adjust_cfa_offset (4)
+       cfi_rel_offset (r12, 0)
 #ifndef _LIBC_REENTRANT
        mov     r0, r2
         mov.l  0f, r12
@@ -58,7 +65,10 @@ skip:
        mov.l   r2, @r1
 #else
        mov.l   r0, @-r15
+       cfi_adjust_cfa_offset (4)
        sts.l   pr, @-r15
+       cfi_adjust_cfa_offset (4)
+       cfi_rel_offset (pr, 0)
         mov.l  0f, r12
        mova    0f, r0
        add     r0, r12
index 2d0136dfeba837e3cbe8b598df11867924791304..44dcccd150889b96de70aab6877bcb2042d705c0 100644 (file)
@@ -1,5 +1,5 @@
 /* clock_getres -- Get the resolution of a POSIX clockid_t.  Linux version.
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005 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
 
 #include "kernel-features.h"
 
+#ifndef HAVE_CLOCK_GETRES_VSYSCALL
+# undef INTERNAL_VSYSCALL
+# define INTERNAL_VSYSCALL INTERNAL_SYSCALL
+# undef INLINE_VSYSCALL
+# define INLINE_VSYSCALL INLINE_SYSCALL
+#else
+# include <bits/libc-vdso.h>
+#endif
 
 #define SYSCALL_GETRES \
-  retval = INLINE_SYSCALL (clock_getres, 2, clock_id, res); \
+  retval = INLINE_VSYSCALL (clock_getres, 2, clock_id, res); \
   break
 
 #ifdef __ASSUME_POSIX_TIMERS
@@ -52,7 +60,7 @@ maybe_syscall_getres (clockid_t clock_id, struct timespec *res)
   if (!__libc_missing_posix_timers)
     {
       INTERNAL_SYSCALL_DECL (err);
-      int r = INTERNAL_SYSCALL (clock_getres, err, 2, clock_id, res);
+      int r = INTERNAL_VSYSCALL (clock_getres, err, 2, clock_id, res);
       if (!INTERNAL_SYSCALL_ERROR_P (r, err))
        return 0;
 
@@ -109,7 +117,7 @@ maybe_syscall_getres_cpu (clockid_t clock_id, struct timespec *res)
   if (!__libc_missing_posix_cpu_timers)
     {
       INTERNAL_SYSCALL_DECL (err);
-      int r = INTERNAL_SYSCALL (clock_getres, err, 2, clock_id, res);
+      int r = INTERNAL_VSYSCALL (clock_getres, err, 2, clock_id, res);
       if (!INTERNAL_SYSCALL_ERROR_P (r, err))
        return 0;
 
@@ -128,7 +136,7 @@ maybe_syscall_getres_cpu (clockid_t clock_id, struct timespec *res)
            {
              /* Check whether the kernel supports CPU clocks at all.
                 If not, record it for the future.  */
-             r = INTERNAL_SYSCALL (clock_getres, err, 2,
+             r = INTERNAL_VSYSCALL (clock_getres, err, 2,
                                    MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
                                    NULL);
              if (INTERNAL_SYSCALL_ERROR_P (r, err))
index bd79642dd50b30197992e2b903b642213cdbc4bc..315d595edc44fd9aec1f32f8d78c71e23cdfe7c3 100644 (file)
@@ -1,5 +1,5 @@
 /* clock_gettime -- Get current time from a POSIX clockid_t.  Linux version.
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005 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
 #include "kernel-posix-cpu-timers.h"
 #include "kernel-features.h"
 
+#ifndef HAVE_CLOCK_GETTIME_VSYSCALL
+# undef INTERNAL_VSYSCALL
+# define INTERNAL_VSYSCALL INTERNAL_SYSCALL
+# undef INLINE_VSYSCALL
+# define INLINE_VSYSCALL INLINE_SYSCALL
+#else
+# include <bits/libc-vdso.h>
+#endif
 
 #define SYSCALL_GETTIME \
-  retval = INLINE_SYSCALL (clock_gettime, 2, clock_id, tp); \
+  retval = INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp); \
   break
 
 #ifdef __ASSUME_POSIX_TIMERS
@@ -51,7 +59,7 @@ maybe_syscall_gettime (clockid_t clock_id, struct timespec *tp)
   if (!__libc_missing_posix_timers)
     {
       INTERNAL_SYSCALL_DECL (err);
-      int r = INTERNAL_SYSCALL (clock_gettime, err, 2, clock_id, tp);
+      int r = INTERNAL_VSYSCALL (clock_gettime, err, 2, clock_id, tp);
       if (!INTERNAL_SYSCALL_ERROR_P (r, err))
        return 0;
 
@@ -108,7 +116,7 @@ maybe_syscall_gettime_cpu (clockid_t clock_id, struct timespec *tp)
   if (!__libc_missing_posix_cpu_timers)
     {
       INTERNAL_SYSCALL_DECL (err);
-      int r = INTERNAL_SYSCALL (clock_gettime, err, 2, clock_id, tp);
+      int r = INTERNAL_VSYSCALL (clock_gettime, err, 2, clock_id, tp);
       if (!INTERNAL_SYSCALL_ERROR_P (r, err))
        return 0;
 
@@ -127,7 +135,7 @@ maybe_syscall_gettime_cpu (clockid_t clock_id, struct timespec *tp)
            {
              /* Check whether the kernel supports CPU clocks at all.
                 If not, record it for the future.  */
-             r = INTERNAL_SYSCALL (clock_getres, err, 2,
+             r = INTERNAL_VSYSCALL (clock_getres, err, 2,
                                    MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
                                    NULL);
              if (INTERNAL_SYSCALL_ERROR_P (r, err))
index 9cb5b6e34053b54eef36ae1404b7938095a3dcce..299574dac4dcb9f94eb7beddd30f20fc12b5e123 100644 (file)
@@ -1,5 +1,5 @@
 /* POSIX.1 `sigaction' call for Linux/i386.
-   Copyright (C) 1991,1995-2000,02,03, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1991,1995-2000,2002-2004,2005 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
@@ -154,6 +154,10 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 }
 libc_hidden_def (__libc_sigaction)
 
+#ifdef WRAPPER_INCLUDE
+# include WRAPPER_INCLUDE
+#endif
+
 #ifndef LIBC_SIGACTION
 weak_alias (__libc_sigaction, __sigaction)
 libc_hidden_weak (__sigaction)
index 76625753d959b65ed96fb703ff69f279211834df..80543976bbb5c4b722482a9572c15b8678fb859b 100644 (file)
@@ -1,5 +1,5 @@
 /* Define the machine-dependent type `jmp_buf'.  Linux/IA-64 version.
-   Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
 
@@ -34,7 +34,7 @@ typedef long __jmp_buf[_JBLEN] __attribute__ ((aligned (16))); /* guarantees 128
 
 /* Test if longjmp to JMPBUF would unwind the frame containing a local
    variable at ADDRESS.  */
-#define _JMPBUF_UNWINDS(_jmpbuf, _address)             \
-     ((void *)(_address) < (void *)(((long *)_jmpbuf)[0]))
+#define _JMPBUF_UNWINDS(_jmpbuf, _address, _demangle) \
+  ((void *) (_address) < (void *) (((long int *) _jmpbuf)[0]))
 
 #endif  /* bits/setjmp.h */
index 6ec3cb1e6198d4e9b67ab63eff0c49173eb3b4cc..fdbc93f0ed1bf64b32ce9da55783e0ccc3df2beb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2000,2002,2003,2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Linux/IA64 specific sigaction
    Written by Jes Sorensen, <Jes.Sorensen@cern.ch>, April 1999.
@@ -48,6 +48,10 @@ __libc_sigaction (sig, act, oact)
 }
 libc_hidden_def (__libc_sigaction)
 
+#ifdef WRAPPER_INCLUDE
+# include WRAPPER_INCLUDE
+#endif
+
 #ifndef LIBC_SIGACTION
 weak_alias (__libc_sigaction, __sigaction)
 libc_hidden_def (__sigaction)
index 1dd82eb86650ac226d95ada12c7453e21c10fda0..4c70eff4217eab8adb331c1b2bc876b7838c4b6f 100644 (file)
@@ -1,5 +1,5 @@
 /* System-specific socket constants and types.  Linux/MIPS version.
-   Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004
+   Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005
        Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -219,7 +219,7 @@ struct msghdr
     socklen_t msg_namelen;     /* Length of address data.  */
 
     struct iovec *msg_iov;     /* Vector of data to send/receive into.  */
-    int msg_iovlen;            /* Number of elements in the vector.  */
+    size_t msg_iovlen;         /* Number of elements in the vector.  */
 
     void *msg_control;         /* Ancillary data (eg BSD filedesc passing). */
     socklen_t msg_controllen;  /* Ancillary data buffer length.  */
index 55d2d0d273e18a995c07f7a33c9d59be453f38a7..ecd8057951c178e481b3e34f4a29e3723a796573 100644 (file)
@@ -6,3 +6,7 @@ endif
 ifeq ($(subdir),stdlib)
 gen-as-const-headers += ucontext_i.sym
 endif
+
+ifeq ($(subdir),elf)
+routines += dl-vdso
+endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/Versions b/sysdeps/unix/sysv/linux/powerpc/Versions
new file mode 100644 (file)
index 0000000..1ef53b9
--- /dev/null
@@ -0,0 +1,7 @@
+libc {
+  GLIBC_PRIVATE {
+    __vdso_get_tbfreq;
+    __vdso_clock_gettime;
+    __vdso_clock_getres;
+  }
+}
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h b/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
new file mode 100644 (file)
index 0000000..f20a5a1
--- /dev/null
@@ -0,0 +1,36 @@
+/* Resolve function pointers to VDSO functions.
+   Copyright (C) 2005 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+
+#ifndef _LIBC_VDSO_H
+#define _LIBC_VDSO_H
+
+#ifdef SHARED
+
+extern void *__vdso_gettimeofday;
+
+extern void *__vdso_clock_gettime;
+
+extern void *__vdso_clock_getres;
+
+extern void *__vdso_get_tbfreq;
+
+#endif
+
+#endif /* _LIBC_VDSO_H */
diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-vdso.c b/sysdeps/unix/sysv/linux/powerpc/dl-vdso.c
new file mode 100644 (file)
index 0000000..e1be097
--- /dev/null
@@ -0,0 +1,59 @@
+/* ELF symbol resolve functions for VDSO objects.
+   Copyright (C) 2005 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include "config.h"
+#include <dl-hash.h>
+#include <ldsodefs.h>
+
+
+void *
+internal_function
+_dl_vdso_vsym (const char *name, const char *version)
+{
+  struct link_map *map = GLRO (dl_sysinfo_map);
+  void *value = NULL;
+
+
+  if (map != NULL)
+    {
+      /* Use a WEAK REF so we don't error out if the symbol is not found.  */
+      ElfW (Sym) wsym;
+      memset (&wsym, 0, sizeof (ElfW (Sym)));
+      wsym.st_info = (unsigned char) ELFW (ST_INFO (STB_WEAK, STT_NOTYPE));
+
+      /* Compute hash value to the version string.  */
+      struct r_found_version vers;
+      vers.name = version;
+      vers.hidden = 1;
+      vers.hash = _dl_elf_hash (version);
+      /* We don't have a specific file where the symbol can be found.  */
+      vers.filename = NULL;
+
+      /* Search the scope of the vdso map.  */
+      const ElfW (Sym) *ref = &wsym;
+      lookup_t result = GLRO (dl_lookup_symbol_x) (name, map, &ref,
+                                                  map->l_local_scope,
+                                                  &vers, 0, 0, NULL);
+
+      if (ref != NULL)
+       value = DL_SYMBOL_ADDRESS (result, ref);
+    }
+
+  return value;
+}
diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-vdso.h b/sysdeps/unix/sysv/linux/powerpc/dl-vdso.h
new file mode 100644 (file)
index 0000000..a7dcb2e
--- /dev/null
@@ -0,0 +1,27 @@
+/* ELF symbol resolve functions for VDSO objects.
+   Copyright (C) 2005 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _DL_VDSO_H
+#define _DL_VDSO_H     1
+
+/* Functions for resolving symbols in the VDSO link map.  */
+extern void *_dl_vdso_vsym (const char *name, const char *version)
+     internal_function attribute_hidden;
+
+#endif /* dl-vdso.h */
index ddaff303c5bd12b5ef6154a42df0abb4eed8ed56..6d2e766aa4c6597ca8c5588f3ab407d2d90c6746 100644 (file)
 #include <string.h>
 #include <unistd.h>
 #include <libc-internal.h>
-
+#include <sysdep.h>
+#include <bits/libc-vdso.h>
 
 hp_timing_t
 __get_clockfreq (void)
 {
   /* We read the information from the /proc filesystem.  /proc/cpuinfo
      contains at least one line like:
-        timebase        : 33333333
+     timebase        : 33333333
      We search for this line and convert the number into an integer.  */
   static hp_timing_t timebase_freq;
   hp_timing_t result = 0L;
@@ -38,67 +39,78 @@ __get_clockfreq (void)
   if (timebase_freq != 0)
     return timebase_freq;
 
-  int fd = open ("/proc/cpuinfo", O_RDONLY);
-  if (__builtin_expect (fd != -1, 1))
+  /* If we can use the vDSO to obtain the timebase even better.  */
+#ifdef SHARED
+  INTERNAL_SYSCALL_DECL (err);
+  timebase_freq = INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK (get_tbfreq, err, 0);
+  if (INTERNAL_SYSCALL_ERROR_P (timebase_freq, err)
+      && INTERNAL_SYSCALL_ERRNO (timebase_freq, err) == ENOSYS)
+#endif
     {
-      /* The timebase will be in the 1st 1024 bytes for systems with up
-         to 8 processors.  If the first read returns less then 1024
-        bytes read,  we have the whole cpuinfo and can start the scan.
-        Otherwise we will have to read more to insure we have the
-        timebase value in the scan.  */
-      char buf[1024];
-      ssize_t n;
+      int fd = open ("/proc/cpuinfo", O_RDONLY);
 
-      n = read (fd, buf, sizeof (buf));
-      if (n == sizeof (buf))
+      if (__builtin_expect (fd != -1, 1))
        {
-         /* We are here because the 1st read returned exactly sizeof
-            (buf) bytes.  This implies that we are not at EOF and may
-            not have read the timebase value yet.  So we need to read
-            more bytes until we know we have EOF.  We copy the lower
-            half of buf to the upper half and read sizeof (buf)/2
-            bytes into the lower half of buf and repeat until we
-            reach EOF.  We can assume that the timebase will be in
-            the last 512 bytes of cpuinfo, so two 512 byte half_bufs
-            will be sufficient to contain the timebase and will
-            handle the case where the timebase spans the half_buf
-            boundry.  */
-         const ssize_t half_buf = sizeof (buf) / 2;
-         while (n >= half_buf)
+         /* The timebase will be in the 1st 1024 bytes for systems with up
+            to 8 processors.  If the first read returns less then 1024
+            bytes read,  we have the whole cpuinfo and can start the scan.
+            Otherwise we will have to read more to insure we have the
+            timebase value in the scan.  */
+         char buf[1024];
+         ssize_t n;
+
+         n = read (fd, buf, sizeof (buf));
+         if (n == sizeof (buf))
            {
-             memcpy (buf, buf + half_buf, half_buf);
-             n = read (fd, buf + half_buf, half_buf);
+             /* We are here because the 1st read returned exactly sizeof
+                (buf) bytes.  This implies that we are not at EOF and may
+                not have read the timebase value yet.  So we need to read
+                more bytes until we know we have EOF.  We copy the lower
+                half of buf to the upper half and read sizeof (buf)/2
+                bytes into the lower half of buf and repeat until we
+                reach EOF.  We can assume that the timebase will be in
+                the last 512 bytes of cpuinfo, so two 512 byte half_bufs
+                will be sufficient to contain the timebase and will
+                handle the case where the timebase spans the half_buf
+                boundry.  */
+             const ssize_t half_buf = sizeof (buf) / 2;
+             while (n >= half_buf)
+               {
+                 memcpy (buf, buf + half_buf, half_buf);
+                 n = read (fd, buf + half_buf, half_buf);
+               }
+             if (n >= 0)
+               n += half_buf;
            }
-         if (n >= 0)
-           n += half_buf;
-       }
-
-      if (__builtin_expect (n, 1) > 0)
-       {
-         char *mhz = memmem (buf, n, "timebase", 7);
 
-         if (__builtin_expect (mhz != NULL, 1))
+         if (__builtin_expect (n, 1) > 0)
            {
-             char *endp = buf + n;
-
-             /* Search for the beginning of the string.  */
-             while (mhz < endp && (*mhz < '0' || *mhz > '9') && *mhz != '\n')
-               ++mhz;
+             char *mhz = memmem (buf, n, "timebase", 7);
 
-             while (mhz < endp && *mhz != '\n')
+             if (__builtin_expect (mhz != NULL, 1))
                {
-                 if (*mhz >= '0' && *mhz <= '9')
+                 char *endp = buf + n;
+
+                 /* Search for the beginning of the string.  */
+                 while (mhz < endp && (*mhz < '0' || *mhz > '9')
+                        && *mhz != '\n')
+                   ++mhz;
+
+                 while (mhz < endp && *mhz != '\n')
                    {
-                     result *= 10;
-                     result += *mhz - '0';
-                   }
+                     if (*mhz >= '0' && *mhz <= '9')
+                       {
+                         result *= 10;
+                         result += *mhz - '0';
+                       }
 
-                 ++mhz;
+                     ++mhz;
+                   }
                }
+             timebase_freq = result;
            }
-         timebase_freq = result;
+         close (fd);
        }
-      close (fd);
     }
 
   return timebase_freq;
diff --git a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
new file mode 100644 (file)
index 0000000..b381baa
--- /dev/null
@@ -0,0 +1,42 @@
+/* Copyright (C) 2005 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+#include <bp-checks.h>
+#include <stddef.h>
+#include <sys/time.h>
+#include <time.h>
+#include <hp-timing.h>
+
+#undef __gettimeofday
+#include <bits/libc-vdso.h>
+
+/* Get the current time of day and timezone information,
+   putting it into *TV and *TZ.  If TZ is NULL, *TZ is not filled.
+   Returns 0 on success, -1 on errors.  */
+
+int
+__gettimeofday (tv, tz)
+     struct timeval *tv;
+     struct timezone *tz;
+{
+  return INLINE_VSYSCALL (gettimeofday, 2, CHECK_1 (tv), CHECK_1 (tz));
+}
+
+INTDEF (__gettimeofday)
+weak_alias (__gettimeofday, gettimeofday)
similarity index 54%
rename from sysdeps/powerpc/elf/libc-start.c
rename to sysdeps/unix/sysv/linux/powerpc/libc-start.c
index 8a60af8d71a499f56a7c86ce0b3f6dd32acd94f1..a8005c116316043306f9526962df493731983527 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000-2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1998,2000,2001,2002,2003,2004,2005 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
 
 extern int __cache_line_size;
 weak_extern (__cache_line_size)
-
 /* The main work is done in the generic function.  */
 #define LIBC_START_MAIN generic_start_main
 #define LIBC_START_DISABLE_INLINE
 #define LIBC_START_MAIN_AUXVEC_ARG
 #define MAIN_AUXVEC_ARG
+#define INIT_MAIN_ARGS
 #include <csu/libc-start.c>
 
-
 struct startup_info
-{
-  void *__unbounded sda_base;
-  int (*main) (int, char **, char **, void *);
-  int (*init) (int, char **, char **, void *);
-  void (*fini) (void);
-};
+  {
+    void *__unbounded sda_base;
+    int (*main) (int, char **, char **, void *);
+    int (*init) (int, char **, char **, void *);
+    void (*fini) (void);
+  };
+
+
+#ifdef SHARED
+# include <sys/time.h>
+# include <dl-vdso.h>
+# undef __gettimeofday
+# undef __clock_gettime
+# undef __clock_getres
+# include <bits/libc-vdso.h>
+
+void *__vdso_gettimeofday;
+void *__vdso_clock_gettime;
+void *__vdso_clock_getres;
+void *__vdso_get_tbfreq;
 
+static inline void _libc_vdso_platform_setup (void)
+  {
+    __vdso_gettimeofday = _dl_vdso_vsym ("__kernel_gettimeofday",
+                                        "LINUX_2.6.15");
+
+    __vdso_clock_gettime = _dl_vdso_vsym ("__kernel_clock_gettime",
+                                         "LINUX_2.6.15");
+
+    __vdso_clock_getres = _dl_vdso_vsym ("__kernel_clock_getres",
+                                        "LINUX_2.6.15");
+
+    __vdso_get_tbfreq = _dl_vdso_vsym ("__kernel_vdso_get_tbfreq",
+                                      "LINUX_2.6.15");
+  }
+#endif
 
 int
 /* GKM FIXME: GCC: this should get __BP_ prefix by virtue of the
    BPs in the arglist of startup_info.main and startup_info.init. */
-BP_SYM (__libc_start_main) (int argc, char *__unbounded *__unbounded ubp_av,
-                           char *__unbounded *__unbounded ubp_ev,
-                           ElfW(auxv_t) *__unbounded auxvec,
-                           void (*rtld_fini) (void),
-                           struct startup_info *__unbounded stinfo,
-                           char *__unbounded *__unbounded stack_on_entry)
+  BP_SYM (__libc_start_main) (int argc, char *__unbounded *__unbounded ubp_av,
+                             char *__unbounded *__unbounded ubp_ev,
+                             ElfW (auxv_t) * __unbounded auxvec,
+                             void (*rtld_fini) (void),
+                             struct startup_info *__unbounded stinfo,
+                             char *__unbounded *__unbounded stack_on_entry)
 {
 #if __BOUNDED_POINTERS__
   char **argv;
@@ -60,13 +88,13 @@ BP_SYM (__libc_start_main) (int argc, char *__unbounded *__unbounded ubp_av,
 
   /* the PPC SVR4 ABI says that the top thing on the stack will
      be a NULL pointer, so if not we assume that we're being called
-     as a statically-linked program by Linux...         */
+     as a statically-linked program by Linux...  */
   if (*stack_on_entry != NULL)
     {
-      char *__unbounded *__unbounded temp;
+      char *__unbounded * __unbounded temp;
       /* ...in which case, we have argc as the top thing on the
-        stack, followed by argv (NULL-terminated), envp (likewise),
-        and the auxilary vector.  */
+         stack, followed by argv (NULL-terminated), envp (likewise),
+         and the auxilary vector.  */
       /* 32/64-bit agnostic load from stack */
       argc = *(long int *__unbounded) stack_on_entry;
       ubp_av = stack_on_entry + 1;
@@ -74,25 +102,28 @@ BP_SYM (__libc_start_main) (int argc, char *__unbounded *__unbounded ubp_av,
 #ifdef HAVE_AUX_VECTOR
       temp = ubp_ev;
       while (*temp != NULL)
-        ++temp;
-      auxvec = (ElfW(auxv_t) *)++temp;
+       ++temp;
+      auxvec = (ElfW (auxv_t) *)++ temp;
 #endif
       rtld_fini = NULL;
     }
 
   /* Initialize the __cache_line_size variable from the aux vector.  */
-  for (ElfW(auxv_t) *av = auxvec; av->a_type != AT_NULL; ++av)
+  for (ElfW (auxv_t) * av = auxvec; av->a_type != AT_NULL; ++av)
     switch (av->a_type)
       {
       case AT_DCACHEBSIZE:
-        {
-          int *cls = & __cache_line_size;
-          if (cls != NULL)
-            *cls = av->a_un.a_val;
-        }
-        break;
+       {
+         int *cls = &__cache_line_size;
+         if (cls != NULL)
+           *cls = av->a_un.a_val;
+       }
+       break;
       }
-
+#ifdef SHARED
+  /* Resolve and initialize function pointers for VDSO functions.  */
+  _libc_vdso_platform_setup ();
+#endif
   return generic_start_main (stinfo->main, argc, ubp_av, auxvec,
                             stinfo->init, stinfo->fini, rtld_fini,
                             stack_on_entry);
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
new file mode 100644 (file)
index 0000000..0e04e4b
--- /dev/null
@@ -0,0 +1,284 @@
+/* Save current context, powerpc32 common.
+   Copyright (C) 2005 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, write to the Free
+   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+   02110-1301 USA.  */
+
+/* This is the common implementation of getcontext for powerpc32.
+   It not complete in itself should be included in to a framework that 
+   defines:
+     __CONTEXT_FUNC_NAME
+   and if appropriate:
+     __CONTEXT_ENABLE_FPRS
+     __CONTEXT_ENABLE_VRS
+   Any archecture that implements the Vector unit is assumed to also 
+   implement the floating unit.  */
+
+/* Stack frame offsets.  */
+#define _FRAME_BACKCHAIN       0
+#define _FRAME_LR_SAVE         4
+#define _FRAME_PARM_SAVE1      8
+#define _FRAME_PARM_SAVE2      12
+#define _FRAME_PARM_SAVE3      16
+#define _FRAME_PARM_SAVE4      20
+
+#ifdef __CONTEXT_ENABLE_VRS
+       .machine        "altivec"
+#endif
+ENTRY(__CONTEXT_FUNC_NAME)
+       stwu    r1,-16(r1)
+/* Insure that the _UC_REGS start on a quadword boundary.  */
+       stw     r3,_FRAME_PARM_SAVE1(r1)
+       addi    r3,r3,_UC_REG_SPACE+12
+       clrrwi  r3,r3,4
+
+/* Save the general purpose registers */
+       stw     r0,_UC_GREGS+(PT_R0*4)(r3)
+       mflr    r0
+       stw     r2,_UC_GREGS+(PT_R2*4)(r3)
+       stw     r4,_UC_GREGS+(PT_R4*4)(r3)
+/* Set the callers LR_SAVE, and the ucontext LR and NIP to the callers
+   return address.  */
+       stw     r0,_UC_GREGS+(PT_LNK*4)(r3)
+       stw     r0,_UC_GREGS+(PT_NIP*4)(r3)
+       stw     r0,_FRAME_LR_SAVE+16(r1)
+       stw     r5,_UC_GREGS+(PT_R5*4)(r3)
+       stw     r6,_UC_GREGS+(PT_R6*4)(r3)
+       stw     r7,_UC_GREGS+(PT_R7*4)(r3)
+       stw     r8,_UC_GREGS+(PT_R8*4)(r3)
+       stw     r9,_UC_GREGS+(PT_R9*4)(r3)
+       stw     r10,_UC_GREGS+(PT_R10*4)(r3)
+       stw     r11,_UC_GREGS+(PT_R11*4)(r3)
+       stw     r12,_UC_GREGS+(PT_R12*4)(r3)
+       stw     r13,_UC_GREGS+(PT_R13*4)(r3)
+       stw     r14,_UC_GREGS+(PT_R14*4)(r3)
+       stw     r15,_UC_GREGS+(PT_R15*4)(r3)
+       stw     r16,_UC_GREGS+(PT_R16*4)(r3)
+       stw     r17,_UC_GREGS+(PT_R17*4)(r3)
+       stw     r18,_UC_GREGS+(PT_R18*4)(r3)
+       stw     r19,_UC_GREGS+(PT_R19*4)(r3)
+       stw     r20,_UC_GREGS+(PT_R20*4)(r3)
+       stw     r21,_UC_GREGS+(PT_R21*4)(r3)
+       stw     r22,_UC_GREGS+(PT_R22*4)(r3)
+       stw     r23,_UC_GREGS+(PT_R23*4)(r3)
+       stw     r24,_UC_GREGS+(PT_R24*4)(r3)
+       stw     r25,_UC_GREGS+(PT_R25*4)(r3)
+       stw     r26,_UC_GREGS+(PT_R26*4)(r3)
+       stw     r27,_UC_GREGS+(PT_R27*4)(r3)
+       stw     r28,_UC_GREGS+(PT_R28*4)(r3)
+       stw     r29,_UC_GREGS+(PT_R29*4)(r3)
+       stw     r30,_UC_GREGS+(PT_R30*4)(r3)
+       stw     r31,_UC_GREGS+(PT_R31*4)(r3)
+/* Save the value of R1.  We had to push the stack before we
+   had the address of uc_reg_space.  So compute the address of
+   the callers stack pointer and save it as R1.  */
+       addi    r8,r1,16
+       li      r0,0
+/* Save the count, exception and condition registers.  */
+       mfctr   r11
+       mfxer   r10
+       mfcr    r9
+       stw     r8,_UC_GREGS+(PT_R1*4)(r3)
+       stw     r11,_UC_GREGS+(PT_CTR*4)(r3)
+       stw     r10,_UC_GREGS+(PT_XER*4)(r3)
+       stw     r9,_UC_GREGS+(PT_CCR*4)(r3)
+/* Set the return value of getcontext to "success".  R3 is the only
+   register whose value is not preserved in the saved context.  */
+       stw     r0,_UC_GREGS+(PT_R3*4)(r3)
+
+/* Zero fill fields that can't be set in user state. */
+       stw     r0,_UC_GREGS+(PT_MSR*4)(r3)
+       stw     r0,_UC_GREGS+(PT_MQ*4)(r3)
+
+#ifdef __CONTEXT_ENABLE_FPRS
+/* Save the floating-point registers */
+       stfd    fp0,_UC_FREGS+(0*8)(r3)
+       stfd    fp1,_UC_FREGS+(1*8)(r3)
+       stfd    fp2,_UC_FREGS+(2*8)(r3)
+       stfd    fp3,_UC_FREGS+(3*8)(r3)
+       stfd    fp4,_UC_FREGS+(4*8)(r3)
+       stfd    fp5,_UC_FREGS+(5*8)(r3)
+       stfd    fp6,_UC_FREGS+(6*8)(r3)
+       stfd    fp7,_UC_FREGS+(7*8)(r3)
+       stfd    fp8,_UC_FREGS+(8*8)(r3)
+       stfd    fp9,_UC_FREGS+(9*8)(r3)
+       stfd    fp10,_UC_FREGS+(10*8)(r3)
+       stfd    fp11,_UC_FREGS+(11*8)(r3)
+       stfd    fp12,_UC_FREGS+(12*8)(r3)
+       stfd    fp13,_UC_FREGS+(13*8)(r3)
+       stfd    fp14,_UC_FREGS+(14*8)(r3)
+       stfd    fp15,_UC_FREGS+(15*8)(r3)
+       stfd    fp16,_UC_FREGS+(16*8)(r3)
+       stfd    fp17,_UC_FREGS+(17*8)(r3)
+       stfd    fp18,_UC_FREGS+(18*8)(r3)
+       stfd    fp19,_UC_FREGS+(19*8)(r3)
+       stfd    fp20,_UC_FREGS+(20*8)(r3)
+       stfd    fp21,_UC_FREGS+(21*8)(r3)
+       stfd    fp22,_UC_FREGS+(22*8)(r3)
+       stfd    fp23,_UC_FREGS+(23*8)(r3)
+       stfd    fp24,_UC_FREGS+(24*8)(r3)
+       stfd    fp25,_UC_FREGS+(25*8)(r3)
+       stfd    fp26,_UC_FREGS+(26*8)(r3)
+       stfd    fp27,_UC_FREGS+(27*8)(r3)
+       stfd    fp28,_UC_FREGS+(28*8)(r3)
+       stfd    fp29,_UC_FREGS+(29*8)(r3)
+       mffs    fp0
+       stfd    fp30,_UC_FREGS+(30*8)(r3)
+       stfd    fp31,_UC_FREGS+(31*8)(r3)
+       stfd    fp0,_UC_FREGS+(32*8)(r3)
+
+# ifdef __CONTEXT_ENABLE_VRS
+#  ifdef PIC
+       mflr    r8
+#   ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r7
+       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
+       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
+#   else
+       bl      _GLOBAL_OFFSET_TABLE_@local-4
+       mflr    r7
+#   endif
+#   ifdef SHARED
+       lwz     r7,_rtld_global_ro@got(r7)
+       mtlr    r8
+       lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r7)
+#   else
+       lwz     r7,_dl_hwcap@got(r7)
+       mtlr    r8
+       lwz     r7,0(r7)
+#   endif
+#  else
+       lis     r7,_dl_hwcap@ha
+       lwz     r7,_dl_hwcap@l(r7)
+#  endif
+       andis.  r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
+
+       la      r10,(_UC_VREGS)(r3)
+       la      r9,(_UC_VREGS+16)(r3)
+       
+       beq     2f      /* L(no_vec) */
+/* address of the combined VSCR/VSAVE quadword.  */    
+       la      r8,(_UC_VREGS+512)(r3)
+
+/* Save the vector registers */
+       stvx  v0,0,r10
+       stvx  v1,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+/* We need to get the Vector Status and Control Register early to avoid
+   store order problems later with the VSAVE register that shares the
+   same quadword.  */
+       mfvscr  v0
+
+       stvx  v2,0,r10
+       stvx  v3,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx    v0,0,r8
+       
+       stvx  v4,0,r10
+       stvx  v5,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v6,0,r10
+       stvx  v7,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v8,0,r10
+       stvx  v9,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v10,0,r10
+       stvx  v11,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v12,0,r10
+       stvx  v13,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v14,0,r10
+       stvx  v15,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v16,0,r10
+       stvx  v17,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v18,0,r10
+       stvx  v19,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v20,0,r10
+       stvx  v21,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v22,0,r10
+       stvx  v23,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v24,0,r10
+       stvx  v25,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v26,0,r10
+       stvx  v27,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v28,0,r10
+       stvx  v29,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       mfspr   r0,VRSAVE
+       stvx  v30,0,r10
+       stvx  v31,0,r9
+
+       stw     r0,0(r8)
+
+2: /* L(no_vec): */
+# endif
+#endif
+/* We need to set up parms and call sigprocmask which will clobber
+   volatile registers. So before the call we need to retrieve the
+   original ucontext ptr (parm1) from stack and store the UC_REGS_PTR
+   (current R3).  */
+       lwz     r12,_FRAME_PARM_SAVE1(r1)
+       li      r4,0
+       stw     r3,_UC_REGS_PTR(r12)
+       addi    r5,r12,_UC_SIGMASK
+       li      r3,SIG_BLOCK
+       bl      __sigprocmask@local
+
+       lwz     r0,_FRAME_LR_SAVE+16(r1)
+       addi    r1,r1,16
+       mtlr    r0
+       blr
+END(__CONTEXT_FUNC_NAME)
+
index 10211458d5e423ce176df6a6b1a602e6fe411b42..dad1074034957cffc764b37003a374bcb000d7fc 100644 (file)
@@ -1,5 +1,5 @@
 /* Save current context.
-   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005 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
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+   02110-1301 USA.  */
 
 #include <sysdep.h>
 #include <rtld-global-offsets.h>
 #include <shlib-compat.h>
+#include <kernel-features.h>
 
 #define __ASSEMBLY__
 #include <asm/ptrace.h>
 #include "ucontext_i.h"
 
-       .machine        "altivec"
-ENTRY(__getcontext)
-       stwu    r1,-16(r1)
-/* Insure that the _UC_REGS start on a quadword boundary.  */
-       stw     r3,_FRAME_PARM_SAVE1(r1)
-       addi    r3,r3,_UC_REG_SPACE+12
-       clrrwi  r3,r3,4
+#define __CONTEXT_FUNC_NAME __getcontext
+#define __CONTEXT_ENABLE_FPRS 1
+#define __CONTEXT_ENABLE_VRS 1
 
-/* Save the general purpose registers */
-       stw     r0,_UC_GREGS+(PT_R0*4)(r3)
-       mflr    r0
-       stw     r2,_UC_GREGS+(PT_R2*4)(r3)
-       stw     r4,_UC_GREGS+(PT_R4*4)(r3)
-/* Set the callers LR_SAVE, and the ucontext LR and NIP to the callers
-   return address.  */
-       stw     r0,_UC_GREGS+(PT_LNK*4)(r3)
-       stw     r0,_UC_GREGS+(PT_NIP*4)(r3)
-       stw     r0,_FRAME_LR_SAVE+16(r1)
-       stw     r5,_UC_GREGS+(PT_R5*4)(r3)
-       stw     r6,_UC_GREGS+(PT_R6*4)(r3)
-       stw     r7,_UC_GREGS+(PT_R7*4)(r3)
-       stw     r8,_UC_GREGS+(PT_R8*4)(r3)
-       stw     r9,_UC_GREGS+(PT_R9*4)(r3)
-       stw     r10,_UC_GREGS+(PT_R10*4)(r3)
-       stw     r11,_UC_GREGS+(PT_R11*4)(r3)
-       stw     r12,_UC_GREGS+(PT_R12*4)(r3)
-       stw     r13,_UC_GREGS+(PT_R13*4)(r3)
-       stw     r14,_UC_GREGS+(PT_R14*4)(r3)
-       stw     r15,_UC_GREGS+(PT_R15*4)(r3)
-       stw     r16,_UC_GREGS+(PT_R16*4)(r3)
-       stw     r17,_UC_GREGS+(PT_R17*4)(r3)
-       stw     r18,_UC_GREGS+(PT_R18*4)(r3)
-       stw     r19,_UC_GREGS+(PT_R19*4)(r3)
-       stw     r20,_UC_GREGS+(PT_R20*4)(r3)
-       stw     r21,_UC_GREGS+(PT_R21*4)(r3)
-       stw     r22,_UC_GREGS+(PT_R22*4)(r3)
-       stw     r23,_UC_GREGS+(PT_R23*4)(r3)
-       stw     r24,_UC_GREGS+(PT_R24*4)(r3)
-       stw     r25,_UC_GREGS+(PT_R25*4)(r3)
-       stw     r26,_UC_GREGS+(PT_R26*4)(r3)
-       stw     r27,_UC_GREGS+(PT_R27*4)(r3)
-       stw     r28,_UC_GREGS+(PT_R28*4)(r3)
-       stw     r29,_UC_GREGS+(PT_R29*4)(r3)
-       stw     r30,_UC_GREGS+(PT_R30*4)(r3)
-       stw     r31,_UC_GREGS+(PT_R31*4)(r3)
-/* Save the value of R1.  We had to push the stack before we
-   had the address of uc_reg_space.  So compute the address of
-   the callers stack pointer and save it as R1.  */
-       addi    r8,r1,16
-       li      r0,0
-/* Save the count, exception and condition registers.  */
-       mfctr   r11
-       mfxer   r10
-       mfcr    r9
-       stw     r8,_UC_GREGS+(PT_R1*4)(r3)
-       stw     r11,_UC_GREGS+(PT_CTR*4)(r3)
-       stw     r10,_UC_GREGS+(PT_XER*4)(r3)
-       stw     r9,_UC_GREGS+(PT_CCR*4)(r3)
-/* Set the return value of getcontext to "success".  R3 is the only
-   register whose value is not preserved in the saved context.  */
-       stw     r0,_UC_GREGS+(PT_R3*4)(r3)
+/* Size of ucontext in GLIBC_2.3.4 and later.  */
+#define _UC_SIZE_2_3_4 1184
 
-/* Zero fill fields that can't be set in user state. */
-       stw     r0,_UC_GREGS+(PT_MSR*4)(r3)
-       stw     r0,_UC_GREGS+(PT_MQ*4)(r3)
-
-/* Save the floating-point registers */
-       stfd    fp0,_UC_FREGS+(0*8)(r3)
-       stfd    fp1,_UC_FREGS+(1*8)(r3)
-       stfd    fp2,_UC_FREGS+(2*8)(r3)
-       stfd    fp3,_UC_FREGS+(3*8)(r3)
-       stfd    fp4,_UC_FREGS+(4*8)(r3)
-       stfd    fp5,_UC_FREGS+(5*8)(r3)
-       stfd    fp6,_UC_FREGS+(6*8)(r3)
-       stfd    fp7,_UC_FREGS+(7*8)(r3)
-       stfd    fp8,_UC_FREGS+(8*8)(r3)
-       stfd    fp9,_UC_FREGS+(9*8)(r3)
-       stfd    fp10,_UC_FREGS+(10*8)(r3)
-       stfd    fp11,_UC_FREGS+(11*8)(r3)
-       stfd    fp12,_UC_FREGS+(12*8)(r3)
-       stfd    fp13,_UC_FREGS+(13*8)(r3)
-       stfd    fp14,_UC_FREGS+(14*8)(r3)
-       stfd    fp15,_UC_FREGS+(15*8)(r3)
-       stfd    fp16,_UC_FREGS+(16*8)(r3)
-       stfd    fp17,_UC_FREGS+(17*8)(r3)
-       stfd    fp18,_UC_FREGS+(18*8)(r3)
-       stfd    fp19,_UC_FREGS+(19*8)(r3)
-       stfd    fp20,_UC_FREGS+(20*8)(r3)
-       stfd    fp21,_UC_FREGS+(21*8)(r3)
-       stfd    fp22,_UC_FREGS+(22*8)(r3)
-       stfd    fp23,_UC_FREGS+(23*8)(r3)
-       stfd    fp24,_UC_FREGS+(24*8)(r3)
-       stfd    fp25,_UC_FREGS+(25*8)(r3)
-       stfd    fp26,_UC_FREGS+(26*8)(r3)
-       stfd    fp27,_UC_FREGS+(27*8)(r3)
-       stfd    fp28,_UC_FREGS+(28*8)(r3)
-       stfd    fp29,_UC_FREGS+(29*8)(r3)
-       mffs    fp0
-       stfd    fp30,_UC_FREGS+(30*8)(r3)
-       stfd    fp31,_UC_FREGS+(31*8)(r3)
-       stfd    fp0,_UC_FREGS+(32*8)(r3)
-
-#ifdef PIC
-       mflr    r8
-# ifdef HAVE_ASM_PPC_REL16
-       bcl     20,31,1f
-1:     mflr    r7
-       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
-       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
-# else
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r7
-# endif
-# ifdef SHARED
-       lwz     r7,_rtld_global_ro@got(r7)
-       mtlr    r8
-       lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r7)
-# else
-       lwz     r7,_dl_hwcap@got(r7)
-       mtlr    r8
-       lwz     r7,0(r7)
-# endif
-#else
-       lis     r7,_dl_hwcap@ha
-       lwz     r7,_dl_hwcap@l(r7)
-#endif
-       andis.  r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
-
-       la      r10,(_UC_VREGS)(r3)
-       la      r9,(_UC_VREGS+16)(r3)
-       
-       beq     L(no_vec)
-/* address of the combined VSCR/VSAVE quadword.  */    
-       la      r8,(_UC_VREGS+512)(r3)
-
-/* Save the vector registers */
-       stvx  v0,0,r10
-       stvx  v1,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-/* We need to get the Vector Status and Control Register early to avoid
-   store order problems later with the VSAVE register that shares the
-   same quadword.  */
-       mfvscr  v0
-
-       stvx  v2,0,r10
-       stvx  v3,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx    v0,0,r8
-       
-       stvx  v4,0,r10
-       stvx  v5,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v6,0,r10
-       stvx  v7,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v8,0,r10
-       stvx  v9,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v10,0,r10
-       stvx  v11,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v12,0,r10
-       stvx  v13,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v14,0,r10
-       stvx  v15,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v16,0,r10
-       stvx  v17,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v18,0,r10
-       stvx  v19,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v20,0,r10
-       stvx  v21,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v22,0,r10
-       stvx  v23,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v24,0,r10
-       stvx  v25,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v26,0,r10
-       stvx  v27,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v28,0,r10
-       stvx  v29,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       mfspr   r0,VRSAVE
-       stvx  v30,0,r10
-       stvx  v31,0,r9
-
-       stw     r0,0(r8)
-
-L(no_vec):
-/* We need to set up parms and call sigprocmask which will clobber
-   volatile registers. So before the call we need to retrieve the
-   original ucontext ptr (parm1) from stack and store the UC_REGS_PTR
-   (current R3).  */
-       lwz     r12,_FRAME_PARM_SAVE1(r1)
+#ifdef __ASSUME_SWAPCONTEXT_SYSCALL
+       .section ".text";
+ENTRY (__getcontext)
        li      r4,0
-       stw     r3,_UC_REGS_PTR(r12)
-       addi    r5,r12,_UC_SIGMASK
-       li      r3,SIG_BLOCK
-       bl      __sigprocmask@local
-
-       lwz     r0,_FRAME_LR_SAVE+16(r1)
-       addi    r1,r1,16
-       mtlr    r0
+       li      r5,_UC_SIZE_2_3_4;
+       DO_CALL (SYS_ify (swapcontext));
+       bso-    cr0,1f
+/* the kernel does not set the return code for the success case */
+       li      r3,0
        blr
+1:
+       b       __syscall_error@local
 END(__getcontext)
+#else
+# include "getcontext-common.S"
+#endif
 
 versioned_symbol (libc, __getcontext, getcontext, GLIBC_2_3_4)
 
 #if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)
-
        compat_text_section
-ENTRY(__novec_getcontext)
-       /*
-        * Since we are not attempting to save the altivec registers,
-        * there is no need to get the register storage space
-        * aligned on a 16-byte boundary.
-        */
-       addi    r3,r3,_UC_REG_SPACE
-       stw     r3,_UC_REGS_PTR - _UC_REG_SPACE(r3)
-       stw     r0,_UC_GREGS+(PT_R0*4)(r3)
-       stw     r1,_UC_GREGS+(PT_R1*4)(r3)
-       mflr    r0
-       stwu    r1,-16(r1)
-       stw     r0,20(r1)
-       stw     r0,_UC_GREGS+(PT_LNK*4)(r3)
-       stw     r0,_UC_GREGS+(PT_NIP*4)(r3)
-       stw     r2,_UC_GREGS+(PT_R2*4)(r3)
-       stw     r4,_UC_GREGS+(PT_R4*4)(r3)
-       stw     r5,_UC_GREGS+(PT_R5*4)(r3)
-       stw     r6,_UC_GREGS+(PT_R6*4)(r3)
-       stw     r7,_UC_GREGS+(PT_R7*4)(r3)
-       stw     r8,_UC_GREGS+(PT_R8*4)(r3)
-       stw     r9,_UC_GREGS+(PT_R9*4)(r3)
-       stw     r10,_UC_GREGS+(PT_R10*4)(r3)
-       stw     r11,_UC_GREGS+(PT_R11*4)(r3)
-       stw     r12,_UC_GREGS+(PT_R12*4)(r3)
-       stw     r13,_UC_GREGS+(PT_R13*4)(r3)
-       stw     r14,_UC_GREGS+(PT_R14*4)(r3)
-       stw     r15,_UC_GREGS+(PT_R15*4)(r3)
-       stw     r16,_UC_GREGS+(PT_R16*4)(r3)
-       stw     r17,_UC_GREGS+(PT_R17*4)(r3)
-       stw     r18,_UC_GREGS+(PT_R18*4)(r3)
-       stw     r19,_UC_GREGS+(PT_R19*4)(r3)
-       stw     r20,_UC_GREGS+(PT_R20*4)(r3)
-       stw     r21,_UC_GREGS+(PT_R21*4)(r3)
-       stw     r22,_UC_GREGS+(PT_R22*4)(r3)
-       stw     r23,_UC_GREGS+(PT_R23*4)(r3)
-       stw     r24,_UC_GREGS+(PT_R24*4)(r3)
-       stw     r25,_UC_GREGS+(PT_R25*4)(r3)
-       stw     r26,_UC_GREGS+(PT_R26*4)(r3)
-       stw     r27,_UC_GREGS+(PT_R27*4)(r3)
-       stw     r28,_UC_GREGS+(PT_R28*4)(r3)
-       stw     r29,_UC_GREGS+(PT_R29*4)(r3)
-       stw     r30,_UC_GREGS+(PT_R30*4)(r3)
-       stw     r31,_UC_GREGS+(PT_R31*4)(r3)
-       mfctr   r0
-       stw     r0,_UC_GREGS+(PT_CTR*4)(r3)
-       mfxer   r0
-       stw     r0,_UC_GREGS+(PT_XER*4)(r3)
-       mfcr    r0
-       stw     r0,_UC_GREGS+(PT_CCR*4)(r3)
-
-       /* Set the return value of getcontext to "success".  R3 is the only
-          register whose value is not preserved in the saved context.  */
-       li      r0,0
-       stw     r0,_UC_GREGS+(PT_R3*4)(r3)
-
-       /* Zero fill fields that can't be set in user state. */
-       stw     r0,_UC_GREGS+(PT_MSR*4)(r3)
-       stw     r0,_UC_GREGS+(PT_MQ*4)(r3)
-
-       /* Save the floating-point registers */
-       stfd    fp0,_UC_FREGS+(0*8)(r3)
-       stfd    fp1,_UC_FREGS+(1*8)(r3)
-       stfd    fp2,_UC_FREGS+(2*8)(r3)
-       stfd    fp3,_UC_FREGS+(3*8)(r3)
-       stfd    fp4,_UC_FREGS+(4*8)(r3)
-       stfd    fp5,_UC_FREGS+(5*8)(r3)
-       stfd    fp6,_UC_FREGS+(6*8)(r3)
-       stfd    fp7,_UC_FREGS+(7*8)(r3)
-       stfd    fp8,_UC_FREGS+(8*8)(r3)
-       stfd    fp9,_UC_FREGS+(9*8)(r3)
-       stfd    fp10,_UC_FREGS+(10*8)(r3)
-       stfd    fp11,_UC_FREGS+(11*8)(r3)
-       stfd    fp12,_UC_FREGS+(12*8)(r3)
-       stfd    fp13,_UC_FREGS+(13*8)(r3)
-       stfd    fp14,_UC_FREGS+(14*8)(r3)
-       stfd    fp15,_UC_FREGS+(15*8)(r3)
-       stfd    fp16,_UC_FREGS+(16*8)(r3)
-       stfd    fp17,_UC_FREGS+(17*8)(r3)
-       stfd    fp18,_UC_FREGS+(18*8)(r3)
-       stfd    fp19,_UC_FREGS+(19*8)(r3)
-       stfd    fp20,_UC_FREGS+(20*8)(r3)
-       stfd    fp21,_UC_FREGS+(21*8)(r3)
-       stfd    fp22,_UC_FREGS+(22*8)(r3)
-       stfd    fp23,_UC_FREGS+(23*8)(r3)
-       stfd    fp24,_UC_FREGS+(24*8)(r3)
-       stfd    fp25,_UC_FREGS+(25*8)(r3)
-       stfd    fp26,_UC_FREGS+(26*8)(r3)
-       stfd    fp27,_UC_FREGS+(27*8)(r3)
-       stfd    fp28,_UC_FREGS+(28*8)(r3)
-       stfd    fp29,_UC_FREGS+(29*8)(r3)
-       mffs    fp0
-       stfd    fp30,_UC_FREGS+(30*8)(r3)
-       stfd    fp31,_UC_FREGS+(31*8)(r3)
-       stfd    fp0,_UC_FREGS+(32*8)(r3)
+       
+# undef __CONTEXT_FUNC_NAME    
+# define __CONTEXT_FUNC_NAME __novec_getcontext
+# undef __CONTEXT_ENABLE_VRS
 
-       addi    r5,r3,_UC_SIGMASK - _UC_REG_SPACE
-       li      r4,0
-       li      r3,SIG_BLOCK
-       bl      __sigprocmask@local
+# clude "getcontext-common.S"
 
-       lwz     r0,20(r1)
-       addi    r1,r1,16
-       mtlr    r0
-       blr
-END(__novec_getcontext)
        .previous
 
 compat_symbol (libc, __novec_getcontext, getcontext, GLIBC_2_3_3)
@@ -385,8 +69,8 @@ compat_symbol (libc, __novec_getcontext, getcontext, GLIBC_2_3_3)
 
 #if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_3_3)
 
-#define _ERRNO_H       1
-#include <bits/errno.h>
+# define _ERRNO_H      1
+# include <bits/errno.h>
 
        compat_text_section
 ENTRY (__getcontext_stub)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
new file mode 100644 (file)
index 0000000..c71fcd7
--- /dev/null
@@ -0,0 +1,290 @@
+/* Jump to a new context powerpc32 common.
+   Copyright (C) 2005 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, write to the Free
+   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+   02110-1301 USA.  */
+
+/* This is the common implementation of setcontext for powerpc32.
+   It not complete in itself should be included in to a framework that 
+   defines:
+     __CONTEXT_FUNC_NAME
+   and if appropriate:
+     __CONTEXT_ENABLE_FPRS
+     __CONTEXT_ENABLE_VRS
+   Any archecture that implements the Vector unit is assumed to also 
+   implement the floating unit.  */
+
+/* Stack frame offsets.  */
+#define _FRAME_BACKCHAIN       0
+#define _FRAME_LR_SAVE         4
+#define _FRAME_PARM_SAVE1      8
+#define _FRAME_PARM_SAVE2      12
+#define _FRAME_PARM_SAVE3      16
+#define _FRAME_PARM_SAVE4      20
+
+#ifdef __CONTEXT_ENABLE_VRS
+       .machine        "altivec"
+#endif
+ENTRY(__CONTEXT_FUNC_NAME)
+       mflr    r0
+       stwu    r1,-16(r1)
+       stw     r0,20(r1)
+       stw     r31,12(r1)
+       lwz     r31,_UC_REGS_PTR(r3)
+
+       /*
+        * If this ucontext refers to the point where we were interrupted
+        * by a signal, we have to use the rt_sigreturn system call to
+        * return to the context so we get both LR and CTR restored.
+        *
+        * Otherwise, the context we are restoring is either just after
+        * a procedure call (getcontext/swapcontext) or at the beginning
+        * of a procedure call (makecontext), so we don't need to restore
+        * r0, xer, ctr.  We don't restore r2 since it will be used as
+        * the TLS pointer.
+        */
+       lwz     r0,_UC_GREGS+(PT_MSR*4)(r31)
+       cmpwi   r0,0
+       bne     4f      /* L(do_sigret) */
+
+       /* Restore the signal mask */
+       li      r5,0
+       addi    r4,r3,_UC_SIGMASK
+       li      r3,SIG_SETMASK
+       bl      __sigprocmask@local
+       cmpwi   r3,0
+       bne     3f      /* L(error_exit) */
+
+#ifdef __CONTEXT_ENABLE_FPRS
+# ifdef __CONTEXT_ENABLE_VRS
+#  ifdef PIC
+       mflr    r8
+#   ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r7
+       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
+       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
+#   else
+       bl      _GLOBAL_OFFSET_TABLE_@local-4
+       mflr    r7
+#   endif
+#   ifdef SHARED
+       lwz     r7,_rtld_global_ro@got(r7)
+       mtlr    r8
+       lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r7)
+#   else
+       lwz     r7,_dl_hwcap@got(r7)
+       mtlr    r8
+       lwz     r7,0(r7)
+#   endif
+#  else
+       lis     r7,_dl_hwcap@ha
+       lwz     r7,_dl_hwcap@l(r7)
+#  endif
+       andis.  r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
+       la      r10,(_UC_VREGS)(r31)
+       beq     2f      /* L(has_no_vec) */
+
+       lwz   r0,(32*16)(r10)
+       li    r9,(32*16)
+       cmpwi r0,0
+       mtspr VRSAVE,r0
+       beq     2f      /* L(has_no_vec) */
+
+       lvx   v19,r9,r10
+       la    r9,(16)(r10)
+
+       lvx   v0,0,r10
+       lvx   v1,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       mtvscr  v19
+       lvx   v2,0,r10
+       lvx   v3,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v4,0,r10
+       lvx   v5,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v6,0,r10
+       lvx   v7,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v8,0,r10
+       lvx   v9,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v10,0,r10
+       lvx   v11,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v12,0,r10
+       lvx   v13,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v14,0,r10
+       lvx   v15,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v16,0,r10
+       lvx   v17,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v18,0,r10
+       lvx   v19,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v20,0,r10
+       lvx   v21,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v22,0,r10
+       lvx   v23,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v24,0,r10
+       lvx   v25,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v26,0,r10
+       lvx   v27,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v28,0,r10
+       lvx   v29,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v30,0,r10
+       lvx   v31,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v10,0,r10
+       lvx   v11,0,r9
+
+2: /* L(has_no_vec): */
+# endif /* __CONTEXT_ENABLE_VRS */
+       /* Restore the floating-point registers */
+       lfd     fp31,_UC_FREGS+(32*8)(r31)
+       lfd     fp0,_UC_FREGS+(0*8)(r31)
+       mtfsf   0xff,fp31
+       lfd     fp1,_UC_FREGS+(1*8)(r31)
+       lfd     fp2,_UC_FREGS+(2*8)(r31)
+       lfd     fp3,_UC_FREGS+(3*8)(r31)
+       lfd     fp4,_UC_FREGS+(4*8)(r31)
+       lfd     fp5,_UC_FREGS+(5*8)(r31)
+       lfd     fp6,_UC_FREGS+(6*8)(r31)
+       lfd     fp7,_UC_FREGS+(7*8)(r31)
+       lfd     fp8,_UC_FREGS+(8*8)(r31)
+       lfd     fp9,_UC_FREGS+(9*8)(r31)
+       lfd     fp10,_UC_FREGS+(10*8)(r31)
+       lfd     fp11,_UC_FREGS+(11*8)(r31)
+       lfd     fp12,_UC_FREGS+(12*8)(r31)
+       lfd     fp13,_UC_FREGS+(13*8)(r31)
+       lfd     fp14,_UC_FREGS+(14*8)(r31)
+       lfd     fp15,_UC_FREGS+(15*8)(r31)
+       lfd     fp16,_UC_FREGS+(16*8)(r31)
+       lfd     fp17,_UC_FREGS+(17*8)(r31)
+       lfd     fp18,_UC_FREGS+(18*8)(r31)
+       lfd     fp19,_UC_FREGS+(19*8)(r31)
+       lfd     fp20,_UC_FREGS+(20*8)(r31)
+       lfd     fp21,_UC_FREGS+(21*8)(r31)
+       lfd     fp22,_UC_FREGS+(22*8)(r31)
+       lfd     fp23,_UC_FREGS+(23*8)(r31)
+       lfd     fp24,_UC_FREGS+(24*8)(r31)
+       lfd     fp25,_UC_FREGS+(25*8)(r31)
+       lfd     fp26,_UC_FREGS+(26*8)(r31)
+       lfd     fp27,_UC_FREGS+(27*8)(r31)
+       lfd     fp28,_UC_FREGS+(28*8)(r31)
+       lfd     fp29,_UC_FREGS+(29*8)(r31)
+       lfd     fp30,_UC_FREGS+(30*8)(r31)
+       lfd     fp31,_UC_FREGS+(31*8)(r31)
+#endif /* __CONTEXT_ENABLE_FPRS */
+
+       /* Restore LR and CCR, and set CTR to the NIP value */
+       lwz     r3,_UC_GREGS+(PT_LNK*4)(r31)
+       lwz     r4,_UC_GREGS+(PT_NIP*4)(r31)
+       lwz     r5,_UC_GREGS+(PT_CCR*4)(r31)
+       mtlr    r3
+       mtctr   r4
+       mtcr    r5
+
+       /* Restore the general registers */
+       lwz     r1,_UC_GREGS+(PT_R1*4)(r31)
+       lwz     r3,_UC_GREGS+(PT_R3*4)(r31)
+       lwz     r4,_UC_GREGS+(PT_R4*4)(r31)
+       lwz     r5,_UC_GREGS+(PT_R5*4)(r31)
+       lwz     r6,_UC_GREGS+(PT_R6*4)(r31)
+       lwz     r7,_UC_GREGS+(PT_R7*4)(r31)
+       lwz     r8,_UC_GREGS+(PT_R8*4)(r31)
+       lwz     r9,_UC_GREGS+(PT_R9*4)(r31)
+       lwz     r10,_UC_GREGS+(PT_R10*4)(r31)
+       lwz     r11,_UC_GREGS+(PT_R11*4)(r31)
+       lwz     r12,_UC_GREGS+(PT_R12*4)(r31)
+       lwz     r13,_UC_GREGS+(PT_R13*4)(r31)
+       lwz     r14,_UC_GREGS+(PT_R14*4)(r31)
+       lwz     r15,_UC_GREGS+(PT_R15*4)(r31)
+       lwz     r16,_UC_GREGS+(PT_R16*4)(r31)
+       lwz     r17,_UC_GREGS+(PT_R17*4)(r31)
+       lwz     r18,_UC_GREGS+(PT_R18*4)(r31)
+       lwz     r19,_UC_GREGS+(PT_R19*4)(r31)
+       lwz     r20,_UC_GREGS+(PT_R20*4)(r31)
+       lwz     r21,_UC_GREGS+(PT_R21*4)(r31)
+       lwz     r22,_UC_GREGS+(PT_R22*4)(r31)
+       lwz     r23,_UC_GREGS+(PT_R23*4)(r31)
+       lwz     r24,_UC_GREGS+(PT_R24*4)(r31)
+       lwz     r25,_UC_GREGS+(PT_R25*4)(r31)
+       lwz     r26,_UC_GREGS+(PT_R26*4)(r31)
+       lwz     r27,_UC_GREGS+(PT_R27*4)(r31)
+       lwz     r28,_UC_GREGS+(PT_R28*4)(r31)
+       lwz     r29,_UC_GREGS+(PT_R29*4)(r31)
+       lwz     r30,_UC_GREGS+(PT_R30*4)(r31)
+       lwz     r31,_UC_GREGS+(PT_R31*4)(r31)
+
+       bctr
+
+3: /* L(error_exit): */
+       lwz     r31,12(r1)
+       lwz     r0,20(r1)
+       addi    r1,r1,16
+       mtlr    r0
+       blr
+
+
+4: /* L(do_sigret): */
+       addi    r1,r3,-0xd0
+       li      r0,SYS_ify(rt_sigreturn)
+       sc
+       /* NOTREACHED */
+
+END (__CONTEXT_FUNC_NAME)
+
index eff60f9bbfdeaec101b533a2f65ac19c277dc7cb..7e9213c2d6046358abf2a4d95f1931fb649d155b 100644 (file)
@@ -1,5 +1,5 @@
 /* Jump to a new context.
-   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005 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
@@ -14,8 +14,8 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+   02110-1301 USA.  */
 
 #include <sysdep.h>
 #include <rtld-global-offsets.h>
 #include <asm/ptrace.h>
 #include "ucontext_i.h"
 
-       .machine        "altivec"
-ENTRY(__setcontext)
-       mflr    r0
-       stwu    r1,-16(r1)
-       stw     r0,20(r1)
-       stw     r31,12(r1)
-       lwz     r31,_UC_REGS_PTR(r3)
-
-       /*
-        * If this ucontext refers to the point where we were interrupted
-        * by a signal, we have to use the rt_sigreturn system call to
-        * return to the context so we get both LR and CTR restored.
-        *
-        * Otherwise, the context we are restoring is either just after
-        * a procedure call (getcontext/swapcontext) or at the beginning
-        * of a procedure call (makecontext), so we don't need to restore
-        * r0, xer, ctr.  We don't restore r2 since it will be used as
-        * the TLS pointer.
-        */
-       lwz     r0,_UC_GREGS+(PT_MSR*4)(r31)
-       cmpwi   r0,0
-       bne     L(do_sigret)
-
-       /* Restore the signal mask */
-       li      r5,0
-       addi    r4,r3,_UC_SIGMASK
-       li      r3,SIG_SETMASK
-       bl      __sigprocmask@local
-       cmpwi   r3,0
-       bne     L(error_exit)
-
-#ifdef PIC
-       mflr    r8
-# ifdef HAVE_ASM_PPC_REL16
-       bcl     20,31,1f
-1:     mflr    r7
-       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
-       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
-# else
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r7
-# endif
-# ifdef SHARED
-       lwz     r7,_rtld_global_ro@got(r7)
-       mtlr    r8
-       lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r7)
-# else
-       lwz     r7,_dl_hwcap@got(r7)
-       mtlr    r8
-       lwz     r7,0(r7)
-# endif
+#define __CONTEXT_FUNC_NAME __setcontext
+#define __CONTEXT_ENABLE_FPRS 1
+#define __CONTEXT_ENABLE_VRS 1
+
+/* Size of ucontext in GLIBC_2.3.4 and later.  */
+#define _UC_SIZE_2_3_4 1184
+
+#ifdef __ASSUME_SWAPCONTEXT_SYSCALL
+       .section ".text";
+ENTRY (__setcontext)
+       mr      r4,r3
+       li      r3,0
+       li      r5,_UC_SIZE_2_3_4;
+       DO_CALL (SYS_ify (swapcontext));
+       bso-    cr0,1f
+/* the kernel does not set the return code for the success case */
+       li      r3,0
+       blr
+1:
+       b       __syscall_error@local
+END(__setcontext)
 #else
-       lis     r7,_dl_hwcap@ha
-       lwz     r7,_dl_hwcap@l(r7)
+# include "setcontext-common.S"
 #endif
-       andis.  r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
-       la      r10,(_UC_VREGS)(r31)
-       beq     L(has_no_vec)
-
-       lwz   r0,(32*16)(r10)
-       li    r9,(32*16)
-       cmpwi r0,0
-       mtspr VRSAVE,r0
-       beq   L(has_no_vec)
-
-       lvx   v19,r9,r10
-       la    r9,(16)(r10)
-
-       lvx   v0,0,r10
-       lvx   v1,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       mtvscr  v19
-       lvx   v2,0,r10
-       lvx   v3,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v4,0,r10
-       lvx   v5,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v6,0,r10
-       lvx   v7,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v8,0,r10
-       lvx   v9,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v10,0,r10
-       lvx   v11,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v12,0,r10
-       lvx   v13,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v14,0,r10
-       lvx   v15,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v16,0,r10
-       lvx   v17,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v18,0,r10
-       lvx   v19,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v20,0,r10
-       lvx   v21,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v22,0,r10
-       lvx   v23,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v24,0,r10
-       lvx   v25,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v26,0,r10
-       lvx   v27,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v28,0,r10
-       lvx   v29,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v30,0,r10
-       lvx   v31,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v10,0,r10
-       lvx   v11,0,r9
-
-L(has_no_vec):
-       /* Restore the floating-point registers */
-       lfd     fp31,_UC_FREGS+(32*8)(r31)
-       lfd     fp0,_UC_FREGS+(0*8)(r31)
-       mtfsf   0xff,fp31
-       lfd     fp1,_UC_FREGS+(1*8)(r31)
-       lfd     fp2,_UC_FREGS+(2*8)(r31)
-       lfd     fp3,_UC_FREGS+(3*8)(r31)
-       lfd     fp4,_UC_FREGS+(4*8)(r31)
-       lfd     fp5,_UC_FREGS+(5*8)(r31)
-       lfd     fp6,_UC_FREGS+(6*8)(r31)
-       lfd     fp7,_UC_FREGS+(7*8)(r31)
-       lfd     fp8,_UC_FREGS+(8*8)(r31)
-       lfd     fp9,_UC_FREGS+(9*8)(r31)
-       lfd     fp10,_UC_FREGS+(10*8)(r31)
-       lfd     fp11,_UC_FREGS+(11*8)(r31)
-       lfd     fp12,_UC_FREGS+(12*8)(r31)
-       lfd     fp13,_UC_FREGS+(13*8)(r31)
-       lfd     fp14,_UC_FREGS+(14*8)(r31)
-       lfd     fp15,_UC_FREGS+(15*8)(r31)
-       lfd     fp16,_UC_FREGS+(16*8)(r31)
-       lfd     fp17,_UC_FREGS+(17*8)(r31)
-       lfd     fp18,_UC_FREGS+(18*8)(r31)
-       lfd     fp19,_UC_FREGS+(19*8)(r31)
-       lfd     fp20,_UC_FREGS+(20*8)(r31)
-       lfd     fp21,_UC_FREGS+(21*8)(r31)
-       lfd     fp22,_UC_FREGS+(22*8)(r31)
-       lfd     fp23,_UC_FREGS+(23*8)(r31)
-       lfd     fp24,_UC_FREGS+(24*8)(r31)
-       lfd     fp25,_UC_FREGS+(25*8)(r31)
-       lfd     fp26,_UC_FREGS+(26*8)(r31)
-       lfd     fp27,_UC_FREGS+(27*8)(r31)
-       lfd     fp28,_UC_FREGS+(28*8)(r31)
-       lfd     fp29,_UC_FREGS+(29*8)(r31)
-       lfd     fp30,_UC_FREGS+(30*8)(r31)
-       lfd     fp31,_UC_FREGS+(31*8)(r31)
-
-       /* Restore LR and CCR, and set CTR to the NIP value */
-       lwz     r3,_UC_GREGS+(PT_LNK*4)(r31)
-       lwz     r4,_UC_GREGS+(PT_NIP*4)(r31)
-       lwz     r5,_UC_GREGS+(PT_CCR*4)(r31)
-       mtlr    r3
-       mtctr   r4
-       mtcr    r5
-
-       /* Restore the general registers */
-       lwz     r1,_UC_GREGS+(PT_R1*4)(r31)
-       lwz     r3,_UC_GREGS+(PT_R3*4)(r31)
-       lwz     r4,_UC_GREGS+(PT_R4*4)(r31)
-       lwz     r5,_UC_GREGS+(PT_R5*4)(r31)
-       lwz     r6,_UC_GREGS+(PT_R6*4)(r31)
-       lwz     r7,_UC_GREGS+(PT_R7*4)(r31)
-       lwz     r8,_UC_GREGS+(PT_R8*4)(r31)
-       lwz     r9,_UC_GREGS+(PT_R9*4)(r31)
-       lwz     r10,_UC_GREGS+(PT_R10*4)(r31)
-       lwz     r11,_UC_GREGS+(PT_R11*4)(r31)
-       lwz     r12,_UC_GREGS+(PT_R12*4)(r31)
-       lwz     r13,_UC_GREGS+(PT_R13*4)(r31)
-       lwz     r14,_UC_GREGS+(PT_R14*4)(r31)
-       lwz     r15,_UC_GREGS+(PT_R15*4)(r31)
-       lwz     r16,_UC_GREGS+(PT_R16*4)(r31)
-       lwz     r17,_UC_GREGS+(PT_R17*4)(r31)
-       lwz     r18,_UC_GREGS+(PT_R18*4)(r31)
-       lwz     r19,_UC_GREGS+(PT_R19*4)(r31)
-       lwz     r20,_UC_GREGS+(PT_R20*4)(r31)
-       lwz     r21,_UC_GREGS+(PT_R21*4)(r31)
-       lwz     r22,_UC_GREGS+(PT_R22*4)(r31)
-       lwz     r23,_UC_GREGS+(PT_R23*4)(r31)
-       lwz     r24,_UC_GREGS+(PT_R24*4)(r31)
-       lwz     r25,_UC_GREGS+(PT_R25*4)(r31)
-       lwz     r26,_UC_GREGS+(PT_R26*4)(r31)
-       lwz     r27,_UC_GREGS+(PT_R27*4)(r31)
-       lwz     r28,_UC_GREGS+(PT_R28*4)(r31)
-       lwz     r29,_UC_GREGS+(PT_R29*4)(r31)
-       lwz     r30,_UC_GREGS+(PT_R30*4)(r31)
-       lwz     r31,_UC_GREGS+(PT_R31*4)(r31)
-
-       bctr
-
-L(error_exit):
-       lwz     r31,12(r1)
-       lwz     r0,20(r1)
-       addi    r1,r1,16
-       mtlr    r0
-       blr
-
-L(do_sigret):
-       addi    r1,r3,-0xd0
-       li      r0,SYS_ify(rt_sigreturn)
-       sc
-       /* NOTREACHED */
-
-END (__setcontext)
 
 versioned_symbol (libc, __setcontext, setcontext, GLIBC_2_3_4)
 
 #if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)
 
        compat_text_section
-ENTRY(__novec_setcontext)
-       mflr    r0
-       stwu    r1,-16(r1)
-       stw     r0,20(r1)
-       stw     r31,12(r1)
-       lwz     r31,_UC_REGS_PTR(r3)
-
-       /*
-        * If this ucontext refers to the point where we were interrupted
-        * by a signal, we have to use the rt_sigreturn system call to
-        * return to the context so we get both LR and CTR restored.
-        *
-        * Otherwise, the context we are restoring is either just after
-        * a procedure call (getcontext/swapcontext) or at the beginning
-        * of a procedure call (makecontext), so we don't need to restore
-        * r0, xer, ctr.  We don't restore r2 since it will be used as
-        * the TLS pointer.
-        */
-       lwz     r0,_UC_GREGS+(PT_MSR*4)(r31)
-       cmpwi   r0,0
-       bne     L(novec_do_sigret)
-
-       /* Restore the signal mask */
-       li      r5,0
-       addi    r4,r3,_UC_SIGMASK
-       li      r3,SIG_SETMASK
-       bl      __sigprocmask@local
-       cmpwi   r3,0
-       bne     L(novec_error_exit)
-
-       /* Restore the floating-point registers */
-       lfd     fp31,_UC_FREGS+(32*8)(r31)
-       lfd     fp0,_UC_FREGS+(0*8)(r31)
-       mtfsf   0xff,fp31
-       lfd     fp1,_UC_FREGS+(1*8)(r31)
-       lfd     fp2,_UC_FREGS+(2*8)(r31)
-       lfd     fp3,_UC_FREGS+(3*8)(r31)
-       lfd     fp4,_UC_FREGS+(4*8)(r31)
-       lfd     fp5,_UC_FREGS+(5*8)(r31)
-       lfd     fp6,_UC_FREGS+(6*8)(r31)
-       lfd     fp7,_UC_FREGS+(7*8)(r31)
-       lfd     fp8,_UC_FREGS+(8*8)(r31)
-       lfd     fp9,_UC_FREGS+(9*8)(r31)
-       lfd     fp10,_UC_FREGS+(10*8)(r31)
-       lfd     fp11,_UC_FREGS+(11*8)(r31)
-       lfd     fp12,_UC_FREGS+(12*8)(r31)
-       lfd     fp13,_UC_FREGS+(13*8)(r31)
-       lfd     fp14,_UC_FREGS+(14*8)(r31)
-       lfd     fp15,_UC_FREGS+(15*8)(r31)
-       lfd     fp16,_UC_FREGS+(16*8)(r31)
-       lfd     fp17,_UC_FREGS+(17*8)(r31)
-       lfd     fp18,_UC_FREGS+(18*8)(r31)
-       lfd     fp19,_UC_FREGS+(19*8)(r31)
-       lfd     fp20,_UC_FREGS+(20*8)(r31)
-       lfd     fp21,_UC_FREGS+(21*8)(r31)
-       lfd     fp22,_UC_FREGS+(22*8)(r31)
-       lfd     fp23,_UC_FREGS+(23*8)(r31)
-       lfd     fp24,_UC_FREGS+(24*8)(r31)
-       lfd     fp25,_UC_FREGS+(25*8)(r31)
-       lfd     fp26,_UC_FREGS+(26*8)(r31)
-       lfd     fp27,_UC_FREGS+(27*8)(r31)
-       lfd     fp28,_UC_FREGS+(28*8)(r31)
-       lfd     fp29,_UC_FREGS+(29*8)(r31)
-       lfd     fp30,_UC_FREGS+(30*8)(r31)
-       lfd     fp31,_UC_FREGS+(31*8)(r31)
-
-       /* Restore LR and CCR, and set CTR to the NIP value */
-       lwz     r3,_UC_GREGS+(PT_LNK*4)(r31)
-       lwz     r4,_UC_GREGS+(PT_NIP*4)(r31)
-       lwz     r5,_UC_GREGS+(PT_CCR*4)(r31)
-       mtlr    r3
-       mtctr   r4
-       mtcr    r5
-
-       /* Restore the general registers */
-       lwz     r1,_UC_GREGS+(PT_R1*4)(r31)
-       lwz     r3,_UC_GREGS+(PT_R3*4)(r31)
-       lwz     r4,_UC_GREGS+(PT_R4*4)(r31)
-       lwz     r5,_UC_GREGS+(PT_R5*4)(r31)
-       lwz     r6,_UC_GREGS+(PT_R6*4)(r31)
-       lwz     r7,_UC_GREGS+(PT_R7*4)(r31)
-       lwz     r8,_UC_GREGS+(PT_R8*4)(r31)
-       lwz     r9,_UC_GREGS+(PT_R9*4)(r31)
-       lwz     r10,_UC_GREGS+(PT_R10*4)(r31)
-       lwz     r11,_UC_GREGS+(PT_R11*4)(r31)
-       lwz     r12,_UC_GREGS+(PT_R12*4)(r31)
-       lwz     r13,_UC_GREGS+(PT_R13*4)(r31)
-       lwz     r14,_UC_GREGS+(PT_R14*4)(r31)
-       lwz     r15,_UC_GREGS+(PT_R15*4)(r31)
-       lwz     r16,_UC_GREGS+(PT_R16*4)(r31)
-       lwz     r17,_UC_GREGS+(PT_R17*4)(r31)
-       lwz     r18,_UC_GREGS+(PT_R18*4)(r31)
-       lwz     r19,_UC_GREGS+(PT_R19*4)(r31)
-       lwz     r20,_UC_GREGS+(PT_R20*4)(r31)
-       lwz     r21,_UC_GREGS+(PT_R21*4)(r31)
-       lwz     r22,_UC_GREGS+(PT_R22*4)(r31)
-       lwz     r23,_UC_GREGS+(PT_R23*4)(r31)
-       lwz     r24,_UC_GREGS+(PT_R24*4)(r31)
-       lwz     r25,_UC_GREGS+(PT_R25*4)(r31)
-       lwz     r26,_UC_GREGS+(PT_R26*4)(r31)
-       lwz     r27,_UC_GREGS+(PT_R27*4)(r31)
-       lwz     r28,_UC_GREGS+(PT_R28*4)(r31)
-       lwz     r29,_UC_GREGS+(PT_R29*4)(r31)
-       lwz     r30,_UC_GREGS+(PT_R30*4)(r31)
-       lwz     r31,_UC_GREGS+(PT_R31*4)(r31)
-
-       bctr
-
-L(novec_error_exit):
-       lwz     r31,12(r1)
-       lwz     r0,20(r1)
-       addi    r1,r1,16
-       mtlr    r0
-       blr
+       
+# undef __CONTEXT_FUNC_NAME    
+# define __CONTEXT_FUNC_NAME __novec_setcontext
+# undef __CONTEXT_ENABLE_VRS
 
-L(novec_do_sigret):
-       addi    r1,r3,-0xd0
-       li      r0,SYS_ify(rt_sigreturn)
-       sc
-       /* NOTREACHED */
+# include "setcontext-common.S"
 
-END (__novec_setcontext)
        .previous
 
 compat_symbol (libc, __novec_setcontext, setcontext, GLIBC_2_3_3)
@@ -406,8 +70,8 @@ compat_symbol (libc, __novec_setcontext, setcontext, GLIBC_2_3_3)
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_3)
 
-#define _ERRNO_H       1
-#include <bits/errno.h>
+# define _ERRNO_H      1
+# include <bits/errno.h>
 
        compat_text_section
 ENTRY (__setcontext_stub)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
new file mode 100644 (file)
index 0000000..8b2998b
--- /dev/null
@@ -0,0 +1,516 @@
+/* Save current context and jump to a new context.
+   Copyright (C) 2005 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, write to the Free
+   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+   02110-1301 USA.  */
+
+/* This is the common implementation of setcontext for powerpc32.
+   It not complete in itself should be included in to a framework that 
+   defines:
+     __CONTEXT_FUNC_NAME
+   and if appropriate:
+     __CONTEXT_ENABLE_FPRS
+     __CONTEXT_ENABLE_VRS
+   Any archecture that implements the Vector unit is assumed to also 
+   implement the floating unit.  */
+
+/* Stack frame offsets.  */
+#define _FRAME_BACKCHAIN       0
+#define _FRAME_LR_SAVE         4
+#define _FRAME_PARM_SAVE1      8
+#define _FRAME_PARM_SAVE2      12
+#define _FRAME_PARM_SAVE3      16
+#define _FRAME_PARM_SAVE4      20
+
+#ifdef __CONTEXT_ENABLE_VRS
+       .machine        "altivec"
+#endif
+ENTRY(__CONTEXT_FUNC_NAME)
+       stwu    r1,-16(r1)
+/* Insure that the _UC_REGS start on a quadword boundary.  */
+       stw     r3,_FRAME_PARM_SAVE1(r1)
+       addi    r3,r3,_UC_REG_SPACE+12
+       stw     r4,_FRAME_PARM_SAVE2(r1)        /* new context pointer */
+       clrrwi  r3,r3,4
+
+/* Save the general purpose registers */
+       stw     r0,_UC_GREGS+(PT_R0*4)(r3)
+       mflr    r0
+       stw     r2,_UC_GREGS+(PT_R2*4)(r3)
+       stw     r4,_UC_GREGS+(PT_R4*4)(r3)                      
+/* Set the callers LR_SAVE, and the ucontext LR and NIP to the callers
+   return address.  */
+       stw     r0,_UC_GREGS+(PT_LNK*4)(r3)
+       stw     r0,_UC_GREGS+(PT_NIP*4)(r3)
+       stw     r0,_FRAME_LR_SAVE+16(r1)
+       stw     r5,_UC_GREGS+(PT_R5*4)(r3)
+       stw     r6,_UC_GREGS+(PT_R6*4)(r3)
+       stw     r7,_UC_GREGS+(PT_R7*4)(r3)
+       stw     r8,_UC_GREGS+(PT_R8*4)(r3)
+       stw     r9,_UC_GREGS+(PT_R9*4)(r3)
+       stw     r10,_UC_GREGS+(PT_R10*4)(r3)
+       stw     r11,_UC_GREGS+(PT_R11*4)(r3)
+       stw     r12,_UC_GREGS+(PT_R12*4)(r3)
+       stw     r13,_UC_GREGS+(PT_R13*4)(r3)
+       stw     r14,_UC_GREGS+(PT_R14*4)(r3)
+       stw     r15,_UC_GREGS+(PT_R15*4)(r3)
+       stw     r16,_UC_GREGS+(PT_R16*4)(r3)
+       stw     r17,_UC_GREGS+(PT_R17*4)(r3)
+       stw     r18,_UC_GREGS+(PT_R18*4)(r3)
+       stw     r19,_UC_GREGS+(PT_R19*4)(r3)
+       stw     r20,_UC_GREGS+(PT_R20*4)(r3)
+       stw     r21,_UC_GREGS+(PT_R21*4)(r3)
+       stw     r22,_UC_GREGS+(PT_R22*4)(r3)
+       stw     r23,_UC_GREGS+(PT_R23*4)(r3)
+       stw     r24,_UC_GREGS+(PT_R24*4)(r3)
+       stw     r25,_UC_GREGS+(PT_R25*4)(r3)
+       stw     r26,_UC_GREGS+(PT_R26*4)(r3)
+       stw     r27,_UC_GREGS+(PT_R27*4)(r3)
+       stw     r28,_UC_GREGS+(PT_R28*4)(r3)
+       stw     r29,_UC_GREGS+(PT_R29*4)(r3)
+       stw     r30,_UC_GREGS+(PT_R30*4)(r3)
+       stw     r31,_UC_GREGS+(PT_R31*4)(r3)
+       
+/* Save the value of R1.  We had to push the stack before we
+   had the address of uc_reg_space.  So compute the address of
+   the callers stack pointer and save it as R1.  */
+       addi    r8,r1,16
+       li      r0,0
+/* Save the count, exception and condition registers.  */
+       mfctr   r11
+       mfxer   r10
+       mfcr    r9
+       stw     r8,_UC_GREGS+(PT_R1*4)(r3)
+       stw     r11,_UC_GREGS+(PT_CTR*4)(r3)
+       stw     r10,_UC_GREGS+(PT_XER*4)(r3)
+       stw     r9,_UC_GREGS+(PT_CCR*4)(r3)
+/* Set the return value of getcontext to "success".  R3 is the only
+   register whose value is not preserved in the saved context.  */
+       stw     r0,_UC_GREGS+(PT_R3*4)(r3)
+
+       /* Zero fill fields that can't be set in user state. */
+       stw     r0,_UC_GREGS+(PT_MSR*4)(r3)
+       stw     r0,_UC_GREGS+(PT_MQ*4)(r3)
+
+#ifdef __CONTEXT_ENABLE_FPRS
+       /* Save the floating-point registers */
+       stfd    fp0,_UC_FREGS+(0*8)(r3)
+       stfd    fp1,_UC_FREGS+(1*8)(r3)
+       stfd    fp2,_UC_FREGS+(2*8)(r3)
+       stfd    fp3,_UC_FREGS+(3*8)(r3)
+       stfd    fp4,_UC_FREGS+(4*8)(r3)
+       stfd    fp5,_UC_FREGS+(5*8)(r3)
+       stfd    fp6,_UC_FREGS+(6*8)(r3)
+       stfd    fp7,_UC_FREGS+(7*8)(r3)
+       stfd    fp8,_UC_FREGS+(8*8)(r3)
+       stfd    fp9,_UC_FREGS+(9*8)(r3)
+       stfd    fp10,_UC_FREGS+(10*8)(r3)
+       stfd    fp11,_UC_FREGS+(11*8)(r3)
+       stfd    fp12,_UC_FREGS+(12*8)(r3)
+       stfd    fp13,_UC_FREGS+(13*8)(r3)
+       stfd    fp14,_UC_FREGS+(14*8)(r3)
+       stfd    fp15,_UC_FREGS+(15*8)(r3)
+       stfd    fp16,_UC_FREGS+(16*8)(r3)
+       stfd    fp17,_UC_FREGS+(17*8)(r3)
+       stfd    fp18,_UC_FREGS+(18*8)(r3)
+       stfd    fp19,_UC_FREGS+(19*8)(r3)
+       stfd    fp20,_UC_FREGS+(20*8)(r3)
+       stfd    fp21,_UC_FREGS+(21*8)(r3)
+       stfd    fp22,_UC_FREGS+(22*8)(r3)
+       stfd    fp23,_UC_FREGS+(23*8)(r3)
+       stfd    fp24,_UC_FREGS+(24*8)(r3)
+       stfd    fp25,_UC_FREGS+(25*8)(r3)
+       stfd    fp26,_UC_FREGS+(26*8)(r3)
+       stfd    fp27,_UC_FREGS+(27*8)(r3)
+       stfd    fp28,_UC_FREGS+(28*8)(r3)
+       stfd    fp29,_UC_FREGS+(29*8)(r3)
+       mffs    fp0
+       stfd    fp30,_UC_FREGS+(30*8)(r3)
+       stfd    fp31,_UC_FREGS+(31*8)(r3)
+       stfd    fp0,_UC_FREGS+(32*8)(r3)
+       
+# ifdef __CONTEXT_ENABLE_VRS
+#  ifdef PIC
+       mflr    r8
+#   ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r7
+       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
+       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
+#   else
+       bl      _GLOBAL_OFFSET_TABLE_@local-4
+       mflr    r7
+#   endif
+#   ifdef SHARED
+       lwz     r7,_rtld_global_ro@got(r7)
+       mtlr    r8
+       lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r7)
+#   else
+       lwz     r7,_dl_hwcap@got(r7)
+       mtlr    r8
+       lwz     r7,0(r7)
+#   endif
+#  else
+       lis     r7,_dl_hwcap@ha
+       lwz     r7,_dl_hwcap@l(r7)
+#  endif
+       andis.  r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
+
+       la      r10,(_UC_VREGS)(r3)
+       la      r9,(_UC_VREGS+16)(r3)
+       
+/*     beq     L(no_vec)*/
+       beq     2f
+/* address of the combined VSCR/VSAVE quadword.  */    
+       la      r8,(_UC_VREGS+512)(r3)
+
+/* Save the vector registers */
+       stvx  v0,0,r10
+       stvx  v1,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+/* We need to get the Vector Status and Control Register early to avoid
+   store order problems later with the VSAVE register that shares the
+   same quadword.  */
+       mfvscr  v0
+
+       stvx  v2,0,r10
+       stvx  v3,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+       
+       stvx    v0,0,r8
+
+       stvx  v4,0,r10
+       stvx  v5,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v6,0,r10
+       stvx  v7,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v8,0,r10
+       stvx  v9,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v10,0,r10
+       stvx  v11,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v12,0,r10
+       stvx  v13,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v14,0,r10
+       stvx  v15,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v16,0,r10
+       stvx  v17,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v18,0,r10
+       stvx  v19,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v20,0,r10
+       stvx  v21,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v22,0,r10
+       stvx  v23,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v24,0,r10
+       stvx  v25,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v26,0,r10
+       stvx  v27,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       stvx  v28,0,r10
+       stvx  v29,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       mfvscr  v0
+       stvx  v30,0,r10
+       stvx  v31,0,r9
+       stw     r0,0(r8)
+       
+2: /*L(no_vec):*/
+# endif /* __CONTEXT_ENABLE_VRS */
+#endif /* __CONTEXT_ENABLE_FPRS */
+
+/* Restore ucontext (parm1) from stack.  */
+       lwz     r12,_FRAME_PARM_SAVE1(r1)
+       li      r4,0
+       stw     r3,_UC_REGS_PTR(r12)
+       addi    r5,r12,_UC_SIGMASK
+       li      r3,SIG_SETMASK
+       bl      __sigprocmask@local
+       cmpwi   r3,0
+       bne     3f      /* L(error_exit) */
+
+       /*
+        * If the new ucontext refers to the point where we were interrupted
+        * by a signal, we have to use the rt_sigreturn system call to
+        * return to the context so we get both LR and CTR restored.
+        *
+        * Otherwise, the context we are restoring is either just after
+        * a procedure call (getcontext/swapcontext) or at the beginning
+        * of a procedure call (makecontext), so we don't need to restore
+        * r0, xer, ctr.  We don't restore r2 since it will be used as
+        * the TLS pointer.
+        */
+       lwz     r4,_FRAME_PARM_SAVE2(r1)
+       lwz     r31,_UC_REGS_PTR(r4)
+       lwz     r0,_UC_GREGS+(PT_MSR*4)(r31)
+       cmpwi   r0,0
+       bne     4f      /* L(do_sigret) */
+
+#ifdef __CONTEXT_ENABLE_FPRS
+# ifdef __CONTEXT_ENABLE_VRS
+
+#  ifdef PIC
+       mflr    r8
+#   ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,5f
+5:     mflr    r7
+       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
+       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
+#   else
+       bl      _GLOBAL_OFFSET_TABLE_@local-4
+       mflr    r7
+#   endif
+#   ifdef SHARED
+       lwz     r7,_rtld_global_ro@got(r7)
+       mtlr    r8
+       lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r7)
+#   else
+       lwz     r7,_dl_hwcap@got(r7)
+       mtlr    r8
+       lwz     r7,0(r7)
+#   endif
+#  else
+       lis     r7,_dl_hwcap@ha
+       lwz     r7,_dl_hwcap@l(r7)
+#  endif
+       andis.  r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
+       la      r10,(_UC_VREGS)(r31)
+       beq     6f      /* L(has_no_vec) */
+
+       lwz   r0,(32*16)(r10)
+       li    r9,(32*16)
+       cmpwi r0,0
+       mtspr VRSAVE,r0
+       beq     6f      /* L(has_no_vec) */
+
+       lvx   v19,r9,r10
+       la    r9,(16)(r10)
+
+       lvx   v0,0,r10
+       lvx   v1,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       mtvscr  v19
+       lvx   v2,0,r10
+       lvx   v3,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v4,0,r10
+       lvx   v5,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v6,0,r10
+       lvx   v7,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v8,0,r10
+       lvx   v9,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v10,0,r10
+       lvx   v11,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v12,0,r10
+       lvx   v13,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v14,0,r10
+       lvx   v15,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v16,0,r10
+       lvx   v17,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v18,0,r10
+       lvx   v19,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v20,0,r10
+       lvx   v21,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v22,0,r10
+       lvx   v23,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v24,0,r10
+       lvx   v25,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v26,0,r10
+       lvx   v27,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v28,0,r10
+       lvx   v29,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v30,0,r10
+       lvx   v31,0,r9
+       addi  r10,r10,32
+       addi  r9,r9,32
+
+       lvx   v10,0,r10
+       lvx   v11,0,r9
+
+6: /* L(has_no_vec): */
+# endif /* __CONTEXT_ENABLE_VRS */
+       /* Restore the floating-point registers */
+       lfd     fp31,_UC_FREGS+(32*8)(r31)
+       lfd     fp0,_UC_FREGS+(0*8)(r31)
+       mtfsf   0xff,fp31
+       lfd     fp1,_UC_FREGS+(1*8)(r31)
+       lfd     fp2,_UC_FREGS+(2*8)(r31)
+       lfd     fp3,_UC_FREGS+(3*8)(r31)
+       lfd     fp4,_UC_FREGS+(4*8)(r31)
+       lfd     fp5,_UC_FREGS+(5*8)(r31)
+       lfd     fp6,_UC_FREGS+(6*8)(r31)
+       lfd     fp7,_UC_FREGS+(7*8)(r31)
+       lfd     fp8,_UC_FREGS+(8*8)(r31)
+       lfd     fp9,_UC_FREGS+(9*8)(r31)
+       lfd     fp10,_UC_FREGS+(10*8)(r31)
+       lfd     fp11,_UC_FREGS+(11*8)(r31)
+       lfd     fp12,_UC_FREGS+(12*8)(r31)
+       lfd     fp13,_UC_FREGS+(13*8)(r31)
+       lfd     fp14,_UC_FREGS+(14*8)(r31)
+       lfd     fp15,_UC_FREGS+(15*8)(r31)
+       lfd     fp16,_UC_FREGS+(16*8)(r31)
+       lfd     fp17,_UC_FREGS+(17*8)(r31)
+       lfd     fp18,_UC_FREGS+(18*8)(r31)
+       lfd     fp19,_UC_FREGS+(19*8)(r31)
+       lfd     fp20,_UC_FREGS+(20*8)(r31)
+       lfd     fp21,_UC_FREGS+(21*8)(r31)
+       lfd     fp22,_UC_FREGS+(22*8)(r31)
+       lfd     fp23,_UC_FREGS+(23*8)(r31)
+       lfd     fp24,_UC_FREGS+(24*8)(r31)
+       lfd     fp25,_UC_FREGS+(25*8)(r31)
+       lfd     fp26,_UC_FREGS+(26*8)(r31)
+       lfd     fp27,_UC_FREGS+(27*8)(r31)
+       lfd     fp28,_UC_FREGS+(28*8)(r31)
+       lfd     fp29,_UC_FREGS+(29*8)(r31)
+       lfd     fp30,_UC_FREGS+(30*8)(r31)
+       lfd     fp31,_UC_FREGS+(31*8)(r31)
+#endif /* __CONTEXT_ENABLE_FPRS */
+
+       /* Restore LR and CCR, and set CTR to the NIP value */
+       lwz     r3,_UC_GREGS+(PT_LNK*4)(r31)
+       lwz     r4,_UC_GREGS+(PT_NIP*4)(r31)
+       lwz     r5,_UC_GREGS+(PT_CCR*4)(r31)
+       mtlr    r3
+       mtctr   r4
+       mtcr    r5
+
+       /* Restore the general registers */
+       lwz     r1,_UC_GREGS+(PT_R1*4)(r31)
+       lwz     r3,_UC_GREGS+(PT_R3*4)(r31)
+       lwz     r4,_UC_GREGS+(PT_R4*4)(r31)
+       lwz     r5,_UC_GREGS+(PT_R5*4)(r31)
+       lwz     r6,_UC_GREGS+(PT_R6*4)(r31)
+       lwz     r7,_UC_GREGS+(PT_R7*4)(r31)
+       lwz     r8,_UC_GREGS+(PT_R8*4)(r31)
+       lwz     r9,_UC_GREGS+(PT_R9*4)(r31)
+       lwz     r10,_UC_GREGS+(PT_R10*4)(r31)
+       lwz     r11,_UC_GREGS+(PT_R11*4)(r31)
+       lwz     r12,_UC_GREGS+(PT_R12*4)(r31)
+       lwz     r13,_UC_GREGS+(PT_R13*4)(r31)
+       lwz     r14,_UC_GREGS+(PT_R14*4)(r31)
+       lwz     r15,_UC_GREGS+(PT_R15*4)(r31)
+       lwz     r16,_UC_GREGS+(PT_R16*4)(r31)
+       lwz     r17,_UC_GREGS+(PT_R17*4)(r31)
+       lwz     r18,_UC_GREGS+(PT_R18*4)(r31)
+       lwz     r19,_UC_GREGS+(PT_R19*4)(r31)
+       lwz     r20,_UC_GREGS+(PT_R20*4)(r31)
+       lwz     r21,_UC_GREGS+(PT_R21*4)(r31)
+       lwz     r22,_UC_GREGS+(PT_R22*4)(r31)
+       lwz     r23,_UC_GREGS+(PT_R23*4)(r31)
+       lwz     r24,_UC_GREGS+(PT_R24*4)(r31)
+       lwz     r25,_UC_GREGS+(PT_R25*4)(r31)
+       lwz     r26,_UC_GREGS+(PT_R26*4)(r31)
+       lwz     r27,_UC_GREGS+(PT_R27*4)(r31)
+       lwz     r28,_UC_GREGS+(PT_R28*4)(r31)
+       lwz     r29,_UC_GREGS+(PT_R29*4)(r31)
+       lwz     r30,_UC_GREGS+(PT_R30*4)(r31)
+       lwz     r31,_UC_GREGS+(PT_R31*4)(r31)
+
+       bctr
+       
+3:/*L(error_exit):*/
+       lwz     r0,_FRAME_LR_SAVE+16(r1)
+       addi    r1,r1,16
+       mtlr    r0
+       blr
+       
+4:/*L(do_sigret):*/
+       addi    r1,r4,-0xd0
+       li      r0,SYS_ify(rt_sigreturn)
+       sc
+       /* NOTREACHED */
+
+END(__CONTEXT_FUNC_NAME)
+
index 6e46abadb09cc135a684be4121eeb615793d9fd3..0605f3d1071100d9961d8911a157abcf58a91314 100644 (file)
@@ -1,5 +1,5 @@
 /* Save current context and jump to a new context.
-   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005 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
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
+   02110-1301 USA.  */
 
 #include <sysdep.h>
 #include <rtld-global-offsets.h>
 #include <shlib-compat.h>
+#include <kernel-features.h>
 
 #define __ASSEMBLY__
 #include <asm/ptrace.h>
 #include "ucontext_i.h"
 
-       .machine        "altivec"
-ENTRY(__swapcontext)
-       stwu    r1,-16(r1)
-/* Insure that the _UC_REGS start on a quadword boundary.  */
-       stw     r3,_FRAME_PARM_SAVE1(r1)
-       addi    r3,r3,_UC_REG_SPACE+12
-       stw     r4,_FRAME_PARM_SAVE2(r1)        /* new context pointer */
-       clrrwi  r3,r3,4
-
-/* Save the general purpose registers */
-       stw     r0,_UC_GREGS+(PT_R0*4)(r3)
-       mflr    r0
-       stw     r2,_UC_GREGS+(PT_R2*4)(r3)
-       stw     r4,_UC_GREGS+(PT_R4*4)(r3)                      
-/* Set the callers LR_SAVE, and the ucontext LR and NIP to the callers
-   return address.  */
-       stw     r0,_UC_GREGS+(PT_LNK*4)(r3)
-       stw     r0,_UC_GREGS+(PT_NIP*4)(r3)
-       stw     r0,_FRAME_LR_SAVE+16(r1)
-       stw     r5,_UC_GREGS+(PT_R5*4)(r3)
-       stw     r6,_UC_GREGS+(PT_R6*4)(r3)
-       stw     r7,_UC_GREGS+(PT_R7*4)(r3)
-       stw     r8,_UC_GREGS+(PT_R8*4)(r3)
-       stw     r9,_UC_GREGS+(PT_R9*4)(r3)
-       stw     r10,_UC_GREGS+(PT_R10*4)(r3)
-       stw     r11,_UC_GREGS+(PT_R11*4)(r3)
-       stw     r12,_UC_GREGS+(PT_R12*4)(r3)
-       stw     r13,_UC_GREGS+(PT_R13*4)(r3)
-       stw     r14,_UC_GREGS+(PT_R14*4)(r3)
-       stw     r15,_UC_GREGS+(PT_R15*4)(r3)
-       stw     r16,_UC_GREGS+(PT_R16*4)(r3)
-       stw     r17,_UC_GREGS+(PT_R17*4)(r3)
-       stw     r18,_UC_GREGS+(PT_R18*4)(r3)
-       stw     r19,_UC_GREGS+(PT_R19*4)(r3)
-       stw     r20,_UC_GREGS+(PT_R20*4)(r3)
-       stw     r21,_UC_GREGS+(PT_R21*4)(r3)
-       stw     r22,_UC_GREGS+(PT_R22*4)(r3)
-       stw     r23,_UC_GREGS+(PT_R23*4)(r3)
-       stw     r24,_UC_GREGS+(PT_R24*4)(r3)
-       stw     r25,_UC_GREGS+(PT_R25*4)(r3)
-       stw     r26,_UC_GREGS+(PT_R26*4)(r3)
-       stw     r27,_UC_GREGS+(PT_R27*4)(r3)
-       stw     r28,_UC_GREGS+(PT_R28*4)(r3)
-       stw     r29,_UC_GREGS+(PT_R29*4)(r3)
-       stw     r30,_UC_GREGS+(PT_R30*4)(r3)
-       stw     r31,_UC_GREGS+(PT_R31*4)(r3)
-       
-/* Save the value of R1.  We had to push the stack before we
-   had the address of uc_reg_space.  So compute the address of
-   the callers stack pointer and save it as R1.  */
-       addi    r8,r1,16
-       li      r0,0
-/* Save the count, exception and condition registers.  */
-       mfctr   r11
-       mfxer   r10
-       mfcr    r9
-       stw     r8,_UC_GREGS+(PT_R1*4)(r3)
-       stw     r11,_UC_GREGS+(PT_CTR*4)(r3)
-       stw     r10,_UC_GREGS+(PT_XER*4)(r3)
-       stw     r9,_UC_GREGS+(PT_CCR*4)(r3)
-/* Set the return value of getcontext to "success".  R3 is the only
-   register whose value is not preserved in the saved context.  */
-       stw     r0,_UC_GREGS+(PT_R3*4)(r3)
-
-       /* Zero fill fields that can't be set in user state. */
-       stw     r0,_UC_GREGS+(PT_MSR*4)(r3)
-       stw     r0,_UC_GREGS+(PT_MQ*4)(r3)
-
-       /* Save the floating-point registers */
-       stfd    fp0,_UC_FREGS+(0*8)(r3)
-       stfd    fp1,_UC_FREGS+(1*8)(r3)
-       stfd    fp2,_UC_FREGS+(2*8)(r3)
-       stfd    fp3,_UC_FREGS+(3*8)(r3)
-       stfd    fp4,_UC_FREGS+(4*8)(r3)
-       stfd    fp5,_UC_FREGS+(5*8)(r3)
-       stfd    fp6,_UC_FREGS+(6*8)(r3)
-       stfd    fp7,_UC_FREGS+(7*8)(r3)
-       stfd    fp8,_UC_FREGS+(8*8)(r3)
-       stfd    fp9,_UC_FREGS+(9*8)(r3)
-       stfd    fp10,_UC_FREGS+(10*8)(r3)
-       stfd    fp11,_UC_FREGS+(11*8)(r3)
-       stfd    fp12,_UC_FREGS+(12*8)(r3)
-       stfd    fp13,_UC_FREGS+(13*8)(r3)
-       stfd    fp14,_UC_FREGS+(14*8)(r3)
-       stfd    fp15,_UC_FREGS+(15*8)(r3)
-       stfd    fp16,_UC_FREGS+(16*8)(r3)
-       stfd    fp17,_UC_FREGS+(17*8)(r3)
-       stfd    fp18,_UC_FREGS+(18*8)(r3)
-       stfd    fp19,_UC_FREGS+(19*8)(r3)
-       stfd    fp20,_UC_FREGS+(20*8)(r3)
-       stfd    fp21,_UC_FREGS+(21*8)(r3)
-       stfd    fp22,_UC_FREGS+(22*8)(r3)
-       stfd    fp23,_UC_FREGS+(23*8)(r3)
-       stfd    fp24,_UC_FREGS+(24*8)(r3)
-       stfd    fp25,_UC_FREGS+(25*8)(r3)
-       stfd    fp26,_UC_FREGS+(26*8)(r3)
-       stfd    fp27,_UC_FREGS+(27*8)(r3)
-       stfd    fp28,_UC_FREGS+(28*8)(r3)
-       stfd    fp29,_UC_FREGS+(29*8)(r3)
-       mffs    fp0
-       stfd    fp30,_UC_FREGS+(30*8)(r3)
-       stfd    fp31,_UC_FREGS+(31*8)(r3)
-       stfd    fp0,_UC_FREGS+(32*8)(r3)
-#ifdef PIC
-       mflr    r8
-# ifdef HAVE_ASM_PPC_REL16
-       bcl     20,31,1f
-1:     mflr    r7
-       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
-       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
-# else
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r7
-# endif
-# ifdef SHARED
-       lwz     r7,_rtld_global_ro@got(r7)
-       mtlr    r8
-       lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r7)
-# else
-       lwz     r7,_dl_hwcap@got(r7)
-       mtlr    r8
-       lwz     r7,0(r7)
-# endif
-#else
-       lis     r7,_dl_hwcap@ha
-       lwz     r7,_dl_hwcap@l(r7)
-#endif
-       andis.  r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
-
-       la      r10,(_UC_VREGS)(r3)
-       la      r9,(_UC_VREGS+16)(r3)
-       
-       beq     L(no_vec)
-/* address of the combined VSCR/VSAVE quadword.  */    
-       la      r8,(_UC_VREGS+512)(r3)
-
-/* Save the vector registers */
-       stvx  v0,0,r10
-       stvx  v1,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-/* We need to get the Vector Status and Control Register early to avoid
-   store order problems later with the VSAVE register that shares the
-   same quadword.  */
-       mfvscr  v0
-
-       stvx  v2,0,r10
-       stvx  v3,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-       
-       stvx    v0,0,r8
-
-       stvx  v4,0,r10
-       stvx  v5,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v6,0,r10
-       stvx  v7,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v8,0,r10
-       stvx  v9,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v10,0,r10
-       stvx  v11,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v12,0,r10
-       stvx  v13,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v14,0,r10
-       stvx  v15,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v16,0,r10
-       stvx  v17,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v18,0,r10
-       stvx  v19,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v20,0,r10
-       stvx  v21,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v22,0,r10
-       stvx  v23,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v24,0,r10
-       stvx  v25,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v26,0,r10
-       stvx  v27,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       stvx  v28,0,r10
-       stvx  v29,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       mfvscr  v0
-       stvx  v30,0,r10
-       stvx  v31,0,r9
-
-       stw     r0,0(r8)
-
-L(no_vec):
-/* Restore ucontext (parm1) from stack.  */
-       lwz     r12,_FRAME_PARM_SAVE1(r1)
-       li      r4,0
-       stw     r3,_UC_REGS_PTR(r12)
-       addi    r5,r12,_UC_SIGMASK
-       li      r3,SIG_SETMASK
-       bl      __sigprocmask@local
-       cmpwi   r3,0
-       bne     L(error_exit)
-
-       /*
-        * If the new ucontext refers to the point where we were interrupted
-        * by a signal, we have to use the rt_sigreturn system call to
-        * return to the context so we get both LR and CTR restored.
-        *
-        * Otherwise, the context we are restoring is either just after
-        * a procedure call (getcontext/swapcontext) or at the beginning
-        * of a procedure call (makecontext), so we don't need to restore
-        * r0, xer, ctr.  We don't restore r2 since it will be used as
-        * the TLS pointer.
-        */
-       lwz     r4,_FRAME_PARM_SAVE2(r1)
-       lwz     r31,_UC_REGS_PTR(r4)
-       lwz     r0,_UC_GREGS+(PT_MSR*4)(r31)
-       cmpwi   r0,0
-       bne     L(do_sigret)
-
-#ifdef PIC
-       mflr    r8
-# ifdef HAVE_ASM_PPC_REL16
-       bcl     20,31,1f
-1:     mflr    r7
-       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
-       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
-# else
-       bl      _GLOBAL_OFFSET_TABLE_@local-4
-       mflr    r7
-# endif
-# ifdef SHARED
-       lwz     r7,_rtld_global_ro@got(r7)
-       mtlr    r8
-       lwz     r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r7)
-# else
-       lwz     r7,_dl_hwcap@got(r7)
-       mtlr    r8
-       lwz     r7,0(r7)
-# endif
-#else
-       lis     r7,_dl_hwcap@ha
-       lwz     r7,_dl_hwcap@l(r7)
-#endif
-       andis.  r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
-       la      r10,(_UC_VREGS)(r31)
-       beq     L(has_no_vec)
-
-       lwz   r0,(32*16)(r10)
-       li    r9,(32*16)
-       cmpwi r0,0
-       mtspr VRSAVE,r0
-       beq   L(has_no_vec)
-
-       lvx   v19,r9,r10
-       la    r9,(16)(r10)
-
-       lvx   v0,0,r10
-       lvx   v1,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       mtvscr  v19
-       lvx   v2,0,r10
-       lvx   v3,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v4,0,r10
-       lvx   v5,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v6,0,r10
-       lvx   v7,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v8,0,r10
-       lvx   v9,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v10,0,r10
-       lvx   v11,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v12,0,r10
-       lvx   v13,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v14,0,r10
-       lvx   v15,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v16,0,r10
-       lvx   v17,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v18,0,r10
-       lvx   v19,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v20,0,r10
-       lvx   v21,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v22,0,r10
-       lvx   v23,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v24,0,r10
-       lvx   v25,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v26,0,r10
-       lvx   v27,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v28,0,r10
-       lvx   v29,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v30,0,r10
-       lvx   v31,0,r9
-       addi  r10,r10,32
-       addi  r9,r9,32
-
-       lvx   v10,0,r10
-       lvx   v11,0,r9
-
-L(has_no_vec):
-       /* Restore the floating-point registers */
-       lfd     fp31,_UC_FREGS+(32*8)(r31)
-       lfd     fp0,_UC_FREGS+(0*8)(r31)
-       mtfsf   0xff,fp31
-       lfd     fp1,_UC_FREGS+(1*8)(r31)
-       lfd     fp2,_UC_FREGS+(2*8)(r31)
-       lfd     fp3,_UC_FREGS+(3*8)(r31)
-       lfd     fp4,_UC_FREGS+(4*8)(r31)
-       lfd     fp5,_UC_FREGS+(5*8)(r31)
-       lfd     fp6,_UC_FREGS+(6*8)(r31)
-       lfd     fp7,_UC_FREGS+(7*8)(r31)
-       lfd     fp8,_UC_FREGS+(8*8)(r31)
-       lfd     fp9,_UC_FREGS+(9*8)(r31)
-       lfd     fp10,_UC_FREGS+(10*8)(r31)
-       lfd     fp11,_UC_FREGS+(11*8)(r31)
-       lfd     fp12,_UC_FREGS+(12*8)(r31)
-       lfd     fp13,_UC_FREGS+(13*8)(r31)
-       lfd     fp14,_UC_FREGS+(14*8)(r31)
-       lfd     fp15,_UC_FREGS+(15*8)(r31)
-       lfd     fp16,_UC_FREGS+(16*8)(r31)
-       lfd     fp17,_UC_FREGS+(17*8)(r31)
-       lfd     fp18,_UC_FREGS+(18*8)(r31)
-       lfd     fp19,_UC_FREGS+(19*8)(r31)
-       lfd     fp20,_UC_FREGS+(20*8)(r31)
-       lfd     fp21,_UC_FREGS+(21*8)(r31)
-       lfd     fp22,_UC_FREGS+(22*8)(r31)
-       lfd     fp23,_UC_FREGS+(23*8)(r31)
-       lfd     fp24,_UC_FREGS+(24*8)(r31)
-       lfd     fp25,_UC_FREGS+(25*8)(r31)
-       lfd     fp26,_UC_FREGS+(26*8)(r31)
-       lfd     fp27,_UC_FREGS+(27*8)(r31)
-       lfd     fp28,_UC_FREGS+(28*8)(r31)
-       lfd     fp29,_UC_FREGS+(29*8)(r31)
-       lfd     fp30,_UC_FREGS+(30*8)(r31)
-       lfd     fp31,_UC_FREGS+(31*8)(r31)
-
-       /* Restore LR and CCR, and set CTR to the NIP value */
-       lwz     r3,_UC_GREGS+(PT_LNK*4)(r31)
-       lwz     r4,_UC_GREGS+(PT_NIP*4)(r31)
-       lwz     r5,_UC_GREGS+(PT_CCR*4)(r31)
-       mtlr    r3
-       mtctr   r4
-       mtcr    r5
-
-       /* Restore the general registers */
-       lwz     r1,_UC_GREGS+(PT_R1*4)(r31)
-       lwz     r3,_UC_GREGS+(PT_R3*4)(r31)
-       lwz     r4,_UC_GREGS+(PT_R4*4)(r31)
-       lwz     r5,_UC_GREGS+(PT_R5*4)(r31)
-       lwz     r6,_UC_GREGS+(PT_R6*4)(r31)
-       lwz     r7,_UC_GREGS+(PT_R7*4)(r31)
-       lwz     r8,_UC_GREGS+(PT_R8*4)(r31)
-       lwz     r9,_UC_GREGS+(PT_R9*4)(r31)
-       lwz     r10,_UC_GREGS+(PT_R10*4)(r31)
-       lwz     r11,_UC_GREGS+(PT_R11*4)(r31)
-       lwz     r12,_UC_GREGS+(PT_R12*4)(r31)
-       lwz     r13,_UC_GREGS+(PT_R13*4)(r31)
-       lwz     r14,_UC_GREGS+(PT_R14*4)(r31)
-       lwz     r15,_UC_GREGS+(PT_R15*4)(r31)
-       lwz     r16,_UC_GREGS+(PT_R16*4)(r31)
-       lwz     r17,_UC_GREGS+(PT_R17*4)(r31)
-       lwz     r18,_UC_GREGS+(PT_R18*4)(r31)
-       lwz     r19,_UC_GREGS+(PT_R19*4)(r31)
-       lwz     r20,_UC_GREGS+(PT_R20*4)(r31)
-       lwz     r21,_UC_GREGS+(PT_R21*4)(r31)
-       lwz     r22,_UC_GREGS+(PT_R22*4)(r31)
-       lwz     r23,_UC_GREGS+(PT_R23*4)(r31)
-       lwz     r24,_UC_GREGS+(PT_R24*4)(r31)
-       lwz     r25,_UC_GREGS+(PT_R25*4)(r31)
-       lwz     r26,_UC_GREGS+(PT_R26*4)(r31)
-       lwz     r27,_UC_GREGS+(PT_R27*4)(r31)
-       lwz     r28,_UC_GREGS+(PT_R28*4)(r31)
-       lwz     r29,_UC_GREGS+(PT_R29*4)(r31)
-       lwz     r30,_UC_GREGS+(PT_R30*4)(r31)
-       lwz     r31,_UC_GREGS+(PT_R31*4)(r31)
-
-       bctr
-
-L(error_exit):
-       lwz     r0,_FRAME_LR_SAVE+16(r1)
-       addi    r1,r1,16
-       mtlr    r0
+#define __CONTEXT_FUNC_NAME __swapcontext
+#define __CONTEXT_ENABLE_FPRS 1
+#define __CONTEXT_ENABLE_VRS 1
+
+/* Size of ucontext in GLIBC_2.3.4 and later.  */
+#define _UC_SIZE_2_3_4 1184
+
+#ifdef __ASSUME_SWAPCONTEXT_SYSCALL
+       .section ".text";
+ENTRY (__swapcontext)
+       li      r5,_UC_SIZE_2_3_4;
+       DO_CALL (SYS_ify (swapcontext));
+       bso-    cr0,1f
+/* the kernel does not set the return code for the success case */
+       li      r3,0
        blr
-
-L(do_sigret):
-       addi    r1,r4,-0xd0
-       li      r0,SYS_ify(rt_sigreturn)
-       sc
-       /* NOTREACHED */
-
+1:
+       b       __syscall_error@local
 END(__swapcontext)
+#else
+# include "swapcontext-common.S"
+#endif
 
 versioned_symbol (libc, __swapcontext, swapcontext, GLIBC_2_3_4)
 
 #if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)
 
        compat_text_section
-ENTRY(__novec_swapcontext)
-       /* Save the current context */
-       addi    r3,r3,_UC_REG_SPACE
-       stw     r3,_UC_REGS_PTR - _UC_REG_SPACE(r3)
-       stw     r0,_UC_GREGS+(PT_R0*4)(r3)
-       stw     r1,_UC_GREGS+(PT_R1*4)(r3)
-       mflr    r0
-       stwu    r1,-16(r1)
-       stw     r0,20(r1)
-       stw     r31,12(r1)
-       stw     r31,_UC_GREGS+(PT_R31*4)(r3)
-       mr      r31,r4                  /* new context pointer */
-       stw     r0,_UC_GREGS+(PT_LNK*4)(r3)
-       stw     r0,_UC_GREGS+(PT_NIP*4)(r3)
-       stw     r2,_UC_GREGS+(PT_R2*4)(r3)
-       stw     r4,_UC_GREGS+(PT_R4*4)(r3)
-       stw     r5,_UC_GREGS+(PT_R5*4)(r3)
-       stw     r6,_UC_GREGS+(PT_R6*4)(r3)
-       stw     r7,_UC_GREGS+(PT_R7*4)(r3)
-       stw     r8,_UC_GREGS+(PT_R8*4)(r3)
-       stw     r9,_UC_GREGS+(PT_R9*4)(r3)
-       stw     r10,_UC_GREGS+(PT_R10*4)(r3)
-       stw     r11,_UC_GREGS+(PT_R11*4)(r3)
-       stw     r12,_UC_GREGS+(PT_R12*4)(r3)
-       stw     r13,_UC_GREGS+(PT_R13*4)(r3)
-       stw     r14,_UC_GREGS+(PT_R14*4)(r3)
-       stw     r15,_UC_GREGS+(PT_R15*4)(r3)
-       stw     r16,_UC_GREGS+(PT_R16*4)(r3)
-       stw     r17,_UC_GREGS+(PT_R17*4)(r3)
-       stw     r18,_UC_GREGS+(PT_R18*4)(r3)
-       stw     r19,_UC_GREGS+(PT_R19*4)(r3)
-       stw     r20,_UC_GREGS+(PT_R20*4)(r3)
-       stw     r21,_UC_GREGS+(PT_R21*4)(r3)
-       stw     r22,_UC_GREGS+(PT_R22*4)(r3)
-       stw     r23,_UC_GREGS+(PT_R23*4)(r3)
-       stw     r24,_UC_GREGS+(PT_R24*4)(r3)
-       stw     r25,_UC_GREGS+(PT_R25*4)(r3)
-       stw     r26,_UC_GREGS+(PT_R26*4)(r3)
-       stw     r27,_UC_GREGS+(PT_R27*4)(r3)
-       stw     r28,_UC_GREGS+(PT_R28*4)(r3)
-       stw     r29,_UC_GREGS+(PT_R29*4)(r3)
-       stw     r30,_UC_GREGS+(PT_R30*4)(r3)
-       mfctr   r0
-       stw     r0,_UC_GREGS+(PT_CTR*4)(r3)
-       mfxer   r0
-       stw     r0,_UC_GREGS+(PT_XER*4)(r3)
-       mfcr    r0
-       stw     r0,_UC_GREGS+(PT_CCR*4)(r3)
-
-       /* Set the return value of swapcontext to "success".  R3 is the only
-          register whose value is not preserved in the saved context.  */
-       li      r0,0
-       stw     r0,_UC_GREGS+(PT_R3*4)(r3)
-
-       /* Zero fill fields that can't be set in user state. */
-       stw     r0,_UC_GREGS+(PT_MSR*4)(r3)
-       stw     r0,_UC_GREGS+(PT_MQ*4)(r3)
-
-       /* Save the floating-point registers */
-       stfd    fp0,_UC_FREGS+(0*8)(r3)
-       stfd    fp1,_UC_FREGS+(1*8)(r3)
-       stfd    fp2,_UC_FREGS+(2*8)(r3)
-       stfd    fp3,_UC_FREGS+(3*8)(r3)
-       stfd    fp4,_UC_FREGS+(4*8)(r3)
-       stfd    fp5,_UC_FREGS+(5*8)(r3)
-       stfd    fp6,_UC_FREGS+(6*8)(r3)
-       stfd    fp7,_UC_FREGS+(7*8)(r3)
-       stfd    fp8,_UC_FREGS+(8*8)(r3)
-       stfd    fp9,_UC_FREGS+(9*8)(r3)
-       stfd    fp10,_UC_FREGS+(10*8)(r3)
-       stfd    fp11,_UC_FREGS+(11*8)(r3)
-       stfd    fp12,_UC_FREGS+(12*8)(r3)
-       stfd    fp13,_UC_FREGS+(13*8)(r3)
-       stfd    fp14,_UC_FREGS+(14*8)(r3)
-       stfd    fp15,_UC_FREGS+(15*8)(r3)
-       stfd    fp16,_UC_FREGS+(16*8)(r3)
-       stfd    fp17,_UC_FREGS+(17*8)(r3)
-       stfd    fp18,_UC_FREGS+(18*8)(r3)
-       stfd    fp19,_UC_FREGS+(19*8)(r3)
-       stfd    fp20,_UC_FREGS+(20*8)(r3)
-       stfd    fp21,_UC_FREGS+(21*8)(r3)
-       stfd    fp22,_UC_FREGS+(22*8)(r3)
-       stfd    fp23,_UC_FREGS+(23*8)(r3)
-       stfd    fp24,_UC_FREGS+(24*8)(r3)
-       stfd    fp25,_UC_FREGS+(25*8)(r3)
-       stfd    fp26,_UC_FREGS+(26*8)(r3)
-       stfd    fp27,_UC_FREGS+(27*8)(r3)
-       stfd    fp28,_UC_FREGS+(28*8)(r3)
-       stfd    fp29,_UC_FREGS+(29*8)(r3)
-       mffs    fp0
-       stfd    fp30,_UC_FREGS+(30*8)(r3)
-       stfd    fp31,_UC_FREGS+(31*8)(r3)
-       stfd    fp0,_UC_FREGS+(32*8)(r3)
-
-       addi    r5,r3,_UC_SIGMASK - _UC_REG_SPACE
-       addi    r4,r4,_UC_SIGMASK
-       li      r3,SIG_SETMASK
-       bl      __sigprocmask@local
-       cmpwi   r3,0
-       bne     L(novec_error_exit)
-
-       /*
-        * If the new ucontext refers to the point where we were interrupted
-        * by a signal, we have to use the rt_sigreturn system call to
-        * return to the context so we get both LR and CTR restored.
-        *
-        * Otherwise, the context we are restoring is either just after
-        * a procedure call (getcontext/swapcontext) or at the beginning
-        * of a procedure call (makecontext), so we don't need to restore
-        * r0, xer, ctr.  We don't restore r2 since it will be used as
-        * the TLS pointer.
-        */
-       mr      r4,r31
-       lwz     r31,_UC_REGS_PTR(r31)
-       lwz     r0,_UC_GREGS+(PT_MSR*4)(r31)
-       cmpwi   r0,0
-       bne     L(novec_do_sigret)
-
-       /* Restore the floating-point registers */
-       lfd     fp31,_UC_FREGS+(32*8)(r31)
-       lfd     fp0,_UC_FREGS+(0*8)(r31)
-       mtfsf   0xff,fp31
-       lfd     fp1,_UC_FREGS+(1*8)(r31)
-       lfd     fp2,_UC_FREGS+(2*8)(r31)
-       lfd     fp3,_UC_FREGS+(3*8)(r31)
-       lfd     fp4,_UC_FREGS+(4*8)(r31)
-       lfd     fp5,_UC_FREGS+(5*8)(r31)
-       lfd     fp6,_UC_FREGS+(6*8)(r31)
-       lfd     fp7,_UC_FREGS+(7*8)(r31)
-       lfd     fp8,_UC_FREGS+(8*8)(r31)
-       lfd     fp9,_UC_FREGS+(9*8)(r31)
-       lfd     fp10,_UC_FREGS+(10*8)(r31)
-       lfd     fp11,_UC_FREGS+(11*8)(r31)
-       lfd     fp12,_UC_FREGS+(12*8)(r31)
-       lfd     fp13,_UC_FREGS+(13*8)(r31)
-       lfd     fp14,_UC_FREGS+(14*8)(r31)
-       lfd     fp15,_UC_FREGS+(15*8)(r31)
-       lfd     fp16,_UC_FREGS+(16*8)(r31)
-       lfd     fp17,_UC_FREGS+(17*8)(r31)
-       lfd     fp18,_UC_FREGS+(18*8)(r31)
-       lfd     fp19,_UC_FREGS+(19*8)(r31)
-       lfd     fp20,_UC_FREGS+(20*8)(r31)
-       lfd     fp21,_UC_FREGS+(21*8)(r31)
-       lfd     fp22,_UC_FREGS+(22*8)(r31)
-       lfd     fp23,_UC_FREGS+(23*8)(r31)
-       lfd     fp24,_UC_FREGS+(24*8)(r31)
-       lfd     fp25,_UC_FREGS+(25*8)(r31)
-       lfd     fp26,_UC_FREGS+(26*8)(r31)
-       lfd     fp27,_UC_FREGS+(27*8)(r31)
-       lfd     fp28,_UC_FREGS+(28*8)(r31)
-       lfd     fp29,_UC_FREGS+(29*8)(r31)
-       lfd     fp30,_UC_FREGS+(30*8)(r31)
-       lfd     fp31,_UC_FREGS+(31*8)(r31)
-
-       /* Restore LR and CCR, and set CTR to the NIP value */
-       lwz     r3,_UC_GREGS+(PT_LNK*4)(r31)
-       lwz     r4,_UC_GREGS+(PT_NIP*4)(r31)
-       lwz     r5,_UC_GREGS+(PT_CCR*4)(r31)
-       mtlr    r3
-       mtctr   r4
-       mtcr    r5
-
-       /* Restore the general registers */
-       lwz     r1,_UC_GREGS+(PT_R1*4)(r31)
-       lwz     r3,_UC_GREGS+(PT_R3*4)(r31)
-       lwz     r4,_UC_GREGS+(PT_R4*4)(r31)
-       lwz     r5,_UC_GREGS+(PT_R5*4)(r31)
-       lwz     r6,_UC_GREGS+(PT_R6*4)(r31)
-       lwz     r7,_UC_GREGS+(PT_R7*4)(r31)
-       lwz     r8,_UC_GREGS+(PT_R8*4)(r31)
-       lwz     r9,_UC_GREGS+(PT_R9*4)(r31)
-       lwz     r10,_UC_GREGS+(PT_R10*4)(r31)
-       lwz     r11,_UC_GREGS+(PT_R11*4)(r31)
-       lwz     r12,_UC_GREGS+(PT_R12*4)(r31)
-       lwz     r13,_UC_GREGS+(PT_R13*4)(r31)
-       lwz     r14,_UC_GREGS+(PT_R14*4)(r31)
-       lwz     r15,_UC_GREGS+(PT_R15*4)(r31)
-       lwz     r16,_UC_GREGS+(PT_R16*4)(r31)
-       lwz     r17,_UC_GREGS+(PT_R17*4)(r31)
-       lwz     r18,_UC_GREGS+(PT_R18*4)(r31)
-       lwz     r19,_UC_GREGS+(PT_R19*4)(r31)
-       lwz     r20,_UC_GREGS+(PT_R20*4)(r31)
-       lwz     r21,_UC_GREGS+(PT_R21*4)(r31)
-       lwz     r22,_UC_GREGS+(PT_R22*4)(r31)
-       lwz     r23,_UC_GREGS+(PT_R23*4)(r31)
-       lwz     r24,_UC_GREGS+(PT_R24*4)(r31)
-       lwz     r25,_UC_GREGS+(PT_R25*4)(r31)
-       lwz     r26,_UC_GREGS+(PT_R26*4)(r31)
-       lwz     r27,_UC_GREGS+(PT_R27*4)(r31)
-       lwz     r28,_UC_GREGS+(PT_R28*4)(r31)
-       lwz     r29,_UC_GREGS+(PT_R29*4)(r31)
-       lwz     r30,_UC_GREGS+(PT_R30*4)(r31)
-       lwz     r31,_UC_GREGS+(PT_R31*4)(r31)
-
-       bctr
-
-L(novec_error_exit):
-       lwz     r31,12(r1)
-       lwz     r0,20(r1)
-       addi    r1,r1,16
-       mtlr    r0
-       blr
+       
+# undef __CONTEXT_FUNC_NAME    
+# define __CONTEXT_FUNC_NAME __novec_swapcontext
+# undef __CONTEXT_ENABLE_VRS
 
-L(novec_do_sigret):
-       addi    r1,r4,-0xd0
-       li      r0,SYS_ify(rt_sigreturn)
-       sc
-       /* NOTREACHED */
+# include "swapcontext-common.S"
 
-END(__novec_swapcontext)
        .previous
 
 compat_symbol (libc, __novec_swapcontext, swapcontext, GLIBC_2_3_3)
@@ -714,8 +69,8 @@ compat_symbol (libc, __novec_swapcontext, swapcontext, GLIBC_2_3_3)
 
 #if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_3_3)
 
-#define _ERRNO_H       1
-#include <bits/errno.h>
+# define _ERRNO_H      1
+# include <bits/errno.h>
 
        compat_text_section
 ENTRY (__swapcontext_stub)
index 546e712edc933b0a4b5569d453baee8d43545c3e..470da5aa6eb255990dca5601aa5adc7f4fd8a771 100644 (file)
 
 # include <errno.h>
 
+# ifdef SHARED
+#  define INLINE_VSYSCALL(name, nr, args...) \
+  ({                                                                         \
+    __label__ out;                                                           \
+    __label__ iserr;                                                         \
+    INTERNAL_SYSCALL_DECL (sc_err);                                          \
+    long int sc_ret;                                                         \
+                                                                             \
+    if (__vdso_##name != NULL)                                               \
+      {                                                                              \
+       sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, sc_err, nr, ##args);   \
+       if (!INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err))                       \
+         goto out;                                                           \
+       if (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err) != ENOSYS)                \
+         goto iserr;                                                         \
+      }                                                                              \
+                                                                             \
+    sc_ret = INTERNAL_SYSCALL (name, sc_err, nr, ##args);                    \
+    if (INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err))                           \
+      {                                                                              \
+      iserr:                                                                 \
+        __set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err));               \
+        sc_ret = -1L;                                                        \
+      }                                                                              \
+  out:                                                                       \
+    sc_ret;                                                                  \
+  })
+# else
+#  define INLINE_VSYSCALL(name, nr, args...) \
+  INLINE_SYSCALL (name, nr, ##args)
+# endif
+
+# ifdef SHARED
+#  define INTERNAL_VSYSCALL(name, err, nr, args...) \
+  ({                                                                         \
+    __label__ out;                                                           \
+    long int v_ret;                                                          \
+                                                                             \
+    if (__vdso_##name != NULL)                                               \
+      {                                                                              \
+       v_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args);       \
+       if (!INTERNAL_SYSCALL_ERROR_P (v_ret, err)                            \
+           || INTERNAL_SYSCALL_ERRNO (v_ret, err) != ENOSYS)                 \
+         goto out;                                                           \
+      }                                                                              \
+    v_ret = INTERNAL_SYSCALL (name, err, nr, ##args);                        \
+  out:                                                                       \
+    v_ret;                                                                   \
+  })
+# else
+#  define INTERNAL_VSYSCALL(name, err, nr, args...) \
+  INTERNAL_SYSCALL (name, err, nr, ##args)
+# endif
+
+# define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, nr, args...)       \
+  ({                                                                         \
+    long int sc_ret = ENOSYS;                                                \
+                                                                             \
+    if (__vdso_##name != NULL)                                               \
+      sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args);       \
+    else                                                                     \
+      err = 1 << 28;                                                         \
+    sc_ret;                                                                  \
+  })
+
+/* List of system calls which are supported as vsyscalls.  */
+# define HAVE_CLOCK_GETRES_VSYSCALL    1
+# define HAVE_CLOCK_GETTIME_VSYSCALL   1
+
+/* Define a macro which expands inline into the wrapper code for a VDSO
+   call. This use is for internal calls that do not need to handle errors
+   normally. It will never touch errno.
+   On powerpc a system call basically clobbers the same registers like a
+   function call, with the exception of LR (which is needed for the
+   "sc; bnslr+" sequence) and CR (where only CR0.SO is clobbered to signal
+   an error return status).  */
+# define INTERNAL_VSYSCALL_NCS(funcptr, err, nr, args...) \
+  ({                                                                         \
+    register void *r0  __asm__ ("r0");                                       \
+    register long int r3  __asm__ ("r3");                                    \
+    register long int r4  __asm__ ("r4");                                    \
+    register long int r5  __asm__ ("r5");                                    \
+    register long int r6  __asm__ ("r6");                                    \
+    register long int r7  __asm__ ("r7");                                    \
+    register long int r8  __asm__ ("r8");                                    \
+    register long int r9  __asm__ ("r9");                                    \
+    register long int r10 __asm__ ("r10");                                   \
+    register long int r11 __asm__ ("r11");                                   \
+    register long int r12 __asm__ ("r12");                                   \
+    LOADARGS_##nr (funcptr, args);                                           \
+    __asm__ __volatile__                                                     \
+      ("mtctr %0\n\t"                                                        \
+       "bctrl\n\t"                                                           \
+       "mfcr %0"                                                             \
+       : "=&r" (r0),                                                         \
+        "=&r" (r3), "=&r" (r4), "=&r" (r5),  "=&r" (r6),  "=&r" (r7),        \
+        "=&r" (r8), "=&r" (r9), "=&r" (r10), "=&r" (r11), "=&r" (r12)        \
+       : ASM_INPUT_##nr                                                              \
+       : "cr0", "ctr", "lr", "memory");                                              \
+    err = (long int) r0;                                                     \
+    (int) r3;                                                                \
+  })
+
 # undef INLINE_SYSCALL
 # define INLINE_SYSCALL(name, nr, args...)                             \
   ({                                                                   \
     register long int r10 __asm__ ("r10");                             \
     register long int r11 __asm__ ("r11");                             \
     register long int r12 __asm__ ("r12");                             \
-    LOADARGS_##nr(name, args);                                         \
+    LOADARGS_##nr(name, args);                                 \
     __asm__ __volatile__                                               \
       ("sc   \n\t"                                                     \
        "mfcr %0"                                                       \
 # undef INTERNAL_SYSCALL_ERRNO
 # define INTERNAL_SYSCALL_ERRNO(val, err)     (val)
 
-# define LOADARGS_0(name, dummy) \
+# define LOADARGS_0(name, dummy)                                             \
        r0 = name
 # define LOADARGS_1(name, __arg1) \
        long int arg1 = (long int) (__arg1);    \
-       LOADARGS_0(name, 0); \
+  LOADARGS_0(name, 0);                                    \
        extern void __illegally_sized_syscall_arg1 (void); \
        if (__builtin_classify_type (__arg1) != 5 && sizeof (__arg1) > 4) \
          __illegally_sized_syscall_arg1 (); \
 #  define PTR_MANGLE(reg, tmpreg) \
        lwz     tmpreg,POINTER_GUARD(r2); \
        xor     reg,tmpreg,reg
+#  define PTR_MANGLE2(reg, tmpreg) \
+       xor     reg,tmpreg,reg
 #  define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg)
+#  define PTR_DEMANGLE2(reg, tmpreg) PTR_MANGLE2 (reg, tmpreg)
 # else
 #  define PTR_MANGLE(var) \
-  (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
+  (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
 #  define PTR_DEMANGLE(var)    PTR_MANGLE (var)
 # endif
 #endif
index 662c69330392299f097382393945dfd4adee15f4..293761f2606a2d6b312003ce61a67c961f97e557 100644 (file)
@@ -7,14 +7,6 @@
 SIG_BLOCK
 SIG_SETMASK
 
--- XXX Do these correspond to some struct?
-_FRAME_BACKCHAIN       0
-_FRAME_LR_SAVE         4
-_FRAME_PARM_SAVE1      8
-_FRAME_PARM_SAVE2      12
-_FRAME_PARM_SAVE3      16
-_FRAME_PARM_SAVE4      20
-
 -- Offsets in ucontext_t.
 #define ucontext(member)       offsetof (ucontext_t, member)
 _UC_LINK               ucontext (uc_link)
index 3ece017563029c02b7ef8d0537216a22826f80d4..858b5c4757626d57650e11d4fc504a3082fba71a 100644 (file)
 #ifdef __ASSEMBLER__
 
 /* This seems to always be the case on PPC.  */
-#define ALIGNARG(log2) log2
+# define ALIGNARG(log2) log2
 /* For ELF we need the `.type' directive to make shared libs work right.  */
-#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg;
-#define ASM_SIZE_DIRECTIVE(name) .size name,.-name
+# define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg;
+# define ASM_SIZE_DIRECTIVE(name) .size name,.-name
 
-#endif /* __ASSEMBLER__ */
+#endif /* __ASSEMBLER__ */
+
+/* This version is for kernels that implement system calls that
+   behave like function calls as far as register saving.
+   It falls back to the syscall in the case that the vDSO doesn't
+   exist or fails for ENOSYS */
+#ifdef SHARED
+# define INLINE_VSYSCALL(name, nr, args...) \
+  ({                                                                         \
+    __label__ out;                                                           \
+    __label__ iserr;                                                         \
+    INTERNAL_SYSCALL_DECL (sc_err);                                          \
+    long int sc_ret;                                                         \
+                                                                             \
+    if (__vdso_##name != NULL)                                               \
+      {                                                                              \
+       sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, sc_err, nr, ##args);   \
+       if (!INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err))                       \
+         goto out;                                                           \
+       if (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err) != ENOSYS)                \
+         goto iserr;                                                         \
+      }                                                                              \
+                                                                             \
+    sc_ret = INTERNAL_SYSCALL (name, sc_err, nr, ##args);                    \
+    if (INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err))                           \
+      {                                                                              \
+      iserr:                                                                 \
+        __set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err));               \
+        sc_ret = -1L;                                                        \
+      }                                                                              \
+  out:                                                                       \
+    sc_ret;                                                                  \
+  })
+#else
+# define INLINE_VSYSCALL(name, nr, args...) \
+  INLINE_SYSCALL (name, nr, ##args)
+#endif
+
+#ifdef SHARED
+# define INTERNAL_VSYSCALL(name, err, nr, args...) \
+  ({                                                                         \
+    __label__ out;                                                           \
+    long int v_ret;                                                          \
+                                                                             \
+    if (__vdso_##name != NULL)                                               \
+      {                                                                              \
+       v_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args);       \
+       if (!INTERNAL_SYSCALL_ERROR_P (v_ret, err)                            \
+           || INTERNAL_SYSCALL_ERRNO (v_ret, err) != ENOSYS)                 \
+         goto out;                                                           \
+      }                                                                              \
+    v_ret = INTERNAL_SYSCALL (name, err, nr, ##args);                        \
+  out:                                                                       \
+    v_ret;                                                                   \
+  })
+#else
+# define INTERNAL_VSYSCALL(name, err, nr, args...) \
+  INTERNAL_SYSCALL (name, err, nr, ##args)
+#endif
+
+/* This version is for internal uses when there is no desire
+   to set errno */
+#define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, nr, args...)        \
+  ({                                                                         \
+    long int sc_ret = ENOSYS;                                                \
+                                                                             \
+    if (__vdso_##name != NULL)                                               \
+      sc_ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args);       \
+    else                                                                     \
+      err = 1 << 28;                                                         \
+    sc_ret;                                                                  \
+  })
+
+/* List of system calls which are supported as vsyscalls.  */
+#define HAVE_CLOCK_GETRES_VSYSCALL     1
+#define HAVE_CLOCK_GETTIME_VSYSCALL    1
+
+/* Define a macro which expands inline into the wrapper code for a system
+   call. This use is for internal calls that do not need to handle errors
+   normally. It will never touch errno. This returns just what the kernel
+   gave back in the non-error (CR0.SO cleared) case, otherwise (CR0.SO set)
+   the negation of the return value in the kernel gets reverted.  */
+
+#define INTERNAL_VSYSCALL_NCS(funcptr, err, nr, args...) \
+  ({                                                                   \
+    register void *r0  __asm__ ("r0");                                 \
+    register long int r3  __asm__ ("r3");                              \
+    register long int r4  __asm__ ("r4");                              \
+    register long int r5  __asm__ ("r5");                              \
+    register long int r6  __asm__ ("r6");                              \
+    register long int r7  __asm__ ("r7");                              \
+    register long int r8  __asm__ ("r8");                              \
+    LOADARGS_##nr (funcptr, args);                                     \
+    __asm__ __volatile__                                               \
+      ("mtctr %0\n\t"                                                  \
+       "bctrl\n\t"                                                     \
+       "mfcr  %0\n\t"                                                  \
+       "0:"                                                            \
+       : "=&r" (r0),                                                   \
+         "=&r" (r3), "=&r" (r4), "=&r" (r5),                           \
+         "=&r" (r6), "=&r" (r7), "=&r" (r8)                            \
+       : ASM_INPUT_##nr                                                        \
+       : "r9", "r10", "r11", "r12",                                    \
+         "cr0", "ctr", "lr", "memory");                                        \
+         err = (long int) r0;                                          \
+    (int) r3;                                                          \
+  })
 
 #undef INLINE_SYSCALL
 
     register long int r6  __asm__ ("r6");                              \
     register long int r7  __asm__ ("r7");                              \
     register long int r8  __asm__ ("r8");                              \
-    LOADARGS_##nr(name, args);                                         \
+    LOADARGS_##nr (name, ##args);                                      \
     __asm__ __volatile__                                               \
       ("sc\n\t"                                                                \
        "mfcr  %0\n\t"                                                  \
     (int) r3;  \
   })
 #define INTERNAL_SYSCALL(name, err, nr, args...)                       \
-  INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args)
+  INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, args)
 
 #undef INTERNAL_SYSCALL_DECL
 #define INTERNAL_SYSCALL_DECL(err) long int err
 #  define PTR_MANGLE(reg, tmpreg) \
        ld      tmpreg,POINTER_GUARD(r13); \
        xor     reg,tmpreg,reg
+#  define PTR_MANGLE2(reg, tmpreg) \
+       xor     reg,tmpreg,reg
 #  define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg)
+#  define PTR_DEMANGLE2(reg, tmpreg) PTR_MANGLE2 (reg, tmpreg)
 # else
 #  define PTR_MANGLE(var) \
   (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
index 480ebd424c5a1e8cc092f7b3a94df21e6620f3bc..eff4f1785319b10568607c3b7b25a08c4c483c57 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2005 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
@@ -44,6 +44,10 @@ __libc_sigaction (sig, act, oact)
 }
 libc_hidden_def (__libc_sigaction)
 
+#ifdef WRAPPER_INCLUDE
+# include WRAPPER_INCLUDE
+#endif
+
 #ifndef LIBC_SIGACTION
 weak_alias (__libc_sigaction, __sigaction)
 libc_hidden_weak (__sigaction)
index deb61817507c1e3166d52740ed7b6474fc783e3c..877d78d3969d012ad44c2a73b291d52fc3ca7596 100644 (file)
@@ -32,7 +32,6 @@
 
        .text
        .align  5
-       cfi_startproc
 ENTRY(__makecontext)
        mov     #4, r3
        mov.l   @(oSS_SP,r4), r1
@@ -140,6 +139,7 @@ ENTRY(__makecontext)
 .L4:
        .long   HIDDEN_JUMPTARGET(exit)
 #endif
+       cfi_startproc
 PSEUDO_END(__makecontext)
 
 weak_alias (__makecontext, makecontext)
index 3ea47d4a5c6ae17729d976297715ec7936faf4b4..66b3daaa3bfae009704ab1af0fb92587082a75f0 100644 (file)
@@ -25,7 +25,6 @@
 
        .text
        .align  5
-       cfi_startproc
 ENTRY(__getcontext)
 
        /* Return value of getcontext.  R0 is the only register whose
@@ -84,7 +83,6 @@ ENTRY(__getcontext)
        rts
         nop
 
-       cfi_endproc
 PSEUDO_END(__getcontext)
 
 weak_alias (__getcontext, getcontext)
index 30fbf7dec300fb9837615d47da6fcecd19ac70f3..3136267aca993fc4785f72594761739926942e19 100644 (file)
@@ -25,7 +25,6 @@
 
        .text
        .align  5
-       cfi_startproc
 ENTRY(__setcontext)
 
        mov     r4, r8
@@ -95,7 +94,6 @@ ENTRY(__setcontext)
        jmp     @r0
         mov.l  @r15+, r0
 
-       cfi_endproc
 PSEUDO_END(__setcontext)
 
 weak_alias (__setcontext, setcontext)
index aa0129e9ac49a5bb54e78ba3e249373223a955df..64035e5545a802de7279da25e179ef6330949079 100644 (file)
@@ -25,7 +25,6 @@
 
        .text
        .align  5
-       cfi_startproc
 ENTRY(__swapcontext)
 
        /* Return value of getcontext.  R0 is the only register whose
@@ -128,7 +127,6 @@ ENTRY(__swapcontext)
        jmp     @r0
         mov.l  @r15+, r0
        
-       cfi_endproc
 PSEUDO_END(__swapcontext)
 
 weak_alias (__swapcontext, swapcontext)
index 380c4591ddd42a641eedd0e7afc4631fb41d5a11..68bc235bcfb5362e74bacb0676441969cfc198c7 100644 (file)
@@ -25,7 +25,6 @@
 
        .text
        .align  5
-       cfi_startproc
 ENTRY(__getcontext)
 
        /* Return value of getcontext.  R0 is the only register whose
@@ -127,7 +126,6 @@ ENTRY(__getcontext)
        rts
         nop
 
-       cfi_endproc
 PSEUDO_END(__getcontext)
 
 weak_alias (__getcontext, getcontext)
index 9e98910b4b05d4c78a9631e1a6bbc7f2b6be12b0..2bc546d1a152b2ff8d63394d70c509de385fca96 100644 (file)
@@ -25,7 +25,6 @@
 
        .text
        .align  5
-       cfi_startproc
 ENTRY(__setcontext)
 
        mov     r4, r8
@@ -135,7 +134,6 @@ ENTRY(__setcontext)
        jmp     @r0
         mov.l  @r15+, r0
 
-       cfi_endproc
 PSEUDO_END(__setcontext)
 
 weak_alias (__setcontext, setcontext)
index 1d58a40e7023608058445fa20c6fdf9ce9c4b80b..1aeca1b1a724d37413f4b30983d764b5e37f33a5 100644 (file)
@@ -25,7 +25,6 @@
 
        .text
        .align  5
-       cfi_startproc
 ENTRY(__swapcontext)
 
        /* Return value of getcontext.  R0 is the only register whose
@@ -210,7 +209,6 @@ ENTRY(__swapcontext)
        jmp     @r0
         mov.l  @r15+, r0
        
-       cfi_endproc
 PSEUDO_END(__swapcontext)
 
 weak_alias (__swapcontext, swapcontext)
index eb1761b94baf9dba384143123ceb71733bcb7249..c83b0f26017a4a8335ad0d3791f5d1ee7a172138 100644 (file)
@@ -88,7 +88,6 @@
 #endif
 
 .globl __socket
-       cfi_startproc
 ENTRY (__socket)
        /* This will not work in the case of a socket call being interrupted
           by a signal.  If the signal handler uses any stack the arguments
@@ -169,7 +168,6 @@ ENTRY (__socket)
        bra     .Lsyscall_error
         nop
 #endif
-       cfi_endproc
 
        .align 2
 .L1:
index 33fdc748b5d5c89a793c9c454575cfa82c48d8d6..176d99aab7c443bc6222a4aeb6a9df27442027a7 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2005
+   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
@@ -27,6 +28,7 @@
 
 ENTRY (__syscall_error)
        neg r4, r0
+       cfi_endproc
 
 #define __syscall_error __syscall_error_1
 #include <sysdeps/unix/sh/sysdep.S>
index 1a412e53dbce3bae247da44f36c05e036b7657f7..b41236299d96d1bffce7615523aba1f4ca0a3929 100644 (file)
 #   define SYSCALL_ERROR_HANDLER \
        neg r0,r1; \
        mov.l r14,@-r15; \
+       cfi_adjust_cfa_offset (4); \
+       cfi_rel_offset (r14, 0); \
        mov.l r12,@-r15; \
+       cfi_adjust_cfa_offset (4); \
+       cfi_rel_offset (r12, 0); \
        mov.l r1,@-r15; \
+       cfi_adjust_cfa_offset (4); \
+       cfi_rel_offset (r1, 0); \
        mov.l 0f,r12; \
        mova 0f,r0; \
        add r0,r12; \
        sts.l pr,@-r15; \
+       cfi_adjust_cfa_offset (4); \
+       cfi_rel_offset (pr, 0); \
        mov r15,r14; \
+       cfi_def_cfa_register (r14); \
        mov.l 1f,r1; \
        bsrf r1; \
          nop; \
index 91c37824bc62afe889a3ae01cbfe6996f94ee711..a9ad6b18f344620a54e356b1c19e4ee7695924b8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2000,2002,2003,2005 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
@@ -129,6 +129,10 @@ __libc_sigaction (sig, act, oact)
 }
 libc_hidden_def (__libc_sigaction)
 
+#ifdef WRAPPER_INCLUDE
+# include WRAPPER_INCLUDE
+#endif
+
 #ifndef LIBC_SIGACTION
 weak_alias (__libc_sigaction, __sigaction)
 libc_hidden_weak (__sigaction)
index dac9ac5cba53deb398401b549c744fad1bef86b3..45aa2655ee230e668941bc7a0ed8b283efd6c01b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1999,2000,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1999,2000,2003, 2005 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
@@ -59,8 +59,8 @@ typedef struct __sparc64_jmp_buf
 
 /* Test if longjmp to JMPBUF would unwind the frame
    containing a local variable at ADDRESS.  */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
-  ((unsigned long int) (address) < (jmpbuf)->uc_mcontext.mc_fp)
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle)                     \
+  ((unsigned long int) (address) < demangle ((jmpbuf)->uc_mcontext.mc_fp))
 
 #else
 
@@ -76,8 +76,8 @@ typedef int __jmp_buf[3];
 
 /* Test if longjmp to JMPBUF would unwind the frame
    containing a local variable at ADDRESS.  */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
-  ((int) (address) < (jmpbuf)[JB_SP])
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle)     \
+  ((int) (address) < demangle ((jmpbuf)[JB_SP]))
 
 #endif
 
index 7fb6459d77ddafa8cc246d3523fe4db58585e0f4..3be801a9326b94b59b945d8e61fbae837fbab685 100644 (file)
@@ -1,5 +1,5 @@
 /* POSIX.1 sigaction call for Linux/SPARC.
-   Copyright (C) 1997,1998,1999,2000,2002,2003 Free Software Foundation, Inc.
+   Copyright (C) 1997-2000,2002,2003,2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Miguel de Icaza (miguel@nuclecu.unam.mx), 1997.
 
@@ -132,6 +132,10 @@ __libc_sigaction (int sig, __const struct sigaction *act,
 }
 libc_hidden_def (__libc_sigaction)
 
+#ifdef WRAPPER_INCLUDE
+# include WRAPPER_INCLUDE
+#endif
+
 #ifndef LIBC_SIGACTION
 weak_alias (__libc_sigaction, __sigaction);
 libc_hidden_weak (__sigaction)
index 0a2d2c3ddec707a711a8513904de54abcb29c859..b5e35f4e40e89bdd3e1f005e0dbcefce4d523b9f 100644 (file)
@@ -1,5 +1,5 @@
 /* POSIX.1 sigaction call for Linux/SPARC64.
-   Copyright (C) 1997,1998,1999,2000,2002,2003 Free Software Foundation, Inc.
+   Copyright (C) 1997-2000,2002,2003,2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Miguel de Icaza (miguel@nuclecu.unam.mx) and
                  Jakub Jelinek (jj@ultra.linux.cz).
@@ -65,6 +65,10 @@ __libc_sigaction (int sig, __const struct sigaction *act,
 }
 libc_hidden_def (__libc_sigaction)
 
+#ifdef WRAPPER_INCLUDE
+# include WRAPPER_INCLUDE
+#endif
+
 #ifndef LIBC_SIGACTION
 weak_alias (__libc_sigaction, __sigaction);
 libc_hidden_weak (__sigaction)
index 91230470925690490169497ce550bdaedebd9cdb..d6f4558cef696135c31e2edd6fe40ce2cf7755a0 100644 (file)
@@ -1,5 +1,5 @@
 /* POSIX.1 `sigaction' call for Linux/x86-64.
-   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2005 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
@@ -79,6 +79,10 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 }
 libc_hidden_def (__libc_sigaction)
 
+#ifdef WRAPPER_INCLUDE
+# include WRAPPER_INCLUDE
+#endif
+
 #ifndef LIBC_SIGACTION
 weak_alias (__libc_sigaction, __sigaction)
 libc_hidden_weak (__sigaction)
index dd797e8a7b2367aa0f458ac60c4ffc256b1efdb3..6e2109245195527ba9ceaf4d87c5371dca871948 100644 (file)
    void __longjmp (__jmp_buf env, int val).  */
 ENTRY(__longjmp)
        /* Restore registers.  */
+       movq (JB_RSP*8)(%rdi),%r8
+       movq (JB_RBP*8)(%rdi),%r9
+       movq (JB_PC*8)(%rdi),%rdx
+#ifdef PTR_DEMANGLE
+       PTR_DEMANGLE (%r8)
+       PTR_DEMANGLE (%r9)
+       PTR_DEMANGLE (%rdx)
+#endif
        /* We add unwind information for the target here.  */
        cfi_def_cfa(%rdi, 0)
+       cfi_register(%rsp,%r8)
+       cfi_register(%rbp,%r9)
+       cfi_register(%rip,%rdx)
        cfi_offset(%rbx,JB_RBX*8)
        cfi_offset(%rbp,JB_RBP*8)
        cfi_offset(%r12,JB_R12*8)
        cfi_offset(%r13,JB_R13*8)
        cfi_offset(%r14,JB_R14*8)
        cfi_offset(%r15,JB_R15*8)
-       cfi_offset(%rsp,JB_RSP*8)
-       cfi_offset(%rip,JB_PC*8)
        movq (JB_RBX*8)(%rdi),%rbx
-       movq (JB_RBP*8)(%rdi),%rbp
        movq (JB_R12*8)(%rdi),%r12
        movq (JB_R13*8)(%rdi),%r13
        movq (JB_R14*8)(%rdi),%r14
        movq (JB_R15*8)(%rdi),%r15
        /* Set return value for setjmp.  */
-       test %esi,%esi
-       mov $01,%eax
-       cmove %eax,%esi
        mov %esi, %eax
-       movq (JB_PC*8)(%rdi),%rdx
-       movq (JB_RSP*8)(%rdi),%rsp
-#ifdef PTR_DEMANGLE
-       PTR_DEMANGLE (%rbp)
-       PTR_DEMANGLE (%rsp)
-       PTR_DEMANGLE (%rdx)
-#endif
+       movq %r8,%rsp
+       movq %r9,%rbp
        jmpq *%rdx
 END (BP_SYM (__longjmp))
index 96646efddabb7f39cca71add9c72cfe9a02e2314..1031d5027b6a38706c38fcdd99a0d042471b62e5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2005 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
@@ -67,11 +67,11 @@ typedef int __jmp_buf[6];
 /* Test if longjmp to JMPBUF would unwind the frame
    containing a local variable at ADDRESS.  */
 # if __WORDSIZE == 64
-#  define _JMPBUF_UNWINDS(jmpbuf, address) \
-  ((void *) (address) < (void *) (jmpbuf)[JB_RSP])
+#  define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+  ((void *) (address) < (void *) demangle ((jmpbuf)[JB_RSP]))
 # else
-#  define _JMPBUF_UNWINDS(jmpbuf, address) \
-  ((void *) (address) < (void *) (jmpbuf)[JB_SP])
+#  define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+  ((void *) (address) < (void *) demangle ((jmpbuf)[JB_SP]))
 # endif
 #endif
 
index eb6c8e21b151bb30c87722dc48cfd12d37faba1a..cca5a80a39a2e00559e0d91f5b6c647efdc54493 100644 (file)
@@ -1,5 +1,5 @@
 /* Test NUL handling of mbsrtowcs.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
 
@@ -32,7 +32,7 @@ main (void)
   mbstate_t state;
   memset (&state, '\0', sizeof (state));
 
-  const char *in = buf;
+  const char *in = (const char *) buf;
   size_t n = mbsrtowcs (out, &in, sizeof (out) / sizeof (wchar_t), &state);
 
   int result = 0;