aboutsummaryrefslogtreecommitdiff
path: root/riscv/trap.cc
blob: cdf7b8d59af6cd8575aea6ea752b142953c5b6d1 (plain)
1
2
3
4
5
6
7
8
9
10
#include "trap.h"

const char* trap_name(trap_t t)
{
  #undef DECLARE_TRAP
  #define DECLARE_TRAP(x) "trap_"#x
  static const char* names[] = { TRAP_LIST };

  return (unsigned)t >= sizeof(names)/sizeof(names[0]) ? "unknown" : names[t];
}