Update. cvs/libc-ud-970530
authorUlrich Drepper <drepper@redhat.com>
Sat, 31 May 1997 00:47:04 +0000 (00:47 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 31 May 1997 00:47:04 +0000 (00:47 +0000)
1997-05-31 02:33  Ulrich Drepper  <drepper@cygnus.com>

* io/ftwtest-sh: More tests.

* misc/tsearch.c: Rewrite tdestroy_recursive.

* libio/libio.h: Define bits for libg++-2.8.

1997-05-30 22:21  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>

* nis/nss_nis/nis-hosts.c: Same changes as in
nss/nss_files/files-hosts.c (Always use inet_pton).
* nis/nss_nisplus/nisplus-hosts.c: Likewise.

1997-05-30 09:50  Richard Henderson  <rth@tamu.edu>

* manual/maint.texi: ECOFF hasn't been tested in ages and I don't
plan on doing so ever again.  Don't say alpha-linuxecoff is known
to work.

* elf/dl-lookup.c: Include <alloca.h>.
* misc/tsearch.c: Include <string.h>.
* posix/execle.c: Include <alloca.h>.
* posix/execlp.c: Likewise.
* stdio-common/printf_fphex.c: Include <string.h>.
* sunrpc/xdr.c: Include <string.h>.
* sysdeps/generic/memccpy.c: Include only <string.h>.

* sunrpc/clnt_udp.c (clntudp_call): Make fromlen a size_t to fix
parameters to network functions.
* sunrpc/pmap_rmt.c (clnt_broadcast): Likewise.
* sunrpc/svc_tcp.c (svctcp_create): Likewise with `len'.
(rendezvous_request): Likewise.
* sunrpc/svc_udp.c (svcudp_bufcreate): Likewise.
(svcudp_recv): Similar, but go through a local variable.  The old code
used &xprt->xp_addrlen.  Someone should determine if the type of the
structure member should be changed instead.
* sunrpc/xdr_rec.c (xdrrec_create): Expunge a ptr->int cast warning
and transform a nonsense for-loop to a closed form calculation.
(fill_input_buf): Another ptr->int warning.

* sysdeps/alpha/Makefile: Temporarily turn on -mieee globally.  This
will last until I figure out how to build a parallel libm_ieee.

* sysdeps/alpha/fpu/fclrexcpt.c,
* sysdeps/alpha/fpu/fegetenv.c,
* sysdeps/alpha/fpu/fegetround.c,
* sysdeps/alpha/fpu/feholdexcpt.c,
* sysdeps/alpha/fpu/fenvbits.h,
* sysdeps/alpha/fpu/fesetenv.c,
* sysdeps/alpha/fpu/fesetround.c,
* sysdeps/alpha/fpu/feupdateenv.c,
* sysdeps/alpha/fpu/fgetexcptflg.c,
* sysdeps/alpha/fpu/fraiseexcpt.c,
* sysdeps/alpha/fpu/fsetexcptflg.c,
* sysdeps/alpha/fpu/ftestexcept.c: New files.  There is, btw, a small
kernel patch that must be applied as of 2.0.31-pre1 and 2.1.41 for
this to work properly.

* sysdeps/alpha/fpu/fpu_control.h: Update copyright.  Change default
FP mode to round to nearest, no exceptions as for Intel.
* sysdeps/unix/sysv/linux/alpha/setfpucw.c: Add copyright.
(rdfpcr): Use excb rather than trapb.  Be more efficient about
getting at the fpcr.
(wrfpcr): Likewise.
(__setfpucw): Reformat.

* sysdeps/ieee754/huge_val.h: Change GCC's HUGE_VAL definition to use
a single DI-mode integer instead of bytes.  This produces better code
on Alpha.  Similar for HUGE_VALF.
* sysdeps/ieee754/nan.h: Similar for NAN.  Add NANF and NANL.

* sysdeps/libm-ieee754/s_log2.c: Missing */ and weak_alias.

* sysdeps/unix/alpha/sysdep.S: Tiny cleanups.
* sysdeps/unix/sysv/linux/alpha/syscall.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/brk.S: Don't use jmp macro to make
sure the stack frame is released the very instruction before the
real jump out.
* sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Likewise.

* sysdeps/unix/sysv/linux/alpha/gnu/types.h: Undef some bits we may
have gotten from <linux/posix_types.h>.

* sysdeps/unix/sysv/linux/alpha/ioperm.c: Add definition for Miata.

1997-05-30 13:05  Ulrich Drepper  <drepper@cygnus.com>

* misc/tst-tsearch.c (mangle_tree): Update casts to prevent
warnings.

1997-05-29 14:02  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* sysdeps/unix/sysv/linux/sys/ttydefaults.h (CEOL, CSTATUS): Use
correct value for _POSIX_VDISABLE.

1997-05-29 13:59  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* Makefile (manual/dir-add.texi): Force execution.

1997-05-29 13:57  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* sysexits.h: New file.

1997-05-29 13:55  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* stdlib/strfmon.c: Don't run past EOS after `='.

1997-02-27 10:34  Richard Henderson  <rth@tamu.edu>

48 files changed:
ChangeLog
Makefile
PROJECTS
elf/dl-lookup.c
io/ftwtest-sh
libio/libio.h
manual/maint.texi
misc/tsearch.c
misc/tst-tsearch.c
nis/nss_nis/nis-hosts.c
nis/nss_nisplus/nisplus-hosts.c
posix/execle.c
posix/execlp.c
stdio-common/printf_fphex.c
stdlib/strfmon.c
sunrpc/clnt_udp.c
sunrpc/pmap_rmt.c
sunrpc/svc_tcp.c
sunrpc/svc_udp.c
sunrpc/xdr.c
sunrpc/xdr_rec.c
sysdeps/alpha/Makefile
sysdeps/alpha/fpu/fclrexcpt.c [new file with mode: 0644]
sysdeps/alpha/fpu/fegetenv.c [new file with mode: 0644]
sysdeps/alpha/fpu/fegetround.c [new file with mode: 0644]
sysdeps/alpha/fpu/feholdexcpt.c [new file with mode: 0644]
sysdeps/alpha/fpu/fenvbits.h [new file with mode: 0644]
sysdeps/alpha/fpu/fesetenv.c [new file with mode: 0644]
sysdeps/alpha/fpu/fesetround.c [new file with mode: 0644]
sysdeps/alpha/fpu/feupdateenv.c [new file with mode: 0644]
sysdeps/alpha/fpu/fgetexcptflg.c [new file with mode: 0644]
sysdeps/alpha/fpu/fpu_control.h
sysdeps/alpha/fpu/fraiseexcpt.c [new file with mode: 0644]
sysdeps/alpha/fpu/fsetexcptflg.c [new file with mode: 0644]
sysdeps/alpha/fpu/ftestexcept.c [new file with mode: 0644]
sysdeps/generic/memccpy.c
sysdeps/ieee754/huge_val.h
sysdeps/ieee754/nan.h
sysdeps/libm-ieee754/s_log2.c
sysdeps/unix/alpha/sysdep.S
sysdeps/unix/sysv/linux/alpha/brk.S
sysdeps/unix/sysv/linux/alpha/gnu/types.h
sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S
sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S
sysdeps/unix/sysv/linux/alpha/ioperm.c
sysdeps/unix/sysv/linux/alpha/setfpucw.c
sysdeps/unix/sysv/linux/alpha/syscall.S
sysdeps/unix/sysv/linux/sys/ttydefaults.h

index 199ee31f9a99791c1ad509ca4d5a1f4d111e32f8..fdbfc6176193cdaf325425ffb04fe3a231e5dc49 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,112 @@
+1997-05-31 02:33  Ulrich Drepper  <drepper@cygnus.com>
+
+       * io/ftwtest-sh: More tests.
+
+       * misc/tsearch.c: Rewrite tdestroy_recursive.
+
+       * libio/libio.h: Define bits for libg++-2.8.
+
+1997-05-30 22:21  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>
+
+       * nis/nss_nis/nis-hosts.c: Same changes as in
+       nss/nss_files/files-hosts.c (Always use inet_pton).
+       * nis/nss_nisplus/nisplus-hosts.c: Likewise.
+
+1997-05-30 09:50  Richard Henderson  <rth@tamu.edu>
+
+       * manual/maint.texi: ECOFF hasn't been tested in ages and I don't
+       plan on doing so ever again.  Don't say alpha-linuxecoff is known
+       to work.
+
+       * elf/dl-lookup.c: Include <alloca.h>.
+       * misc/tsearch.c: Include <string.h>.
+       * posix/execle.c: Include <alloca.h>.
+       * posix/execlp.c: Likewise.
+       * stdio-common/printf_fphex.c: Include <string.h>.
+       * sunrpc/xdr.c: Include <string.h>.
+       * sysdeps/generic/memccpy.c: Include only <string.h>.
+
+       * sunrpc/clnt_udp.c (clntudp_call): Make fromlen a size_t to fix
+       parameters to network functions.
+       * sunrpc/pmap_rmt.c (clnt_broadcast): Likewise.
+       * sunrpc/svc_tcp.c (svctcp_create): Likewise with `len'.
+       (rendezvous_request): Likewise.
+       * sunrpc/svc_udp.c (svcudp_bufcreate): Likewise.
+       (svcudp_recv): Similar, but go through a local variable.  The old code
+       used &xprt->xp_addrlen.  Someone should determine if the type of the
+       structure member should be changed instead.
+       * sunrpc/xdr_rec.c (xdrrec_create): Expunge a ptr->int cast warning
+       and transform a nonsense for-loop to a closed form calculation.
+       (fill_input_buf): Another ptr->int warning.
+
+       * sysdeps/alpha/Makefile: Temporarily turn on -mieee globally.  This
+       will last until I figure out how to build a parallel libm_ieee.
+
+       * sysdeps/alpha/fpu/fclrexcpt.c,
+       * sysdeps/alpha/fpu/fegetenv.c,
+       * sysdeps/alpha/fpu/fegetround.c,
+       * sysdeps/alpha/fpu/feholdexcpt.c,
+       * sysdeps/alpha/fpu/fenvbits.h,
+       * sysdeps/alpha/fpu/fesetenv.c,
+       * sysdeps/alpha/fpu/fesetround.c,
+       * sysdeps/alpha/fpu/feupdateenv.c,
+       * sysdeps/alpha/fpu/fgetexcptflg.c,
+       * sysdeps/alpha/fpu/fraiseexcpt.c,
+       * sysdeps/alpha/fpu/fsetexcptflg.c,
+       * sysdeps/alpha/fpu/ftestexcept.c: New files.  There is, btw, a small
+       kernel patch that must be applied as of 2.0.31-pre1 and 2.1.41 for
+       this to work properly.
+
+       * sysdeps/alpha/fpu/fpu_control.h: Update copyright.  Change default
+       FP mode to round to nearest, no exceptions as for Intel.
+       * sysdeps/unix/sysv/linux/alpha/setfpucw.c: Add copyright.
+       (rdfpcr): Use excb rather than trapb.  Be more efficient about
+       getting at the fpcr.
+       (wrfpcr): Likewise.
+       (__setfpucw): Reformat.
+
+       * sysdeps/ieee754/huge_val.h: Change GCC's HUGE_VAL definition to use
+       a single DI-mode integer instead of bytes.  This produces better code
+       on Alpha.  Similar for HUGE_VALF.
+       * sysdeps/ieee754/nan.h: Similar for NAN.  Add NANF and NANL.
+
+       * sysdeps/libm-ieee754/s_log2.c: Missing */ and weak_alias.
+
+       * sysdeps/unix/alpha/sysdep.S: Tiny cleanups.
+       * sysdeps/unix/sysv/linux/alpha/syscall.S: Likewise.
+       * sysdeps/unix/sysv/linux/alpha/brk.S: Don't use jmp macro to make
+       sure the stack frame is released the very instruction before the
+       real jump out.
+       * sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S: Likewise.
+       * sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Likewise.
+
+       * sysdeps/unix/sysv/linux/alpha/gnu/types.h: Undef some bits we may
+       have gotten from <linux/posix_types.h>.
+
+       * sysdeps/unix/sysv/linux/alpha/ioperm.c: Add definition for Miata.
+
+1997-05-30 13:05  Ulrich Drepper  <drepper@cygnus.com>
+
+       * misc/tst-tsearch.c (mangle_tree): Update casts to prevent
+       warnings.
+
+1997-05-29 14:02  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * sysdeps/unix/sysv/linux/sys/ttydefaults.h (CEOL, CSTATUS): Use
+       correct value for _POSIX_VDISABLE.
+
+1997-05-29 13:59  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * Makefile (manual/dir-add.texi): Force execution.
+
+1997-05-29 13:57  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * sysexits.h: New file.
+
+1997-05-29 13:55  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * stdlib/strfmon.c: Don't run past EOS after `='.
+
 1997-05-29 12:48  Ulrich Drepper  <drepper@cygnus.com>
 
        * io/ftw.c: Complete rewrite.  Add implementation of `nftw'.
        header since it is wrong for 64 bit systems.
        Patch by a sun <asun@zoology.washington.edu>.
 
-1997-02-27 10:34:11  Richard Henderson  <rth@tamu.edu>
+1997-02-27 10:34  Richard Henderson  <rth@tamu.edu>
 
        * sysdeps/unix/sysv/linux/alpha/brk.S: Support both the Linux/i386
        and OSF/1 style brk syscalls.  We may want to change Linux/Alpha
index bebffa472229b82b98547d9a1235e6aa2fc4adbc..a91999bb426fed6e1ad48999ac2dd1c9e74ba792 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -315,8 +315,9 @@ makeinfo --no-validate --no-warn --no-headers $< -o $@
 endef
 INSTALL: manual/maint.texi; $(format-me)
 NOTES: manual/creature.texi; $(format-me)
-manual/dir-add.texi:
+manual/dir-add.texi: FORCE
        $(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
+FORCE:
 
 rpm/%: subdir_distinfo
        $(MAKE) $(PARALLELMFLAGS) -C $(@D) subdirs='$(subdirs)' $(@F)
index 0775bd2130c54a95d54ea0d6cee7855117f7acce..59b3d8a0f5d714322cb6f5213335910a8c207b37 100644 (file)
--- a/PROJECTS
+++ b/PROJECTS
@@ -80,12 +80,6 @@ contact <bug-glibc@prep.ai.mit.edu>
      work.
 
 
-[ 9] Write nftw() function.  Perhaps it might be good to reimplement the
-     ftw() function as well to share most of the code.
-
-**** Almost done!
-
-
 [10] Extend regex and/or rx to work with wide characters and complete
      implementation of character class and collation class handling.
 
@@ -98,21 +92,12 @@ contact <bug-glibc@prep.ai.mit.edu>
      hard and not all services must be supported at once.
 
 
-[12] Rewrite utmp/wtmp functions to use database functions.  This is much
-     better than the normal flat file format.
-
-**** There are plans for a new approach to this problem.  Please contact
-     bug-glibc@prep.ai.mit.edu before starting to work.)
-
-
 [13] Several more or less small functions have to be written:
 
      + tcgetid() and waitid()                  from XPG4.2
      + grantpt(), ptsname(), unlockpt()                from XPG4.2
      + getdate()                               from XPG4.2
        *** Probably underway
-     + fmtmsg()                                        from SVID
-       *** Probably underway
 
      More information are available on request.
 
index 63a525edaaedfa95be10b83feed150a56f81598d..294dfb951ff11d79000dd5707b22101a05244f6b 100644 (file)
@@ -17,6 +17,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <alloca.h>
 #include <stddef.h>
 #include <link.h>
 #include <assert.h>
index 1c7c3984d8ec6bb08ff0bbd79666a03a92493302..da2eaf73139f6d5ef9c9759c76a50304faf26137 100644 (file)
@@ -16,7 +16,7 @@ testprogram=$2
 tmp=${TMPDIR:-/tmp}
 tmpdir=$tmp/ftwtest.d
 
-trap 'rm -fr $tmpdir $testout' 1 2 3 15
+trap 'chmod -R a+x $tmpdir; rm -fr $tmpdir $testout' 1 2 3 15
 
 if test -d $tmpdir; then
   chmod -R a+x $tmpdir
@@ -39,7 +39,8 @@ echo > $tmpdir/bar/xo
 chmod a-x,a+r $tmpdir/bar
 
 testout=${TMPDIR:-/tmp}/ftwtest.out
-LD_LIBRARY_PATH=$objpfx $objpfx/elf/ld.so $testprogram $tmpdir |
+
+LD_LIBRARY_PATH=$objpfx ${objpfx}elf/ld.so $testprogram $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
@@ -58,27 +59,47 @@ base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F
 EOF
 rm $testout
 
-testout=${TMPDIR:-/tmp}/ftwtest.out
-LD_LIBRARY_PATH=$objpfx $objpfx/elf/ld.so $testprogram --depth $tmpdir |
+LD_LIBRARY_PATH=$objpfx ${objpfx}elf/ld.so $testprogram --depth $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
-base = "/tmp/", file = "ftwtest.d", flag = FTW_DP
-base = "/tmp/ftwtest.d/", file = "bar", flag = FTW_DP
-base = "/tmp/ftwtest.d/", file = "baz", flag = FTW_F
-base = "/tmp/ftwtest.d/", file = "foo", flag = FTW_DP
-base = "/tmp/ftwtest.d/bar/", file = "xo", flag = FTW_NS
-base = "/tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_DP
-base = "/tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F
-base = "/tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN
-base = "/tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_DP
-base = "/tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F
-base = "/tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_DP
-base = "/tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F
+base = "$tmp/", file = "ftwtest.d", flag = FTW_DP
+base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_DP
+base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F
+base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_DP
+base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_NS
+base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_DP
+base = "$tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F
+base = "$tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN
+base = "$tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_DP
+base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F
+base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_DP
+base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F
+EOF
+rm $testout
+
+LD_LIBRARY_PATH=$objpfx ${objpfx}elf/ld.so $testprogram --phys $tmpdir |
+    sort > $testout
+
+cat <<EOF | cmp $testout - || exit 1
+base = "$tmp/", file = "ftwtest.d", flag = FTW_D
+base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D
+base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F
+base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D
+base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_NS
+base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D
+base = "$tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F
+base = "$tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SL
+base = "$tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_D
+base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F
+base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "link@2", flag = FTW_SL
+base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D
+base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F
+base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "link@3", flag = FTW_SL
 EOF
 rm $testout
 
 chmod -R a+x $tmpdir
 rm -fr $tmpdir
 
-exit 0
\ No newline at end of file
+exit 0
index d0a76c34b25f7c4366fae975c56f8a9b5f6decd6..20eb5a9e1aecc48dfd04bee4c9e41ebf44b4e8d4 100644 (file)
@@ -127,6 +127,7 @@ the executable file might be covered by the GNU General Public License. */
 #define _IO_CURRENTLY_PUTTING 0x800
 #define _IO_IS_APPENDING 0x1000
 #define _IO_IS_FILEBUF 0x2000
+#define _IO_BAD_SEEN 0x4000
 
 /* These are "formatting flags" matching the iostream fmtflags enum values. */
 #define _IO_SKIPWS 01
@@ -145,6 +146,7 @@ the executable file might be covered by the GNU General Public License. */
 #define _IO_UNITBUF 020000
 #define _IO_STDIO 040000
 #define _IO_DONT_CLOSE 0100000
+#define _IO_BOOLALPHA 0200000
 
 
 struct _IO_jump_t;  struct _IO_FILE;
index 38d9786b9f66590c9ddf7c8842adb223834b4188..9c542a3ce394c6dcd5657d8fe3d3f68eb6f4f783 100644 (file)
@@ -223,7 +223,6 @@ following patterns:
 
 @smallexample
 alpha-@var{anything}-linux
-alpha-@var{anything}-linuxecoff
 i@var{x}86-@var{anything}-gnu
 i@var{x}86-@var{anything}-linux
 m68k-@var{anything}-linux
@@ -234,6 +233,7 @@ versions) used to run on the following configurations:
 
 @smallexample
 alpha-dec-osf1
+alpha-@var{anything}-linuxecoff
 i@var{x}86-@var{anything}-bsd4.3
 i@var{x}86-@var{anything}-isc2.2
 i@var{x}86-@var{anything}-isc3.@var{n}
index c06930d509a6314b920be4f89490c09e3a1cb780..e372a9e971dcc134d388b530366270f20269f242 100644 (file)
@@ -85,6 +85,7 @@
    binary tree.  */
 
 #include <stdlib.h>
+#include <string.h>
 #include <search.h>
 
 typedef struct node_t
@@ -633,16 +634,11 @@ weak_alias (__twalk, twalk)
 static void
 tdestroy_recurse (node root, __free_fn_t freefct)
 {
-  if (root->left == NULL && root->right == NULL)
-    (*freefct) (root->key);
-  else
-    {
-      if (root->left != NULL)
-       tdestroy_recurse (root->left, freefct);
-      if (root->right != NULL)
-       tdestroy_recurse (root->right, freefct);
-      (*freefct) (root->key);
-    }
+  if (root->left != NULL)
+    tdestroy_recurse (root->left, freefct);
+  if (root->right != NULL)
+    tdestroy_recurse (root->right, freefct);
+  (*freefct) ((void *) root->key);
   /* Free the node itself.  */
   free (root);
 }
index 18cf89c91f313ec2182c6df084f423f892e957da..7a0c5fac6e9bfe717b48924994b84a6a631381ab 100644 (file)
@@ -197,14 +197,14 @@ mangle_tree (enum order how, enum action what, void **root, int lag)
        case build:
          if (i < SIZE)
            {
-             if (tfind (x + j, (const void **) root, cmp_fn) != NULL)
+             if (tfind (x + j, (void *const *) root, cmp_fn) != NULL)
                {
                  fputs ("Found element which is not in tree yet.\n", stdout);
                  error = 1;
                }
              elem = tsearch (x + j, root, cmp_fn);
              if (elem == 0
-                 || tfind (x + j, (const void **) root, cmp_fn) == NULL)
+                 || tfind (x + j, (void *const *) root, cmp_fn) == NULL)
                {
                  fputs ("Couldn't find element after it was added.\n",
                         stdout);
@@ -219,7 +219,7 @@ mangle_tree (enum order how, enum action what, void **root, int lag)
          /* fall through */
 
        case delete:
-         elem = tfind (x + j, (const void **) root, cmp_fn);
+         elem = tfind (x + j, (void *const *) root, cmp_fn);
          if (elem == NULL || tdelete (x + j, root, cmp_fn) == NULL)
            {
              fputs ("Error deleting element.\n", stdout);
@@ -228,7 +228,7 @@ mangle_tree (enum order how, enum action what, void **root, int lag)
          break;
 
        case find:
-         if (tfind (x + j, (const void **) root, cmp_fn) == NULL)
+         if (tfind (x + j, (void *const *) root, cmp_fn) == NULL)
            {
              fputs ("Couldn't find element after it was added.\n", stdout);
              error = 1;
index 5ca24c76255de567676fb4471bd234cf783abde9..91d30c8149440cb1b7298078fe7fb8ce948e788c 100644 (file)
@@ -32,7 +32,6 @@
 
 /* Get implementation for some internal functions. */
 #include <resolv/mapv4v6addr.h>
-#include <resolv/mapv4v6hostent.h>
 
 #define ENTNAME         hostent
 #define DATABASE        "hosts"
@@ -56,8 +55,7 @@ LINE_PARSER
    STRING_FIELD (addr, isspace, 1);
 
    /* Parse address.  */
-   if ((_res.options & RES_USE_INET6)
-       && inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
+   if (inet_pton (AF_INET6, p, entdata->host_addr) > 0)
      {
        result->h_addrtype = AF_INET6;
        result->h_length = IN6ADDRSZ;
@@ -87,14 +85,6 @@ LINE_PARSER
    entdata->h_addr_ptrs[1] = NULL;
    result->h_addr_list = entdata->h_addr_ptrs;
 
-   /* If we need the host entry in IPv6 form change it now.  */
-   if (_res.options & RES_USE_INET6)
-     {
-       char *bufptr = data->linebuffer;
-       size_t buflen = (char *) data + datalen - bufptr;
-       map_v4v6_hostent (result, &bufptr, &buflen);
-     }
-
    STRING_FIELD (result->h_name, isspace, 1);
  }
 )
index 6f1b4be35b7e9ede1ff10019a6eb055560d7525b..0a005406d1dd5d02c0c4243814db37958dedd8ed 100644 (file)
@@ -43,7 +43,6 @@ static nis_name *names = NULL;
 
 /* Get implementation for some internal functions. */
 #include "../../resolv/mapv4v6addr.h"
-#include "../../resolv/mapv4v6hostent.h"
 
 #define ENTNAME         hostent
 #define DATABASE        "hosts"
@@ -67,8 +66,7 @@ LINE_PARSER
    STRING_FIELD (addr, isspace, 1);
 
    /* Parse address.  */
-   if ((_res.options & RES_USE_INET6)
-       && inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
+   if (inet_pton (AF_INET6, p, entdata->host_addr) > 0)
      {
        result->h_addrtype = AF_INET6;
        result->h_length = IN6ADDRSZ;
@@ -98,15 +96,6 @@ LINE_PARSER
    entdata->h_addr_ptrs[1] = NULL;
    result->h_addr_list = entdata->h_addr_ptrs;
 
-   /* If we need the host entry in IPv6 form change it now.  */
-   if (_res.options & RES_USE_INET6)
-     {
-       char *bufptr = data->linebuffer;
-       /* This should be size_t */
-       int buflen = (char *) data + datalen - bufptr;
-       map_v4v6_hostent (result, &bufptr, &buflen);
-     }
-
    STRING_FIELD (result->h_name, isspace, 1);
  }
 )
index 3e0fcee87ecc83676fa013746705f4fc062f4133..7619a36f427c4642d95bd9666df603a093b17c54 100644 (file)
@@ -16,6 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <alloca.h>
 #include <unistd.h>
 #include <stdarg.h>
 #include <stddef.h>
index 76b878ec6aab6a027e8dd2441cd86bc45319f22f..88a54178cc9f0f844b76d6191cdd5d63858a37dd 100644 (file)
@@ -16,6 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <alloca.h>
 #include <unistd.h>
 #include <stdarg.h>
 #include <stddef.h>
index 6cdda9e1d48778b4d140b3136cda5cc37e0a8ec0..f5a3b49e387aef13b73cd883e6eec87c84a60980 100644 (file)
@@ -25,6 +25,7 @@
 #include <printf.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 #include "_itoa.h"
 #include "../locale/localeinfo.h"
 
index 54771049ad25de2c5e8b804d4db9824db1540e9a..c956ae3040339d88f6ae255a231c6672692afe31 100644 (file)
@@ -170,6 +170,13 @@ __strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
            {
            case '=':                   /* Set fill character.  */
              pad = *++fmt;
+             if (pad == '\0')
+               {
+                 /* Premature EOS.  */
+                 __set_errno (EINVAL);
+                 va_end (ap);
+                 return -1;
+               }
              continue;
            case '^':                   /* Don't group digits.  */
              group = 0;
index efd6a9f9f592eece01cd7a007d31634bb92698a8..e19e7e820b47ccc288aa0c57ec6869451183091f 100644 (file)
@@ -233,7 +233,7 @@ clntudp_call (cl, proc, xargs, argsp, xresults, resultsp, utimeout)
   XDR *xdrs;
   int outlen;
   int inlen;
-  int fromlen;
+  size_t fromlen;
 #ifdef FD_SETSIZE
   fd_set readfds;
   fd_set mask;
index 8ae93b8f6ddb8f0df7a90bc2d7a385289baaa072..6117c365d5d3612e9ae20394d52f120b5c30535e 100644 (file)
@@ -235,7 +235,8 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
   AUTH *unix_auth = authunix_create_default ();
   XDR xdr_stream;
   XDR *xdrs = &xdr_stream;
-  int outlen, inlen, fromlen, nets;
+  int outlen, inlen, nets;
+  size_t fromlen;
   int sock;
   int on = 1;
 #ifdef FD_SETSIZE
index 758b6ba6e4e927485ccba422999dcab8b05363fa..ec7de3b80a5659b11fa3d8b3cdf6063f4aff70ce 100644 (file)
@@ -130,7 +130,7 @@ svctcp_create (int sock, u_int sendsize, u_int recvsize)
   SVCXPRT *xprt;
   struct tcp_rendezvous *r;
   struct sockaddr_in addr;
-  int len = sizeof (struct sockaddr_in);
+  size_t len = sizeof (struct sockaddr_in);
 
   if (sock == RPC_ANYSOCK)
     {
@@ -231,7 +231,7 @@ rendezvous_request (SVCXPRT *xprt, struct rpc_msg *errmsg)
   int sock;
   struct tcp_rendezvous *r;
   struct sockaddr_in addr;
-  int len;
+  size_t len;
 
   r = (struct tcp_rendezvous *) xprt->xp_p1;
 again:
index 8ae18a9147c08142ed51687b8ded0e462097802a..39ecbb0b5052c2bddb45dd40ae3aaad3e867d333 100644 (file)
@@ -108,7 +108,7 @@ svcudp_bufcreate (sock, sendsz, recvsz)
   SVCXPRT *xprt;
   struct svcudp_data *su;
   struct sockaddr_in addr;
-  int len = sizeof (struct sockaddr_in);
+  size_t len = sizeof (struct sockaddr_in);
 
   if (sock == RPC_ANYSOCK)
     {
@@ -188,11 +188,14 @@ svcudp_recv (xprt, msg)
   int rlen;
   char *reply;
   u_long replylen;
+  size_t len;
 
 again:
-  xprt->xp_addrlen = sizeof (struct sockaddr_in);
+  /* FIXME -- should xp_addrlen be a size_t?  */
+  len = sizeof(struct sockaddr_in);
   rlen = recvfrom (xprt->xp_sock, rpc_buffer (xprt), (int) su->su_iosz, 0,
-                  (struct sockaddr *) &(xprt->xp_raddr), &(xprt->xp_addrlen));
+                  (struct sockaddr *) &(xprt->xp_raddr), &len);
+  xprt->xp_addrlen = len;
   if (rlen == -1 && errno == EINTR)
     goto again;
   if (rlen < 16)               /* < 4 32-bit ints? */
@@ -207,7 +210,7 @@ again:
       if (cache_get (xprt, msg, &reply, &replylen))
        {
          (void) sendto (xprt->xp_sock, reply, (int) replylen, 0,
-                    (struct sockaddr *) &xprt->xp_raddr, xprt->xp_addrlen);
+                        (struct sockaddr *) &xprt->xp_raddr, len);
          return TRUE;
        }
     }
index becc59bed3deb6d0364062edc5e3d56a8f74c42e..668d9b683b3325d2fd3b0f6bf47c456ff38b4c52 100644 (file)
@@ -43,6 +43,7 @@ static char sccsid[] = "@(#)xdr.c 1.35 87/08/12";
 
 #include <stdio.h>
 #include <limits.h>
+#include <string.h>
 
 #include <rpc/types.h>
 #include <rpc/xdr.h>
index e76feeb99139bd85cd9b89c94043e8d6eb133c27..e39131c2c25d4e3efaa3cee5e9f6cce01ef35f3e 100644 (file)
@@ -138,8 +138,8 @@ xdrrec_create (XDR *xdrs, u_int sendsize,
               int (*readit) (char *, char *, int),
               int (*writeit) (char *, char *, int))
 {
-  RECSTREAM *rstrm =
-  (RECSTREAM *) mem_alloc (sizeof (RECSTREAM));
+  RECSTREAM *rstrm = (RECSTREAM *) mem_alloc (sizeof (RECSTREAM));
+  caddr_t tmp;
 
   if (rstrm == NULL)
     {
@@ -161,10 +161,11 @@ xdrrec_create (XDR *xdrs, u_int sendsize,
       (void) fputs (_("xdrrec_create: out of memory\n"), stderr);
       return;
     }
-  for (rstrm->out_base = rstrm->the_buffer;
-       (u_int) rstrm->out_base % BYTES_PER_XDR_UNIT != 0;
-       rstrm->out_base++);
-  rstrm->in_base = rstrm->out_base + sendsize;
+  tmp = rstrm->the_buffer;
+  if ((size_t)tmp % BYTES_PER_XDR_UNIT)
+    tmp += BYTES_PER_XDR_UNIT - (size_t)tmp % BYTES_PER_XDR_UNIT;
+  rstrm->out_base = tmp;
+  rstrm->in_base = tmp + sendsize;
   /*
    * now the rest ...
    */
@@ -516,11 +517,11 @@ static bool_t     /* knows nothing about records!  Only about input buffers */
 fill_input_buf (RECSTREAM *rstrm)
 {
   caddr_t where;
-  u_int i;
+  size_t i;
   int len;
 
   where = rstrm->in_base;
-  i = (u_int) rstrm->in_boundry % BYTES_PER_XDR_UNIT;
+  i = (size_t) rstrm->in_boundry % BYTES_PER_XDR_UNIT;
   where += i;
   len = rstrm->in_size - i;
   if ((len = (*(rstrm->readit)) (rstrm->tcp_handle, where, len)) == -1)
index 841dc980a889b47ff71f663cf42450f7d3895566..5fe8e4ee7f998e9e80cfce6146a0be7d13120154 100644 (file)
@@ -44,3 +44,7 @@ sysdep-CFLAGS += -mno-fp-regs
 endif
 
 divrem := divl divq reml remq
+
+# For now, build everything with full IEEE math support. 
+# TODO: build separate libm and libm-ieee.
+sysdep-CFLAGS += -mieee
diff --git a/sysdeps/alpha/fpu/fclrexcpt.c b/sysdeps/alpha/fpu/fclrexcpt.c
new file mode 100644 (file)
index 0000000..7aa79af
--- /dev/null
@@ -0,0 +1,36 @@
+/* Clear given exceptions in current floating-point environment.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@tamu.edu>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+void
+feclearexcept (int excepts)
+{
+  unsigned long swcr;
+
+  /* Get the current state.  */
+  swcr = __ieee_get_fp_control();
+
+  /* Clear the relevant bits.  */
+  swcr &= ~((unsigned long)excepts & FE_ALL_EXCEPT);
+
+  /* Put the new state in effect.  */
+  __ieee_set_fp_control(swcr);
+}
diff --git a/sysdeps/alpha/fpu/fegetenv.c b/sysdeps/alpha/fpu/fegetenv.c
new file mode 100644 (file)
index 0000000..c8b705d
--- /dev/null
@@ -0,0 +1,37 @@
+/* Store current floating-point environment.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@tamu.edu>, 1997
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+void
+fegetenv (fenv_t *envp)
+{
+  unsigned long fpcr, swcr;
+
+  /* Get status from software and hardware.  Note that we don't need an
+     excb because the callsys is an implied trap barrier.  */
+  swcr = __ieee_get_fp_control();
+  __asm__ __volatile__("mf_fpcr %0" : "=f"(fpcr));
+
+  /* Merge the two bits of information.  The magic number at the end is
+     the exception enable mask.  */
+
+  *envp = (fpcr & (3UL << 58)) | (swcr & (FE_ALL_EXCEPT | 0x3e));
+}
diff --git a/sysdeps/alpha/fpu/fegetround.c b/sysdeps/alpha/fpu/fegetround.c
new file mode 100644 (file)
index 0000000..623e2ce
--- /dev/null
@@ -0,0 +1,31 @@
+/* Return current rounding direction.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@tamu.edu>, 1997
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+int
+fegetround (void)
+{
+  unsigned long fpcr;
+
+  __asm__ __volatile__("excb; mf_fpcr %0" : "=f"(fpcr));
+
+  return (fpcr >> 58) & 3;
+}
diff --git a/sysdeps/alpha/fpu/feholdexcpt.c b/sysdeps/alpha/fpu/feholdexcpt.c
new file mode 100644 (file)
index 0000000..493d6a1
--- /dev/null
@@ -0,0 +1,33 @@
+/* Store current floating-point environment and clear exceptions.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@tamu.edu>, 1997
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+int
+feholdexcept (fenv_t *envp)
+{
+  /* Save the current state.  */
+  fegetenv(envp);
+
+  /* Clear all exception status bits and exception enable bits.  */
+  __ieee_set_fp_control(0);
+
+  return 1;
+}
diff --git a/sysdeps/alpha/fpu/fenvbits.h b/sysdeps/alpha/fpu/fenvbits.h
new file mode 100644 (file)
index 0000000..02414e4
--- /dev/null
@@ -0,0 +1,107 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@tamu.edu>, 1997
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* This file should never be included directly.  */
+
+#ifndef _FENVBITS_H
+#define _FENVBITS_H    1
+
+/* Define the bits representing the exception.
+
+   Note that these are the bit positions as defined by the OSF/1
+   ieee_{get,set}_control_word interface and not by the hardware fpcr.
+
+   See the Alpha Architecture Handbook section 4.7.7.3 for details,
+   but in summary, trap shadows mean the hardware register can acquire
+   extra exception bits so for proper IEEE support the tracking has to
+   be done in software -- in this case with kernel support.
+
+   As to why the system call interface isn't in the same format as
+   the hardware register, only those crazy folks at DEC can tell you.  */
+
+enum
+  {
+    FE_INEXACT =       1UL << 21,
+#define FE_INEXACT     FE_INEXACT
+
+    FE_UNDERFLOW =     1UL << 20,
+#define FE_UNDERFLOW   FE_UNDERFLOW
+
+    FE_OVERFLOW =      1UL << 19,
+#define FE_OVERFLOW    FE_OVERFLOW
+
+    FE_DIVBYZERO =     1UL << 18,
+#define FE_DIVBYZERO   FE_DIVBYZERO
+
+    FE_INVALID =       1UL << 17,
+#define FE_INVALID     FE_INVALID
+    
+    FE_ALL_EXCEPT =
+       (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+#define FE_ALL_EXCEPT  FE_ALL_EXCEPT 
+  };
+
+
+/* Alpha chips support all four defined rouding modes. 
+
+   Note that code must be compiled to use dynamic rounding (/d) instructions
+   to see these changes.  For gcc this is -mfp-rounding-mode=d; for DEC cc
+   this is -fprm d.  The default for both is static rounding to nearest. 
+
+   These are shifted down 58 bits from the hardware fpcr because the 
+   functions are declared to take integers.  */
+
+enum
+  {
+    FE_TOWARDSZERO =   0,
+#define FE_TOWARDSZERO FE_TOWARDSZERO
+
+    FE_DOWNWARD =      1,
+#define FE_DOWNWARD    FE_DOWNWARD
+
+    FE_TONEAREST =     2,
+#define FE_TONEAREST   FE_TONEAREST
+
+    FE_UPWARD =                3,
+#define FE_UPWARD      FE_UPWARD
+  };
+
+
+/* Type representing exception flags.  */
+typedef unsigned long fexcept_t;
+
+/* Type representing floating-point environment.  */
+typedef unsigned long fenv_t;
+
+/* If the default argument is used we use this value.  Note that due to
+   architecture-specified page mappings, no user-space pointer will ever
+   have its two high bits set.  Co-opt one.  */
+#define FE_DFL_ENV     ((fenv_t *) 0x8800000000000000UL)
+
+#ifdef __USE_GNU
+/* Floating-point environment where none of the exceptions are masked.  */
+# define FE_NOMASK_ENV ((fenv_t *) 0x880000000000003eUL)
+#endif
+
+/* The system calls to talk to the kernel's FP code.  */
+extern unsigned long __ieee_get_fp_control(void);
+extern void __ieee_set_fp_control(unsigned long);
+
+
+#endif /* fenvbits.h */
diff --git a/sysdeps/alpha/fpu/fesetenv.c b/sysdeps/alpha/fpu/fesetenv.c
new file mode 100644 (file)
index 0000000..3692967
--- /dev/null
@@ -0,0 +1,45 @@
+/* Install given floating-point environment.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@tamu.edu>, 1997
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+void
+fesetenv (const fenv_t *envp)
+{
+  unsigned long fpcr;
+  fenv_t env;
+
+  /* Magic encoding of default values: high bit set (never possible for a
+     user-space address) is not indirect.  And we don't even have to get
+     rid of it since we mask things around just below.  */
+  if ((long)envp >= 0)
+    env = *envp;
+  else
+    env = (unsigned long)envp;
+
+  /* Reset the rounding mode with the hardware fpcr.  Note that the following
+     system call is an implied trap barrier for our modification.  */
+  __asm__ __volatile__("excb; mf_fpcr %0" : "=f"(fpcr));
+  fpcr = (fpcr & ~(3UL << 58)) | (env & (3UL << 58));
+  __asm__ __volatile__("mt_fpcr %0" : : "f"(fpcr));
+
+  /* Reset the exception status and mask with the kernel's FP code.  */
+  __ieee_set_fp_control(env & (FE_ALL_EXCEPT | 0x3e));
+}
diff --git a/sysdeps/alpha/fpu/fesetround.c b/sysdeps/alpha/fpu/fesetround.c
new file mode 100644 (file)
index 0000000..f49586c
--- /dev/null
@@ -0,0 +1,41 @@
+/* Set current rounding direction.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@tamu.edu>, 1997
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+int
+fesetround (int round)
+{
+  unsigned long fpcr;
+
+  if (round & ~3)
+    return 0;
+
+  /* Get the current state.  */
+  __asm__ __volatile__("excb; mf_fpcr %0" : "=f"(fpcr));
+
+  /* Set the relevant bits.  */
+  fpcr = (fpcr & ~(3UL << 58)) | ((unsigned long)round << 58);
+
+  /* Put the new state in effect.  */
+  __asm__ __volatile__("mt_fpcr %0; excb" : : "f"(fpcr));
+
+  return 1;
+}
diff --git a/sysdeps/alpha/fpu/feupdateenv.c b/sysdeps/alpha/fpu/feupdateenv.c
new file mode 100644 (file)
index 0000000..816575a
--- /dev/null
@@ -0,0 +1,38 @@
+/* Install given floating-point environment and raise exceptions.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@tamu.edu>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+void
+feupdateenv (const fenv_t *envp)
+{
+  unsigned long tmp;
+
+  /* Get the current exception state.  */
+  tmp = __ieee_get_fp_control();
+
+  /* Install new environment.  */
+  fesetenv(envp);
+
+  /* Raise the saved exception.  Incidently for us the implementation
+     defined format of the values in objects of type fexcept_t is the
+     same as the ones specified using the FE_* constants.  */
+  feraiseexcept((int)tmp & FE_ALL_EXCEPT);
+}
diff --git a/sysdeps/alpha/fpu/fgetexcptflg.c b/sysdeps/alpha/fpu/fgetexcptflg.c
new file mode 100644 (file)
index 0000000..28d9e12
--- /dev/null
@@ -0,0 +1,33 @@
+/* Store current representation for exceptions.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@tamu.edu>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+void
+fegetexceptflag (fexcept_t *flagp, int excepts)
+{
+  unsigned long tmp;
+
+  /* Get the current state.  */
+  tmp = __ieee_get_fp_control();
+
+  /* Return that portion that corresponds to the requested exceptions. */
+  *flagp = tmp & excepts & FE_ALL_EXCEPT;
+}
index 219ea55f24910de96fb7d47438884ef73d105663..bcf73e857e2b695e742f2d643735d266ce84f3fa 100644 (file)
@@ -1,23 +1,22 @@
-/* FPU control word bits.  Alpha version.
-Copyright (C) 1996 Free Software Foundation, Inc.
-Contributed by Olaf Flebbe.
-
-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 Library General Public License as
-published by the Free Software Foundation; either version 2 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+/* FPU control word bits.  Alpha-maped-to-Intel version.
+   Copyright (C) 1996 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Olaf Flebbe.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef _ALPHA_FPU_CONTROL_H
 #define _ALPHA_FPU_CONTROL_H
@@ -91,11 +90,12 @@ Cambridge, MA 02139, USA.  */
        qualifier.  By setting the dynamic rounding mode to +infinity,
        one can use /d to get round to +infinity with no extra overhead
        (so long as the default isn't changed, of course...)
-     - exceptions on overflow, zero divide and NaN */
-#define _FPU_DEFAULT  0x1f72
+     - no exceptions enabled.  */
+
+#define _FPU_DEFAULT  0x137f
 
 /* IEEE:  same as above, but exceptions */
-#define _FPU_IEEE     0x1f7f
+#define _FPU_IEEE     0x137f
 
 /* Type of the control word.  */
 typedef unsigned int fpu_control_t;
diff --git a/sysdeps/alpha/fpu/fraiseexcpt.c b/sysdeps/alpha/fpu/fraiseexcpt.c
new file mode 100644 (file)
index 0000000..6a53e55
--- /dev/null
@@ -0,0 +1,72 @@
+/* Raise given exceptions.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@tamu.edu>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+#include <math.h>
+
+void
+feraiseexcept (int excepts)
+{
+  double tmp;
+
+  /* Raise exceptions represented by EXPECTS.  But we must raise only
+     one signal at a time.  It is important the if the overflow/underflow
+     exception and the inexact exception are given at the same time,
+     the overflow/underflow exception precedes the inexact exception.  */
+
+  /* We do these bits in assembly to be certain GCC doesn't optimize
+     away something important.  */
+
+  /* First: invalid exception.  */
+  if (FE_INVALID & excepts)
+    {
+      /* One example of a invalid operation is 0 * Infinity.  */
+      __asm__ __volatile__("mult/sui $f31,%1,%0; trapb"
+                          : "=f"(tmp) : "f"(HUGE_VAL));
+    }
+
+  /* Next: division by zero.  */
+  if (FE_DIVBYZERO & excepts)
+    {
+      __asm__ __volatile__("cmpteq $f31,$f31,%0; divt/sui %0,$f31,%0; trapb"
+                          : "=f"(tmp));
+    }
+
+  /* Next: overflow.  */
+  if (FE_OVERFLOW & excepts)
+    {
+      __asm__ __volatile__("mult/sui %1,%1,%0; trapb"
+                          : "=f"(tmp) : "f"(DBL_MAX));
+    }
+
+  /* Next: underflow.  */
+  if (FE_UNDERFLOW & excepts)
+    {
+      __asm__ __volatile__("divt/sui %1,%2,%0; trapb"
+                          : "=f"(tmp) : "f"(DBL_MIN), "f"(16.0));
+    }
+
+  /* Last: inexact.  */
+  if (FE_INEXACT & excepts)
+    {
+      __asm__ __volatile__("divt/sui %1,%2,%0; trapb"
+                          : "=f"(tmp) : "f"(1.0), "f"(M_PI));
+    }
+}
diff --git a/sysdeps/alpha/fpu/fsetexcptflg.c b/sysdeps/alpha/fpu/fsetexcptflg.c
new file mode 100644 (file)
index 0000000..7e373be
--- /dev/null
@@ -0,0 +1,36 @@
+/* Set floating-point environment exception handling.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@tamu.edu>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+void
+fesetexceptflag (const fexcept_t *flagp, int excepts)
+{
+  unsigned long tmp;
+
+  /* Get the current exception state.  */
+  tmp = __ieee_get_fp_control();
+
+  /* Set all the bits that were called for.  */
+  tmp = tmp & ~FE_ALL_EXCEPT | *flagp & excepts & FE_ALL_EXCEPT;
+
+  /* And store it back.  */
+  __ieee_set_fp_control(tmp);
+}
diff --git a/sysdeps/alpha/fpu/ftestexcept.c b/sysdeps/alpha/fpu/ftestexcept.c
new file mode 100644 (file)
index 0000000..9ee9dc9
--- /dev/null
@@ -0,0 +1,32 @@
+/* Test exception in current environment.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@tamu.edu>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fenv.h>
+
+int
+fetestexcept (int excepts)
+{
+  unsigned long tmp;
+
+  /* Get current exceptions.  */
+  tmp = __ieee_get_fp_control();
+
+  return tmp & excepts & FE_ALL_EXCEPT;
+}
index 7c2d443863ad96ab5689049d43cd00b361a4aa38..6d85a791c6e0a8ad7373e9e135c6fab7f93295c7 100644 (file)
@@ -16,7 +16,6 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include <stddef.h>    /* For size_t and NULL. */
 #include <string.h>
 
 /*
index 9d1785b75f5131466f58d9d861a5ccaa1db72021..a2520859e452ac6107272ebac5354ba15b148b2d 100644 (file)
 
 /* IEEE positive infinity (-HUGE_VAL is negative infinity).  */
 
+#ifdef __GNUC__
+
+#define HUGE_VAL                                                            \
+  (__extension__                                                            \
+   ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
+    { __l: 0x7ff0000000000000ULL }).__d)
+
+#else /* not GCC */
+
+typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
+
 #if __BYTE_ORDER == __BIG_ENDIAN
 #define        __HUGE_VAL_bytes        { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
 #endif
 #define        __HUGE_VAL_bytes        { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
 #endif
 
-#define __huge_val_t   union { unsigned char __c[8]; double __d; }
-#ifdef __GNUC__
-#define        HUGE_VAL        (__extension__ \
-                        ((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d)
-#else  /* Not GCC.  */
 static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
 #define        HUGE_VAL        (__huge_val.__d)
+
 #endif /* GCC.  */
 
 
@@ -48,6 +55,17 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
 
 #ifdef __USE_ISOC9X
 
+#ifdef __GNUC__
+
+#define HUGE_VALF                                                           \
+  (__extension__                                                            \
+   ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; })  \
+    { __l: 0x7f800000UL }).__d)
+
+#else /* not GCC */
+
+typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;
+
 #if __BYTE_ORDER == __BIG_ENDIAN
 #define        __HUGE_VALF_bytes       { 0x7f, 0x80, 0, 0 }
 #endif
@@ -55,13 +73,9 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
 #define        __HUGE_VALF_bytes       { 0, 0, 0x80, 0x7f }
 #endif
 
-#define __huge_valf_t  union { unsigned char __c[4]; float __f; }
-#ifdef __GNUC__
-#define        HUGE_VALF       (__extension__ \
-                        ((__huge_valf_t) { __c: __HUGE_VALF_bytes }).__f)
-#else  /* Not GCC.  */
 static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
 #define        HUGE_VALF       (__huge_valf.__f)
+
 #endif /* GCC.  */
 
 
@@ -69,6 +83,6 @@ static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
    same as `double'.  */
 #define HUGE_VALL HUGE_VAL
 
-#endif /* __USE_ISOC9X.  */
+#endif /* __USE_ISOC9X.  */
 
-#endif    /* huge_val.h */
+#endif /* huge_val.h */
index bea98d96d4fb492efa0352708f302d056713752c..d4e6842562576295db026b577146e8d265df5034 100644 (file)
@@ -1,5 +1,5 @@
 /* `NAN' constant for IEEE 754 machines.
-   Copyright (C) 1992, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1996, 1997 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
 
 /* IEEE Not A Number.  */
 
+#ifdef __GNUC__
+
+#define NAN                                                                 \
+  (__extension__                                                            \
+   ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
+    { __l: 0x7ff8000000000000ULL }).__d)
+
+#define NANF                                                                \
+  (__extension__                                                            \
+   ((union { unsigned __l __attribute__((__mode__(__SI__))); flaot __d; })  \
+    { __l: 0x7fc00000UL }).__d)
+
+#else
+
 #include <endian.h>
 
 #if __BYTE_ORDER == __BIG_ENDIAN
 #define        __nan_bytes             { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 }
