mirror of
https://github.com/anrieff/libcpuid
synced 2025-10-03 11:01:30 +00:00
Documented the cpu listing functions better, tidy up cpuid_tool help
git-svn-id: https://svn.code.sf.net/p/libcpuid/code/HEAD/libcpuid@46 3b4be424-7ac5-41d7-8526-f4ddcb85d872
This commit is contained in:
parent
5ae4a8dd8e
commit
9f61c6c8e9
3 changed files with 24 additions and 22 deletions
|
@ -250,7 +250,7 @@ static int cpuid_basic_identify(struct cpu_raw_data_t* raw, struct cpu_id_t* dat
|
|||
data->brand_str[48] = 0;
|
||||
}
|
||||
load_features_common(raw, data);
|
||||
data->total_cpus = get_total_cpus();
|
||||
data->total_logical_cpus = get_total_cpus();
|
||||
return set_error(ERR_OK);
|
||||
}
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ struct cpu_id_t {
|
|||
* If you're writing a multithreaded program and you want to run it on
|
||||
* all CPUs, this is the number of threads you need.
|
||||
*/
|
||||
int32_t total_cpus;
|
||||
int32_t total_logical_cpus;
|
||||
|
||||
/**
|
||||
* L1 data cache size in KB. Could be zero, if the CPU lacks cache.
|
||||
|
@ -649,9 +649,13 @@ libcpuid_warn_fn_t cpuid_set_warn_function(libcpuid_warn_fn_t warn_fun);
|
|||
void cpuid_set_verbosiness_level(int level);
|
||||
|
||||
|
||||
/** @see cpuid_get_cpu_list */
|
||||
/**
|
||||
* @brief a structure that holds a list of processor names
|
||||
*/
|
||||
struct cpu_list_t {
|
||||
/** Number of entries in the list */
|
||||
int num_entries;
|
||||
/** Pointers to names. There will be num_entries of them */
|
||||
char **names;
|
||||
};
|
||||
|
||||
|
@ -665,13 +669,11 @@ struct cpu_list_t {
|
|||
* vendors. The list is written out in approximate chronological introduction
|
||||
* order of the parts.
|
||||
*
|
||||
* @param vendor - the vendor to be queried
|
||||
* @param list [out] - the resulting list will be written here. The `names'
|
||||
* field of the structure will hold the names (memory is
|
||||
* allocated by this function). `num_entries' will hold
|
||||
* the count.
|
||||
* @param vendor the vendor to be queried
|
||||
* @param list [out] the resulting list will be written here.
|
||||
* NOTE: As the memory is dynamically allocated, be sure to call
|
||||
* @see cpuid_free_cpu_list() after you're done with the data
|
||||
* cpuid_free_cpu_list() after you're done with the data
|
||||
* @see cpu_list_t
|
||||
*/
|
||||
void cpuid_get_cpu_list(cpu_vendor_t vendor, struct cpu_list_t* list);
|
||||
|
||||
|
@ -679,7 +681,7 @@ void cpuid_get_cpu_list(cpu_vendor_t vendor, struct cpu_list_t* list);
|
|||
* @brief Frees a CPU list
|
||||
*
|
||||
* This function deletes all the memory associated with a CPU list, as obtained
|
||||
* by @see cpuid_get_cpu_list()
|
||||
* by cpuid_get_cpu_list()
|
||||
*
|
||||
* @param list - the list to be free()'d.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue