aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/odp_fdserver_internal.h
blob: 8637b53be85136bb3a9a77bf339c0e9f20e87831 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright (c) 2016-2018 Linaro Limited
 */

#ifndef _FD_SERVER_INTERNAL_H
#define _FD_SERVER_INTERNAL_H

#ifdef __cplusplus
extern "C" {
#endif

/*
 * the following enum defines the different contexts by which the
 * FD server may be used: In the FD server, the keys used to store/retrieve
 * a file descriptor are actually context based:
 * Both the context and the key are stored at fd registration time,
 * and both the context and the key are used to retrieve a fd.
 * In other words a context identifies a FD server usage, so that different
 * unrelated fd server users do not have to guarantee key unicity between
 * them.
 */
typedef enum fd_server_context {
	FD_SRV_CTX_NA,  /* Not Applicable   */
	FD_SRV_CTX_ISHM,
	FD_SRV_CTX_END, /* upper enum limit */
} fd_server_context_e;

int _odp_fdserver_register_fd(fd_server_context_e context, uint64_t key,
			      int fd);
int _odp_fdserver_deregister_fd(fd_server_context_e context, uint64_t key);
int _odp_fdserver_lookup_fd(fd_server_context_e context, uint64_t key);

#ifdef __cplusplus
}
#endif

#endif