stream_buffer.c.017i.build_ssa_passes 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536
  1. ucStreamBufferGetStreamBufferType (struct StreamBufferDef_t * xStreamBuffer)
  2. {
  3. uint8_t D.6587;
  4. <bb 2> :
  5. _1 = xStreamBuffer->ucFlags;
  6. D.6587 = _1 & 1;
  7. <bb 3> :
  8. <L0>:
  9. return D.6587;
  10. }
  11. vStreamBufferSetStreamBufferNumber (struct StreamBufferDef_t * xStreamBuffer, UBaseType_t uxStreamBufferNumber)
  12. {
  13. <bb 2> :
  14. xStreamBuffer->uxStreamBufferNumber = uxStreamBufferNumber;
  15. return;
  16. }
  17. uxStreamBufferGetStreamBufferNumber (struct StreamBufferDef_t * xStreamBuffer)
  18. {
  19. UBaseType_t D.6585;
  20. <bb 2> :
  21. D.6585 = xStreamBuffer->uxStreamBufferNumber;
  22. <bb 3> :
  23. <L0>:
  24. return D.6585;
  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. <bb 2> :
  30. xWriteValue = 85;
  31. _1 = memset (pucBuffer, xWriteValue, xBufferSizeBytes);
  32. if (pucBuffer != _1)
  33. goto <bb 3>; [INV]
  34. else
  35. goto <bb 5>; [INV]
  36. <bb 3> :
  37. vPortRaiseBASEPRI ();
  38. <bb 4> :
  39. goto <bb 4>; [INV]
  40. <bb 5> :
  41. memset (pxStreamBuffer, 0, 36);
  42. pxStreamBuffer->pucBuffer = pucBuffer;
  43. pxStreamBuffer->xLength = xBufferSizeBytes;
  44. pxStreamBuffer->xTriggerLevelBytes = xTriggerLevelBytes;
  45. pxStreamBuffer->ucFlags = ucFlags;
  46. return;
  47. }
  48. prvBytesInBuffer (const struct StreamBuffer_t * const pxStreamBuffer)
  49. {
  50. size_t xCount;
  51. size_t D.6581;
  52. unsigned int D.6577;
  53. <bb 2> :
  54. _1 = pxStreamBuffer->xLength;
  55. _2 = pxStreamBuffer->xHead;
  56. xCount = _1 + _2;
  57. D.6577 = pxStreamBuffer->xTail;
  58. xCount = xCount - D.6577;
  59. _3 = pxStreamBuffer->xLength;
  60. if (xCount >= _3)
  61. goto <bb 3>; [INV]
  62. else
  63. goto <bb 4>; [INV]
  64. <bb 3> :
  65. _4 = pxStreamBuffer->xLength;
  66. xCount = xCount - _4;
  67. <bb 4> :
  68. D.6581 = xCount;
  69. <bb 5> :
  70. <L3>:
  71. return D.6581;
  72. }
  73. prvReadBytesFromBuffer (struct StreamBuffer_t * pxStreamBuffer, uint8_t * pucData, size_t xCount, size_t xTail)
  74. {
  75. size_t xFirstLength;
  76. size_t D.6575;
  77. <bb 2> :
  78. if (xCount == 0)
  79. goto <bb 3>; [INV]
  80. else
  81. goto <bb 5>; [INV]
  82. <bb 3> :
  83. vPortRaiseBASEPRI ();
  84. <bb 4> :
  85. goto <bb 4>; [INV]
  86. <bb 5> :
  87. _1 = pxStreamBuffer->xLength;
  88. _2 = _1 - xTail;
  89. xFirstLength = MIN_EXPR <xCount, _2>;
  90. if (xFirstLength > xCount)
  91. goto <bb 6>; [INV]
  92. else
  93. goto <bb 8>; [INV]
  94. <bb 6> :
  95. vPortRaiseBASEPRI ();
  96. <bb 7> :
  97. goto <bb 7>; [INV]
  98. <bb 8> :
  99. _3 = xTail + xFirstLength;
  100. _4 = pxStreamBuffer->xLength;
  101. if (_3 > _4)
  102. goto <bb 9>; [INV]
  103. else
  104. goto <bb 11>; [INV]
  105. <bb 9> :
  106. vPortRaiseBASEPRI ();
  107. <bb 10> :
  108. goto <bb 10>; [INV]
  109. <bb 11> :
  110. _5 = pxStreamBuffer->pucBuffer;
  111. _6 = _5 + xTail;
  112. memcpy (pucData, _6, xFirstLength);
  113. if (xCount > xFirstLength)
  114. goto <bb 12>; [INV]
  115. else
  116. goto <bb 13>; [INV]
  117. <bb 12> :
  118. _7 = pucData + xFirstLength;
  119. _8 = pxStreamBuffer->pucBuffer;
  120. _9 = xCount - xFirstLength;
  121. memcpy (_7, _8, _9);
  122. <bb 13> :
  123. xTail = xTail + xCount;
  124. _10 = pxStreamBuffer->xLength;
  125. if (xTail >= _10)
  126. goto <bb 14>; [INV]
  127. else
  128. goto <bb 15>; [INV]
  129. <bb 14> :
  130. _11 = pxStreamBuffer->xLength;
  131. xTail = xTail - _11;
  132. <bb 15> :
  133. D.6575 = xTail;
  134. <bb 16> :
  135. <L14>:
  136. return D.6575;
  137. }
  138. prvWriteBytesToBuffer (struct StreamBuffer_t * const pxStreamBuffer, const uint8_t * pucData, size_t xCount, size_t xHead)
  139. {
  140. size_t xFirstLength;
  141. size_t D.6562;
  142. <bb 2> :
  143. if (xCount == 0)
  144. goto <bb 3>; [INV]
  145. else
  146. goto <bb 5>; [INV]
  147. <bb 3> :
  148. vPortRaiseBASEPRI ();
  149. <bb 4> :
  150. goto <bb 4>; [INV]
  151. <bb 5> :
  152. _1 = pxStreamBuffer->xLength;
  153. _2 = _1 - xHead;
  154. xFirstLength = MIN_EXPR <xCount, _2>;
  155. _3 = xHead + xFirstLength;
  156. _4 = pxStreamBuffer->xLength;
  157. if (_3 > _4)
  158. goto <bb 6>; [INV]
  159. else
  160. goto <bb 8>; [INV]
  161. <bb 6> :
  162. vPortRaiseBASEPRI ();
  163. <bb 7> :
  164. goto <bb 7>; [INV]
  165. <bb 8> :
  166. _5 = pxStreamBuffer->pucBuffer;
  167. _6 = _5 + xHead;
  168. memcpy (_6, pucData, xFirstLength);
  169. if (xCount > xFirstLength)
  170. goto <bb 9>; [INV]
  171. else
  172. goto <bb 13>; [INV]
  173. <bb 9> :
  174. _7 = xCount - xFirstLength;
  175. _8 = pxStreamBuffer->xLength;
  176. if (_7 > _8)
  177. goto <bb 10>; [INV]
  178. else
  179. goto <bb 12>; [INV]
  180. <bb 10> :
  181. vPortRaiseBASEPRI ();
  182. <bb 11> :
  183. goto <bb 11>; [INV]
  184. <bb 12> :
  185. _9 = pxStreamBuffer->pucBuffer;
  186. _10 = pucData + xFirstLength;
  187. _11 = xCount - xFirstLength;
  188. memcpy (_9, _10, _11);
  189. <bb 13> :
  190. xHead = xHead + xCount;
  191. _12 = pxStreamBuffer->xLength;
  192. if (xHead >= _12)
  193. goto <bb 14>; [INV]
  194. else
  195. goto <bb 15>; [INV]
  196. <bb 14> :
  197. _13 = pxStreamBuffer->xLength;
  198. xHead = xHead - _13;
  199. <bb 15> :
  200. D.6562 = xHead;
  201. <bb 16> :
  202. <L15>:
  203. return D.6562;
  204. }
  205. xStreamBufferReceiveCompletedFromISR (struct StreamBufferDef_t * xStreamBuffer, BaseType_t * pxHigherPriorityTaskWoken)
  206. {
  207. UBaseType_t uxSavedInterruptStatus;
  208. BaseType_t xReturn;
  209. struct StreamBuffer_t * const pxStreamBuffer;
  210. BaseType_t D.6548;
  211. <bb 2> :
  212. pxStreamBuffer = xStreamBuffer;
  213. if (pxStreamBuffer == 0B)
  214. goto <bb 3>; [INV]
  215. else
  216. goto <bb 5>; [INV]
  217. <bb 3> :
  218. vPortRaiseBASEPRI ();
  219. <bb 4> :
  220. goto <bb 4>; [INV]
  221. <bb 5> :
  222. uxSavedInterruptStatus = ulPortRaiseBASEPRI ();
  223. _1 = pxStreamBuffer->xTaskWaitingToSend;
  224. if (_1 != 0B)
  225. goto <bb 6>; [INV]
  226. else
  227. goto <bb 7>; [INV]
  228. <bb 6> :
  229. _2 = pxStreamBuffer->xTaskWaitingToSend;
  230. xTaskGenericNotifyFromISR (_2, 0, 0, 0, 0B, pxHigherPriorityTaskWoken);
  231. pxStreamBuffer->xTaskWaitingToSend = 0B;
  232. xReturn = 1;
  233. goto <bb 8>; [INV]
  234. <bb 7> :
  235. xReturn = 0;
  236. <bb 8> :
  237. vPortSetBASEPRI (uxSavedInterruptStatus);
  238. D.6548 = xReturn;
  239. <bb 9> :
  240. <L6>:
  241. return D.6548;
  242. }
  243. xStreamBufferSendCompletedFromISR (struct StreamBufferDef_t * xStreamBuffer, BaseType_t * pxHigherPriorityTaskWoken)
  244. {
  245. UBaseType_t uxSavedInterruptStatus;
  246. BaseType_t xReturn;
  247. struct StreamBuffer_t * const pxStreamBuffer;
  248. BaseType_t D.6541;
  249. <bb 2> :
  250. pxStreamBuffer = xStreamBuffer;
  251. if (pxStreamBuffer == 0B)
  252. goto <bb 3>; [INV]
  253. else
  254. goto <bb 5>; [INV]
  255. <bb 3> :
  256. vPortRaiseBASEPRI ();
  257. <bb 4> :
  258. goto <bb 4>; [INV]
  259. <bb 5> :
  260. uxSavedInterruptStatus = ulPortRaiseBASEPRI ();
  261. _1 = pxStreamBuffer->xTaskWaitingToReceive;
  262. if (_1 != 0B)
  263. goto <bb 6>; [INV]
  264. else
  265. goto <bb 7>; [INV]
  266. <bb 6> :
  267. _2 = pxStreamBuffer->xTaskWaitingToReceive;
  268. xTaskGenericNotifyFromISR (_2, 0, 0, 0, 0B, pxHigherPriorityTaskWoken);
  269. pxStreamBuffer->xTaskWaitingToReceive = 0B;
  270. xReturn = 1;
  271. goto <bb 8>; [INV]
  272. <bb 7> :
  273. xReturn = 0;
  274. <bb 8> :
  275. vPortSetBASEPRI (uxSavedInterruptStatus);
  276. D.6541 = xReturn;
  277. <bb 9> :
  278. <L6>:
  279. return D.6541;
  280. }
  281. xStreamBufferIsFull (struct StreamBufferDef_t * xStreamBuffer)
  282. {
  283. const struct StreamBuffer_t * const pxStreamBuffer;
  284. size_t xBytesToStoreMessageLength;
  285. BaseType_t xReturn;
  286. BaseType_t D.6534;
  287. <bb 2> :
  288. pxStreamBuffer = xStreamBuffer;
  289. if (pxStreamBuffer == 0B)
  290. goto <bb 3>; [INV]
  291. else
  292. goto <bb 5>; [INV]
  293. <bb 3> :
  294. vPortRaiseBASEPRI ();
  295. <bb 4> :
  296. goto <bb 4>; [INV]
  297. <bb 5> :
  298. _1 = pxStreamBuffer->ucFlags;
  299. _2 = (int) _1;
  300. _3 = _2 & 1;
  301. if (_3 != 0)
  302. goto <bb 6>; [INV]
  303. else
  304. goto <bb 7>; [INV]
  305. <bb 6> :
  306. xBytesToStoreMessageLength = 4;
  307. goto <bb 8>; [INV]
  308. <bb 7> :
  309. xBytesToStoreMessageLength = 0;
  310. <bb 8> :
  311. _4 = xStreamBufferSpacesAvailable (xStreamBuffer);
  312. if (xBytesToStoreMessageLength >= _4)
  313. goto <bb 9>; [INV]
  314. else
  315. goto <bb 10>; [INV]
  316. <bb 9> :
  317. xReturn = 1;
  318. goto <bb 11>; [INV]
  319. <bb 10> :
  320. xReturn = 0;
  321. <bb 11> :
  322. D.6534 = xReturn;
  323. <bb 12> :
  324. <L9>:
  325. return D.6534;
  326. }
  327. xStreamBufferIsEmpty (struct StreamBufferDef_t * xStreamBuffer)
  328. {
  329. size_t xTail;
  330. BaseType_t xReturn;
  331. const struct StreamBuffer_t * const pxStreamBuffer;
  332. BaseType_t D.6524;
  333. <bb 2> :
  334. pxStreamBuffer = xStreamBuffer;
  335. if (pxStreamBuffer == 0B)
  336. goto <bb 3>; [INV]
  337. else
  338. goto <bb 5>; [INV]
  339. <bb 3> :
  340. vPortRaiseBASEPRI ();
  341. <bb 4> :
  342. goto <bb 4>; [INV]
  343. <bb 5> :
  344. xTail = pxStreamBuffer->xTail;
  345. _1 = pxStreamBuffer->xHead;
  346. if (xTail == _1)
  347. goto <bb 6>; [INV]
  348. else
  349. goto <bb 7>; [INV]
  350. <bb 6> :
  351. xReturn = 1;
  352. goto <bb 8>; [INV]
  353. <bb 7> :
  354. xReturn = 0;
  355. <bb 8> :
  356. D.6524 = xReturn;
  357. <bb 9> :
  358. <L6>:
  359. return D.6524;
  360. }
  361. prvReadMessageFromBuffer (struct StreamBuffer_t * pxStreamBuffer, void * pvRxData, size_t xBufferLengthBytes, size_t xBytesAvailable)
  362. {
  363. size_t xNextTail;
  364. size_t xTempNextMessageLength;
  365. size_t xNextMessageLength;
  366. size_t xCount;
  367. size_t D.6516;
  368. <bb 2> :
  369. xNextTail = pxStreamBuffer->xTail;
  370. _1 = pxStreamBuffer->ucFlags;
  371. _2 = (int) _1;
  372. _3 = _2 & 1;
  373. if (_3 != 0)
  374. goto <bb 3>; [INV]
  375. else
  376. goto <bb 5>; [INV]
  377. <bb 3> :
  378. xNextTail = prvReadBytesFromBuffer (pxStreamBuffer, &xTempNextMessageLength, 4, xNextTail);
  379. xNextMessageLength = xTempNextMessageLength;
  380. xBytesAvailable = xBytesAvailable + 4294967292;
  381. if (xNextMessageLength > xBufferLengthBytes)
  382. goto <bb 4>; [INV]
  383. else
  384. goto <bb 6>; [INV]
  385. <bb 4> :
  386. xNextMessageLength = 0;
  387. goto <bb 6>; [INV]
  388. <bb 5> :
  389. xNextMessageLength = xBufferLengthBytes;
  390. <bb 6> :
  391. xCount = MIN_EXPR <xBytesAvailable, xNextMessageLength>;
  392. if (xCount != 0)
  393. goto <bb 7>; [INV]
  394. else
  395. goto <bb 8>; [INV]
  396. <bb 7> :
  397. _4 = prvReadBytesFromBuffer (pxStreamBuffer, pvRxData, xCount, xNextTail);
  398. pxStreamBuffer->xTail = _4;
  399. <bb 8> :
  400. D.6516 = xCount;
  401. xTempNextMessageLength = {CLOBBER};
  402. <bb 9> :
  403. <L9>:
  404. return D.6516;
  405. }
  406. xStreamBufferReceiveFromISR (struct StreamBufferDef_t * xStreamBuffer, void * pvRxData, size_t xBufferLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken)
  407. {
  408. UBaseType_t uxSavedInterruptStatus;
  409. size_t xBytesToStoreMessageLength;
  410. size_t xBytesAvailable;
  411. size_t xReceivedLength;
  412. struct StreamBuffer_t * const pxStreamBuffer;
  413. size_t D.6506;
  414. <bb 2> :
  415. pxStreamBuffer = xStreamBuffer;
  416. xReceivedLength = 0;
  417. if (pvRxData == 0B)
  418. goto <bb 3>; [INV]
  419. else
  420. goto <bb 5>; [INV]
  421. <bb 3> :
  422. vPortRaiseBASEPRI ();
  423. <bb 4> :
  424. goto <bb 4>; [INV]
  425. <bb 5> :
  426. if (pxStreamBuffer == 0B)
  427. goto <bb 6>; [INV]
  428. else
  429. goto <bb 8>; [INV]
  430. <bb 6> :
  431. vPortRaiseBASEPRI ();
  432. <bb 7> :
  433. goto <bb 7>; [INV]
  434. <bb 8> :
  435. _1 = pxStreamBuffer->ucFlags;
  436. _2 = (int) _1;
  437. _3 = _2 & 1;
  438. if (_3 != 0)
  439. goto <bb 9>; [INV]
  440. else
  441. goto <bb 10>; [INV]
  442. <bb 9> :
  443. xBytesToStoreMessageLength = 4;
  444. goto <bb 11>; [INV]
  445. <bb 10> :
  446. xBytesToStoreMessageLength = 0;
  447. <bb 11> :
  448. xBytesAvailable = prvBytesInBuffer (pxStreamBuffer);
  449. if (xBytesAvailable > xBytesToStoreMessageLength)
  450. goto <bb 12>; [INV]
  451. else
  452. goto <bb 16>; [INV]
  453. <bb 12> :
  454. xReceivedLength = prvReadMessageFromBuffer (pxStreamBuffer, pvRxData, xBufferLengthBytes, xBytesAvailable);
  455. if (xReceivedLength != 0)
  456. goto <bb 13>; [INV]
  457. else
  458. goto <bb 16>; [INV]
  459. <bb 13> :
  460. uxSavedInterruptStatus = ulPortRaiseBASEPRI ();
  461. _4 = pxStreamBuffer->xTaskWaitingToSend;
  462. if (_4 != 0B)
  463. goto <bb 14>; [INV]
  464. else
  465. goto <bb 15>; [INV]
  466. <bb 14> :
  467. _5 = pxStreamBuffer->xTaskWaitingToSend;
  468. xTaskGenericNotifyFromISR (_5, 0, 0, 0, 0B, pxHigherPriorityTaskWoken);
  469. pxStreamBuffer->xTaskWaitingToSend = 0B;
  470. <bb 15> :
  471. vPortSetBASEPRI (uxSavedInterruptStatus);
  472. <bb 16> :
  473. D.6506 = xReceivedLength;
  474. <bb 17> :
  475. <L17>:
  476. return D.6506;
  477. }
  478. xStreamBufferNextMessageLengthBytes (struct StreamBufferDef_t * xStreamBuffer)
  479. {
  480. size_t xTempReturn;
  481. size_t xBytesAvailable;
  482. size_t xReturn;
  483. struct StreamBuffer_t * const pxStreamBuffer;
  484. size_t D.6488;
  485. <bb 2> :
  486. pxStreamBuffer = xStreamBuffer;
  487. if (pxStreamBuffer == 0B)
  488. goto <bb 3>; [INV]
  489. else
  490. goto <bb 5>; [INV]
  491. <bb 3> :
  492. vPortRaiseBASEPRI ();
  493. <bb 4> :
  494. goto <bb 4>; [INV]
  495. <bb 5> :
  496. _1 = pxStreamBuffer->ucFlags;
  497. _2 = (int) _1;
  498. _3 = _2 & 1;
  499. if (_3 != 0)
  500. goto <bb 6>; [INV]
  501. else
  502. goto <bb 12>; [INV]
  503. <bb 6> :
  504. xBytesAvailable = prvBytesInBuffer (pxStreamBuffer);
  505. if (xBytesAvailable > 4)
  506. goto <bb 7>; [INV]
  507. else
  508. goto <bb 8>; [INV]
  509. <bb 7> :
  510. _4 = pxStreamBuffer->xTail;
  511. prvReadBytesFromBuffer (pxStreamBuffer, &xTempReturn, 4, _4);
  512. xReturn = xTempReturn;
  513. goto <bb 13>; [INV]
  514. <bb 8> :
  515. if (xBytesAvailable != 0)
  516. goto <bb 9>; [INV]
  517. else
  518. goto <bb 11>; [INV]
  519. <bb 9> :
  520. vPortRaiseBASEPRI ();
  521. <bb 10> :
  522. goto <bb 10>; [INV]
  523. <bb 11> :
  524. xReturn = 0;
  525. goto <bb 13>; [INV]
  526. <bb 12> :
  527. xReturn = 0;
  528. <bb 13> :
  529. D.6488 = xReturn;
  530. xTempReturn = {CLOBBER};
  531. <bb 14> :
  532. <L13>:
  533. return D.6488;
  534. }
  535. xStreamBufferReceive (struct StreamBufferDef_t * xStreamBuffer, void * pvRxData, size_t xBufferLengthBytes, TickType_t xTicksToWait)
  536. {
  537. size_t xBytesToStoreMessageLength;
  538. size_t xBytesAvailable;
  539. size_t xReceivedLength;
  540. struct StreamBuffer_t * const pxStreamBuffer;
  541. size_t D.6476;
  542. <bb 2> :
  543. pxStreamBuffer = xStreamBuffer;
  544. xReceivedLength = 0;
  545. if (pvRxData == 0B)
  546. goto <bb 3>; [INV]
  547. else
  548. goto <bb 5>; [INV]
  549. <bb 3> :
  550. vPortRaiseBASEPRI ();
  551. <bb 4> :
  552. goto <bb 4>; [INV]
  553. <bb 5> :
  554. if (pxStreamBuffer == 0B)
  555. goto <bb 6>; [INV]
  556. else
  557. goto <bb 8>; [INV]
  558. <bb 6> :
  559. vPortRaiseBASEPRI ();
  560. <bb 7> :
  561. goto <bb 7>; [INV]
  562. <bb 8> :
  563. _1 = pxStreamBuffer->ucFlags;
  564. _2 = (int) _1;
  565. _3 = _2 & 1;
  566. if (_3 != 0)
  567. goto <bb 9>; [INV]
  568. else
  569. goto <bb 10>; [INV]
  570. <bb 9> :
  571. xBytesToStoreMessageLength = 4;
  572. goto <bb 11>; [INV]
  573. <bb 10> :
  574. xBytesToStoreMessageLength = 0;
  575. <bb 11> :
  576. if (xTicksToWait != 0)
  577. goto <bb 12>; [INV]
  578. else
  579. goto <bb 19>; [INV]
  580. <bb 12> :
  581. vPortEnterCritical ();
  582. xBytesAvailable = prvBytesInBuffer (pxStreamBuffer);
  583. if (xBytesAvailable <= xBytesToStoreMessageLength)
  584. goto <bb 13>; [INV]
  585. else
  586. goto <bb 17>; [INV]
  587. <bb 13> :
  588. xTaskGenericNotifyStateClear (0B, 0);
  589. _4 = pxStreamBuffer->xTaskWaitingToReceive;
  590. if (_4 != 0B)
  591. goto <bb 14>; [INV]
  592. else
  593. goto <bb 16>; [INV]
  594. <bb 14> :
  595. vPortRaiseBASEPRI ();
  596. <bb 15> :
  597. goto <bb 15>; [INV]
  598. <bb 16> :
  599. _5 = xTaskGetCurrentTaskHandle ();
  600. pxStreamBuffer->xTaskWaitingToReceive = _5;
  601. <bb 17> :
  602. vPortExitCritical ();
  603. if (xBytesAvailable <= xBytesToStoreMessageLength)
  604. goto <bb 18>; [INV]
  605. else
  606. goto <bb 20>; [INV]
  607. <bb 18> :
  608. xTaskGenericNotifyWait (0, 0, 0, 0B, xTicksToWait);
  609. pxStreamBuffer->xTaskWaitingToReceive = 0B;
  610. xBytesAvailable = prvBytesInBuffer (pxStreamBuffer);
  611. goto <bb 20>; [INV]
  612. <bb 19> :
  613. xBytesAvailable = prvBytesInBuffer (pxStreamBuffer);
  614. <bb 20> :
  615. if (xBytesAvailable > xBytesToStoreMessageLength)
  616. goto <bb 21>; [INV]
  617. else
  618. goto <bb 25>; [INV]
  619. <bb 21> :
  620. xReceivedLength = prvReadMessageFromBuffer (pxStreamBuffer, pvRxData, xBufferLengthBytes, xBytesAvailable);
  621. if (xReceivedLength != 0)
  622. goto <bb 22>; [INV]
  623. else
  624. goto <bb 25>; [INV]
  625. <bb 22> :
  626. vTaskSuspendAll ();
  627. _6 = pxStreamBuffer->xTaskWaitingToSend;
  628. if (_6 != 0B)
  629. goto <bb 23>; [INV]
  630. else
  631. goto <bb 24>; [INV]
  632. <bb 23> :
  633. _7 = pxStreamBuffer->xTaskWaitingToSend;
  634. xTaskGenericNotify (_7, 0, 0, 0, 0B);
  635. pxStreamBuffer->xTaskWaitingToSend = 0B;
  636. <bb 24> :
  637. xTaskResumeAll ();
  638. <bb 25> :
  639. D.6476 = xReceivedLength;
  640. <bb 26> :
  641. <L29>:
  642. return D.6476;
  643. }
  644. prvWriteMessageToBuffer (struct StreamBuffer_t * const pxStreamBuffer, const void * pvTxData, size_t xDataLengthBytes, size_t xSpace, size_t xRequiredSpace)
  645. {
  646. size_t xNextHead;
  647. size_t D.6448;
  648. <bb 2> :
  649. xNextHead = pxStreamBuffer->xHead;
  650. _1 = pxStreamBuffer->ucFlags;
  651. _2 = (int) _1;
  652. _3 = _2 & 1;
  653. if (_3 != 0)
  654. goto <bb 3>; [INV]
  655. else
  656. goto <bb 6>; [INV]
  657. <bb 3> :
  658. if (xSpace >= xRequiredSpace)
  659. goto <bb 4>; [INV]
  660. else
  661. goto <bb 5>; [INV]
  662. <bb 4> :
  663. xNextHead = prvWriteBytesToBuffer (pxStreamBuffer, &xDataLengthBytes, 4, xNextHead);
  664. goto <bb 7>; [INV]
  665. <bb 5> :
  666. xDataLengthBytes = 0;
  667. goto <bb 7>; [INV]
  668. <bb 6> :
  669. xDataLengthBytes.2_4 = xDataLengthBytes;
  670. _5 = MIN_EXPR <xSpace, xDataLengthBytes.2_4>;
  671. xDataLengthBytes = _5;
  672. <bb 7> :
  673. xDataLengthBytes.3_6 = xDataLengthBytes;
  674. if (xDataLengthBytes.3_6 != 0)
  675. goto <bb 8>; [INV]
  676. else
  677. goto <bb 9>; [INV]
  678. <bb 8> :
  679. xDataLengthBytes.4_7 = xDataLengthBytes;
  680. _8 = prvWriteBytesToBuffer (pxStreamBuffer, pvTxData, xDataLengthBytes.4_7, xNextHead);
  681. pxStreamBuffer->xHead = _8;
  682. <bb 9> :
  683. D.6448 = xDataLengthBytes;
  684. <bb 10> :
  685. <L8>:
  686. return D.6448;
  687. }
  688. xStreamBufferSendFromISR (struct StreamBufferDef_t * xStreamBuffer, const void * pvTxData, size_t xDataLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken)
  689. {
  690. UBaseType_t uxSavedInterruptStatus;
  691. size_t xRequiredSpace;
  692. size_t xSpace;
  693. size_t xReturn;
  694. struct StreamBuffer_t * const pxStreamBuffer;
  695. size_t D.6436;
  696. <bb 2> :
  697. pxStreamBuffer = xStreamBuffer;
  698. xRequiredSpace = xDataLengthBytes;
  699. if (pvTxData == 0B)
  700. goto <bb 3>; [INV]
  701. else
  702. goto <bb 5>; [INV]
  703. <bb 3> :
  704. vPortRaiseBASEPRI ();
  705. <bb 4> :
  706. goto <bb 4>; [INV]
  707. <bb 5> :
  708. if (pxStreamBuffer == 0B)
  709. goto <bb 6>; [INV]
  710. else
  711. goto <bb 8>; [INV]
  712. <bb 6> :
  713. vPortRaiseBASEPRI ();
  714. <bb 7> :
  715. goto <bb 7>; [INV]
  716. <bb 8> :
  717. _1 = pxStreamBuffer->ucFlags;
  718. _2 = (int) _1;
  719. _3 = _2 & 1;
  720. if (_3 != 0)
  721. goto <bb 9>; [INV]
  722. else
  723. goto <bb 10>; [INV]
  724. <bb 9> :
  725. xRequiredSpace = xRequiredSpace + 4;
  726. <bb 10> :
  727. xSpace = xStreamBufferSpacesAvailable (pxStreamBuffer);
  728. xReturn = prvWriteMessageToBuffer (pxStreamBuffer, pvTxData, xDataLengthBytes, xSpace, xRequiredSpace);
  729. if (xReturn != 0)
  730. goto <bb 11>; [INV]
  731. else
  732. goto <bb 15>; [INV]
  733. <bb 11> :
  734. _4 = prvBytesInBuffer (pxStreamBuffer);
  735. _5 = pxStreamBuffer->xTriggerLevelBytes;
  736. if (_4 >= _5)
  737. goto <bb 12>; [INV]
  738. else
  739. goto <bb 15>; [INV]
  740. <bb 12> :
  741. uxSavedInterruptStatus = ulPortRaiseBASEPRI ();
  742. _6 = pxStreamBuffer->xTaskWaitingToReceive;
  743. if (_6 != 0B)
  744. goto <bb 13>; [INV]
  745. else
  746. goto <bb 14>; [INV]
  747. <bb 13> :
  748. _7 = pxStreamBuffer->xTaskWaitingToReceive;
  749. xTaskGenericNotifyFromISR (_7, 0, 0, 0, 0B, pxHigherPriorityTaskWoken);
  750. pxStreamBuffer->xTaskWaitingToReceive = 0B;
  751. <bb 14> :
  752. vPortSetBASEPRI (uxSavedInterruptStatus);
  753. <bb 15> :
  754. D.6436 = xReturn;
  755. <bb 16> :
  756. <L17>:
  757. return D.6436;
  758. }
  759. xStreamBufferSend (struct StreamBufferDef_t * xStreamBuffer, const void * pvTxData, size_t xDataLengthBytes, TickType_t xTicksToWait)
  760. {
  761. size_t xMaxReportedSpace;
  762. struct TimeOut_t xTimeOut;
  763. size_t xRequiredSpace;
  764. size_t xSpace;
  765. size_t xReturn;
  766. struct StreamBuffer_t * const pxStreamBuffer;
  767. size_t D.6418;
  768. <bb 2> :
  769. pxStreamBuffer = xStreamBuffer;
  770. xSpace = 0;
  771. xRequiredSpace = xDataLengthBytes;
  772. xMaxReportedSpace = 0;
  773. if (pvTxData == 0B)
  774. goto <bb 3>; [INV]
  775. else
  776. goto <bb 5>; [INV]
  777. <bb 3> :
  778. vPortRaiseBASEPRI ();
  779. <bb 4> :
  780. goto <bb 4>; [INV]
  781. <bb 5> :
  782. if (pxStreamBuffer == 0B)
  783. goto <bb 6>; [INV]
  784. else
  785. goto <bb 8>; [INV]
  786. <bb 6> :
  787. vPortRaiseBASEPRI ();
  788. <bb 7> :
  789. goto <bb 7>; [INV]
  790. <bb 8> :
  791. _1 = pxStreamBuffer->xLength;
  792. xMaxReportedSpace = _1 + 4294967295;
  793. _2 = pxStreamBuffer->ucFlags;
  794. _3 = (int) _2;
  795. _4 = _3 & 1;
  796. if (_4 != 0)
  797. goto <bb 9>; [INV]
  798. else
  799. goto <bb 14>; [INV]
  800. <bb 9> :
  801. xRequiredSpace = xRequiredSpace + 4;
  802. if (xRequiredSpace <= xDataLengthBytes)
  803. goto <bb 10>; [INV]
  804. else
  805. goto <bb 12>; [INV]
  806. <bb 10> :
  807. vPortRaiseBASEPRI ();
  808. <bb 11> :
  809. goto <bb 11>; [INV]
  810. <bb 12> :
  811. if (xRequiredSpace > xMaxReportedSpace)
  812. goto <bb 13>; [INV]
  813. else
  814. goto <bb 16>; [INV]
  815. <bb 13> :
  816. xTicksToWait = 0;
  817. goto <bb 16>; [INV]
  818. <bb 14> :
  819. if (xRequiredSpace > xMaxReportedSpace)
  820. goto <bb 15>; [INV]
  821. else
  822. goto <bb 16>; [INV]
  823. <bb 15> :
  824. xRequiredSpace = xMaxReportedSpace;
  825. <bb 16> :
  826. xTicksToWait.0_5 = xTicksToWait;
  827. if (xTicksToWait.0_5 != 0)
  828. goto <bb 17>; [INV]
  829. else
  830. goto <bb 26>; [INV]
  831. <bb 17> :
  832. vTaskSetTimeOutState (&xTimeOut);
  833. <bb 18> :
  834. vPortEnterCritical ();
  835. xSpace = xStreamBufferSpacesAvailable (pxStreamBuffer);
  836. if (xSpace < xRequiredSpace)
  837. goto <bb 19>; [INV]
  838. else
  839. goto <bb 23>; [INV]
  840. <bb 19> :
  841. xTaskGenericNotifyStateClear (0B, 0);
  842. _6 = pxStreamBuffer->xTaskWaitingToSend;
  843. if (_6 != 0B)
  844. goto <bb 20>; [INV]
  845. else
  846. goto <bb 22>; [INV]
  847. <bb 20> :
  848. vPortRaiseBASEPRI ();
  849. <bb 21> :
  850. goto <bb 21>; [INV]
  851. <bb 22> :
  852. _7 = xTaskGetCurrentTaskHandle ();
  853. pxStreamBuffer->xTaskWaitingToSend = _7;
  854. goto <bb 24>; [INV]
  855. <bb 23> :
  856. vPortExitCritical ();
  857. goto <bb 25>; [INV]
  858. <bb 24> :
  859. vPortExitCritical ();
  860. xTicksToWait.1_8 = xTicksToWait;
  861. xTaskGenericNotifyWait (0, 0, 0, 0B, xTicksToWait.1_8);
  862. pxStreamBuffer->xTaskWaitingToSend = 0B;
  863. _9 = xTaskCheckForTimeOut (&xTimeOut, &xTicksToWait);
  864. if (_9 == 0)
  865. goto <bb 18>; [INV]
  866. else
  867. goto <bb 25>; [INV]
  868. <bb 25> :
  869. <bb 26> :
  870. if (xSpace == 0)
  871. goto <bb 27>; [INV]
  872. else
  873. goto <bb 28>; [INV]
  874. <bb 27> :
  875. xSpace = xStreamBufferSpacesAvailable (pxStreamBuffer);
  876. <bb 28> :
  877. xReturn = prvWriteMessageToBuffer (pxStreamBuffer, pvTxData, xDataLengthBytes, xSpace, xRequiredSpace);
  878. if (xReturn != 0)
  879. goto <bb 29>; [INV]
  880. else
  881. goto <bb 33>; [INV]
  882. <bb 29> :
  883. _10 = prvBytesInBuffer (pxStreamBuffer);
  884. _11 = pxStreamBuffer->xTriggerLevelBytes;
  885. if (_10 >= _11)
  886. goto <bb 30>; [INV]
  887. else
  888. goto <bb 33>; [INV]
  889. <bb 30> :
  890. vTaskSuspendAll ();
  891. _12 = pxStreamBuffer->xTaskWaitingToReceive;
  892. if (_12 != 0B)
  893. goto <bb 31>; [INV]
  894. else
  895. goto <bb 32>; [INV]
  896. <bb 31> :
  897. _13 = pxStreamBuffer->xTaskWaitingToReceive;
  898. xTaskGenericNotify (_13, 0, 0, 0, 0B);
  899. pxStreamBuffer->xTaskWaitingToReceive = 0B;
  900. <bb 32> :
  901. xTaskResumeAll ();
  902. <bb 33> :
  903. D.6418 = xReturn;
  904. xTimeOut = {CLOBBER};
  905. <bb 34> :
  906. <L41>:
  907. return D.6418;
  908. }
  909. xStreamBufferBytesAvailable (struct StreamBufferDef_t * xStreamBuffer)
  910. {
  911. size_t xReturn;
  912. const struct StreamBuffer_t * const pxStreamBuffer;
  913. size_t D.6382;
  914. <bb 2> :
  915. pxStreamBuffer = xStreamBuffer;
  916. if (pxStreamBuffer == 0B)
  917. goto <bb 3>; [INV]
  918. else
  919. goto <bb 5>; [INV]
  920. <bb 3> :
  921. vPortRaiseBASEPRI ();
  922. <bb 4> :
  923. goto <bb 4>; [INV]
  924. <bb 5> :
  925. xReturn = prvBytesInBuffer (pxStreamBuffer);
  926. D.6382 = xReturn;
  927. <bb 6> :
  928. <L3>:
  929. return D.6382;
  930. }
  931. xStreamBufferSpacesAvailable (struct StreamBufferDef_t * xStreamBuffer)
  932. {
  933. size_t xOriginalTail;
  934. size_t xSpace;
  935. const struct StreamBuffer_t * const pxStreamBuffer;
  936. size_t D.6378;
  937. unsigned int D.6374;
  938. <bb 2> :
  939. pxStreamBuffer = xStreamBuffer;
  940. if (pxStreamBuffer == 0B)
  941. goto <bb 3>; [INV]
  942. else
  943. goto <bb 5>; [INV]
  944. <bb 3> :
  945. vPortRaiseBASEPRI ();
  946. <bb 4> :
  947. goto <bb 4>; [INV]
  948. <bb 5> :
  949. xOriginalTail = pxStreamBuffer->xTail;
  950. _1 = pxStreamBuffer->xLength;
  951. _2 = pxStreamBuffer->xTail;
  952. xSpace = _1 + _2;
  953. D.6374 = pxStreamBuffer->xHead;
  954. xSpace = xSpace - D.6374;
  955. _3 = pxStreamBuffer->xTail;
  956. if (xOriginalTail != _3)
  957. goto <bb 5>; [INV]
  958. else
  959. goto <bb 6>; [INV]
  960. <bb 6> :
  961. xSpace = xSpace + 4294967295;
  962. _4 = pxStreamBuffer->xLength;
  963. if (xSpace >= _4)
  964. goto <bb 7>; [INV]
  965. else
  966. goto <bb 8>; [INV]
  967. <bb 7> :
  968. _5 = pxStreamBuffer->xLength;
  969. xSpace = xSpace - _5;
  970. <bb 8> :
  971. D.6378 = xSpace;
  972. <bb 9> :
  973. <L8>:
  974. return D.6378;
  975. }
  976. xStreamBufferSetTriggerLevel (struct StreamBufferDef_t * xStreamBuffer, size_t xTriggerLevel)
  977. {
  978. BaseType_t xReturn;
  979. struct StreamBuffer_t * const pxStreamBuffer;
  980. BaseType_t D.6370;
  981. <bb 2> :
  982. pxStreamBuffer = xStreamBuffer;
  983. if (pxStreamBuffer == 0B)
  984. goto <bb 3>; [INV]
  985. else
  986. goto <bb 5>; [INV]
  987. <bb 3> :
  988. vPortRaiseBASEPRI ();
  989. <bb 4> :
  990. goto <bb 4>; [INV]
  991. <bb 5> :
  992. if (xTriggerLevel == 0)
  993. goto <bb 6>; [INV]
  994. else
  995. goto <bb 7>; [INV]
  996. <bb 6> :
  997. xTriggerLevel = 1;
  998. <bb 7> :
  999. _1 = pxStreamBuffer->xLength;
  1000. if (xTriggerLevel < _1)
  1001. goto <bb 8>; [INV]
  1002. else
  1003. goto <bb 9>; [INV]
  1004. <bb 8> :
  1005. pxStreamBuffer->xTriggerLevelBytes = xTriggerLevel;
  1006. xReturn = 1;
  1007. goto <bb 10>; [INV]
  1008. <bb 9> :
  1009. xReturn = 0;
  1010. <bb 10> :
  1011. D.6370 = xReturn;
  1012. <bb 11> :
  1013. <L8>:
  1014. return D.6370;
  1015. }
  1016. xStreamBufferReset (struct StreamBufferDef_t * xStreamBuffer)
  1017. {
  1018. UBaseType_t uxStreamBufferNumber;
  1019. BaseType_t xReturn;
  1020. struct StreamBuffer_t * const pxStreamBuffer;
  1021. BaseType_t D.6361;
  1022. <bb 2> :
  1023. pxStreamBuffer = xStreamBuffer;
  1024. xReturn = 0;
  1025. if (pxStreamBuffer == 0B)
  1026. goto <bb 3>; [INV]
  1027. else
  1028. goto <bb 5>; [INV]
  1029. <bb 3> :
  1030. vPortRaiseBASEPRI ();
  1031. <bb 4> :
  1032. goto <bb 4>; [INV]
  1033. <bb 5> :
  1034. uxStreamBufferNumber = pxStreamBuffer->uxStreamBufferNumber;
  1035. vPortEnterCritical ();
  1036. _1 = pxStreamBuffer->xTaskWaitingToReceive;
  1037. if (_1 == 0B)
  1038. goto <bb 6>; [INV]
  1039. else
  1040. goto <bb 8>; [INV]
  1041. <bb 6> :
  1042. _2 = pxStreamBuffer->xTaskWaitingToSend;
  1043. if (_2 == 0B)
  1044. goto <bb 7>; [INV]
  1045. else
  1046. goto <bb 8>; [INV]
  1047. <bb 7> :
  1048. _3 = pxStreamBuffer->pucBuffer;
  1049. _4 = pxStreamBuffer->xLength;
  1050. _5 = pxStreamBuffer->xTriggerLevelBytes;
  1051. _6 = pxStreamBuffer->ucFlags;
  1052. prvInitialiseNewStreamBuffer (pxStreamBuffer, _3, _4, _5, _6);
  1053. xReturn = 1;
  1054. pxStreamBuffer->uxStreamBufferNumber = uxStreamBufferNumber;
  1055. <bb 8> :
  1056. vPortExitCritical ();
  1057. D.6361 = xReturn;
  1058. <bb 9> :
  1059. <L7>:
  1060. return D.6361;
  1061. }
  1062. vStreamBufferDelete (struct StreamBufferDef_t * xStreamBuffer)
  1063. {
  1064. struct StreamBuffer_t * pxStreamBuffer;
  1065. <bb 2> :
  1066. pxStreamBuffer = xStreamBuffer;
  1067. if (pxStreamBuffer == 0B)
  1068. goto <bb 3>; [INV]
  1069. else
  1070. goto <bb 5>; [INV]
  1071. <bb 3> :
  1072. vPortRaiseBASEPRI ();
  1073. <bb 4> :
  1074. goto <bb 4>; [INV]
  1075. <bb 5> :
  1076. _1 = pxStreamBuffer->ucFlags;
  1077. _2 = (int) _1;
  1078. _3 = _2 & 2;
  1079. if (_3 == 0)
  1080. goto <bb 6>; [INV]
  1081. else
  1082. goto <bb 7>; [INV]
  1083. <bb 6> :
  1084. vPortFree (pxStreamBuffer);
  1085. goto <bb 8>; [INV]
  1086. <bb 7> :
  1087. memset (pxStreamBuffer, 0, 36);
  1088. <bb 8> :
  1089. return;
  1090. }
  1091. xStreamBufferGenericCreate (size_t xBufferSizeBytes, size_t xTriggerLevelBytes, BaseType_t xIsMessageBuffer)
  1092. {
  1093. uint8_t ucFlags;
  1094. uint8_t * pucAllocatedMemory;
  1095. struct StreamBufferDef_t * D.6348;
  1096. <bb 2> :
  1097. if (xIsMessageBuffer == 1)
  1098. goto <bb 3>; [INV]
  1099. else
  1100. goto <bb 6>; [INV]
  1101. <bb 3> :
  1102. ucFlags = 1;
  1103. if (xBufferSizeBytes <= 4)
  1104. goto <bb 4>; [INV]
  1105. else
  1106. goto <bb 9>; [INV]
  1107. <bb 4> :
  1108. vPortRaiseBASEPRI ();
  1109. <bb 5> :
  1110. goto <bb 5>; [INV]
  1111. <bb 6> :
  1112. ucFlags = 0;
  1113. if (xBufferSizeBytes == 0)
  1114. goto <bb 7>; [INV]
  1115. else
  1116. goto <bb 9>; [INV]
  1117. <bb 7> :
  1118. vPortRaiseBASEPRI ();
  1119. <bb 8> :
  1120. goto <bb 8>; [INV]
  1121. <bb 9> :
  1122. if (xTriggerLevelBytes > xBufferSizeBytes)
  1123. goto <bb 10>; [INV]
  1124. else
  1125. goto <bb 12>; [INV]
  1126. <bb 10> :
  1127. vPortRaiseBASEPRI ();
  1128. <bb 11> :
  1129. goto <bb 11>; [INV]
  1130. <bb 12> :
  1131. if (xTriggerLevelBytes == 0)
  1132. goto <bb 13>; [INV]
  1133. else
  1134. goto <bb 14>; [INV]
  1135. <bb 13> :
  1136. xTriggerLevelBytes = 1;
  1137. <bb 14> :
  1138. if (xBufferSizeBytes <= 4294967258)
  1139. goto <bb 15>; [INV]
  1140. else
  1141. goto <bb 16>; [INV]
  1142. <bb 15> :
  1143. xBufferSizeBytes = xBufferSizeBytes + 1;
  1144. _1 = xBufferSizeBytes + 36;
  1145. pucAllocatedMemory = pvPortMalloc (_1);
  1146. goto <bb 17>; [INV]
  1147. <bb 16> :
  1148. pucAllocatedMemory = 0B;
  1149. <bb 17> :
  1150. if (pucAllocatedMemory != 0B)
  1151. goto <bb 18>; [INV]
  1152. else
  1153. goto <bb 19>; [INV]
  1154. <bb 18> :
  1155. _2 = pucAllocatedMemory + 36;
  1156. prvInitialiseNewStreamBuffer (pucAllocatedMemory, _2, xBufferSizeBytes, xTriggerLevelBytes, ucFlags);
  1157. <bb 19> :
  1158. D.6348 = pucAllocatedMemory;
  1159. <bb 20> :
  1160. <L20>:
  1161. return D.6348;
  1162. }
  1163. __attribute__((always_inline))
  1164. vPortSetBASEPRI (uint32_t ulNewMaskValue)
  1165. {
  1166. <bb 2> :
  1167. __asm__ __volatile__(" msr basepri, %0 " : : "r" ulNewMaskValue : "memory");
  1168. return;
  1169. }
  1170. __attribute__((always_inline))
  1171. ulPortRaiseBASEPRI ()
  1172. {
  1173. uint32_t ulNewBASEPRI;
  1174. uint32_t ulOriginalBASEPRI;
  1175. uint32_t D.6438;
  1176. <bb 2> :
  1177. __asm__ __volatile__(" mrs %0, basepri
  1178. mov %1, %2
  1179. msr basepri, %1
  1180. isb
  1181. dsb
  1182. " : "=r" ulOriginalBASEPRI, "=r" ulNewBASEPRI : "i" 16 : "memory");
  1183. D.6438 = ulOriginalBASEPRI;
  1184. <bb 3> :
  1185. <L0>:
  1186. return D.6438;
  1187. }
  1188. __attribute__((always_inline))
  1189. vPortRaiseBASEPRI ()
  1190. {
  1191. uint32_t ulNewBASEPRI;
  1192. <bb 2> :
  1193. __asm__ __volatile__(" mov %0, %1
  1194. msr basepri, %0
  1195. isb
  1196. dsb
  1197. " : "=r" ulNewBASEPRI : "i" 16 : "memory");
  1198. return;
  1199. }