heap_4.c.075i.fnsummary 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868
  1. Symbol table:
  2. vPortExitCritical/24 (vPortExitCritical) @06becee0
  3. Type: function
  4. Visibility: external public
  5. References:
  6. Referring:
  7. Availability: not_available
  8. Function flags:
  9. Called by: vPortGetHeapStats/20
  10. Calls:
  11. vPortEnterCritical/23 (vPortEnterCritical) @06becd20
  12. Type: function
  13. Visibility: external public
  14. References:
  15. Referring:
  16. Availability: not_available
  17. Function flags:
  18. Called by: vPortGetHeapStats/20
  19. Calls:
  20. xTaskResumeAll/22 (xTaskResumeAll) @06bec380
  21. Type: function
  22. Visibility: external public
  23. References:
  24. Referring:
  25. Availability: not_available
  26. Function flags:
  27. Called by: vPortGetHeapStats/20 vPortFree/14 pvPortMalloc/13
  28. Calls:
  29. vTaskSuspendAll/21 (vTaskSuspendAll) @06bec1c0
  30. Type: function
  31. Visibility: external public
  32. References:
  33. Referring:
  34. Availability: not_available
  35. Function flags:
  36. Called by: vPortGetHeapStats/20 vPortFree/14 pvPortMalloc/13
  37. Calls:
  38. vPortGetHeapStats/20 (vPortGetHeapStats) @06bdd2a0
  39. Type: function definition analyzed
  40. Visibility: force_output externally_visible no_reorder public
  41. References: xStart/6 (read)pxEnd/7 (read)xFreeBytesRemaining/8 (read)xNumberOfSuccessfulAllocations/10 (read)xNumberOfSuccessfulFrees/11 (read)xMinimumEverFreeBytesRemaining/9 (read)
  42. Referring:
  43. Availability: available
  44. Function flags: body
  45. Called by:
  46. Calls: vPortExitCritical/24 vPortEnterCritical/23 xTaskResumeAll/22 vTaskSuspendAll/21
  47. prvInsertBlockIntoFreeList/19 (prvInsertBlockIntoFreeList) @06bddee0
  48. Type: function definition analyzed
  49. Visibility: force_output no_reorder prevailing_def_ironly
  50. References: xStart/6 (addr)pxEnd/7 (read)pxEnd/7 (read)
  51. Referring:
  52. Availability: available
  53. Function flags: body
  54. Called by: vPortFree/14 pvPortMalloc/13
  55. Calls:
  56. prvHeapInit/18 (prvHeapInit) @06bddc40
  57. Type: function definition analyzed
  58. Visibility: force_output no_reorder prevailing_def_ironly
  59. References: ucHeap/4 (addr)ucHeap/4 (addr)xStart/6 (write)xStart/6 (write)pxEnd/7 (write)pxEnd/7 (read)pxEnd/7 (read)pxEnd/7 (read)xMinimumEverFreeBytesRemaining/9 (write)xFreeBytesRemaining/8 (write)xBlockAllocatedBit/12 (write)
  60. Referring:
  61. Availability: available
  62. Function flags: body
  63. Called by: pvPortMalloc/13
  64. Calls:
  65. vPortInitialiseBlocks/17 (vPortInitialiseBlocks) @06bdd9a0
  66. Type: function definition analyzed
  67. Visibility: force_output externally_visible no_reorder public
  68. References:
  69. Referring:
  70. Availability: available
  71. Function flags: body
  72. Called by:
  73. Calls:
  74. xPortGetMinimumEverFreeHeapSize/16 (xPortGetMinimumEverFreeHeapSize) @06bdd700
  75. Type: function definition analyzed
  76. Visibility: force_output externally_visible no_reorder public
  77. References: xMinimumEverFreeBytesRemaining/9 (read)
  78. Referring:
  79. Availability: available
  80. Function flags: body
  81. Called by:
  82. Calls:
  83. xPortGetFreeHeapSize/15 (xPortGetFreeHeapSize) @06bdd460
  84. Type: function definition analyzed
  85. Visibility: force_output externally_visible no_reorder public
  86. References: xFreeBytesRemaining/8 (read)
  87. Referring:
  88. Availability: available
  89. Function flags: body
  90. Called by:
  91. Calls:
  92. vPortFree/14 (vPortFree) @06bdd1c0
  93. Type: function definition analyzed
  94. Visibility: force_output externally_visible no_reorder public
  95. References: xBlockAllocatedBit/12 (read)xBlockAllocatedBit/12 (read)xBlockAllocatedBit/12 (read)xFreeBytesRemaining/8 (read)xFreeBytesRemaining/8 (write)xNumberOfSuccessfulFrees/11 (read)xNumberOfSuccessfulFrees/11 (write)
  96. Referring:
  97. Availability: available
  98. Function flags: body
  99. Called by:
  100. Calls: xTaskResumeAll/22 prvInsertBlockIntoFreeList/19 vTaskSuspendAll/21
  101. pvPortMalloc/13 (pvPortMalloc) @06bd7e00
  102. Type: function definition analyzed
  103. Visibility: force_output externally_visible no_reorder public
  104. References: pxEnd/7 (read)xBlockAllocatedBit/12 (read)xFreeBytesRemaining/8 (read)xStart/6 (addr)xStart/6 (read)pxEnd/7 (read)xFreeBytesRemaining/8 (read)xFreeBytesRemaining/8 (write)xFreeBytesRemaining/8 (read)xMinimumEverFreeBytesRemaining/9 (read)xFreeBytesRemaining/8 (read)xMinimumEverFreeBytesRemaining/9 (write)xBlockAllocatedBit/12 (read)xNumberOfSuccessfulAllocations/10 (read)xNumberOfSuccessfulAllocations/10 (write)
  105. Referring:
  106. Availability: available
  107. Function flags: body
  108. Called by:
  109. Calls: xTaskResumeAll/22 prvInsertBlockIntoFreeList/19 prvHeapInit/18 vTaskSuspendAll/21
  110. xBlockAllocatedBit/12 (xBlockAllocatedBit) @06c27678
  111. Type: variable definition analyzed
  112. Visibility: force_output no_reorder prevailing_def_ironly
  113. References:
  114. Referring: prvHeapInit/18 (write)pvPortMalloc/13 (read)pvPortMalloc/13 (read)vPortFree/14 (read)vPortFree/14 (read)vPortFree/14 (read)
  115. Availability: available
  116. Varpool flags: initialized
  117. xNumberOfSuccessfulFrees/11 (xNumberOfSuccessfulFrees) @06c275e8
  118. Type: variable definition analyzed
  119. Visibility: force_output no_reorder prevailing_def_ironly
  120. References:
  121. Referring: vPortFree/14 (write)vPortFree/14 (read)vPortGetHeapStats/20 (read)
  122. Availability: available
  123. Varpool flags: initialized
  124. xNumberOfSuccessfulAllocations/10 (xNumberOfSuccessfulAllocations) @06c275a0
  125. Type: variable definition analyzed
  126. Visibility: force_output no_reorder prevailing_def_ironly
  127. References:
  128. Referring: pvPortMalloc/13 (write)pvPortMalloc/13 (read)vPortGetHeapStats/20 (read)
  129. Availability: available
  130. Varpool flags: initialized
  131. xMinimumEverFreeBytesRemaining/9 (xMinimumEverFreeBytesRemaining) @06c27558
  132. Type: variable definition analyzed
  133. Visibility: force_output no_reorder prevailing_def_ironly
  134. References:
  135. Referring: pvPortMalloc/13 (write)xPortGetMinimumEverFreeHeapSize/16 (read)prvHeapInit/18 (write)pvPortMalloc/13 (read)vPortGetHeapStats/20 (read)
  136. Availability: available
  137. Varpool flags: initialized
  138. xFreeBytesRemaining/8 (xFreeBytesRemaining) @06c27510
  139. Type: variable definition analyzed
  140. Visibility: force_output no_reorder prevailing_def_ironly
  141. References:
  142. Referring: pvPortMalloc/13 (read)prvHeapInit/18 (write)pvPortMalloc/13 (read)vPortFree/14 (write)xPortGetFreeHeapSize/15 (read)pvPortMalloc/13 (read)pvPortMalloc/13 (read)pvPortMalloc/13 (write)vPortFree/14 (read)vPortGetHeapStats/20 (read)
  143. Availability: available
  144. Varpool flags: initialized
  145. pxEnd/7 (pxEnd) @06c27480
  146. Type: variable definition analyzed
  147. Visibility: force_output no_reorder prevailing_def_ironly
  148. References:
  149. Referring: prvHeapInit/18 (read)prvHeapInit/18 (read)prvInsertBlockIntoFreeList/19 (read)prvInsertBlockIntoFreeList/19 (read)pvPortMalloc/13 (read)prvHeapInit/18 (write)prvHeapInit/18 (read)pvPortMalloc/13 (read)vPortGetHeapStats/20 (read)
  150. Availability: available
  151. Varpool flags: initialized
  152. xStart/6 (xStart) @06c273f0
  153. Type: variable definition analyzed
  154. Visibility: force_output no_reorder prevailing_def_ironly
  155. References:
  156. Referring: prvHeapInit/18 (write)prvHeapInit/18 (write)pvPortMalloc/13 (read)prvInsertBlockIntoFreeList/19 (addr)pvPortMalloc/13 (addr)vPortGetHeapStats/20 (read)
  157. Availability: available
  158. Varpool flags:
  159. xHeapStructSize/5 (xHeapStructSize) @06c27360
  160. Type: variable definition analyzed
  161. Visibility: force_output no_reorder prevailing_def_ironly
  162. References:
  163. Referring:
  164. Availability: available
  165. Varpool flags: initialized read-only const-value-known
  166. ucHeap/4 (ucHeap) @06c27120
  167. Type: variable definition analyzed
  168. Visibility: force_output no_reorder prevailing_def_ironly
  169. References:
  170. Referring: prvHeapInit/18 (addr)prvHeapInit/18 (addr)
  171. Availability: available
  172. Varpool flags:
  173. vPortGetHeapStats (struct HeapStats_t * pxHeapStats)
  174. {
  175. size_t xMinSize;
  176. size_t xMaxSize;
  177. size_t xBlocks;
  178. struct BlockLink_t * pxBlock;
  179. unsigned int _1;
  180. unsigned int _2;
  181. struct BlockLink_t * pxEnd.32_3;
  182. unsigned int xFreeBytesRemaining.33_4;
  183. unsigned int xNumberOfSuccessfulAllocations.34_5;
  184. unsigned int xNumberOfSuccessfulFrees.35_6;
  185. unsigned int xMinimumEverFreeBytesRemaining.36_7;
  186. <bb 2> :
  187. xBlocks_17 = 0;
  188. xMaxSize_18 = 0;
  189. xMinSize_19 = 4294967295;
  190. vTaskSuspendAll ();
  191. pxBlock_22 = xStart.pxNextFreeBlock;
  192. if (pxBlock_22 != 0B)
  193. goto <bb 3>; [INV]
  194. else
  195. goto <bb 8>; [INV]
  196. <bb 3> :
  197. # pxBlock_8 = PHI <pxBlock_22(2), pxBlock_26(7)>
  198. # xBlocks_9 = PHI <xBlocks_17(2), xBlocks_23(7)>
  199. # xMaxSize_11 = PHI <xMaxSize_18(2), xMaxSize_12(7)>
  200. # xMinSize_14 = PHI <xMinSize_19(2), xMinSize_15(7)>
  201. xBlocks_23 = xBlocks_9 + 1;
  202. _1 = pxBlock_8->xBlockSize;
  203. if (xMaxSize_11 < _1)
  204. goto <bb 4>; [INV]
  205. else
  206. goto <bb 5>; [INV]
  207. <bb 4> :
  208. xMaxSize_24 = pxBlock_8->xBlockSize;
  209. <bb 5> :
  210. # xMaxSize_12 = PHI <xMaxSize_11(3), xMaxSize_24(4)>
  211. _2 = pxBlock_8->xBlockSize;
  212. if (xMinSize_14 > _2)
  213. goto <bb 6>; [INV]
  214. else
  215. goto <bb 7>; [INV]
  216. <bb 6> :
  217. xMinSize_25 = pxBlock_8->xBlockSize;
  218. <bb 7> :
  219. # xMinSize_15 = PHI <xMinSize_14(5), xMinSize_25(6)>
  220. pxBlock_26 = pxBlock_8->pxNextFreeBlock;
  221. pxEnd.32_3 = pxEnd;
  222. if (pxBlock_26 != pxEnd.32_3)
  223. goto <bb 3>; [INV]
  224. else
  225. goto <bb 8>; [INV]
  226. <bb 8> :
  227. # xBlocks_10 = PHI <xBlocks_17(2), xBlocks_23(7)>
  228. # xMaxSize_13 = PHI <xMaxSize_18(2), xMaxSize_12(7)>
  229. # xMinSize_16 = PHI <xMinSize_19(2), xMinSize_15(7)>
  230. xTaskResumeAll ();
  231. pxHeapStats_28(D)->xSizeOfLargestFreeBlockInBytes = xMaxSize_13;
  232. pxHeapStats_28(D)->xSizeOfSmallestFreeBlockInBytes = xMinSize_16;
  233. pxHeapStats_28(D)->xNumberOfFreeBlocks = xBlocks_10;
  234. vPortEnterCritical ();
  235. xFreeBytesRemaining.33_4 = xFreeBytesRemaining;
  236. pxHeapStats_28(D)->xAvailableHeapSpaceInBytes = xFreeBytesRemaining.33_4;
  237. xNumberOfSuccessfulAllocations.34_5 = xNumberOfSuccessfulAllocations;
  238. pxHeapStats_28(D)->xNumberOfSuccessfulAllocations = xNumberOfSuccessfulAllocations.34_5;
  239. xNumberOfSuccessfulFrees.35_6 = xNumberOfSuccessfulFrees;
  240. pxHeapStats_28(D)->xNumberOfSuccessfulFrees = xNumberOfSuccessfulFrees.35_6;
  241. xMinimumEverFreeBytesRemaining.36_7 = xMinimumEverFreeBytesRemaining;
  242. pxHeapStats_28(D)->xMinimumEverFreeBytesRemaining = xMinimumEverFreeBytesRemaining.36_7;
  243. vPortExitCritical ();
  244. return;
  245. }
  246. prvInsertBlockIntoFreeList (struct BlockLink_t * pxBlockToInsert)
  247. {
  248. uint8_t * puc;
  249. struct BlockLink_t * pxIterator;
  250. struct A_BLOCK_LINK * _1;
  251. unsigned int _2;
  252. uint8_t * _3;
  253. unsigned int _4;
  254. unsigned int _5;
  255. unsigned int _6;
  256. unsigned int _7;
  257. uint8_t * _8;
  258. struct A_BLOCK_LINK * _9;
  259. struct A_BLOCK_LINK * _10;
  260. struct BlockLink_t * pxEnd.30_11;
  261. unsigned int _12;
  262. struct A_BLOCK_LINK * _13;
  263. unsigned int _14;
  264. unsigned int _15;
  265. struct A_BLOCK_LINK * _16;
  266. struct A_BLOCK_LINK * _17;
  267. struct BlockLink_t * pxEnd.31_18;
  268. struct A_BLOCK_LINK * _19;
  269. <bb 2> :
  270. pxIterator_25 = &xStart;
  271. goto <bb 4>; [INV]
  272. <bb 3> :
  273. pxIterator_37 = pxIterator_21->pxNextFreeBlock;
  274. <bb 4> :
  275. # pxIterator_21 = PHI <pxIterator_25(2), pxIterator_37(3)>
  276. _1 = pxIterator_21->pxNextFreeBlock;
  277. if (pxBlockToInsert_27(D) > _1)
  278. goto <bb 3>; [INV]
  279. else
  280. goto <bb 5>; [INV]
  281. <bb 5> :
  282. puc_28 = pxIterator_21;
  283. _2 = pxIterator_21->xBlockSize;
  284. _3 = puc_28 + _2;
  285. if (pxBlockToInsert_27(D) == _3)
  286. goto <bb 6>; [INV]
  287. else
  288. goto <bb 7>; [INV]
  289. <bb 6> :
  290. _4 = pxIterator_21->xBlockSize;
  291. _5 = pxBlockToInsert_27(D)->xBlockSize;
  292. _6 = _4 + _5;
  293. pxIterator_21->xBlockSize = _6;
  294. pxBlockToInsert_30 = pxIterator_21;
  295. <bb 7> :
  296. # pxBlockToInsert_20 = PHI <pxBlockToInsert_27(D)(5), pxBlockToInsert_30(6)>
  297. puc_31 = pxBlockToInsert_20;
  298. _7 = pxBlockToInsert_20->xBlockSize;
  299. _8 = puc_31 + _7;
  300. _9 = pxIterator_21->pxNextFreeBlock;
  301. if (_8 == _9)
  302. goto <bb 8>; [INV]
  303. else
  304. goto <bb 11>; [INV]
  305. <bb 8> :
  306. _10 = pxIterator_21->pxNextFreeBlock;
  307. pxEnd.30_11 = pxEnd;
  308. if (_10 != pxEnd.30_11)
  309. goto <bb 9>; [INV]
  310. else
  311. goto <bb 10>; [INV]
  312. <bb 9> :
  313. _12 = pxBlockToInsert_20->xBlockSize;
  314. _13 = pxIterator_21->pxNextFreeBlock;
  315. _14 = _13->xBlockSize;
  316. _15 = _12 + _14;
  317. pxBlockToInsert_20->xBlockSize = _15;
  318. _16 = pxIterator_21->pxNextFreeBlock;
  319. _17 = _16->pxNextFreeBlock;
  320. pxBlockToInsert_20->pxNextFreeBlock = _17;
  321. goto <bb 12>; [INV]
  322. <bb 10> :
  323. pxEnd.31_18 = pxEnd;
  324. pxBlockToInsert_20->pxNextFreeBlock = pxEnd.31_18;
  325. goto <bb 12>; [INV]
  326. <bb 11> :
  327. _19 = pxIterator_21->pxNextFreeBlock;
  328. pxBlockToInsert_20->pxNextFreeBlock = _19;
  329. <bb 12> :
  330. if (pxIterator_21 != pxBlockToInsert_20)
  331. goto <bb 13>; [INV]
  332. else
  333. goto <bb 14>; [INV]
  334. <bb 13> :
  335. pxIterator_21->pxNextFreeBlock = pxBlockToInsert_20;
  336. <bb 14> :
  337. return;
  338. }
  339. prvHeapInit ()
  340. {
  341. size_t xTotalHeapSize;
  342. size_t uxAddress;
  343. uint8_t * pucAlignedHeap;
  344. struct BlockLink_t * pxFirstFreeBlock;
  345. unsigned int _1;
  346. unsigned int _2;
  347. unsigned int ucHeap.22_3;
  348. unsigned int pucAlignedHeap.23_4;
  349. unsigned int xHeapStructSize.24_5;
  350. struct BlockLink_t * uxAddress.25_6;
  351. struct BlockLink_t * pxEnd.26_7;
  352. struct BlockLink_t * pxEnd.27_8;
  353. unsigned int pxFirstFreeBlock.28_9;
  354. unsigned int _10;
  355. struct BlockLink_t * pxEnd.29_11;
  356. unsigned int _12;
  357. unsigned int _13;
  358. <bb 2> :
  359. xTotalHeapSize_16 = 8192;
  360. uxAddress_17 = (size_t) &ucHeap;
  361. _1 = uxAddress_17 & 7;
  362. if (_1 != 0)
  363. goto <bb 3>; [INV]
  364. else
  365. goto <bb 4>; [INV]
  366. <bb 3> :
  367. uxAddress_18 = uxAddress_17 + 7;
  368. uxAddress_19 = uxAddress_18 & 4294967288;
  369. _2 = xTotalHeapSize_16 - uxAddress_19;
  370. ucHeap.22_3 = (unsigned int) &ucHeap;
  371. xTotalHeapSize_20 = _2 + ucHeap.22_3;
  372. <bb 4> :
  373. # uxAddress_14 = PHI <uxAddress_17(2), uxAddress_19(3)>
  374. # xTotalHeapSize_15 = PHI <xTotalHeapSize_16(2), xTotalHeapSize_20(3)>
  375. pucAlignedHeap_21 = (uint8_t *) uxAddress_14;
  376. xStart.pxNextFreeBlock = pucAlignedHeap_21;
  377. xStart.xBlockSize = 0;
  378. pucAlignedHeap.23_4 = (unsigned int) pucAlignedHeap_21;
  379. uxAddress_25 = xTotalHeapSize_15 + pucAlignedHeap.23_4;
  380. xHeapStructSize.24_5 = 8;
  381. uxAddress_26 = uxAddress_25 - xHeapStructSize.24_5;
  382. uxAddress_27 = uxAddress_26 & 4294967288;
  383. uxAddress.25_6 = (struct BlockLink_t *) uxAddress_27;
  384. pxEnd = uxAddress.25_6;
  385. pxEnd.26_7 = pxEnd;
  386. pxEnd.26_7->xBlockSize = 0;
  387. pxEnd.27_8 = pxEnd;
  388. pxEnd.27_8->pxNextFreeBlock = 0B;
  389. pxFirstFreeBlock_31 = pucAlignedHeap_21;
  390. pxFirstFreeBlock.28_9 = (unsigned int) pxFirstFreeBlock_31;
  391. _10 = uxAddress_27 - pxFirstFreeBlock.28_9;
  392. pxFirstFreeBlock_31->xBlockSize = _10;
  393. pxEnd.29_11 = pxEnd;
  394. pxFirstFreeBlock_31->pxNextFreeBlock = pxEnd.29_11;
  395. _12 = pxFirstFreeBlock_31->xBlockSize;
  396. xMinimumEverFreeBytesRemaining = _12;
  397. _13 = pxFirstFreeBlock_31->xBlockSize;
  398. xFreeBytesRemaining = _13;
  399. xBlockAllocatedBit = 2147483648;
  400. return;
  401. }
  402. vPortInitialiseBlocks ()
  403. {
  404. <bb 2> :
  405. return;
  406. }
  407. xPortGetMinimumEverFreeHeapSize ()
  408. {
  409. size_t D.6339;
  410. size_t _2;
  411. <bb 2> :
  412. _2 = xMinimumEverFreeBytesRemaining;
  413. <bb 3> :
  414. <L0>:
  415. return _2;
  416. }
  417. xPortGetFreeHeapSize ()
  418. {
  419. size_t D.6337;
  420. size_t _2;
  421. <bb 2> :
  422. _2 = xFreeBytesRemaining;
  423. <bb 3> :
  424. <L0>:
  425. return _2;
  426. }
  427. vPortFree (void * pv)
  428. {
  429. uint32_t ulNewBASEPRI;
  430. uint32_t ulNewBASEPRI;
  431. struct BlockLink_t * pxLink;
  432. uint8_t * puc;
  433. unsigned int xHeapStructSize.16_1;
  434. sizetype _2;
  435. unsigned int _3;
  436. unsigned int xBlockAllocatedBit.17_4;
  437. unsigned int _5;
  438. struct A_BLOCK_LINK * _6;
  439. unsigned int _7;
  440. unsigned int xBlockAllocatedBit.18_8;
  441. unsigned int _9;
  442. struct A_BLOCK_LINK * _10;
  443. unsigned int _11;
  444. unsigned int xBlockAllocatedBit.19_12;
  445. unsigned int _13;
  446. unsigned int _14;
  447. unsigned int _15;
  448. unsigned int xFreeBytesRemaining.20_16;
  449. unsigned int _17;
  450. unsigned int xNumberOfSuccessfulFrees.21_18;
  451. unsigned int _19;
  452. <bb 2> :
  453. puc_22 = pv_21(D);
  454. if (pv_21(D) != 0B)
  455. goto <bb 3>; [INV]
  456. else
  457. goto <bb 14>; [INV]
  458. <bb 3> :
  459. xHeapStructSize.16_1 = 8;
  460. _2 = -xHeapStructSize.16_1;
  461. puc_24 = puc_22 + _2;
  462. pxLink_25 = puc_24;
  463. _3 = pxLink_25->xBlockSize;
  464. xBlockAllocatedBit.17_4 = xBlockAllocatedBit;
  465. _5 = _3 & xBlockAllocatedBit.17_4;
  466. if (_5 == 0)
  467. goto <bb 4>; [INV]
  468. else
  469. goto <bb 7>; [INV]
  470. <bb 4> :
  471. __asm__ __volatile__(" mov %0, %1
  472. msr basepri, %0
  473. isb
  474. dsb
  475. " : "=r" ulNewBASEPRI_32 : "i" 16 : "memory");
  476. <bb 5> :
  477. <bb 6> :
  478. goto <bb 6>; [INV]
  479. <bb 7> :
  480. _6 = pxLink_25->pxNextFreeBlock;
  481. if (_6 != 0B)
  482. goto <bb 8>; [INV]
  483. else
  484. goto <bb 11>; [INV]
  485. <bb 8> :
  486. __asm__ __volatile__(" mov %0, %1
  487. msr basepri, %0
  488. isb
  489. dsb
  490. " : "=r" ulNewBASEPRI_33 : "i" 16 : "memory");
  491. <bb 9> :
  492. <bb 10> :
  493. goto <bb 10>; [INV]
  494. <bb 11> :
  495. _7 = pxLink_25->xBlockSize;
  496. xBlockAllocatedBit.18_8 = xBlockAllocatedBit;
  497. _9 = _7 & xBlockAllocatedBit.18_8;
  498. if (_9 != 0)
  499. goto <bb 12>; [INV]
  500. else
  501. goto <bb 14>; [INV]
  502. <bb 12> :
  503. _10 = pxLink_25->pxNextFreeBlock;
  504. if (_10 == 0B)
  505. goto <bb 13>; [INV]
  506. else
  507. goto <bb 14>; [INV]
  508. <bb 13> :
  509. _11 = pxLink_25->xBlockSize;
  510. xBlockAllocatedBit.19_12 = xBlockAllocatedBit;
  511. _13 = ~xBlockAllocatedBit.19_12;
  512. _14 = _11 & _13;
  513. pxLink_25->xBlockSize = _14;
  514. vTaskSuspendAll ();
  515. _15 = pxLink_25->xBlockSize;
  516. xFreeBytesRemaining.20_16 = xFreeBytesRemaining;
  517. _17 = _15 + xFreeBytesRemaining.20_16;
  518. xFreeBytesRemaining = _17;
  519. prvInsertBlockIntoFreeList (pxLink_25);
  520. xNumberOfSuccessfulFrees.21_18 = xNumberOfSuccessfulFrees;
  521. _19 = xNumberOfSuccessfulFrees.21_18 + 1;
  522. xNumberOfSuccessfulFrees = _19;
  523. xTaskResumeAll ();
  524. <bb 14> :
  525. return;
  526. }
  527. pvPortMalloc (size_t xWantedSize)
  528. {
  529. uint32_t ulNewBASEPRI;
  530. uint32_t ulNewBASEPRI;
  531. uint32_t ulNewBASEPRI;
  532. void * pvReturn;
  533. struct BlockLink_t * pxNewBlockLink;
  534. struct BlockLink_t * pxPreviousBlock;
  535. struct BlockLink_t * pxBlock;
  536. void * D.6323;
  537. struct BlockLink_t * pxEnd.0_1;
  538. unsigned int xBlockAllocatedBit.1_2;
  539. unsigned int _3;
  540. unsigned int xHeapStructSize.2_4;
  541. unsigned int _5;
  542. unsigned int xHeapStructSize.3_6;
  543. unsigned int _7;
  544. unsigned int _8;
  545. unsigned int _9;
  546. unsigned int _10;
  547. unsigned int _11;
  548. unsigned int xFreeBytesRemaining.4_12;
  549. unsigned int _13;
  550. struct A_BLOCK_LINK * _14;
  551. struct BlockLink_t * pxEnd.5_15;
  552. struct A_BLOCK_LINK * _16;
  553. unsigned int xHeapStructSize.6_17;
  554. struct A_BLOCK_LINK * _18;
  555. unsigned int _19;
  556. unsigned int _20;
  557. unsigned int xHeapStructSize.7_21;
  558. unsigned int _22;
  559. unsigned int pxNewBlockLink.8_23;
  560. unsigned int _24;
  561. unsigned int _25;
  562. unsigned int _26;
  563. unsigned int xFreeBytesRemaining.9_27;
  564. unsigned int _28;
  565. unsigned int _29;
  566. unsigned int xFreeBytesRemaining.10_30;
  567. unsigned int xMinimumEverFreeBytesRemaining.11_31;
  568. unsigned int xFreeBytesRemaining.12_32;
  569. unsigned int _33;
  570. unsigned int xBlockAllocatedBit.13_34;
  571. unsigned int _35;
  572. unsigned int xNumberOfSuccessfulAllocations.14_36;
  573. unsigned int _37;
  574. unsigned int pvReturn.15_38;
  575. unsigned int _39;
  576. void * _74;
  577. <bb 2> :
  578. pvReturn_49 = 0B;
  579. vTaskSuspendAll ();
  580. pxEnd.0_1 = pxEnd;
  581. if (pxEnd.0_1 == 0B)
  582. goto <bb 3>; [INV]
  583. else
  584. goto <bb 4>; [INV]
  585. <bb 3> :
  586. prvHeapInit ();
  587. <bb 4> :
  588. xBlockAllocatedBit.1_2 = xBlockAllocatedBit;
  589. _3 = xWantedSize_53(D) & xBlockAllocatedBit.1_2;
  590. if (_3 == 0)
  591. goto <bb 5>; [INV]
  592. else
  593. goto <bb 32>; [INV]
  594. <bb 5> :
  595. if (xWantedSize_53(D) != 0)
  596. goto <bb 6>; [INV]
  597. else
  598. goto <bb 15>; [INV]
  599. <bb 6> :
  600. xHeapStructSize.2_4 = 8;
  601. _5 = xWantedSize_53(D) + xHeapStructSize.2_4;
  602. if (xWantedSize_53(D) < _5)
  603. goto <bb 7>; [INV]
  604. else
  605. goto <bb 15>; [INV]
  606. <bb 7> :
  607. xHeapStructSize.3_6 = 8;
  608. xWantedSize_54 = xWantedSize_53(D) + xHeapStructSize.3_6;
  609. _7 = xWantedSize_54 & 7;
  610. if (_7 != 0)
  611. goto <bb 8>; [INV]
  612. else
  613. goto <bb 14>; [INV]
  614. <bb 8> :
  615. _8 = xWantedSize_54 & 4294967288;
  616. _9 = _8 + 8;
  617. if (xWantedSize_54 < _9)
  618. goto <bb 9>; [INV]
  619. else
  620. goto <bb 13>; [INV]
  621. <bb 9> :
  622. _10 = xWantedSize_54 & 4294967288;
  623. xWantedSize_56 = _10 + 8;
  624. _11 = xWantedSize_56 & 7;
  625. if (_11 != 0)
  626. goto <bb 10>; [INV]
  627. else
  628. goto <bb 14>; [INV]
  629. <bb 10> :
  630. __asm__ __volatile__(" mov %0, %1
  631. msr basepri, %0
  632. isb
  633. dsb
  634. " : "=r" ulNewBASEPRI_75 : "i" 16 : "memory");
  635. <bb 11> :
  636. <bb 12> :
  637. goto <bb 12>; [INV]
  638. <bb 13> :
  639. xWantedSize_55 = 0;
  640. <bb 14> :
  641. # xWantedSize_40 = PHI <xWantedSize_54(7), xWantedSize_55(13), xWantedSize_56(9)>
  642. goto <bb 16>; [INV]
  643. <bb 15> :
  644. xWantedSize_57 = 0;
  645. <bb 16> :
  646. # xWantedSize_41 = PHI <xWantedSize_40(14), xWantedSize_57(15)>
  647. if (xWantedSize_41 != 0)
  648. goto <bb 17>; [INV]
  649. else
  650. goto <bb 32>; [INV]
  651. <bb 17> :
  652. xFreeBytesRemaining.4_12 = xFreeBytesRemaining;
  653. if (xWantedSize_41 <= xFreeBytesRemaining.4_12)
  654. goto <bb 18>; [INV]
  655. else
  656. goto <bb 32>; [INV]
  657. <bb 18> :
  658. pxPreviousBlock_58 = &xStart;
  659. pxBlock_59 = xStart.pxNextFreeBlock;
  660. goto <bb 20>; [INV]
  661. <bb 19> :
  662. pxPreviousBlock_60 = pxBlock_42;
  663. pxBlock_61 = pxBlock_42->pxNextFreeBlock;
  664. <bb 20> :
  665. # pxBlock_42 = PHI <pxBlock_59(18), pxBlock_61(19)>
  666. # pxPreviousBlock_43 = PHI <pxPreviousBlock_58(18), pxPreviousBlock_60(19)>
  667. _13 = pxBlock_42->xBlockSize;
  668. if (xWantedSize_41 > _13)
  669. goto <bb 21>; [INV]
  670. else
  671. goto <bb 22>; [INV]
  672. <bb 21> :
  673. _14 = pxBlock_42->pxNextFreeBlock;
  674. if (_14 != 0B)
  675. goto <bb 19>; [INV]
  676. else
  677. goto <bb 22>; [INV]
  678. <bb 22> :
  679. pxEnd.5_15 = pxEnd;
  680. if (pxBlock_42 != pxEnd.5_15)
  681. goto <bb 23>; [INV]
  682. else
  683. goto <bb 32>; [INV]
  684. <bb 23> :
  685. _16 = pxPreviousBlock_43->pxNextFreeBlock;
  686. xHeapStructSize.6_17 = 8;
  687. pvReturn_62 = _16 + xHeapStructSize.6_17;
  688. _18 = pxBlock_42->pxNextFreeBlock;
  689. pxPreviousBlock_43->pxNextFreeBlock = _18;
  690. _19 = pxBlock_42->xBlockSize;
  691. _20 = _19 - xWantedSize_41;
  692. xHeapStructSize.7_21 = 8;
  693. _22 = xHeapStructSize.7_21 << 1;
  694. if (_20 > _22)
  695. goto <bb 24>; [INV]
  696. else
  697. goto <bb 29>; [INV]
  698. <bb 24> :
  699. pxNewBlockLink_64 = pxBlock_42 + xWantedSize_41;
  700. pxNewBlockLink.8_23 = (unsigned int) pxNewBlockLink_64;
  701. _24 = pxNewBlockLink.8_23 & 7;
  702. if (_24 != 0)
  703. goto <bb 25>; [INV]
  704. else
  705. goto <bb 28>; [INV]
  706. <bb 25> :
  707. __asm__ __volatile__(" mov %0, %1
  708. msr basepri, %0
  709. isb
  710. dsb
  711. " : "=r" ulNewBASEPRI_76 : "i" 16 : "memory");
  712. <bb 26> :
  713. <bb 27> :
  714. goto <bb 27>; [INV]
  715. <bb 28> :
  716. _25 = pxBlock_42->xBlockSize;
  717. _26 = _25 - xWantedSize_41;
  718. pxNewBlockLink_64->xBlockSize = _26;
  719. pxBlock_42->xBlockSize = xWantedSize_41;
  720. prvInsertBlockIntoFreeList (pxNewBlockLink_64);
  721. <bb 29> :
  722. xFreeBytesRemaining.9_27 = xFreeBytesRemaining;
  723. _28 = pxBlock_42->xBlockSize;
  724. _29 = xFreeBytesRemaining.9_27 - _28;
  725. xFreeBytesRemaining = _29;
  726. xFreeBytesRemaining.10_30 = xFreeBytesRemaining;
  727. xMinimumEverFreeBytesRemaining.11_31 = xMinimumEverFreeBytesRemaining;
  728. if (xFreeBytesRemaining.10_30 < xMinimumEverFreeBytesRemaining.11_31)
  729. goto <bb 30>; [INV]
  730. else
  731. goto <bb 31>; [INV]
  732. <bb 30> :
  733. xFreeBytesRemaining.12_32 = xFreeBytesRemaining;
  734. xMinimumEverFreeBytesRemaining = xFreeBytesRemaining.12_32;
  735. <bb 31> :
  736. _33 = pxBlock_42->xBlockSize;
  737. xBlockAllocatedBit.13_34 = xBlockAllocatedBit;
  738. _35 = _33 | xBlockAllocatedBit.13_34;
  739. pxBlock_42->xBlockSize = _35;
  740. pxBlock_42->pxNextFreeBlock = 0B;
  741. xNumberOfSuccessfulAllocations.14_36 = xNumberOfSuccessfulAllocations;
  742. _37 = xNumberOfSuccessfulAllocations.14_36 + 1;
  743. xNumberOfSuccessfulAllocations = _37;
  744. <bb 32> :
  745. # pvReturn_44 = PHI <pvReturn_49(4), pvReturn_49(17), pvReturn_49(16), pvReturn_49(22), pvReturn_62(31)>
  746. xTaskResumeAll ();
  747. pvReturn.15_38 = (unsigned int) pvReturn_44;
  748. _39 = pvReturn.15_38 & 7;
  749. if (_39 != 0)
  750. goto <bb 33>; [INV]
  751. else
  752. goto <bb 36>; [INV]
  753. <bb 33> :
  754. __asm__ __volatile__(" mov %0, %1
  755. msr basepri, %0
  756. isb
  757. dsb
  758. " : "=r" ulNewBASEPRI_77 : "i" 16 : "memory");
  759. <bb 34> :
  760. <bb 35> :
  761. goto <bb 35>; [INV]
  762. <bb 36> :
  763. _74 = pvReturn_44;
  764. <bb 37> :
  765. <L43>:
  766. return _74;
  767. }