summaryrefslogtreecommitdiff
path: root/src/runtime/defs_windows_arm.go
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2022-12-16 16:54:03 +0100
committerQuim Muntal <quimmuntal@gmail.com>2023-01-24 12:05:07 +0000
commitcf9263dee1bb160f013a080bbda3532a7d35da15 (patch)
treec6743f75c942150fb1685ec1da9f6e874762eae3 /src/runtime/defs_windows_arm.go
parente39c7a37f0f1a992eb65202d05c3148524c5c0ef (diff)
downloadgo-git-cf9263dee1bb160f013a080bbda3532a7d35da15.tar.gz
runtime: factor out windows sigtramp
This CL factors out part of the Windows sigtramp implementation, which was duplicated in all four architectures. The new common code is implemented in Go rather than in assembly, which will make Windows error handling easier to reason and maintain. While here, implement the control flow guard workaround on windows/386, which almost comes for free. Change-Id: I0bf38c28c54793225126e161bd95527a62de05e0 Reviewed-on: https://go-review.googlesource.com/c/go/+/458135 Run-TryBot: Quim Muntal <quimmuntal@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/runtime/defs_windows_arm.go')
-rw-r--r--src/runtime/defs_windows_arm.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/runtime/defs_windows_arm.go b/src/runtime/defs_windows_arm.go
index 370470e35d..21c7991519 100644
--- a/src/runtime/defs_windows_arm.go
+++ b/src/runtime/defs_windows_arm.go
@@ -58,6 +58,11 @@ func (c *context) set_ip(x uintptr) { c.pc = uint32(x) }
func (c *context) set_sp(x uintptr) { c.spr = uint32(x) }
func (c *context) set_lr(x uintptr) { c.lrr = uint32(x) }
+func prepareContextForSigResume(c *context) {
+ c.r0 = c.spr
+ c.r1 = c.pc
+}
+
func dumpregs(r *context) {
print("r0 ", hex(r.r0), "\n")
print("r1 ", hex(r.r1), "\n")