github.com/flyinox/gosm@v0.0.0-20171117061539-16768cb62077/src/runtime/defs_plan9_arm.go (about)

     1  // Copyright 2015 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  package runtime
     6  
     7  const _PAGESIZE = 0x1000
     8  
     9  type ureg struct {
    10  	r0   uint32 /* general registers */
    11  	r1   uint32 /* ... */
    12  	r2   uint32 /* ... */
    13  	r3   uint32 /* ... */
    14  	r4   uint32 /* ... */
    15  	r5   uint32 /* ... */
    16  	r6   uint32 /* ... */
    17  	r7   uint32 /* ... */
    18  	r8   uint32 /* ... */
    19  	r9   uint32 /* ... */
    20  	r10  uint32 /* ... */
    21  	r11  uint32 /* ... */
    22  	r12  uint32 /* ... */
    23  	sp   uint32
    24  	link uint32 /* ... */
    25  	trap uint32 /* trap type */
    26  	psr  uint32
    27  	pc   uint32 /* interrupted addr */
    28  }
    29  
    30  type sigctxt struct {
    31  	u *ureg
    32  }
    33  
    34  //go:nosplit
    35  //go:nowritebarrierrec
    36  func (c *sigctxt) pc() uintptr { return uintptr(c.u.pc) }
    37  
    38  func (c *sigctxt) sp() uintptr { return uintptr(c.u.sp) }
    39  func (c *sigctxt) lr() uintptr { return uintptr(c.u.link) }
    40  
    41  func (c *sigctxt) setpc(x uintptr)  { c.u.pc = uint32(x) }
    42  func (c *sigctxt) setsp(x uintptr)  { c.u.sp = uint32(x) }
    43  func (c *sigctxt) setlr(x uintptr)  { c.u.link = uint32(x) }
    44  func (c *sigctxt) savelr(x uintptr) { c.u.r0 = uint32(x) }
    45  
    46  func dumpregs(u *ureg) {
    47  	print("r0    ", hex(u.r0), "\n")
    48  	print("r1    ", hex(u.r1), "\n")
    49  	print("r2    ", hex(u.r2), "\n")
    50  	print("r3    ", hex(u.r3), "\n")
    51  	print("r4    ", hex(u.r4), "\n")
    52  	print("r5    ", hex(u.r5), "\n")
    53  	print("r6    ", hex(u.r6), "\n")
    54  	print("r7    ", hex(u.r7), "\n")
    55  	print("r8    ", hex(u.r8), "\n")
    56  	print("r9    ", hex(u.r9), "\n")
    57  	print("r10   ", hex(u.r10), "\n")
    58  	print("r11   ", hex(u.r11), "\n")
    59  	print("r12   ", hex(u.r12), "\n")
    60  	print("sp    ", hex(u.sp), "\n")
    61  	print("link  ", hex(u.link), "\n")
    62  	print("pc    ", hex(u.pc), "\n")
    63  	print("psr   ", hex(u.psr), "\n")
    64  }
    65  
    66  func sigpanictramp()