58
Embedded AMD Processor Recognition
Embedded AMD-K6 Processors BIOS Design Guide
23913A/0—November 2000
Preliminary Information
I
Standard functions
provide a simple method for software to
access information common to all x86 processors.
Extended functions
provide information on extensions
specific to a vendor’s processor (for example, AMD’s
processors).
I
The flexibility of the CPUID instruction allows for the addition
of new CPUID functions in future generations of processors.
“Appendix A” on page 71 contains a detailed description of the
CPUID instruction.
Testing for the CPUID Instruction
Beginning with the AMD-K6E processor Model 7, all AMD
processors support the CPUID instruction. However, it is still
recommended that software verify that the CPUID instruction
is supported. To use the CPUID instruction, software must first
determine if the processor supports the CPUID instruction.
CPUID support is determined in one of the following ways:
I
Execute the CPUID instruction and check whether an
illegal instruction exception occurs. If an exception occurs,
the processor does not have CPUID support.
Check if the ID bit (bit 21) of the EFLAGS register is
writable. If the bit is writable (that is, it can be modified),
the CPUID instruction is supported.
I
The operating system (OS) environment determines which
approach is more appropriate. These techniques are described
in the following sections.
Illegal Instruction
Exception Method
This technique requires a way for a user program to detect and
handle illegal instruction exceptions. Where such capabilities
are present, this method represents a reliable way of detecting
support for the CPUID instruction. The CPUID sample code
described on page 67 uses this approach.
EFLAGS ID-Bit
Method
This technique retrieves the contents of EFLAGS using the
PUSHFD instruction, toggles the ID bit, and uses the POPFD
instruction to write the modified value of the ID bit into the
EFLAGS register. It then retrieves the contents of EFLAGS
using a second PUSHFD instruction and checks whether the
value of the ID bit differs from the original value.