#include <stdint.h>
/**
- * 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().
*
CPU_HIGHEST_EXTENDED_FUNCTION_SUPPORTED = 0x80000000,
CPU_EXTENDED_PROC_INFO_FEATURE_BITS = 0x80000001,
- CPU_PROC_BRAND_STRING = 0x80000002,
+ CPU_PROC_BRAND_STRING = 0x80000002,
CPU_L1_CACHE_AND_TLB_IDS = 0x80000005,
CPU_EXTENDED_L2_CACHE_FEATURES = 0x80000006,
CPU_ADV_POWER_MGT_INFO = 0x80000007,
*
* 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
* 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.
#endif
#endif
-