Source-Changes-HG archive

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

[src/trunk]: src/sys/sys SA_SIGINFO changes. This is 1.5Z



details:   https://anonhg.NetBSD.org/src/rev/a53024b78653
branches:  trunk
changeset: 551448:a53024b78653
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Sep 06 22:01:20 2003 +0000

description:
SA_SIGINFO changes. This is 1.5Z

diffstat:

 sys/sys/param.h     |   4 +-
 sys/sys/proc.h      |   8 +++-
 sys/sys/siginfo.h   |  95 +++++++++++++++++++++++++++++++++-------------------
 sys/sys/signal.h    |  10 ++--
 sys/sys/signalvar.h |  25 ++++++++++---
 sys/sys/socketvar.h |   8 ++--
 sys/sys/time.h      |   5 +-
 7 files changed, 98 insertions(+), 57 deletions(-)

diffs (truncated from 330 to 300 lines):

diff -r c05740884388 -r a53024b78653 sys/sys/param.h
--- a/sys/sys/param.h   Sat Sep 06 21:07:00 2003 +0000
+++ b/sys/sys/param.h   Sat Sep 06 22:01:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: param.h,v 1.173 2003/09/04 09:17:40 itojun Exp $       */
+/*     $NetBSD: param.h,v 1.174 2003/09/06 22:01:20 christos Exp $     */
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -63,7 +63,7 @@
  * Don't forget to change conf/osrelease.sh too.
  */
 
-#define        __NetBSD_Version__      106250000       /* NetBSD 1.6Y */
+#define        __NetBSD_Version__      106260000       /* NetBSD 1.6Z */
 
 /*
  * Historical NetBSD #define
diff -r c05740884388 -r a53024b78653 sys/sys/proc.h
--- a/sys/sys/proc.h    Sat Sep 06 21:07:00 2003 +0000
+++ b/sys/sys/proc.h    Sat Sep 06 22:01:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.169 2003/08/24 17:52:47 chs Exp $   */
+/*     $NetBSD: proc.h,v 1.170 2003/09/06 22:01:20 christos Exp $      */
 
 /*-
  * Copyright (c) 1986, 1989, 1991, 1993
@@ -50,6 +50,7 @@
 #include <sys/queue.h>
 #include <sys/callout.h>
 #include <sys/signalvar.h>
+#include <sys/siginfo.h>
 #include <sys/event.h>
 
 /*
@@ -99,8 +100,13 @@
        const struct sysent *e_sysent;  /* System call array */
        const char * const *e_syscallnames; /* System call name array */
                                        /* Signal sending function */
+#ifdef __HAVE_SIGINFO
+       void            (*e_sendsig) __P((struct ksiginfo *, sigset_t *));
+       void            (*e_trapsignal) __P((struct lwp *, struct ksiginfo *));
+#else
        void            (*e_sendsig) __P((int, sigset_t *, u_long));
        void            (*e_trapsignal) __P((struct lwp *, int, u_long));
+#endif
        char            *e_sigcode;     /* Start of sigcode */
        char            *e_esigcode;    /* End of sigcode */
                                        /* Set registers before execution */
diff -r c05740884388 -r a53024b78653 sys/sys/siginfo.h
--- a/sys/sys/siginfo.h Sat Sep 06 21:07:00 2003 +0000
+++ b/sys/sys/siginfo.h Sat Sep 06 22:01:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: siginfo.h,v 1.1 2002/11/26 19:06:38 christos Exp $      */
+/*     $NetBSD: siginfo.h,v 1.2 2003/09/06 22:01:20 christos Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -39,47 +39,51 @@
 #ifndef        _SYS_SIGINFO_H_
 #define        _SYS_SIGINFO_H_
 
+#include <machine/signal.h>    /* XXX: __HAVE_SIGINFO */
+
 typedef union sigval {
        int     sival_int;
        void    *sival_ptr;
 } sigval_t;
 
