34 lines
592 B
C
34 lines
592 B
C
//
|
|
// Created by rick on 12-02-21.
|
|
//
|
|
|
|
#include "cpuidx.h"
|
|
|
|
#include <types.h>
|
|
#include <cpuid.h>
|
|
#include <libc/kprintf.h>
|
|
|
|
union cpu_name {
|
|
uint32_t parts[3];
|
|
struct {
|
|
char name[12];
|
|
char end;
|
|
};
|
|
};
|
|
|
|
|
|
void cpuidx_print_info() {
|
|
union cpu_name name;
|
|
__get_cpuid(0, NULL, &name.parts[0], &name.parts[2], &name.parts[1]);
|
|
name.end = 0;
|
|
printf("CPU: %s\n", &name.name);
|
|
|
|
cpu_features_ecx features_ecx;
|
|
cpu_features_edx features_edx;
|
|
__get_cpuid(1, NULL, NULL, (uint32_t *) &features_ecx, (uint32_t *) &features_edx);
|
|
|
|
printf("");
|
|
|
|
|
|
}
|