user.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. /* Copyright (C) 2002, 2003, 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. #include <sgidefs.h>
  18. /* The whole purpose of this file is for GDB and GDB only. Don't read
  19. too much into it. Don't use it for anything other than GDB unless
  20. you know what you are doing. */
  21. /* #include <asm/reg.h> */
  22. /* Instead of including the kernel header, that will vary depending on
  23. whether the 32- or the 64-bit kernel is installed, we paste its
  24. contents here. Note that the fact that the file is inline here,
  25. instead of included separately, doesn't change in any way the
  26. licensing status of a program that includes user.h. Since this is
  27. for gdb alone, and gdb is GPLed, no surprises here. */
  28. #if _MIPS_SIM == _ABIO32
  29. /*
  30. * Various register offset definitions for debuggers, core file
  31. * examiners and whatnot.
  32. *
  33. * This file is subject to the terms and conditions of the GNU General Public
  34. * License. See the file "COPYING" in the main directory of this archive
  35. * for more details.
  36. *
  37. * Copyright (C) 1995, 1999 by Ralf Baechle
  38. */
  39. #ifndef __ASM_MIPS_REG_H
  40. #define __ASM_MIPS_REG_H
  41. /*
  42. * This defines/structures correspond to the register layout on stack -
  43. * if the order here is changed, it needs to be updated in
  44. * include/asm-mips/stackframe.h
  45. */
  46. #define EF_REG0 6
  47. #define EF_REG1 7
  48. #define EF_REG2 8
  49. #define EF_REG3 9
  50. #define EF_REG4 10
  51. #define EF_REG5 11
  52. #define EF_REG6 12
  53. #define EF_REG7 13
  54. #define EF_REG8 14
  55. #define EF_REG9 15
  56. #define EF_REG10 16
  57. #define EF_REG11 17
  58. #define EF_REG12 18
  59. #define EF_REG13 19
  60. #define EF_REG14 20
  61. #define EF_REG15 21
  62. #define EF_REG16 22
  63. #define EF_REG17 23
  64. #define EF_REG18 24
  65. #define EF_REG19 25
  66. #define EF_REG20 26
  67. #define EF_REG21 27
  68. #define EF_REG22 28
  69. #define EF_REG23 29
  70. #define EF_REG24 30
  71. #define EF_REG25 31
  72. /*
  73. * k0/k1 unsaved
  74. */
  75. #define EF_REG28 34
  76. #define EF_REG29 35
  77. #define EF_REG30 36
  78. #define EF_REG31 37
  79. /*
  80. * Saved special registers
  81. */
  82. #define EF_LO 38
  83. #define EF_HI 39
  84. #define EF_CP0_EPC 40
  85. #define EF_CP0_BADVADDR 41
  86. #define EF_CP0_STATUS 42
  87. #define EF_CP0_CAUSE 43
  88. #define EF_SIZE 180 /* size in bytes */
  89. #endif /* __ASM_MIPS_REG_H */
  90. #else /* _MIPS_SIM != _ABIO32 */
  91. /*
  92. * Various register offset definitions for debuggers, core file
  93. * examiners and whatnot.
  94. *
  95. * This file is subject to the terms and conditions of the GNU General Public
  96. * License. See the file "COPYING" in the main directory of this archive
  97. * for more details.
  98. *
  99. * Copyright (C) 1995, 1999 Ralf Baechle
  100. * Copyright (C) 1995, 1999 Silicon Graphics
  101. */
  102. #ifndef _ASM_REG_H
  103. #define _ASM_REG_H
  104. /*
  105. * This defines/structures correspond to the register layout on stack -
  106. * if the order here is changed, it needs to be updated in
  107. * include/asm-mips/stackframe.h
  108. */
  109. #define EF_REG0 0
  110. #define EF_REG1 1
  111. #define EF_REG2 2
  112. #define EF_REG3 3
  113. #define EF_REG4 4
  114. #define EF_REG5 5
  115. #define EF_REG6 6
  116. #define EF_REG7 7
  117. #define EF_REG8 8
  118. #define EF_REG9 9
  119. #define EF_REG10 10
  120. #define EF_REG11 11
  121. #define EF_REG12 12
  122. #define EF_REG13 13
  123. #define EF_REG14 14
  124. #define EF_REG15 15
  125. #define EF_REG16 16
  126. #define EF_REG17 17
  127. #define EF_REG18 18
  128. #define EF_REG19 19
  129. #define EF_REG20 20
  130. #define EF_REG21 21
  131. #define EF_REG22 22
  132. #define EF_REG23 23
  133. #define EF_REG24 24
  134. #define EF_REG25 25
  135. /*
  136. * k0/k1 unsaved
  137. */
  138. #define EF_REG28 28
  139. #define EF_REG29 29
  140. #define EF_REG30 30
  141. #define EF_REG31 31
  142. /*
  143. * Saved special registers
  144. */
  145. #define EF_LO 32
  146. #define EF_HI 33
  147. #define EF_CP0_EPC 34
  148. #define EF_CP0_BADVADDR 35
  149. #define EF_CP0_STATUS 36
  150. #define EF_CP0_CAUSE 37
  151. #define EF_SIZE 304 /* size in bytes */
  152. #endif /* _ASM_REG_H */
  153. #endif /* _MIPS_SIM != _ABIO32 */
  154. #if _MIPS_SIM == _ABIO32
  155. struct user
  156. {
  157. unsigned long regs[EF_SIZE/4+64]; /* integer and fp regs */
  158. size_t u_tsize; /* text size (pages) */
  159. size_t u_dsize; /* data size (pages) */
  160. size_t u_ssize; /* stack size (pages) */
  161. unsigned long start_code; /* text starting address */
  162. unsigned long start_data; /* data starting address */
  163. unsigned long start_stack; /* stack starting address */
  164. long int signal; /* signal causing core dump */
  165. void* u_ar0; /* help gdb find registers */
  166. unsigned long magic; /* identifies a core file */
  167. char u_comm[32]; /* user command name */
  168. };
  169. #else
  170. struct user {
  171. __extension__ unsigned long regs[EF_SIZE/8+64]; /* integer and fp regs */
  172. __extension__ unsigned long u_tsize; /* text size (pages) */
  173. __extension__ unsigned long u_dsize; /* data size (pages) */
  174. __extension__ unsigned long u_ssize; /* stack size (pages) */
  175. __extension__ unsigned long long start_code; /* text starting address */
  176. __extension__ unsigned long long start_data; /* data starting address */
  177. __extension__ unsigned long long start_stack; /* stack starting address */
  178. __extension__ long long signal; /* signal causing core dump */
  179. __extension__ unsigned long long u_ar0; /* help gdb find registers */
  180. __extension__ unsigned long long magic; /* identifies a core file */
  181. char u_comm[32]; /* user command name */
  182. };
  183. #endif
  184. #include <bits/uClibc_page.h>
  185. #define NBPG PAGE_SIZE
  186. #define UPAGES 1
  187. #define HOST_TEXT_START_ADDR (u.start_code)
  188. #define HOST_DATA_START_ADDR (u.start_data)
  189. #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
  190. #endif /* _SYS_USER_H */