+struct ksiginfo {
+       int     _signo;
+       int     _code;
+       int     _errno;
+#ifdef _LP64
+       /* In _LP64 the union starts on an 8-byte boundary. */
+       int     _pad;
+#endif
+       union {
+               struct {
+                       pid_t   _pid;
+                       uid_t   _uid;
+                       sigval_t        _sigval;
+               } _rt;
+
+               struct {
+                       pid_t   _pid;
+                       uid_t   _uid;
+                       int     _status;
+                       clock_t _utime;
+                       clock_t _stime;
+               } _child;
+
+               struct {
+                       void   *_addr;
+                       int     _trap;
+               } _fault;
+
+               struct {
+                       long    _band;
+                       int     _fd;
+               } _poll;
+       } _reason;
+};
+
 typedef union siginfo {
        char    si_pad[128];    /* Total size; for future expansion */
-       struct {
-               int     _signo;
-               int     _code;
-               int     _errno;
-#ifdef _LP64
-               /* In _LP64 the union starts on an 8-byte boundary. */
-               int     _pad;
-#endif
-               union {
-                       struct {
-                               pid_t   _pid;
-                               uid_t   _uid;
-                               sigval_t        _sigval;
-                       } _rt;
-
-                       struct {
-                               pid_t   _pid;
-                               uid_t   _uid;
-                               int     _status;
-                               clock_t _utime;
-                               clock_t _stime;
-                       } _child;
-
-                       struct {
-                               void   *_addr;
-                               int     _trap;
-                       } _fault;
-
-                       struct {
-                               long    _band;
-                               int     _fd;
-                       } _poll;
-               } _reason;
-       } _info;
+       struct ksiginfo _info;
 } siginfo_t;
 
 /** Field access macros */
@@ -100,6 +104,27 @@
 #define        si_band         _info._reason._poll._band
 #define        si_fd           _info._reason._poll._fd
 
+#ifdef _KERNEL
+typedef struct ksiginfo ksiginfo_t;
+/** Field access macros */
+#define        ksi_signo       _signo
+#define        ksi_code        _code
+#define        ksi_errno       _errno
+
+#define        ksi_sigval      _reason._rt._sigval
+#define        ksi_pid         _reason._child._pid
+#define        ksi_uid         _reason._child._uid
+#define        ksi_status      _reason._child._status
+#define        ksi_utime       _reason._child._utime
+#define        ksi_stime       _reason._child._stime
+
+#define        ksi_addr        _reason._fault._addr
+#define        ksi_trap        _reason._fault._trap
+
+#define        ksi_band        _reason._poll._band
+#define        ksi_fd          _reason._poll._fd
+#endif
+
 /** si_code */
 /* SIGILL */
 #define        ILL_ILLOPC      1       /* Illegal opcode                       */
diff -r c05740884388 -r a53024b78653 sys/sys/signal.h
--- a/sys/sys/signal.h  Sat Sep 06 21:07:00 2003 +0000
+++ b/sys/sys/signal.h  Sat Sep 06 22:01:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: signal.h,v 1.53 2003/08/07 16:34:13 agc Exp $  */
+/*     $NetBSD: signal.h,v 1.54 2003/09/06 22:01:20 christos Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -142,15 +142,17 @@
 #define sa_handler _sa_u._sa_handler
 #define sa_sigaction _sa_u._sa_sigaction
 
+#include <machine/signal.h>    /* sigcontext; codes for SIGILL, SIGFPE */
+
 #if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \
     (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
 #define SA_ONSTACK     0x0001  /* take signal on signal stack */
 #define SA_RESTART     0x0002  /* restart system on signal return */
 #define SA_RESETHAND   0x0004  /* reset to SIG_DFL when taking signal */
 #define SA_NODEFER     0x0010  /* don't mask the signal we're delivering */
-#if defined(_KERNEL)
+#if defined(_KERNEL) || defined(__HAVE_SIGINFO)
 #define SA_SIGINFO     0x0040
-#endif /* _KERNEL */
+#endif /* _KERNEL || __HAVE_SIGINFO */
 #endif /* _XOPEN_SOURCE_EXTENDED || XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */
 /* Only valid for SIGCHLD. */
 #define SA_NOCLDSTOP   0x0008  /* do not generate SIGCHLD on child stop */
@@ -212,8 +214,6 @@
 };
 #endif /* _XOPEN_SOURCE_EXTENDED || _XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */
 
-#include <machine/signal.h>    /* sigcontext; codes for SIGILL, SIGFPE */
-
 #if defined(_NETBSD_SOURCE) && !defined(_KERNEL)
 /*
  * Macro for converting signal number to a mask suitable for
diff -r c05740884388 -r a53024b78653 sys/sys/signalvar.h
--- a/sys/sys/signalvar.h       Sat Sep 06 21:07:00 2003 +0000
+++ b/sys/sys/signalvar.h       Sat Sep 06 22:01:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: signalvar.h,v 1.41 2003/08/07 16:34:13 agc Exp $       */
+/*     $NetBSD: signalvar.h,v 1.42 2003/09/06 22:01:20 christos Exp $  */
 
 /*
  * Copyright (c) 1991, 1993
@@ -67,8 +67,7 @@
        struct  sigaltstack ps_sigstk;  /* sp & on stack state variable */
        sigset_t ps_oldmask;            /* saved mask from before sigpause */
        int     ps_flags;               /* signal flags, below */
