diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2011-08-07 09:21:48 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2011-08-07 09:21:48 -0700 |
commit | 16882b04838c33e7de5456937b8b069547827b2a (patch) | |
tree | 52d9dadf5185a920a6fd1a1f3457180ba0086bc4 /src/cpu/base_dyn_inst.hh | |
parent | 720c0be620bd3427b5222e437fc7a82cb3a9ad7f (diff) | |
download | gem5-16882b04838c33e7de5456937b8b069547827b2a.tar.xz |
Translation: Use a pointer type as the template argument.
This allows regular pointers and reference counted pointers without having to
use any shim structures or other tricks.
Diffstat (limited to 'src/cpu/base_dyn_inst.hh')
-rw-r--r-- | src/cpu/base_dyn_inst.hh | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/cpu/base_dyn_inst.hh b/src/cpu/base_dyn_inst.hh index 18a178c4a..cb9294481 100644 --- a/src/cpu/base_dyn_inst.hh +++ b/src/cpu/base_dyn_inst.hh @@ -91,6 +91,7 @@ class BaseDynInst : public FastAlloc, public RefCounted // The DynInstPtr type. typedef typename Impl::DynInstPtr DynInstPtr; + typedef RefCountingPtr<BaseDynInst<Impl> > BaseDynInstPtr; // The list of instructions iterator type. typedef typename std::list<DynInstPtr>::iterator ListIt; @@ -950,8 +951,8 @@ BaseDynInst<Impl>::initiateTranslation(RequestPtr req, RequestPtr sreqLow, new WholeTranslationState(req, NULL, res, mode); // One translation if the request isn't split. - DataTranslation<BaseDynInst<Impl> > *trans = - new DataTranslation<BaseDynInst<Impl> >(this, state); + DataTranslation<BaseDynInstPtr> *trans = + new DataTranslation<BaseDynInstPtr>(this, state); cpu->dtb->translateTiming(req, thread->getTC(), trans, mode); if (!translationCompleted) { // Save memory requests. @@ -964,10 +965,10 @@ BaseDynInst<Impl>::initiateTranslation(RequestPtr req, RequestPtr sreqLow, new WholeTranslationState(req, sreqLow, sreqHigh, NULL, res, mode); // Two translations when the request is split. - DataTranslation<BaseDynInst<Impl> > *stransLow = - new DataTranslation<BaseDynInst<Impl> >(this, state, 0); - DataTranslation<BaseDynInst<Impl> > *stransHigh = - new DataTranslation<BaseDynInst<Impl> >(this, state, 1); + DataTranslation<BaseDynInstPtr> *stransLow = + new DataTranslation<BaseDynInstPtr>(this, state, 0); + DataTranslation<BaseDynInstPtr> *stransHigh = + new DataTranslation<BaseDynInstPtr>(this, state, 1); cpu->dtb->translateTiming(sreqLow, thread->getTC(), stransLow, mode); cpu->dtb->translateTiming(sreqHigh, thread->getTC(), stransHigh, mode); |