12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694 |
- ucStreamBufferGetStreamBufferType (struct StreamBufferDef_t * xStreamBuffer)
- {
- uint8_t D.6587;
- unsigned char _1;
- uint8_t _4;
- <bb 2> :
- _1 = xStreamBuffer_3(D)->ucFlags;
- _4 = _1 & 1;
- <bb 3> :
- <L0>:
- return _4;
- }
- vStreamBufferSetStreamBufferNumber (struct StreamBufferDef_t * xStreamBuffer, UBaseType_t uxStreamBufferNumber)
- {
- <bb 2> :
- xStreamBuffer_2(D)->uxStreamBufferNumber = uxStreamBufferNumber_3(D);
- return;
- }
- uxStreamBufferGetStreamBufferNumber (struct StreamBufferDef_t * xStreamBuffer)
- {
- UBaseType_t D.6585;
- UBaseType_t _3;
- <bb 2> :
- _3 = xStreamBuffer_2(D)->uxStreamBufferNumber;
- <bb 3> :
- <L0>:
- return _3;
- }
- prvInitialiseNewStreamBuffer (struct StreamBuffer_t * const pxStreamBuffer, uint8_t * const pucBuffer, size_t xBufferSizeBytes, size_t xTriggerLevelBytes, uint8_t ucFlags)
- {
- const BaseType_t xWriteValue;
- void * _1;
- <bb 2> :
- xWriteValue_2 = 85;
- _1 = memset (pucBuffer_4(D), xWriteValue_2, xBufferSizeBytes_5(D));
- if (pucBuffer_4(D) != _1)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- memset (pxStreamBuffer_7(D), 0, 36);
- pxStreamBuffer_7(D)->pucBuffer = pucBuffer_4(D);
- pxStreamBuffer_7(D)->xLength = xBufferSizeBytes_5(D);
- pxStreamBuffer_7(D)->xTriggerLevelBytes = xTriggerLevelBytes_11(D);
- pxStreamBuffer_7(D)->ucFlags = ucFlags_13(D);
- return;
- }
- prvBytesInBuffer (const struct StreamBuffer_t * const pxStreamBuffer)
- {
- size_t xCount;
- size_t D.6581;
- unsigned int D.6577;
- unsigned int _1;
- unsigned int _2;
- unsigned int _3;
- unsigned int _4;
- unsigned int _9;
- size_t _12;
- <bb 2> :
- _1 = pxStreamBuffer_7(D)->xLength;
- _2 ={v} pxStreamBuffer_7(D)->xHead;
- xCount_8 = _1 + _2;
- _9 ={v} pxStreamBuffer_7(D)->xTail;
- xCount_10 = xCount_8 - _9;
- _3 = pxStreamBuffer_7(D)->xLength;
- if (xCount_10 >= _3)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- _4 = pxStreamBuffer_7(D)->xLength;
- xCount_11 = xCount_10 - _4;
- <bb 4> :
- # xCount_5 = PHI <xCount_10(2), xCount_11(3)>
- _12 = xCount_5;
- <bb 5> :
- <L3>:
- return _12;
- }
- prvReadBytesFromBuffer (struct StreamBuffer_t * pxStreamBuffer, uint8_t * pucData, size_t xCount, size_t xTail)
- {
- size_t xFirstLength;
- size_t D.6575;
- unsigned int _1;
- unsigned int _2;
- unsigned int _3;
- unsigned int _4;
- uint8_t * _5;
- uint8_t * _6;
- uint8_t * _7;
- uint8_t * _8;
- unsigned int _9;
- unsigned int _10;
- unsigned int _11;
- size_t _24;
- <bb 2> :
- if (xCount_14(D) == 0)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- _1 = pxStreamBuffer_16(D)->xLength;
- _2 = _1 - xTail_17(D);
- xFirstLength_18 = MIN_EXPR <xCount_14(D), _2>;
- if (xFirstLength_18 > xCount_14(D))
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 6> :
- vPortRaiseBASEPRI ();
- <bb 7> :
- goto <bb 7>; [INV]
- <bb 8> :
- _3 = xTail_17(D) + xFirstLength_18;
- _4 = pxStreamBuffer_16(D)->xLength;
- if (_3 > _4)
- goto <bb 9>; [INV]
- else
- goto <bb 11>; [INV]
- <bb 9> :
- vPortRaiseBASEPRI ();
- <bb 10> :
- goto <bb 10>; [INV]
- <bb 11> :
- _5 = pxStreamBuffer_16(D)->pucBuffer;
- _6 = _5 + xTail_17(D);
- memcpy (pucData_19(D), _6, xFirstLength_18);
- if (xCount_14(D) > xFirstLength_18)
- goto <bb 12>; [INV]
- else
- goto <bb 13>; [INV]
- <bb 12> :
- _7 = pucData_19(D) + xFirstLength_18;
- _8 = pxStreamBuffer_16(D)->pucBuffer;
- _9 = xCount_14(D) - xFirstLength_18;
- memcpy (_7, _8, _9);
- <bb 13> :
- xTail_22 = xTail_17(D) + xCount_14(D);
- _10 = pxStreamBuffer_16(D)->xLength;
- if (xTail_22 >= _10)
- goto <bb 14>; [INV]
- else
- goto <bb 15>; [INV]
- <bb 14> :
- _11 = pxStreamBuffer_16(D)->xLength;
- xTail_23 = xTail_22 - _11;
- <bb 15> :
- # xTail_12 = PHI <xTail_22(13), xTail_23(14)>
- _24 = xTail_12;
- <bb 16> :
- <L14>:
- return _24;
- }
- prvWriteBytesToBuffer (struct StreamBuffer_t * const pxStreamBuffer, const uint8_t * pucData, size_t xCount, size_t xHead)
- {
- size_t xFirstLength;
- size_t D.6562;
- unsigned int _1;
- unsigned int _2;
- unsigned int _3;
- unsigned int _4;
- uint8_t * _5;
- uint8_t * _6;
- unsigned int _7;
- unsigned int _8;
- uint8_t * _9;
- const uint8_t * _10;
- unsigned int _11;
- unsigned int _12;
- unsigned int _13;
- size_t _27;
- <bb 2> :
- if (xCount_16(D) == 0)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- _1 = pxStreamBuffer_18(D)->xLength;
- _2 = _1 - xHead_19(D);
- xFirstLength_20 = MIN_EXPR <xCount_16(D), _2>;
- _3 = xHead_19(D) + xFirstLength_20;
- _4 = pxStreamBuffer_18(D)->xLength;
- if (_3 > _4)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 6> :
- vPortRaiseBASEPRI ();
- <bb 7> :
- goto <bb 7>; [INV]
- <bb 8> :
- _5 = pxStreamBuffer_18(D)->pucBuffer;
- _6 = _5 + xHead_19(D);
- memcpy (_6, pucData_21(D), xFirstLength_20);
- if (xCount_16(D) > xFirstLength_20)
- goto <bb 9>; [INV]
- else
- goto <bb 13>; [INV]
- <bb 9> :
- _7 = xCount_16(D) - xFirstLength_20;
- _8 = pxStreamBuffer_18(D)->xLength;
- if (_7 > _8)
- goto <bb 10>; [INV]
- else
- goto <bb 12>; [INV]
- <bb 10> :
- vPortRaiseBASEPRI ();
- <bb 11> :
- goto <bb 11>; [INV]
- <bb 12> :
- _9 = pxStreamBuffer_18(D)->pucBuffer;
- _10 = pucData_21(D) + xFirstLength_20;
- _11 = xCount_16(D) - xFirstLength_20;
- memcpy (_9, _10, _11);
- <bb 13> :
- xHead_25 = xHead_19(D) + xCount_16(D);
- _12 = pxStreamBuffer_18(D)->xLength;
- if (xHead_25 >= _12)
- goto <bb 14>; [INV]
- else
- goto <bb 15>; [INV]
- <bb 14> :
- _13 = pxStreamBuffer_18(D)->xLength;
- xHead_26 = xHead_25 - _13;
- <bb 15> :
- # xHead_14 = PHI <xHead_25(13), xHead_26(14)>
- _27 = xHead_14;
- <bb 16> :
- <L15>:
- return _27;
- }
- xStreamBufferReceiveCompletedFromISR (struct StreamBufferDef_t * xStreamBuffer, BaseType_t * pxHigherPriorityTaskWoken)
- {
- UBaseType_t uxSavedInterruptStatus;
- BaseType_t xReturn;
- struct StreamBuffer_t * const pxStreamBuffer;
- BaseType_t D.6548;
- struct tskTaskControlBlock * _1;
- struct tskTaskControlBlock * _2;
- BaseType_t _16;
- <bb 2> :
- pxStreamBuffer_6 = xStreamBuffer_5(D);
- if (pxStreamBuffer_6 == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- uxSavedInterruptStatus_9 = ulPortRaiseBASEPRI ();
- _1 ={v} pxStreamBuffer_6->xTaskWaitingToSend;
- if (_1 != 0B)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- _2 ={v} pxStreamBuffer_6->xTaskWaitingToSend;
- xTaskGenericNotifyFromISR (_2, 0, 0, 0, 0B, pxHigherPriorityTaskWoken_11(D));
- pxStreamBuffer_6->xTaskWaitingToSend ={v} 0B;
- xReturn_14 = 1;
- goto <bb 8>; [INV]
- <bb 7> :
- xReturn_10 = 0;
- <bb 8> :
- # xReturn_3 = PHI <xReturn_14(6), xReturn_10(7)>
- vPortSetBASEPRI (uxSavedInterruptStatus_9);
- _16 = xReturn_3;
- <bb 9> :
- <L6>:
- return _16;
- }
- xStreamBufferSendCompletedFromISR (struct StreamBufferDef_t * xStreamBuffer, BaseType_t * pxHigherPriorityTaskWoken)
- {
- UBaseType_t uxSavedInterruptStatus;
- BaseType_t xReturn;
- struct StreamBuffer_t * const pxStreamBuffer;
- BaseType_t D.6541;
- struct tskTaskControlBlock * _1;
- struct tskTaskControlBlock * _2;
- BaseType_t _16;
- <bb 2> :
- pxStreamBuffer_6 = xStreamBuffer_5(D);
- if (pxStreamBuffer_6 == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- uxSavedInterruptStatus_9 = ulPortRaiseBASEPRI ();
- _1 ={v} pxStreamBuffer_6->xTaskWaitingToReceive;
- if (_1 != 0B)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- _2 ={v} pxStreamBuffer_6->xTaskWaitingToReceive;
- xTaskGenericNotifyFromISR (_2, 0, 0, 0, 0B, pxHigherPriorityTaskWoken_11(D));
- pxStreamBuffer_6->xTaskWaitingToReceive ={v} 0B;
- xReturn_14 = 1;
- goto <bb 8>; [INV]
- <bb 7> :
- xReturn_10 = 0;
- <bb 8> :
- # xReturn_3 = PHI <xReturn_14(6), xReturn_10(7)>
- vPortSetBASEPRI (uxSavedInterruptStatus_9);
- _16 = xReturn_3;
- <bb 9> :
- <L6>:
- return _16;
- }
- xStreamBufferIsFull (struct StreamBufferDef_t * xStreamBuffer)
- {
- const struct StreamBuffer_t * const pxStreamBuffer;
- size_t xBytesToStoreMessageLength;
- BaseType_t xReturn;
- BaseType_t D.6534;
- unsigned char _1;
- int _2;
- int _3;
- unsigned int _4;
- BaseType_t _15;
- <bb 2> :
- pxStreamBuffer_8 = xStreamBuffer_7(D);
- if (pxStreamBuffer_8 == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- _1 = pxStreamBuffer_8->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 1;
- if (_3 != 0)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- xBytesToStoreMessageLength_11 = 4;
- goto <bb 8>; [INV]
- <bb 7> :
- xBytesToStoreMessageLength_10 = 0;
- <bb 8> :
- # xBytesToStoreMessageLength_6 = PHI <xBytesToStoreMessageLength_11(6), xBytesToStoreMessageLength_10(7)>
- _4 = xStreamBufferSpacesAvailable (xStreamBuffer_7(D));
- if (xBytesToStoreMessageLength_6 >= _4)
- goto <bb 9>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 9> :
- xReturn_14 = 1;
- goto <bb 11>; [INV]
- <bb 10> :
- xReturn_13 = 0;
- <bb 11> :
- # xReturn_5 = PHI <xReturn_14(9), xReturn_13(10)>
- _15 = xReturn_5;
- <bb 12> :
- <L9>:
- return _15;
- }
- xStreamBufferIsEmpty (struct StreamBufferDef_t * xStreamBuffer)
- {
- size_t xTail;
- BaseType_t xReturn;
- const struct StreamBuffer_t * const pxStreamBuffer;
- BaseType_t D.6524;
- unsigned int _1;
- BaseType_t _9;
- <bb 2> :
- pxStreamBuffer_4 = xStreamBuffer_3(D);
- if (pxStreamBuffer_4 == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- xTail_6 ={v} pxStreamBuffer_4->xTail;
- _1 ={v} pxStreamBuffer_4->xHead;
- if (xTail_6 == _1)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- xReturn_8 = 1;
- goto <bb 8>; [INV]
- <bb 7> :
- xReturn_7 = 0;
- <bb 8> :
- # xReturn_2 = PHI <xReturn_8(6), xReturn_7(7)>
- _9 = xReturn_2;
- <bb 9> :
- <L6>:
- return _9;
- }
- 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.6516;
- unsigned char _1;
- int _2;
- int _3;
- unsigned int _4;
- size_t _25;
- <bb 2> :
- xNextTail_12 ={v} pxStreamBuffer_11(D)->xTail;
- _1 = pxStreamBuffer_11(D)->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 1;
- if (_3 != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- xNextTail_17 = prvReadBytesFromBuffer (pxStreamBuffer_11(D), &xTempNextMessageLength, 4, xNextTail_12);
- xNextMessageLength_18 = xTempNextMessageLength;
- xBytesAvailable_19 = xBytesAvailable_15(D) + 4294967292;
- if (xNextMessageLength_18 > xBufferLengthBytes_13(D))
- goto <bb 4>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 4> :
- xNextMessageLength_20 = 0;
- goto <bb 6>; [INV]
- <bb 5> :
- xNextMessageLength_14 = xBufferLengthBytes_13(D);
- <bb 6> :
- # xBytesAvailable_5 = PHI <xBytesAvailable_19(4), xBytesAvailable_15(D)(5), xBytesAvailable_19(3)>
- # xNextMessageLength_6 = PHI <xNextMessageLength_20(4), xNextMessageLength_14(5), xNextMessageLength_18(3)>
- # xNextTail_7 = PHI <xNextTail_17(4), xNextTail_12(5), xNextTail_17(3)>
- xCount_21 = MIN_EXPR <xBytesAvailable_5, xNextMessageLength_6>;
- if (xCount_21 != 0)
- goto <bb 7>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 7> :
- _4 = prvReadBytesFromBuffer (pxStreamBuffer_11(D), pvRxData_22(D), xCount_21, xNextTail_7);
- pxStreamBuffer_11(D)->xTail ={v} _4;
- <bb 8> :
- _25 = xCount_21;
- xTempNextMessageLength ={v} {CLOBBER};
- <bb 9> :
- <L9>:
- return _25;
- }
- 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.6506;
- unsigned char _1;
- int _2;
- int _3;
- struct tskTaskControlBlock * _4;
- struct tskTaskControlBlock * _5;
- size_t _28;
- <bb 2> :
- pxStreamBuffer_11 = xStreamBuffer_10(D);
- xReceivedLength_12 = 0;
- if (pvRxData_13(D) == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- if (pxStreamBuffer_11 == 0B)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 6> :
- vPortRaiseBASEPRI ();
- <bb 7> :
- goto <bb 7>; [INV]
- <bb 8> :
- _1 = pxStreamBuffer_11->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 1;
- if (_3 != 0)
- goto <bb 9>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 9> :
- xBytesToStoreMessageLength_16 = 4;
- goto <bb 11>; [INV]
- <bb 10> :
- xBytesToStoreMessageLength_15 = 0;
- <bb 11> :
- # xBytesToStoreMessageLength_7 = PHI <xBytesToStoreMessageLength_16(9), xBytesToStoreMessageLength_15(10)>
- xBytesAvailable_18 = prvBytesInBuffer (pxStreamBuffer_11);
- if (xBytesAvailable_18 > xBytesToStoreMessageLength_7)
- goto <bb 12>; [INV]
- else
- goto <bb 16>; [INV]
- <bb 12> :
- xReceivedLength_21 = prvReadMessageFromBuffer (pxStreamBuffer_11, pvRxData_13(D), xBufferLengthBytes_19(D), xBytesAvailable_18);
- if (xReceivedLength_21 != 0)
- goto <bb 13>; [INV]
- else
- goto <bb 16>; [INV]
- <bb 13> :
- uxSavedInterruptStatus_23 = ulPortRaiseBASEPRI ();
- _4 ={v} pxStreamBuffer_11->xTaskWaitingToSend;
- if (_4 != 0B)
- goto <bb 14>; [INV]
- else
- goto <bb 15>; [INV]
- <bb 14> :
- _5 ={v} pxStreamBuffer_11->xTaskWaitingToSend;
- xTaskGenericNotifyFromISR (_5, 0, 0, 0, 0B, pxHigherPriorityTaskWoken_24(D));
- pxStreamBuffer_11->xTaskWaitingToSend ={v} 0B;
- <bb 15> :
- vPortSetBASEPRI (uxSavedInterruptStatus_23);
- <bb 16> :
- # xReceivedLength_6 = PHI <xReceivedLength_12(11), xReceivedLength_21(15), xReceivedLength_21(12)>
- _28 = xReceivedLength_6;
- <bb 17> :
- <L17>:
- return _28;
- }
- xStreamBufferNextMessageLengthBytes (struct StreamBufferDef_t * xStreamBuffer)
- {
- size_t xTempReturn;
- size_t xBytesAvailable;
- size_t xReturn;
- struct StreamBuffer_t * const pxStreamBuffer;
- size_t D.6488;
- unsigned char _1;
- int _2;
- int _3;
- unsigned int _4;
- size_t _17;
- <bb 2> :
- pxStreamBuffer_8 = xStreamBuffer_7(D);
- if (pxStreamBuffer_8 == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- _1 = pxStreamBuffer_8->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 1;
- if (_3 != 0)
- goto <bb 6>; [INV]
- else
- goto <bb 12>; [INV]
- <bb 6> :
- xBytesAvailable_12 = prvBytesInBuffer (pxStreamBuffer_8);
- if (xBytesAvailable_12 > 4)
- goto <bb 7>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 7> :
- _4 ={v} pxStreamBuffer_8->xTail;
- prvReadBytesFromBuffer (pxStreamBuffer_8, &xTempReturn, 4, _4);
- xReturn_16 = xTempReturn;
- goto <bb 13>; [INV]
- <bb 8> :
- if (xBytesAvailable_12 != 0)
- goto <bb 9>; [INV]
- else
- goto <bb 11>; [INV]
- <bb 9> :
- vPortRaiseBASEPRI ();
- <bb 10> :
- goto <bb 10>; [INV]
- <bb 11> :
- xReturn_13 = 0;
- goto <bb 13>; [INV]
- <bb 12> :
- xReturn_10 = 0;
- <bb 13> :
- # xReturn_5 = PHI <xReturn_13(11), xReturn_10(12), xReturn_16(7)>
- _17 = xReturn_5;
- xTempReturn ={v} {CLOBBER};
- <bb 14> :
- <L13>:
- return _17;
- }
- 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.6476;
- unsigned char _1;
- int _2;
- int _3;
- struct tskTaskControlBlock * _4;
- struct tskTaskControlBlock * _5;
- struct tskTaskControlBlock * _6;
- struct tskTaskControlBlock * _7;
- size_t _44;
- <bb 2> :
- pxStreamBuffer_16 = xStreamBuffer_15(D);
- xReceivedLength_17 = 0;
- if (pvRxData_18(D) == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- if (pxStreamBuffer_16 == 0B)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 6> :
- vPortRaiseBASEPRI ();
- <bb 7> :
- goto <bb 7>; [INV]
- <bb 8> :
- _1 = pxStreamBuffer_16->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 1;
- if (_3 != 0)
- goto <bb 9>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 9> :
- xBytesToStoreMessageLength_21 = 4;
- goto <bb 11>; [INV]
- <bb 10> :
- xBytesToStoreMessageLength_20 = 0;
- <bb 11> :
- # xBytesToStoreMessageLength_10 = PHI <xBytesToStoreMessageLength_21(9), xBytesToStoreMessageLength_20(10)>
- if (xTicksToWait_22(D) != 0)
- goto <bb 12>; [INV]
- else
- goto <bb 19>; [INV]
- <bb 12> :
- vPortEnterCritical ();
- xBytesAvailable_27 = prvBytesInBuffer (pxStreamBuffer_16);
- if (xBytesAvailable_27 <= xBytesToStoreMessageLength_10)
- goto <bb 13>; [INV]
- else
- goto <bb 17>; [INV]
- <bb 13> :
- xTaskGenericNotifyStateClear (0B, 0);
- _4 ={v} pxStreamBuffer_16->xTaskWaitingToReceive;
- if (_4 != 0B)
- goto <bb 14>; [INV]
- else
- goto <bb 16>; [INV]
- <bb 14> :
- vPortRaiseBASEPRI ();
- <bb 15> :
- goto <bb 15>; [INV]
- <bb 16> :
- _5 = xTaskGetCurrentTaskHandle ();
- pxStreamBuffer_16->xTaskWaitingToReceive ={v} _5;
- <bb 17> :
- vPortExitCritical ();
- if (xBytesAvailable_27 <= xBytesToStoreMessageLength_10)
- goto <bb 18>; [INV]
- else
- goto <bb 20>; [INV]
- <bb 18> :
- xTaskGenericNotifyWait (0, 0, 0, 0B, xTicksToWait_22(D));
- pxStreamBuffer_16->xTaskWaitingToReceive ={v} 0B;
- xBytesAvailable_36 = prvBytesInBuffer (pxStreamBuffer_16);
- goto <bb 20>; [INV]
- <bb 19> :
- xBytesAvailable_24 = prvBytesInBuffer (pxStreamBuffer_16);
- <bb 20> :
- # xBytesAvailable_9 = PHI <xBytesAvailable_36(18), xBytesAvailable_24(19), xBytesAvailable_27(17)>
- if (xBytesAvailable_9 > xBytesToStoreMessageLength_10)
- goto <bb 21>; [INV]
- else
- goto <bb 25>; [INV]
- <bb 21> :
- xReceivedLength_39 = prvReadMessageFromBuffer (pxStreamBuffer_16, pvRxData_18(D), xBufferLengthBytes_37(D), xBytesAvailable_9);
- if (xReceivedLength_39 != 0)
- goto <bb 22>; [INV]
- else
- goto <bb 25>; [INV]
- <bb 22> :
- vTaskSuspendAll ();
- _6 ={v} pxStreamBuffer_16->xTaskWaitingToSend;
- if (_6 != 0B)
- goto <bb 23>; [INV]
- else
- goto <bb 24>; [INV]
- <bb 23> :
- _7 ={v} pxStreamBuffer_16->xTaskWaitingToSend;
- xTaskGenericNotify (_7, 0, 0, 0, 0B);
- pxStreamBuffer_16->xTaskWaitingToSend ={v} 0B;
- <bb 24> :
- xTaskResumeAll ();
- <bb 25> :
- # xReceivedLength_8 = PHI <xReceivedLength_17(20), xReceivedLength_39(24), xReceivedLength_39(21)>
- _44 = xReceivedLength_8;
- <bb 26> :
- <L29>:
- return _44;
- }
- prvWriteMessageToBuffer (struct StreamBuffer_t * const pxStreamBuffer, const void * pvTxData, size_t xDataLengthBytes, size_t xSpace, size_t xRequiredSpace)
- {
- size_t xNextHead;
- size_t D.6448;
- unsigned char _1;
- int _2;
- int _3;
- unsigned int xDataLengthBytes.2_4;
- unsigned int _5;
- unsigned int xDataLengthBytes.3_6;
- unsigned int xDataLengthBytes.4_7;
- unsigned int _8;
- size_t _24;
- <bb 2> :
- xNextHead_14 ={v} pxStreamBuffer_13(D)->xHead;
- _1 = pxStreamBuffer_13(D)->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 1;
- if (_3 != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 3> :
- if (xSpace_15(D) >= xRequiredSpace_17(D))
- goto <bb 4>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 4> :
- xNextHead_20 = prvWriteBytesToBuffer (pxStreamBuffer_13(D), &xDataLengthBytes, 4, xNextHead_14);
- goto <bb 7>; [INV]
- <bb 5> :
- xDataLengthBytes = 0;
- goto <bb 7>; [INV]
- <bb 6> :
- xDataLengthBytes.2_4 = xDataLengthBytes;
- _5 = MIN_EXPR <xSpace_15(D), xDataLengthBytes.2_4>;
- xDataLengthBytes = _5;
- <bb 7> :
- # xNextHead_9 = PHI <xNextHead_14(5), xNextHead_14(6), xNextHead_20(4)>
- xDataLengthBytes.3_6 = xDataLengthBytes;
- if (xDataLengthBytes.3_6 != 0)
- goto <bb 8>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 8> :
- xDataLengthBytes.4_7 = xDataLengthBytes;
- _8 = prvWriteBytesToBuffer (pxStreamBuffer_13(D), pvTxData_21(D), xDataLengthBytes.4_7, xNextHead_9);
- pxStreamBuffer_13(D)->xHead ={v} _8;
- <bb 9> :
- _24 = xDataLengthBytes;
- <bb 10> :
- <L8>:
- return _24;
- }
- 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.6436;
- unsigned char _1;
- int _2;
- int _3;
- unsigned int _4;
- unsigned int _5;
- struct tskTaskControlBlock * _6;
- struct tskTaskControlBlock * _7;
- size_t _29;
- <bb 2> :
- pxStreamBuffer_12 = xStreamBuffer_11(D);
- xRequiredSpace_14 = xDataLengthBytes_13(D);
- if (pvTxData_15(D) == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- if (pxStreamBuffer_12 == 0B)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 6> :
- vPortRaiseBASEPRI ();
- <bb 7> :
- goto <bb 7>; [INV]
- <bb 8> :
- _1 = pxStreamBuffer_12->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 1;
- if (_3 != 0)
- goto <bb 9>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 9> :
- xRequiredSpace_17 = xRequiredSpace_14 + 4;
- <bb 10> :
- # xRequiredSpace_8 = PHI <xRequiredSpace_14(8), xRequiredSpace_17(9)>
- xSpace_19 = xStreamBufferSpacesAvailable (pxStreamBuffer_12);
- xReturn_21 = prvWriteMessageToBuffer (pxStreamBuffer_12, pvTxData_15(D), xDataLengthBytes_13(D), xSpace_19, xRequiredSpace_8);
- if (xReturn_21 != 0)
- goto <bb 11>; [INV]
- else
- goto <bb 15>; [INV]
- <bb 11> :
- _4 = prvBytesInBuffer (pxStreamBuffer_12);
- _5 = pxStreamBuffer_12->xTriggerLevelBytes;
- if (_4 >= _5)
- goto <bb 12>; [INV]
- else
- goto <bb 15>; [INV]
- <bb 12> :
- uxSavedInterruptStatus_24 = ulPortRaiseBASEPRI ();
- _6 ={v} pxStreamBuffer_12->xTaskWaitingToReceive;
- if (_6 != 0B)
- goto <bb 13>; [INV]
- else
- goto <bb 14>; [INV]
- <bb 13> :
- _7 ={v} pxStreamBuffer_12->xTaskWaitingToReceive;
- xTaskGenericNotifyFromISR (_7, 0, 0, 0, 0B, pxHigherPriorityTaskWoken_25(D));
- pxStreamBuffer_12->xTaskWaitingToReceive ={v} 0B;
- <bb 14> :
- vPortSetBASEPRI (uxSavedInterruptStatus_24);
- <bb 15> :
- _29 = xReturn_21;
- <bb 16> :
- <L17>:
- return _29;
- }
- 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.6418;
- unsigned int _1;
- unsigned char _2;
- int _3;
- int _4;
- long unsigned int xTicksToWait.0_5;
- struct tskTaskControlBlock * _6;
- struct tskTaskControlBlock * _7;
- long unsigned int xTicksToWait.1_8;
- long int _9;
- unsigned int _10;
- unsigned int _11;
- struct tskTaskControlBlock * _12;
- struct tskTaskControlBlock * _13;
- size_t _59;
- <bb 2> :
- pxStreamBuffer_25 = xStreamBuffer_24(D);
- xSpace_26 = 0;
- xRequiredSpace_28 = xDataLengthBytes_27(D);
- xMaxReportedSpace_29 = 0;
- if (pvTxData_30(D) == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- if (pxStreamBuffer_25 == 0B)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 6> :
- vPortRaiseBASEPRI ();
- <bb 7> :
- goto <bb 7>; [INV]
- <bb 8> :
- _1 = pxStreamBuffer_25->xLength;
- xMaxReportedSpace_32 = _1 + 4294967295;
- _2 = pxStreamBuffer_25->ucFlags;
- _3 = (int) _2;
- _4 = _3 & 1;
- if (_4 != 0)
- goto <bb 9>; [INV]
- else
- goto <bb 14>; [INV]
- <bb 9> :
- xRequiredSpace_34 = xRequiredSpace_28 + 4;
- if (xRequiredSpace_34 <= xDataLengthBytes_27(D))
- goto <bb 10>; [INV]
- else
- goto <bb 12>; [INV]
- <bb 10> :
- vPortRaiseBASEPRI ();
- <bb 11> :
- goto <bb 11>; [INV]
- <bb 12> :
- if (xRequiredSpace_34 > xMaxReportedSpace_32)
- goto <bb 13>; [INV]
- else
- goto <bb 16>; [INV]
- <bb 13> :
- xTicksToWait = 0;
- goto <bb 16>; [INV]
- <bb 14> :
- if (xRequiredSpace_28 > xMaxReportedSpace_32)
- goto <bb 15>; [INV]
- else
- goto <bb 16>; [INV]
- <bb 15> :
- xRequiredSpace_33 = xMaxReportedSpace_32;
- <bb 16> :
- # xRequiredSpace_16 = PHI <xRequiredSpace_34(13), xRequiredSpace_28(14), xRequiredSpace_33(15), xRequiredSpace_34(12)>
- xTicksToWait.0_5 = xTicksToWait;
- if (xTicksToWait.0_5 != 0)
- goto <bb 17>; [INV]
- else
- goto <bb 26>; [INV]
- <bb 17> :
- vTaskSetTimeOutState (&xTimeOut);
- <bb 18> :
- vPortEnterCritical ();
- xSpace_40 = xStreamBufferSpacesAvailable (pxStreamBuffer_25);
- if (xSpace_40 < xRequiredSpace_16)
- goto <bb 19>; [INV]
- else
- goto <bb 23>; [INV]
- <bb 19> :
- xTaskGenericNotifyStateClear (0B, 0);
- _6 ={v} pxStreamBuffer_25->xTaskWaitingToSend;
- if (_6 != 0B)
- goto <bb 20>; [INV]
- else
- goto <bb 22>; [INV]
- <bb 20> :
- vPortRaiseBASEPRI ();
- <bb 21> :
- goto <bb 21>; [INV]
- <bb 22> :
- _7 = xTaskGetCurrentTaskHandle ();
- pxStreamBuffer_25->xTaskWaitingToSend ={v} _7;
- goto <bb 24>; [INV]
- <bb 23> :
- vPortExitCritical ();
- goto <bb 25>; [INV]
- <bb 24> :
- vPortExitCritical ();
- xTicksToWait.1_8 = xTicksToWait;
- xTaskGenericNotifyWait (0, 0, 0, 0B, xTicksToWait.1_8);
- pxStreamBuffer_25->xTaskWaitingToSend ={v} 0B;
- _9 = xTaskCheckForTimeOut (&xTimeOut, &xTicksToWait);
- if (_9 == 0)
- goto <bb 18>; [INV]
- else
- goto <bb 25>; [INV]
- <bb 25> :
- <bb 26> :
- # xSpace_14 = PHI <xSpace_26(16), xSpace_40(25)>
- if (xSpace_14 == 0)
- goto <bb 27>; [INV]
- else
- goto <bb 28>; [INV]
- <bb 27> :
- xSpace_51 = xStreamBufferSpacesAvailable (pxStreamBuffer_25);
- <bb 28> :
- # xSpace_15 = PHI <xSpace_14(26), xSpace_51(27)>
- xReturn_53 = prvWriteMessageToBuffer (pxStreamBuffer_25, pvTxData_30(D), xDataLengthBytes_27(D), xSpace_15, xRequiredSpace_16);
- if (xReturn_53 != 0)
- goto <bb 29>; [INV]
- else
- goto <bb 33>; [INV]
- <bb 29> :
- _10 = prvBytesInBuffer (pxStreamBuffer_25);
- _11 = pxStreamBuffer_25->xTriggerLevelBytes;
- if (_10 >= _11)
- goto <bb 30>; [INV]
- else
- goto <bb 33>; [INV]
- <bb 30> :
- vTaskSuspendAll ();
- _12 ={v} pxStreamBuffer_25->xTaskWaitingToReceive;
- if (_12 != 0B)
- goto <bb 31>; [INV]
- else
- goto <bb 32>; [INV]
- <bb 31> :
- _13 ={v} pxStreamBuffer_25->xTaskWaitingToReceive;
- xTaskGenericNotify (_13, 0, 0, 0, 0B);
- pxStreamBuffer_25->xTaskWaitingToReceive ={v} 0B;
- <bb 32> :
- xTaskResumeAll ();
- <bb 33> :
- _59 = xReturn_53;
- xTimeOut ={v} {CLOBBER};
- <bb 34> :
- <L41>:
- return _59;
- }
- xStreamBufferBytesAvailable (struct StreamBufferDef_t * xStreamBuffer)
- {
- size_t xReturn;
- const struct StreamBuffer_t * const pxStreamBuffer;
- size_t D.6382;
- size_t _6;
- <bb 2> :
- pxStreamBuffer_2 = xStreamBuffer_1(D);
- if (pxStreamBuffer_2 == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- xReturn_5 = prvBytesInBuffer (pxStreamBuffer_2);
- _6 = xReturn_5;
- <bb 6> :
- <L3>:
- return _6;
- }
- xStreamBufferSpacesAvailable (struct StreamBufferDef_t * xStreamBuffer)
- {
- size_t xOriginalTail;
- size_t xSpace;
- const struct StreamBuffer_t * const pxStreamBuffer;
- size_t D.6378;
- unsigned int D.6374;
- unsigned int _1;
- unsigned int _2;
- unsigned int _3;
- unsigned int _4;
- unsigned int _5;
- unsigned int _12;
- size_t _16;
- <bb 2> :
- pxStreamBuffer_8 = xStreamBuffer_7(D);
- if (pxStreamBuffer_8 == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- xOriginalTail_10 ={v} pxStreamBuffer_8->xTail;
- _1 = pxStreamBuffer_8->xLength;
- _2 ={v} pxStreamBuffer_8->xTail;
- xSpace_11 = _1 + _2;
- _12 ={v} pxStreamBuffer_8->xHead;
- xSpace_13 = xSpace_11 - _12;
- _3 ={v} pxStreamBuffer_8->xTail;
- if (xOriginalTail_10 != _3)
- goto <bb 5>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 6> :
- xSpace_14 = xSpace_13 + 4294967295;
- _4 = pxStreamBuffer_8->xLength;
- if (xSpace_14 >= _4)
- goto <bb 7>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 7> :
- _5 = pxStreamBuffer_8->xLength;
- xSpace_15 = xSpace_14 - _5;
- <bb 8> :
- # xSpace_6 = PHI <xSpace_14(6), xSpace_15(7)>
- _16 = xSpace_6;
- <bb 9> :
- <L8>:
- return _16;
- }
- xStreamBufferSetTriggerLevel (struct StreamBufferDef_t * xStreamBuffer, size_t xTriggerLevel)
- {
- BaseType_t xReturn;
- struct StreamBuffer_t * const pxStreamBuffer;
- BaseType_t D.6370;
- unsigned int _1;
- BaseType_t _13;
- <bb 2> :
- pxStreamBuffer_6 = xStreamBuffer_5(D);
- if (pxStreamBuffer_6 == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- if (xTriggerLevel_7(D) == 0)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- xTriggerLevel_8 = 1;
- <bb 7> :
- # xTriggerLevel_2 = PHI <xTriggerLevel_7(D)(5), xTriggerLevel_8(6)>
- _1 = pxStreamBuffer_6->xLength;
- if (xTriggerLevel_2 < _1)
- goto <bb 8>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 8> :
- pxStreamBuffer_6->xTriggerLevelBytes = xTriggerLevel_2;
- xReturn_12 = 1;
- goto <bb 10>; [INV]
- <bb 9> :
- xReturn_10 = 0;
- <bb 10> :
- # xReturn_3 = PHI <xReturn_12(8), xReturn_10(9)>
- _13 = xReturn_3;
- <bb 11> :
- <L8>:
- return _13;
- }
- xStreamBufferReset (struct StreamBufferDef_t * xStreamBuffer)
- {
- UBaseType_t uxStreamBufferNumber;
- BaseType_t xReturn;
- struct StreamBuffer_t * const pxStreamBuffer;
- BaseType_t D.6361;
- struct tskTaskControlBlock * _1;
- struct tskTaskControlBlock * _2;
- uint8_t * _3;
- unsigned int _4;
- unsigned int _5;
- unsigned char _6;
- BaseType_t _19;
- <bb 2> :
- pxStreamBuffer_10 = xStreamBuffer_9(D);
- xReturn_11 = 0;
- if (pxStreamBuffer_10 == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- uxStreamBufferNumber_13 = pxStreamBuffer_10->uxStreamBufferNumber;
- vPortEnterCritical ();
- _1 ={v} pxStreamBuffer_10->xTaskWaitingToReceive;
- if (_1 == 0B)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 6> :
- _2 ={v} pxStreamBuffer_10->xTaskWaitingToSend;
- if (_2 == 0B)
- goto <bb 7>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 7> :
- _3 = pxStreamBuffer_10->pucBuffer;
- _4 = pxStreamBuffer_10->xLength;
- _5 = pxStreamBuffer_10->xTriggerLevelBytes;
- _6 = pxStreamBuffer_10->ucFlags;
- prvInitialiseNewStreamBuffer (pxStreamBuffer_10, _3, _4, _5, _6);
- xReturn_16 = 1;
- pxStreamBuffer_10->uxStreamBufferNumber = uxStreamBufferNumber_13;
- <bb 8> :
- # xReturn_7 = PHI <xReturn_11(5), xReturn_11(6), xReturn_16(7)>
- vPortExitCritical ();
- _19 = xReturn_7;
- <bb 9> :
- <L7>:
- return _19;
- }
- vStreamBufferDelete (struct StreamBufferDef_t * xStreamBuffer)
- {
- struct StreamBuffer_t * pxStreamBuffer;
- unsigned char _1;
- int _2;
- int _3;
- <bb 2> :
- pxStreamBuffer_6 = xStreamBuffer_5(D);
- if (pxStreamBuffer_6 == 0B)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 3> :
- vPortRaiseBASEPRI ();
- <bb 4> :
- goto <bb 4>; [INV]
- <bb 5> :
- _1 = pxStreamBuffer_6->ucFlags;
- _2 = (int) _1;
- _3 = _2 & 2;
- if (_3 == 0)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- vPortFree (pxStreamBuffer_6);
- goto <bb 8>; [INV]
- <bb 7> :
- memset (pxStreamBuffer_6, 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.6348;
- unsigned int _1;
- uint8_t * _2;
- struct StreamBufferDef_t * _23;
- <bb 2> :
- if (xIsMessageBuffer_9(D) == 1)
- goto <bb 3>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 3> :
- ucFlags_14 = 1;
- if (xBufferSizeBytes_11(D) <= 4)
- goto <bb 4>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 4> :
- vPortRaiseBASEPRI ();
- <bb 5> :
- goto <bb 5>; [INV]
- <bb 6> :
- ucFlags_10 = 0;
- if (xBufferSizeBytes_11(D) == 0)
- goto <bb 7>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 7> :
- vPortRaiseBASEPRI ();
- <bb 8> :
- goto <bb 8>; [INV]
- <bb 9> :
- # ucFlags_6 = PHI <ucFlags_14(3), ucFlags_10(6)>
- if (xTriggerLevelBytes_16(D) > xBufferSizeBytes_11(D))
- goto <bb 10>; [INV]
- else
- goto <bb 12>; [INV]
- <bb 10> :
- vPortRaiseBASEPRI ();
- <bb 11> :
- goto <bb 11>; [INV]
- <bb 12> :
- if (xTriggerLevelBytes_16(D) == 0)
- goto <bb 13>; [INV]
- else
- goto <bb 14>; [INV]
- <bb 13> :
- xTriggerLevelBytes_17 = 1;
- <bb 14> :
- # xTriggerLevelBytes_4 = PHI <xTriggerLevelBytes_16(D)(12), xTriggerLevelBytes_17(13)>
- if (xBufferSizeBytes_11(D) <= 4294967258)
- goto <bb 15>; [INV]
- else
- goto <bb 16>; [INV]
- <bb 15> :
- xBufferSizeBytes_19 = xBufferSizeBytes_11(D) + 1;
- _1 = xBufferSizeBytes_19 + 36;
- pucAllocatedMemory_21 = pvPortMalloc (_1);
- goto <bb 17>; [INV]
- <bb 16> :
- pucAllocatedMemory_18 = 0B;
- <bb 17> :
- # xBufferSizeBytes_3 = PHI <xBufferSizeBytes_19(15), xBufferSizeBytes_11(D)(16)>
- # pucAllocatedMemory_5 = PHI <pucAllocatedMemory_21(15), pucAllocatedMemory_18(16)>
- if (pucAllocatedMemory_5 != 0B)
- goto <bb 18>; [INV]
- else
- goto <bb 19>; [INV]
- <bb 18> :
- _2 = pucAllocatedMemory_5 + 36;
- prvInitialiseNewStreamBuffer (pucAllocatedMemory_5, _2, xBufferSizeBytes_3, xTriggerLevelBytes_4, ucFlags_6);
- <bb 19> :
- _23 = pucAllocatedMemory_5;
- <bb 20> :
- <L20>:
- return _23;
- }
- __attribute__((always_inline))
- vPortSetBASEPRI (uint32_t ulNewMaskValue)
- {
- <bb 2> :
- __asm__ __volatile__(" msr basepri, %0 " : : "r" ulNewMaskValue_2(D) : "memory");
- return;
- }
- __attribute__((always_inline))
- ulPortRaiseBASEPRI ()
- {
- uint32_t ulNewBASEPRI;
- uint32_t ulOriginalBASEPRI;
- uint32_t D.6438;
- uint32_t _5;
- <bb 2> :
- __asm__ __volatile__(" mrs %0, basepri
- mov %1, %2
- msr basepri, %1
- isb
- dsb
- " : "=r" ulOriginalBASEPRI_3, "=r" ulNewBASEPRI_4 : "i" 16 : "memory");
- _5 = ulOriginalBASEPRI_3;
- <bb 3> :
- <L0>:
- return _5;
- }
- __attribute__((always_inline))
- vPortRaiseBASEPRI ()
- {
- uint32_t ulNewBASEPRI;
- <bb 2> :
- __asm__ __volatile__(" mov %0, %1
- msr basepri, %0
- isb
- dsb
- " : "=r" ulNewBASEPRI_3 : "i" 16 : "memory");
- return;
- }
|