packet.hh (10564:a8c16e2d466a) packet.hh (10565:23593fdaadcd)
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

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

654 lastWordDelay(pkt->lastWordDelay),
655 senderState(pkt->senderState)
656 {
657 if (!clearFlags)
658 flags.set(pkt->flags & COPY_FLAGS);
659
660 flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE));
661 flags.set(pkt->flags & STATIC_DATA);
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

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

654 lastWordDelay(pkt->lastWordDelay),
655 senderState(pkt->senderState)
656 {
657 if (!clearFlags)
658 flags.set(pkt->flags & COPY_FLAGS);
659
660 flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE));
661 flags.set(pkt->flags & STATIC_DATA);
662
663 // if we did not copy the static data pointer, allocate data
664 // dynamically instead
665 if (!data)
666 allocate();
662 }
663
664 /**
665 * Change the packet type based on request type.
666 */
667 void
668 refineCommand()
669 {

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

937 delete [] data;
938 else if (flags.isSet(DYNAMIC_DATA))
939 delete data;
940
941 flags.clear(STATIC_DATA|DYNAMIC_DATA|ARRAY_DATA);
942 data = NULL;
943 }
944
667 }
668
669 /**
670 * Change the packet type based on request type.
671 */
672 void
673 refineCommand()
674 {

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

942 delete [] data;
943 else if (flags.isSet(DYNAMIC_DATA))
944 delete data;
945
946 flags.clear(STATIC_DATA|DYNAMIC_DATA|ARRAY_DATA);
947 data = NULL;
948 }
949
945 /** If there isn't data in the packet, allocate some. */
950 /** Allocate memory for the packet. */
946 void
947 allocate()
948 {
951 void
952 allocate()
953 {
949 if (data) {
950 assert(flags.isSet(STATIC_DATA|DYNAMIC_DATA));
951 return;
952 }
953
954 assert(flags.noneSet(STATIC_DATA|DYNAMIC_DATA));
955 flags.set(DYNAMIC_DATA|ARRAY_DATA);
956 data = new uint8_t[getSize()];
957 }
958
959 /**
960 * Check a functional request against a memory value represented
961 * by a base/size pair and an associated data array. If the

--- 52 unchanged lines hidden ---
954 assert(flags.noneSet(STATIC_DATA|DYNAMIC_DATA));
955 flags.set(DYNAMIC_DATA|ARRAY_DATA);
956 data = new uint8_t[getSize()];
957 }
958
959 /**
960 * Check a functional request against a memory value represented
961 * by a base/size pair and an associated data array. If the

--- 52 unchanged lines hidden ---