2080 lines
70 KiB
Diff
2080 lines
70 KiB
Diff
diff --git a/lib/librte_eal/common/arch/e2k/rte_cpuflags.c b/lib/librte_eal/common/arch/e2k/rte_cpuflags.c
|
|
new file mode 100644
|
|
index 0000000..6cfff21
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/arch/e2k/rte_cpuflags.c
|
|
@@ -0,0 +1,131 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright (C) Cavium, Inc. 2015.
|
|
+ * Copyright(c) 2015 RehiveTech. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of Cavium, Inc nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#include "rte_cpuflags.h"
|
|
+
|
|
+#include <elf.h>
|
|
+#include <fcntl.h>
|
|
+#include <assert.h>
|
|
+#include <unistd.h>
|
|
+#include <string.h>
|
|
+
|
|
+#ifndef AT_HWCAP
|
|
+#define AT_HWCAP 16
|
|
+#endif
|
|
+
|
|
+#ifndef AT_HWCAP2
|
|
+#define AT_HWCAP2 26
|
|
+#endif
|
|
+
|
|
+#ifndef AT_PLATFORM
|
|
+#define AT_PLATFORM 15
|
|
+#endif
|
|
+
|
|
+enum cpu_register_t {
|
|
+ REG_NONE = 0,
|
|
+ REG_HWCAP,
|
|
+ REG_HWCAP2,
|
|
+ REG_PLATFORM,
|
|
+ REG_MAX
|
|
+};
|
|
+
|
|
+typedef uint32_t hwcap_registers_t[REG_MAX];
|
|
+
|
|
+/**
|
|
+ * Struct to hold a processor feature entry
|
|
+ */
|
|
+struct feature_entry {
|
|
+ uint32_t reg;
|
|
+ uint32_t bit;
|
|
+#define CPU_FLAG_NAME_MAX_LEN 64
|
|
+ char name[CPU_FLAG_NAME_MAX_LEN];
|
|
+};
|
|
+
|
|
+#define FEAT_DEF(name, reg, bit) \
|
|
+ [RTE_CPUFLAG_##name] = {reg, bit, #name},
|
|
+
|
|
+const struct feature_entry rte_cpu_feature_table[] = {
|
|
+// FEAT_DEF(SWP, REG_HWCAP, 0)
|
|
+};
|
|
+/*
|
|
+ * Read AUXV software register and get cpu features for ARM
|
|
+ */
|
|
+static void
|
|
+rte_cpu_get_features(hwcap_registers_t out)
|
|
+{
|
|
+ out=0;
|
|
+// int auxv_fd;
|
|
+// _Elfx_auxv_t auxv;
|
|
+//
|
|
+// auxv_fd = open("/proc/self/auxv", O_RDONLY);
|
|
+// assert(auxv_fd);
|
|
+// while (read(auxv_fd, &auxv, sizeof(auxv)) == sizeof(auxv)) {
|
|
+// if (auxv.a_type == AT_HWCAP) {
|
|
+// out[REG_HWCAP] = auxv.a_un.a_val;
|
|
+// } else if (auxv.a_type == AT_HWCAP2) {
|
|
+// out[REG_HWCAP2] = auxv.a_un.a_val;
|
|
+// } else if (auxv.a_type == AT_PLATFORM) {
|
|
+// if (!strcmp((const char *)auxv.a_un.a_val, PLATFORM_STR))
|
|
+// out[REG_PLATFORM] = 0x0001;
|
|
+// }
|
|
+// }
|
|
+// close(auxv_fd);
|
|
+}
|
|
+
|
|
+/*
|
|
+ * Checks if a particular flag is available on current machine.
|
|
+ */
|
|
+int
|
|
+rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature)
|
|
+{
|
|
+ const struct feature_entry *feat;
|
|
+ hwcap_registers_t regs = {0};
|
|
+
|
|
+ if (feature >= RTE_CPUFLAG_NUMFLAGS)
|
|
+ return -ENOENT;
|
|
+
|
|
+// feat = &rte_cpu_feature_table[feature];
|
|
+// if (feat->reg == REG_NONE)
|
|
+ return -EFAULT;
|
|
+
|
|
+ rte_cpu_get_features(regs);
|
|
+ return (regs[feat->reg] >> feat->bit) & 1;
|
|
+}
|
|
+
|
|
+const char *
|
|
+rte_cpu_get_flag_name(enum rte_cpu_flag_t feature)
|
|
+{
|
|
+ if (feature >= RTE_CPUFLAG_NUMFLAGS)
|
|
+ return NULL;
|
|
+ return rte_cpu_feature_table[feature].name;
|
|
+}
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_atomic.h b/lib/librte_eal/common/include/arch/e2k/rte_atomic.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_atomic.h b/lib/librte_eal/common/include/arch/e2k/rte_atomic.h
|
|
new file mode 100644
|
|
index 0000000..f3f3b6e
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_atomic.h
|
|
@@ -0,0 +1,42 @@
|
|
+/*-
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2015 RehiveTech. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of RehiveTech nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_ATOMIC_ARM_H_
|
|
+#define _RTE_ATOMIC_ARM_H_
|
|
+
|
|
+#ifdef RTE_ARCH_64
|
|
+#include <rte_atomic_64.h>
|
|
+#else
|
|
+#include <rte_atomic_32.h>
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_ATOMIC_ARM_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_atomic_32.h b/lib/librte_eal/common/include/arch/e2k/rte_atomic_32.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_atomic_32.h b/lib/librte_eal/common/include/arch/e2k/rte_atomic_32.h
|
|
new file mode 100644
|
|
index 0000000..5ff5ea3
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_atomic_32.h
|
|
@@ -0,0 +1,86 @@
|
|
+/*-
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2015 RehiveTech. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of RehiveTech nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_ATOMIC_ARM32_H_
|
|
+#define _RTE_ATOMIC_ARM32_H_
|
|
+
|
|
+#ifndef RTE_FORCE_INTRINSICS
|
|
+# error Platform must be built with CONFIG_RTE_FORCE_INTRINSICS
|
|
+#endif
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#include "generic/rte_atomic.h"
|
|
+
|
|
+/**
|
|
+ * General memory barrier.
|
|
+ *
|
|
+ * Guarantees that the LOAD and STORE operations generated before the
|
|
+ * barrier occur before the LOAD and STORE operations generated after.
|
|
+ */
|
|
+#define rte_mb() __sync_synchronize()
|
|
+
|
|
+/**
|
|
+ * Write memory barrier.
|
|
+ *
|
|
+ * Guarantees that the STORE operations generated before the barrier
|
|
+ * occur before the STORE operations generated after.
|
|
+ */
|
|
+#define rte_wmb() do { asm volatile ("wait all_c=1" : : : "memory"); } while (0)
|
|
+
|
|
+/**
|
|
+ * Read memory barrier.
|
|
+ *
|
|
+ * Guarantees that the LOAD operations generated before the barrier
|
|
+ * occur before the LOAD operations generated after.
|
|
+ */
|
|
+#define rte_rmb() __sync_synchronize()
|
|
+
|
|
+#define rte_smp_mb() rte_mb()
|
|
+
|
|
+#define rte_smp_wmb() rte_wmb()
|
|
+
|
|
+#define rte_smp_rmb() rte_rmb()
|
|
+
|
|
+#define rte_io_mb() rte_mb()
|
|
+
|
|
+#define rte_io_wmb() rte_wmb()
|
|
+
|
|
+#define rte_io_rmb() rte_rmb()
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_ATOMIC_ARM32_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_atomic_64.h b/lib/librte_eal/common/include/arch/e2k/rte_atomic_64.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_atomic_64.h b/lib/librte_eal/common/include/arch/e2k/rte_atomic_64.h
|
|
new file mode 100644
|
|
index 0000000..40fe224
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_atomic_64.h
|
|
@@ -0,0 +1,71 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright (C) Cavium, Inc. 2015.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of Cavium, Inc nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+*/
|
|
+
|
|
+#ifndef _RTE_ATOMIC_ARM64_H_
|
|
+#define _RTE_ATOMIC_ARM64_H_
|
|
+
|
|
+#ifndef RTE_FORCE_INTRINSICS
|
|
+# error Platform must be built with CONFIG_RTE_FORCE_INTRINSICS
|
|
+#endif
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#include "generic/rte_atomic.h"
|
|
+
|
|
+#define dsb() do { asm volatile("wait all_c=1" : : : "memory"); } while(0)
|
|
+#define dmb() do { asm volatile("wait all_c=1" : : : "memory"); }while(0)
|
|
+
|
|
+#define rte_mb() dsb()
|
|
+
|
|
+#define rte_wmb() dsb()
|
|
+
|
|
+#define rte_rmb() dsb()
|
|
+
|
|
+#define rte_smp_mb() dmb()
|
|
+
|
|
+#define rte_smp_wmb() dmb()
|
|
+
|
|
+#define rte_smp_rmb() dmb()
|
|
+
|
|
+#define rte_io_mb() rte_mb()
|
|
+
|
|
+#define rte_io_wmb() rte_wmb()
|
|
+
|
|
+#define rte_io_rmb() rte_rmb()
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_ATOMIC_ARM64_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_byteorder.h b/lib/librte_eal/common/include/arch/e2k/rte_byteorder.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_byteorder.h b/lib/librte_eal/common/include/arch/e2k/rte_byteorder.h
|
|
new file mode 100644
|
|
index 0000000..b61e435
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_byteorder.h
|
|
@@ -0,0 +1,110 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2015 RehiveTech. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of RehiveTech nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_BYTEORDER_ARM_H_
|
|
+#define _RTE_BYTEORDER_ARM_H_
|
|
+
|
|
+#ifndef RTE_FORCE_INTRINSICS
|
|
+# error Platform must be built with CONFIG_RTE_FORCE_INTRINSICS
|
|
+#endif
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#include <stdint.h>
|
|
+#include <rte_common.h>
|
|
+#include "generic/rte_byteorder.h"
|
|
+
|
|
+///* fix missing __builtin_bswap16 for gcc older then 4.8 */
|
|
+//#if !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
|
|
+//
|
|
+//static inline uint16_t rte_arch_bswap16(uint16_t _x)
|
|
+//{
|
|
+// register uint16_t x = _x;
|
|
+//
|
|
+// asm volatile ("rev16 %w0,%w1"
|
|
+// : "=r" (x)
|
|
+// : "r" (x)
|
|
+// );
|
|
+// return x;
|
|
+//}
|
|
+//
|
|
+//#define rte_bswap16(x) ((uint16_t)(__builtin_constant_p(x) ? \
|
|
+// rte_constant_bswap16(x) : \
|
|
+// rte_arch_bswap16(x)))
|
|
+//#endif
|
|
+
|
|
+/* ARM architecture is bi-endian (both big and little).
|
|
+ * unlike ARM e2k is little-endian by default */
|
|
+#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
|
|
+
|
|
+#define rte_cpu_to_le_16(x) (x)
|
|
+#define rte_cpu_to_le_32(x) (x)
|
|
+#define rte_cpu_to_le_64(x) (x)
|
|
+
|
|
+#define rte_cpu_to_be_16(x) rte_bswap16(x)
|
|
+#define rte_cpu_to_be_32(x) rte_bswap32(x)
|
|
+#define rte_cpu_to_be_64(x) rte_bswap64(x)
|
|
+
|
|
+#define rte_le_to_cpu_16(x) (x)
|
|
+#define rte_le_to_cpu_32(x) (x)
|
|
+#define rte_le_to_cpu_64(x) (x)
|
|
+
|
|
+#define rte_be_to_cpu_16(x) rte_bswap16(x)
|
|
+#define rte_be_to_cpu_32(x) rte_bswap32(x)
|
|
+#define rte_be_to_cpu_64(x) rte_bswap64(x)
|
|
+
|
|
+#else /* RTE_BIG_ENDIAN */
|
|
+#error not_supported_bigendian_e2k
|
|
+#define rte_cpu_to_le_16(x) rte_bswap16(x)
|
|
+#define rte_cpu_to_le_32(x) rte_bswap32(x)
|
|
+#define rte_cpu_to_le_64(x) rte_bswap64(x)
|
|
+
|
|
+#define rte_cpu_to_be_16(x) (x)
|
|
+#define rte_cpu_to_be_32(x) (x)
|
|
+#define rte_cpu_to_be_64(x) (x)
|
|
+
|
|
+#define rte_le_to_cpu_16(x) rte_bswap16(x)
|
|
+#define rte_le_to_cpu_32(x) rte_bswap32(x)
|
|
+#define rte_le_to_cpu_64(x) rte_bswap64(x)
|
|
+
|
|
+#define rte_be_to_cpu_16(x) (x)
|
|
+#define rte_be_to_cpu_32(x) (x)
|
|
+#define rte_be_to_cpu_64(x) (x)
|
|
+#endif
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_BYTEORDER_ARM_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_cpuflags.h b/lib/librte_eal/common/include/arch/e2k/rte_cpuflags.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_cpuflags.h b/lib/librte_eal/common/include/arch/e2k/rte_cpuflags.h
|
|
new file mode 100644
|
|
index 0000000..b8f6288
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_cpuflags.h
|
|
@@ -0,0 +1,42 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2015 RehiveTech. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of RehiveTech nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_CPUFLAGS_ARM_H_
|
|
+#define _RTE_CPUFLAGS_ARM_H_
|
|
+
|
|
+#ifdef RTE_ARCH_64
|
|
+#include <rte_cpuflags_64.h>
|
|
+#else
|
|
+#include <rte_cpuflags_32.h>
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_CPUFLAGS_ARM_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_cpuflags_32.h b/lib/librte_eal/common/include/arch/e2k/rte_cpuflags_32.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_cpuflags_32.h b/lib/librte_eal/common/include/arch/e2k/rte_cpuflags_32.h
|
|
new file mode 100644
|
|
index 0000000..b18782f
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_cpuflags_32.h
|
|
@@ -0,0 +1,84 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2015 RehiveTech. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of RehiveTech nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_CPUFLAGS_ARM32_H_
|
|
+#define _RTE_CPUFLAGS_ARM32_H_
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#error header_cpuflags32_was_included
|
|
+
|
|
+/**
|
|
+ * Enumeration of all CPU features supported
|
|
+ */
|
|
+enum rte_cpu_flag_t {
|
|
+ RTE_CPUFLAG_SWP = 0,
|
|
+ RTE_CPUFLAG_HALF,
|
|
+ RTE_CPUFLAG_THUMB,
|
|
+ RTE_CPUFLAG_A26BIT,
|
|
+ RTE_CPUFLAG_FAST_MULT,
|
|
+ RTE_CPUFLAG_FPA,
|
|
+ RTE_CPUFLAG_VFP,
|
|
+ RTE_CPUFLAG_EDSP,
|
|
+ RTE_CPUFLAG_JAVA,
|
|
+ RTE_CPUFLAG_IWMMXT,
|
|
+ RTE_CPUFLAG_CRUNCH,
|
|
+ RTE_CPUFLAG_THUMBEE,
|
|
+ RTE_CPUFLAG_NEON,
|
|
+ RTE_CPUFLAG_VFPv3,
|
|
+ RTE_CPUFLAG_VFPv3D16,
|
|
+ RTE_CPUFLAG_TLS,
|
|
+ RTE_CPUFLAG_VFPv4,
|
|
+ RTE_CPUFLAG_IDIVA,
|
|
+ RTE_CPUFLAG_IDIVT,
|
|
+ RTE_CPUFLAG_VFPD32,
|
|
+ RTE_CPUFLAG_LPAE,
|
|
+ RTE_CPUFLAG_EVTSTRM,
|
|
+ RTE_CPUFLAG_AES,
|
|
+ RTE_CPUFLAG_PMULL,
|
|
+ RTE_CPUFLAG_SHA1,
|
|
+ RTE_CPUFLAG_SHA2,
|
|
+ RTE_CPUFLAG_CRC32,
|
|
+ RTE_CPUFLAG_V7L,
|
|
+ /* The last item */
|
|
+ RTE_CPUFLAG_NUMFLAGS,/**< This should always be the last! */
|
|
+};
|
|
+
|
|
+#include "generic/rte_cpuflags.h"
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_CPUFLAGS_ARM32_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_cpuflags_64.h b/lib/librte_eal/common/include/arch/e2k/rte_cpuflags_64.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_cpuflags_64.h b/lib/librte_eal/common/include/arch/e2k/rte_cpuflags_64.h
|
|
new file mode 100644
|
|
index 0000000..04f6c17
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_cpuflags_64.h
|
|
@@ -0,0 +1,64 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright (C) Cavium, Inc. 2015.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of Cavium, Inc nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_CPUFLAGS_ARM64_H_
|
|
+#define _RTE_CPUFLAGS_ARM64_H_
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+/**
|
|
+ * Enumeration of all CPU features supported
|
|
+ */
|
|
+enum rte_cpu_flag_t {
|
|
+/* RTE_CPUFLAG_FP = 0,
|
|
+ RTE_CPUFLAG_NEON,
|
|
+ RTE_CPUFLAG_EVTSTRM,
|
|
+ RTE_CPUFLAG_AES,
|
|
+ RTE_CPUFLAG_PMULL,
|
|
+ RTE_CPUFLAG_SHA1,
|
|
+ RTE_CPUFLAG_SHA2,
|
|
+ RTE_CPUFLAG_CRC32,
|
|
+ RTE_CPUFLAG_ATOMICS,
|
|
+ RTE_CPUFLAG_AARCH64,*/
|
|
+ /* The last item */
|
|
+ RTE_CPUFLAG_NUMFLAGS = 0/**< This should always be the last! */
|
|
+};
|
|
+
|
|
+#include "generic/rte_cpuflags.h"
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_CPUFLAGS_ARM64_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_cycles.h b/lib/librte_eal/common/include/arch/e2k/rte_cycles.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_cycles.h b/lib/librte_eal/common/include/arch/e2k/rte_cycles.h
|
|
new file mode 100644
|
|
index 0000000..a8009a0
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_cycles.h
|
|
@@ -0,0 +1,42 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2015 RehiveTech. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of RehiveTech nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_CYCLES_ARM_H_
|
|
+#define _RTE_CYCLES_ARM_H_
|
|
+
|
|
+#ifdef RTE_ARCH_64
|
|
+#include <rte_cycles_64.h>
|
|
+#else
|
|
+#include <rte_cycles_32.h>
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_CYCLES_ARM_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_cycles_32.h b/lib/librte_eal/common/include/arch/e2k/rte_cycles_32.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_cycles_32.h b/lib/librte_eal/common/include/arch/e2k/rte_cycles_32.h
|
|
new file mode 100644
|
|
index 0000000..ebc012d
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_cycles_32.h
|
|
@@ -0,0 +1,115 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2015 RehiveTech. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of RehiveTech nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_CYCLES_ARM32_H_
|
|
+#define _RTE_CYCLES_ARM32_H_
|
|
+
|
|
+/* ARM v7 does not have suitable source of clock signals. The only clock counter
|
|
+ available in the core is 32 bit wide. Therefore it is unsuitable as the
|
|
+ counter overlaps every few seconds and probably is not accessible by
|
|
+ userspace programs. Therefore we use clock_gettime(CLOCK_MONOTONIC_RAW) to
|
|
+ simulate counter running at 1GHz.
|
|
+*/
|
|
+
|
|
+#include <time.h>
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#include "generic/rte_cycles.h"
|
|
+
|
|
+/**
|
|
+ * Read the time base register.
|
|
+ *
|
|
+ * @return
|
|
+ * The time base for this lcore.
|
|
+ */
|
|
+#ifndef RTE_ARM_EAL_RDTSC_USE_PMU
|
|
+
|
|
+/**
|
|
+ * This call is easily portable to any ARM architecture, however,
|
|
+ * it may be damn slow and inprecise for some tasks.
|
|
+ */
|
|
+static inline uint64_t
|
|
+__rte_rdtsc_syscall(void)
|
|
+{
|
|
+ struct timespec val;
|
|
+ uint64_t v;
|
|
+
|
|
+ while (clock_gettime(CLOCK_MONOTONIC_RAW, &val) != 0)
|
|
+ /* no body */;
|
|
+
|
|
+ v = (uint64_t) val.tv_sec * 1000000000LL;
|
|
+ v += (uint64_t) val.tv_nsec;
|
|
+ return v;
|
|
+}
|
|
+#define rte_rdtsc __rte_rdtsc_syscall
|
|
+
|
|
+#else
|
|
+
|
|
+/**
|
|
+ * This function requires to configure the PMCCNTR and enable
|
|
+ * userspace access to it:
|
|
+ *
|
|
+ * asm volatile("mcr p15, 0, %0, c9, c14, 0" : : "r"(1));
|
|
+ * asm volatile("mcr p15, 0, %0, c9, c12, 0" : : "r"(29));
|
|
+ * asm volatile("mcr p15, 0, %0, c9, c12, 1" : : "r"(0x8000000f));
|
|
+ *
|
|
+ * which is possible only from the priviledged mode (kernel space).
|
|
+ */
|
|
+static inline uint64_t
|
|
+__rte_rdtsc_pmccntr(void)
|
|
+{
|
|
+ uint64_t final_tsc;
|
|
+ asm volatile("rrd %%clkr, %0" : "=r"(final_tsc));
|
|
+ return (uint64_t)final_tsc;
|
|
+}
|
|
+#define rte_rdtsc __rte_rdtsc_pmccntr
|
|
+
|
|
+#endif /* RTE_ARM_EAL_RDTSC_USE_PMU */
|
|
+
|
|
+static inline uint64_t
|
|
+rte_rdtsc_precise(void)
|
|
+{
|
|
+ rte_mb();
|
|
+ return rte_rdtsc();
|
|
+}
|
|
+
|
|
+static inline uint64_t
|
|
+rte_get_tsc_cycles(void) { return rte_rdtsc(); }
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_CYCLES_ARM32_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_cycles_64.h b/lib/librte_eal/common/include/arch/e2k/rte_cycles_64.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_cycles_64.h b/lib/librte_eal/common/include/arch/e2k/rte_cycles_64.h
|
|
new file mode 100644
|
|
index 0000000..dd448b3
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_cycles_64.h
|
|
@@ -0,0 +1,103 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright (C) Cavium, Inc. 2015.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of Cavium, Inc nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+*/
|
|
+
|
|
+#ifndef _RTE_CYCLES_ARM64_H_
|
|
+#define _RTE_CYCLES_ARM64_H_
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#include "generic/rte_cycles.h"
|
|
+
|
|
+/**
|
|
+ * Read the time base register.
|
|
+ *
|
|
+ * @return
|
|
+ * The time base for this lcore.
|
|
+ */
|
|
+#ifndef RTE_ARM_EAL_RDTSC_USE_PMU
|
|
+/**
|
|
+ * This call is portable to any ARMv8 architecture, however, typically
|
|
+ * cntvct_el0 runs at <= 100MHz and it may be imprecise for some tasks.
|
|
+ */
|
|
+static inline uint64_t
|
|
+rte_rdtsc(void)
|
|
+{
|
|
+ uint64_t tsc;
|
|
+ asm volatile("rrd %%clkr, %0" : "=r"(tsc));
|
|
+ return tsc;
|
|
+}
|
|
+#else
|
|
+/**
|
|
+ * This is an alternative method to enable rte_rdtsc() with high resolution
|
|
+ * PMU cycles counter.The cycle counter runs at cpu frequency and this scheme
|
|
+ * uses ARMv8 PMU subsystem to get the cycle counter at userspace, However,
|
|
+ * access to PMU cycle counter from user space is not enabled by default in
|
|
+ * arm64 linux kernel.
|
|
+ * It is possible to enable cycle counter at user space access by configuring
|
|
+ * the PMU from the privileged mode (kernel space).
|
|
+ *
|
|
+ * asm volatile("msr pmintenset_el1, %0" : : "r" ((u64)(0 << 31)));
|
|
+ * asm volatile("msr pmcntenset_el0, %0" :: "r" BIT(31));
|
|
+ * asm volatile("msr pmuserenr_el0, %0" : : "r"(BIT(0) | BIT(2)));
|
|
+ * asm volatile("mrs %0, pmcr_el0" : "=r" (val));
|
|
+ * val |= (BIT(0) | BIT(2));
|
|
+ * isb();
|
|
+ * asm volatile("msr pmcr_el0, %0" : : "r" (val));
|
|
+ *
|
|
+ */
|
|
+static inline uint64_t
|
|
+rte_rdtsc(void)
|
|
+{
|
|
+ uint64_t tsc;
|
|
+
|
|
+ asm volatile("rrd %%clkr, %0" : "=r"(tsc));
|
|
+ return tsc;
|
|
+}
|
|
+#endif
|
|
+
|
|
+static inline uint64_t
|
|
+rte_rdtsc_precise(void)
|
|
+{
|
|
+ rte_mb();
|
|
+ return rte_rdtsc();
|
|
+}
|
|
+
|
|
+static inline uint64_t
|
|
+rte_get_tsc_cycles(void) { return rte_rdtsc(); }
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_CYCLES_ARM64_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_io.h b/lib/librte_eal/common/include/arch/e2k/rte_io.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_io.h b/lib/librte_eal/common/include/arch/e2k/rte_io.h
|
|
new file mode 100644
|
|
index 0000000..3b63ec8
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_io.h
|
|
@@ -0,0 +1,51 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2016 Cavium, Inc. All rights reserved.
|
|
+ * All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of Cavium, Inc nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_IO_ARM_H_
|
|
+#define _RTE_IO_ARM_H_
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#ifdef RTE_ARCH_64
|
|
+#include "rte_io_64.h"
|
|
+#else
|
|
+#include "generic/rte_io.h"
|
|
+#endif
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_IO_ARM_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_io_64.h b/lib/librte_eal/common/include/arch/e2k/rte_io_64.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_io_64.h b/lib/librte_eal/common/include/arch/e2k/rte_io_64.h
|
|
new file mode 100644
|
|
index 0000000..ba0f64e
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_io_64.h
|
|
@@ -0,0 +1,200 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright (C) Cavium, Inc. 2016.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of Cavium, Inc nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_IO_ARM64_H_
|
|
+#define _RTE_IO_ARM64_H_
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#include <stdint.h>
|
|
+
|
|
+#define RTE_OVERRIDE_IO_H
|
|
+
|
|
+#include "generic/rte_io.h"
|
|
+#include "rte_atomic_64.h"
|
|
+// Do check asm/io.h
|
|
+// FIXME e3s/kubik needs some serializing; and other don't
|
|
+static __rte_always_inline uint8_t
|
|
+rte_read8_relaxed(const volatile void *addr)
|
|
+{
|
|
+ uint8_t val;
|
|
+
|
|
+ asm volatile(
|
|
+ "ldb %1, 0, %0"
|
|
+ : [val] "=r" (val)
|
|
+ : [addr] "r" (addr));
|
|
+ return val;
|
|
+}
|
|
+
|
|
+static __rte_always_inline uint16_t
|
|
+rte_read16_relaxed(const volatile void *addr)
|
|
+{
|
|
+ uint16_t val;
|
|
+
|
|
+ asm volatile(
|
|
+ "ldh %1, 0, %0"
|
|
+ : [val] "=r" (val)
|
|
+ : [addr] "r" (addr));
|
|
+ return val;
|
|
+}
|
|
+
|
|
+static __rte_always_inline uint32_t
|
|
+rte_read32_relaxed(const volatile void *addr)
|
|
+{
|
|
+ uint32_t val;
|
|
+
|
|
+ asm volatile(
|
|
+ "ldw %1, 0, %0"
|
|
+ : [val] "=r" (val)
|
|
+ : [addr] "r" (addr));
|
|
+ return val;
|
|
+}
|
|
+
|
|
+static __rte_always_inline uint64_t
|
|
+rte_read64_relaxed(const volatile void *addr)
|
|
+{
|
|
+ uint64_t val;
|
|
+
|
|
+ asm volatile(
|
|
+ "ldd %1, 0, %0"
|
|
+ : [val] "=r" (val)
|
|
+ : [addr] "r" (addr));
|
|
+ return val;
|
|
+}
|
|
+
|
|
+static __rte_always_inline void
|
|
+rte_write8_relaxed(uint8_t val, volatile void *addr)
|
|
+{
|
|
+ asm volatile(
|
|
+ "stb %1, 0, %0"
|
|
+ :
|
|
+ : [val] "r" (val), [addr] "r" (addr));
|
|
+}
|
|
+
|
|
+static __rte_always_inline void
|
|
+rte_write16_relaxed(uint16_t val, volatile void *addr)
|
|
+{
|
|
+ asm volatile(
|
|
+ "sth %1, 0, %0"
|
|
+ :
|
|
+ : [val] "r" (val), [addr] "r" (addr));
|
|
+}
|
|
+
|
|
+static __rte_always_inline void
|
|
+rte_write32_relaxed(uint32_t val, volatile void *addr)
|
|
+{
|
|
+ asm volatile(
|
|
+ "stw %1, 0, %0"
|
|
+ :
|
|
+ : [val] "r" (val), [addr] "r" (addr));
|
|
+}
|
|
+
|
|
+static __rte_always_inline void
|
|
+rte_write64_relaxed(uint64_t val, volatile void *addr)
|
|
+{
|
|
+ asm volatile(
|
|
+ "std %1, 0, %0"
|
|
+ :
|
|
+ : [val] "r" (val), [addr] "r" (addr));
|
|
+}
|
|
+
|
|
+static __rte_always_inline uint8_t
|
|
+rte_read8(const volatile void *addr)
|
|
+{
|
|
+ uint8_t val;
|
|
+ val = rte_read8_relaxed(addr);
|
|
+ rte_io_rmb();
|
|
+ return val;
|
|
+}
|
|
+
|
|
+static __rte_always_inline uint16_t
|
|
+rte_read16(const volatile void *addr)
|
|
+{
|
|
+ uint16_t val;
|
|
+ val = rte_read16_relaxed(addr);
|
|
+ rte_io_rmb();
|
|
+ return val;
|
|
+}
|
|
+
|
|
+static __rte_always_inline uint32_t
|
|
+rte_read32(const volatile void *addr)
|
|
+{
|
|
+ uint32_t val;
|
|
+ val = rte_read32_relaxed(addr);
|
|
+ rte_io_rmb();
|
|
+ return val;
|
|
+}
|
|
+
|
|
+static __rte_always_inline uint64_t
|
|
+rte_read64(const volatile void *addr)
|
|
+{
|
|
+ uint64_t val;
|
|
+ val = rte_read64_relaxed(addr);
|
|
+ rte_io_rmb();
|
|
+ return val;
|
|
+}
|
|
+
|
|
+static __rte_always_inline void
|
|
+rte_write8(uint8_t value, volatile void *addr)
|
|
+{
|
|
+ rte_io_wmb();
|
|
+ rte_write8_relaxed(value, addr);
|
|
+}
|
|
+
|
|
+static __rte_always_inline void
|
|
+rte_write16(uint16_t value, volatile void *addr)
|
|
+{
|
|
+ rte_io_wmb();
|
|
+ rte_write16_relaxed(value, addr);
|
|
+}
|
|
+
|
|
+static __rte_always_inline void
|
|
+rte_write32(uint32_t value, volatile void *addr)
|
|
+{
|
|
+ rte_io_wmb();
|
|
+ rte_write32_relaxed(value, addr);
|
|
+}
|
|
+
|
|
+static __rte_always_inline void
|
|
+rte_write64(uint64_t value, volatile void *addr)
|
|
+{
|
|
+ rte_io_wmb();
|
|
+ rte_write64_relaxed(value, addr);
|
|
+}
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_IO_ARM64_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_memcpy.h b/lib/librte_eal/common/include/arch/e2k/rte_memcpy.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_memcpy.h b/lib/librte_eal/common/include/arch/e2k/rte_memcpy.h
|
|
new file mode 100644
|
|
index 0000000..1d562c3
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_memcpy.h
|
|
@@ -0,0 +1,42 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2015 RehiveTech. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of RehiveTech nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_MEMCPY_ARM_H_
|
|
+#define _RTE_MEMCPY_ARM_H_
|
|
+
|
|
+#ifdef RTE_ARCH_64
|
|
+#include <rte_memcpy_64.h>
|
|
+#else
|
|
+#include <rte_memcpy_32.h>
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_MEMCPY_ARM_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_memcpy_32.h b/lib/librte_eal/common/include/arch/e2k/rte_memcpy_32.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_memcpy_32.h b/lib/librte_eal/common/include/arch/e2k/rte_memcpy_32.h
|
|
new file mode 100644
|
|
index 0000000..b471a3d
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_memcpy_32.h
|
|
@@ -0,0 +1,93 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2015 RehiveTech. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of RehiveTech nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_MEMCPY_ARM32_H_
|
|
+#define _RTE_MEMCPY_ARM32_H_
|
|
+
|
|
+#include <stdint.h>
|
|
+#include <string.h>
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#include "generic/rte_memcpy.h"
|
|
+
|
|
+
|
|
+static inline void
|
|
+rte_mov16(uint8_t *dst, const uint8_t *src)
|
|
+{
|
|
+ memcpy(dst, src, 16);
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_mov32(uint8_t *dst, const uint8_t *src)
|
|
+{
|
|
+ memcpy(dst, src, 32);
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_mov48(uint8_t *dst, const uint8_t *src)
|
|
+{
|
|
+ memcpy(dst, src, 48);
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_mov64(uint8_t *dst, const uint8_t *src)
|
|
+{
|
|
+ memcpy(dst, src, 64);
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_mov128(uint8_t *dst, const uint8_t *src)
|
|
+{
|
|
+ memcpy(dst, src, 128);
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_mov256(uint8_t *dst, const uint8_t *src)
|
|
+{
|
|
+ memcpy(dst, src, 256);
|
|
+}
|
|
+
|
|
+static inline void *
|
|
+rte_memcpy(void *dst, const void *src, size_t n)
|
|
+{
|
|
+ return memcpy(dst, src, n);
|
|
+}
|
|
+
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_MEMCPY_ARM32_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_memcpy_64.h b/lib/librte_eal/common/include/arch/e2k/rte_memcpy_64.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_memcpy_64.h b/lib/librte_eal/common/include/arch/e2k/rte_memcpy_64.h
|
|
new file mode 100644
|
|
index 0000000..b80d8ba
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_memcpy_64.h
|
|
@@ -0,0 +1,87 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright (C) Cavium, Inc. 2015.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of Cavium, Inc nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+*/
|
|
+
|
|
+#ifndef _RTE_MEMCPY_ARM64_H_
|
|
+#define _RTE_MEMCPY_ARM64_H_
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#include <stdint.h>
|
|
+#include <string.h>
|
|
+
|
|
+#include "generic/rte_memcpy.h"
|
|
+
|
|
+static inline void
|
|
+rte_mov16(uint8_t *dst, const uint8_t *src)
|
|
+{
|
|
+ memcpy(dst, src, 16);
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_mov32(uint8_t *dst, const uint8_t *src)
|
|
+{
|
|
+ memcpy(dst, src, 32);
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_mov48(uint8_t *dst, const uint8_t *src)
|
|
+{
|
|
+ memcpy(dst, src, 48);
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_mov64(uint8_t *dst, const uint8_t *src)
|
|
+{
|
|
+ memcpy(dst, src, 64);
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_mov128(uint8_t *dst, const uint8_t *src)
|
|
+{
|
|
+ memcpy(dst, src, 128);
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_mov256(uint8_t *dst, const uint8_t *src)
|
|
+{
|
|
+ memcpy(dst, src, 256);
|
|
+}
|
|
+
|
|
+#define rte_memcpy(d, s, n) memcpy((d), (s), (n))
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_MEMCPY_ARM_64_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_pause.h b/lib/librte_eal/common/include/arch/e2k/rte_pause.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_pause.h b/lib/librte_eal/common/include/arch/e2k/rte_pause.h
|
|
new file mode 100644
|
|
index 0000000..b772ca0
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_pause.h
|
|
@@ -0,0 +1,50 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2017 Cavium, Inc. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of Cavium, Inc nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_PAUSE_ARM_H_
|
|
+#define _RTE_PAUSE_ARM_H_
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#ifdef RTE_ARCH_64
|
|
+#include <rte_pause_64.h>
|
|
+#else
|
|
+#include <rte_pause_32.h>
|
|
+#endif
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_PAUSE_ARM_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_pause_32.h b/lib/librte_eal/common/include/arch/e2k/rte_pause_32.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_pause_32.h b/lib/librte_eal/common/include/arch/e2k/rte_pause_32.h
|
|
new file mode 100644
|
|
index 0000000..ec680b5
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_pause_32.h
|
|
@@ -0,0 +1,51 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2017 Cavium, Inc. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of Cavium, Inc nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_PAUSE_ARM32_H_
|
|
+#define _RTE_PAUSE_ARM32_H_
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#include <rte_common.h>
|
|
+#include "generic/rte_pause.h"
|
|
+
|
|
+static inline void rte_pause(void)
|
|
+{
|
|
+}
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_PAUSE_ARM32_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_pause_64.h b/lib/librte_eal/common/include/arch/e2k/rte_pause_64.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_pause_64.h b/lib/librte_eal/common/include/arch/e2k/rte_pause_64.h
|
|
new file mode 100644
|
|
index 0000000..34bdd4d
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_pause_64.h
|
|
@@ -0,0 +1,52 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2017 Cavium, Inc. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of Cavium, Inc nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_PAUSE_ARM64_H_
|
|
+#define _RTE_PAUSE_ARM64_H_
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#include <rte_common.h>
|
|
+#include "generic/rte_pause.h"
|
|
+
|
|
+static inline void rte_pause(void)
|
|
+{
|
|
+// asm volatile("yield" ::: "memory");
|
|
+}
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_PAUSE_ARM64_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_prefetch.h b/lib/librte_eal/common/include/arch/e2k/rte_prefetch.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_prefetch.h b/lib/librte_eal/common/include/arch/e2k/rte_prefetch.h
|
|
new file mode 100644
|
|
index 0000000..aa37de5
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_prefetch.h
|
|
@@ -0,0 +1,42 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2015 RehiveTech. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of RehiveTech nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_PREFETCH_ARM_H_
|
|
+#define _RTE_PREFETCH_ARM_H_
|
|
+
|
|
+#ifdef RTE_ARCH_64
|
|
+#include <rte_prefetch_64.h>
|
|
+#else
|
|
+#include <rte_prefetch_32.h>
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_PREFETCH_ARM_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_prefetch_32.h b/lib/librte_eal/common/include/arch/e2k/rte_prefetch_32.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_prefetch_32.h b/lib/librte_eal/common/include/arch/e2k/rte_prefetch_32.h
|
|
new file mode 100644
|
|
index 0000000..f8c25bc
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_prefetch_32.h
|
|
@@ -0,0 +1,69 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2015 RehiveTech. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of RehiveTech nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_PREFETCH_ARM32_H_
|
|
+#define _RTE_PREFETCH_ARM32_H_
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#include <rte_common.h>
|
|
+#include "generic/rte_prefetch.h"
|
|
+
|
|
+static inline void rte_prefetch0(const volatile void *p)
|
|
+{
|
|
+ __builtin_prefetch (p, 0, 0);
|
|
+}
|
|
+
|
|
+static inline void rte_prefetch1(const volatile void *p)
|
|
+{
|
|
+ __builtin_prefetch (p, 0, 1);
|
|
+}
|
|
+
|
|
+static inline void rte_prefetch2(const volatile void *p)
|
|
+{
|
|
+ __builtin_prefetch (p, 0, 2);
|
|
+}
|
|
+
|
|
+static inline void rte_prefetch_non_temporal(const volatile void *p)
|
|
+{
|
|
+ /* non-temporal version not available, fallback to rte_prefetch0 */
|
|
+ rte_prefetch0(p);
|
|
+// __builtin_prefetch (p, 1, 0);
|
|
+}
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_PREFETCH_ARM32_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_prefetch_64.h b/lib/librte_eal/common/include/arch/e2k/rte_prefetch_64.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_prefetch_64.h b/lib/librte_eal/common/include/arch/e2k/rte_prefetch_64.h
|
|
new file mode 100644
|
|
index 0000000..4301fc1
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_prefetch_64.h
|
|
@@ -0,0 +1,69 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright (C) Cavium, Inc. 2015.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of Cavium, Inc nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_PREFETCH_ARM_64_H_
|
|
+#define _RTE_PREFETCH_ARM_64_H_
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#include <rte_common.h>
|
|
+#include "generic/rte_prefetch.h"
|
|
+
|
|
+static inline void rte_prefetch0(const volatile void *p)
|
|
+{
|
|
+ __builtin_prefetch (p, 0, 0);
|
|
+}
|
|
+
|
|
+static inline void rte_prefetch1(const volatile void *p)
|
|
+{
|
|
+ __builtin_prefetch (p, 0, 1);
|
|
+}
|
|
+
|
|
+static inline void rte_prefetch2(const volatile void *p)
|
|
+{
|
|
+ __builtin_prefetch (p, 0, 2);
|
|
+}
|
|
+
|
|
+static inline void rte_prefetch_non_temporal(const volatile void *p)
|
|
+{
|
|
+ /* non-temporal version not available, fallback to rte_prefetch0 */
|
|
+ rte_prefetch0(p);
|
|
+// __builtin_prefetch (p, 1, 0);
|
|
+}
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_PREFETCH_ARM_64_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_rwlock.h b/lib/librte_eal/common/include/arch/e2k/rte_rwlock.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_rwlock.h b/lib/librte_eal/common/include/arch/e2k/rte_rwlock.h
|
|
new file mode 100644
|
|
index 0000000..664bec8
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_rwlock.h
|
|
@@ -0,0 +1,40 @@
|
|
+/* copied from ppc_64 */
|
|
+
|
|
+#ifndef _RTE_RWLOCK_ARM_H_
|
|
+#define _RTE_RWLOCK_ARM_H_
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#include "generic/rte_rwlock.h"
|
|
+
|
|
+static inline void
|
|
+rte_rwlock_read_lock_tm(rte_rwlock_t *rwl)
|
|
+{
|
|
+ rte_rwlock_read_lock(rwl);
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_rwlock_read_unlock_tm(rte_rwlock_t *rwl)
|
|
+{
|
|
+ rte_rwlock_read_unlock(rwl);
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_rwlock_write_lock_tm(rte_rwlock_t *rwl)
|
|
+{
|
|
+ rte_rwlock_write_lock(rwl);
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_rwlock_write_unlock_tm(rte_rwlock_t *rwl)
|
|
+{
|
|
+ rte_rwlock_write_unlock(rwl);
|
|
+}
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_RWLOCK_ARM_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_spinlock.h b/lib/librte_eal/common/include/arch/e2k/rte_spinlock.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_spinlock.h b/lib/librte_eal/common/include/arch/e2k/rte_spinlock.h
|
|
new file mode 100644
|
|
index 0000000..396a42e
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_spinlock.h
|
|
@@ -0,0 +1,92 @@
|
|
+/*
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2015 RehiveTech. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of RehiveTech nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_SPINLOCK_ARM_H_
|
|
+#define _RTE_SPINLOCK_ARM_H_
|
|
+
|
|
+#ifndef RTE_FORCE_INTRINSICS
|
|
+# error Platform must be built with CONFIG_RTE_FORCE_INTRINSICS
|
|
+#endif
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+
|
|
+#include <rte_common.h>
|
|
+#include "generic/rte_spinlock.h"
|
|
+
|
|
+static inline int rte_tm_supported(void)
|
|
+{
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_spinlock_lock_tm(rte_spinlock_t *sl)
|
|
+{
|
|
+ rte_spinlock_lock(sl); /* fall-back */
|
|
+}
|
|
+
|
|
+static inline int
|
|
+rte_spinlock_trylock_tm(rte_spinlock_t *sl)
|
|
+{
|
|
+ return rte_spinlock_trylock(sl);
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_spinlock_unlock_tm(rte_spinlock_t *sl)
|
|
+{
|
|
+ rte_spinlock_unlock(sl);
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_spinlock_recursive_lock_tm(rte_spinlock_recursive_t *slr)
|
|
+{
|
|
+ rte_spinlock_recursive_lock(slr); /* fall-back */
|
|
+}
|
|
+
|
|
+static inline void
|
|
+rte_spinlock_recursive_unlock_tm(rte_spinlock_recursive_t *slr)
|
|
+{
|
|
+ rte_spinlock_recursive_unlock(slr);
|
|
+}
|
|
+
|
|
+static inline int
|
|
+rte_spinlock_recursive_trylock_tm(rte_spinlock_recursive_t *slr)
|
|
+{
|
|
+ return rte_spinlock_recursive_trylock(slr);
|
|
+}
|
|
+
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif /* _RTE_SPINLOCK_ARM_H_ */
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_vect.h b/lib/librte_eal/common/include/arch/e2k/rte_vect.h
|
|
diff --git a/lib/librte_eal/common/include/arch/e2k/rte_vect.h b/lib/librte_eal/common/include/arch/e2k/rte_vect.h
|
|
new file mode 100644
|
|
index 0000000..92afc3b
|
|
--- /dev/null
|
|
+++ b/lib/librte_eal/common/include/arch/e2k/rte_vect.h
|
|
@@ -0,0 +1,74 @@
|
|
+/*-
|
|
+ * BSD LICENSE
|
|
+ *
|
|
+ * Copyright(c) 2015 Cavium, Inc. All rights reserved.
|
|
+ *
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
+ * modification, are permitted provided that the following conditions
|
|
+ * are met:
|
|
+ *
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
+ * the documentation and/or other materials provided with the
|
|
+ * distribution.
|
|
+ * * Neither the name of Cavium, Inc nor the names of its
|
|
+ * contributors may be used to endorse or promote products derived
|
|
+ * from this software without specific prior written permission.
|
|
+ *
|
|
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
+ */
|
|
+
|
|
+#ifndef _RTE_VECT_ARM_H_
|
|
+#define _RTE_VECT_ARM_H_
|
|
+
|
|
+#include <stdint.h>
|
|
+#include "generic/rte_vect.h"
|
|
+#include "rte_debug.h"
|
|
+#include <x86intrin.h>
|
|
+
|
|
+#ifdef __cplusplus
|
|
+extern "C" {
|
|
+#endif
|
|
+typedef __m128i xmm_t;
|
|
+
|
|
+#define XMM_SIZE (sizeof(xmm_t))
|
|
+#define XMM_MASK (XMM_SIZE - 1)
|
|
+
|
|
+typedef union rte_xmm {
|
|
+ xmm_t x;
|
|
+ uint8_t u8[XMM_SIZE / sizeof(uint8_t)];
|
|
+ uint16_t u16[XMM_SIZE / sizeof(uint16_t)];
|
|
+ uint32_t u32[XMM_SIZE / sizeof(uint32_t)];
|
|
+ uint64_t u64[XMM_SIZE / sizeof(uint64_t)];
|
|
+ double pd[XMM_SIZE / sizeof(double)];
|
|
+} rte_xmm_t;
|
|
+
|
|
+#define _mm_cvtsi128_si64(a) \
|
|
+__extension__ ({ \
|
|
+ rte_xmm_t m; \
|
|
+ m.x = (a); \
|
|
+ (m.u64[0]); \
|
|
+})
|
|
+
|
|
+
|
|
+
|
|
+
|
|
+
|
|
+///
|
|
+#ifdef __cplusplus
|
|
+}
|
|
+#endif
|
|
+
|
|
+#endif
|
|
--
|
|
2.16.4
|
|
|