blob: 02fb0ee26093f53c07c494c3a1766bb267dca0de [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _PPC64_PPC32_H
2#define _PPC64_PPC32_H
3
4#include <linux/compat.h>
5#include <asm/siginfo.h>
6#include <asm/signal.h>
7
8/*
9 * Data types and macros for providing 32b PowerPC support.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
15 */
16
17/* These are here to support 32-bit syscalls on a 64-bit kernel. */
18
Linus Torvalds1da177e2005-04-16 15:20:36 -070019#define __old_sigaction32 old_sigaction32
20
21struct __old_sigaction32 {
Stephen Rothwell81e70092005-10-18 11:17:58 +100022 compat_uptr_t sa_handler;
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 compat_old_sigset_t sa_mask;
24 unsigned int sa_flags;
Stephen Rothwell81e70092005-10-18 11:17:58 +100025 compat_uptr_t sa_restorer; /* not used by Linux/SPARC yet */
Linus Torvalds1da177e2005-04-16 15:20:36 -070026};
27
28
29
30struct sigaction32 {
Stephen Rothwell81e70092005-10-18 11:17:58 +100031 compat_uptr_t sa_handler; /* Really a pointer, but need to deal with 32 bits */
Linus Torvalds1da177e2005-04-16 15:20:36 -070032 unsigned int sa_flags;
Stephen Rothwell81e70092005-10-18 11:17:58 +100033 compat_uptr_t sa_restorer; /* Another 32 bit pointer */
Linus Torvalds1da177e2005-04-16 15:20:36 -070034 compat_sigset_t sa_mask; /* A 32 bit mask */
35};
36
37typedef struct sigaltstack_32 {
38 unsigned int ss_sp;
39 int ss_flags;
40 compat_size_t ss_size;
41} stack_32_t;
42
Stephen Rothwellda80d462005-11-03 15:14:36 +110043struct pt_regs32 {
44 unsigned int gpr[32];
45 unsigned int nip;
46 unsigned int msr;
47 unsigned int orig_gpr3; /* Used for restarting system calls */
48 unsigned int ctr;
49 unsigned int link;
50 unsigned int xer;
51 unsigned int ccr;
52 unsigned int mq; /* 601 only (not used at present) */
53 unsigned int trap; /* Reason for being here */
54 unsigned int dar; /* Fault registers */
55 unsigned int dsisr;
56 unsigned int result; /* Result of a system call */
57};
58
Linus Torvalds1da177e2005-04-16 15:20:36 -070059struct sigcontext32 {
60 unsigned int _unused[4];
61 int signal;
Stephen Rothwell81e70092005-10-18 11:17:58 +100062 compat_uptr_t handler;
Linus Torvalds1da177e2005-04-16 15:20:36 -070063 unsigned int oldmask;
Stephen Rothwell81e70092005-10-18 11:17:58 +100064 compat_uptr_t regs; /* 4 byte pointer to the pt_regs32 structure. */
Linus Torvalds1da177e2005-04-16 15:20:36 -070065};
66
67struct mcontext32 {
68 elf_gregset_t32 mc_gregs;
69 elf_fpregset_t mc_fregs;
70 unsigned int mc_pad[2];
71 elf_vrregset_t32 mc_vregs __attribute__((__aligned__(16)));
Michael Neulingce48b212008-06-25 14:07:18 +100072 elf_vsrreghalf_t32 mc_vsregs __attribute__((__aligned__(16)));
Linus Torvalds1da177e2005-04-16 15:20:36 -070073};
74
75struct ucontext32 {
76 unsigned int uc_flags;
77 unsigned int uc_link;
78 stack_32_t uc_stack;
79 int uc_pad[7];
Stephen Rothwell81e70092005-10-18 11:17:58 +100080 compat_uptr_t uc_regs; /* points to uc_mcontext field */
Linus Torvalds1da177e2005-04-16 15:20:36 -070081 compat_sigset_t uc_sigmask; /* mask last for extensibility */
82 /* glibc has 1024-bit signal masks, ours are 64-bit */
83 int uc_maskext[30];
84 int uc_pad2[3];
85 struct mcontext32 uc_mcontext;
86};
87
Linus Torvalds1da177e2005-04-16 15:20:36 -070088#endif /* _PPC64_PPC32_H */