ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
Macros | Functions
ReturnCode.h File Reference

contains exception/return codes used to control execution of an etiss::CPUCore More...

#include "etiss/jit/types.h"
Include dependency graph for ReturnCode.h:

Go to the source code of this file.

Macros

#define etiss__toString_(X)   #X
 
#define etiss_toString(X)   etiss__toString_(X)
 
#define etiss__merge2_(X, Y)   X##Y
 
#define etiss_merge2(X, Y)   etiss__merge2_(X, Y)
 
#define defineReturnCode(NAME, VALUE, MSG)   static const etiss_int32 ETISS_RETURNCODE_##NAME = VALUE
 define RETURNCODE definition template for easy use with c and c++
 
#define ETISS_RETURNCODE_TEMPORARY_COUNT   8
 

Functions

int32_t etiss_returncode_setTemporary (const char *msg)
 sets the message of a temporary return code and returns the returncode.
 
 defineReturnCode (NOERROR, 0, "No error.")
 
 defineReturnCode (GENERALERROR, -1, "General error.")
 
 defineReturnCode (RELOADBLOCKS, -2, "Clear cached translated blocks.")
 
 defineReturnCode (RELOADCURRENTBLOCK, -3, "Clear the cached block that returned this code.")
 
 defineReturnCode (DBUS_READ_ERROR, -5, "Data bus read error.")
 
 defineReturnCode (DBUS_WRITE_ERROR, -6, "Data bus write error.")
 
 defineReturnCode (IBUS_READ_ERROR, -7, "Instruction bus read error.")
 
 defineReturnCode (IBUS_WRITE_ERROR, -8, "Instruction bus write error.")
 
 defineReturnCode (INTERRUPT, -9, "Signal an interrupt.")
 
 defineReturnCode (RESET, -10, "Reset signal.")
 
 defineReturnCode (ILLEGALINSTRUCTION, -11, "Illegal instruction.")
 
 defineReturnCode (ILLEGALJUMP, -12, "Illegal jump address.")
 
 defineReturnCode (INSTR_PAGEFAULT, -13, "Instruction page fault.")
 
 defineReturnCode (LOAD_PAGEFAULT, -14, "Load page fault.")
 
 defineReturnCode (STORE_PAGEFAULT, -15, "Store page fault.")
 
 defineReturnCode (GDBNOERROR, -16, "Has the same effect as NOERROR but allows exiting a block where NOERROR " "would have continued block execution.")
 
 defineReturnCode (SYSCALL, -17, "System call")
 
 defineReturnCode (PAGEFAULT, -18, "Virtual memory tranlation fault.")
 
 defineReturnCode (BREAKPOINT, -19, "Break point.")
 
 defineReturnCode (CPUFINISHED, 1<< 31, "Finished cpu execution. This is the proper way to exit from " "etiss::CPUCore::execute.")
 
 defineReturnCode (CPUTERMINATED, 0x80000001, "Terminates cpu execution. this is the proper way to force an " "exit from etiss::CPUCore::execute (e.g. by a debugger).")
 
 defineReturnCode (JITERROR, -32, "Error in JIT.")
 
 defineReturnCode (JITCOMPILATIONERROR, -33, "Error in JIT compilation.")
 
 defineReturnCode (ARCHERROR, -34, "Error in architecture.")
 
 defineReturnCode (EMULATIONNOTSUPPORTED, -35, "Emulation is not supported.")
 
 defineReturnCode (INVALIDSYSTEM, -36, "An ETISS_System structure doesn't contain " "the neccessary function pointers.")
 
 defineReturnCode (TEMPORARY0, -128, "")
 
 defineReturnCode (TEMPORARY1, -129, "")
 
 defineReturnCode (TEMPORARY2, -130, "")
 
 defineReturnCode (TEMPORARY3, -131, "")
 
 defineReturnCode (TEMPORARY4, -132, "")
 
 defineReturnCode (TEMPORARY5, -133, "")
 
 defineReturnCode (TEMPORARY6, -134, "")
 
 defineReturnCode (TEMPORARY7, -135, "")
 

Detailed Description

contains exception/return codes used to control execution of an etiss::CPUCore

any return code defined with the defineReturnCode(NAME,VALUE,MSG) macro is available in C++ under the name etiss::RETURNCODE::NAME and ETISS_RETURNCODE_NAME and in C under the name ETISS_RETURNCODE_NAME. In C++ the return code names and messages are accessible via the maps returned by etiss::RETURNCODE::getErrorMessages and etiss::RETURNCODE::getErrorNames

Definition in file ReturnCode.h.

Macro Definition Documentation

◆ defineReturnCode

#define defineReturnCode (   NAME,
  VALUE,
  MSG 
)    static const etiss_int32 ETISS_RETURNCODE_##NAME = VALUE

define RETURNCODE definition template for easy use with c and c++

Definition at line 116 of file ReturnCode.h.

◆ etiss__merge2_

#define etiss__merge2_ (   X,
 
)    X##Y

Definition at line 60 of file ReturnCode.h.

◆ etiss__toString_

#define etiss__toString_ (   X)    #X

Definition at line 56 of file ReturnCode.h.

◆ etiss_merge2

#define etiss_merge2 (   X,
 
)    etiss__merge2_(X, Y)

Definition at line 61 of file ReturnCode.h.

◆ ETISS_RETURNCODE_TEMPORARY_COUNT

