refactor: moved api_interrupt_clear_decrement to vcpu
Moved the function api_interrupt_clear_decrement to
the vcpu module, and simplified its signature, thus
creating vcpu_interrupt_clear_decrement.
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I757ee632e8dc478921d8f3945fbf3be8292fa137
diff --git a/src/api.c b/src/api.c
index d671b74..4c4e8fa 100644
--- a/src/api.c
+++ b/src/api.c
@@ -2344,14 +2344,6 @@
return ret;
}
-static void api_interrupt_clear_decrement(struct vcpu_locked locked_vcpu,
- struct interrupts *interrupts,
- uint32_t intid)
-{
- vcpu_virt_interrupt_clear_pending(interrupts, intid);
- vcpu_interrupt_count_decrement(locked_vcpu, interrupts, intid);
-}
-
/**
* Returns the ID of the next pending interrupt for the calling vCPU, and
* acknowledges it (i.e. marks it as no longer pending). Returns
@@ -2381,8 +2373,8 @@
/*
* Mark it as no longer pending and decrement the count.
*/
- api_interrupt_clear_decrement(
- current_locked, interrupts, first_interrupt);
+ vcpu_interrupt_clear_decrement(current_locked,
+ first_interrupt);
break;
}
}
@@ -3228,9 +3220,8 @@
if (vcpu_is_virt_interrupt_pending(interrupts,
HF_MANAGED_EXIT_INTID)) {
- api_interrupt_clear_decrement(current_locked,
- interrupts,
- HF_MANAGED_EXIT_INTID);
+ vcpu_interrupt_clear_decrement(current_locked,
+ HF_MANAGED_EXIT_INTID);
}
}