diff options
author | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2011-09-23 21:12:51 +0200 |
---|---|---|
committer | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2011-09-23 21:12:51 +0200 |
commit | 1ad9971d8a87721b8a6a98198e31b3b54d1be7ce (patch) | |
tree | f8c36b6f81e952086e080e692c57ecd5a38631ed /include/dlt/dlt_shm.h | |
parent | 0eaf6ec6b762018db31f7626bbc6e2cdfc374c5c (diff) | |
download | DLT-daemon-1ad9971d8a87721b8a6a98198e31b3b54d1be7ce.tar.gz |
Merged version for SHM now works.
Diffstat (limited to 'include/dlt/dlt_shm.h')
-rw-r--r-- | include/dlt/dlt_shm.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/dlt/dlt_shm.h b/include/dlt/dlt_shm.h new file mode 100644 index 0000000..9727f4b --- /dev/null +++ b/include/dlt/dlt_shm.h @@ -0,0 +1,28 @@ + +#define DLT_SHM_KEY 10002 +#define DLT_SHM_SIZE (1024*4000) +#define DLT_SHM_SEM 20013 + +typedef struct +{ + int shmid; // Id of shared memory + int semid; // Id of semaphore + char* shm; // pointer to beginning of shared memory + int size; // size of data areay in shared memory + char* mem; // pointer to data area in shared memory +} DltShm; + +#define DLT_SHM_SEM_GET(id) dlt_shm_pv(id,-1) +#define DLT_SHM_SEM_FREE(id) dlt_shm_pv(id,1) + +extern int dlt_shm_init_client(DltShm *buf,int key,int size); +extern int dlt_shm_init_server(DltShm *buf,int key,int size); + +extern int dlt_shm_push(DltShm *buf,const char *data1, int size1,const char *data2, int size2,const char *data3, int size3); +extern int dlt_shm_pull(DltShm *buf,char *data, int size); + +extern void dlt_shm_info(DltShm *buf); +extern void dlt_shm_status(DltShm *buf); + +extern int dlt_shm_free_client(DltShm *buf); +extern int dlt_shm_free_server(DltShm *buf); |