xref: /linux/arch/x86/include/asm/elfcore-compat.h (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
1*7facdc42SAl Viro #ifndef _ASM_X86_ELFCORE_COMPAT_H
2*7facdc42SAl Viro #define _ASM_X86_ELFCORE_COMPAT_H
3*7facdc42SAl Viro 
4*7facdc42SAl Viro #include <asm/user32.h>
5*7facdc42SAl Viro 
6*7facdc42SAl Viro /*
7*7facdc42SAl Viro  * On amd64 we have two 32bit ABIs - i386 and x32.  The latter
8*7facdc42SAl Viro  * has bigger registers, so we use it for compat_elf_regset_t.
9*7facdc42SAl Viro  * The former uses i386_elf_prstatus and PRSTATUS_SIZE/SET_PR_FPVALID
10*7facdc42SAl Viro  * are used to choose the size and location of ->pr_fpvalid of
11*7facdc42SAl Viro  * the layout actually used.
12*7facdc42SAl Viro  */
13*7facdc42SAl Viro typedef struct user_regs_struct compat_elf_gregset_t;
14*7facdc42SAl Viro 
15*7facdc42SAl Viro struct i386_elf_prstatus
16*7facdc42SAl Viro {
17*7facdc42SAl Viro 	struct compat_elf_prstatus_common	common;
18*7facdc42SAl Viro 	struct user_regs_struct32		pr_reg;
19*7facdc42SAl Viro 	compat_int_t			pr_fpvalid;
20*7facdc42SAl Viro };
21*7facdc42SAl Viro 
22*7facdc42SAl Viro #define PRSTATUS_SIZE \
23*7facdc42SAl Viro 	(user_64bit_mode(task_pt_regs(current)) \
24*7facdc42SAl Viro 		? sizeof(struct compat_elf_prstatus) \
25*7facdc42SAl Viro 		: sizeof(struct i386_elf_prstatus))
26*7facdc42SAl Viro #define SET_PR_FPVALID(S) \
27*7facdc42SAl Viro 	(*(user_64bit_mode(task_pt_regs(current)) \
28*7facdc42SAl Viro 		? &(S)->pr_fpvalid 	\
29*7facdc42SAl Viro 		: &((struct i386_elf_prstatus *)(S))->pr_fpvalid) = 1)
30*7facdc42SAl Viro 
31*7facdc42SAl Viro #endif
32