The script just parses whatever cpu-gather.sh printed out.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
xml()
{
hex='\(0x[0-9a-f]\+\)'
- match="$hex $hex: eax=$hex ebx=$hex ecx=$hex edx=$hex"
- subst="<cpuid eax_in='\\1' ecx_in='\\2' eax='\\3' ebx='\\4' ecx='\\5' edx='\\6'\\/>"
+ matchCPUID="$hex $hex: eax=$hex ebx=$hex ecx=$hex edx=$hex"
+ substCPUID="<cpuid eax_in='\\1' ecx_in='\\2' eax='\\3' ebx='\\4' ecx='\\5' edx='\\6'\\/>"
+
+ matchMSR="$hex: $hex\(.......[0-9a-f]\)"
+ substMSR="<msr index='\\1' edx='\\2' eax='0x\\3'\\/>"
echo "<!-- $model -->"
echo "<cpudata arch='x86'>"
- sed -ne "s/^ *$match$/ $subst/p"
+ sed -ne "s/^ *$matchCPUID$/ $substCPUID/p; s/^ *$matchMSR$/ $substMSR/p"
echo "</cpudata>"
}
<cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x0000302e' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/>
<cpuid eax_in='0x80860000' ecx_in='0x00' eax='0x00000b54' ebx='0x00000f3c' ecx='0x00000064' edx='0x00000000'/>
<cpuid eax_in='0xc0000000' ecx_in='0x00' eax='0x00000b54' ebx='0x00000f3c' ecx='0x00000064' edx='0x00000000'/>
+ <msr index='0x10a' edx='0x00000000' eax='0x0000002b'/>
</cpudata>