...

Source file src/runtime/sys_openbsd3.go

Documentation: runtime

		 1  // Copyright 2020 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 openbsd
		 6  // +build openbsd
		 7  
		 8  package runtime
		 9  
		10  import "unsafe"
		11  
		12  // The X versions of syscall expect the libc call to return a 64-bit result.
		13  // Otherwise (the non-X version) expects a 32-bit result.
		14  // This distinction is required because an error is indicated by returning -1,
		15  // and we need to know whether to check 32 or 64 bits of the result.
		16  // (Some libc functions that return 32 bits put junk in the upper 32 bits of AX.)
		17  
		18  //go:linkname syscall_syscall syscall.syscall
		19  //go:nosplit
		20  //go:cgo_unsafe_args
		21  func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2, err uintptr) {
		22  	entersyscall()
		23  	libcCall(unsafe.Pointer(funcPC(syscall)), unsafe.Pointer(&fn))
		24  	exitsyscall()
		25  	return
		26  }
		27  func syscall()
		28  
		29  //go:linkname syscall_syscallX syscall.syscallX
		30  //go:nosplit
		31  //go:cgo_unsafe_args
		32  func syscall_syscallX(fn, a1, a2, a3 uintptr) (r1, r2, err uintptr) {
		33  	entersyscall()
		34  	libcCall(unsafe.Pointer(funcPC(syscallX)), unsafe.Pointer(&fn))
		35  	exitsyscall()
		36  	return
		37  }
		38  func syscallX()
		39  
		40  //go:linkname syscall_syscall6 syscall.syscall6
		41  //go:nosplit
		42  //go:cgo_unsafe_args
		43  func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) {
		44  	entersyscall()
		45  	libcCall(unsafe.Pointer(funcPC(syscall6)), unsafe.Pointer(&fn))
		46  	exitsyscall()
		47  	return
		48  }
		49  func syscall6()
		50  
		51  //go:linkname syscall_syscall6X syscall.syscall6X
		52  //go:nosplit
		53  //go:cgo_unsafe_args
		54  func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) {
		55  	entersyscall()
		56  	libcCall(unsafe.Pointer(funcPC(syscall6X)), unsafe.Pointer(&fn))
		57  	exitsyscall()
		58  	return
		59  }
		60  func syscall6X()
		61  
		62  //go:linkname syscall_syscall10 syscall.syscall10
		63  //go:nosplit
		64  //go:cgo_unsafe_args
		65  func syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2, err uintptr) {
		66  	entersyscall()
		67  	libcCall(unsafe.Pointer(funcPC(syscall10)), unsafe.Pointer(&fn))
		68  	exitsyscall()
		69  	return
		70  }
		71  func syscall10()
		72  
		73  //go:linkname syscall_syscall10X syscall.syscall10X
		74  //go:nosplit
		75  //go:cgo_unsafe_args
		76  func syscall_syscall10X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2, err uintptr) {
		77  	entersyscall()
		78  	libcCall(unsafe.Pointer(funcPC(syscall10X)), unsafe.Pointer(&fn))
		79  	exitsyscall()
		80  	return
		81  }
		82  func syscall10X()
		83  
		84  //go:linkname syscall_rawSyscall syscall.rawSyscall
		85  //go:nosplit
		86  //go:cgo_unsafe_args
		87  func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2, err uintptr) {
		88  	libcCall(unsafe.Pointer(funcPC(syscall)), unsafe.Pointer(&fn))
		89  	return
		90  }
		91  
		92  //go:linkname syscall_rawSyscall6 syscall.rawSyscall6
		93  //go:nosplit
		94  //go:cgo_unsafe_args
		95  func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) {
		96  	libcCall(unsafe.Pointer(funcPC(syscall6)), unsafe.Pointer(&fn))
		97  	return
		98  }
		99  
	 100  //go:linkname syscall_rawSyscall6X syscall.rawSyscall6X
	 101  //go:nosplit
	 102  //go:cgo_unsafe_args
	 103  func syscall_rawSyscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) {
	 104  	libcCall(unsafe.Pointer(funcPC(syscall6X)), unsafe.Pointer(&fn))
	 105  	return
	 106  }
	 107  
	 108  //go:linkname syscall_rawSyscall10X syscall.rawSyscall10X
	 109  //go:nosplit
	 110  //go:cgo_unsafe_args
	 111  func syscall_rawSyscall10X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2, err uintptr) {
	 112  	libcCall(unsafe.Pointer(funcPC(syscall10X)), unsafe.Pointer(&fn))
	 113  	return
	 114  }
	 115  

View as plain text