stream_buffer.c.022i.opt_local_passes 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210
  1. ucStreamBufferGetStreamBufferType (struct StreamBufferDef_t * xStreamBuffer)
  2. {
  3. unsigned char _1;
  4. uint8_t _4;
  5. <bb 2> :
  6. # DEBUG BEGIN_STMT
  7. _1 = xStreamBuffer_3(D)->ucFlags;
  8. _4 = _1 & 1;
  9. return _4;
  10. }
  11. vStreamBufferSetStreamBufferNumber (struct StreamBufferDef_t * xStreamBuffer, UBaseType_t uxStreamBufferNumber)
  12. {
  13. <bb 2> :
  14. # DEBUG BEGIN_STMT
  15. xStreamBuffer_2(D)->uxStreamBufferNumber = uxStreamBufferNumber_3(D);
  16. return;
  17. }
  18. uxStreamBufferGetStreamBufferNumber (struct StreamBufferDef_t * xStreamBuffer)
  19. {
  20. UBaseType_t _3;
  21. <bb 2> :
  22. # DEBUG BEGIN_STMT
  23. _3 = xStreamBuffer_2(D)->uxStreamBufferNumber;
  24. return _3;
  25. }
  26. prvInitialiseNewStreamBuffer (struct StreamBuffer_t * const pxStreamBuffer, uint8_t * const pucBuffer, size_t xBufferSizeBytes, size_t xTriggerLevelBytes, uint8_t ucFlags)
  27. {
  28. const BaseType_t xWriteValue;
  29. void * _1;
  30. <bb 2> :
  31. # DEBUG BEGIN_STMT
  32. xWriteValue_2 = 85;
  33. # DEBUG xWriteValue => xWriteValue_2
  34. # DEBUG BEGIN_STMT
  35. _1 = memset (pucBuffer_4(D), 85, xBufferSizeBytes_5(D));
  36. if (pucBuffer_4(D) != _1)
  37. goto <bb 3>; [INV]
  38. else
  39. goto <bb 5>; [INV]
  40. <bb 3> :
  41. # DEBUG BEGIN_STMT
  42. vPortRaiseBASEPRI ();
  43. <bb 4> :
  44. # DEBUG BEGIN_STMT
  45. # DEBUG BEGIN_STMT
  46. # DEBUG BEGIN_STMT
  47. goto <bb 4>; [INV]
  48. <bb 5> :
  49. # DEBUG BEGIN_STMT
  50. # DEBUG BEGIN_STMT
  51. memset (pxStreamBuffer_7(D), 0, 36);
  52. # DEBUG BEGIN_STMT
  53. pxStreamBuffer_7(D)->pucBuffer = pucBuffer_4(D);
  54. # DEBUG BEGIN_STMT
  55. pxStreamBuffer_7(D)->xLength = xBufferSizeBytes_5(D);
  56. # DEBUG BEGIN_STMT
  57. pxStreamBuffer_7(D)->xTriggerLevelBytes = xTriggerLevelBytes_11(D);
  58. # DEBUG BEGIN_STMT
  59. pxStreamBuffer_7(D)->ucFlags = ucFlags_13(D);
  60. return;
  61. }
  62. prvBytesInBuffer (const struct StreamBuffer_t * const pxStreamBuffer)
  63. {
  64. size_t xCount;
  65. unsigned int _1;
  66. unsigned int _2;
  67. unsigned int _3;
  68. unsigned int _4;
  69. unsigned int _9;
  70. size_t _12;
  71. <bb 2> :
  72. # DEBUG BEGIN_STMT
  73. # DEBUG BEGIN_STMT
  74. _1 = pxStreamBuffer_7(D)->xLength;
  75. _2 ={v} pxStreamBuffer_7(D)->xHead;
  76. xCount_8 = _1 + _2;
  77. # DEBUG xCount => xCount_8
  78. # DEBUG BEGIN_STMT
  79. _9 ={v} pxStreamBuffer_7(D)->xTail;
  80. xCount_10 = xCount_8 - _9;
  81. # DEBUG xCount => xCount_10
  82. # DEBUG BEGIN_STMT
  83. _3 = pxStreamBuffer_7(D)->xLength;
  84. if (xCount_10 >= _3)
  85. goto <bb 3>; [INV]
  86. else
  87. goto <bb 4>; [INV]
  88. <bb 3> :
  89. # DEBUG BEGIN_STMT
  90. _4 = pxStreamBuffer_7(D)->xLength;
  91. xCount_11 = xCount_10 - _4;
  92. # DEBUG xCount => xCount_11
  93. <bb 4> :
  94. # xCount_5 = PHI <xCount_10(2), xCount_11(3)>
  95. # DEBUG xCount => xCount_5
  96. # DEBUG BEGIN_STMT
  97. # DEBUG BEGIN_STMT
  98. _12 = xCount_5;
  99. return _12;
  100. }
  101. prvReadBytesFromBuffer (struct StreamBuffer_t * pxStreamBuffer, uint8_t * pucData, size_t xCount, size_t xTail)
  102. {
  103. size_t xFirstLength;
  104. unsigned int _1;
  105. unsigned int _2;
  106. unsigned int _3;
  107. unsigned int _4;
  108. uint8_t * _5;
  109. uint8_t * _6;
  110. uint8_t * _7;
  111. uint8_t * _8;
  112. unsigned int _9;
  113. unsigned int _10;
  114. unsigned int _11;
  115. size_t _24;
  116. <bb 2> :
  117. # DEBUG BEGIN_STMT
  118. # DEBUG BEGIN_STMT
  119. if (xCount_14(D) == 0)
  120. goto <bb 3>; [INV]
  121. else
  122. goto <bb 5>; [INV]
  123. <bb 3> :
  124. # DEBUG BEGIN_STMT
  125. vPortRaiseBASEPRI ();
  126. <bb 4> :
  127. # DEBUG BEGIN_STMT
  128. # DEBUG BEGIN_STMT
  129. # DEBUG BEGIN_STMT
  130. goto <bb 4>; [INV]
  131. <bb 5> :
  132. # DEBUG BEGIN_STMT
  133. # DEBUG BEGIN_STMT
  134. _1 = pxStreamBuffer_16(D)->xLength;
  135. _2 = _1 - xTail_17(D);
  136. xFirstLength_18 = MIN_EXPR <xCount_14(D), _2>;
  137. # DEBUG xFirstLength => xFirstLength_18
  138. # DEBUG BEGIN_STMT
  139. if (xFirstLength_18 > xCount_14(D))
  140. goto <bb 6>; [INV]
  141. else
  142. goto <bb 8>; [INV]
  143. <bb 6> :
  144. # DEBUG BEGIN_STMT
  145. vPortRaiseBASEPRI ();
  146. <bb 7> :
  147. # DEBUG BEGIN_STMT
  148. # DEBUG BEGIN_STMT
  149. # DEBUG BEGIN_STMT
  150. goto <bb 7>; [INV]
  151. <bb 8> :
  152. # DEBUG BEGIN_STMT
  153. # DEBUG BEGIN_STMT
  154. _3 = xTail_17(D) + xFirstLength_18;
  155. _4 = pxStreamBuffer_16(D)->xLength;
  156. if (_3 > _4)
  157. goto <bb 9>; [INV]
  158. else
  159. goto <bb 11>; [INV]
  160. <bb 9> :
  161. # DEBUG BEGIN_STMT
  162. vPortRaiseBASEPRI ();
  163. <bb 10> :
  164. # DEBUG BEGIN_STMT
  165. # DEBUG BEGIN_STMT
  166. # DEBUG BEGIN_STMT
  167. goto <bb 10>; [INV]
  168. <bb 11> :
  169. # DEBUG BEGIN_STMT
  170. # DEBUG BEGIN_STMT
  171. _5 = pxStreamBuffer_16(D)->pucBuffer;
  172. _6 = _5 + xTail_17(D);
  173. memcpy (pucData_19(D), _6, xFirstLength_18);
  174. # DEBUG BEGIN_STMT
  175. if (xCount_14(D) > xFirstLength_18)
  176. goto <bb 12>; [INV]
  177. else
  178. goto <bb 13>; [INV]
  179. <bb 12> :
  180. # DEBUG BEGIN_STMT
  181. _7 = pucData_19(D) + xFirstLength_18;
  182. _8 = pxStreamBuffer_16(D)->pucBuffer;
  183. _9 = xCount_14(D) - xFirstLength_18;
  184. memcpy (_7, _8, _9);
  185. <bb 13> :
  186. # DEBUG BEGIN_STMT
  187. # DEBUG BEGIN_STMT
  188. xTail_22 = xTail_17(D) + xCount_14(D);
  189. # DEBUG xTail => xTail_22
  190. # DEBUG BEGIN_STMT
  191. _10 = pxStreamBuffer_16(D)->xLength;
  192. if (xTail_22 >= _10)
  193. goto <bb 14>; [INV]
  194. else
  195. goto <bb 15>; [INV]
  196. <bb 14> :
  197. # DEBUG BEGIN_STMT
  198. _11 = pxStreamBuffer_16(D)->xLength;
  199. xTail_23 = xTail_22 - _11;
  200. # DEBUG xTail => xTail_23
  201. <bb 15> :
  202. # xTail_12 = PHI <xTail_22(13), xTail_23(14)>
  203. # DEBUG xTail => xTail_12
  204. # DEBUG BEGIN_STMT
  205. _24 = xTail_12;
  206. return _24;
  207. }
  208. prvWriteBytesToBuffer (struct StreamBuffer_t * const pxStreamBuffer, const uint8_t * pucData, size_t xCount, size_t xHead)
  209. {
  210. size_t xFirstLength;
  211. unsigned int _1;
  212. unsigned int _2;
  213. unsigned int _3;
  214. unsigned int _4;
  215. uint8_t * _5;
  216. uint8_t * _6;
  217. unsigned int _7;
  218. unsigned int _8;
  219. uint8_t * _9;
  220. const uint8_t * _10;
  221. unsigned int _11;
  222. unsigned int _12;
  223. unsigned int _13;
  224. size_t _27;
  225. <bb 2> :
  226. # DEBUG BEGIN_STMT
  227. # DEBUG BEGIN_STMT
  228. if (xCount_16(D) == 0)
  229. goto <bb 3>; [INV]
  230. else
  231. goto <bb 5>; [INV]
  232. <bb 3> :
  233. # DEBUG BEGIN_STMT
  234. vPortRaiseBASEPRI ();
  235. <bb 4> :
  236. # DEBUG BEGIN_STMT
  237. # DEBUG BEGIN_STMT
  238. # DEBUG BEGIN_STMT
  239. goto <bb 4>; [INV]
  240. <bb 5> :
  241. # DEBUG BEGIN_STMT
  242. # DEBUG BEGIN_STMT
  243. _1 = pxStreamBuffer_18(D)->xLength;
  244. _2 = _1 - xHead_19(D);
  245. xFirstLength_20 = MIN_EXPR <xCount_16(D), _2>;
  246. # DEBUG xFirstLength => xFirstLength_20
  247. # DEBUG BEGIN_STMT
  248. _3 = xHead_19(D) + xFirstLength_20;
  249. _4 = pxStreamBuffer_18(D)->xLength;
  250. if (_3 > _4)
  251. goto <bb 6>; [INV]
  252. else
  253. goto <bb 8>; [INV]
  254. <bb 6> :
  255. # DEBUG BEGIN_STMT
  256. vPortRaiseBASEPRI ();
  257. <bb 7> :
  258. # DEBUG BEGIN_STMT
  259. # DEBUG BEGIN_STMT
  260. # DEBUG BEGIN_STMT
  261. goto <bb 7>; [INV]
  262. <bb 8> :
  263. # DEBUG BEGIN_STMT
  264. # DEBUG BEGIN_STMT
  265. _5 = pxStreamBuffer_18(D)->pucBuffer;
  266. _6 = _5 + xHead_19(D);
  267. memcpy (_6, pucData_21(D), xFirstLength_20);
  268. # DEBUG BEGIN_STMT
  269. if (xCount_16(D) > xFirstLength_20)
  270. goto <bb 9>; [INV]
  271. else
  272. goto <bb 13>; [INV]
  273. <bb 9> :
  274. # DEBUG BEGIN_STMT
  275. _7 = xCount_16(D) - xFirstLength_20;
  276. _8 = pxStreamBuffer_18(D)->xLength;
  277. if (_7 > _8)
  278. goto <bb 10>; [INV]
  279. else
  280. goto <bb 12>; [INV]
  281. <bb 10> :
  282. # DEBUG BEGIN_STMT
  283. vPortRaiseBASEPRI ();
  284. <bb 11> :
  285. # DEBUG BEGIN_STMT
  286. # DEBUG BEGIN_STMT
  287. # DEBUG BEGIN_STMT
  288. goto <bb 11>; [INV]
  289. <bb 12> :
  290. # DEBUG BEGIN_STMT
  291. # DEBUG BEGIN_STMT
  292. _9 = pxStreamBuffer_18(D)->pucBuffer;
  293. _10 = pucData_21(D) + xFirstLength_20;
  294. _11 = xCount_16(D) - xFirstLength_20;
  295. memcpy (_9, _10, _11);
  296. <bb 13> :
  297. # DEBUG BEGIN_STMT
  298. # DEBUG BEGIN_STMT
  299. xHead_25 = xHead_19(D) + xCount_16(D);
  300. # DEBUG xHead => xHead_25
  301. # DEBUG BEGIN_STMT
  302. _12 = pxStreamBuffer_18(D)->xLength;
  303. if (xHead_25 >= _12)
  304. goto <bb 14>; [INV]
  305. else
  306. goto <bb 15>; [INV]
  307. <bb 14> :
  308. # DEBUG BEGIN_STMT
  309. _13 = pxStreamBuffer_18(D)->xLength;
  310. xHead_26 = xHead_25 - _13;
  311. # DEBUG xHead => xHead_26
  312. <bb 15> :
  313. # xHead_14 = PHI <xHead_25(13), xHead_26(14)>
  314. # DEBUG xHead => xHead_14
  315. # DEBUG BEGIN_STMT
  316. # DEBUG BEGIN_STMT
  317. _27 = xHead_14;
  318. return _27;
  319. }
  320. xStreamBufferReceiveCompletedFromISR (struct StreamBufferDef_t * xStreamBuffer, BaseType_t * pxHigherPriorityTaskWoken)
  321. {
  322. UBaseType_t uxSavedInterruptStatus;
  323. BaseType_t xReturn;
  324. struct StreamBuffer_t * const pxStreamBuffer;
  325. struct tskTaskControlBlock * _1;
  326. struct tskTaskControlBlock * _2;
  327. BaseType_t _16;
  328. <bb 2> :
  329. # DEBUG BEGIN_STMT
  330. pxStreamBuffer_6 = xStreamBuffer_5(D);
  331. # DEBUG pxStreamBuffer => pxStreamBuffer_6
  332. # DEBUG BEGIN_STMT
  333. # DEBUG BEGIN_STMT
  334. # DEBUG BEGIN_STMT
  335. if (pxStreamBuffer_6 == 0B)
  336. goto <bb 3>; [INV]
  337. else
  338. goto <bb 5>; [INV]
  339. <bb 3> :
  340. # DEBUG BEGIN_STMT
  341. vPortRaiseBASEPRI ();
  342. <bb 4> :
  343. # DEBUG BEGIN_STMT
  344. # DEBUG BEGIN_STMT
  345. # DEBUG BEGIN_STMT
  346. goto <bb 4>; [INV]
  347. <bb 5> :
  348. # DEBUG BEGIN_STMT
  349. # DEBUG BEGIN_STMT
  350. uxSavedInterruptStatus_9 = ulPortRaiseBASEPRI ();
  351. # DEBUG uxSavedInterruptStatus => uxSavedInterruptStatus_9
  352. # DEBUG BEGIN_STMT
  353. _1 ={v} pxStreamBuffer_6->xTaskWaitingToSend;
  354. if (_1 != 0B)
  355. goto <bb 6>; [INV]
  356. else
  357. goto <bb 7>; [INV]
  358. <bb 6> :
  359. # DEBUG BEGIN_STMT
  360. _2 ={v} pxStreamBuffer_6->xTaskWaitingToSend;
  361. xTaskGenericNotifyFromISR (_2, 0, 0, 0, 0B, pxHigherPriorityTaskWoken_11(D));
  362. # DEBUG BEGIN_STMT
  363. pxStreamBuffer_6->xTaskWaitingToSend ={v} 0B;
  364. # DEBUG BEGIN_STMT
  365. xReturn_14 = 1;
  366. # DEBUG xReturn => xReturn_14
  367. goto <bb 8>; [INV]
  368. <bb 7> :
  369. # DEBUG BEGIN_STMT
  370. xReturn_10 = 0;
  371. # DEBUG xReturn => xReturn_10
  372. <bb 8> :
  373. # xReturn_3 = PHI <xReturn_14(6), xReturn_10(7)>
  374. # DEBUG xReturn => xReturn_3
  375. # DEBUG BEGIN_STMT
  376. vPortSetBASEPRI (uxSavedInterruptStatus_9);
  377. # DEBUG BEGIN_STMT
  378. _16 = xReturn_3;
  379. return _16;
  380. }
  381. xStreamBufferSendCompletedFromISR (struct StreamBufferDef_t * xStreamBuffer, BaseType_t * pxHigherPriorityTaskWoken)
  382. {
  383. UBaseType_t uxSavedInterruptStatus;
  384. BaseType_t xReturn;
  385. struct StreamBuffer_t * const pxStreamBuffer;
  386. struct tskTaskControlBlock * _1;
  387. struct tskTaskControlBlock * _2;
  388. BaseType_t _16;
  389. <bb 2> :
  390. # DEBUG BEGIN_STMT
  391. pxStreamBuffer_6 = xStreamBuffer_5(D);
  392. # DEBUG pxStreamBuffer => pxStreamBuffer_6
  393. # DEBUG BEGIN_STMT
  394. # DEBUG BEGIN_STMT
  395. # DEBUG BEGIN_STMT
  396. if (pxStreamBuffer_6 == 0B)
  397. goto <bb 3>; [INV]
  398. else
  399. goto <bb 5>; [INV]
  400. <bb 3> :
  401. # DEBUG BEGIN_STMT
  402. vPortRaiseBASEPRI ();
  403. <bb 4> :
  404. # DEBUG BEGIN_STMT
  405. # DEBUG BEGIN_STMT
  406. # DEBUG BEGIN_STMT
  407. goto <bb 4>; [INV]
  408. <bb 5> :
  409. # DEBUG BEGIN_STMT
  410. # DEBUG BEGIN_STMT
  411. uxSavedInterruptStatus_9 = ulPortRaiseBASEPRI ();
  412. # DEBUG uxSavedInterruptStatus => uxSavedInterruptStatus_9
  413. # DEBUG BEGIN_STMT
  414. _1 ={v} pxStreamBuffer_6->xTaskWaitingToReceive;
  415. if (_1 != 0B)
  416. goto <bb 6>; [INV]
  417. else
  418. goto <bb 7>; [INV]
  419. <bb 6> :
  420. # DEBUG BEGIN_STMT
  421. _2 ={v} pxStreamBuffer_6->xTaskWaitingToReceive;
  422. xTaskGenericNotifyFromISR (_2, 0, 0, 0, 0B, pxHigherPriorityTaskWoken_11(D));
  423. # DEBUG BEGIN_STMT
  424. pxStreamBuffer_6->xTaskWaitingToReceive ={v} 0B;
  425. # DEBUG BEGIN_STMT
  426. xReturn_14 = 1;
  427. # DEBUG xReturn => xReturn_14
  428. goto <bb 8>; [INV]
  429. <bb 7> :
  430. # DEBUG BEGIN_STMT
  431. xReturn_10 = 0;
  432. # DEBUG xReturn => xReturn_10
  433. <bb 8> :
  434. # xReturn_3 = PHI <xReturn_14(6), xReturn_10(7)>
  435. # DEBUG xReturn => xReturn_3
  436. # DEBUG BEGIN_STMT
  437. vPortSetBASEPRI (uxSavedInterruptStatus_9);
  438. # DEBUG BEGIN_STMT
  439. _16 = xReturn_3;
  440. return _16;
  441. }
  442. xStreamBufferIsFull (struct StreamBufferDef_t * xStreamBuffer)
  443. {
  444. const struct StreamBuffer_t * const pxStreamBuffer;
  445. size_t xBytesToStoreMessageLength;
  446. BaseType_t xReturn;
  447. unsigned char _1;
  448. int _2;
  449. int _3;
  450. unsigned int _4;
  451. BaseType_t _15;
  452. <bb 2> :
  453. # DEBUG BEGIN_STMT
  454. # DEBUG BEGIN_STMT
  455. # DEBUG BEGIN_STMT
  456. pxStreamBuffer_8 = xStreamBuffer_7(D);
  457. # DEBUG pxStreamBuffer => pxStreamBuffer_8
  458. # DEBUG BEGIN_STMT
  459. if (pxStreamBuffer_8 == 0B)
  460. goto <bb 3>; [INV]
  461. else
  462. goto <bb 5>; [INV]
  463. <bb 3> :
  464. # DEBUG BEGIN_STMT
  465. vPortRaiseBASEPRI ();
  466. <bb 4> :
  467. # DEBUG BEGIN_STMT
  468. # DEBUG BEGIN_STMT
  469. # DEBUG BEGIN_STMT
  470. goto <bb 4>; [INV]
  471. <bb 5> :
  472. # DEBUG BEGIN_STMT
  473. # DEBUG BEGIN_STMT
  474. _1 = pxStreamBuffer_8->ucFlags;
  475. _2 = (int) _1;
  476. _3 = _2 & 1;
  477. if (_3 != 0)
  478. goto <bb 6>; [INV]
  479. else
  480. goto <bb 7>; [INV]
  481. <bb 6> :
  482. # DEBUG BEGIN_STMT
  483. xBytesToStoreMessageLength_11 = 4;
  484. # DEBUG xBytesToStoreMessageLength => xBytesToStoreMessageLength_11
  485. goto <bb 8>; [INV]
  486. <bb 7> :
  487. # DEBUG BEGIN_STMT
  488. xBytesToStoreMessageLength_10 = 0;
  489. # DEBUG xBytesToStoreMessageLength => xBytesToStoreMessageLength_10
  490. <bb 8> :
  491. # xBytesToStoreMessageLength_6 = PHI <xBytesToStoreMessageLength_11(6), xBytesToStoreMessageLength_10(7)>
  492. # DEBUG xBytesToStoreMessageLength => xBytesToStoreMessageLength_6
  493. # DEBUG BEGIN_STMT
  494. _4 = xStreamBufferSpacesAvailable (xStreamBuffer_7(D));
  495. if (xBytesToStoreMessageLength_6 >= _4)
  496. goto <bb 9>; [INV]
  497. else
  498. goto <bb 10>; [INV]
  499. <bb 9> :
  500. # DEBUG BEGIN_STMT
  501. xReturn_14 = 1;
  502. # DEBUG xReturn => xReturn_14
  503. goto <bb 11>; [INV]
  504. <bb 10> :
  505. # DEBUG BEGIN_STMT
  506. xReturn_13 = 0;
  507. # DEBUG xReturn => xReturn_13
  508. <bb 11> :
  509. # xReturn_5 = PHI <xReturn_14(9), xReturn_13(10)>
  510. # DEBUG xReturn => xReturn_5
  511. # DEBUG BEGIN_STMT
  512. _15 = xReturn_5;
  513. return _15;
  514. }
  515. xStreamBufferIsEmpty (struct StreamBufferDef_t * xStreamBuffer)
  516. {
  517. size_t xTail;
  518. BaseType_t xReturn;
  519. const struct StreamBuffer_t * const pxStreamBuffer;
  520. unsigned int _1;
  521. BaseType_t _9;
  522. <bb 2> :
  523. # DEBUG BEGIN_STMT
  524. pxStreamBuffer_4 = xStreamBuffer_3(D);
  525. # DEBUG pxStreamBuffer => pxStreamBuffer_4
  526. # DEBUG BEGIN_STMT
  527. # DEBUG BEGIN_STMT
  528. # DEBUG BEGIN_STMT
  529. if (pxStreamBuffer_4 == 0B)
  530. goto <bb 3>; [INV]
  531. else
  532. goto <bb 5>; [INV]
  533. <bb 3> :
  534. # DEBUG BEGIN_STMT
  535. vPortRaiseBASEPRI ();
  536. <bb 4> :
  537. # DEBUG BEGIN_STMT
  538. # DEBUG BEGIN_STMT
  539. # DEBUG BEGIN_STMT
  540. goto <bb 4>; [INV]
  541. <bb 5> :
  542. # DEBUG BEGIN_STMT
  543. # DEBUG BEGIN_STMT
  544. xTail_6 ={v} pxStreamBuffer_4->xTail;
  545. # DEBUG xTail => xTail_6
  546. # DEBUG BEGIN_STMT
  547. _1 ={v} pxStreamBuffer_4->xHead;
  548. if (xTail_6 == _1)
  549. goto <bb 6>; [INV]
  550. else
  551. goto <bb 7>; [INV]
  552. <bb 6> :
  553. # DEBUG BEGIN_STMT
  554. xReturn_8 = 1;
  555. # DEBUG xReturn => xReturn_8
  556. goto <bb 8>; [INV]
  557. <bb 7> :
  558. # DEBUG BEGIN_STMT
  559. xReturn_7 = 0;
  560. # DEBUG xReturn => xReturn_7
  561. <bb 8> :
  562. # xReturn_2 = PHI <xReturn_8(6), xReturn_7(7)>
  563. # DEBUG xReturn => xReturn_2
  564. # DEBUG BEGIN_STMT
  565. _9 = xReturn_2;
  566. return _9;
  567. }
  568. prvReadMessageFromBuffer (struct StreamBuffer_t * pxStreamBuffer, void * pvRxData, size_t xBufferLengthBytes, size_t xBytesAvailable)
  569. {
  570. size_t xNextTail;
  571. size_t xTempNextMessageLength;
  572. size_t xNextMessageLength;
  573. size_t xCount;
  574. unsigned char _1;
  575. int _2;
  576. int _3;
  577. unsigned int _4;
  578. size_t _25;
  579. <bb 2> :
  580. # DEBUG BEGIN_STMT
  581. # DEBUG BEGIN_STMT
  582. # DEBUG BEGIN_STMT
  583. xNextTail_12 ={v} pxStreamBuffer_11(D)->xTail;
  584. # DEBUG xNextTail => xNextTail_12
  585. # DEBUG BEGIN_STMT
  586. _1 = pxStreamBuffer_11(D)->ucFlags;
  587. _2 = (int) _1;
  588. _3 = _2 & 1;
  589. if (_3 != 0)
  590. goto <bb 3>; [INV]
  591. else
  592. goto <bb 5>; [INV]
  593. <bb 3> :
  594. # DEBUG BEGIN_STMT
  595. xNextTail_17 = prvReadBytesFromBuffer (pxStreamBuffer_11(D), &xTempNextMessageLength, 4, xNextTail_12);
  596. # DEBUG xNextTail => xNextTail_17
  597. # DEBUG BEGIN_STMT
  598. xNextMessageLength_18 = xTempNextMessageLength;
  599. # DEBUG xNextMessageLength => xNextMessageLength_18
  600. # DEBUG BEGIN_STMT
  601. xBytesAvailable_19 = xBytesAvailable_15(D) + 4294967292;
  602. # DEBUG xBytesAvailable => xBytesAvailable_19
  603. # DEBUG BEGIN_STMT
  604. if (xNextMessageLength_18 > xBufferLengthBytes_13(D))
  605. goto <bb 4>; [INV]
  606. else
  607. goto <bb 6>; [INV]
  608. <bb 4> :
  609. # DEBUG BEGIN_STMT
  610. xNextMessageLength_20 = 0;
  611. # DEBUG xNextMessageLength => xNextMessageLength_20
  612. goto <bb 6>; [INV]
  613. <bb 5> :
  614. # DEBUG BEGIN_STMT
  615. xNextMessageLength_14 = xBufferLengthBytes_13(D);
  616. # DEBUG xNextMessageLength => xNextMessageLength_14
  617. <bb 6> :
  618. # xBytesAvailable_5 = PHI <xBytesAvailable_19(4), xBytesAvailable_15(D)(5), xBytesAvailable_19(3)>
  619. # xNextMessageLength_6 = PHI <xNextMessageLength_20(4), xNextMessageLength_14(5), xNextMessageLength_18(3)>
  620. # xNextTail_7 = PHI <xNextTail_17(4), xNextTail_12(5), xNextTail_17(3)>
  621. # DEBUG xNextTail => xNextTail_7
  622. # DEBUG xNextMessageLength => xNextMessageLength_6
  623. # DEBUG xBytesAvailable => xBytesAvailable_5
  624. # DEBUG BEGIN_STMT
  625. xCount_21 = MIN_EXPR <xBytesAvailable_5, xNextMessageLength_6>;
  626. # DEBUG xCount => xCount_21
  627. # DEBUG BEGIN_STMT
  628. if (xCount_21 != 0)
  629. goto <bb 7>; [INV]
  630. else
  631. goto <bb 8>; [INV]
  632. <bb 7> :
  633. # DEBUG BEGIN_STMT
  634. _4 = prvReadBytesFromBuffer (pxStreamBuffer_11(D), pvRxData_22(D), xCount_21, xNextTail_7);
  635. pxStreamBuffer_11(D)->xTail ={v} _4;
  636. <bb 8> :
  637. # DEBUG BEGIN_STMT
  638. _25 = xCount_21;
  639. xTempNextMessageLength ={v} {CLOBBER};
  640. return _25;
  641. }
  642. xStreamBufferReceiveFromISR (struct StreamBufferDef_t * xStreamBuffer, void * pvRxData, size_t xBufferLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken)
  643. {
  644. UBaseType_t uxSavedInterruptStatus;
  645. size_t xBytesToStoreMessageLength;
  646. size_t xBytesAvailable;
  647. size_t xReceivedLength;
  648. struct StreamBuffer_t * const pxStreamBuffer;
  649. unsigned char _1;
  650. int _2;
  651. int _3;
  652. struct tskTaskControlBlock * _4;
  653. struct tskTaskControlBlock * _5;
  654. size_t _28;
  655. <bb 2> :
  656. # DEBUG BEGIN_STMT
  657. pxStreamBuffer_11 = xStreamBuffer_10(D);
  658. # DEBUG pxStreamBuffer => pxStreamBuffer_11
  659. # DEBUG BEGIN_STMT
  660. xReceivedLength_12 = 0;
  661. # DEBUG xReceivedLength => xReceivedLength_12
  662. # DEBUG BEGIN_STMT
  663. if (pvRxData_13(D) == 0B)
  664. goto <bb 3>; [INV]
  665. else
  666. goto <bb 5>; [INV]
  667. <bb 3> :
  668. # DEBUG BEGIN_STMT
  669. vPortRaiseBASEPRI ();
  670. <bb 4> :
  671. # DEBUG BEGIN_STMT
  672. # DEBUG BEGIN_STMT
  673. # DEBUG BEGIN_STMT
  674. goto <bb 4>; [INV]
  675. <bb 5> :
  676. # DEBUG BEGIN_STMT
  677. # DEBUG BEGIN_STMT
  678. if (pxStreamBuffer_11 == 0B)
  679. goto <bb 6>; [INV]
  680. else
  681. goto <bb 8>; [INV]
  682. <bb 6> :
  683. # DEBUG BEGIN_STMT
  684. vPortRaiseBASEPRI ();
  685. <bb 7> :
  686. # DEBUG BEGIN_STMT
  687. # DEBUG BEGIN_STMT
  688. # DEBUG BEGIN_STMT
  689. goto <bb 7>; [INV]
  690. <bb 8> :
  691. # DEBUG BEGIN_STMT
  692. # DEBUG BEGIN_STMT
  693. _1 = pxStreamBuffer_11->ucFlags;
  694. _2 = (int) _1;
  695. _3 = _2 & 1;
  696. if (_3 != 0)
  697. goto <bb 9>; [INV]
  698. else
  699. goto <bb 10>; [INV]
  700. <bb 9> :
  701. # DEBUG BEGIN_STMT
  702. xBytesToStoreMessageLength_16 = 4;
  703. # DEBUG xBytesToStoreMessageLength => xBytesToStoreMessageLength_16
  704. goto <bb 11>; [INV]
  705. <bb 10> :
  706. # DEBUG BEGIN_STMT
  707. xBytesToStoreMessageLength_15 = 0;
  708. # DEBUG xBytesToStoreMessageLength => xBytesToStoreMessageLength_15
  709. <bb 11> :
  710. # xBytesToStoreMessageLength_7 = PHI <xBytesToStoreMessageLength_16(9), xBytesToStoreMessageLength_15(10)>
  711. # DEBUG xBytesToStoreMessageLength => xBytesToStoreMessageLength_7
  712. # DEBUG BEGIN_STMT
  713. xBytesAvailable_18 = prvBytesInBuffer (pxStreamBuffer_11);
  714. # DEBUG xBytesAvailable => xBytesAvailable_18
  715. # DEBUG BEGIN_STMT
  716. if (xBytesAvailable_18 > xBytesToStoreMessageLength_7)
  717. goto <bb 12>; [INV]
  718. else
  719. goto <bb 16>; [INV]
  720. <bb 12> :
  721. # DEBUG BEGIN_STMT
  722. xReceivedLength_21 = prvReadMessageFromBuffer (pxStreamBuffer_11, pvRxData_13(D), xBufferLengthBytes_19(D), xBytesAvailable_18);
  723. # DEBUG xReceivedLength => xReceivedLength_21
  724. # DEBUG BEGIN_STMT
  725. if (xReceivedLength_21 != 0)
  726. goto <bb 13>; [INV]
  727. else
  728. goto <bb 16>; [INV]
  729. <bb 13> :
  730. # DEBUG BEGIN_STMT
  731. # DEBUG BEGIN_STMT
  732. uxSavedInterruptStatus_23 = ulPortRaiseBASEPRI ();
  733. # DEBUG uxSavedInterruptStatus => uxSavedInterruptStatus_23
  734. # DEBUG BEGIN_STMT
  735. _4 ={v} pxStreamBuffer_11->xTaskWaitingToSend;
  736. if (_4 != 0B)
  737. goto <bb 14>; [INV]
  738. else
  739. goto <bb 15>; [INV]
  740. <bb 14> :
  741. # DEBUG BEGIN_STMT
  742. _5 ={v} pxStreamBuffer_11->xTaskWaitingToSend;
  743. xTaskGenericNotifyFromISR (_5, 0, 0, 0, 0B, pxHigherPriorityTaskWoken_24(D));
  744. # DEBUG BEGIN_STMT
  745. pxStreamBuffer_11->xTaskWaitingToSend ={v} 0B;
  746. <bb 15> :
  747. # DEBUG BEGIN_STMT
  748. vPortSetBASEPRI (uxSavedInterruptStatus_23);
  749. # DEBUG BEGIN_STMT
  750. <bb 16> :
  751. # xReceivedLength_6 = PHI <xReceivedLength_12(11), xReceivedLength_21(15), xReceivedLength_21(12)>
  752. # DEBUG xReceivedLength => xReceivedLength_6
  753. # DEBUG BEGIN_STMT
  754. # DEBUG BEGIN_STMT
  755. # DEBUG BEGIN_STMT
  756. _28 = xReceivedLength_6;
  757. return _28;
  758. }
  759. xStreamBufferNextMessageLengthBytes (struct StreamBufferDef_t * xStreamBuffer)
  760. {
  761. size_t xTempReturn;
  762. size_t xBytesAvailable;
  763. size_t xReturn;
  764. struct StreamBuffer_t * const pxStreamBuffer;
  765. unsigned char _1;
  766. int _2;
  767. int _3;
  768. unsigned int _4;
  769. size_t _17;
  770. <bb 2> :
  771. # DEBUG BEGIN_STMT
  772. pxStreamBuffer_8 = xStreamBuffer_7(D);
  773. # DEBUG pxStreamBuffer => pxStreamBuffer_8
  774. # DEBUG BEGIN_STMT
  775. # DEBUG BEGIN_STMT
  776. # DEBUG BEGIN_STMT
  777. if (pxStreamBuffer_8 == 0B)
  778. goto <bb 3>; [INV]
  779. else
  780. goto <bb 5>; [INV]
  781. <bb 3> :
  782. # DEBUG BEGIN_STMT
  783. vPortRaiseBASEPRI ();
  784. <bb 4> :
  785. # DEBUG BEGIN_STMT
  786. # DEBUG BEGIN_STMT
  787. # DEBUG BEGIN_STMT
  788. goto <bb 4>; [INV]
  789. <bb 5> :
  790. # DEBUG BEGIN_STMT
  791. # DEBUG BEGIN_STMT
  792. _1 = pxStreamBuffer_8->ucFlags;
  793. _2 = (int) _1;
  794. _3 = _2 & 1;
  795. if (_3 != 0)
  796. goto <bb 6>; [INV]
  797. else
  798. goto <bb 12>; [INV]
  799. <bb 6> :
  800. # DEBUG BEGIN_STMT
  801. xBytesAvailable_12 = prvBytesInBuffer (pxStreamBuffer_8);
  802. # DEBUG xBytesAvailable => xBytesAvailable_12
  803. # DEBUG BEGIN_STMT
  804. if (xBytesAvailable_12 > 4)
  805. goto <bb 7>; [INV]
  806. else
  807. goto <bb 8>; [INV]
  808. <bb 7> :
  809. # DEBUG BEGIN_STMT
  810. _4 ={v} pxStreamBuffer_8->xTail;
  811. prvReadBytesFromBuffer (pxStreamBuffer_8, &xTempReturn, 4, _4);
  812. # DEBUG BEGIN_STMT
  813. xReturn_16 = xTempReturn;
  814. # DEBUG xReturn => xReturn_16
  815. goto <bb 13>; [INV]
  816. <bb 8> :
  817. # DEBUG BEGIN_STMT
  818. if (xBytesAvailable_12 != 0)
  819. goto <bb 9>; [INV]
  820. else
  821. goto <bb 11>; [INV]
  822. <bb 9> :
  823. # DEBUG BEGIN_STMT
  824. vPortRaiseBASEPRI ();
  825. <bb 10> :
  826. # DEBUG BEGIN_STMT
  827. # DEBUG BEGIN_STMT
  828. # DEBUG BEGIN_STMT
  829. goto <bb 10>; [INV]
  830. <bb 11> :
  831. # DEBUG BEGIN_STMT
  832. # DEBUG BEGIN_STMT
  833. xReturn_13 = 0;
  834. # DEBUG xReturn => xReturn_13
  835. goto <bb 13>; [INV]
  836. <bb 12> :
  837. # DEBUG BEGIN_STMT
  838. xReturn_10 = 0;
  839. # DEBUG xReturn => xReturn_10
  840. <bb 13> :
  841. # xReturn_5 = PHI <xReturn_13(11), xReturn_10(12), xReturn_16(7)>
  842. # DEBUG xReturn => xReturn_5
  843. # DEBUG BEGIN_STMT
  844. _17 = xReturn_5;
  845. xTempReturn ={v} {CLOBBER};
  846. return _17;
  847. }
  848. xStreamBufferReceive (struct StreamBufferDef_t * xStreamBuffer, void * pvRxData, size_t xBufferLengthBytes, TickType_t xTicksToWait)
  849. {
  850. size_t xBytesToStoreMessageLength;
  851. size_t xBytesAvailable;
  852. size_t xReceivedLength;
  853. struct StreamBuffer_t * const pxStreamBuffer;
  854. unsigned char _1;
  855. int _2;
  856. int _3;
  857. struct tskTaskControlBlock * _4;
  858. struct tskTaskControlBlock * _5;
  859. struct tskTaskControlBlock * _6;
  860. struct tskTaskControlBlock * _7;
  861. size_t _44;
  862. <bb 2> :
  863. # DEBUG BEGIN_STMT
  864. pxStreamBuffer_16 = xStreamBuffer_15(D);
  865. # DEBUG pxStreamBuffer => pxStreamBuffer_16
  866. # DEBUG BEGIN_STMT
  867. xReceivedLength_17 = 0;
  868. # DEBUG xReceivedLength => xReceivedLength_17
  869. # DEBUG BEGIN_STMT
  870. if (pvRxData_18(D) == 0B)
  871. goto <bb 3>; [INV]
  872. else
  873. goto <bb 5>; [INV]
  874. <bb 3> :
  875. # DEBUG BEGIN_STMT
  876. vPortRaiseBASEPRI ();
  877. <bb 4> :
  878. # DEBUG BEGIN_STMT
  879. # DEBUG BEGIN_STMT
  880. # DEBUG BEGIN_STMT
  881. goto <bb 4>; [INV]
  882. <bb 5> :
  883. # DEBUG BEGIN_STMT
  884. # DEBUG BEGIN_STMT
  885. if (pxStreamBuffer_16 == 0B)
  886. goto <bb 6>; [INV]
  887. else
  888. goto <bb 8>; [INV]
  889. <bb 6> :
  890. # DEBUG BEGIN_STMT
  891. vPortRaiseBASEPRI ();
  892. <bb 7> :
  893. # DEBUG BEGIN_STMT
  894. # DEBUG BEGIN_STMT
  895. # DEBUG BEGIN_STMT
  896. goto <bb 7>; [INV]
  897. <bb 8> :
  898. # DEBUG BEGIN_STMT
  899. # DEBUG BEGIN_STMT
  900. _1 = pxStreamBuffer_16->ucFlags;
  901. _2 = (int) _1;
  902. _3 = _2 & 1;
  903. if (_3 != 0)
  904. goto <bb 9>; [INV]
  905. else
  906. goto <bb 10>; [INV]
  907. <bb 9> :
  908. # DEBUG BEGIN_STMT
  909. xBytesToStoreMessageLength_21 = 4;
  910. # DEBUG xBytesToStoreMessageLength => xBytesToStoreMessageLength_21
  911. goto <bb 11>; [INV]
  912. <bb 10> :
  913. # DEBUG BEGIN_STMT
  914. xBytesToStoreMessageLength_20 = 0;
  915. # DEBUG xBytesToStoreMessageLength => xBytesToStoreMessageLength_20
  916. <bb 11> :
  917. # xBytesToStoreMessageLength_10 = PHI <xBytesToStoreMessageLength_21(9), xBytesToStoreMessageLength_20(10)>
  918. # DEBUG xBytesToStoreMessageLength => xBytesToStoreMessageLength_10
  919. # DEBUG BEGIN_STMT
  920. if (xTicksToWait_22(D) != 0)
  921. goto <bb 12>; [INV]
  922. else
  923. goto <bb 19>; [INV]
  924. <bb 12> :
  925. # DEBUG BEGIN_STMT
  926. vPortEnterCritical ();
  927. # DEBUG BEGIN_STMT
  928. xBytesAvailable_27 = prvBytesInBuffer (pxStreamBuffer_16);
  929. # DEBUG xBytesAvailable => xBytesAvailable_27
  930. # DEBUG BEGIN_STMT
  931. if (xBytesAvailable_27 <= xBytesToStoreMessageLength_10)
  932. goto <bb 13>; [INV]
  933. else
  934. goto <bb 17>; [INV]
  935. <bb 13> :
  936. # DEBUG BEGIN_STMT
  937. xTaskGenericNotifyStateClear (0B, 0);
  938. # DEBUG BEGIN_STMT
  939. _4 ={v} pxStreamBuffer_16->xTaskWaitingToReceive;
  940. if (_4 != 0B)
  941. goto <bb 14>; [INV]
  942. else
  943. goto <bb 16>; [INV]
  944. <bb 14> :
  945. # DEBUG BEGIN_STMT
  946. vPortRaiseBASEPRI ();
  947. <bb 15> :
  948. # DEBUG BEGIN_STMT
  949. # DEBUG BEGIN_STMT
  950. # DEBUG BEGIN_STMT
  951. goto <bb 15>; [INV]
  952. <bb 16> :
  953. # DEBUG BEGIN_STMT
  954. # DEBUG BEGIN_STMT
  955. _5 = xTaskGetCurrentTaskHandle ();
  956. pxStreamBuffer_16->xTaskWaitingToReceive ={v} _5;
  957. <bb 17> :
  958. # DEBUG BEGIN_STMT
  959. # DEBUG BEGIN_STMT
  960. vPortExitCritical ();
  961. # DEBUG BEGIN_STMT
  962. if (xBytesAvailable_27 <= xBytesToStoreMessageLength_10)
  963. goto <bb 18>; [INV]
  964. else
  965. goto <bb 20>; [INV]
  966. <bb 18> :
  967. # DEBUG BEGIN_STMT
  968. # DEBUG BEGIN_STMT
  969. xTaskGenericNotifyWait (0, 0, 0, 0B, xTicksToWait_22(D));
  970. # DEBUG BEGIN_STMT
  971. pxStreamBuffer_16->xTaskWaitingToReceive ={v} 0B;
  972. # DEBUG BEGIN_STMT
  973. xBytesAvailable_36 = prvBytesInBuffer (pxStreamBuffer_16);
  974. # DEBUG xBytesAvailable => xBytesAvailable_36
  975. goto <bb 20>; [INV]
  976. <bb 19> :
  977. # DEBUG BEGIN_STMT
  978. xBytesAvailable_24 = prvBytesInBuffer (pxStreamBuffer_16);
  979. # DEBUG xBytesAvailable => xBytesAvailable_24
  980. <bb 20> :
  981. # xBytesAvailable_9 = PHI <xBytesAvailable_36(18), xBytesAvailable_24(19), xBytesAvailable_27(17)>
  982. # DEBUG xBytesAvailable => xBytesAvailable_9
  983. # DEBUG BEGIN_STMT
  984. if (xBytesAvailable_9 > xBytesToStoreMessageLength_10)
  985. goto <bb 21>; [INV]
  986. else
  987. goto <bb 25>; [INV]
  988. <bb 21> :
  989. # DEBUG BEGIN_STMT
  990. xReceivedLength_39 = prvReadMessageFromBuffer (pxStreamBuffer_16, pvRxData_18(D), xBufferLengthBytes_37(D), xBytesAvailable_9);
  991. # DEBUG xReceivedLength => xReceivedLength_39
  992. # DEBUG BEGIN_STMT
  993. if (xReceivedLength_39 != 0)
  994. goto <bb 22>; [INV]
  995. else
  996. goto <bb 25>; [INV]
  997. <bb 22> :
  998. # DEBUG BEGIN_STMT
  999. # DEBUG BEGIN_STMT
  1000. vTaskSuspendAll ();
  1001. # DEBUG BEGIN_STMT
  1002. _6 ={v} pxStreamBuffer_16->xTaskWaitingToSend;
  1003. if (_6 != 0B)
  1004. goto <bb 23>; [INV]
  1005. else
  1006. goto <bb 24>; [INV]
  1007. <bb 23> :
  1008. # DEBUG BEGIN_STMT
  1009. _7 ={v} pxStreamBuffer_16->xTaskWaitingToSend;
  1010. xTaskGenericNotify (_7, 0, 0, 0, 0B);
  1011. # DEBUG BEGIN_STMT
  1012. pxStreamBuffer_16->xTaskWaitingToSend ={v} 0B;
  1013. <bb 24> :
  1014. # DEBUG BEGIN_STMT
  1015. xTaskResumeAll ();
  1016. # DEBUG BEGIN_STMT
  1017. <bb 25> :
  1018. # xReceivedLength_8 = PHI <xReceivedLength_17(20), xReceivedLength_39(24), xReceivedLength_39(21)>
  1019. # DEBUG xReceivedLength => xReceivedLength_8
  1020. # DEBUG BEGIN_STMT
  1021. # DEBUG BEGIN_STMT
  1022. # DEBUG BEGIN_STMT
  1023. _44 = xReceivedLength_8;
  1024. return _44;
  1025. }
  1026. prvWriteMessageToBuffer (struct StreamBuffer_t * const pxStreamBuffer, const void * pvTxData, size_t xDataLengthBytes, size_t xSpace, size_t xRequiredSpace)
  1027. {
  1028. size_t xNextHead;
  1029. unsigned char _1;
  1030. int _2;
  1031. int _3;
  1032. unsigned int xDataLengthBytes.2_4;
  1033. unsigned int _5;
  1034. unsigned int xDataLengthBytes.3_6;
  1035. unsigned int xDataLengthBytes.4_7;
  1036. unsigned int _8;
  1037. size_t _24;
  1038. <bb 2> :
  1039. # DEBUG BEGIN_STMT
  1040. xNextHead_14 ={v} pxStreamBuffer_13(D)->xHead;
  1041. # DEBUG xNextHead => xNextHead_14
  1042. # DEBUG BEGIN_STMT
  1043. _1 = pxStreamBuffer_13(D)->ucFlags;
  1044. _2 = (int) _1;
  1045. _3 = _2 & 1;
  1046. if (_3 != 0)
  1047. goto <bb 3>; [INV]
  1048. else
  1049. goto <bb 6>; [INV]
  1050. <bb 3> :
  1051. # DEBUG BEGIN_STMT
  1052. if (xSpace_15(D) >= xRequiredSpace_17(D))
  1053. goto <bb 4>; [INV]
  1054. else
  1055. goto <bb 5>; [INV]
  1056. <bb 4> :
  1057. # DEBUG BEGIN_STMT
  1058. xNextHead_20 = prvWriteBytesToBuffer (pxStreamBuffer_13(D), &xDataLengthBytes, 4, xNextHead_14);
  1059. # DEBUG xNextHead => xNextHead_20
  1060. goto <bb 7>; [INV]
  1061. <bb 5> :
  1062. # DEBUG BEGIN_STMT
  1063. xDataLengthBytes = 0;
  1064. goto <bb 7>; [INV]
  1065. <bb 6> :
  1066. # DEBUG BEGIN_STMT
  1067. xDataLengthBytes.2_4 = xDataLengthBytes;
  1068. _5 = MIN_EXPR <xSpace_15(D), xDataLengthBytes.2_4>;
  1069. xDataLengthBytes = _5;
  1070. <bb 7> :
  1071. # xNextHead_9 = PHI <xNextHead_14(5), xNextHead_14(6), xNextHead_20(4)>
  1072. # DEBUG xNextHead => xNextHead_9
  1073. # DEBUG BEGIN_STMT
  1074. xDataLengthBytes.3_6 = xDataLengthBytes;
  1075. if (xDataLengthBytes.3_6 != 0)
  1076. goto <bb 8>; [INV]
  1077. else
  1078. goto <bb 9>; [INV]
  1079. <bb 8> :
  1080. # DEBUG BEGIN_STMT
  1081. xDataLengthBytes.4_7 = xDataLengthBytes;
  1082. _8 = prvWriteBytesToBuffer (pxStreamBuffer_13(D), pvTxData_21(D), xDataLengthBytes.4_7, xNextHead_9);
  1083. pxStreamBuffer_13(D)->xHead ={v} _8;
  1084. <bb 9> :
  1085. # DEBUG BEGIN_STMT
  1086. _24 = xDataLengthBytes;
  1087. return _24;
  1088. }
  1089. xStreamBufferSendFromISR (struct StreamBufferDef_t * xStreamBuffer, const void * pvTxData, size_t xDataLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken)
  1090. {
  1091. UBaseType_t uxSavedInterruptStatus;
  1092. size_t xRequiredSpace;
  1093. size_t xSpace;
  1094. size_t xReturn;
  1095. struct StreamBuffer_t * const pxStreamBuffer;
  1096. unsigned char _1;
  1097. int _2;
  1098. int _3;
  1099. unsigned int _4;
  1100. unsigned int _5;
  1101. struct tskTaskControlBlock * _6;
  1102. struct tskTaskControlBlock * _7;
  1103. size_t _29;
  1104. <bb 2> :
  1105. # DEBUG BEGIN_STMT
  1106. pxStreamBuffer_12 = xStreamBuffer_11(D);
  1107. # DEBUG pxStreamBuffer => pxStreamBuffer_12
  1108. # DEBUG BEGIN_STMT
  1109. # DEBUG BEGIN_STMT
  1110. xRequiredSpace_14 = xDataLengthBytes_13(D);
  1111. # DEBUG xRequiredSpace => xRequiredSpace_14
  1112. # DEBUG BEGIN_STMT
  1113. if (pvTxData_15(D) == 0B)
  1114. goto <bb 3>; [INV]
  1115. else
  1116. goto <bb 5>; [INV]
  1117. <bb 3> :
  1118. # DEBUG BEGIN_STMT
  1119. vPortRaiseBASEPRI ();
  1120. <bb 4> :
  1121. # DEBUG BEGIN_STMT
  1122. # DEBUG BEGIN_STMT
  1123. # DEBUG BEGIN_STMT
  1124. goto <bb 4>; [INV]
  1125. <bb 5> :
  1126. # DEBUG BEGIN_STMT
  1127. # DEBUG BEGIN_STMT
  1128. if (pxStreamBuffer_12 == 0B)
  1129. goto <bb 6>; [INV]
  1130. else
  1131. goto <bb 8>; [INV]
  1132. <bb 6> :
  1133. # DEBUG BEGIN_STMT
  1134. vPortRaiseBASEPRI ();
  1135. <bb 7> :
  1136. # DEBUG BEGIN_STMT
  1137. # DEBUG BEGIN_STMT
  1138. # DEBUG BEGIN_STMT
  1139. goto <bb 7>; [INV]
  1140. <bb 8> :
  1141. # DEBUG BEGIN_STMT
  1142. # DEBUG BEGIN_STMT
  1143. _1 = pxStreamBuffer_12->ucFlags;
  1144. _2 = (int) _1;
  1145. _3 = _2 & 1;
  1146. if (_3 != 0)
  1147. goto <bb 9>; [INV]
  1148. else
  1149. goto <bb 10>; [INV]
  1150. <bb 9> :
  1151. # DEBUG BEGIN_STMT
  1152. xRequiredSpace_17 = xRequiredSpace_14 + 4;
  1153. # DEBUG xRequiredSpace => xRequiredSpace_17
  1154. <bb 10> :
  1155. # xRequiredSpace_8 = PHI <xRequiredSpace_14(8), xRequiredSpace_17(9)>
  1156. # DEBUG xRequiredSpace => xRequiredSpace_8
  1157. # DEBUG BEGIN_STMT
  1158. # DEBUG BEGIN_STMT
  1159. xSpace_19 = xStreamBufferSpacesAvailable (pxStreamBuffer_12);
  1160. # DEBUG xSpace => xSpace_19
  1161. # DEBUG BEGIN_STMT
  1162. xReturn_21 = prvWriteMessageToBuffer (pxStreamBuffer_12, pvTxData_15(D), xDataLengthBytes_13(D), xSpace_19, xRequiredSpace_8);
  1163. # DEBUG xReturn => xReturn_21
  1164. # DEBUG BEGIN_STMT
  1165. if (xReturn_21 != 0)
  1166. goto <bb 11>; [INV]
  1167. else
  1168. goto <bb 15>; [INV]
  1169. <bb 11> :
  1170. # DEBUG BEGIN_STMT
  1171. _4 = prvBytesInBuffer (pxStreamBuffer_12);
  1172. _5 = pxStreamBuffer_12->xTriggerLevelBytes;
  1173. if (_4 >= _5)
  1174. goto <bb 12>; [INV]
  1175. else
  1176. goto <bb 15>; [INV]
  1177. <bb 12> :
  1178. # DEBUG BEGIN_STMT
  1179. # DEBUG BEGIN_STMT
  1180. uxSavedInterruptStatus_24 = ulPortRaiseBASEPRI ();
  1181. # DEBUG uxSavedInterruptStatus => uxSavedInterruptStatus_24
  1182. # DEBUG BEGIN_STMT
  1183. _6 ={v} pxStreamBuffer_12->xTaskWaitingToReceive;
  1184. if (_6 != 0B)
  1185. goto <bb 13>; [INV]
  1186. else
  1187. goto <bb 14>; [INV]
  1188. <bb 13> :
  1189. # DEBUG BEGIN_STMT
  1190. _7 ={v} pxStreamBuffer_12->xTaskWaitingToReceive;
  1191. xTaskGenericNotifyFromISR (_7, 0, 0, 0, 0B, pxHigherPriorityTaskWoken_25(D));
  1192. # DEBUG BEGIN_STMT
  1193. pxStreamBuffer_12->xTaskWaitingToReceive ={v} 0B;
  1194. <bb 14> :
  1195. # DEBUG BEGIN_STMT
  1196. vPortSetBASEPRI (uxSavedInterruptStatus_24);
  1197. # DEBUG BEGIN_STMT
  1198. <bb 15> :
  1199. # DEBUG BEGIN_STMT
  1200. # DEBUG BEGIN_STMT
  1201. # DEBUG BEGIN_STMT
  1202. _29 = xReturn_21;
  1203. return _29;
  1204. }
  1205. xStreamBufferSend (struct StreamBufferDef_t * xStreamBuffer, const void * pvTxData, size_t xDataLengthBytes, TickType_t xTicksToWait)
  1206. {
  1207. size_t xMaxReportedSpace;
  1208. struct TimeOut_t xTimeOut;
  1209. size_t xRequiredSpace;
  1210. size_t xSpace;
  1211. size_t xReturn;
  1212. struct StreamBuffer_t * const pxStreamBuffer;
  1213. unsigned int _1;
  1214. unsigned char _2;
  1215. int _3;
  1216. int _4;
  1217. long unsigned int xTicksToWait.0_5;
  1218. struct tskTaskControlBlock * _6;
  1219. struct tskTaskControlBlock * _7;
  1220. long unsigned int xTicksToWait.1_8;
  1221. long int _9;
  1222. unsigned int _10;
  1223. unsigned int _11;
  1224. struct tskTaskControlBlock * _12;
  1225. struct tskTaskControlBlock * _13;
  1226. size_t _58;
  1227. <bb 2> :
  1228. # DEBUG BEGIN_STMT
  1229. pxStreamBuffer_24 = xStreamBuffer_23(D);
  1230. # DEBUG pxStreamBuffer => pxStreamBuffer_24
  1231. # DEBUG BEGIN_STMT
  1232. xSpace_25 = 0;
  1233. # DEBUG xSpace => xSpace_25
  1234. # DEBUG BEGIN_STMT
  1235. xRequiredSpace_27 = xDataLengthBytes_26(D);
  1236. # DEBUG xRequiredSpace => xRequiredSpace_27
  1237. # DEBUG BEGIN_STMT
  1238. # DEBUG BEGIN_STMT
  1239. xMaxReportedSpace_28 = 0;
  1240. # DEBUG xMaxReportedSpace => xMaxReportedSpace_28
  1241. # DEBUG BEGIN_STMT
  1242. if (pvTxData_29(D) == 0B)
  1243. goto <bb 3>; [INV]
  1244. else
  1245. goto <bb 5>; [INV]
  1246. <bb 3> :
  1247. # DEBUG BEGIN_STMT
  1248. vPortRaiseBASEPRI ();
  1249. <bb 4> :
  1250. # DEBUG BEGIN_STMT
  1251. # DEBUG BEGIN_STMT
  1252. # DEBUG BEGIN_STMT
  1253. goto <bb 4>; [INV]
  1254. <bb 5> :
  1255. # DEBUG BEGIN_STMT
  1256. # DEBUG BEGIN_STMT
  1257. if (pxStreamBuffer_24 == 0B)
  1258. goto <bb 6>; [INV]
  1259. else
  1260. goto <bb 8>; [INV]
  1261. <bb 6> :
  1262. # DEBUG BEGIN_STMT
  1263. vPortRaiseBASEPRI ();
  1264. <bb 7> :
  1265. # DEBUG BEGIN_STMT
  1266. # DEBUG BEGIN_STMT
  1267. # DEBUG BEGIN_STMT
  1268. goto <bb 7>; [INV]
  1269. <bb 8> :
  1270. # DEBUG BEGIN_STMT
  1271. # DEBUG BEGIN_STMT
  1272. _1 = pxStreamBuffer_24->xLength;
  1273. xMaxReportedSpace_31 = _1 + 4294967295;
  1274. # DEBUG xMaxReportedSpace => xMaxReportedSpace_31
  1275. # DEBUG BEGIN_STMT
  1276. _2 = pxStreamBuffer_24->ucFlags;
  1277. _3 = (int) _2;
  1278. _4 = _3 & 1;
  1279. if (_4 != 0)
  1280. goto <bb 9>; [INV]
  1281. else
  1282. goto <bb 14>; [INV]
  1283. <bb 9> :
  1284. # DEBUG BEGIN_STMT
  1285. xRequiredSpace_33 = xRequiredSpace_27 + 4;
  1286. # DEBUG xRequiredSpace => xRequiredSpace_33
  1287. # DEBUG BEGIN_STMT
  1288. if (xRequiredSpace_33 <= xDataLengthBytes_26(D))
  1289. goto <bb 10>; [INV]
  1290. else
  1291. goto <bb 12>; [INV]
  1292. <bb 10> :
  1293. # DEBUG BEGIN_STMT
  1294. vPortRaiseBASEPRI ();
  1295. <bb 11> :
  1296. # DEBUG BEGIN_STMT
  1297. # DEBUG BEGIN_STMT
  1298. # DEBUG BEGIN_STMT
  1299. goto <bb 11>; [INV]
  1300. <bb 12> :
  1301. # DEBUG BEGIN_STMT
  1302. # DEBUG BEGIN_STMT
  1303. if (xRequiredSpace_33 > xMaxReportedSpace_31)
  1304. goto <bb 13>; [INV]
  1305. else
  1306. goto <bb 16>; [INV]
  1307. <bb 13> :
  1308. # DEBUG BEGIN_STMT
  1309. xTicksToWait = 0;
  1310. goto <bb 16>; [INV]
  1311. <bb 14> :
  1312. # DEBUG BEGIN_STMT
  1313. if (xRequiredSpace_27 > xMaxReportedSpace_31)
  1314. goto <bb 15>; [INV]
  1315. else
  1316. goto <bb 16>; [INV]
  1317. <bb 15> :
  1318. # DEBUG BEGIN_STMT
  1319. xRequiredSpace_32 = xMaxReportedSpace_31;
  1320. # DEBUG xRequiredSpace => xRequiredSpace_32
  1321. <bb 16> :
  1322. # xRequiredSpace_16 = PHI <xRequiredSpace_33(13), xRequiredSpace_27(14), xRequiredSpace_32(15), xRequiredSpace_33(12)>
  1323. # DEBUG xRequiredSpace => xRequiredSpace_16
  1324. # DEBUG BEGIN_STMT
  1325. # DEBUG BEGIN_STMT
  1326. xTicksToWait.0_5 = xTicksToWait;
  1327. if (xTicksToWait.0_5 != 0)
  1328. goto <bb 17>; [INV]
  1329. else
  1330. goto <bb 24>; [INV]
  1331. <bb 17> :
  1332. # DEBUG BEGIN_STMT
  1333. vTaskSetTimeOutState (&xTimeOut);
  1334. <bb 18> :
  1335. # DEBUG BEGIN_STMT
  1336. # DEBUG BEGIN_STMT
  1337. vPortEnterCritical ();
  1338. # DEBUG BEGIN_STMT
  1339. xSpace_39 = xStreamBufferSpacesAvailable (pxStreamBuffer_24);
  1340. # DEBUG xSpace => xSpace_39
  1341. # DEBUG BEGIN_STMT
  1342. if (xSpace_39 < xRequiredSpace_16)
  1343. goto <bb 19>; [INV]
  1344. else
  1345. goto <bb 23>; [INV]
  1346. <bb 19> :
  1347. # DEBUG BEGIN_STMT
  1348. xTaskGenericNotifyStateClear (0B, 0);
  1349. # DEBUG BEGIN_STMT
  1350. _6 ={v} pxStreamBuffer_24->xTaskWaitingToSend;
  1351. if (_6 != 0B)
  1352. goto <bb 20>; [INV]
  1353. else
  1354. goto <bb 22>; [INV]
  1355. <bb 20> :
  1356. # DEBUG BEGIN_STMT
  1357. vPortRaiseBASEPRI ();
  1358. <bb 21> :
  1359. # DEBUG BEGIN_STMT
  1360. # DEBUG BEGIN_STMT
  1361. # DEBUG BEGIN_STMT
  1362. goto <bb 21>; [INV]
  1363. <bb 22> :
  1364. # DEBUG BEGIN_STMT
  1365. # DEBUG BEGIN_STMT
  1366. _7 = xTaskGetCurrentTaskHandle ();
  1367. pxStreamBuffer_24->xTaskWaitingToSend ={v} _7;
  1368. # DEBUG BEGIN_STMT
  1369. vPortExitCritical ();
  1370. # DEBUG BEGIN_STMT
  1371. # DEBUG BEGIN_STMT
  1372. xTicksToWait.1_8 = xTicksToWait;
  1373. xTaskGenericNotifyWait (0, 0, 0, 0B, xTicksToWait.1_8);
  1374. # DEBUG BEGIN_STMT
  1375. pxStreamBuffer_24->xTaskWaitingToSend ={v} 0B;
  1376. # DEBUG BEGIN_STMT
  1377. _9 = xTaskCheckForTimeOut (&xTimeOut, &xTicksToWait);
  1378. if (_9 == 0)
  1379. goto <bb 18>; [INV]
  1380. else
  1381. goto <bb 24>; [INV]
  1382. <bb 23> :
  1383. # DEBUG BEGIN_STMT
  1384. vPortExitCritical ();
  1385. # DEBUG BEGIN_STMT
  1386. <bb 24> :
  1387. # xSpace_14 = PHI <xSpace_25(16), xSpace_39(22), xSpace_39(23)>
  1388. # DEBUG xSpace => xSpace_14
  1389. # DEBUG BEGIN_STMT
  1390. # DEBUG BEGIN_STMT
  1391. if (xSpace_14 == 0)
  1392. goto <bb 25>; [INV]
  1393. else
  1394. goto <bb 26>; [INV]
  1395. <bb 25> :
  1396. # DEBUG BEGIN_STMT
  1397. xSpace_50 = xStreamBufferSpacesAvailable (pxStreamBuffer_24);
  1398. # DEBUG xSpace => xSpace_50
  1399. <bb 26> :
  1400. # xSpace_15 = PHI <xSpace_14(24), xSpace_50(25)>
  1401. # DEBUG xSpace => xSpace_15
  1402. # DEBUG BEGIN_STMT
  1403. # DEBUG BEGIN_STMT
  1404. xReturn_52 = prvWriteMessageToBuffer (pxStreamBuffer_24, pvTxData_29(D), xDataLengthBytes_26(D), xSpace_15, xRequiredSpace_16);
  1405. # DEBUG xReturn => xReturn_52
  1406. # DEBUG BEGIN_STMT
  1407. if (xReturn_52 != 0)
  1408. goto <bb 27>; [INV]
  1409. else
  1410. goto <bb 31>; [INV]
  1411. <bb 27> :
  1412. # DEBUG BEGIN_STMT
  1413. # DEBUG BEGIN_STMT
  1414. _10 = prvBytesInBuffer (pxStreamBuffer_24);
  1415. _11 = pxStreamBuffer_24->xTriggerLevelBytes;
  1416. if (_10 >= _11)
  1417. goto <bb 28>; [INV]
  1418. else
  1419. goto <bb 31>; [INV]
  1420. <bb 28> :
  1421. # DEBUG BEGIN_STMT
  1422. vTaskSuspendAll ();
  1423. # DEBUG BEGIN_STMT
  1424. _12 ={v} pxStreamBuffer_24->xTaskWaitingToReceive;
  1425. if (_12 != 0B)
  1426. goto <bb 29>; [INV]
  1427. else
  1428. goto <bb 30>; [INV]
  1429. <bb 29> :
  1430. # DEBUG BEGIN_STMT
  1431. _13 ={v} pxStreamBuffer_24->xTaskWaitingToReceive;
  1432. xTaskGenericNotify (_13, 0, 0, 0, 0B);
  1433. # DEBUG BEGIN_STMT
  1434. pxStreamBuffer_24->xTaskWaitingToReceive ={v} 0B;
  1435. <bb 30> :
  1436. # DEBUG BEGIN_STMT
  1437. xTaskResumeAll ();
  1438. # DEBUG BEGIN_STMT
  1439. <bb 31> :
  1440. # DEBUG BEGIN_STMT
  1441. # DEBUG BEGIN_STMT
  1442. # DEBUG BEGIN_STMT
  1443. _58 = xReturn_52;
  1444. xTimeOut ={v} {CLOBBER};
  1445. return _58;
  1446. }
  1447. xStreamBufferBytesAvailable (struct StreamBufferDef_t * xStreamBuffer)
  1448. {
  1449. size_t xReturn;
  1450. const struct StreamBuffer_t * const pxStreamBuffer;
  1451. size_t _6;
  1452. <bb 2> :
  1453. # DEBUG BEGIN_STMT
  1454. pxStreamBuffer_2 = xStreamBuffer_1(D);
  1455. # DEBUG pxStreamBuffer => pxStreamBuffer_2
  1456. # DEBUG BEGIN_STMT
  1457. # DEBUG BEGIN_STMT
  1458. if (pxStreamBuffer_2 == 0B)
  1459. goto <bb 3>; [INV]
  1460. else
  1461. goto <bb 5>; [INV]
  1462. <bb 3> :
  1463. # DEBUG BEGIN_STMT
  1464. vPortRaiseBASEPRI ();
  1465. <bb 4> :
  1466. # DEBUG BEGIN_STMT
  1467. # DEBUG BEGIN_STMT
  1468. # DEBUG BEGIN_STMT
  1469. goto <bb 4>; [INV]
  1470. <bb 5> :
  1471. # DEBUG BEGIN_STMT
  1472. # DEBUG BEGIN_STMT
  1473. xReturn_5 = prvBytesInBuffer (pxStreamBuffer_2);
  1474. # DEBUG xReturn => xReturn_5
  1475. # DEBUG BEGIN_STMT
  1476. _6 = xReturn_5;
  1477. return _6;
  1478. }
  1479. xStreamBufferSpacesAvailable (struct StreamBufferDef_t * xStreamBuffer)
  1480. {
  1481. size_t xOriginalTail;
  1482. size_t xSpace;
  1483. const struct StreamBuffer_t * const pxStreamBuffer;
  1484. unsigned int _1;
  1485. unsigned int _2;
  1486. unsigned int _3;
  1487. unsigned int _4;
  1488. unsigned int _5;
  1489. unsigned int _12;
  1490. size_t _16;
  1491. <bb 2> :
  1492. # DEBUG BEGIN_STMT
  1493. pxStreamBuffer_8 = xStreamBuffer_7(D);
  1494. # DEBUG pxStreamBuffer => pxStreamBuffer_8
  1495. # DEBUG BEGIN_STMT
  1496. # DEBUG BEGIN_STMT
  1497. # DEBUG BEGIN_STMT
  1498. if (pxStreamBuffer_8 == 0B)
  1499. goto <bb 3>; [INV]
  1500. else
  1501. goto <bb 5>; [INV]
  1502. <bb 3> :
  1503. # DEBUG BEGIN_STMT
  1504. vPortRaiseBASEPRI ();
  1505. <bb 4> :
  1506. # DEBUG BEGIN_STMT
  1507. # DEBUG BEGIN_STMT
  1508. # DEBUG BEGIN_STMT
  1509. goto <bb 4>; [INV]
  1510. <bb 5> :
  1511. # DEBUG BEGIN_STMT
  1512. # DEBUG BEGIN_STMT
  1513. # DEBUG BEGIN_STMT
  1514. xOriginalTail_10 ={v} pxStreamBuffer_8->xTail;
  1515. # DEBUG xOriginalTail => xOriginalTail_10
  1516. # DEBUG BEGIN_STMT
  1517. _1 = pxStreamBuffer_8->xLength;
  1518. _2 ={v} pxStreamBuffer_8->xTail;
  1519. xSpace_11 = _1 + _2;
  1520. # DEBUG xSpace => xSpace_11
  1521. # DEBUG BEGIN_STMT
  1522. _12 ={v} pxStreamBuffer_8->xHead;
  1523. xSpace_13 = xSpace_11 - _12;
  1524. # DEBUG xSpace => xSpace_13
  1525. # DEBUG BEGIN_STMT
  1526. _3 ={v} pxStreamBuffer_8->xTail;
  1527. if (xOriginalTail_10 != _3)
  1528. goto <bb 5>; [INV]
  1529. else
  1530. goto <bb 6>; [INV]
  1531. <bb 6> :
  1532. # DEBUG BEGIN_STMT
  1533. xSpace_14 = xSpace_13 + 4294967295;
  1534. # DEBUG xSpace => xSpace_14
  1535. # DEBUG BEGIN_STMT
  1536. _4 = pxStreamBuffer_8->xLength;
  1537. if (xSpace_14 >= _4)
  1538. goto <bb 7>; [INV]
  1539. else
  1540. goto <bb 8>; [INV]
  1541. <bb 7> :
  1542. # DEBUG BEGIN_STMT
  1543. _5 = pxStreamBuffer_8->xLength;
  1544. xSpace_15 = xSpace_14 - _5;
  1545. # DEBUG xSpace => xSpace_15
  1546. <bb 8> :
  1547. # xSpace_6 = PHI <xSpace_14(6), xSpace_15(7)>
  1548. # DEBUG xSpace => xSpace_6
  1549. # DEBUG BEGIN_STMT
  1550. # DEBUG BEGIN_STMT
  1551. _16 = xSpace_6;
  1552. return _16;
  1553. }
  1554. xStreamBufferSetTriggerLevel (struct StreamBufferDef_t * xStreamBuffer, size_t xTriggerLevel)
  1555. {
  1556. BaseType_t xReturn;
  1557. struct StreamBuffer_t * const pxStreamBuffer;
  1558. unsigned int _1;
  1559. BaseType_t _13;
  1560. <bb 2> :
  1561. # DEBUG BEGIN_STMT
  1562. pxStreamBuffer_6 = xStreamBuffer_5(D);
  1563. # DEBUG pxStreamBuffer => pxStreamBuffer_6
  1564. # DEBUG BEGIN_STMT
  1565. # DEBUG BEGIN_STMT
  1566. if (pxStreamBuffer_6 == 0B)
  1567. goto <bb 3>; [INV]
  1568. else
  1569. goto <bb 5>; [INV]
  1570. <bb 3> :
  1571. # DEBUG BEGIN_STMT
  1572. vPortRaiseBASEPRI ();
  1573. <bb 4> :
  1574. # DEBUG BEGIN_STMT
  1575. # DEBUG BEGIN_STMT
  1576. # DEBUG BEGIN_STMT
  1577. goto <bb 4>; [INV]
  1578. <bb 5> :
  1579. # DEBUG BEGIN_STMT
  1580. # DEBUG BEGIN_STMT
  1581. if (xTriggerLevel_7(D) == 0)
  1582. goto <bb 6>; [INV]
  1583. else
  1584. goto <bb 7>; [INV]
  1585. <bb 6> :
  1586. # DEBUG BEGIN_STMT
  1587. xTriggerLevel_8 = 1;
  1588. # DEBUG xTriggerLevel => xTriggerLevel_8
  1589. <bb 7> :
  1590. # xTriggerLevel_2 = PHI <xTriggerLevel_7(D)(5), xTriggerLevel_8(6)>
  1591. # DEBUG xTriggerLevel => xTriggerLevel_2
  1592. # DEBUG BEGIN_STMT
  1593. _1 = pxStreamBuffer_6->xLength;
  1594. if (xTriggerLevel_2 < _1)
  1595. goto <bb 8>; [INV]
  1596. else
  1597. goto <bb 9>; [INV]
  1598. <bb 8> :
  1599. # DEBUG BEGIN_STMT
  1600. pxStreamBuffer_6->xTriggerLevelBytes = xTriggerLevel_2;
  1601. # DEBUG BEGIN_STMT
  1602. xReturn_12 = 1;
  1603. # DEBUG xReturn => xReturn_12
  1604. goto <bb 10>; [INV]
  1605. <bb 9> :
  1606. # DEBUG BEGIN_STMT
  1607. xReturn_10 = 0;
  1608. # DEBUG xReturn => xReturn_10
  1609. <bb 10> :
  1610. # xReturn_3 = PHI <xReturn_12(8), xReturn_10(9)>
  1611. # DEBUG xReturn => xReturn_3
  1612. # DEBUG BEGIN_STMT
  1613. _13 = xReturn_3;
  1614. return _13;
  1615. }
  1616. xStreamBufferReset (struct StreamBufferDef_t * xStreamBuffer)
  1617. {
  1618. UBaseType_t uxStreamBufferNumber;
  1619. BaseType_t xReturn;
  1620. struct StreamBuffer_t * const pxStreamBuffer;
  1621. struct tskTaskControlBlock * _1;
  1622. struct tskTaskControlBlock * _2;
  1623. uint8_t * _3;
  1624. unsigned int _4;
  1625. unsigned int _5;
  1626. unsigned char _6;
  1627. BaseType_t _19;
  1628. <bb 2> :
  1629. # DEBUG BEGIN_STMT
  1630. pxStreamBuffer_10 = xStreamBuffer_9(D);
  1631. # DEBUG pxStreamBuffer => pxStreamBuffer_10
  1632. # DEBUG BEGIN_STMT
  1633. xReturn_11 = 0;
  1634. # DEBUG xReturn => xReturn_11
  1635. # DEBUG BEGIN_STMT
  1636. # DEBUG BEGIN_STMT
  1637. if (pxStreamBuffer_10 == 0B)
  1638. goto <bb 3>; [INV]
  1639. else
  1640. goto <bb 5>; [INV]
  1641. <bb 3> :
  1642. # DEBUG BEGIN_STMT
  1643. vPortRaiseBASEPRI ();
  1644. <bb 4> :
  1645. # DEBUG BEGIN_STMT
  1646. # DEBUG BEGIN_STMT
  1647. # DEBUG BEGIN_STMT
  1648. goto <bb 4>; [INV]
  1649. <bb 5> :
  1650. # DEBUG BEGIN_STMT
  1651. # DEBUG BEGIN_STMT
  1652. uxStreamBufferNumber_13 = pxStreamBuffer_10->uxStreamBufferNumber;
  1653. # DEBUG uxStreamBufferNumber => uxStreamBufferNumber_13
  1654. # DEBUG BEGIN_STMT
  1655. vPortEnterCritical ();
  1656. # DEBUG BEGIN_STMT
  1657. _1 ={v} pxStreamBuffer_10->xTaskWaitingToReceive;
  1658. if (_1 == 0B)
  1659. goto <bb 6>; [INV]
  1660. else
  1661. goto <bb 8>; [INV]
  1662. <bb 6> :
  1663. # DEBUG BEGIN_STMT
  1664. _2 ={v} pxStreamBuffer_10->xTaskWaitingToSend;
  1665. if (_2 == 0B)
  1666. goto <bb 7>; [INV]
  1667. else
  1668. goto <bb 8>; [INV]
  1669. <bb 7> :
  1670. # DEBUG BEGIN_STMT
  1671. _3 = pxStreamBuffer_10->pucBuffer;
  1672. _4 = pxStreamBuffer_10->xLength;
  1673. _5 = pxStreamBuffer_10->xTriggerLevelBytes;
  1674. _6 = pxStreamBuffer_10->ucFlags;
  1675. prvInitialiseNewStreamBuffer (pxStreamBuffer_10, _3, _4, _5, _6);
  1676. # DEBUG BEGIN_STMT
  1677. xReturn_16 = 1;
  1678. # DEBUG xReturn => xReturn_16
  1679. # DEBUG BEGIN_STMT
  1680. pxStreamBuffer_10->uxStreamBufferNumber = uxStreamBufferNumber_13;
  1681. <bb 8> :
  1682. # xReturn_7 = PHI <xReturn_11(5), xReturn_11(6), xReturn_16(7)>
  1683. # DEBUG xReturn => xReturn_7
  1684. # DEBUG BEGIN_STMT
  1685. # DEBUG BEGIN_STMT
  1686. vPortExitCritical ();
  1687. # DEBUG BEGIN_STMT
  1688. _19 = xReturn_7;
  1689. return _19;
  1690. }
  1691. vStreamBufferDelete (struct StreamBufferDef_t * xStreamBuffer)
  1692. {
  1693. struct StreamBuffer_t * pxStreamBuffer;
  1694. unsigned char _1;
  1695. int _2;
  1696. int _3;
  1697. <bb 2> :
  1698. # DEBUG BEGIN_STMT
  1699. pxStreamBuffer_6 = xStreamBuffer_5(D);
  1700. # DEBUG pxStreamBuffer => pxStreamBuffer_6
  1701. # DEBUG BEGIN_STMT
  1702. if (pxStreamBuffer_6 == 0B)
  1703. goto <bb 3>; [INV]
  1704. else
  1705. goto <bb 5>; [INV]
  1706. <bb 3> :
  1707. # DEBUG BEGIN_STMT
  1708. vPortRaiseBASEPRI ();
  1709. <bb 4> :
  1710. # DEBUG BEGIN_STMT
  1711. # DEBUG BEGIN_STMT
  1712. # DEBUG BEGIN_STMT
  1713. goto <bb 4>; [INV]
  1714. <bb 5> :
  1715. # DEBUG BEGIN_STMT
  1716. # DEBUG BEGIN_STMT
  1717. # DEBUG BEGIN_STMT
  1718. _1 = pxStreamBuffer_6->ucFlags;
  1719. _2 = (int) _1;
  1720. _3 = _2 & 2;
  1721. if (_3 == 0)
  1722. goto <bb 6>; [INV]
  1723. else
  1724. goto <bb 7>; [INV]
  1725. <bb 6> :
  1726. # DEBUG BEGIN_STMT
  1727. vPortFree (pxStreamBuffer_6);
  1728. goto <bb 8>; [INV]
  1729. <bb 7> :
  1730. # DEBUG BEGIN_STMT
  1731. memset (pxStreamBuffer_6, 0, 36);
  1732. <bb 8> :
  1733. return;
  1734. }
  1735. xStreamBufferGenericCreate (size_t xBufferSizeBytes, size_t xTriggerLevelBytes, BaseType_t xIsMessageBuffer)
  1736. {
  1737. uint8_t ucFlags;
  1738. uint8_t * pucAllocatedMemory;
  1739. unsigned int _1;
  1740. uint8_t * _2;
  1741. struct StreamBufferDef_t * _23;
  1742. <bb 2> :
  1743. # DEBUG BEGIN_STMT
  1744. # DEBUG BEGIN_STMT
  1745. # DEBUG BEGIN_STMT
  1746. if (xIsMessageBuffer_9(D) == 1)
  1747. goto <bb 3>; [INV]
  1748. else
  1749. goto <bb 6>; [INV]
  1750. <bb 3> :
  1751. # DEBUG BEGIN_STMT
  1752. ucFlags_14 = 1;
  1753. # DEBUG ucFlags => ucFlags_14
  1754. # DEBUG BEGIN_STMT
  1755. if (xBufferSizeBytes_11(D) <= 4)
  1756. goto <bb 4>; [INV]
  1757. else
  1758. goto <bb 9>; [INV]
  1759. <bb 4> :
  1760. # DEBUG BEGIN_STMT
  1761. vPortRaiseBASEPRI ();
  1762. <bb 5> :
  1763. # DEBUG BEGIN_STMT
  1764. # DEBUG BEGIN_STMT
  1765. # DEBUG BEGIN_STMT
  1766. goto <bb 5>; [INV]
  1767. <bb 6> :
  1768. # DEBUG BEGIN_STMT
  1769. ucFlags_10 = 0;
  1770. # DEBUG ucFlags => ucFlags_10
  1771. # DEBUG BEGIN_STMT
  1772. if (xBufferSizeBytes_11(D) == 0)
  1773. goto <bb 7>; [INV]
  1774. else
  1775. goto <bb 9>; [INV]
  1776. <bb 7> :
  1777. # DEBUG BEGIN_STMT
  1778. vPortRaiseBASEPRI ();
  1779. <bb 8> :
  1780. # DEBUG BEGIN_STMT
  1781. # DEBUG BEGIN_STMT
  1782. # DEBUG BEGIN_STMT
  1783. goto <bb 8>; [INV]
  1784. <bb 9> :
  1785. # ucFlags_6 = PHI <ucFlags_14(3), ucFlags_10(6)>
  1786. # DEBUG ucFlags => ucFlags_6
  1787. # DEBUG BEGIN_STMT
  1788. # DEBUG BEGIN_STMT
  1789. if (xTriggerLevelBytes_16(D) > xBufferSizeBytes_11(D))
  1790. goto <bb 10>; [INV]
  1791. else
  1792. goto <bb 12>; [INV]
  1793. <bb 10> :
  1794. # DEBUG BEGIN_STMT
  1795. vPortRaiseBASEPRI ();
  1796. <bb 11> :
  1797. # DEBUG BEGIN_STMT
  1798. # DEBUG BEGIN_STMT
  1799. # DEBUG BEGIN_STMT
  1800. goto <bb 11>; [INV]
  1801. <bb 12> :
  1802. # DEBUG BEGIN_STMT
  1803. # DEBUG BEGIN_STMT
  1804. if (xTriggerLevelBytes_16(D) == 0)
  1805. goto <bb 13>; [INV]
  1806. else
  1807. goto <bb 14>; [INV]
  1808. <bb 13> :
  1809. # DEBUG BEGIN_STMT
  1810. xTriggerLevelBytes_17 = 1;
  1811. # DEBUG xTriggerLevelBytes => xTriggerLevelBytes_17
  1812. <bb 14> :
  1813. # xTriggerLevelBytes_4 = PHI <xTriggerLevelBytes_16(D)(12), xTriggerLevelBytes_17(13)>
  1814. # DEBUG xTriggerLevelBytes => xTriggerLevelBytes_4
  1815. # DEBUG BEGIN_STMT
  1816. if (xBufferSizeBytes_11(D) <= 4294967258)
  1817. goto <bb 15>; [INV]
  1818. else
  1819. goto <bb 16>; [INV]
  1820. <bb 15> :
  1821. # DEBUG BEGIN_STMT
  1822. xBufferSizeBytes_19 = xBufferSizeBytes_11(D) + 1;
  1823. # DEBUG xBufferSizeBytes => xBufferSizeBytes_19
  1824. # DEBUG BEGIN_STMT
  1825. _1 = xBufferSizeBytes_19 + 36;
  1826. pucAllocatedMemory_21 = pvPortMalloc (_1);
  1827. # DEBUG pucAllocatedMemory => pucAllocatedMemory_21
  1828. goto <bb 17>; [INV]
  1829. <bb 16> :
  1830. # DEBUG BEGIN_STMT
  1831. pucAllocatedMemory_18 = 0B;
  1832. # DEBUG pucAllocatedMemory => pucAllocatedMemory_18
  1833. <bb 17> :
  1834. # xBufferSizeBytes_3 = PHI <xBufferSizeBytes_19(15), xBufferSizeBytes_11(D)(16)>
  1835. # pucAllocatedMemory_5 = PHI <pucAllocatedMemory_21(15), pucAllocatedMemory_18(16)>
  1836. # DEBUG pucAllocatedMemory => pucAllocatedMemory_5
  1837. # DEBUG xBufferSizeBytes => xBufferSizeBytes_3
  1838. # DEBUG BEGIN_STMT
  1839. if (pucAllocatedMemory_5 != 0B)
  1840. goto <bb 18>; [INV]
  1841. else
  1842. goto <bb 19>; [INV]
  1843. <bb 18> :
  1844. # DEBUG BEGIN_STMT
  1845. _2 = pucAllocatedMemory_5 + 36;
  1846. prvInitialiseNewStreamBuffer (pucAllocatedMemory_5, _2, xBufferSizeBytes_3, xTriggerLevelBytes_4, ucFlags_6);
  1847. # DEBUG BEGIN_STMT
  1848. <bb 19> :
  1849. # DEBUG BEGIN_STMT
  1850. # DEBUG BEGIN_STMT
  1851. _23 = pucAllocatedMemory_5;
  1852. return _23;
  1853. }
  1854. __attribute__((always_inline))
  1855. vPortSetBASEPRI (uint32_t ulNewMaskValue)
  1856. {
  1857. <bb 2> :
  1858. # DEBUG BEGIN_STMT
  1859. __asm__ __volatile__(" msr basepri, %0 " : : "r" ulNewMaskValue_2(D) : "memory");
  1860. return;
  1861. }
  1862. __attribute__((always_inline))
  1863. ulPortRaiseBASEPRI ()
  1864. {
  1865. uint32_t ulNewBASEPRI;
  1866. uint32_t ulOriginalBASEPRI;
  1867. uint32_t _5;
  1868. <bb 2> :
  1869. # DEBUG BEGIN_STMT
  1870. # DEBUG BEGIN_STMT
  1871. __asm__ __volatile__(" mrs %0, basepri
  1872. mov %1, %2
  1873. msr basepri, %1
  1874. isb
  1875. dsb
  1876. " : "=r" ulOriginalBASEPRI_3, "=r" ulNewBASEPRI_4 : "i" 16 : "memory");
  1877. # DEBUG ulNewBASEPRI => ulNewBASEPRI_4
  1878. # DEBUG ulOriginalBASEPRI => ulOriginalBASEPRI_3
  1879. # DEBUG BEGIN_STMT
  1880. _5 = ulOriginalBASEPRI_3;
  1881. return _5;
  1882. }
  1883. __attribute__((always_inline))
  1884. vPortRaiseBASEPRI ()
  1885. {
  1886. uint32_t ulNewBASEPRI;
  1887. <bb 2> :
  1888. # DEBUG BEGIN_STMT
  1889. # DEBUG BEGIN_STMT
  1890. __asm__ __volatile__(" mov %0, %1
  1891. msr basepri, %0
  1892. isb
  1893. dsb
  1894. " : "=r" ulNewBASEPRI_3 : "i" 16 : "memory");
  1895. # DEBUG ulNewBASEPRI => ulNewBASEPRI_3
  1896. return;
  1897. }