summaryrefslogtreecommitdiff
path: root/schulung_tools/ipc_shm/shm.h
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2017-12-19 10:59:40 +0100
committerJohn Ogness <john.ogness@linutronix.de>2017-12-19 10:59:40 +0100
commit270520b4a2eac8725c8575c3180964289722e191 (patch)
treed9512cd96d0c52e14293c3f8bc19fd168ee14025 /schulung_tools/ipc_shm/shm.h
parent27209bb802048f4803d9cd9a5c2f99d613986446 (diff)
schulung_tools: add various demos and tools
Different tools have been used by various trainers as demos. Put all these into master so they are available to all trainers. ipc_pipe: ipc demo using pipes ipc_shm: ipc demo using shared memory libduma: source and instructions for compiling libduma matrix: demo of good and bad cache access mtrace: patch and infos for using mtrace with ASLR rtex: demo of handling page faults Signed-off-by: John Ogness <john.ogness@linutronix.de>
Diffstat (limited to 'schulung_tools/ipc_shm/shm.h')
-rw-r--r--schulung_tools/ipc_shm/shm.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/schulung_tools/ipc_shm/shm.h b/schulung_tools/ipc_shm/shm.h
new file mode 100644
index 0000000..35acd0a
--- /dev/null
+++ b/schulung_tools/ipc_shm/shm.h
@@ -0,0 +1,17 @@
+#ifndef _SHM_H
+#define _SHM_H
+
+#include <pthread.h>
+
+struct share_data {
+ pthread_mutex_t m;
+ pthread_cond_t c;
+ char msg[2048];
+};
+
+extern int create_share(void);
+extern void init_share(struct share_data *data);
+extern struct share_data *get_share(void);
+extern void remove_share(void);
+
+#endif /* _SHM_H */