ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
ReturnCode.cpp
Go to the documentation of this file.
1 
52 // special define to generate registration functionality of error codes for the
53 // maps provided in this file
54 #define ETISS_RETURNCODE_REGISTRATION_BODY
55 #include "etiss/jit/ReturnCode.h"
56 
57 std::map<etiss::int32, const char *> &etiss::RETURNCODE::getErrorMessages()
58 {
59  static std::map<etiss::int32, const char *> map;
60  return map;
61 }
62 
63 std::map<etiss::int32, const char *> &etiss::RETURNCODE::getErrorNames()
64 {
65  static std::map<etiss::int32, const char *> map;
66  return map;
67 }
68 
69 int32_t etiss::RETURNCODE::setTemporary(const std::string &msg)
70 {
71  static std::mutex mu;
72  static std::string msgs[ETISS_RETURNCODE_TEMPORARY_COUNT];
73  static int32_t pos = 0;
74  std::lock_guard<std::mutex> lock(mu);
75  int32_t ret = pos;
76  pos = (pos + 1) % ETISS_RETURNCODE_TEMPORARY_COUNT;
77  msgs[ret] = msg;
78  return ret;
79 }
80 
82 {
83  return etiss::RETURNCODE::setTemporary(std::string(msg));
84 }
int32_t etiss_returncode_setTemporary(const char *msg)
sets the message of a temporary return code and returns the returncode.
Definition: ReturnCode.cpp:81
static __inline__ int32_t
Definition: arm_mve.h:51
#define ETISS_RETURNCODE_TEMPORARY_COUNT
Definition: ReturnCode.h:207