unix: add syscall trampolines for linux/sparc64 - #292
Open
shalseth wants to merge 1 commit into
Open
Conversation
syscall_unix_gc.go and syscall_linux_gc.go declare Syscall, Syscall6, RawSyscall, RawSyscall6, SyscallNoError and RawSyscallNoError for every gc-built unix target, with the bodies supplied per architecture in assembly. linux/sparc64 has the generated syscall, errno, sysnum and type files and a hand-written syscall_linux_sparc64.go, but no asm_linux_sparc64.s, so the package does not compile there at all, and neither does anything importing it. Add the file in the same shape as the other linux architectures: jump to package syscall's implementations where they exist, and trap directly for the two NoError variants. On SPARC the trap is ta 0x6d, with the syscall number in %g1 and the arguments in %o0-%o5. linux/mkall.go already lists sparc64, noting that it is "not fully supported, but there is enough support already to generate Go type and error definitions". This is the piece that makes that support reachable rather than inert. It is wanted downstream as well: moby/sys#249 adds a sparc64 signal map and was put on hold by its maintainer pending "x/sys/unix implements linux/sparc64 syscalls". Built and tested on an UltraSPARC T4-1 running linux/sparc64 with a gc toolchain that supports the architecture. The package compiles, and being able to run its test suite is what turned up the two bugs fixed in CL 822904 and CL 822906, which account for every failure it shows here bar one that is specific to my kernel build. Updates golang/go#55000
Contributor
|
This PR (HEAD: cd72e3d) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/sys/+/823604. Important tips:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
syscall_unix_gc.go and syscall_linux_gc.go declare Syscall, Syscall6,
RawSyscall, RawSyscall6, SyscallNoError and RawSyscallNoError for every
gc-built unix target, with the bodies supplied per architecture in
assembly. linux/sparc64 has the generated syscall, errno, sysnum and
type files and a hand-written syscall_linux_sparc64.go, but no
asm_linux_sparc64.s, so the package does not compile there at all, and
neither does anything importing it.
Add the file in the same shape as the other linux architectures: jump
to package syscall's implementations where they exist, and trap directly
for the two NoError variants. On SPARC the trap is ta 0x6d, with the
syscall number in %g1 and the arguments in %o0-%o5.
linux/mkall.go already lists sparc64, noting that it is "not fully
supported, but there is enough support already to generate Go type and
error definitions". This is the piece that makes that support reachable
rather than inert.
It is wanted downstream as well: moby/sys#249 adds a sparc64 signal map
and was put on hold by its maintainer pending "x/sys/unix implements
linux/sparc64 syscalls".
Built and tested on an UltraSPARC T4-1 running linux/sparc64 with a gc
toolchain that supports the architecture. The package compiles, and
being able to run its test suite is what turned up the two bugs fixed in
CL 822904 and CL 822906, which account for every failure it shows here
bar one that is specific to my kernel build.
Updates golang/go#55000