github.com/hbdrawn/golang@v0.0.0-20141214014649-6b835209aba2/src/runtime/defs_linux_ppc64le.go (about) 1 // created by cgo -cdefs and then converted to Go 2 // cgo -cdefs defs_linux.go defs3_linux.go 3 4 package runtime 5 6 const ( 7 _EINTR = 0x4 8 _EAGAIN = 0xb 9 _ENOMEM = 0xc 10 11 _PROT_NONE = 0x0 12 _PROT_READ = 0x1 13 _PROT_WRITE = 0x2 14 _PROT_EXEC = 0x4 15 16 _MAP_ANON = 0x20 17 _MAP_PRIVATE = 0x2 18 _MAP_FIXED = 0x10 19 20 _MADV_DONTNEED = 0x4 21 22 _SA_RESTART = 0x10000000 23 _SA_ONSTACK = 0x8000000 24 _SA_SIGINFO = 0x4 25 26 _SIGHUP = 0x1 27 _SIGINT = 0x2 28 _SIGQUIT = 0x3 29 _SIGILL = 0x4 30 _SIGTRAP = 0x5 31 _SIGABRT = 0x6 32 _SIGBUS = 0x7 33 _SIGFPE = 0x8 34 _SIGKILL = 0x9 35 _SIGUSR1 = 0xa 36 _SIGSEGV = 0xb 37 _SIGUSR2 = 0xc 38 _SIGPIPE = 0xd 39 _SIGALRM = 0xe 40 _SIGSTKFLT = 0x10 41 _SIGCHLD = 0x11 42 _SIGCONT = 0x12 43 _SIGSTOP = 0x13 44 _SIGTSTP = 0x14 45 _SIGTTIN = 0x15 46 _SIGTTOU = 0x16 47 _SIGURG = 0x17 48 _SIGXCPU = 0x18 49 _SIGXFSZ = 0x19 50 _SIGVTALRM = 0x1a 51 _SIGPROF = 0x1b 52 _SIGWINCH = 0x1c 53 _SIGIO = 0x1d 54 _SIGPWR = 0x1e 55 _SIGSYS = 0x1f 56 57 _FPE_INTDIV = 0x1 58 _FPE_INTOVF = 0x2 59 _FPE_FLTDIV = 0x3 60 _FPE_FLTOVF = 0x4 61 _FPE_FLTUND = 0x5 62 _FPE_FLTRES = 0x6 63 _FPE_FLTINV = 0x7 64 _FPE_FLTSUB = 0x8 65 66 _BUS_ADRALN = 0x1 67 _BUS_ADRERR = 0x2 68 _BUS_OBJERR = 0x3 69 70 _SEGV_MAPERR = 0x1 71 _SEGV_ACCERR = 0x2 72 73 _ITIMER_REAL = 0x0 74 _ITIMER_VIRTUAL = 0x1 75 _ITIMER_PROF = 0x2 76 77 _EPOLLIN = 0x1 78 _EPOLLOUT = 0x4 79 _EPOLLERR = 0x8 80 _EPOLLHUP = 0x10 81 _EPOLLRDHUP = 0x2000 82 _EPOLLET = 0x80000000 83 _EPOLL_CLOEXEC = 0x80000 84 _EPOLL_CTL_ADD = 0x1 85 _EPOLL_CTL_DEL = 0x2 86 _EPOLL_CTL_MOD = 0x3 87 ) 88 89 //struct Sigset { 90 // uint64 sig[1]; 91 //}; 92 //typedef uint64 Sigset; 93 94 type timespec struct { 95 tv_sec int64 96 tv_nsec int64 97 } 98 99 func (ts *timespec) set_sec(x int64) { 100 ts.tv_sec = x 101 } 102 103 func (ts *timespec) set_nsec(x int32) { 104 ts.tv_nsec = int64(x) 105 } 106 107 type timeval struct { 108 tv_sec int64 109 tv_usec int64 110 } 111 112 func (tv *timeval) set_usec(x int32) { 113 tv.tv_usec = int64(x) 114 } 115 116 type sigactiont struct { 117 sa_handler uintptr 118 sa_flags uint64 119 sa_restorer uintptr 120 sa_mask uint64 121 } 122 123 type siginfo struct { 124 si_signo int32 125 si_errno int32 126 si_code int32 127 // below here is a union; si_addr is the only field we use 128 si_addr uint64 129 } 130 131 type itimerval struct { 132 it_interval timeval 133 it_value timeval 134 } 135 136 type epollevent struct { 137 events uint32 138 pad_cgo_0 [4]byte 139 data [8]byte // unaligned uintptr 140 } 141 142 // created by cgo -cdefs and then converted to Go 143 // cgo -cdefs defs_linux.go defs3_linux.go 144 145 const ( 146 _O_RDONLY = 0x0 147 _O_CLOEXEC = 0x80000 148 _SA_RESTORER = 0 149 ) 150 151 type ptregs struct { 152 gpr [32]uint64 153 nip uint64 154 msr uint64 155 orig_gpr3 uint64 156 ctr uint64 157 link uint64 158 xer uint64 159 ccr uint64 160 softe uint64 161 trap uint64 162 dar uint64 163 dsisr uint64 164 result uint64 165 } 166 167 type vreg struct { 168 u [4]uint32 169 } 170 171 type sigaltstackt struct { 172 ss_sp *byte 173 ss_flags int32 174 pad_cgo_0 [4]byte 175 ss_size uintptr 176 } 177 178 type sigcontext struct { 179 _unused [4]uint64 180 signal int32 181 _pad0 int32 182 handler uint64 183 oldmask uint64 184 regs *ptregs 185 gp_regs [48]uint64 186 fp_regs [33]float64 187 v_regs *vreg 188 vmx_reserve [101]int64 189 } 190 191 type ucontext struct { 192 uc_flags uint64 193 uc_link *ucontext 194 uc_stack sigaltstackt 195 uc_sigmask uint64 196 __unused [15]uint64 197 uc_mcontext sigcontext 198 }