Now USE libcpuid14. Remove i-nex-cpuid binary

This commit is contained in:
eloaders 2016-11-08 13:29:13 +01:00
parent fe49fd7021
commit 04863f115e
12 changed files with 301 additions and 1591 deletions

View File

@ -1,71 +0,0 @@
' Gambas module file
' Gambas module file
Library "libcpuid:14"
Public Struct cpu_id_t
vendor_str As String
brand_str As String
vendor As Integer
family As Integer
model As Integer
stepping As Integer
ext_family As Integer
ext_model As Integer
num_cores As Integer
num_logical_cpus As Integer
total_logical_cpus As Integer
l1_data_cache As Integer
l1_instruction_cache As Integer
l2_cache As Long
l3_cache As Long
l4_cache As Long
l1_assoc As Long
l2_assoc As Long
l3_assoc As Long
l4_assoc As Long
l1_cacheline As Long
l2_cacheline As Long
l3_cacheline As Long
l4_cacheline As Long
cpu_codename As String
sse_size As Integer
detection_hints As Integer
End Struct
Public Struct cpu_mark_t
tsc As Long
sys_clock As Long
End Struct
' int sysinfo (struct sysinfo *__info)
' Returns information on overall system statistics.
Private Extern cpuid_get_total_cpus() As Integer
Private Extern cpu_mark_t() As Integer
Private Extern cpu_id_t() As Integer
Public Logs As New Logger
Public Sub Main()
Dim si As New Cpu_id_t
Dim err As Integer
' err = cpu_id_t(si)
' If err < 0 Then
' Logs("Libcpuid cpu_id_t Error", Logger.Error)
' Elsepu_exec_cpuid()
Print cpuid_get_total_cpus()
Print si.brand_str
Print si.cpu_codename
Print si.detection_hints
Print si.ext_family
Print si.ext_model
Print si.family
Print si.l1_assoc
Print si.l1_cacheline
Print si.l1_data_cache
Print si.l1_instruction_cache
Print si.l2_assoc
Print si.l2_cache
'Endif
End

View File

@ -1,2 +0,0 @@
' Gambas module file

View File

@ -1,114 +0,0 @@
' Gambas module file
Private ToolButton[99] As ToolButton
Private Label[99] As Label ' Dim the array of controls
Private Button[99] As Button
Private TextLabel[99] As TextLabel
Private YESNO As Picture
Public Logs As New Logger
Public BUFFER As String
Public DATAT As Collection
Public Sub Libcpuid()
Dim i As Integer
Logs("Check whereis inex-cpuid and get JSON Data", Logger.Info)
Exec [ChkPrm.ChkExecDir("i-nex-cpuid")] Wait To BUFFER
Logs("Decode JSON Data", Logger.Info)
DATAT = JSON.Decode(BUFFER)
Logs("Add Values CPUID", Logger.Info)
Finfosys.Label92.Text = DATAT["VENDOR_STR"]
Finfosys.Label193.Text = DATAT["CPU_CODENAME"]
Finfosys.Label194.Text = DATAT["BRAND_STR"]
Finfosys.Label195.Text = "Cores: " & DATAT["NUM_CORES"]
Finfosys.Label196.Text = "Logical CPUS: " & DATAT["NUM_LOGICAL_CPUS"]
Finfosys.Label197.Text = "Total Logical CPUS: " & DATAT["TOTAL_LOGICAL_CPUS"]
Finfosys.Label198.Text = "Family: " & DATAT["FAMILY"]
Finfosys.Label199.Text = "Model: " & DATAT["MODEL"]
Finfosys.Label200.Text = "Stepping: " & DATAT["STEPPING"]
Finfosys.Label201.Text = "Ext Family: " & DATAT["EXT_FAMILY"]
Finfosys.Label202.Text = "Ext Model: " & DATAT["EXT_MODEL"]
Finfosys.Label203.Text = "CPU Clock: " & DATAT["CPU_CLOCK"]
Finfosys.Label204.Text = "CPU Clock BY OS: " & DATAT["CPU_CLOCK_BY_OS"]
Finfosys.Label205.Text = "CPU Clock BY IC: " & DATAT["CPU_CLOCK_BY_IC"]
Finfosys.Label206.Text = "CPU Clock Measure: " & DATAT["CPU_CLOCK_MEASURE"]
Finfosys.Label207.Text = "Mark TSC: " & DATAT["MARK_TSC"]
Finfosys.Label208.Text = "Mark SYS Clock: " & DATAT["MARK_SYS_CLOCK"]
Finfosys.Label209.Text = "L1 D: " & DATAT["L1_DATA_CACHE"]
Finfosys.Label210.Text = "L1 I: " & DATAT["L1_INSTRUCTION_CACHE"]
Finfosys.Label211.Text = "L2 Cache: " & DATAT["L2_CACHE"]
Finfosys.Label212.Text = "L3 Cache: " & DATAT["L3_CACHE"]
Finfosys.Label213.Text = "L1 Assoc: " & DATAT["L1_ASSOC"]
Finfosys.Label214.Text = "L2 Assoc: " & DATAT["L2_ASSOC"]
Finfosys.Label215.Text = "L3 Assoc: " & DATAT["L3_ASSOC"]
Finfosys.Label216.Text = "L1 line: " & DATAT["L1_CACHELINE"]
Finfosys.Label217.Text = "L2 line: " & DATAT["L2_CACHELINE"]
Finfosys.Label218.Text = "L3 line: " & DATAT["L3_CACHELINE"]
Finfosys.Label219.Text = "SSE Size: " & DATAT["SSE_SIZE"]
Logs("Create Labels ToolButtons TextLabels in Finfosys.ScrollView1", Logger.Info)
For i = 1 To 98
Label[i] = New Label(Finfosys.ScrollView1)
ToolButton[i] = New ToolButton(Finfosys.ScrollView1)
Button[i] = New Button(Finfosys.ScrollView1) As "Buttongroup"
TextLabel[i] = New TextLabel(Finfosys.ScrollView1)
If DATAT["Flags"][i]["VALUE"] = 1 Then
YESNO = Picture["Data/check_true.png"]
Else
YESNO = Picture["Data/check_false.png"]
Endif
With Label[i]
.X = 2
.Y = 310 + Int(i * 20)
.Width = 440
.Height = 21
.Border = Border.Raised
.Padding = 0
.Font.Size = 8
.Tooltip = DATAT["Flags"][i]["NAME"]
.Text = DATAT["Flags"][i]["DESC"]
If DATAT["Flags"][i]["NAME"] = "CPU_FEATURE_RESERVED" Then
.Visible = False
Endif
End With
With ToolButton[i]
.X = 420
.Y = 310 + Int(i * 20)
.Width = 21
.Height = 21
.Picture = YESNO
.Tooltip = DATAT["Flags"][i]["VALUE"]
If DATAT["Flags"][i]["NAME"] = "CPU_FEATURE_RESERVED" Then
.Visible = False
Endif
End With
With Button[i]
.X = 400
.Y = 310 + Int(i * 20)
.Width = 21
.Height = 21
.Font.Bold = True
.Font.Size = 8
.Foreground = 6
.Tooltip = "Open Wikipedia page about this processor feature\n" & DATAT["Flags"][i]["WEBSITE"] & ""
.Name = DATAT["Flags"][i]["WEBSITE"]
.Visible = DATAT["Flags"][i]["HAVEWEBSITE"]
.Picture = Picture["AppIcons/applications-internet.png"]
End With
With TextLabel[i]
.X = 320
.Y = 310 + Int(i * 20)
.Width = 80
.Height = 21
.Font.Bold = True
.Font.Size = 8
.Foreground = 6
.Alignment = Align.Center
.Text = DATAT["Flags"][i]["FEATURE"]
If DATAT["Flags"][i]["NAME"] = "CPU_FEATURE_RESERVED" Then
.Visible = False
Endif
End With
Next
End

View File

