HV:Modularize vpic code to remove usage of acrn_vm

V1:Initial Patch
Modularize vpic. The current patch reduces the usage
of acrn_vm inside the vpic.c file.
Due to the global natire of register_pio_handler, where
acrn_vm is being passed, some usage remains.
These needs to be a separate "interface" file.
That will come in smaller newer patch provided
this patch is accepted.

V2:
Incorporated comments from Jason.

V3:
Fixed some MISRA-C Violations.

Tracked-On: #1842
Signed-off-by: Arindam Roy <arindam.roy@intel.com>
Reviewed-by: Xu, Anthony <anthony.xu@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
Arindam Roy
2019-05-16 13:58:02 -07:00
committed by Eddie Dong
parent c91a54882f
commit 2321fcdf78
6 changed files with 36 additions and 53 deletions

View File

@@ -149,39 +149,40 @@ void vpic_init(struct acrn_vm *vm);
/**
* @brief Set vPIC IRQ line status.
*
* @param[in] vm Pointer to target VM
* @param[in] vpic Pointer to target VM's vpic table
* @param[in] irqline Target IRQ number
* @param[in] operation action options:GSI_SET_HIGH/GSI_SET_LOW/
* GSI_RAISING_PULSE/GSI_FALLING_PULSE
*
* @return None
*/
void vpic_set_irqline(const struct acrn_vm *vm, uint32_t irqline, uint32_t operation);
void vpic_set_irqline(struct acrn_vpic *vpic, uint32_t irqline, uint32_t operation);
/**
* @brief Get pending virtual interrupts for vPIC.
*
* @param[in] vm Pointer to target VM
* @param[in] vpic Pointer to target VM's vpic table
* @param[inout] vecptr Pointer to vector buffer and will be filled
* with eligible vector if any.
*
* @return None
*/
void vpic_pending_intr(struct acrn_vm *vm, uint32_t *vecptr);
void vpic_pending_intr(struct acrn_vpic *vpic, uint32_t *vecptr);
/**
* @brief Accept virtual interrupt for vPIC.
*
* @param[in] vm Pointer to target VM
* @param[in] vpic Pointer to target VM's vpic table
* @param[in] vector Target virtual interrupt vector
*
* @return None
*
* @pre vm != NULL
*/
void vpic_intr_accepted(struct acrn_vm *vm, uint32_t vector);
void vpic_get_irqline_trigger_mode(const struct acrn_vm *vm, uint32_t irqline, enum vpic_trigger *trigger);
void vpic_intr_accepted(struct acrn_vpic *vpic, uint32_t vector);
void vpic_get_irqline_trigger_mode(const struct acrn_vpic *vpic, uint32_t irqline, enum vpic_trigger *trigger);
uint32_t vpic_pincount(void);
struct acrn_vpic *vm_pic(const struct acrn_vm *vm);
/**
* @}