packet.hh (10192:5c2c4195b839) packet.hh (10342:711eb0e64249)
1/*
1/*
2 * Copyright (c) 2012-2013 ARM Limited
2 * Copyright (c) 2012-2014 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

--- 650 unchanged lines hidden (view full) ---

661 busLastWordDelay(pkt->busLastWordDelay),
662 senderState(pkt->senderState)
663 {
664 if (!clearFlags)
665 flags.set(pkt->flags & COPY_FLAGS);
666
667 flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE));
668 flags.set(pkt->flags & STATIC_DATA);
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

--- 650 unchanged lines hidden (view full) ---

661 busLastWordDelay(pkt->busLastWordDelay),
662 senderState(pkt->senderState)
663 {
664 if (!clearFlags)
665 flags.set(pkt->flags & COPY_FLAGS);
666
667 flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE));
668 flags.set(pkt->flags & STATIC_DATA);
669 }
669
670
671 /**
672 * Change the packet type based on request type.
673 */
674 void
675 refineCommand()
676 {
677 if (cmd == MemCmd::ReadReq) {
678 if (req->isLLSC()) {
679 cmd = MemCmd::LoadLockedReq;
680 }
681 } else if (cmd == MemCmd::WriteReq) {
682 if (req->isLLSC()) {
683 cmd = MemCmd::StoreCondReq;
684 } else if (req->isSwap()) {
685 cmd = MemCmd::SwapReq;
686 }
687 }
670 }
671
672 /**
688 }
689
690 /**
691 * Constructor-like methods that return Packets based on Request objects.
692 * Will call refineCommand() to fine-tune the Packet type if it's not a
693 * vanilla read or write.
694 */
695 static PacketPtr
696 createRead(Request *req)
697 {
698 PacketPtr pkt = new Packet(req, MemCmd::ReadReq);
699 pkt->refineCommand();
700 return pkt;
701 }
702
703 static PacketPtr
704 createWrite(Request *req)
705 {
706 PacketPtr pkt = new Packet(req, MemCmd::WriteReq);
707 pkt->refineCommand();
708 return pkt;
709 }
710
711 /**
673 * clean up packet variables
674 */
675 ~Packet()
676 {
677 // If this is a request packet for which there's no response,
678 // delete the request object here, since the requester will
679 // never get the chance.
680 if (req && isRequest() && !needsResponse())

--- 274 unchanged lines hidden ---
712 * clean up packet variables
713 */
714 ~Packet()
715 {
716 // If this is a request packet for which there's no response,
717 // delete the request object here, since the requester will
718 // never get the chance.
719 if (req && isRequest() && !needsResponse())

--- 274 unchanged lines hidden ---