1  #ifndef _ASMPPC_SIGNAL_H
2  #define _ASMPPC_SIGNAL_H
3  
4  #include <linux/types.h>
5  
6  /* Avoid too many header ordering problems.  */
7  struct siginfo;
8  
9  /* Most things should be clean enough to redefine this at will, if care
10     is taken to make libc match.  */
11  
12  #define _NSIG		64
13  #define _NSIG_BPW	32
14  #define _NSIG_WORDS	(_NSIG / _NSIG_BPW)
15  
16  typedef unsigned long old_sigset_t;		/* at least 32 bits */
17  
18  typedef struct {
19  	unsigned long sig[_NSIG_WORDS];
20  } sigset_t;
21  
22  #define SIGHUP		 1
23  #define SIGINT		 2
24  #define SIGQUIT		 3
25  #define SIGILL		 4
26  #define SIGTRAP		 5
27  #define SIGABRT		 6
28  #define SIGIOT		 6
29  #define SIGBUS		 7
30  #define SIGFPE		 8
31  #define SIGKILL		 9
32  #define SIGUSR1		10
33  #define SIGSEGV		11
34  #define SIGUSR2		12
35  #define SIGPIPE		13
36  #define SIGALRM		14
37  #define SIGTERM		15
38  #define SIGSTKFLT	16
39  #define SIGCHLD		17
40  #define SIGCONT		18
41  #define SIGSTOP		19
42  #define SIGTSTP		20
43  #define SIGTTIN		21
44  #define SIGTTOU		22
45  #define SIGURG		23
46  #define SIGXCPU		24
47  #define SIGXFSZ		25
48  #define SIGVTALRM	26
49  #define SIGPROF		27
50  #define SIGWINCH	28
51  #define SIGIO		29
52  #define SIGPOLL		SIGIO
53  /*
54  #define SIGLOST		29
55  */
56  #define SIGPWR		30
57  #define SIGSYS		31
58  #define	SIGUNUSED	31
59  
60  /* These should not be considered constants from userland.  */
61  #define SIGRTMIN	32
62  #define SIGRTMAX	(_NSIG-1)
63  
64  /*
65   * SA_FLAGS values:
66   *
67   * SA_ONSTACK is not currently supported, but will allow sigaltstack(2).
68   * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
69   * SA_RESTART flag to get restarting signals (which were the default long ago)
70   * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
71   * SA_RESETHAND clears the handler when the signal is delivered.
72   * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
73   * SA_NODEFER prevents the current signal from being masked in the handler.
74   *
75   * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
76   * Unix names RESETHAND and NODEFER respectively.
77   */
78  #define SA_NOCLDSTOP	0x00000001
79  #define SA_NOCLDWAIT	0x00000002 /* not supported yet */
80  #define SA_SIGINFO	0x00000004
81  #define SA_ONSTACK	0x08000000
82  #define SA_RESTART	0x10000000
83  #define SA_NODEFER	0x40000000
84  #define SA_RESETHAND	0x80000000
85  
86  #define SA_NOMASK	SA_NODEFER
87  #define SA_ONESHOT	SA_RESETHAND
88  #define SA_INTERRUPT	0x20000000 /* dummy -- ignored */
89  
90  #define SA_RESTORER	0x04000000
91  
92  /*
93   * sigaltstack controls
94   */
95  #define SS_ONSTACK	1
96  #define SS_DISABLE	2
97  
98  #define MINSIGSTKSZ	2048
99  #define SIGSTKSZ	8192
100  #ifdef __KERNEL__
101  
102  /*
103   * These values of sa_flags are used only by the kernel as part of the
104   * irq handling routines.
105   *
106   * SA_INTERRUPT is also used by the irq handling routines.
107   * SA_SHIRQ is for shared interrupt support on PCI and EISA.
108   */
109  #define SA_PROBE		SA_ONESHOT
110  #define SA_SAMPLE_RANDOM	SA_RESTART
111  #define SA_SHIRQ		0x04000000
112  #endif
113  
114  #define SIG_BLOCK          0	/* for blocking signals */
115  #define SIG_UNBLOCK        1	/* for unblocking signals */
116  #define SIG_SETMASK        2	/* for setting the signal mask */
117  
118  /* Type of a signal handler.  */
119  typedef void (*__sighandler_t)(int);
120  
121  #define SIG_DFL	((__sighandler_t)0)	/* default signal handling */
122  #define SIG_IGN	((__sighandler_t)1)	/* ignore signal */
123  #define SIG_ERR	((__sighandler_t)-1)	/* error return from signal */
124  
125  struct old_sigaction {
126  	__sighandler_t sa_handler;
127  	old_sigset_t sa_mask;
128  	unsigned long sa_flags;
129  	void (*sa_restorer)(void);
130  };
131  
132  struct sigaction {
133  	__sighandler_t sa_handler;
134  	unsigned long sa_flags;
135  	void (*sa_restorer)(void);
136  	sigset_t sa_mask;		/* mask last for extensibility */
137  };
138  
139  struct k_sigaction {
140  	struct sigaction sa;
141  };
142  
143  typedef struct sigaltstack {
144  	void *ss_sp;
145  	int ss_flags;
146  	size_t ss_size;
147  } stack_t;
148  
149  #ifdef __KERNEL__
150  #include <asm/sigcontext.h>
151  
152  #endif
153  
154  #endif
155