|
L4Re Operating System Framework
Interface and Usage Documentation
|
Low-level Thread Functions. More...
#include <l4/sys/compiler.h>#include <l4/sys/types.h>#include <l4/sys/scheduler.h>#include <l4/util/arch/thread.h>Go to the source code of this file.
Macros | |
| #define | __L4UTIL_THREAD_FUNC(name) |
| Defines a wrapper function that sets up the registers according to the calling conventions for the architecture. | |
| #define | _L4UTIL_THREAD_CXX_FUNC_IMPL_(suffix, class, fn_name, from_asm_name, ...) |
| Implement stub and handler. | |
| #define | L4UTIL_THREAD_CXX_FUNC_PROTO(fn_name, ...) |
| Declare static C++ class method which can be called as handler were only stack and instruction pointer are in a well-defined state. | |
| #define | L4UTIL_THREAD_CXX_FUNC_IMPL(class, fn_name, ...) |
| Implement static C++ class method which can be called as handler were only stack and instruction pointer are in a well-defined state. | |
| #define | L4UTIL_THREAD_CXX_FUNC_INTERRUPT_IMPL(class, fn_name, ...) |
| Implement static C++ class method which can be called as handler were only stack and instruction pointer are in a well-defined state. | |
| #define __L4UTIL_THREAD_FUNC | ( | name | ) |
Defines a wrapper function that sets up the registers according to the calling conventions for the architecture.
Use this as a function header when starting a low-level thread where only stack and instruction pointer are in a well-defined state.
Example:
| #define _L4UTIL_THREAD_CXX_FUNC_IMPL_ | ( | suffix, | |
| class, | |||
| fn_name, | |||
| from_asm_name, | |||
| ... ) |
Implement stub and handler.
For 'Foo::foo(int a, int b)' this macro expands into:
| #define L4UTIL_THREAD_CXX_FUNC_IMPL | ( | class, | |
| fn_name, | |||
| ... ) |
Implement static C++ class method which can be called as handler were only stack and instruction pointer are in a well-defined state.
This is important for certain architectures defining global registers or for architectures like AMD64 defining a "red zone" (a reserved fixed-size area below the current stack pointer to be used for temporary data).
The first two parameters of this macro define class name and method name, followed by up to three function parameters.
Use these macros like follows:
to declare the method
| #define L4UTIL_THREAD_CXX_FUNC_INTERRUPT_IMPL | ( | class, | |
| fn_name, | |||
| ... ) |
Implement static C++ class method which can be called as handler were only stack and instruction pointer are in a well-defined state.
In contrast to L4UTIL_THREAD_CXX_FUNC_IMPL(), assume that this function may interrupt code executed at another user-level context and there are adaptions required to the stack pointer (alignment, consider the "red zone" on AMD64, etc.)
| #define L4UTIL_THREAD_CXX_FUNC_PROTO | ( | fn_name, | |
| ... ) |
Declare static C++ class method which can be called as handler were only stack and instruction pointer are in a well-defined state.
Architecture-specific implementations may override this macro to use certain function attributes (e.g. attribute((regparm(3))) on x86).