wrappers.h File Reference

STM wrapper functions for different data types. More...

Go to the source code of this file.

Defines

#define FUNC_ATTR(STR)   STR

Functions

uint8_t stm_load_u8 (TXPARAMS volatile uint8_t *addr)
 Transactional load of an unsigned 8-bit value.
uint16_t stm_load_u16 (TXPARAMS volatile uint16_t *addr)
 Transactional load of an unsigned 16-bit value.
uint32_t stm_load_u32 (TXPARAMS volatile uint32_t *addr)
 Transactional load of an unsigned 32-bit value.
uint64_t stm_load_u64 (TXPARAMS volatile uint64_t *addr)
 Transactional load of an unsigned 64-bit value.
char stm_load_char (TXPARAMS volatile char *addr)
 Transactional load of a char value.
unsigned char stm_load_uchar (TXPARAMS volatile unsigned char *addr)
 Transactional load of an unsigned char value.
short stm_load_short (TXPARAMS volatile short *addr)
 Transactional load of a short value.
unsigned short stm_load_ushort (TXPARAMS volatile unsigned short *addr)
 Transactional load of an unsigned short value.
int stm_load_int (TXPARAMS volatile int *addr)
 Transactional load of an int value.
unsigned int stm_load_uint (TXPARAMS volatile unsigned int *addr)
 Transactional load of an unsigned int value.
long stm_load_long (TXPARAMS volatile long *addr)
 Transactional load of a long value.
unsigned long stm_load_ulong (TXPARAMS volatile unsigned long *addr)
 Transactional load of an unsigned long value.
float stm_load_float (TXPARAMS volatile float *addr)
 Transactional load of a float value.
double stm_load_double (TXPARAMS volatile double *addr)
 Transactional load of a double value.
void * stm_load_ptr (TXPARAMS volatile void **addr)
 Transactional load of a pointer value.
void stm_load_bytes (TXPARAMS volatile uint8_t *addr, uint8_t *buf, size_t size)
 Transactional load of a memory region.
void stm_store_u8 (TXPARAMS volatile uint8_t *addr, uint8_t value)
 Transactional store of an unsigned 8-bit value.
void stm_store_u16 (TXPARAMS volatile uint16_t *addr, uint16_t value)
 Transactional store of an unsigned 16-bit value.
void stm_store_u32 (TXPARAMS volatile uint32_t *addr, uint32_t value)
 Transactional store of an unsigned 32-bit value.
void stm_store_u64 (TXPARAMS volatile uint64_t *addr, uint64_t value)
 Transactional store of an unsigned 64-bit value.
void stm_store_char (TXPARAMS volatile char *addr, char value)
 Transactional store of a char value.
void stm_store_uchar (TXPARAMS volatile unsigned char *addr, unsigned char value)
 Transactional store of an unsigned char value.
void stm_store_short (TXPARAMS volatile short *addr, short value)
 Transactional store of a short value.
void stm_store_ushort (TXPARAMS volatile unsigned short *addr, unsigned short value)
 Transactional store of an unsigned short value.
void stm_store_int (TXPARAMS volatile int *addr, int value)
 Transactional store of an int value.
void stm_store_uint (TXPARAMS volatile unsigned int *addr, unsigned int value)
 Transactional store of an unsigned int value.
void stm_store_long (TXPARAMS volatile long *addr, long value)
 Transactional store of a long value.
void stm_store_ulong (TXPARAMS volatile unsigned long *addr, unsigned long value)
 Transactional store of an unsigned long value.
void stm_store_float (TXPARAMS volatile float *addr, float value)
 Transactional store of a float value.
void stm_store_double (TXPARAMS volatile double *addr, double value)
 Transactional store of a double value.
void stm_store_ptr (TXPARAMS volatile void **addr, void *value)
 Transactional store of a pointer value.
void stm_store_bytes (TXPARAMS volatile uint8_t *addr, uint8_t *buf, size_t size)
 Transactional store of a memory region.
void stm_set_bytes (TXPARAMS volatile uint8_t *addr, uint8_t byte, size_t count)
 Transactional write of a byte to a memory region.

Detailed Description

STM wrapper functions for different data types.

This library defines transactional loads/store functions for unsigned data types of various sizes and for basic C data types.

Author:
Pascal Felber <pascal.felber@unine.ch>
Date:
2007-2009

Function Documentation

void stm_load_bytes ( TXPARAMS volatile uint8_t *  addr,
uint8_t *  buf,
size_t  size 
)

Transactional load of a memory region.

The address of the region does not need to be word aligned and its size may be longer than a word. The values are copied into the provided buffer, which must be allocated by the caller.

Parameters:
addr Address of the memory location.
buf Buffer for storing the read bytes.
size Number of bytes to read.
char stm_load_char ( TXPARAMS volatile char *  addr  ) 

Transactional load of a char value.

Parameters:
addr Address of the memory location.
Returns:
Value read from the specified address.
double stm_load_double ( TXPARAMS volatile double *  addr  ) 

Transactional load of a double value.

Parameters:
addr Address of the memory location.
Returns:
Value read from the specified address.
float stm_load_float ( TXPARAMS volatile float *  addr  ) 

Transactional load of a float value.

Parameters:
addr Address of the memory location.
Returns:
Value read from the specified address.
int stm_load_int ( TXPARAMS volatile int *  addr  ) 

Transactional load of an int value.

Parameters:
addr Address of the memory location.
Returns:
Value read from the specified address.
long stm_load_long ( TXPARAMS volatile long *  addr  ) 

Transactional load of a long value.

Parameters:
addr Address of the memory location.
Returns:
Value read from the specified address.
void* stm_load_ptr ( TXPARAMS volatile void **  addr  ) 

Transactional load of a pointer value.

