]> Cypherpunks repositories - gostls13.git/commit
runtime: save and restore CR for ppc64le
authorIan Lance Taylor <iant@golang.org>
Fri, 2 Jun 2017 22:56:35 +0000 (15:56 -0700)
committerIan Lance Taylor <iant@golang.org>
Mon, 5 Jun 2017 19:59:49 +0000 (19:59 +0000)
commitb1af5393d9eaa9360f6d08e36653c383394d8b9a
treeb4708435bfc868997a102f448d039477c7ce17fa
parent555d1e36f97cdb3fa8fc3a354370d27dfe885545
runtime: save and restore CR for ppc64le

C code expects CR2, CR3, and CR4 to be preserved across function calls.
Preserve the entire CR register across function calls in
_rt0_ppc64le_linux_lib and crosscall2. The standard ppc64le call frame
uses 8(R1) as the place to save CR; emulate that.

It's hard to write a reliable test for this as it requires writing C
code that sets CR2, CR3, or CR4 across a call to a Go function.

Change-Id: If39e771a5b574602b848227312e83598fe74eab7
Reviewed-on: https://go-review.googlesource.com/44733
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
src/runtime/cgo/asm_ppc64x.s
src/runtime/rt0_linux_ppc64le.s