From 096598c05a6c352bfd4b93adf06143a43a8f4e11 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 1 May 2019 21:43:09 -0700 Subject: arch, base, sim: Replace Copy(String)?(In|Out) with equivalent code. This expands those functions into code which extracts the virt proxy and then uses the appropriate method on it. This has two benefits. First, the Copy* functions where mostly redundant wrappers around the methods the proxy port already had. Second, using them forced a particular port which might not actually be what the user wanted. Change-Id: I62084631dd080061e3c74997125164f40da2d77c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18575 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/arch/x86/stacktrace.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/arch/x86') diff --git a/src/arch/x86/stacktrace.cc b/src/arch/x86/stacktrace.cc index 2d9eaea73..b5fbb5ce5 100644 --- a/src/arch/x86/stacktrace.cc +++ b/src/arch/x86/stacktrace.cc @@ -104,7 +104,7 @@ ProcessInfo::name(Addr ksp) const return "console"; char comm[256]; - CopyStringOut(tc, comm, task + name_off, sizeof(comm)); + tc->getVirtProxy().readString(comm, task + name_off, sizeof(comm)); if (!comm[0]) return "startup"; @@ -164,8 +164,7 @@ StackTrace::decodePrologue(Addr sp, Addr callpc, Addr func, ra = 0; for (Addr pc = func; pc < callpc; pc += sizeof(MachInst)) { - MachInst inst; - CopyOut(tc, (uint8_t *)&inst, pc, sizeof(MachInst)); + MachInst inst = tc->getVirtProxy().read(pc); int reg, disp; if (decodeStack(inst, disp)) { @@ -176,7 +175,7 @@ StackTrace::decodePrologue(Addr sp, Addr callpc, Addr func, size += disp; } else if (decodeSave(inst, reg, disp)) { if (!ra && reg == ReturnAddressReg) { - CopyOut(tc, (uint8_t *)&ra, sp + disp, sizeof(Addr)); + ra = tc->getVirtProxy().read(sp + disp); if (!ra) { // panic("no return address value pc=%#x\n", pc); return false; -- cgit v1.2.3