Make libproc compilable for MIPS
This commit is contained in:
parent
e36c52f18a
commit
f2242861f8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=233402
@ -44,6 +44,9 @@ __FBSDID("$FreeBSD$");
|
||||
#if defined(__i386__) || defined(__amd64__)
|
||||
#define BREAKPOINT_INSTR 0xcc /* int 0x3 */
|
||||
#define BREAKPOINT_INSTR_SZ 1
|
||||
#elif defined(__mips__)
|
||||
#define BREAKPOINT_INSTR 0xd /* break */
|
||||
#define BREAKPOINT_INSTR_SZ 4
|
||||
#else
|
||||
#error "Add support for your architecture"
|
||||
#endif
|
||||
|
@ -58,6 +58,8 @@ proc_regget(struct proc_handle *phdl, proc_reg_t reg, unsigned long *regvalue)
|
||||
*regvalue = regs.r_rip;
|
||||
#elif defined(__i386__)
|
||||
*regvalue = regs.r_eip;
|
||||
#elif defined(__mips__)
|
||||
*regvalue = regs.r_regs[PC];
|
||||
#endif
|
||||
break;
|
||||
case REG_SP:
|
||||
@ -65,6 +67,8 @@ proc_regget(struct proc_handle *phdl, proc_reg_t reg, unsigned long *regvalue)
|
||||
*regvalue = regs.r_rsp;
|
||||
#elif defined(__i386__)
|
||||
*regvalue = regs.r_esp;
|
||||
#elif defined(__mips__)
|
||||
*regvalue = regs.r_regs[SP];
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
@ -93,6 +97,8 @@ proc_regset(struct proc_handle *phdl, proc_reg_t reg, unsigned long regvalue)
|
||||
regs.r_rip = regvalue;
|
||||
#elif defined(__i386__)
|
||||
regs.r_eip = regvalue;
|
||||
#elif defined(__mips__)
|
||||
regs.r_regs[PC] = regvalue;
|
||||
#endif
|
||||
break;
|
||||
case REG_SP:
|
||||
@ -100,6 +106,8 @@ proc_regset(struct proc_handle *phdl, proc_reg_t reg, unsigned long regvalue)
|
||||
regs.r_rsp = regvalue;
|
||||
#elif defined(__i386__)
|
||||
regs.r_esp = regvalue;
|
||||
#elif defined(__mips__)
|
||||
regs.r_regs[PC] = regvalue;
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user