ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
ReturnCode.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2//
3// This file is part of ETISS. It is licensed under the BSD 3-Clause License; you may not use this file except in
4// compliance with the License. You should have received a copy of the license along with this project. If not, see the
5// LICENSE file.
14// special define to generate registration functionality of error codes for the
15// maps provided in this file
16#define ETISS_RETURNCODE_REGISTRATION_BODY
17#include "etiss/jit/ReturnCode.h"
18
19std::map<etiss::int32, const char *> &etiss::RETURNCODE::getErrorMessages()
20{
21 static std::map<etiss::int32, const char *> map;
22 return map;
23}
24
25std::map<etiss::int32, const char *> &etiss::RETURNCODE::getErrorNames()
26{
27 static std::map<etiss::int32, const char *> map;
28 return map;
29}
30
31int32_t etiss::RETURNCODE::setTemporary(const std::string &msg)
32{
33 static std::mutex mu;
34 static std::string msgs[ETISS_RETURNCODE_TEMPORARY_COUNT];
35 static int32_t pos = 0;
36 std::lock_guard<std::mutex> lock(mu);
37 int32_t ret = pos;
38 pos = (pos + 1) % ETISS_RETURNCODE_TEMPORARY_COUNT;
39 msgs[ret] = msg;
40 return ret;
41}
42
44{
45 return etiss::RETURNCODE::setTemporary(std::string(msg));
46}
int32_t etiss_returncode_setTemporary(const char *msg)
sets the message of a temporary return code and returns the returncode.
static __inline__ int32_t
Definition arm_mve.h:51
#define ETISS_RETURNCODE_TEMPORARY_COUNT
Definition ReturnCode.h:169