mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 01:03:09 +00:00
Fix __cpuid() compile error with gcc
Use same __cpuid() signature used under Windows. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
c853b87c08
commit
a4551c59e0
1 changed files with 7 additions and 4 deletions
11
src/types.h
11
src/types.h
|
@ -80,11 +80,14 @@ typedef uint64_t Bitboard;
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
inline void __cpuid(unsigned int op,
|
inline void __cpuid(int CPUInfo[4], int InfoType)
|
||||||
unsigned int *eax, unsigned int *ebx,
|
|
||||||
unsigned int *ecx, unsigned int *edx)
|
|
||||||
{
|
{
|
||||||
*eax = op;
|
int* eax = CPUInfo + 0;
|
||||||
|
int* ebx = CPUInfo + 1;
|
||||||
|
int* ecx = CPUInfo + 2;
|
||||||
|
int* edx = CPUInfo + 3;
|
||||||
|
|
||||||
|
*eax = InfoType;
|
||||||
*ecx = 0;
|
*ecx = 0;
|
||||||
__asm__("cpuid" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
|
__asm__("cpuid" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
|
||||||
: "0" (*eax), "2" (*ecx));
|
: "0" (*eax), "2" (*ecx));
|
||||||
|
|
Loading…
Add table
Reference in a new issue