@@ -13,17 +13,11 @@ package syscall
13
13
14
14
import (
15
15
"internal/itoa"
16
+ runtimesyscall "internal/runtime/syscall"
16
17
"runtime"
17
18
"unsafe"
18
19
)
19
20
20
- // N.B. RawSyscall6 is provided via linkname by internal/runtime/syscall.
21
- //
22
- // Errno is uintptr and thus compatible with the internal/runtime/syscall
23
- // definition.
24
-
25
- func RawSyscall6 (trap , a1 , a2 , a3 , a4 , a5 , a6 uintptr ) (r1 , r2 uintptr , err Errno )
26
-
27
21
// Pull in entersyscall/exitsyscall for Syscall/Syscall6.
28
22
//
29
23
// Note that this can't be a push linkname because the runtime already has a
@@ -40,8 +34,7 @@ func runtime_exitsyscall()
40
34
// N.B. For the Syscall functions below:
41
35
//
42
36
// //go:uintptrkeepalive because the uintptr argument may be converted pointers
43
- // that need to be kept alive in the caller (this is implied for RawSyscall6
44
- // since it has no body).
37
+ // that need to be kept alive in the caller.
45
38
//
46
39
// //go:nosplit because stack copying does not account for uintptrkeepalive, so
47
40
// the stack must not grow. Stack copying cannot blindly assume that all
@@ -62,6 +55,17 @@ func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {
62
55
return RawSyscall6 (trap , a1 , a2 , a3 , 0 , 0 , 0 )
63
56
}
64
57
58
+ //go:uintptrkeepalive
59
+ //go:nosplit
60
+ //go:norace
61
+ //go:linkname RawSyscall6
62
+ func RawSyscall6 (trap , a1 , a2 , a3 , a4 , a5 , a6 uintptr ) (r1 , r2 uintptr , err Errno ) {
63
+ var errno uintptr
64
+ r1 , r2 , errno = runtimesyscall .Syscall6 (trap , a1 , a2 , a3 , a4 , a5 , a6 )
65
+ err = Errno (errno )
66
+ return
67
+ }
68
+
65
69
//go:uintptrkeepalive
66
70
//go:nosplit
67
71
//go:linkname Syscall
0 commit comments