msach@134: /* msach@134: * File: requests.h msach@134: * Author: msach msach@134: * msach@134: * Created on September 16, 2011, 3:11 PM msach@134: */ msach@134: msach@134: #ifndef REQUESTS_H msach@134: #define REQUESTS_H msach@134: msach@134: #include "ProcrContext.h" msach@134: msach@134: typedef struct _InterMasterReqst InterMasterReqst; msach@134: msach@134: //============= Requests =========== msach@134: // msach@134: msach@134: //VMS Request is the carrier for Slave to Master requests msach@134: // it has an embedded sub-type request that is pulled out msach@134: // inside the plugin's request handler msach@134: enum VMSReqstType //For Slave->Master requests msach@134: { msach@134: semantic = 1, //avoid starting enums at 0, for debug reasons msach@134: createReq, msach@134: dissipate, msach@134: VMSSemantic //goes with VMSSemReqst below msach@134: }; msach@134: msach@134: struct _VMSReqst msach@134: { msach@134: enum VMSReqstType reqType;//used for dissipate and in future for IO requests msach@134: void *semReqData; msach@134: msach@134: VMSReqst *nextReqst; msach@134: }; msach@134: //VMSReqst msach@134: msach@134: //This is a sub-type of Slave->Master requests. msach@134: // It's for Slaves to invoke built-in VMS-core functions that have language-like msach@134: // behavior. msach@134: enum VMSSemReqstType //These are equivalent to semantic requests, but for msach@134: { // VMS's services available directly to app, like OS msach@134: createProbe = 1, // and probe services -- like a VMS-wide built-in lang msach@134: openFile, msach@134: otherIO msach@134: }; msach@134: msach@134: typedef struct msach@134: { enum VMSSemReqstType reqType; msach@134: VirtProcr *requestingPr; msach@134: char *nameStr; //for create probe msach@134: } msach@134: VMSSemReq; msach@134: msach@134: //These are for Master to Master requests msach@134: // They get re-cast to the appropriate sub-type of request msach@134: enum InterMasterReqstType //For Master->Master msach@134: { msach@134: destVMSCore = 1, //avoid starting enums at 0, for debug reasons msach@134: destPlugin msach@134: }; msach@134: msach@134: struct _InterMasterReqst //Doing a trick to save space & time -- allocate msach@134: { // space for a sub-type then cast first as InterMaster then as sub-type msach@134: enum InterMasterReqstType reqType; msach@134: InterMasterReqst *nextReqst; msach@134: }; msach@134: //InterMasterReqst (defined above in typedef block) msach@134: msach@134: msach@134: //These are a sub-type of InterMaster requests. The inter-master req gets msach@134: // re-cast to be of this type, after checking msach@134: //This ones for requests between internals of VMS-core.. such as malloc msach@134: enum InterVMSCoreReqType msach@134: { msach@134: transfer_free_ptr = 1 //avoid starting enums at 0, for debug reasons msach@134: }; msach@134: msach@134: //Doing a trick to save space & time -- allocate space msach@134: // for this, cast first as InterMaster then as this msach@134: typedef struct msach@134: { msach@134: enum InterMasterReqstType reqType; //duplicate InterMasterReqst at top msach@134: InterMasterReqst *nextReqst; msach@134: msach@134: enum InterVMSCoreReqType secondReqType; msach@134: void *freePtr; //pile up fields, add as needed msach@134: } InterVMSCoreReqst; msach@134: msach@134: //This is for requests between plugins on different cores msach@134: // Here, after casting, the pluginReq is extracted and handed to plugin msach@134: //Doing a trick to save space & time -- allocate space msach@134: // for this, cast first as InterMaster then as this msach@134: typedef struct msach@134: { msach@134: enum InterMasterReqstType reqType; //copy InterMasterReqst at top msach@134: InterMasterReqst *nextReqst; msach@134: msach@134: void *pluginReq; //plugin will cast to approp type msach@134: } InterPluginReqst; msach@134: msach@134: #endif /* REQUESTS_H */ msach@134: