Skip to content

Commit

Permalink
pci_ivshmem.c: ivshmem_support_irq API support
Browse files Browse the repository at this point in the history
ivshmem based driver can use this api to judge weather current
ivshmem device support irq or not, and use polling mode or irq
mode to process the event.

Signed-off-by: wangyongrong <[email protected]>
  • Loading branch information
wyr-7 authored and xiaoxiang781216 committed Oct 12, 2024
1 parent 99b6c77 commit ad2e6fb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/pci/pci_ivshmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,19 @@ int ivshmem_control_irq(FAR struct ivshmem_device_s *dev, bool on)
return OK;
}

/****************************************************************************
* Name: ivshmem_support_irq
*
* Description:
* Judge if support ivshmem interrupt
*
****************************************************************************/

bool ivshmem_support_irq(FAR struct ivshmem_device_s *dev)
{
return dev->vmid != IVSHMEM_INVALID_VMID;
}

/****************************************************************************
* Name: ivshmem_kick_peer
*
Expand Down
10 changes: 10 additions & 0 deletions include/nuttx/pci/pci_ivshmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ int ivshmem_detach_irq(FAR struct ivshmem_device_s *dev);

int ivshmem_control_irq(FAR struct ivshmem_device_s *dev, bool on);

/****************************************************************************
* Name: ivshmem_support_irq
*
* Description:
* judge if support ivshmem interrupt
*
****************************************************************************/

bool ivshmem_support_irq(FAR struct ivshmem_device_s *dev);

/****************************************************************************
* Name: ivshmem_kick_peer
*
Expand Down

0 comments on commit ad2e6fb

Please sign in to comment.