next up previous contents index
Next: 10.5.2 cpuid: identify the Up: (X86) Processor Identification and Previous: (X86) Processor Identification and

10.5.1 cpu_info: CPU identification data structure

   

SYNOPSIS

#include <oskit/x86/cpuid.h>

struct cpu_info  {

		unsigned        stepping        : 4;	/* Stepping ID */
		unsigned        model           : 4;	/* Model */
		unsigned        family          : 4;	/* Family */
		unsigned        type            : 2;	/* Processor type */
		unsigned        feature_flags;		/* Features supported */
		char            vendor_id[12];		/* Vendor ID string */
		unsigned char   cache_config[16];	/* Cache information */
	 
};

DESCRIPTION

This structure is used to hold identification information about x86 processors, such as information returned by the CPUID instruction. The cpuid toolkit function, described below, fills in an instance of this structure with information about the current processor.

Note that it is expected that the cpu_info structure will continue to grow in the future as new x86-architecture processors are released, so client code should not depend on this structure in ways that will break if the structure's size changes.

The family field describes the processor family:

CPU_FAMILY_386
A 386-class processor.
CPU_FAMILY_486
A 486-class processor.
CPU_FAMILY_PENTIUM
A Pentium-class (``586'') processor.
CPU_FAMILY_PENTIUM_PRO
A Pentium Pro-class (``686'') processor.

The type field is one of the following:

CPU_TYPE_ORIGINAL
Original OEM processor.
CPU_TYPE_OVERDRIVE
OverDrive upgrade processor.
CPU_TYPE_DUAL
Dual processor.

The feature_flags field is a bit field containing the following bits:

CPUF_ON_CHIP_FPU
Set if the CPU has a built-in floating point unit.
CPUF_VM86_EXT
Set if the virtual 8086 mode extensions are supported, i.e., the VIF and VIP flags register bits, and the VME and PVI bits in CR4.
CPUF_IO_BKPTS
Set if I/O breakpoints are supported, i.e., the DR7_RW_IO mode defined in x86/debug_reg.h.
CPUF_4MB_PAGES
Set if 4MB superpages are supported, i.e., the INTEL_PDE_SUPERPAGE page directory entry bit defined in x86/paging.h.
CPUF_TS_COUNTER
Set if the on-chip timestamp counter and the RDTSC instruction are available.
CPUF_PENTIUM_MSR
Set if the Pentium model specific registers are available.
CPUF_PAGE_ADDR_EXT
Set if the Pentium Pro's page addressing extensions (36-bit physical addresses and 2MB pages) are available.
CPUF_MACHINE_CHECK_EXCP
Set if the processor supports the Machine Check exception (vector 18, or T_MACHINE_CHECK in x86/trap.h).
CPUF_CMPXCHG8B
Set if the processor supports the CMPXCHG8B instruction (also known as ``double-compare-and-swap'').
CPUF_LOCAL_APIC
Set if the processor has a built-in local APIC (Advanced Programmable Interrupt Controller), for symmetric multiprocessor support.
CPUF_MEM_RANGE_REGS
Set if the processor supports the memory type range registers.
CPUF_PAGE_GLOBAL_EXT
Set if the processor supports the global global paging extensions, i.e., the INTEL_PDE_GLOBAL page table entry bit defined in x86/paging.h.
CPUF_MACHINE_CHECK_ARCH
Set if the processor supports Intel's machine check architecture and the MCG_CAP model-specific register.
CPUF_CMOVCC
Set if the processor supports the CMOVcc instructions.

The cpuid.h header file also contains symbolic definitions for other constants such as the cache configuration descriptor values; see the header file and the Intel documentation for details on these.


next up previous contents index
Next: 10.5.2 cpuid: identify the Up: (X86) Processor Identification and Previous: (X86) Processor Identification and

University of Utah Flux Research Group