github.com/tcnksm/go@v0.0.0-20141208075154-439b32936367/src/runtime/defs_linux_amd64.go (about)

     1  // created by cgo -cdefs and then converted to Go
     2  // cgo -cdefs defs_linux.go defs1_linux.go
     3  
     4  package runtime
     5  
     6  const (
     7  	_EINTR  = 0x4
     8  	_EAGAIN = 0xb
     9  	_ENOMEM = 0xc
    10  
    11  	_PROT_NONE  = 0x0
    12  	_PROT_READ  = 0x1
    13  	_PROT_WRITE = 0x2
    14  	_PROT_EXEC  = 0x4
    15  
    16  	_MAP_ANON    = 0x20
    17  	_MAP_PRIVATE = 0x2
    18  	_MAP_FIXED   = 0x10
    19  
    20  	_MADV_DONTNEED = 0x4
    21  
    22  	_SA_RESTART  = 0x10000000
    23  	_SA_ONSTACK  = 0x8000000
    24  	_SA_RESTORER = 0x4000000
    25  	_SA_SIGINFO  = 0x4
    26  
    27  	_SIGHUP    = 0x1
    28  	_SIGINT    = 0x2
    29  	_SIGQUIT   = 0x3
    30  	_SIGILL    = 0x4
    31  	_SIGTRAP   = 0x5
    32  	_SIGABRT   = 0x6
    33  	_SIGBUS    = 0x7
    34  	_SIGFPE    = 0x8
    35  	_SIGKILL   = 0x9
    36  	_SIGUSR1   = 0xa
    37  	_SIGSEGV   = 0xb
    38  	_SIGUSR2   = 0xc
    39  	_SIGPIPE   = 0xd
    40  	_SIGALRM   = 0xe
    41  	_SIGSTKFLT = 0x10
    42  	_SIGCHLD   = 0x11
    43  	_SIGCONT   = 0x12
    44  	_SIGSTOP   = 0x13
    45  	_SIGTSTP   = 0x14
    46  	_SIGTTIN   = 0x15
    47  	_SIGTTOU   = 0x16
    48  	_SIGURG    = 0x17
    49  	_SIGXCPU   = 0x18
    50  	_SIGXFSZ   = 0x19
    51  	_SIGVTALRM = 0x1a
    52  	_SIGPROF   = 0x1b
    53  	_SIGWINCH  = 0x1c
    54  	_SIGIO     = 0x1d
    55  	_SIGPWR    = 0x1e
    56  	_SIGSYS    = 0x1f
    57  
    58  	_FPE_INTDIV = 0x1
    59  	_FPE_INTOVF = 0x2
    60  	_FPE_FLTDIV = 0x3
    61  	_FPE_FLTOVF = 0x4
    62  	_FPE_FLTUND = 0x5
    63  	_FPE_FLTRES = 0x6
    64  	_FPE_FLTINV = 0x7
    65  	_FPE_FLTSUB = 0x8
    66  
    67  	_BUS_ADRALN = 0x1
    68  	_BUS_ADRERR = 0x2
    69  	_BUS_OBJERR = 0x3
    70  
    71  	_SEGV_MAPERR = 0x1
    72  	_SEGV_ACCERR = 0x2
    73  
    74  	_ITIMER_REAL    = 0x0
    75  	_ITIMER_VIRTUAL = 0x1
    76  	_ITIMER_PROF    = 0x2
    77  
    78  	_EPOLLIN       = 0x1
    79  	_EPOLLOUT      = 0x4
    80  	_EPOLLERR      = 0x8
    81  	_EPOLLHUP      = 0x10
    82  	_EPOLLRDHUP    = 0x2000
    83  	_EPOLLET       = 0x80000000
    84  	_EPOLL_CLOEXEC = 0x80000
    85  	_EPOLL_CTL_ADD = 0x1
    86  	_EPOLL_CTL_DEL = 0x2
    87  	_EPOLL_CTL_MOD = 0x3
    88  )
    89  
    90  type timespec struct {
    91  	tv_sec  int64
    92  	tv_nsec int64
    93  }
    94  
    95  func (ts *timespec) set_sec(x int64) {
    96  	ts.tv_sec = x
    97  }
    98  
    99  func (ts *timespec) set_nsec(x int32) {
   100  	ts.tv_nsec = int64(x)
   101  }
   102  
   103  type timeval struct {
   104  	tv_sec  int64
   105  	tv_usec int64
   106  }
   107  
   108  func (tv *timeval) set_usec(x int32) {
   109  	tv.tv_usec = int64(x)
   110  }
   111  
   112  type sigactiont struct {
   113  	sa_handler  uintptr
   114  	sa_flags    uint64
   115  	sa_restorer uintptr
   116  	sa_mask     uint64
   117  }
   118  
   119  type siginfo struct {
   120  	si_signo int32
   121  	si_errno int32
   122  	si_code  int32
   123  	// below here is a union; si_addr is the only field we use
   124  	si_addr uint64
   125  }
   126  
   127  type itimerval struct {
   128  	it_interval timeval
   129  	it_value    timeval
   130  }
   131  
   132  type epollevent struct {
   133  	events uint32
   134  	data   [8]byte // unaligned uintptr
   135  }
   136  
   137  // created by cgo -cdefs and then converted to Go
   138  // cgo -cdefs defs_linux.go defs1_linux.go
   139  
   140  const (
   141  	_O_RDONLY  = 0x0
   142  	_O_CLOEXEC = 0x80000
   143  )
   144  
   145  type usigset struct {
   146  	__val [16]uint64
   147  }
   148  
   149  type fpxreg struct {
   150  	significand [4]uint16
   151  	exponent    uint16
   152  	padding     [3]uint16
   153  }
   154  
   155  type xmmreg struct {
   156  	element [4]uint32
   157  }
   158  
   159  type fpstate struct {
   160  	cwd       uint16
   161  	swd       uint16
   162  	ftw       uint16
   163  	fop       uint16
   164  	rip       uint64
   165  	rdp       uint64
   166  	mxcsr     uint32
   167  	mxcr_mask uint32
   168  	_st       [8]fpxreg
   169  	_xmm      [16]xmmreg
   170  	padding   [24]uint32
   171  }
   172  
   173  type fpxreg1 struct {
   174  	significand [4]uint16
   175  	exponent    uint16
   176  	padding     [3]uint16
   177  }
   178  
   179  type xmmreg1 struct {
   180  	element [4]uint32
   181  }
   182  
   183  type fpstate1 struct {
   184  	cwd       uint16
   185  	swd       uint16
   186  	ftw       uint16
   187  	fop       uint16
   188  	rip       uint64
   189  	rdp       uint64
   190  	mxcsr     uint32
   191  	mxcr_mask uint32
   192  	_st       [8]fpxreg1
   193  	_xmm      [16]xmmreg1
   194  	padding   [24]uint32
   195  }
   196  
   197  type fpreg1 struct {
   198  	significand [4]uint16
   199  	exponent    uint16
   200  }
   201  
   202  type sigaltstackt struct {
   203  	ss_sp     *byte
   204  	ss_flags  int32
   205  	pad_cgo_0 [4]byte
   206  	ss_size   uintptr
   207  }
   208  
   209  type mcontext struct {
   210  	gregs       [23]uint64
   211  	fpregs      *fpstate
   212  	__reserved1 [8]uint64
   213  }
   214  
   215  type ucontext struct {
   216  	uc_flags     uint64
   217  	uc_link      *ucontext
   218  	uc_stack     sigaltstackt
   219  	uc_mcontext  mcontext
   220  	uc_sigmask   usigset
   221  	__fpregs_mem fpstate
   222  }
   223  
   224  type sigcontext struct {
   225  	r8          uint64
   226  	r9          uint64
   227  	r10         uint64
   228  	r11         uint64
   229  	r12         uint64
   230  	r13         uint64
   231  	r14         uint64
   232  	r15         uint64
   233  	rdi         uint64
   234  	rsi         uint64
   235  	rbp         uint64
   236  	rbx         uint64
   237  	rdx         uint64
   238  	rax         uint64
   239  	rcx         uint64
   240  	rsp         uint64
   241  	rip         uint64
   242  	eflags      uint64
   243  	cs          uint16
   244  	gs          uint16
   245  	fs          uint16
   246  	__pad0      uint16
   247  	err         uint64
   248  	trapno      uint64
   249  	oldmask     uint64
   250  	cr2         uint64
   251  	fpstate     *fpstate1
   252  	__reserved1 [8]uint64
   253  }