aboutsummaryrefslogtreecommitdiff
path: root/pk/pk.h
diff options
context:
space:
mode:
Diffstat (limited to 'pk/pk.h')
-rw-r--r--pk/pk.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/pk/pk.h b/pk/pk.h
index 52fc70d..9ab0b37 100644
--- a/pk/pk.h
+++ b/pk/pk.h
@@ -72,10 +72,9 @@ extern elf_info current;
void load_elf(const char* fn, elf_info* info);
-static inline void advance_pc(trapframe_t* tf)
+static inline int insn_len(long insn)
{
- int rvc = (tf->insn & 0x3) < 0x3;
- tf->epc += rvc ? 2 : 4;
+ return (insn & 0x3) < 0x3 ? 2 : 4;
}
#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))