Deleted Added
sdiff udiff text old ( 6102:7fbf97dc6540 ) new ( 6104:ca0915f8d86d )
full compact
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

457 /**
458 * Constructor. Note that a Request object must be constructed
459 * first, but the Requests's physical address and size fields need
460 * not be valid. The command and destination addresses must be
461 * supplied.
462 */
463 Packet(Request *_req, MemCmd _cmd, NodeID _dest)
464 : flags(VALID_DST), cmd(_cmd), req(_req), data(NULL),
465 addr(_req->paddr), size(_req->size), dest(_dest), time(curTick),
466 senderState(NULL)
467 {
468 if (req->flags.isSet(Request::VALID_PADDR))
469 flags.set(VALID_ADDR|VALID_SIZE);
470 }
471
472 /**
473 * Alternate constructor if you are trying to create a packet with
474 * a request that is for a whole block, not the address from the
475 * req. this allows for overriding the size/addr of the req.
476 */
477 Packet(Request *_req, MemCmd _cmd, NodeID _dest, int _blkSize)
478 : flags(VALID_DST), cmd(_cmd), req(_req), data(NULL),
479 addr(_req->paddr & ~(_blkSize - 1)), size(_blkSize), dest(_dest),
480 time(curTick), senderState(NULL)
481 {
482 if (req->flags.isSet(Request::VALID_PADDR))
483 flags.set(VALID_ADDR|VALID_SIZE);
484 }
485
486 /**
487 * Alternate constructor for copying a packet. Copy all fields
488 * *except* if the original packet's data was dynamic, don't copy
489 * that, as we can't guarantee that the new packet's lifetime is
490 * less than that of the original packet. In this case the new
491 * packet should allocate its own data.

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

521 * Request object, and reset other fields that may have been
522 * modified by a previous transaction. Typically called when a
523 * statically allocated Request/Packet pair is reused for multiple
524 * transactions.
525 */
526 void
527 reinitFromRequest()
528 {
529 assert(req->flags.isSet(Request::VALID_PADDR));
530 flags = 0;
531 addr = req->paddr;
532 size = req->size;
533 time = req->time;
534
535 flags.set(VALID_ADDR|VALID_SIZE);
536 deleteData();
537 }
538
539 /**
540 * Take a request packet and modify it in place to be suitable for
541 * returning as a response to that request. The source and

--- 220 unchanged lines hidden ---