@ -4,138 +4,6 @@
' http://www.gambas-it.org/smf/index.php?action=profile;u=402
Library "libcpuid:14.0.0"
Private Enum CPU_HINT_SSE_SIZE_AUTH = 0, NUM_CPU_HINTS
Private Enum CPU_FEATURE_FPU,
CPU_FEATURE_VME,
CPU_FEATURE_DE,
CPU_FEATURE_PSE,
CPU_FEATURE_TSC,
CPU_FEATURE_MSR,
CPU_FEATURE_PAE,
CPU_FEATURE_MCE, '!< Machine check exception */
CPU_FEATURE_CX8, '!< CMPXCHG8B instruction supported */
CPU_FEATURE_APIC, '!< APIC support */
CPU_FEATURE_MTRR, '!< Memory type range registers */
CPU_FEATURE_SEP, '!< SYSENTER / SYSEXIT instructions supported */
CPU_FEATURE_PGE, '!< Page global enable */
CPU_FEATURE_MCA, '!< Machine check architecture */
CPU_FEATURE_CMOV, '!< CMOVxx instructions supported */
CPU_FEATURE_PAT, '!< Page attribute table */
CPU_FEATURE_PSE36, '!< 36-bit page address extension */
CPU_FEATURE_PN, '!< Processor serial # implemented (Intel P3 only) */
CPU_FEATURE_CLFLUSH, '!< CLFLUSH instruction supported */
CPU_FEATURE_DTS, '!< Debug store supported */
CPU_FEATURE_ACPI, '!< ACPI support (power states) */
CPU_FEATURE_MMX, '!< MMX instruction set supported */
CPU_FEATURE_FXSR, '!< FXSAVE / FXRSTOR supported */
CPU_FEATURE_SSE, '!< Streaming-SIMD Extensions (SSE) supported */
CPU_FEATURE_SSE2, '!< SSE2 instructions supported */
CPU_FEATURE_SS, '!< Self-snoop */
CPU_FEATURE_HT, '!< Hyper-threading supported (but might be disabled) */
CPU_FEATURE_TM, '!< Thermal monitor */
CPU_FEATURE_IA64, '!< IA64 supported (Itanium only) */
CPU_FEATURE_PBE, '!< Pending-break enable */
CPU_FEATURE_PNI, '!< PNI (SSE3) instructions supported */
CPU_FEATURE_PCLMUL, '!< PCLMULQDQ instruction supported */
CPU_FEATURE_DTS64, '!< 64-bit Debug store supported */
CPU_FEATURE_MONITOR, '!< MONITOR / MWAIT supported */
CPU_FEATURE_DS_CPL, '!< CPL Qualified Debug Store */
CPU_FEATURE_VMX, '!< Virtualization technology supported */
CPU_FEATURE_SMX, '!< Safer mode exceptions */
CPU_FEATURE_EST, '!< Enhanced SpeedStep */
CPU_FEATURE_TM2, '!< Thermal monitor 2 */
CPU_FEATURE_SSSE3, '!< SSSE3 instructionss supported (this is different from SSE3!) */
CPU_FEATURE_CID, '!< Context ID supported */
CPU_FEATURE_CX16, '!< CMPXCHG16B instruction supported */
CPU_FEATURE_XTPR, '!< Send Task Priority Messages disable */
CPU_FEATURE_PDCM, '!< Performance capabilities MSR supported */
CPU_FEATURE_DCA, '!< Direct cache access supported */
CPU_FEATURE_SSE4_1, '!< SSE 4.1 instructions supported */
CPU_FEATURE_SSE4_2, '!< SSE 4.2 instructions supported */
CPU_FEATURE_SYSCALL, '!< SYSCALL / SYSRET instructions supported */
CPU_FEATURE_XD, '!< Execute disable bit supported */
CPU_FEATURE_MOVBE, '!< MOVBE instruction supported */
CPU_FEATURE_POPCNT, '!< POPCNT instruction supported */
CPU_FEATURE_AES, '!< AES* instructions supported */
CPU_FEATURE_XSAVE, '!< XSAVE/XRSTOR/etc instructions supported */
CPU_FEATURE_OSXSAVE, '!< non-privileged copy of OSXSAVE supported */
CPU_FEATURE_AVX, '!< Advanced vector extensions supported */
CPU_FEATURE_MMXEXT, '!< AMD MMX-extended instructions supported */
CPU_FEATURE_3DNOW, '!< AMD 3DNow! instructions supported */
CPU_FEATURE_3DNOWEXT, '!< AMD 3DNow! extended instructions supported */
CPU_FEATURE_NX, '!< No-execute bit supported */
CPU_FEATURE_FXSR_OPT, '!< FFXSR: FXSAVE and FXRSTOR optimizations */
CPU_FEATURE_RDTSCP, '!< RDTSCP instruction supported (AMD-only) */
CPU_FEATURE_LM, '!< Long mode (x86_64/EM64T) supported */
CPU_FEATURE_LAHF_LM, '!< LAHF/SAHF supported in 64-bit mode */
CPU_FEATURE_CMP_LEGACY, '!< core multi-processing legacy mode */
CPU_FEATURE_SVM, '!< AMD Secure virtual machine */
CPU_FEATURE_ABM, '!< LZCNT instruction support */
CPU_FEATURE_MISALIGNSSE, '!< Misaligned SSE supported */
CPU_FEATURE_SSE4A, '!< SSE 4a from AMD */
CPU_FEATURE_3DNOWPREFETCH, '!< PREFETCH/PREFETCHW support */
CPU_FEATURE_OSVW, '!< OS Visible Workaround (AMD) */
CPU_FEATURE_IBS, '!< Instruction-based sampling */
CPU_FEATURE_SSE5, '!< SSE 5 instructions supported (deprecated, will never be 1) */
CPU_FEATURE_SKINIT, '!< SKINIT / STGI supported */
CPU_FEATURE_WDT, '!< Watchdog timer support */
CPU_FEATURE_TS, '!< Temperature sensor */
CPU_FEATURE_FID, '!< Frequency ID control */
CPU_FEATURE_VID, '!< Voltage ID control */
CPU_FEATURE_TTP, '!< THERMTRIP */
CPU_FEATURE_TM_AMD, '!< AMD-specified hardware thermal control */
CPU_FEATURE_STC, '!< Software thermal control */
CPU_FEATURE_100MHZSTEPS, '!< 100 MHz multiplier control */
CPU_FEATURE_HWPSTATE, '!< Hardware P-state control */
CPU_FEATURE_CONSTANT_TSC, '!< TSC ticks at constant rate */
CPU_FEATURE_XOP, '!< The XOP instruction set (same as the old CPU_FEATURE_SSE5) */
CPU_FEATURE_FMA3, '!< The FMA3 instruction set */
CPU_FEATURE_FMA4, '!< The FMA4 instruction set */
CPU_FEATURE_TBM, '!< Trailing bit manipulation instruction support */
CPU_FEATURE_F16C, '!< 16-bit FP convert instruction support */
CPU_FEATURE_RDRAND, '!< RdRand instruction */
CPU_FEATURE_X2APIC, '!< x2APIC, APIC_BASE.EXTD, MSRs 0000_0800h...0000_0BFFh 64-bit ICR (+030h but not +031h), no DFR (+00Eh), SELF_IPI (+040h) also see standard level 0000_000Bh */
CPU_FEATURE_CPB, '!< Core performance boost */
CPU_FEATURE_APERFMPERF, '!< MPERF/APERF MSRs support */
CPU_FEATURE_PFI, '!< Processor Feedback Interface support */
CPU_FEATURE_PA, '!< Processor accumulator */
CPU_FEATURE_AVX2, '!< AVX2 instructions */
CPU_FEATURE_BMI1, '!< BMI1 instructions */
CPU_FEATURE_BMI2, '!< BMI2 instructions */
CPU_FEATURE_HLE, '!< Hardware Lock Elision prefixes */
CPU_FEATURE_RTM, '!< Restricted Transactional Memory instructions */
CPU_FEATURE_AVX512F, '!< AVX-512 Foundation */
CPU_FEATURE_AVX512DQ, '!< AVX-512 Double/Quad granular insns */
CPU_FEATURE_AVX512PF, '!< AVX-512 Prefetch */
CPU_FEATURE_AVX512ER, '!< AVX-512 Exponential/Reciprocal */
CPU_FEATURE_AVX512CD, '!< AVX-512 Conflict detection */
CPU_FEATURE_SHA_NI, '!< SHA-1/SHA-256 instructions */
CPU_FEATURE_AVX512BW, '!< AVX-512 Byte/Word granular insns */
CPU_FEATURE_AVX512VL, '!< AVX-512 128/256 vector length extensions */
CPU_FEATURE_SGX, '!< SGX extensions. Non-autoritative, check cpu_id_t::sgx::present to verify presence */
CPU_FEATURE_RDSEED, '!< RDSEED instruction */
CPU_FEATURE_ADX,
NUM_CPU_FEATURES
Private Enum VENDOR_INTEL = 0, '/*!< Intel CPU */
VENDOR_AMD, '/*!< AMD CPU */
VENDOR_CYRIX, '/*!< Cyrix CPU */
VENDOR_NEXGEN, '/*!< NexGen CPU */
VENDOR_TRANSMETA, '/*!< Transmeta CPU */
VENDOR_UMC, '/*!< x86 CPU by UMC */
VENDOR_CENTAUR, '/*!< x86 CPU by IDT */
VENDOR_RISE, '/*!< x86 CPU by Rise Technology */
VENDOR_SIS, '/*!< x86 CPU by SiS */
VENDOR_NSC, '/*!< x86 CPU by National Semiconductor */
NUM_CPU_VENDORS, '/*!< Valid CPU vendor ids: 0..NUM_CPU_VENDORS - 1 */
VENDOR_UNKNOWN = -1
Public Struct cpu_list_t
num_entries As Integer
names As String
End Struct
Public Struct cpu_raw_data_t
basic_cpuid[32, 4] As Integer
ext_cpuid[32, 4] As Integer
@ -145,59 +13,11 @@ Public Struct cpu_raw_data_t
intel_fn14h[4, 4] As Integer
End Struct
Public Struct cpu_sgx_t
present As Integer
max_enclave_32bit As Byte
max_enclave_64bit As Byte
flags[14] As Byte
num_epc_sections As Integer
misc_select As Integer
secs_attributes As Long
secs_xfrm As Long
End Struct
Public Struct cpu_id_t
vendor_str[16] As Byte ' 0 - 15
brand_str[64] As Byte ' 16 - 79
vendor As Integer ' 80 - 83
flags[124] As Byte ' 84 - 211
family As Integer ' 212 - 215
model As Integer ' 216 - 219
stepping As Integer ' 220 - 223
ext_family As Integer ' 224 - 227
ext_model As Integer ' 228 - 231
num_cores As Integer ' 232 - 235
num_logical_cpus As Integer ' 236 - 239
total_logical_cpus As Integer ' 240 - 243
l1_data_cache As Integer ' 244 - 247
l1_instruction_cache As Integer ' 248 - 251
l2_cache As Integer ' 252 - 255
l3_cache As Integer ' 256 - 259
l4_cache As Integer ' 260 - 263
l1_assoc As Integer ' 264 - 267
l2_assoc As Integer ' 268 - 271
l3_assoc As Integer ' 272 - 275
l4_assoc As Integer ' 276 - 279
l1_cacheline As Integer ' 280 - 283
l2_cacheline As Integer ' 284 - 287
l3_cacheline As Integer ' 288 - 291
l4_cacheline As Integer ' 292 - 295
cpu_codename[64] As Byte ' 296 - 359
sse_size As Integer ' 360 - 363
detection_hints[16] As Byte ' 364 - 379
sgx As Struct Cpu_sgx_t ' 380 - 431
End Struct
Public Struct cpu_mark_t
tsc As Long
sys_clock As Long
End Struct
Public Struct cpu_epc_t
start_addr As Long
length As Long
End Struct
' int cpuid_present(void)
' Checks if the CPUID instruction is supported.
Private Extern cpuid_present() As Integer
@ -206,23 +26,13 @@ Private Extern cpuid_present() As Integer
' Obtains the raw CPUID data from the current CPU.
Private Extern cpuid_get_raw_data(data As Cpu_raw_data_t) As Integer
'/ * *
' * @brief Returns the short textual representation Of a CPU flag
' * @param feature - the feature, whose textual representation Is Wanted.
' * @returns a constant string Like "fpu", "tsc", "sse2", etc.
' * @note the names Of the returned flags are compatible With those From
' * / proc / cpuinfo In Linux, With the exception Of `tm_amd'
' * /
'Const char * cpu_feature_str(cpu_feature_t feature);
Private Extern cpu_feature_str(cpu_feature_t As Integer) As String
' const char* cpuid_error(void)
' Returns textual description of the last error.
Private Extern cpuid_error() As String
' int cpu_identify(struct cpu_raw_data_t* raw, struct cpu_id_t* data)
' Identifies the CPU.
Private Extern cpu_identify(raw As Cpu_raw_data_t, data As Cpu_id_t) As Integer
Private Extern cpu_identify(raw As Cpu_raw_data_t, data As Pointer) As Integer
' void cpu_tsc_mark(struct cpu_mark_t* mark)
' Store TSC and timing info.
@ -236,11 +46,6 @@ Private Extern cpu_tsc_unmark(mark As Cpu_mark_t)
' Get the CPU clock frequency (all-in-one method).
Private Extern cpu_clock() As Integer
'cpu_vendor_t cpuid_get_vendor(void);
Private Extern cpuid_get_vendor() As Integer
'void cpuid_get_cpu_list(cpu_vendor_t vendor, struct cpu_list_t* list);
Private Extern cpuid_get_cpu_list(cpu_vendor_t As String, list As Cpu_list_t) As String
' int cpu_clock_by_os(void)
' Returns the CPU clock, as reported by the OS.
Private Extern cpu_clock_by_os() As Integer
@ -253,69 +58,298 @@ Private Extern cpu_clock_by_ic(millis As Integer, runs As Integer) As Integer
' Measure the CPU clock frequency.
Private Extern cpu_clock_measure(millis As Integer, quad_check As Integer) As Integer
' const char * cpu_feature_str(cpu_feature_t feature)
' Returns the short textual representation Of a CPU flag.
Private Extern cpu_feature_str(feature As Integer) As String
Private sa As ScrollArea
Public Sub Main()
Dim obs As Observer
Dim TextBox As TextBox
Dim TextArea As TextArea
Dim raw As New Cpu_raw_data_t
Dim data As New Cpu_id_t
Dim data As Pointer
Dim mark As New Cpu_mark_t
Dim names As New Cpu_list_t
Dim au As String
Dim dataflags As Pointer
Dim cpu_vendor As String[]
Dim i As Integer
If Not cpuid_present() Then Error.Raise("Sorry, your CPU doesn't support CPUID !")
dataflags = Alloc(SizeOf(gb.Byte), 432)
cpu_vendor = ["Intel CPU", "AMD CPU", "Cyrix CPU", "NexGen CPU", "Transmeta CPU", "x86 CPU by UMC", "x86 CPU by IDT",
"x86 CPU by Rise Technology", "x86 CPU by SiS", "x86 CPU by National Semiconductor", ""]
If Not cpuid_present() Then Error.Raise("La CPUID non è supportata !")
If cpuid_get_raw_data(raw) < 0 Then
Error.Raise("Sorry, cannot get the CPUID raw data.\nError: " & cpuid_error())
Error.Raise("Impossibile ottenere dati grezzi CPUID !\nError: " & cpuid_error())
Endif
data = Alloc(SizeOf(gb.Byte), 432)
If cpu_identify(raw, data) < 0 Then
Error.Raise("Sorry, CPU identification failed.\nError: " & cpuid_error())
Error.Raise("Impossibile identificare la CPU !\nError: " & cpuid_error())
Endif
If cpu_identify(raw, dataflags) < 0 Then
Error.Raise("Sorry, CPU identification failed.\nError: " & cpuid_error())
Endif
cpu_tsc_mark(mark)
cpu_tsc_unmark(mark)
Print " \"VENDOR_STR\": "; String@(data.vendor_str.data)
Print " \"CPU_CODENAME\": "; String@(data.cpu_codename.data)
Print " \"BRAND_STR\": "; String@(data.brand_str.data)
Print " \"VENDOR\": "; data.vendor
Print " \"NUM_CORES\": "; data.num_cores
Print " \"NUM_LOGICAL_CPUS\": "; data.num_logical_cpus
Print " \"TOTAL_LOGICAL_CPUS\": "; data.total_logical_cpus
Print " \"FAMILY\": "; data.family
Print " \"MODEL\": "; data.model
Print " \"STEPPING\": "; data.stepping
Print " \"EXT_FAMILY\": "; data.ext_family
Print " \"EXT_MODEL\": "; data.ext_model
au = IIf(data.detection_hints[CPU_HINT_SSE_SIZE_AUTH], "(authoritative)", "(non-authoritative)")
Print " \"SSE_SIZE\": "; data.sse_size; " bit "; au
Print " \"CPU_CLOCK\": "; cpu_clock(); " Mhz"
Print " \"CPU_CLOCK_BY_OS\": "; cpu_clock_by_os(); " Mhz"
Print " \"CPU_CLOCK_BY_IC\": "; cpu_clock_by_ic(25, 16); " Mhz"
Print " \"CPU_CLOCK_MEASURE\": "; cpu_clock_measure(400, 1); " Mhz"
Print " \"L1_DATA_CACHE\": "; data.l1_data_cache; " KB"
Print " \"L1_INSTRUCTION_CACHE\": "; data.l1_instruction_cache; " KB"
Print " \"L1_CACHELINE\": "; data.l1_cacheline; " bytes"
Print " \"L1_ASSOC\": "; data.l1_assoc; "-way"
Print " \"L2_CACHE\": "; data.l2_cache; " KB"
Print " \"L2_ASSOC\": "; data.l2_assoc; "-way"
Print " \"L2_CACHELINE\": "; data.l2_cacheline; " bytes"
Print " \"L3_CACHE\": "; data.l3_cache; " KB"
Print " \"L3_ASSOC\": "; data.l3_assoc; "-way"
Print " \"L3_CACHELINE\": "; data.l3_cacheline; " bytes"
Print " \"L4_CACHE\": "; data.l4_cache; " KB"
Print " \"L4_ASSOC\": "; data.l4_assoc; "-way"
Print " \"L4_CACHELINE\": "; data.l4_cacheline; " bytes"
Print " \"MARK_TSC\": "; mark.tsc
Print " \"MARK_SYS_CLOCK\": "; mark.sys_clock
For i = 0 To 109
Print " \"FEATURE\": "; cpu_feature_str(i); IIf(Byte@(dataflags + (i + 84)), " Present", " Absent")
Next
cpu_tsc_mark(mark)
cpu_tsc_unmark(mark)
Free(dataflags)
sa = Finfosys.GridView4.Children[0]
obs = New Observer(sa) As "Scroll"
With Finfosys.GridView4
.Columns.Count = 1
.Rows.Count = 20
End With
Finfosys.GridView4.Columns[0].W = 400
With TextBox = New TextBox(sa) As "CPU_VENDOR"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[0].Y
.W = Finfosys.GridView4[0, 0].W
.H = Finfosys.GridView4[0, 0].H
.Text = "CPU Vendor: " & String@(data)
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "CPU_CODENAME"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[1].Y
.W = Finfosys.GridView4[1, 0].W
.H = Finfosys.GridView4[1, 0].H
.Text = "CPU Codename: " & String@(data + 296)
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "CPU_BRAND"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[2].Y
.W = Finfosys.GridView4[2, 0].W
.H = Finfosys.GridView4[2, 0].H
.Text = "CPU Brand: " & String@(data + 16)
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "VENDOR"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[3].Y
.W = Finfosys.GridView4[3, 0].W
.H = Finfosys.GridView4[3, 0].H
.Text = "CPU Vendor: " & IIf(Int@(data + 80) = -1, "Not found", cpu_vendor[Int@(data + 80)])
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "FAMILY"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[4].Y
.W = Finfosys.GridView4[4, 0].W
.H = Finfosys.GridView4[4, 0].H
.Text = "CPU Family: " & Int@(data + 212)
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "MODEL"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[5].Y
.W = Finfosys.GridView4[5, 0].W
.H = Finfosys.GridView4[5, 0].H
.Text = "CPU Model: " & Int@(data + 216)
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "STEPPING"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[6].Y
.W = Finfosys.GridView4[6, 0].W
.H = Finfosys.GridView4[6, 0].H
.Text = "CPU Stepping: " & Int@(data + 220)
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "EXT_FAMILY"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[7].Y
.W = Finfosys.GridView4[7, 0].W
.H = Finfosys.GridView4[7, 0].H
.Text = "CPU Ext family: " & Int@(data + 224)
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "EXT_MODEL"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[8].Y
.W = Finfosys.GridView4[8, 0].W
.H = Finfosys.GridView4[8, 0].H
.Text = "CPU Ext model: " & Int@(data + 228)
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "NUM_CORES"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[9].Y
.W = Finfosys.GridView4[9, 0].W
.H = Finfosys.GridView4[9, 0].H
.Text = "CPU Num cores: " & Int@(data + 232)
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "NUM_LOGICAL_CPUS"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[10].Y
.W = Finfosys.GridView4[10, 0].W
.H = Finfosys.GridView4[10, 0].H
.Text = "CPU Num logical cpus: " & Int@(data + 236)
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "TOTAL_LOGICAL_CPUS"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[11].Y
.W = Finfosys.GridView4[11, 0].W
.H = Finfosys.GridView4[11, 0].H
.Text = "CPU Total logical cpus: " & Int@(data + 240)
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "L1_DATA_CACHE"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[12].Y
.W = Finfosys.GridView4[12, 0].W
.H = Finfosys.GridView4[12, 0].H
.Text = "L1 Data Cache: " & Int@(data + 244) & " KB" &
", Assoc: " & IIf(Int@(data + 264) > 0, Int@(data + 264) & "-way", "intedeterminato") &
", Cacheline: " & IIf(Int@(data + 280) > 0, Int@(data + 280) & " byte", "intedeterminato")
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "L1_INSTRUCTION_CACHE"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[13].Y
.W = Finfosys.GridView4[13, 0].W
.H = Finfosys.GridView4[13, 0].H
.Text = "L1 Instruction Cache: " & Int@(data + 248) & " KB"
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "L2_CACHE"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[14].Y
.W = Finfosys.GridView4[14, 0].W
.H = Finfosys.GridView4[14, 0].H
.Text = "L2 Cache: " & Int@(data + 252) & " KB" &
", Assoc: " & IIf(Int@(data + 268) > 0, Int@(data + 268) & "-way", "undetermined") &
", Cacheline: " & IIf(Int@(data + 284) > 0, Int@(data + 280) & " byte", "undetermined")
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "L3_CACHE"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[15].Y
.W = Finfosys.GridView4[15, 0].W
.H = Finfosys.GridView4[15, 0].H
.Text = "L3 Cache: " & Int@(data + 256) & " KB" &
", Assoc: " & IIf(Int@(data + 272) > 0, Int@(data + 272) & "-way", "undetermined") &
", Cacheline: " & IIf(Int@(data + 288) > 0, Int@(data + 288) & " byte", "undetermined")
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "L4_CACHE"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[16].Y
.W = Finfosys.GridView4[16, 0].W
.H = Finfosys.GridView4[16, 0].H
.Text = "L4 Cache: " & Int@(data + 260) & " KB" &
", Assoc: " & IIf(Int@(data + 276) > 0, Int@(data + 276) & "-way", "undetermined") &
", Cacheline: " & IIf(Int@(data + 292) > 0, Int@(data + 292) & " byte", "undetermined")
.Border = False
.ReadOnly = True
End With
au = IIf(Byte@(data + 364), "(authoritative)", "(non-authoritative)")
With TextBox = New TextBox(sa) As "SSE_SIZE"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[17].Y
.W = Finfosys.GridView4[17, 0].W
.H = Finfosys.GridView4[17, 0].H
.Text = "SSE Size: " & Int@(data + 360) & " bit " & au
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "CPU_CLOCK"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[18].Y
.W = Finfosys.GridView4[18, 0].W
.H = Finfosys.GridView4[18, 0].H
.Text = "CPU Clock: " & cpu_clock() & " Mhz" &
", By OS:" & cpu_clock_by_os() & " Mhz" &
", By IC:" & cpu_clock_by_ic(25, 16) & " Mhz" &
", Measure:" & cpu_clock_measure(400, 1) & " Mhz"
.Border = False
.ReadOnly = True
End With
With TextBox = New TextBox(sa) As "CPU_MARK_TSC"
.X = Finfosys.GridView4.Columns[0].X
.Y = Finfosys.GridView4.Rows[19].Y
.W = Finfosys.GridView4[19, 0].W
.H = Finfosys.GridView4[19, 0].H
.Text = "CPU Mark TSC: " & mark.tsc &
", Sys Clock:" & "µs " & mark.sys_clock
.Border = False
.ReadOnly = True
End With
'
'
' Print " \"VENDOR_STR\": "; String@(data)
' Print " \"CPU_CODENAME\": "; String@(data + 296)
' Print " \"BRAND_STR\": "; String@(data + 16)
' Print " \"VENDOR\": "; IIf(Int@(data + 80) = -1, "Not found", cpu_vendor[Int@(data + 80)])
' Print " \"FAMILY\": "; Int@(data + 212)
' Print " \"MODEL\": "; Int@(data + 216)
' Print " \"STEPPING\": "; Int@(data + 220)
' Print " \"EXT_FAMILY\": "; Int@(data + 224)
' Print " \"EXT_MODEL\": "; Int@(data + 228)
' Print " \"NUM_CORES\": "; Int@(data + 232)
' Print " \"NUM_LOGICAL_CPUS\": "; Int@(data + 236)
' Print " \"TOTAL_LOGICAL_CPUS\": "; Int@(data + 240)
' Print " \"L1_DATA_CACHE\": "; Int@(data + 244); " KB"
' Print " \"L1_INSTRUCTION_CACHE\": "; Int@(data + 248); " KB"
' Print " \"L2_CACHE\": "; Int@(data + 252); " KB"
' Print " \"L3_CACHE\": "; Int@(data + 256); " KB"
' Print " \"L4_CACHE\": "; Int@(data + 260); " KB"
' Print " \"L1_ASSOC\": "; IIf(Int@(data + 264) > 0, Int@(data + 264) & "-way", "intedeterminato")
' Print " \"L2_ASSOC\": "; IIf(Int@(data + 268) > 0, Int@(data + 268) & "-way", "intedeterminato")
' Print " \"L3_ASSOC\": "; IIf(Int@(data + 272) > 0, Int@(data + 272) & "-way", "intedeterminato")
' Print " \"L4_ASSOC\": "; IIf(Int@(data + 276) > 0, Int@(data + 276) & "-way", "intedeterminato")
' Print " \"L1_CACHELINE\": "; IIf(Int@(data + 280) > 0, Int@(data + 280) & " byte", "intedeterminato")
' Print " \"L2_CACHELINE\": "; IIf(Int@(data + 284) > 0, Int@(data + 284) & " byte", "intedeterminato")
' Print " \"L3_CACHELINE\": "; IIf(Int@(data + 288) > 0, Int@(data + 288) & " byte", "intedeterminato")
' Print " \"L4_CACHELINE\": "; IIf(Int@(data + 292) > 0, Int@(data + 292) & " byte", "intedeterminato")
'
' Print " \"SSE_SIZE\": "; Int@(data + 360); " bit "; au
' Print " \"CPU_CLOCK\": "; cpu_clock(); " Mhz"
' Print " \"CPU_CLOCK_BY_OS\": "; cpu_clock_by_os(); " Mhz"
' Print " \"CPU_CLOCK_BY_IC\": "; cpu_clock_by_ic(25, 16); " Mhz"
' Print " \"CPU_CLOCK_MEASURE\": "; cpu_clock_measure(400, 1); " Mhz"
' Print " \"MARK_TSC\": "; mark.tsc
' Print " \"MARK_SYS_CLOCK\": "; "µs "; mark.sys_clock
For i = 0 To 109
Finfosys.ListBox2.Add("FEATURE: " & cpu_feature_str(i) & IIf(Byte@(data + (i + 84)), " Present", " Absent"))
Next
Free(data)
End

