1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19 20 21
22
23 package ti.sdo.ipc.gates;
24
25 import xdc.runtime.Error;
26 import xdc.runtime.Assert;
27 import xdc.runtime.IGateProvider;
28 import xdc.runtime.Diags;
29 import xdc.runtime.Log;
30
31 import ti.sdo.ipc.interfaces.IGateMPSupport;
32
33 /*!
34 * ======== GateHWSem ========
35 * Multiprocessor gate that utilizes a hardware semaphore
36 */
37 @ModuleStartup
38 @InstanceInitError
39 @InstanceFinalize
40
41 module GateHWSem inherits IGateMPSupport
42 {
43 /*! @_nodoc */
44 metaonly struct BasicView {
45 Ptr semNum;
46 UInt nested;
47 String enteredBy;
48 }
49
50 /*!
51 * ======== rovViewInfo ========
52 * @_nodoc
53 */
54 @Facet
55 metaonly config xdc.rov.ViewInfo.Instance rovViewInfo =
56 xdc.rov.ViewInfo.create({
57 viewMap: [
58 ['Basic',
59 {
60 type: xdc.rov.ViewInfo.INSTANCE,
61 viewInitFxn: 'viewInitBasic',
62 structName: 'BasicView'
63 }
64 ],
65 ]
66 });
67
68 /*!
69 * ======== A_invalidParams ========
70 * Asserted when insufficient information is passed to {@link #open}
71 */
72 config Assert.Id A_invalidParams = {
73 msg: "A_invalidParams: Need to supply either a name or a semaphore Number"
74 };
75
76 /*!
77 * ======== A_invProtectionLevel ========
78 * Asserted when an invalid protection level is encountered
79 */
80 config Assert.Id A_invProtectionLevel = {
81 msg: "A_invProtectionLevel: Unknown level of local protection"
82 };
83
84 /*!
85 * ======== A_invSemNum ========
86 * Asserted when supplied semNum is invalid for the relevant device
87 */
88 config Assert.Id A_invSemNum = {
89 msg: "A_invSemNum: Invalid hardware semaphore number"
90 };
91
92 instance:
93
94 internal:
95
96 /*! Initialize the hardware semaphore when the creator is created */
97 Void postInit(Object *obj);
98
99 /*! Device-specific base address for HW Semaphore subsystem */
100 config Ptr baseAddr;
101
102 /*! Device-specific query offset for HW Semaphore subsystem (for ROV) */
103 config Ptr queryAddr;
104
105 /*! Device-specific number of semphores in the HW Semaphore subsystem */
106 config UInt numSems;
107
108 struct Instance_State {
109 UInt semNum;
110 UInt nested;
111 IGateProvider.Handle localGate;
112 };
113 }