Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
ivshmem reference API

ivshmem reference API More...

Data Structures

struct  ivshmem_driver_api
 

Typedefs

typedef size_t(* ivshmem_get_mem_f) (const struct device *dev, uintptr_t *memmap)
 
typedef uint32_t(* ivshmem_get_id_f) (const struct device *dev)
 
typedef uint16_t(* ivshmem_get_vectors_f) (const struct device *dev)
 
typedef int(* ivshmem_int_peer_f) (const struct device *dev, uint32_t peer_id, uint16_t vector)
 
typedef int(* ivshmem_register_handler_f) (const struct device *dev, struct k_poll_signal *signal, uint16_t vector)
 

Functions

size_t ivshmem_get_mem (const struct device *dev, uintptr_t *memmap)
 Get the inter-VM shared memory. More...
 
uint32_t ivshmem_get_id (const struct device *dev)
 Get our VM ID. More...
 
uint16_t ivshmem_get_vectors (const struct device *dev)
 Get the number of interrupt vectors we can use. More...
 
int ivshmem_int_peer (const struct device *dev, uint32_t peer_id, uint16_t vector)
 Interrupt another VM. More...
 
int ivshmem_register_handler (const struct device *dev, struct k_poll_signal *signal, uint16_t vector)
 Register a vector notification (interrupt) handler. More...
 

Detailed Description

ivshmem reference API

Typedef Documentation

◆ ivshmem_get_id_f

typedef uint32_t(* ivshmem_get_id_f) (const struct device *dev)

◆ ivshmem_get_mem_f

typedef size_t(* ivshmem_get_mem_f) (const struct device *dev, uintptr_t *memmap)

◆ ivshmem_get_vectors_f

typedef uint16_t(* ivshmem_get_vectors_f) (const struct device *dev)

◆ ivshmem_int_peer_f

typedef int(* ivshmem_int_peer_f) (const struct device *dev, uint32_t peer_id, uint16_t vector)

◆ ivshmem_register_handler_f

typedef int(* ivshmem_register_handler_f) (const struct device *dev, struct k_poll_signal *signal, uint16_t vector)

Function Documentation

◆ ivshmem_get_id()

uint32_t ivshmem_get_id ( const struct device dev)

#include <include/drivers/virtualization/ivshmem.h>

Get our VM ID.

Parameters
devPointer to the device structure for the driver instance
Returns
our VM ID or 0 if we are not running on doorbell version

◆ ivshmem_get_mem()

size_t ivshmem_get_mem ( const struct device dev,
uintptr_t memmap 
)

#include <include/drivers/virtualization/ivshmem.h>

Get the inter-VM shared memory.

Parameters
devPointer to the device structure for the driver instance
memmapA pointer to fill in with the memory address
Returns
the size of the memory mapped, or 0

◆ ivshmem_get_vectors()

uint16_t ivshmem_get_vectors ( const struct device dev)

#include <include/drivers/virtualization/ivshmem.h>

Get the number of interrupt vectors we can use.

Parameters
devPointer to the device structure for the driver instance
Returns
the number of available interrupt vectors

◆ ivshmem_int_peer()

int ivshmem_int_peer ( const struct device dev,
uint32_t  peer_id,
uint16_t  vector 
)

#include <include/drivers/virtualization/ivshmem.h>

Interrupt another VM.

Parameters
devPointer to the device structure for the driver instance
peer_idThe VM ID to interrupt
vectorThe interrupt vector to use
Returns
0 on success, a negative errno otherwise

◆ ivshmem_register_handler()

int ivshmem_register_handler ( const struct device dev,
struct k_poll_signal signal,
uint16_t  vector 
)

#include <include/drivers/virtualization/ivshmem.h>

Register a vector notification (interrupt) handler.

Parameters
devPointer to the device structure for the driver instance
signalA pointer to a valid and ready to be signaled struct k_poll_signal. Or NULL to unregister any handler registered for the given vector.
vectorThe interrupt vector to get notification from

Note: The returned status, if positive, to a raised signal is the vector that generated the signal. This lets the possibility to the user to have one signal for all vectors, or one per-vector.

Returns
0 on success, a negative errno otherwise