X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcpuid%2Fcpuid.h;h=e923259292cc0c041218f51520e915777f75fae0;hb=319dadd4fa7af3f75b15bcb4f33b33f65d87a523;hp=eea6c31019db46c41baff0b1ef9ca5fcbb78d805;hpb=7d7de521a4feda7c65298b9e7bb0089405119555;p=ccan diff --git a/ccan/cpuid/cpuid.h b/ccan/cpuid/cpuid.h index eea6c310..e9232592 100644 --- a/ccan/cpuid/cpuid.h +++ b/ccan/cpuid/cpuid.h @@ -258,16 +258,16 @@ static char const *const c_cpunames[] = { * * Returns the CPU Type as cputype_t. * - * See also: cpuid_get_cpu_type_string() + * See also: cpuid_get_name() */ cputype_t cpuid_get_cpu_type(void); -static inline bool is_intel_cpu(void) +static inline bool cpuid_is_intel(void) { return cpuid_get_cpu_type() == CT_INTEL; } -static inline bool is_amd_cpu(void) +static inline bool cpuid_is_amd(void) { return cpuid_get_cpu_type() == CT_AMDK5 || cpuid_get_cpu_type() == CT_AMD; } @@ -306,6 +306,8 @@ uint32_t cpuid_highest_ext_func_supported(void); /** * cpuid - Get Some information from the CPU. + * @request: a cpuid_t + * @buf: output * * This function expects buf to be a valid pointer to a string/int/... * depending on the requested information. @@ -364,7 +366,7 @@ uint32_t cpuid_highest_ext_func_supported(void); * For CPUID_PROC_BRAND_STRING: * Have a char array with at least 48 bytes assigned to it. * - * If an invalid flag has been passed a 0xbaadf00d is returned in *buf. + * If an invalid request has been passed a 0xbaadf00d is returned in *buf. */ void cpuid(cpuid_t request, uint32_t *buf); @@ -403,7 +405,6 @@ bool cpuid_test_feature(cpuid_t feature); * cpuid_has_edxfeature. * See the enum for more information. * - * * Returns true if the feature is available, false otherwise. */ bool cpuid_has_ecxfeature(int feature); @@ -418,7 +419,7 @@ bool cpuid_has_edxfeature(int feature); * cpuid_has_edxfeature_ext. * See the enum for more information. * - * Test if the CPU supports this feature. + * Test if the CPU supports this extfeature. * Returns true on success, false otherwise. */ bool cpuid_has_ecxfeature_ext(int extfeature); @@ -428,10 +429,12 @@ bool cpuid_has_edxfeature_ext(int extfeature); #include #define cpuid_get_cpu_type() BUILD_ASSERT_OR_ZERO(0) -#define cpuid_get_cpu_type_string() BUILD_ASSERT_OR_ZERO(0) +#define cpuid_is_intel() BUILD_ASSERT_OR_ZERO(0) +#define cpuid_is_amd() BUILD_ASSERT_OR_ZERO(0) +#define cpuid_get_name() BUILD_ASSERT_OR_ZERO(0) #define cpuid_is_supported() BUILD_ASSERT_OR_ZERO(0) -#define cpuid(info, buf) BUILD_ASSERT_OR_ZERO(0) +#define cpuid(request, buf) BUILD_ASSERT_OR_ZERO(0) #define cpuid_write_info(info, featureset, outfile) BUILD_ASSERT_OR_ZERO(0) #define cpuid_highest_ext_func_supported() BUILD_ASSERT_OR_ZERO(0)