]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blame - tools/perf/util/memswap.c
Merge tag 'tty-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
[mirror_ubuntu-eoan-kernel.git] / tools / perf / util / memswap.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
98521b38
ACM
2#include <byteswap.h>
3#include "memswap.h"
4#include <linux/types.h>
5
6void mem_bswap_32(void *src, int byte_size)
7{
8 u32 *m = src;
9 while (byte_size > 0) {
10 *m = bswap_32(*m);
11 byte_size -= sizeof(u32);
12 ++m;
13 }
14}
15
16void mem_bswap_64(void *src, int byte_size)
17{
18 u64 *m = src;
19
20 while (byte_size > 0) {
21 *m = bswap_64(*m);
22 byte_size -= sizeof(u64);
23 ++m;
24 }
25}