coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
timer_queue.c File Reference
#include <timer.h>
Include dependency graph for timer_queue.c:

Go to the source code of this file.

Data Structures

struct  timer_queue
 

Macros

#define MAX_TIMER_QUEUE_ENTRIES   64
 

Functions

static int timer_queue_empty (struct timer_queue *tq)
 
static int timer_queue_full (struct timer_queue *tq)
 
static struct timeout_callbacktimer_queue_head (struct timer_queue *tq)
 
static int timer_queue_insert (struct timer_queue *tq, struct timeout_callback *tocb)
 
static int timer_queue_min_child_index (struct timer_queue *tq, int index)
 
static void timer_queue_remove_head (struct timer_queue *tq)
 
static struct timeout_callbacktimer_queue_expired (struct timer_queue *tq, struct mono_time *current_time)
 
int timer_sched_callback (struct timeout_callback *tocb, unsigned long us)
 
int timers_run (void)
 

Variables

static struct timer_queue global_timer_queue
 

Macro Definition Documentation

◆ MAX_TIMER_QUEUE_ENTRIES

#define MAX_TIMER_QUEUE_ENTRIES   64

Definition at line 5 of file timer_queue.c.

Function Documentation

◆ timer_queue_empty()

static int timer_queue_empty ( struct timer_queue tq)
inlinestatic

Definition at line 21 of file timer_queue.c.

References timer_queue::num_entries.

Referenced by timer_queue_head(), and timers_run().

Here is the caller graph for this function:

◆ timer_queue_expired()

static struct timeout_callback* timer_queue_expired ( struct timer_queue tq,
struct mono_time current_time 
)
static

Definition at line 133 of file timer_queue.c.

References timeout_callback::expiration, mono_time_before(), NULL, timer_queue_head(), and timer_queue_remove_head().

Referenced by timers_run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ timer_queue_full()

static int timer_queue_full ( struct timer_queue tq)
inlinestatic

Definition at line 26 of file timer_queue.c.

References timer_queue::max_entries, and timer_queue::num_entries.

Referenced by timer_queue_insert().

Here is the caller graph for this function:

◆ timer_queue_head()

static struct timeout_callback* timer_queue_head ( struct timer_queue tq)
inlinestatic

Definition at line 31 of file timer_queue.c.

References NULL, timer_queue::queue, and timer_queue_empty().

Referenced by timer_queue_expired().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ timer_queue_insert()

static int timer_queue_insert ( struct timer_queue tq,
struct timeout_callback tocb 
)
static

Definition at line 38 of file timer_queue.c.

References timeout_callback::expiration, mono_time_cmp(), timer_queue::num_entries, timer_queue::queue, and timer_queue_full().

Referenced by timer_sched_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ timer_queue_min_child_index()

static int timer_queue_min_child_index ( struct timer_queue tq,
int  index 
)
static

Definition at line 73 of file timer_queue.c.

References timeout_callback::expiration, mono_time_cmp(), timer_queue::num_entries, and timer_queue::queue.

Referenced by timer_queue_remove_head().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ timer_queue_remove_head()

static void timer_queue_remove_head ( struct timer_queue tq)
static

Definition at line 95 of file timer_queue.c.

References timeout_callback::expiration, mono_time_cmp(), timer_queue::num_entries, timer_queue::queue, and timer_queue_min_child_index().

Referenced by timer_queue_expired().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ timer_sched_callback()

int timer_sched_callback ( struct timeout_callback tocb,
unsigned long  us 
)

Definition at line 151 of file timer_queue.c.

References timeout_callback::expiration, global_timer_queue, mono_time_add_usecs(), mono_time_before(), timer_monotonic_get(), and timer_queue_insert().

Referenced by thread_yield_timed_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ timers_run()

int timers_run ( void  )

Definition at line 169 of file timer_queue.c.

References timeout_callback::callback, global_timer_queue, NULL, timer_monotonic_get(), timer_queue_empty(), and timer_queue_expired().

Referenced by idle_thread().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ global_timer_queue

struct timer_queue global_timer_queue
static
Initial value:
= {
.num_entries = 0,
.max_entries = MAX_TIMER_QUEUE_ENTRIES,
.queue = { 0 },
}
#define MAX_TIMER_QUEUE_ENTRIES
Definition: timer_queue.c:5

Definition at line 1 of file timer_queue.c.

Referenced by timer_sched_callback(), and timers_run().