include: Add intrin.h and use it to provide __cpuid implementation.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2020-05-05 02:52:26 +02:00 committed by Alexandre Julliard
parent 6849be3ffa
commit 48fa25d4de
2 changed files with 26 additions and 0 deletions

View File

@ -450,6 +450,7 @@ SOURCES = \
msvcrt/fenv.h \ msvcrt/fenv.h \
msvcrt/float.h \ msvcrt/float.h \
msvcrt/fpieee.h \ msvcrt/fpieee.h \
msvcrt/intrin.h \
msvcrt/inttypes.h \ msvcrt/inttypes.h \
msvcrt/io.h \ msvcrt/io.h \
msvcrt/limits.h \ msvcrt/limits.h \

25
include/msvcrt/intrin.h Normal file
View File

@ -0,0 +1,25 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the Wine project.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef _INC_INTRIN
#define _INC_INTRIN
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__i386__) || defined(__x86_64__)
static inline void __cpuid(int info[4], int ax)
{
__asm__ ("cpuid" : "=a"(info[0]), "=b" (info[1]), "=c"(info[2]), "=d"(info[3]) : "a"(ax), "c"(0));
}
#endif
#ifdef __cplusplus
}
#endif
#endif /* _INC_INTRIN */