From 55201e2d0e60003edfd7e2c7c4c592136b000f44 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 6 Aug 2013 19:16:30 +0100 Subject: [settings] Expose CPUID instruction via settings mechanism Allow CPUID values to be read using the syntax ${cpuid/.} For example, ${cpuid/2.0x80000001} will give the value of %ecx after calling CPUID with %eax=0x80000001. Values for 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 --- src/config/config.c | 3 +++ src/config/settings.h | 1 + 2 files changed, 4 insertions(+) (limited to 'src/config') diff --git a/src/config/config.c b/src/config/config.c index 437f61339..06c5713f0 100644 --- a/src/config/config.c +++ b/src/config/config.c @@ -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 diff --git a/src/config/settings.h b/src/config/settings.h index 9c5c2d20b..97131e883 100644 --- a/src/config/settings.h +++ b/src/config/settings.h @@ -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 -- cgit v1.2.3-55-g7522