Files
linux/tools/include/nolibc/byteswap.h
Thomas Weißschuh ce834c9cb9 tools/nolibc: add byteorder conversions
Add some standard functions to convert between different byte orders.
Conveniently the UAPI headers provide all the necessary functionality.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260405-nolibc-bswap-v1-1-f7699ca9cee0@weissschuh.net
2026-04-07 09:27:25 +02:00

22 lines
449 B
C

/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
/*
* Byte swapping for NOLIBC
* Copyright (C) 2026 Thomas Weißschuh <linux@weissschuh.net>
*/
/* make sure to include all global symbols */
#include "nolibc.h"
#ifndef _NOLIBC_BYTESWAP_H
#define _NOLIBC_BYTESWAP_H
#include "stdint.h"
#include <linux/swab.h>
#define bswap_16(_x) __swab16(_x)
#define bswap_32(_x) __swab32(_x)
#define bswap_64(_x) __swab64(_x)
#endif /* _NOLIBC_BYTESWAP_H */