summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2018-02-01 19:31:39 +0000
committermav <mav@FreeBSD.org>2018-02-01 19:31:39 +0000
commit9cc76186768d73116ea0f3e435049400c610adb6 (patch)
tree3b335444ab3133e2fcc88e9039e0a574b4dad765
parenta06be92929b2bf40d6fef6832059e9ac4ff01e3e (diff)
downloadFreeBSD-src-9cc76186768d73116ea0f3e435049400c610adb6.zip
FreeBSD-src-9cc76186768d73116ea0f3e435049400c610adb6.tar.gz
MFC r308869 (by imp):
i386 turns out to not have __uint128_t. So confusingly use 64-bit math instead. Since we're little endian, we can get away with it. Also, since the counters in quesitons would require billions of iops for tens of billions of seconds to overflow, and since such data rates are unlikely for people using i386 for a while, that's OK. The fastest cards today can't do even a million IOPs.
-rw-r--r--sbin/nvmecontrol/logpage.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c
index 28295c0..b1303a6 100644
--- a/sbin/nvmecontrol/logpage.c
+++ b/sbin/nvmecontrol/logpage.c
@@ -75,10 +75,18 @@ kv_lookup(const struct kv_name *kv, size_t kv_count, uint32_t key)
}
/*
- * 128-bit integer augments to standard values
+ * 128-bit integer augments to standard values. On i386 this
+ * doesn't exist, so we use 64-bit values. The 128-bit counters
+ * are crazy anyway, since for this purpose, you'd need a
+ * billion IOPs for billions of seconds to overflow them.
+ * So, on 32-bit i386, you'll get truncated values.
*/
#define UINT128_DIG 39
+#ifdef __i386__
+typedef uint64_t uint128_t;
+#else
typedef __uint128_t uint128_t;
+#endif
static inline uint128_t
to128(void *p)
OpenPOWER on IntegriCloud