Skip to content

unix: add syscall trampolines for linux/sparc64 - #292

Open
shalseth wants to merge 1 commit into
golang:masterfrom
shalseth:sparc64-trampolines
Open

unix: add syscall trampolines for linux/sparc64#292
shalseth wants to merge 1 commit into
golang:masterfrom
shalseth:sparc64-trampolines

Conversation

@shalseth

Copy link
Copy Markdown
Contributor

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

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
@gopherbot

Copy link
Copy Markdown
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:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants