sp1/amd64: cpu: Obtain processor vendor information
Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
@@ -36,12 +36,48 @@ cpu_print_info(struct cpu_info *ci)
|
||||
}
|
||||
|
||||
mcb = &ci->mcb;
|
||||
pr_trace("pg.nx : yes\n");
|
||||
pr_trace("cpu.model : %x\n", mcb->model_id);
|
||||
pr_trace("cpu.family : %x\n", mcb->family_id);
|
||||
pr_trace("pg.nx : yes\n");
|
||||
pr_trace("cpu.model : %x\n", mcb->model_id);
|
||||
pr_trace("cpu.family : %x\n", mcb->family_id);
|
||||
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
|
||||
cpu_get_info(struct cpu_info *ci)
|
||||
{
|
||||
@@ -55,6 +91,7 @@ cpu_get_info(struct cpu_info *ci)
|
||||
}
|
||||
|
||||
mcb = &ci->mcb;
|
||||
cpu_get_vendor();
|
||||
|
||||
/* Get processor info and feature bits */
|
||||
__cpuid(0x01, eax, unused, unused, unused);
|
||||
|
||||
Reference in New Issue
Block a user