Started experimenting with perl/python scripts to auto rename incl guards etc.
[aesalon.git] / include / shm / SharedMemoryHeader.h
blobb1782b56973d4f28e6f07116c2e64fc77f0b8624
1 /**
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
15 #include <stdint.h>
16 #include <semaphore.h>
18 typedef struct SharedMemoryHeader_t SharedMemoryHeader_t;
19 struct SharedMemoryHeader_t {
20 /** Overall size of SHM in pages. */
21 uint32_t shmSize;
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. */
33 uint32_t zoneSize;
35 /** The number of zones currently in use. */
36 uint32_t zoneCount;
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;
56 #endif