Module Name:    src
Committed By:   thorpej
Date:           Sat Oct 30 14:05:40 UTC 2021

Modified Files:
        src/sys/arch/mips/include: signal.h

Log Message:
Adjust the rules for sigcontext visibility on MIPS:
- Define __HAVE_STRUCT_SIGCONTEXT if _KERNEL (because it's needed for
  32-bit binary compatibility) or if the O32 ABI is active (because
  that's the only ABI that ever used sigcontext for signal delivery).
- For _KERNEL, define a "struct sigcontext" suitable only for 32-bit
  compatible signal delivery.
- For userspace, define a "struct sigcontext" appropriate for any ABI
  if _LIBC is defined (it's used for setjmp / longjmp) or if O32 is
  the active ABI (because it was part of the old BSD signal API).


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/mips/include/signal.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/signal.h
diff -u src/sys/arch/mips/include/signal.h:1.32 src/sys/arch/mips/include/signal.h:1.33
--- src/sys/arch/mips/include/signal.h:1.32	Wed Oct 27 02:00:46 2021
+++ src/sys/arch/mips/include/signal.h	Sat Oct 30 14:05:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.32 2021/10/27 02:00:46 thorpej Exp $	*/
+/*	$NetBSD: signal.h,v 1.33 2021/10/30 14:05:40 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -78,8 +78,12 @@ struct sigcontext13 {
 };
 #endif /* _KERNEL && COMPAT_13 */
 
-#if defined(_LIBC) || (defined(_KERNEL) && (defined(COMPAT_16) || defined(COMPAT_ULTRIX)))
+#if defined(_KERNEL) || defined(__mips_o32)
 #define	__HAVE_STRUCT_SIGCONTEXT
+#endif
+
+#if defined(_NETBSD_SOURCE)
+#include <sys/sigtypes.h>
 /*
  * Only need an O32 version.
  */
@@ -98,19 +102,17 @@ struct sigcontext { \
 }
 
 /*
- * These will be identical in O32
- */
-#ifdef _KERNEL
-/*
- * We need this only compatibility.
+ * The only binaries that used sigcontext used the O32 ABI.  The kernel
+ * needs this for 32-bit compatibility, and O32 ABI user-space needs this
+ * natively.
  */
+#if defined(_KERNEL)
 _SIGCONTEXT_DEFINE(sigcontext, int, int);
-#endif
-#ifdef _LIBC
+#elif defined(__mips_o32) || defined(_LIBC)
 _SIGCONTEXT_DEFINE(sigcontext, __register_t, __fpregister_t);
 #endif
 
-#endif /* _LIBC || _KERNEL */
+#endif /* _NETBSD_SOURCE */
 
 #endif	/* !_LANGUAGE_ASSEMBLY */
 #endif	/* !_MIPS_SIGNAL_H_ */

Reply via email to