1 /*
2 * Copyright (c) 2012-2016, Texas Instruments Incorporated
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 * */
32
33 /*
34 * ======== IpcMP.xdc ========
35 */
36
37 package ti.uia.sysbios;
38
39 import xdc.runtime.Assert;
40 import ti.uia.runtime.UIAPacket;
41 import ti.sysbios.knl.Semaphore;
42 import ti.sysbios.knl.Clock;
43 import ti.sysbios.knl.Task;
44 import ti.sysbios.knl.Event;
45 import ti.sysbios.syncs.SyncEvent;
46
47 /*!
48 * ======== IpcMP ========
49 */
50
51 @ModuleStartup /* Initialize static instances */
52
53 module IpcMP inherits ti.uia.runtime.IServiceMgrSupport
54 {
55 /*!
56 * Assert raised IpcMP interaction gets unexpected failure
57 */
58 config Assert.Id A_IpcMPFailure = {
59 msg: "A_IpcMPFailure: Unexpected failure with the IpcMP"
60 };
61
62 /*!
63 * SharedRegion used to allocate messages
64 */
65 config Int sharedRegionId = 0;
66
67 // -------- Module Functions --------
68
69 /*!
70 * @_nodoc
71 * ======== rxTaskFxn ========
72 * Function used for the transfer agent Task.
73 */
74 @DirectCall
75 Void rxTaskFxn(UArg arg0, UArg arg1);
76
77 /*!
78 * @_nodoc
79 * ======== transferAgentFxn ========
80 * Function used for the transfer agent Task.
81 */
82 @DirectCall
83 Void transferAgentFxn(UArg arg0, UArg arg1);
84
85 /*!
86 * @_nodoc
87 * ======== clockFxn ========
88 * Function used for the RTA Agent's Clock instance.
89 *
90 * The Agent C code does not contain any references to this function, so
91 * this function has been made public and nodoc'd, rather than being made
92 * internal, so that it does not fall away in a ROM build.
93 */
94 @DirectCall
95 Void clockFxn(UArg arg0);
96
97 /*!
98 * @_nodoc
99 * ======== start ========
100 */
101 @DirectCall
102 Int start(UArg arg, UInt16 value);
103
104 /*!
105 * ======== doNotPlugIpc ========
106 * Work-around for Syslink bug SDOCM00077375
107 *
108 * Only call if you are using Syslink version 2.00.00.66
109 */
110 metaonly Void doNotPlugIpc();
111
112 internal:
113 /*!
114 * ======== createRxTask ========
115 */
116 config Bool createRxTask = false;
117
118 /*!
119 * @_nodoc
120 * ======== start ========
121 */
122 @DirectCall
123 Int startOrig(Ptr *ptr, UInt16 value);
124
125 /*!
126 * ======== giveEnergy ========
127 */
128 @DirectCall
129 Void giveEnergy();
130
131 /*!
132 * ======== handleMsg ========
133 */
134 @DirectCall
135 Void handleMsg(Ptr msg);
136
137 /*!
138 * ======== prime ========
139 */
140 @DirectCall
141 Void prime(Ptr handle, Int size, Int count);
142
143 /*!
144 * ======== registerWithMaster ========
145 */
146 @DirectCall
147 Void registerWithMaster();
148
149 /*!
150 * ======== requestEvents ========
151 */
152 @DirectCall
153 Void requestEvents();
154
155 /*!
156 * ======== Module_State ========
157 */
158 struct Module_State {
159 Event.Handle event;
160 Clock.Handle clock;
161 Ptr freeEventMQ;
162 Ptr freeMsgMQ;
163 Ptr routerMQ;
164 Ptr startedMQ;
165 UInt32 masterMQ;
166 Ptr incomingMsgMQ;
167 UInt32 replyMQ[];
168 SyncEvent.Handle syncEvent01;
169 Task.Handle transferAgentHandle;
170 Ptr transportMsgHandle;
171 Ptr transportEventHandle;
172 Semaphore.Handle releaseTasksSem;
173 Int numMSGPacketsSent;
174 Int numEventPacketsSent;
175 Bool master;
176 Bool masterRunning;
177 UInt32 period[];
178 UInt32 scheduled[];
179 Bool reqEnergy[];
180
181 };
182 }