mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-16 05:07:59 +07:00
98521b3869
Just one more step into splitting util.[ch] to reduce the includes hell. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-navarr9mijkgwgbzu464dwam@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
25 lines
365 B
C
25 lines
365 B
C
#include <byteswap.h>
|
|
#include "memswap.h"
|
|
#include <linux/types.h>
|
|
|
|
void mem_bswap_32(void *src, int byte_size)
|
|
{
|
|
u32 *m = src;
|
|
while (byte_size > 0) {
|
|
*m = bswap_32(*m);
|
|
byte_size -= sizeof(u32);
|
|
++m;
|
|
}
|
|
}
|
|
|
|
void mem_bswap_64(void *src, int byte_size)
|
|
{
|
|
u64 *m = src;
|
|
|
|
while (byte_size > 0) {
|
|
*m = bswap_64(*m);
|
|
byte_size -= sizeof(u64);
|
|
++m;
|
|
}
|
|
}
|