X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fvisitor%2Fcbe%2Flib%2Fppu_main.h;fp=dol%2Fsrc%2Fdol%2Fvisitor%2Fcbe%2Flib%2Fppu_main.h;h=5fd2a262e389c38a1e620d772183ff3d7073eada;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git 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 index 0000000..5fd2a26 --- /dev/null +++ b/dol/src/dol/visitor/cbe/lib/ppu_main.h @@ -0,0 +1,76 @@ +/**************************************************************** + * Header for the main function + * Creator: lschor, 2008-11-21 + * Description: Header file for the main function of the PPU + * + * Revision: + * - 2008-11-21: Created + */ + +#ifndef __PPU_MAIN_H__ +#define __PPU_MAIN_H__ + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Local includes +#include "lib/malloc_align.h" +#include "lib/free_align.h" +#include "common.h" +#include "lib/estimation.h" +#include "common_ppu.h" +#include "cbe_mfc.h" + +// Handler for the SPE +extern spe_program_handle_t spu; + +// Program context for the SPEs +volatile parm_context ctx[NUM_SPES] __attribute__ ((aligned(16))); + +// The SPE-program-handler +spe_program_handle_t *program[NUM_SPES]; + +// data structure for running SPE thread +typedef struct spu_data { + spe_context_ptr_t spe_ctx; + pthread_t pthread; + void *argp; +} spu_data_t; + +// Data for the SPEs +spu_data_t data[NUM_SPES]; + +// Struct which stores a fifo entry temporary +struct fifoEntry { + uint64_t ea; + int length; + int queue; +}; + +// Two temporary store elements +struct fifoEntry tmpFifoEntryRead[NUM_SPES]; +struct fifoEntry tmpFifoEntryWrite[NUM_SPES]; + +// Initialize the fifo, we use +const int MAXELEMENT = 262144; +char *locBuf[NUM_FIFO]; +int locBufCount[NUM_FIFO]; +int locBufStart[NUM_FIFO]; + +// Mutex-variables for the read/write process of the Queues +pthread_mutex_t mutex [NUM_FIFO]; +pthread_mutex_t mutexProcessNr = PTHREAD_MUTEX_INITIALIZER; + +// Number of process that have been finished +int processFinished = 0; + + +#endif