aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/signal.h
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2005-10-14 03:01:14 +0000
committerDavid Xu <davidxu@FreeBSD.org>2005-10-14 03:01:14 +0000
commitac2587e125f17e2be0d088d727db26029a273359 (patch)
tree4a6d94076f1684c5429e3f899f837a91ed2c7173 /sys/sys/signal.h
parentfd6238a659d5727bf69ac4f5e6c0e36fb802b195 (diff)
downloadsrc-ac2587e125f17e2be0d088d727db26029a273359.tar.gz
src-ac2587e125f17e2be0d088d727db26029a273359.zip
Add POSIX siginfo_t's si_code, this is for upcoming POSIX realtime signal
support in kernel. Earlier patch reviewed by: jhb, deischen
Notes
Notes: svn path=/head/; revision=151306
Diffstat (limited to 'sys/sys/signal.h')
-rw-r--r--sys/sys/signal.h82
1 files changed, 73 insertions, 9 deletions
diff --git a/sys/sys/signal.h b/sys/sys/signal.h
index 6016f1380e1c..ccd5c9214d84 100644
--- a/sys/sys/signal.h
+++ b/sys/sys/signal.h
@@ -111,9 +111,9 @@
#if __BSD_VISIBLE
#define SIGTHR 32 /* Thread interrupt. */
#endif
-/*
- * XXX missing SIGRTMIN, SIGRTMAX.
- */
+
+#define SIGRTMIN 65
+#define SIGRTMAX 128
#define SIG_DFL ((__sighandler_t *)0)
#define SIG_IGN ((__sighandler_t *)1)
@@ -199,8 +199,69 @@ typedef struct __siginfo {
void *si_addr; /* faulting instruction */
union sigval si_value; /* signal value */
long si_band; /* band event for SIGPOLL */
- int __spare__[7]; /* gimme some slack */
+ union {
+ struct {
+ int _trapno;/* machine specific trap code */
+ } _fault;
+ int __spare__[7]; /* gimme some slack */
+ } _reason;
} siginfo_t;
+
+#define si_trapno _reason._fault._trapno
+
+/** si_code **/
+/* codes for SIGILL */
+#define ILL_ILLOPC 1 /* Illegal opcode. */
+#define ILL_ILLOPN 2 /* Illegal operand. */
+#define ILL_ILLADR 3 /* Illegal addressing mode. */
+#define ILL_ILLTRP 4 /* Illegal trap. */
+#define ILL_PRVOPC 5 /* Privileged opcode. */
+#define ILL_PRVREG 6 /* Privileged register. */
+#define ILL_COPROC 7 /* Coprocessor error. */
+#define ILL_BADSTK 8 /* Internal stack error. */
+
+/* codes for SIGBUS */
+#define BUS_ADRALN 1 /* Invalid address alignment. */
+#define BUS_ADRERR 2 /* Nonexistent physical address. */
+#define BUS_OBJERR 3 /* Object-specific hardware error. */
+
+/* codes for SIGSEGV */
+#define SEGV_MAPERR 1 /* Address not mapped to object. */
+#define SEGV_ACCERR 2 /* Invalid permissions for mapped */
+ /* object. */
+
+/* codes for SIGFPE */
+#define FPE_INTOVF 1 /* Integer overflow. */
+#define FPE_INTDIV 2 /* Integer divide by zero. */
+#define FPE_FLTDIV 3 /* Floating point divide by zero. */
+#define FPE_FLTOVF 4 /* Floating point overflow. */
+#define FPE_FLTUND 5 /* Floating point underflow. */
+#define FPE_FLTRES 6 /* Floating point inexact result. */
+#define FPE_FLTINV 7 /* Invalid floating point operation. */
+#define FPE_FLTSUB 8 /* Subscript out of range. */
+
+/* codes for SIGTRAP */
+#define TRAP_BRKPT 1 /* Process breakpoint. */
+#define TRAP_TRACE 2 /* Process trace trap. */
+
+/* codes for SIGCHLD */
+#define CLD_EXITED 1 /* Child has exited */
+#define CLD_KILLED 2 /* Child has terminated abnormally but */
+ /* did not create a core file */
+#define CLD_DUMPED 3 /* Child has terminated abnormally and */
+ /* created a core file */
+#define CLD_TRAPPED 4 /* Traced child has trapped */
+#define CLD_STOPPED 5 /* Child has stopped */
+#define CLD_CONTINUED 6 /* Stopped child has continued */
+
+/* codes for SIGPOLL */
+#define POLL_IN 1 /* Data input available */
+#define POLL_OUT 2 /* Output buffers available */
+#define POLL_MSG 3 /* Input message available */
+#define POLL_ERR 4 /* I/O Error */
+#define POLL_PRI 5 /* High priority input available */
+#define POLL_HUP 4 /* Device disconnected */
+
#endif
#if __POSIX_VISIBLE || __XSI_VISIBLE
@@ -244,11 +305,14 @@ struct sigaction {
#endif
#if __POSIX_VISIBLE || __XSI_VISIBLE
-#define SI_USER 0x10001
-#define SI_QUEUE 0x10002
-#define SI_TIMER 0x10003
-#define SI_ASYNCIO 0x10004
-#define SI_MESGQ 0x10005
+#define SI_USER 0x10001 /* Signal sent by kill(). */
+#define SI_QUEUE 0x10002 /* Signal sent by the sigqueue(). */
+#define SI_TIMER 0x10003 /* Signal generated by expiration of */
+ /* a timer set by timer_settime(). */
+#define SI_ASYNCIO 0x10004 /* Signal generated by completion of */
+ /* an asynchronous I/O request.*/
+#define SI_MESGQ 0x10005 /* Signal generated by arrival of a */
+ /* message on an empty message queue. */
#endif
#if __BSD_VISIBLE
#define SI_UNDEFINED 0