github.com/geraldss/go/src@v0.0.0-20210511222824-ac7d0ebfc235/runtime/defs_freebsd_amd64.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 mcontext struct { 157 mc_onstack uint64 158 mc_rdi uint64 159 mc_rsi uint64 160 mc_rdx uint64 161 mc_rcx uint64 162 mc_r8 uint64 163 mc_r9 uint64 164 mc_rax uint64 165 mc_rbx uint64 166 mc_rbp uint64 167 mc_r10 uint64 168 mc_r11 uint64 169 mc_r12 uint64 170 mc_r13 uint64 171 mc_r14 uint64 172 mc_r15 uint64 173 mc_trapno uint32 174 mc_fs uint16 175 mc_gs uint16 176 mc_addr uint64 177 mc_flags uint32 178 mc_es uint16 179 mc_ds uint16 180 mc_err uint64 181 mc_rip uint64 182 mc_cs uint64 183 mc_rflags uint64 184 mc_rsp uint64 185 mc_ss uint64 186 mc_len uint64 187 mc_fpformat uint64 188 mc_ownedfp uint64 189 mc_fpstate [64]uint64 190 mc_fsbase uint64 191 mc_gsbase uint64 192 mc_xfpustate uint64 193 mc_xfpustate_len uint64 194 mc_spare [4]uint64 195 } 196 197 type ucontext struct { 198 uc_sigmask sigset 199 uc_mcontext mcontext 200 uc_link *ucontext 201 uc_stack stackt 202 uc_flags int32 203 __spare__ [4]int32 204 pad_cgo_0 [12]byte 205 } 206 207 type timespec struct { 208 tv_sec int64 209 tv_nsec int64 210 } 211 212 //go:nosplit 213 func (ts *timespec) setNsec(ns int64) { 214 ts.tv_sec = ns / 1e9 215 ts.tv_nsec = ns % 1e9 216 } 217 218 type timeval struct { 219 tv_sec int64 220 tv_usec int64 221 } 222 223 func (tv *timeval) set_usec(x int32) { 224 tv.tv_usec = int64(x) 225 } 226 227 type itimerval struct { 228 it_interval timeval 229 it_value timeval 230 } 231 232 type umtx_time struct { 233 _timeout timespec 234 _flags uint32 235 _clockid uint32 236 } 237 238 type keventt struct { 239 ident uint64 240 filter int16 241 flags uint16 242 fflags uint32 243 data int64 244 udata *byte 245 } 246 247 type bintime struct { 248 sec int64 249 frac uint64 250 } 251 252 type vdsoTimehands struct { 253 algo uint32 254 gen uint32 255 scale uint64 256 offset_count uint32 257 counter_mask uint32 258 offset bintime 259 boottime bintime 260 x86_shift uint32 261 x86_hpet_idx uint32 262 res [6]uint32 263 } 264 265 type vdsoTimekeep struct { 266 ver uint32 267 enabled uint32 268 current uint32 269 pad_cgo_0 [4]byte 270 } 271 272 const ( 273 _VDSO_TK_VER_CURR = 0x1 274 275 vdsoTimehandsSize = 0x58 276 vdsoTimekeepSize = 0x10 277 )