github.com/x04/go/src@v0.0.0-20200202162449-3d481ceb3525/runtime/defs_windows_arm.go (about)

     1  // Copyright 2018 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 (
     8  	_PROT_NONE	= 0
     9  	_PROT_READ	= 1
    10  	_PROT_WRITE	= 2
    11  	_PROT_EXEC	= 4
    12  
    13  	_MAP_ANON	= 1
    14  	_MAP_PRIVATE	= 2
    15  
    16  	_DUPLICATE_SAME_ACCESS		= 0x2
    17  	_THREAD_PRIORITY_HIGHEST	= 0x2
    18  
    19  	_SIGINT			= 0x2
    20  	_SIGTERM		= 0xF
    21  	_CTRL_C_EVENT		= 0x0
    22  	_CTRL_BREAK_EVENT	= 0x1
    23  	_CTRL_CLOSE_EVENT	= 0x2
    24  	_CTRL_LOGOFF_EVENT	= 0x5
    25  	_CTRL_SHUTDOWN_EVENT	= 0x6
    26  
    27  	_CONTEXT_CONTROL	= 0x10001
    28  	_CONTEXT_FULL		= 0x10007
    29  
    30  	_EXCEPTION_ACCESS_VIOLATION	= 0xc0000005
    31  	_EXCEPTION_BREAKPOINT		= 0x80000003
    32  	_EXCEPTION_FLT_DENORMAL_OPERAND	= 0xc000008d
    33  	_EXCEPTION_FLT_DIVIDE_BY_ZERO	= 0xc000008e
    34  	_EXCEPTION_FLT_INEXACT_RESULT	= 0xc000008f
    35  	_EXCEPTION_FLT_OVERFLOW		= 0xc0000091
    36  	_EXCEPTION_FLT_UNDERFLOW	= 0xc0000093
    37  	_EXCEPTION_INT_DIVIDE_BY_ZERO	= 0xc0000094
    38  	_EXCEPTION_INT_OVERFLOW		= 0xc0000095
    39  
    40  	_INFINITE	= 0xffffffff
    41  	_WAIT_TIMEOUT	= 0x102
    42  
    43  	_EXCEPTION_CONTINUE_EXECUTION	= -0x1
    44  	_EXCEPTION_CONTINUE_SEARCH	= 0x0
    45  )
    46  
    47  type systeminfo struct {
    48  	anon0				[4]byte
    49  	dwpagesize			uint32
    50  	lpminimumapplicationaddress	*byte
    51  	lpmaximumapplicationaddress	*byte
    52  	dwactiveprocessormask		uint32
    53  	dwnumberofprocessors		uint32
    54  	dwprocessortype			uint32
    55  	dwallocationgranularity		uint32
    56  	wprocessorlevel			uint16
    57  	wprocessorrevision		uint16
    58  }
    59  
    60  type exceptionrecord struct {
    61  	exceptioncode		uint32
    62  	exceptionflags		uint32
    63  	exceptionrecord		*exceptionrecord
    64  	exceptionaddress	*byte
    65  	numberparameters	uint32
    66  	exceptioninformation	[15]uint32
    67  }
    68  
    69  type neon128 struct {
    70  	low	uint64
    71  	high	int64
    72  }
    73  
    74  type context struct {
    75  	contextflags	uint32
    76  	r0		uint32
    77  	r1		uint32
    78  	r2		uint32
    79  	r3		uint32
    80  	r4		uint32
    81  	r5		uint32
    82  	r6		uint32
    83  	r7		uint32
    84  	r8		uint32
    85  	r9		uint32
    86  	r10		uint32
    87  	r11		uint32
    88  	r12		uint32
    89  
    90  	spr	uint32
    91  	lrr	uint32
    92  	pc	uint32
    93  	cpsr	uint32
    94  
    95  	fpscr	uint32
    96  	padding	uint32
    97  
    98  	floatNeon	[16]neon128
    99  
   100  	bvr		[8]uint32
   101  	bcr		[8]uint32
   102  	wvr		[1]uint32
   103  	wcr		[1]uint32
   104  	padding2	[2]uint32
   105  }
   106  
   107  func (c *context) ip() uintptr	{ return uintptr(c.pc) }
   108  func (c *context) sp() uintptr	{ return uintptr(c.spr) }
   109  func (c *context) lr() uintptr	{ return uintptr(c.lrr) }
   110  
   111  func (c *context) set_ip(x uintptr)	{ c.pc = uint32(x) }
   112  func (c *context) set_sp(x uintptr)	{ c.spr = uint32(x) }
   113  func (c *context) set_lr(x uintptr)	{ c.lrr = uint32(x) }
   114  
   115  func dumpregs(r *context) {
   116  	print("r0   ", hex(r.r0), "\n")
   117  	print("r1   ", hex(r.r1), "\n")
   118  	print("r2   ", hex(r.r2), "\n")
   119  	print("r3   ", hex(r.r3), "\n")
   120  	print("r4   ", hex(r.r4), "\n")
   121  	print("r5   ", hex(r.r5), "\n")
   122  	print("r6   ", hex(r.r6), "\n")
   123  	print("r7   ", hex(r.r7), "\n")
   124  	print("r8   ", hex(r.r8), "\n")
   125  	print("r9   ", hex(r.r9), "\n")
   126  	print("r10  ", hex(r.r10), "\n")
   127  	print("r11  ", hex(r.r11), "\n")
   128  	print("r12  ", hex(r.r12), "\n")
   129  	print("sp   ", hex(r.spr), "\n")
   130  	print("lr   ", hex(r.lrr), "\n")
   131  	print("pc   ", hex(r.pc), "\n")
   132  	print("cpsr ", hex(r.cpsr), "\n")
   133  }
   134  
   135  type overlapped struct {
   136  	internal	uint32
   137  	internalhigh	uint32
   138  	anon0		[8]byte
   139  	hevent		*byte
   140  }
   141  
   142  type memoryBasicInformation struct {
   143  	baseAddress		uintptr
   144  	allocationBase		uintptr
   145  	allocationProtect	uint32
   146  	regionSize		uintptr
   147  	state			uint32
   148  	protect			uint32
   149  	type_			uint32
   150  }
   151  
   152  func stackcheck() {
   153  	// TODO: not implemented on ARM
   154  }