函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:arch\x86\kernel\cpu\zhaoxin.c Create Date:2022-07-27 08:59:56
首页 Copyright©Brick

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
static void early_init_zhaoxin(struct cpuinfo_x86 *c)
{
    if (c->x86 >= 0x6)
        set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
#ifdef CONFIG_X86_64
    set_cpu_cap(c, X86_FEATURE_SYSENTER32);
#endif
    if (c->x86_power & (1 << 8)) {
        set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
        set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
    }
 
    if (c->cpuid_level >= 0x00000001) {
        u32 eax, ebx, ecx, edx;
 
        cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
        /*
         * If HTT (EDX[28]) is set EBX[16:23] contain the number of
         * apicids which are reserved per package. Store the resulting
         * shift value for the package management code.
         */
        if (edx & (1U << 28))
            c->x86_coreid_bits = get_count_order((ebx >> 16) & 0xff);
    }
 
}