View File

@ -64,8 +64,8 @@ Public Sub Form_Open()
End Select
Endif
Logs("Call to MLibcpuid", Logger.Info)
Object.Call(MLibcpuid, "Libcpuid")
Logs("Call to MLibcpuid14", Logger.Info)
Object.Call(MLibcpuid14, "main")
Try data = Open "/proc/mtrr" For Input
@ -992,6 +992,8 @@ Public Sub TabPanel1_Click()
Else If TabPanel1.Current.Text = "CPUINFO" Then
ComboBox1.Visible = True
'MenuButton1.Visible = True
Else If TabPanel1.Current.Text = "FLAGS" Then
ComboBox1.Visible = False
Else
ComboBox1.Visible = False
'MenuButton1.Visible = False
@ -1043,7 +1045,7 @@ Public Sub Form_Close()
Settings["Window/Y"] = Me.Y
Settings["Tab/Pos"] = TabStrip1.Orientation
Logs("Good bye!", Logger.Info)
MLibcpuid.DATAT.Clear
'MLibcpuid.DATAT.Clear
Me.Close
End

View File

@ -99,7 +99,7 @@
Margin = True
Padding = 3
Border = False
Count = 2
Count = 3
TextFont = Font["Bold,8"]
Orientation = Align.Bottom
Highlight = True
@ -305,189 +305,18 @@
}
Index = 1
Text = ("CPUID")
{ ScrollView1 ScrollView
Move(0,0,469,455)
Font = Font["8"]
{ Label92 Label
Move(0,7,441,21)
Font = Font["Bold,8"]
Text = ("Label92")
Alignment = Align.Center
Border = Border.Raised
}
{ Label193 Label
Move(0,56,441,21)
Font = Font["Bold,8"]
Text = ("Label193")
Alignment = Align.Center
Border = Border.Raised
}
{ Label194 Label
Move(0,28,441,28)
Font = Font["Bold,8"]
Text = ("Label194")
Alignment = Align.Center
Border = Border.Raised
}
{ Label195 Label
Move(217,98,224,21)
Font = Font["Bold,8"]
Text = ("Label195")
Border = Border.Raised
}
{ Label196 Label
Move(0,119,217,21)
Font = Font["Bold,8"]
Text = ("Label196")
Border = Border.Raised
}
{ Label197 Label
Move(217,119,224,21)
Font = Font["Bold,8"]
Text = ("Label197")
Border = Border.Raised
}
{ Label198 Label
Move(217,77,119,21)
Font = Font["Bold,8"]
Text = ("Label198")
Border = Border.Raised
}
{ Label199 Label
Move(0,77,98,21)
Font = Font["Bold,8"]
Text = ("Label199")
Border = Border.Raised
}
{ Label200 Label
Move(0,98,217,21)
Font = Font["Bold,8"]
Text = ("Label200")
Border = Border.Raised
}
{ Label201 Label
Move(336,77,105,21)
Font = Font["Bold,8"]
Text = ("Label201")
Border = Border.Raised
}
{ Label202 Label
Move(98,77,119,21)
Font = Font["Bold,8"]
Text = ("Label202")
Border = Border.Raised
}
{ Label203 Label
Move(0,140,217,21)
Font = Font["Bold,8"]
Text = ("Label203")
Border = Border.Raised
}
{ Label204 Label
Move(217,140,224,21)
Font = Font["Bold,8"]
Text = ("Label204")
Border = Border.Raised
}
{ Label205 Label
Move(0,161,217,21)
Font = Font["Bold,8"]
Text = ("Label205")
Border = Border.Raised
}
{ Label206 Label
Move(217,161,224,21)
Font = Font["Bold,8"]
Text = ("Label206")
Border = Border.Raised
}
{ Label207 Label
Move(0,182,217,21)
Font = Font["Bold,8"]
Text = ("Label207")
Border = Border.Raised
}
{ Label208 Label
Move(217,182,224,21)
Font = Font["Bold,8"]
Text = ("Label208")
Border = Border.Raised
}
{ Separator12 Separator
Move(0,315,441,14)
}
{ Label209 Label
Move(0,210,147,21)
Font = Font["Bold,8"]
Text = ("Label209")
Border = Border.Raised
}
{ Label210 Label
Move(0,231,147,21)
Font = Font["Bold,8"]
Text = ("Label210")
Border = Border.Raised
}
{ Label211 Label
Move(0,252,147,21)
Font = Font["Bold,8"]
Text = ("Label211")
Border = Border.Raised
}
{ Label212 Label
Move(0,273,147,21)
Font = Font["8,Bold"]
Text = ("Label212")
Border = Border.Raised
}
{ Label213 Label
Move(147,210,140,21)
Font = Font["Bold,8"]
Text = ("Label213")
Border = Border.Raised
}
{ Label214 Label
Move(147,231,140,21)
Font = Font["Bold,8"]
Text = ("Label214")
Border = Border.Raised
}
{ Label215 Label
Move(147,252,140,21)
Font = Font["Bold,8"]
Text = ("Label215")
Border = Border.Raised
}
{ Label216 Label
Move(287,210,154,21)
Font = Font["Bold,8"]
Text = ("Label216")
Border = Border.Raised
}
{ Label217 Label
Move(287,231,154,21)
Font = Font["Bold,8"]
Text = ("Label217")
Border = Border.Raised
}
{ Label218 Label
Move(287,252,154,21)
Font = Font["Bold,8"]
Text = ("Label218")
Border = Border.Raised
}
{ Label219 Label
Move(0,294,441,21)
Font = Font["Bold,8"]
Text = ("Label219")
Alignment = Align.Center
Border = Border.Raised
}
{ GridView4 GridView
Move(7,7,462,441)
}
Index = 2
Text = ("FLAGS")
{ ListBox2 ListBox
Move(7,7,462,441)
}
Index = 0
}
{ ProgressBar6 ProgressBar
Move(119,455,350,21)
Move(168,455,301,21)
}
Index = 1
Text = "GPU"

