heap_4.c.068i.whole-program 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919
  1. Marking local functions: prvInsertBlockIntoFreeList prvHeapInit
  2. Marking externally visible functions: vPortGetHeapStats vPortInitialiseBlocks xPortGetMinimumEverFreeHeapSize xPortGetFreeHeapSize vPortFree pvPortMalloc
  3. Marking externally visible variables:
  4. Clearing variable flags:
  5. Reclaiming functions:
  6. Reclaiming variables:
  7. Clearing address taken flags:
  8. Symbol table:
  9. vPortExitCritical/24 (vPortExitCritical) @06a51e00
  10. Type: function
  11. Visibility: external public
  12. References:
  13. Referring:
  14. Availability: not_available
  15. Function flags: optimize_size
  16. Called by: vPortGetHeapStats/20 (168730858 (estimated locally),1.00 per call)
  17. Calls:
  18. vPortEnterCritical/23 (vPortEnterCritical) @06a51c40
  19. Type: function
  20. Visibility: external public
  21. References:
  22. Referring:
  23. Availability: not_available
  24. Function flags: optimize_size
  25. Called by: vPortGetHeapStats/20 (168730858 (estimated locally),1.00 per call)
  26. Calls:
  27. xTaskResumeAll/22 (xTaskResumeAll) @06a512a0
  28. Type: function
  29. Visibility: external public
  30. References:
  31. Referring:
  32. Availability: not_available
  33. Function flags: optimize_size
  34. Called by: vPortGetHeapStats/20 (168730858 (estimated locally),1.00 per call) vPortFree/14 (18715 (estimated locally),0.06 per call) pvPortMalloc/13 (214748 (estimated locally),0.93 per call)
  35. Calls:
  36. vTaskSuspendAll/21 (vTaskSuspendAll) @06a510e0
  37. Type: function
  38. Visibility: external public
  39. References:
  40. Referring:
  41. Availability: not_available
  42. Function flags: optimize_size
  43. Called by: vPortGetHeapStats/20 (168730857 (estimated locally),1.00 per call) vPortFree/14 (18715 (estimated locally),0.06 per call) pvPortMalloc/13 (231566 (estimated locally),1.00 per call)
  44. Calls:
  45. vPortGetHeapStats/20 (vPortGetHeapStats) @06aa50e0
  46. Type: function definition analyzed
  47. Visibility: externally_visible public
  48. References: xStart/6 (read)pxEnd/7 (read)xFreeBytesRemaining/8 (read)xNumberOfSuccessfulAllocations/10 (read)xNumberOfSuccessfulFrees/11 (read)xMinimumEverFreeBytesRemaining/9 (read)
  49. Referring:
  50. Availability: available
  51. Function flags: count:168730857 (estimated locally) body optimize_size
  52. Called by:
  53. Calls: vPortExitCritical/24 (168730858 (estimated locally),1.00 per call) vPortEnterCritical/23 (168730858 (estimated locally),1.00 per call) xTaskResumeAll/22 (168730858 (estimated locally),1.00 per call) vTaskSuspendAll/21 (168730857 (estimated locally),1.00 per call)
  54. prvInsertBlockIntoFreeList/19 (prvInsertBlockIntoFreeList) @06aa5d20
  55. Type: function definition analyzed
  56. Visibility: prevailing_def_ironly
  57. References: xStart/6 (addr)pxEnd/7 (read)
  58. Referring:
  59. Availability: local
  60. Function flags: count:118111600 (estimated locally) body local optimize_size
  61. Called by: vPortFree/14 (18715 (estimated locally),0.06 per call) pvPortMalloc/13 (8283 (estimated locally),0.04 per call)
  62. Calls:
  63. prvHeapInit/18 (prvHeapInit) @06aa5a80
  64. Type: function definition analyzed
  65. Visibility: prevailing_def_ironly
  66. References: ucHeap/4 (addr)xStart/6 (write)xStart/6 (write)pxEnd/7 (write)xMinimumEverFreeBytesRemaining/9 (write)xFreeBytesRemaining/8 (write)xBlockAllocatedBit/12 (write)
  67. Referring:
  68. Availability: local
  69. Function flags: count:1073741824 (estimated locally) body local optimize_size
  70. Called by: pvPortMalloc/13 (40362 (estimated locally),0.17 per call)
  71. Calls:
  72. vPortInitialiseBlocks/17 (vPortInitialiseBlocks) @06aa57e0
  73. Type: function definition analyzed
  74. Visibility: externally_visible public
  75. References:
  76. Referring:
  77. Availability: available
  78. Function flags: count:1073741824 (estimated locally) body optimize_size
  79. Called by:
  80. Calls:
  81. xPortGetMinimumEverFreeHeapSize/16 (xPortGetMinimumEverFreeHeapSize) @06aa5540
  82. Type: function definition analyzed
  83. Visibility: externally_visible public
  84. References: xMinimumEverFreeBytesRemaining/9 (read)
  85. Referring:
  86. Availability: available
  87. Function flags: count:1073741824 (estimated locally) body optimize_size
  88. Called by:
  89. Calls:
  90. xPortGetFreeHeapSize/15 (xPortGetFreeHeapSize) @06aa52a0
  91. Type: function definition analyzed
  92. Visibility: externally_visible public
  93. References: xFreeBytesRemaining/8 (read)
  94. Referring:
  95. Availability: available
  96. Function flags: count:1073741824 (estimated locally) body optimize_size
  97. Called by:
  98. Calls:
  99. vPortFree/14 (vPortFree) @06aa5000
  100. Type: function definition analyzed
  101. Visibility: externally_visible public
  102. References: xBlockAllocatedBit/12 (read)xFreeBytesRemaining/8 (read)xFreeBytesRemaining/8 (write)xNumberOfSuccessfulFrees/11 (read)xNumberOfSuccessfulFrees/11 (write)
  103. Referring:
  104. Availability: available
  105. Function flags: count:306783 (estimated locally) body optimize_size
  106. Called by:
  107. Calls: xTaskResumeAll/22 (18715 (estimated locally),0.06 per call) prvInsertBlockIntoFreeList/19 (18715 (estimated locally),0.06 per call) vTaskSuspendAll/21 (18715 (estimated locally),0.06 per call)
  108. pvPortMalloc/13 (pvPortMalloc) @06a9dee0
  109. Type: function definition analyzed
  110. Visibility: externally_visible public
  111. References: pxEnd/7 (read)xBlockAllocatedBit/12 (read)xFreeBytesRemaining/8 (read)xStart/6 (read)xStart/6 (addr)pxEnd/7 (read)xFreeBytesRemaining/8 (read)xFreeBytesRemaining/8 (write)xMinimumEverFreeBytesRemaining/9 (read)xMinimumEverFreeBytesRemaining/9 (write)xBlockAllocatedBit/12 (read)xNumberOfSuccessfulAllocations/10 (read)xNumberOfSuccessfulAllocations/10 (write)
  112. Referring:
  113. Availability: available
  114. Function flags: count:231566 (estimated locally) body optimize_size
  115. Called by:
  116. Calls: xTaskResumeAll/22 (214748 (estimated locally),0.93 per call) prvInsertBlockIntoFreeList/19 (8283 (estimated locally),0.04 per call) prvHeapInit/18 (40362 (estimated locally),0.17 per call) vTaskSuspendAll/21 (231566 (estimated locally),1.00 per call)
  117. xBlockAllocatedBit/12 (xBlockAllocatedBit) @06a9a678
  118. Type: variable definition analyzed
  119. Visibility: prevailing_def_ironly
  120. References:
  121. Referring: pvPortMalloc/13 (read)pvPortMalloc/13 (read)prvHeapInit/18 (write)vPortFree/14 (read)
  122. Availability: available
  123. Varpool flags: initialized
  124. xNumberOfSuccessfulFrees/11 (xNumberOfSuccessfulFrees) @06a9a5e8
  125. Type: variable definition analyzed
  126. Visibility: prevailing_def_ironly
  127. References:
  128. Referring: vPortFree/14 (write)vPortFree/14 (read)vPortGetHeapStats/20 (read)
  129. Availability: available
  130. Varpool flags: initialized
  131. xNumberOfSuccessfulAllocations/10 (xNumberOfSuccessfulAllocations) @06a9a5a0
  132. Type: variable definition analyzed
  133. Visibility: prevailing_def_ironly
  134. References:
  135. Referring: pvPortMalloc/13 (write)pvPortMalloc/13 (read)vPortGetHeapStats/20 (read)
  136. Availability: available
  137. Varpool flags: initialized
  138. xMinimumEverFreeBytesRemaining/9 (xMinimumEverFreeBytesRemaining) @06a9a558
  139. Type: variable definition analyzed
  140. Visibility: prevailing_def_ironly
  141. References:
  142. Referring: prvHeapInit/18 (write)xPortGetMinimumEverFreeHeapSize/16 (read)pvPortMalloc/13 (write)pvPortMalloc/13 (read)vPortGetHeapStats/20 (read)
  143. Availability: available
  144. Varpool flags: initialized
  145. xFreeBytesRemaining/8 (xFreeBytesRemaining) @06a9a510
  146. Type: variable definition analyzed
  147. Visibility: prevailing_def_ironly
  148. References:
  149. Referring: vPortFree/14 (write)pvPortMalloc/13 (read)prvHeapInit/18 (write)pvPortMalloc/13 (write)xPortGetFreeHeapSize/15 (read)pvPortMalloc/13 (read)vPortFree/14 (read)vPortGetHeapStats/20 (read)
  150. Availability: available
  151. Varpool flags: initialized
  152. pxEnd/7 (pxEnd) @06a9a480
  153. Type: variable definition analyzed
  154. Visibility: prevailing_def_ironly
  155. References:
  156. Referring: pvPortMalloc/13 (read)prvHeapInit/18 (write)prvInsertBlockIntoFreeList/19 (read)pvPortMalloc/13 (read)vPortGetHeapStats/20 (read)
  157. Availability: available
  158. Varpool flags: initialized
  159. xStart/6 (xStart) @06a9a3f0
  160. Type: variable definition analyzed
  161. Visibility: prevailing_def_ironly
  162. References:
  163. Referring: prvHeapInit/18 (write)prvHeapInit/18 (write)pvPortMalloc/13 (addr)prvInsertBlockIntoFreeList/19 (addr)pvPortMalloc/13 (read)vPortGetHeapStats/20 (read)
  164. Availability: available
  165. Varpool flags:
  166. ucHeap/4 (ucHeap) @06a9a120
  167. Type: variable definition analyzed
  168. Visibility: prevailing_def_ironly
  169. References:
  170. Referring: 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. struct BlockLink_t * pxEnd.26_3;
  181. unsigned int xFreeBytesRemaining.27_4;
  182. unsigned int xNumberOfSuccessfulAllocations.28_5;
  183. unsigned int xNumberOfSuccessfulFrees.29_6;
  184. unsigned int xMinimumEverFreeBytesRemaining.30_7;
  185. <bb 2> [local count: 168730857]:
  186. # DEBUG BEGIN_STMT
  187. # DEBUG BEGIN_STMT
  188. # DEBUG xBlocks => 0
  189. # DEBUG xMaxSize => 0
  190. # DEBUG xMinSize => 4294967295
  191. # DEBUG BEGIN_STMT
  192. vTaskSuspendAll ();
  193. # DEBUG BEGIN_STMT
  194. pxBlock_17 = xStart.pxNextFreeBlock;
  195. # DEBUG pxBlock => pxBlock_17
  196. # DEBUG BEGIN_STMT
  197. if (pxBlock_17 != 0B)
  198. goto <bb 5>; [70.00%]
  199. else
  200. goto <bb 4>; [30.00%]
  201. <bb 5> [local count: 118111600]:
  202. <bb 3> [local count: 1073741824]:
  203. # pxBlock_8 = PHI <pxBlock_17(5), pxBlock_20(6)>
  204. # xBlocks_9 = PHI <0(5), xBlocks_18(6)>
  205. # xMaxSize_11 = PHI <0(5), xMaxSize_2(6)>
  206. # xMinSize_13 = PHI <4294967295(5), xMinSize_19(6)>
  207. # DEBUG xMinSize => xMinSize_13
  208. # DEBUG xMaxSize => xMaxSize_11
  209. # DEBUG xBlocks => xBlocks_9
  210. # DEBUG pxBlock => pxBlock_8
  211. # DEBUG BEGIN_STMT
  212. # DEBUG BEGIN_STMT
  213. xBlocks_18 = xBlocks_9 + 1;
  214. # DEBUG xBlocks => xBlocks_18
  215. # DEBUG BEGIN_STMT
  216. _1 = pxBlock_8->xBlockSize;
  217. xMaxSize_2 = MAX_EXPR <_1, xMaxSize_11>;
  218. # DEBUG xMaxSize => xMaxSize_2
  219. # DEBUG BEGIN_STMT
  220. xMinSize_19 = MIN_EXPR <_1, xMinSize_13>;
  221. # DEBUG xMinSize => xMinSize_19
  222. # DEBUG BEGIN_STMT
  223. pxBlock_20 = pxBlock_8->pxNextFreeBlock;
  224. # DEBUG pxBlock => pxBlock_20
  225. # DEBUG BEGIN_STMT
  226. pxEnd.26_3 = pxEnd;
  227. if (pxEnd.26_3 != pxBlock_20)
  228. goto <bb 6>; [89.00%]
  229. else
  230. goto <bb 4>; [11.00%]
  231. <bb 6> [local count: 955630225]:
  232. goto <bb 3>; [100.00%]
  233. <bb 4> [local count: 168730858]:
  234. # xBlocks_10 = PHI <0(2), xBlocks_18(3)>
  235. # xMaxSize_12 = PHI <0(2), xMaxSize_2(3)>
  236. # xMinSize_14 = PHI <4294967295(2), xMinSize_19(3)>
  237. # DEBUG xMinSize => xMinSize_14
  238. # DEBUG xMaxSize => xMaxSize_12
  239. # DEBUG xBlocks => xBlocks_10
  240. # DEBUG BEGIN_STMT
  241. xTaskResumeAll ();
  242. # DEBUG BEGIN_STMT
  243. pxHeapStats_22(D)->xSizeOfLargestFreeBlockInBytes = xMaxSize_12;
  244. # DEBUG BEGIN_STMT
  245. pxHeapStats_22(D)->xSizeOfSmallestFreeBlockInBytes = xMinSize_14;
  246. # DEBUG BEGIN_STMT
  247. pxHeapStats_22(D)->xNumberOfFreeBlocks = xBlocks_10;
  248. # DEBUG BEGIN_STMT
  249. vPortEnterCritical ();
  250. # DEBUG BEGIN_STMT
  251. xFreeBytesRemaining.27_4 = xFreeBytesRemaining;
  252. pxHeapStats_22(D)->xAvailableHeapSpaceInBytes = xFreeBytesRemaining.27_4;
  253. # DEBUG BEGIN_STMT
  254. xNumberOfSuccessfulAllocations.28_5 = xNumberOfSuccessfulAllocations;
  255. pxHeapStats_22(D)->xNumberOfSuccessfulAllocations = xNumberOfSuccessfulAllocations.28_5;
  256. # DEBUG BEGIN_STMT
  257. xNumberOfSuccessfulFrees.29_6 = xNumberOfSuccessfulFrees;
  258. pxHeapStats_22(D)->xNumberOfSuccessfulFrees = xNumberOfSuccessfulFrees.29_6;
  259. # DEBUG BEGIN_STMT
  260. xMinimumEverFreeBytesRemaining.30_7 = xMinimumEverFreeBytesRemaining;
  261. pxHeapStats_22(D)->xMinimumEverFreeBytesRemaining = xMinimumEverFreeBytesRemaining.30_7;
  262. # DEBUG BEGIN_STMT
  263. vPortExitCritical ();
  264. return;
  265. }
  266. prvInsertBlockIntoFreeList (struct BlockLink_t * pxBlockToInsert)
  267. {
  268. struct BlockLink_t * pxIterator;
  269. struct A_BLOCK_LINK * _1;
  270. unsigned int _2;
  271. uint8_t * _3;
  272. unsigned int _5;
  273. unsigned int _6;
  274. unsigned int _7;
  275. uint8_t * _8;
  276. struct BlockLink_t * pxEnd.19_9;
  277. unsigned int _10;
  278. unsigned int _11;
  279. struct A_BLOCK_LINK * _12;
  280. struct A_BLOCK_LINK * _20;
  281. <bb 2> [local count: 118111600]:
  282. # DEBUG BEGIN_STMT
  283. # DEBUG BEGIN_STMT
  284. # DEBUG BEGIN_STMT
  285. # DEBUG pxIterator => &xStart
  286. <bb 3> [local count: 1073741824]:
  287. # pxIterator_14 = PHI <&xStart(2), _1(14)>
  288. # DEBUG pxIterator => pxIterator_14
  289. # DEBUG BEGIN_STMT
  290. _1 = pxIterator_14->pxNextFreeBlock;
  291. if (_1 < pxBlockToInsert_19(D))
  292. goto <bb 14>; [89.00%]
  293. else
  294. goto <bb 4>; [11.00%]
  295. <bb 14> [local count: 955630223]:
  296. goto <bb 3>; [100.00%]
  297. <bb 4> [local count: 118111601]:
  298. # _20 = PHI <_1(3)>
  299. # pxIterator_4 = PHI <pxIterator_14(3)>
  300. # DEBUG BEGIN_STMT
  301. # DEBUG puc => pxIterator_4
  302. # DEBUG BEGIN_STMT
  303. _2 = pxIterator_4->xBlockSize;
  304. _3 = pxIterator_4 + _2;
  305. if (_3 == pxBlockToInsert_19(D))
  306. goto <bb 5>; [30.00%]
  307. else
  308. goto <bb 6>; [70.00%]
  309. <bb 5> [local count: 35433480]:
  310. # DEBUG BEGIN_STMT
  311. _5 = pxBlockToInsert_19(D)->xBlockSize;
  312. _6 = _2 + _5;
  313. pxIterator_4->xBlockSize = _6;
  314. # DEBUG BEGIN_STMT
  315. # DEBUG pxBlockToInsert => pxIterator_4
  316. <bb 6> [local count: 118111601]:
  317. # pxBlockToInsert_13 = PHI <pxBlockToInsert_19(D)(4), pxIterator_4(5)>
  318. # DEBUG pxBlockToInsert => pxBlockToInsert_13
  319. # DEBUG BEGIN_STMT
  320. # DEBUG BEGIN_STMT
  321. # DEBUG puc => pxBlockToInsert_13
  322. # DEBUG BEGIN_STMT
  323. _7 = pxBlockToInsert_13->xBlockSize;
  324. _8 = pxBlockToInsert_13 + _7;
  325. if (_8 == _20)
  326. goto <bb 7>; [30.00%]
  327. else
  328. goto <bb 10>; [70.00%]
  329. <bb 7> [local count: 35433480]:
  330. # DEBUG BEGIN_STMT
  331. pxEnd.19_9 = pxEnd;
  332. if (pxEnd.19_9 != _20)
  333. goto <bb 8>; [70.00%]
  334. else
  335. goto <bb 9>; [30.00%]
  336. <bb 8> [local count: 24803436]:
  337. # DEBUG BEGIN_STMT
  338. _10 = _20->xBlockSize;
  339. _11 = _7 + _10;
  340. pxBlockToInsert_13->xBlockSize = _11;
  341. # DEBUG BEGIN_STMT
  342. _12 = _20->pxNextFreeBlock;
  343. pxBlockToInsert_13->pxNextFreeBlock = _12;
  344. goto <bb 11>; [100.00%]
  345. <bb 9> [local count: 10630044]:
  346. # DEBUG BEGIN_STMT
  347. pxBlockToInsert_13->pxNextFreeBlock = pxEnd.19_9;
  348. goto <bb 11>; [100.00%]
  349. <bb 10> [local count: 82678120]:
  350. # DEBUG BEGIN_STMT
  351. pxBlockToInsert_13->pxNextFreeBlock = _20;
  352. <bb 11> [local count: 118111601]:
  353. # DEBUG BEGIN_STMT
  354. if (pxIterator_4 != pxBlockToInsert_13)
  355. goto <bb 12>; [70.00%]
  356. else
  357. goto <bb 13>; [30.00%]
  358. <bb 12> [local count: 82678120]:
  359. # DEBUG BEGIN_STMT
  360. pxIterator_4->pxNextFreeBlock = pxBlockToInsert_13;
  361. <bb 13> [local count: 118111601]:
  362. # DEBUG BEGIN_STMT
  363. return;
  364. }
  365. prvHeapInit ()
  366. {
  367. size_t xTotalHeapSize;
  368. size_t uxAddress;
  369. uint8_t * pucAlignedHeap;
  370. unsigned int _1;
  371. unsigned int _2;
  372. struct BlockLink_t * uxAddress.14_3;
  373. unsigned int _4;
  374. <bb 2> [local count: 1073741824]:
  375. # DEBUG BEGIN_STMT
  376. # DEBUG BEGIN_STMT
  377. # DEBUG BEGIN_STMT
  378. # DEBUG BEGIN_STMT
  379. # DEBUG xTotalHeapSize => 8192
  380. # DEBUG BEGIN_STMT
  381. uxAddress_7 = (size_t) &ucHeap;
  382. # DEBUG uxAddress => uxAddress_7
  383. # DEBUG BEGIN_STMT
  384. _1 = uxAddress_7 & 7;
  385. if (_1 != 0)
  386. goto <bb 3>; [50.00%]
  387. else
  388. goto <bb 4>; [50.00%]
  389. <bb 3> [local count: 536870913]:
  390. # DEBUG BEGIN_STMT
  391. uxAddress_8 = uxAddress_7 + 7;
  392. # DEBUG uxAddress => uxAddress_8
  393. # DEBUG BEGIN_STMT
  394. uxAddress_9 = uxAddress_8 & 4294967288;
  395. # DEBUG uxAddress => uxAddress_9
  396. # DEBUG BEGIN_STMT
  397. _2 = 8192 - uxAddress_9;
  398. xTotalHeapSize_10 = _2 + uxAddress_7;
  399. # DEBUG xTotalHeapSize => xTotalHeapSize_10
  400. <bb 4> [local count: 1073741824]:
  401. # uxAddress_5 = PHI <uxAddress_7(2), uxAddress_9(3)>
  402. # xTotalHeapSize_6 = PHI <8192(2), xTotalHeapSize_10(3)>
  403. # DEBUG xTotalHeapSize => xTotalHeapSize_6
  404. # DEBUG uxAddress => uxAddress_5
  405. # DEBUG BEGIN_STMT
  406. pucAlignedHeap_11 = (uint8_t *) uxAddress_5;
  407. # DEBUG pucAlignedHeap => pucAlignedHeap_11
  408. # DEBUG BEGIN_STMT
  409. xStart.pxNextFreeBlock = pucAlignedHeap_11;
  410. # DEBUG BEGIN_STMT
  411. xStart.xBlockSize = 0;
  412. # DEBUG BEGIN_STMT
  413. uxAddress_15 = uxAddress_5 + xTotalHeapSize_6;
  414. # DEBUG uxAddress => uxAddress_15
  415. # DEBUG BEGIN_STMT
  416. uxAddress_16 = uxAddress_15 + 4294967288;
  417. # DEBUG uxAddress => uxAddress_16
  418. # DEBUG BEGIN_STMT
  419. uxAddress_17 = uxAddress_16 & 4294967288;
  420. # DEBUG uxAddress => uxAddress_17
  421. # DEBUG BEGIN_STMT
  422. uxAddress.14_3 = (struct BlockLink_t *) uxAddress_17;
  423. pxEnd = uxAddress.14_3;
  424. # DEBUG BEGIN_STMT
  425. uxAddress.14_3->xBlockSize = 0;
  426. # DEBUG BEGIN_STMT
  427. uxAddress.14_3->pxNextFreeBlock = 0B;
  428. # DEBUG BEGIN_STMT
  429. # DEBUG pxFirstFreeBlock => pucAlignedHeap_11
  430. # DEBUG BEGIN_STMT
  431. _4 = uxAddress_17 - uxAddress_5;
  432. MEM[(struct BlockLink_t *)pucAlignedHeap_11].xBlockSize = _4;
  433. # DEBUG BEGIN_STMT
  434. MEM[(struct BlockLink_t *)pucAlignedHeap_11].pxNextFreeBlock = uxAddress.14_3;
  435. # DEBUG BEGIN_STMT
  436. xMinimumEverFreeBytesRemaining = _4;
  437. # DEBUG BEGIN_STMT
  438. xFreeBytesRemaining = _4;
  439. # DEBUG BEGIN_STMT
  440. xBlockAllocatedBit = 2147483648;
  441. return;
  442. }
  443. vPortInitialiseBlocks ()
  444. {
  445. <bb 2> [local count: 1073741824]:
  446. # DEBUG BEGIN_STMT
  447. return;
  448. }
  449. xPortGetMinimumEverFreeHeapSize ()
  450. {
  451. size_t _2;
  452. <bb 2> [local count: 1073741824]:
  453. # DEBUG BEGIN_STMT
  454. _2 = xMinimumEverFreeBytesRemaining;
  455. return _2;
  456. }
  457. xPortGetFreeHeapSize ()
  458. {
  459. size_t _2;
  460. <bb 2> [local count: 1073741824]:
  461. # DEBUG BEGIN_STMT
  462. _2 = xFreeBytesRemaining;
  463. return _2;
  464. }
  465. vPortFree (void * pv)
  466. {
  467. uint32_t ulNewBASEPRI;
  468. uint32_t ulNewBASEPRI;
  469. uint8_t * puc;
  470. unsigned int _1;
  471. unsigned int xBlockAllocatedBit.21_2;
  472. unsigned int _3;
  473. struct A_BLOCK_LINK * _4;
  474. unsigned int _5;
  475. unsigned int _6;
  476. unsigned int _7;
  477. unsigned int xFreeBytesRemaining.24_8;
  478. unsigned int _9;
  479. unsigned int xNumberOfSuccessfulFrees.25_10;
  480. unsigned int _11;
  481. <bb 2> [local count: 306783]:
  482. # DEBUG BEGIN_STMT
  483. # DEBUG puc => pv_13(D)
  484. # DEBUG BEGIN_STMT
  485. # DEBUG BEGIN_STMT
  486. if (pv_13(D) != 0B)
  487. goto <bb 3>; [70.00%]
  488. else
  489. goto <bb 10>; [30.00%]
  490. <bb 3> [local count: 214748]:
  491. # DEBUG BEGIN_STMT
  492. puc_15 = pv_13(D) + 4294967288;
  493. # DEBUG puc => puc_15
  494. # DEBUG BEGIN_STMT
  495. # DEBUG pxLink => puc_15
  496. # DEBUG BEGIN_STMT
  497. _1 = MEM[(struct BlockLink_t *)pv_13(D) + 4294967288B].xBlockSize;
  498. xBlockAllocatedBit.21_2 = xBlockAllocatedBit;
  499. _3 = _1 & xBlockAllocatedBit.21_2;
  500. if (_3 == 0)
  501. goto <bb 4>; [50.00%]
  502. else
  503. goto <bb 6>; [50.00%]
  504. <bb 4> [local count: 107374]:
  505. # DEBUG BEGIN_STMT
  506. # DEBUG INLINE_ENTRY vPortRaiseBASEPRI
  507. # DEBUG BEGIN_STMT
  508. # DEBUG BEGIN_STMT
  509. __asm__ __volatile__(" mov %0, %1
  510. msr basepri, %0
  511. isb
  512. dsb
  513. " : "=r" ulNewBASEPRI_22 : "i" 16 : "memory");
  514. # DEBUG ulNewBASEPRI => ulNewBASEPRI_22
  515. <bb 5> [local count: 1073741823]:
  516. # DEBUG ulNewBASEPRI => NULL
  517. # DEBUG BEGIN_STMT
  518. # DEBUG BEGIN_STMT
  519. # DEBUG BEGIN_STMT
  520. <bb 11> [local count: 1073741824]:
  521. goto <bb 5>; [100.00%]
  522. <bb 6> [local count: 107374]:
  523. # DEBUG BEGIN_STMT
  524. # DEBUG BEGIN_STMT
  525. _4 = MEM[(struct BlockLink_t *)pv_13(D) + 4294967288B].pxNextFreeBlock;
  526. if (_4 != 0B)
  527. goto <bb 7>; [82.57%]
  528. else
  529. goto <bb 9>; [17.43%]
  530. <bb 7> [local count: 88659]:
  531. # DEBUG BEGIN_STMT
  532. # DEBUG INLINE_ENTRY vPortRaiseBASEPRI
  533. # DEBUG BEGIN_STMT
  534. # DEBUG BEGIN_STMT
  535. __asm__ __volatile__(" mov %0, %1
  536. msr basepri, %0
  537. isb
  538. dsb
  539. " : "=r" ulNewBASEPRI_23 : "i" 16 : "memory");
  540. # DEBUG ulNewBASEPRI => ulNewBASEPRI_23
  541. <bb 8> [local count: 886588623]:
  542. # DEBUG ulNewBASEPRI => NULL
  543. # DEBUG BEGIN_STMT
  544. # DEBUG BEGIN_STMT
  545. # DEBUG BEGIN_STMT
  546. <bb 12> [local count: 886588623]:
  547. goto <bb 8>; [100.00%]
  548. <bb 9> [local count: 18715]:
  549. # DEBUG BEGIN_STMT
  550. # DEBUG BEGIN_STMT
  551. # DEBUG BEGIN_STMT
  552. # DEBUG BEGIN_STMT
  553. _5 = ~xBlockAllocatedBit.21_2;
  554. _6 = _1 & _5;
  555. MEM[(struct BlockLink_t *)pv_13(D) + 4294967288B].xBlockSize = _6;
  556. # DEBUG BEGIN_STMT
  557. vTaskSuspendAll ();
  558. # DEBUG BEGIN_STMT
  559. _7 = MEM[(struct BlockLink_t *)pv_13(D) + 4294967288B].xBlockSize;
  560. xFreeBytesRemaining.24_8 = xFreeBytesRemaining;
  561. _9 = _7 + xFreeBytesRemaining.24_8;
  562. xFreeBytesRemaining = _9;
  563. # DEBUG BEGIN_STMT
  564. # DEBUG BEGIN_STMT
  565. prvInsertBlockIntoFreeList (puc_15);
  566. # DEBUG BEGIN_STMT
  567. xNumberOfSuccessfulFrees.25_10 = xNumberOfSuccessfulFrees;
  568. _11 = xNumberOfSuccessfulFrees.25_10 + 1;
  569. xNumberOfSuccessfulFrees = _11;
  570. # DEBUG BEGIN_STMT
  571. xTaskResumeAll ();
  572. <bb 10> [local count: 110750]:
  573. # DEBUG BEGIN_STMT
  574. return;
  575. }
  576. pvPortMalloc (size_t xWantedSize)
  577. {
  578. uint32_t ulNewBASEPRI;
  579. uint32_t ulNewBASEPRI;
  580. void * pvReturn;
  581. struct BlockLink_t * pxNewBlockLink;
  582. struct BlockLink_t * pxPreviousBlock;
  583. struct BlockLink_t * pxBlock;
  584. struct BlockLink_t * pxEnd.0_1;
  585. unsigned int xBlockAllocatedBit.1_2;
  586. unsigned int _3;
  587. unsigned int _4;
  588. unsigned int _5;
  589. unsigned int _6;
  590. unsigned int _7;
  591. unsigned int xFreeBytesRemaining.2_9;
  592. unsigned int _10;
  593. struct A_BLOCK_LINK * _11;
  594. struct BlockLink_t * pxEnd.3_12;
  595. struct A_BLOCK_LINK * _13;
  596. struct A_BLOCK_LINK * _14;
  597. unsigned int _15;
  598. unsigned int pxNewBlockLink.4_16;
  599. unsigned int _17;
  600. unsigned int xFreeBytesRemaining.5_18;
  601. unsigned int _19;
  602. unsigned int _20;
  603. unsigned int xMinimumEverFreeBytesRemaining.7_21;
  604. unsigned int xBlockAllocatedBit.9_22;
  605. unsigned int _23;
  606. unsigned int xNumberOfSuccessfulAllocations.10_24;
  607. unsigned int _25;
  608. unsigned int pvReturn.11_26;
  609. unsigned int _27;
  610. unsigned int _57;
  611. <bb 2> [local count: 231566]:
  612. # DEBUG BEGIN_STMT
  613. # DEBUG BEGIN_STMT
  614. # DEBUG pvReturn => 0B
  615. # DEBUG BEGIN_STMT
  616. vTaskSuspendAll ();
  617. # DEBUG BEGIN_STMT
  618. pxEnd.0_1 = pxEnd;
  619. if (pxEnd.0_1 == 0B)
  620. goto <bb 3>; [17.43%]
  621. else
  622. goto <bb 4>; [82.57%]
  623. <bb 3> [local count: 40362]:
  624. # DEBUG BEGIN_STMT
  625. prvHeapInit ();
  626. <bb 4> [local count: 231566]:
  627. # DEBUG BEGIN_STMT
  628. # DEBUG BEGIN_STMT
  629. xBlockAllocatedBit.1_2 = xBlockAllocatedBit;
  630. _3 = xBlockAllocatedBit.1_2 & xWantedSize_39(D);
  631. if (_3 == 0)
  632. goto <bb 5>; [83.25%]
  633. else
  634. goto <bb 22>; [16.75%]
  635. <bb 5> [local count: 192779]:
  636. # DEBUG BEGIN_STMT
  637. _4 = xWantedSize_39(D) + 4294967295;
  638. if (_4 <= 4294967286)
  639. goto <bb 6>; [71.00%]
  640. else
  641. goto <bb 22>; [29.00%]
  642. <bb 6> [local count: 136873]:
  643. # DEBUG BEGIN_STMT
  644. xWantedSize_40 = xWantedSize_39(D) + 8;
  645. # DEBUG xWantedSize => xWantedSize_40
  646. # DEBUG BEGIN_STMT
  647. _5 = xWantedSize_40 & 7;
  648. if (_5 != 0)
  649. goto <bb 7>; [50.00%]
  650. else
  651. goto <bb 8>; [50.00%]
  652. <bb 7> [local count: 68436]:
  653. # DEBUG BEGIN_STMT
  654. _6 = xWantedSize_40 & 4294967288;
  655. _7 = _6 + 8;
  656. if (_7 > xWantedSize_40)
  657. goto <bb 8>; [71.00%]
  658. else
  659. goto <bb 22>; [29.00%]
  660. <bb 8> [local count: 117026]:
  661. # xWantedSize_28 = PHI <_7(7), xWantedSize_40(6)>
  662. # DEBUG xWantedSize => xWantedSize_28
  663. # DEBUG BEGIN_STMT
  664. if (xWantedSize_28 != 0)
  665. goto <bb 9>; [71.00%]
  666. else
  667. goto <bb 22>; [29.00%]
  668. <bb 9> [local count: 83089]:
  669. xFreeBytesRemaining.2_9 = xFreeBytesRemaining;
  670. if (xFreeBytesRemaining.2_9 >= xWantedSize_28)
  671. goto <bb 10>; [71.00%]
  672. else
  673. goto <bb 22>; [29.00%]
  674. <bb 10> [local count: 58993]:
  675. # DEBUG BEGIN_STMT
  676. # DEBUG pxPreviousBlock => &xStart
  677. # DEBUG BEGIN_STMT
  678. pxBlock_41 = xStart.pxNextFreeBlock;
  679. # DEBUG pxBlock => pxBlock_41
  680. # DEBUG BEGIN_STMT
  681. <bb 11> [local count: 551465]:
  682. # pxBlock_29 = PHI <pxBlock_41(10), _11(28)>
  683. # pxPreviousBlock_30 = PHI <&xStart(10), pxBlock_29(28)>
  684. # DEBUG pxPreviousBlock => pxPreviousBlock_30
  685. # DEBUG pxBlock => pxBlock_29
  686. # DEBUG BEGIN_STMT
  687. _10 = pxBlock_29->xBlockSize;
  688. if (_10 < xWantedSize_28)
  689. goto <bb 12>; [94.50%]
  690. else
  691. goto <bb 13>; [5.50%]
  692. <bb 12> [local count: 521134]:
  693. _11 = pxBlock_29->pxNextFreeBlock;
  694. if (_11 != 0B)
  695. goto <bb 28>; [94.50%]
  696. else
  697. goto <bb 13>; [5.50%]
  698. <bb 28> [local count: 492472]:
  699. goto <bb 11>; [100.00%]
  700. <bb 13> [local count: 58993]:
  701. # _57 = PHI <_10(11), _10(12)>
  702. # pxBlock_54 = PHI <pxBlock_29(11), pxBlock_29(12)>
  703. # pxPreviousBlock_8 = PHI <pxPreviousBlock_30(11), pxPreviousBlock_30(12)>
  704. # DEBUG BEGIN_STMT
  705. pxEnd.3_12 = pxEnd;
  706. if (pxEnd.3_12 != pxBlock_54)
  707. goto <bb 14>; [85.10%]
  708. else
  709. goto <bb 22>; [14.90%]
  710. <bb 14> [local count: 50203]:
  711. # DEBUG BEGIN_STMT
  712. _13 = pxPreviousBlock_8->pxNextFreeBlock;
  713. pvReturn_42 = _13 + 8;
  714. # DEBUG pvReturn => pvReturn_42
  715. # DEBUG BEGIN_STMT
  716. _14 = pxBlock_54->pxNextFreeBlock;
  717. pxPreviousBlock_8->pxNextFreeBlock = _14;
  718. # DEBUG BEGIN_STMT
  719. _15 = _57 - xWantedSize_28;
  720. if (_15 > 16)
  721. goto <bb 15>; [50.00%]
  722. else
  723. goto <bb 19>; [50.00%]
  724. <bb 15> [local count: 25102]:
  725. # DEBUG BEGIN_STMT
  726. pxNewBlockLink_44 = pxBlock_54 + xWantedSize_28;
  727. # DEBUG pxNewBlockLink => pxNewBlockLink_44
  728. # DEBUG BEGIN_STMT
  729. pxNewBlockLink.4_16 = (unsigned int) pxNewBlockLink_44;
  730. _17 = pxNewBlockLink.4_16 & 7;
  731. if (_17 != 0)
  732. goto <bb 16>; [67.00%]
  733. else
  734. goto <bb 18>; [33.00%]
  735. <bb 16> [local count: 16818]:
  736. # DEBUG BEGIN_STMT
  737. # DEBUG INLINE_ENTRY vPortRaiseBASEPRI
  738. # DEBUG BEGIN_STMT
  739. # DEBUG BEGIN_STMT
  740. __asm__ __volatile__(" mov %0, %1
  741. msr basepri, %0
  742. isb
  743. dsb
  744. " : "=r" ulNewBASEPRI_55 : "i" 16 : "memory");
  745. # DEBUG ulNewBASEPRI => ulNewBASEPRI_55
  746. <bb 17> [local count: 168180375]:
  747. # DEBUG ulNewBASEPRI => NULL
  748. # DEBUG BEGIN_STMT
  749. # DEBUG BEGIN_STMT
  750. # DEBUG BEGIN_STMT
  751. <bb 26> [local count: 168180375]:
  752. goto <bb 17>; [100.00%]
  753. <bb 18> [local count: 8283]:
  754. # DEBUG BEGIN_STMT
  755. # DEBUG BEGIN_STMT
  756. pxNewBlockLink_44->xBlockSize = _15;
  757. # DEBUG BEGIN_STMT
  758. pxBlock_54->xBlockSize = xWantedSize_28;
  759. # DEBUG BEGIN_STMT
  760. prvInsertBlockIntoFreeList (pxNewBlockLink_44);
  761. <bb 19> [local count: 33385]:
  762. # DEBUG BEGIN_STMT
  763. # DEBUG BEGIN_STMT
  764. xFreeBytesRemaining.5_18 = xFreeBytesRemaining;
  765. _19 = pxBlock_54->xBlockSize;
  766. _20 = xFreeBytesRemaining.5_18 - _19;
  767. xFreeBytesRemaining = _20;
  768. # DEBUG BEGIN_STMT
  769. xMinimumEverFreeBytesRemaining.7_21 = xMinimumEverFreeBytesRemaining;
  770. if (_20 < xMinimumEverFreeBytesRemaining.7_21)
  771. goto <bb 20>; [50.00%]
  772. else
  773. goto <bb 21>; [50.00%]
  774. <bb 20> [local count: 16693]:
  775. # DEBUG BEGIN_STMT
  776. xMinimumEverFreeBytesRemaining = _20;
  777. <bb 21> [local count: 33385]:
  778. # DEBUG BEGIN_STMT
  779. # DEBUG BEGIN_STMT
  780. xBlockAllocatedBit.9_22 = xBlockAllocatedBit;
  781. _23 = _19 | xBlockAllocatedBit.9_22;
  782. pxBlock_54->xBlockSize = _23;
  783. # DEBUG BEGIN_STMT
  784. pxBlock_54->pxNextFreeBlock = 0B;
  785. # DEBUG BEGIN_STMT
  786. xNumberOfSuccessfulAllocations.10_24 = xNumberOfSuccessfulAllocations;
  787. _25 = xNumberOfSuccessfulAllocations.10_24 + 1;
  788. xNumberOfSuccessfulAllocations = _25;
  789. <bb 22> [local count: 214748]:
  790. # pvReturn_31 = PHI <0B(4), 0B(9), 0B(8), 0B(13), pvReturn_42(21), 0B(7), 0B(5)>
  791. # DEBUG xWantedSize => NULL
  792. # DEBUG pvReturn => pvReturn_31
  793. # DEBUG BEGIN_STMT
  794. # DEBUG BEGIN_STMT
  795. # DEBUG BEGIN_STMT
  796. xTaskResumeAll ();
  797. # DEBUG BEGIN_STMT
  798. pvReturn.11_26 = (unsigned int) pvReturn_31;
  799. _27 = pvReturn.11_26 & 7;
  800. if (_27 != 0)
  801. goto <bb 23>; [50.00%]
  802. else
  803. goto <bb 25>; [50.00%]
  804. <bb 23> [local count: 107374]:
  805. # DEBUG BEGIN_STMT
  806. # DEBUG INLINE_ENTRY vPortRaiseBASEPRI
  807. # DEBUG BEGIN_STMT
  808. # DEBUG BEGIN_STMT
  809. __asm__ __volatile__(" mov %0, %1
  810. msr basepri, %0
  811. isb
  812. dsb
  813. " : "=r" ulNewBASEPRI_56 : "i" 16 : "memory");
  814. # DEBUG ulNewBASEPRI => ulNewBASEPRI_56
  815. <bb 24> [local count: 1073741824]:
  816. # DEBUG ulNewBASEPRI => NULL
  817. # DEBUG BEGIN_STMT
  818. # DEBUG BEGIN_STMT
  819. # DEBUG BEGIN_STMT
  820. <bb 27> [local count: 1073741824]:
  821. goto <bb 24>; [100.00%]
  822. <bb 25> [local count: 107374]:
  823. # DEBUG BEGIN_STMT
  824. # DEBUG BEGIN_STMT
  825. return pvReturn_31;
  826. }