about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-04-13 11:36:32 +0000
committerAlexandre Oliva <aoliva@redhat.com>2003-04-13 11:36:32 +0000
commit6a1aff6912ff551906d4c60f5ca2eeb8fd78090e (patch)
tree471f9df46016c90913ca7246d4d06da9be157a70 /sysdeps/unix/sysv/linux/mips/sys/ucontext.h
parentad2be8527ac0f19f129fc4519d823cbe48239c78 (diff)
downloadglibc-6a1aff6912ff551906d4c60f5ca2eeb8fd78090e.tar.gz
glibc-6a1aff6912ff551906d4c60f5ca2eeb8fd78090e.tar.xz
glibc-6a1aff6912ff551906d4c60f5ca2eeb8fd78090e.zip
* sysdeps/unix/sysv/linux/mips/profil-counter: New. * sysdeps/unix/sysv/linux/mips/sigcontextinfo.h: Port to n32/n64. * sysdeps/unix/sysv/linux/mips/bits/sigcontext.h: New. * sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Port to n32/n64. (mcontext_t): Make it match the 32-bit mips kernel in o32. * sysdeps/unix/sysv/linux/mips/sys/user.h: Bring in constants from the mips and mips64 headers. (struct user): Port to n32/n64.
2003-04-13  Alexandre Oliva  <aoliva@redhat.com>

	* sysdeps/unix/sysv/linux/mips/profil-counter: New.
	* sysdeps/unix/sysv/linux/mips/sigcontextinfo.h: Port to n32/n64.
	* sysdeps/unix/sysv/linux/mips/bits/sigcontext.h: New.
	* sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Port to n32/n64.
	(mcontext_t): Make it match the 32-bit mips kernel in o32.
	* sysdeps/unix/sysv/linux/mips/sys/user.h: Bring in constants from
	the mips and mips64 headers.
	(struct user): Port to n32/n64.
Diffstat (limited to 'sysdeps/unix/sysv/linux/mips/sys/ucontext.h')
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/ucontext.h61
1 files changed, 43 insertions, 18 deletions
diff --git a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
index 9d80b4086a..66c729a4f9 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
@@ -29,47 +29,72 @@
 #include <bits/sigcontext.h>
 
 
-/* Type for general register.  */
-#if defined _ABIN32 && _MIPS_SIM == _ABIN32
+/* Type for general register.  Even in o32 we assume 64-bit registers,
+   like the kernel.  */
 __extension__ typedef unsigned long long int greg_t;
-#else
-typedef unsigned long int greg_t;
-#endif
 
 /* Number of general registers.  */
-#define NGREG	37
-#define NFPREG	33
+#define NGREG	32
+#define NFPREG	32
 
 /* Container for all general registers.  */
-/* gregset_t must be an array.  The below declared array corresponds to:
-typedef struct gregset {
-	greg_t	g_regs[32];
-	greg_t	g_hi;
-	greg_t	g_lo;
-	greg_t	g_pad[3];
-} gregset_t;  */
 typedef greg_t gregset_t[NGREG];
 
 /* Container for all FPU registers.  */
 typedef struct fpregset {
 	union {
-		double	fp_dregs[32];
+		double	fp_dregs[NFPREG];
 		struct {
 			float		_fp_fregs;
 			unsigned int	_fp_pad;
-		} fp_fregs[32];
+		} fp_fregs[NFPREG];
 	} fp_r;
-	unsigned int	fp_csr;
-	unsigned int	fp_pad;
 } fpregset_t;
 
 
 /* Context to describe whole processor state.  */
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+/* Earlier versions of glibc for mips had an entirely different
+   definition of mcontext_t, that didn't even resemble the
+   corresponding kernel data structure.  Since all legitimate uses of
+   ucontext_t in glibc mustn't have accessed anything beyond
+   uc_mcontext and, even then, taking a pointer to it, casting it to
+   sigcontext_t, and accessing it as such, which is what it has always
+   been, this can still be rectified.  Fortunately, makecontext,
+   [gs]etcontext et all have never been implemented.  */
+typedef struct
+  {
+    unsigned int regmask;
+    unsigned int status;
+    greg_t pc;
+    gregset_t gregs;
+    fpregset_t fpregs;
+    unsigned int fp_owned;
+    unsigned int fpc_csr;
+    unsigned int fpc_eir;
+    unsigned int used_math;
+    unsigned int ssflags;
+    greg_t mdhi;
+    greg_t mdlo;
+    unsigned int cause;
+    unsigned int badvaddr;
+  } mcontext_t;
+#else
 typedef struct
   {
     gregset_t gregs;
     fpregset_t fpregs;
+    greg_t mdhi;
+    greg_t mdlo;
+    greg_t pc;
+    unsigned int status;
+    unsigned int fpc_csr;
+    unsigned int fpc_eir;
+    unsigned int used_math;
+    unsigned int cause;
+    unsigned int badvaddr;
   } mcontext_t;
+#endif
 
 /* Userlevel context.  */
 typedef struct ucontext