]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/x86/boot/mkcpustr.c
Merge tag 'driver-core-4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-bionic-kernel.git] / arch / x86 / boot / mkcpustr.c
CommitLineData
f0be6c6a
PA
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
abbf1590 18#include "../include/asm/required-features.h"
381aa07a 19#include "../include/asm/disabled-features.h"
cd4d09ec 20#include "../include/asm/cpufeatures.h"
7414aa41 21#include "../kernel/cpu/capflags.c"
f0be6c6a 22
f0be6c6a
PA
23int main(void)
24{
97fc0555 25 int i, j;
f0be6c6a
PA
26 const char *str;
27
3235dc3f 28 printf("static const char x86_cap_strs[] =\n");
f0be6c6a 29
97fc0555
PA
30 for (i = 0; i < NCAPINTS; i++) {
31 for (j = 0; j < 32; j++) {
32 str = x86_cap_flags[i*32+j];
33
34 if (i == NCAPINTS-1 && j == 31) {
35 /* The last entry must be unconditional; this
36 also consumes the compiler-added null
37 character */
38 if (!str)
39 str = "";
40 printf("\t\"\\x%02x\\x%02x\"\"%s\"\n",
41 i, j, str);
42 } else if (str) {
43 printf("#if REQUIRED_MASK%d & (1 << %d)\n"
44 "\t\"\\x%02x\\x%02x\"\"%s\\0\"\n"
45 "#endif\n",
46 i, j, i, j, str);
47 }
f0be6c6a
PA
48 }
49 }
50 printf("\t;\n");
51 return 0;
52}