aboutsummaryrefslogtreecommitdiff
path: root/lib/libk/include/endian.h
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2023-10-08 19:50:00 +0300
committeraqua <aqua@iserlohn-fortress.net>2023-11-27 21:02:22 +0200
commitfc13fb2ba5993d06d9d6ae5e80bc337aebbdc119 (patch)
tree9607ab4d5f1d4069d4f761a0b25eada36088bd6b /lib/libk/include/endian.h
parentrules.mk: make include paths absolute (diff)
downloadkernel-fc13fb2ba5993d06d9d6ae5e80bc337aebbdc119.tar.xz
Use meson build system
Diffstat (limited to 'lib/libk/include/endian.h')
-rw-r--r--lib/libk/include/endian.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/libk/include/endian.h b/lib/libk/include/endian.h
new file mode 100644
index 0000000..6aa2669
--- /dev/null
+++ b/lib/libk/include/endian.h
@@ -0,0 +1,15 @@
+/* spdx-license-identifier: ISC */
+
+#pragma once
+
+#include <stdint.h>
+
+/* These functions convert the byte encoding of integer values from host byte order to and from little-endian and
+ * big-endian byte order */
+uint16_t htole16(uint16_t host_16b);
+uint32_t htole32(uint32_t host_32b);
+uint64_t htole64(uint64_t host_64b);
+
+uint16_t htobe16(uint16_t host_16b);
+uint32_t htobe32(uint32_t host_32b);
+uint64_t htobe64(uint64_t host_64b);