L4Re - L4 Runtime Environment
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Basic Macros

L4 standard macros for header files, function definitions, and public APIs etc. More...

+ Collaboration diagram for Basic Macros:

Macros

#define L4_DECLARE_CONSTRUCTOR(func, prio)
 L4 Inline function attribute.
#define __END_DECLS
 End section with C types and functions.
#define EXTERN_C_BEGIN
 Start section with C types and functions.
#define EXTERN_C_END
 End section with C types and functions.
#define EXTERN_C
 Mark C types and functions.
#define L4_NOTHROW
 Mark a function declaration and definition as never throwing an exception.
#define L4_EXPORT
 Attribute to mark functions, variables, and data types as being exported from a library.
#define L4_HIDDEN
 Attribute to mark functions, variables, and data types as being explicitly hidden from users of a library.
#define L4_NORETURN
 Noreturn function attribute.
#define L4_NOINSTRUMENT
 No instrumentation function attribute.
#define EXPECT_TRUE(x)
 Expression is likely to execute.
#define EXPECT_FALSE(x)
 Expression is unlikely to execute.
#define L4_STICKY(x)
 Mark symbol sticky (even not there)
#define L4_DEPRECATED(s)
 Mark symbol deprecated.
#define L4_stringify_helper(x)
 stringify helper.
#define L4_stringify(x)
 stringify.
#define L4_CV
 Define calling convention.
#define L4_CV
 Define calling convention.
#define L4_CV   __attribute__((regparm(0)))
 Define calling convention.

Functions

void l4_barrier (void)
 Memory barrier.
void l4_mb (void)
 Memory barrier.
void l4_wmb (void)
 Write memory barrier.

Detailed Description

L4 standard macros for header files, function definitions, and public APIs etc.

#include <l4/sys/compiler.h>

Macro Definition Documentation

#define L4_DECLARE_CONSTRUCTOR (   func,
  prio 
)

L4 Inline function attribute.

Handcoded version of attribute((constructor(xx))).

Parameters
funcfunction declaration (prototype)
priothe prio must be 65535 - gcc_prio

Definition at line 84 of file compiler.h.

#define L4_NOTHROW

Mark a function declaration and definition as never throwing an exception.

(Also for C code).

This macro shall be used to mark C and C++ functions that never throw any exception. Note that also C functions may throw exceptions according to the compilers ABI and shall be marke with L4_NOTHROW if they never do. In C++ this is equvalent to throw().

int foo() L4_NOTHROW;
...
int foo() L4_NOTHROW
{
...
return result;
}

Definition at line 202 of file compiler.h.

#define L4_EXPORT

Attribute to mark functions, variables, and data types as being exported from a library.

All data types, functions, and global variables that shall be exported from a library shall be marked with this attribute. The default may become to hide everything that is not marked as L4_EXPORT from the users of a library and provide the possibility for aggressive optimization of all those internal functionality of a library.

Usage:

class L4_EXPORT My_class
{
...
};
int L4_EXPORT function(void);
int L4_EXPORT global_data; // global data is not recommended

Definition at line 232 of file compiler.h.

#define L4_HIDDEN

Attribute to mark functions, variables, and data types as being explicitly hidden from users of a library.

This attribute is intended for functions, data, and data types that shall never be visible outside of a library. In particular, for shared libraries this may result in much faster code within the library and short linking times.

class L4_HIDDEN My_class
{
...
};
int L4_HIDDEN function(void);
int L4_HIDDEN global_data; // global data is not recommended

Definition at line 229 of file compiler.h.

L4Re - L4 Runtime Environment