Motr  M0
user_aarch64_atomic.h File Reference
#include "lib/types.h"
#include "lib/assert.h"
Include dependency graph for user_aarch64_atomic.h:

Go to the source code of this file.

Data Structures

struct  m0_atomic64
 

Macros

#define __MOTR_LIB_USER_AARCH64_ATOMIC_H__
 

Functions

static void m0_atomic64_add (struct m0_atomic64 *a, int64_t num)
 
static void m0_atomic64_sub (struct m0_atomic64 *a, int64_t num)
 
static void m0_atomic64_set (struct m0_atomic64 *a, int64_t num)
 
static int64_t m0_atomic64_get (const struct m0_atomic64 *a)
 
static void m0_atomic64_inc (struct m0_atomic64 *a)
 
static void m0_atomic64_dec (struct m0_atomic64 *a)
 
static int64_t m0_atomic64_add_return (struct m0_atomic64 *a, int64_t delta)
 
static int64_t m0_atomic64_sub_return (struct m0_atomic64 *a, int64_t delta)
 
static bool m0_atomic64_inc_and_test (struct m0_atomic64 *a)
 
static bool m0_atomic64_dec_and_test (struct m0_atomic64 *a)
 
static bool m0_atomic64_cas (int64_t *loc, int64_t oldval, int64_t newval)
 
static void m0_mb (void)
 

Macro Definition Documentation

◆ __MOTR_LIB_USER_AARCH64_ATOMIC_H__

#define __MOTR_LIB_USER_AARCH64_ATOMIC_H__

Definition at line 26 of file user_aarch64_atomic.h.

Function Documentation

◆ m0_atomic64_add()

static void m0_atomic64_add ( struct m0_atomic64 a,
int64_t  num 
)
inlinestatic

Atomically adds given amount to a counter

Definition at line 89 of file user_aarch64_atomic.h.

Here is the caller graph for this function:

◆ m0_atomic64_add_return()

static int64_t m0_atomic64_add_return ( struct m0_atomic64 a,
int64_t  delta 
)
inlinestatic

atomically increment counter and return result

Parameters
apointer to atomic counter
Returns
new value of atomic counter

Definition at line 129 of file user_aarch64_atomic.h.

Here is the caller graph for this function:

◆ m0_atomic64_cas()

static bool m0_atomic64_cas ( int64_t *  loc,
int64_t  oldval,
int64_t  newval 
)
inlinestatic

Since the undersigend commented code being processor specific assembly instruction, This would act more comprehensible while porting to other platform. Since this code has few flaws, not debugged yet.It is not working as of now. The gcc specific routine is called in place of it which has no public source code available. So it is kept as part of documentation for future reference and implementation.

Definition at line 184 of file user_aarch64_atomic.h.

◆ m0_atomic64_dec()

static void m0_atomic64_dec ( struct m0_atomic64 a)
inlinestatic

atomically decrement counter

Parameters
apointer to atomic counter
Returns
none

Definition at line 81 of file user_aarch64_atomic.h.

Here is the call graph for this function:

◆ m0_atomic64_dec_and_test()

static bool m0_atomic64_dec_and_test ( struct m0_atomic64 a)
inlinestatic

Definition at line 179 of file user_aarch64_atomic.h.

Here is the call graph for this function:

◆ m0_atomic64_get()

static int64_t m0_atomic64_get ( const struct m0_atomic64 a)
inlinestatic

Returns value of an atomic counter.

Definition at line 57 of file user_aarch64_atomic.h.

◆ m0_atomic64_inc()

static void m0_atomic64_inc ( struct m0_atomic64 a)
inlinestatic

atomically increment counter

Parameters
apointer to atomic counter
Returns
none

Definition at line 69 of file user_aarch64_atomic.h.

Here is the call graph for this function:

◆ m0_atomic64_inc_and_test()

static bool m0_atomic64_inc_and_test ( struct m0_atomic64 a)
inlinestatic

Definition at line 174 of file user_aarch64_atomic.h.

Here is the call graph for this function:

◆ m0_atomic64_set()

static void m0_atomic64_set ( struct m0_atomic64 a,
int64_t  num 
)
inlinestatic

Definition at line 47 of file user_aarch64_atomic.h.

◆ m0_atomic64_sub()

static void m0_atomic64_sub ( struct m0_atomic64 a,
int64_t  num 
)
inlinestatic

Atomically subtracts given amount from a counter

Definition at line 106 of file user_aarch64_atomic.h.

Here is the caller graph for this function:

◆ m0_atomic64_sub_return()

static int64_t m0_atomic64_sub_return ( struct m0_atomic64 a,
int64_t  delta 
)
inlinestatic

atomically decrement counter and return result

Parameters
apointer to atomic counter
Returns
new value of atomic counter

Definition at line 155 of file user_aarch64_atomic.h.

Here is the caller graph for this function:

◆ m0_mb()

static void m0_mb ( void  )
inlinestatic

Definition at line 218 of file user_aarch64_atomic.h.