diff --git a/libcpuid/cpuid_main.c b/libcpuid/cpuid_main.c index 4a3293c..99aea8e 100644 --- a/libcpuid/cpuid_main.c +++ b/libcpuid/cpuid_main.c @@ -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(); diff --git a/libcpuid/libcpuid.h b/libcpuid/libcpuid.h index f63b5a1..b78b0d6 100644 --- a/libcpuid/libcpuid.h +++ b/libcpuid/libcpuid.h @@ -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