user.h 2.0 KB

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