Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\boot\cpuflags.c Create Date:2022-07-28 07:26:35
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:get_cpuflags

Proto:void get_cpuflags(void)

Type:void

Parameter:Nothing

93  If loaded_flags Then Return
95  loaded_flags = true
97  If has_fpu() Then Atomically set a bit in memory
100  If has_eflag(X86_EFLAGS_ID) Then
101  cpuid(0x0, & max_intel_level, & cpu_vendor[0], & cpu_vendor[2], & cpu_vendor[1])
104  If max_intel_level >= 0x00000001 && max_intel_level <= 0x0000ffff Then
106  cpuid(0x1, & tfms, & ignored, & flags[4], & flags[0])
108  level = tfms >> 8 & 15
110  model = tfms >> 4 & 15
111  If level >= 6 Then model += ( tfms >> 16 & 0xf) << 4
115  If max_intel_level >= 0x00000007 Then
116  cpuid_count(0x00000007, 0, & ignored, & ignored, & flags[16], & ignored)
120  cpuid(0x80000000, & max_amd_level, & ignored, & ignored, & ignored)
123  If max_amd_level >= 0x80000001 && max_amd_level <= 0x8000ffff Then
125  cpuid(0x80000001, & ignored, & ignored, & flags[6], & flags[1])
Caller
NameDescribe
check_cpuReturns -1 on error.* *cpu_level is set to the current CPU level; *req_level to the required* level. x86-64 is considered level 64 for this purpose.* *err_flags_ptr is set to the flags error array if there are flags missing.