aboutsummaryrefslogtreecommitdiff
path: root/riscv/trap.cc
blob: ba0d867e2c7a94d9f3c9855602978f637ce6fead (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// See LICENSE for license details.

#include "trap.h"

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

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