INOS
inosmacro.h File Reference

The macro definition file. More...

#include <inostype.h>
Include dependency graph for inosmacro.h:
This graph shows which files directly or indirectly include this file:

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 charapFile
 
void const char const int aiLine
 
void const char const int const charapMsg
 
bool g_bThrowExceptionOnAssert
 

Detailed Description

The macro definition file.

Author
Ch. Hirzel
Remarks
project         : INOS
language        : Gnu C++
system          : Indel targets

This file contains all global INOS macros

Macro Definition Documentation

◆ ASSERT_ALWAYS

#define ASSERT_ALWAYS (   f)
Value:
if (INOS_UNLIKELY(!(f))){ \
}
Definition cinosmcmodule.h:1900

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.

◆ ASSERT_ALWAYS_MSG

#define ASSERT_ALWAYS_MSG (   f,
  i_Msg,
  i_Args... 
)
Value:
if( INOS_UNLIKELY(!(f)) ) { \
}

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.

◆ DECLARE_STRUCT_BEGIN

#define DECLARE_STRUCT_BEGIN (   aStructName,
  aTableName,
  aBaseTable 
)
Value:
STRUCT_NAM char aStructName##tablename[] = aTableName; \
STRUCT_NAM char aStructName##basetable[] = aBaseTable; \
STRUCT_DEF char* aStructName##ptablename = (char *) &aStructName##tablename; \
STRUCT_DEF char* aStructName##pbasetable = (char *) &aStructName##basetable; \
STRUCT_DEF uint32 aStructName##size = sizeof(aStructName); \
STRUCT_DEF uint32 aStructName##align1 = 0;

◆ DECLARE_STRUCT_BINARY

#define DECLARE_STRUCT_BINARY (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
STRUCT_DEF char* aStructName##aMemberName##pvalue = (char *) &aStructName##aMemberName##value;\
STRUCT_DEF uint32 aStructName##aMemberName##dummy = 0;

◆ DECLARE_STRUCT_CHAR

#define DECLARE_STRUCT_CHAR (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
static_assert(sizeof(aStructName::aMemberName) == (aArrayLength * sizeof(char)), "Detected type mismatch registering struct member for dt2"); \
STRUCT_DEF char* aStructName##aMemberName##pvalue = (char *) &aStructName##aMemberName##value;\
STRUCT_DEF uint32 aStructName##aMemberName##dummy = 0;

◆ DECLARE_STRUCT_DOUBLE

#define DECLARE_STRUCT_DOUBLE (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
static_assert((sizeof(aStructName::aMemberName) == sizeof(double)) || (sizeof(aStructName::aMemberName) == (aArrayLength * sizeof(double))), "Detected type mismatch registering struct member for dt2"); \
STRUCT_DEF double aStructName##aMemberName##value = aValue;

◆ DECLARE_STRUCT_END

#define DECLARE_STRUCT_END (   aStructName)
Value:
STRUCT_DEF uint32 aStructName##end = 0; \
STRUCT_DEF uint32 aStructName##align2 = 0;

◆ DECLARE_STRUCT_FILE

#define DECLARE_STRUCT_FILE (   aStructName,
  aPublicName,
  aMemberName,
  aValue 
)
Value:
DECLARE_STRUCT_MEMBER(aStructName, aPublicName, aMemberName, defType_file, sizeof(((aStructName *)0)->aMemberName))\
STRUCT_NAM char aStructName##aMemberName##value[] = aValue;\
STRUCT_DEF char* aStructName##aMemberName##pvalue = (char *) &aStructName##aMemberName##value;\
STRUCT_DEF uint32 aStructName##aMemberName##dummy = 0;

◆ DECLARE_STRUCT_FIXED32

#define DECLARE_STRUCT_FIXED32 (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
static_assert((sizeof(aStructName::aMemberName) == sizeof(fixed32)) || (sizeof(aStructName::aMemberName) == (aArrayLength * sizeof(fixed32))), "Detected type mismatch registering struct member for dt2"); \
STRUCT_DEF double aStructName##aMemberName##value = aValue;

◆ DECLARE_STRUCT_FIXED64

#define DECLARE_STRUCT_FIXED64 (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
static_assert((sizeof(aStructName::aMemberName) == sizeof(fixed64)) || (sizeof(aStructName::aMemberName) == (aArrayLength * sizeof(fixed64))), "Detected type mismatch registering struct member for dt2"); \
STRUCT_DEF double aStructName##aMemberName##value = aValue;

◆ DECLARE_STRUCT_FLOAT

#define DECLARE_STRUCT_FLOAT (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
static_assert((sizeof(aStructName::aMemberName) == sizeof(float)) || (sizeof(aStructName::aMemberName) == (aArrayLength * sizeof(float))), "Detected type mismatch registering struct member for dt2"); \
STRUCT_DEF double aStructName##aMemberName##value = aValue;

