picotm  0.8.0
Macros | Enumerations | Functions
picotm-tm.h File Reference

Public interfaces of picotm's Transactional Memory module. More...

#include <picotm/compiler.h>
#include <stddef.h>
#include <stdint.h>

Macros

#define PICOTM_TM_LOAD_TX(__name, __type)
 
#define PICOTM_TM_STORE_TX(__name, __type)
 
#define PICOTM_TM_PRIVATIZE_LOADSTORE
 
#define PICOTM_TM_PRIVATIZE_TX(__name, __type)
 

Enumerations

enum  { PICOTM_TM_PRIVATIZE_LOAD, PICOTM_TM_PRIVATIZE_STORE }
 

Functions

static void load_tx (const void *addr, void *buf, size_t siz)
 
static void * load_ptr_tx (const void *addr)
 
static void store_tx (void *addr, const void *buf, size_t siz)
 
static void store_ptr_tx (void *addr, const void *ptr)
 
static void loadstore_tx (const void *laddr, void *saddr, size_t siz)
 
static void privatize_tx (const void *addr, size_t siz, unsigned long flags)
 
static void privatize_c_tx (const void *addr, int c, unsigned long flags)
 

Macro Definition Documentation

◆ PICOTM_TM_LOAD_TX

#define PICOTM_TM_LOAD_TX (   __name,
  __type 
)

Defines a C function for conveniently loading a value of a specific type into a transaction. The helper function's name is load_<__name>_tx.

Parameters
__nameThe name of the type.
__typeThe C type.

◆ PICOTM_TM_PRIVATIZE_LOADSTORE

#define PICOTM_TM_PRIVATIZE_LOADSTORE

Privatizes a memory region for loading and storing.

◆ PICOTM_TM_PRIVATIZE_TX

#define PICOTM_TM_PRIVATIZE_TX (   __name,
  __type 
)

Defines a C function for conveniently privatizing a value of a specific type into a transaction. The helper function's name is store_<__name>_tx.

Parameters
__nameThe name of the type.
__typeThe C type.

◆ PICOTM_TM_STORE_TX

#define PICOTM_TM_STORE_TX (   __name,
  __type 
)

Defines a C function for conveniently storing a value of a specific type into a transaction. The helper function's name is store_<__name>_tx.

Parameters
__nameThe name of the type.
__typeThe C type.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Flags for memory privatizations.

Enumerator
PICOTM_TM_PRIVATIZE_LOAD 

Privatizes a memory region for loading.

PICOTM_TM_PRIVATIZE_STORE 

Privatizes a memory region for storing.

Function Documentation

◆ load_ptr_tx()

static void* load_ptr_tx ( const void *  addr)
inlinestatic

Loads a pointer into a buffer.

Parameters
addrThe address to load from.
Returns
The transaction-local pointer.

◆ load_tx()

static void load_tx ( const void *  addr,
void *  buf,
size_t  siz 
)
inlinestatic

Loads the memory at address into a buffer.

Parameters
addrThe address to load from.
bufThe transaction-local buffer to store the loaded value in.
sizThe number of bytes to load.

◆ loadstore_tx()

static void loadstore_tx ( const void *  laddr,
void *  saddr,
size_t  siz 
)
inlinestatic

Copies data between non-transactional memory regions.

Parameters
laddrThe address of the source region.
saddrThe address of the destination region.
sizThe number of bytes ot copy.

◆ privatize_c_tx()

static void privatize_c_tx ( const void *  addr,
int  c,
unsigned long  flags 
)
inlinestatic

Privatizes the memory region starting at address, ending at character 'c'.

Parameters
addrThe address to privatize.
cThe region's terminating character.
flagsPrivatizes for loading and/or storing.

◆ privatize_tx()

static void privatize_tx ( const void *  addr,
size_t  siz,
unsigned long  flags 
)
inlinestatic

Privatizes the memory region starting at address.

Parameters
addrThe address to privatize.
sizThe number of bytes to privatize.
flagsPrivatizes for loading and/or storing.

◆ store_ptr_tx()

static void store_ptr_tx ( void *  addr,
const void *  ptr 
)
inlinestatic

Stores the pointer in memory.

Parameters
addrThe address to store to.
ptrThe pointer value to store.

◆ store_tx()

static void store_tx ( void *  addr,
const void *  buf,
size_t  siz 
)
inlinestatic

Stores the buffer at address in memory.

Parameters
addrThe address to store to.
bufThe transaction-local buffer to load the loaded value from.
sizThe number of bytes to store.