brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · 65f4271 Raw
63 lines · c
1/*===---- mwaitxintrin.h - MONITORX/MWAITX intrinsics ----------------------===2 *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-exception6 *7 *===-----------------------------------------------------------------------===8 */9 10#ifndef __X86INTRIN_H11#error "Never use <mwaitxintrin.h> directly; include <x86intrin.h> instead."12#endif13 14#ifndef __MWAITXINTRIN_H15#define __MWAITXINTRIN_H16 17/* Define the default attributes for the functions in this file. */18#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__,  __target__("mwaitx")))19 20/// Establishes a linear address memory range to be monitored and puts21///    the processor in the monitor event pending state. Data stored in the22///    monitored address range causes the processor to exit the pending state.23///24/// \headerfile <x86intrin.h>25///26/// This intrinsic corresponds to the \c MONITORX instruction.27///28/// \param __p29///    The memory range to be monitored. The size of the range is determined by30///    CPUID function 0000_0005h.31/// \param __extensions32///    Optional extensions for the monitoring state.33/// \param __hints34///    Optional hints for the monitoring state.35static __inline__ void __DEFAULT_FN_ATTRS36_mm_monitorx(void * __p, unsigned __extensions, unsigned __hints)37{38  __builtin_ia32_monitorx(__p, __extensions, __hints);39}40 41/// Used with the \c MONITORX instruction to wait while the processor is in42///    the monitor event pending state. Data stored in the monitored address43///    range, or an interrupt, causes the processor to exit the pending state.44///45/// \headerfile <x86intrin.h>46///47/// This intrinsic corresponds to the \c MWAITX instruction.48///49/// \param __extensions50///    Optional extensions for the monitoring state, which can vary by51///    processor.52/// \param __hints53///    Optional hints for the monitoring state, which can vary by processor.54static __inline__ void __DEFAULT_FN_ATTRS55_mm_mwaitx(unsigned __extensions, unsigned __hints, unsigned __clock)56{57  __builtin_ia32_mwaitx(__extensions, __hints, __clock);58}59 60#undef __DEFAULT_FN_ATTRS61 62#endif /* __MWAITXINTRIN_H */63