2 Aesalon, a tool to visualize a program's behaviour at run-time.
3 Copyright (C) 2010, Aesalon Development Team.
5 Aesalon is distributed under the terms of the GNU GPLv3. For more
6 licensing information, see the file LICENSE included with the distribution.
8 @file include/shm/SharedMemoryHeader.h
12 #ifndef AesalonSHM_SharedMemoryHeader_H
13 #define AesalonSHM_SharedMemoryHeader_H
16 #include <semaphore.h>
18 typedef struct SharedMemoryHeader_t SharedMemoryHeader_t
;
19 struct SharedMemoryHeader_t
{
20 /** Overall size of SHM in pages. */
23 /** The size of the configuration data (in pages). */
24 uint32_t configDataSize
;
26 /** The number of pages to use to store zone usage data in. */
27 uint32_t zoneUsagePages
;
29 /** The page offset that zones are created starting at. */
30 uint32_t zonePageOffset
;
32 /** The size of a zone, in pages. */
35 /** The number of zones currently in use. */
38 /** The number of zones that memory has been allocated for. */
39 uint32_t zonesAllocated
;
41 /** Packet semaphore: incremented when a packet is available for reading. */
42 sem_t packetSemaphore
;
44 /** Resizing semaphore; locked when a thread is resizing the SHM. */
45 sem_t resizeSemaphore
;
47 /** The last process ID; used to assign 4-byte thread IDs dynamically.
49 uint32_t lastProcessID
;
51 /** The last thread ID; used to assign 4-byte thread IDs dynamically.
53 uint32_t lastThreadID
;