aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/random/uint128.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/random/uint128.h')
-rw-r--r--sys/dev/random/uint128.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/dev/random/uint128.h b/sys/dev/random/uint128.h
index 63de28a3864a..71056a63a93b 100644
--- a/sys/dev/random/uint128.h
+++ b/sys/dev/random/uint128.h
@@ -65,6 +65,21 @@ uint128_increment(uint128_t *big_uintp)
#endif
}
+static __inline void
+uint128_add64(uint128_t *big_uintp, uint64_t add)
+{
+#ifdef USE_REAL_UINT128_T
+ (*big_uintp) += add;
+#else
+ uint64_t word0p;
+
+ word0p = big_uintp->u128t_word0 + add;
+ if (word0p < big_uintp->u128t_word0)
+ big_uintp->u128t_word1++;
+ big_uintp->u128t_word0 = word0p;
+#endif
+}
+
static __inline bool
uint128_equals(uint128_t a, uint128_t b)
{