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).
This commit is contained in:
thorpej 2021-10-30 14:05:40 +00:00
parent 2e07311f7f
commit 6f78cc6e5b
1 changed files with 12 additions and 10 deletions

View File

@ -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_ */