From 0b321c9a7c0055dfd3f875dea930a28690659211 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Tue, 8 Feb 2022 16:45:14 -0500 Subject: runtime/internal/syscall: new package for linux Add a generic syscall package for use by the runtime. Eventually we'd like to clean up system calls in the runtime to use more code generation and be moved out of the main runtime package. The implementations of the assembly functions are based on copies of syscall.RawSyscall6, modified slightly for more consistency between arches. e.g., renamed trap to num, always set syscall num register first. For now, this package is just the bare minimum needed for doAllThreadsSyscall to make an arbitrary syscall. For #51087. For #50113. Change-Id: Ibecb5e6303279ce15286759e1cd6a2ddc52f7c72 Reviewed-on: https://go-review.googlesource.com/c/go/+/383999 Trust: Michael Pratt Run-TryBot: Michael Pratt TryBot-Result: Gopher Robot Reviewed-by: Austin Clements --- src/runtime/internal/syscall/syscall_linux.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/runtime/internal/syscall/syscall_linux.go (limited to 'src/runtime/internal/syscall/syscall_linux.go') diff --git a/src/runtime/internal/syscall/syscall_linux.go b/src/runtime/internal/syscall/syscall_linux.go new file mode 100644 index 0000000000..06d5f21e7c --- /dev/null +++ b/src/runtime/internal/syscall/syscall_linux.go @@ -0,0 +1,12 @@ +// Copyright 2022 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package syscall provides the syscall primitives required for the runtime. +package syscall + +// TODO(https://go.dev/issue/51087): This package is incomplete and currently +// only contains very minimal support for Linux. + +// Syscall6 calls system call number 'num' with arguments a1-6. +func Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr) -- cgit v1.3