sp1/amd64: cpu: Obtain processor vendor information

Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
2026-04-19 15:19:40 -04:00
parent 182b080957
commit 8ee72dcc8a
+37
View File
@@ -42,6 +42,42 @@ cpu_print_info(struct cpu_info *ci)
once = true; once = true;
} }
/*
* Obtain the processor vendor
*/
static void
cpu_get_vendor(void)
{
uint32_t ebx, edx, ecx, unused;
char vendor[13];
/* Obtain the manufacturer ID */
__cpuid(0x0, unused, ebx, ecx, edx);
/* Dword 0 */
vendor[0] = ebx & 0xFF;
vendor[1] = (ebx >> 8) & 0xFF;
vendor[2] = (ebx >> 16) & 0xFF;
vendor[3] = (ebx >> 24) & 0xFF;
/* Dword 1 */
vendor[4] = edx & 0xFF;
vendor[5] = (edx >> 8) & 0xFF;
vendor[6] = (edx >> 16) & 0xFF;
vendor[7] = (edx >> 24) & 0xFF;
/* Dword 1 */
vendor[8] = ecx & 0xFF;
vendor[9] = (ecx >> 8) & 0xFF;
vendor[10] = (ecx >> 16) & 0xFF;
vendor[11] = (ecx >> 24) & 0xFF;
vendor[12] = '\0';
pr_trace("cpu.manufacturer : %s\n", vendor);
}
/*
* Obtain processor specific information
*/
static void static void
cpu_get_info(struct cpu_info *ci) cpu_get_info(struct cpu_info *ci)
{ {
@@ -55,6 +91,7 @@ cpu_get_info(struct cpu_info *ci)
} }
mcb = &ci->mcb; mcb = &ci->mcb;
cpu_get_vendor();
/* Get processor info and feature bits */ /* Get processor info and feature bits */
__cpuid(0x01, eax, unused, unused, unused); __cpuid(0x01, eax, unused, unused, unused);