Monado OpenXR Runtime
ipc_client_connection.h
Go to the documentation of this file.
1// Copyright 2020-2023, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief More-internal client side code.
6 * @author Pete Black <pblack@collabora.com>
7 * @author Jakob Bornecrantz <jakob@collabora.com>
8 * @author Rylie Pavlik <rylie.pavlik@collabora.com>
9 * @ingroup ipc_client
10 */
11
12#pragma once
13
14#include "xrt/xrt_results.h"
15#include "ipc_client.h"
16
17
18/*!
19 * Set up the basics of the client connection: socket and shared mem
20 * @param ipc_c Empty IPC connection struct
21 * @param log_level Log level for IPC messages
22 * @param i_info Instance info to send to server
23 * @return XRT_SUCCESS on success
24 *
25 * @ingroup ipc_client
26 */
29 enum u_logging_level log_level,
30 const struct xrt_instance_info *i_info);
31
32/*!
33 * Locks the connection, allows sending complex messages.
34 *
35 * @param ipc_c The IPC connection to lock.
36 *
37 * @ingroup ipc_client
38 */
39static inline void
41{
42 os_mutex_lock(&ipc_c->mutex);
43}
44
45/*!
46 * Unlocks the connection.
47 *
48 * @param ipc_c A locked IPC connection to unlock.
49 *
50 * @ingroup ipc_client
51 */
52static inline void
54{
55 os_mutex_unlock(&ipc_c->mutex);
56}
57
58/*!
59 * Tear down the basics of the client connection: socket and shared mem
60 * @param ipc_c initialized IPC connection struct
61 *
62 * @ingroup ipc_client
63 */
64void
u_logging_level
Logging level enum.
Definition: u_logging.h:43
static void os_mutex_lock(struct os_mutex *om)
Lock.
Definition: os_threading.h:86
static void os_mutex_unlock(struct os_mutex *om)
Unlock.
Definition: os_threading.h:110
static void ipc_client_connection_lock(struct ipc_connection *ipc_c)
Locks the connection, allows sending complex messages.
Definition: ipc_client_connection.h:40
xrt_result_t ipc_client_connection_init(struct ipc_connection *ipc_c, enum u_logging_level log_level, const struct xrt_instance_info *i_info)
Set up the basics of the client connection: socket and shared mem.
Definition: ipc_client_connection.c:339
static void ipc_client_connection_unlock(struct ipc_connection *ipc_c)
Unlocks the connection.
Definition: ipc_client_connection.h:53
void ipc_client_connection_fini(struct ipc_connection *ipc_c)
Tear down the basics of the client connection: socket and shared mem.
Definition: ipc_client_connection.c:408
enum xrt_result xrt_result_t
Result type used across Monado.
Common client side code.
Connection.
Definition: ipc_client.h:156
Information provided by the application at instance create time.
Definition: xrt_instance.h:88
Internal result type for XRT.