View File

@ -34,10 +34,8 @@ Public Sub Main()
"\n Options:"
"\n --help (Chow Help)"
"\n --library (Chow library)"
"\n --cpuinfo (Use cpuinfo instead of /proc)"
"\n --smbus (smbus)"
"\n"
"\n --libcpuid (Print info about CPU in term using Libcpuid)"
"\n Env Variables:"
"\n"
"\n INEXCPU_VENDOR"
@ -48,19 +46,12 @@ Public Sub Main()
Case "--library"
FSystemInfo.Show
PrintErr = False
Case "--cpuinfo"
CPUINFO_FILE = Application.Args[2]
Finfosys.Show
PrintErr = False
Case "--conv"
MConvert.Convert(Application.Args[2], Application.Args[3], Application.Args[4])
PrintErr = False
Case "--smbus"
i2c._inits
PrintErr = False
Case "--libcpuid"
MLibcpuid14.Main()
PrintErr = False
Case ""
Finfosys.Show
PrintErr = False

View File

@ -47,7 +47,7 @@ End
Function get_value(Value As Integer, Pos As Integer) As String
If Finfosys.DATAT["Flags"][Pos]["VALUE"] = 1 Then
If Finfosys.DATAT["Flags"][Pos][VALUE] = 1 Then
Return "Is Supported"
Else
Return "Not Supported"

