GDB (API)
|
00001 /* Target-dependent code for GNU/Linux on MIPS processors. 00002 00003 Copyright (C) 2006-2013 Free Software Foundation, Inc. 00004 00005 This file is part of GDB. 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00019 00020 /* Copied from <asm/elf.h>. */ 00021 #define ELF_NGREG 45 00022 #define ELF_NFPREG 33 00023 00024 typedef unsigned char mips_elf_greg_t[4]; 00025 typedef mips_elf_greg_t mips_elf_gregset_t[ELF_NGREG]; 00026 00027 typedef unsigned char mips_elf_fpreg_t[8]; 00028 typedef mips_elf_fpreg_t mips_elf_fpregset_t[ELF_NFPREG]; 00029 00030 /* 0 - 31 are integer registers, 32 - 63 are fp registers. */ 00031 #define FPR_BASE 32 00032 #define PC 64 00033 #define CAUSE 65 00034 #define BADVADDR 66 00035 #define MMHI 67 00036 #define MMLO 68 00037 #define FPC_CSR 69 00038 #define FPC_EIR 70 00039 #define DSP_BASE 71 00040 #define DSP_CONTROL 77 00041 00042 #define EF_REG0 6 00043 #define EF_REG31 37 00044 #define EF_LO 38 00045 #define EF_HI 39 00046 #define EF_CP0_EPC 40 00047 #define EF_CP0_BADVADDR 41 00048 #define EF_CP0_STATUS 42 00049 #define EF_CP0_CAUSE 43 00050 00051 #define EF_SIZE 180 00052 00053 void mips_supply_gregset (struct regcache *, const mips_elf_gregset_t *); 00054 void mips_fill_gregset (const struct regcache *, mips_elf_gregset_t *, int); 00055 void mips_supply_fpregset (struct regcache *, const mips_elf_fpregset_t *); 00056 void mips_fill_fpregset (const struct regcache *, mips_elf_fpregset_t *, int); 00057 00058 /* 64-bit support. */ 00059 00060 /* Copied from <asm/elf.h>. */ 00061 #define MIPS64_ELF_NGREG 45 00062 #define MIPS64_ELF_NFPREG 33 00063 00064 typedef unsigned char mips64_elf_greg_t[8]; 00065 typedef mips64_elf_greg_t mips64_elf_gregset_t[MIPS64_ELF_NGREG]; 00066 00067 typedef unsigned char mips64_elf_fpreg_t[8]; 00068 typedef mips64_elf_fpreg_t mips64_elf_fpregset_t[MIPS64_ELF_NFPREG]; 00069 00070 /* 0 - 31 are integer registers, 32 - 63 are fp registers. */ 00071 #define MIPS64_FPR_BASE 32 00072 #define MIPS64_PC 64 00073 #define MIPS64_CAUSE 65 00074 #define MIPS64_BADVADDR 66 00075 #define MIPS64_MMHI 67 00076 #define MIPS64_MMLO 68 00077 #define MIPS64_FPC_CSR 69 00078 #define MIPS64_FPC_EIR 70 00079 00080 #define MIPS64_EF_REG0 0 00081 #define MIPS64_EF_REG31 31 00082 #define MIPS64_EF_LO 32 00083 #define MIPS64_EF_HI 33 00084 #define MIPS64_EF_CP0_EPC 34 00085 #define MIPS64_EF_CP0_BADVADDR 35 00086 #define MIPS64_EF_CP0_STATUS 36 00087 #define MIPS64_EF_CP0_CAUSE 37 00088 00089 #define MIPS64_EF_SIZE 304 00090 00091 void mips64_supply_gregset (struct regcache *, const mips64_elf_gregset_t *); 00092 void mips64_fill_gregset (const struct regcache *, 00093 mips64_elf_gregset_t *, int); 00094 void mips64_supply_fpregset (struct regcache *, 00095 const mips64_elf_fpregset_t *); 00096 void mips64_fill_fpregset (const struct regcache *, 00097 mips64_elf_fpregset_t *, int); 00098 00099 enum { 00100 /* The Linux kernel stores an error code from any interrupted 00101 syscall in a "register" (in $0's save slot). */ 00102 MIPS_RESTART_REGNUM = 79 00103 }; 00104 00105 /* Return 1 if MIPS_RESTART_REGNUM is usable. */ 00106 00107 int mips_linux_restart_reg_p (struct gdbarch *gdbarch);