| rev |
line source |
|
Me@0
|
1 /*
|
|
Me@0
|
2 * Copyright 2009 OpenSourceStewardshipFoundation.org
|
|
Me@0
|
3 * Licensed under GNU General Public License version 2
|
|
Me@0
|
4 *
|
|
Me@0
|
5 * Author: seanhalle@yahoo.com
|
|
Me@0
|
6 *
|
|
Me@0
|
7 */
|
|
Me@0
|
8
|
|
Me@0
|
9 #ifndef _VMSHW_H
|
|
Me@0
|
10 #define _VMSHW_H
|
|
Me@0
|
11
|
|
Me@1
|
12 #include "VMS/Queue_impl/PrivateQueue.h"
|
|
Me@1
|
13 #include "VMS/Hash_impl/PrivateHash.h"
|
|
Me@1
|
14 #include "VMS/VMS.h"
|
|
Me@0
|
15
|
|
Me@0
|
16 /*This header defines everything specific to the VMSHW semantic plug-in
|
|
Me@0
|
17 */
|
|
Me@1
|
18 typedef struct _VMSHWSemReq VMSHWSemReq;
|
|
Me@0
|
19
|
|
Me@0
|
20
|
|
Me@0
|
21 /*Semantic layer-specific data sent inside a request from lib called in app
|
|
Me@0
|
22 * to request handler called in MasterLoop
|
|
Me@0
|
23 */
|
|
Me@1
|
24 enum VMSHWReqType
|
|
Me@0
|
25 {
|
|
Me@1
|
26 send_type = 1,
|
|
Me@1
|
27 send_from_to,
|
|
Me@1
|
28 receive_any, //order and grouping matter -- send before receive
|
|
Me@1
|
29 receive_type, // and receive_any first of the receives -- Handlers
|
|
Me@1
|
30 receive_from_to,// rely upon this ordering of enum
|
|
Me@1
|
31 transfer_to,
|
|
Me@1
|
32 transfer_out
|
|
Me@0
|
33 };
|
|
Me@0
|
34
|
|
Me@1
|
35 struct _VMSHWSemReq
|
|
Me@1
|
36 { enum VMSHWReqType reqType;
|
|
Me@1
|
37 VirtProcr *sendPr;
|
|
Me@1
|
38 VirtProcr *receivePr;
|
|
Me@1
|
39 int32 msgType;
|
|
Me@1
|
40 void *msg;
|
|
Me@1
|
41 VMSHWSemReq *nextReqInHashEntry;
|
|
Me@1
|
42 }
|
|
Me@1
|
43 /* VMSHWSemReq */;
|
|
Me@0
|
44
|
|
Me@0
|
45 typedef struct
|
|
Me@0
|
46 {
|
|
Me@1
|
47 PrivQueueStruc *readyVirtProcrQ;
|
|
Me@1
|
48 HashTable *commHashTbl;
|
|
Me@1
|
49 int numVirtPr;
|
|
Me@1
|
50 }
|
|
Me@1
|
51 VMSHWSemEnv;
|
|
Me@0
|
52
|
|
Me@1
|
53
|
|
Me@1
|
54 //===========================================================================
|
|
Me@1
|
55
|
|
Me@1
|
56 void
|
|
Me@1
|
57 VMSHW__create_seed_procr_and_do_work( VirtProcrFnPtr fn, void *initData );
|
|
Me@1
|
58
|
|
Me@1
|
59 //=======================
|
|
Me@1
|
60
|
|
Me@1
|
61 void
|
|
Me@1
|
62 VMSHW__init();
|
|
Me@1
|
63
|
|
Me@1
|
64 void
|
|
Me@3
|
65 VMSHW__cleanup_after_shutdown();
|
|
Me@1
|
66
|
|
Me@1
|
67 //=======================
|
|
Me@1
|
68
|
|
Me@1
|
69 inline VirtProcr *
|
|
Me@1
|
70 VMSHW__create_procr_with( VirtProcrFnPtr fnPtr, void *initData,
|
|
Me@1
|
71 VirtProcr *creatingPr );
|
|
Me@1
|
72
|
|
Me@1
|
73 void
|
|
Me@1
|
74 VMSHW__dissipate_procr( VirtProcr *procrToDissipate );
|
|
Me@1
|
75
|
|
Me@1
|
76 //=======================
|
|
Me@1
|
77 void *
|
|
Me@1
|
78 VMSHW__malloc_size_to( int numBytes, VirtProcr *ownerPr );
|
|
Me@1
|
79
|
|
Me@1
|
80 void
|
|
Me@1
|
81 VMSHW__transfer_ownership_of_from_to( void *data, VirtProcr *oldOwnerPr,
|
|
Me@1
|
82 VirtProcr *newOwnerPr );
|
|
Me@1
|
83
|
|
Me@1
|
84 void
|
|
Me@1
|
85 VMSHW__add_ownership_by_to( VirtProcr *newOwnerPr, void *data );
|
|
Me@1
|
86
|
|
Me@1
|
87 void
|
|
Me@1
|
88 VMSHW__remove_ownership_by_from( VirtProcr *loserPr, void *dataLosing );
|
|
Me@1
|
89
|
|
Me@1
|
90 void
|
|
Me@1
|
91 VMSHW__transfer_ownership_to_outside( void *dataToTransferOwnershipOf );
|
|
Me@1
|
92
|
|
Me@1
|
93
|
|
Me@1
|
94
|
|
Me@1
|
95 //=======================
|
|
Me@1
|
96 void
|
|
Me@1
|
97 VMSHW__send_of_type_to( VirtProcr *sendPr, void *msg, const int type,
|
|
Me@1
|
98 VirtProcr *receivePr);
|
|
Me@1
|
99
|
|
Me@1
|
100 void
|
|
Me@1
|
101 VMSHW__send_from_to( void *msg, VirtProcr *sendPr, VirtProcr *receivePr);
|
|
Me@1
|
102
|
|
Me@1
|
103 void *
|
|
Me@1
|
104 VMSHW__receive_type_to( const int type, VirtProcr *receivePr );
|
|
Me@1
|
105
|
|
Me@1
|
106 void *
|
|
Me@1
|
107 VMSHW__receive_from_to( VirtProcr *sendPr, VirtProcr *receivePr );
|
|
Me@1
|
108
|
|
Me@1
|
109
|
|
Me@1
|
110 //=======================
|
|
Me@1
|
111
|
|
Me@1
|
112 void
|
|
Me@1
|
113 VMSHW__free_semantic_request( VMSHWSemReq *semReq );
|
|
Me@1
|
114
|
|
Me@1
|
115
|
|
Me@1
|
116 //========================= Internal use only =============================
|
|
Me@1
|
117 void
|
|
Me@1
|
118 VMSHW__Request_Handler( VirtProcr *requestingPr, void *_semEnv );
|
|
Me@1
|
119
|
|
Me@1
|
120 VirtProcr *
|
|
Me@1
|
121 VMSHW__schedule_virt_procr( void *_semEnv );
|
|
Me@1
|
122
|
|
Me@0
|
123
|
|
Me@0
|
124 #endif /* _VMSHW_H */
|
|
Me@0
|
125
|