X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Ftime.h;h=9deb2cf61cc4aab0d19dadea79469af79d8015ca;hb=9ff4ce8abc627b8696c9bd6fd726dd1dbf4b9a5c;hp=1e9b369be7cb029f0eafa6ad9180affe73b36b6e;hpb=5973901826c73462306fbe4051bc3643dca6b88f;p=platform%2Fkernel%2Fu-boot.git diff --git a/include/time.h b/include/time.h index 1e9b369..9deb2cf 100644 --- a/include/time.h +++ b/include/time.h @@ -6,6 +6,8 @@ #include #include +ulong get_tbclk(void); + unsigned long get_timer(unsigned long base); /* @@ -13,6 +15,18 @@ unsigned long get_timer(unsigned long base); * Granularity may be larger than 1us if hardware does not support this. */ unsigned long timer_get_us(void); +uint64_t get_timer_us(uint64_t base); + +/** + * get_timer_us_long() - Get the number of elapsed microseconds + * + * This uses 32-bit arithmetic on 32-bit machines, which is enough to handle + * delays of over an hour. For 64-bit machines it uses a 64-bit value. + * + *@base: Base time to consider + *Return: elapsed time since @base + */ +unsigned long get_timer_us_long(unsigned long base); /* * timer_test_add_offset() @@ -69,4 +83,47 @@ uint64_t usec_to_tick(unsigned long usec); (time_after_eq(a,b) && \ time_before(a,c)) +/** + * usec2ticks() - Convert microseconds to internal ticks + * + * @usec: Value of microseconds to convert + * Return: Corresponding internal ticks value, calculated using get_tbclk() + */ +ulong usec2ticks(unsigned long usec); + +/** + * ticks2usec() - Convert internal ticks to microseconds + * + * @ticks: Value of ticks to convert + * Return: Corresponding microseconds value, calculated using get_tbclk() + */ +ulong ticks2usec(unsigned long ticks); + +/** + * wait_ticks() - waits a given number of ticks + * + * This is an internal function typically used to implement udelay() and + * similar. Normally you should use udelay() or mdelay() instead. + * + * @ticks: Number of ticks to wait + */ +void wait_ticks(unsigned long ticks); + +/** + * timer_get_us() - Get monotonic microsecond timer + * + * Return: value of monotonic microsecond timer + */ +unsigned long timer_get_us(void); + +/** + * get_ticks() - Get the current tick value + * + * This is an internal value used by the timer on the system. Ticks increase + * monotonically at the rate given by get_tbclk(). + * + * Return: current tick value + */ +uint64_t get_ticks(void); + #endif /* _TIME_H */