windows cpuid x64 version

This commit is contained in:
Doug MacEachern 2008-04-10 18:39:22 +00:00
parent 7c61bc6695
commit aac5fcb703
1 changed files with 9 additions and 1 deletions

View File

@ -525,7 +525,15 @@ static void sigar_cpuid(sigar_uint32_t request,
# endif # endif
#elif defined(WIN32) #elif defined(WIN32)
# ifdef _M_X64 # ifdef _M_X64
/*XXX*/ # include <intrin.h>
# define SIGAR_HAS_CPUID
static void sigar_cpuid(sigar_uint32_t request,
sigar_cpuid_t *id)
{
sigar_uint32_t info[4];
__cpuid(info, request); /* as of MSVC 7 */
memcpy(id, &info[0], sizeof(info));
}
# else # else
# define SIGAR_HAS_CPUID # define SIGAR_HAS_CPUID
static void sigar_cpuid(sigar_uint32_t request, static void sigar_cpuid(sigar_uint32_t request,