⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpuid32.h

📁 vc写的SSE2优化离散余弦变换
💻 H
字号:
//***************************************************************************/
//*
//*                  Copyright (c) 1998-99 Intel Corporation.
//*                         All rights reserved.
//*
//*
//***************************************************************************/
//////////////////////////////////////////////////////////////////////////////
// File Name: cpuid32.h
// Program Description: Header File fo cpuid32.c
//
//			Contains important constants and types for CPUID calls
//
//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////
// INCLUDES & DEFINES
//////////////////////////////////////////////////////////////////////////////
#ifndef __CPUID32_H__
#define __CPUID32_H__

//#include <windows.h>	- Can't have it in here and compile DDK stuff
#include "ui64.h"

#define CPUID_EAX1_STEPPING	0x0000000f
#define CPUID_EAX1_STEPPING_SHIFT 0
#define CPUID_EAX1_MODEL	0x000000f0
#define CPUID_EAX1_MODEL_SHIFT 4
#define CPUID_EAX1_FAMILY	0x00000f00
#define CPUID_EAX1_FAMILY_SHIFT	8
#define CPUID_EAX1_TYPE		0x00003000
#define CPUID_EAX1_TYPE_SHIFT	12
#define CPUID_EDX1_FPU		0x00000001	// FPU on Chip
#define CPUID_EDX1_VME		0x00000002	// Virtual 8086 Mode Enhancement
#define CPUID_EDX1_DE		0x00000004	// Debugging Extensions
#define CPUID_EDX1_PSE		0x00000008	// Page Size Extensions
#define CPUID_EDX1_TSC		0x00000010	// Time Stamp counter
#define CPUID_EDX1_MSR		0x00000020	// RDMSR/WRMSR Support
#define CPUID_EDX1_PAE		0x00000040	// Physical Address Extensions
#define CPUID_EDX1_MCE		0x00000080	// Machine Check Exceptions
#define	CPUID_EDX1_CXS		0x00000100	// CMPXCHG8B Inst.
#define CPUID_EDX1_APIC		0x00000200	// APIC on chip
#define CPUID_EDX1_MTRR		0x00001000	// Memory Type Range Registers
#define CPUID_EDX1_PGE		0x00002000	// PTE Global Bit
#define	CPUID_EDX1_MCA		0x00004000	// Machine Check Arch.
#define CPUID_EDX1_CMOV		0x00008000	// Conditional Move/Comp. Instructions
#define CPUID_EDX1_MMX		0x00800000	// MMX Supported

#define CPUID_EAX2_NUMCALLS	0x0000000f	// Number of Times to call CPUID w/ EAX=2
#define CPUID_EAX2_NUMCALLS_SHIFT	0
#define CPUID_XXX2_INVALID	0x80000000	// Invalid Bit for all registers with EAX=2
#define CPUID_CACHE_NULL	0x00
#define CPUID_CACHE_ITLB1	0x01		// Instruction TLB 4KByte Pages, 4way set Assoc, 64 Entries
#define CPUID_CACHE_ITLB2	0x02		// Instruction TLB 4MByte Pages, 4way set Assoc,  4 Entries
#define CPUID_CACHE_DTLB1	0x03		// Data TLB 4KByte Pages, 4way set Assoc, 64 Entries
#define CPUID_CACHE_DTLB2	0x04		// Data TLB 4MByte Pages, 4way set Assoc,  8 Entries
#define CPUID_CACHE_ICACHE1	0x06		// Instruction Cache: 8KBytes, 4way set Assoc. 32B lines
#define CPUID_CACHE_ICACHE2	0x08		// Instruction Cache: 16KBytes, 4way set Assoc. 32B lines
#define CPUID_CACHE_DCACHE1	0x0a		// Data Cache: 8KBytes, 2way set Assoc. 32B lines
#define CPUID_CACHE_DCACHE2	0x0c		// Data Cache: 16KBytes, 2way set Assoc. 32B lines
#define CPUID_CACHE_UCACHE0	0x40		// Unified L2 Cache: None
#define CPUID_CACHE_UCACHE1	0x41		// Unified L2 Cache: 128KBytes, 4way set Assoc. 32B lines
#define CPUID_CACHE_UCACHE2	0x42		// Unified L2 Cache: 256KBytes, 4way set Assoc. 32B lines
#define CPUID_CACHE_UCACHE3	0x43		// Unified L2 Cache: 512KBytes, 4way set Assoc. 32B lines
#define CPUID_CACHE_UCACHE4	0x44		// Unified L2 Cache: 1MBytes, 4way set Assoc. 32B lines
#define CPUID_CACHE_UNUSED	0xFF		// Unused

#define CPUID_TYPE_OEM				0x00
#define CPUID_TYPE_OVERDRIVE		0x01
#define CPUID_TYPE_DUALPROCESSOR	0x02


#define CPUID_MAX_RAWDATA	16
#define CPUID_UNDEFINED_INPUTVALUE	0xffffffff

typedef struct {
	UINT	uiInputValue;
	UINT	uiEAX;
	UINT	uiEBX;
	UINT	uiECX;
	UINT	uiEDX;
} CPUID_RAWDATA_t;
typedef CPUID_RAWDATA_t *PCUID_RAWDATA_t;

typedef struct {
	char			szVender[16];
	UINT			uiFamily;
	UINT			uiModel;
	UINT			uiStepping;
	UINT			uiType;
	UINT			uiMHz;
	UINT			uiMaxInputValue;
	CPUID_RAWDATA_t	RawData[CPUID_MAX_RAWDATA+1];
} CPUID_t;
typedef CPUID_t	*PCPUID_t;

//////////////////////////////////////////////////////////////////////////////
// FUNCTION PROTOTYPES
//////////////////////////////////////////////////////////////////////////////

BOOL GetCPUID(PCPUID_t pcpuid);
BOOL CPUIDCacheCheck(PCPUID_t p, UINT uiType);
BOOL CPUIDSupported();

#endif // __CPUID32_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -