64 lines · c
1/*===------------------ enqcmdintrin.h - enqcmd 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 __IMMINTRIN_H11#error "Never use <enqcmdintrin.h> directly; include <immintrin.h> instead."12#endif13 14#ifndef __ENQCMDINTRIN_H15#define __ENQCMDINTRIN_H16 17/* Define the default attributes for the functions in this file */18#define _DEFAULT_FN_ATTRS \19 __attribute__((__always_inline__, __nodebug__, __target__("enqcmd")))20 21/// Reads 64-byte command pointed by \a __src, formats 64-byte enqueue store22/// data, and performs 64-byte enqueue store to memory pointed by \a __dst.23/// This intrinsics may only be used in User mode.24///25/// \headerfile <x86intrin.h>26///27/// This intrinsics corresponds to the <c> ENQCMD </c> instruction.28///29/// \param __dst30/// Pointer to the destination of the enqueue store.31/// \param __src32/// Pointer to 64-byte command data.33/// \returns If the command data is successfully written to \a __dst then 0 is34/// returned. Otherwise 1 is returned.35static __inline__ int _DEFAULT_FN_ATTRS36_enqcmd (void *__dst, const void *__src)37{38 return __builtin_ia32_enqcmd(__dst, __src);39}40 41/// Reads 64-byte command pointed by \a __src, formats 64-byte enqueue store42/// data, and performs 64-byte enqueue store to memory pointed by \a __dst43/// This intrinsic may only be used in Privileged mode.44///45/// \headerfile <x86intrin.h>46///47/// This intrinsics corresponds to the <c> ENQCMDS </c> instruction.48///49/// \param __dst50/// Pointer to the destination of the enqueue store.51/// \param __src52/// Pointer to 64-byte command data.53/// \returns If the command data is successfully written to \a __dst then 0 is54/// returned. Otherwise 1 is returned.55static __inline__ int _DEFAULT_FN_ATTRS56_enqcmds (void *__dst, const void *__src)57{58 return __builtin_ia32_enqcmds(__dst, __src);59}60 61#undef _DEFAULT_FN_ATTRS62 63#endif /* __ENQCMDINTRIN_H */64