view VMSHW.h @ 3:9f2e23d38ff2

Works Sequentially -- first debugged version fully working
author Me
date Wed, 28 Jul 2010 13:16:09 -0700
parents 06ca89bafbb8
children
line source
1 /*
2 * Copyright 2009 OpenSourceStewardshipFoundation.org
3 * Licensed under GNU General Public License version 2
4 *
5 * Author: seanhalle@yahoo.com
6 *
7 */
9 #ifndef _VMSHW_H
10 #define _VMSHW_H
12 #include "VMS/Queue_impl/PrivateQueue.h"
13 #include "VMS/Hash_impl/PrivateHash.h"
14 #include "VMS/VMS.h"
16 /*This header defines everything specific to the VMSHW semantic plug-in
17 */
18 typedef struct _VMSHWSemReq VMSHWSemReq;
21 /*Semantic layer-specific data sent inside a request from lib called in app
22 * to request handler called in MasterLoop
23 */
24 enum VMSHWReqType
25 {
26 send_type = 1,
27 send_from_to,
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
33 };
35 struct _VMSHWSemReq
36 { enum VMSHWReqType reqType;
37 VirtProcr *sendPr;
38 VirtProcr *receivePr;
39 int32 msgType;
40 void *msg;
41 VMSHWSemReq *nextReqInHashEntry;
42 }
43 /* VMSHWSemReq */;
45 typedef struct
46 {
47 PrivQueueStruc *readyVirtProcrQ;
48 HashTable *commHashTbl;
49 int numVirtPr;
50 }
51 VMSHWSemEnv;
54 //===========================================================================
56 void
57 VMSHW__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData );
59 //=======================
61 void
62 VMSHW__init();
64 void
65 VMSHW__cleanup_after_shutdown();
67 //=======================
69 inline VirtProcr *
70 VMSHW__create_procr_with( VirtProcrFnPtr fnPtr, void *initData,
71 VirtProcr *creatingPr );
73 void
74 VMSHW__dissipate_procr( VirtProcr *procrToDissipate );
76 //=======================
77 void *
78 VMSHW__malloc_size_to( int numBytes, VirtProcr *ownerPr );
80 void
81 VMSHW__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr,
82 VirtProcr *newOwnerPr );
84 void
85 VMSHW__add_ownership_by_to( VirtProcr *newOwnerPr, void *data );
87 void
88 VMSHW__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing );
90 void
91 VMSHW__transfer_ownership_to_outside( void *dataToTransferOwnershipOf );
95 //=======================
96 void
97 VMSHW__send_of_type_to( VirtProcr *sendPr, void *msg, const int type,
98 VirtProcr *receivePr);
100 void
101 VMSHW__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr);
103 void *
104 VMSHW__receive_type_to( const int type, VirtProcr *receivePr );
106 void *
107 VMSHW__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr );
110 //=======================
112 void
113 VMSHW__free_semantic_request( VMSHWSemReq *semReq );
116 //========================= Internal use only =============================
117 void
118 VMSHW__Request_Handler( VirtProcr *requestingPr, void *_semEnv );
120 VirtProcr *
121 VMSHW__schedule_virt_procr( void *_semEnv );
124 #endif /* _VMSHW_H */