1 // © 2021 Qualcomm Innovation Center, Inc. All rights reserved.
2 //
3 // SPDX-License-Identifier: BSD-3-Clause
4 
5 // Barrier and wait operations.
6 //
7 // These macros should not be used unless the event interface and other
8 // compiler barriers are unsuitable.
9 
10 // Yield the CPU to another hardware thread (SMT) / or let a simulator give CPU
11 // time to somthing else.
12 #define asm_yield() __asm__ volatile("yield")
13 
14 // Ensure that writes to CPU configuration registers and other similar events
15 // are visible to code executing on the CPU. For example, use this between
16 // enabling access to floating point registers and actually using those
17 // registers.
18 #define asm_context_sync_fence()	__asm__ volatile("isb" ::: "memory")
19 #define asm_context_sync_ordered(order) __asm__ volatile("isb" : "+m"(*order))
20 
21 // The asm_ordering variable is used as an artificial dependency to order
22 // different individual asm statements with respect to each other in a way that
23 // is lighter weight than a full "memory" clobber.
24 extern asm_ordering_dummy_t asm_ordering;
25