1. fix cpu family calculation

2. Modifie the parameter 'fl' order

Tracked-On:#3142
Signed-off-by: Andy <andyx.liu@intel.com>
This commit is contained in:
Andy 2019-05-20 17:08:43 +08:00 committed by wenlingz
parent 238d8bbaa2
commit aba357dd36
2 changed files with 4 additions and 4 deletions

View File

@ -214,9 +214,9 @@ void init_pcpu_capabilities(void)
cpuid(CPUID_FEATURES, &eax, &unused,
&boot_cpu_data.cpuid_leaves[FEAT_1_ECX],
&boot_cpu_data.cpuid_leaves[FEAT_1_EDX]);
family = (eax >> 8U) & 0xffU;
family = (eax >> 8U) & 0xfU;
if (family == 0xFU) {
family += (eax >> 20U) & 0xffU;
family += ((eax >> 20U) & 0xffU) << 4U;
}
boot_cpu_data.family = (uint8_t)family;

4
hypervisor/lib/sprintf.c Normal file → Executable file
View File

@ -105,8 +105,8 @@ static const char *get_flags(const char *s_arg, uint32_t *flags)
PRINT_FLAG_ALTERNATE_FORM, /* # */
PRINT_FLAG_PAD_ZERO, /* 0 */
PRINT_FLAG_LEFT_JUSTIFY, /* - */
PRINT_FLAG_SIGN, /* + */
PRINT_FLAG_SPACE /* ' ' */
PRINT_FLAG_SPACE, /* ' ' */
PRINT_FLAG_SIGN /* + */
};
uint32_t i;
bool found;