1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-30 00:00:15 +01:00

simplify code and avoid unneeded memcpy

This commit is contained in:
Stefan Lankes 2017-02-18 11:38:33 +01:00
parent f3ddda3b70
commit caabadd6c7

View file

@ -620,10 +620,7 @@ int cpu_detection(void) {
LOG_INFO("HermitCore is running on a hypervisor!\n");
cpuid(0x40000000, &a, &b, &c, &d);
memcpy(vendor_id, &b, 4);
memcpy(vendor_id + 4, &c, 4);
memcpy(vendor_id + 8, &d, 4);
cpuid(0x40000000, &a, (uint32_t*)vendor_id, (uint32_t*)(vendor_id+4), (uint32_t*)(vendor_id+8));
vendor_id[12] = '\0';
LOG_INFO("Hypervisor Vendor Id: %s\n", vendor_id);