Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > SSR_impls > SSR__MC_shared_impl
comparison VMSHW.h @ 2:f6b960f40005
Debugging -- middle of debugging frenzy before PPoPP deadline
| author | Me |
|---|---|
| date | Mon, 26 Jul 2010 15:26:57 -0700 |
| parents | 35b53e6de714 |
| children | 9f2e23d38ff2 |
comparison
equal
deleted
inserted
replaced
| 0:875c74bf5661 | 1:02321fc7700e |
|---|---|
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef _VMSHW_H | 9 #ifndef _VMSHW_H |
| 10 #define _VMSHW_H | 10 #define _VMSHW_H |
| 11 | 11 |
| 12 #include "VMS/VMS_primitive_data_types.h" | 12 #include "VMS/Queue_impl/PrivateQueue.h" |
| 13 #include "VMS/Queue_impl/BlockingQueue.h" | 13 #include "VMS/Hash_impl/PrivateHash.h" |
| 14 #include "VMS/VMS.h" | |
| 14 | 15 |
| 15 /*This header defines everything specific to the VMSHW semantic plug-in | 16 /*This header defines everything specific to the VMSHW semantic plug-in |
| 16 */ | 17 */ |
| 17 typedef struct VMSHWReqData VMSHWReqData; | 18 typedef struct _VMSHWSemReq VMSHWSemReq; |
| 18 | 19 |
| 19 typedef struct | |
| 20 { | |
| 21 } | |
| 22 VMSHWProcr; | |
| 23 | 20 |
| 24 /*Semantic layer-specific data sent inside a request from lib called in app | 21 /*Semantic layer-specific data sent inside a request from lib called in app |
| 25 * to request handler called in MasterLoop | 22 * to request handler called in MasterLoop |
| 26 */ | 23 */ |
| 27 enum VMSHW_ReqType | 24 enum VMSHWReqType |
| 28 { | 25 { |
| 29 receive, | 26 send_type = 1, |
| 30 send, | 27 send_from_to, |
| 31 create | 28 receive_any, //order and grouping matter -- send before receive |
| 29 receive_type, // and receive_any first of the receives -- Handlers | |
| 30 receive_from_to,// rely upon this ordering of enum | |
| 31 transfer_to, | |
| 32 transfer_out | |
| 32 }; | 33 }; |
| 33 | 34 |
| 34 struct VMSHWReqData | 35 struct _VMSHWSemReq |
| 35 { VMSHW_ReqType reqType; | 36 { enum VMSHWReqType reqType; |
| 36 | 37 VirtProcr *sendPr; |
| 37 }; | 38 VirtProcr *receivePr; |
| 39 int32 msgType; | |
| 40 void *msg; | |
| 41 VMSHWSemReq *nextReqInHashEntry; | |
| 42 } | |
| 43 /* VMSHWSemReq */; | |
| 38 | 44 |
| 39 typedef struct | 45 typedef struct |
| 40 { | 46 { |
| 47 PrivQueueStruc *readyVirtProcrQ; | |
| 48 HashTable *commHashTbl; | |
| 49 int numVirtPr; | |
| 50 } | |
| 51 VMSHWSemEnv; | |
| 41 | 52 |
| 42 } | 53 |
| 43 VMSHWSemanticEnv; | 54 //=========================================================================== |
| 55 | |
| 56 void | |
| 57 VMSHW__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData ); | |
| 58 | |
| 59 //======================= | |
| 60 | |
| 61 void | |
| 62 VMSHW__init(); | |
| 63 | |
| 64 void | |
| 65 VMSHW__shutdown(); | |
| 66 | |
| 67 //======================= | |
| 68 | |
| 69 inline VirtProcr * | |
| 70 VMSHW__create_procr_with( VirtProcrFnPtr fnPtr, void *initData, | |
| 71 VirtProcr *creatingPr ); | |
| 72 | |
| 73 void | |
| 74 VMSHW__dissipate_procr( VirtProcr *procrToDissipate ); | |
| 75 | |
| 76 //======================= | |
| 77 void * | |
| 78 VMSHW__malloc_size_to( int numBytes, VirtProcr *ownerPr ); | |
| 79 | |
| 80 void | |
| 81 VMSHW__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr, | |
| 82 VirtProcr *newOwnerPr ); | |
| 83 | |
| 84 void | |
| 85 VMSHW__add_ownership_by_to( VirtProcr *newOwnerPr, void *data ); | |
| 86 | |
| 87 void | |
| 88 VMSHW__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing ); | |
| 89 | |
| 90 void | |
| 91 VMSHW__transfer_ownership_to_outside( void *dataToTransferOwnershipOf ); | |
| 92 | |
| 93 | |
| 94 | |
| 95 //======================= | |
| 96 void | |
| 97 VMSHW__send_of_type_to( VirtProcr *sendPr, void *msg, const int type, | |
| 98 VirtProcr *receivePr); | |
| 99 | |
| 100 void | |
| 101 VMSHW__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr); | |
| 102 | |
| 103 void * | |
| 104 VMSHW__receive_type_to( const int type, VirtProcr *receivePr ); | |
| 105 | |
| 106 void * | |
| 107 VMSHW__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr ); | |
| 108 | |
| 109 | |
| 110 //======================= | |
| 111 | |
| 112 void | |
| 113 VMSHW__free_semantic_request( VMSHWSemReq *semReq ); | |
| 114 | |
| 115 | |
| 116 //========================= Internal use only ============================= | |
| 117 void | |
| 118 VMSHW__Request_Handler( VirtProcr *requestingPr, void *_semEnv ); | |
| 119 | |
| 120 VirtProcr * | |
| 121 VMSHW__schedule_virt_procr( void *_semEnv ); | |
| 122 | |
| 44 | 123 |
| 45 #endif /* _VMSHW_H */ | 124 #endif /* _VMSHW_H */ |
| 46 | 125 |
