18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _ASM_X86_USER32_H
38c2ecf20Sopenharmony_ci#define _ASM_X86_USER32_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci/* IA32 compatible user structures for ptrace.
68c2ecf20Sopenharmony_ci * These should be used for 32bit coredumps too. */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_cistruct user_i387_ia32_struct {
98c2ecf20Sopenharmony_ci	u32	cwd;
108c2ecf20Sopenharmony_ci	u32	swd;
118c2ecf20Sopenharmony_ci	u32	twd;
128c2ecf20Sopenharmony_ci	u32	fip;
138c2ecf20Sopenharmony_ci	u32	fcs;
148c2ecf20Sopenharmony_ci	u32	foo;
158c2ecf20Sopenharmony_ci	u32	fos;
168c2ecf20Sopenharmony_ci	u32	st_space[20];   /* 8*10 bytes for each FP-reg = 80 bytes */
178c2ecf20Sopenharmony_ci};
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci/* FSAVE frame with extensions */
208c2ecf20Sopenharmony_cistruct user32_fxsr_struct {
218c2ecf20Sopenharmony_ci	unsigned short	cwd;
228c2ecf20Sopenharmony_ci	unsigned short	swd;
238c2ecf20Sopenharmony_ci	unsigned short	twd;	/* not compatible to 64bit twd */
248c2ecf20Sopenharmony_ci	unsigned short	fop;
258c2ecf20Sopenharmony_ci	int	fip;
268c2ecf20Sopenharmony_ci	int	fcs;
278c2ecf20Sopenharmony_ci	int	foo;
288c2ecf20Sopenharmony_ci	int	fos;
298c2ecf20Sopenharmony_ci	int	mxcsr;
308c2ecf20Sopenharmony_ci	int	reserved;
318c2ecf20Sopenharmony_ci	int	st_space[32];	/* 8*16 bytes for each FP-reg = 128 bytes */
328c2ecf20Sopenharmony_ci	int	xmm_space[32];	/* 8*16 bytes for each XMM-reg = 128 bytes */
338c2ecf20Sopenharmony_ci	int	padding[56];
348c2ecf20Sopenharmony_ci};
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_cistruct user_regs_struct32 {
378c2ecf20Sopenharmony_ci	__u32 ebx, ecx, edx, esi, edi, ebp, eax;
388c2ecf20Sopenharmony_ci	unsigned short ds, __ds, es, __es;
398c2ecf20Sopenharmony_ci	unsigned short fs, __fs, gs, __gs;
408c2ecf20Sopenharmony_ci	__u32 orig_eax, eip;
418c2ecf20Sopenharmony_ci	unsigned short cs, __cs;
428c2ecf20Sopenharmony_ci	__u32 eflags, esp;
438c2ecf20Sopenharmony_ci	unsigned short ss, __ss;
448c2ecf20Sopenharmony_ci};
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_cistruct user32 {
478c2ecf20Sopenharmony_ci  struct user_regs_struct32 regs; /* Where the registers are actually stored */
488c2ecf20Sopenharmony_ci  int u_fpvalid;		/* True if math co-processor being used. */
498c2ecf20Sopenharmony_ci				/* for this mess. Not yet used. */
508c2ecf20Sopenharmony_ci  struct user_i387_ia32_struct i387;	/* Math Co-processor registers. */
518c2ecf20Sopenharmony_ci/* The rest of this junk is to help gdb figure out what goes where */
528c2ecf20Sopenharmony_ci  __u32 u_tsize;	/* Text segment size (pages). */
538c2ecf20Sopenharmony_ci  __u32 u_dsize;	/* Data segment size (pages). */
548c2ecf20Sopenharmony_ci  __u32 u_ssize;	/* Stack segment size (pages). */
558c2ecf20Sopenharmony_ci  __u32 start_code;     /* Starting virtual address of text. */
568c2ecf20Sopenharmony_ci  __u32 start_stack;	/* Starting virtual address of stack area.
578c2ecf20Sopenharmony_ci				   This is actually the bottom of the stack,
588c2ecf20Sopenharmony_ci				   the top of the stack is always found in the
598c2ecf20Sopenharmony_ci				   esp register.  */
608c2ecf20Sopenharmony_ci  __u32 signal;     		/* Signal that caused the core dump. */
618c2ecf20Sopenharmony_ci  int reserved;			/* No __u32er used */
628c2ecf20Sopenharmony_ci  __u32 u_ar0;	/* Used by gdb to help find the values for */
638c2ecf20Sopenharmony_ci				/* the registers. */
648c2ecf20Sopenharmony_ci  __u32 u_fpstate;	/* Math Co-processor pointer. */
658c2ecf20Sopenharmony_ci  __u32 magic;		/* To uniquely identify a core file */
668c2ecf20Sopenharmony_ci  char u_comm[32];		/* User command that was responsible */
678c2ecf20Sopenharmony_ci  int u_debugreg[8];
688c2ecf20Sopenharmony_ci};
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci#endif /* _ASM_X86_USER32_H */
72