diff options
author | Andrew Waterman <andrew@sifive.com> | 2021-11-08 22:03:07 -0800 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2021-11-08 22:21:44 -0800 |
commit | ad96b52e18a51519b57509ab1964c43ba9559c07 (patch) | |
tree | 9f0a1bd0d6c7ba2e70b55c97ac2d397797c80223 /riscv/insn_macros.h | |
parent | d2bbb60aace5ff1c851bc769f47b87d480cd19ad (diff) | |
download | spike-ad96b52e18a51519b57509ab1964c43ba9559c07.zip spike-ad96b52e18a51519b57509ab1964c43ba9559c07.tar.gz spike-ad96b52e18a51519b57509ab1964c43ba9559c07.tar.bz2 |
Move definitions of P and require macros
Avoids namespace conflicts with Boost.
Fixes #820 in a better way.
Diffstat (limited to 'riscv/insn_macros.h')
-rw-r--r-- | riscv/insn_macros.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/riscv/insn_macros.h b/riscv/insn_macros.h new file mode 100644 index 0000000..2fdfced --- /dev/null +++ b/riscv/insn_macros.h @@ -0,0 +1,9 @@ +#ifndef _RISCV_INSN_MACROS_H +#define _RISCV_INSN_MACROS_H + +// These conflict with Boost headers so can't be included from insn_template.h +#define P (*p) + +#define require(x) do { if (unlikely(!(x))) throw trap_illegal_instruction(insn.bits()); } while (0) + +#endif |