Skip to content

Commit ff1e540

Browse files
zapsterfniephaus
authored andcommitted
svm: fix placement of the NO_INLINE definition in cpuid.c
1 parent c548ae6 commit ff1e540

File tree

1 file changed

+7
-7
lines changed
  • substratevm/src/com.oracle.svm.native.libchelper/src

1 file changed

+7
-7
lines changed

substratevm/src/com.oracle.svm.native.libchelper/src/cpuid.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
#include <stdint.h>
2929
#include <string.h>
3030

31+
#if defined(_MSC_VER) && !defined(__clang__)
32+
#define NO_INLINE __declspec(noinline)
33+
#else
34+
#define NO_INLINE __attribute__((noinline))
35+
#endif
36+
3137
#ifndef _WIN64
3238
#include <alloca.h>
3339
#else
@@ -42,12 +48,6 @@
4248
#ifndef _WIN64
4349
#include <cpuid.h>
4450

45-
#if defined(_MSC_VER) && !defined(__clang__)
46-
#define NO_INLINE __declspec(noinline)
47-
#else
48-
#define NO_INLINE __attribute__((noinline))
49-
#endif
50-
5151
static void read_xem_xcr0(uint32_t *eax, uint32_t *edx) {
5252
__asm__ __volatile__("xgetbv" : "=a"(*eax), "=d"(*edx) : "c"(0));
5353
}
@@ -388,7 +388,7 @@ static void initialize_cpuinfo(CpuidInfo *_cpuid_info)
388388
}
389389

390390
// ported from from vm_version_x86.cpp::feature_flags
391-
static void NO_INLINE set_cpufeatures(CPUFeatures *features, CpuidInfo *_cpuid_info)
391+
NO_INLINE static void set_cpufeatures(CPUFeatures *features, CpuidInfo *_cpuid_info)
392392
{
393393
if (_cpuid_info->std_cpuid1_edx.bits.cmpxchg8 != 0)
394394
features->fCX8 = 1;

0 commit comments

Comments
 (0)