View File

@ -44,9 +44,7 @@ Public Sub _inits()
End
Public Sub _get_informations()
Dim ASOUND_INPUT As String[]
Dim ASOUND_INPUT_LIST As String[]
Dim i As Integer
Try ASOUND_ID = File.Load("/proc/asound/card" & Finfosys.ComboBox6.Index & "/id")
Try ASOUND_ALSADV = File.Load("/proc/asound/version")
ASOUND_ID = Replace(ASOUND_ID, "\n", "")

View File

@ -1,12 +1,6 @@
#!/usr/bin/make -f
include ../i-nex.mk
make: check-static make-binary
check-static:
ifeq ($(STATIC),true)
@echo -e '$(WARN_COLOR)Compile Static $(WARN_STRING)$(NO_COLOR)'
else
@echo -e '$(OK_COLOR)Compile Not Static $(OK_STRING)$(NO_COLOR)'
endif
make: make-binary
make-binary: compile-i-nex-edid \
compile-i-nex-cpuid
@ -15,21 +9,13 @@ compile-i-nex-edid:
@echo -e '$(OK_COLOR)Compile i-nex-edid $(OK_STRING)$(NO_COLOR)'
$(CC) -o i-nex-edid i-nex-edid.c $(CFLAGS) $(additional_confflags)
compile-i-nex-cpuid:
@echo -e '$(OK_COLOR)Compile i-nex-cpuid $(OK_STRING)$(NO_COLOR)'
$(CC) -o i-nex-cpuid i-nex-cpuid.c $(CC_OPTS_LIBCPUID) $(additional_confflags)
install: install-set-executables install-bin
install-set-executables: set-executable-i-nex-edid \
set-executable-i-nex-cpuid
install-set-executables: set-executable-i-nex-edid
set-executable-i-nex-edid:
chmod +x i-nex-edid
set-executable-i-nex-cpuid:
chmod +x i-nex-cpuid
install-bin: install-bin-i-nex-edid \
install-bin-i-nex-cpuid \
install-bin-i-nex-dimms
@ -37,14 +23,9 @@ install-bin: install-bin-i-nex-edid \
install-bin-i-nex-edid:
test -d $(DESTDIR)$(bindir) || mkdir $(DESTDIR)$(bindir)
$(INSTALL) 0755 i-nex-edid $(DESTDIR)$(bindir)
install-bin-i-nex-cpuid:
test -d $(DESTDIR)$(bindir) || mkdir $(DESTDIR)$(bindir)
$(INSTALL) 0755 i-nex-cpuid $(DESTDIR)$(bindir)
install-bin-i-nex-dimms:
test -d $(DESTDIR)$(bindir) || mkdir $(DESTDIR)$(bindir)
$(INSTALL) 0755 i-nex-dimms $(DESTDIR)$(bindir)
clean:
@echo -e '$(ACTION_COLOR)Clean JSON$(NO_COLOR)'
$(RM_COM) $(RMFILE_OPT) i-nex-edid
$(RM_COM) $(RMFILE_OPT) i-nex-cpuid
$(RM_COM) $(RMFILE_OPT) i-nex-usage

