...

Source file src/pkg/runtime/defs3_linux.go

     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	// +build ignore
     6	
     7	/*
     8	Input to cgo -cdefs
     9	
    10	GOARCH=ppc64 cgo -cdefs defs_linux.go defs3_linux.go > defs_linux_ppc64.h
    11	*/
    12	
    13	package runtime
    14	
    15	/*
    16	#define size_t __kernel_size_t
    17	#define sigset_t __sigset_t // rename the sigset_t here otherwise cgo will complain about "inconsistent definitions for C.sigset_t"
    18	#define	_SYS_TYPES_H	// avoid inclusion of sys/types.h
    19	#include <asm/ucontext.h>
    20	#include <asm-generic/fcntl.h>
    21	*/
    22	import "C"
    23	
    24	const (
    25		O_RDONLY    = C.O_RDONLY
    26		O_CLOEXEC   = C.O_CLOEXEC
    27		SA_RESTORER = 0 // unused
    28	)
    29	
    30	type Usigset C.__sigset_t
    31	
    32	// types used in sigcontext
    33	type Ptregs C.struct_pt_regs
    34	type Gregset C.elf_gregset_t
    35	type FPregset C.elf_fpregset_t
    36	type Vreg C.elf_vrreg_t
    37	
    38	type StackT C.stack_t
    39	
    40	// PPC64 uses sigcontext in place of mcontext in ucontext.
    41	// see https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/include/uapi/asm/ucontext.h
    42	type Sigcontext C.struct_sigcontext
    43	type Ucontext C.struct_ucontext
    44	

View as plain text