pconfigintrin.h revision 336815
1336815Sdim/*===---- pconfigintrin.h - X86 platform configuration ---------------------===
2336815Sdim *
3336815Sdim * Permission is hereby granted, free of charge, to any person obtaining a copy
4336815Sdim * of this software and associated documentation files (the "Software"), to deal
5336815Sdim * in the Software without restriction, including without limitation the rights
6336815Sdim * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7336815Sdim * copies of the Software, and to permit persons to whom the Software is
8336815Sdim * furnished to do so, subject to the following conditions:
9336815Sdim *
10336815Sdim * The above copyright notice and this permission notice shall be included in
11336815Sdim * all copies or substantial portions of the Software.
12336815Sdim *
13336815Sdim * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14336815Sdim * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15336815Sdim * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16336815Sdim * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17336815Sdim * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18336815Sdim * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19336815Sdim * THE SOFTWARE.
20336815Sdim *
21336815Sdim *===-----------------------------------------------------------------------===
22336815Sdim */
23336815Sdim
24336815Sdim#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
25336815Sdim#error "Never use <pconfigintrin.h> directly; include <x86intrin.h> instead."
26336815Sdim#endif
27336815Sdim
28336815Sdim#ifndef __PCONFIGINTRIN_H
29336815Sdim#define __PCONFIGINTRIN_H
30336815Sdim
31336815Sdim#define __PCONFIG_KEY_PROGRAM 0x00000001
32336815Sdim
33336815Sdim/* Define the default attributes for the functions in this file. */
34336815Sdim#define __DEFAULT_FN_ATTRS \
35336815Sdim  __attribute__((__always_inline__, __nodebug__,  __target__("pconfig")))
36336815Sdim
37336815Sdimstatic __inline unsigned int __DEFAULT_FN_ATTRS
38336815Sdim_pconfig_u32(unsigned int __leaf, __SIZE_TYPE__ __d[])
39336815Sdim{
40336815Sdim  unsigned int __result;
41336815Sdim  __asm__ ("pconfig"
42336815Sdim           : "=a" (__result), "=b" (__d[0]), "=c" (__d[1]), "=d" (__d[2])
43336815Sdim           : "a" (__leaf), "b" (__d[0]), "c" (__d[1]), "d" (__d[2])
44336815Sdim           : "cc");
45336815Sdim  return __result;
46336815Sdim}
47336815Sdim
48336815Sdim#undef __DEFAULT_FN_ATTRS
49336815Sdim
50336815Sdim#endif
51