#define ETISS_RETURNCODE_TEMPORARY_COUNT   8

Definition at line 169 of file ReturnCode.h.

◆ etiss_toString

#define etiss_toString (   X)    etiss__toString_(X)

Definition at line 57 of file ReturnCode.h.

Function Documentation

◆ defineReturnCode() [1/34]

defineReturnCode ( ARCHERROR  ,
34,
"Error in architecture."   
)

◆ defineReturnCode() [2/34]

defineReturnCode ( BREAKPOINT  ,
19,
"Break point."   
)

◆ defineReturnCode() [3/34]

defineReturnCode ( CPUFINISHED  ,
1<<  31,
"Finished cpu execution. This is the proper way to exit from " "etiss::CPUCore::execute."   
)

◆ defineReturnCode() [4/34]

defineReturnCode ( CPUTERMINATED  ,
0x80000001  ,
"Terminates cpu execution. this is the proper way to force an " "exit from etiss::CPUCore::execute (e.g. by a debugger)."   
)

◆ defineReturnCode() [5/34]

defineReturnCode ( DBUS_READ_ERROR  ,
5,
"Data bus read error."   
)

◆ defineReturnCode() [6/34]

defineReturnCode ( DBUS_WRITE_ERROR  ,
6,
"Data bus write error."   
)

◆ defineReturnCode() [7/34]

defineReturnCode ( EMULATIONNOTSUPPORTED  ,
35,
"Emulation is not supported."   
)

◆ defineReturnCode() [8/34]

defineReturnCode ( GDBNOERROR  ,
16,
"Has the same effect as NOERROR but allows exiting a block where NOERROR " "would have continued block execution."   
)

◆ defineReturnCode() [9/34]

defineReturnCode ( GENERALERROR  ,
1,
"General error."   
)

◆ defineReturnCode() [10/34]

defineReturnCode ( IBUS_READ_ERROR  ,
7,
"Instruction bus read error."   
)

◆ defineReturnCode() [11/34]

defineReturnCode ( IBUS_WRITE_ERROR  ,
8,
"Instruction bus write error."   
)

◆ defineReturnCode() [12/34]

defineReturnCode ( ILLEGALINSTRUCTION  ,
11,
"Illegal instruction."   
)

◆ defineReturnCode() [13/34]

defineReturnCode ( ILLEGALJUMP  ,
12,
"Illegal jump address."   
)

◆ defineReturnCode() [14/34]

defineReturnCode ( INSTR_PAGEFAULT  ,
13,
"Instruction page fault."   
)

◆ defineReturnCode() [15/34]

defineReturnCode ( INTERRUPT  ,
9,
"Signal an interrupt."   
)

◆ defineReturnCode() [16/34]

defineReturnCode ( INVALIDSYSTEM  ,
36,
"An ETISS_System structure doesn't contain " "the neccessary function pointers."   
)

◆ defineReturnCode() [17/34]

defineReturnCode ( JITCOMPILATIONERROR  ,
33,
"Error in JIT compilation."   
)

◆ defineReturnCode() [18/34]

defineReturnCode ( JITERROR  ,
32,
"Error in JIT."   
)

◆ defineReturnCode() [19/34]

defineReturnCode ( LOAD_PAGEFAULT  ,
14,
"Load page fault."   
)

◆ defineReturnCode() [20/34]

defineReturnCode ( NOERROR  ,
,
"No error."   
)

◆ defineReturnCode() [21/34]

defineReturnCode ( PAGEFAULT  ,
18,
"Virtual memory tranlation fault."   
)

◆ defineReturnCode() [22/34]

defineReturnCode ( RELOADBLOCKS  ,
2,
"Clear cached translated blocks."   
)

◆ defineReturnCode() [23/34]

defineReturnCode ( RELOADCURRENTBLOCK  ,
3,
"Clear the cached block that returned this code."   
)

◆ defineReturnCode() [24/34]

defineReturnCode ( RESET  ,
10,
"Reset signal."   
)

◆ defineReturnCode() [25/34]

defineReturnCode ( STORE_PAGEFAULT  ,
15,
"Store page fault."   
)

◆ defineReturnCode() [26/34]

defineReturnCode ( SYSCALL  ,
17,
"System call"   
)

◆ defineReturnCode() [27/34]

defineReturnCode ( TEMPORARY0  ,
128,
""   
)

◆ defineReturnCode() [28/34]

defineReturnCode ( TEMPORARY1  ,
129,
""   
)

◆ defineReturnCode() [29/34]

defineReturnCode ( TEMPORARY2  ,
130,
""   
)

◆ defineReturnCode() [30/34]

defineReturnCode ( TEMPORARY3  ,
131,
""   
)

◆ defineReturnCode() [31/34]

defineReturnCode ( TEMPORARY4  ,
132,
""   
)

◆ defineReturnCode() [32/34]

defineReturnCode ( TEMPORARY5  ,
133,
""   
)

◆ defineReturnCode() [33/34]

defineReturnCode ( TEMPORARY6  ,
134,
""   
)

◆ defineReturnCode() [34/34]

defineReturnCode ( TEMPORARY7  ,
135,
""   
)

◆ etiss_returncode_setTemporary()

int32_t etiss_returncode_setTemporary ( const char *  msg)
extern

sets the message of a temporary return code and returns the returncode.

use for custom messages. message may be overwritten if all other temporary return codes are used

Definition at line 43 of file ReturnCode.cpp.