usermode/library/mtm/src/mtm_i.h File Reference

Definitions used internally by the STM implementation. More...

#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include <xmmintrin.h>
#include "itm.h"
#include <result.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <atomic.h>
#include <pcm.h>
#include "mode/dtable.h"
#include "mode/mode.h"
#include "sysdeps/x86/target.h"
#include "rwlock.h"
#include "useraction.h"
#include "locks.h"
#include "local.h"
#include "stats.h"

Go to the source code of this file.

Classes

struct  mtm_tx_s

Defines

#define ITM_NORETURN   __attribute__((noreturn))
#define FOR_ALL_TYPES(ACTION, name)
#define TMLOG_TYPE_BASE   0
#define TMLOG_TYPE_TORNBIT   1
#define M_TMLOG_WRITE   m_tmlog_base_write
#define M_TMLOG_TRUNCATE_SYNC   m_tmlog_base_truncate_sync
#define M_TMLOG_BEGIN   m_tmlog_base_begin
#define M_TMLOG_COMMIT   m_tmlog_base_commit
#define M_TMLOG_ABORT   m_tmlog_base_abort
#define M_TMLOG_T   m_tmlog_base_t
#define M_TMLOG_LF_TYPE   LF_TYPE_TM_BASE
#define M_TMLOG_OPS   tmlog_base_ops
#define EXPLICIT_TX_PARAMETER
#define TXTYPE   mtm_tx_t *
#define TXPARAM   mtm_tx_t *tx
#define TXPARAMS   mtm_tx_t *tx,
#define TXARG   (mtm_tx_t *)tx
#define TXARGS   (mtm_tx_t *)tx,
#define TX_RETURN   return tx
#define TX_GET
#define WRITE_BACK_ETL   0
#define WRITE_THROUGH   1
#define CM_SUICIDE   0
#define CM_DELAY   1
#define CM_BACKOFF   2
#define CM_PRIORITY   3
#define TLS
#define MTM_DEBUG_PRINT()
#define IO_FLUSH
#define PRINT_DEBUG()
#define PRINT_DEBUG2()
#define LOCK_SHIFT_EXTRA   2
#define STR2(str1, str2)   str1##str2
#define XSTR(s)   STR(s)
#define STR(s)   #s
#define COMPILE_TIME_ASSERT(pred)   switch (0) { case 0: case pred: ; }
#define UNUSED   __attribute__((unused))
#define CLOCK   (gclock)
#define GET_CLOCK   (ATOMIC_LOAD_ACQ(&CLOCK))
#define FETCH_INC_CLOCK   (ATOMIC_FETCH_INC_FULL(&CLOCK))

Typedefs

typedef uint8_t _ITM_TYPE_U1
typedef uint16_t _ITM_TYPE_U2
typedef uint32_t _ITM_TYPE_U4
typedef uint64_t _ITM_TYPE_U8
typedef float _ITM_TYPE_F
typedef double _ITM_TYPE_D
typedef long double _ITM_TYPE_E
typedef __m64 _ITM_TYPE_M64
typedef __m128 _ITM_TYPE_M128
typedef float _Complex _ITM_TYPE_CF
typedef double _Complex _ITM_TYPE_CD
typedef long double _Complex _ITM_TYPE_CE
typedef mtm_tx_s mtm_tx_t
typedef mtm_tx_t _ITM_transaction
typedef uintptr_t mtm_word_t

Enumerations

enum  {
  TX_IDLE = 0, TX_ACTIVE = 1, TX_COMMITTED = 2, TX_ABORTED = 3,
  TX_IRREVOCABLE = 4, TX_SERIAL = 8
}
enum  mtm_restart_reason {
  RESTART_REALLOCATE, RESTART_LOCKED_READ, RESTART_LOCKED_WRITE, RESTART_VALIDATE_READ,
  RESTART_VALIDATE_WRITE, RESTART_VALIDATE_COMMIT, RESTART_NOT_READONLY, RESTART_USER_RETRY,
  NUM_RESTARTS
}

Functions

mtm_tx * mtm_current_tx ()
uint32_t mtm_begin_transaction (uint32_t, const mtm_jmpbuf_t *)
uint32_t mtm_longjmp (const mtm_jmpbuf_t *, uint32_t) ITM_NORETURN
void mtm_commit_local (TXPARAM)
void mtm_rollback_local (TXPARAM)
void mtm_LB (mtm_tx_t *tx, const void *, size_t) _ITM_CALL_CONVENTION
void mtm_serialmode (bool, bool)
void mtm_restart_transaction (mtm_restart_reason) ITM_NORETURN
void mtm_alloc_record_allocation (void *, size_t, void(*)(void *))
void mtm_alloc_forget_allocation (void *, void(*)(void *))
size_t mtm_alloc_get_allocation_size (void *)
void mtm_alloc_commit_allocations (bool)
void mtm_revert_cpp_exceptions (void)
void * mtm_null_read_lock (mtm_tx_t *td, uintptr_t)
void * mtm_null_write_lock (mtm_tx_t *td, uintptr_t)

Variables

int vr_threshold
int cm_threshold
volatile mtm_word_t locks []
volatile mtm_word_t gclock
mtm_rwlock_t mtm_serial_lock
__thread mtm_tx_t_mtm_thread_tx


Detailed Description

Definitions used internally by the STM implementation.

Definition in file mtm_i.h.


Define Documentation

#define FOR_ALL_TYPES ( ACTION,
name   ) 

Value:

ACTION (name,uint8_t,U1)                \
ACTION (name,uint16_t,U2)               \
ACTION (name,uint32_t,U4)               \
ACTION (name,uint64_t,U8)               \
ACTION (name,float,F)                   \
ACTION (name,double,D)                  \
ACTION (name,long double,E)             \
ACTION (name,__m64,M64)                 \
ACTION (name,__m128,M128)               \
ACTION (name,float _Complex,CF)         \
ACTION (name,double _Complex,CD)        \
ACTION (name,long double _Complex,CE)

Definition at line 57 of file mtm_i.h.


Typedef Documentation

typedef uintptr_t mtm_word_t

Size of a word (accessible atomically) on the target architecture. The library supports 32-bit and 64-bit architectures.

Definition at line 232 of file mtm_i.h.


Variable Documentation

volatile mtm_word_t locks[]

The set of locks and write-set pointers (together!).

A lock is a unsigned int of the size of a pointer (mtm_word_t). The LSB is the lock bit. If it is set, this means:

See also:
locks.h

Definition at line 48 of file mtm.c.


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