+#define        __nanf_bytes            { 0x7f, 0xc0, 0, 0 }
 #endif
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 #define        __nan_bytes             { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f }
+#define        __nanf_bytes            { 0, 0, 0xc0, 0x7f }
 #endif
 
-#ifdef __GNUC__
-#define        NAN \
-  (__extension__ ((union { unsigned char __c[8];                             \
-                          double __d; })                                     \
-                 { __nan_bytes }).__d)
-#else  /* Not GCC.  */
-static CONST char __nan[8] = __nan_bytes;
-#define        NAN     (*(CONST double *) __nan)
+static union { unsigned char __c[8]; double __d; } __nan = { __nan_bytes };
+#define        NAN     (__nan.__d)
+
+static union { unsigned char __c[4]; double __d; } __nanf = { __nanf_bytes };
+#define        NANF    (__nanf.__d)
+
 #endif /* GCC.  */
 
+/* Generally there is no separate `long double' format and it is the
+   same as `double'.  */
+
+#define NANL  NAN
+
 #endif /* nan.h */
index 03a7deaa6759aebe4ce0f322ccbdb20c38dff6cf..7950dfa420e872d818e8ccf643dfd984a70f7999 100644 (file)
@@ -1,4 +1,4 @@
-/* Adapted for log2 by Ulrich Drepper <drepper@cygnus.com>.
+/* Adapted for log2 by Ulrich Drepper <drepper@cygnus.com>.  */
 /*
  * ====================================================
  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -127,3 +127,5 @@ static double zero   =  0.0;
            return dk-((s*(f-R))-f);
        }
 }
+
+weak_alias (__log2, log2)
index 9df313422ce7b3e9941cb945cdf8b65f5fda336d..fc5cc0436bc24800693a7f539006d19c9fdb26e3 100644 (file)
@@ -38,7 +38,7 @@ __errno = errno
        .globl __syscall_error
        .ent __syscall_error
 __syscall_error:
-       ldgp    gp, 0(t12)
+       ldgp    gp, 0(pv)
        lda     sp, -16(sp)
        .frame  sp, 16, ra, 0
        stq     ra, 0(sp)
@@ -53,7 +53,7 @@ __syscall_error:
        jsr     ra, __errno_location
 
        /* Store the error value.  */