Parameters:
addr Address of the memory location.
Returns:
Value read from the specified address.
short stm_load_short ( TXPARAMS volatile short *  addr  ) 

Transactional load of a short value.

Parameters:
addr Address of the memory location.
Returns:
Value read from the specified address.
uint16_t stm_load_u16 ( TXPARAMS volatile uint16_t *  addr  ) 

Transactional load of an unsigned 16-bit value.

Parameters:
addr Address of the memory location.
Returns:
Value read from the specified address.
uint32_t stm_load_u32 ( TXPARAMS volatile uint32_t *  addr  ) 

Transactional load of an unsigned 32-bit value.

Parameters:
addr Address of the memory location.
Returns:
Value read from the specified address.
uint64_t stm_load_u64 ( TXPARAMS volatile uint64_t *  addr  ) 

Transactional load of an unsigned 64-bit value.

Parameters:
addr Address of the memory location.
Returns:
Value read from the specified address.
uint8_t stm_load_u8 ( TXPARAMS volatile uint8_t *  addr  ) 

Transactional load of an unsigned 8-bit value.

Parameters:
addr Address of the memory location.
Returns:
Value read from the specified address.
unsigned char stm_load_uchar ( TXPARAMS volatile unsigned char *  addr  ) 

Transactional load of an unsigned char value.

Parameters:
addr Address of the memory location.
Returns:
Value read from the specified address.
unsigned int stm_load_uint ( TXPARAMS volatile unsigned int *  addr  ) 

Transactional load of an unsigned int value.

Parameters:
addr Address of the memory location.
Returns:
Value read from the specified address.
unsigned long stm_load_ulong ( TXPARAMS volatile unsigned long *  addr  ) 

Transactional load of an unsigned long value.

Parameters:
addr Address of the memory location.
Returns:
Value read from the specified address.
unsigned short stm_load_ushort ( TXPARAMS volatile unsigned short *  addr  ) 

Transactional load of an unsigned short value.

Parameters:
addr Address of the memory location.
Returns:
Value read from the specified address.
void stm_set_bytes ( TXPARAMS volatile uint8_t *  addr,
uint8_t  byte,
size_t  count 
)

Transactional write of a byte to a memory region.

The address of the region does not need to be word aligned and its size may be longer than a word. The provided byte is repeatedly copied to the whole memory region.

Parameters:
addr Address of the memory location.
byte Byte to write.
count Number of bytes to write.
void stm_store_bytes ( TXPARAMS volatile uint8_t *  addr,
uint8_t *  buf,
size_t  size 
)

Transactional store of a memory region.

The address of the region does not need to be word aligned and its size may be longer than a word. The values are copied from the provided buffer.

Parameters:
addr Address of the memory location.
buf Buffer with the bytes to write.
size Number of bytes to write.
void stm_store_char ( TXPARAMS volatile char *  addr,
char  value 
)

Transactional store of a char value.

Parameters:
addr Address of the memory location.
value Value to be written.
void stm_store_double ( TXPARAMS volatile double *  addr,
double  value 
)

Transactional store of a double value.

Parameters:
addr Address of the memory location.
value Value to be written.
void stm_store_float ( TXPARAMS volatile float *  addr,
float  value 
)

Transactional store of a float value.

Parameters:
addr Address of the memory location.
value Value to be written.
void stm_store_int ( TXPARAMS volatile int *  addr,
int  value 
)

Transactional store of an int value.

Parameters:
addr Address of the memory location.
value Value to be written.
void stm_store_long ( TXPARAMS volatile long *  addr,
long  value 
)

Transactional store of a long value.

Parameters:
addr Address of the memory location.
value Value to be written.
void stm_store_ptr ( TXPARAMS volatile void **  addr,
void *  value 
)

Transactional store of a pointer value.

Parameters:
addr Address of the memory location.
value Value to be written.
void stm_store_short ( TXPARAMS volatile short *  addr,
short  value 
)

Transactional store of a short value.

Parameters:
addr Address of the memory location.
value Value to be written.
void stm_store_u16 ( TXPARAMS volatile uint16_t *  addr,
uint16_t  value 
)

Transactional store of an unsigned 16-bit value.

Parameters:
addr Address of the memory location.
value Value to be written.
void stm_store_u32 ( TXPARAMS volatile uint32_t *  addr,
uint32_t  value 
)

Transactional store of an unsigned 32-bit value.

Parameters:
addr Address of the memory location.
value Value to be written.
void stm_store_u64 ( TXPARAMS volatile uint64_t *  addr,
uint64_t  value 
)

Transactional store of an unsigned 64-bit value.

Parameters:
addr Address of the memory location.
value Value to be written.
void stm_store_u8 ( TXPARAMS volatile uint8_t *  addr,
uint8_t  value 
)

Transactional store of an unsigned 8-bit value.

Parameters:
addr Address of the memory location.
value Value to be written.
void stm_store_uchar ( TXPARAMS volatile unsigned char *  addr,
unsigned char  value 
)

Transactional store of an unsigned char value.

Parameters:
addr Address of the memory location.
value Value to be written.
void stm_store_uint ( TXPARAMS volatile unsigned int *  addr,
unsigned int  value 
)

Transactional store of an unsigned int value.

Parameters:
addr Address of the memory location.
value Value to be written.
void stm_store_ulong ( TXPARAMS volatile unsigned long *  addr,
unsigned long  value 
)

Transactional store of an unsigned long value.

Parameters:
addr Address of the memory location.
value Value to be written.
void stm_store_ushort ( TXPARAMS volatile unsigned short *  addr,
unsigned short  value 
)

Transactional store of an unsigned short value.

Parameters:
addr Address of the memory location.
value Value to be written.
Generated on Mon Feb 22 15:49:59 2010 for TinySTM by  doxygen 1.6.3