1 #ifndef FIO_LFSR_H
2 #define FIO_LFSR_H
3 
4 #include <inttypes.h>
5 
6 #define FIO_MAX_TAPS	6
7 
8 struct lfsr_taps {
9 	unsigned int length;
10 	unsigned int taps[FIO_MAX_TAPS];
11 };
12 
13 
14 struct fio_lfsr {
15 	uint64_t xormask;
16 	uint64_t last_val;
17 	uint64_t cached_bit;
18 	uint64_t max_val;
19 	uint64_t num_vals;
20 	uint64_t cycle_length;
21 	uint64_t cached_cycle_length;
22 	unsigned int spin;
23 };
24 
25 int lfsr_next(struct fio_lfsr *fl, uint64_t *off);
26 int lfsr_init(struct fio_lfsr *fl, uint64_t size,
27 		unsigned long seed, unsigned int spin);
28 int lfsr_reset(struct fio_lfsr *fl, unsigned long seed);
29 
30 #endif
31