1 /* -*- linux-c -*- ------------------------------------------------------- *
3 * Copyright (C) 1991, 1992 Linus Torvalds
4 * Copyright 2007-2008 rPath, Inc. - All Rights Reserved
6 * This file is part of the Linux kernel, and is made available under
7 * the terms of the GNU General Public License version 2.
9 * ----------------------------------------------------------------------- */
14 * Check for obligatory CPU features and abort if the features are not
21 static char *cpu_name(int level
)
30 sprintf(buf
, "i%d86", level
);
35 int validate_cpu(void)
38 int cpu_level
, req_level
;
39 const unsigned char *msg_strs
;
41 check_cpu(&cpu_level
, &req_level
, &err_flags
);
43 if (cpu_level
< req_level
) {
44 printf("This kernel requires an %s CPU, ",
46 printf("but only detected an %s CPU.\n",
53 puts("This kernel requires the following features "
54 "not present on the CPU:\n");
56 msg_strs
= (const unsigned char *)x86_cap_strs
;
58 for (i
= 0; i
< NCAPINTS
; i
++) {
61 for (j
= 0; j
< 32; j
++) {
62 if (msg_strs
[0] < i
||
63 (msg_strs
[0] == i
&& msg_strs
[1] < j
)) {
64 /* Skip to the next string */
70 if (msg_strs
[0] == i
&&
73 printf("%s ", msg_strs
+2);
75 printf("%d:%d ", i
, j
);