khypervisor
v1
|
Go to the source code of this file.
Typedefs | |
typedef void(* | generic_timer_callback_t )(void *pdata) |
Enumerations | |
enum | generic_timer_type_t { GENERIC_TIMER_HYP, GENERIC_TIMER_VIR, GENERIC_TIMER_NSP, GENERIC_TIMER_NUM_TYPES } |
Functions | |
hvmm_status_t | generic_timer_init () |
hvmm_status_t | generic_timer_enable_int (generic_timer_type_t type) |
hvmm_status_t | generic_timer_disable_int (generic_timer_type_t type) |
hvmm_status_t | generic_timer_set_tval (generic_timer_type_t type, uint32_t tval) |
hvmm_status_t | generic_timer_enable_irq (generic_timer_type_t type) |
hvmm_status_t | generic_timer_set_callback (generic_timer_type_t type, generic_timer_callback_t callback) |
typedef void(* generic_timer_callback_t)(void *pdata) |
Definition at line 16 of file generic_timer.h.
enum generic_timer_type_t |
Definition at line 9 of file generic_timer.h.
{ GENERIC_TIMER_HYP, /* IRQ 26 */ GENERIC_TIMER_VIR, /* IRQ 27 */ GENERIC_TIMER_NSP, /* IRQ 30 */ GENERIC_TIMER_NUM_TYPES } generic_timer_type_t;
Definition at line 54 of file generic_timer.c.
{ uint32_t ctrl; hvmm_status_t result = HVMM_STATUS_UNSUPPORTED_FEATURE; if ( type == GENERIC_TIMER_HYP ) { ctrl = generic_timer_reg_read(GENERIC_TIMER_REG_HYP_CTRL); ctrl &= ~GENERIC_TIMER_CTRL_ENABLE; ctrl |= GENERIC_TIMER_CTRL_IMASK; generic_timer_reg_write(GENERIC_TIMER_REG_HYP_CTRL, ctrl); result = HVMM_STATUS_SUCCESS; } return result; }
Definition at line 37 of file generic_timer.c.
{ uint32_t ctrl; hvmm_status_t result = HVMM_STATUS_UNSUPPORTED_FEATURE; if ( type == GENERIC_TIMER_HYP ) { ctrl = generic_timer_reg_read(GENERIC_TIMER_REG_HYP_CTRL); ctrl |= GENERIC_TIMER_CTRL_ENABLE; ctrl &= ~GENERIC_TIMER_CTRL_IMASK; generic_timer_reg_write(GENERIC_TIMER_REG_HYP_CTRL, ctrl); result = HVMM_STATUS_SUCCESS; } return result; }
Definition at line 76 of file generic_timer.c.
{ hvmm_status_t result = HVMM_STATUS_UNSUPPORTED_FEATURE; if ( type == GENERIC_TIMER_HYP ) { uint32_t irq = _timer_irqs[type]; gic_test_set_irq_handler(irq, &_generic_timer_hyp_irq_handler, 0); gic_test_configure_irq(irq, GIC_INT_POLARITY_LEVEL, gic_cpumask_current(), GIC_INT_PRIORITY_DEFAULT ); result = HVMM_STATUS_SUCCESS; } return result; }
Definition at line 13 of file generic_timer.c.
{ _timer_irqs[GENERIC_TIMER_HYP] = 26; _timer_irqs[GENERIC_TIMER_NSP] = 27; _timer_irqs[GENERIC_TIMER_VIR] = 30; return HVMM_STATUS_SUCCESS; }
hvmm_status_t generic_timer_set_callback | ( | generic_timer_type_t | type, |
generic_timer_callback_t | callback | ||
) |
Definition at line 95 of file generic_timer.c.
{ HVMM_TRACE_ENTER(); _callback[type] = callback; HVMM_TRACE_EXIT(); return HVMM_STATUS_SUCCESS; }
hvmm_status_t generic_timer_set_tval | ( | generic_timer_type_t | type, |
uint32_t | tval | ||
) |
Definition at line 23 of file generic_timer.c.
{ hvmm_status_t result = HVMM_STATUS_UNSUPPORTED_FEATURE; if ( type == GENERIC_TIMER_HYP) { _tvals[type] = tval; generic_timer_reg_write(GENERIC_TIMER_REG_HYP_TVAL, tval); result = HVMM_STATUS_SUCCESS; } else { } return result; }