Page MenuHomeFreeBSD

D54663.id169500.diff
No OneTemporary

D54663.id169500.diff

diff --git a/sys/compat/freebsd32/freebsd32.h b/sys/compat/freebsd32/freebsd32.h
--- a/sys/compat/freebsd32/freebsd32.h
+++ b/sys/compat/freebsd32/freebsd32.h
@@ -37,6 +37,7 @@
/*
* i386 is the only arch with a 32-bit time_t
+ * Also it is the only arch with (u)int64_t having 4-bytes alignment.
*/
#ifdef __amd64__
typedef int32_t time32_t;
diff --git a/sys/sys/abi_compat.h b/sys/sys/abi_compat.h
--- a/sys/sys/abi_compat.h
+++ b/sys/sys/abi_compat.h
@@ -29,6 +29,8 @@
#ifndef _COMPAT_H_
#define _COMPAT_H_
+#include <sys/endian.h>
+
/*
* Helper macros for translating objects between different ABIs.
*/
@@ -67,9 +69,18 @@
TS_CP((src), (dst), it_value); \
} while (0)
+#if _BYTE_ORDER == _LITTLE_ENDIAN
#define BT_CP(src, dst, fld) do { \
CP((src).fld, (dst).fld, sec); \
- *(uint64_t *)&(dst).fld.frac[0] = (src).fld.frac; \
+ (dst).fld.frac[0] = (src).fld.frac; \
+ (dst).fld.frac[1] = (src).fld.frac >> 32; \
} while (0)
+#elif _BYTE_ORDER == _BIG_ENDIAN
+#define BT_CP(src, dst, fld) do { \
+ CP((src).fld, (dst).fld, sec); \
+ (dst).fld.frac[0] = (src).fld.frac >> 32; \
+ (dst).fld.frac[1] = (src).fld.frac; \
+} while (0)
+#endif
#endif /* !_COMPAT_H_ */

File Metadata

Mime Type
text/plain
Expires
Sat, Feb 21, 1:06 PM (1 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28923066
Default Alt Text
D54663.id169500.diff (1 KB)

Event Timeline