Lines Matching refs:limit
60 static uint32 random_upto_makemask(uint32 limit) { in random_upto_makemask() argument
64 if ((limit & (mask >> i)) == limit) in random_upto_makemask()
69 static uint32 random_upto_internal(uint32 limit, uint32 mask) { in random_upto_internal() argument
73 } while (ret > limit); in random_upto_internal()
77 uint32 random_upto(uint32 limit) { in random_upto() argument
78 uint32 mask = random_upto_makemask(limit); in random_upto()
79 return random_upto_internal(limit, mask); in random_upto()
82 uint32 random_upto_biased(uint32 limit, int bias) { in random_upto_biased() argument
83 uint32 mask = random_upto_makemask(limit); in random_upto_biased()
85 uint32 ret = random_upto_internal(limit, mask); in random_upto_biased()
88 tmp = random_upto_internal(limit, mask); if (tmp < ret) ret = tmp; in random_upto_biased()
89 tmp = random_upto_internal(limit, mask); if (tmp < ret) ret = tmp; in random_upto_biased()
90 tmp = random_upto_internal(limit, mask); if (tmp < ret) ret = tmp; in random_upto_biased()
91 tmp = random_upto_internal(limit, mask); if (tmp < ret) ret = tmp; in random_upto_biased()
92 tmp = random_upto_internal(limit, mask); if (tmp < ret) ret = tmp; in random_upto_biased()
93 tmp = random_upto_internal(limit, mask); if (tmp < ret) ret = tmp; in random_upto_biased()
94 tmp = random_upto_internal(limit, mask); if (tmp < ret) ret = tmp; in random_upto_biased()
95 tmp = random_upto_internal(limit, mask); if (tmp < ret) ret = tmp; in random_upto_biased()