| 
    Monado OpenXR Runtime
    
   | 
 
Generic typedef for platform-specific shared memory handle. More...
#include </builds/monado/monado/src/xrt/ipc/shared/ipc_shmem.h>
Public Member Functions | |
| xrt_result_t | ipc_shmem_create (size_t size, xrt_shmem_handle_t *out_handle, void **out_map) | 
| Create and map a shared memory region.  More... | |
| xrt_result_t | ipc_shmem_map (xrt_shmem_handle_t handle, size_t size, void **out_map) | 
| Map a shared memory region.  More... | |
| void | ipc_shmem_unmap (void **map_ptr, size_t size) | 
| Unmap a shared memory region.  More... | |
| void | ipc_shmem_destroy (xrt_shmem_handle_t *handle_ptr, void **map_ptr, size_t size) | 
| Destroy a handle to a shared memory region.  More... | |
Static Public Member Functions | |
| static bool | xrt_shmem_is_valid (xrt_shmem_handle_t handle) | 
| Check whether a shared memory handle is valid.  More... | |
Related Functions | |
(Note that these are not member functions.)  | |
| #define | XRT_SHMEM_HANDLE_IS_FD 1 | 
| Defined to allow detection of the underlying type.  More... | |
| #define | XRT_SHMEM_HANDLE_INVALID (-1) | 
| An invalid value for a shared memory block.  More... | |
Generic typedef for platform-specific shared memory handle.
| xrt_result_t ipc_shmem_create | ( | size_t | size, | 
| xrt_shmem_handle_t * | out_handle, | ||
| void ** | out_map | ||
| ) | 
Create and map a shared memory region.
| [in] | size | Desired size of region | 
| [in,out] | out_handle | Pointer to the handle to populate. Receives the handle if this succeeds, or the invalid value if it fails. | 
| [in,out] | out_map | Pointer to the pointer to populate with the mapping of this shared memory region. On failure, contents are undefined. | 
| void ipc_shmem_destroy | ( | xrt_shmem_handle_t * | handle_ptr, | 
| void ** | map_ptr, | ||
| size_t | size | ||
| ) | 
Destroy a handle to a shared memory region.
This probably does not destroy the underlying region, if other references to it (in this process or others) are still open.
| [in,out] | handle_ptr | Pointer to the handle to destroy - will be checked for validity, destroyed, and cleared. | 
| [in,out] | map_ptr | Pointer to the mapped memory to unmap - will be checked for validity, destroyed, and cleared. It's necessary unmap the region to destroy the shmem. | 
| [in] | size | Size of the mapped region. | 
References ipc_shmem_unmap().
| xrt_result_t ipc_shmem_map | ( | xrt_shmem_handle_t | handle, | 
| size_t | size, | ||
| void ** | out_map | ||
| ) | 
Map a shared memory region.
| [in] | handle | Handle for region | 
| [in] | size | Size of region | 
| [in,out] | out_map | Pointer to the pointer to populate with the mapping of this shared memory region. | 
References XRT_ERROR_IPC_FAILURE, and XRT_SUCCESS.
| void ipc_shmem_unmap | ( | void ** | map_ptr, | 
| size_t | size | ||
| ) | 
Unmap a shared memory region.
| [in] | map_ptr | pointer to region | 
| [in] | size | Size of region | 
Referenced by ipc_shmem_destroy().
      
  | 
  inlinestatic | 
Check whether a shared memory handle is valid.
      
  | 
  related | 
An invalid value for a shared memory block.
Note that there may be more than one value that's invalid - use xrt_shmem_is_valid instead of comparing against this!
Referenced by ipc_client_connection_fini().
      
  | 
  related | 
Defined to allow detection of the underlying type.