Shenghou Ma | ab29d5b | 2014-08-12 19:50:30 -0400 | [diff] [blame] | 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 | |
Russ Cox | 09d92b6 | 2014-12-05 19:13:20 -0500 | [diff] [blame] | 10 | GOARCH=ppc64 cgo -cdefs defs_linux.go defs3_linux.go > defs_linux_ppc64.h |
Shenghou Ma | ab29d5b | 2014-08-12 19:50:30 -0400 | [diff] [blame] | 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 | |
Ian Lance Taylor | d15295c | 2016-09-25 13:38:54 -0700 | [diff] [blame^] | 38 | type StackT C.stack_t |
Shenghou Ma | ab29d5b | 2014-08-12 19:50:30 -0400 | [diff] [blame] | 39 | |
| 40 | // PPC64 uses sigcontext in place of mcontext in ucontext. |
| 41 | // see http://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 |