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/*
8Input to cgo -cdefs
9
10GOARCH=ppc64 cgo -cdefs defs_linux.go defs3_linux.go > defs_linux_ppc64.h
11*/
12
13package 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*/
22import "C"
23
24const (
25	O_RDONLY    = C.O_RDONLY
26	O_CLOEXEC   = C.O_CLOEXEC
27	SA_RESTORER = 0 // unused
28)
29
30type Usigset C.__sigset_t
31
32// types used in sigcontext
33type Ptregs C.struct_pt_regs
34type Gregset C.elf_gregset_t
35type FPregset C.elf_fpregset_t
36type Vreg C.elf_vrreg_t
37
38type 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
42type Sigcontext C.struct_sigcontext
43type Ucontext C.struct_ucontext
44