|
| volatile clock_t | timer_ticks_counter |
| | This is where we keep track of the number of intervals reported by the timer. More...
|
| |
|
volatile u32 | timer_kernel_frequency |
| | Frequency of the global timekeeping timer.
|
| |
|
#define | SEC_TO_TICKS(_time) SEC((_time) * HZ) |
| | Compute the number of ticks in a given time frame.
|
| |
|
#define | MS_TO_TICKS(_time) MS_TO_SEC(SEC_TO_TICKS(_time)) |
| | Compute the number of ticks in a given time frame.
|
| |
|
#define | US_TO_TICKS(_time) US_TO_SEC(SEC_TO_TICKS(_time)) |
| | Compute the number of ticks in a given time frame.
|
| |
|
#define | NS_TO_TICKS(_time) NS_TO_SEC(SEC_TO_TICKS(_time)) |
| | Compute the number of ticks in a given time frame.
|
| |
|
#define | TICKS_TO_SEC(_ticks) SEC((_ticks) / HZ) |
| | Convert a number of ticks into a regular time unit.
|
| |
|
#define | TICKS_TO_MS(_ticks) MS(TICKS_TO_SEC(_ticks)) |
| | Convert a number of ticks into a regular time unit.
|
| |
|
#define | TICKS_TO_US(_ticks) US(TICKS_TO_SEC(_ticks)) |
| | Convert a number of ticks into a regular time unit.
|
| |
|
#define | TICKS_TO_NS(_ticks) NS(TICKS_TO_SEC(_ticks)) |
| | Convert a number of ticks into a regular time unit.
|
| |
Time
Timer
Any interaction done with the timer should be done through the functions defined inside this header.
◆ clock_get_time()
| static void clock_get_time |
( |
struct timespec * |
time | ) |
|
|
inlinestatic |
FIXME: Change this to use the system's clock once clock_settime(). For now we'll use the system's timer instead.
◆ timer_get_ms()
| static time_t timer_get_ms |
( |
void |
| ) |
|
|
inlinestatic |
- Returns
- the number of miliseconds elapsed since startup.
◆ timer_get_ns()
| static time_t timer_get_ns |
( |
void |
| ) |
|
|
inlinestatic |
- Returns
- the number of nanoseconds elapsed since startup.
◆ timer_get_us()
| static time_t timer_get_us |
( |
void |
| ) |
|
|
inlinestatic |
- Returns
- the number of microseconds elapsed since startup.
◆ timer_gettick()
| static clock_t timer_gettick |
( |
void |
| ) |
|
|
inlinestatic |
- Returns
- the number of timer intervals elapsed since startup
◆ timer_start()
| void timer_start |
( |
u32 |
frequency | ) |
|
- Parameters
-
| frequency | The timer's frequency (Hz) |
◆ timer_tick()
| static bool timer_tick |
( |
void |
| ) |
|
|
inlinestatic |
- Returns
true if an overflow occured.
◆ timer_wait_ms()
| void timer_wait_ms |
( |
time_t |
ms | ) |
|
- Warning
- Calls to this function are blocking
◆ timer_ticks_counter
| volatile clock_t timer_ticks_counter |
|
extern |
This MUST be incremented EACH time we recieve an interrupt from the global timer.