public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Re: alpha div/rem and PAL/gentrap constants
       [not found] <20020604122635.A14573@redhat.com>
@ 2002-06-04 12:39 ` Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2002-06-04 12:39 UTC (permalink / raw)
  To: Richard Henderson; +Cc: GNU libc hackers

> On Tue, Jun 04, 2002 at 02:56:13PM -0400, Roland McGrath wrote:
> > 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
> 
> Heh.  This won't compile on OSF/1 either -- machine/pal.h contains
> only the PAL_code constants.  There's a machine/gentrap.h that contains
> (modulo comments) exactly what's in the linux asm/gentrap.h.

That sounds reasonable.

> > Any opinions on which changes or new headers would be best to get libc to
> > compile for non-Linux on Alpha?
> 
> I think it'd be nicer to add machine/gentrap.h for Hurd...

I can do that.  

^ permalink raw reply	[flat|nested] 2+ messages in thread

* alpha div/rem and PAL/gentrap constants
@ 2002-06-04 11:56 Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2002-06-04 11:56 UTC (permalink / raw)
  To: GNU libc hackers; +Cc: Richard Henderson

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-06-04 19:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20020604122635.A14573@redhat.com>
2002-06-04 12:39 ` alpha div/rem and PAL/gentrap constants Roland McGrath
2002-06-04 11:56 Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).