This is the mail archive of the libc-hacker@sourceware.cygnus.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]

Assorted SPARC patches


Hi!

These are SPARC patches collected over time.

1999-10-29  Jakub Jelinek  <jakub@redhat.com>

	* stdlib/longlong.h: Avoid UDIV_TIME redefinition.
	* sysdeps/sparc/sparc32/dl-machine.h: Fix loading of SPARC v8plus
	libraries from statically linked programs.
	* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h: POSIX 199309
	fix for sigaction on SPARC.
	Patches by David S. Miller <davem@redhat.com>.

	* sysdeps/unix/sysv/linux/sparc/sys/ucontext.h: Declare
	gregset_t and other required structures and defines for SPARC 64bit
	ABI as well, not only 32bit ABI.

--- ./stdlib/longlong.h.jj	Mon Jun 21 16:58:27 1999
+++ ./stdlib/longlong.h	Fri Oct 29 20:23:48 1999
@@ -1179,7 +1179,9 @@ extern USItype __udiv_qrnnd ();
 #define UDIV_TIME (3+7*32)	/* 7 instructions/iteration. 32 iterations. */
 #else
 extern USItype __udiv_qrnnd __P ((USItype *, USItype, USItype, USItype));
+#ifndef UDIV_TIME
 #define UDIV_TIME 140
+#endif /* UDIV_TIME */
 #endif /* udiv_qrnnd */
 #endif /* __sparc__ */
 
--- ./sysdeps/sparc/sparc32/dl-machine.h.jj	Wed Jul 21 18:57:50 1999
+++ ./sysdeps/sparc/sparc32/dl-machine.h	Fri Oct 29 20:25:54 1999
@@ -56,7 +56,7 @@ elf_machine_matches_host (Elf32_Half e_m
       weak_extern (_dl_hwcap_mask);
 
       hwcap = WEAKADDR(_dl_hwcap);
-      return hwcap && (*hwcap & _dl_hwcap_mask & HWCAP_SPARC_V9);
+      return ! hwcap || (*hwcap & _dl_hwcap_mask & HWCAP_SPARC_V9);
     }
   else
     return 0;
--- ./sysdeps/unix/sysv/linux/sparc/bits/sigaction.h.jj	Thu Oct 22 16:41:23 1998
+++ ./sysdeps/unix/sysv/linux/sparc/bits/sigaction.h	Fri Oct 29 20:21:36 1999
@@ -1,5 +1,5 @@
 /* The proper definitions for Linux/SPARC sigaction.
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999 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
@@ -24,8 +24,21 @@
 /* Structure describing the action to be taken when a signal arrives.  */
 struct sigaction
   {
-    /* Signal handler.  */
+    /* Signal handler. */
+#ifdef __USE_POSIX199309
+    union
+      {
+	/* Used if SA_SIGINFO is not set.  */
+	__sighandler_t sa_handler;
+	/* Used if SA_SIGINFO is set.  */
+	void (*sa_sigaction) (int, siginfo_t *, void *);
+      }
+    __sigaction_handler;
+# define sa_handler	__sigaction_handler.sa_handler
+# define sa_sigaction	__sigaction_handler.sa_sigaction
+#else
     __sighandler_t sa_handler;
+#endif
 
     /* Additional set of signals to be blocked.  */
     __sigset_t sa_mask;
--- ./sysdeps/unix/sysv/linux/sparc/sys/ucontext.h.jj	Tue May 25 13:52:25 1999
+++ ./sysdeps/unix/sysv/linux/sparc/sys/ucontext.h	Fri Oct 29 20:12:08 1999
@@ -85,7 +85,7 @@ typedef struct ucontext {
 	mcontext_t		uc_mcontext;
 } ucontext_t;
 
-#else /* __WORDSIZE == 32 */
+#endif /* __WORDISIZE == 64 */
 
 /*
  * Location of the users' stored registers relative to R0.
@@ -117,11 +117,24 @@ typedef struct ucontext {
  * treats arrays and structures as parameters.
  *
  * Note that NGREG is really (sizeof (struct regs) / sizeof (greg_t)),
- * but that the ABI defines it absolutely to be 19.
+ * but that the ABI defines it absolutely to be 21 (resp. 19).
  */
-#define NGREG   19
 
+#if __WORDSIZE == 64
+
+#define REG_ASI	(19)
+#define REG_FPRS (20)
+
+#define NGREG   21
+typedef long greg_t;
+
+#else /* __WORDSIZE == 32 */
+
+#define NGREG   19
 typedef int greg_t;
+
+#endif /* __WORDSIZE == 32 */
+
 typedef greg_t  gregset_t[NGREG];
 
 /*
@@ -181,6 +194,24 @@ struct fq
 #define V7_FPU_FSR_TYPE         unsigned
 #define V9_FPU_FSR_TYPE         unsigned long long
 #define V9_FPU_FPRS_TYPE        unsigned
+
+#if __WORDSIZE == 64
+
+typedef struct fpu
+  {
+    union {				/* FPU floating point regs */
+      unsigned		fpu_regs[32];	/* 32 singles */
+      double            fpu_dregs[16];	/* 32 doubles */
+      long double	fpu_qregs[16];  /* 16 quads */
+    } fpu_fr;
+    struct fq       *fpu_q;		/* ptr to array of FQ entries */
+    unsigned long   fpu_fsr;		/* FPU status register */
+    unsigned char   fpu_qcnt;		/* # of entries in saved FQ */
+    unsigned char   fpu_q_entrysize;	/* # of bytes per FQ entry */
+    unsigned char   fpu_en;		/* flag signifying fpu in use */
+  } fpregset_t;
+
+#else /* __WORDSIZE == 32 */
 
 typedef struct fpu
   {

Cheers,
    Jakub
___________________________________________________________________
Jakub Jelinek | jakub@redhat.com | http://sunsite.mff.cuni.cz/~jj
Linux version 2.3.18 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________

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