3 struct frand_state __fio_rand_state;
5 static inline int __seed(unsigned int x, unsigned int m)
7 return (x < m) ? x + m : x;
10 void init_rand(struct frand_state *state)
12 #define LCG(x) ((x) * 69069) /* super-duper LCG */
14 state->s1 = __seed(LCG((2^31) + (2^17) + (2^7)), 1);
15 state->s2 = __seed(LCG(state->s1), 7);
16 state->s3 = __seed(LCG(state->s2), 15);