...
Source file src/runtime/defs_darwin_386.go
1
2
3
4 package runtime
5
6 import "unsafe"
7
8 const (
9 _EINTR = 0x4
10 _EFAULT = 0xe
11 _ETIMEDOUT = 0x3c
12
13 _PROT_NONE = 0x0
14 _PROT_READ = 0x1
15 _PROT_WRITE = 0x2
16 _PROT_EXEC = 0x4
17
18 _MAP_ANON = 0x1000
19 _MAP_PRIVATE = 0x2
20 _MAP_FIXED = 0x10
21
22 _MADV_DONTNEED = 0x4
23 _MADV_FREE = 0x5
24 _MADV_FREE_REUSABLE = 0x7
25 _MADV_FREE_REUSE = 0x8
26
27 _SA_SIGINFO = 0x40
28 _SA_RESTART = 0x2
29 _SA_ONSTACK = 0x1
30 _SA_USERTRAMP = 0x100
31 _SA_64REGSET = 0x200
32
33 _SIGHUP = 0x1
34 _SIGINT = 0x2
35 _SIGQUIT = 0x3
36 _SIGILL = 0x4
37 _SIGTRAP = 0x5
38 _SIGABRT = 0x6
39 _SIGEMT = 0x7
40 _SIGFPE = 0x8
41 _SIGKILL = 0x9
42 _SIGBUS = 0xa
43 _SIGSEGV = 0xb
44 _SIGSYS = 0xc
45 _SIGPIPE = 0xd
46 _SIGALRM = 0xe
47 _SIGTERM = 0xf
48 _SIGURG = 0x10
49 _SIGSTOP = 0x11
50 _SIGTSTP = 0x12
51 _SIGCONT = 0x13
52 _SIGCHLD = 0x14
53 _SIGTTIN = 0x15
54 _SIGTTOU = 0x16
55 _SIGIO = 0x17
56 _SIGXCPU = 0x18
57 _SIGXFSZ = 0x19
58 _SIGVTALRM = 0x1a
59 _SIGPROF = 0x1b
60 _SIGWINCH = 0x1c
61 _SIGINFO = 0x1d
62 _SIGUSR1 = 0x1e
63 _SIGUSR2 = 0x1f
64
65 _FPE_INTDIV = 0x7
66 _FPE_INTOVF = 0x8
67 _FPE_FLTDIV = 0x1
68 _FPE_FLTOVF = 0x2
69 _FPE_FLTUND = 0x3
70 _FPE_FLTRES = 0x4
71 _FPE_FLTINV = 0x5
72 _FPE_FLTSUB = 0x6
73
74 _BUS_ADRALN = 0x1
75 _BUS_ADRERR = 0x2
76 _BUS_OBJERR = 0x3
77
78 _SEGV_MAPERR = 0x1
79 _SEGV_ACCERR = 0x2
80
81 _ITIMER_REAL = 0x0
82 _ITIMER_VIRTUAL = 0x1
83 _ITIMER_PROF = 0x2
84
85 _EV_ADD = 0x1
86 _EV_DELETE = 0x2
87 _EV_CLEAR = 0x20
88 _EV_RECEIPT = 0x40
89 _EV_ERROR = 0x4000
90 _EV_EOF = 0x8000
91 _EVFILT_READ = -0x1
92 _EVFILT_WRITE = -0x2
93
94 _PTHREAD_CREATE_DETACHED = 0x2
95
96 _F_SETFD = 0x2
97 _F_GETFL = 0x3
98 _F_SETFL = 0x4
99 _FD_CLOEXEC = 0x1
100
101 _O_NONBLOCK = 4
102 )
103
104 type stackt struct {
105 ss_sp *byte
106 ss_size uintptr
107 ss_flags int32
108 }
109
110 type sigactiont struct {
111 __sigaction_u [4]byte
112 sa_tramp unsafe.Pointer
113 sa_mask uint32
114 sa_flags int32
115 }
116
117 type usigactiont struct {
118 __sigaction_u [4]byte
119 sa_mask uint32
120 sa_flags int32
121 }
122
123 type siginfo struct {
124 si_signo int32
125 si_errno int32
126 si_code int32
127 si_pid int32
128 si_uid uint32
129 si_status int32
130 si_addr uint32
131 si_value [4]byte
132 si_band int32
133 __pad [7]uint32
134 }
135
136 type timeval struct {
137 tv_sec int32
138 tv_usec int32
139 }
140
141 func (tv *timeval) set_usec(x int32) {
142 tv.tv_usec = x
143 }
144
145 type itimerval struct {
146 it_interval timeval
147 it_value timeval
148 }
149
150 type timespec struct {
151 tv_sec int32
152 tv_nsec int32
153 }
154
155
156 func (ts *timespec) setNsec(ns int64) {
157 ts.tv_sec = timediv(ns, 1e9, &ts.tv_nsec)
158 }
159
160 type fpcontrol struct {
161 pad_cgo_0 [2]byte
162 }
163
164 type fpstatus struct {
165 pad_cgo_0 [2]byte
166 }
167
168 type regmmst struct {
169 mmst_reg [10]int8
170 mmst_rsrv [6]int8
171 }
172
173 type regxmm struct {
174 xmm_reg [16]int8
175 }
176
177 type regs64 struct {
178 rax uint64
179 rbx uint64
180 rcx uint64
181 rdx uint64
182 rdi uint64
183 rsi uint64
184 rbp uint64
185 rsp uint64
186 r8 uint64
187 r9 uint64
188 r10 uint64
189 r11 uint64
190 r12 uint64
191 r13 uint64
192 r14 uint64
193 r15 uint64
194 rip uint64
195 rflags uint64
196 cs uint64
197 fs uint64
198 gs uint64
199 }
200
201 type floatstate64 struct {
202 fpu_reserved [2]int32
203 fpu_fcw fpcontrol
204 fpu_fsw fpstatus
205 fpu_ftw uint8
206 fpu_rsrv1 uint8
207 fpu_fop uint16
208 fpu_ip uint32
209 fpu_cs uint16
210 fpu_rsrv2 uint16
211 fpu_dp uint32
212 fpu_ds uint16
213 fpu_rsrv3 uint16
214 fpu_mxcsr uint32
215 fpu_mxcsrmask uint32
216 fpu_stmm0 regmmst
217 fpu_stmm1 regmmst
218 fpu_stmm2 regmmst
219 fpu_stmm3 regmmst
220 fpu_stmm4 regmmst
221 fpu_stmm5 regmmst
222 fpu_stmm6 regmmst
223 fpu_stmm7 regmmst
224 fpu_xmm0 regxmm
225 fpu_xmm1 regxmm
226 fpu_xmm2 regxmm
227 fpu_xmm3 regxmm
228 fpu_xmm4 regxmm
229 fpu_xmm5 regxmm
230 fpu_xmm6 regxmm
231 fpu_xmm7 regxmm
232 fpu_xmm8 regxmm
233 fpu_xmm9 regxmm
234 fpu_xmm10 regxmm
235 fpu_xmm11 regxmm
236 fpu_xmm12 regxmm
237 fpu_xmm13 regxmm
238 fpu_xmm14 regxmm
239 fpu_xmm15 regxmm
240 fpu_rsrv4 [96]int8
241 fpu_reserved1 int32
242 }
243
244 type exceptionstate64 struct {
245 trapno uint16
246 cpu uint16
247 err uint32
248 faultvaddr uint64
249 }
250
251 type mcontext64 struct {
252 es exceptionstate64
253 ss regs64
254 fs floatstate64
255 }
256
257 type regs32 struct {
258 eax uint32
259 ebx uint32
260 ecx uint32
261 edx uint32
262 edi uint32
263 esi uint32
264 ebp uint32
265 esp uint32
266 ss uint32
267 eflags uint32
268 eip uint32
269 cs uint32
270 ds uint32
271 es uint32
272 fs uint32
273 gs uint32
274 }
275
276 type floatstate32 struct {
277 fpu_reserved [2]int32
278 fpu_fcw fpcontrol
279 fpu_fsw fpstatus
280 fpu_ftw uint8
281 fpu_rsrv1 uint8
282 fpu_fop uint16
283 fpu_ip uint32
284 fpu_cs uint16
285 fpu_rsrv2 uint16
286 fpu_dp uint32
287 fpu_ds uint16
288 fpu_rsrv3 uint16
289 fpu_mxcsr uint32
290 fpu_mxcsrmask uint32
291 fpu_stmm0 regmmst
292 fpu_stmm1 regmmst
293 fpu_stmm2 regmmst
294 fpu_stmm3 regmmst
295 fpu_stmm4 regmmst
296 fpu_stmm5 regmmst
297 fpu_stmm6 regmmst
298 fpu_stmm7 regmmst
299 fpu_xmm0 regxmm
300 fpu_xmm1 regxmm
301 fpu_xmm2 regxmm
302 fpu_xmm3 regxmm
303 fpu_xmm4 regxmm
304 fpu_xmm5 regxmm
305 fpu_xmm6 regxmm
306 fpu_xmm7 regxmm
307 fpu_rsrv4 [224]int8
308 fpu_reserved1 int32
309 }
310
311 type exceptionstate32 struct {
312 trapno uint16
313 cpu uint16
314 err uint32
315 faultvaddr uint32
316 }
317
318 type mcontext32 struct {
319 es exceptionstate32
320 ss regs32
321 fs floatstate32
322 }
323
324 type ucontext struct {
325 uc_onstack int32
326 uc_sigmask uint32
327 uc_stack stackt
328 uc_link *ucontext
329 uc_mcsize uint32
330 uc_mcontext *mcontext32
331 }
332
333 type keventt struct {
334 ident uint32
335 filter int16
336 flags uint16
337 fflags uint32
338 data int32
339 udata *byte
340 }
341
342 type pthread uintptr
343 type pthreadattr struct {
344 X__sig int32
345 X__opaque [36]int8
346 }
347 type pthreadmutex struct {
348 X__sig int32
349 X__opaque [40]int8
350 }
351 type pthreadmutexattr struct {
352 X__sig int32
353 X__opaque [8]int8
354 }
355 type pthreadcond struct {
356 X__sig int32
357 X__opaque [24]int8
358 }
359 type pthreadcondattr struct {
360 X__sig int32
361 X__opaque [4]int8
362 }
363 type machTimebaseInfo struct {
364 numer uint32
365 denom uint32
366 }
367
View as plain text