|
Packit |
c04fcb |
#ifndef _LIBRINGBUFFER_SHM_TYPES_H
|
|
Packit |
c04fcb |
#define _LIBRINGBUFFER_SHM_TYPES_H
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
/*
|
|
Packit |
c04fcb |
* libringbuffer/shm_types.h
|
|
Packit |
c04fcb |
*
|
|
Packit |
c04fcb |
* Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
|
Packit |
c04fcb |
*
|
|
Packit |
c04fcb |
* This library is free software; you can redistribute it and/or
|
|
Packit |
c04fcb |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit |
c04fcb |
* License as published by the Free Software Foundation; only
|
|
Packit |
c04fcb |
* version 2.1 of the License.
|
|
Packit |
c04fcb |
*
|
|
Packit |
c04fcb |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
c04fcb |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
c04fcb |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
c04fcb |
* Lesser General Public License for more details.
|
|
Packit |
c04fcb |
*
|
|
Packit |
c04fcb |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit |
c04fcb |
* License along with this library; if not, write to the Free Software
|
|
Packit |
c04fcb |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
Packit |
c04fcb |
*/
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
#include <stdint.h>
|
|
Packit |
c04fcb |
#include <limits.h>
|
|
Packit |
c04fcb |
#include "shm_internal.h"
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
struct channel;
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
enum shm_object_type {
|
|
Packit |
c04fcb |
SHM_OBJECT_SHM,
|
|
Packit |
c04fcb |
SHM_OBJECT_MEM,
|
|
Packit |
c04fcb |
};
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
struct shm_object {
|
|
Packit |
c04fcb |
enum shm_object_type type;
|
|
Packit |
c04fcb |
size_t index; /* within the object table */
|
|
Packit |
c04fcb |
int shm_fd; /* shm fd */
|
|
Packit |
c04fcb |
int wait_fd[2]; /* fd for wait/wakeup */
|
|
Packit |
c04fcb |
char *memory_map;
|
|
Packit |
c04fcb |
size_t memory_map_size;
|
|
Packit |
c04fcb |
uint64_t allocated_len;
|
|
Packit |
c04fcb |
int shm_fd_ownership;
|
|
Packit |
c04fcb |
};
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
struct shm_object_table {
|
|
Packit |
c04fcb |
size_t size;
|
|
Packit |
c04fcb |
size_t allocated_len;
|
|
Packit |
c04fcb |
struct shm_object objects[];
|
|
Packit |
c04fcb |
};
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
struct lttng_ust_shm_handle {
|
|
Packit |
c04fcb |
struct shm_object_table *table;
|
|
Packit |
c04fcb |
DECLARE_SHMP(struct channel, chan);
|
|
Packit |
c04fcb |
};
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
#endif /* _LIBRINGBUFFER_SHM_TYPES_H */
|