diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-05 18:01:15 +0200 |
---|---|---|
committer | Sascha Hauer <sha@octopus.labnet.pengutronix.de> | 2007-07-05 18:01:15 +0200 |
commit | 363266d818c3504458fe005ef0308ea48f71e7ca (patch) | |
tree | fa11b8ab9cb69096d9482eda32d2d0be400810ee /common/clock.c | |
parent | fecf0fd93e63938080c6a86c7e0918ab9f310908 (diff) | |
download | barebox-363266d818c3504458fe005ef0308ea48f71e7ca.tar.gz barebox-363266d818c3504458fe005ef0308ea48f71e7ca.tar.xz |
svn_rev_033
change to clocksource api
Diffstat (limited to 'common/clock.c')
-rw-r--r-- | common/clock.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/common/clock.c b/common/clock.c index 2e4e9d7df..d500e5c53 100644 --- a/common/clock.c +++ b/common/clock.c @@ -57,17 +57,23 @@ uint32_t clocksource_hz2mult(uint32_t hz, uint32_t shift_constant) int is_timeout(uint64_t start_ns, uint64_t time_offset_ns) { + if (ctrlc ()) + return -1; + if (start_ns + time_offset_ns < get_time_ns()) return 1; else return 0; } -void udelay(unsigned long usecs) +int udelay(unsigned long usecs) { uint64_t start = get_time_ns(); - while(!is_timeout(start, usecs * 1000)); + while(!is_timeout(start, usecs * 1000)) + if (ctrlc ()) + return -1; + return 0; } void mdelay(unsigned long msecs) |