1 /*===---- mwaitxintrin.h - MONITORX/MWAITX intrinsics ----------------------===
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 *===-----------------------------------------------------------------------===
11 #error "Never use <mwaitxintrin.h> directly; include <x86intrin.h> instead."
14 #ifndef __MWAITXINTRIN_H
15 #define __MWAITXINTRIN_H
17 /* Define the default attributes for the functions in this file. */
18 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("mwaitx")))
20 /// Establishes a linear address memory range to be monitored and puts
21 /// the processor in the monitor event pending state. Data stored in the
22 /// monitored address range causes the processor to exit the pending state.
24 /// \headerfile <x86intrin.h>
26 /// This intrinsic corresponds to the \c MONITORX instruction.
29 /// The memory range to be monitored. The size of the range is determined by
30 /// CPUID function 0000_0005h.
31 /// \param __extensions
32 /// Optional extensions for the monitoring state.
34 /// Optional hints for the monitoring state.
35 static __inline__
void __DEFAULT_FN_ATTRS
36 _mm_monitorx(void * __p
, unsigned __extensions
, unsigned __hints
)
38 __builtin_ia32_monitorx(__p
, __extensions
, __hints
);
41 /// Used with the \c MONITORX instruction to wait while the processor is in
42 /// the monitor event pending state. Data stored in the monitored address
43 /// range, or an interrupt, causes the processor to exit the pending state.
45 /// \headerfile <x86intrin.h>
47 /// This intrinsic corresponds to the \c MWAITX instruction.
49 /// \param __extensions
50 /// Optional extensions for the monitoring state, which can vary by
53 /// Optional hints for the monitoring state, which can vary by processor.
54 static __inline__
void __DEFAULT_FN_ATTRS
55 _mm_mwaitx(unsigned __extensions
, unsigned __hints
, unsigned __clock
)
57 __builtin_ia32_mwaitx(__extensions
, __hints
, __clock
);
60 #undef __DEFAULT_FN_ATTRS
62 #endif /* __MWAITXINTRIN_H */