Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107164082
D40174.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
986 B
Referenced Files
None
Subscribers
None
D40174.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/asm/unaligned.h b/sys/compat/linuxkpi/common/include/asm/unaligned.h
--- 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.
@@ -50,6 +50,15 @@
return (le32_to_cpup((const __le32 *)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)
{
@@ -82,4 +91,11 @@
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 */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 12, 2:51 AM (20 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15760299
Default Alt Text
D40174.diff (986 B)
Attached To
Mode
D40174: LinuxKPI: add put_unaligned_le16() and get_unaligned_be64()
Attached
Detach File
Event Timeline
Log In to Comment