arch/x86/boot/cpu.c

Source file repositories/reference/linux-study-clean/arch/x86/boot/cpu.c

File Facts

System
Linux kernel
Corpus path
arch/x86/boot/cpu.c
Extension
.c
Size
1777 bytes
Lines
87
Domain
Architecture Layer
Bucket
arch/x86
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

if (e & 1) {
				if (msg_strs[0] == i &&
				    msg_strs[1] == j &&
				    msg_strs[2])
					printf("%s ", msg_strs+2);
				else
					printf("%d:%d ", i, j);
			}
			e >>= 1;
		}
	}
}

int validate_cpu(void)
{
	u32 *err_flags;
	int cpu_level, req_level;

	check_cpu(&cpu_level, &req_level, &err_flags);

	if (cpu_level < req_level) {
		printf("This kernel requires an %s CPU, ",
		       cpu_name(req_level));
		printf("but only detected an %s CPU.\n",
		       cpu_name(cpu_level));
		return -1;
	}

	if (err_flags) {
		puts("This kernel requires the following features "
		     "not present on the CPU:\n");
		show_cap_strs(err_flags);
		putchar('\n');
		return -1;
	} else if (check_knl_erratum()) {
		return -1;
	} else {
		return 0;
	}
}

Annotation

Implementation Notes