usermode/library/mtm/src/mode/dtable.h

Go to the documentation of this file.
00001 
00019 #ifndef _DISPATCH_TABLE_H_119AKL
00020 #define _DISPATCH_TABLE_H_119AKL
00021 
00022 #include "mtm_i.h"
00023 #include "mode/mode.h"
00024 
00025 
00026 #undef FOREACH_ABI_FUNCTION
00027 #define FOREACH_ABI_FUNCTION(ACTION, ...)                                                \
00028     ACTION (void,     abortTransaction,     (mtm_tx_t *td,                               \
00029                                              _ITM_abortReason reason,                    \
00030                                              const _ITM_srcLocation *loc), __VA_ARGS__)  \
00031     ACTION (void,     rollbackTransaction,  (mtm_tx_t *td,                               \
00032                                              const _ITM_srcLocation *loc), __VA_ARGS__)  \
00033     ACTION (void,     commitTransaction,    (mtm_tx_t *td,                               \
00034                                              const _ITM_srcLocation *loc), __VA_ARGS__)  \
00035     ACTION (bool,     tryCommitTransaction, (mtm_tx_t *td,                               \
00036                                              const _ITM_srcLocation *loc), __VA_ARGS__)  \
00037     ACTION (void,     commitTransactionToId,(mtm_tx_t *td,                               \
00038                                              const _ITM_transactionId tid,               \
00039                                              const _ITM_srcLocation *loc), __VA_ARGS__)  \
00040     ACTION (uint32_t, beginTransaction,     (mtm_tx_t *td,                               \
00041                                              uint32 __properties,                        \
00042                                              const _ITM_srcLocation *loc), __VA_ARGS__)  \
00043 
00044 #define FOREACH_DTABLE_ENTRY(ACTION,ARG)                           \
00045     FOREACH_ABI_FUNCTION(ACTION,ARG)                               \
00046     _ITM_FOREACH_TRANSFER (ACTION,ARG)
00047 
00048 
00049 #define _DTABLE_MEMBER(result, function, args, ARG)                \
00050     result (_ITM_CALL_CONVENTION * function##p) args;
00051 
00052 
00053 #define _GEN_READ_BARRIER(ACTION, result_type, encoding, ...)      \
00054     ACTION (result_type, R##encoding, dummy_args, __VA_ARGS__)     \
00055     ACTION (result_type, RaR##encoding, dummy_args, __VA_ARGS__)   \
00056     ACTION (result_type, RaW##encoding, dummy_args, __VA_ARGS__)   \
00057     ACTION (result_type, RfW##encoding, dummy_args, __VA_ARGS__) 
00058 
00059 #define _GEN_WRITE_BARRIER(ACTION, result_type, encoding, ...)     \
00060     ACTION (result_type, W##encoding, dummy_args, __VA_ARGS__)     \
00061     ACTION (result_type, WaR##encoding, dummy_args, __VA_ARGS__)   \
00062     ACTION (result_type, WaW##encoding, dummy_args, __VA_ARGS__) 
00063 
00064 #define FOREACH_READ_BARRIER(ACTION, ...)                          \
00065    _ITM_GENERATE_FOREACH_SIMPLE_TRANSFER (_GEN_READ_BARRIER, ACTION, __VA_ARGS__)
00066 
00067 #define FOREACH_WRITE_BARRIER(ACTION, ...)                         \
00068    _ITM_GENERATE_FOREACH_SIMPLE_TRANSFER (_GEN_WRITE_BARRIER, ACTION, __VA_ARGS__)
00069 
00070 
00071 
00072 typedef struct mtm_dtable_s mtm_dtable_t;
00073 
00074 struct mtm_dtable_s
00075 {
00076     FOREACH_DTABLE_ENTRY (_DTABLE_MEMBER, dummy) 
00077 };
00078 
00079 
00080 # define ACTION(mode) mtm_dtable_t * mtm_##mode;
00081 typedef struct mtm_dtable_group_s
00082 {
00083     FOREACH_MODE(ACTION)
00084 } mtm_dtable_group_t;
00085 # undef ACTION
00086 
00087 extern mtm_dtable_group_t normal_dtable_group;
00088 extern mtm_dtable_group_t *default_dtable_group;
00089 
00090 #endif /* _DISPATCH_TABLE_H_119AKL */

Generated on Sat Apr 23 11:43:36 2011 for Mnemosyne by  doxygen 1.4.7