Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 068a9a83 authored by Elliot Berman's avatar Elliot Berman
Browse files

haven: rm: Allow IRQ lender to learn about the IRQ handle



An IRQ lender driver will likely ought to need to use the IRQ handle to
reclaim the interrupt when the lendee is done with the interrupt.

Change-Id: I0b791ecfb7b169d5cf2677d324e9aceea51feb5d
Signed-off-by: default avatarElliot Berman <eberman@codeaurora.org>
parent 205f53fb
Loading
Loading
Loading
Loading
+10 −4
Original line number Original line Diff line number Diff line
@@ -314,21 +314,27 @@ static int hh_rm_vm_irq_notify(const hh_vmid_t *vmids, unsigned int num_vmids,
 * @vmid: VM to lend interrupt to
 * @vmid: VM to lend interrupt to
 * @virq: Virtual IRQ number to lend
 * @virq: Virtual IRQ number to lend
 * @label: Label to give to VM so it may know how to associate the interrupt
 * @label: Label to give to VM so it may know how to associate the interrupt
 * @virq_handle: vIRQ handle generated by hypervisor to reperesent the interrupt
 *               which can be used later to know when the interrupt has been
 *               released
 *
 *
 * This function performs interrupt sharing flow for "HLOS" described in
 * This function performs interrupt sharing flow for "HLOS" described in
 * Resource Manager High Level Design Sec. 3.3.3.
 * Resource Manager High Level Design Sec. 3.3.3.
 */
 */
int hh_rm_vm_irq_lend_notify(hh_vmid_t vmid, int virq, int label)
int hh_rm_vm_irq_lend_notify(hh_vmid_t vmid, int virq, int label,
			     hh_virq_handle_t *virq_handle)
{
{
	hh_virq_handle_t virq_handle;
	int ret;
	int ret;


	ret = hh_rm_vm_irq_lend(vmid, virq, label, &virq_handle);
	if (!virq_handle)
		return -EINVAL;

	ret = hh_rm_vm_irq_lend(vmid, virq, label, virq_handle);
	if (ret)
	if (ret)
		return ret;
		return ret;


	return hh_rm_vm_irq_notify(&vmid, 1, HH_VM_IRQ_NOTIFY_FLAGS_LENT,
	return hh_rm_vm_irq_notify(&vmid, 1, HH_VM_IRQ_NOTIFY_FLAGS_LENT,
				   virq_handle);
				   *virq_handle);
}
}


/**
/**
+2 −1
Original line number Original line Diff line number Diff line
@@ -179,7 +179,8 @@ int hh_rm_unregister_notifier(struct notifier_block *nb);


/* Client APIs for IRQ management */
/* Client APIs for IRQ management */
int hh_rm_vm_irq_accept(hh_virq_handle_t virq_handle, int virq);
int hh_rm_vm_irq_accept(hh_virq_handle_t virq_handle, int virq);
int hh_rm_vm_irq_lend_notify(hh_vmid_t vmid, int virq, int label);
int hh_rm_vm_irq_lend_notify(hh_vmid_t vmid, int virq, int label,
			     hh_virq_handle_t *virq_handle);


/* Client APIs for VM management */
/* Client APIs for VM management */
int hh_rm_vm_alloc_vmid(enum hh_vm_names vm_name);
int hh_rm_vm_alloc_vmid(enum hh_vm_names vm_name);