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/vcpu.c b/src/vcpu.c
index ec7f54f..9130ff1 100644
--- a/src/vcpu.c
+++ b/src/vcpu.c
@@ -259,6 +259,15 @@
vcpu->next_boot = current;
}
+void vcpu_interrupt_clear_decrement(struct vcpu_locked vcpu_locked,
+ uint32_t intid)
+{
+ struct interrupts *interrupts = &(vcpu_locked.vcpu->interrupts);
+
+ vcpu_virt_interrupt_clear_pending(interrupts, intid);
+ vcpu_interrupt_count_decrement(vcpu_locked, interrupts, intid);
+}
+
/**
* Sets the vcpu in the VCPU_STATE_RUNNING.
* With that, its register are set as "not available".