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:
parent
400c55dbe3
commit
f7e6c6b274
2 changed files with 11 additions and 0 deletions
|
@ -317,6 +317,11 @@ static void make_list_from_string(const char* csv, struct cpu_list_t* list)
|
||||||
|
|
||||||
/* Interface: */
|
/* Interface: */
|
||||||
|
|
||||||
|
int cpuid_get_total_cpus(void)
|
||||||
|
{
|
||||||
|
return get_total_cpus();
|
||||||
|
}
|
||||||
|
|
||||||
int cpuid_present(void)
|
int cpuid_present(void)
|
||||||
{
|
{
|
||||||
return cpuid_exists_by_eflags();
|
return cpuid_exists_by_eflags();
|
||||||
|
|
|
@ -399,6 +399,12 @@ struct cpu_mark_t {
|
||||||
uint64_t sys_clock; /*!< In microsecond resolution */
|
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
|
* @brief Checks if the CPUID instruction is supported
|
||||||
* @retval 1 if CPUID is present
|
* @retval 1 if CPUID is present
|
||||||
|
|
Loading…
Reference in a new issue