dol: initial dol commit
[jump.git] / dol / src / dol / visitor / cbe / lib / ppu_main.h
diff --git a/dol/src/dol/visitor/cbe/lib/ppu_main.h b/dol/src/dol/visitor/cbe/lib/ppu_main.h
new file mode 100644 (file)
index 0000000..5fd2a26
--- /dev/null
@@ -0,0 +1,76 @@
+/**************************************************************** \r
+ *     Header for the main function\r
+ *     Creator: lschor, 2008-11-21\r
+ *     Description: Header file for the main function of the PPU\r
+ *     \r
+ *     Revision: \r
+ *     - 2008-11-21: Created\r
+ */\r
+\r
+#ifndef __PPU_MAIN_H__\r
+#define __PPU_MAIN_H__\r
+\r
+// System includes\r
+#include <stdio.h>\r
+#include <stddef.h>\r
+#include <stdint.h>\r
+#include <string.h>\r
+#include <ctype.h>\r
+#include <stdlib.h>\r
+#include <libspe2.h>\r
+#include <pthread.h>\r
+#include <sys/time.h>\r
+\r
+// Local includes\r
+#include "lib/malloc_align.h"\r
+#include "lib/free_align.h"\r
+#include "common.h"\r
+#include "lib/estimation.h"\r
+#include "common_ppu.h"\r
+#include "cbe_mfc.h"\r
+\r
+// Handler for the SPE\r
+extern spe_program_handle_t spu;\r
+\r
+// Program context for the SPEs\r
+volatile parm_context ctx[NUM_SPES] __attribute__ ((aligned(16)));\r
+\r
+// The SPE-program-handler\r
+spe_program_handle_t *program[NUM_SPES];\r
+\r
+// data structure for running SPE thread \r
+typedef struct spu_data {\r
+       spe_context_ptr_t spe_ctx;\r
+       pthread_t pthread;\r
+       void *argp;\r
+} spu_data_t;\r
+\r
+// Data for the SPEs\r
+spu_data_t data[NUM_SPES];\r
+\r
+// Struct which stores a fifo entry temporary\r
+struct fifoEntry {\r
+       uint64_t ea; \r
+       int length;\r
+       int queue;\r
+};\r
+\r
+// Two temporary store elements\r
+struct fifoEntry tmpFifoEntryRead[NUM_SPES]; \r
+struct fifoEntry tmpFifoEntryWrite[NUM_SPES]; \r
+\r
+// Initialize the fifo, we use\r
+const int MAXELEMENT = 262144;\r
+char *locBuf[NUM_FIFO];\r
+int locBufCount[NUM_FIFO]; \r
+int locBufStart[NUM_FIFO]; \r
+\r
+// Mutex-variables for the read/write process of the Queues\r
+pthread_mutex_t mutex [NUM_FIFO];\r
+pthread_mutex_t mutexProcessNr = PTHREAD_MUTEX_INITIALIZER;\r
+\r
+// Number of process that have been finished\r
+int processFinished = 0; \r
+\r
+\r
+#endif\r