aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/arch/x86/odp/api/abi/sync_inlines.h
blob: bebe6b571f0f5ae746a864363dcfeccaf3e11353 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright (c) 2023 Nokia
 */

#ifndef ODP_ARCH_SYNC_INLINES_H_
#define ODP_ARCH_SYNC_INLINES_H_

#ifdef __cplusplus
extern "C" {
#endif

static inline void _odp_mb_sync(void)
{
	__asm__ volatile("mfence" ::: "memory");
}

static inline void _odp_mb_sync_load(void)
{
	__asm__ volatile("lfence" ::: "memory");
}

static inline void _odp_mb_sync_store(void)
{
	__asm__ volatile("sfence" ::: "memory");
}

#ifdef __cplusplus
}
#endif

#endif