1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32 33 34 35
36
37 package ti.sdo.ipc.gates;
38
39 import xdc.runtime.Error;
40 import xdc.runtime.Assert;
41 import xdc.runtime.IGateProvider;
42 import xdc.runtime.Diags;
43 import xdc.runtime.Log;
44
45 import ti.sdo.ipc.interfaces.IGateMPSupport;
46
47 /*!
48 * ======== GateHWSpinlock ========
49 * Multiprocessor gate that utilizes a hardware spinlock
50 */
51 @InstanceInitError
52 @ModuleStartup
53
54 module GateHWSpinlock inherits IGateMPSupport
55 {
56 /*!
57 * ======== BasicView ========
58 * @_nodoc
59 */
60 metaonly struct BasicView {
61 UInt lockNum;
62 UInt nested;
63 }
64
65 /*!
66 * ======== rovViewInfo ========
67 * @_nodoc
68 */
69 @Facet
70 metaonly config xdc.rov.ViewInfo.Instance rovViewInfo =
71 xdc.rov.ViewInfo.create({
72 viewMap: [
73 ['Basic',
74 {
75 type: xdc.rov.ViewInfo.INSTANCE,
76 viewInitFxn: 'viewInitBasic',
77 structName: 'BasicView'
78 }
79 ],
80 ]
81 });
82
83 /*!
84 * ======== LM_enter ========
85 * Logged on gate enter
86 */
87 config Log.Event LM_enter = {
88 mask: Diags.USER1,
89 msg: "LM_enter: Gate (lockNum = %d) entered, returning key = %d"
90 };
91
92 /*!
93 * ======== LM_leave ========
94 * Logged on gate leave
95 */
96 config Log.Event LM_leave = {
97 mask: Diags.USER1,
98 msg: "LM_leave: Gate (lockNum = %d) left using key = %d"
99 };
100
101 /*!
102 * ======== LM_create ========
103 * Logged on gate create
104 */
105 config Log.Event LM_create = {
106 mask: Diags.USER1,
107 msg: "LM_create: Gate (lockNum = %d) created"
108 };
109
110 /*!
111 * ======== LM_open ========
112 * Logged on gate open
113 */
114 config Log.Event LM_open = {
115 mask: Diags.USER1,
116 msg: "LM_open: Remote gate (lockNum = %d) opened"
117 };
118
119 /*!
120 * ======== LM_delete ========
121 * Logged on gate deletion
122 */
123 config Log.Event LM_delete = {
124 mask: Diags.USER1,
125 msg: "LM_delete: Gate (lockNum = %d) deleted"
126 };
127
128 /*!
129 * ======== LM_close ========
130 * Logged on gate close
131 */
132 config Log.Event LM_close = {
133 mask: Diags.USER1,
134 msg: "LM_close: Gate (lockNum = %d) closed"
135 };
136
137 /*!
138 * ======== A_invalidParams ========
139 * Asserted when insufficient information is passed to {@link #open}
140 */
141 config Assert.Id A_invalidParams = {
142 msg: "A_invalidParams: Need to supply either a name or a spinlock Number"
143 };
144
145 /*!
146 * ======== A_invProtectionLevel ========
147 * Asserted when an invalid protection level is encountered
148 */
149 config Assert.Id A_invProtectionLevel = {
150 msg: "A_invProtectionLevel: Unknown level of local protection"
151 };
152
153 /*!
154 * ======== A_invSpinLockNum ========
155 * Assert raised when provided lockNum is invalid for the relevant device
156 */
157 config Assert.Id A_invSpinLockNum = {
158 msg: "A_invSpinLockNum: Invalid hardware spinlock number"
159 };
160
161 /*! Device-specific base address for HW Semaphore subsystem */
162 config Ptr baseAddr = null;
163
164 instance:
165
166 internal:
167
168 /*! Device-specific number of semphores in the HW Semaphore subsystem */
169 config UInt numLocks;
170
171 struct Instance_State {
172 UInt lockNum;
173 UInt nested;
174 IGateProvider.Handle localGate;
175 };
176 }
177 178 179
180