mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-19 04:02:05 +00:00
HV: cleanup CONFIG_COM_IRQ related code
move CONFIG_COM_IRQ code into vuart, because it is just used for vuart. Tracked-On: #2170 Signed-off-by: Minggui Cao <minggui.cao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
fde0bcc1ce
commit
537adaeb46
@ -54,22 +54,6 @@ ptirq_lookup_entry_by_vpin(const struct acrn_vm *vm, uint8_t virt_pin, bool pic_
|
||||
return entry;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_COM_IRQ
|
||||
static bool ptdev_hv_owned_intx(const struct acrn_vm *vm, const union source_id *virt_sid)
|
||||
{
|
||||
bool ret;
|
||||
|
||||
/* vm0 vuart pin is owned by hypervisor under debug version */
|
||||
if (is_vm0(vm) && (virt_sid->intx_id.pin == CONFIG_COM_IRQ)) {
|
||||
ret = true;
|
||||
} else {
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_COM_IRQ */
|
||||
|
||||
static uint64_t calculate_logical_dest_mask(uint64_t pdmask)
|
||||
{
|
||||
uint64_t dest_mask = 0UL;
|
||||
@ -625,11 +609,9 @@ int32_t ptirq_intx_pin_remap(struct acrn_vm *vm, uint8_t virt_pin, uint8_t vpin_
|
||||
*/
|
||||
|
||||
/* no remap for hypervisor owned intx */
|
||||
#ifdef CONFIG_COM_IRQ
|
||||
if (ptdev_hv_owned_intx(vm, &virt_sid)) {
|
||||
if (is_vm0(vm) && hv_used_dbg_intx(virt_sid.intx_id.pin)) {
|
||||
status = -ENODEV;
|
||||
}
|
||||
#endif /* CONFIG_COM_IRQ */
|
||||
|
||||
if ((status != 0) || (pic_pin && (virt_pin >= NR_VPIC_PINS_TOTAL))) {
|
||||
status = -EINVAL;
|
||||
|
@ -408,3 +408,8 @@ void vuart_init(struct acrn_vm *vm)
|
||||
vuart_lock_init(vu);
|
||||
vuart_register_io_handler(vm);
|
||||
}
|
||||
|
||||
bool hv_used_dbg_intx(uint8_t intx_pin)
|
||||
{
|
||||
return is_dbg_uart_enabled() && (intx_pin == CONFIG_COM_IRQ);
|
||||
}
|
||||
|
@ -75,4 +75,5 @@ struct acrn_vuart *vuart_console_active(void);
|
||||
void vuart_console_tx_chars(struct acrn_vuart *vu);
|
||||
void vuart_console_rx_chars(struct acrn_vuart *vu);
|
||||
|
||||
bool hv_used_dbg_intx(uint8_t intx_pin);
|
||||
#endif /* VUART_H */
|
||||
|
@ -15,3 +15,8 @@ struct acrn_vuart *vuart_console_active(void)
|
||||
|
||||
void vuart_console_tx_chars(__unused struct acrn_vuart *vu) {}
|
||||
void vuart_console_rx_chars(__unused struct acrn_vuart *vu) {}
|
||||
|
||||
bool hv_used_dbg_intx(__unused uint8_t intx_pin)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user