doc: hv: add comments to irq APIs for documentation

Tracked-On: #1595
Signed-off-by: Yan, Like <like.yan@intel.com>
This commit is contained in:
Yan, Like
2018-10-31 15:12:33 +08:00
committed by David Kinder
parent f69dd1c6ea
commit 7dc3e609be
7 changed files with 148 additions and 13 deletions

View File

@@ -20,8 +20,34 @@ void setup_ioapic_irqs(void);
bool irq_is_gsi(uint32_t irq);
uint8_t irq_to_pin(uint32_t irq);
/**
* @brief Get irq num from pin num
*
* @param[in] pin The pin number
*/
uint32_t pin_to_irq(uint8_t pin);
/**
* @brief Set the redirection table entry
*
* Set the redirection table entry of an interrupt
*
* @param[in] irq The number of irq to set
* @param[in] rte Union of ioapic_rte to set
*/
void ioapic_set_rte(uint32_t irq, union ioapic_rte rte);
/**
* @brief Get the redirection table entry
*
* Get the redirection table entry of an interrupt
*
* @param[in] irq The number of irq to fetch RTE
* @param[inout] rte Pointer to union ioapic_rte to return result RTE
*
* @pre rte != NULL
*/
void ioapic_get_rte(uint32_t irq, union ioapic_rte *rte);
void suspend_ioapic(void);
@@ -33,6 +59,15 @@ void gsi_unmask_irq(uint32_t irq);
extern uint8_t pic_ioapic_pin_map[NR_LEGACY_PIN];
#ifdef HV_DEBUG
/**
* @brief Get information of ioapic
*
* It's for debug only.
*
* @param[in] str_max_len The max size of the string containing
* interrupt info
* @param[inout] str_arg Pointer to the output information
*/
int get_ioapic_info(char *str_arg, size_t str_max_len);
#endif /* HV_DEBUG */

View File

@@ -89,6 +89,12 @@ extern spurious_handler_t spurious_handler;
uint32_t alloc_irq_num(uint32_t req_irq);
uint32_t alloc_irq_vector(uint32_t irq);
/**
* @brief Get vector number of an interupt from irq number
*
* @param[in] irq The irq_num to convert
*/
uint32_t irq_to_vector(uint32_t irq);
/*
@@ -122,11 +128,27 @@ int exception_vmexit_handler(struct vcpu *vcpu);
int interrupt_window_vmexit_handler(struct vcpu *vcpu);
int external_interrupt_vmexit_handler(struct vcpu *vcpu);
int acrn_handle_pending_request(struct vcpu *vcpu);
/**
* @brief Initialize the interrupt
*
* To do interrupt initialization for a cpu, will be called for each physical cpu.
*
* @param[in] pcpu_id The id of physical cpu to initialize
*/
void interrupt_init(uint16_t pcpu_id);
void cancel_event_injection(struct vcpu *vcpu);
#ifdef HV_DEBUG
/**
* @brief Get the interupt statistics
*
* It's for debug only.
*
* @param[in] str_max The max size of the string containing interrupt info
* @param[inout] str_arg Pointer to the output interrupt info
*/
void get_cpu_interrupt_info(char *str_arg, size_t str_max);
#endif /* HV_DEBUG */

View File

@@ -51,17 +51,54 @@ enum intr_cpu_startup_shorthand {
INTR_CPU_STARTUP_UNKNOWN,
};
/**
* @brief Save context of lapic
*
* @param[inout] regs Pointer to struct lapic_regs to hold the
* context of current lapic
*/
void save_lapic(struct lapic_regs *regs);
void early_init_lapic(void);
void init_lapic(uint16_t pcpu_id);
void send_lapic_eoi(void);
/**
* @brief Get the lapic id
*
* @return lapic id
*/
uint32_t get_cur_lapic_id(void);
/**
* @brief Send an SIPI to a specific cpu
*
* Send an Startup IPI to a specific cpu, to notify the cpu to start booting.
*
* @param[in] cpu_startup_shorthand The startup_shorthand
* @param[in] dest_pcpu_id The id of destination physical cpu
* @param[in] cpu_startup_start_address The address for the dest pCPU to start running
*
* @pre cpu_startup_shorthand < INTR_CPU_STARTUP_UNKNOWN
*/
void send_startup_ipi(enum intr_cpu_startup_shorthand cpu_startup_shorthand,
uint16_t dest_pcpu_id,
uint64_t cpu_startup_start_address);
/* API to send an IPI to multiple pCPUs */
/**
* @brief Send an IPI to multiple pCPUs
*
* @param[in] dest_mask The mask of destination physical cpus
* @param[in] vector The vector of interrupt
*/
void send_dest_ipi_mask(uint32_t dest_mask, uint32_t vector);
/* API to send an IPI to a single pCPU */
/**
* @brief Send an IPI to a single pCPU
*
* @param[in] pcpu_id The id of destination physical cpu
* @param[in] vector The vector of interrupt
*/
void send_single_ipi(uint16_t pcpu_id, uint32_t vector);
void suspend_lapic(void);