commit | 0edc148a16644da89b9cbbc0a72a3c9dd743556a | [log] [tgz] |
---|---|---|
author | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | Mon May 26 12:19:10 2008 +0200 |
committer | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | Tue May 27 15:27:31 2008 +0200 |
tree | 6abca9359bef605709b18b85ecde8d0d0dc1cb97 | |
parent | 437d62719b3dbda51ca559177402d51976bc4efb [diff] |
avr32: Fix theoretical race in udelay() If the specified delay is very short, the cycle counter may go past the "end" time we are waiting for before we get around to reading it. Fix it by checking the different between the cycle count "now" and the cycle count at the beginning. This will work as long as the delay measured in number of cycles is below 2^31. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>