Zephyr API Documentation 4.4.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
barrier.h
Go to the documentation of this file.
1
6#ifndef ZEPHYR_INCLUDE_BARRIER_ARM_H_
7#define ZEPHYR_INCLUDE_BARRIER_ARM_H_
8
9#ifndef ZEPHYR_INCLUDE_SYS_BARRIER_H_
10#error Please include <zephyr/sys/barrier.h>
11#endif
12
13#if defined(CONFIG_CPU_ARM9)
14#define __DMB() __asm__("" ::: "memory")
15#define __DSB() __asm__("mcr p15, 0, %0, c7, c10, 4" :: "r"(0) : "memory")
16#define __ISB() __asm__("" ::: "memory")
17#define __sync_synchronize() __asm__("" ::: "memory")
18#else
19#include <cmsis_core.h>
20#endif
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26static ALWAYS_INLINE void z_barrier_sync_synchronize(void)
27{
28 __sync_synchronize();
29}
30
31static ALWAYS_INLINE void z_barrier_dmem_fence_full(void)
32{
33 __DMB();
34}
35
36static ALWAYS_INLINE void z_barrier_dsync_fence_full(void)
37{
38 __DSB();
39}
40
41static ALWAYS_INLINE void z_barrier_isync_fence_full(void)
42{
43 __ISB();
44}
45
46#ifdef __cplusplus
47}
48#endif
49
50#endif /* ZEPHYR_INCLUDE_BARRIER_ARM_H_ */
#define ALWAYS_INLINE
Definition common.h:161