mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 15:45:05 +00:00
hv/mod_timer: refine timer interface
1. do not allow external modules to touch internal field of a timer. 2. make timer mode internal, period_in_ticks will decide the mode. API wise: 1. the "mode" parameter was taken out of initialize_timer(). 2. a new function update_timer() was added to update the timeout and period fields. 3. the timer_expired() function was extended with an output parameter to return the remaining cycles before expiration. Also, the "fire_tsc" field name of hv_timer was renamed to "timeout". With the new API, however, this change should not concern user code. Tracked-On: #5920 Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
@@ -166,7 +166,7 @@ void console_setup_timer(void)
|
||||
fire_tsc = cpu_ticks() + period_in_cycle;
|
||||
initialize_timer(&console_timer,
|
||||
console_timer_callback, NULL,
|
||||
fire_tsc, TICK_MODE_PERIODIC, period_in_cycle);
|
||||
fire_tsc, period_in_cycle);
|
||||
|
||||
/* Start an periodic timer */
|
||||
if (add_timer(&console_timer) != 0) {
|
||||
|
||||
Reference in New Issue
Block a user