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

Add cpuid_get_total_cpus to allow getting the total number of CPUs on systems without CPUID.

This commit is contained in:
Robert Kausch 2014-09-27 15:51:48 +02:00 committed by Veselin Georgiev
parent 400c55dbe3
commit f7e6c6b274
2 changed files with 11 additions and 0 deletions

View file

@ -317,6 +317,11 @@ static void make_list_from_string(const char* csv, struct cpu_list_t* list)
/* Interface: */
int cpuid_get_total_cpus(void)
{
return get_total_cpus();
}
int cpuid_present(void)
{
return cpuid_exists_by_eflags();

View file

@ -399,6 +399,12 @@ struct cpu_mark_t {
uint64_t sys_clock; /*!< In microsecond resolution */
};
/**
* @brief Returns the total number of CPUs even if CPUID is not present
* @retval Number of CPUs available
*/
int cpuid_get_total_cpus(void);
/**
* @brief Checks if the CPUID instruction is supported
* @retval 1 if CPUID is present