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 * ======== GateHWSem ========
49 * Multiprocessor gate that utilizes a hardware semaphore
50 */
51 @ModuleStartup
52 @InstanceInitError
53 @InstanceFinalize
54
55 module GateHWSem inherits IGateMPSupport
56 {
57 /*! @_nodoc */
58 metaonly struct BasicView {
59 Ptr semNum;
60 UInt nested;
61 String enteredBy;
62 }
63
64 /*!
65 * ======== rovViewInfo ========
66 * @_nodoc
67 */
68 @Facet
69 metaonly config xdc.rov.ViewInfo.Instance rovViewInfo =
70 xdc.rov.ViewInfo.create({
71 viewMap: [
72 ['Basic',
73 {
74 type: xdc.rov.ViewInfo.INSTANCE,
75 viewInitFxn: 'viewInitBasic',
76 structName: 'BasicView'
77 }
78 ],
79 ]
80 });
81
82 /*!
83 * ======== A_invalidParams ========
84 * Asserted when insufficient information is passed to {@link #open}
85 */
86 config Assert.Id A_invalidParams = {
87 msg: "A_invalidParams: Need to supply either a name or a semaphore Number"
88 };
89
90 /*!
91 * ======== A_invProtectionLevel ========
92 * Asserted when an invalid protection level is encountered
93 */
94 config Assert.Id A_invProtectionLevel = {
95 msg: "A_invProtectionLevel: Unknown level of local protection"
96 };
97
98 /*!
99 * ======== A_invSemNum ========
100 * Asserted when supplied semNum is invalid for the relevant device
101 */
102 config Assert.Id A_invSemNum = {
103 msg: "A_invSemNum: Invalid hardware semaphore number"
104 };
105
106 instance:
107
108 internal:
109
110 /*! Initialize the hardware semaphore when the creator is created */
111 Void postInit(Object *obj);
112
113 /*! Device-specific base address for HW Semaphore subsystem */
114 config Ptr baseAddr;
115
116 /*! Device-specific query offset for HW Semaphore subsystem (for ROV) */
117 config Ptr queryAddr;
118
119 /*! Device-specific number of semphores in the HW Semaphore subsystem */
120 config UInt numSems;
121
122 struct Instance_State {
123 UInt semNum;
124 UInt nested;
125 IGateProvider.Handle localGate;
126 };
127 }
128 129 130
131