]> Cypherpunks repositories - gostls13.git/commit
runtime/cgo: save and restore X3 (aka GP) for crosscall1 on riscv64
authorJoel Sing <joel@sing.id.au>
Thu, 15 Jul 2021 16:56:08 +0000 (02:56 +1000)
committerIan Lance Taylor <iant@golang.org>
Fri, 17 Sep 2021 18:33:15 +0000 (18:33 +0000)
commit70493b3eb06d10217d9aa346ffff0b4c4f2cc72b
tree6d35f7521a7824b3c8650193aa9f9f5a4a3c0d04
parent6d02ce85840fb7a1a9239d02e02710a008b1657a
runtime/cgo: save and restore X3 (aka GP) for crosscall1 on riscv64

The C code that is calling crosscall1 may depend on the GP register, which Go code
will currently clobber. Save and restore both X3 (aka GP) and X4 (aka TP) in this
code path (note that the Go code does not currently clobber X4, however there is
minimal downside to saving and restoring it here, which then also matches crosscall2).

Updates #47100

Change-Id: Icbb706d7889d5dc59de3efb2b510fa6ea2069496
Reviewed-on: https://go-review.googlesource.com/c/go/+/334870
Trust: Joel Sing <joel@sing.id.au>
Trust: Meng Zhuo <mzh@golangcn.org>
Reviewed-by: Meng Zhuo <mzh@golangcn.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
src/runtime/cgo/gcc_riscv64.S