Deleted Added
sdiff udiff text old ( 9951:2f5eec8c1010 ) new ( 10028:fb8c44de891a )
full compact
1/*
2 * Copyright (c) 2012-2013 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

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

281 * be allocated.
282 */
283 PacketDataPtr data;
284
285 /// The address of the request. This address could be virtual or
286 /// physical, depending on the system configuration.
287 Addr addr;
288
289 /// The size of the request or transfer.
290 unsigned size;
291
292 /**
293 * Source port identifier set on a request packet to enable
294 * appropriate routing of the responses. The source port
295 * identifier is set by any multiplexing component, e.g. a bus, as
296 * the timing responses need this information to be routed back to

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

557 * an existing address, so it asserts that the current address is
558 * valid.
559 */
560 void setAddr(Addr _addr) { assert(flags.isSet(VALID_ADDR)); addr = _addr; }
561
562 unsigned getSize() const { assert(flags.isSet(VALID_SIZE)); return size; }
563 Addr getOffset(int blkSize) const { return getAddr() & (Addr)(blkSize - 1); }
564
565 /**
566 * It has been determined that the SC packet should successfully update
567 * memory. Therefore, convert this SC packet to a normal write.
568 */
569 void
570 convertScToWrite()
571 {
572 assert(isLLSC());

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

596 src(InvalidPortID), dest(InvalidPortID),
597 bytesValidStart(0), bytesValidEnd(0),
598 busFirstWordDelay(0), busLastWordDelay(0),
599 senderState(NULL)
600 {
601 if (req->hasPaddr()) {
602 addr = req->getPaddr();
603 flags.set(VALID_ADDR);
604 }
605 if (req->hasSize()) {
606 size = req->getSize();
607 flags.set(VALID_SIZE);
608 }
609 }
610
611 /**

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

618 src(InvalidPortID), dest(InvalidPortID),
619 bytesValidStart(0), bytesValidEnd(0),
620 busFirstWordDelay(0), busLastWordDelay(0),
621 senderState(NULL)
622 {
623 if (req->hasPaddr()) {
624 addr = req->getPaddr() & ~(_blkSize - 1);
625 flags.set(VALID_ADDR);
626 }
627 size = _blkSize;
628 flags.set(VALID_SIZE);
629 }
630
631 /**
632 * Alternate constructor for copying a packet. Copy all fields
633 * *except* if the original packet's data was dynamic, don't copy
634 * that, as we can't guarantee that the new packet's lifetime is
635 * less than that of the original packet. In this case the new
636 * packet should allocate its own data.
637 */
638 Packet(Packet *pkt, bool clearFlags = false)
639 : cmd(pkt->cmd), req(pkt->req),
640 data(pkt->flags.isSet(STATIC_DATA) ? pkt->data : NULL),
641 addr(pkt->addr), size(pkt->size), src(pkt->src), dest(pkt->dest),
642 bytesValidStart(pkt->bytesValidStart),
643 bytesValidEnd(pkt->bytesValidEnd),
644 busFirstWordDelay(pkt->busFirstWordDelay),
645 busLastWordDelay(pkt->busLastWordDelay),
646 senderState(pkt->senderState)
647 {
648 if (!clearFlags)
649 flags.set(pkt->flags & COPY_FLAGS);

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

674 * transactions.
675 */
676 void
677 reinitFromRequest()
678 {
679 assert(req->hasPaddr());
680 flags = 0;
681 addr = req->getPaddr();
682 size = req->getSize();
683
684 src = InvalidPortID;
685 dest = InvalidPortID;
686 bytesValidStart = 0;
687 bytesValidEnd = 0;
688 busFirstWordDelay = 0;
689 busLastWordDelay = 0;

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

882
883 /**
884 * Check a functional request against a memory value represented
885 * by a base/size pair and an associated data array. If the
886 * functional request is a read, it may be satisfied by the memory
887 * value. If the functional request is a write, it may update the
888 * memory value.
889 */
890 bool checkFunctional(Printable *obj, Addr base, int size, uint8_t *data);
891
892 /**
893 * Check a functional request against a memory value stored in
894 * another packet (i.e. an in-transit request or response).
895 */
896 bool
897 checkFunctional(PacketPtr other)
898 {
899 uint8_t *data = other->hasData() ? other->getPtr<uint8_t>() : NULL;
900 return checkFunctional(other, other->getAddr(), other->getSize(),
901 data);
902 }
903
904 /**
905 * Push label for PrintReq (safe to call unconditionally).
906 */
907 void
908 pushLabel(const std::string &lbl)
909 {

--- 27 unchanged lines hidden ---