File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,21 @@ static inline u32_t sys_get_be32(const u8_t src[4])
229
229
return ((u32_t )sys_get_be16 (& src [0 ]) << 16 ) | sys_get_be16 (& src [2 ]);
230
230
}
231
231
232
+ /**
233
+ * @brief Get a 64-bit integer stored in big-endian format.
234
+ *
235
+ * Get a 64-bit integer, stored in big-endian format in a potentially
236
+ * unaligned memory location, and convert it to the host endianness.
237
+ *
238
+ * @param src Location of the big-endian 64-bit integer to get.
239
+ *
240
+ * @return 64-bit integer in host endianness.
241
+ */
242
+ static inline u64_t sys_get_be64 (const u8_t src [8 ])
243
+ {
244
+ return ((u64_t )sys_get_be32 (& src [0 ]) << 32 ) | sys_get_be32 (& src [4 ]);
245
+ }
246
+
232
247
/**
233
248
* @brief Get a 16-bit integer stored in little-endian format.
234
249
*
You can’t perform that action at this time.
0 commit comments