...

Source file src/runtime/defs_plan9_386.go

Documentation: runtime

     1  // Copyright 2014 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  	di    uint32 /* general registers */
    11  	si    uint32 /* ... */
    12  	bp    uint32 /* ... */
    13  	nsp   uint32
    14  	bx    uint32 /* ... */
    15  	dx    uint32 /* ... */
    16  	cx    uint32 /* ... */
    17  	ax    uint32 /* ... */
    18  	gs    uint32 /* data segments */
    19  	fs    uint32 /* ... */
    20  	es    uint32 /* ... */
    21  	ds    uint32 /* ... */
    22  	trap  uint32 /* trap _type */
    23  	ecode uint32 /* error code (or zero) */
    24  	pc    uint32 /* pc */
    25  	cs    uint32 /* old context */
    26  	flags uint32 /* old flags */
    27  	sp    uint32
    28  	ss    uint32 /* old stack segment */
    29  }
    30  
    31  type sigctxt struct {
    32  	u *ureg
    33  }
    34  
    35  //go:nosplit
    36  //go:nowritebarrierrec
    37  func (c *sigctxt) pc() uintptr { return uintptr(c.u.pc) }
    38  
    39  func (c *sigctxt) sp() uintptr { return uintptr(c.u.sp) }
    40  func (c *sigctxt) lr() uintptr { return uintptr(0) }
    41  
    42  func (c *sigctxt) setpc(x uintptr) { c.u.pc = uint32(x) }
    43  func (c *sigctxt) setsp(x uintptr) { c.u.sp = uint32(x) }
    44  func (c *sigctxt) setlr(x uintptr) {}
    45  
    46  func (c *sigctxt) savelr(x uintptr) {}
    47  
    48  func dumpregs(u *ureg) {
    49  	print("ax    ", hex(u.ax), "\n")
    50  	print("bx    ", hex(u.bx), "\n")
    51  	print("cx    ", hex(u.cx), "\n")
    52  	print("dx    ", hex(u.dx), "\n")
    53  	print("di    ", hex(u.di), "\n")
    54  	print("si    ", hex(u.si), "\n")
    55  	print("bp    ", hex(u.bp), "\n")
    56  	print("sp    ", hex(u.sp), "\n")
    57  	print("pc    ", hex(u.pc), "\n")
    58  	print("flags ", hex(u.flags), "\n")
    59  	print("cs    ", hex(u.cs), "\n")
    60  	print("fs    ", hex(u.fs), "\n")
    61  	print("gs    ", hex(u.gs), "\n")
    62  }
    63  
    64  func sigpanictramp()
    65  

View as plain text