X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcpuid%2Fcpuid.h;h=7bf903a6db397af69c454cd20eab3a061d1b084a;hb=ef47a9814be99eb66c906c01a36dd19e3a5f69ee;hp=0a9fc9d91ac84bb1d98cc27e80bb1b5ae5a914da;hpb=a87884aabba198a1d44e22f89c5477f1b8167ffd;p=ccan diff --git a/ccan/cpuid/cpuid.h b/ccan/cpuid/cpuid.h index 0a9fc9d9..7bf903a6 100644 --- a/ccan/cpuid/cpuid.h +++ b/ccan/cpuid/cpuid.h @@ -26,7 +26,7 @@ #include /** - * enum cpuid - stuff to get information on from the CPU. + * enum cpuid - stuff to get information about from the CPU. * * This is used as a parameter in cpuid(). * @@ -124,14 +124,17 @@ typedef enum cputype { * * See also: cpuid_get_cpu_type_string() */ +#define is_intel_cpu() cpuid_get_cpu_type() == CT_INTEL +#define is_amd_cpu() cpuid_get_cpu_type() == CT_AMDK5 || cpuid_get_cpu_type() == CT_AMD cputype_t cpuid_get_cpu_type(void); /** - * cpuid_get_cpu_type_string - Get CPU Type string + * cpuid_sprintf_cputype - Get CPU Type string + * @cputype: a char of atleast 12 bytes in it. * - * Returns the CPU type string based off cputype_t. + * Returns true on success, false on failure */ -const char *cpuid_get_cpu_type_string(const cputype_t cputype); +bool cpuid_sprintf_cputype(const cputype_t cputype, char *buf); /** * cpuid_is_supported - test if the CPUID instruction is supported @@ -205,8 +208,14 @@ uint32_t cpuid_highest_ext_func_supported(void); * For CPU_EXTENDED_PROC_INFO_FEATURE_BITS: * Returns them in buf[0] and buf[1]. * + * For CPU_EXTENDED_L2_CACHE_FEATURES: + * buf[0]: Line size + * buf[1]: Associativity + * buf[2]: Cache size. + * * For CPU_VIRT_PHYS_ADDR_SIZES: - * Returns it as an integer in *buf. + * buf[0]: Physical + * buf[1]: Virtual * * For CPU_PROC_BRAND_STRING: * Have a char array with at least 48 bytes assigned to it. @@ -269,4 +278,3 @@ bool cpuid_has_feature(int feature, bool extended); #endif #endif -