◆ DECLARE_STRUCT_INT16

#define DECLARE_STRUCT_INT16 (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
static_assert((sizeof(aStructName::aMemberName) == sizeof(int16)) || (sizeof(aStructName::aMemberName) == (aArrayLength * sizeof(int16))), "Detected type mismatch registering struct member for dt2"); \
STRUCT_DEF int64 aStructName##aMemberName##value = aValue;

◆ DECLARE_STRUCT_INT32

#define DECLARE_STRUCT_INT32 (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
static_assert((sizeof(aStructName::aMemberName) == sizeof(int32)) || (sizeof(aStructName::aMemberName) == (aArrayLength * sizeof(int32))), "Detected type mismatch registering struct member for dt2"); \
STRUCT_DEF int64 aStructName##aMemberName##value = aValue;

◆ DECLARE_STRUCT_INT64

#define DECLARE_STRUCT_INT64 (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
static_assert((sizeof(aStructName::aMemberName) == sizeof(int64)) || (sizeof(aStructName::aMemberName) == (aArrayLength * sizeof(int64))), "Detected type mismatch registering struct member for dt2"); \
STRUCT_DEF int64 aStructName##aMemberName##value = aValue;

◆ DECLARE_STRUCT_INT8

#define DECLARE_STRUCT_INT8 (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
static_assert((sizeof(aStructName::aMemberName) == sizeof(int8)) || (sizeof(aStructName::aMemberName) == (aArrayLength * sizeof(int8))), "Detected type mismatch registering struct member for dt2"); \
STRUCT_DEF int64 aStructName##aMemberName##value = aValue;

◆ DECLARE_STRUCT_MEMBER

#define DECLARE_STRUCT_MEMBER (   aStructName,
  aPublicName,
  aMemberName,
  aType,
  aSize 
)
Value:
STRUCT_NAM char aStructName##aMemberName##name[] = aPublicName; \
STRUCT_DEF char* aStructName##aMemberName##pname = (char *) &aStructName##aMemberName##name;\
STRUCT_DEF uint32 aStructName##aMemberName##type = aType; \
STRUCT_DEF uint32 aStructName##aMemberName##offset = (uintptr) &((aStructName *)0x100)->aMemberName - 0x100; \
STRUCT_DEF uint32 aStructName##aMemberName##size = aSize;

◆ DECLARE_STRUCT_REAL32

#define DECLARE_STRUCT_REAL32 (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
static_assert((sizeof(aStructName::aMemberName) == sizeof(real32)) || (sizeof(aStructName::aMemberName) == (aArrayLength * sizeof(real32))), "Detected type mismatch registering struct member for dt2"); \
STRUCT_DEF double aStructName##aMemberName##value = aValue;

◆ DECLARE_STRUCT_REAL64

#define DECLARE_STRUCT_REAL64 (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
static_assert((sizeof(aStructName::aMemberName) == sizeof(real64)) || (sizeof(aStructName::aMemberName) == (aArrayLength * sizeof(real64))), "Detected type mismatch registering struct member for dt2"); \
STRUCT_DEF double aStructName##aMemberName##value = aValue;

◆ DECLARE_STRUCT_STRING

#define DECLARE_STRUCT_STRING (   aStructName,
  aPublicName,
  aMemberName,
  aValue 
)
Value:
DECLARE_STRUCT_MEMBER(aStructName, aPublicName, aMemberName, defType_string, sizeof(((aStructName *)0)->aMemberName))\
STRUCT_NAM char aStructName##aMemberName##value[] = aValue;\
STRUCT_DEF char* aStructName##aMemberName##pvalue = (char *) &aStructName##aMemberName##value;\
STRUCT_DEF uint32 aStructName##aMemberName##dummy = 0;

◆ DECLARE_STRUCT_UINT16

#define DECLARE_STRUCT_UINT16 (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
static_assert((sizeof(aStructName::aMemberName) == sizeof(uint16)) || (sizeof(aStructName::aMemberName) == (aArrayLength * sizeof(uint16))), "Detected type mismatch registering struct member for dt2"); \
STRUCT_DEF uint64 aStructName##aMemberName##value = aValue;

◆ DECLARE_STRUCT_UINT16_NOCHECK

#define DECLARE_STRUCT_UINT16_NOCHECK (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
STRUCT_DEF uint64 aStructName##aMemberName##value = aValue;

◆ DECLARE_STRUCT_UINT32

#define DECLARE_STRUCT_UINT32 (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
static_assert((sizeof(aStructName::aMemberName) == sizeof(uint32)) || (sizeof(aStructName::aMemberName) == (aArrayLength * sizeof(uint32))), "Detected type mismatch registering struct member for dt2"); \
STRUCT_DEF uint64 aStructName##aMemberName##value = aValue;

◆ DECLARE_STRUCT_UINT64

#define DECLARE_STRUCT_UINT64 (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
static_assert((sizeof(aStructName::aMemberName) == sizeof(uint64)) || (sizeof(aStructName::aMemberName) == (aArrayLength * sizeof(uint64))), "Detected type mismatch registering struct member for dt2"); \
STRUCT_DEF uint64 aStructName##aMemberName##value = aValue;

◆ DECLARE_STRUCT_UINT8

#define DECLARE_STRUCT_UINT8 (   aStructName,
  aPublicName,
  aMemberName,
  aValue,
  aArrayLength 
)
Value:
static_assert((sizeof(aStructName::aMemberName) == sizeof(uint8)) || (sizeof(aStructName::aMemberName) == (aArrayLength * sizeof(uint8))), "Detected type mismatch registering struct member for dt2"); \
STRUCT_DEF uint64 aStructName##aMemberName##value = aValue;

◆ DF_INOS_ASYNCHRONOUS

#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

◆ DF_INOS_DELEGATE

#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'.

◆ DF_INOS_SYNCH_LAST

#define DF_INOS_SYNCH_LAST   ((CINOSSync *) 2)

The largest number of special INOS Synch types everything above should be a real sync object.

◆ DF_INOS_SYNCHRONOUS

#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

◆ INOS_ADD

#define INOS_ADD (   variable,
  value 
)
Value:

Atomically (read: thread save) adds 'value' to 'variable', where 'value' may also be negative. Thread safety is achieved by disabling interrupts.

◆ INOS_ADD_

#define INOS_ADD_   INOS_ADD

Just forwards to INOS_ADD. See INOS_ADD for documentation.

◆ INOS_AND

#define INOS_AND (   variable,
  mask 
)
Value:

Atomically (read: thread save) "bitwise and" 'mask' to 'variable'. Thread safety is achieved by disabling interrupts.

◆ INOS_DEFINE_ENUM_CODE

#define INOS_DEFINE_ENUM_CODE (   defines,
  ... 
)
Value:
enum __VA_ARGS__ { \
};
#define INOS_DEFINE_ENUM_CODE_X(id, code,...)
Enum X macros allow to store extra information with enum declaration and allow to define additional c...
Definition inosmacro.h:141

◆ INOS_DEFINE_ENUM_CODE_X

#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)

◆ INOS_DEPRECATED

#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() {};

◆ INOS_IGNORE_WARNING

#define INOS_IGNORE_WARNING (   warning)
Value:
#define INOS_STRINGIFY(x)
helper macro to turn a preprocessor token into a string literal
Definition inosmacro.h:824

macro to disable a compiler warning for some code lines. example:

INOS_IGNORE_WARNING("-Wuninitialized") // some code INOS_RESTORE_WARNING

◆ INOS_MAX

#define INOS_MAX (   a,
  b 
)
Value:
({ \
__typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; \
})

◆ INOS_MIN

#define INOS_MIN (   a,
  b 
)
Value:
({ \
__typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; \
})

◆ INOS_OR

#define INOS_OR (   variable,
  mask 
)
Value:

Atomically (read: thread save) "bitwise or" 'mask' to 'variable'. Thread safety is achieved by disabling interrupts.

◆ INOS_SET

#define INOS_SET (   variable,
  value 
)
Value:

Atomically (read: thread save) sets 'value' to 'variable'. Thread safety is achieved by disabling interrupts.

◆ INOS_SET_MB

#define INOS_SET_MB (   variable,
  value 
)

◆ INOS_TESTING_INTERRUPTION_POINT

#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.

◆ LOAD_GETBE16

#define LOAD_GETBE16 (   address)    inos_getbe16((uint16*)address)

Read big endian 16 bit from source.

Parameters
apSrcPointer to source
Returns
Value read from source

◆ LOAD_GETBE32

#define LOAD_GETBE32 (   address)    inos_getbe32((uint32*)address)

Read big endian 32 bit from source.

Parameters
apSrcPointer to source
Returns
Value read from source

◆ LOAD_SETBE16

#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.

Parameters
apDstPointer to dest
auValueValue to write

◆ LOAD_SETBE32

#define LOAD_SETBE32 (   address,
  value 
)    inos_setbe32((uint32*)address, value)

Write big endian 32 bit value to dest.

Parameters
apDstPointer to dest
auValueValue to write

Function Documentation

◆ __attribute__()

void __attribute__ ( (noinline ) const

Call this function in case of a failed assertion.

Note
The compiler is told to never inline this function, as it's unlikely that it will be called and if it needs to be called, it shouldn't hurt if it takes slightly longer as we are in an error case any way.

like DoAssert but allows a caller specified 'message'

Variable Documentation

◆ g_bThrowExceptionOnAssert

bool g_bThrowExceptionOnAssert
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.