Module Name: src
Committed By: matt
Date: Sat Sep 12 17:23:06 UTC 2009
Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: mcontext.h
Log Message:
Add COMPAT_NETBSD32 support.
To generate a diff of this commit:
cvs rdiff -u -r1.8.18.1 -r1.8.18.2 src/sys/arch/mips/include/mcontext.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/mips/include/mcontext.h
diff -u src/sys/arch/mips/include/mcontext.h:1.8.18.1 src/sys/arch/mips/include/mcontext.h:1.8.18.2
--- src/sys/arch/mips/include/mcontext.h:1.8.18.1 Sun Aug 16 03:33:58 2009
+++ src/sys/arch/mips/include/mcontext.h Sat Sep 12 17:23:06 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.8.18.1 2009/08/16 03:33:58 matt Exp $ */
+/* $NetBSD: mcontext.h,v 1.8.18.2 2009/09/12 17:23:06 matt Exp $ */
/*-
* Copyright (c) 1999, 2002 The NetBSD Foundation, Inc.
@@ -81,15 +81,15 @@
/* Make sure this is signed; we need pointers to be sign-extended. */
#if defined(__mips_n32)
-typedef long long __greg_t;
+typedef long long __greg_t;
#else
-typedef long __greg_t;
+typedef long __greg_t;
#endif /* __mips_n32 */
typedef __greg_t __gregset_t[_NGREG];
/*
- * For the O32 ABI, there are 16 doubles, one at each even FP reg
+ * For the O32/O64 ABI, there are 16 doubles, one at each even FP reg
* number. The FP registers themselves are 32-bits.
*
* For 64-bit ABIs (include N32), each FP register is a 64-bit double.
@@ -99,32 +99,50 @@
/*
* Floating point register state
*/
-#if defined(__mips_n32) || defined(_LP64)
-typedef struct {
+struct __fpregset_nabi {
union {
double __fp64_dregs[32];
__freg_t __fp_regs[32];
} __fp_r;
- unsigned int __fp_csr;
- unsigned int __fp_pad;
-} __fpregset_t;
-#else /* !(__mips_n32 || _LP64) */
-typedef struct {
+ __greg_t __fp_csr;
+};
+struct __fpregset_oabi {
union {
double __fp_dregs[16];
float __fp_fregs[32];
- __freg_t __fp_regs[32];
+ int32_t __fp_regs[32];
} __fp_r;
unsigned int __fp_csr;
unsigned int __fp_pad;
-} __fpregset_t;
-#endif /* !(__mips_n32 || _LP64) */
+};
+
+#if __mips_n32 || __mips_n64
+typedef struct __fpregset_nabi __fpregset_t;
+#else
+typedef struct __fpregset_oabi __fpregset_t;
+#endif
typedef struct {
__gregset_t __gregs;
__fpregset_t __fpregs;
} mcontext_t;
+#if defined(_KERNEL) && defined(_LP64)
+typedef int32_t __greg32_t;
+typedef __greg32_t __gregset32_t[_NGREG];
+
+typedef struct {
+ __gregset32_t __gregs;
+ struct __fpregset_oabi __fpregs;
+} mcontext_o32_t;
+
+typedef struct {
+ __gregset_t __gregs;
+ struct __fpregset_nabi __fpregs;
+} mcontext32_t;
+
+#endif /* _KERNEL && _LP64 */
+
#endif /* !__ASSEMBLER__ */
#define _UC_MACHINE_PAD 16 /* Padding appended to ucontext_t */
@@ -138,4 +156,10 @@
#define _UC_MACHINE_SET_PC(uc, pc) _UC_MACHINE_PC(uc) = (pc)
+#define _UC_MACHINE32_SP(uc) _UC_MACHINE_SP(uc)
+#define _UC_MACHINE32_PC(uc) _UC_MACHINE_PC(uc)
+#define _UC_MACHINE32_INTRV(uc) _UC_MACHINE_INTRV(uc)
+
+#define _UC_MACHINE32_SET_PC(uc, pc) _UC_MACHINE_PC((uc), (pc))
+
#endif /* _MIPS_MCONTEXT_H_ */