github.com/aloncn/graphics-go@v0.0.1/src/runtime/defs_windows_amd64.go (about)

     1  // created by cgo -cdefs and then converted to Go
     2  // cgo -cdefs defs_windows.go
     3  
     4  package runtime
     5  
     6  const (
     7  	_PROT_NONE  = 0
     8  	_PROT_READ  = 1
     9  	_PROT_WRITE = 2
    10  	_PROT_EXEC  = 4
    11  
    12  	_MAP_ANON    = 1
    13  	_MAP_PRIVATE = 2
    14  
    15  	_DUPLICATE_SAME_ACCESS   = 0x2
    16  	_THREAD_PRIORITY_HIGHEST = 0x2
    17  
    18  	_SIGINT           = 0x2
    19  	_CTRL_C_EVENT     = 0x0
    20  	_CTRL_BREAK_EVENT = 0x1
    21  
    22  	_CONTEXT_CONTROL = 0x100001
    23  	_CONTEXT_FULL    = 0x10000b
    24  
    25  	_EXCEPTION_ACCESS_VIOLATION     = 0xc0000005
    26  	_EXCEPTION_BREAKPOINT           = 0x80000003
    27  	_EXCEPTION_FLT_DENORMAL_OPERAND = 0xc000008d
    28  	_EXCEPTION_FLT_DIVIDE_BY_ZERO   = 0xc000008e
    29  	_EXCEPTION_FLT_INEXACT_RESULT   = 0xc000008f
    30  	_EXCEPTION_FLT_OVERFLOW         = 0xc0000091
    31  	_EXCEPTION_FLT_UNDERFLOW        = 0xc0000093
    32  	_EXCEPTION_INT_DIVIDE_BY_ZERO   = 0xc0000094
    33  	_EXCEPTION_INT_OVERFLOW         = 0xc0000095
    34  
    35  	_INFINITE     = 0xffffffff
    36  	_WAIT_TIMEOUT = 0x102
    37  
    38  	_EXCEPTION_CONTINUE_EXECUTION = -0x1
    39  	_EXCEPTION_CONTINUE_SEARCH    = 0x0
    40  )
    41  
    42  type systeminfo struct {
    43  	anon0                       [4]byte
    44  	dwpagesize                  uint32
    45  	lpminimumapplicationaddress *byte
    46  	lpmaximumapplicationaddress *byte
    47  	dwactiveprocessormask       uint64
    48  	dwnumberofprocessors        uint32
    49  	dwprocessortype             uint32
    50  	dwallocationgranularity     uint32
    51  	wprocessorlevel             uint16
    52  	wprocessorrevision          uint16
    53  }
    54  
    55  type exceptionrecord struct {
    56  	exceptioncode        uint32
    57  	exceptionflags       uint32
    58  	exceptionrecord      *exceptionrecord
    59  	exceptionaddress     *byte
    60  	numberparameters     uint32
    61  	pad_cgo_0            [4]byte
    62  	exceptioninformation [15]uint64
    63  }
    64  
    65  type m128a struct {
    66  	low  uint64
    67  	high int64
    68  }
    69  
    70  type context struct {
    71  	p1home               uint64
    72  	p2home               uint64
    73  	p3home               uint64
    74  	p4home               uint64
    75  	p5home               uint64
    76  	p6home               uint64
    77  	contextflags         uint32
    78  	mxcsr                uint32
    79  	segcs                uint16
    80  	segds                uint16
    81  	seges                uint16
    82  	segfs                uint16
    83  	seggs                uint16
    84  	segss                uint16
    85  	eflags               uint32
    86  	dr0                  uint64
    87  	dr1                  uint64
    88  	dr2                  uint64
    89  	dr3                  uint64
    90  	dr6                  uint64
    91  	dr7                  uint64
    92  	rax                  uint64
    93  	rcx                  uint64
    94  	rdx                  uint64
    95  	rbx                  uint64
    96  	rsp                  uint64
    97  	rbp                  uint64
    98  	rsi                  uint64
    99  	rdi                  uint64
   100  	r8                   uint64
   101  	r9                   uint64
   102  	r10                  uint64
   103  	r11                  uint64
   104  	r12                  uint64
   105  	r13                  uint64
   106  	r14                  uint64
   107  	r15                  uint64
   108  	rip                  uint64
   109  	anon0                [512]byte
   110  	vectorregister       [26]m128a
   111  	vectorcontrol        uint64
   112  	debugcontrol         uint64
   113  	lastbranchtorip      uint64
   114  	lastbranchfromrip    uint64
   115  	lastexceptiontorip   uint64
   116  	lastexceptionfromrip uint64
   117  }
   118  
   119  func (c *context) ip() uintptr { return uintptr(c.rip) }
   120  func (c *context) sp() uintptr { return uintptr(c.rsp) }
   121  
   122  func (c *context) setip(x uintptr) { c.rip = uint64(x) }
   123  func (c *context) setsp(x uintptr) { c.rsp = uint64(x) }
   124  
   125  func dumpregs(r *context) {
   126  	print("rax     ", hex(r.rax), "\n")
   127  	print("rbx     ", hex(r.rbx), "\n")
   128  	print("rcx     ", hex(r.rcx), "\n")
   129  	print("rdi     ", hex(r.rdi), "\n")
   130  	print("rsi     ", hex(r.rsi), "\n")
   131  	print("rbp     ", hex(r.rbp), "\n")
   132  	print("rsp     ", hex(r.rsp), "\n")
   133  	print("r8      ", hex(r.r8), "\n")
   134  	print("r9      ", hex(r.r9), "\n")
   135  	print("r10     ", hex(r.r10), "\n")
   136  	print("r11     ", hex(r.r11), "\n")
   137  	print("r12     ", hex(r.r12), "\n")
   138  	print("r13     ", hex(r.r13), "\n")
   139  	print("r14     ", hex(r.r14), "\n")
   140  	print("r15     ", hex(r.r15), "\n")
   141  	print("rip     ", hex(r.rip), "\n")
   142  	print("rflags  ", hex(r.eflags), "\n")
   143  	print("cs      ", hex(r.segcs), "\n")
   144  	print("fs      ", hex(r.segfs), "\n")
   145  	print("gs      ", hex(r.seggs), "\n")
   146  }
   147  
   148  type overlapped struct {
   149  	internal     uint64
   150  	internalhigh uint64
   151  	anon0        [8]byte
   152  	hevent       *byte
   153  }