43 lines · c
1/*===----------------------- waitpkgintrin.h - WAITPKG --------------------===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#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H10#error "Never use <waitpkgintrin.h> directly; include <x86intrin.h> instead."11#endif12 13#ifndef __WAITPKGINTRIN_H14#define __WAITPKGINTRIN_H15 16/* Define the default attributes for the functions in this file. */17#define __DEFAULT_FN_ATTRS \18 __attribute__((__always_inline__, __nodebug__, __target__("waitpkg")))19 20static __inline__ void __DEFAULT_FN_ATTRS21_umonitor (void * __address)22{23 __builtin_ia32_umonitor (__address);24}25 26static __inline__ unsigned char __DEFAULT_FN_ATTRS27_umwait (unsigned int __control, unsigned long long __counter)28{29 return __builtin_ia32_umwait (__control,30 (unsigned int)(__counter >> 32), (unsigned int)__counter);31}32 33static __inline__ unsigned char __DEFAULT_FN_ATTRS34_tpause (unsigned int __control, unsigned long long __counter)35{36 return __builtin_ia32_tpause (__control,37 (unsigned int)(__counter >> 32), (unsigned int)__counter);38}39 40#undef __DEFAULT_FN_ATTRS41 42#endif /* __WAITPKGINTRIN_H */43