1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948 |
- ucStreamBufferGetStreamBufferType (struct StreamBufferDef_t * xStreamBuffer)
- {
- uint8_t D.6586;
- <bb 2> :
- # DEBUG BEGIN_STMT
- _1 = xStreamBuffer->ucFlags;
- D.6586 = _1 & 1;
- return D.6586;
- }
- vStreamBufferSetStreamBufferNumber (struct StreamBufferDef_t * xStreamBuffer, UBaseType_t uxStreamBufferNumber)
- {
- <bb 2> :
- # DEBUG BEGIN_STMT
- xStreamBuffer->uxStreamBufferNumber = uxStreamBufferNumber;
- return;
- }
- uxStreamBufferGetStreamBufferNumber (struct StreamBufferDef_t * xStreamBuffer)
- {
- UBaseType_t D.6584;
- <bb 2> :
- # DEBUG BEGIN_STMT
- D.6584 = xStreamBuffer->uxStreamBufferNumber;
- return D.6584;
- }
- prvInitialiseNewStreamBuffer (struct StreamBuffer_t * const pxStreamBuffer, uint8_t * const pucBuffer, size_t xBufferSizeBytes, size_t xTriggerLevelBytes, uint8_t ucFlags)
- {
- const BaseType_t xWriteValue;
- <bb 2> :
- # DEBUG BEGIN_STMT
- xWriteValue = 85;
- # DEBUG BEGIN_STMT
- _1 = memset (pucBuffer, 85, xBufferSizeBytes);
- if (pucBuffer != _1)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- memset (pxStreamBuffer, 0, 36);
- # DEBUG BEGIN_STMT
- pxStreamBuffer->pucBuffer = pucBuffer;
- # DEBUG BEGIN_STMT
- pxStreamBuffer->xLength = xBufferSizeBytes;
- # DEBUG BEGIN_STMT
- pxStreamBuffer->xTriggerLevelBytes = xTriggerLevelBytes;
- # DEBUG BEGIN_STMT
- pxStreamBuffer->ucFlags = ucFlags;
- return;
- }
- prvBytesInBuffer (const struct StreamBuffer_t * const pxStreamBuffer)
- {
- size_t xCount;
- size_t D.6389;
- unsigned int D.6385;
- <bb 2> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->xLength;
- _2 = pxStreamBuffer->xHead;
- xCount = _1 + _2;
- # DEBUG BEGIN_STMT
- D.6385 = pxStreamBuffer->xTail;
- xCount = xCount - D.6385;
- # DEBUG BEGIN_STMT
- _3 = pxStreamBuffer->xLength;
- if (xCount >= _3)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- _4 = pxStreamBuffer->xLength;
- xCount = xCount - _4;
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- D.6389 = xCount;
- return D.6389;
- }
- prvReadBytesFromBuffer (struct StreamBuffer_t * pxStreamBuffer, uint8_t * pucData, size_t xCount, size_t xTail)
- {
- size_t xFirstLength;
- size_t D.6521;
- <bb 2> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (xCount == 0)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->xLength;
- _2 = _1 - xTail;
- xFirstLength = MIN_EXPR <xCount, _2>;
- # DEBUG BEGIN_STMT
- if (xFirstLength > xCount)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 7> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 7>; [INV]
- <bb 8> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _3 = xTail + xFirstLength;
- _4 = pxStreamBuffer->xLength;
- if (_3 > _4)
- goto <bb 9>; [INV]
- else
- goto <bb 11>; [INV]
- <bb 9> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 10> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 10>; [INV]
- <bb 11> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _5 = pxStreamBuffer->pucBuffer;
- _6 = _5 + xTail;
- memcpy (pucData, _6, xFirstLength);
- # DEBUG BEGIN_STMT
- if (xCount > xFirstLength)
- goto <bb 12>; [INV]
- else
- goto <bb 13>; [INV]
- <bb 12> :
- # DEBUG BEGIN_STMT
- _7 = pucData + xFirstLength;
- _8 = pxStreamBuffer->pucBuffer;
- _9 = xCount - xFirstLength;
- memcpy (_7, _8, _9);
- <bb 13> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- xTail = xTail + xCount;
- # DEBUG BEGIN_STMT
- _10 = pxStreamBuffer->xLength;
- if (xTail >= _10)
- goto <bb 14>; [INV]
- else
- goto <bb 15>; [INV]
- <bb 14> :
- # DEBUG BEGIN_STMT
- _11 = pxStreamBuffer->xLength;
- xTail = xTail - _11;
- <bb 15> :
- # DEBUG BEGIN_STMT
- D.6521 = xTail;
- return D.6521;
- }
- prvWriteBytesToBuffer (struct StreamBuffer_t * const pxStreamBuffer, const uint8_t * pucData, size_t xCount, size_t xHead)
- {
- size_t xFirstLength;
- size_t D.6450;
- <bb 2> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (xCount == 0)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->xLength;
- _2 = _1 - xHead;
- xFirstLength = MIN_EXPR <xCount, _2>;
- # DEBUG BEGIN_STMT
- _3 = xHead + xFirstLength;
- _4 = pxStreamBuffer->xLength;
- if (_3 > _4)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 7> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 7>; [INV]
- <bb 8> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _5 = pxStreamBuffer->pucBuffer;
- _6 = _5 + xHead;
- memcpy (_6, pucData, xFirstLength);
- # DEBUG BEGIN_STMT
- if (xCount > xFirstLength)
- goto <bb 9>; [INV]
- else
- goto <bb 13>; [INV]
- <bb 9> :
- # DEBUG BEGIN_STMT
- _7 = xCount - xFirstLength;
- _8 = pxStreamBuffer->xLength;
- if (_7 > _8)
- goto <bb 10>; [INV]
- else
- goto <bb 12>; [INV]
- <bb 10> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 11> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 11>; [INV]
- <bb 12> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _9 = pxStreamBuffer->pucBuffer;
- _10 = pucData + xFirstLength;
- _11 = xCount - xFirstLength;
- memcpy (_9, _10, _11);
- <bb 13> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- xHead = xHead + xCount;
- # DEBUG BEGIN_STMT
- _12 = pxStreamBuffer->xLength;
- if (xHead >= _12)
- goto <bb 14>; [INV]
- else
- goto <bb 15>; [INV]
- <bb 14> :
- # DEBUG BEGIN_STMT
- _13 = pxStreamBuffer->xLength;
- xHead = xHead - _13;
- <bb 15> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- D.6450 = xHead;
- return D.6450;
- }
- xStreamBufferReceiveCompletedFromISR (struct StreamBufferDef_t * xStreamBuffer, BaseType_t * pxHigherPriorityTaskWoken)
- {
- UBaseType_t uxSavedInterruptStatus;
- BaseType_t xReturn;
- struct StreamBuffer_t * const pxStreamBuffer;
- BaseType_t D.6582;
- <bb 2> :
- # DEBUG BEGIN_STMT
- pxStreamBuffer = xStreamBuffer;
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (pxStreamBuffer == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- uxSavedInterruptStatus = ulPortRaiseBASEPRI ();
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->xTaskWaitingToSend;
- if (_1 != 0B)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- _2 = pxStreamBuffer->xTaskWaitingToSend;
- xTaskGenericNotifyFromISR (_2, 0, 0, 0, 0B, pxHigherPriorityTaskWoken);
- # DEBUG BEGIN_STMT
- pxStreamBuffer->xTaskWaitingToSend = 0B;
- # DEBUG BEGIN_STMT
- xReturn = 1;
- goto <bb 8>; [INV]
- <bb 7> :
- # DEBUG BEGIN_STMT
- xReturn = 0;
- <bb 8> :
- # DEBUG BEGIN_STMT
- vPortSetBASEPRI (uxSavedInterruptStatus);
- # DEBUG BEGIN_STMT
- D.6582 = xReturn;
- return D.6582;
- }
- xStreamBufferSendCompletedFromISR (struct StreamBufferDef_t * xStreamBuffer, BaseType_t * pxHigherPriorityTaskWoken)
- {
- UBaseType_t uxSavedInterruptStatus;
- BaseType_t xReturn;
- struct StreamBuffer_t * const pxStreamBuffer;
- BaseType_t D.6575;
- <bb 2> :
- # DEBUG BEGIN_STMT
- pxStreamBuffer = xStreamBuffer;
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (pxStreamBuffer == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- uxSavedInterruptStatus = ulPortRaiseBASEPRI ();
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->xTaskWaitingToReceive;
- if (_1 != 0B)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- _2 = pxStreamBuffer->xTaskWaitingToReceive;
- xTaskGenericNotifyFromISR (_2, 0, 0, 0, 0B, pxHigherPriorityTaskWoken);
- # DEBUG BEGIN_STMT
- pxStreamBuffer->xTaskWaitingToReceive = 0B;
- # DEBUG BEGIN_STMT
- xReturn = 1;
- goto <bb 8>; [INV]
- <bb 7> :
- # DEBUG BEGIN_STMT
- xReturn = 0;
- <bb 8> :
- # DEBUG BEGIN_STMT
- vPortSetBASEPRI (uxSavedInterruptStatus);
- # DEBUG BEGIN_STMT
- D.6575 = xReturn;
- return D.6575;
- }
- xStreamBufferIsFull (struct StreamBufferDef_t * xStreamBuffer)
- {
- const struct StreamBuffer_t * const pxStreamBuffer;
- size_t xBytesToStoreMessageLength;
- BaseType_t xReturn;
- BaseType_t D.6568;
- <bb 2> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- pxStreamBuffer = xStreamBuffer;
- # DEBUG BEGIN_STMT
- if (pxStreamBuffer == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 1;
- if (_3 != 0)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- xBytesToStoreMessageLength = 4;
- goto <bb 8>; [INV]
- <bb 7> :
- # DEBUG BEGIN_STMT
- xBytesToStoreMessageLength = 0;
- <bb 8> :
- # DEBUG BEGIN_STMT
- _4 = xStreamBufferSpacesAvailable (xStreamBuffer);
- if (xBytesToStoreMessageLength >= _4)
- goto <bb 9>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 9> :
- # DEBUG BEGIN_STMT
- xReturn = 1;
- goto <bb 11>; [INV]
- <bb 10> :
- # DEBUG BEGIN_STMT
- xReturn = 0;
- <bb 11> :
- # DEBUG BEGIN_STMT
- D.6568 = xReturn;
- return D.6568;
- }
- xStreamBufferIsEmpty (struct StreamBufferDef_t * xStreamBuffer)
- {
- size_t xTail;
- BaseType_t xReturn;
- const struct StreamBuffer_t * const pxStreamBuffer;
- BaseType_t D.6558;
- <bb 2> :
- # DEBUG BEGIN_STMT
- pxStreamBuffer = xStreamBuffer;
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (pxStreamBuffer == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- xTail = pxStreamBuffer->xTail;
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->xHead;
- if (xTail == _1)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- xReturn = 1;
- goto <bb 8>; [INV]
- <bb 7> :
- # DEBUG BEGIN_STMT
- xReturn = 0;
- <bb 8> :
- # DEBUG BEGIN_STMT
- D.6558 = xReturn;
- return D.6558;
- }
- prvReadMessageFromBuffer (struct StreamBuffer_t * pxStreamBuffer, void * pvRxData, size_t xBufferLengthBytes, size_t xBytesAvailable)
- {
- size_t xNextTail;
- size_t xTempNextMessageLength;
- size_t xNextMessageLength;
- size_t xCount;
- size_t D.6507;
- <bb 2> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- xNextTail = pxStreamBuffer->xTail;
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 1;
- if (_3 != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- xNextTail = prvReadBytesFromBuffer (pxStreamBuffer, &xTempNextMessageLength, 4, xNextTail);
- # DEBUG BEGIN_STMT
- xNextMessageLength = xTempNextMessageLength;
- # DEBUG BEGIN_STMT
- xBytesAvailable = xBytesAvailable + 4294967292;
- # DEBUG BEGIN_STMT
- if (xNextMessageLength > xBufferLengthBytes)
- goto <bb 4>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 4> :
- # DEBUG BEGIN_STMT
- xNextMessageLength = 0;
- goto <bb 6>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- xNextMessageLength = xBufferLengthBytes;
- <bb 6> :
- # DEBUG BEGIN_STMT
- xCount = MIN_EXPR <xBytesAvailable, xNextMessageLength>;
- # DEBUG BEGIN_STMT
- if (xCount != 0)
- goto <bb 7>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 7> :
- # DEBUG BEGIN_STMT
- _4 = prvReadBytesFromBuffer (pxStreamBuffer, pvRxData, xCount, xNextTail);
- pxStreamBuffer->xTail = _4;
- <bb 8> :
- # DEBUG BEGIN_STMT
- D.6507 = xCount;
- xTempNextMessageLength = {CLOBBER};
- return D.6507;
- }
- xStreamBufferReceiveFromISR (struct StreamBufferDef_t * xStreamBuffer, void * pvRxData, size_t xBufferLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken)
- {
- UBaseType_t uxSavedInterruptStatus;
- size_t xBytesToStoreMessageLength;
- size_t xBytesAvailable;
- size_t xReceivedLength;
- struct StreamBuffer_t * const pxStreamBuffer;
- size_t D.6551;
- <bb 2> :
- # DEBUG BEGIN_STMT
- pxStreamBuffer = xStreamBuffer;
- # DEBUG BEGIN_STMT
- xReceivedLength = 0;
- # DEBUG BEGIN_STMT
- if (pvRxData == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (pxStreamBuffer == 0B)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 7> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 7>; [INV]
- <bb 8> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 1;
- if (_3 != 0)
- goto <bb 9>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 9> :
- # DEBUG BEGIN_STMT
- xBytesToStoreMessageLength = 4;
- goto <bb 11>; [INV]
- <bb 10> :
- # DEBUG BEGIN_STMT
- xBytesToStoreMessageLength = 0;
- <bb 11> :
- # DEBUG BEGIN_STMT
- xBytesAvailable = prvBytesInBuffer (pxStreamBuffer);
- # DEBUG BEGIN_STMT
- if (xBytesAvailable > xBytesToStoreMessageLength)
- goto <bb 12>; [INV]
- else
- goto <bb 16>; [INV]
- <bb 12> :
- # DEBUG BEGIN_STMT
- xReceivedLength = prvReadMessageFromBuffer (pxStreamBuffer, pvRxData, xBufferLengthBytes, xBytesAvailable);
- # DEBUG BEGIN_STMT
- if (xReceivedLength != 0)
- goto <bb 13>; [INV]
- else
- goto <bb 16>; [INV]
- <bb 13> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- uxSavedInterruptStatus = ulPortRaiseBASEPRI ();
- # DEBUG BEGIN_STMT
- _4 = pxStreamBuffer->xTaskWaitingToSend;
- if (_4 != 0B)
- goto <bb 14>; [INV]
- else
- goto <bb 15>; [INV]
- <bb 14> :
- # DEBUG BEGIN_STMT
- _5 = pxStreamBuffer->xTaskWaitingToSend;
- xTaskGenericNotifyFromISR (_5, 0, 0, 0, 0B, pxHigherPriorityTaskWoken);
- # DEBUG BEGIN_STMT
- pxStreamBuffer->xTaskWaitingToSend = 0B;
- <bb 15> :
- # DEBUG BEGIN_STMT
- vPortSetBASEPRI (uxSavedInterruptStatus);
- # DEBUG BEGIN_STMT
- <bb 16> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- D.6551 = xReceivedLength;
- return D.6551;
- }
- xStreamBufferNextMessageLengthBytes (struct StreamBufferDef_t * xStreamBuffer)
- {
- size_t xTempReturn;
- size_t xBytesAvailable;
- size_t xReturn;
- struct StreamBuffer_t * const pxStreamBuffer;
- size_t D.6533;
- <bb 2> :
- # DEBUG BEGIN_STMT
- pxStreamBuffer = xStreamBuffer;
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (pxStreamBuffer == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 1;
- if (_3 != 0)
- goto <bb 6>; [INV]
- else
- goto <bb 12>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- xBytesAvailable = prvBytesInBuffer (pxStreamBuffer);
- # DEBUG BEGIN_STMT
- if (xBytesAvailable > 4)
- goto <bb 7>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 7> :
- # DEBUG BEGIN_STMT
- _4 = pxStreamBuffer->xTail;
- prvReadBytesFromBuffer (pxStreamBuffer, &xTempReturn, 4, _4);
- # DEBUG BEGIN_STMT
- xReturn = xTempReturn;
- goto <bb 13>; [INV]
- <bb 8> :
- # DEBUG BEGIN_STMT
- if (xBytesAvailable != 0)
- goto <bb 9>; [INV]
- else
- goto <bb 11>; [INV]
- <bb 9> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 10> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 10>; [INV]
- <bb 11> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- xReturn = 0;
- goto <bb 13>; [INV]
- <bb 12> :
- # DEBUG BEGIN_STMT
- xReturn = 0;
- <bb 13> :
- # DEBUG BEGIN_STMT
- D.6533 = xReturn;
- xTempReturn = {CLOBBER};
- return D.6533;
- }
- xStreamBufferReceive (struct StreamBufferDef_t * xStreamBuffer, void * pvRxData, size_t xBufferLengthBytes, TickType_t xTicksToWait)
- {
- size_t xBytesToStoreMessageLength;
- size_t xBytesAvailable;
- size_t xReceivedLength;
- struct StreamBuffer_t * const pxStreamBuffer;
- size_t D.6497;
- <bb 2> :
- # DEBUG BEGIN_STMT
- pxStreamBuffer = xStreamBuffer;
- # DEBUG BEGIN_STMT
- xReceivedLength = 0;
- # DEBUG BEGIN_STMT
- if (pvRxData == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (pxStreamBuffer == 0B)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 7> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 7>; [INV]
- <bb 8> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 1;
- if (_3 != 0)
- goto <bb 9>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 9> :
- # DEBUG BEGIN_STMT
- xBytesToStoreMessageLength = 4;
- goto <bb 11>; [INV]
- <bb 10> :
- # DEBUG BEGIN_STMT
- xBytesToStoreMessageLength = 0;
- <bb 11> :
- # DEBUG BEGIN_STMT
- if (xTicksToWait != 0)
- goto <bb 12>; [INV]
- else
- goto <bb 19>; [INV]
- <bb 12> :
- # DEBUG BEGIN_STMT
- vPortEnterCritical ();
- # DEBUG BEGIN_STMT
- xBytesAvailable = prvBytesInBuffer (pxStreamBuffer);
- # DEBUG BEGIN_STMT
- if (xBytesAvailable <= xBytesToStoreMessageLength)
- goto <bb 13>; [INV]
- else
- goto <bb 17>; [INV]
- <bb 13> :
- # DEBUG BEGIN_STMT
- xTaskGenericNotifyStateClear (0B, 0);
- # DEBUG BEGIN_STMT
- _4 = pxStreamBuffer->xTaskWaitingToReceive;
- if (_4 != 0B)
- goto <bb 14>; [INV]
- else
- goto <bb 16>; [INV]
- <bb 14> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 15> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 15>; [INV]
- <bb 16> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _5 = xTaskGetCurrentTaskHandle ();
- pxStreamBuffer->xTaskWaitingToReceive = _5;
- <bb 17> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- vPortExitCritical ();
- # DEBUG BEGIN_STMT
- if (xBytesAvailable <= xBytesToStoreMessageLength)
- goto <bb 18>; [INV]
- else
- goto <bb 20>; [INV]
- <bb 18> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- xTaskGenericNotifyWait (0, 0, 0, 0B, xTicksToWait);
- # DEBUG BEGIN_STMT
- pxStreamBuffer->xTaskWaitingToReceive = 0B;
- # DEBUG BEGIN_STMT
- xBytesAvailable = prvBytesInBuffer (pxStreamBuffer);
- goto <bb 20>; [INV]
- <bb 19> :
- # DEBUG BEGIN_STMT
- xBytesAvailable = prvBytesInBuffer (pxStreamBuffer);
- <bb 20> :
- # DEBUG BEGIN_STMT
- if (xBytesAvailable > xBytesToStoreMessageLength)
- goto <bb 21>; [INV]
- else
- goto <bb 25>; [INV]
- <bb 21> :
- # DEBUG BEGIN_STMT
- xReceivedLength = prvReadMessageFromBuffer (pxStreamBuffer, pvRxData, xBufferLengthBytes, xBytesAvailable);
- # DEBUG BEGIN_STMT
- if (xReceivedLength != 0)
- goto <bb 22>; [INV]
- else
- goto <bb 25>; [INV]
- <bb 22> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- vTaskSuspendAll ();
- # DEBUG BEGIN_STMT
- _6 = pxStreamBuffer->xTaskWaitingToSend;
- if (_6 != 0B)
- goto <bb 23>; [INV]
- else
- goto <bb 24>; [INV]
- <bb 23> :
- # DEBUG BEGIN_STMT
- _7 = pxStreamBuffer->xTaskWaitingToSend;
- xTaskGenericNotify (_7, 0, 0, 0, 0B);
- # DEBUG BEGIN_STMT
- pxStreamBuffer->xTaskWaitingToSend = 0B;
- <bb 24> :
- # DEBUG BEGIN_STMT
- xTaskResumeAll ();
- # DEBUG BEGIN_STMT
- <bb 25> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- D.6497 = xReceivedLength;
- return D.6497;
- }
- prvWriteMessageToBuffer (struct StreamBuffer_t * const pxStreamBuffer, const void * pvTxData, size_t xDataLengthBytes, size_t xSpace, size_t xRequiredSpace)
- {
- size_t xNextHead;
- size_t D.6436;
- <bb 2> :
- # DEBUG BEGIN_STMT
- xNextHead = pxStreamBuffer->xHead;
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 1;
- if (_3 != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- if (xSpace >= xRequiredSpace)
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- # DEBUG BEGIN_STMT
- xNextHead = prvWriteBytesToBuffer (pxStreamBuffer, &xDataLengthBytes, 4, xNextHead);
- goto <bb 7>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- xDataLengthBytes = 0;
- goto <bb 7>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- xDataLengthBytes.2_4 = xDataLengthBytes;
- _5 = MIN_EXPR <xSpace, xDataLengthBytes.2_4>;
- xDataLengthBytes = _5;
- <bb 7> :
- # DEBUG BEGIN_STMT
- xDataLengthBytes.3_6 = xDataLengthBytes;
- if (xDataLengthBytes.3_6 != 0)
- goto <bb 8>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 8> :
- # DEBUG BEGIN_STMT
- xDataLengthBytes.4_7 = xDataLengthBytes;
- _8 = prvWriteBytesToBuffer (pxStreamBuffer, pvTxData, xDataLengthBytes.4_7, xNextHead);
- pxStreamBuffer->xHead = _8;
- <bb 9> :
- # DEBUG BEGIN_STMT
- D.6436 = xDataLengthBytes;
- return D.6436;
- }
- xStreamBufferSendFromISR (struct StreamBufferDef_t * xStreamBuffer, const void * pvTxData, size_t xDataLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken)
- {
- UBaseType_t uxSavedInterruptStatus;
- size_t xRequiredSpace;
- size_t xSpace;
- size_t xReturn;
- struct StreamBuffer_t * const pxStreamBuffer;
- size_t D.6467;
- <bb 2> :
- # DEBUG BEGIN_STMT
- pxStreamBuffer = xStreamBuffer;
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- xRequiredSpace = xDataLengthBytes;
- # DEBUG BEGIN_STMT
- if (pvTxData == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (pxStreamBuffer == 0B)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 7> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 7>; [INV]
- <bb 8> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 1;
- if (_3 != 0)
- goto <bb 9>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 9> :
- # DEBUG BEGIN_STMT
- xRequiredSpace = xRequiredSpace + 4;
- <bb 10> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- xSpace = xStreamBufferSpacesAvailable (pxStreamBuffer);
- # DEBUG BEGIN_STMT
- xReturn = prvWriteMessageToBuffer (pxStreamBuffer, pvTxData, xDataLengthBytes, xSpace, xRequiredSpace);
- # DEBUG BEGIN_STMT
- if (xReturn != 0)
- goto <bb 11>; [INV]
- else
- goto <bb 15>; [INV]
- <bb 11> :
- # DEBUG BEGIN_STMT
- _4 = prvBytesInBuffer (pxStreamBuffer);
- _5 = pxStreamBuffer->xTriggerLevelBytes;
- if (_4 >= _5)
- goto <bb 12>; [INV]
- else
- goto <bb 15>; [INV]
- <bb 12> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- uxSavedInterruptStatus = ulPortRaiseBASEPRI ();
- # DEBUG BEGIN_STMT
- _6 = pxStreamBuffer->xTaskWaitingToReceive;
- if (_6 != 0B)
- goto <bb 13>; [INV]
- else
- goto <bb 14>; [INV]
- <bb 13> :
- # DEBUG BEGIN_STMT
- _7 = pxStreamBuffer->xTaskWaitingToReceive;
- xTaskGenericNotifyFromISR (_7, 0, 0, 0, 0B, pxHigherPriorityTaskWoken);
- # DEBUG BEGIN_STMT
- pxStreamBuffer->xTaskWaitingToReceive = 0B;
- <bb 14> :
- # DEBUG BEGIN_STMT
- vPortSetBASEPRI (uxSavedInterruptStatus);
- # DEBUG BEGIN_STMT
- <bb 15> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- D.6467 = xReturn;
- return D.6467;
- }
- xStreamBufferSend (struct StreamBufferDef_t * xStreamBuffer, const void * pvTxData, size_t xDataLengthBytes, TickType_t xTicksToWait)
- {
- size_t xMaxReportedSpace;
- struct TimeOut_t xTimeOut;
- size_t xRequiredSpace;
- size_t xSpace;
- size_t xReturn;
- struct StreamBuffer_t * const pxStreamBuffer;
- size_t D.6425;
- <bb 2> :
- # DEBUG BEGIN_STMT
- pxStreamBuffer = xStreamBuffer;
- # DEBUG BEGIN_STMT
- xSpace = 0;
- # DEBUG BEGIN_STMT
- xRequiredSpace = xDataLengthBytes;
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- xMaxReportedSpace = 0;
- # DEBUG BEGIN_STMT
- if (pvTxData == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (pxStreamBuffer == 0B)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 7> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 7>; [INV]
- <bb 8> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->xLength;
- xMaxReportedSpace = _1 + 4294967295;
- # DEBUG BEGIN_STMT
- _2 = pxStreamBuffer->ucFlags;
- _3 = (int) _2;
- _4 = _3 & 1;
- if (_4 != 0)
- goto <bb 9>; [INV]
- else
- goto <bb 14>; [INV]
- <bb 9> :
- # DEBUG BEGIN_STMT
- xRequiredSpace = xRequiredSpace + 4;
- # DEBUG BEGIN_STMT
- if (xRequiredSpace <= xDataLengthBytes)
- goto <bb 10>; [INV]
- else
- goto <bb 12>; [INV]
- <bb 10> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 11> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 11>; [INV]
- <bb 12> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (xRequiredSpace > xMaxReportedSpace)
- goto <bb 13>; [INV]
- else
- goto <bb 16>; [INV]
- <bb 13> :
- # DEBUG BEGIN_STMT
- xTicksToWait = 0;
- goto <bb 16>; [INV]
- <bb 14> :
- # DEBUG BEGIN_STMT
- if (xRequiredSpace > xMaxReportedSpace)
- goto <bb 15>; [INV]
- else
- goto <bb 16>; [INV]
- <bb 15> :
- # DEBUG BEGIN_STMT
- xRequiredSpace = xMaxReportedSpace;
- <bb 16> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- xTicksToWait.0_5 = xTicksToWait;
- if (xTicksToWait.0_5 != 0)
- goto <bb 17>; [INV]
- else
- goto <bb 24>; [INV]
- <bb 17> :
- # DEBUG BEGIN_STMT
- vTaskSetTimeOutState (&xTimeOut);
- <bb 18> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- vPortEnterCritical ();
- # DEBUG BEGIN_STMT
- xSpace = xStreamBufferSpacesAvailable (pxStreamBuffer);
- # DEBUG BEGIN_STMT
- if (xSpace < xRequiredSpace)
- goto <bb 19>; [INV]
- else
- goto <bb 23>; [INV]
- <bb 19> :
- # DEBUG BEGIN_STMT
- xTaskGenericNotifyStateClear (0B, 0);
- # DEBUG BEGIN_STMT
- _6 = pxStreamBuffer->xTaskWaitingToSend;
- if (_6 != 0B)
- goto <bb 20>; [INV]
- else
- goto <bb 22>; [INV]
- <bb 20> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 21> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 21>; [INV]
- <bb 22> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _7 = xTaskGetCurrentTaskHandle ();
- pxStreamBuffer->xTaskWaitingToSend = _7;
- # DEBUG BEGIN_STMT
- vPortExitCritical ();
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- xTicksToWait.1_8 = xTicksToWait;
- xTaskGenericNotifyWait (0, 0, 0, 0B, xTicksToWait.1_8);
- # DEBUG BEGIN_STMT
- pxStreamBuffer->xTaskWaitingToSend = 0B;
- # DEBUG BEGIN_STMT
- _9 = xTaskCheckForTimeOut (&xTimeOut, &xTicksToWait);
- if (_9 == 0)
- goto <bb 18>; [INV]
- else
- goto <bb 24>; [INV]
- <bb 23> :
- # DEBUG BEGIN_STMT
- vPortExitCritical ();
- # DEBUG BEGIN_STMT
- <bb 24> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (xSpace == 0)
- goto <bb 25>; [INV]
- else
- goto <bb 26>; [INV]
- <bb 25> :
- # DEBUG BEGIN_STMT
- xSpace = xStreamBufferSpacesAvailable (pxStreamBuffer);
- <bb 26> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- xReturn = prvWriteMessageToBuffer (pxStreamBuffer, pvTxData, xDataLengthBytes, xSpace, xRequiredSpace);
- # DEBUG BEGIN_STMT
- if (xReturn != 0)
- goto <bb 27>; [INV]
- else
- goto <bb 31>; [INV]
- <bb 27> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _10 = prvBytesInBuffer (pxStreamBuffer);
- _11 = pxStreamBuffer->xTriggerLevelBytes;
- if (_10 >= _11)
- goto <bb 28>; [INV]
- else
- goto <bb 31>; [INV]
- <bb 28> :
- # DEBUG BEGIN_STMT
- vTaskSuspendAll ();
- # DEBUG BEGIN_STMT
- _12 = pxStreamBuffer->xTaskWaitingToReceive;
- if (_12 != 0B)
- goto <bb 29>; [INV]
- else
- goto <bb 30>; [INV]
- <bb 29> :
- # DEBUG BEGIN_STMT
- _13 = pxStreamBuffer->xTaskWaitingToReceive;
- xTaskGenericNotify (_13, 0, 0, 0, 0B);
- # DEBUG BEGIN_STMT
- pxStreamBuffer->xTaskWaitingToReceive = 0B;
- <bb 30> :
- # DEBUG BEGIN_STMT
- xTaskResumeAll ();
- # DEBUG BEGIN_STMT
- <bb 31> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- D.6425 = xReturn;
- xTimeOut = {CLOBBER};
- return D.6425;
- }
- xStreamBufferBytesAvailable (struct StreamBufferDef_t * xStreamBuffer)
- {
- size_t xReturn;
- const struct StreamBuffer_t * const pxStreamBuffer;
- size_t D.6383;
- <bb 2> :
- # DEBUG BEGIN_STMT
- pxStreamBuffer = xStreamBuffer;
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (pxStreamBuffer == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- xReturn = prvBytesInBuffer (pxStreamBuffer);
- # DEBUG BEGIN_STMT
- D.6383 = xReturn;
- return D.6383;
- }
- xStreamBufferSpacesAvailable (struct StreamBufferDef_t * xStreamBuffer)
- {
- size_t xOriginalTail;
- size_t xSpace;
- const struct StreamBuffer_t * const pxStreamBuffer;
- size_t D.6379;
- unsigned int D.6375;
- <bb 2> :
- # DEBUG BEGIN_STMT
- pxStreamBuffer = xStreamBuffer;
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (pxStreamBuffer == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- xOriginalTail = pxStreamBuffer->xTail;
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->xLength;
- _2 = pxStreamBuffer->xTail;
- xSpace = _1 + _2;
- # DEBUG BEGIN_STMT
- D.6375 = pxStreamBuffer->xHead;
- xSpace = xSpace - D.6375;
- # DEBUG BEGIN_STMT
- _3 = pxStreamBuffer->xTail;
- if (xOriginalTail != _3)
- goto <bb 5>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- xSpace = xSpace + 4294967295;
- # DEBUG BEGIN_STMT
- _4 = pxStreamBuffer->xLength;
- if (xSpace >= _4)
- goto <bb 7>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 7> :
- # DEBUG BEGIN_STMT
- _5 = pxStreamBuffer->xLength;
- xSpace = xSpace - _5;
- <bb 8> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- D.6379 = xSpace;
- return D.6379;
- }
- xStreamBufferSetTriggerLevel (struct StreamBufferDef_t * xStreamBuffer, size_t xTriggerLevel)
- {
- BaseType_t xReturn;
- struct StreamBuffer_t * const pxStreamBuffer;
- BaseType_t D.6371;
- <bb 2> :
- # DEBUG BEGIN_STMT
- pxStreamBuffer = xStreamBuffer;
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (pxStreamBuffer == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (xTriggerLevel == 0)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- xTriggerLevel = 1;
- <bb 7> :
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->xLength;
- if (xTriggerLevel < _1)
- goto <bb 8>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 8> :
- # DEBUG BEGIN_STMT
- pxStreamBuffer->xTriggerLevelBytes = xTriggerLevel;
- # DEBUG BEGIN_STMT
- xReturn = 1;
- goto <bb 10>; [INV]
- <bb 9> :
- # DEBUG BEGIN_STMT
- xReturn = 0;
- <bb 10> :
- # DEBUG BEGIN_STMT
- D.6371 = xReturn;
- return D.6371;
- }
- xStreamBufferReset (struct StreamBufferDef_t * xStreamBuffer)
- {
- UBaseType_t uxStreamBufferNumber;
- BaseType_t xReturn;
- struct StreamBuffer_t * const pxStreamBuffer;
- BaseType_t D.6362;
- <bb 2> :
- # DEBUG BEGIN_STMT
- pxStreamBuffer = xStreamBuffer;
- # DEBUG BEGIN_STMT
- xReturn = 0;
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (pxStreamBuffer == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- uxStreamBufferNumber = pxStreamBuffer->uxStreamBufferNumber;
- # DEBUG BEGIN_STMT
- vPortEnterCritical ();
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->xTaskWaitingToReceive;
- if (_1 == 0B)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- _2 = pxStreamBuffer->xTaskWaitingToSend;
- if (_2 == 0B)
- goto <bb 7>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 7> :
- # DEBUG BEGIN_STMT
- _3 = pxStreamBuffer->pucBuffer;
- _4 = pxStreamBuffer->xLength;
- _5 = pxStreamBuffer->xTriggerLevelBytes;
- _6 = pxStreamBuffer->ucFlags;
- prvInitialiseNewStreamBuffer (pxStreamBuffer, _3, _4, _5, _6);
- # DEBUG BEGIN_STMT
- xReturn = 1;
- # DEBUG BEGIN_STMT
- pxStreamBuffer->uxStreamBufferNumber = uxStreamBufferNumber;
- <bb 8> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- vPortExitCritical ();
- # DEBUG BEGIN_STMT
- D.6362 = xReturn;
- return D.6362;
- }
- vStreamBufferDelete (struct StreamBufferDef_t * xStreamBuffer)
- {
- struct StreamBuffer_t * pxStreamBuffer;
- <bb 2> :
- # DEBUG BEGIN_STMT
- pxStreamBuffer = xStreamBuffer;
- # DEBUG BEGIN_STMT
- if (pxStreamBuffer == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 4> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 4>; [INV]
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- _1 = pxStreamBuffer->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 2;
- if (_3 == 0)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- vPortFree (pxStreamBuffer);
- goto <bb 8>; [INV]
- <bb 7> :
- # DEBUG BEGIN_STMT
- memset (pxStreamBuffer, 0, 36);
- <bb 8> :
- return;
- }
- xStreamBufferGenericCreate (size_t xBufferSizeBytes, size_t xTriggerLevelBytes, BaseType_t xIsMessageBuffer)
- {
- uint8_t ucFlags;
- uint8_t * pucAllocatedMemory;
- struct StreamBufferDef_t * D.6347;
- <bb 2> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (xIsMessageBuffer == 1)
- goto <bb 3>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 3> :
- # DEBUG BEGIN_STMT
- ucFlags = 1;
- # DEBUG BEGIN_STMT
- if (xBufferSizeBytes <= 4)
- goto <bb 4>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 4> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 5> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 5>; [INV]
- <bb 6> :
- # DEBUG BEGIN_STMT
- ucFlags = 0;
- # DEBUG BEGIN_STMT
- if (xBufferSizeBytes == 0)
- goto <bb 7>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 7> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 8> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 8>; [INV]
- <bb 9> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (xTriggerLevelBytes > xBufferSizeBytes)
- goto <bb 10>; [INV]
- else
- goto <bb 12>; [INV]
- <bb 10> :
- # DEBUG BEGIN_STMT
- vPortRaiseBASEPRI ();
- <bb 11> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- goto <bb 11>; [INV]
- <bb 12> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- if (xTriggerLevelBytes == 0)
- goto <bb 13>; [INV]
- else
- goto <bb 14>; [INV]
- <bb 13> :
- # DEBUG BEGIN_STMT
- xTriggerLevelBytes = 1;
- <bb 14> :
- # DEBUG BEGIN_STMT
- if (xBufferSizeBytes <= 4294967258)
- goto <bb 15>; [INV]
- else
- goto <bb 16>; [INV]
- <bb 15> :
- # DEBUG BEGIN_STMT
- xBufferSizeBytes = xBufferSizeBytes + 1;
- # DEBUG BEGIN_STMT
- _1 = xBufferSizeBytes + 36;
- pucAllocatedMemory = pvPortMalloc (_1);
- goto <bb 17>; [INV]
- <bb 16> :
- # DEBUG BEGIN_STMT
- pucAllocatedMemory = 0B;
- <bb 17> :
- # DEBUG BEGIN_STMT
- if (pucAllocatedMemory != 0B)
- goto <bb 18>; [INV]
- else
- goto <bb 19>; [INV]
- <bb 18> :
- # DEBUG BEGIN_STMT
- _2 = pucAllocatedMemory + 36;
- prvInitialiseNewStreamBuffer (pucAllocatedMemory, _2, xBufferSizeBytes, xTriggerLevelBytes, ucFlags);
- # DEBUG BEGIN_STMT
- <bb 19> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- D.6347 = pucAllocatedMemory;
- return D.6347;
- }
- __attribute__((always_inline))
- vPortSetBASEPRI (uint32_t ulNewMaskValue)
- {
- <bb 2> :
- # DEBUG BEGIN_STMT
- __asm__ __volatile__(" msr basepri, %0 " : : "r" ulNewMaskValue : "memory");
- return;
- }
- __attribute__((always_inline))
- ulPortRaiseBASEPRI ()
- {
- uint32_t ulNewBASEPRI;
- uint32_t ulOriginalBASEPRI;
- uint32_t D.6469;
- <bb 2> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- __asm__ __volatile__(" mrs %0, basepri
- mov %1, %2
- msr basepri, %1
- isb
- dsb
- " : "=r" ulOriginalBASEPRI, "=r" ulNewBASEPRI : "i" 16 : "memory");
- # DEBUG BEGIN_STMT
- D.6469 = ulOriginalBASEPRI;
- return D.6469;
- }
- __attribute__((always_inline))
- vPortRaiseBASEPRI ()
- {
- uint32_t ulNewBASEPRI;
- <bb 2> :
- # DEBUG BEGIN_STMT
- # DEBUG BEGIN_STMT
- __asm__ __volatile__(" mov %0, %1
- msr basepri, %0
- isb
- dsb
- " : "=r" ulNewBASEPRI : "i" 16 : "memory");
- return;
- }
|