1 /****************************************************************
\r
2 * Header for the main function
\r
3 * Creator: lschor, 2008-11-21
\r
4 * Description: Header file for the main function of the PPU
\r
7 * - 2008-11-21: Created
\r
10 #ifndef __PPU_MAIN_H__
\r
11 #define __PPU_MAIN_H__
\r
20 #include <libspe2.h>
\r
21 #include <pthread.h>
\r
22 #include <sys/time.h>
\r
25 #include "lib/malloc_align.h"
\r
26 #include "lib/free_align.h"
\r
28 #include "lib/estimation.h"
\r
29 #include "common_ppu.h"
\r
30 #include "cbe_mfc.h"
\r
32 // Handler for the SPE
\r
33 extern spe_program_handle_t spu;
\r
35 // Program context for the SPEs
\r
36 volatile parm_context ctx[NUM_SPES] __attribute__ ((aligned(16)));
\r
38 // The SPE-program-handler
\r
39 spe_program_handle_t *program[NUM_SPES];
\r
41 // data structure for running SPE thread
\r
42 typedef struct spu_data {
\r
43 spe_context_ptr_t spe_ctx;
\r
48 // Data for the SPEs
\r
49 spu_data_t data[NUM_SPES];
\r
51 // Struct which stores a fifo entry temporary
\r
58 // Two temporary store elements
\r
59 struct fifoEntry tmpFifoEntryRead[NUM_SPES];
\r
60 struct fifoEntry tmpFifoEntryWrite[NUM_SPES];
\r
62 // Initialize the fifo, we use
\r
63 const int MAXELEMENT = 262144;
\r
64 char *locBuf[NUM_FIFO];
\r
65 int locBufCount[NUM_FIFO];
\r
66 int locBufStart[NUM_FIFO];
\r
68 // Mutex-variables for the read/write process of the Queues
\r
69 pthread_mutex_t mutex [NUM_FIFO];
\r
70 pthread_mutex_t mutexProcessNr = PTHREAD_MUTEX_INITIALIZER;
\r
72 // Number of process that have been finished
\r
73 int processFinished = 0;
\r