File: utils.h

package info (click to toggle)
criu 4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,500 kB
  • sloc: ansic: 139,280; python: 7,484; sh: 3,824; java: 2,799; makefile: 2,659; asm: 1,137; perl: 206; xml: 117; exp: 45
file content (22 lines) | stat: -rw-r--r-- 494 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef __UTILS_H__
#define __UTILS_H__

#define kernel_uses_llsc 1

typedef struct {
	int counter;
} atomic_t;

/*
 * FIXME: detect with compel_cpu_has_feature() if LL/SC implicitly
 * provide a memory barrier.
*/
#define __WEAK_LLSC_MB "	sync	\n"

#define smp_llsc_mb() __asm__ __volatile__(__WEAK_LLSC_MB : : : "memory")

#define smp_mb__before_llsc()	smp_llsc_mb()
#define smp_mb__before_atomic() smp_mb__before_llsc()
#define smp_mb__after_atomic()	smp_llsc_mb()

#endif /* __UTILS_H__ */