Loading...
1/* ----------------------------------------------------------------------- *
2 *
3 * Copyright 2008 rPath, Inc. - All Rights Reserved
4 *
5 * This file is part of the Linux kernel, and is made available under
6 * the terms of the GNU General Public License version 2 or (at your
7 * option) any later version; incorporated herein by reference.
8 *
9 * ----------------------------------------------------------------------- */
10
11/*
12 * This is a host program to preprocess the CPU strings into a
13 * compact format suitable for the setup code.
14 */
15
16#include <stdio.h>
17
18#include "../include/asm/required-features.h"
19#include "../include/asm/cpufeature.h"
20#include "../kernel/cpu/capflags.c"
21
22int main(void)
23{
24 int i, j;
25 const char *str;
26
27 printf("static const char x86_cap_strs[] =\n");
28
29 for (i = 0; i < NCAPINTS; i++) {
30 for (j = 0; j < 32; j++) {
31 str = x86_cap_flags[i*32+j];
32
33 if (i == NCAPINTS-1 && j == 31) {
34 /* The last entry must be unconditional; this
35 also consumes the compiler-added null
36 character */
37 if (!str)
38 str = "";
39 printf("\t\"\\x%02x\\x%02x\"\"%s\"\n",
40 i, j, str);
41 } else if (str) {
42 printf("#if REQUIRED_MASK%d & (1 << %d)\n"
43 "\t\"\\x%02x\\x%02x\"\"%s\\0\"\n"
44 "#endif\n",
45 i, j, i, j, str);
46 }
47 }
48 }
49 printf("\t;\n");
50 return 0;
51}
1// SPDX-License-Identifier: GPL-2.0-or-later
2/* ----------------------------------------------------------------------- *
3 *
4 * Copyright 2008 rPath, Inc. - All Rights Reserved
5 *
6 * ----------------------------------------------------------------------- */
7
8/*
9 * This is a host program to preprocess the CPU strings into a
10 * compact format suitable for the setup code.
11 */
12
13#include <stdio.h>
14
15#include "../include/asm/required-features.h"
16#include "../include/asm/disabled-features.h"
17#include "../include/asm/cpufeatures.h"
18#include "../include/asm/vmxfeatures.h"
19#include "../kernel/cpu/capflags.c"
20
21int main(void)
22{
23 int i, j;
24 const char *str;
25
26 printf("static const char x86_cap_strs[] =\n");
27
28 for (i = 0; i < NCAPINTS; i++) {
29 for (j = 0; j < 32; j++) {
30 str = x86_cap_flags[i*32+j];
31
32 if (i == NCAPINTS-1 && j == 31) {
33 /* The last entry must be unconditional; this
34 also consumes the compiler-added null
35 character */
36 if (!str)
37 str = "";
38 printf("\t\"\\x%02x\\x%02x\"\"%s\"\n",
39 i, j, str);
40 } else if (str) {
41 printf("#if REQUIRED_MASK%d & (1 << %d)\n"
42 "\t\"\\x%02x\\x%02x\"\"%s\\0\"\n"
43 "#endif\n",
44 i, j, i, j, str);
45 }
46 }
47 }
48 printf("\t;\n");
49 return 0;
50}