Typedefs | Functions
oro_arch_interface.h File Reference

Please use this template to create new oro_arch.h files for different target architectures or compilers. You are free to make any of these functions macros or to declare them inlined. More...

Go to the source code of this file.

Typedefs

typedef struct
oro_atomic_t_interface 
oro_atomic_t

Functions

void oro_atomic_add (oro_atomic_t *a, int n)
void ORO_ATOMIC_CLEANUP (oro_atomic_t *a)
void oro_atomic_dec (oro_atomic_t *a)
int oro_atomic_dec_and_test (oro_atomic_t *a)
void oro_atomic_inc (oro_atomic_t *a)
int oro_atomic_inc_and_test (oro_atomic_t *a)
int oro_atomic_read (oro_atomic_t *a)
void oro_atomic_set (oro_atomic_t *a, int n)
void ORO_ATOMIC_SETUP (oro_atomic_t *a, int n)
void oro_atomic_sub (int n, oro_atomic_t *a, int n)
int oro_atomic_sub_and_test (oro_atomic_t *a, int n)
int oro_cmpxchg (void volatile *ptr, unsigned long o, unsigned long n)

Detailed Description

Please use this template to create new oro_arch.h files for different target architectures or compilers. You are free to make any of these functions macros or to declare them inlined.

Do not include this header, it serves only as an example and the expected architecture-specific API of the RTT. Include oro_arch.h instead.

This interface has been inspired on the common intrinsics API's of various compilers, operating systems and processor architectures. Examples are: GCC, Visual Studio and the Intel instruction set.

Definition in file oro_arch_interface.h.


Typedef Documentation

typedef struct oro_atomic_t_interface oro_atomic_t

Definition at line 26 of file oro_arch_interface.h.


Function Documentation

void oro_atomic_add ( oro_atomic_t a,
int  n 
)

Add n to a

Cleans up all resources allocated durint the setup of atomic structure a.

Decrement a atomically

Decrement a atomically and test for zero.

Increment a atomically

Increment a atomically and test for zero.

Returns the current counter value of the atomic structure a.

void oro_atomic_set ( oro_atomic_t a,
int  n 
)

Sets the current counter value of the atomic structure a to n.

void ORO_ATOMIC_SETUP ( oro_atomic_t a,
int  n 
)

Initializes the uninitialized atomic structure a with a counter value of 'n'.

void oro_atomic_sub ( int  n,
oro_atomic_t a,
int  n 
)

Substract n from a

int oro_atomic_sub_and_test ( oro_atomic_t a,
int  n 
)

Substract n from a and test for zero

int oro_cmpxchg ( void volatile *  ptr,
unsigned long  o,
unsigned long  n 
)

Compare o with *ptr and swap with n if equal. Note: you need to implement this function for different sizes of pointers and payloads. You will probably need to implement this function as a macro to resolve this in a way compatible with C.



rtt
Author(s): RTT Developers
autogenerated on Mon Oct 6 2014 03:13:56