github.com/megatontech/mynoteforgo@v0.0.0-20200507084910-5d0c6ea6e890/源码/runtime/defs_darwin_arm64.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 pad_cgo_0 [4]byte 103 } 104 105 type sigactiont struct { 106 __sigaction_u [8]byte 107 sa_tramp unsafe.Pointer 108 sa_mask uint32 109 sa_flags int32 110 } 111 112 type usigactiont struct { 113 __sigaction_u [8]byte 114 sa_mask uint32 115 sa_flags int32 116 } 117 118 type siginfo struct { 119 si_signo int32 120 si_errno int32 121 si_code int32 122 si_pid int32 123 si_uid uint32 124 si_status int32 125 si_addr *byte 126 si_value [8]byte 127 si_band int64 128 __pad [7]uint64 129 } 130 131 type timeval struct { 132 tv_sec int64 133 tv_usec int32 134 pad_cgo_0 [4]byte 135 } 136 137 func (tv *timeval) set_usec(x int32) { 138 tv.tv_usec = x 139 } 140 141 type itimerval struct { 142 it_interval timeval 143 it_value timeval 144 } 145 146 type timespec struct { 147 tv_sec int64 148 tv_nsec int64 149 } 150 151 //go:nosplit 152 func (t *timespec) set_nsec(ns int64) { 153 t.tv_sec = ns / 1000000000 154 t.tv_nsec = ns % 1000000000 155 } 156 157 type exceptionstate64 struct { 158 far uint64 // virtual fault addr 159 esr uint32 // exception syndrome 160 exc uint32 // number of arm exception taken 161 } 162 163 type regs64 struct { 164 x [29]uint64 // registers x0 to x28 165 fp uint64 // frame register, x29 166 lr uint64 // link register, x30 167 sp uint64 // stack pointer, x31 168 pc uint64 // program counter 169 cpsr uint32 // current program status register 170 __pad uint32 171 } 172 173 type neonstate64 struct { 174 v [64]uint64 // actually [32]uint128 175 fpsr uint32 176 fpcr uint32 177 } 178 179 type mcontext64 struct { 180 es exceptionstate64 181 ss regs64 182 ns neonstate64 183 } 184 185 type ucontext struct { 186 uc_onstack int32 187 uc_sigmask uint32 188 uc_stack stackt 189 uc_link *ucontext 190 uc_mcsize uint64 191 uc_mcontext *mcontext64 192 } 193 194 type keventt struct { 195 ident uint64 196 filter int16 197 flags uint16 198 fflags uint32 199 data int64 200 udata *byte 201 } 202 203 type pthread uintptr 204 type pthreadattr struct { 205 X__sig int64 206 X__opaque [56]int8 207 } 208 type pthreadmutex struct { 209 X__sig int64 210 X__opaque [56]int8 211 } 212 type pthreadmutexattr struct { 213 X__sig int64 214 X__opaque [8]int8 215 } 216 type pthreadcond struct { 217 X__sig int64 218 X__opaque [40]int8 219 } 220 type pthreadcondattr struct { 221 X__sig int64 222 X__opaque [8]int8 223 } 224 225 type machTimebaseInfo struct { 226 numer uint32 227 denom uint32 228 }