14#include <Library/HardwareInfoLib.h>
29 if (DataSize ==
NULL) {
37QemuFwCfgReadNextHardwareInfoByType (
38 IN HARDWARE_INFO_TYPE Type,
49 (ReadIndex ==
NULL) ||
51 (Type == HardwareInfoTypeUndefined) ||
54 return EFI_INVALID_PARAMETER;
57 UpdateDataSize (DataSize, 0);
59 while (*ReadIndex < TotalFileSize) {
61 *ReadIndex +=
sizeof (Header);
63 if ((Header.Size > MAX_UINTN) || (((UINT64)*ReadIndex + Header.Size) > TotalFileSize)) {
64 *ReadIndex = TotalFileSize;
68 if ((Header.Type.Value == Type) && (Header.Size <= TypeSize)) {
71 *ReadIndex += (
UINTN)Header.Size;
72 UpdateDataSize (DataSize, (
UINTN)Header.Size);
84 *ReadIndex += (
UINTN)Header.Size;
87 return EFI_END_OF_FILE;
VOID EFIAPI QemuFwCfgReadBytes(IN UINTN Size, IN VOID *Buffer OPTIONAL)
VOID EFIAPI QemuFwCfgSkipBytes(IN UINTN Size)