mirror of
https://github.com/anrieff/libcpuid
synced 2024-12-16 16:35:45 +00:00
Less warnings
This commit is contained in:
parent
7e92710d7c
commit
7d8819905f
2 changed files with 17 additions and 4 deletions
|
@ -84,7 +84,7 @@ int cpuid_exists_by_eflags(void)
|
|||
*/
|
||||
void exec_cpuid(uint32_t *regs)
|
||||
{
|
||||
#if defined(COMPILER_GCC) || defined(COMPILER_CLANG)
|
||||
# if defined(COMPILER_GCC) || defined(COMPILER_CLANG)
|
||||
# ifdef PLATFORM_X64
|
||||
__asm __volatile(
|
||||
" mov %0, %%rdi\n"
|
||||
|
@ -206,7 +206,7 @@ void cpu_rdtsc(uint64_t* result)
|
|||
#ifdef INLINE_ASM_SUPPORTED
|
||||
void busy_sse_loop(int cycles)
|
||||
{
|
||||
#if defined(COMPILER_GCC) || defined(COMPILER_CLANG)
|
||||
# if defined(COMPILER_GCC) || defined(COMPILER_CLANG)
|
||||
#ifndef __APPLE__
|
||||
# define XALIGN ".balign 16\n"
|
||||
#else
|
||||
|
@ -520,6 +520,7 @@ void busy_sse_loop(int cycles)
|
|||
" jnz 1b\n"
|
||||
::"a"(cycles)
|
||||
);
|
||||
#endif
|
||||
#else
|
||||
# ifdef COMPILER_MICROSOFT
|
||||
__asm {
|
||||
|
@ -832,4 +833,4 @@ bsLoop:
|
|||
# endif /* COMPILER_MICROSOFT */
|
||||
#endif /* COMPILER_GCC */
|
||||
}
|
||||
#endif /* INLINE_ASSEMBLY_SUPPORTED */
|
||||
#endif /* INLINE_ASSEMBLY_SUPPORTED */
|
|
@ -29,24 +29,36 @@
|
|||
|
||||
/* Determine Compiler: */
|
||||
#if defined(_MSC_VER)
|
||||
#if !defined(COMPILER_MICROSOFT)
|
||||
# define COMPILER_MICROSOFT
|
||||
#endif
|
||||
#elif defined(__GNUC__)
|
||||
#if !defined(COMPILER_GCC)
|
||||
# define COMPILER_GCC
|
||||
#endif
|
||||
#elif defined(__clang__)
|
||||
#if !defined(COMPILER_CLANG)
|
||||
# define COMPILER_CLANG
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Determine Platform */
|
||||
#if defined(__x86_64__) || defined(_M_AMD64)
|
||||
#if !defined(PLATFORM_X64)
|
||||
# define PLATFORM_X64
|
||||
#endif
|
||||
#elif defined(__i386__) || defined(_M_IX86)
|
||||
#if !defined(PLATFORM_X86)
|
||||
# define PLATFORM_X86
|
||||
#endif
|
||||
#elif defined(__ARMEL__)
|
||||
#if !defined(PLATFORM_ARM)
|
||||
# define PLATFORM_ARM
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Under Windows/AMD64 with MSVC, inline assembly isn't supported */
|
||||
#if ((defined(COMPILER_GCC) || defined(COMPILER_CLANG))) && defined(PLATFORM_X64)) || defined(PLATFORM_X86) || defined(PLATFORM_ARM)
|
||||
#if ((defined(COMPILER_GCC) || defined(COMPILER_CLANG))) && (defined(PLATFORM_X64) || defined(PLATFORM_X86) || defined(PLATFORM_ARM))
|
||||
# define INLINE_ASM_SUPPORTED
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue