Commit | Line | Data |
---|---|---|
c906108c SS |
1 | /* This program is free software; you can redistribute it and/or modify |
2 | it under the terms of the GNU General Public License as published by | |
3 | the Free Software Foundation; either version 2 of the License, or | |
4 | (at your option) any later version. | |
5 | ||
6 | This program is distributed in the hope that it will be useful, | |
7 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
8 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
9 | GNU General Public License for more details. | |
10 | ||
11 | You should have received a copy of the GNU General Public License | |
12 | along with this program; if not, write to the Free Software | |
13 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
14 | ||
15 | /* MIPS running RISC/os 4.52C. */ | |
16 | ||
17 | #define PCB_OFFSET(FIELD) ((int)&((struct user*)0)->u_pcb.FIELD) | |
18 | ||
19 | /* RISC/os 5.0 defines this in machparam.h. */ | |
20 | #include <bsd43/machine/machparam.h> | |
21 | #define NBPG BSD43_NBPG | |
22 | #define UPAGES BSD43_UPAGES | |
23 | ||
24 | /* Where is this used? I don't see any uses in mips-nat.c, and I don't think | |
25 | the uses in infptrace.c are used if FETCH_INFERIOR_REGISTERS is defined. | |
26 | Does the compiler react badly to "extern CORE_ADDR kernel_u_addr" (even | |
27 | if never referenced)? */ | |
28 | #define KERNEL_U_ADDR BSD43_UADDR | |
29 | ||
30 | #define REGISTER_U_ADDR(addr, blockend, regno) \ | |
31 | if (regno < FP0_REGNUM) \ | |
32 | addr = UPAGES*NBPG-EF_SIZE+4*((regno)+EF_AT-1); \ | |
33 | else if (regno < PC_REGNUM) \ | |
34 | addr = PCB_OFFSET(pcb_fpregs[0]) + 4*(regno-FP0_REGNUM); \ | |
35 | else if (regno == PS_REGNUM) \ | |
36 | addr = UPAGES*NBPG-EF_SIZE+4*EF_SR; \ | |
37 | else if (regno == BADVADDR_REGNUM) \ | |
38 | addr = UPAGES*NBPG-EF_SIZE+4*EF_BADVADDR; \ | |
39 | else if (regno == LO_REGNUM) \ | |
40 | addr = UPAGES*NBPG-EF_SIZE+4*EF_MDLO; \ | |
41 | else if (regno == HI_REGNUM) \ | |
42 | addr = UPAGES*NBPG-EF_SIZE+4*EF_MDHI; \ | |
43 | else if (regno == CAUSE_REGNUM) \ | |
44 | addr = UPAGES*NBPG-EF_SIZE+4*EF_CAUSE; \ | |
45 | else if (regno == PC_REGNUM) \ | |
46 | addr = UPAGES*NBPG-EF_SIZE+4*EF_EPC; \ | |
47 | else if (regno < FCRCS_REGNUM) \ | |
48 | addr = PCB_OFFSET(pcb_fpregs[0]) + 4*(regno-FP0_REGNUM); \ | |
49 | else if (regno == FCRCS_REGNUM) \ | |
50 | addr = PCB_OFFSET(pcb_fpc_csr); \ | |
51 | else if (regno == FCRIR_REGNUM) \ | |
52 | addr = PCB_OFFSET(pcb_fpc_eir); \ | |
53 | else \ | |
54 | addr = 0; | |
55 | ||
56 | #include "mips/nm-mips.h" | |
57 | ||
58 | /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ | |
59 | #define FETCH_INFERIOR_REGISTERS |