[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 12/16] target/mips/translate: Extract DisasContext structure
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 12/16] target/mips/translate: Extract DisasContext structure |
Date: |
Mon, 14 Dec 2020 19:37:35 +0100 |
Extract DisasContext to a new 'translate.h' header so
different translation files (ISA, ASE, extensions)
can use it.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20201207235539.4070364-2-f4bug@amsat.org>
---
target/mips/translate.h | 50 +++++++++++++++++++++++++++++++++++++++++
target/mips/translate.c | 38 +------------------------------
2 files changed, 51 insertions(+), 37 deletions(-)
create mode 100644 target/mips/translate.h
diff --git a/target/mips/translate.h b/target/mips/translate.h
new file mode 100644
index 00000000000..fcda1a99001
--- /dev/null
+++ b/target/mips/translate.h
@@ -0,0 +1,50 @@
+/*
+ * MIPS translation routines.
+ *
+ * Copyright (c) 2004-2005 Jocelyn Mayer
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+#ifndef TARGET_MIPS_TRANSLATE_H
+#define TARGET_MIPS_TRANSLATE_H
+
+#include "exec/translator.h"
+
+typedef struct DisasContext {
+ DisasContextBase base;
+ target_ulong saved_pc;
+ target_ulong page_start;
+ uint32_t opcode;
+ uint64_t insn_flags;
+ int32_t CP0_Config1;
+ int32_t CP0_Config2;
+ int32_t CP0_Config3;
+ int32_t CP0_Config5;
+ /* Routine used to access memory */
+ int mem_idx;
+ MemOp default_tcg_memop_mask;
+ uint32_t hflags, saved_hflags;
+ target_ulong btarget;
+ bool ulri;
+ int kscrexist;
+ bool rxi;
+ int ie;
+ bool bi;
+ bool bp;
+ uint64_t PAMask;
+ bool mvh;
+ bool eva;
+ bool sc;
+ int CP0_LLAddr_shift;
+ bool ps;
+ bool vp;
+ bool cmgcr;
+ bool mrp;
+ bool nan2008;
+ bool abs2008;
+ bool saar;
+ bool mi;
+ int gi;
+} DisasContext;
+
+#endif
diff --git a/target/mips/translate.c b/target/mips/translate.c
index 49570a95615..0db0fce3789 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -36,6 +36,7 @@
#include "exec/log.h"
#include "qemu/qemu-print.h"
#include "fpu_helper.h"
+#include "translate.h"
#define MIPS_DEBUG_DISAS 0
@@ -2554,43 +2555,6 @@ static TCGv mxu_CR;
tcg_temp_free_i32(helper_tmp); \
} while (0)
-typedef struct DisasContext {
- DisasContextBase base;
- target_ulong saved_pc;
- target_ulong page_start;
- uint32_t opcode;
- uint64_t insn_flags;
- int32_t CP0_Config1;
- int32_t CP0_Config2;
- int32_t CP0_Config3;
- int32_t CP0_Config5;
- /* Routine used to access memory */
- int mem_idx;
- MemOp default_tcg_memop_mask;
- uint32_t hflags, saved_hflags;
- target_ulong btarget;
- bool ulri;
- int kscrexist;
- bool rxi;
- int ie;
- bool bi;
- bool bp;
- uint64_t PAMask;
- bool mvh;
- bool eva;
- bool sc;
- int CP0_LLAddr_shift;
- bool ps;
- bool vp;
- bool cmgcr;
- bool mrp;
- bool nan2008;
- bool abs2008;
- bool saar;
- bool mi;
- int gi;
-} DisasContext;
-
#define DISAS_STOP DISAS_TARGET_0
#define DISAS_EXIT DISAS_TARGET_1
--
2.26.2
- [PATCH v2 06/16] target/mips: Rename helper.c as tlb_helper.c, (continued)
- [PATCH v2 06/16] target/mips: Rename helper.c as tlb_helper.c, Philippe Mathieu-Daudé, 2020/12/14
- [PATCH v2 07/16] target/mips: Fix code style for checkpatch.pl, Philippe Mathieu-Daudé, 2020/12/14
- [PATCH v2 08/16] target/mips: Move mmu_init() functions to tlb_helper.c, Philippe Mathieu-Daudé, 2020/12/14
- [PATCH v2 09/16] target/mips: Rename translate_init.c as cpu-defs.c, Philippe Mathieu-Daudé, 2020/12/14
- [PATCH v2 10/16] target/mips: Replace gen_exception_err(err=0) by gen_exception_end(), Philippe Mathieu-Daudé, 2020/12/14
- [PATCH v2 13/16] target/mips/translate: Add declarations for generic code, Philippe Mathieu-Daudé, 2020/12/14
- [PATCH v2 11/16] target/mips: Replace gen_exception_end(EXCP_RI) by gen_rsvd_instruction, Philippe Mathieu-Daudé, 2020/12/14
- [PATCH v2 12/16] target/mips/translate: Extract DisasContext structure,
Philippe Mathieu-Daudé <=
- [PATCH v2 14/16] target/mips: Declare generic FPU functions in 'translate.h', Philippe Mathieu-Daudé, 2020/12/14
- [PATCH v2 16/16] target/mips: Only build TCG code when CONFIG_TCG is set, Philippe Mathieu-Daudé, 2020/12/14
- [PATCH v2 15/16] target/mips: Extract FPU specific definitions to translate.h, Philippe Mathieu-Daudé, 2020/12/14
- Re: [PATCH v2 00/16] target/mips: Boring code reordering + add "translate.h", no-reply, 2020/12/15