View File

@ -1,932 +0,0 @@
/* Copyright(C) 2014, Michał Głowienka aka eloaders <eloaders@linux.pl>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
#include <stdio.h>
#include <libcpuid.h>
int main(void)
{
if (!cpuid_present()) { // check for CPUID presence
printf("Sorry, your CPU doesn't support CPUID!\n");
return -1;
}
struct cpu_raw_data_t raw;
struct cpu_id_t data; // contains recognized CPU features data
if (cpuid_get_raw_data(&raw) < 0) { // obtain the raw CPUID data
printf("Sorry, cannot get the CPUID raw data.\n");
printf("Error: %s\n", cpuid_error()); // cpuid_error() gives the last error description
return -2;
}
if (cpu_identify(&raw, &data) < 0) { // identify the CPU, using the given raw data.
printf("Sorrry, CPU identification failed.\n");
printf("Error: %s\n", cpuid_error());
return -3;
}
struct cpu_mark_t mark;
cpu_tsc_mark(&mark);
cpu_tsc_unmark(&mark);
printf("{\n");
printf(" \"VENDOR_STR\": \"%s\",\n", data.vendor_str); //
printf(" \"CPU_CODENAME\": \"%s\",\n", data.cpu_codename); //
printf(" \"BRAND_STR\": \"%s\",\n", data.brand_str); //
printf(" \"NUM_CORES\": \"%d\",\n", data.num_cores); //
printf(" \"NUM_LOGICAL_CPUS\": \"%d\",\n", data.num_logical_cpus); //
printf(" \"TOTAL_LOGICAL_CPUS\": \"%d\",\n", data.total_logical_cpus); //
printf(" \"FAMILY\": \"%d\",\n", data.family); //
printf(" \"MODEL\": \"%d\",\n", data.model); //
printf(" \"STEPPING\": \"%d\",\n", data.stepping); //
printf(" \"EXT_FAMILY\": \"%d\",\n", data.ext_family); //
printf(" \"EXT_MODEL\": \"%d\",\n", data.ext_model); //
printf(" \"CPU_CLOCK\": \"%d MHz\",\n", cpu_clock()); //
printf(" \"CPU_CLOCK_BY_OS\": \"%d MHz\",\n", cpu_clock_by_os()); //
printf(" \"CPU_CLOCK_BY_IC\": \"%d MHz\",\n", cpu_clock_by_ic(25, 16)); //
printf(" \"CPU_CLOCK_MEASURE\": \"%d MHz\",\n", cpu_clock_measure(400, 1));//
printf(" \"MARK_TSC\": \"%llu\",\n", mark.tsc); //
printf(" \"MARK_SYS_CLOCK\": \"%llu\",\n", mark.sys_clock); //
printf(" \"Flags\": {\n");
printf(" \"1\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_MMXEXT] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_MMXEXT\",\n");
printf(" \"FEATURE\": \"mmxext\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/MMX_(instruction_set)\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"AMD MMX-extended instructions supported\"\n");
printf(" },\n");
printf(" \"2\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_SSE] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_SSE\",\n");
printf(" \"FEATURE\": \"sse\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Streaming_SIMD_Extensions\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Streaming-SIMD Extensions (SSE) supported\"\n");
printf(" },\n");
printf(" \"3\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_SSE2] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_SSE2\",\n");
printf(" \"FEATURE\": \"sse2\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/SSE2\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"SSE2 instructions supported\"\n");
printf(" },\n");
printf(" \"4\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_3DNOW] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_3DNOW\",\n");
printf(" \"FEATURE\": \"3dnow\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/3DNow!\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"AMD 3DNow! instructions supported\"\n");
printf(" },\n");
printf(" \"5\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_VME] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_VME\",\n");
printf(" \"FEATURE\": \"vme\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Virtual_8086_mode\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Virtual mode extension\"\n");
printf(" },\n");
printf(" \"6\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_CLFLUSH] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_CLFLUSH\",\n");
printf(" \"FEATURE\": \"clflush\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"CLFLUSH instruction supported\"\n");
printf(" },\n");
printf(" \"7\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_SSSE3] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_SSSE3\",\n");
printf(" \"FEATURE\": \"ssse3\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/SSE3\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"SSSE3 instructionss supported (this is different from SSE3!)\"\n");
printf(" },\n");
printf(" \"8\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_LM] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_LM\",\n");
printf(" \"FEATURE\": \"lm\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Long mode (x86_64/EM64T) supported\"\n");
printf(" },\n");
printf(" \"9\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_LAHF_LM] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_LAHF_LM\",\n");
printf(" \"FEATURE\": \"lahf_lm\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"LAHF/SAHF supported in 64-bit mode\"\n");
printf(" },\n");
printf(" \"10\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_MTRR] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_MTRR\",\n");
printf(" \"FEATURE\": \"mtrr\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Memory_type_range_register\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Memory type range registers\"\n");
printf(" },\n");
printf(" \"11\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_ACPI] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_ACPI\",\n");
printf(" \"FEATURE\": \"acpi\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Acpi\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"ACPI support (power states)\"\n");
printf(" },\n");
printf(" \"12\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_VMX] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_VMX\",\n");
printf(" \"FEATURE\": \"vmx\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/X86_virtualization\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Virtualization technology supported\"\n");
printf(" },\n");
printf(" \"13\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_SYSCALL] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_SYSCALL\",\n");
printf(" \"FEATURE\": \"syscall\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Syscall\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"SYSCALL / SYSRET instructions supported\"\n");
printf(" },\n");
printf(" \"14\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_DTS64] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_DTS64\",\n");
printf(" \"FEATURE\": \"dts64\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"64-bit Debug store supported\"\n");
printf(" },\n");
printf(" \"15\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_FPU] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_FPU\",\n");
printf(" \"FEATURE\": \"fpu\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Floating-point_unit\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Floating point unit\"\n");
printf(" },\n");
printf(" \"16\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_DE] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_DE\",\n");
printf(" \"FEATURE\": \"de\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Debugging extension\"\n");
printf(" },\n");
printf(" \"17\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_VME] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_VME\",\n");
printf(" \"FEATURE\": \"vme\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Virtual_8086_mode\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Virtual mode extension\"\n");
printf(" },\n");
printf(" \"18\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_PSE] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_PSE\",\n");
printf(" \"FEATURE\": \"pse\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Page_Size_Extension\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Page size extension\"\n");
printf(" },\n");
printf(" \"19\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_TSC] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_TSC\",\n");
printf(" \"FEATURE\": \"tsc\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Time_Stamp_Counter\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Time-stamp counter\"\n");
printf(" },\n");
printf(" \"20\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_MSR] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_MSR\",\n");
printf(" \"FEATURE\": \"msr\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Model-specific_register\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Model-specific regsisters, RDMSR/WRMSR supported\"\n");
printf(" },\n");
printf(" \"21\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_PAE] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_PAE\",\n");
printf(" \"FEATURE\": \"pae\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Physical_Address_Extension\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Physical address extension\"\n");
printf(" },\n");
printf(" \"22\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_MCE] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_MCE\",\n");
printf(" \"FEATURE\": \"mce\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Machine-check_exception\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Machine check exception\"\n");
printf(" },\n");
printf(" \"23\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_CX8] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_CX8\",\n");
printf(" \"FEATURE\": \"cx8\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"CMPXCHG8/CMPXCHG8B instruction supported\"\n");
printf(" },\n");
printf(" \"24\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_APIC] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_APIC\",\n");
printf(" \"FEATURE\": \"apic\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Advanced_Programmable_Interrupt_Controller\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Advanced Programmable Interrupt Controller support\"\n");
printf(" },\n");
printf(" \"25\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_X2APIC] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_X2APIC\",\n");
printf(" \"FEATURE\": \"x2apic\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/X2APIC\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Intel 64 Architecture x2APIC Specification\"\n");
printf(" },\n");
printf(" \"26\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_SEP] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_SEP\",\n");
printf(" \"FEATURE\": \"sep\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Call_gate\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"SYSENTER / SYSEXIT instructions supported\"\n");
printf(" },\n");
printf(" \"27\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_PGE] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_PGE\",\n");
printf(" \"FEATURE\": \"pge\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Translation_lookaside_buffer\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Page global enable\"\n");
printf(" },\n");
printf(" \"28\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_MCA] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_MCA\",\n");
printf(" \"FEATURE\": \"mca\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Machine_check_architecture\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Machine check architecture\"\n");
printf(" },\n");
printf(" \"29\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_CMOV] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_CMOV\",\n");
printf(" \"FEATURE\": \"cmov\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"CMOVxx instructions supported\"\n");
printf(" },\n");
printf(" \"30\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_PAT] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_PAT\",\n");
printf(" \"FEATURE\": \"pat\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Page_attribute_table\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Page attribute table\"\n");
printf(" },\n");
printf(" \"31\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_PSE36] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_PSE36\",\n");
printf(" \"FEATURE\": \"pse36\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Physical_Address_Extension\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"36-bit page address extension\"\n");
printf(" },\n");
printf(" \"32\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_PN] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_PN\",\n");
printf(" \"FEATURE\": \"pt\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Processor serial # implemented (Intel P3 only)\"\n");
printf(" },\n");
printf(" \"33\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_DTS] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_DTS\",\n");
printf(" \"FEATURE\": \"dts\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Debug store supported\"\n");
printf(" },\n");
printf(" \"34\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_SS] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_SS\",\n");
printf(" \"FEATURE\": \"ss\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Cache_snooping\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Self-snoop\"\n");
printf(" },\n");
printf(" \"35\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_TM] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_TM\",\n");
printf(" \"FEATURE\": \"tm\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Thermal monitor\"\n");
printf(" },\n");
printf(" \"36\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_IA64] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_IA64\",\n");
printf(" \"FEATURE\": \"ia64\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Ia64\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"IA64 supported (Itanium only)\"\n");
printf(" },\n");
printf(" \"37\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_PBE] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_PBE\",\n");
printf(" \"FEATURE\": \"pbe\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Pending-break enable\"\n");
printf(" },\n");
printf(" \"38\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_PNI] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_PNI\",\n");
printf(" \"FEATURE\": \"pni\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/SSE3\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"PNI (SSE3) instructions supported\"\n");
printf(" },\n");
printf(" \"39\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_PCLMUL] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_PCLMUL\",\n");
printf(" \"FEATURE\": \"pclmul\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"PCLMULQDQ instruction supported\"\n");
printf(" },\n");
printf(" \"40\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_MONITOR] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_MONITOR\",\n");
printf(" \"FEATURE\": \"monitor\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"MONITOR / MWAIT supported\"\n");
printf(" },\n");
printf(" \"41\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_DS_CPL] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_DS_CPL\",\n");
printf(" \"FEATURE\": \"ds_cpl\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"CPL Qualified Debug Store\"\n");
printf(" },\n");
printf(" \"42\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_SMX] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_SMX\",\n");
printf(" \"FEATURE\": \"smx\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/LaGrande\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Safer mode exceptions\"\n");
printf(" },\n");
printf(" \"43\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_EST] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_EST\",\n");
printf(" \"FEATURE\": \"est\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/SpeedStep\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Enhanced SpeedStep\"\n");
printf(" },\n");
printf(" \"44\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_TM2] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_TM2\",\n");
printf(" \"FEATURE\": \"tm2\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Tm2\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Thermal monitor 2\"\n");
printf(" },\n");
printf(" \"45\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_CID] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_CID\",\n");
printf(" \"FEATURE\": \"cid\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Context ID supported\"\n");
printf(" },\n");
printf(" \"46\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_CX16] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_CX16\",\n");
printf(" \"FEATURE\": \"cx16\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"CMPXCHG16B instruction supported\"\n");
printf(" },\n");
printf(" \"47\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_XTPR] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_XTPR\",\n");
printf(" \"FEATURE\": \"xtpr\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Send Task Priority Messages disable\"\n");
printf(" },\n");
printf(" \"48\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_PDCM] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_PDCM\",\n");
printf(" \"FEATURE\": \"pdcm\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Performance capabilities MSR supported\"\n");
printf(" },\n");
printf(" \"49\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_DCA] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_DCA\",\n");
printf(" \"FEATURE\": \"dca\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Direct cache access supported\"\n");
printf(" },\n");
printf(" \"50\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_SSE4_1] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_SSE4_1\",\n");
printf(" \"FEATURE\": \"sse4_1\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/SSE4\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"SSE 4.1 instructions supported\"\n");
printf(" },\n");
printf(" \"51\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_SSE4_2] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_SSE4_2\",\n");
printf(" \"FEATURE\": \"sse4_2\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/SSE4\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"SSE 4.2 instructions supported\"\n");
printf(" },\n");
printf(" \"52\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_SYSCALL] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_SYSCALL\",\n");
printf(" \"FEATURE\": \"syscall\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"SYSCALL / SYSRET instructions supported\"\n");
printf(" },\n");
printf(" \"53\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_XD] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_XD\",\n");
printf(" \"FEATURE\": \"xd\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Execute disable bit supported\"\n");
printf(" },\n");
printf(" \"54\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_MOVBE] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_MOVBE\",\n");
printf(" \"FEATURE\": \"movbe\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"MOVBE instruction supported\"\n");
printf(" },\n");
printf(" \"55\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_POPCNT] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_POPCNT\",\n");
printf(" \"FEATURE\": \"popcnt\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Hamming_weight\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"POPCNT instruction supported\"\n");
printf(" },\n");
printf(" \"56\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_AES] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_AES\",\n");
printf(" \"FEATURE\": \"aes\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/AES_instruction_set\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"AES* instructions supported\"\n");
printf(" },\n");
printf(" \"57\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_XSAVE] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_XSAVE\",\n");
printf(" \"FEATURE\": \"xsave\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Streaming_SIMD_Extensions\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"XSAVE/XRSTOR/etc instructions supported\"\n");
printf(" },\n");
printf(" \"58\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_OSXSAVE] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_OSXSAVE\",\n");
printf(" \"FEATURE\": \"osxsave\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Streaming_SIMD_Extensions\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"non-privileged copy of OSXSAVE supported\"\n");
printf(" },\n");
printf(" \"59\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_AVX] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_AVX\",\n");
printf(" \"FEATURE\": \"avx\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Advanced_Vector_Extensions\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Advanced vector extensions supported\"\n");
printf(" },\n");
printf(" \"60\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_3DNOWEXT] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_3DNOWEXT\",\n");
printf(" \"FEATURE\": \"3dnowext\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/3DNow!\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"AMD 3DNow! extended instructions supported\"\n");
printf(" },\n");
printf(" \"61\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_NX] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_NX\",\n");
printf(" \"FEATURE\": \"nx\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/NX_bit\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"No-execute bit supported\"\n");
printf(" },\n");
printf(" \"62\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_FXSR_OPT] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_FXSR_OPT\",\n");
printf(" \"FEATURE\": \"opt\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"FFXSR: FXSAVE and FXRSTOR optimizations\"\n");
printf(" },\n");
printf(" \"63\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_RDTSCP] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_RDTSCP\",\n");
printf(" \"FEATURE\": \"rdtscp\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Time_Stamp_Counter\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"RDTSCP instruction supported (AMD-only)\"\n");
printf(" },\n");
printf(" \"64\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_LM] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_LM\",\n");
printf(" \"FEATURE\": \"lm\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Long mode (x86_64/EM64T) supported\"\n");
printf(" },\n");
printf(" \"65\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_LAHF_LM] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_LAHF_LM\",\n");
printf(" \"FEATURE\": \"lahf_lm\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"LAHF/SAHF supported in 64-bit mode\"\n");
printf(" },\n");
printf(" \"66\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_CMP_LEGACY] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_CMP_LEGACY\",\n");
printf(" \"FEATURE\": \"cmp_legacy\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Core multi-processing legacy mode\"\n");
printf(" },\n");
printf(" \"67\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_SVM] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_SVM\",\n");
printf(" \"FEATURE\": \"svm\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"AMD Secure virtual machine\"\n");
printf(" },\n");
printf(" \"68\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_SSE4A] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_SSE4A\",\n");
printf(" \"FEATURE\": \"sse4a\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/SSE4\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"SSE 4a from AMD\"\n");
printf(" },\n");
printf(" \"69\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_MISALIGNSSE] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_MISALIGNSSE\",\n");
printf(" \"FEATURE\": \"misalignsse\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Misaligned SSE supported\"\n");
printf(" },\n");
printf(" \"70\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_ABM] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_ABM\",\n");
printf(" \"FEATURE\": \"abm\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"LZCNT instruction support\"\n");
printf(" },\n");
printf(" \"71\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_3DNOWPREFETCH] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_3DNOWPREFETCH\",\n");
printf(" \"FEATURE\": \"3dnowprefetch\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/3DNow!\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"PREFETCH/PREFETCHW support\"\n");
printf(" },\n");
printf(" \"72\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_OSVW] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_OSVW\",\n");
printf(" \"FEATURE\": \"osvw\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"OS Visible Workaround (AMD)\"\n");
printf(" },\n");
printf(" \"73\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_IBS] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_IBS\",\n");
printf(" \"FEATURE\": \"ibs\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Hardware_performance_counter\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Instruction-based sampling\"\n");
printf(" },\n");
printf(" \"74\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_SSE5] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_SSE5\",\n");
printf(" \"FEATURE\": \"sse5\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/SSE5\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"SSE 5 instructions supported (deprecated, will never be 1)\"\n");
printf(" },\n");
printf(" \"75\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_SKINIT] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_SKINIT\",\n");
printf(" \"FEATURE\": \"skinit\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"SKINIT / STGI supported\"\n");
printf(" },\n");
printf(" \"76\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_WDT] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_WDT\",\n");
printf(" \"FEATURE\": \"wdt\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Watchdog_timer\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Watchdog timer support\"\n");
printf(" },\n");
printf(" \"77\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_TS] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_TS\",\n");
printf(" \"FEATURE\": \"ts\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Temperature sensor\"\n");
printf(" },\n");
printf(" \"78\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_FID] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_FID\",\n");
printf(" \"FEATURE\": \"fid\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Frequency ID control\"\n");
printf(" },\n");
printf(" \"79\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_VID] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_VID\",\n");
printf(" \"FEATURE\": \"vid\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Voltage ID control\"\n");
printf(" },\n");
printf(" \"80\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_TTP] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_TTP\",\n");
printf(" \"FEATURE\": \"ttp\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"THERMTRIP\"\n");
printf(" },\n");
printf(" \"81\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_TM_AMD] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_TM_AMD\",\n");
printf(" \"FEATURE\": \"tm_amd\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"AMD-specified hardware thermal control\"\n");
printf(" },\n");
printf(" \"82\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_STC] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_STC\",\n");
printf(" \"FEATURE\": \"stc\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Software thermal control\"\n");
printf(" },\n");
printf(" \"83\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_100MHZSTEPS] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_100MHZSTEPS\",\n");
printf(" \"FEATURE\": \"100mhzsteps\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"100 MHz multiplier control\"\n");
printf(" },\n");
printf(" \"84\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_HWPSTATE] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_HWPSTATE\",\n");
printf(" \"FEATURE\": \"hwpstate\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Hardware P-state control\"\n");
printf(" },\n");
printf(" \"85\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_CONSTANT_TSC] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_CONSTANT_TSC\",\n");
printf(" \"FEATURE\": \"constant_tsc\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Time_Stamp_Counter\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"TSC ticks at constant rate\"\n");
printf(" },\n");
printf(" \"86\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_XOP] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_XOP\",\n");
printf(" \"FEATURE\": \"xop\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"The XOP instruction set (same as the old CPU_FEATURE_SSE5)\"\n");
printf(" },\n");
printf(" \"87\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_FMA3] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_FMA3\",\n");
printf(" \"FEATURE\": \"fma3\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/FMA_instruction_set\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"The FMA3 instruction set\"\n");
printf(" },\n");
printf(" \"88\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_FMA4] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_FMA4\",\n");
printf(" \"FEATURE\": \"fma4\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/FMA_instruction_set\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"The FMA4 instruction set\"\n");
printf(" },\n");
printf(" \"89\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_TBM] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_TBM\",\n");
printf(" \"FEATURE\": \"tbm\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Trailing bit manipulation instruction support\"\n");
printf(" },\n");
printf(" \"90\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_F16C] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_F16C\",\n");
printf(" \"FEATURE\": \"f16c\",\n");
printf(" \"WEBSITE\": \"mmxext\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"16-bit FP convert instruction support\"\n");
printf(" },\n");
printf(" \"91\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_RDRAND] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_RDRAND\",\n");
printf(" \"FEATURE\": \"rdrand\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/RdRand\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"RdRand instruction\"\n");
printf(" },\n");
if (data.vendor == VENDOR_INTEL) {
printf(" \"92\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_HT] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_HT\",\n");
printf(" \"FEATURE\": \"ht\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Hyper-Threading\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Hyper-threading supported (but might be disabled)\"\n");
printf(" },\n");
} else if (data.vendor == VENDOR_AMD) {
printf(" \"92\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_HT] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_HT\",\n");
printf(" \"FEATURE\": \"ht\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/HyperTransport\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"HyperTransport (HT)\"\n");
printf(" },\n");
} else {
printf(" \"92\": {\n");
printf(" \"VALUE\": 0 ,\n");
printf(" \"NAME\": \"CPU_FEATURE_RESERVED\",\n");
printf(" \"FEATURE\": \"Reserved space\",\n");
printf(" \"WEBSITE\": \"Reserved space\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Reserved space\"\n");
printf(" },\n");
}
printf(" \"93\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_MMX] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_MMX\",\n");
printf(" \"FEATURE\": \"mmx\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/MMX_(instruction_set)\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"MMX instruction set supported\"\n");
printf(" },\n");
printf(" \"94\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_MTRR] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_MTRR\",\n");
printf(" \"FEATURE\": \"mtrr\",\n");
printf(" \"WEBSITE\": \"http://en.wikipedia.org/wiki/Memory_type_range_register\",\n");
printf(" \"HAVEWEBSITE\": 1 ,\n");
printf(" \"DESC\": \"Memory type range registers\"\n");
if (data.vendor == VENDOR_AMD) {
printf(" },\n");
printf(" \"95\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_CPB] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_CPB\",\n");
printf(" \"FEATURE\": \"cpb\",\n");
printf(" \"WEBSITE\": \"\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Core performance boost\"\n");
printf(" },\n");
printf(" \"96\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_APERFMPERF] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_APERFMPERF\",\n");
printf(" \"FEATURE\": \"aperfmperf\",\n");
printf(" \"WEBSITE\": \"\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"MPERF/APERF MSRs support\"\n");
printf(" },\n");
printf(" \"97\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_PFI] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_PFI\",\n");
printf(" \"FEATURE\": \"pfi\",\n");
printf(" \"WEBSITE\": \"\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Processor Feedback Interface support\"\n");
printf(" },\n");
printf(" \"98\": {\n");
printf(" \"VALUE\": %s \n", data.flags[CPU_FEATURE_PA] ? "1 ," : "0 ,");
printf(" \"NAME\": \"CPU_FEATURE_PA\",\n");
printf(" \"FEATURE\": \"pa\",\n");
printf(" \"WEBSITE\": \"\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Processor accumulator\"\n");
} else {
printf(" },\n");
printf(" \"95\": {\n");
printf(" \"VALUE\": 0 ,\n");
printf(" \"NAME\": \"CPU_FEATURE_RESERVED\",\n");
printf(" \"FEATURE\": \"Reserved space\",\n");
printf(" \"WEBSITE\": \"Reserved space\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Reserved space\"\n");
printf(" },\n");
printf(" \"96\": {\n");
printf(" \"VALUE\": 0 ,\n");
printf(" \"NAME\": \"CPU_FEATURE_RESERVED\",\n");
printf(" \"FEATURE\": \"Reserved space\",\n");
printf(" \"WEBSITE\": \"Reserved space\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Reserved space\"\n");
printf(" },\n");
printf(" \"97\": {\n");
printf(" \"VALUE\": 0 ,\n");
printf(" \"NAME\": \"CPU_FEATURE_RESERVED\",\n");
printf(" \"FEATURE\": \"Reserved space\",\n");
printf(" \"WEBSITE\": \"Reserved space\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Reserved space\"\n");
printf(" },\n");
printf(" \"98\": {\n");
printf(" \"VALUE\": 0 ,\n");
printf(" \"NAME\": \"CPU_FEATURE_RESERVED\",\n");
printf(" \"FEATURE\": \"Reserved space\",\n");
printf(" \"WEBSITE\": \"Reserved space\",\n");
printf(" \"HAVEWEBSITE\": 0 ,\n");
printf(" \"DESC\": \"Reserved space\"\n");
}
printf(" }\n");
printf(" },\n");
printf(" \"L1_DATA_CACHE\": \"%d KB\",\n", data.l1_data_cache);
printf(" \"L1_INSTRUCTION_CACHE\": \"%d KB\",\n", data.l1_instruction_cache);
printf(" \"L2_CACHE\": \"%d KB\",\n", data.l2_cache);
if (data.l3_cache > 0) {
printf(" \"L3_CACHE\": \"%d KB\",\n", data.l3_cache);
} else {
printf(" \"L3_CACHE\": \"Not found\",\n");
}
printf(" \"L1_ASSOC\": \"%d-way\",\n", data.l1_assoc);
printf(" \"L2_ASSOC\": \"%d-way\",\n", data.l2_assoc);
if (data.l3_assoc > 0) {
printf(" \"L3_ASSOC\": \"%d-way\",\n", data.l3_assoc);
} else {
printf(" \"L3_ASSOC\": \"Not found\",\n");
}
printf(" \"L1_CACHELINE\": \"%d bytes\",\n", data.l1_cacheline);
printf(" \"L2_CACHELINE\": \"%d bytes\",\n", data.l2_cacheline);
if (data.l3_cacheline > 0) {
printf(" \"L3_CACHELINE\": \"%d bytes\",\n", data.l3_cacheline);
} else {
printf(" \"L3_CACHELINE\": \"Not found\",\n");
}
printf(" \"SSE_SIZE\": \"%d bits (%s)\"\n", data.sse_size, data.detection_hints[CPU_HINT_SSE_SIZE_AUTH] ? "authoritative" : "non-authoritative");
printf("}\n");
return 0;
}

View File

@ -7,7 +7,6 @@ DOCSDIR = /share/doc/i-nex
MANDIR = /share/man/man1
APP_NAME = $(PN)
LSB_CS = $(shell lsb_release -cs)
CC_OPTS_LIBCPUID = $(shell pkg-config libcpuid --cflags --libs)
ARCH = $(shell uname -m)
GBC = /usr/bin/gbc3
GBCOPTS = -eagtpm
@ -32,11 +31,6 @@ ifeq ($(ARCH),x86_64)
additional_confflags := -O2
endif
ifeq ($(LSB_CS),precise)
CC_OPTS_LIBPROCPS = -lproc
else
CC_OPTS_LIBPROCPS = $(shell pkg-config libprocps --cflags --libs)
endif
NO_COLOR = \033[0m
OK_COLOR = \033[92m