Index: head/lib/libproc/proc_bkpt.c =================================================================== --- head/lib/libproc/proc_bkpt.c +++ head/lib/libproc/proc_bkpt.c @@ -61,6 +61,9 @@ #elif defined(__powerpc__) #define BREAKPOINT_INSTR 0x7fe00008 /* trap */ #define BREAKPOINT_INSTR_SZ 4 +#elif defined(__riscv__) +#define BREAKPOINT_INSTR 0x00100073 /* sbreak */ +#define BREAKPOINT_INSTR_SZ 4 #else #error "Add support for your architecture" #endif Index: head/lib/libproc/proc_regs.c =================================================================== --- head/lib/libproc/proc_regs.c +++ head/lib/libproc/proc_regs.c @@ -66,6 +66,8 @@ *regvalue = regs.r_regs[PC]; #elif defined(__powerpc__) *regvalue = regs.pc; +#elif defined(__riscv__) + *regvalue = regs.sepc; #endif break; case REG_SP: @@ -81,6 +83,8 @@ *regvalue = regs.r_regs[SP]; #elif defined(__powerpc__) *regvalue = regs.fixreg[1]; +#elif defined(__riscv__) + *regvalue = regs.sp; #endif break; default: @@ -117,6 +121,8 @@ regs.r_regs[PC] = regvalue; #elif defined(__powerpc__) regs.pc = regvalue; +#elif defined(__riscv__) + regs.sepc = regvalue; #endif break; case REG_SP: @@ -132,6 +138,8 @@ regs.r_regs[PC] = regvalue; #elif defined(__powerpc__) regs.fixreg[1] = regvalue; +#elif defined(__riscv__) + regs.sp = regvalue; #endif break; default: