From 48fa25d4dea31318d0c8551ee8f52a0f25f65c51 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 5 May 2020 02:52:26 +0200 Subject: [PATCH] include: Add intrin.h and use it to provide __cpuid implementation. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- include/Makefile.in | 1 + include/msvcrt/intrin.h | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 include/msvcrt/intrin.h diff --git a/include/Makefile.in b/include/Makefile.in index 74db5ee1516..8aa61021d22 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -450,6 +450,7 @@ SOURCES = \ msvcrt/fenv.h \ msvcrt/float.h \ msvcrt/fpieee.h \ + msvcrt/intrin.h \ msvcrt/inttypes.h \ msvcrt/io.h \ msvcrt/limits.h \ diff --git a/include/msvcrt/intrin.h b/include/msvcrt/intrin.h new file mode 100644 index 00000000000..5ad2776450a --- /dev/null +++ b/include/msvcrt/intrin.h @@ -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 */