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

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