1 #include <byteswap.h> 2 #include "memswap.h" 3 #include <linux/types.h> 4 5 void mem_bswap_32(void *src, int byte_size) 6 { 7 u32 *m = src; 8 while (byte_size > 0) { 9 *m = bswap_32(*m); 10 byte_size -= sizeof(u32); 11 ++m; 12 } 13 } 14 15 void mem_bswap_64(void *src, int byte_size) 16 { 17 u64 *m = src; 18 19 while (byte_size > 0) { 20 *m = bswap_64(*m); 21 byte_size -= sizeof(u64); 22 ++m; 23 } 24 } 25