aboutsummaryrefslogtreecommitdiff
path: root/disas.c
diff options
context:
space:
mode:
authorPeter Crosthwaite <crosthwaitepeter@gmail.com>2015-05-24 14:20:41 -0700
committerMarkus Armbruster <armbru@redhat.com>2015-06-22 17:40:01 +0200
commitd49190c4208f2c556c3a01962a81f8a85d522bb1 (patch)
treeec56cf8fdf6f4fa51dc756947dc8455db95c307d /disas.c
parent5bcda5f7349da01aded719b595f32ce2b9d396db (diff)
disas: Remove uses of CPU env
disas does not need to access the CPU env for any reason. Change the APIs to accept CPU pointers instead. Small change pattern needs to be applied to all target translate.c. This brings us closer to making disas.o a common-obj and less architecture specific in general. Cc: Richard Henderson <rth@twiddle.net> Cc: Peter Maydell <peter.maydell@linaro.org> Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: Michael Walle <michael@walle.cc> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Leon Alrae <leon.alrae@imgtec.com> Cc: Jia Liu <proljc@gmail.com> Cc: Alexander Graf <agraf@suse.de> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Acked-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'disas.c')
-rw-r--r--disas.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/disas.c b/disas.c
index 44a019a2e7..576c6a437b 100644
--- a/disas.c
+++ b/disas.c
@@ -9,7 +9,7 @@
typedef struct CPUDebug {
struct disassemble_info info;
- CPUArchState *env;
+ CPUState *cpu;
} CPUDebug;
/* Filled in by elfload.c. Simplistic, but will do for now. */
@@ -39,7 +39,7 @@ target_read_memory (bfd_vma memaddr,
{
CPUDebug *s = container_of(info, CPUDebug, info);
- cpu_memory_rw_debug(ENV_GET_CPU(s->env), memaddr, myaddr, length, 0);
+ cpu_memory_rw_debug(s->cpu, memaddr, myaddr, length, 0);
return 0;
}
@@ -195,7 +195,7 @@ static int print_insn_od_target(bfd_vma pc, disassemble_info *info)
bit 16 indicates little endian.
other targets - unused
*/
-void target_disas(FILE *out, CPUArchState *env, target_ulong code,
+void target_disas(FILE *out, CPUState *cpu, target_ulong code,
target_ulong size, int flags)
{
target_ulong pc;
@@ -205,7 +205,7 @@ void target_disas(FILE *out, CPUArchState *env, target_ulong code,
INIT_DISASSEMBLE_INFO(s.info, out, fprintf);
- s.env = env;
+ s.cpu = cpu;
s.info.read_memory_func = target_read_memory;
s.info.buffer_vma = code;
s.info.buffer_length = size;
@@ -430,7 +430,7 @@ monitor_read_memory (bfd_vma memaddr, bfd_byte *myaddr, int length,
if (monitor_disas_is_physical) {
cpu_physical_memory_read(memaddr, myaddr, length);
} else {
- cpu_memory_rw_debug(ENV_GET_CPU(s->env), memaddr, myaddr, length, 0);
+ cpu_memory_rw_debug(s->cpu, memaddr, myaddr, length, 0);
}
return 0;
}
@@ -447,7 +447,7 @@ monitor_fprintf(FILE *stream, const char *fmt, ...)
/* Disassembler for the monitor.
See target_disas for a description of flags. */
-void monitor_disas(Monitor *mon, CPUArchState *env,
+void monitor_disas(Monitor *mon, CPUState *cpu,
target_ulong pc, int nb_insn, int is_physical, int flags)
{
int count, i;
@@ -456,7 +456,7 @@ void monitor_disas(Monitor *mon, CPUArchState *env,
INIT_DISASSEMBLE_INFO(s.info, (FILE *)mon, monitor_fprintf);
- s.env = env;
+ s.cpu = cpu;
monitor_disas_is_physical = is_physical;
s.info.read_memory_func = monitor_read_memory;
s.info.print_address_func = generic_print_target_address;