]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[settings] Expose CPUID instruction via settings mechanism
authorMichael Brown <mcb30@ipxe.org>
Tue, 6 Aug 2013 18:16:30 +0000 (19:16 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 7 Aug 2013 11:06:28 +0000 (12:06 +0100)
commit55201e2d0e60003edfd7e2c7c4c592136b000f44
tree3be4677eaac90b8c686edf1318a8726895868649
parent53c01d6444d9e7d5b420c65e9486e990960aba45
[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>
src/arch/x86/core/cpuid.c
src/arch/x86/core/cpuid_settings.c [new file with mode: 0644]
src/arch/x86/include/bits/errfile.h
src/arch/x86/include/ipxe/cpuid.h
src/config/config.c
src/config/settings.h