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