/* Don't use 8 (could be a normal load offset). */
TRAP_COMPILER = 9,
+ TRAP_COUNTDOWN = 10,
TRAP_END
};
+
+/**
+ * Macro to fixup a compiler stub. The XPC is the RA minus 4,
+ * because the RA points to the instruction after the call.
+ */
+#define MD_TRAP_COMPILER_FIXUP(xpc, ra, sp, pv) \
+ do { \
+ (xpc) = (void*) (((uintptr_t) (ra)) - 4); \
+ } while(0)
+
+
#endif /* _MD_TRAP_H */