add 2.6.32 support
[librecmc/librecmc.git] / target / linux / ubicom32 / files / arch / ubicom32 / include / asm / signal.h
1 /*
2  * arch/ubicom32/include/asm/signal.h
3  *   Signal related definitions for Ubicom32 architecture.
4  *
5  * (C) Copyright 2009, Ubicom, Inc.
6  *
7  * This file is part of the Ubicom32 Linux Kernel Port.
8  *
9  * The Ubicom32 Linux Kernel Port is free software: you can redistribute
10  * it and/or modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation, either version 2 of the
12  * License, or (at your option) any later version.
13  *
14  * The Ubicom32 Linux Kernel Port is distributed in the hope that it
15  * will be useful, but WITHOUT ANY WARRANTY; without even the implied
16  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
17  * the GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with the Ubicom32 Linux Kernel Port.  If not,
21  * see <http://www.gnu.org/licenses/>.
22  *
23  * Ubicom32 implementation derived from (with many thanks):
24  *   arch/m68knommu
25  *   arch/blackfin
26  *   arch/parisc
27  */
28 #ifndef _ASM_UBICOM32_SIGNAL_H
29 #define _ASM_UBICOM32_SIGNAL_H
30
31 #include <linux/types.h>
32
33 /* Avoid too many header ordering problems.  */
34 struct siginfo;
35
36 #ifdef __KERNEL__
37 /* Most things should be clean enough to redefine this at will, if care
38    is taken to make libc match.  */
39
40 #define _NSIG           64
41 #define _NSIG_BPW       32
42 #define _NSIG_WORDS     (_NSIG / _NSIG_BPW)
43
44 typedef unsigned long old_sigset_t;             /* at least 32 bits */
45
46 typedef struct {
47         unsigned long sig[_NSIG_WORDS];
48 } sigset_t;
49
50 #endif /* __KERNEL__ */
51
52 #define SIGHUP           1
53 #define SIGINT           2
54 #define SIGQUIT          3
55 #define SIGILL           4
56 #define SIGTRAP          5
57 #define SIGABRT          6
58 #define SIGIOT           6
59 #define SIGBUS           7
60 #define SIGFPE           8
61 #define SIGKILL          9
62 #define SIGUSR1         10
63 #define SIGSEGV         11
64 #define SIGUSR2         12
65 #define SIGPIPE         13
66 #define SIGALRM         14
67 #define SIGTERM         15
68 #define SIGSTKFLT       16
69 #define SIGCHLD         17
70 #define SIGCONT         18
71 #define SIGSTOP         19
72 #define SIGTSTP         20
73 #define SIGTTIN         21
74 #define SIGTTOU         22
75 #define SIGURG          23
76 #define SIGXCPU         24
77 #define SIGXFSZ         25
78 #define SIGVTALRM       26
79 #define SIGPROF         27
80 #define SIGWINCH        28
81 #define SIGIO           29
82 #define SIGPOLL         SIGIO
83 /*
84 #define SIGLOST         29
85 */
86 #define SIGPWR          30
87 #define SIGSYS          31
88 #define SIGUNUSED       31
89
90 /* These should not be considered constants from userland.  */
91 #define SIGRTMIN        32
92 #define SIGRTMAX        _NSIG
93
94 /*
95  * SA_FLAGS values:
96  *
97  * SA_ONSTACK indicates that a registered stack_t will be used.
98  * SA_RESTART flag to get restarting signals (which were the default long ago)
99  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
100  * SA_RESETHAND clears the handler when the signal is delivered.
101  * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
102  * SA_NODEFER prevents the current signal from being masked in the handler.
103  *
104  * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
105  * Unix names RESETHAND and NODEFER respectively.
106  */
107 #define SA_NOCLDSTOP    0x00000001
108 #define SA_NOCLDWAIT    0x00000002
109 #define SA_SIGINFO      0x00000004
110 #define SA_ONSTACK      0x08000000
111 #define SA_RESTART      0x10000000
112 #define SA_NODEFER      0x40000000
113 #define SA_RESETHAND    0x80000000
114
115 #define SA_NOMASK       SA_NODEFER
116 #define SA_ONESHOT      SA_RESETHAND
117
118 /*
119  * sigaltstack controls
120  */
121 #define SS_ONSTACK      1
122 #define SS_DISABLE      2
123
124 #define MINSIGSTKSZ     2048
125 #define SIGSTKSZ        8192
126
127 #include <linux/version.h>
128 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
129 #include <asm-generic/signal-defs.h>
130 #else
131 #include <asm-generic/signal.h>
132 #endif
133
134 #ifdef __KERNEL__
135 struct old_sigaction {
136         __sighandler_t sa_handler;
137         old_sigset_t sa_mask;
138         unsigned long sa_flags;
139         void (*sa_restorer)(void);
140 };
141
142 struct sigaction {
143         __sighandler_t sa_handler;
144         unsigned long sa_flags;
145         void (*sa_restorer)(void);
146         sigset_t sa_mask;               /* mask last for extensibility */
147 };
148
149 struct k_sigaction {
150         struct sigaction sa;
151 };
152 #else
153 /* Here we must cater to libcs that poke about in kernel headers.  */
154
155 struct sigaction {
156         union {
157           __sighandler_t _sa_handler;
158           void (*_sa_sigaction)(int, struct siginfo *, void *);
159         } _u;
160         sigset_t sa_mask;
161         unsigned long sa_flags;
162         void (*sa_restorer)(void);
163 };
164
165 #define sa_handler      _u._sa_handler
166 #define sa_sigaction    _u._sa_sigaction
167
168 #endif /* __KERNEL__ */
169
170 typedef struct sigaltstack {
171         void *ss_sp;
172         int ss_flags;
173         size_t ss_size;
174 } stack_t;
175
176 #ifdef __KERNEL__
177
178 #include <asm/sigcontext.h>
179 #undef __HAVE_ARCH_SIG_BITOPS
180
181 #define ptrace_signal_deliver(regs, cookie) do { } while (0)
182
183 #endif /* __KERNEL__ */
184
185 #endif /* _ASM_UBICOM32_SIGNAL_H */