aboutsummaryrefslogtreecommitdiff
path: root/pk/pk.h
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2013-08-18 04:17:29 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2013-08-18 04:17:29 -0700
commit186ae3cc353fa3115d4ee0c9fcb18d8b2370c68c (patch)
tree3ecbf5e1e1333195e6f30764f876618fc79e829b /pk/pk.h
parent2f7d5b9ee2ea937c6734650fecd9952e070a9795 (diff)
downloadpk-186ae3cc353fa3115d4ee0c9fcb18d8b2370c68c.zip
pk-186ae3cc353fa3115d4ee0c9fcb18d8b2370c68c.tar.gz
pk-186ae3cc353fa3115d4ee0c9fcb18d8b2370c68c.tar.bz2
Renumber PCRs; refer to them with new ASM syntax
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]))