github.com/ebitengine/purego@v0.8.0-alpha.2.0.20240512170805-6cd12240d332/internal/fakecgo/symbols.go (about) 1 // Code generated by 'go generate' with gen.go. DO NOT EDIT. 2 3 // SPDX-License-Identifier: Apache-2.0 4 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors 5 6 //go:build !cgo && (darwin || freebsd || linux) 7 8 package fakecgo 9 10 import ( 11 "syscall" 12 "unsafe" 13 ) 14 15 // setg_trampoline calls setg with the G provided 16 func setg_trampoline(setg uintptr, G uintptr) 17 18 //go:linkname memmove runtime.memmove 19 func memmove(to, from unsafe.Pointer, n uintptr) 20 21 // call5 takes fn the C function and 5 arguments and calls the function with those arguments 22 func call5(fn, a1, a2, a3, a4, a5 uintptr) uintptr 23 24 func malloc(size uintptr) unsafe.Pointer { 25 ret := call5(mallocABI0, uintptr(size), 0, 0, 0, 0) 26 // this indirection is to avoid go vet complaining about possible misuse of unsafe.Pointer 27 return *(*unsafe.Pointer)(unsafe.Pointer(&ret)) 28 } 29 30 func free(ptr unsafe.Pointer) { 31 call5(freeABI0, uintptr(ptr), 0, 0, 0, 0) 32 } 33 34 func setenv(name *byte, value *byte, overwrite int32) int32 { 35 return int32(call5(setenvABI0, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), uintptr(overwrite), 0, 0)) 36 } 37 38 func unsetenv(name *byte) int32 { 39 return int32(call5(unsetenvABI0, uintptr(unsafe.Pointer(name)), 0, 0, 0, 0)) 40 } 41 42 func sigfillset(set *sigset_t) int32 { 43 return int32(call5(sigfillsetABI0, uintptr(unsafe.Pointer(set)), 0, 0, 0, 0)) 44 } 45 46 func nanosleep(ts *syscall.Timespec, rem *syscall.Timespec) int32 { 47 return int32(call5(nanosleepABI0, uintptr(unsafe.Pointer(ts)), uintptr(unsafe.Pointer(rem)), 0, 0, 0)) 48 } 49 50 func abort() { 51 call5(abortABI0, 0, 0, 0, 0, 0) 52 } 53 54 func pthread_attr_init(attr *pthread_attr_t) int32 { 55 return int32(call5(pthread_attr_initABI0, uintptr(unsafe.Pointer(attr)), 0, 0, 0, 0)) 56 } 57 58 func pthread_create(thread *pthread_t, attr *pthread_attr_t, start unsafe.Pointer, arg unsafe.Pointer) int32 { 59 return int32(call5(pthread_createABI0, uintptr(unsafe.Pointer(thread)), uintptr(unsafe.Pointer(attr)), uintptr(start), uintptr(arg), 0)) 60 } 61 62 func pthread_detach(thread pthread_t) int32 { 63 return int32(call5(pthread_detachABI0, uintptr(thread), 0, 0, 0, 0)) 64 } 65 66 func pthread_sigmask(how sighow, ign *sigset_t, oset *sigset_t) int32 { 67 return int32(call5(pthread_sigmaskABI0, uintptr(how), uintptr(unsafe.Pointer(ign)), uintptr(unsafe.Pointer(oset)), 0, 0)) 68 } 69 70 func pthread_self() pthread_t { 71 return pthread_t(call5(pthread_selfABI0, 0, 0, 0, 0, 0)) 72 } 73 74 func pthread_get_stacksize_np(thread pthread_t) size_t { 75 return size_t(call5(pthread_get_stacksize_npABI0, uintptr(thread), 0, 0, 0, 0)) 76 } 77 78 func pthread_attr_getstacksize(attr *pthread_attr_t, stacksize *size_t) int32 { 79 return int32(call5(pthread_attr_getstacksizeABI0, uintptr(unsafe.Pointer(attr)), uintptr(unsafe.Pointer(stacksize)), 0, 0, 0)) 80 } 81 82 func pthread_attr_setstacksize(attr *pthread_attr_t, size size_t) int32 { 83 return int32(call5(pthread_attr_setstacksizeABI0, uintptr(unsafe.Pointer(attr)), uintptr(size), 0, 0, 0)) 84 } 85 86 func pthread_attr_destroy(attr *pthread_attr_t) int32 { 87 return int32(call5(pthread_attr_destroyABI0, uintptr(unsafe.Pointer(attr)), 0, 0, 0, 0)) 88 } 89 90 func pthread_mutex_lock(mutex *pthread_mutex_t) int32 { 91 return int32(call5(pthread_mutex_lockABI0, uintptr(unsafe.Pointer(mutex)), 0, 0, 0, 0)) 92 } 93 94 func pthread_mutex_unlock(mutex *pthread_mutex_t) int32 { 95 return int32(call5(pthread_mutex_unlockABI0, uintptr(unsafe.Pointer(mutex)), 0, 0, 0, 0)) 96 } 97 98 func pthread_cond_broadcast(cond *pthread_cond_t) int32 { 99 return int32(call5(pthread_cond_broadcastABI0, uintptr(unsafe.Pointer(cond)), 0, 0, 0, 0)) 100 } 101 102 func pthread_setspecific(key pthread_key_t, value unsafe.Pointer) int32 { 103 return int32(call5(pthread_setspecificABI0, uintptr(key), uintptr(value), 0, 0, 0)) 104 } 105 106 //go:linkname _malloc _malloc 107 var _malloc uintptr 108 var mallocABI0 = uintptr(unsafe.Pointer(&_malloc)) 109 110 //go:linkname _free _free 111 var _free uintptr 112 var freeABI0 = uintptr(unsafe.Pointer(&_free)) 113 114 //go:linkname _setenv _setenv 115 var _setenv uintptr 116 var setenvABI0 = uintptr(unsafe.Pointer(&_setenv)) 117 118 //go:linkname _unsetenv _unsetenv 119 var _unsetenv uintptr 120 var unsetenvABI0 = uintptr(unsafe.Pointer(&_unsetenv)) 121 122 //go:linkname _sigfillset _sigfillset 123 var _sigfillset uintptr 124 var sigfillsetABI0 = uintptr(unsafe.Pointer(&_sigfillset)) 125 126 //go:linkname _nanosleep _nanosleep 127 var _nanosleep uintptr 128 var nanosleepABI0 = uintptr(unsafe.Pointer(&_nanosleep)) 129 130 //go:linkname _abort _abort 131 var _abort uintptr 132 var abortABI0 = uintptr(unsafe.Pointer(&_abort)) 133 134 //go:linkname _pthread_attr_init _pthread_attr_init 135 var _pthread_attr_init uintptr 136 var pthread_attr_initABI0 = uintptr(unsafe.Pointer(&_pthread_attr_init)) 137 138 //go:linkname _pthread_create _pthread_create 139 var _pthread_create uintptr 140 var pthread_createABI0 = uintptr(unsafe.Pointer(&_pthread_create)) 141 142 //go:linkname _pthread_detach _pthread_detach 143 var _pthread_detach uintptr 144 var pthread_detachABI0 = uintptr(unsafe.Pointer(&_pthread_detach)) 145 146 //go:linkname _pthread_sigmask _pthread_sigmask 147 var _pthread_sigmask uintptr 148 var pthread_sigmaskABI0 = uintptr(unsafe.Pointer(&_pthread_sigmask)) 149 150 //go:linkname _pthread_self _pthread_self 151 var _pthread_self uintptr 152 var pthread_selfABI0 = uintptr(unsafe.Pointer(&_pthread_self)) 153 154 //go:linkname _pthread_get_stacksize_np _pthread_get_stacksize_np 155 var _pthread_get_stacksize_np uintptr 156 var pthread_get_stacksize_npABI0 = uintptr(unsafe.Pointer(&_pthread_get_stacksize_np)) 157 158 //go:linkname _pthread_attr_getstacksize _pthread_attr_getstacksize 159 var _pthread_attr_getstacksize uintptr 160 var pthread_attr_getstacksizeABI0 = uintptr(unsafe.Pointer(&_pthread_attr_getstacksize)) 161 162 //go:linkname _pthread_attr_setstacksize _pthread_attr_setstacksize 163 var _pthread_attr_setstacksize uintptr 164 var pthread_attr_setstacksizeABI0 = uintptr(unsafe.Pointer(&_pthread_attr_setstacksize)) 165 166 //go:linkname _pthread_attr_destroy _pthread_attr_destroy 167 var _pthread_attr_destroy uintptr 168 var pthread_attr_destroyABI0 = uintptr(unsafe.Pointer(&_pthread_attr_destroy)) 169 170 //go:linkname _pthread_mutex_lock _pthread_mutex_lock 171 var _pthread_mutex_lock uintptr 172 var pthread_mutex_lockABI0 = uintptr(unsafe.Pointer(&_pthread_mutex_lock)) 173 174 //go:linkname _pthread_mutex_unlock _pthread_mutex_unlock 175 var _pthread_mutex_unlock uintptr 176 var pthread_mutex_unlockABI0 = uintptr(unsafe.Pointer(&_pthread_mutex_unlock)) 177 178 //go:linkname _pthread_cond_broadcast _pthread_cond_broadcast 179 var _pthread_cond_broadcast uintptr 180 var pthread_cond_broadcastABI0 = uintptr(unsafe.Pointer(&_pthread_cond_broadcast)) 181 182 //go:linkname _pthread_setspecific _pthread_setspecific 183 var _pthread_setspecific uintptr 184 var pthread_setspecificABI0 = uintptr(unsafe.Pointer(&_pthread_setspecific))