10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*11913SRoger.Faulkner@Sun.COM * Common Development and Distribution License (the "License"). 6*11913SRoger.Faulkner@Sun.COM * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 21*11913SRoger.Faulkner@Sun.COM 220Sstevel@tonic-gate /* 23*11913SRoger.Faulkner@Sun.COM * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 240Sstevel@tonic-gate * Use is subject to license terms. 250Sstevel@tonic-gate */ 260Sstevel@tonic-gate 270Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 280Sstevel@tonic-gate /* All Rights Reserved */ 290Sstevel@tonic-gate 300Sstevel@tonic-gate /* 310Sstevel@tonic-gate * University Copyright- Copyright (c) 1982, 1986, 1988 320Sstevel@tonic-gate * The Regents of the University of California 330Sstevel@tonic-gate * All Rights Reserved 340Sstevel@tonic-gate * 350Sstevel@tonic-gate * University Acknowledgment- Portions of this document are derived from 360Sstevel@tonic-gate * software developed by the University of California, Berkeley, and its 370Sstevel@tonic-gate * contributors. 380Sstevel@tonic-gate */ 390Sstevel@tonic-gate 400Sstevel@tonic-gate #ifndef _UCB_SYS_SIGNAL_H 410Sstevel@tonic-gate #define _UCB_SYS_SIGNAL_H 420Sstevel@tonic-gate 430Sstevel@tonic-gate /* 440Sstevel@tonic-gate * 4.3BSD signal compatibility header 450Sstevel@tonic-gate * 460Sstevel@tonic-gate * this file includes all standard SVR4 header info, plus the 4.3BSD 470Sstevel@tonic-gate * structures - 4.3BSD signal codes are translated to SVR4 generic 480Sstevel@tonic-gate * signal codes where applicable 490Sstevel@tonic-gate */ 500Sstevel@tonic-gate 510Sstevel@tonic-gate #ifdef __cplusplus 520Sstevel@tonic-gate extern "C" { 530Sstevel@tonic-gate #endif 540Sstevel@tonic-gate 550Sstevel@tonic-gate /* 560Sstevel@tonic-gate * SysV <signal.h> 570Sstevel@tonic-gate */ 580Sstevel@tonic-gate 590Sstevel@tonic-gate /* ---- <signal.h> ---- */ 600Sstevel@tonic-gate 610Sstevel@tonic-gate /* Copyright (c) 1988 AT&T */ 620Sstevel@tonic-gate /* All Rights Reserved */ 630Sstevel@tonic-gate 640Sstevel@tonic-gate 650Sstevel@tonic-gate #ifndef _SIGNAL_H 660Sstevel@tonic-gate #define _SIGNAL_H 670Sstevel@tonic-gate 680Sstevel@tonic-gate /* ---- <sys/signal.h> ---- */ 690Sstevel@tonic-gate 700Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 710Sstevel@tonic-gate /* All Rights Reserved */ 720Sstevel@tonic-gate 730Sstevel@tonic-gate 740Sstevel@tonic-gate #ifndef _SYS_SIGNAL_H 750Sstevel@tonic-gate #define _SYS_SIGNAL_H 760Sstevel@tonic-gate 770Sstevel@tonic-gate #define SIGHUP 1 /* hangup */ 780Sstevel@tonic-gate #define SIGINT 2 /* interrupt (rubout) */ 790Sstevel@tonic-gate #define SIGQUIT 3 /* quit (ASCII FS) */ 800Sstevel@tonic-gate #define SIGILL 4 /* illegal instruction (not reset when caught) */ 810Sstevel@tonic-gate #define SIGTRAP 5 /* trace trap (not reset when caught) */ 820Sstevel@tonic-gate #define SIGIOT 6 /* IOT instruction */ 830Sstevel@tonic-gate #define SIGABRT 6 /* used by abort, replace SIGIOT in the future */ 840Sstevel@tonic-gate #define SIGEMT 7 /* EMT instruction */ 850Sstevel@tonic-gate #define SIGFPE 8 /* floating point exception */ 860Sstevel@tonic-gate #define SIGKILL 9 /* kill (cannot be caught or ignored) */ 870Sstevel@tonic-gate #define SIGBUS 10 /* bus error */ 880Sstevel@tonic-gate #define SIGSEGV 11 /* segmentation violation */ 890Sstevel@tonic-gate #define SIGSYS 12 /* bad argument to system call */ 900Sstevel@tonic-gate #define SIGPIPE 13 /* write on a pipe with no one to read it */ 910Sstevel@tonic-gate #define SIGALRM 14 /* alarm clock */ 920Sstevel@tonic-gate #define SIGTERM 15 /* software termination signal from kill */ 930Sstevel@tonic-gate #define SIGUSR1 16 /* user defined signal 1 */ 940Sstevel@tonic-gate #define SIGUSR2 17 /* user defined signal 2 */ 950Sstevel@tonic-gate #define SIGCLD 18 /* child status change */ 960Sstevel@tonic-gate #define SIGCHLD 18 /* child status change alias (POSIX) */ 970Sstevel@tonic-gate #define SIGPWR 19 /* power-fail restart */ 980Sstevel@tonic-gate #define SIGWINCH 20 /* window size change */ 990Sstevel@tonic-gate #define SIGURG 21 /* urgent socket condition */ 1000Sstevel@tonic-gate #define SIGPOLL 22 /* pollable event occured */ 1010Sstevel@tonic-gate #define SIGIO SIGPOLL /* socket I/O possible (SIGPOLL alias) */ 1020Sstevel@tonic-gate #define SIGSTOP 23 /* stop (cannot be caught or ignored) */ 1030Sstevel@tonic-gate #define SIGTSTP 24 /* user stop requested from tty */ 1040Sstevel@tonic-gate #define SIGCONT 25 /* stopped process has been continued */ 1050Sstevel@tonic-gate #define SIGTTIN 26 /* background tty read attempted */ 1060Sstevel@tonic-gate #define SIGTTOU 27 /* background tty write attempted */ 1070Sstevel@tonic-gate #define SIGVTALRM 28 /* virtual timer expired */ 1080Sstevel@tonic-gate #define SIGPROF 29 /* profiling timer expired */ 1090Sstevel@tonic-gate #define SIGXCPU 30 /* exceeded cpu limit */ 1100Sstevel@tonic-gate #define SIGXFSZ 31 /* exceeded file size limit */ 1110Sstevel@tonic-gate #define SIGWAITING 32 /* process's lwps are blocked */ 1120Sstevel@tonic-gate #define SIGLWP 33 /* special signal used by thread library */ 1130Sstevel@tonic-gate 1140Sstevel@tonic-gate #if defined(__cplusplus) 1150Sstevel@tonic-gate 1160Sstevel@tonic-gate typedef void SIG_FUNC_TYP(int); 1170Sstevel@tonic-gate typedef SIG_FUNC_TYP *SIG_TYP; 1180Sstevel@tonic-gate #define SIG_PF SIG_TYP 1190Sstevel@tonic-gate 1200Sstevel@tonic-gate #define SIG_DFL (SIG_PF)0 1210Sstevel@tonic-gate #define SIG_ERR (SIG_PF)-1 1220Sstevel@tonic-gate #define SIG_IGN (SIG_PF)1 1230Sstevel@tonic-gate #define SIG_HOLD (SIG_PF)2 1240Sstevel@tonic-gate 1250Sstevel@tonic-gate #elif defined(lint) 1260Sstevel@tonic-gate 1270Sstevel@tonic-gate #define SIG_DFL (void(*)(int))0 1280Sstevel@tonic-gate #define SIG_ERR (void(*)(int))0 1290Sstevel@tonic-gate #define SIG_IGN (void (*)(int))0 1300Sstevel@tonic-gate #define SIG_HOLD (void(*)(int))0 1310Sstevel@tonic-gate 1320Sstevel@tonic-gate #else 1330Sstevel@tonic-gate 1340Sstevel@tonic-gate #define SIG_DFL (void(*)())0 1350Sstevel@tonic-gate #define SIG_ERR (void(*)())-1 1360Sstevel@tonic-gate #define SIG_IGN (void (*)())1 1370Sstevel@tonic-gate #define SIG_HOLD (void(*)())2 1380Sstevel@tonic-gate 1390Sstevel@tonic-gate #endif 1400Sstevel@tonic-gate 1410Sstevel@tonic-gate #define SIG_BLOCK 1 1420Sstevel@tonic-gate #define SIG_UNBLOCK 2 1430Sstevel@tonic-gate #define SIG_SETMASK 3 1440Sstevel@tonic-gate 1450Sstevel@tonic-gate #define SIGNO_MASK 0xFF 1460Sstevel@tonic-gate #define SIGDEFER 0x100 1470Sstevel@tonic-gate #define SIGHOLD 0x200 1480Sstevel@tonic-gate #define SIGRELSE 0x400 1490Sstevel@tonic-gate #define SIGIGNORE 0x800 1500Sstevel@tonic-gate #define SIGPAUSE 0x1000 1510Sstevel@tonic-gate 1520Sstevel@tonic-gate #if !defined(_STRICT_STDC) || defined(_POSIX_SOURCE) 1530Sstevel@tonic-gate 1540Sstevel@tonic-gate #ifndef _SIGSET_T 1550Sstevel@tonic-gate #define _SIGSET_T 1560Sstevel@tonic-gate typedef struct { /* signal set type */ 1570Sstevel@tonic-gate unsigned int __sigbits[4]; 1580Sstevel@tonic-gate } sigset_t; 1590Sstevel@tonic-gate #endif /* _SIGSET_T */ 1600Sstevel@tonic-gate 1610Sstevel@tonic-gate struct sigaction { 1620Sstevel@tonic-gate int sa_flags; 1630Sstevel@tonic-gate #if defined(__cplusplus) 1640Sstevel@tonic-gate void (*sa_handler)(int); 1650Sstevel@tonic-gate #else 1660Sstevel@tonic-gate void (*sa_handler)(); 1670Sstevel@tonic-gate #endif 1680Sstevel@tonic-gate sigset_t sa_mask; 1690Sstevel@tonic-gate int sa_resv[2]; 1700Sstevel@tonic-gate }; 1710Sstevel@tonic-gate 1720Sstevel@tonic-gate /* this is only valid for SIGCLD */ 1730Sstevel@tonic-gate #define SA_NOCLDSTOP 0x00020000 /* don't send job control SIGCLD's */ 1740Sstevel@tonic-gate #endif 1750Sstevel@tonic-gate 1760Sstevel@tonic-gate #if !defined(_STRICT_STDC) && !defined(_POSIX_SOURCE) 1770Sstevel@tonic-gate /* non-comformant ANSI compilation */ 1780Sstevel@tonic-gate 1790Sstevel@tonic-gate /* definitions for the sa_flags field */ 1800Sstevel@tonic-gate #define SA_ONSTACK 0x00000001 1810Sstevel@tonic-gate #define SA_RESETHAND 0x00000002 1820Sstevel@tonic-gate #define SA_RESTART 0x00000004 1830Sstevel@tonic-gate #define SA_SIGINFO 0x00000008 1840Sstevel@tonic-gate #define SA_NODEFER 0x00000010 1850Sstevel@tonic-gate 1860Sstevel@tonic-gate /* this is only valid for SIGCLD */ 1870Sstevel@tonic-gate #define SA_NOCLDWAIT 0x00010000 /* don't save zombie children */ 1880Sstevel@tonic-gate 1890Sstevel@tonic-gate #define NSIG 34 /* valid signals range from 1 to NSIG-1 */ 1900Sstevel@tonic-gate #define MAXSIG 33 /* size of u_signal[], NSIG-1 <= MAXSIG */ 1910Sstevel@tonic-gate 1920Sstevel@tonic-gate #define MINSIGSTKSZ 2048 1930Sstevel@tonic-gate #define SIGSTKSZ 8192 1940Sstevel@tonic-gate 1950Sstevel@tonic-gate #define SS_ONSTACK 0x00000001 1960Sstevel@tonic-gate #define SS_DISABLE 0x00000002 1970Sstevel@tonic-gate 1980Sstevel@tonic-gate struct sigaltstack { 1990Sstevel@tonic-gate char *ss_sp; 2000Sstevel@tonic-gate int ss_size; 2010Sstevel@tonic-gate int ss_flags; 2020Sstevel@tonic-gate }; 2030Sstevel@tonic-gate 2040Sstevel@tonic-gate typedef struct sigaltstack stack_t; 2050Sstevel@tonic-gate 2060Sstevel@tonic-gate #endif /* __STDC__ && !POSIX */ 2070Sstevel@tonic-gate 2080Sstevel@tonic-gate 2090Sstevel@tonic-gate #endif /* _SYS_SIGNAL_H */ 2100Sstevel@tonic-gate 2110Sstevel@tonic-gate /* ---- end of SysV <sys/signal.h> ---- */ 2120Sstevel@tonic-gate 2130Sstevel@tonic-gate typedef int sig_atomic_t; 2140Sstevel@tonic-gate 2150Sstevel@tonic-gate #if defined(__STDC__) 2160Sstevel@tonic-gate 2170Sstevel@tonic-gate extern const char *_sys_siglist[]; 2180Sstevel@tonic-gate extern const int _sys_nsig; 2190Sstevel@tonic-gate 2200Sstevel@tonic-gate #ifdef __cplusplus 2210Sstevel@tonic-gate extern "C" SIG_PF signal(int, SIG_PF); 2220Sstevel@tonic-gate #else 2230Sstevel@tonic-gate extern void (*signal(int, void (*)(int)))(int); 2240Sstevel@tonic-gate #endif 2250Sstevel@tonic-gate extern int raise(int); 2260Sstevel@tonic-gate 2270Sstevel@tonic-gate #if !defined(_STRICT_STDC) || defined(_POSIX_SOURCE) || \ 2280Sstevel@tonic-gate defined(_XOPEN_SOURCE) 2290Sstevel@tonic-gate extern int kill(pid_t, int); 2300Sstevel@tonic-gate extern int sigaction(int, const struct sigaction *, struct sigaction *); 2310Sstevel@tonic-gate extern int sigaddset(sigset_t *, int); 2320Sstevel@tonic-gate extern int sigdelset(sigset_t *, int); 2330Sstevel@tonic-gate extern int sigemptyset(sigset_t *); 2340Sstevel@tonic-gate extern int sigfillset(sigset_t *); 2350Sstevel@tonic-gate extern int sigismember(const sigset_t *, int); 2360Sstevel@tonic-gate extern int sigpending(sigset_t *); 2370Sstevel@tonic-gate extern int sigprocmask(int, const sigset_t *, sigset_t *); 2380Sstevel@tonic-gate extern int sigsuspend(const sigset_t *); 2390Sstevel@tonic-gate #endif 2400Sstevel@tonic-gate 2410Sstevel@tonic-gate #if !defined(_STRICT_STDC) && !defined(_POSIX_SOURCE) 2420Sstevel@tonic-gate extern int gsignal(int); 2430Sstevel@tonic-gate extern void (*sigset(int, void (*)(int)))(int); 2440Sstevel@tonic-gate extern int sighold(int); 2450Sstevel@tonic-gate extern int sigrelse(int); 2460Sstevel@tonic-gate extern int sigignore(int); 2470Sstevel@tonic-gate extern int sigpause(int); 2480Sstevel@tonic-gate extern int (*ssignal(int, int (*)(int)))(int); 2490Sstevel@tonic-gate extern int sigaltstack(const stack_t *, stack_t *); 2500Sstevel@tonic-gate /* extern int sigsend(idtype_t, id_t, int); */ 2510Sstevel@tonic-gate /* extern int sigsendset(const procset_t *, int); */ 2520Sstevel@tonic-gate #endif 2530Sstevel@tonic-gate 2540Sstevel@tonic-gate #else 2550Sstevel@tonic-gate 2560Sstevel@tonic-gate extern char *_sys_siglist[]; 2570Sstevel@tonic-gate extern int _sys_nsig; 2580Sstevel@tonic-gate 2590Sstevel@tonic-gate extern void(*signal())(); 2600Sstevel@tonic-gate extern void(*sigset())(); 2610Sstevel@tonic-gate 2620Sstevel@tonic-gate #endif /* __STDC__ */ 2630Sstevel@tonic-gate 2640Sstevel@tonic-gate #endif /* _SIGNAL_H */ 2650Sstevel@tonic-gate /* ---- end of SysV <signal.h> ---- */ 2660Sstevel@tonic-gate 2670Sstevel@tonic-gate #define sigmask(m) (m > 32 ? 0 : (1 << ((m)-1))) 2680Sstevel@tonic-gate 2690Sstevel@tonic-gate /* 2700Sstevel@tonic-gate * 4.3BSD structure used in sigstack call. 2710Sstevel@tonic-gate */ 2720Sstevel@tonic-gate 2730Sstevel@tonic-gate struct sigstack { 2740Sstevel@tonic-gate char *ss_sp; /* signal stack pointer */ 2750Sstevel@tonic-gate int ss_onstack; /* current status */ 2760Sstevel@tonic-gate }; 2770Sstevel@tonic-gate 2780Sstevel@tonic-gate #define SV_ONSTACK 0x0001 /* take signal on signal stack */ 2790Sstevel@tonic-gate #define SV_INTERRUPT 0x0002 /* do not restart system on signal return */ 2800Sstevel@tonic-gate #define SV_RESETHAND 0x0004 /* reset handler to SIG_DFL when signal taken */ 2810Sstevel@tonic-gate 2820Sstevel@tonic-gate #define sv_onstack sv_flags 2830Sstevel@tonic-gate 2840Sstevel@tonic-gate struct sigcontext { 2850Sstevel@tonic-gate int sc_onstack; /* sigstack state to restore */ 2860Sstevel@tonic-gate int sc_mask; /* signal mask to restore */ 2870Sstevel@tonic-gate #ifdef u3b2 2880Sstevel@tonic-gate int sc_sp; /* sp to restore */ 2890Sstevel@tonic-gate int sc_fp; /* fp to restore */ 2900Sstevel@tonic-gate int sc_ap; /* ap to restore */ 2910Sstevel@tonic-gate int sc_pc; /* pc to restore */ 2920Sstevel@tonic-gate int sc_ps; /* psw to restore */ 2930Sstevel@tonic-gate #endif 2940Sstevel@tonic-gate #ifdef vax 2950Sstevel@tonic-gate int sc_sp; /* sp to restore */ 2960Sstevel@tonic-gate int sc_fp; /* fp to restore */ 2970Sstevel@tonic-gate int sc_ap; /* ap to restore */ 2980Sstevel@tonic-gate int sc_pc; /* pc to restore */ 2990Sstevel@tonic-gate int sc_ps; /* psl to restore */ 3000Sstevel@tonic-gate #endif /* vax */ 3010Sstevel@tonic-gate #ifdef mc68000 3020Sstevel@tonic-gate int sc_sp; /* sp to restore */ 3030Sstevel@tonic-gate int sc_pc; /* pc to retore */ 3040Sstevel@tonic-gate int sc_ps; /* psl to restore */ 3050Sstevel@tonic-gate #endif /* mc68000 */ 3060Sstevel@tonic-gate #ifdef __sparc 3070Sstevel@tonic-gate #define MAXWINDOW 31 /* max usable windows in sparc */ 3080Sstevel@tonic-gate long sc_sp; /* sp to restore */ 3090Sstevel@tonic-gate long sc_pc; /* pc to retore */ 3100Sstevel@tonic-gate long sc_npc; /* next pc to restore */ 3110Sstevel@tonic-gate long sc_psr; /* psr to restore */ 3120Sstevel@tonic-gate /* aliased to REG_CCR for sparcv9 */ 3130Sstevel@tonic-gate long sc_g1; /* register that must be restored */ 3140Sstevel@tonic-gate long sc_o0; 3150Sstevel@tonic-gate int sc_wbcnt; /* number of outstanding windows */ 3160Sstevel@tonic-gate char *sc_spbuf[MAXWINDOW]; /* sp's for each wbuf */ 3170Sstevel@tonic-gate long sc_wbuf[MAXWINDOW][16]; /* outstanding window save buffer */ 3180Sstevel@tonic-gate #endif /* __sparc */ 3190Sstevel@tonic-gate #if defined(__amd64) 3200Sstevel@tonic-gate long sc_sp; /* sp to restore */ 3210Sstevel@tonic-gate long sc_pc; /* pc to retore */ 3220Sstevel@tonic-gate long sc_ps; /* psl to restore */ 3230Sstevel@tonic-gate long sc_rax; /* rax to restore */ 3240Sstevel@tonic-gate long sc_rdx; /* rdx to restore */ 3250Sstevel@tonic-gate #define sc_r0 sc_rax 3260Sstevel@tonic-gate #define sc_r1 sc_rdx 3270Sstevel@tonic-gate #elif defined(__i386) 3280Sstevel@tonic-gate int sc_sp; /* sp to restore */ 3290Sstevel@tonic-gate int sc_pc; /* pc to retore */ 3300Sstevel@tonic-gate int sc_ps; /* psl to restore */ 3310Sstevel@tonic-gate int sc_eax; /* eax to restore */ 3320Sstevel@tonic-gate int sc_edx; /* edx to restore */ 3330Sstevel@tonic-gate #define sc_r0 sc_eax 3340Sstevel@tonic-gate #define sc_r1 sc_edx 3350Sstevel@tonic-gate #endif 3360Sstevel@tonic-gate }; 3370Sstevel@tonic-gate 3380Sstevel@tonic-gate /* 3390Sstevel@tonic-gate * 4.3BSD signal vector structure used in sigvec call. 3400Sstevel@tonic-gate */ 3410Sstevel@tonic-gate struct sigvec { 3420Sstevel@tonic-gate #if defined(__cplusplus) 3430Sstevel@tonic-gate void (*sv_handler)(int, int, struct sigcontext *, char *); 3440Sstevel@tonic-gate #else 3450Sstevel@tonic-gate void (*sv_handler)(); /* signal handler */ 3460Sstevel@tonic-gate #endif 3470Sstevel@tonic-gate int sv_mask; /* signal mask to apply */ 3480Sstevel@tonic-gate int sv_flags; /* see signal options below */ 3490Sstevel@tonic-gate }; 3500Sstevel@tonic-gate 3510Sstevel@tonic-gate #if defined(__STDC__) 3520Sstevel@tonic-gate extern int sigvec(int, struct sigvec *, struct sigvec *); 3530Sstevel@tonic-gate extern int sigblock(int); 3540Sstevel@tonic-gate extern int sigsetmask(int); 3550Sstevel@tonic-gate #endif 3560Sstevel@tonic-gate 3570Sstevel@tonic-gate /* 3580Sstevel@tonic-gate * Signal codes taken verbatim from SunOS4.1 3590Sstevel@tonic-gate */ 3600Sstevel@tonic-gate #ifdef vax 3610Sstevel@tonic-gate #define ILL_RESAD_FAULT 0x0 /* reserved addressing fault */ 3620Sstevel@tonic-gate #define ILL_PRIVIN_FAULT 0x1 /* privileged instruction fault */ 3630Sstevel@tonic-gate #define ILL_RESOP_FAULT 0x2 /* reserved operand fault */ 3640Sstevel@tonic-gate #endif /* vax */ 3650Sstevel@tonic-gate #ifdef mc68000 3660Sstevel@tonic-gate #define ILL_ILLINSTR_FAULT 0x10 /* illegal instruction fault */ 3670Sstevel@tonic-gate #define ILL_PRIVVIO_FAULT 0x20 /* privilege violation fault */ 3680Sstevel@tonic-gate #define ILL_COPROCERR_FAULT 0x34 /* [coprocessor protocol error fault] */ 3690Sstevel@tonic-gate #define ILL_TRAP1_FAULT 0x84 /* trap #1 fault */ 3700Sstevel@tonic-gate #define ILL_TRAP2_FAULT 0x88 /* trap #2 fault */ 3710Sstevel@tonic-gate #define ILL_TRAP3_FAULT 0x8c /* trap #3 fault */ 3720Sstevel@tonic-gate #define ILL_TRAP4_FAULT 0x90 /* trap #4 fault */ 3730Sstevel@tonic-gate #define ILL_TRAP5_FAULT 0x94 /* trap #5 fault */ 3740Sstevel@tonic-gate #define ILL_TRAP6_FAULT 0x98 /* trap #6 fault */ 3750Sstevel@tonic-gate #define ILL_TRAP7_FAULT 0x9c /* trap #7 fault */ 3760Sstevel@tonic-gate #define ILL_TRAP8_FAULT 0xa0 /* trap #8 fault */ 3770Sstevel@tonic-gate #define ILL_TRAP9_FAULT 0xa4 /* trap #9 fault */ 3780Sstevel@tonic-gate #define ILL_TRAP10_FAULT 0xa8 /* trap #10 fault */ 3790Sstevel@tonic-gate #define ILL_TRAP11_FAULT 0xac /* trap #11 fault */ 3800Sstevel@tonic-gate #define ILL_TRAP12_FAULT 0xb0 /* trap #12 fault */ 3810Sstevel@tonic-gate #define ILL_TRAP13_FAULT 0xb4 /* trap #13 fault */ 3820Sstevel@tonic-gate #define ILL_TRAP14_FAULT 0xb8 /* trap #14 fault */ 3830Sstevel@tonic-gate #endif /* mc68000 */ 3840Sstevel@tonic-gate #ifdef sparc 3850Sstevel@tonic-gate #define ILL_STACK 0x00 /* bad stack */ 3860Sstevel@tonic-gate #define ILL_ILLINSTR_FAULT 0x02 /* illegal instruction fault */ 3870Sstevel@tonic-gate #define ILL_PRIVINSTR_FAULT 0x03 /* privileged instruction fault */ 3880Sstevel@tonic-gate /* codes from 0x80 to 0xff are software traps */ 3890Sstevel@tonic-gate #define ILL_TRAP_FAULT(n) ((n)+0x80) /* trap n fault */ 3900Sstevel@tonic-gate #endif /* sparc */ 3910Sstevel@tonic-gate #if defined(__i386) || defined(__amd64) 3920Sstevel@tonic-gate #define ILL_ILLINSTR_FAULT 0x02 /* illegal instruction fault */ 3930Sstevel@tonic-gate #endif 3940Sstevel@tonic-gate 3950Sstevel@tonic-gate #ifdef mc68000 3960Sstevel@tonic-gate #define EMT_EMU1010 0x28 /* line 1010 emulator trap */ 3970Sstevel@tonic-gate #define EMT_EMU1111 0x2c /* line 1111 emulator trap */ 3980Sstevel@tonic-gate #endif /* mc68000 */ 3990Sstevel@tonic-gate #ifdef sparc 4000Sstevel@tonic-gate #define EMT_TAG 0x0a /* tag overflow */ 4010Sstevel@tonic-gate #endif /* sparc */ 4020Sstevel@tonic-gate 4030Sstevel@tonic-gate #ifdef vax 4040Sstevel@tonic-gate #define FPE_INTOVF_TRAP 0x1 /* integer overflow */ 4050Sstevel@tonic-gate #define FPE_INTDIV_TRAP 0x2 /* integer divide by zero */ 4060Sstevel@tonic-gate #define FPE_FLTOVF_TRAP 0x3 /* floating overflow */ 4070Sstevel@tonic-gate #define FPE_FLTDIV_TRAP 0x4 /* floating/decimal divide by zero */ 4080Sstevel@tonic-gate #define FPE_FLTUND_TRAP 0x5 /* floating underflow */ 4090Sstevel@tonic-gate #define FPE_DECOVF_TRAP 0x6 /* decimal overflow */ 4100Sstevel@tonic-gate #define FPE_SUBRNG_TRAP 0x7 /* subscript out of range */ 4110Sstevel@tonic-gate #define FPE_FLTOVF_FAULT 0x8 /* floating overflow fault */ 4120Sstevel@tonic-gate #define FPE_FLTDIV_FAULT 0x9 /* divide by zero floating fault */ 4130Sstevel@tonic-gate #define FPE_FLTUND_FAULT 0xa /* floating underflow fault */ 4140Sstevel@tonic-gate #endif /* vax */ 4150Sstevel@tonic-gate #ifdef mc68000 4160Sstevel@tonic-gate #define FPE_INTDIV_TRAP 0x14 /* integer divide by zero */ 4170Sstevel@tonic-gate #define FPE_CHKINST_TRAP 0x18 /* CHK [CHK2] instruction */ 4180Sstevel@tonic-gate #define FPE_TRAPV_TRAP 0x1c /* TRAPV [cpTRAPcc TRAPcc] instr */ 4190Sstevel@tonic-gate #define FPE_FLTBSUN_TRAP 0xc0 /* [branch or set on unordered cond] */ 4200Sstevel@tonic-gate #define FPE_FLTINEX_TRAP 0xc4 /* [floating inexact result] */ 4210Sstevel@tonic-gate #define FPE_FLTDIV_TRAP 0xc8 /* [floating divide by zero] */ 4220Sstevel@tonic-gate #define FPE_FLTUND_TRAP 0xcc /* [floating underflow] */ 4230Sstevel@tonic-gate #define FPE_FLTOPERR_TRAP 0xd0 /* [floating operand error] */ 4240Sstevel@tonic-gate #define FPE_FLTOVF_TRAP 0xd4 /* [floating overflow] */ 4250Sstevel@tonic-gate #define FPE_FLTNAN_TRAP 0xd8 /* [floating Not-A-Number] */ 4260Sstevel@tonic-gate #ifdef sun 4270Sstevel@tonic-gate #define FPE_FPA_ENABLE 0x400 /* [FPA not enabled] */ 4280Sstevel@tonic-gate #define FPE_FPA_ERROR 0x404 /* [FPA arithmetic exception] */ 4290Sstevel@tonic-gate #endif /* sun */ 4300Sstevel@tonic-gate #endif /* mc68000 */ 4310Sstevel@tonic-gate #ifdef sparc 4320Sstevel@tonic-gate #define FPE_INTOVF_TRAP 0x1 /* integer overflow */ 4330Sstevel@tonic-gate #define FPE_STARTSIG_TRAP 0x2 /* process using fp */ 4340Sstevel@tonic-gate #define FPE_INTDIV_TRAP 0x14 /* integer divide by zero */ 4350Sstevel@tonic-gate #define FPE_FLTINEX_TRAP 0xc4 /* [floating inexact result] */ 4360Sstevel@tonic-gate #define FPE_FLTDIV_TRAP 0xc8 /* [floating divide by zero] */ 4370Sstevel@tonic-gate #define FPE_FLTUND_TRAP 0xcc /* [floating underflow] */ 4380Sstevel@tonic-gate #define FPE_FLTOPERR_TRAP 0xd0 /* [floating operand error] */ 4390Sstevel@tonic-gate #define FPE_FLTOVF_TRAP 0xd4 /* [floating overflow] */ 4400Sstevel@tonic-gate #endif /* sparc */ 4410Sstevel@tonic-gate 4420Sstevel@tonic-gate /* 4430Sstevel@tonic-gate * The codes for SIGBUS and SIGSEGV are described in <vm/faultcode.h> 4440Sstevel@tonic-gate * These are the same between SunOS4.1 and SunOS5.0 4450Sstevel@tonic-gate */ 4460Sstevel@tonic-gate 4470Sstevel@tonic-gate #include <vm/faultcode.h> 4480Sstevel@tonic-gate 4490Sstevel@tonic-gate #define BUS_HWERR FC_HWERR /* misc hardware error (e.g. timeout) */ 4500Sstevel@tonic-gate #define BUS_ALIGN FC_ALIGN /* hardware alignment error */ 4510Sstevel@tonic-gate #ifdef BUS_OBJERR /* namespace conflict with SysV */ 4520Sstevel@tonic-gate #undef BUS_OBJERR 4530Sstevel@tonic-gate #endif 4540Sstevel@tonic-gate #define BUS_OBJERR FC_OBJERR /* object returned errno value */ 4550Sstevel@tonic-gate /* 4560Sstevel@tonic-gate * The BUS_CODE(code) will be one of the above. In the BUS_OBJERR case, 4570Sstevel@tonic-gate * doing a BUS_ERRNO(code) gives an errno value reported by the underlying 4580Sstevel@tonic-gate * file object mapped at the fault address. Note that this appears to be 4590Sstevel@tonic-gate * duplicated with the segmentation fault case below -- unfortunate, since 4600Sstevel@tonic-gate * the specification has always claimed that such errors produce SIGBUS. 4610Sstevel@tonic-gate * The segmentation cases are left defined as a transition aid. 4620Sstevel@tonic-gate */ 4630Sstevel@tonic-gate #define BUS_CODE(C) FC_CODE(C) 4640Sstevel@tonic-gate #define BUS_ERRNO(C) FC_ERRNO(C) 4650Sstevel@tonic-gate 4660Sstevel@tonic-gate #define SEGV_NOMAP FC_NOMAP /* no mapping at the fault address */ 4670Sstevel@tonic-gate #define SEGV_PROT FC_PROT /* access exceeded protections */ 4680Sstevel@tonic-gate #define SEGV_OBJERR FC_OBJERR /* object returned errno value */ 4690Sstevel@tonic-gate /* 4700Sstevel@tonic-gate * The SEGV_CODE(code) will be SEGV_NOMAP, SEGV_PROT, or SEGV_OBJERR. 4710Sstevel@tonic-gate * In the SEGV_OBJERR case, doing a SEGV_ERRNO(code) gives an errno value 4720Sstevel@tonic-gate * reported by the underlying file object mapped at the fault address. 4730Sstevel@tonic-gate */ 4740Sstevel@tonic-gate #define SEGV_CODE(C) FC_CODE(C) 4750Sstevel@tonic-gate #define SEGV_ERRNO(C) FC_ERRNO(C) 4760Sstevel@tonic-gate #define SEGV_MAKE_ERR(e) FC_MAKE_ERR(e) 4770Sstevel@tonic-gate 4780Sstevel@tonic-gate #define SIG_NOADDR ((char *)~0) 4790Sstevel@tonic-gate 4800Sstevel@tonic-gate #if defined(lint) 4810Sstevel@tonic-gate #define BADSIG (void(*)())0 4820Sstevel@tonic-gate #else 4830Sstevel@tonic-gate #define BADSIG (void(*)())-1 4840Sstevel@tonic-gate #endif 4850Sstevel@tonic-gate 4860Sstevel@tonic-gate #ifdef __cplusplus 4870Sstevel@tonic-gate } 4880Sstevel@tonic-gate #endif 4890Sstevel@tonic-gate 4900Sstevel@tonic-gate #endif /* _UCB_SYS_SIGNAL_H */ 491