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