aboutsummaryrefslogtreecommitdiffstats
path: root/vppinfra/vppinfra/cpu.h
diff options
context:
space:
mode:
authorChristophe Fontaine <christophe.fontaine@qosmos.com>2016-12-19 14:41:52 +0100
committerChristophe Fontaine <christophe.fontaine@qosmos.com>2016-12-21 15:16:44 +0100
commit33e81950cf937ab081c7c591f06e8871b0f00e93 (patch)
tree6589eb085e89c2631b9dc7dcc3126a66c368f604 /vppinfra/vppinfra/cpu.h
parent7e9e6e1f1c1b9f41547899aeff5a05a5a7421103 (diff)
aarch64 compatibility
- lb plugin: compatibility for non x86 platforms. - Add vector_neon.h to support simd instructions, especially 'u16x8_zero_byte_mask' used in "vnet/vnet/ip/ip4_source_and_port_range_check.c" Change-Id: I395546b0e2d5748e73daffa51269a200ef8d1235 Signed-off-by: Christophe Fontaine <christophe.fontaine@qosmos.com>
Diffstat (limited to 'vppinfra/vppinfra/cpu.h')
-rw-r--r--vppinfra/vppinfra/cpu.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/vppinfra/vppinfra/cpu.h b/vppinfra/vppinfra/cpu.h
index 7d63f85b506..9c149f3fa2a 100644
--- a/vppinfra/vppinfra/cpu.h
+++ b/vppinfra/vppinfra/cpu.h
@@ -51,8 +51,6 @@
return & fn; \
}
-#if __x86_64__
-#include "cpuid.h"
#define foreach_x86_64_flags \
_ (sse3, 1, ecx, 0) \
@@ -66,6 +64,9 @@ _ (aes, 1, ecx, 25) \
_ (sha, 7, ebx, 29) \
_ (invariant_tsc, 0x80000007, edx, 8)
+#if defined(__x86_64__)
+#include "cpuid.h"
+
static inline int
clib_get_cpuid (const u32 lev, u32 * eax, u32 * ebx, u32 * ecx, u32 * edx)
{
@@ -90,13 +91,18 @@ clib_cpu_supports_ ## flag() \
}
foreach_x86_64_flags
#undef _
+#else
+
+#define _(flag, func, reg, bit) \
+static inline int clib_cpu_supports_ ## flag() { return 0; }
+foreach_x86_64_flags
+#undef _
+#endif
#endif
format_function_t format_cpu_uarch;
format_function_t format_cpu_model_name;
format_function_t format_cpu_flags;
-#endif
-
/*
* fd.io coding-style-patch-verification: ON
*