]> git.proxmox.com Git - mirror_qemu.git/commit - target/i386/cpu.c
target-i386: Replace uint32_t vendor fields by vendor string in x86_def_t
authorIgor Mammedov <imammedo@redhat.com>
Mon, 21 Jan 2013 14:06:36 +0000 (15:06 +0100)
committerAndreas Färber <afaerber@suse.de>
Sun, 27 Jan 2013 13:34:27 +0000 (14:34 +0100)
commit99b88a1708919934f4092f7b6dcc2cca9d4072e9
tree5db55c3033836a3f58f07cc20bdb80b13f68135d
parent8ba8a69848f8b910207a4b57c68db9a7e92af578
target-i386: Replace uint32_t vendor fields by vendor string in x86_def_t

Vendor property setter takes string as vendor value but cpudefs
use uint32_t vendor[123] fields to define vendor value. It makes it
difficult to unify and use property setter for values from cpudefs.

Simplify code by using vendor property setter, vendor[123] fields
are converted into vendor[13] array to keep its value. And vendor
property setter is used to access/set value on CPU.

 - Make for() cycle reusable for the next patch by adding
   x86_cpu_vendor_words2str()

Intel's CPUID spec[1] says:
"
5.1.1 ...
These registers contain the ASCII string: GenuineIntel
...
"

List[2] of known vendor values shows that they all are 12 ASCII
characters long, padded where necessary with space.

Current supported values are all ASCII characters packed in
ebx, edx, ecx. So lets state that QEMU supports 12 printable ASCII
characters packed in ebx, edx, ecx registers for cpuid(0) instruction.

*1 - http://www.intel.com/Assets/PDF/appnote/241618.pdf
*2 - http://en.wikipedia.org/wiki/CPUID#EAX.3D0:_Get_vendor_ID

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
target-i386/cpu.c
target-i386/cpu.h