* tm-{irix3,mips,nindy960,pn,symmetry,vx960}.h: Move

REGISTER_U_ADDR to corresponding xm- file.  Sugg. by Peter Schauer.
This commit is contained in:
John Gilmore 1991-10-12 07:11:48 +00:00
parent 96eb46258b
commit df6335e19f
10 changed files with 133 additions and 149 deletions

View file

@ -125,14 +125,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define DO_REGISTERS_INFO(_regnum, fp) mips_do_registers_info(_regnum, fp)
#define U_REGS_OFFSET 0
#define REGISTER_U_ADDR(addr, blockend, regno) \
if (regno < PC_REGNUM) \
addr = regno; \
else \
addr = regno + NSIG_HNDLRS; /* Skip over signal handlers */
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
#define REGISTER_BYTES (NUM_REGS*4)

View file

@ -136,20 +136,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define DO_REGISTERS_INFO(_regnum, fp) mips_do_registers_info(_regnum, fp)
#define REGISTER_U_ADDR(addr, blockend, regno) \
if (blockend == 0) { \
if (regno < 38) addr = (NBPG*UPAGES) + (regno - 38)*sizeof(int);\
else addr = 0; /* ..somewhere in the pcb */ \
} else if (regno < 32) addr = regno; \
else if (regno == PC_REGNUM) addr = 96; \
else if (regno == 36) addr = 97; \
else if (regno == HI_REGNUM) addr = 98; \
else if (regno == LO_REGNUM) addr = 99; \
else if (regno == FCRCS_REGNUM) addr = 100; \
else if (regno == FCRIR_REGNUM) addr = 101; \
else if (regno >= FP0_REGNUM) addr = regno - (FP0_REGNUM-32);\
else addr = 0;
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
#define REGISTER_BYTES (NUM_REGS*4)

View file

@ -98,8 +98,3 @@ extern int nindy_frame_chain_valid(); /* See nindy-tdep.c */
*/
#define DECR_PC_AFTER_BREAK 0
/* Not needed, because we don't support core files:
* #define KERNEL_U_ADDR
* #define REGISTER_U_ADDR(addr, blockend, regno)
*/

View file

@ -229,17 +229,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define PS_REGNUM 17 /* Contains processor status */
#define PC_REGNUM 18 /* Contains program counter */
/* This is a piece of magic that is given a register number REGNO
and as BLOCKEND the address in the system of the end of the user structure
and stores in ADDR the address in the kernel or core dump
of that register. */
#define REGISTER_U_ADDR(addr, blockend, regno) { \
addr = blockend + regno * 4; \
if (regno == PC_REGNUM) addr = blockend - 8 * 4; \
if (regno == PS_REGNUM) addr = blockend - 7 * 4; \
if (regno == SP_REGNUM) addr = blockend - 6 * 4; \
}
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
#define REGISTER_BYTES (NUM_GEN_REGS*4 + NUM_CPU_REGS*4)

View file

