1// created by cgo -cdefs and then converted to Go 2// cgo -cdefs defs_freebsd.go 3 4package runtime 5 6import "unsafe" 7 8const ( 9 _NBBY = 0x8 10 _CTL_MAXNAME = 0x18 11 _CPU_LEVEL_WHICH = 0x3 12 _CPU_WHICH_PID = 0x2 13) 14 15const ( 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 110type rtprio struct { 111 _type uint16 112 prio uint16 113} 114 115type 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 // *int32 123 parent_tid *int32 124 flags int32 125 rtp *rtprio 126 spare [3]uintptr 127} 128 129type thread int32 // long 130 131type sigset struct { 132 __bits [4]uint32 133} 134 135type stackt struct { 136 ss_sp uintptr 137 ss_size uintptr 138 ss_flags int32 139} 140 141type siginfo struct { 142 si_signo int32 143 si_errno int32 144 si_code int32 145 si_pid int32 146 si_uid uint32 147 si_status int32 148 si_addr uintptr 149 si_value [4]byte 150 _reason [32]byte 151} 152 153type mcontext struct { 154 mc_onstack uint32 155 mc_gs uint32 156 mc_fs uint32 157 mc_es uint32 158 mc_ds uint32 159 mc_edi uint32 160 mc_esi uint32 161 mc_ebp uint32 162 mc_isp uint32 163 mc_ebx uint32 164 mc_edx uint32 165 mc_ecx uint32 166 mc_eax uint32 167 mc_trapno uint32 168 mc_err uint32 169 mc_eip uint32 170 mc_cs uint32 171 mc_eflags uint32 172 mc_esp uint32 173 mc_ss uint32 174 mc_len uint32 175 mc_fpformat uint32 176 mc_ownedfp uint32 177 mc_flags uint32 178 mc_fpstate [128]uint32 179 mc_fsbase uint32 180 mc_gsbase uint32 181 mc_xfpustate uint32 182 mc_xfpustate_len uint32 183 mc_spare2 [4]uint32 184} 185 186type ucontext struct { 187 uc_sigmask sigset 188 uc_mcontext mcontext 189 uc_link *ucontext 190 uc_stack stackt 191 uc_flags int32 192 __spare__ [4]int32 193 pad_cgo_0 [12]byte 194} 195 196type timespec struct { 197 tv_sec int32 198 tv_nsec int32 199} 200 201//go:nosplit 202func (ts *timespec) setNsec(ns int64) { 203 ts.tv_sec = timediv(ns, 1e9, &ts.tv_nsec) 204} 205 206type timeval struct { 207 tv_sec int32 208 tv_usec int32 209} 210 211func (tv *timeval) set_usec(x int32) { 212 tv.tv_usec = x 213} 214 215type itimerval struct { 216 it_interval timeval 217 it_value timeval 218} 219 220type umtx_time struct { 221 _timeout timespec 222 _flags uint32 223 _clockid uint32 224} 225 226type keventt struct { 227 ident uint32 228 filter int16 229 flags uint16 230 fflags uint32 231 data int32 232 udata *byte 233} 234 235type bintime struct { 236 sec int32 237 frac uint64 238} 239 240type vdsoTimehands struct { 241 algo uint32 242 gen uint32 243 scale uint64 244 offset_count uint32 245 counter_mask uint32 246 offset bintime 247 boottime bintime 248 x86_shift uint32 249 x86_hpet_idx uint32 250 res [6]uint32 251} 252 253type vdsoTimekeep struct { 254 ver uint32 255 enabled uint32 256 current uint32 257} 258 259const ( 260 _VDSO_TK_VER_CURR = 0x1 261 262 vdsoTimehandsSize = 0x50 263 vdsoTimekeepSize = 0xc 264) 265