Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/sys Always include the 32 bit structure and defin...



details:   https://anonhg.NetBSD.org/src/rev/90d705b585aa
branches:  trunk
changeset: 962101:90d705b585aa
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jun 27 01:58:49 2019 +0000

description:
Always include the 32 bit structure and definitions on _LP64 regardless
of compat32 being on or off, because we want the headers to work when
compiling modular kernels. Of course the 32 bit structs do not make sense
on platforms that don't have 32 bit modes (alpha), but we don't have
a define for that and it does not hurt.

diffstat:

 sys/compat/sys/rnd.h      |  27 +++++++++------------------
 sys/compat/sys/siginfo.h  |  10 +++-------
 sys/compat/sys/sigtypes.h |  10 +++-------
 sys/compat/sys/ttycom.h   |   3 +--
 sys/compat/sys/ucontext.h |  15 ++++-----------
 5 files changed, 20 insertions(+), 45 deletions(-)

diffs (218 lines):

diff -r d7a91947b93d -r 90d705b585aa sys/compat/sys/rnd.h
--- a/sys/compat/sys/rnd.h      Wed Jun 26 23:10:42 2019 +0000
+++ b/sys/compat/sys/rnd.h      Thu Jun 27 01:58:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rnd.h,v 1.5 2019/01/27 02:08:41 pgoyette Exp $ */
+/*     $NetBSD: rnd.h,v 1.6 2019/06/27 01:58:49 christos Exp $ */
 
 /*-
  * Copyright (c) 1997,2011 The NetBSD Foundation, Inc.
@@ -33,18 +33,9 @@
 #ifndef _COMPAT_SYS_RND_H_
 #define        _COMPAT_SYS_RND_H_
 
-#if defined(_KERNEL_OPT)
-#include "opt_compat_netbsd.h"
-#include "opt_compat_netbsd32.h"
-#endif
-
 #include <sys/types.h>
 #include <sys/ioctl.h>
 
-#ifdef COMPAT_NETBSD32
-#include <compat/netbsd32/netbsd32.h>
-#endif /* COMPAT_NETBSD32 */
-
 #include <sys/rndio.h>
 
 /*
@@ -66,7 +57,7 @@
        void            *unused_state;  /* was: internal state */
 } rndsource50_t;
 
-#ifdef COMPAT_NETBSD32
+#ifdef _LP64
 typedef struct {
        char            name[16];       /* device name */
        uint32_t        unused_time;    /* was: last time recorded */
@@ -77,7 +68,7 @@
        uint32_t        flags;          /* flags */
        netbsd32_voidp  unused_state;   /* was: internal state */
 } rndsource50_32_t;
-#endif /* COMPAT_NETBSD32 */
+#endif /* _LP64 */
 
 /*
  * NetBSD-5 defined RND_MAXSTATCOUNT as 10.  We define RND_MAXSTATCOUNT50
@@ -97,13 +88,13 @@
        rndsource50_t source[RND_MAXSTATCOUNT50];
 } rndstat50_t;
 
-#ifdef COMPAT_NETBSD32
+#ifdef _LP64
 typedef struct {
        uint32_t        start;
        uint32_t        count;
        rndsource50_32_t source[RND_MAXSTATCOUNT50];
 } rndstat50_32_t;
-#endif /* COMPAT_NETBSD32 */
+#endif /* _LP64 */
 
 /*
  * return information on a specific source by name
@@ -113,12 +104,12 @@
        rndsource50_t source;
 } rndstat_name50_t;
 
-#ifdef COMPAT_NETBSD32
+#ifdef _LP64
 typedef struct {
        char            name[16];
        rndsource50_32_t source;
 } rndstat_name50_32_t;
-#endif /* COMPAT_NETBSD32 */
+#endif /* _LP64 */
 
 /*
  * NetBSD-5 defined RND_POOLWORDS as 128.  In NetBSD-6, the value
@@ -143,9 +134,9 @@
 #define        RNDGETSRCNUM50          _IOWR('R', 102, rndstat50_t)
 #define        RNDGETSRCNAME50         _IOWR('R', 103, rndstat_name50_t)
 
-#ifdef COMPAT_NETBSD32
+#ifdef _LP64
 #define        RNDGETSRCNUM50_32       _IOWR('R', 102, rndstat50_32_t)
 #define        RNDGETSRCNAME50_32      _IOWR('R', 103, rndstat_name50_32_t)
-#endif /* COMPAT_NETBSD32 */
+#endif
 
 #endif /* !_COMPAT_SYS_RND_H_ */