@ -131,104 +131,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define PC_REGNUM 16 /* Contains program counter */
#define PS_REGNUM 17 /* Contains processor status */
/* The magic numbers below are offsets into u_ar0 in the user struct.
* They live in <machine/reg.h>. Gdb calls this macro with blockend
* holding u.u_ar0 - KERNEL_U_ADDR. Only the registers listed are
* saved in the u area (along with a few others that aren't useful
* here. See <machine/reg.h>).
*/
#define REGISTER_U_ADDR(addr, blockend, regno) \
{ struct user foo; /* needed for finding fpu regs */ \
switch (regno) { \
case 0: \
addr = blockend + EAX * sizeof(int); break; \
case 1: \
addr = blockend + EDX * sizeof(int); break; \
case 2: \
addr = blockend + ECX * sizeof(int); break; \
case 3: /* st(0) */ \
addr = blockend - \
((int)&foo.u_fpusave.fpu_stack[0][0] - (int)&foo); \
break; \
case 4: /* st(1) */ \
addr = blockend - \
((int) &foo.u_fpusave.fpu_stack[1][0] - (int)&foo); \
break; \
case 5: \
addr = blockend + EBX * sizeof(int); break; \
case 6: \
addr = blockend + ESI * sizeof(int); break; \
case 7: \
addr = blockend + EDI * sizeof(int); break; \
case 8: /* st(2) */ \
addr = blockend - \
((int) &foo.u_fpusave.fpu_stack[2][0] - (int)&foo); \
break; \
case 9: /* st(3) */ \
addr = blockend - \
((int) &foo.u_fpusave.fpu_stack[3][0] - (int)&foo); \
break; \
case 10: /* st(4) */ \
addr = blockend - \
((int) &foo.u_fpusave.fpu_stack[4][0] - (int)&foo); \
break; \
case 11: /* st(5) */ \
addr = blockend - \
((int) &foo.u_fpusave.fpu_stack[5][0] - (int)&foo); \
break; \
case 12: /* st(6) */ \
addr = blockend - \
((int) &foo.u_fpusave.fpu_stack[6][0] - (int)&foo); \
break; \
case 13: /* st(7) */ \
addr = blockend - \
((int) &foo.u_fpusave.fpu_stack[7][0] - (int)&foo); \
break; \
case 14: \
addr = blockend + ESP * sizeof(int); break; \
case 15: \
addr = blockend + EBP * sizeof(int); break; \
case 16: \
addr = blockend + EIP * sizeof(int); break; \
case 17: \
addr = blockend + FLAGS * sizeof(int); break; \
case 18: /* fp1 */ \
case 19: /* fp2 */ \
case 20: /* fp3 */ \
case 21: /* fp4 */ \
case 22: /* fp5 */ \
case 23: /* fp6 */ \
case 24: /* fp7 */ \
case 25: /* fp8 */ \
case 26: /* fp9 */ \
case 27: /* fp10 */ \
case 28: /* fp11 */ \
case 29: /* fp12 */ \
case 30: /* fp13 */ \
case 31: /* fp14 */ \
case 32: /* fp15 */ \
case 33: /* fp16 */ \
case 34: /* fp17 */ \
case 35: /* fp18 */ \
case 36: /* fp19 */ \
case 37: /* fp20 */ \
case 38: /* fp21 */ \
case 39: /* fp22 */ \
case 40: /* fp23 */ \
case 41: /* fp24 */ \
case 42: /* fp25 */ \
case 43: /* fp26 */ \
case 44: /* fp27 */ \
case 45: /* fp28 */ \
case 46: /* fp29 */ \
case 47: /* fp30 */ \
case 48: /* fp31 */ \
addr = blockend - \
((int) &foo.u_fpasave.fpa_regs[(regno)-18] - (int)&foo); \
} \
}
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
/* 10 i386 registers, 8 i387 registers, and 31 Weitek 1167 registers */

View file

@ -35,14 +35,3 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Breakpoint patching is handled at the target end in VxWorks. */
/* #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} */
/* Not needed, because we don't support core files:
#define KERNEL_U_ADDR
#define REGISTER_U_ADDR(addr, blockend, regno)
*/
/* Address of end of stack space.
This doesn't matter for VxWorks, because it's only used
in manipulation of core files, which we don't support. */
/* #define STACK_END_ADDR (0xfe000000) */

View file

@ -20,7 +20,17 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define HAVE_TERMIO
#define U_REGS_OFFSET 0
#include "xm-bigmips.h"
/* Override register locations in upage for SGI machines */
#undef REGISTER_U_ADDR
#define REGISTER_U_ADDR(addr, blockend, regno) \
if (regno < PC_REGNUM) \
addr = regno; \
else \
addr = regno + NSIG_HNDLRS; /* Skip over signal handlers */
/* Don't need special routines for the SGI -- we can use infptrace.c */
#undef FETCH_INFERIOR_REGISTERS

View file

@ -36,6 +36,20 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define KERNEL_U_ADDR (int)u.u_ar0
#define REGISTER_U_ADDR(addr, blockend, regno) \
if (blockend == 0) { \
if (regno < 38) addr = (NBPG*UPAGES) + (regno - 38)*sizeof(int);\
else addr = 0; /* ..somewhere in the pcb */ \
} else if (regno < 32) addr = regno; \
else if (regno == PC_REGNUM) addr = 96; \
else if (regno == 36) addr = 97; \
else if (regno == HI_REGNUM) addr = 98; \
else if (regno == LO_REGNUM) addr = 99; \
else if (regno == FCRCS_REGNUM) addr = 100; \
else if (regno == FCRIR_REGNUM) addr = 101; \
else if (regno >= FP0_REGNUM) addr = regno - (FP0_REGNUM-32);\
else addr = 0;
/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
#define FETCH_INFERIOR_REGISTERS

View file

