qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/4] target/i386: Define CPUID_MODEL_ID_SZ macro


From: Eduardo Habkost
Subject: [Qemu-devel] [PATCH 3/4] target/i386: Define CPUID_MODEL_ID_SZ macro
Date: Wed, 12 Jul 2017 13:20:57 -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 <address@hidden>
---
 target/i386/cpu.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index a667d5d..e2cd157 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1537,6 +1537,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;
-- 
2.9.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]