-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-/* Deal with dummy functions later. */
-
-#define STW_P(INSN) (((INSN) & 0xfc000000) == 0x68000000)
-#define ADDIL_P(INSN) (((INSN) & 0xfc000000) == 0x28000000)
-#define LDO_P(INSN) (((INSN) & 0xfc00c000) == 0x34000000)
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-{ register int regnum; \
- register CORE_ADDR next_addr; \
- register CORE_ADDR pc; \
- unsigned this_insn; \
- unsigned address; \
- \
- memset (&frame_saved_regs, '\0', sizeof frame_saved_regs); \
- if ((frame_info->pc >= (frame_info)->frame \
- && (frame_info)->pc <= ((frame_info)->frame + CALL_DUMMY_LENGTH \
- + 32 * 4 + (NUM_REGS - FP0_REGNUM) * 8 \
- + 6 * 4))) \
- find_dummy_frame_regs ((frame_info), &(frame_saved_regs)); \
- else \
- { pc = get_pc_function_start ((frame_info)->pc); \
- if (read_memory_integer (pc, 4) == 0x6BC23FD9) \
- { (frame_saved_regs).regs[RP_REGNUM] = (frame_info)->frame - 20;\
- pc = pc + 4; \
- } \
- if (read_memory_integer (pc, 4) != 0x8040241) goto lose; \
- pc += 8; /* skip "copy 4,1; copy 30, 4" */ \
- /* skip either "stw 1,0(4);addil L'fsize,30;ldo R'fsize(1),30" \
- or "stwm 1,fsize(30)" */ \
- if ((read_memory_integer (pc, 4) & ~MASK_14) == 0x68810000) \
- pc += 12; \
- else \
- pc += 4; \
- while (1) \
- { this_insn = read_memory_integer(pc, 4); \
- if (STW_P (this_insn)) /* stw */ \
- { regnum = GET_FIELD (this_insn, 11, 15); \
- if (!regnum) goto lose; \
- (frame_saved_regs).regs[regnum] = (frame_info)->frame + \
- extract_14 (this_insn); \
- pc += 4; \
- } \
- else if (ADDIL_P (this_insn)) /* addil */ \
- { int next_insn; \
- next_insn = read_memory_integer(pc + 4, 4); \
- if (STW_P (next_insn)) /* stw */ \
- { regnum = GET_FIELD (this_insn, 6, 10); \
- if (!regnum) goto lose; \
- (frame_saved_regs).regs[regnum] = (frame_info)->frame +\
- (extract_21 (this_insn) << 11) + extract_14 (next_insn);\
- pc += 8; \
- } \
- else \
- break; \
- } \
- else \
- { pc += 4; \
- break; \
- } \
- } \
- this_insn = read_memory_integer (pc, 4); \
- if (LDO_P (this_insn)) \
- { next_addr = (frame_info)->frame + extract_14 (this_insn); \
- pc += 4; \
- } \
- else if (ADDIL_P (this_insn)) \
- { next_addr = (frame_info)->frame + (extract_21 (this_insn) << 11)\
- + extract_14 (read_memory_integer (pc + 4, 4)); \
- pc += 8; \
- } \
- while (1) \
- { this_insn = read_memory_integer (pc, 4); \
- if ((this_insn & 0xfc001fe0) == 0x2c001220) /* fstds,ma */ \
- { regnum = GET_FIELD (this_insn, 27, 31); \
- (frame_saved_regs).regs[regnum + FP0_REGNUM] = next_addr; \
- next_addr += 8; \
- pc += 4; \
- } \
- else \
- break; \
- } \
- lose: \
- (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame; \
- (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame -4; \
- }}