X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fvisitor%2Fcbe%2Flib%2Fcommon.h;fp=dol%2Fsrc%2Fdol%2Fvisitor%2Fcbe%2Flib%2Fcommon.h;h=9370673b0ca55931a5d53bb1bacf44e1ccdbc3a8;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/visitor/cbe/lib/common.h b/dol/src/dol/visitor/cbe/lib/common.h new file mode 100644 index 0000000..9370673 --- /dev/null +++ b/dol/src/dol/visitor/cbe/lib/common.h @@ -0,0 +1,59 @@ +/**************************************************************** + * COMMON.H + * Creator: lschor, 2008-10-30 + * Description: Specifies some structs and Constants for the CBE-DOL-Implementation + * + * Revision: + * - 2008-10-30: Created + */ + +#ifndef _COMMON_H_ +#define _COMMON_H_ + +#include "dol.h" +#include "lib/constant.h" + +#define SPE_WRITE_DEMAND 0 +#define SPE_READ_DEMAND 1 +#define SPE_WRITE_SUC 2 +#define SPE_READ_SUC 3 +#define SPE_DETACH 4 + +// the context that PPE forward to SPE +typedef struct{ + uint64_t port_id; + uint64_t port_queue_id; + + uint64_t processName; // Address for the name of the process + uint64_t processNameLen; // Len of the process Name + + uint32_t number_of_ports; + uint32_t is_detached; + uint32_t padd[2]; // dummy - for alignment --> It always has to be a multiple of 128 bit! +} parm_context; // aligned to 16B + +typedef struct{ + uint32_t d; + uint32_t padd[31]; //padd to cache line +} status_s; + + +// Round a number ot the right DMA number --> Is used for DMA transfers +uint32_t roundDMA(uint32_t number) +{ + if (number > 16) + return number + 16 - (number % 16); + else if (number > 8) + return 16; + else if (number > 4) + return 8; + else if (number > 2) + return 4; + else if (number > 1) + return 2; + else + return 1; +} + +#endif // _COMMON_H_ +