1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2024-12-16 16:35:45 +00:00

Remove cpu_vendor() function, replaced by cpuid_get_vendor() function

This commit is contained in:
Xorg 2015-10-15 16:33:50 +02:00
parent a853fcd25b
commit b1cff440b7
3 changed files with 4 additions and 25 deletions

View file

@ -174,21 +174,6 @@ int match_pattern(const char* s, const char* p)
return 0;
}
int cpu_vendor(void)
{
int r;
struct cpu_raw_data_t raw;
struct cpu_id_t data;
if ((r = cpuid_get_raw_data(&raw)) < 0)
return set_error(r);
if ((r = cpu_identify(&raw, &data)) < 0)
return set_error(r);
if (0 <= data.vendor && data.vendor < NUM_CPU_VENDORS)
return data.vendor;
else
return set_error(r);
}
struct cpu_id_t* get_cached_cpuid(void)
{
static int initialized = 0;

View file

@ -70,12 +70,6 @@ void generic_get_cpu_list(const struct match_entry_t* matchtable, int count,
*/
int match_pattern(const char* haystack, const char* pattern);
/*
* Get the CPU vendor
* Return val: see enum cpu_vendor_t
*/
int cpu_vendor(void);
/*
* Gets an initialized cpu_id_t. It is cached, so that internal libcpuid
* machinery doesn't need to issue cpu_identify more than once.

View file

@ -465,7 +465,7 @@ int cpu_msrinfo(struct msr_driver_t* handle, cpu_msrinfo_request_t which)
return perfmsr_measure(handle, 0xe8);
case INFO_CUR_MULTIPLIER:
{
if(cpu_vendor() == VENDOR_INTEL)
if(cpuid_get_vendor() == VENDOR_INTEL)
{
if(!bclk)
bclk = (double) cpu_msrinfo(handle, INFO_BCLK) / 100;
@ -482,7 +482,7 @@ int cpu_msrinfo(struct msr_driver_t* handle, cpu_msrinfo_request_t which)
}
case INFO_MAX_MULTIPLIER:
{
if(cpu_vendor() == VENDOR_INTEL)
if(cpuid_get_vendor() == VENDOR_INTEL)
{
if(!multiplier)
multiplier = (int) cpu_rdmsr_range(handle, PLATFORM_INFO_MSR, PLATFORM_INFO_MSR_high, PLATFORM_INFO_MSR_low, &error_indx);
@ -494,7 +494,7 @@ int cpu_msrinfo(struct msr_driver_t* handle, cpu_msrinfo_request_t which)
return (int) ((r >> 40) & 0x1f) * 100;
}
case INFO_TEMPERATURE:
if(cpu_vendor() == VENDOR_INTEL)
if(cpuid_get_vendor() == VENDOR_INTEL)
{
// https://github.com/ajaiantilal/i7z/blob/5023138d7c35c4667c938b853e5ea89737334e92/helper_functions.c#L59
unsigned long val = cpu_rdmsr_range(handle, IA32_THERM_STATUS, 63, 0, &error_indx);
@ -512,7 +512,7 @@ int cpu_msrinfo(struct msr_driver_t* handle, cpu_msrinfo_request_t which)
return CPU_INVALID_VALUE;
case INFO_VOLTAGE:
{
if(cpu_vendor() == VENDOR_INTEL)
if(cpuid_get_vendor() == VENDOR_INTEL)
{
unsigned long val = cpu_rdmsr_range(handle, MSR_PERF_STATUS, 47, 32, &error_indx);
double ret = (double) val / (1 << 13);