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 // Global Prefetch Processing Queue
35 proPrefetchQ_t prefetchQ;
37 /**** Prefetch Queue to be processed functions ******/
38 void proPrefetchQDealloc(perMcPrefetchList_t *);
40 /******** Process Queue Element functions ***********/
41 void rangePrefetch(unsigned int, short, short *);
42 void *transPrefetchNew();
43 perMcPrefetchList_t* checkIfLocal(char *ptr);
44 int isOidAvail(unsigned int oid);
45 int lookForObjs(int*, short *, int *, int *, int *, int *);
46 void insertPrefetch(int, unsigned int, short, short*, perMcPrefetchList_t **);
48 /******** Sending and Receiving Prefetches *******/
49 void sendRangePrefetchReq(perMcPrefetchList_t *, int sd);
50 int rangePrefetchReq(int acceptfd);
51 int getRangePrefetchResponse(int sd);
53 /************* Internal functions *******************/
54 int getsize(short *ptr, int n);