Deleted Added
sdiff udiff text old ( 5314:e902f12a3af1 ) new ( 5315:30997e988446 )
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;

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

294 * needed to process it. A specific subclass would be derived
295 * from this to carry state specific to a particular sending
296 * device. */
297 class SenderState : public FastAlloc {
298 public:
299 virtual ~SenderState() {}
300 };
301
302 class PrintReqState : public SenderState {
303 class LabelStackEntry {
304 public:
305 const std::string label;
306 std::string *prefix;
307 bool labelPrinted;
308 LabelStackEntry(const std::string &_label,
309 std::string *_prefix);
310 };

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

316
317 public:
318 std::ostream &os;
319 const int verbosity;
320
321 PrintReqState(std::ostream &os, int verbosity = 0);
322 ~PrintReqState();
323
324 const std::string &curPrefix() { return *curPrefixPtr; }
325 void pushLabel(const std::string &lbl,
326 const std::string &prefix = " ");
327 void popLabel();
328 void printLabels();
329 void printObj(Printable *obj);
330 };
331
332 /** This packet's sender state. Devices should use dynamic_cast<>
333 * to cast to the state appropriate to the sender. */
334 SenderState *senderState;
335
336 /** Return the string name of the cmd field (for debugging and

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

608 * functional request is a read, it may be satisfied by the memory
609 * value. If the functional request is a write, it may update the
610 * memory value.
611 */
612 bool checkFunctional(Printable *obj, Addr base, int size, uint8_t *data);
613
614 /**
615 * Check a functional request against a memory value stored in
616 * another packet (i.e. an in-transit request or response). If
617 * possible, the request will be satisfied and transformed
618 * in-place into a response (at which point no further checking
619 * need be done).
620 *
621 * @return True if the memory location addressed by the request
622 * overlaps with the location addressed by otherPkt.
623 */
624 bool checkFunctional(PacketPtr otherPkt) {
625 return checkFunctional(otherPkt,
626 otherPkt->getAddr(), otherPkt->getSize(),
627 otherPkt->hasData() ?
628 otherPkt->getPtr<uint8_t>() : NULL);
629 }
630
631 void pushLabel(const std::string &lbl) {
632 if (isPrint()) {
633 dynamic_cast<PrintReqState*>(senderState)->pushLabel(lbl);
634 }
635 }
636
637 void popLabel() {
638 if (isPrint()) {
639 dynamic_cast<PrintReqState*>(senderState)->popLabel();
640 }
641 }
642
643 void print(std::ostream &o, int verbosity = 0,
644 const std::string &prefix = "") const;
645};
646
647#endif //__MEM_PACKET_HH