packet.hh (12633:675cd1260b40) | packet.hh (12652:bae1a1865204) |
---|---|
1/* | 1/* |
2 * Copyright (c) 2012-2017 ARM Limited | 2 * Copyright (c) 2012-2018 ARM Limited |
3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 1052 unchanged lines hidden (view full) --- 1063 */ 1064 template <typename T> 1065 void set(T v, ByteOrder endian); 1066 1067 /** Set the value in the data pointer to v as guest endian. */ 1068 template <typename T> 1069 void set(T v); 1070 | 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 1052 unchanged lines hidden (view full) --- 1063 */ 1064 template <typename T> 1065 void set(T v, ByteOrder endian); 1066 1067 /** Set the value in the data pointer to v as guest endian. */ 1068 template <typename T> 1069 void set(T v); 1070 |
1071 |
|
1071 /** | 1072 /** |
1073 * Get the data in the packet byte swapped from the specified 1074 * endianness and zero-extended to 64 bits. 1075 */ 1076 uint64_t getUintX(ByteOrder endian) const; 1077 1078 /** 1079 * Set the value in the word w after truncating it to the length 1080 * of the packet and then byteswapping it to the desired 1081 * endianness. 1082 */ 1083 void setUintX(uint64_t w, ByteOrder endian); 1084 1085 /** |
|
1072 * Copy data into the packet from the provided pointer. 1073 */ 1074 void 1075 setData(const uint8_t *p) 1076 { 1077 // we should never be copying data onto itself, which means we 1078 // must idenfity packets with static data, as they carry the 1079 // same pointer from source to destination and back --- 163 unchanged lines hidden --- | 1086 * Copy data into the packet from the provided pointer. 1087 */ 1088 void 1089 setData(const uint8_t *p) 1090 { 1091 // we should never be copying data onto itself, which means we 1092 // must idenfity packets with static data, as they carry the 1093 // same pointer from source to destination and back --- 163 unchanged lines hidden --- |