6 #define GET_STRIDE(x) ((x & 0x7000) >> 12)
7 #define GET_RANGE(x) (x & 0x0fff)
8 #define GET_STRIDEINC(x) ((x & 0x8000) >> 15)
9 #define GET_OID(x) ((int *) (x))
10 #define GET_NUM_OFFSETS(x) ((short *) (x + sizeof(unsigned int)))
11 #define GET_OFFSETS(x) ((short *) (x + sizeof(unsigned int) + sizeof(short)))
13 /****** Global structure **********/
14 typedef struct objOffsetPile {
18 struct objOffsetPile *next;
21 typedef struct perMcPrefetchList {
23 objOffsetPile_t *list;
24 struct perMcPrefetchList *next;
25 } perMcPrefetchList_t;
27 typedef struct proPrefetchQ {
28 perMcPrefetchList_t *front, *rear;
29 pthread_mutex_t qlock;
30 pthread_mutexattr_t qlockattr;
34 typedef struct oidAtDepth {
35 int depth; //TODO Remove may not need since depth is never read
39 // Global Prefetch Processing Queue
40 proPrefetchQ_t prefetchQ;
42 /**** Prefetch Queue to be processed functions ******/
43 void proPrefetchQDealloc(perMcPrefetchList_t *);
45 /******** Process Queue Element functions ***********/
46 void rangePrefetch(unsigned int, short, short *);
47 void *transPrefetchNew();
48 perMcPrefetchList_t* checkIfLocal(char *ptr);
49 int lookForObjs(int*, short *, int *, int *, int *, int *);
50 void insertPrefetch(int, unsigned int, short, short*, perMcPrefetchList_t **);
52 /******** Sending and Receiving Prefetches *******/
53 void sendRangePrefetchReq(perMcPrefetchList_t *, int sd);
54 int rangePrefetchReq(int acceptfd);
55 int processOidFound(objheader_t *, short *, int, int, int);
56 int processArrayOids(short *, objheader_t *, int *, int);
57 int findOidinStride(short *, struct ArrayObject *, int, int, int, int, int, int);
58 int processLinkedListOids(short *, objheader_t *, int *, int);
59 int getRangePrefetchResponse(int sd);
60 objheader_t *searchObj(unsigned int);
61 void forwardRequest(unsigned int *, int*, int*, int*, short*);
63 /*********** Functions for computation at the participant end **********/
64 int getNextOid(short *, unsigned int*, int*, int*, oidAtDepth_t *, unsigned int);
65 unsigned int getNextArrayOid(short *, unsigned int *, int *, int*);
66 unsigned int getNextPointerOid(short *, unsigned int *, int *, int*);
67 int sendOidFound(unsigned int, int);
68 int sendOidNotFound(unsigned int oid, int sd);
70 /************* Internal functions *******************/
71 int getsize(short *ptr, int n);