XenevaOS
Loading...
Searching...
No Matches
shm.h
Go to the documentation of this file.
1
30#ifndef __SHM_H__
31#define __SHM_H__
32
33#include <stdint.h>
34#include <process.h>
35
36#define USER_SHARED_MEM_START 0x0000000080000000
37
38//#pragma pack(push,1)
39/*
40 * AuSHM -- shared memory segment
41 */
49//#pragma pack(pop)
50
51//#pragma pack(push,1)
57//#pragma pack(pop)
58
62extern void AuInitialiseSHMMan();
63
64/*
65* AuGetSHMSeg -- searches and return a
66* shm segment by its key
67* @param key -- key to search
68*/
69extern AuSHM * AuGetSHMByID(uint16_t id);
70
80extern int AuCreateSHM(AuProcess* proc, uint16_t key, size_t sz, uint8_t flags);
81
91extern void* AuSHMObtainMem(AuProcess* proc, uint16_t id, void* shmaddr, int shmflg);
92
98extern void AuSHMUnmap(uint16_t key, AuProcess* proc);
99
106extern void AuSHMUnmapAll(AuProcess* proc);
107
108#endif
unsigned char uint8_t
Definition acefiex.h:161
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
unsigned short int uint16_t
Definition acefiex.h:162
void AuInitialiseSHMMan()
AuInitialiseSHMMan – initialise shm manager.
Definition shm.cpp:49
struct _shm_ AuSHM
void * AuSHMObtainMem(AuProcess *proc, uint16_t id, void *shmaddr, int shmflg)
AuSHMObtainMem – obtains a virtual memory from given shm segment.
Definition shm.cpp:216
struct _shm_mapping_ AuSHMMappings
void AuSHMUnmap(uint16_t key, AuProcess *proc)
AuSHMUnmap – unmaps a shared memory segment.
Definition shm.cpp:332
int AuCreateSHM(AuProcess *proc, uint16_t key, size_t sz, uint8_t flags)
AuCreateSHM – create a new shared memory segment or returns previously allocated one.
Definition shm.cpp:102
AuSHM * AuGetSHMByID(uint16_t id)
AuGetSHMSeg – searches and return a shm segment by its key.
Definition shm.cpp:85
void AuSHMUnmapAll(AuProcess *proc)
AuSHMUnmapAll – unmaps all mappings for this process.
Definition shm.cpp:374
Definition process.h:94
Definition shm.h:42
uint16_t link_count
Definition shm.h:47
uint64_t num_frames
Definition shm.h:45
uint16_t key
Definition shm.h:43
uint64_t * frames
Definition shm.h:46
uint16_t id
Definition shm.h:44
Definition shm.h:52
uint64_t start_addr
Definition shm.h:53
size_t length
Definition shm.h:54
AuSHM * shm
Definition shm.h:55