On 2/11/20 1:40 AM, Taylor Simpson wrote:
Functions to support scatter/gather
Signed-off-by: Taylor Simpson <tsimp...@quicinc.com>
---
target/hexagon/mmvec/system_ext_mmvec.c | 265 ++++++++++++++++++++++++++++++++
target/hexagon/mmvec/system_ext_mmvec.h | 38 +++++
2 files changed, 303 insertions(+)
create mode 100644 target/hexagon/mmvec/system_ext_mmvec.c
create mode 100644 target/hexagon/mmvec/system_ext_mmvec.h
diff --git a/target/hexagon/mmvec/system_ext_mmvec.c
b/target/hexagon/mmvec/system_ext_mmvec.c
new file mode 100644
index 0000000..f80ae3d
--- /dev/null
+++ b/target/hexagon/mmvec/system_ext_mmvec.c
@@ -0,0 +1,265 @@
+/*
+ * Copyright (c) 2019 Qualcomm Innovation Center, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdio.h>
+#include <string.h>
Similarly, drop previous includes.
+#include "qemu/osdep.h"
+#include "opcodes.h"
+#include "insn.h"
+#include "mmvec/macros.h"
+#include "qemu.h"
+
+#define TYPE_LOAD 'L'
+#define TYPE_STORE 'S'
+#define TYPE_FETCH 'F'
+#define TYPE_ICINVA 'I'
+
+enum mem_access_types {
+ access_type_INVALID = 0,
+ access_type_unknown = 1,
+ access_type_load = 2,
+ access_type_store = 3,
+ access_type_fetch = 4,
+ access_type_dczeroa = 5,
+ access_type_dccleana = 6,
+ access_type_dcinva = 7,
+ access_type_dccleaninva = 8,
+ access_type_icinva = 9,
+ access_type_ictagr = 10,
+ access_type_ictagw = 11,
+ access_type_icdatar = 12,
+ access_type_dcfetch = 13,
+ access_type_l2fetch = 14,
+ access_type_l2cleanidx = 15,
+ access_type_l2cleaninvidx = 16,
+ access_type_l2tagr = 17,
+ access_type_l2tagw = 18,
+ access_type_dccleanidx = 19,
+ access_type_dcinvidx = 20,
+ access_type_dccleaninvidx = 21,
+ access_type_dctagr = 22,
+ access_type_dctagw = 23,
+ access_type_k0unlock = 24,
+ access_type_l2locka = 25,
+ access_type_l2unlocka = 26,
+ access_type_l2kill = 27,
+ access_type_l2gclean = 28,
+ access_type_l2gcleaninv = 29,
+ access_type_l2gunlock = 30,
+ access_type_synch = 31,
+ access_type_isync = 32,
+ access_type_pause = 33,
+ access_type_load_phys = 34,
+ access_type_load_locked = 35,
+ access_type_store_conditional = 36,
+ access_type_barrier = 37,
+ access_type_memcpy_load = 39,
+ access_type_memcpy_store = 40,
+
+ NUM_CORE_ACCESS_TYPES
+};
+
+enum ext_mem_access_types {
+ access_type_vload = NUM_CORE_ACCESS_TYPES,
+ access_type_vstore,
+ access_type_vload_nt,
+ access_type_vstore_nt,
+ access_type_vgather_load,
+ access_type_vscatter_store,
+ access_type_vscatter_release,
+ access_type_vgather_release,
+ access_type_vfetch,
+ NUM_EXT_ACCESS_TYPES
+};
+
+static inline
+target_ulong mem_init_access(CPUHexagonState *env, int slot, size4u_t vaddr,
+ int width, enum mem_access_types mtype,
+ int type_for_xlate)
+{
+#ifdef CONFIG_USER_ONLY
+ /* Nothing to do for Linux user mode in qemu */
+ return vaddr;
+#else
+#error System mode not yet implemented for Hexagon
Do you plan to contribute system mode? :)
+#endif
+}
+
[...]