mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-19 12:12:16 +00:00
hv: revise interfaces description in vpic
Add comments for APIs: - vpic_set_irq() - vpic_pending_intr() - vpic_intr_accepted() Tracked-On: #1595 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
parent
c41f286085
commit
7c20cb0cbe
@ -439,12 +439,14 @@ static void vpic_set_pinstate(struct acrn_vpic *vpic, uint8_t pin,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @pre irq < NR_VPIC_PINS_TOTAL
|
* @brief Set vPIC IRQ line status.
|
||||||
* @pre operation value shall be one of the folllowing values:
|
*
|
||||||
* GSI_SET_HIGH
|
* @param[in] vm Pointer to target VM
|
||||||
* GSI_SET_LOW
|
* @param[in] irq Target IRQ number
|
||||||
* GSI_RAISING_PULSE
|
* @param[in] operation action options:GSI_SET_HIGH/GSI_SET_LOW/
|
||||||
* GSI_FALLING_PULSE
|
* GSI_RAISING_PULSE/GSI_FALLING_PULSE
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
void vpic_set_irq(struct vm *vm, uint32_t irq, uint32_t operation)
|
void vpic_set_irq(struct vm *vm, uint32_t irq, uint32_t operation)
|
||||||
{
|
{
|
||||||
@ -513,6 +515,15 @@ void vpic_get_irq_trigger(struct vm *vm, uint32_t irq,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get pending virtual interrupts for vPIC.
|
||||||
|
*
|
||||||
|
* @param[in] vm Pointer to target VM
|
||||||
|
* @param[inout] vecptr Pointer to vector buffer and will be filled
|
||||||
|
* with eligible vector if any.
|
||||||
|
*
|
||||||
|
* @return void.
|
||||||
|
*/
|
||||||
void vpic_pending_intr(struct vm *vm, uint32_t *vecptr)
|
void vpic_pending_intr(struct vm *vm, uint32_t *vecptr)
|
||||||
{
|
{
|
||||||
struct acrn_vpic *vpic;
|
struct acrn_vpic *vpic;
|
||||||
@ -566,6 +577,16 @@ static void vpic_pin_accepted(struct i8259_reg_state *i8259, uint8_t pin)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Accept virtual interrupt for vPIC.
|
||||||
|
*
|
||||||
|
* @param[in] vm Pointer to target VM
|
||||||
|
* @param[in] vector Target virtual interrupt vector
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @pre vm != NULL
|
||||||
|
*/
|
||||||
void vpic_intr_accepted(struct vm *vm, uint32_t vector)
|
void vpic_intr_accepted(struct vm *vm, uint32_t vector)
|
||||||
{
|
{
|
||||||
struct acrn_vpic *vpic;
|
struct acrn_vpic *vpic;
|
||||||
|
@ -30,6 +30,13 @@
|
|||||||
#ifndef VPIC_H
|
#ifndef VPIC_H
|
||||||
#define VPIC_H
|
#define VPIC_H
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file vpic.h
|
||||||
|
*
|
||||||
|
* @brief public APIs for virtual PIC
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define ICU_IMR_OFFSET 1U
|
#define ICU_IMR_OFFSET 1U
|
||||||
|
|
||||||
/* Initialization control word 1. Written to even address. */
|
/* Initialization control word 1. Written to even address. */
|
||||||
@ -121,12 +128,54 @@ struct acrn_vpic {
|
|||||||
|
|
||||||
void vpic_init(struct vm *vm);
|
void vpic_init(struct vm *vm);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief virtual PIC
|
||||||
|
*
|
||||||
|
* @addtogroup acrn_vpic ACRN vPIC
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set vPIC IRQ line status.
|
||||||
|
*
|
||||||
|
* @param[in] vm Pointer to target VM
|
||||||
|
* @param[in] irq Target IRQ number
|
||||||
|
* @param[in] operation action options:GSI_SET_HIGH/GSI_SET_LOW/
|
||||||
|
* GSI_RAISING_PULSE/GSI_FALLING_PULSE
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
void vpic_set_irq(struct vm *vm, uint32_t irq, uint32_t operation);
|
void vpic_set_irq(struct vm *vm, uint32_t irq, uint32_t operation);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get pending virtual interrupts for vPIC.
|
||||||
|
*
|
||||||
|
* @param[in] vm Pointer to target VM
|
||||||
|
* @param[inout] vecptr Pointer to vector buffer and will be filled
|
||||||
|
* with eligible vector if any.
|
||||||
|
*
|
||||||
|
* @return void.
|
||||||
|
*/
|
||||||
void vpic_pending_intr(struct vm *vm, uint32_t *vecptr);
|
void vpic_pending_intr(struct vm *vm, uint32_t *vecptr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Accept virtual interrupt for vPIC.
|
||||||
|
*
|
||||||
|
* @param[in] vm Pointer to target VM
|
||||||
|
* @param[in] vector Target virtual interrupt vector
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @pre vm != NULL
|
||||||
|
*/
|
||||||
void vpic_intr_accepted(struct vm *vm, uint32_t vector);
|
void vpic_intr_accepted(struct vm *vm, uint32_t vector);
|
||||||
void vpic_get_irq_trigger(struct vm *vm, uint32_t irq,
|
void vpic_get_irq_trigger(struct vm *vm, uint32_t irq,
|
||||||
enum vpic_trigger *trigger);
|
enum vpic_trigger *trigger);
|
||||||
uint32_t vpic_pincount(void);
|
uint32_t vpic_pincount(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
/* End of acrn_vpic */
|
||||||
|
|
||||||
#endif /* VPIC_H */
|
#endif /* VPIC_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user