Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #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 | ||
1da177e4 LT |
19 | #define __old_sigaction32 old_sigaction32 |
20 | ||
21 | struct __old_sigaction32 { | |
81e7009e | 22 | compat_uptr_t sa_handler; |
1da177e4 LT |
23 | compat_old_sigset_t sa_mask; |
24 | unsigned int sa_flags; | |
81e7009e | 25 | compat_uptr_t sa_restorer; /* not used by Linux/SPARC yet */ |
1da177e4 LT |
26 | }; |
27 | ||
28 | ||
29 | ||
30 | struct sigaction32 { | |
81e7009e | 31 | compat_uptr_t sa_handler; /* Really a pointer, but need to deal with 32 bits */ |
1da177e4 | 32 | unsigned int sa_flags; |
81e7009e | 33 | compat_uptr_t sa_restorer; /* Another 32 bit pointer */ |
1da177e4 LT |
34 | compat_sigset_t sa_mask; /* A 32 bit mask */ |
35 | }; | |
36 | ||
37 | typedef struct sigaltstack_32 { | |
38 | unsigned int ss_sp; | |
39 | int ss_flags; | |
40 | compat_size_t ss_size; | |
41 | } stack_32_t; | |
42 | ||
da80d460 SR |
43 | struct 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 | ||
1da177e4 LT |
59 | struct sigcontext32 { |
60 | unsigned int _unused[4]; | |
61 | int signal; | |
81e7009e | 62 | compat_uptr_t handler; |
1da177e4 | 63 | unsigned int oldmask; |
81e7009e | 64 | compat_uptr_t regs; /* 4 byte pointer to the pt_regs32 structure. */ |
1da177e4 LT |
65 | }; |
66 | ||
67 | struct 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))); | |
ce48b210 | 72 | elf_vsrreghalf_t32 mc_vsregs __attribute__((__aligned__(16))); |
1da177e4 LT |
73 | }; |
74 | ||
75 | struct ucontext32 { | |
76 | unsigned int uc_flags; | |
77 | unsigned int uc_link; | |
78 | stack_32_t uc_stack; | |
79 | int uc_pad[7]; | |
81e7009e | 80 | compat_uptr_t uc_regs; /* points to uc_mcontext field */ |
1da177e4 LT |
81 | 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 | ||
88 | #endif /* _PPC64_PPC32_H */ |