Skip to content

Commit 7c20cb0

Browse files
yonghuahdbkinder
authored andcommitted
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>
1 parent c41f286 commit 7c20cb0

File tree

2 files changed

+76
-6
lines changed

2 files changed

+76
-6
lines changed

hypervisor/dm/vpic.c

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,14 @@ static void vpic_set_pinstate(struct acrn_vpic *vpic, uint8_t pin,
439439
}
440440

441441
/**
442-
* @pre irq < NR_VPIC_PINS_TOTAL
443-
* @pre operation value shall be one of the folllowing values:
444-
* GSI_SET_HIGH
445-
* GSI_SET_LOW
446-
* GSI_RAISING_PULSE
447-
* GSI_FALLING_PULSE
442+
* @brief Set vPIC IRQ line status.
443+
*
444+
* @param[in] vm Pointer to target VM
445+
* @param[in] irq Target IRQ number
446+
* @param[in] operation action options:GSI_SET_HIGH/GSI_SET_LOW/
447+
* GSI_RAISING_PULSE/GSI_FALLING_PULSE
448+
*
449+
* @return void
448450
*/
449451
void vpic_set_irq(struct vm *vm, uint32_t irq, uint32_t operation)
450452
{
@@ -513,6 +515,15 @@ void vpic_get_irq_trigger(struct vm *vm, uint32_t irq,
513515
}
514516
}
515517

518+
/**
519+
* @brief Get pending virtual interrupts for vPIC.
520+
*
521+
* @param[in] vm Pointer to target VM
522+
* @param[inout] vecptr Pointer to vector buffer and will be filled
523+
* with eligible vector if any.
524+
*
525+
* @return void.
526+
*/
516527
void vpic_pending_intr(struct vm *vm, uint32_t *vecptr)
517528
{
518529
struct acrn_vpic *vpic;
@@ -566,6 +577,16 @@ static void vpic_pin_accepted(struct i8259_reg_state *i8259, uint8_t pin)
566577
}
567578
}
568579

580+
/**
581+
* @brief Accept virtual interrupt for vPIC.
582+
*
583+
* @param[in] vm Pointer to target VM
584+
* @param[in] vector Target virtual interrupt vector
585+
*
586+
* @return void
587+
*
588+
* @pre vm != NULL
589+
*/
569590
void vpic_intr_accepted(struct vm *vm, uint32_t vector)
570591
{
571592
struct acrn_vpic *vpic;

hypervisor/include/arch/x86/guest/vpic.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
#ifndef VPIC_H
3131
#define VPIC_H
3232

33+
/**
34+
* @file vpic.h
35+
*
36+
* @brief public APIs for virtual PIC
37+
*/
38+
39+
3340
#define ICU_IMR_OFFSET 1U
3441

3542
/* Initialization control word 1. Written to even address. */
@@ -121,12 +128,54 @@ struct acrn_vpic {
121128

122129
void vpic_init(struct vm *vm);
123130

131+
/**
132+
* @brief virtual PIC
133+
*
134+
* @addtogroup acrn_vpic ACRN vPIC
135+
* @{
136+
*/
137+
138+
/**
139+
* @brief Set vPIC IRQ line status.
140+
*
141+
* @param[in] vm Pointer to target VM
142+
* @param[in] irq Target IRQ number
143+
* @param[in] operation action options:GSI_SET_HIGH/GSI_SET_LOW/
144+
* GSI_RAISING_PULSE/GSI_FALLING_PULSE
145+
*
146+
* @return void
147+
*/
124148
void vpic_set_irq(struct vm *vm, uint32_t irq, uint32_t operation);
125149

150+
/**
151+
* @brief Get pending virtual interrupts for vPIC.
152+
*
153+
* @param[in] vm Pointer to target VM
154+
* @param[inout] vecptr Pointer to vector buffer and will be filled
155+
* with eligible vector if any.
156+
*
157+
* @return void.
158+
*/
126159
void vpic_pending_intr(struct vm *vm, uint32_t *vecptr);
160+
161+
/**
162+
* @brief Accept virtual interrupt for vPIC.
163+
*
164+
* @param[in] vm Pointer to target VM
165+
* @param[in] vector Target virtual interrupt vector
166+
*
167+
* @return void
168+
*
169+
* @pre vm != NULL
170+
*/
127171
void vpic_intr_accepted(struct vm *vm, uint32_t vector);
128172
void vpic_get_irq_trigger(struct vm *vm, uint32_t irq,
129173
enum vpic_trigger *trigger);
130174
uint32_t vpic_pincount(void);
131175

176+
/**
177+
* @}
178+
*/
179+
/* End of acrn_vpic */
180+
132181
#endif /* VPIC_H */

0 commit comments

Comments
 (0)