heap_4.c.016i.visibility 22 KB

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