user.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (C) 2016 Andes Technology, Inc.
  3. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  4. */
  5. /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
  6. The GNU C Library is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU Lesser General Public
  8. License as published by the Free Software Foundation; either
  9. version 2.1 of the License, or (at your option) any later version.
  10. The GNU C Library is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. Lesser General Public License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with the GNU C Library; if not, write to the Free
  16. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  17. 02111-1307 USA. */
  18. #ifndef _SYS_USER_H
  19. #define _SYS_USER_H 1
  20. /* The whole purpose of this file is for GDB and GDB only. Don't read
  21. too much into it. Don't use it for anything other than GDB unless
  22. you know what you are doing. */
  23. struct user_fpregs
  24. {
  25. struct fp_reg
  26. {
  27. unsigned int sign1:1;
  28. unsigned int unused:15;
  29. unsigned int sign2:1;
  30. unsigned int exponent:14;
  31. unsigned int j:1;
  32. unsigned int mantissa1:31;
  33. unsigned int mantissa0:32;
  34. } fpregs[8];
  35. unsigned int fpsr:32;
  36. unsigned int fpcr:32;
  37. unsigned char ftype[8];
  38. unsigned int init_flag;
  39. };
  40. struct user_regs
  41. {
  42. unsigned long int uregs[18];
  43. };
  44. struct user
  45. {
  46. struct user_regs regs; /* General registers */
  47. int u_fpvalid; /* True if math co-processor being used. */
  48. unsigned long int u_tsize; /* Text segment size (pages). */
  49. unsigned long int u_dsize; /* Data segment size (pages). */
  50. unsigned long int u_ssize; /* Stack segment size (pages). */
  51. unsigned long start_code; /* Starting virtual address of text. */
  52. unsigned long start_stack; /* Starting virtual address of stack. */
  53. long int signal; /* Signal that caused the core dump. */
  54. int reserved; /* No longer used */
  55. struct user_regs *u_ar0; /* help gdb to find the general registers. */
  56. unsigned long magic; /* uniquely identify a core file */
  57. char u_comm[32]; /* User command that was responsible */
  58. int u_debugreg[8];
  59. struct user_fpregs u_fp; /* Floating point registers */
  60. struct user_fpregs *u_fp0; /* help gdb to find the FP registers. */
  61. };
  62. #include <bits/uClibc_page.h>
  63. #define NBPG PAGE_SIZE
  64. #define UPAGES 1
  65. #define HOST_TEXT_START_ADDR (u.start_code)
  66. #define HOST_DATA_START_ADDR (u.start_data)
  67. #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
  68. #endif /* sys/user.h */