@ -26,9 +26,19 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Address of U in kernel space */
#define KERNEL_U_ADDR 0x3fc000
/* This is a piece of magic that is given a register number REGNO
and as BLOCKEND the address in the system of the end of the user structure
and stores in ADDR the address in the kernel or core dump
of that register. */
#define REGISTER_U_ADDR(addr, blockend, regno) { \
addr = blockend + regno * 4; \
if (regno == PC_REGNUM) addr = blockend - 8 * 4; \
if (regno == PS_REGNUM) addr = blockend - 7 * 4; \
if (regno == SP_REGNUM) addr = blockend - 6 * 4; \
}
/*
* No KDB support, Yet! */
/* No KDB support, Yet! */
/* Interface definitions for kernel debugger KDB. */
/* Map machine fault codes into signal numbers.

View file

@ -41,6 +41,103 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG))
/* The magic numbers below are offsets into u_ar0 in the user struct.
They live in <machine/reg.h>. Gdb calls this macro with blockend
holding u.u_ar0 - KERNEL_U_ADDR. Only the registers listed are
saved in the u area (along with a few others that aren't useful
here. See <machine/reg.h>). */
#define REGISTER_U_ADDR(addr, blockend, regno) \
{ struct user foo; /* needed for finding fpu regs */ \
switch (regno) { \
case 0: \
addr = blockend + EAX * sizeof(int); break; \
case 1: \
addr = blockend + EDX * sizeof(int); break; \
case 2: \
addr = blockend + ECX * sizeof(int); break; \
case 3: /* st(0) */ \
addr = blockend - \
((int)&foo.u_fpusave.fpu_stack[0][0] - (int)&foo); \
break; \
case 4: /* st(1) */ \
addr = blockend - \
((int) &foo.u_fpusave.fpu_stack[1][0] - (int)&foo); \
break; \
case 5: \
addr = blockend + EBX * sizeof(int); break; \
case 6: \
addr = blockend + ESI * sizeof(int); break; \
case 7: \
addr = blockend + EDI * sizeof(int); break; \
case 8: /* st(2) */ \
addr = blockend - \
((int) &foo.u_fpusave.fpu_stack[2][0] - (int)&foo); \
break; \
case 9: /* st(3) */ \
addr = blockend - \
((int) &foo.u_fpusave.fpu_stack[3][0] - (int)&foo); \
break; \
case 10: /* st(4) */ \
addr = blockend - \
((int) &foo.u_fpusave.fpu_stack[4][0] - (int)&foo); \
break; \
case 11: /* st(5) */ \
addr = blockend - \
((int) &foo.u_fpusave.fpu_stack[5][0] - (int)&foo); \
break; \
case 12: /* st(6) */ \
addr = blockend - \
((int) &foo.u_fpusave.fpu_stack[6][0] - (int)&foo); \
break; \
case 13: /* st(7) */ \
addr = blockend - \
((int) &foo.u_fpusave.fpu_stack[7][0] - (int)&foo); \
break; \
case 14: \
addr = blockend + ESP * sizeof(int); break; \
case 15: \
addr = blockend + EBP * sizeof(int); break; \
case 16: \
addr = blockend + EIP * sizeof(int); break; \
case 17: \
addr = blockend + FLAGS * sizeof(int); break; \
case 18: /* fp1 */ \
case 19: /* fp2 */ \
case 20: /* fp3 */ \
case 21: /* fp4 */ \
case 22: /* fp5 */ \
case 23: /* fp6 */ \
case 24: /* fp7 */ \
case 25: /* fp8 */ \
case 26: /* fp9 */ \
case 27: /* fp10 */ \
case 28: /* fp11 */ \
case 29: /* fp12 */ \
case 30: /* fp13 */ \
case 31: /* fp14 */ \
case 32: /* fp15 */ \
case 33: /* fp16 */ \
case 34: /* fp17 */ \
case 35: /* fp18 */ \
case 36: /* fp19 */ \
case 37: /* fp20 */ \
case 38: /* fp21 */ \
case 39: /* fp22 */ \
case 40: /* fp23 */ \
case 41: /* fp24 */ \
case 42: /* fp25 */ \
case 43: /* fp26 */ \
case 44: /* fp27 */ \
case 45: /* fp28 */ \
case 46: /* fp29 */ \
case 47: /* fp30 */ \
case 48: /* fp31 */ \
addr = blockend - \
((int) &foo.u_fpasave.fpa_regs[(regno)-18] - (int)&foo); \
} \
}
/* Compensate for lack of `vprintf' function. */
#define MISSING_VPRINTF