1 /*===----------------------- waitpkgintrin.h - WAITPKG --------------------===
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 *===-----------------------------------------------------------------------===
9 #if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
10 #error "Never use <waitpkgintrin.h> directly; include <x86intrin.h> instead."
13 #ifndef __WAITPKGINTRIN_H
14 #define __WAITPKGINTRIN_H
16 /* Define the default attributes for the functions in this file. */
17 #define __DEFAULT_FN_ATTRS \
18 __attribute__((__always_inline__, __nodebug__, __target__("waitpkg")))
20 static __inline__
void __DEFAULT_FN_ATTRS
21 _umonitor (void * __address
)
23 __builtin_ia32_umonitor (__address
);
26 static __inline__
unsigned char __DEFAULT_FN_ATTRS
27 _umwait (unsigned int __control
, unsigned long long __counter
)
29 return __builtin_ia32_umwait (__control
,
30 (unsigned int)(__counter
>> 32), (unsigned int)__counter
);
33 static __inline__
unsigned char __DEFAULT_FN_ATTRS
34 _tpause (unsigned int __control
, unsigned long long __counter
)
36 return __builtin_ia32_tpause (__control
,
37 (unsigned int)(__counter
>> 32), (unsigned int)__counter
);
40 #undef __DEFAULT_FN_ATTRS
42 #endif /* __WAITPKGINTRIN_H */