Xen Test Framework
Macros | Functions
tsx.h File Reference

x86 TSX intrinsics, compatible with the GCC API. More...

#include <xtf/compiler.h>
#include <xtf/extable.h>
+ Include dependency graph for tsx.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _XBEGIN_STARTED   (~0u)
 
#define _XBEGIN_UD   EXINFO_SYM(UD, 0)
 
#define _XABORT_EXPLICIT   (1u << 0)
 
#define _XABORT_RETRY   (1u << 1)
 
#define _XABORT_CONFLICT   (1u << 2)
 
#define _XABORT_CAPACITY   (1u << 3)
 
#define _XABORT_DEBUG   (1u << 4)
 
#define _XABORT_NESTED   (1u << 5)
 
#define _XABORT_CODE(x)   (((x) >> 24) & 0xff)
 
#define _xabort(code)
 

Functions

static unsigned int _xbegin (void)
 
static unsigned int _xbegin_safe (void)
 
static int _xtest (void)
 
static void _xend (void)
 

Detailed Description

x86 TSX intrinsics, compatible with the GCC API.

To use:

if ( (xstatus = _xbegin()) == _XBEGIN_STARTED )
{
// Inside hardware transaction
_xend();
}
else
// Abort occured

Definition in file tsx.h.

Macro Definition Documentation

◆ _XBEGIN_STARTED

#define _XBEGIN_STARTED   (~0u)

Definition at line 26 of file tsx.h.

◆ _XBEGIN_UD

#define _XBEGIN_UD   EXINFO_SYM(UD, 0)

Definition at line 27 of file tsx.h.

◆ _XABORT_EXPLICIT

#define _XABORT_EXPLICIT   (1u << 0)

Definition at line 28 of file tsx.h.

◆ _XABORT_RETRY

#define _XABORT_RETRY   (1u << 1)

Definition at line 29 of file tsx.h.

◆ _XABORT_CONFLICT

#define _XABORT_CONFLICT   (1u << 2)

Definition at line 30 of file tsx.h.

◆ _XABORT_CAPACITY

#define _XABORT_CAPACITY   (1u << 3)

Definition at line 31 of file tsx.h.

◆ _XABORT_DEBUG

#define _XABORT_DEBUG   (1u << 4)

Definition at line 32 of file tsx.h.

◆ _XABORT_NESTED

#define _XABORT_NESTED   (1u << 5)

Definition at line 33 of file tsx.h.

◆ _XABORT_CODE

#define _XABORT_CODE (   x)    (((x) >> 24) & 0xff)

Definition at line 34 of file tsx.h.

◆ _xabort

#define _xabort (   code)
Value:
do { \
asm volatile (".byte 0xc6, 0xf8, %c0" /* xabort %0 */ \
:: "N" (code) : "memory"); \
unreachable(); \
} while ( 0 )

Definition at line 75 of file tsx.h.

Function Documentation

◆ _xbegin()

static unsigned int _xbegin ( void  )
inlinestatic

Definition at line 36 of file tsx.h.

◆ _xbegin_safe()

static unsigned int _xbegin_safe ( void  )
inlinestatic

Definition at line 47 of file tsx.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _xtest()

static int _xtest ( void  )
inlinestatic

Definition at line 60 of file tsx.h.

◆ _xend()

static void _xend ( void  )
inlinestatic

Definition at line 82 of file tsx.h.

+ Here is the caller graph for this function: