github.com/x04/go/src@v0.0.0-20200202162449-3d481ceb3525/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 "github.com/x04/go/src/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 21 _O_NONBLOCK = 0x4 22 _O_CLOEXEC = 0x100000 23 24 _PROT_NONE = 0x0 25 _PROT_READ = 0x1 26 _PROT_WRITE = 0x2 27 _PROT_EXEC = 0x4 28 29 _MAP_ANON = 0x1000 30 _MAP_SHARED = 0x1 31 _MAP_PRIVATE = 0x2 32 _MAP_FIXED = 0x10 33 34 _MADV_FREE = 0x5 35 36 _SA_SIGINFO = 0x40 37 _SA_RESTART = 0x2 38 _SA_ONSTACK = 0x1 39 40 _CLOCK_MONOTONIC = 0x4 41 _CLOCK_REALTIME = 0x0 42 43 _UMTX_OP_WAIT_UINT = 0xb 44 _UMTX_OP_WAIT_UINT_PRIVATE = 0xf 45 _UMTX_OP_WAKE = 0x3 46 _UMTX_OP_WAKE_PRIVATE = 0x10 47 48 _SIGHUP = 0x1 49 _SIGINT = 0x2 50 _SIGQUIT = 0x3 51 _SIGILL = 0x4 52 _SIGTRAP = 0x5 53 _SIGABRT = 0x6 54 _SIGEMT = 0x7 55 _SIGFPE = 0x8 56 _SIGKILL = 0x9 57 _SIGBUS = 0xa 58 _SIGSEGV = 0xb 59 _SIGSYS = 0xc 60 _SIGPIPE = 0xd 61 _SIGALRM = 0xe 62 _SIGTERM = 0xf 63 _SIGURG = 0x10 64 _SIGSTOP = 0x11 65 _SIGTSTP = 0x12 66 _SIGCONT = 0x13 67 _SIGCHLD = 0x14 68 _SIGTTIN = 0x15 69 _SIGTTOU = 0x16 70 _SIGIO = 0x17 71 _SIGXCPU = 0x18 72 _SIGXFSZ = 0x19 73 _SIGVTALRM = 0x1a 74 _SIGPROF = 0x1b 75 _SIGWINCH = 0x1c 76 _SIGINFO = 0x1d 77 _SIGUSR1 = 0x1e 78 _SIGUSR2 = 0x1f 79 80 _FPE_INTDIV = 0x2 81 _FPE_INTOVF = 0x1 82 _FPE_FLTDIV = 0x3 83 _FPE_FLTOVF = 0x4 84 _FPE_FLTUND = 0x5 85 _FPE_FLTRES = 0x6 86 _FPE_FLTINV = 0x7 87 _FPE_FLTSUB = 0x8 88 89 _BUS_ADRALN = 0x1 90 _BUS_ADRERR = 0x2 91 _BUS_OBJERR = 0x3 92 93 _SEGV_MAPERR = 0x1 94 _SEGV_ACCERR = 0x2 95 96 _ITIMER_REAL = 0x0 97 _ITIMER_VIRTUAL = 0x1 98 _ITIMER_PROF = 0x2 99 100 _EV_ADD = 0x1 101 _EV_DELETE = 0x2 102 _EV_CLEAR = 0x20 103 _EV_RECEIPT = 0x40 104 _EV_ERROR = 0x4000 105 _EV_EOF = 0x8000 106 _EVFILT_READ = -0x1 107 _EVFILT_WRITE = -0x2 108 ) 109 110 type rtprio struct { 111 _type uint16 112 prio uint16 113 } 114 115 type thrparam struct { 116 start_func uintptr 117 arg unsafe.Pointer 118 stack_base uintptr 119 stack_size uintptr 120 tls_base unsafe.Pointer 121 tls_size uintptr 122 child_tid unsafe.Pointer // *int64 123 parent_tid *int64 124 flags int32 125 pad_cgo_0 [4]byte 126 rtp *rtprio 127 spare [3]uintptr 128 } 129 130 type thread int64 // long 131 132 type sigset struct { 133 __bits [4]uint32 134 } 135 136 type stackt struct { 137 ss_sp uintptr 138 ss_size uintptr 139 ss_flags int32 140 pad_cgo_0 [4]byte 141 } 142 143 type siginfo struct { 144 si_signo int32 145 si_errno int32 146 si_code int32 147 si_pid int32 148 si_uid uint32 149 si_status int32 150 si_addr uint64 151 si_value [8]byte 152 _reason [40]byte 153 } 154 155 type mcontext struct { 156 mc_onstack uint64 157 mc_rdi uint64 158 mc_rsi uint64 159 mc_rdx uint64 160 mc_rcx uint64 161 mc_r8 uint64 162 mc_r9 uint64 163 mc_rax uint64 164 mc_rbx uint64 165 mc_rbp uint64 166 mc_r10 uint64 167 mc_r11 uint64 168 mc_r12 uint64 169 mc_r13 uint64 170 mc_r14 uint64 171 mc_r15 uint64 172 mc_trapno uint32 173 mc_fs uint16 174 mc_gs uint16 175 mc_addr uint64 176 mc_flags uint32 177 mc_es uint16 178 mc_ds uint16 179 mc_err uint64 180 mc_rip uint64 181 mc_cs uint64 182 mc_rflags uint64 183 mc_rsp uint64 184 mc_ss uint64 185 mc_len uint64 186 mc_fpformat uint64 187 mc_ownedfp uint64 188 mc_fpstate [64]uint64 189 mc_fsbase uint64 190 mc_gsbase uint64 191 mc_xfpustate uint64 192 mc_xfpustate_len uint64 193 mc_spare [4]uint64 194 } 195 196 type ucontext struct { 197 uc_sigmask sigset 198 uc_mcontext mcontext 199 uc_link *ucontext 200 uc_stack stackt 201 uc_flags int32 202 __spare__ [4]int32 203 pad_cgo_0 [12]byte 204 } 205 206 type timespec struct { 207 tv_sec int64 208 tv_nsec int64 209 } 210 211 //go:nosplit 212 func (ts *timespec) setNsec(ns int64) { 213 ts.tv_sec = ns / 1e9 214 ts.tv_nsec = ns % 1e9 215 } 216 217 type timeval struct { 218 tv_sec int64 219 tv_usec int64 220 } 221 222 func (tv *timeval) set_usec(x int32) { 223 tv.tv_usec = int64(x) 224 } 225 226 type itimerval struct { 227 it_interval timeval 228 it_value timeval 229 } 230 231 type umtx_time struct { 232 _timeout timespec 233 _flags uint32 234 _clockid uint32 235 } 236 237 type keventt struct { 238 ident uint64 239 filter int16 240 flags uint16 241 fflags uint32 242 data int64 243 udata *byte 244 } 245 246 type bintime struct { 247 sec int64 248 frac uint64 249 } 250 251 type vdsoTimehands struct { 252 algo uint32 253 gen uint32 254 scale uint64 255 offset_count uint32 256 counter_mask uint32 257 offset bintime 258 boottime bintime 259 x86_shift uint32 260 x86_hpet_idx uint32 261 res [6]uint32 262 } 263 264 type vdsoTimekeep struct { 265 ver uint32 266 enabled uint32 267 current uint32 268 pad_cgo_0 [4]byte 269 } 270 271 const ( 272 _VDSO_TK_VER_CURR = 0x1 273 274 vdsoTimehandsSize = 0x58 275 vdsoTimekeepSize = 0x10 276 )