Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/52054 )

Change subject: cpu: Reimplement pcState(Addr) without using the PCState constructor.
......................................................................

cpu: Reimplement pcState(Addr) without using the PCState constructor.

Use the BaseISA::newPCState(Addr) method instead, so that we don't need
to know how to build PCState objects for the given ISA.

Because the pcState() accessor still takes a const reference to a
PCState, we still need to use the TheISA::PCState type to call it. In
the future this will also take a PCStatePtr, so that use will go away.

Change-Id: I8f2f66b58c342e8c455d438047857c0119566b2b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52054
Reviewed-by: Daniel Carvalho <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/cpu/thread_context.hh
1 file changed, 25 insertions(+), 1 deletion(-)

Approvals:
  Daniel Carvalho: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/cpu/thread_context.hh b/src/cpu/thread_context.hh
index 1f04e3c..2fd22ff 100644
--- a/src/cpu/thread_context.hh
+++ b/src/cpu/thread_context.hh
@@ -226,7 +226,11 @@
     virtual TheISA::PCState pcState() const = 0;

     virtual void pcState(const TheISA::PCState &val) = 0;
-    void pcState(Addr addr) { pcState(TheISA::PCState(addr)); }
+    void
+    pcState(Addr addr)
+    {
+        pcState(getIsaPtr()->newPCState(addr)->as<TheISA::PCState>());
+    }

     void
     setNPC(Addr val)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/52054
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I8f2f66b58c342e8c455d438047857c0119566b2b
Gerrit-Change-Number: 52054
Gerrit-PatchSet: 14
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Earl Ou <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to