move new files out from platform support patch
[lede.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 <asm-generic/signal.h>
128
129 #ifdef __KERNEL__
130 struct old_sigaction {
131         __sighandler_t sa_handler;
132         old_sigset_t sa_mask;
133         unsigned long sa_flags;
134         void (*sa_restorer)(void);
135 };
136
137 struct sigaction {
138         __sighandler_t sa_handler;
139         unsigned long sa_flags;
140         void (*sa_restorer)(void);
141         sigset_t sa_mask;               /* mask last for extensibility */
142 };
143
144 struct k_sigaction {
145         struct sigaction sa;
146 };
147 #else
148 /* Here we must cater to libcs that poke about in kernel headers.  */
149
150 struct sigaction {
151         union {
152           __sighandler_t _sa_handler;
153           void (*_sa_sigaction)(int, struct siginfo *, void *);
154         } _u;
155         sigset_t sa_mask;
156         unsigned long sa_flags;
157         void (*sa_restorer)(void);
158 };
159
160 #define sa_handler      _u._sa_handler
161 #define sa_sigaction    _u._sa_sigaction
162
163 #endif /* __KERNEL__ */
164
165 typedef struct sigaltstack {
166         void *ss_sp;
167         int ss_flags;
168         size_t ss_size;
169 } stack_t;
170
171 #ifdef __KERNEL__
172
173 #include <asm/sigcontext.h>
174 #undef __HAVE_ARCH_SIG_BITOPS
175
176 #define ptrace_signal_deliver(regs, cookie) do { } while (0)
177
178 #endif /* __KERNEL__ */
179
180 #endif /* _ASM_UBICOM32_SIGNAL_H */