Implementation of the kal_timer interface based on hrtimer.h. More...
#include <linux/aquosa/qos_debug.h>
#include <linux/aquosa/qos_types.h>
#include <linux/aquosa/qos_memory.h>
#include <linux/hrtimer.h>
#include "kal_time.h"
#include "kal_arg.h"
Go to the source code of this file.
Data Structures | |
struct | kal_timer |
Implementation of kal_timer based on hrtimer.h. More... | |
Typedefs | |
typedef void(* | kal_timer_cb )(kal_arg_t cb_data) |
typedef struct kal_timer | kal_timer_t |
Implementation of kal_timer based on hrtimer.h. | |
typedef enum hrtimer_restart(* | hrtimer_cb )(struct hrtimer *) |
Functions | |
static enum hrtimer_restart | hrt_callback (struct hrtimer *hrt) |
kal_timer_cb <-> hrtimer_cb wrapper/adapter | |
static void | kal_timer_init (kal_timer_t *p_timer, kal_timer_cb cb, kal_arg_t cb_data) |
static void | kal_timer_set_expires (kal_timer_t *p_timer, kal_time_t t) |
Set absolute expiry time and do not start. | |
static kal_time_t | kal_timer_get_expires (kal_timer_t *p_timer) |
Retrieve the absolute expiry time. | |
static void | kal_timer_init_now (kal_timer_t *p_timer, kal_timer_cb cb, kal_arg_t cb_data) |
static void | kal_timer_del (kal_timer_t *p_timer) |
static void | kal_timer_set (kal_timer_t *p_timer, kal_time_t t) |
Set absolute expiry time and start the timer. | |
static kal_time_t | kal_timer_get_remaining (kal_timer_t *p_timer) |
Retrieve the remaining time to expiry. | |
static void | kal_timer_forward (kal_timer_t *p_timer, kal_time_t t) |
static int | kal_timer_pending (kal_timer_t *p_timer) |
Implementation of the kal_timer interface based on hrtimer.h.
The implementation in kal_timer_hrtimer.h may be used independently of the actual type of kal_time.h, thanks to the converion functions defined below (however, optimum configuration is with the kal_time implementation found in kal_time_timespec.h).
Definition in file kal_timer_hrtimer.h.
typedef enum hrtimer_restart(* hrtimer_cb)(struct hrtimer *) |
Definition at line 50 of file kal_timer_hrtimer.h.
typedef void(* kal_timer_cb)(kal_arg_t cb_data) |
Definition at line 25 of file kal_timer_hrtimer.h.
typedef struct kal_timer kal_timer_t |
Implementation of kal_timer based on hrtimer.h.
This type may be logically thought of as a subclass of hrtimer, so that (dynamic) casting from kal_timer * to/from hrtimer * is safe.
static enum hrtimer_restart hrt_callback | ( | struct hrtimer * | hrt | ) | [static] |
kal_timer_cb <-> hrtimer_cb wrapper/adapter
This callback casts the hrtimer* arg to a kal_timer*, then retrieves from it the actual kal_timer callback and parameter, and calls it.
Definition at line 57 of file kal_timer_hrtimer.h.
References kal_timer_t::handler_running, qos_chk_do, qos_mem_valid(), timer, kal_timer_t::timer_cb, and kal_timer_t::timer_cb_data.
Referenced by kal_timer_init().
static void kal_timer_del | ( | kal_timer_t * | p_timer | ) | [inline, static] |
Definition at line 105 of file kal_timer_hrtimer.h.
References kal_timer_t::handler_running.
Referenced by kal_timer_forward(), kal_timer_set(), rres_cleanup(), rres_schedule(), and stop_pending_timers().
static void kal_timer_forward | ( | kal_timer_t * | p_timer, | |
kal_time_t | t | |||
) | [inline, static] |
Definition at line 124 of file kal_timer_hrtimer.h.
References kal_time_add(), kal_timer_del(), and kal_timer_get_expires().
static kal_time_t kal_timer_get_expires | ( | kal_timer_t * | p_timer | ) | [inline, static] |
Retrieve the absolute expiry time.
Definition at line 89 of file kal_timer_hrtimer.h.
Referenced by kal_timer_forward().
static kal_time_t kal_timer_get_remaining | ( | kal_timer_t * | p_timer | ) | [inline, static] |
Retrieve the remaining time to expiry.
Definition at line 120 of file kal_timer_hrtimer.h.
static void kal_timer_init | ( | kal_timer_t * | p_timer, | |
kal_timer_cb | cb, | |||
kal_arg_t | cb_data | |||
) | [inline, static] |
Definition at line 67 of file kal_timer_hrtimer.h.
References kal_timer_t::handler_running, hrt_callback(), kal_timer_t::timer_cb, and kal_timer_t::timer_cb_data.
Referenced by kal_timer_init_now(), rres_init(), and rres_init_server().
static void kal_timer_init_now | ( | kal_timer_t * | p_timer, | |
kal_timer_cb | cb, | |||
kal_arg_t | cb_data | |||
) | [inline, static] |
Definition at line 99 of file kal_timer_hrtimer.h.
References kal_time_now(), kal_timer_init(), and kal_timer_set_expires().
static int kal_timer_pending | ( | kal_timer_t * | p_timer | ) | [inline, static] |
Definition at line 130 of file kal_timer_hrtimer.h.
Referenced by stop_pending_timers().
static void kal_timer_set | ( | kal_timer_t * | p_timer, | |
kal_time_t | t | |||
) | [inline, static] |
Set absolute expiry time and start the timer.
Definition at line 114 of file kal_timer_hrtimer.h.
References kal_timer_del().
Referenced by rres_update_budget(), and set_enforce_timer().
static void kal_timer_set_expires | ( | kal_timer_t * | p_timer, | |
kal_time_t | t | |||
) | [inline, static] |
Set absolute expiry time and do not start.
Definition at line 78 of file kal_timer_hrtimer.h.
Referenced by kal_timer_init_now().