packet_access.hh (4176:2d52a9751dfc) | packet_access.hh (5735:a88e8e7dec75) |
---|---|
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; --- 32 unchanged lines hidden (view full) --- 41// these functions and make the users do their own byte swapping since 42// the memory system does not in fact have an endianness. 43 44/** return the value of what is pointed to in the packet. */ 45template <typename T> 46inline T 47Packet::get() 48{ | 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; --- 32 unchanged lines hidden (view full) --- 41// these functions and make the users do their own byte swapping since 42// the memory system does not in fact have an endianness. 43 44/** return the value of what is pointed to in the packet. */ 45template <typename T> 46inline T 47Packet::get() 48{ |
49 assert(staticData || dynamicData); | 49 assert(flags.any(STATIC_DATA|DYNAMIC_DATA)); |
50 assert(sizeof(T) <= size); 51 return TheISA::gtoh(*(T*)data); 52} 53 54/** set the value in the data pointer to v. */ 55template <typename T> 56inline void 57Packet::set(T v) 58{ | 50 assert(sizeof(T) <= size); 51 return TheISA::gtoh(*(T*)data); 52} 53 54/** set the value in the data pointer to v. */ 55template <typename T> 56inline void 57Packet::set(T v) 58{ |
59 assert(flags.any(STATIC_DATA|DYNAMIC_DATA)); |
|
59 assert(sizeof(T) <= size); 60 *(T*)data = TheISA::htog(v); 61} 62 63#endif //__MEM_PACKET_ACCESS_HH__ | 60 assert(sizeof(T) <= size); 61 *(T*)data = TheISA::htog(v); 62} 63 64#endif //__MEM_PACKET_ACCESS_HH__ |