Commit | Line | Data |
---|---|---|
1d498196 | 1 | /* |
c0c0989a | 2 | * SPDX-License-Identifier: LGPL-2.1-only |
1d498196 | 3 | * |
e92f3e28 | 4 | * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
1d498196 MD |
5 | */ |
6 | ||
c0c0989a MJ |
7 | #ifndef _LIBRINGBUFFER_SHM_TYPES_H |
8 | #define _LIBRINGBUFFER_SHM_TYPES_H | |
9 | ||
1d498196 | 10 | #include <stdint.h> |
b4051ad8 | 11 | #include <stddef.h> |
a9ff648c | 12 | #include <limits.h> |
1d498196 MD |
13 | #include "shm_internal.h" |
14 | ||
5198080d | 15 | struct lttng_ust_lib_ring_buffer_channel; |
1d498196 | 16 | |
74d81a6c MD |
17 | enum shm_object_type { |
18 | SHM_OBJECT_SHM, | |
19 | SHM_OBJECT_MEM, | |
20 | }; | |
21 | ||
1d498196 | 22 | struct shm_object { |
74d81a6c | 23 | enum shm_object_type type; |
1d498196 MD |
24 | size_t index; /* within the object table */ |
25 | int shm_fd; /* shm fd */ | |
26 | int wait_fd[2]; /* fd for wait/wakeup */ | |
27 | char *memory_map; | |
0cdad3b1 MD |
28 | size_t memory_map_size; |
29 | uint64_t allocated_len; | |
5ea386c3 | 30 | int shm_fd_ownership; |
1d498196 MD |
31 | }; |
32 | ||
33 | struct shm_object_table { | |
34 | size_t size; | |
35 | size_t allocated_len; | |
36 | struct shm_object objects[]; | |
37 | }; | |
38 | ||
38fae1d3 | 39 | struct lttng_ust_shm_handle { |
1d498196 | 40 | struct shm_object_table *table; |
5198080d | 41 | DECLARE_SHMP(struct lttng_ust_lib_ring_buffer_channel, chan); |
1d498196 MD |
42 | }; |
43 | ||
44 | #endif /* _LIBRINGBUFFER_SHM_TYPES_H */ |