blob: f6bee3e6f4387a60d558420a2003ca46f49fdbdb [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
Stephen Rothwellda80d462005-11-03 15:14:36 +110037struct pt_regs32 {
38 unsigned int gpr[32];
39 unsigned int nip;
40 unsigned int msr;
41 unsigned int orig_gpr3; /* Used for restarting system calls */
42 unsigned int ctr;
43 unsigned int link;
44 unsigned int xer;
45 unsigned int ccr;
46 unsigned int mq; /* 601 only (not used at present) */
47 unsigned int trap; /* Reason for being here */
48 unsigned int dar; /* Fault registers */
49 unsigned int dsisr;
50 unsigned int result; /* Result of a system call */
51};
52
Linus Torvalds1da177e2005-04-16 15:20:36 -070053struct sigcontext32 {
54 unsigned int _unused[4];
55 int signal;
Stephen Rothwell81e70092005-10-18 11:17:58 +100056 compat_uptr_t handler;
Linus Torvalds1da177e2005-04-16 15:20:36 -070057 unsigned int oldmask;
Stephen Rothwell81e70092005-10-18 11:17:58 +100058 compat_uptr_t regs; /* 4 byte pointer to the pt_regs32 structure. */
Linus Torvalds1da177e2005-04-16 15:20:36 -070059};
60
61struct mcontext32 {
62 elf_gregset_t32 mc_gregs;
63 elf_fpregset_t mc_fregs;
64 unsigned int mc_pad[2];
65 elf_vrregset_t32 mc_vregs __attribute__((__aligned__(16)));
Michael Neulingce48b212008-06-25 14:07:18 +100066 elf_vsrreghalf_t32 mc_vsregs __attribute__((__aligned__(16)));
Linus Torvalds1da177e2005-04-16 15:20:36 -070067};
68
69struct ucontext32 {
70 unsigned int uc_flags;
71 unsigned int uc_link;
Al Viro7cce2462012-12-23 03:26:46 -050072 compat_stack_t uc_stack;
Linus Torvalds1da177e2005-04-16 15:20:36 -070073 int uc_pad[7];
Stephen Rothwell81e70092005-10-18 11:17:58 +100074 compat_uptr_t uc_regs; /* points to uc_mcontext field */
Linus Torvalds1da177e2005-04-16 15:20:36 -070075 compat_sigset_t uc_sigmask; /* mask last for extensibility */
76 /* glibc has 1024-bit signal masks, ours are 64-bit */
77 int uc_maskext[30];
78 int uc_pad2[3];
79 struct mcontext32 uc_mcontext;
80};
81
Linus Torvalds1da177e2005-04-16 15:20:36 -070082#endif /* _PPC64_PPC32_H */