Source file src/runtime/cgo/cgo_aix.go
1 // Copyright 2026 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build goexperiment.runtimecgopurego && !msan && !tsan && aix 6 7 package cgo 8 9 import "unsafe" 10 11 const ( 12 _SIG_SETMASK = 2 13 _EAGAIN = 11 14 _PTHREAD_CREATE_DETACHED = 1 15 ) 16 17 // On AIX, C function pointers are 24-byte XCOFF function descriptors 18 // defined via DEFINE_PPC64X_FUNCDESC in asm_unix_ppc64x.s. 19 var cgoCallTrampoline uintptr 20 var pthreadKeyDestructor uintptr 21 var x_cgo_threadentry uintptr 22 23 //go:nosplit 24 //go:norace 25 func cgoCallTrampolinePC() unsafe.Pointer { 26 return unsafe.Pointer(&cgoCallTrampoline) 27 } 28 29 //go:nosplit 30 //go:norace 31 func pthreadKeyDestructorPC() uintptr { 32 return uintptr(unsafe.Pointer(&pthreadKeyDestructor)) 33 } 34 35 //go:nosplit 36 //go:norace 37 func threadentryPC() uintptr { 38 return uintptr(unsafe.Pointer(&x_cgo_threadentry)) 39 } 40 41 //go:cgo_export_static _GLOBAL__I_65535_0_runtime_cgo 42 43 //go:cgo_ldflag "-Wl,-berok" 44 45 //go:cgo_import_dynamic _cgo_libc_setenv setenv "libc.a/shr_64.o" 46 //go:cgo_import_dynamic _cgo_libc_unsetenv unsetenv "libc.a/shr_64.o" 47 //go:cgo_import_dynamic _cgo_libc_sigfillset sigfillset "libc.a/shr_64.o" 48 //go:cgo_import_dynamic _cgo_libc_pthread_create pthread_create "libpthread.a/shr_xpg5_64.o" 49 //go:cgo_import_dynamic _cgo_libc_pthread_attr_init pthread_attr_init "libpthread.a/shr_xpg5_64.o" 50 //go:cgo_import_dynamic _cgo_libc_pthread_attr_setdetachstate pthread_attr_setdetachstate "libpthread.a/shr_xpg5_64.o" 51 //go:cgo_import_dynamic _cgo_libc_pthread_attr_getstacksize pthread_attr_getstacksize "libpthread.a/shr_xpg5_64.o" 52 //go:cgo_import_dynamic _cgo_libc_pthread_attr_destroy pthread_attr_destroy "libpthread.a/shr_xpg5_64.o" 53 //go:cgo_import_dynamic _cgo_libc_pthread_key_create pthread_key_create "libpthread.a/shr_xpg5_64.o" 54 //go:cgo_import_dynamic _cgo_libc_pthread_setspecific pthread_setspecific "libpthread.a/shr_xpg5_64.o" 55 //go:cgo_import_dynamic _cgo_libc_pthread_sigmask sigthreadmask "libpthread.a/shr_xpg5_64.o" 56