-       ldl     t0, 8(sp)
+       ldq     t0, 8(sp)
        stl     t0, 0(v0)
 
        /* And kick back a -1.  */
index 74fef64f64425d8bc9c443bf6f6a724d3bf8eb73..be0539b475d0752b6abc5e7f644dbb1cf2a85a17 100644 (file)
@@ -73,8 +73,9 @@ $ok:  stq     a0, __curbrk
 
        /* What a horrible way to die.  */
 $err0: ldi     v0, ENOMEM
-$err1: addq    sp, 8, sp
-       jmp     zero, __syscall_error
+$err1: lda     pv, __syscall_error
+       addq    sp, 8, sp
+       jmp     zero, (pv), __syscall_error
 
        END(__brk)
 
index 5c1e4074231da66e9257c7357b3dd5d35ea71821..b23deb8aa4e4cbd4a3b5fdfaf929449b56120a9a 100644 (file)
@@ -68,6 +68,11 @@ typedef long int __clock_t;
 /* One element in the file descriptor mask array.  */
 typedef unsigned int __fd_mask;
 
+/* Due to incaution, we may have gotten these from a kernel header file.  */
+#undef __FD_SETSIZE
+#undef __NFDBITS
+#undef __FDMASK
+
 /* Number of descriptors that can fit in an `fd_set'.  */
 #define __FD_SETSIZE   1024
 
