Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Mar 2012 23:07:02 +0000 (UTC)
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r233402 - head/lib/libproc
Message-ID:  <201203232307.q2NN727v098214@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gonzo
Date: Fri Mar 23 23:07:02 2012
New Revision: 233402
URL: http://svn.freebsd.org/changeset/base/233402

Log:
  Make libproc compilable for MIPS

Modified:
  head/lib/libproc/proc_bkpt.c
  head/lib/libproc/proc_regs.c

Modified: head/lib/libproc/proc_bkpt.c
==============================================================================
--- head/lib/libproc/proc_bkpt.c	Fri Mar 23 22:55:37 2012	(r233401)
+++ head/lib/libproc/proc_bkpt.c	Fri Mar 23 23:07:02 2012	(r233402)
@@ -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

Modified: head/lib/libproc/proc_regs.c
==============================================================================
--- head/lib/libproc/proc_regs.c	Fri Mar 23 22:55:37 2012	(r233401)
+++ head/lib/libproc/proc_regs.c	Fri Mar 23 23:07:02 2012	(r233402)
@@ -58,6 +58,8 @@ proc_regget(struct proc_handle *phdl, pr
 		*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, pr
 		*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, pr
 		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, pr
 		regs.r_rsp = regvalue;
 #elif defined(__i386__)
 		regs.r_esp = regvalue;
+#elif defined(__mips__)
+		regs.r_regs[PC] = regvalue;
 #endif
 		break;
 	default:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203232307.q2NN727v098214>