Source file src/runtime/sys_openbsd3.go

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

View as plain text