mirror of
https://github.com/anrieff/libcpuid
synced 2024-12-16 16:35:45 +00:00
Fix some line endings (make them consistent on each mixed-EOL file).
Sadly, there's no consistency for the whole project, but I don't want to mess with it now.
This commit is contained in:
parent
f7e6c6b274
commit
dcbee3517f
6 changed files with 32 additions and 32 deletions
|
@ -29,10 +29,10 @@
|
|||
|
||||
int cpuid_exists_by_eflags(void)
|
||||
{
|
||||
#if defined(PLATFORM_X64)
|
||||
#if defined(PLATFORM_X64)
|
||||
return 1; /* CPUID is always present on the x86_64 */
|
||||
#elif defined(PLATFORM_X86)
|
||||
# if defined(COMPILER_GCC)
|
||||
#elif defined(PLATFORM_X86)
|
||||
# if defined(COMPILER_GCC)
|
||||
int result;
|
||||
__asm __volatile(
|
||||
" pushfl\n"
|
||||
|
@ -50,7 +50,7 @@ int cpuid_exists_by_eflags(void)
|
|||
: "=m"(result)
|
||||
: :"eax", "ecx", "memory");
|
||||
return (result != 0);
|
||||
# elif defined(COMPILER_MICROSOFT)
|
||||
# elif defined(COMPILER_MICROSOFT)
|
||||
int result;
|
||||
__asm {
|
||||
pushfd
|
||||
|
@ -67,12 +67,12 @@ int cpuid_exists_by_eflags(void)
|
|||
popfd
|
||||
};
|
||||
return (result != 0);
|
||||
# else
|
||||
return 0;
|
||||
# endif /* COMPILER_MICROSOFT */
|
||||
#else
|
||||
return 0;
|
||||
#endif /* PLATFORM_X86 */
|
||||
# else
|
||||
return 0;
|
||||
# endif /* COMPILER_MICROSOFT */
|
||||
#else
|
||||
return 0;
|
||||
#endif /* PLATFORM_X86 */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -81,12 +81,12 @@ int cpuid_exists_by_eflags(void)
|
|||
*/
|
||||
void exec_cpuid(uint32_t *regs)
|
||||
{
|
||||
#ifdef INLINE_ASM_SUPPORTED
|
||||
#ifdef INLINE_ASM_SUPPORTED
|
||||
#ifdef COMPILER_GCC
|
||||
# ifdef PLATFORM_X64
|
||||
__asm __volatile(
|
||||
" mov %0, %%rdi\n"
|
||||
|
||||
|
||||
" push %%rbx\n"
|
||||
" push %%rcx\n"
|
||||
" push %%rdx\n"
|
||||
|
@ -112,7 +112,7 @@ void exec_cpuid(uint32_t *regs)
|
|||
# else
|
||||
__asm __volatile(
|
||||
" mov %0, %%edi\n"
|
||||
|
||||
|
||||
" push %%ebx\n"
|
||||
" push %%ecx\n"
|
||||
" push %%edx\n"
|
||||
|
@ -167,7 +167,7 @@ void exec_cpuid(uint32_t *regs)
|
|||
# endif /* COMPILER_MICROSOFT */
|
||||
#endif
|
||||
#endif /* INLINE_ASSEMBLY_SUPPORTED */
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef INLINE_ASM_SUPPORTED
|
||||
void cpu_rdtsc(uint64_t* result)
|
||||
|
|
|
@ -28,21 +28,21 @@
|
|||
#include "libcpuid.h"
|
||||
|
||||
/* Determine Compiler: */
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER)
|
||||
# define COMPILER_MICROSOFT
|
||||
#elif defined(__GNUC__)
|
||||
#elif defined(__GNUC__)
|
||||
# define COMPILER_GCC
|
||||
#endif
|
||||
|
||||
/* Determine Platform */
|
||||
#if defined(__x86_64__) || defined(_M_AMD64)
|
||||
# define PLATFORM_X64
|
||||
#elif defined(__i386__) || defined(_M_IX86)
|
||||
#elif defined(__i386__) || defined(_M_IX86)
|
||||
# define PLATFORM_X86
|
||||
#endif
|
||||
|
||||
/* Under Windows/AMD64 with MSVC, inline assembly isn't supported */
|
||||
#if (defined(COMPILER_GCC) && defined(PLATFORM_X64)) || defined(PLATFORM_X86)
|
||||
#if (defined(COMPILER_GCC) && defined(PLATFORM_X64)) || defined(PLATFORM_X86)
|
||||
# define INLINE_ASM_SUPPORTED
|
||||
#endif
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ RSC=rc.exe
|
|||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D VERSION=\"0.2.1\" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D VERSION=\"0.2.1\" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
@ -64,7 +64,7 @@ LIB32=link.exe -lib
|
|||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D VERSION=\"0.2.1\" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D VERSION=\"0.2.1\" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
|
|
@ -51,15 +51,15 @@ typedef unsigned uint32_t;
|
|||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
#if (defined _MSC_VER) && (_MSC_VER <= 1300)
|
||||
typedef unsigned short uint16_t;
|
||||
#if (defined _MSC_VER) && (_MSC_VER <= 1300)
|
||||
/* MSVC 6.0: no long longs ... */
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#else
|
||||
/* all other sane compilers: */
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#else
|
||||
/* all other sane compilers: */
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="VERSION=\"0.2.1\""
|
||||
PreprocessorDefinitions="VERSION=\"0.2.1\""
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
|
@ -60,7 +60,7 @@
|
|||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions="VERSION=\"0.2.1\""
|
||||
PreprocessorDefinitions="VERSION=\"0.2.1\""
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
|
@ -99,7 +99,7 @@
|
|||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions="VERSION=\"0.2.1\""
|
||||
PreprocessorDefinitions="VERSION=\"0.2.1\""
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
|
|
|
@ -109,8 +109,8 @@ int cpu_msr_driver_close(struct msr_driver_t* drv)
|
|||
}
|
||||
# endif /* __APPLE__ */
|
||||
#else /* _WIN32 */
|
||||
#include <windows.h>
|
||||
#include <winioctl.h>
|
||||
#include <windows.h>
|
||||
#include <winioctl.h>
|
||||
#include <winerror.h>
|
||||
|
||||
extern uint8_t cc_x86driver_code[];
|
||||
|
|
Loading…
Reference in a new issue