dol: initial epiphany code generator (untested)
[jump.git] / dol / src / dol / visitor / epiphany / template / shared.h
diff --git a/dol/src/dol/visitor/epiphany/template/shared.h b/dol/src/dol/visitor/epiphany/template/shared.h
new file mode 100644 (file)
index 0000000..467b09f
--- /dev/null
@@ -0,0 +1,33 @@
+/* shared.h
+ * NOTE: shared between Host and Epiphany */
+#ifndef _SHARED_H_
+#define _SHARED_H_
+
+#ifndef PACKED
+#define PACKED __attribute__((packed))
+#endif
+
+#include <stdint.h>
+
+#define NUM_CORES      16
+#define CORES_PER_ROW  4
+
+typedef struct {
+       volatile uint32_t rp;
+       volatile uint32_t wp;
+       volatile uint32_t size;
+       char     buf[];
+} PACKED hwbuf_t;
+@@SHM_BUF_STRUCTS@@
+typedef struct {
+       uint32_t counters[2];
+} PACKED coredata_t;
+
+typedef struct {
+       int32_t    states[NUM_CORES];
+       coredata_t cores[NUM_CORES];
+       buf0_t     buf0;
+       buf1_t     buf1;
+} PACKED shm_t;
+
+#endif /* _SHARED_H_ */