index dbc25bcbf3b997db6284a595ddc5db422294d82a..e118ff19f5b64fba30fa1bfacd25a416b2d3d221 100644 (file)
@@ -41,18 +41,20 @@ LEAF(__ieee_get_fp_control, 16)
        ldi     a0, GSI_IEEE_FP_CONTROL
        ldi     v0, __NR_osf_getsysinfo
        call_pal PAL_callsys
-       bne     a3, error
+       bne     a3, $error
 
        ldq     v0, 0(sp)
        lda     sp, 16(sp)
        ret
 
-error: lda     sp, 16(sp)
+$error:
 #ifndef PROF
        br      gp, 1f
 1:     ldgp    gp, 0(gp)
 #endif
-       jmp     zero, __syscall_error
+       lda     pv, __syscall_error
+       lda     sp, 16(sp)
+       jmp     zero, (pv), __syscall_error
 
        END(__ieee_get_fp_control)
 
index d2d2add56c3bd7bccf350c5462f2d9292e42961b..b38d67efac928ce7afd48fdb92c04661dbc92359 100644 (file)
@@ -41,17 +41,19 @@ LEAF(__ieee_set_fp_control, 16)
        ldi     v0, __NR_osf_setsysinfo
        call_pal PAL_callsys
 
-       lda     sp, 16(sp)
+       bne     a3, $error
 
