1/*
2 * Copyright (c) 2002-2005 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;

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

68 * have to be created.
69 *
70 * Recv accesor functions are being called from the peer interface.
71 * Send accessor functions are being called from the device the port is
72 * associated with, and it will call the peer recv. accessor function.
73 */
74class Port
75{
76 private:
77
76 protected:
77 /** Descriptive name (for DPRINTF output) */
78 mutable std::string portName;
79
80 /** A pointer to the peer port. Ports always come in pairs, that way they
81 can use a standardized interface to communicate between different
82 memory objects. */
83 Port *peer;
84

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

97 * @param _owner Pointer to the MemObject that owns this port.
98 * Will not necessarily be set.
99 */
100 Port(const std::string &_name, MemObject *_owner = NULL);
101
102 /** Return port name (for DPRINTF). */
103 const std::string &name() const { return portName; }
104
106 virtual ~Port() {};
105 virtual ~Port();
106
107 // mey be better to use subclasses & RTTI?
108 /** Holds the ports status. Currently just that a range recomputation needs
109 * to be done. */
110 enum Status {
111 RangeChange
112 };
113

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

125
126 /** Function to return the owner of this port. */
127 MemObject *getOwner() { return owner; }
128
129 /** Inform the peer port to delete itself and notify it's owner about it's
130 * demise. */
131 void removeConn();
132
134 virtual bool isDefaultPort() { return false; }
133 virtual bool isDefaultPort() const { return false; }
134
135 bool isConnected() { return peer && !peer->isDefaultPort(); }
136
137 protected:
138
139 /** These functions are protected because they should only be
140 * called by a peer port, never directly by any outside object. */
141
142 /** Called to recive a timing call from the peer port. */
143 virtual bool recvTiming(PacketPtr pkt) = 0;
144

--- 159 unchanged lines hidden ---