diff options
author | Anthony Martin <ality@pbrane.org> | 2014-12-18 05:05:44 -0800 |
---|---|---|
committer | Anthony Martin <ality@pbrane.org> | 2014-12-30 14:36:15 +0000 |
commit | 3d032d765318cea13b4aaae882135381cde0c11a (patch) | |
tree | d428f952af104ad9ba5781a91e8d5f48ebe91603 /src/runtime/defs_plan9_amd64.go | |
parent | f3de21767e1ea12e9ec30fc1e9a1b60dfc6cb440 (diff) | |
download | go-3d032d765318cea13b4aaae882135381cde0c11a.tar.gz go-3d032d765318cea13b4aaae882135381cde0c11a.zip |
runtime: consolidate arch-specific signal handlers on Plan 9
Change-Id: I4379418853c523fc9aaeb5d6f37bc96117841418
Reviewed-on: https://go-review.googlesource.com/1786
Reviewed-by: David du Colombier <0intro@gmail.com>
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
Diffstat (limited to 'src/runtime/defs_plan9_amd64.go')
-rw-r--r-- | src/runtime/defs_plan9_amd64.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/runtime/defs_plan9_amd64.go b/src/runtime/defs_plan9_amd64.go index 510da0e994..54b4d39076 100644 --- a/src/runtime/defs_plan9_amd64.go +++ b/src/runtime/defs_plan9_amd64.go @@ -32,3 +32,37 @@ type ureg struct { sp uint64 /* sp */ ss uint64 /* old stack segment */ } + +type sigctxt struct { + u *ureg +} + +func (c *sigctxt) pc() uintptr { return uintptr(c.u.ip) } +func (c *sigctxt) sp() uintptr { return uintptr(c.u.sp) } + +func (c *sigctxt) setpc(x uintptr) { c.u.ip = uint64(x) } +func (c *sigctxt) setsp(x uintptr) { c.u.sp = uint64(x) } + +func dumpregs(u *ureg) { + print("ax ", hex(u.ax), "\n") + print("bx ", hex(u.bx), "\n") + print("cx ", hex(u.cx), "\n") + print("dx ", hex(u.dx), "\n") + print("di ", hex(u.di), "\n") + print("si ", hex(u.si), "\n") + print("bp ", hex(u.bp), "\n") + print("sp ", hex(u.sp), "\n") + print("r8 ", hex(u.r8), "\n") + print("r9 ", hex(u.r9), "\n") + print("r10 ", hex(u.r10), "\n") + print("r11 ", hex(u.r11), "\n") + print("r12 ", hex(u.r12), "\n") + print("r13 ", hex(u.r13), "\n") + print("r14 ", hex(u.r14), "\n") + print("r15 ", hex(u.r15), "\n") + print("ip ", hex(u.ip), "\n") + print("flags ", hex(u.flags), "\n") + print("cs ", hex(u.cs), "\n") + print("fs ", hex(u.fs), "\n") + print("gs ", hex(u.gs), "\n") +} |