28 IN UINT32 MaxBufferSize,
32 if ((Stream ==
NULL) ||
34 (MaxBufferSize == 0) ||
39 return EFI_INVALID_PARAMETER;
42 Stream->Buffer = Buffer;
43 Stream->MaxBufferSize = MaxBufferSize;
45 Stream->Direction = Direction;
69 (ClonedStream ==
NULL))
72 return EFI_INVALID_PARAMETER;
75 ClonedStream->Buffer = Stream->Buffer;
76 ClonedStream->MaxBufferSize = Stream->MaxBufferSize;
77 ClonedStream->Index = Stream->Index;
78 ClonedStream->Direction = Stream->Direction;
118 return EFI_INVALID_PARAMETER;
124 SubStream->Buffer = Stream->Buffer;
127 return EFI_INVALID_PARAMETER;
131 SubStream->Index = 0;
132 SubStream->Direction = Stream->Direction;
155 return Stream->Buffer;
176 return Stream->MaxBufferSize;
197 ((Stream->MaxBufferSize - Diff) <= Stream->Index))
200 return EFI_INVALID_PARAMETER;
203 Stream->MaxBufferSize -= Diff;
231 return Stream->Index;
252 return Stream->Direction;
274 return Stream->Buffer + Stream->Index;
276 return Stream->Buffer + (Stream->MaxBufferSize - 1) - Stream->Index;
301 if (Stream->Index > Stream->MaxBufferSize) {
306 return Stream->MaxBufferSize - Stream->Index;
334 return EFI_INVALID_PARAMETER;
339 return EFI_BUFFER_TOO_SMALL;
342 Stream->Index += Offset;
370 return EFI_INVALID_PARAMETER;
375 return EFI_BUFFER_TOO_SMALL;
378 Stream->Index -= Offset;
398 return EFI_INVALID_PARAMETER;
433 return EFI_INVALID_PARAMETER;
437 if (CurPos ==
NULL) {
439 return EFI_INVALID_PARAMETER;
473 return EFI_INVALID_PARAMETER;
478 if (EFI_ERROR (Status)) {
526 return EFI_INVALID_PARAMETER;
531 return EFI_BUFFER_TOO_SMALL;
541 CopyMem (CurrPos, Buffer, Size);
542 Stream->Index += Size;
576 UINT8 *CurrPosStream1;
577 UINT8 *CurrPosStream2;
583 (Stream1->Direction != Stream2->Direction) ||
596 if (MinSize < Size) {
602 if (CurrPosStream1 ==
NULL) {
608 if (CurrPosStream2 ==
NULL) {
614 return (0 ==
CompareMem (CurrPosStream1, CurrPosStream2, MinSize));
624 CurrPosStream1 - (MinSize - 1),
625 CurrPosStream2 - (MinSize - 1),
651 OUT CHAR8 *DstBuffer,
652 IN UINT32 MaxDstBufferSize,
657 CHAR8 *StreamBufferStart;
660 if ((DstBuffer ==
NULL) ||
661 (MaxDstBufferSize == 0) ||
662 (Size > MaxDstBufferSize) ||
666 return EFI_INVALID_PARAMETER;
678 CopyMem (DstBuffer, StreamBufferStart, Size);
EFI_STATUS EFIAPI AmlStreamReset(IN AML_STREAM *Stream)
UINT32 EFIAPI AmlStreamGetMaxBufferSize(IN CONST AML_STREAM *Stream)
UINT32 EFIAPI AmlStreamGetIndex(IN CONST AML_STREAM *Stream)
EFI_STATUS EFIAPI AmlStreamReadByte(IN AML_STREAM *Stream, OUT UINT8 *OutByte)
EAML_STREAM_DIRECTION EFIAPI AmlStreamGetDirection(IN CONST AML_STREAM *Stream)
EFI_STATUS EFIAPI AmlStreamPeekByte(IN AML_STREAM *Stream, OUT UINT8 *OutByte)
UINT32 EFIAPI AmlStreamGetFreeSpace(IN CONST AML_STREAM *Stream)
EFI_STATUS EFIAPI AmlStreamCpyS(OUT CHAR8 *DstBuffer, IN UINT32 MaxDstBufferSize, IN AML_STREAM *Stream, IN UINT32 Size)
EFI_STATUS EFIAPI AmlStreamRewind(IN AML_STREAM *Stream, IN UINT32 Offset)
EFI_STATUS EFIAPI AmlStreamProgress(IN AML_STREAM *Stream, IN UINT32 Offset)
EFI_STATUS EFIAPI AmlStreamClone(IN CONST AML_STREAM *Stream, OUT AML_STREAM *ClonedStream)
EFI_STATUS EFIAPI AmlStreamWrite(IN AML_STREAM *Stream, IN CONST UINT8 *Buffer, IN UINT32 Size)
UINT8 *EFIAPI AmlStreamGetCurrPos(IN CONST AML_STREAM *Stream)
UINT8 *EFIAPI AmlStreamGetBuffer(IN CONST AML_STREAM *Stream)
EFI_STATUS EFIAPI AmlStreamReduceMaxBufferSize(IN AML_STREAM *Stream, IN UINT32 Diff)
EFI_STATUS EFIAPI AmlStreamInitSubStream(IN CONST AML_STREAM *Stream, OUT AML_STREAM *SubStream)
BOOLEAN EFIAPI AmlStreamCmp(IN CONST AML_STREAM *Stream1, IN CONST AML_STREAM *Stream2, IN UINT32 Size)
EFI_STATUS EFIAPI AmlStreamInit(IN OUT AML_STREAM *Stream, IN UINT8 *Buffer, IN UINT32 MaxBufferSize, IN EAML_STREAM_DIRECTION Direction)
enum EAmlStreamDirection EAML_STREAM_DIRECTION
#define IS_STREAM_FORWARD(Stream)
@ EAmlStreamDirectionForward
@ EAmlStreamDirectionBackward
@ EAmlStreamDirectionInvalid
Invalid AML Stream direction.
#define IS_STREAM(Stream)
#define IS_STREAM_BACKWARD(Stream)
#define IS_END_OF_STREAM(Stream)
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
#define ASSERT_EFI_ERROR(StatusParameter)