api/debug.hpp
00001 #if !defined(__API_DEBUG_HPP__)
00002 #define __API_DEBUG_HPP__
00003
00004
00005
00006
00007 #if L4VMM_BUILD_DEBUG
00008
00009
00010
00011
00012
00013 #define L4VMM_API_LOCK 0
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #define L4VMM_DEBUG_VMM 2
00027
00028
00029
00030
00031
00032
00033
00034 #define L4VMM_DEBUG_OMEGA0 1
00035
00036
00037
00038
00039
00040 #define L4VMM_DEBUG_L4IO 1
00041
00042
00043
00044
00045
00046
00047 #define L4VMM_DEBUG_L4UTIL 1
00048
00049 #else
00050
00051 #define L4VMM_API_LOCK 0
00052
00053 #define L4VMM_DEBUG_VMM 0
00054 #define L4VMM_DEBUG_OMEGA0 0
00055 #define L4VMM_DEBUG_L4IO 0
00056 #define L4VMM_DEBUG_L4UTIL 0
00057
00058 #endif
00059
00060
00061
00062
00063 #if L4VMM_DEBUG_VMM >= 2
00064 #include "core/util/c++0x.hpp"
00065 void l4vmm_check_types(const char *header=nullptr);
00066 #endif
00067
00068
00069
00070
00071 #if L4VMM_DEBUG_VMM >= 3
00072 struct l4vmm_entry_frame
00073 {
00074 const char *function;
00075 char notes[80];
00076
00077 l4vmm_entry_frame(const char *function, const char *format=nullptr, ...);
00078 ~l4vmm_entry_frame(void);
00079
00080 void print(const char *prefix=nullptr);
00081 };
00082 #endif
00083
00084
00085
00086
00087 #if L4VMM_API_LOCK
00088 extern struct lock l4vmm_library_lock;
00089 #endif
00090
00091
00092
00093
00094 #if L4VMM_DEBUG_VMM >= 3
00095 #define l4vmm_enter_nolock(args...) l4vmm_entry_frame __enter__(args)
00096 #else
00097 #define l4vmm_enter_nolock(...) do {} while(0)
00098 #endif
00099
00100 #if L4VMM_API_LOCK
00101 #define l4vmm_enter(args...) l4vmm_enter_nolock(args); \
00102 auto_lock<lock> __lock_guard__(l4vmm_library_lock)
00103 #else
00104 #define l4vmm_enter(args...) l4vmm_enter_nolock(args);
00105 #endif
00106
00107 #endif
00108
00109
00110