[settings] Expose CPUID instruction via settings mechanism

Allow CPUID values to be read using the syntax

  ${cpuid/<register>.<function>}

For example, ${cpuid/2.0x80000001} will give the value of %ecx after
calling CPUID with %eax=0x80000001.  Values for <register> are encoded
as %eax=0, %ebx=1, %ecx=2, %edx=3.

The numeric encoding is more sophisticated than described above,
allowing for settings such as the CPU model (obtained by calling CPUID
with %eax=0x80000002-0x80000004 inclusive and concatenating the values
returned in %eax:%ebx:%ecx:%edx).  See the source code for details.

The "cpuvendor" and "cpumodel" settings provide easy access to these
more complex CPUID settings.

This functionality is intended to complement the "cpuid" command,
which allows for testing individual CPUID feature bits.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2013-08-06 19:16:30 +01:00
parent 53c01d6444
commit 55201e2d0e
6 changed files with 303 additions and 19 deletions

View File

@@ -313,6 +313,9 @@ REQUIRE_OBJECT ( pci_settings );
#ifdef VMWARE_SETTINGS
REQUIRE_OBJECT ( guestinfo );
#endif
#ifdef CPUID_SETTINGS
REQUIRE_OBJECT ( cpuid_settings );
#endif
/*
* Drag in selected keyboard map

View File

@@ -10,6 +10,7 @@
FILE_LICENCE ( GPL2_OR_LATER );
#define PCI_SETTINGS /* PCI device settings */
//#define CPUID_SETTINGS /* CPUID settings */
//#define VMWARE_SETTINGS /* VMware GuestInfo settings */
#include <config/local/settings.h>