heap_4.c.071i.devirt 26 KB

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