mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-19 01:26:22 +00:00
This patch only adds the support but does not enable it for building. Signed-off-by: Guoyun Sun <sunguoyun@loongson.cn>
24 lines
496 B
C
24 lines
496 B
C
#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__ */
|