github.com/likebike/go--@v0.0.0-20190911215757-0bd925d16e96/go/src/runtime/signal_linux_mipsx.go (about)

     1  // Copyright 2016 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  
     5  // +build linux
     6  // +build mips mipsle
     7  
     8  package runtime
     9  
    10  import "unsafe"
    11  
    12  type sigctxt struct {
    13  	info *siginfo
    14  	ctxt unsafe.Pointer
    15  }
    16  
    17  func (c *sigctxt) regs() *sigcontext { return &(*ucontext)(c.ctxt).uc_mcontext }
    18  func (c *sigctxt) r0() uint32        { return uint32(c.regs().sc_regs[0]) }
    19  func (c *sigctxt) r1() uint32        { return uint32(c.regs().sc_regs[1]) }
    20  func (c *sigctxt) r2() uint32        { return uint32(c.regs().sc_regs[2]) }
    21  func (c *sigctxt) r3() uint32        { return uint32(c.regs().sc_regs[3]) }
    22  func (c *sigctxt) r4() uint32        { return uint32(c.regs().sc_regs[4]) }
    23  func (c *sigctxt) r5() uint32        { return uint32(c.regs().sc_regs[5]) }
    24  func (c *sigctxt) r6() uint32        { return uint32(c.regs().sc_regs[6]) }
    25  func (c *sigctxt) r7() uint32        { return uint32(c.regs().sc_regs[7]) }
    26  func (c *sigctxt) r8() uint32        { return uint32(c.regs().sc_regs[8]) }
    27  func (c *sigctxt) r9() uint32        { return uint32(c.regs().sc_regs[9]) }
    28  func (c *sigctxt) r10() uint32       { return uint32(c.regs().sc_regs[10]) }
    29  func (c *sigctxt) r11() uint32       { return uint32(c.regs().sc_regs[11]) }
    30  func (c *sigctxt) r12() uint32       { return uint32(c.regs().sc_regs[12]) }
    31  func (c *sigctxt) r13() uint32       { return uint32(c.regs().sc_regs[13]) }
    32  func (c *sigctxt) r14() uint32       { return uint32(c.regs().sc_regs[14]) }
    33  func (c *sigctxt) r15() uint32       { return uint32(c.regs().sc_regs[15]) }
    34  func (c *sigctxt) r16() uint32       { return uint32(c.regs().sc_regs[16]) }
    35  func (c *sigctxt) r17() uint32       { return uint32(c.regs().sc_regs[17]) }
    36  func (c *sigctxt) r18() uint32       { return uint32(c.regs().sc_regs[18]) }
    37  func (c *sigctxt) r19() uint32       { return uint32(c.regs().sc_regs[19]) }
    38  func (c *sigctxt) r20() uint32       { return uint32(c.regs().sc_regs[20]) }
    39  func (c *sigctxt) r21() uint32       { return uint32(c.regs().sc_regs[21]) }
    40  func (c *sigctxt) r22() uint32       { return uint32(c.regs().sc_regs[22]) }
    41  func (c *sigctxt) r23() uint32       { return uint32(c.regs().sc_regs[23]) }
    42  func (c *sigctxt) r24() uint32       { return uint32(c.regs().sc_regs[24]) }
    43  func (c *sigctxt) r25() uint32       { return uint32(c.regs().sc_regs[25]) }
    44  func (c *sigctxt) r26() uint32       { return uint32(c.regs().sc_regs[26]) }
    45  func (c *sigctxt) r27() uint32       { return uint32(c.regs().sc_regs[27]) }
    46  func (c *sigctxt) r28() uint32       { return uint32(c.regs().sc_regs[28]) }
    47  func (c *sigctxt) r29() uint32       { return uint32(c.regs().sc_regs[29]) }
    48  func (c *sigctxt) r30() uint32       { return uint32(c.regs().sc_regs[30]) }
    49  func (c *sigctxt) r31() uint32       { return uint32(c.regs().sc_regs[31]) }
    50  func (c *sigctxt) sp() uint32        { return uint32(c.regs().sc_regs[29]) }
    51  func (c *sigctxt) pc() uint32        { return uint32(c.regs().sc_pc) }
    52  func (c *sigctxt) link() uint32      { return uint32(c.regs().sc_regs[31]) }
    53  func (c *sigctxt) lo() uint32        { return uint32(c.regs().sc_mdlo) }
    54  func (c *sigctxt) hi() uint32        { return uint32(c.regs().sc_mdhi) }
    55  
    56  func (c *sigctxt) sigcode() uint32 { return uint32(c.info.si_code) }
    57  func (c *sigctxt) sigaddr() uint32 { return c.info.si_addr }
    58  
    59  func (c *sigctxt) set_r30(x uint32)  { c.regs().sc_regs[30] = uint64(x) }
    60  func (c *sigctxt) set_pc(x uint32)   { c.regs().sc_pc = uint64(x) }
    61  func (c *sigctxt) set_sp(x uint32)   { c.regs().sc_regs[29] = uint64(x) }
    62  func (c *sigctxt) set_link(x uint32) { c.regs().sc_regs[31] = uint64(x) }
    63  
    64  func (c *sigctxt) set_sigcode(x uint32) { c.info.si_code = int32(x) }
    65  func (c *sigctxt) set_sigaddr(x uint32) { c.info.si_addr = x }