diff -r d7a91947b93d -r 90d705b585aa sys/compat/sys/siginfo.h
--- a/sys/compat/sys/siginfo.h  Wed Jun 26 23:10:42 2019 +0000
+++ b/sys/compat/sys/siginfo.h  Thu Jun 27 01:58:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: siginfo.h,v 1.5 2019/06/19 16:14:07 maya Exp $  */
+/*     $NetBSD: siginfo.h,v 1.6 2019/06/27 01:58:49 christos Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -32,11 +32,7 @@
 #ifndef        _COMPAT_SYS_SIGINFO_H_
 #define        _COMPAT_SYS_SIGINFO_H_
 
-#if defined(_KERNEL_OPT)
-#include "opt_compat_netbsd32.h"
-#endif
-
-#if defined(COMPAT_NETBSD32) && defined(_KERNEL)
+#if defined(_LP64) && defined(_KERNEL)
 
 typedef union sigval32 {
        int sival_int;
@@ -87,6 +83,6 @@
        struct __ksiginfo32 _info;
 } siginfo32_t;
 
-#endif /* COMPAT_NETBSD32 && _KERNEL */
+#endif /* _LP64 && _KERNEL */
 
 #endif /* !_COMPAT_SYS_SIGINFO_H_ */
diff -r d7a91947b93d -r 90d705b585aa sys/compat/sys/sigtypes.h
--- a/sys/compat/sys/sigtypes.h Wed Jun 26 23:10:42 2019 +0000
+++ b/sys/compat/sys/sigtypes.h Thu Jun 27 01:58:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sigtypes.h,v 1.2 2005/12/11 12:20:29 christos Exp $    */
+/*     $NetBSD: sigtypes.h,v 1.3 2019/06/27 01:58:49 christos Exp $    */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -39,10 +39,6 @@
 #ifndef        _COMPAT_SYS_SIGTYPES_H_
 #define        _COMPAT_SYS_SIGTYPES_H_
 
-#if defined(_KERNEL_OPT)
-#include "opt_compat_netbsd32.h"
-#endif
-
 #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
     defined(_NETBSD_SOURCE)
 
@@ -67,7 +63,7 @@
 
 #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || ... */
 
-#if defined(COMPAT_NETBSD32) && defined(_KERNEL)
+#if defined(_LP64) && defined(_KERNEL)
 
 struct __sigaltstack32 {
        uint32_t        ss_sp;
@@ -77,7 +73,7 @@
 
 typedef struct __sigaltstack32 stack32_t;
 
-#endif /* COMPAT_NETBSD32 && _KERNEL */
+#endif /* _LP64 && _KERNEL */
 
 
 #endif /* !_COMPAT_SYS_SIGTYPES_H_ */
diff -r d7a91947b93d -r 90d705b585aa sys/compat/sys/ttycom.h
--- a/sys/compat/sys/ttycom.h   Wed Jun 26 23:10:42 2019 +0000
+++ b/sys/compat/sys/ttycom.h   Thu Jun 27 01:58:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ttycom.h,v 1.4 2019/01/28 15:46:49 christos Exp $      */
+/*     $NetBSD: ttycom.h,v 1.5 2019/06/27 01:58:49 christos Exp $      */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -34,7 +34,6 @@
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
-#include "opt_compat_netbsd32.h"
 #endif
 
 #include <sys/types.h>
diff -r d7a91947b93d -r 90d705b585aa sys/compat/sys/ucontext.h
--- a/sys/compat/sys/ucontext.h Wed Jun 26 23:10:42 2019 +0000
+++ b/sys/compat/sys/ucontext.h Thu Jun 27 01:58:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ucontext.h,v 1.6 2012/05/21 14:15:19 martin Exp $      */
+/*     $NetBSD: ucontext.h,v 1.7 2019/06/27 01:58:49 christos Exp $    */
 
 /*-
  * Copyright (c) 1999, 2003 The NetBSD Foundation, Inc.
@@ -32,13 +32,9 @@
 #ifndef _COMPAT_SYS_UCONTEXT_H_
 #define _COMPAT_SYS_UCONTEXT_H_
 
-#if defined(_KERNEL_OPT)
-#include "opt_compat_netbsd32.h"
-#endif
-
 #include <compat/sys/sigtypes.h>
 
-#if defined(COMPAT_NETBSD32) && defined(_KERNEL)
+#if defined(_LP64) && defined(_KERNEL)
 
 typedef struct __ucontext32       ucontext32_t;
 
@@ -57,17 +53,14 @@
 __CTASSERT(sizeof(ucontext32_t) == __UCONTEXT32_SIZE);
 #endif
 
-#endif /* COMPAT_NETBSD32 && _KERNEL */
 
-#ifdef _KERNEL
-#ifdef COMPAT_NETBSD32
 struct lwp;
 void   getucontext32(struct lwp *, ucontext32_t *);
 int    setucontext32(struct lwp *, const ucontext32_t *);
 int    cpu_mcontext32_validate(struct lwp *, const mcontext32_t *);
 void   cpu_getmcontext32(struct lwp *, mcontext32_t *, unsigned int *);
 int    cpu_setmcontext32(struct lwp *, const mcontext32_t *, unsigned int);
-#endif /* COMPAT_NETBSD32 */
-#endif /* _KERNEL */
+
+#endif /* _LP64 && _KERNEL */
 
 #endif /* !_COMPAT_SYS_UCONTEXT_H_ */



Home | Main Index | Thread Index | Old Index