-       bne     a3, error
+       lda     sp, 16(sp)
        ret
 
-error:
+$error:
 #ifndef PROF
        br      gp, 1f
 1:     ldgp    gp, 0(gp)
 #endif
-       jmp     zero, __syscall_error
+       lda     pv, __syscall_error
+       lda     sp, 16(sp)
+       jmp     zero, (pv), __syscall_error
 
        END(__ieee_set_fp_control)
 
index 63bf17588a3692a544b308129cf6c026ba2445c4..76a744d1676124a57ce306d45187db2093bf564d 100644 (file)
 #define JENSEN_IO_BASE         (0xfffffc0300000000UL)
 #define JENSEN_SPARSE_MEM      (0xfffffc0200000000UL)
 
-/*
- * With respect to the I/O architecture, APECS and LCA are identical,
- * so the following defines apply to LCA as well.
- */
+/* With respect to the I/O architecture, APECS and LCA are identical,
+   so the following defines apply to LCA as well.  */
 #define APECS_IO_BASE          (0xfffffc01c0000000UL)
 #define APECS_SPARSE_MEM       (0xfffffc0200000000UL)
 #define APECS_DENSE_MEM                (0xfffffc0300000000UL)
 
+/* The same holds for CIA and PYXIS.  */
 #define CIA_IO_BASE            (0xfffffc8580000000UL)
 #define CIA_SPARSE_MEM         (0xfffffc8000000000UL)
 #define CIA_DENSE_MEM          (0xfffffc8600000000UL)
