heap_4.c.016i.visibility 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  1. Marking local functions: vPortRaiseBASEPRI
  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 vPortRaiseBASEPRI/1 vPortRaiseBASEPRI/1
  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: vPortRaiseBASEPRI/1 xTaskResumeAll/22 prvInsertBlockIntoFreeList/19 vPortRaiseBASEPRI/1 vPortRaiseBASEPRI/1 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: pvPortMalloc/13 (read)pvPortMalloc/13 (read)vPortFree/14 (read)vPortFree/14 (read)vPortFree/14 (read)prvHeapInit/18 (write)
  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 (read)vPortFree/14 (write)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 (read)pvPortMalloc/13 (write)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 (read)pvPortMalloc/13 (write)xPortGetMinimumEverFreeHeapSize/16 (read)prvHeapInit/18 (write)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)pvPortMalloc/13 (read)pvPortMalloc/13 (write)pvPortMalloc/13 (read)pvPortMalloc/13 (read)vPortFree/14 (read)vPortFree/14 (write)xPortGetFreeHeapSize/15 (read)prvHeapInit/18 (write)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: pvPortMalloc/13 (read)pvPortMalloc/13 (read)prvHeapInit/18 (write)prvHeapInit/18 (read)prvHeapInit/18 (read)prvHeapInit/18 (read)prvInsertBlockIntoFreeList/19 (read)prvInsertBlockIntoFreeList/19 (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: pvPortMalloc/13 (addr)pvPortMalloc/13 (read)prvHeapInit/18 (write)prvHeapInit/18 (write)prvInsertBlockIntoFreeList/19 (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. vPortRaiseBASEPRI/1 (vPortRaiseBASEPRI) @06b79d20
  180. Type: function definition analyzed
  181. Visibility: no_reorder prevailing_def_ironly
  182. References:
  183. Referring:
  184. Availability: local
  185. Function flags: body local
  186. Called by: vPortFree/14 vPortFree/14 pvPortMalloc/13 pvPortMalloc/13 pvPortMalloc/13
  187. Calls:
  188. vPortGetHeapStats (struct HeapStats_t * pxHeapStats)
  189. {
  190. size_t xMinSize;
  191. size_t xMaxSize;
  192. size_t xBlocks;
  193. struct BlockLink_t * pxBlock;
  194. <bb 2> :
  195. xBlocks = 0;
  196. xMaxSize = 0;
  197. xMinSize = 4294967295;
  198. vTaskSuspendAll ();
  199. pxBlock = xStart.pxNextFreeBlock;
  200. if (pxBlock != 0B)
  201. goto <bb 3>; [INV]
  202. else
  203. goto <bb 8>; [INV]
  204. <bb 3> :
  205. xBlocks = xBlocks + 1;
  206. _1 = pxBlock->xBlockSize;
  207. if (xMaxSize < _1)
  208. goto <bb 4>; [INV]
  209. else
  210. goto <bb 5>; [INV]
  211. <bb 4> :
  212. xMaxSize = pxBlock->xBlockSize;
  213. <bb 5> :
  214. _2 = pxBlock->xBlockSize;
  215. if (xMinSize > _2)
  216. goto <bb 6>; [INV]
  217. else
  218. goto <bb 7>; [INV]
  219. <bb 6> :
  220. xMinSize = pxBlock->xBlockSize;
  221. <bb 7> :
  222. pxBlock = pxBlock->pxNextFreeBlock;
  223. pxEnd.32_3 = pxEnd;
  224. if (pxBlock != pxEnd.32_3)
  225. goto <bb 3>; [INV]
  226. else
  227. goto <bb 8>; [INV]
  228. <bb 8> :
  229. xTaskResumeAll ();
  230. pxHeapStats->xSizeOfLargestFreeBlockInBytes = xMaxSize;
  231. pxHeapStats->xSizeOfSmallestFreeBlockInBytes = xMinSize;
  232. pxHeapStats->xNumberOfFreeBlocks = xBlocks;
  233. vPortEnterCritical ();
  234. xFreeBytesRemaining.33_4 = xFreeBytesRemaining;
  235. pxHeapStats->xAvailableHeapSpaceInBytes = xFreeBytesRemaining.33_4;
  236. xNumberOfSuccessfulAllocations.34_5 = xNumberOfSuccessfulAllocations;
  237. pxHeapStats->xNumberOfSuccessfulAllocations = xNumberOfSuccessfulAllocations.34_5;
  238. xNumberOfSuccessfulFrees.35_6 = xNumberOfSuccessfulFrees;
  239. pxHeapStats->xNumberOfSuccessfulFrees = xNumberOfSuccessfulFrees.35_6;
  240. xMinimumEverFreeBytesRemaining.36_7 = xMinimumEverFreeBytesRemaining;
  241. pxHeapStats->xMinimumEverFreeBytesRemaining = xMinimumEverFreeBytesRemaining.36_7;
  242. vPortExitCritical ();
  243. return;
  244. }
  245. prvInsertBlockIntoFreeList (struct BlockLink_t * pxBlockToInsert)
  246. {
  247. uint8_t * puc;
  248. struct BlockLink_t * pxIterator;
  249. <bb 2> :
  250. pxIterator = &xStart;
  251. goto <bb 4>; [INV]
  252. <bb 3> :
  253. pxIterator = pxIterator->pxNextFreeBlock;
  254. <bb 4> :
  255. _1 = pxIterator->pxNextFreeBlock;
  256. if (pxBlockToInsert > _1)
  257. goto <bb 3>; [INV]
  258. else
  259. goto <bb 5>; [INV]
  260. <bb 5> :
  261. puc = pxIterator;
  262. _2 = pxIterator->xBlockSize;
  263. _3 = puc + _2;
  264. if (pxBlockToInsert == _3)
  265. goto <bb 6>; [INV]
  266. else
  267. goto <bb 7>; [INV]
  268. <bb 6> :
  269. _4 = pxIterator->xBlockSize;
  270. _5 = pxBlockToInsert->xBlockSize;
  271. _6 = _4 + _5;
  272. pxIterator->xBlockSize = _6;
  273. pxBlockToInsert = pxIterator;
  274. <bb 7> :
  275. puc = pxBlockToInsert;
  276. _7 = pxBlockToInsert->xBlockSize;
  277. _8 = puc + _7;
  278. _9 = pxIterator->pxNextFreeBlock;
  279. if (_8 == _9)
  280. goto <bb 8>; [INV]
  281. else
  282. goto <bb 11>; [INV]
  283. <bb 8> :
  284. _10 = pxIterator->pxNextFreeBlock;
  285. pxEnd.30_11 = pxEnd;
  286. if (_10 != pxEnd.30_11)
  287. goto <bb 9>; [INV]
  288. else
  289. goto <bb 10>; [INV]
  290. <bb 9> :
  291. _12 = pxBlockToInsert->xBlockSize;
  292. _13 = pxIterator->pxNextFreeBlock;
  293. _14 = _13->xBlockSize;
  294. _15 = _12 + _14;
  295. pxBlockToInsert->xBlockSize = _15;
  296. _16 = pxIterator->pxNextFreeBlock;
  297. _17 = _16->pxNextFreeBlock;
  298. pxBlockToInsert->pxNextFreeBlock = _17;
  299. goto <bb 12>; [INV]
  300. <bb 10> :
  301. pxEnd.31_18 = pxEnd;
  302. pxBlockToInsert->pxNextFreeBlock = pxEnd.31_18;
  303. goto <bb 12>; [INV]
  304. <bb 11> :
  305. _19 = pxIterator->pxNextFreeBlock;
  306. pxBlockToInsert->pxNextFreeBlock = _19;
  307. <bb 12> :
  308. if (pxIterator != pxBlockToInsert)
  309. goto <bb 13>; [INV]
  310. else
  311. goto <bb 14>; [INV]
  312. <bb 13> :
  313. pxIterator->pxNextFreeBlock = pxBlockToInsert;
  314. <bb 14> :
  315. return;
  316. }
  317. prvHeapInit ()
  318. {
  319. size_t xTotalHeapSize;
  320. size_t uxAddress;
  321. uint8_t * pucAlignedHeap;
  322. struct BlockLink_t * pxFirstFreeBlock;
  323. <bb 2> :
  324. xTotalHeapSize = 8192;
  325. uxAddress = (size_t) &ucHeap;
  326. _1 = uxAddress & 7;
  327. if (_1 != 0)
  328. goto <bb 3>; [INV]
  329. else
  330. goto <bb 4>; [INV]
  331. <bb 3> :
  332. uxAddress = uxAddress + 7;
  333. uxAddress = uxAddress & 4294967288;
  334. _2 = xTotalHeapSize - uxAddress;
  335. ucHeap.22_3 = (unsigned int) &ucHeap;
  336. xTotalHeapSize = _2 + ucHeap.22_3;
  337. <bb 4> :
  338. pucAlignedHeap = (uint8_t *) uxAddress;
  339. xStart.pxNextFreeBlock = pucAlignedHeap;
  340. xStart.xBlockSize = 0;
  341. pucAlignedHeap.23_4 = (unsigned int) pucAlignedHeap;
  342. uxAddress = xTotalHeapSize + pucAlignedHeap.23_4;
  343. xHeapStructSize.24_5 = 8;
  344. uxAddress = uxAddress - xHeapStructSize.24_5;
  345. uxAddress = uxAddress & 4294967288;
  346. uxAddress.25_6 = (struct BlockLink_t *) uxAddress;
  347. pxEnd = uxAddress.25_6;
  348. pxEnd.26_7 = pxEnd;
  349. pxEnd.26_7->xBlockSize = 0;
  350. pxEnd.27_8 = pxEnd;
  351. pxEnd.27_8->pxNextFreeBlock = 0B;
  352. pxFirstFreeBlock = pucAlignedHeap;
  353. pxFirstFreeBlock.28_9 = (unsigned int) pxFirstFreeBlock;
  354. _10 = uxAddress - pxFirstFreeBlock.28_9;
  355. pxFirstFreeBlock->xBlockSize = _10;
  356. pxEnd.29_11 = pxEnd;
  357. pxFirstFreeBlock->pxNextFreeBlock = pxEnd.29_11;
  358. _12 = pxFirstFreeBlock->xBlockSize;
  359. xMinimumEverFreeBytesRemaining = _12;
  360. _13 = pxFirstFreeBlock->xBlockSize;
  361. xFreeBytesRemaining = _13;
  362. xBlockAllocatedBit = 2147483648;
  363. return;
  364. }
  365. vPortInitialiseBlocks ()
  366. {
  367. <bb 2> :
  368. return;
  369. }
  370. xPortGetMinimumEverFreeHeapSize ()
  371. {
  372. size_t D.6339;
  373. <bb 2> :
  374. D.6339 = xMinimumEverFreeBytesRemaining;
  375. <bb 3> :
  376. <L0>:
  377. return D.6339;
  378. }
  379. xPortGetFreeHeapSize ()
  380. {
  381. size_t D.6337;
  382. <bb 2> :
  383. D.6337 = xFreeBytesRemaining;
  384. <bb 3> :
  385. <L0>:
  386. return D.6337;
  387. }
  388. vPortFree (void * pv)
  389. {
  390. struct BlockLink_t * pxLink;
  391. uint8_t * puc;
  392. <bb 2> :
  393. puc = pv;
  394. if (pv != 0B)
  395. goto <bb 3>; [INV]
  396. else
  397. goto <bb 12>; [INV]
  398. <bb 3> :
  399. xHeapStructSize.16_1 = 8;
  400. _2 = -xHeapStructSize.16_1;
  401. puc = puc + _2;
  402. pxLink = puc;
  403. _3 = pxLink->xBlockSize;
  404. xBlockAllocatedBit.17_4 = xBlockAllocatedBit;
  405. _5 = _3 & xBlockAllocatedBit.17_4;
  406. if (_5 == 0)
  407. goto <bb 4>; [INV]
  408. else
  409. goto <bb 6>; [INV]
  410. <bb 4> :
  411. vPortRaiseBASEPRI ();
  412. <bb 5> :
  413. goto <bb 5>; [INV]
  414. <bb 6> :
  415. _6 = pxLink->pxNextFreeBlock;
  416. if (_6 != 0B)
  417. goto <bb 7>; [INV]
  418. else
  419. goto <bb 9>; [INV]
  420. <bb 7> :
  421. vPortRaiseBASEPRI ();
  422. <bb 8> :
  423. goto <bb 8>; [INV]
  424. <bb 9> :
  425. _7 = pxLink->xBlockSize;
  426. xBlockAllocatedBit.18_8 = xBlockAllocatedBit;
  427. _9 = _7 & xBlockAllocatedBit.18_8;
  428. if (_9 != 0)
  429. goto <bb 10>; [INV]
  430. else
  431. goto <bb 12>; [INV]
  432. <bb 10> :
  433. _10 = pxLink->pxNextFreeBlock;
  434. if (_10 == 0B)
  435. goto <bb 11>; [INV]
  436. else
  437. goto <bb 12>; [INV]
  438. <bb 11> :
  439. _11 = pxLink->xBlockSize;
  440. xBlockAllocatedBit.19_12 = xBlockAllocatedBit;
  441. _13 = ~xBlockAllocatedBit.19_12;
  442. _14 = _11 & _13;
  443. pxLink->xBlockSize = _14;
  444. vTaskSuspendAll ();
  445. _15 = pxLink->xBlockSize;
  446. xFreeBytesRemaining.20_16 = xFreeBytesRemaining;
  447. _17 = _15 + xFreeBytesRemaining.20_16;
  448. xFreeBytesRemaining = _17;
  449. prvInsertBlockIntoFreeList (pxLink);
  450. xNumberOfSuccessfulFrees.21_18 = xNumberOfSuccessfulFrees;
  451. _19 = xNumberOfSuccessfulFrees.21_18 + 1;
  452. xNumberOfSuccessfulFrees = _19;
  453. xTaskResumeAll ();
  454. <bb 12> :
  455. return;
  456. }
  457. pvPortMalloc (size_t xWantedSize)
  458. {
  459. void * pvReturn;
  460. struct BlockLink_t * pxNewBlockLink;
  461. struct BlockLink_t * pxPreviousBlock;
  462. struct BlockLink_t * pxBlock;
  463. void * D.6323;
  464. <bb 2> :
  465. pvReturn = 0B;
  466. vTaskSuspendAll ();
  467. pxEnd.0_1 = pxEnd;
  468. if (pxEnd.0_1 == 0B)
  469. goto <bb 3>; [INV]
  470. else
  471. goto <bb 4>; [INV]
  472. <bb 3> :
  473. prvHeapInit ();
  474. <bb 4> :
  475. xBlockAllocatedBit.1_2 = xBlockAllocatedBit;
  476. _3 = xWantedSize & xBlockAllocatedBit.1_2;
  477. if (_3 == 0)
  478. goto <bb 5>; [INV]
  479. else
  480. goto <bb 30>; [INV]
  481. <bb 5> :
  482. if (xWantedSize != 0)
  483. goto <bb 6>; [INV]
  484. else
  485. goto <bb 14>; [INV]
  486. <bb 6> :
  487. xHeapStructSize.2_4 = 8;
  488. _5 = xWantedSize + xHeapStructSize.2_4;
  489. if (xWantedSize < _5)
  490. goto <bb 7>; [INV]
  491. else
  492. goto <bb 14>; [INV]
  493. <bb 7> :
  494. xHeapStructSize.3_6 = 8;
  495. xWantedSize = xWantedSize + xHeapStructSize.3_6;
  496. _7 = xWantedSize & 7;
  497. if (_7 != 0)
  498. goto <bb 8>; [INV]
  499. else
  500. goto <bb 13>; [INV]
  501. <bb 8> :
  502. _8 = xWantedSize & 4294967288;
  503. _9 = _8 + 8;
  504. if (xWantedSize < _9)
  505. goto <bb 9>; [INV]
  506. else
  507. goto <bb 12>; [INV]
  508. <bb 9> :
  509. _10 = xWantedSize & 4294967288;
  510. xWantedSize = _10 + 8;
  511. _11 = xWantedSize & 7;
  512. if (_11 != 0)
  513. goto <bb 10>; [INV]
  514. else
  515. goto <bb 13>; [INV]
  516. <bb 10> :
  517. vPortRaiseBASEPRI ();
  518. <bb 11> :
  519. goto <bb 11>; [INV]
  520. <bb 12> :
  521. xWantedSize = 0;
  522. <bb 13> :
  523. goto <bb 15>; [INV]
  524. <bb 14> :
  525. xWantedSize = 0;
  526. <bb 15> :
  527. if (xWantedSize != 0)
  528. goto <bb 16>; [INV]
  529. else
  530. goto <bb 30>; [INV]
  531. <bb 16> :
  532. xFreeBytesRemaining.4_12 = xFreeBytesRemaining;
  533. if (xWantedSize <= xFreeBytesRemaining.4_12)
  534. goto <bb 17>; [INV]
  535. else
  536. goto <bb 30>; [INV]
  537. <bb 17> :
  538. pxPreviousBlock = &xStart;
  539. pxBlock = xStart.pxNextFreeBlock;
  540. goto <bb 19>; [INV]
  541. <bb 18> :
  542. pxPreviousBlock = pxBlock;
  543. pxBlock = pxBlock->pxNextFreeBlock;
  544. <bb 19> :
  545. _13 = pxBlock->xBlockSize;
  546. if (xWantedSize > _13)
  547. goto <bb 20>; [INV]
  548. else
  549. goto <bb 21>; [INV]
  550. <bb 20> :
  551. _14 = pxBlock->pxNextFreeBlock;
  552. if (_14 != 0B)
  553. goto <bb 18>; [INV]
  554. else
  555. goto <bb 21>; [INV]
  556. <bb 21> :
  557. pxEnd.5_15 = pxEnd;
  558. if (pxBlock != pxEnd.5_15)
  559. goto <bb 22>; [INV]
  560. else
  561. goto <bb 30>; [INV]
  562. <bb 22> :
  563. _16 = pxPreviousBlock->pxNextFreeBlock;
  564. xHeapStructSize.6_17 = 8;
  565. pvReturn = _16 + xHeapStructSize.6_17;
  566. _18 = pxBlock->pxNextFreeBlock;
  567. pxPreviousBlock->pxNextFreeBlock = _18;
  568. _19 = pxBlock->xBlockSize;
  569. _20 = _19 - xWantedSize;
  570. xHeapStructSize.7_21 = 8;
  571. _22 = xHeapStructSize.7_21 << 1;
  572. if (_20 > _22)
  573. goto <bb 23>; [INV]
  574. else
  575. goto <bb 27>; [INV]
  576. <bb 23> :
  577. pxNewBlockLink = pxBlock + xWantedSize;
  578. pxNewBlockLink.8_23 = (unsigned int) pxNewBlockLink;
  579. _24 = pxNewBlockLink.8_23 & 7;
  580. if (_24 != 0)
  581. goto <bb 24>; [INV]
  582. else
  583. goto <bb 26>; [INV]
  584. <bb 24> :
  585. vPortRaiseBASEPRI ();
  586. <bb 25> :
  587. goto <bb 25>; [INV]
  588. <bb 26> :
  589. _25 = pxBlock->xBlockSize;
  590. _26 = _25 - xWantedSize;
  591. pxNewBlockLink->xBlockSize = _26;
  592. pxBlock->xBlockSize = xWantedSize;
  593. prvInsertBlockIntoFreeList (pxNewBlockLink);
  594. <bb 27> :
  595. xFreeBytesRemaining.9_27 = xFreeBytesRemaining;
  596. _28 = pxBlock->xBlockSize;
  597. _29 = xFreeBytesRemaining.9_27 - _28;
  598. xFreeBytesRemaining = _29;
  599. xFreeBytesRemaining.10_30 = xFreeBytesRemaining;
  600. xMinimumEverFreeBytesRemaining.11_31 = xMinimumEverFreeBytesRemaining;
  601. if (xFreeBytesRemaining.10_30 < xMinimumEverFreeBytesRemaining.11_31)
  602. goto <bb 28>; [INV]
  603. else
  604. goto <bb 29>; [INV]
  605. <bb 28> :
  606. xFreeBytesRemaining.12_32 = xFreeBytesRemaining;
  607. xMinimumEverFreeBytesRemaining = xFreeBytesRemaining.12_32;
  608. <bb 29> :
  609. _33 = pxBlock->xBlockSize;
  610. xBlockAllocatedBit.13_34 = xBlockAllocatedBit;
  611. _35 = _33 | xBlockAllocatedBit.13_34;
  612. pxBlock->xBlockSize = _35;
  613. pxBlock->pxNextFreeBlock = 0B;
  614. xNumberOfSuccessfulAllocations.14_36 = xNumberOfSuccessfulAllocations;
  615. _37 = xNumberOfSuccessfulAllocations.14_36 + 1;
  616. xNumberOfSuccessfulAllocations = _37;
  617. <bb 30> :
  618. xTaskResumeAll ();
  619. pvReturn.15_38 = (unsigned int) pvReturn;
  620. _39 = pvReturn.15_38 & 7;
  621. if (_39 != 0)
  622. goto <bb 31>; [INV]
  623. else
  624. goto <bb 33>; [INV]
  625. <bb 31> :
  626. vPortRaiseBASEPRI ();
  627. <bb 32> :
  628. goto <bb 32>; [INV]
  629. <bb 33> :
  630. D.6323 = pvReturn;
  631. <bb 34> :
  632. <L43>:
  633. return D.6323;
  634. }
  635. __attribute__((always_inline))
  636. vPortRaiseBASEPRI ()
  637. {
  638. uint32_t ulNewBASEPRI;
  639. <bb 2> :
  640. __asm__ __volatile__(" mov %0, %1
  641. msr basepri, %0
  642. isb
  643. dsb
  644. " : "=r" ulNewBASEPRI : "i" 16 : "memory");
  645. return;
  646. }