INOS
|
The macro definition file. More...
#include <inostype.h>
Go to the source code of this file.
Classes | |
struct | TINOSStaticBitmap< T, First, Values... > |
struct | TINOSStaticBitmap< T > |
Macros | |
#define | LOAD_SETBE16(address, value) inos_setbe16((uint16*)address, value) |
Write big endian 16 bit value to dest. | |
#define | LOAD_GETBE16(address) inos_getbe16((uint16*)address) |
Read big endian 16 bit from source. | |
#define | LOAD_SETBE32(address, value) inos_setbe32((uint32*)address, value) |
Write big endian 32 bit value to dest. | |
#define | LOAD_GETBE32(address) inos_getbe32((uint32*)address) |
Read big endian 32 bit from source. | |
#define | INOS_TRY static_assert(0, "One needs to enable C++ Exception feature to use this macro"); |
Enter a CPP try block and enable CPP exceptions in current task. | |
#define | INOS_CATCH(Exception) static_assert(0, "One needs to enable C++ Exception feature to use this macro"); |
Enter a CPP catch block and disable CPP exceptions in current task. | |
#define | INOS_THROW(ExceptionClass, args...) static_assert(0, "One needs to enable C++ Exception feature to use this macro"); |
Throw a CPP exception. Base must be CINOSException. | |
#define | INOS_DEFINE_ENUM_CODE_X(id, code, ...) id = code, |
Enum X macros allow to store extra information with enum declaration and allow to define additional code that is using these enums with macros. | |
#define | INOS_DEFINE_ENUM_CODE(defines, ...) |
#define | INOS_DEFINE_COMBO_DATA_X(id, code, ...) #code";"#id";" |
#define | INOS_DEFINE_COMBO_DATA(defines, ...) defines(INOS_DEFINE_COMBO_DATA_X) |
#define | INOS_HW_WRITE8(address, value) *((volatile uint8*)((uintptr)(address)^1)) = (value); |
#define | INOS_HW_READ8(address) *((volatile uint8*)((uintptr)(address)^1)) |
#define | INOS_HW_ADDR8(address) ((uint8*)((uintptr)(address)^1)) |
#define | INOS_HW_WRITE16(address, value) *((volatile uint16*)((uintptr)(address)^2)) = (value); |
#define | INOS_HW_READ16(address) *((volatile uint16*)((uintptr)(address)^2)) |
#define | INOS_HW_ADDR16(address) ((uint16*)((uintptr)(address)^2)) |
#define | INOS_HW_WRITE32(address, value) *((volatile uint32*)((uintptr)(address))) = (value); |
#define | INOS_HW_READ32(address) *((volatile uint32*)((uintptr)(address))) |
#define | INOS_HW_ADDR32(address) ((volatile uint32*)((uintptr)(address))) |
#define | INOS_OR(variable, mask) |
#define | INOS_AND(variable, mask) |
#define | INOS_ADD(variable, value) |
#define | INOS_SET(variable, value) |
#define | INOS_SET_8 INOS_SET |
#define | INOS_SET_MB(variable, value) |
#define | INOS_ADD_ INOS_ADD |
#define | DF_INOS_SYNCHRONOUS ((CINOSSync *) 0) |
#define | DF_INOS_ASYNCHRONOUS ((CINOSSync *) 1) |
#define | DF_INOS_DELEGATE ((CINOSSync *) 2) |
#define | DF_INOS_SYNCH_LAST ((CINOSSync *) 2) |
#define | DF_INOS_LOG_TRIGGER_TYPE_TESTPOINT uint8(0) |
#define | DF_INOS_LOG_TRIGGER_TYPE_OVERRUN uint8(1) |
#define | DF_INOS_LOG_TRIGGER_TYPE_POSTOVERRUN uint8(2) |
#define | DF_INOS_LOG_TRIGGER_TYPE_TASK uint8(3) |
#define | DF_INOS_LOG_TRIGGER_TYPE_VARLOG uint8(4) |
#define | DF_INOS_LOG_TRIGGER_TYPE_USER uint8(5) |
#define | DF_INOS_LOG_TRIGGER_TYPE_UNKNOWN uint8(255) |
#define | DF_INOS_LOG_SINGLE uint8(0) |
#define | DF_INOS_LOG_ENDLESS uint8(1) |
#define | ICACHE |
#define | DCACHE |
#define | ICRITICAL |
#define | DCRITICAL |
#define | STRUCT_DEF __attribute__ ((section (".struct_def"))) __attribute__ ((unused)) |
#define | STRUCT_NAM __attribute__ ((section (".struct_nam"))) |
#define | DECLARE_STRUCT_BEGIN(aStructName, aTableName, aBaseTable) |
#define | DECLARE_STRUCT_END(aStructName) |
#define | DECLARE_STRUCT_MEMBER(aStructName, aPublicName, aMemberName, aType, aSize) |
#define | DECLARE_STRUCT_INT8(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_UINT8(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_INT16(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_UINT16(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_UINT16_NOCHECK(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_INT32(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_UINT32(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_INT64(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_UINT64(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_FLOAT(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_DOUBLE(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_REAL32(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_REAL64(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_FIXED32(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_FIXED64(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_STRING(aStructName, aPublicName, aMemberName, aValue) |
#define | DECLARE_STRUCT_CHAR(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | DECLARE_STRUCT_FILE(aStructName, aPublicName, aMemberName, aValue) |
#define | DECLARE_STRUCT_BINARY(aStructName, aPublicName, aMemberName, aValue, aArrayLength) |
#define | INOS_LIKELY(x) __builtin_expect(!!(x), 1) |
#define | INOS_UNLIKELY(x) __builtin_expect(!!(x), 0) |
#define | INOS_NO_INLINE __attribute__ ((noinline)) |
#define | INOS_FORMAT(a, b) __attribute__ ((format (printf, a, b))) |
#define | INOS_COMPILE_OPTIMIZED __attribute__((optimize("-O2"))) |
#define | INOS_COMPILE_NONOPTIMIZED __attribute__((optimize("-O0"))) |
#define | INOS_OCRAM |
#define | INOS_OCRAM_DATA |
#define | ASSERT_ALWAYS(f) |
#define | ASSERT_ALWAYS_MSG(f, i_Msg, i_Args...) |
#define | ASSERT(f) ((void)0) |
#define | INOS_CONCURRENCY_CHECK_DECLARE |
#define | INOS_CONCURRENCY_CHECK_CLAIM(Check) |
#define | INOS_CONCURRENCY_CHECK_FREE(Check) |
#define | INOS_TESTING_INTERRUPTION_POINT |
#define | STATIC_ASSERT(e, msg) static_assert(e, #msg); |
#define | sizeofm(aClass, aMember) sizeof(((aClass*)0x100)->aMember) |
#define | inos_offsetof(aClass, aMember) (uintnbr)((char*)&(((aClass*)0x100)->aMember)-(char*)0x100) |
#define | INOS_MIN(a, b) |
#define | INOS_MAX(a, b) |
#define | INOS_STRINGIFY(x) #x |
helper macro to turn a preprocessor token into a string literal | |
#define | INOS_STR(x) INOS_STRINGIFY(x) |
#define | INOS_IGNORE_WARNING(warning) |
#define | INOS_RESTORE_WARNING _Pragma(INOS_STRINGIFY(GCC diagnostic pop)) |
#define | INOS_IGNORE_WARNING_DEPRECATED INOS_IGNORE_WARNING("-Wdeprecated-declarations") |
commonly used warning filters | |
#define | INOS_DEPRECATED(msg) |
#define | STATIC_UINT64_BITMAP(...) (TINOSStaticBitmap<uint64,__VA_ARGS__>::s_uBitmap) |
#define | STATIC_UINT32_BITMAP(...) (TINOSStaticBitmap<uint32,__VA_ARGS__>::s_uBitmap) |
#define | STATIC_UINT16_BITMAP(...) (TINOSStaticBitmap<uint16,__VA_ARGS__>::s_uBitmap) |
#define | STATIC_UINT8_BITMAP(...) (TINOSStaticBitmap<uint8,__VA_ARGS__>::s_uBitmap) |
Functions | |
void | __attribute__ ((noinline)) DoAssert(const char *apCondition |
void const char const int const char | __attribute__ ((format(printf, 4, 5))) |
template<typename TO , typename FROM > | |
TO | checked_static_cast (const FROM &from_value) |
Variables | |
void const char * | apFile |
void const char const int | aiLine |
void const char const int const char * | apMsg |
bool | g_bThrowExceptionOnAssert |
The macro definition file.
project : INOS language : Gnu C++ system : Indel targets
This file contains all global INOS macros
#define ASSERT_ALWAYS | ( | f | ) |
Use this macro for 'assertion' which are active in debug AND release mode (therefore the 'ALWAYS'). If the assertion 'f' evaluates to false, this calling task will be halt.
#define ASSERT_ALWAYS_MSG | ( | f, | |
i_Msg, | |||
i_Args... | |||
) |
Like ASSERT_ALWAYS but will additionally pass the printf-like error message defined by i_Msg and optionally i_Args to INOS_ERROR. This macro should be preffered to ASSERT_ALWAYS especially when failed assertions may point a user (customer) to programming or configuration (e.g. dt2) mistakes.
#define DECLARE_STRUCT_BEGIN | ( | aStructName, | |
aTableName, | |||
aBaseTable | |||
) |
#define DECLARE_STRUCT_BINARY | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_CHAR | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_DOUBLE | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_END | ( | aStructName | ) |
#define DECLARE_STRUCT_FILE | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue | |||
) |
#define DECLARE_STRUCT_FIXED32 | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_FIXED64 | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_FLOAT | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_INT16 | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_INT32 | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_INT64 | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_INT8 | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_MEMBER | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aType, | |||
aSize | |||
) |
#define DECLARE_STRUCT_REAL32 | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_REAL64 | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_STRING | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue | |||
) |
#define DECLARE_STRUCT_UINT16 | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_UINT16_NOCHECK | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_UINT32 | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_UINT64 | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DECLARE_STRUCT_UINT8 | ( | aStructName, | |
aPublicName, | |||
aMemberName, | |||
aValue, | |||
aArrayLength | |||
) |
#define DF_INOS_ASYNCHRONOUS ((CINOSSync *) 1) |
The call needs to be done asynchronous. It returns either a ticket in case of success or an appropriate error code in case of a failure
#define DF_INOS_DELEGATE ((CINOSSync *) 2) |
The call needs to be done asynchronous. It returns either INOS_OK in case of success or an appropriate error code in case of a failure. A method called with DF_INOS_DELEGATE never returns a ticket to wait for. It behaves like 'fire and forget'.
#define DF_INOS_SYNCH_LAST ((CINOSSync *) 2) |
The largest number of special INOS Synch types everything above should be a real sync object.
#define DF_INOS_SYNCHRONOUS ((CINOSSync *) 0) |
The call needs to be done synchronous. It returns either INOS_OK in case of success or an appropriate error code in case of a failure
#define INOS_ADD | ( | variable, | |
value | |||
) |
Atomically (read: thread save) adds 'value' to 'variable', where 'value' may also be negative. Thread safety is achieved by disabling interrupts.
#define INOS_ADD_ INOS_ADD |
Just forwards to INOS_ADD. See INOS_ADD for documentation.
#define INOS_AND | ( | variable, | |
mask | |||
) |
Atomically (read: thread save) "bitwise and" 'mask' to 'variable'. Thread safety is achieved by disabling interrupts.
#define INOS_DEFINE_ENUM_CODE | ( | defines, | |
... | |||
) |
#define INOS_DEFINE_ENUM_CODE_X | ( | id, | |
code, | |||
... | |||
) | id = code, |
Enum X macros allow to store extra information with enum declaration and allow to define additional code that is using these enums with macros.
NOTES: All X macro definitions are based on the following parameter order: id, code, text, ... The extended error code uses: id, code, text[, type, flags[, param]] To support additional parameters in the future the ellipsis is always defined To use this makro to define an emum define a list with an X macro as parameter: #define DF_MY_ENUM(X) \ X( DF_FIRST_VALUE, 1) \ X( DF_SECOND_VALUE, 2) \ INOS_DEFINE_ENUM_CODE(DF_MY_ENUM)
#define INOS_DEPRECATED | ( | msg | ) |
macro to mark classes or functions as deprecated. example:
class INOS_DEPRECATED("use CNewClass instead") COldClass {};
INOS_DEPRECATED("use NewFunc instead") void OldFunc() {};
#define INOS_IGNORE_WARNING | ( | warning | ) |
macro to disable a compiler warning for some code lines. example:
INOS_IGNORE_WARNING("-Wuninitialized") // some code INOS_RESTORE_WARNING
#define INOS_MAX | ( | a, | |
b | |||
) |
#define INOS_MIN | ( | a, | |
b | |||
) |
#define INOS_OR | ( | variable, | |
mask | |||
) |
Atomically (read: thread save) "bitwise or" 'mask' to 'variable'. Thread safety is achieved by disabling interrupts.
#define INOS_SET | ( | variable, | |
value | |||
) |
Atomically (read: thread save) sets 'value' to 'variable'. Thread safety is achieved by disabling interrupts.
#define INOS_SET_MB | ( | variable, | |
value | |||
) |
#define INOS_TESTING_INTERRUPTION_POINT |
this macro is intended to be used in multi-threading sensitive code that is covered by stress tests. It increases the chances for a context switch, so that the test is more likely to detect bugs. NOTE: we exclude INOS_DESKTOP here for now because we ran into hangers/traps for tests where the Relinquish() is called after leaving CINOSTask::Action(), e.g. from within a destructor. It seems that ActualTask() does not return a valid pointer anymore at that time. We did not further investigate why.
#define LOAD_GETBE16 | ( | address | ) | inos_getbe16((uint16*)address) |
Read big endian 16 bit from source.
apSrc | Pointer to source |
#define LOAD_GETBE32 | ( | address | ) | inos_getbe32((uint32*)address) |
Read big endian 32 bit from source.
apSrc | Pointer to source |
#define LOAD_SETBE16 | ( | address, | |
value | |||
) | inos_setbe16((uint16*)address, value) |
Write big endian 16 bit value to dest.
Special macros which ensure 'inline code' for all supported GCC versions. These macros are used in so called 'load devices' code, where the code needs to be position independant.
apDst | Pointer to dest |
auValue | Value to write |
#define LOAD_SETBE32 | ( | address, | |
value | |||
) | inos_setbe32((uint32*)address, value) |
Write big endian 32 bit value to dest.
apDst | Pointer to dest |
auValue | Value to write |
void __attribute__ | ( | (noinline) | ) | const |
Call this function in case of a failed assertion.
like DoAssert but allows a caller specified 'message'
|
extern |
If true, failed assertions cause an exception being thrown. Typically, exceptions should only be thrown in the context of (unit)testing. The (unit)test runner is meant to set this variable accordingly. By default, this variable is 'false' and therefore no exceptions are thrown when an assertion fails.