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