]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/i386: Define CPUID_MODEL_ID_SZ macro
authorEduardo Habkost <ehabkost@redhat.com>
Wed, 12 Jul 2017 16:20:57 +0000 (13:20 -0300)
committerEduardo Habkost <ehabkost@redhat.com>
Wed, 26 Jul 2017 17:55:12 +0000 (14:55 -0300)
Document cpu_x86_fill_model_id() and define CPUID_MODEL_ID_SZ to
help callers use the right buffer size.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20170712162058.10538-4-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
target/i386/cpu.c

index 156dc955d2408d1a9ddf5b0b30e8af9f1d724ed0..8558c600bf1b15e77717f9e203f5258683d78b31 100644 (file)
@@ -1585,6 +1585,17 @@ static bool lmce_supported(void)
     return !!(mce_cap & MCG_LMCE_P);
 }
 
+#define CPUID_MODEL_ID_SZ 48
+
+/**
+ * cpu_x86_fill_model_id:
+ * Get CPUID model ID string from host CPU.
+ *
+ * @str should have at least CPUID_MODEL_ID_SZ bytes
+ *
+ * The function does NOT add a null terminator to the string
+ * automatically.
+ */
 static int cpu_x86_fill_model_id(char *str)
 {
     uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;