packet.hh (2665:a124942bacb8) | packet.hh (2685:a0821abe7132) |
---|---|
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; --- 165 unchanged lines hidden (view full) --- 174 bool isResponse() { return (cmd & IsResponse) != 0; } 175 bool needsResponse() { return (cmd & NeedsResponse) != 0; } 176 177 /** Possible results of a packet's request. */ 178 enum Result 179 { 180 Success, 181 BadAddress, | 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; --- 165 unchanged lines hidden (view full) --- 174 bool isResponse() { return (cmd & IsResponse) != 0; } 175 bool needsResponse() { return (cmd & NeedsResponse) != 0; } 176 177 /** Possible results of a packet's request. */ 178 enum Result 179 { 180 Success, 181 BadAddress, |
182 Nacked, |
|
182 Unknown 183 }; 184 185 /** The result of this packet's request. */ 186 Result result; 187 188 /** Accessor function that returns the source index of the packet. */ 189 short getSrc() const { assert(srcValid); return src; } --- 54 unchanged lines hidden (view full) --- 244 int icmd = (int)cmd; 245 icmd &= ~(IsRequest | NeedsResponse); 246 icmd |= IsResponse; 247 cmd = (Command)icmd; 248 dest = src; 249 srcValid = false; 250 } 251 | 183 Unknown 184 }; 185 186 /** The result of this packet's request. */ 187 Result result; 188 189 /** Accessor function that returns the source index of the packet. */ 190 short getSrc() const { assert(srcValid); return src; } --- 54 unchanged lines hidden (view full) --- 245 int icmd = (int)cmd; 246 icmd &= ~(IsRequest | NeedsResponse); 247 icmd |= IsResponse; 248 cmd = (Command)icmd; 249 dest = src; 250 srcValid = false; 251 } 252 |
253 /** Take a request packet that has been returned as NACKED and modify it so 254 * that it can be sent out again. Only packets that need a response can be 255 * NACKED, so verify that that is true. */ 256 void reinitNacked() { 257 assert(needsResponse() && result == Nacked); 258 dest = Broadcast; 259 result = Unknown; 260 } 261 262 |
|
252 /** Set the data pointer to the following value that should not be freed. */ 253 template <typename T> 254 void dataStatic(T *p); 255 256 /** Set the data pointer to a value that should have delete [] called on it. 257 */ 258 template <typename T> 259 void dataDynamicArray(T *p); --- 30 unchanged lines hidden --- | 263 /** Set the data pointer to the following value that should not be freed. */ 264 template <typename T> 265 void dataStatic(T *p); 266 267 /** Set the data pointer to a value that should have delete [] called on it. 268 */ 269 template <typename T> 270 void dataDynamicArray(T *p); --- 30 unchanged lines hidden --- |