misc: Merge branch v20.1.0.3 hotfix into develop
[gem5.git] / src / dev / arm / gic_v3_its.cc
index ab0d8c2d0fa1caeadd6455482733687c3a6e3cc5..ee30eeee7ccbd407158888b192edd130d480c8bd 100644 (file)
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Authors: Giacomo Travaglini
  */
 
 #include "dev/arm/gic_v3_its.hh"
 
+#include <cassert>
+#include <functional>
+
+#include "base/logging.hh"
+#include "base/trace.hh"
 #include "debug/AddrRanges.hh"
 #include "debug/Drain.hh"
 #include "debug/GIC.hh"
@@ -50,7 +53,7 @@
 
 #define COMMAND(x, method) { x, DispatchEntry(#x, method) }
 
-const AddrRange Gicv3Its::GITS_BASER(0x0100, 0x0138);
+const AddrRange Gicv3Its::GITS_BASER(0x0100, 0x0140);
 
 const uint32_t Gicv3Its::CTLR_QUIESCENT = 0x80000000;
 
@@ -91,7 +94,7 @@ ItsProcess::doRead(Yield &yield, Addr addr, void *ptr, size_t size)
     a.type = ItsActionType::SEND_REQ;
 
     RequestPtr req = std::make_shared<Request>(
-        addr, size, 0, its.masterId);
+        addr, size, 0, its.requestorId);
 
     req->taskId(ContextSwitchTaskId::DMA);
 
@@ -115,7 +118,7 @@ ItsProcess::doWrite(Yield &yield, Addr addr, void *ptr, size_t size)
     a.type = ItsActionType::SEND_REQ;
 
     RequestPtr req = std::make_shared<Request>(
-        addr, size, 0, its.masterId);
+        addr, size, 0, its.requestorId);
 
     req->taskId(ContextSwitchTaskId::DMA);
 
@@ -773,15 +776,15 @@ ItsCommand::vsync(Yield &yield, CommandEntry &command)
     panic("ITS %s command unimplemented", __func__);
 }
 
-Gicv3Its::Gicv3Its(const Gicv3ItsParams *params)
- : BasicPioDevice(params, params->pio_size),
+Gicv3Its::Gicv3Its(const Gicv3ItsParams &params)
+ : BasicPioDevice(params, params.pio_size),
    dmaPort(name() + ".dma", *this),
    gitsControl(CTLR_QUIESCENT),
-   gitsTyper(params->gits_typer),
+   gitsTyper(params.gits_typer),
    gitsCbaser(0), gitsCreadr(0),
    gitsCwriter(0), gitsIidr(0),
    tableBases(NUM_BASER_REGS, 0),
-   masterId(params->system->getMasterId(this)),
+   requestorId(params.system->getRequestorId(this)),
    gic(nullptr),
    commandEvent([this] { checkCommandQueue(); }, name()),
    pendingCommands(false),
@@ -884,7 +887,7 @@ Gicv3Its::read(PacketPtr pkt)
         }
     }
 
-    pkt->setUintX(value, LittleEndianByteOrder);
+    pkt->setUintX(value, ByteOrder::little);
     pkt->makeAtomicResponse();
     return pioDelay;
 }
@@ -1288,9 +1291,3 @@ Gicv3Its::moveAllPendingState(
 
     rd2->updateDistributor();
 }
-
-Gicv3Its *
-Gicv3ItsParams::create()
-{
-    return new Gicv3Its(this);
-}