use ffsl and ffsll
replace locks by critical sections in interrupt handling