@@ -104,6 +103,7 @@ static struct platform {
   {"Mustang",  IOSYS_APECS,    5, APECS_DENSE_MEM,     APECS_SPARSE_MEM},
   {"Noname",   IOSYS_APECS,    5, APECS_DENSE_MEM,     APECS_SPARSE_MEM},
   {"Sable",    IOSYS_T2,       5, T2_DENSE_MEM,        T2_SPARSE_MEM},
+  {"Miata",    IOSYS_CIA,      5, CIA_DENSE_MEM,       CIA_SPARSE_MEM},
 };
 
 
index 43e8536b2078bb43038e0d05d974222dcf43aa5e..9133c81110ee58047ef9721fb625ccd86173ea87 100644 (file)
@@ -1,65 +1,78 @@
-#include <fpu_control.h>
+/* Set FP exception mask and rounding mode.
+   Copyright (C) 1996, 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
+#include <fpu_control.h>
 #include <asm/fpu.h>
 
+
 extern void            __ieee_set_fp_control (unsigned long);
 extern unsigned long   __ieee_get_fp_control (void);
 
-
 static inline unsigned long
 rdfpcr (void)
 {
-    unsigned long fpcr;
-
-    asm ("trapb; mf_fpcr $f0; trapb; stt $f0,%0" : "m="(fpcr));
-    return fpcr;
+  unsigned long fpcr;
+  asm ("excb; mf_fpcr %0" : "=f"(fpcr));
+  return fpcr;
 }
 
 
 static inline void
 wrfpcr (unsigned long fpcr)
 {
-    asm volatile ("ldt $f0,%0; trapb; mt_fpcr $f0; trapb" :: "m"(fpcr));
+  asm volatile ("mt_fpcr %0; excb" : : "f"(fpcr));
 }
 
 
 void
 __setfpucw (unsigned short fpu_control)
 {
-    unsigned long fpcr = 0, fpcw = 0;
+  unsigned long fpcr = 0, fpcw = 0;
 
-    if (!fpu_control)
-       fpu_control = _FPU_DEFAULT;
+  if (!fpu_control)
+    fpu_control = _FPU_DEFAULT;
 
-    /* first, set dynamic rounding mode: */
+  /* first, set dynamic rounding mode: */
 
