1/* 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 --- 282 unchanged lines hidden (view full) --- 291 292 /// True if the request targets the secure memory space. 293 bool _isSecure; 294 295 /// The size of the request or transfer. 296 unsigned size; 297 298 /** |
299 * The original value of the command field. Only valid when the 300 * current command field is an error condition; in that case, the 301 * previous contents of the command field are copied here. This 302 * field is *not* set on non-error responses. 303 */ 304 MemCmd origCmd; 305 306 /** --- 211 unchanged lines hidden (view full) --- 518 { 519 assert(isResponse()); 520 cmd = MemCmd::BadAddressError; 521 } 522 523 bool hadBadAddress() const { return cmd == MemCmd::BadAddressError; } 524 void copyError(Packet *pkt) { assert(pkt->isError()); cmd = pkt->cmd; } 525 |
526 Addr getAddr() const { assert(flags.isSet(VALID_ADDR)); return addr; } 527 /** 528 * Update the address of this packet mid-transaction. This is used 529 * by the address mapper to change an already set address to a new 530 * one based on the system configuration. It is intended to remap 531 * an existing address, so it asserts that the current address is 532 * valid. 533 */ --- 34 unchanged lines hidden (view full) --- 568 569 /** 570 * Constructor. Note that a Request object must be constructed 571 * first, but the Requests's physical address and size fields need 572 * not be valid. The command must be supplied. 573 */ 574 Packet(const RequestPtr _req, MemCmd _cmd) 575 : cmd(_cmd), req(_req), data(nullptr), addr(0), _isSecure(false), |
576 size(0), bytesValidStart(0), bytesValidEnd(0), |
577 firstWordDelay(0), lastWordDelay(0), 578 senderState(NULL) 579 { 580 if (req->hasPaddr()) { 581 addr = req->getPaddr(); 582 flags.set(VALID_ADDR); 583 _isSecure = req->isSecure(); 584 } --- 5 unchanged lines hidden (view full) --- 590 591 /** 592 * Alternate constructor if you are trying to create a packet with 593 * a request that is for a whole block, not the address from the 594 * req. this allows for overriding the size/addr of the req. 595 */ 596 Packet(const RequestPtr _req, MemCmd _cmd, int _blkSize) 597 : cmd(_cmd), req(_req), data(nullptr), addr(0), _isSecure(false), |
598 bytesValidStart(0), bytesValidEnd(0), 599 firstWordDelay(0), lastWordDelay(0), 600 senderState(NULL) 601 { 602 if (req->hasPaddr()) { 603 addr = req->getPaddr() & ~(_blkSize - 1); 604 flags.set(VALID_ADDR); 605 _isSecure = req->isSecure(); --- 8 unchanged lines hidden (view full) --- 614 * that, as we can't guarantee that the new packet's lifetime is 615 * less than that of the original packet. In this case the new 616 * packet should allocate its own data. 617 */ 618 Packet(PacketPtr pkt, bool clear_flags, bool alloc_data) 619 : cmd(pkt->cmd), req(pkt->req), 620 data(nullptr), 621 addr(pkt->addr), _isSecure(pkt->_isSecure), size(pkt->size), |
622 bytesValidStart(pkt->bytesValidStart), 623 bytesValidEnd(pkt->bytesValidEnd), 624 firstWordDelay(pkt->firstWordDelay), 625 lastWordDelay(pkt->lastWordDelay), 626 senderState(pkt->senderState) 627 { 628 if (!clear_flags) 629 flags.set(pkt->flags & COPY_FLAGS); --- 69 unchanged lines hidden (view full) --- 699 // never get the chance. 700 if (req && isRequest() && !needsResponse()) 701 delete req; 702 deleteData(); 703 } 704 705 /** 706 * Take a request packet and modify it in place to be suitable for |
707 * returning as a response to that request. |
708 */ 709 void 710 makeResponse() 711 { 712 assert(needsResponse()); 713 assert(isRequest()); 714 origCmd = cmd; 715 cmd = cmd.responseCommand(); 716 717 // responses are never express, even if the snoop that 718 // triggered them was 719 flags.clear(EXPRESS_SNOOP); |
720 } 721 722 void 723 makeAtomicResponse() 724 { 725 makeResponse(); 726 } 727 --- 250 unchanged lines hidden --- |