add BSD license
[riscv-isa-sim.git] / riscv / trap.cc
1 // See LICENSE for license details.
2
3 #include "trap.h"
4
5 const char* trap_name(trap_t t)
6 {
7 #define DECLARE_TRAP(x) "trap_"#x
8 static const char* names[] = { TRAP_LIST };
9 #undef DECLARE_TRAP
10
11 return (unsigned)t >= sizeof(names)/sizeof(names[0]) ? "unknown" : names[t];
12 }