mirror of
https://github.com/anrieff/libcpuid
synced 2025-02-12 20:24:05 +00:00
commit
c86fd1d0be
4 changed files with 129 additions and 22 deletions
7
debian/changelog
vendored
7
debian/changelog
vendored
|
@ -1,3 +1,10 @@
|
|||
libcpuid (0.4.0+ubuntu1~1) artful; urgency=low
|
||||
|
||||
* built for artful
|
||||
* got rid of lintian errors
|
||||
|
||||
-- Jeffrey Cliff <jeffrey.cliff@gmail.com> Fri, 20 Apr 2018 15:39:37 +0600
|
||||
|
||||
libcpuid (0.4.0) unstable; urgency=low
|
||||
|
||||
* Better detection of AMD clock multiplier with msrinfo.
|
||||
|
|
2
debian/control
vendored
2
debian/control
vendored
|
@ -1,5 +1,5 @@
|
|||
Source: libcpuid
|
||||
Section: utils
|
||||
Section: libs
|
||||
Priority: optional
|
||||
Maintainer: Zhang, Guodong <gdzhang@linx-info.com>
|
||||
Build-Depends: debhelper (>= 9), autotools-dev, libtool, automake, autoconf, python, doxygen
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
*/
|
||||
|
||||
/** @mainpage A simple libcpuid introduction
|
||||
*
|
||||
*
|
||||
* LibCPUID provides CPU identification and access to the CPUID and RDTSC
|
||||
* instructions on the x86.
|
||||
* <p>
|
||||
|
@ -82,6 +82,7 @@
|
|||
*/
|
||||
|
||||
/** @defgroup libcpuid LibCPUID
|
||||
* @brief LibCPUID provides CPU identification
|
||||
@{ */
|
||||
|
||||
/* Include some integer type specifications: */
|
||||
|
@ -535,23 +536,23 @@ typedef enum {
|
|||
* @brief Describes common library error codes
|
||||
*/
|
||||
typedef enum {
|
||||
ERR_OK = 0, /*!< "No error" */
|
||||
ERR_NO_CPUID = -1, /*!< "CPUID instruction is not supported" */
|
||||
ERR_NO_RDTSC = -2, /*!< "RDTSC instruction is not supported" */
|
||||
ERR_NO_MEM = -3, /*!< "Memory allocation failed" */
|
||||
ERR_OPEN = -4, /*!< "File open operation failed" */
|
||||
ERR_BADFMT = -5, /*!< "Bad file format" */
|
||||
ERR_NOT_IMP = -6, /*!< "Not implemented" */
|
||||
ERR_CPU_UNKN = -7, /*!< "Unsupported processor" */
|
||||
ERR_NO_RDMSR = -8, /*!< "RDMSR instruction is not supported" */
|
||||
ERR_NO_DRIVER= -9, /*!< "RDMSR driver error (generic)" */
|
||||
ERR_NO_PERMS = -10, /*!< "No permissions to install RDMSR driver" */
|
||||
ERR_EXTRACT = -11, /*!< "Cannot extract RDMSR driver (read only media?)" */
|
||||
ERR_HANDLE = -12, /*!< "Bad handle" */
|
||||
ERR_INVMSR = -13, /*!< "Invalid MSR" */
|
||||
ERR_INVCNB = -14, /*!< "Invalid core number" */
|
||||
ERR_HANDLE_R = -15, /*!< "Error on handle read" */
|
||||
ERR_INVRANGE = -16, /*!< "Invalid given range" */
|
||||
ERR_OK = 0, /*!< No error */
|
||||
ERR_NO_CPUID = -1, /*!< CPUID instruction is not supported */
|
||||
ERR_NO_RDTSC = -2, /*!< RDTSC instruction is not supported */
|
||||
ERR_NO_MEM = -3, /*!< Memory allocation failed */
|
||||
ERR_OPEN = -4, /*!< File open operation failed */
|
||||
ERR_BADFMT = -5, /*!< Bad file format */
|
||||
ERR_NOT_IMP = -6, /*!< Not implemented */
|
||||
ERR_CPU_UNKN = -7, /*!< Unsupported processor */
|
||||
ERR_NO_RDMSR = -8, /*!< RDMSR instruction is not supported */
|
||||
ERR_NO_DRIVER= -9, /*!< RDMSR driver error (generic) */
|
||||
ERR_NO_PERMS = -10, /*!< No permissions to install RDMSR driver */
|
||||
ERR_EXTRACT = -11, /*!< Cannot extract RDMSR driver (read only media?) */
|
||||
ERR_HANDLE = -12, /*!< Bad handle */
|
||||
ERR_INVMSR = -13, /*!< Invalid MSR */
|
||||
ERR_INVCNB = -14, /*!< Invalid core number */
|
||||
ERR_HANDLE_R = -15, /*!< Error on handle read */
|
||||
ERR_INVRANGE = -16, /*!< Invalid given range */
|
||||
} cpu_error_t;
|
||||
|
||||
/**
|
||||
|
@ -1108,7 +1109,7 @@ int cpu_msrinfo(struct msr_driver_t* handle, cpu_msrinfo_request_t which);
|
|||
|
||||
/**
|
||||
* @brief Writes the raw MSR data to a text file
|
||||
* @param data - a pointer to msr_driver_t structure
|
||||
* @param handle - a handle to the MSR reader driver, as created by cpu_msr_driver_open
|
||||
* @param filename - the path of the file, where the serialized data should be
|
||||
* written. If empty, stdout will be used.
|
||||
* @note This is intended primarily for debugging. On some processor, which is
|
||||
|
@ -1131,8 +1132,7 @@ int msr_serialize_raw_data(struct msr_driver_t* handle, const char* filename);
|
|||
* This function unloads the MSR driver opened by cpu_msr_driver_open and
|
||||
* frees any resources associated with it.
|
||||
*
|
||||
* @param handle - a handle to the MSR reader driver, as created by
|
||||
* cpu_msr_driver_open
|
||||
* @param handle - a handle to the MSR reader driver, as created by cpu_msr_driver_open
|
||||
*
|
||||
* @returns zero if successful, and some negative number on error.
|
||||
* The error message can be obtained by calling \ref cpuid_error.
|
||||
|
|
100
tests/intel/qemu/qemu.test
Normal file
100
tests/intel/qemu/qemu.test
Normal file
|
@ -0,0 +1,100 @@
|
|||
basic_cpuid[0]=00000004 756e6547 6c65746e 49656e69
|
||||
basic_cpuid[1]=000006d3 00000800 80002001 078bfbfd
|
||||
basic_cpuid[2]=00000001 00000000 00000000 002c307d
|
||||
basic_cpuid[3]=00000000 00000000 00000000 00000000
|
||||
basic_cpuid[4]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[5]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[6]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[7]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[8]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[9]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[10]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[11]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[12]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[13]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[14]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[15]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[16]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[17]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[18]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[19]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[20]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[21]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[22]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[23]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[24]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[25]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[26]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[27]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[28]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[29]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[30]=00000121 01c0003f 0000003f 00000001
|
||||
basic_cpuid[31]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[0]=8000000a 68747541 444d4163 69746e65
|
||||
ext_cpuid[1]=000006d3 00000000 00000001 2191abfd
|
||||
ext_cpuid[2]=554d4551 72695620 6c617574 55504320
|
||||
ext_cpuid[3]=72657620 6e6f6973 70632820 2d343675
|
||||
ext_cpuid[4]=6c656872 00002936 00000000 00000000
|
||||
ext_cpuid[5]=01ff01ff 01ff01ff 40020140 40020140
|
||||
ext_cpuid[6]=00000000 42004200 02008140 00000000
|
||||
ext_cpuid[7]=00000000 00000000 00000000 00000000
|
||||
ext_cpuid[8]=0000302e 00000000 00000000 00000000
|
||||
ext_cpuid[9]=00000000 00000000 00000000 00000000
|
||||
ext_cpuid[10]=00000001 00000010 00000000 00000000
|
||||
ext_cpuid[11]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[12]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[13]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[14]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[15]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[16]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[17]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[18]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[19]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[20]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[21]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[22]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[23]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[24]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[25]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[26]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[27]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[28]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[29]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[30]=00000121 01c0003f 0000003f 00000001
|
||||
ext_cpuid[31]=00000121 01c0003f 0000003f 00000001
|
||||
intel_fn4[0]=00000121 01c0003f 0000003f 00000001
|
||||
intel_fn4[1]=00000122 01c0003f 0000003f 00000001
|
||||
intel_fn4[2]=00000143 03c0003f 00000fff 00000001
|
||||
intel_fn4[3]=00000000 00000000 00000000 00000000
|
||||
intel_fn4[4]=00000000 00000000 00000000 00000000
|
||||
intel_fn4[5]=00000000 00000000 00000000 00000000
|
||||
intel_fn4[6]=00000000 00000000 00000000 00000000
|
||||
intel_fn4[7]=00000000 00000000 00000000 00000000
|
||||
intel_fn11[0]=00000121 01c0003f 0000003f 00000001
|
||||
intel_fn11[1]=00000122 01c0003f 0000003f 00000001
|
||||
intel_fn11[2]=00000143 03c0003f 00000fff 00000001
|
||||
intel_fn11[3]=00000000 00000000 00000000 00000000
|
||||
--------------------------------------------------------------------------------
|
||||
6
|
||||
13
|
||||
3
|
||||
6
|
||||
13
|
||||
1
|
||||
1
|
||||
32
|
||||
32
|
||||
4096
|
||||
-1
|
||||
-1
|
||||
8
|
||||
16
|
||||
-1
|
||||
-1
|
||||
64
|
||||
64
|
||||
-1
|
||||
-1
|
||||
64 (non-authoritative)
|
||||
Pentium M (Dothan)
|
||||
fpu de pse tsc msr pae mce cx8 apic mtrr sep pge mca cmov pat pse36 clflush mmx fxsr sse sse2 pni cx16 syscall xd lm lahf_lm
|
Loading…
Add table
Reference in a new issue