heap_4.c.076i.inline 26 KB

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