-       int     ps_sig;                 /* for core dump/debugger XXX */
-       long    ps_code;                /* for core dump/debugger XXX */
+       struct ksiginfo ps_siginfo;     /* for core dump/debugger XXX */
        int     ps_lwp;                 /* for core dump/debugger XXX */
        void    *ps_sigcode;            /* address of signal trampoline */
        sigset_t ps_sigmask;            /* Current signal mask. */
@@ -137,18 +136,26 @@
 int    coredump_netbsd __P((struct lwp *, struct vnode *, struct ucred *));
 void   execsigs __P((struct proc *));
 void   gsignal __P((int, int));
+void   kgsignal __P((int, struct ksiginfo *, void *));
 int    issignal __P((struct lwp *));
 void   pgsignal __P((struct pgrp *, int, int));
+void   kpgsignal __P((struct pgrp *, struct ksiginfo *, void *, int));
 void   postsig __P((int));
 void   psignal1 __P((struct proc *, int, int));
-#define        psignal(p, sig)         psignal1((p), (sig), 1)
-#define        sched_psignal(p, sig)   psignal1((p), (sig), 0)
+void   kpsignal1 __P((struct proc *, struct ksiginfo *, void *, int));
+#define        kpsignal(p, ksi, data)          kpsignal1((p), (ksi), (data), 1)
+#define        psignal(p, sig)                 psignal1((p), (sig), 1)
+#define        sched_psignal(p, sig)           psignal1((p), (sig), 0)
 void   siginit __P((struct proc *));
+#ifdef __HAVE_SIGINFO
+void   trapsignal __P((struct lwp *, struct ksiginfo *));
+#else
 void   trapsignal __P((struct lwp *, int, u_long));
+#endif
 void   sigexit __P((struct lwp *, int));
 void   killproc __P((struct proc *, const char *));
 void   setsigvec __P((struct proc *, int, struct sigaction *));
-int    killpg1 __P((struct proc *, int, int, int));
+int    killpg1 __P((struct proc *, struct ksiginfo *, int, int));
 struct lwp *proc_unstop __P((struct proc *p));
 
 int    sigaction1 __P((struct proc *, int, const struct sigaction *,
@@ -166,12 +173,16 @@
 void   sigactsunshare __P((struct proc *));
 void   sigactsfree __P((struct proc *));
 
-void   psendsig __P((struct lwp *, int, sigset_t *, u_long));
+void   kpsendsig __P((struct lwp *, struct ksiginfo *, sigset_t *));
 
 /*
  * Machine-dependent functions:
  */
+#ifdef __HAVE_SIGINFO
+void   sendsig __P((struct ksiginfo *, sigset_t *));
+#else
 void   sendsig __P((int, sigset_t *, u_long));
+#endif
 struct core;
 struct core32;
 int    cpu_coredump __P((struct lwp *, struct vnode *, struct ucred *,
diff -r c05740884388 -r a53024b78653 sys/sys/socketvar.h
--- a/sys/sys/socketvar.h       Sat Sep 06 21:07:00 2003 +0000
+++ b/sys/sys/socketvar.h       Sat Sep 06 22:01:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: socketvar.h,v 1.66 2003/09/04 16:44:06 wrstuden Exp $  */
+/*     $NetBSD: socketvar.h,v 1.67 2003/09/06 22:01:21 christos Exp $  */
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -240,13 +240,13 @@
 #define        sorwakeup(so)                                                   \
 do {                                                                   \
        if (sb_notify(&(so)->so_rcv))                                   \
-               sowakeup((so), &(so)->so_rcv);                          \
+               sowakeup((so), &(so)->so_rcv, POLL_IN);                         \
 } while (/* CONSTCOND */ 0)
 
 #define        sowwakeup(so)                                                   \
 do {                                                                   \
        if (sb_notify(&(so)->so_snd))                                   \
-               sowakeup((so), &(so)->so_snd);                          \
+               sowakeup((so), &(so)->so_snd, POLL_OUT);                \
 } while (/* CONSTCOND */ 0)



Home | Main Index | Thread Index | Old Index