user.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /* Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. #ifndef _SYS_USER_H
  16. #define _SYS_USER_H 1
  17. /* The whole purpose of this file is for GDB and GDB only. Don't read
  18. too much into it. Don't use it for anything other than GDB unless
  19. you know what you are doing. */
  20. #include <bits/wordsize.h>
  21. #if __WORDSIZE == 64
  22. struct user_fpregs_struct
  23. {
  24. __uint16_t cwd;
  25. __uint16_t swd;
  26. __uint16_t ftw;
  27. __uint16_t fop;
  28. __uint64_t rip;
  29. __uint64_t rdp;
  30. __uint32_t mxcsr;
  31. __uint32_t mxcr_mask;
  32. __uint32_t st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
  33. __uint32_t xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */
  34. __uint32_t padding[24];
  35. };
  36. struct user_regs_struct
  37. {
  38. unsigned long r15;
  39. unsigned long r14;
  40. unsigned long r13;
  41. unsigned long r12;
  42. unsigned long rbp;
  43. unsigned long rbx;
  44. unsigned long r11;
  45. unsigned long r10;
  46. unsigned long r9;
  47. unsigned long r8;
  48. unsigned long rax;
  49. unsigned long rcx;
  50. unsigned long rdx;
  51. unsigned long rsi;
  52. unsigned long rdi;
  53. unsigned long orig_rax;
  54. unsigned long rip;
  55. unsigned long cs;
  56. unsigned long eflags;
  57. unsigned long rsp;
  58. unsigned long ss;
  59. unsigned long fs_base;
  60. unsigned long gs_base;
  61. unsigned long ds;
  62. unsigned long es;
  63. unsigned long fs;
  64. unsigned long gs;
  65. };
  66. struct user
  67. {
  68. struct user_regs_struct regs;
  69. int u_fpvalid;
  70. struct user_fpregs_struct i387;
  71. unsigned long int u_tsize;
  72. unsigned long int u_dsize;
  73. unsigned long int u_ssize;
  74. unsigned long start_code;
  75. unsigned long start_stack;
  76. long int signal;
  77. int reserved;
  78. struct user_regs_struct* u_ar0;
  79. struct user_fpregs_struct* u_fpstate;
  80. unsigned long int magic;
  81. char u_comm [32];
  82. unsigned long int u_debugreg [8];
  83. };
  84. #else
  85. /* These are the 32-bit x86 structures. */
  86. struct user_fpregs_struct
  87. {
  88. long int cwd;
  89. long int swd;
  90. long int twd;
  91. long int fip;
  92. long int fcs;
  93. long int foo;
  94. long int fos;
  95. long int st_space [20];
  96. };
  97. struct user_fpxregs_struct
  98. {
  99. unsigned short int cwd;
  100. unsigned short int swd;
  101. unsigned short int twd;
  102. unsigned short int fop;
  103. long int fip;
  104. long int fcs;
  105. long int foo;
  106. long int fos;
  107. long int mxcsr;
  108. long int reserved;
  109. long int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
  110. long int xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */
  111. long int padding[56];
  112. };
  113. struct user_regs_struct
  114. {
  115. long int ebx;
  116. long int ecx;
  117. long int edx;
  118. long int esi;
  119. long int edi;
  120. long int ebp;
  121. long int eax;
  122. long int xds;
  123. long int xes;
  124. long int xfs;
  125. long int xgs;
  126. long int orig_eax;
  127. long int eip;
  128. long int xcs;
  129. long int eflags;
  130. long int esp;
  131. long int xss;
  132. };
  133. struct user
  134. {
  135. struct user_regs_struct regs;
  136. int u_fpvalid;
  137. struct user_fpregs_struct i387;
  138. unsigned long int u_tsize;
  139. unsigned long int u_dsize;
  140. unsigned long int u_ssize;
  141. unsigned long start_code;
  142. unsigned long start_stack;
  143. long int signal;
  144. int reserved;
  145. struct user_regs_struct* u_ar0;
  146. struct user_fpregs_struct* u_fpstate;
  147. unsigned long int magic;
  148. char u_comm [32];
  149. int u_debugreg [8];
  150. };
  151. #endif /* __WORDSIZE */
  152. #include <bits/uClibc_page.h>
  153. #define PAGE_SHIFT 12
  154. #define PAGE_SIZE (1UL << PAGE_SHIFT)
  155. #define PAGE_MASK (~(PAGE_SIZE-1))
  156. #define NBPG PAGE_SIZE
  157. #define UPAGES 1
  158. #define HOST_TEXT_START_ADDR (u.start_code)
  159. #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
  160. #endif /* _SYS_USER_H */