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

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

alpha div/rem and PAL/gentrap constants


The files sysdeps/alpha/ldiv.S, sysdeps/alpha/div.S, sysdeps/alpha/divrem.h
use this and expect it to define the macros PAL_gentrap and GEN_INTDIV:

	#ifdef __linux__
	# include <asm/gentrap.h>
	# include <asm/pal.h>
	#else
	# include <machine/pal.h>
	#endif

For Hurd/Alpha we don't (yet) have any such header files (asm/*.h is pure
Linuxism).  I've looked at the BSDs, and they do have a machine/pal.h, so I
think we will add that to Hurd.  But the div code in BSD libc uses a
literal -2 for GEN_INTDIV, and I haven't found any BSD header files that
define names for those constants.  (The BSD kernel code that sees the trap
from divrem also uses a literal -2 in its code to recognize it.)  I don't
have access to an OSF/1 or Digital Unix system to see what header files
those systems have for this stuff.

Any opinions on which changes or new headers would be best to get libc to
compile for non-Linux on Alpha?  Right now I am using this:


Index: sysdeps/alpha/div.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/alpha/div.S,v
retrieving revision 1.3
diff -u -r1.3 div.S
--- sysdeps/alpha/div.S	6 Jul 2001 04:55:45 -0000	1.3
+++ sysdeps/alpha/div.S	4 Jun 2002 18:36:09 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996,97,2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson <rth@tamu.edu>.
 
@@ -24,6 +24,10 @@
 # include <asm/pal.h>
 #else
 # include <machine/pal.h>
+#endif
+
+#ifndef GEN_INTDIV
+# define GEN_INTDIV		-2 /* magic constant from OSF/1 used by all */
 #endif
 
 	.set noat
Index: sysdeps/alpha/divrem.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/alpha/divrem.h,v
retrieving revision 1.8
diff -u -r1.8 divrem.h
--- sysdeps/alpha/divrem.h	6 Jul 2001 04:55:45 -0000	1.8
+++ sysdeps/alpha/divrem.h	4 Jun 2002 18:36:09 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996,97,2002 Free Software Foundation, Inc.
    Contributed by David Mosberger (davidm@cs.arizona.edu).
    This file is part of the GNU C Library.
 
@@ -38,6 +38,10 @@
 # include <asm/pal.h>
 #else
 # include <machine/pal.h>
+#endif
+
+#ifndef GEN_INTDIV
+# define GEN_INTDIV		-2 /* magic constant from OSF/1 used by all */
 #endif
 
 #define mask			v0
Index: sysdeps/alpha/ldiv.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/alpha/ldiv.S,v
retrieving revision 1.4
diff -u -r1.4 ldiv.S
--- sysdeps/alpha/ldiv.S	6 Jul 2001 04:55:45 -0000	1.4
+++ sysdeps/alpha/ldiv.S	4 Jun 2002 18:36:09 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1996,97,2001,02 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson <rth@tamu.edu>.
 
@@ -24,6 +24,10 @@
 # include <asm/pal.h>
 #else
 # include <machine/pal.h>
+#endif
+
+#ifndef GEN_INTDIV
+# define GEN_INTDIV		-2 /* magic constant from OSF/1 used by all */
 #endif
 
 	.set noat


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