1/* 2 * Copyright (c) 2012-2015 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 --- 241 unchanged lines hidden (view full) --- 250 /// Special timing-mode atomic snoop for multi-level coherence. 251 EXPRESS_SNOOP = 0x00000002, 252 /// Does supplier have exclusive copy? 253 /// Useful for multi-level coherence. 254 SUPPLY_EXCLUSIVE = 0x00000004, 255 // Snoop response flags 256 MEM_INHIBIT = 0x00000008, 257 |
258 /// Is the data pointer set to a value that shouldn't be freed 259 /// when the packet is destroyed? 260 STATIC_DATA = 0x00001000, 261 /// The data pointer points to a value that should be freed when 262 /// the packet is destroyed. The pointer is assumed to be pointing 263 /// to an array, and delete [] is consequently called 264 DYNAMIC_DATA = 0x00002000, 265 --- 248 unchanged lines hidden (view full) --- 514 setBadAddress() 515 { 516 assert(isResponse()); 517 cmd = MemCmd::BadAddressError; 518 } 519 520 void copyError(Packet *pkt) { assert(pkt->isError()); cmd = pkt->cmd; } 521 |
522 Addr getAddr() const { return addr; } |
523 /** 524 * Update the address of this packet mid-transaction. This is used 525 * by the address mapper to change an already set address to a new 526 * one based on the system configuration. It is intended to remap 527 * an existing address, so it asserts that the current address is 528 * valid. 529 */ |
530 void setAddr(Addr _addr) { addr = _addr; } |
531 |
532 unsigned getSize() const { return size; } |
533 534 Addr getOffset(unsigned int blk_size) const 535 { 536 return getAddr() & Addr(blk_size - 1); 537 } 538 539 Addr getBlockAddr(unsigned int blk_size) const 540 { 541 return getAddr() & ~(Addr(blk_size - 1)); 542 } 543 |
544 bool isSecure() const { return _isSecure; } |
545 546 /** 547 * It has been determined that the SC packet should successfully update 548 * memory. Therefore, convert this SC packet to a normal write. 549 */ 550 void 551 convertScToWrite() 552 { --- 11 unchanged lines hidden (view full) --- 564 { 565 assert(isLLSC()); 566 assert(isRead()); 567 cmd = MemCmd::ReadReq; 568 } 569 570 /** 571 * Constructor. Note that a Request object must be constructed |
572 * first, and have a valid physical address and size. The command 573 * must be supplied. |
574 */ 575 Packet(const RequestPtr _req, MemCmd _cmd) |
576 : cmd(_cmd), req(_req), data(nullptr), addr(req->getPaddr()), 577 _isSecure(req->isSecure()), size(req->getSize()), 578 headerDelay(0), payloadDelay(0), |
579 senderState(NULL) |
580 { } |
581 582 /** |
583 * Alternate constructor when creating a packet that is for a 584 * whole block. This allows for overriding the size and addr of 585 * the request. |
586 */ |
587 Packet(const RequestPtr _req, MemCmd _cmd, unsigned _blkSize) 588 : cmd(_cmd), req(_req), data(nullptr), 589 addr(_req->getPaddr() & ~Addr(_blkSize - 1)), 590 _isSecure(_req->isSecure()), size(_blkSize), |
591 headerDelay(0), payloadDelay(0), 592 senderState(NULL) |
593 { } |
594 595 /** 596 * Alternate constructor for copying a packet. Copy all fields 597 * *except* if the original packet's data was dynamic, don't copy 598 * that, as we can't guarantee that the new packet's lifetime is 599 * less than that of the original packet. In this case the new 600 * packet should allocate its own data. 601 */ --- 4 unchanged lines hidden (view full) --- 606 bytesValid(pkt->bytesValid), 607 headerDelay(pkt->headerDelay), 608 payloadDelay(pkt->payloadDelay), 609 senderState(pkt->senderState) 610 { 611 if (!clear_flags) 612 flags.set(pkt->flags & COPY_FLAGS); 613 |
614 // should we allocate space for data, or not, the express 615 // snoops do not need to carry any data as they only serve to 616 // co-ordinate state changes 617 if (alloc_data) { 618 // even if asked to allocate data, if the original packet 619 // holds static data, then the sender will not be doing 620 // any memcpy on receiving the response, thus we simply 621 // carry the pointer forward --- 105 unchanged lines hidden (view full) --- 727 if (isWrite()) { 728 cmd = MemCmd::FunctionalWriteError; 729 } else { 730 cmd = MemCmd::FunctionalReadError; 731 } 732 } 733 } 734 |
735 public: 736 /** 737 * @{ 738 * @name Data accessor mehtods 739 */ 740 741 /** 742 * Set the data pointer to the following value that should not be --- 288 unchanged lines hidden --- |