event_groups.c.022i.opt_local_passes 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927
  1. vEventGroupSetNumber (void * xEventGroup, UBaseType_t uxEventGroupNumber)
  2. {
  3. <bb 2> :
  4. MEM[(struct EventGroup_t *)xEventGroup_2(D)].uxEventGroupNumber = uxEventGroupNumber_3(D);
  5. return;
  6. }
  7. uxEventGroupGetNumber (void * xEventGroup)
  8. {
  9. const struct EventGroup_t * pxEventBits;
  10. UBaseType_t xReturn;
  11. UBaseType_t D.6567;
  12. UBaseType_t _7;
  13. <bb 2> :
  14. pxEventBits_3 = xEventGroup_2(D);
  15. if (xEventGroup_2(D) == 0B)
  16. goto <bb 3>; [INV]
  17. else
  18. goto <bb 4>; [INV]
  19. <bb 3> :
  20. xReturn_6 = 0;
  21. goto <bb 5>; [INV]
  22. <bb 4> :
  23. xReturn_5 = pxEventBits_3->uxEventGroupNumber;
  24. <bb 5> :
  25. # xReturn_1 = PHI <xReturn_6(3), xReturn_5(4)>
  26. _7 = xReturn_1;
  27. <bb 6> :
  28. <L3>:
  29. return _7;
  30. }
  31. xEventGroupSetBitsFromISR (struct EventGroupDef_t * xEventGroup, const EventBits_t uxBitsToSet, BaseType_t * pxHigherPriorityTaskWoken)
  32. {
  33. BaseType_t xReturn;
  34. BaseType_t D.6562;
  35. BaseType_t _7;
  36. <bb 2> :
  37. xReturn_6 = xTimerPendFunctionCallFromISR (vEventGroupSetBitsCallback, xEventGroup_2(D), uxBitsToSet_3(D), pxHigherPriorityTaskWoken_4(D));
  38. _7 = xReturn_6;
  39. <bb 3> :
  40. <L0>:
  41. return _7;
  42. }
  43. prvTestWaitCondition (const EventBits_t uxCurrentEventBits, const EventBits_t uxBitsToWaitFor, const BaseType_t xWaitForAllBits)
  44. {
  45. BaseType_t xWaitConditionMet;
  46. BaseType_t D.6560;
  47. long unsigned int _1;
  48. long unsigned int _2;
  49. BaseType_t _10;
  50. <bb 2> :
  51. xWaitConditionMet_4 = 0;
  52. if (xWaitForAllBits_5(D) == 0)
  53. goto <bb 3>; [INV]
  54. else
  55. goto <bb 5>; [INV]
  56. <bb 3> :
  57. _1 = uxCurrentEventBits_6(D) & uxBitsToWaitFor_7(D);
  58. if (_1 != 0)
  59. goto <bb 4>; [INV]
  60. else
  61. goto <bb 7>; [INV]
  62. <bb 4> :
  63. xWaitConditionMet_9 = 1;
  64. goto <bb 7>; [INV]
  65. <bb 5> :
  66. _2 = uxCurrentEventBits_6(D) & uxBitsToWaitFor_7(D);
  67. if (uxBitsToWaitFor_7(D) == _2)
  68. goto <bb 6>; [INV]
  69. else
  70. goto <bb 7>; [INV]
  71. <bb 6> :
  72. xWaitConditionMet_8 = 1;
  73. <bb 7> :
  74. # xWaitConditionMet_3 = PHI <xWaitConditionMet_9(4), xWaitConditionMet_4(5), xWaitConditionMet_8(6), xWaitConditionMet_4(3)>
  75. _10 = xWaitConditionMet_3;
  76. <bb 8> :
  77. <L9>:
  78. return _10;
  79. }
  80. vEventGroupClearBitsCallback (void * pvEventGroup, const uint32_t ulBitsToClear)
  81. {
  82. <bb 2> :
  83. xEventGroupClearBits (pvEventGroup_2(D), ulBitsToClear_3(D));
  84. return;
  85. }
  86. vEventGroupSetBitsCallback (void * pvEventGroup, const uint32_t ulBitsToSet)
  87. {
  88. <bb 2> :
  89. xEventGroupSetBits (pvEventGroup_2(D), ulBitsToSet_3(D));
  90. return;
  91. }
  92. vEventGroupDelete (struct EventGroupDef_t * xEventGroup)
  93. {
  94. const struct List_t * pxTasksWaitingForBits;
  95. struct EventGroup_t * pxEventBits;
  96. struct xLIST_ITEM * _1;
  97. const struct MiniListItem_t * _2;
  98. struct xLIST_ITEM * _3;
  99. long unsigned int _4;
  100. <bb 2> :
  101. if (xEventGroup_6(D) == 0B)
  102. goto <bb 3>; [INV]
  103. else
  104. goto <bb 5>; [INV]
  105. <bb 3> :
  106. vPortRaiseBASEPRI ();
  107. <bb 4> :
  108. goto <bb 4>; [INV]
  109. <bb 5> :
  110. pxEventBits_7 = xEventGroup_6(D);
  111. pxTasksWaitingForBits_8 = &pxEventBits_7->xTasksWaitingForBits;
  112. vTaskSuspendAll ();
  113. goto <bb 10>; [INV]
  114. <bb 6> :
  115. _1 = pxTasksWaitingForBits_8->xListEnd.pxNext;
  116. _2 = &pxTasksWaitingForBits_8->xListEnd;
  117. if (_1 == _2)
  118. goto <bb 7>; [INV]
  119. else
  120. goto <bb 9>; [INV]
  121. <bb 7> :
  122. vPortRaiseBASEPRI ();
  123. <bb 8> :
  124. goto <bb 8>; [INV]
  125. <bb 9> :
  126. _3 = pxTasksWaitingForBits_8->xListEnd.pxNext;
  127. vTaskRemoveFromUnorderedEventList (_3, 33554432);
  128. <bb 10> :
  129. _4 ={v} pxTasksWaitingForBits_8->uxNumberOfItems;
  130. if (_4 != 0)
  131. goto <bb 6>; [INV]
  132. else
  133. goto <bb 11>; [INV]
  134. <bb 11> :
  135. vPortFree (pxEventBits_7);
  136. xTaskResumeAll ();
  137. return;
  138. }
  139. xEventGroupSetBits (struct EventGroupDef_t * xEventGroup, const EventBits_t uxBitsToSet)
  140. {
  141. BaseType_t xMatchFound;
  142. struct EventGroup_t * pxEventBits;
  143. EventBits_t uxControlBits;
  144. EventBits_t uxBitsWaitedFor;
  145. EventBits_t uxBitsToClear;
  146. const struct List_t * pxList;
  147. const struct ListItem_t * pxListEnd;
  148. struct ListItem_t * pxNext;
  149. struct ListItem_t * pxListItem;
  150. EventBits_t D.6545;
  151. long unsigned int _1;
  152. long unsigned int _2;
  153. long unsigned int _3;
  154. long unsigned int _4;
  155. long unsigned int _5;
  156. long unsigned int _6;
  157. long unsigned int _7;
  158. long unsigned int _8;
  159. long unsigned int _9;
  160. long unsigned int _10;
  161. long unsigned int _11;
  162. long unsigned int _12;
  163. long unsigned int _13;
  164. long unsigned int _14;
  165. EventBits_t _35;
  166. <bb 2> :
  167. uxBitsToClear_22 = 0;
  168. pxEventBits_24 = xEventGroup_23(D);
  169. xMatchFound_25 = 0;
  170. if (xEventGroup_23(D) == 0B)
  171. goto <bb 3>; [INV]
  172. else
  173. goto <bb 5>; [INV]
  174. <bb 3> :
  175. vPortRaiseBASEPRI ();
  176. <bb 4> :
  177. goto <bb 4>; [INV]
  178. <bb 5> :
  179. _1 = uxBitsToSet_26(D) & 4278190080;
  180. if (_1 != 0)
  181. goto <bb 6>; [INV]
  182. else
  183. goto <bb 8>; [INV]
  184. <bb 6> :
  185. vPortRaiseBASEPRI ();
  186. <bb 7> :
  187. goto <bb 7>; [INV]
  188. <bb 8> :
  189. pxList_27 = &pxEventBits_24->xTasksWaitingForBits;
  190. pxListEnd_28 = &pxList_27->xListEnd;
  191. vTaskSuspendAll ();
  192. pxListItem_31 = pxList_27->xListEnd.pxNext;
  193. _2 = pxEventBits_24->uxEventBits;
  194. _3 = uxBitsToSet_26(D) | _2;
  195. pxEventBits_24->uxEventBits = _3;
  196. goto <bb 19>; [INV]
  197. <bb 9> :
  198. pxNext_36 = pxListItem_15->pxNext;
  199. uxBitsWaitedFor_37 = pxListItem_15->xItemValue;
  200. xMatchFound_38 = 0;
  201. uxControlBits_39 = uxBitsWaitedFor_37 & 4278190080;
  202. uxBitsWaitedFor_40 = uxBitsWaitedFor_37 & 16777215;
  203. _4 = uxControlBits_39 & 67108864;
  204. if (_4 == 0)
  205. goto <bb 10>; [INV]
  206. else
  207. goto <bb 12>; [INV]
  208. <bb 10> :
  209. _5 = pxEventBits_24->uxEventBits;
  210. _6 = uxBitsWaitedFor_40 & _5;
  211. if (_6 != 0)
  212. goto <bb 11>; [INV]
  213. else
  214. goto <bb 14>; [INV]
  215. <bb 11> :
  216. xMatchFound_42 = 1;
  217. goto <bb 14>; [INV]
  218. <bb 12> :
  219. _7 = pxEventBits_24->uxEventBits;
  220. _8 = uxBitsWaitedFor_40 & _7;
  221. if (uxBitsWaitedFor_40 == _8)
  222. goto <bb 13>; [INV]
  223. else
  224. goto <bb 14>; [INV]
  225. <bb 13> :
  226. xMatchFound_41 = 1;
  227. <bb 14> :
  228. # xMatchFound_19 = PHI <xMatchFound_42(11), xMatchFound_38(12), xMatchFound_41(13), xMatchFound_38(10)>
  229. if (xMatchFound_19 != 0)
  230. goto <bb 15>; [INV]
  231. else
  232. goto <bb 18>; [INV]
  233. <bb 15> :
  234. _9 = uxControlBits_39 & 16777216;
  235. if (_9 != 0)
  236. goto <bb 16>; [INV]
  237. else
  238. goto <bb 17>; [INV]
  239. <bb 16> :
  240. uxBitsToClear_43 = uxBitsToClear_18 | uxBitsWaitedFor_40;
  241. <bb 17> :
  242. # uxBitsToClear_16 = PHI <uxBitsToClear_18(15), uxBitsToClear_43(16)>
  243. _10 = pxEventBits_24->uxEventBits;
  244. _11 = _10 | 33554432;
  245. vTaskRemoveFromUnorderedEventList (pxListItem_15, _11);
  246. <bb 18> :
  247. # uxBitsToClear_17 = PHI <uxBitsToClear_18(14), uxBitsToClear_16(17)>
  248. pxListItem_45 = pxNext_36;
  249. <bb 19> :
  250. # pxListItem_15 = PHI <pxListItem_31(8), pxListItem_45(18)>
  251. # uxBitsToClear_18 = PHI <uxBitsToClear_22(8), uxBitsToClear_17(18)>
  252. if (pxListItem_15 != pxListEnd_28)
  253. goto <bb 9>; [INV]
  254. else
  255. goto <bb 20>; [INV]
  256. <bb 20> :
  257. _12 = pxEventBits_24->uxEventBits;
  258. _13 = ~uxBitsToClear_18;
  259. _14 = _12 & _13;
  260. pxEventBits_24->uxEventBits = _14;
  261. xTaskResumeAll ();
  262. _35 = pxEventBits_24->uxEventBits;
  263. <bb 21> :
  264. <L23>:
  265. return _35;
  266. }
  267. xEventGroupGetBitsFromISR (struct EventGroupDef_t * xEventGroup)
  268. {
  269. EventBits_t uxReturn;
  270. const struct EventGroup_t * const pxEventBits;
  271. UBaseType_t uxSavedInterruptStatus;
  272. EventBits_t D.6523;
  273. EventBits_t _8;
  274. <bb 2> :
  275. pxEventBits_2 = xEventGroup_1(D);
  276. uxSavedInterruptStatus_5 = ulPortRaiseBASEPRI ();
  277. uxReturn_6 = pxEventBits_2->uxEventBits;
  278. vPortSetBASEPRI (uxSavedInterruptStatus_5);
  279. _8 = uxReturn_6;
  280. <bb 3> :
  281. <L0>:
  282. return _8;
  283. }
  284. xEventGroupClearBitsFromISR (struct EventGroupDef_t * xEventGroup, const EventBits_t uxBitsToClear)
  285. {
  286. BaseType_t xReturn;
  287. BaseType_t D.6521;
  288. BaseType_t _6;
  289. <bb 2> :
  290. xReturn_5 = xTimerPendFunctionCallFromISR (vEventGroupClearBitsCallback, xEventGroup_2(D), uxBitsToClear_3(D), 0B);
  291. _6 = xReturn_5;
  292. <bb 3> :
  293. <L0>:
  294. return _6;
  295. }
  296. xEventGroupClearBits (struct EventGroupDef_t * xEventGroup, const EventBits_t uxBitsToClear)
  297. {
  298. EventBits_t uxReturn;
  299. struct EventGroup_t * pxEventBits;
  300. EventBits_t D.6519;
  301. long unsigned int _1;
  302. long unsigned int _2;
  303. long unsigned int _3;
  304. long unsigned int _4;
  305. EventBits_t _13;
  306. <bb 2> :
  307. pxEventBits_6 = xEventGroup_5(D);
  308. if (xEventGroup_5(D) == 0B)
  309. goto <bb 3>; [INV]
  310. else
  311. goto <bb 5>; [INV]
  312. <bb 3> :
  313. vPortRaiseBASEPRI ();
  314. <bb 4> :
  315. goto <bb 4>; [INV]
  316. <bb 5> :
  317. _1 = uxBitsToClear_7(D) & 4278190080;
  318. if (_1 != 0)
  319. goto <bb 6>; [INV]
  320. else
  321. goto <bb 8>; [INV]
  322. <bb 6> :
  323. vPortRaiseBASEPRI ();
  324. <bb 7> :
  325. goto <bb 7>; [INV]
  326. <bb 8> :
  327. vPortEnterCritical ();
  328. uxReturn_10 = pxEventBits_6->uxEventBits;
  329. _2 = pxEventBits_6->uxEventBits;
  330. _3 = ~uxBitsToClear_7(D);
  331. _4 = _2 & _3;
  332. pxEventBits_6->uxEventBits = _4;
  333. vPortExitCritical ();
  334. _13 = uxReturn_10;
  335. <bb 9> :
  336. <L6>:
  337. return _13;
  338. }
  339. xEventGroupWaitBits (struct EventGroupDef_t * xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait)
  340. {
  341. const EventBits_t uxCurrentEventBits;
  342. BaseType_t xTimeoutOccurred;
  343. BaseType_t xAlreadyYielded;
  344. BaseType_t xWaitConditionMet;
  345. EventBits_t uxControlBits;
  346. EventBits_t uxReturn;
  347. struct EventGroup_t * pxEventBits;
  348. EventBits_t D.6513;
  349. int iftmp.1;
  350. long unsigned int _1;
  351. long int _2;
  352. long unsigned int _3;
  353. long unsigned int _4;
  354. long unsigned int _5;
  355. struct List_t * _6;
  356. long unsigned int _7;
  357. volatile uint32_t * _8;
  358. long unsigned int _9;
  359. long int _10;
  360. long unsigned int _11;
  361. long unsigned int _12;
  362. long unsigned int _13;
  363. int iftmp.1_20;
  364. int iftmp.1_34;
  365. int iftmp.1_35;
  366. EventBits_t _65;
  367. <bb 2> :
  368. pxEventBits_27 = xEventGroup_26(D);
  369. uxControlBits_28 = 0;
  370. xTimeoutOccurred_29 = 0;
  371. if (xEventGroup_26(D) == 0B)
  372. goto <bb 3>; [INV]
  373. else
  374. goto <bb 5>; [INV]
  375. <bb 3> :
  376. vPortRaiseBASEPRI ();
  377. <bb 4> :
  378. goto <bb 4>; [INV]
  379. <bb 5> :
  380. _1 = uxBitsToWaitFor_30(D) & 4278190080;
  381. if (_1 != 0)
  382. goto <bb 6>; [INV]
  383. else
  384. goto <bb 8>; [INV]
  385. <bb 6> :
  386. vPortRaiseBASEPRI ();
  387. <bb 7> :
  388. goto <bb 7>; [INV]
  389. <bb 8> :
  390. if (uxBitsToWaitFor_30(D) == 0)
  391. goto <bb 9>; [INV]
  392. else
  393. goto <bb 11>; [INV]
  394. <bb 9> :
  395. vPortRaiseBASEPRI ();
  396. <bb 10> :
  397. goto <bb 10>; [INV]
  398. <bb 11> :
  399. _2 = xTaskGetSchedulerState ();
  400. if (_2 != 0)
  401. goto <bb 13>; [INV]
  402. else
  403. goto <bb 12>; [INV]
  404. <bb 12> :
  405. if (xTicksToWait_33(D) == 0)
  406. goto <bb 13>; [INV]
  407. else
  408. goto <bb 14>; [INV]
  409. <bb 13> :
  410. iftmp.1_35 = 1;
  411. goto <bb 15>; [INV]
  412. <bb 14> :
  413. iftmp.1_34 = 0;
  414. <bb 15> :
  415. # iftmp.1_20 = PHI <iftmp.1_35(13), iftmp.1_34(14)>
  416. if (iftmp.1_20 == 0)
  417. goto <bb 16>; [INV]
  418. else
  419. goto <bb 18>; [INV]
  420. <bb 16> :
  421. vPortRaiseBASEPRI ();
  422. <bb 17> :
  423. goto <bb 17>; [INV]
  424. <bb 18> :
  425. vTaskSuspendAll ();
  426. uxCurrentEventBits_37 = pxEventBits_27->uxEventBits;
  427. xWaitConditionMet_40 = prvTestWaitCondition (uxCurrentEventBits_37, uxBitsToWaitFor_30(D), xWaitForAllBits_38(D));
  428. if (xWaitConditionMet_40 != 0)
  429. goto <bb 19>; [INV]
  430. else
  431. goto <bb 21>; [INV]
  432. <bb 19> :
  433. uxReturn_48 = uxCurrentEventBits_37;
  434. xTicksToWait_49 = 0;
  435. if (xClearOnExit_41(D) != 0)
  436. goto <bb 20>; [INV]
  437. else
  438. goto <bb 28>; [INV]
  439. <bb 20> :
  440. _3 = pxEventBits_27->uxEventBits;
  441. _4 = ~uxBitsToWaitFor_30(D);
  442. _5 = _3 & _4;
  443. pxEventBits_27->uxEventBits = _5;
  444. goto <bb 28>; [INV]
  445. <bb 21> :
  446. if (xTicksToWait_33(D) == 0)
  447. goto <bb 22>; [INV]
  448. else
  449. goto <bb 23>; [INV]
  450. <bb 22> :
  451. uxReturn_46 = uxCurrentEventBits_37;
  452. xTimeoutOccurred_47 = 1;
  453. goto <bb 28>; [INV]
  454. <bb 23> :
  455. if (xClearOnExit_41(D) != 0)
  456. goto <bb 24>; [INV]
  457. else
  458. goto <bb 25>; [INV]
  459. <bb 24> :
  460. uxControlBits_42 = uxControlBits_28 | 16777216;
  461. <bb 25> :
  462. # uxControlBits_18 = PHI <uxControlBits_28(23), uxControlBits_42(24)>
  463. if (xWaitForAllBits_38(D) != 0)
  464. goto <bb 26>; [INV]
  465. else
  466. goto <bb 27>; [INV]
  467. <bb 26> :
  468. uxControlBits_43 = uxControlBits_18 | 67108864;
  469. <bb 27> :
  470. # uxControlBits_19 = PHI <uxControlBits_18(25), uxControlBits_43(26)>
  471. _6 = &pxEventBits_27->xTasksWaitingForBits;
  472. _7 = uxBitsToWaitFor_30(D) | uxControlBits_19;
  473. vTaskPlaceOnUnorderedEventList (_6, _7, xTicksToWait_33(D));
  474. uxReturn_45 = 0;
  475. <bb 28> :
  476. # xTicksToWait_14 = PHI <xTicksToWait_49(20), xTicksToWait_33(D)(22), xTicksToWait_33(D)(27), xTicksToWait_49(19)>
  477. # uxReturn_15 = PHI <uxReturn_48(20), uxReturn_46(22), uxReturn_45(27), uxReturn_48(19)>
  478. xAlreadyYielded_52 = xTaskResumeAll ();
  479. if (xTicksToWait_14 != 0)
  480. goto <bb 29>; [INV]
  481. else
  482. goto <bb 37>; [INV]
  483. <bb 29> :
  484. if (xAlreadyYielded_52 == 0)
  485. goto <bb 30>; [INV]
  486. else
  487. goto <bb 31>; [INV]
  488. <bb 30> :
  489. _8 = 3758157060B;
  490. *_8 ={v} 268435456;
  491. __asm__ __volatile__("dsb" : : : "memory");
  492. __asm__ __volatile__("isb");
  493. <bb 31> :
  494. uxReturn_57 = uxTaskResetEventItemValue ();
  495. _9 = uxReturn_57 & 33554432;
  496. if (_9 == 0)
  497. goto <bb 32>; [INV]
  498. else
  499. goto <bb 36>; [INV]
  500. <bb 32> :
  501. vPortEnterCritical ();
  502. uxReturn_59 = pxEventBits_27->uxEventBits;
  503. _10 = prvTestWaitCondition (uxReturn_59, uxBitsToWaitFor_30(D), xWaitForAllBits_38(D));
  504. if (_10 != 0)
  505. goto <bb 33>; [INV]
  506. else
  507. goto <bb 35>; [INV]
  508. <bb 33> :
  509. if (xClearOnExit_41(D) != 0)
  510. goto <bb 34>; [INV]
  511. else
  512. goto <bb 35>; [INV]
  513. <bb 34> :
  514. _11 = pxEventBits_27->uxEventBits;
  515. _12 = ~uxBitsToWaitFor_30(D);
  516. _13 = _11 & _12;
  517. pxEventBits_27->uxEventBits = _13;
  518. <bb 35> :
  519. xTimeoutOccurred_62 = 1;
  520. vPortExitCritical ();
  521. <bb 36> :
  522. # uxReturn_16 = PHI <uxReturn_57(31), uxReturn_59(35)>
  523. uxReturn_64 = uxReturn_16 & 16777215;
  524. <bb 37> :
  525. # uxReturn_17 = PHI <uxReturn_15(28), uxReturn_64(36)>
  526. _65 = uxReturn_17;
  527. <bb 38> :
  528. <L45>:
  529. return _65;
  530. }
  531. xEventGroupSync (struct EventGroupDef_t * xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait)
  532. {
  533. BaseType_t xTimeoutOccurred;
  534. BaseType_t xAlreadyYielded;
  535. struct EventGroup_t * pxEventBits;
  536. EventBits_t uxReturn;
  537. EventBits_t uxOriginalBitValue;
  538. EventBits_t D.6469;
  539. int iftmp.0;
  540. long unsigned int _1;
  541. long int _2;
  542. long unsigned int _3;
  543. long unsigned int _4;
  544. long unsigned int _5;
  545. long unsigned int _6;
  546. long unsigned int _7;
  547. struct List_t * _8;
  548. long unsigned int _9;
  549. volatile uint32_t * _10;
  550. long unsigned int _11;
  551. long unsigned int _12;
  552. long unsigned int _13;
  553. long unsigned int _14;
  554. long unsigned int _15;
  555. int iftmp.0_20;
  556. int iftmp.0_33;
  557. int iftmp.0_34;
  558. EventBits_t _59;
  559. <bb 2> :
  560. pxEventBits_27 = xEventGroup_26(D);
  561. xTimeoutOccurred_28 = 0;
  562. _1 = uxBitsToWaitFor_29(D) & 4278190080;
  563. if (_1 != 0)
  564. goto <bb 3>; [INV]
  565. else
  566. goto <bb 5>; [INV]
  567. <bb 3> :
  568. vPortRaiseBASEPRI ();
  569. <bb 4> :
  570. goto <bb 4>; [INV]
  571. <bb 5> :
  572. if (uxBitsToWaitFor_29(D) == 0)
  573. goto <bb 6>; [INV]
  574. else
  575. goto <bb 8>; [INV]
  576. <bb 6> :
  577. vPortRaiseBASEPRI ();
  578. <bb 7> :
  579. goto <bb 7>; [INV]
  580. <bb 8> :
  581. _2 = xTaskGetSchedulerState ();
  582. if (_2 != 0)
  583. goto <bb 10>; [INV]
  584. else
  585. goto <bb 9>; [INV]
  586. <bb 9> :
  587. if (xTicksToWait_32(D) == 0)
  588. goto <bb 10>; [INV]
  589. else
  590. goto <bb 11>; [INV]
  591. <bb 10> :
  592. iftmp.0_34 = 1;
  593. goto <bb 12>; [INV]
  594. <bb 11> :
  595. iftmp.0_33 = 0;
  596. <bb 12> :
  597. # iftmp.0_20 = PHI <iftmp.0_34(10), iftmp.0_33(11)>
  598. if (iftmp.0_20 == 0)
  599. goto <bb 13>; [INV]
  600. else
  601. goto <bb 15>; [INV]
  602. <bb 13> :
  603. vPortRaiseBASEPRI ();
  604. <bb 14> :
  605. goto <bb 14>; [INV]
  606. <bb 15> :
  607. vTaskSuspendAll ();
  608. uxOriginalBitValue_36 = pxEventBits_27->uxEventBits;
  609. xEventGroupSetBits (xEventGroup_26(D), uxBitsToSet_37(D));
  610. _3 = uxOriginalBitValue_36 | uxBitsToSet_37(D);
  611. _4 = uxBitsToWaitFor_29(D) & _3;
  612. if (uxBitsToWaitFor_29(D) == _4)
  613. goto <bb 16>; [INV]
  614. else
  615. goto <bb 17>; [INV]
  616. <bb 16> :
  617. uxReturn_43 = uxOriginalBitValue_36 | uxBitsToSet_37(D);
  618. _5 = pxEventBits_27->uxEventBits;
  619. _6 = ~uxBitsToWaitFor_29(D);
  620. _7 = _5 & _6;
  621. pxEventBits_27->uxEventBits = _7;
  622. xTicksToWait_45 = 0;
  623. goto <bb 20>; [INV]
  624. <bb 17> :
  625. if (xTicksToWait_32(D) != 0)
  626. goto <bb 18>; [INV]
  627. else
  628. goto <bb 19>; [INV]
  629. <bb 18> :
  630. _8 = &pxEventBits_27->xTasksWaitingForBits;
  631. _9 = uxBitsToWaitFor_29(D) | 83886080;
  632. vTaskPlaceOnUnorderedEventList (_8, _9, xTicksToWait_32(D));
  633. uxReturn_42 = 0;
  634. goto <bb 20>; [INV]
  635. <bb 19> :
  636. uxReturn_39 = pxEventBits_27->uxEventBits;
  637. xTimeoutOccurred_40 = 1;
  638. <bb 20> :
  639. # xTicksToWait_16 = PHI <xTicksToWait_45(16), xTicksToWait_32(D)(18), xTicksToWait_32(D)(19)>
  640. # uxReturn_17 = PHI <uxReturn_43(16), uxReturn_42(18), uxReturn_39(19)>
  641. xAlreadyYielded_47 = xTaskResumeAll ();
  642. if (xTicksToWait_16 != 0)
  643. goto <bb 21>; [INV]
  644. else
  645. goto <bb 28>; [INV]
  646. <bb 21> :
  647. if (xAlreadyYielded_47 == 0)
  648. goto <bb 22>; [INV]
  649. else
  650. goto <bb 23>; [INV]
  651. <bb 22> :
  652. _10 = 3758157060B;
  653. *_10 ={v} 268435456;
  654. __asm__ __volatile__("dsb" : : : "memory");
  655. __asm__ __volatile__("isb");
  656. <bb 23> :
  657. uxReturn_52 = uxTaskResetEventItemValue ();
  658. _11 = uxReturn_52 & 33554432;
  659. if (_11 == 0)
  660. goto <bb 24>; [INV]
  661. else
  662. goto <bb 27>; [INV]
  663. <bb 24> :
  664. vPortEnterCritical ();
  665. uxReturn_54 = pxEventBits_27->uxEventBits;
  666. _12 = uxReturn_54 & uxBitsToWaitFor_29(D);
  667. if (uxBitsToWaitFor_29(D) == _12)
  668. goto <bb 25>; [INV]
  669. else
  670. goto <bb 26>; [INV]
  671. <bb 25> :
  672. _13 = pxEventBits_27->uxEventBits;
  673. _14 = ~uxBitsToWaitFor_29(D);
  674. _15 = _13 & _14;
  675. pxEventBits_27->uxEventBits = _15;
  676. <bb 26> :
  677. vPortExitCritical ();
  678. xTimeoutOccurred_57 = 1;
  679. <bb 27> :
  680. # uxReturn_18 = PHI <uxReturn_52(23), uxReturn_54(26)>
  681. uxReturn_58 = uxReturn_18 & 16777215;
  682. <bb 28> :
  683. # uxReturn_19 = PHI <uxReturn_17(20), uxReturn_58(27)>
  684. _59 = uxReturn_19;
  685. <bb 29> :
  686. <L30>:
  687. return _59;
  688. }
  689. xEventGroupCreate ()
  690. {
  691. struct EventGroup_t * pxEventBits;
  692. struct EventGroupDef_t * D.6439;
  693. struct List_t * _1;
  694. struct EventGroupDef_t * _8;
  695. <bb 2> :
  696. pxEventBits_5 = pvPortMalloc (28);
  697. if (pxEventBits_5 != 0B)
  698. goto <bb 3>; [INV]
  699. else
  700. goto <bb 4>; [INV]
  701. <bb 3> :
  702. pxEventBits_5->uxEventBits = 0;
  703. _1 = &pxEventBits_5->xTasksWaitingForBits;
  704. vListInitialise (_1);
  705. <bb 4> :
  706. _8 = pxEventBits_5;
  707. <bb 5> :
  708. <L3>:
  709. return _8;
  710. }
  711. __attribute__((always_inline))
  712. vPortSetBASEPRI (uint32_t ulNewMaskValue)
  713. {
  714. <bb 2> :
  715. __asm__ __volatile__(" msr basepri, %0 " : : "r" ulNewMaskValue_2(D) : "memory");
  716. return;
  717. }
  718. __attribute__((always_inline))
  719. ulPortRaiseBASEPRI ()
  720. {
  721. uint32_t ulNewBASEPRI;
  722. uint32_t ulOriginalBASEPRI;
  723. uint32_t D.6525;
  724. uint32_t _5;
  725. <bb 2> :
  726. __asm__ __volatile__(" mrs %0, basepri
  727. mov %1, %2
  728. msr basepri, %1
  729. isb
  730. dsb
  731. " : "=r" ulOriginalBASEPRI_3, "=r" ulNewBASEPRI_4 : "i" 16 : "memory");
  732. _5 = ulOriginalBASEPRI_3;
  733. <bb 3> :
  734. <L0>:
  735. return _5;
  736. }
  737. __attribute__((always_inline))
  738. vPortRaiseBASEPRI ()
  739. {
  740. uint32_t ulNewBASEPRI;
  741. <bb 2> :
  742. __asm__ __volatile__(" mov %0, %1
  743. msr basepri, %0
  744. isb
  745. dsb
  746. " : "=r" ulNewBASEPRI_3 : "i" 16 : "memory");
  747. return;
  748. }