Debian Codegraph @

runtime/linux/compat_structs.h

raw
1 /*
2 * Architecture specific compatibility type for various structs. In older
3 * kernels, these weren't in public headers.
4 */
5
6 #ifndef _COMPAT_STRUCTS_H_
7 #define _COMPAT_STRUCTS_H_
8
9 #if defined(__powerpc64__)
10 typedef struct sigaltstack_32 {
11 unsigned int ss_sp;
12 int ss_flags;
13 compat_size_t ss_size;
14 } stack_32_t;
15
16 #ifndef SI_PAD_SIZE32
17 #define SI_PAD_SIZE32 (128/sizeof(int) - 3)
18 #endif
19
20 typedef struct compat_siginfo {
21 int si_signo;
22 int si_errno;
23 int si_code;
24
25 union {
26 int _pad[SI_PAD_SIZE32];
27
28 /* kill() */
29 struct {
30 compat_pid_t _pid; /* sender's pid */
31 __compat_uid_t _uid; /* sender's uid */
32 } _kill;
33
34 /* POSIX.1b timers */
35 struct {
36 compat_timer_t _tid; /* timer id */
37 int _overrun; /* overrun count */
38 compat_sigval_t _sigval; /* same as below */
39 int _sys_private; /* not to be passed to user */
40 } _timer;
41
42 /* POSIX.1b signals */
43 struct {
44 compat_pid_t _pid; /* sender's pid */
45 __compat_uid_t _uid; /* sender's uid */
46 compat_sigval_t _sigval;
47 } _rt;
48
49 /* SIGCHLD */
50 struct {
51 compat_pid_t _pid; /* which child */
52 __compat_uid_t _uid; /* sender's uid */
53 int _status; /* exit code */
54 compat_clock_t _utime;
55 compat_clock_t _stime;
56 } _sigchld;
57
58 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
59 struct {
60 unsigned int _addr; /* faulting insn/memory ref. */
61 } _sigfault;
62
63 /* SIGPOLL */
64 struct {
65 int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
66 int _fd;
67 } _sigpoll;
68 } _sifields;
69 } compat_siginfo_t;
70 #endif /* __powerpc64__ */
71
72 #if defined(__s390x__)
73 typedef struct {
74 __u32 ss_sp; /* pointer */
75 int ss_flags;
76 compat_size_t ss_size;
77 } stack_t32;
78
79 typedef struct compat_siginfo {
80 int si_signo;
81 int si_errno;
82 int si_code;
83
84 union {
85 int _pad[128/sizeof(int) - 3];
86
87 /* kill() */
88 struct {
89 pid_t _pid; /* sender's pid */
90 uid_t _uid; /* sender's uid */
91 } _kill;
92
93 /* POSIX.1b timers */
94 struct {
95 compat_timer_t _tid; /* timer id */
96 int _overrun; /* overrun count */
97 compat_sigval_t _sigval; /* same as below */
98 int _sys_private; /* not to be passed to user */
99 } _timer;
100
101 /* POSIX.1b signals */
102 struct {
103 pid_t _pid; /* sender's pid */
104 uid_t _uid; /* sender's uid */
105 compat_sigval_t _sigval;
106 } _rt;
107
108 /* SIGCHLD */
109 struct {
110 pid_t _pid; /* which child */
111 uid_t _uid; /* sender's uid */
112 int _status;/* exit code */
113 compat_clock_t _utime;
114 compat_clock_t _stime;
115 } _sigchld;
116
117 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
118 struct {
119 __u32 _addr; /* faulting insn/memory ref. - pointer */
120 } _sigfault;
121
122 /* SIGPOLL */
123 struct {
124 int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
125 int _fd;
126 } _sigpoll;
127 } _sifields;
128 } compat_siginfo_t;
129 #endif /* __s390x__ */
130
131 #if defined(__x86_64__)
132 // x86_64 has an accessible header.
133 #include <asm/ia32.h>
134 #endif /* __x86_64__ */
135
136 #if defined(__aarch64__)
137 typedef struct compat_siginfo {
138 int si_signo;
139 int si_errno;
140 int si_code;
141
142 union {
143 /* The padding is the same size as AArch64. */
144 int _pad[128/sizeof(int) - 3];
145
146 /* kill() */
147 struct {
148 compat_pid_t _pid; /* sender's pid */
149 __compat_uid32_t _uid; /* sender's uid */
150 } _kill;
151
152 /* POSIX.1b timers */
153 struct {
154 compat_timer_t _tid; /* timer id */
155 int _overrun; /* overrun count */
156 compat_sigval_t _sigval; /* same as below */
157 int _sys_private; /* not to be passed to user */
158 } _timer;
159
160 /* POSIX.1b signals */
161 struct {
162 compat_pid_t _pid; /* sender's pid */
163 __compat_uid32_t _uid; /* sender's uid */
164 compat_sigval_t _sigval;
165 } _rt;
166
167 /* SIGCHLD */
168 struct {
169 compat_pid_t _pid; /* which child */
170 __compat_uid32_t _uid; /* sender's uid */
171 int _status; /* exit code */
172 compat_clock_t _utime;
173 compat_clock_t _stime;
174 } _sigchld;
175
176 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
177 struct {
178 compat_uptr_t _addr; /* faulting insn/memory ref. */
179 short _addr_lsb; /* LSB of the reported address */
180 } _sigfault;
181
182 /* SIGPOLL */
183 struct {
184 compat_long_t _band; /* POLL_IN, POLL_OUT, POLL_MSG */
185 int _fd;
186 } _sigpoll;
187
188 /* SIGSYS */
189 struct {
190 compat_uptr_t _call_addr; /* calling user insn */
191 int _syscall; /* triggering system call number */
192 compat_uint_t _arch; /* AUDIT_ARCH_* of syscall */
193 } _sigsys;
194 } _sifields;
195 } compat_siginfo_t;
196 #endif /* __aarch64__ */
197
198 #endif /* _COMPAT_STRUCTS_H_ */