Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-9]: src/sys/compat Pull up following revision(s) (requested by ri...
details: https://anonhg.NetBSD.org/src/rev/c460607c1689
branches: netbsd-9
changeset: 461234:c460607c1689
user: martin <martin%NetBSD.org@localhost>
date: Tue Nov 19 13:36:25 2019 +0000
description:
Pull up following revision(s) (requested by rin in ticket #457):
sys/compat/sys/siginfo.h: revision 1.9
sys/compat/netbsd32/netbsd32.h: revision 1.131
8-byte objects on i386 or arm-oabi are aligned in 4-byte boundary.
Therefore, we must use __attribute__((__aligned__(4))) for them.
netbsd32_{,u}int64 are provided for this purpose. However, we
cannot use it in <compat/sys/siginfo.h> due to circular dependency
b/w <machine/netbsd32_machdep.h>.
In order to distangle it, we choose here to have a duplicate type,
netbsd32_siginfo_uint64, in <compat/sys/siginfo.h>. The equivalence
with netbsd32_uint64 is asserted in <compat/netbsd32/netbsd32.h>.
Now, gdb for i386 works again on amd64 kernel.
Based on patch provided by kamil. Thanks!
XXX
pullup to netbsd-9
diffstat:
sys/compat/netbsd32/netbsd32.h | 6 +++++-
sys/compat/sys/siginfo.h | 13 +++++++++++--
2 files changed, 16 insertions(+), 3 deletions(-)
diffs (54 lines):
diff -r f3531dd8227c -r c460607c1689 sys/compat/netbsd32/netbsd32.h
--- a/sys/compat/netbsd32/netbsd32.h Tue Nov 19 13:33:21 2019 +0000
+++ b/sys/compat/netbsd32/netbsd32.h Tue Nov 19 13:36:25 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32.h,v 1.123 2019/02/20 06:04:28 mrg Exp $ */
+/* $NetBSD: netbsd32.h,v 1.123.4.1 2019/11/19 13:36:25 martin Exp $ */
/*
* Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -162,6 +162,10 @@
typedef uint64_t netbsd32_uint64 NETBSD32_INT64_ALIGN;
#undef NETBSD32_INT64_ALIGN
+/* Type used in siginfo, avoids circular dependencies between headers. */
+CTASSERT(sizeof(netbsd32_uint64) == sizeof(netbsd32_siginfo_uint64));
+CTASSERT(__alignof__(netbsd32_uint64) == __alignof__(netbsd32_siginfo_uint64));
+
/*
* all pointers are netbsd32_pointer_t (defined in <machine/netbsd32_machdep.h>)
*/
diff -r f3531dd8227c -r c460607c1689 sys/compat/sys/siginfo.h
--- a/sys/compat/sys/siginfo.h Tue Nov 19 13:33:21 2019 +0000
+++ b/sys/compat/sys/siginfo.h Tue Nov 19 13:36:25 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: siginfo.h,v 1.7.2.1 2019/10/15 18:32:13 martin Exp $ */
+/* $NetBSD: siginfo.h,v 1.7.2.2 2019/11/19 13:36:25 martin Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -34,6 +34,15 @@
#ifdef _KERNEL
+/* Avoids circular dependency with machine/netbsd32_machdep.h */
+#if defined(__x86_64__) || (defined(__arm__) && defined(__ARM_EABI__))
+#define NETBSD32_SIGINFO_UINT64_ALIGN __attribute__((__aligned__(4)))
+#else
+#define NETBSD32_SIGINFO_UINT64_ALIGN __attribute__((__aligned__(8)))
+#endif
+typedef uint64_t netbsd32_siginfo_uint64 NETBSD32_SIGINFO_UINT64_ALIGN;
+#undef NETBSD32_SIGINFO_UINT64_ALIGN
+
typedef union sigval32 {
int sival_int;
uint32_t sival_ptr;
@@ -73,7 +82,7 @@
int _sysnum;
int _retval[2];
int _error;
- uint64_t _args[8]; /* SYS_MAXSYSARGS */
+ netbsd32_siginfo_uint64 _args[8]; /* SYS_MAXSYSARGS */
} _syscall;
struct {
Home |
Main Index |
Thread Index |
Old Index