-    fpcr = rdfpcr();
-    fpcr &= ~FPCR_DYN_MASK;
-    switch (fpu_control & 0xc00) {
-      case _FPU_RC_NEAREST:    fpcr |= FPCR_DYN_NORMAL; break;
-      case _FPU_RC_DOWN:       fpcr |= FPCR_DYN_MINUS; break;
-      case _FPU_RC_UP:         fpcr |= FPCR_DYN_PLUS; break;
-      case _FPU_RC_ZERO:       fpcr |= FPCR_DYN_CHOPPED; break;
+  fpcr = rdfpcr();
+  fpcr &= ~FPCR_DYN_MASK;
+  switch (fpu_control & 0xc00)
+    {
+    case _FPU_RC_NEAREST:      fpcr |= FPCR_DYN_NORMAL; break;
+    case _FPU_RC_DOWN:         fpcr |= FPCR_DYN_MINUS; break;
+    case _FPU_RC_UP:           fpcr |= FPCR_DYN_PLUS; break;
+    case _FPU_RC_ZERO:         fpcr |= FPCR_DYN_CHOPPED; break;
     }
-    wrfpcr(fpcr);
+  wrfpcr(fpcr);
 
-    /* now tell kernel about traps that we like to hear about: */
+  /* now tell kernel about traps that we like to hear about: */
 
-    fpcw = __ieee_get_fp_control();
-    fpcw &= ~IEEE_TRAP_ENABLE_MASK;
+  fpcw = __ieee_get_fp_control();
+  fpcw &= ~IEEE_TRAP_ENABLE_MASK;
 
-    if (!(fpu_control & _FPU_MASK_IM))
-       fpcw |= IEEE_TRAP_ENABLE_INV;
-    if (!(fpu_control & _FPU_MASK_DM))
-       fpcw |= IEEE_TRAP_ENABLE_UNF;
-    if (!(fpu_control & _FPU_MASK_ZM))
-       fpcw |= IEEE_TRAP_ENABLE_DZE;
-    if (!(fpu_control & _FPU_MASK_OM))
-       fpcw |= IEEE_TRAP_ENABLE_OVF;
-    if (!(fpu_control & _FPU_MASK_PM))
-       fpcw |= IEEE_TRAP_ENABLE_INE;
+  if (!(fpu_control & _FPU_MASK_IM)) fpcw |= IEEE_TRAP_ENABLE_INV;
+  if (!(fpu_control & _FPU_MASK_DM)) fpcw |= IEEE_TRAP_ENABLE_UNF;
+  if (!(fpu_control & _FPU_MASK_ZM)) fpcw |= IEEE_TRAP_ENABLE_DZE;
+  if (!(fpu_control & _FPU_MASK_OM)) fpcw |= IEEE_TRAP_ENABLE_OVF;
+  if (!(fpu_control & _FPU_MASK_PM)) fpcw |= IEEE_TRAP_ENABLE_INE;
 
-    __ieee_set_fp_control(fpcw);
+  __fpu_control = fpu_control; /* update global copy */
 
-    __fpu_control = fpu_control;       /* update global copy */
+  __ieee_set_fp_control(fpcw);
 }
