hil: add API to enable vdev IPI
authorWendy Liang <jliang@xilinx.com>
Wed, 25 Jan 2017 23:33:53 +0000 (15:33 -0800)
committerWendy Liang <jliang@xilinx.com>
Mon, 6 Feb 2017 19:31:33 +0000 (11:31 -0800)
Implement hil_set_vdev_notification to enable vdev IPI.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
lib/common/hil.c
lib/include/openamp/hil.h

index 5a09cea771b090b3535e08f4ae3d36227a993a91..f832d6b7aab82899d2b7f1171d8e033840fde293 100644 (file)
@@ -310,6 +310,17 @@ void hil_free_vqs(struct virtio_device *vdev)
        metal_mutex_release(&proc->lock);
 }
 
+int hil_enable_vdev_notification(struct hil_proc *proc, int id)
+{
+       /* We only support single vdev in hil_proc */
+       (void)id;
+       if (!proc)
+               return -1;
+       if (proc->ops->enable_interrupt)
+               proc->ops->enable_interrupt(&proc->vdev.intr_info);
+       return 0;
+}
+
 /**
  * hil_enable_vring_notifications()
  *
index afea963c7eb87ec7ff97747be19c23e9f68f85cd..35edf213afeba468c8c9d0dfc7e0f870d2be27fa 100644 (file)
@@ -312,6 +312,18 @@ struct proc_shm *hil_get_shm_info(struct hil_proc *proc);
  */
 void hil_free_vqs(struct virtio_device *vdev);
 
+/**
+ * hil_enable_vdev_notification()
+ *
+ * This function enable handler for vdev notification.
+ *
+ * @param proc - pointer to hil_proc
+ * @param id   - vdev index
+ *
+ * @return - execution status
+ */
+int hil_enable_vdev_notification(struct hil_proc *proc, int id);
+
 /**
  * hil_enable_vring_notifications()
  *