blob: 0a1e7c6ea525e6e9d6a258a4c26ec0fa8389ade0 [file] [log] [blame]
Russ Coxad817922014-11-21 10:22:18 -05001// Copyright 2013 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package runtime
6
7import "unsafe"
8
9type sigctxt struct {
10 info *siginfo
11 ctxt unsafe.Pointer
12}
13
14func (c *sigctxt) regs() *excregs386 { return &(*exccontext)(c.ctxt).regs }
15func (c *sigctxt) eax() uint32 { return c.regs().eax }
16func (c *sigctxt) ebx() uint32 { return c.regs().ebx }
17func (c *sigctxt) ecx() uint32 { return c.regs().ecx }
18func (c *sigctxt) edx() uint32 { return c.regs().edx }
19func (c *sigctxt) edi() uint32 { return c.regs().edi }
20func (c *sigctxt) esi() uint32 { return c.regs().esi }
21func (c *sigctxt) ebp() uint32 { return c.regs().ebp }
22func (c *sigctxt) esp() uint32 { return c.regs().esp }
23func (c *sigctxt) eip() uint32 { return c.regs().eip }
24func (c *sigctxt) eflags() uint32 { return c.regs().eflags }
25func (c *sigctxt) cs() uint32 { return ^uint32(0) }
26func (c *sigctxt) fs() uint32 { return ^uint32(0) }
27func (c *sigctxt) gs() uint32 { return ^uint32(0) }
28func (c *sigctxt) sigcode() uint32 { return ^uint32(0) }
29func (c *sigctxt) sigaddr() uint32 { return 0 }
30
31func (c *sigctxt) set_eip(x uint32) { c.regs().eip = x }
32func (c *sigctxt) set_esp(x uint32) { c.regs().esp = x }
33func (c *sigctxt) set_sigcode(x uint32) {}
34func (c *sigctxt) set_sigaddr(x uint32) {}