index 75e1260aea859b4f92fd10085929cb63647edf6b..d25dd6b51fc0a3480b526d94ed8f020fba9ead87 100644 (file)
@@ -62,10 +62,10 @@ LEAF(__syscall, 0)
        mov     a5, a4
 
        call_pal PAL_callsys    /* Invoke system call */
-       bne     a3, error
+       bne     a3, $error
        ret
 
-error:
+$error:
 #ifndef PROF
        br      gp, 2f
 2:     ldgp    gp, 0(gp)
index 28512ebebb6fdc847e37b0804c2e9600710dcad8..b21c6d56868e43e4d5394b17bc397f493bcaf918 100644 (file)
 #ifdef _POSIX_VDISABLE
 # define CEOL          _POSIX_VDISABLE
 #else
-# define CEOL          ((unsigned char)'\377') /* XXX avoid _POSIX_VDISABLE */
+# define CEOL          '\0'            /* XXX avoid _POSIX_VDISABLE */
 #endif
 #define        CERASE          0177
 #define        CINTR           CTRL('c')
 #ifdef _POSIX_VDISABLE
 # define CSTATUS       _POSIX_VDISABLE
 #else
-# define CSTATUS       ((unsigned char)'\377') /* XXX avoid _POSIX_VDISABLE */
+# define CSTATUS       '\0'            /* XXX avoid _POSIX_VDISABLE */
 #endif
 #define        CKILL           CTRL('u')
 #define        CMIN            1