github.com/m10x/go/src@v0.0.0-20220112094212-ba61592315da/runtime/defs_freebsd_arm64.go (about) 1 // created by cgo -cdefs and then converted to Go 2 // cgo -cdefs defs_freebsd.go 3 4 package runtime 5 6 import "unsafe" 7 8 const ( 9 _NBBY = 0x8 10 _CTL_MAXNAME = 0x18 11 _CPU_LEVEL_WHICH = 0x3 12 _CPU_WHICH_PID = 0x2 13 ) 14 15 const ( 16 _EINTR = 0x4 17 _EFAULT = 0xe 18 _EAGAIN = 0x23 19 _ENOSYS = 0x4e 20 _ETIMEDOUT = 0x3c 21 22 _O_NONBLOCK = 0x4 23 _O_CLOEXEC = 0x100000 24 25 _PROT_NONE = 0x0 26 _PROT_READ = 0x1 27 _PROT_WRITE = 0x2 28 _PROT_EXEC = 0x4 29 30 _MAP_ANON = 0x1000 31 _MAP_SHARED = 0x1 32 _MAP_PRIVATE = 0x2 33 _MAP_FIXED = 0x10 34 35 _MADV_FREE = 0x5 36 37 _SA_SIGINFO = 0x40 38 _SA_RESTART = 0x2 39 _SA_ONSTACK = 0x1 40 41 _CLOCK_MONOTONIC = 0x4 42 _CLOCK_REALTIME = 0x0 43 44 _UMTX_OP_WAIT_UINT = 0xb 45 _UMTX_OP_WAIT_UINT_PRIVATE = 0xf 46 _UMTX_OP_WAKE = 0x3 47 _UMTX_OP_WAKE_PRIVATE = 0x10 48 49 _SIGHUP = 0x1 50 _SIGINT = 0x2 51 _SIGQUIT = 0x3 52 _SIGILL = 0x4 53 _SIGTRAP = 0x5 54 _SIGABRT = 0x6 55 _SIGEMT = 0x7 56 _SIGFPE = 0x8 57 _SIGKILL = 0x9 58 _SIGBUS = 0xa 59 _SIGSEGV = 0xb 60 _SIGSYS = 0xc 61 _SIGPIPE = 0xd 62 _SIGALRM = 0xe 63 _SIGTERM = 0xf 64 _SIGURG = 0x10 65 _SIGSTOP = 0x11 66 _SIGTSTP = 0x12 67 _SIGCONT = 0x13 68 _SIGCHLD = 0x14 69 _SIGTTIN = 0x15 70 _SIGTTOU = 0x16 71 _SIGIO = 0x17 72 _SIGXCPU = 0x18 73 _SIGXFSZ = 0x19 74 _SIGVTALRM = 0x1a 75 _SIGPROF = 0x1b 76 _SIGWINCH = 0x1c 77 _SIGINFO = 0x1d 78 _SIGUSR1 = 0x1e 79 _SIGUSR2 = 0x1f 80 81 _FPE_INTDIV = 0x2 82 _FPE_INTOVF = 0x1 83 _FPE_FLTDIV = 0x3 84 _FPE_FLTOVF = 0x4 85 _FPE_FLTUND = 0x5 86 _FPE_FLTRES = 0x6 87 _FPE_FLTINV = 0x7 88 _FPE_FLTSUB = 0x8 89 90 _BUS_ADRALN = 0x1 91 _BUS_ADRERR = 0x2 92 _BUS_OBJERR = 0x3 93 94 _SEGV_MAPERR = 0x1 95 _SEGV_ACCERR = 0x2 96 97 _ITIMER_REAL = 0x0 98 _ITIMER_VIRTUAL = 0x1 99 _ITIMER_PROF = 0x2 100 101 _EV_ADD = 0x1 102 _EV_DELETE = 0x2 103 _EV_CLEAR = 0x20 104 _EV_RECEIPT = 0x40 105 _EV_ERROR = 0x4000 106 _EV_EOF = 0x8000 107 _EVFILT_READ = -0x1 108 _EVFILT_WRITE = -0x2 109 ) 110 111 type rtprio struct { 112 _type uint16 113 prio uint16 114 } 115 116 type thrparam struct { 117 start_func uintptr 118 arg unsafe.Pointer 119 stack_base uintptr 120 stack_size uintptr 121 tls_base unsafe.Pointer 122 tls_size uintptr 123 child_tid unsafe.Pointer // *int64 124 parent_tid *int64 125 flags int32 126 pad_cgo_0 [4]byte 127 rtp *rtprio 128 spare [3]uintptr 129 } 130 131 type thread int64 // long 132 133 type sigset struct { 134 __bits [4]uint32 135 } 136 137 type stackt struct { 138 ss_sp uintptr 139 ss_size uintptr 140 ss_flags int32 141 pad_cgo_0 [4]byte 142 } 143 144 type siginfo struct { 145 si_signo int32 146 si_errno int32 147 si_code int32 148 si_pid int32 149 si_uid uint32 150 si_status int32 151 si_addr uint64 152 si_value [8]byte 153 _reason [40]byte 154 } 155 156 type gpregs struct { 157 gp_x [30]uint64 158 gp_lr uint64 159 gp_sp uint64 160 gp_elr uint64 161 gp_spsr uint32 162 gp_pad int32 163 } 164 165 type fpregs struct { 166 fp_q [64]uint64 // actually [32]uint128 167 fp_sr uint32 168 fp_cr uint32 169 fp_flags int32 170 fp_pad int32 171 } 172 173 type mcontext struct { 174 mc_gpregs gpregs 175 mc_fpregs fpregs 176 mc_flags int32 177 mc_pad int32 178 mc_spare [8]uint64 179 } 180 181 type ucontext struct { 182 uc_sigmask sigset 183 uc_mcontext mcontext 184 uc_link *ucontext 185 uc_stack stackt 186 uc_flags int32 187 __spare__ [4]int32 188 pad_cgo_0 [12]byte 189 } 190 191 type timespec struct { 192 tv_sec int64 193 tv_nsec int64 194 } 195 196 //go:nosplit 197 func (ts *timespec) setNsec(ns int64) { 198 ts.tv_sec = ns / 1e9 199 ts.tv_nsec = ns % 1e9 200 } 201 202 type timeval struct { 203 tv_sec int64 204 tv_usec int64 205 } 206 207 func (tv *timeval) set_usec(x int32) { 208 tv.tv_usec = int64(x) 209 } 210 211 type itimerval struct { 212 it_interval timeval 213 it_value timeval 214 } 215 216 type umtx_time struct { 217 _timeout timespec 218 _flags uint32 219 _clockid uint32 220 } 221 222 type keventt struct { 223 ident uint64 224 filter int16 225 flags uint16 226 fflags uint32 227 data int64 228 udata *byte 229 } 230 231 type bintime struct { 232 sec int64 233 frac uint64 234 } 235 236 type vdsoTimehands struct { 237 algo uint32 238 gen uint32 239 scale uint64 240 offset_count uint32 241 counter_mask uint32 242 offset bintime 243 boottime bintime 244 physical uint32 245 res [7]uint32 246 } 247 248 type vdsoTimekeep struct { 249 ver uint32 250 enabled uint32 251 current uint32 252 pad_cgo_0 [4]byte 253 } 254 255 const ( 256 _VDSO_TK_VER_CURR = 0x1 257 258 vdsoTimehandsSize = 0x58 259 vdsoTimekeepSize = 0x10 260 )