Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/random/uint128.h
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | #ifdef USE_REAL_UINT128_T | ||||
(*big_uintp)++; | (*big_uintp)++; | ||||
#else | #else | ||||
big_uintp->u128t_word0++; | big_uintp->u128t_word0++; | ||||
if (big_uintp->u128t_word0 == 0UL) | if (big_uintp->u128t_word0 == 0UL) | ||||
big_uintp->u128t_word1++; | big_uintp->u128t_word1++; | ||||
#endif | #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 | static __inline bool | ||||
uint128_equals(uint128_t a, uint128_t b) | uint128_equals(uint128_t a, uint128_t b) | ||||
{ | { | ||||
#ifdef USE_REAL_UINT128_T | #ifdef USE_REAL_UINT128_T | ||||
return (a == b); | return (a == b); | ||||
#else | #else | ||||
return (a.u128t_word0 == b.u128t_word0 && | return (a.u128t_word0 == b.u128t_word0 && | ||||
a.u128t_word1 == b.u128t_word1); | a.u128t_word1 == b.u128t_word1); | ||||
Show All 39 Lines |