mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
cpu_x86: Make x86cpuidSetBits more general
The function is renamed as virCPUx86DataItemSetBits and it works on virCPUx86DataItem now. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
559ccd7815
commit
9c6f00fc33
@ -216,16 +216,16 @@ x86cpuidMatchMasked(const virCPUx86CPUID *cpuid,
|
||||
|
||||
|
||||
static void
|
||||
x86cpuidSetBits(virCPUx86CPUID *cpuid,
|
||||
const virCPUx86CPUID *mask)
|
||||
virCPUx86DataItemSetBits(virCPUx86DataItemPtr item,
|
||||
const virCPUx86DataItem *mask)
|
||||
{
|
||||
if (!mask)
|
||||
return;
|
||||
|
||||
cpuid->eax |= mask->eax;
|
||||
cpuid->ebx |= mask->ebx;
|
||||
cpuid->ecx |= mask->ecx;
|
||||
cpuid->edx |= mask->edx;
|
||||
item->cpuid.eax |= mask->cpuid.eax;
|
||||
item->cpuid.ebx |= mask->cpuid.ebx;
|
||||
item->cpuid.ecx |= mask->cpuid.ecx;
|
||||
item->cpuid.edx |= mask->cpuid.edx;
|
||||
}
|
||||
|
||||
|
||||
@ -393,7 +393,7 @@ virCPUx86DataAddItem(virCPUx86Data *data,
|
||||
virCPUx86DataItemPtr existing;
|
||||
|
||||
if ((existing = virCPUx86DataGet(data, item))) {
|
||||
x86cpuidSetBits(&existing->cpuid, &item->cpuid);
|
||||
virCPUx86DataItemSetBits(existing, item);
|
||||
} else {
|
||||
if (VIR_APPEND_ELEMENT_COPY(data->items, data->len,
|
||||
*((virCPUx86DataItemPtr)item)) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user