usermode/library/mtm/src/itmuser.h

00001 
00020 #if !defined(_ITMUSER_H)
00021 # define _ITMUSER_H
00022 
00023 # ifdef __cplusplus
00024 extern "C"
00025 {
00026 # endif                          /* __cplusplus */
00027 
00028 #include <stddef.h>
00029 
00030 # if (defined (_WIN32))
00031 
00032 typedef unsigned char uint8;
00033 typedef signed   char int8;
00034 
00035 typedef unsigned short uint16;
00036 typedef signed   short int16;
00037 
00038 typedef unsigned int uint32;
00039 typedef signed   int int32;
00040 
00041 typedef unsigned long long uint64;
00042 typedef signed   long long int64;
00043 
00044 #  if (!defined (_M_X64))
00045 typedef uint32 uintptr;
00046 typedef int32  intptr;
00047 #  else
00048 typedef uintptr_t uintptr;
00049 typedef intptr_t  intptr;
00050 #  endif
00051 
00052 # else /* !(defined (_WIN32)) */
00053 
00054 # include <stdint.h>
00055 
00056 typedef uint8_t uint8;
00057 typedef int8_t  int8;
00058 
00059 typedef uint16_t uint16;
00060 typedef int16_t  int16;
00061 
00062 typedef uint32_t uint32;
00063 typedef int32_t  int32;
00064 
00065 typedef uint64_t uint64;
00066 typedef int64_t  int64;
00067 
00068 typedef uintptr_t uintptr;
00069 typedef intptr_t  intptr;
00070 
00071 # endif /* (defined (_WIN32)) */
00072 
00073 
00074 #ifndef _WINDOWS
00075   /* supress warnings on declare __attribute__(regparm(2)) function pointers
00076    */
00077   #pragma warning( disable : 1287 )
00078 #endif
00079 
00080 #if (defined(_TM))
00081     /* We're being compiled in TM mode, so we want to add the TM Waiver declspec to our
00082      * declarations here.
00083      */
00084 #  define TM_PURE __declspec (tm_pure)
00085 #else
00086 #  define TM_PURE 
00087 #endif
00088 
00089 /* __fastcall only makes sense on IA32. We use it on all functions for
00090  * consistency, though it has no effect on functions which take no
00091  * arguments.
00092  */
00093 # if (defined (_M_X64))
00094 #  define _ITM_CALL_CONVENTION
00095 # elif (defined (_WIN32))
00096 #  define _ITM_CALL_CONVENTION __fastcall
00097 # else
00098     /*Assume GCC like behavior on other OSes */
00099 #  if (defined (__x86_64__))
00100 #   define _ITM_CALL_CONVENTION
00101 #  else
00102 #   define _ITM_CALL_CONVENTION __attribute__((regparm(2)))
00103 #  endif
00104 
00105 # endif
00106 
00107 //struct _ITM_transactionS;
00109 //typedef struct _ITM_transactionS _ITM_transaction;
00110 
00111 typedef void (_ITM_CALL_CONVENTION * _ITM_userUndoFunction)(void *);
00112 typedef void (_ITM_CALL_CONVENTION * _ITM_userCommitFunction)(void *);
00113 
00115 typedef uint32 _ITM_transactionId;
00116 
00118 typedef enum 
00119 {
00120     outsideTransaction = 0,   
00121     inRetryableTransaction,
00122     inIrrevocableTransaction
00123 } _ITM_howExecuting;
00124 
00127 TM_PURE
00128 extern _ITM_transaction * _ITM_CALL_CONVENTION _ITM_getTransaction (void);
00129 
00134 TM_PURE
00135 extern _ITM_howExecuting _ITM_CALL_CONVENTION _ITM_inTransaction (_ITM_transaction * __td);
00136 
00138 TM_PURE 
00139 extern int _ITM_CALL_CONVENTION _ITM_getThreadnum(void) ;
00140 
00147 TM_PURE 
00148 extern void _ITM_CALL_CONVENTION _ITM_addUserCommitAction (_ITM_transaction * __td, 
00149                                                        _ITM_userCommitFunction __commit,
00150                                                        _ITM_transactionId resumingTransactionId,
00151                                                        void * __arg);
00152 
00158 TM_PURE 
00159 extern void _ITM_CALL_CONVENTION _ITM_addUserUndoAction (_ITM_transaction * __td, 
00160                                                        const _ITM_userUndoFunction __undo, void * __arg);
00161 
00165 #define _ITM_noTransactionId (1) // Id for non-transactional code.
00166 
00170 TM_PURE 
00171 extern _ITM_transactionId _ITM_CALL_CONVENTION _ITM_getTransactionId(_ITM_transaction * __td);
00172 
00178 TM_PURE
00179 extern void _ITM_CALL_CONVENTION _ITM_dropReferences (_ITM_transaction * __td, const void * __start, size_t __size);
00180 
00185 TM_PURE
00186 extern void _ITM_CALL_CONVENTION _ITM_userError (const char *errString, int exitCode);
00187 
00188 # undef TM_PURE
00189 # ifdef __cplusplus
00190 } /* extern "C" */
00191 # endif                          /* __cplusplus */
00192 #endif /* defined (_ITMUSER_H) */

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