|
|
|
@ -1,9 +1,9 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2014 Martin Lenders <mlenders@inf.fu-berlin.de>
|
|
|
|
|
*
|
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser General
|
|
|
|
|
* Public License. See the file LICENSE in the top level directory for more
|
|
|
|
|
* details.
|
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
|
* directory for more details.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -26,9 +26,14 @@
|
|
|
|
|
|
|
|
|
|
void cpuid_get(void *id)
|
|
|
|
|
{
|
|
|
|
|
memset(id, 0xff, CPUID_ID_LEN); /* Just in case _native_id is shorter
|
|
|
|
|
than CPUID_ID_LEN. */
|
|
|
|
|
memcpy(id, &(_native_id), sizeof(_native_id));
|
|
|
|
|
/* Just in case _native_id is shorter than CPUID_ID_LEN: */
|
|
|
|
|
size_t len = CPUID_ID_LEN;
|
|
|
|
|
if (sizeof(_native_id) < CPUID_ID_LEN) {
|
|
|
|
|
memset(((char*)id) + sizeof(_native_id), 0xff,
|
|
|
|
|
CPUID_ID_LEN - sizeof(_native_id));
|
|
|
|
|
len = sizeof(_native_id);
|
|
|
|
|
}
|
|
|
|
|
memcpy(id, &(_native_id), len);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|