1 /*
2  * Copyright (C) 2017 Hangzhou C-SKY Microsystems co.,ltd.
3  *
4  * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB
5  * in this tarball.
6  */
7 
8 #ifndef _SYS_USER_H
9 #define _SYS_USER_H  1
10 
11 struct user_fpregs {
12 	unsigned long  fsr;         /* fpu status reg */
13 	unsigned long  fesr;        /* fpu exception status reg */
14 	unsigned long  fp[32];      /* fpu general regs */
15 };
16 
17 struct user_regs {
18 #if defined(__CSKYABIV2__)
19 	unsigned long int uregs[34];  /* CSKY V2 has 32 general rgister */
20 #else
21 	unsigned long int uregs[18];  /* CSKY V1 has 16 general rgister */
22 #endif
23 };
24 
25 /*
26  * When the kernel dumps core, it starts by dumping the user struct -
27  * this will be used by gdb to figure out where the data and stack segments
28  * are within the file, and what virtual addresses to use.
29  */
30 struct user{
31 /* We start with the registers, to mimic the way that "memory" is returned
32    from the ptrace(3,...) function.  */
33 	struct user_regs    regs; /* Where the registers are actually stored */
34 	int                 u_fpvalid;  /* True if math co-processor being used. */
35 
36 /* The rest of this junk is to help gdb figure out what goes where */
37 	unsigned long int   u_tsize;	/* Text segment size (pages). */
38 	unsigned long int   u_dsize;	/* Data segment size (pages). */
39 	unsigned long int   u_ssize;	/* Stack segment size (pages). */
40 	unsigned long       start_code; /* Starting virtual address of text. */
41 	unsigned long       start_stack;/* Starting virtual address of stack area.
42 					   This is actually the bottom of the stack,
43 					   the top of the stack is always found in
44 					   the esp register.  */
45 	long int            signal;     /* Signal that caused the core dump. */
46 	int                 reserved;	/* No longer used */
47 	struct user_regs *  u_ar0;	/* Used by gdb to help find the values
48 					   for the registers. */
49 	unsigned long       magic;	/* To uniquely identify a core file */
50 	char                u_comm[32];	/* User command that was responsible */
51 	struct user_fpregs  u_fp;
52 	struct user_fpregs* u_fpstate;	/* Math Co-processor pointer. */
53 };
54 
55 #endif /* _SYS_USER_H */
56