TianoCore EDK2 master
Loading...
Searching...
No Matches
AmlStream.h
Go to the documentation of this file.
1
9#ifndef AML_STREAM_H_
10#define AML_STREAM_H_
11
12#include <AmlInclude.h>
13
18typedef enum EAmlStreamDirection {
26
32typedef struct AmlStream {
34 UINT8 *Buffer;
35
38
44 UINT32 Index;
45
61
69#define IS_STREAM(Stream) ( \
70 (((AML_STREAM*)Stream) != NULL) && \
71 (((AML_STREAM*)Stream)->Buffer != NULL))
72
80#define IS_END_OF_STREAM(Stream) ( \
81 (((AML_STREAM*)Stream)->Index == \
82 ((AML_STREAM*)Stream)->MaxBufferSize))
83
91#define IS_STREAM_FORWARD(Stream) ( \
92 ((AML_STREAM*)Stream)->Direction == EAmlStreamDirectionForward)
93
101#define IS_STREAM_BACKWARD(Stream) ( \
102 ((AML_STREAM*)Stream)->Direction == EAmlStreamDirectionBackward)
103
117EFIAPI
119 IN OUT AML_STREAM *Stream,
120 IN UINT8 *Buffer,
121 IN UINT32 MaxBufferSize,
122 IN EAML_STREAM_DIRECTION Direction
123 );
124
137EFIAPI
139 IN CONST AML_STREAM *Stream,
140 OUT AML_STREAM *ClonedStream
141 );
142
168EFIAPI
170 IN CONST AML_STREAM *Stream,
171 OUT AML_STREAM *SubStream
172 );
173
181UINT8 *
182EFIAPI
184 IN CONST AML_STREAM *Stream
185 );
186
194UINT32
195EFIAPI
197 IN CONST AML_STREAM *Stream
198 );
199
210EFIAPI
212 IN AML_STREAM *Stream,
213 IN UINT32 Diff
214 );
215
229UINT32
230EFIAPI
232 IN CONST AML_STREAM *Stream
233 );
234
243EFIAPI
245 IN CONST AML_STREAM *Stream
246 );
247
255UINT8 *
256EFIAPI
258 IN CONST AML_STREAM *Stream
259 );
260
268UINT32
269EFIAPI
271 IN CONST AML_STREAM *Stream
272 );
273
288EFIAPI
290 IN AML_STREAM *Stream,
291 IN UINT32 Offset
292 );
293
307EFIAPI
309 IN AML_STREAM *Stream,
310 IN UINT32 Offset
311 );
312
321EFIAPI
323 IN AML_STREAM *Stream
324 );
325
340EFIAPI
342 IN AML_STREAM *Stream,
343 OUT UINT8 *OutByte
344 );
345
360EFIAPI
362 IN AML_STREAM *Stream,
363 OUT UINT8 *OutByte
364 );
365
389EFIAPI
391 IN AML_STREAM *Stream,
392 IN CONST UINT8 *Buffer,
393 IN UINT32 Size
394 );
395
416BOOLEAN
417EFIAPI
419 IN CONST AML_STREAM *Stream1,
420 IN CONST AML_STREAM *Stream2,
421 IN UINT32 Size
422 );
423
443EFIAPI
445 OUT CHAR8 *DstBuffer,
446 IN UINT32 MaxDstBufferSize,
447 IN AML_STREAM *Stream,
448 IN UINT32 Size
449 );
450
451#endif // AML_STREAM_H_
EFI_STATUS EFIAPI AmlStreamReset(IN AML_STREAM *Stream)
Definition: AmlStream.c:392
UINT32 EFIAPI AmlStreamGetMaxBufferSize(IN CONST AML_STREAM *Stream)
Definition: AmlStream.c:167
enum EAmlStreamDirection EAML_STREAM_DIRECTION
UINT32 EFIAPI AmlStreamGetIndex(IN CONST AML_STREAM *Stream)
Definition: AmlStream.c:222
EFI_STATUS EFIAPI AmlStreamReadByte(IN AML_STREAM *Stream, OUT UINT8 *OutByte)
Definition: AmlStream.c:461
EAML_STREAM_DIRECTION EFIAPI AmlStreamGetDirection(IN CONST AML_STREAM *Stream)
Definition: AmlStream.c:243
EFI_STATUS EFIAPI AmlStreamPeekByte(IN AML_STREAM *Stream, OUT UINT8 *OutByte)
Definition: AmlStream.c:421
EAmlStreamDirection
Definition: AmlStream.h:18
@ EAmlStreamDirectionForward
Definition: AmlStream.h:20
@ EAmlStreamDirectionBackward
Definition: AmlStream.h:22
@ EAmlStreamDirectionMax
Max enum.
Definition: AmlStream.h:24
@ EAmlStreamDirectionInvalid
Invalid AML Stream direction.
Definition: AmlStream.h:19
UINT32 EFIAPI AmlStreamGetFreeSpace(IN CONST AML_STREAM *Stream)
Definition: AmlStream.c:292
EFI_STATUS EFIAPI AmlStreamCpyS(OUT CHAR8 *DstBuffer, IN UINT32 MaxDstBufferSize, IN AML_STREAM *Stream, IN UINT32 Size)
Definition: AmlStream.c:650
EFI_STATUS EFIAPI AmlStreamRewind(IN AML_STREAM *Stream, IN UINT32 Offset)
Definition: AmlStream.c:361
EFI_STATUS EFIAPI AmlStreamProgress(IN AML_STREAM *Stream, IN UINT32 Offset)
Definition: AmlStream.c:324
EFI_STATUS EFIAPI AmlStreamClone(IN CONST AML_STREAM *Stream, OUT AML_STREAM *ClonedStream)
Definition: AmlStream.c:63
EFI_STATUS EFIAPI AmlStreamWrite(IN AML_STREAM *Stream, IN CONST UINT8 *Buffer, IN UINT32 Size)
Definition: AmlStream.c:512
UINT8 *EFIAPI AmlStreamGetCurrPos(IN CONST AML_STREAM *Stream)
Definition: AmlStream.c:264
UINT8 *EFIAPI AmlStreamGetBuffer(IN CONST AML_STREAM *Stream)
Definition: AmlStream.c:146
EFI_STATUS EFIAPI AmlStreamReduceMaxBufferSize(IN AML_STREAM *Stream, IN UINT32 Diff)
Definition: AmlStream.c:190
EFI_STATUS EFIAPI AmlStreamInitSubStream(IN CONST AML_STREAM *Stream, OUT AML_STREAM *SubStream)
Definition: AmlStream.c:109
BOOLEAN EFIAPI AmlStreamCmp(IN CONST AML_STREAM *Stream1, IN CONST AML_STREAM *Stream2, IN UINT32 Size)
Definition: AmlStream.c:569
struct AmlStream AML_STREAM
EFI_STATUS EFIAPI AmlStreamInit(IN OUT AML_STREAM *Stream, IN UINT8 *Buffer, IN UINT32 MaxBufferSize, IN EAML_STREAM_DIRECTION Direction)
Definition: AmlStream.c:25
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
EAML_STREAM_DIRECTION Direction
Definition: AmlStream.h:59
UINT8 * Buffer
Pointer to a buffer.
Definition: AmlStream.h:34
UINT32 MaxBufferSize
Size of Buffer.
Definition: AmlStream.h:37
UINT32 Index
Definition: AmlStream.h:44