aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/include/asm
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2023-05-20 00:52:27 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2023-05-20 11:10:31 +0000
commitae1e336e05171b80123bf6db7457f19c174accc4 (patch)
tree03b613946b81483cd25dbdb4f4807990aae30f74 /sys/compat/linuxkpi/common/include/asm
parent7eee0eaf1602765bdf20c8e56884069085812c27 (diff)
Diffstat (limited to 'sys/compat/linuxkpi/common/include/asm')
-rw-r--r--sys/compat/linuxkpi/common/include/asm/unaligned.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/compat/linuxkpi/common/include/asm/unaligned.h b/sys/compat/linuxkpi/common/include/asm/unaligned.h
index 8a001ec38c3d..c13089b2c5f4 100644
--- a/sys/compat/linuxkpi/common/include/asm/unaligned.h
+++ b/sys/compat/linuxkpi/common/include/asm/unaligned.h
@@ -1,7 +1,7 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
- * Copyright (c) 2020 The FreeBSD Foundation
+ * Copyright (c) 2020,2023 The FreeBSD Foundation
*
* This software was developed by Björn Zeeb under sponsorship from
* the FreeBSD Foundation.
@@ -51,6 +51,15 @@ get_unaligned_le32(const void *p)
}
static __inline void
+put_unaligned_le16(__le16 v, void *p)
+{
+ __le16 x;
+
+ x = cpu_to_le16(v);
+ memcpy(p, &x, sizeof(x));
+}
+
+static __inline void
put_unaligned_le32(__le32 v, void *p)
{
__le32 x;
@@ -82,4 +91,11 @@ get_unaligned_be32(const void *p)
return (be32_to_cpup((const __be32 *)p));
}
+static __inline uint64_t
+get_unaligned_be64(const void *p)
+{
+
+ return (be64_to_cpup((const __be64 *)p));
+}
+
#endif /* _LINUXKPI_ASM_UNALIGNED_H */