1 /* Copyright (C) 2015-2020 Free Software Foundation, Inc.
3 Contributed by Intel Corp. <walfred.tedeschi@intel.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 #include "x86-cpuid.h"
32 unsigned int eax
, ebx
, ecx
, edx
;
34 if (!__get_cpuid (1, &eax
, &ebx
, &ecx
, &edx
))
37 if ((ecx
& bit_OSXSAVE
) == bit_OSXSAVE
)
39 if (__get_cpuid_max (0, NULL
) < 7)
42 __cpuid_count (7, 0, eax
, ebx
, ecx
, edx
);
44 if ((ebx
& bit_MPX
) == bit_MPX
)
65 upper (int * p
, int * a
, int * b
, int * c
, int * d
, int len
)
76 lower (int * p
, int * a
, int * b
, int * c
, int * d
, int len
)
97 int *x
, *a
, *b
, *c
, *d
;
99 x
= calloc (OUR_SIZE
, sizeof (int));
100 a
= calloc (OUR_SIZE
, sizeof (int));
101 b
= calloc (OUR_SIZE
, sizeof (int));
102 c
= calloc (OUR_SIZE
, sizeof (int));
103 d
= calloc (OUR_SIZE
, sizeof (int));
105 upper (x
, a
, b
, c
, d
, OUR_SIZE
+ 2);
106 upper (sx
, sa
, sb
, sc
, sd
, OUR_SIZE
+ 2);
107 upper (gx
, ga
, gb
, gc
, gd
, OUR_SIZE
+ 2);
108 lower (x
, a
, b
, c
, d
, 1);
109 lower (sx
, sa
, sb
, sc
, sd
, 1);
111 lower (gx
, ga
, gb
, gc
, gd
, 1);
This page took 0.030658 seconds and 4 git commands to generate.