};\r
\r
\r
+\r
/**\r
\r
Get the full size of SMBIOS structure including optional strings that follow the formatted structure.\r
//\r
SmbiosProtocol = &mPrivateData.Smbios;\r
\r
- PreAllocatedPages = EFI_SIZE_TO_PAGES (EntryPointStructure->TableLength);\r
+ if (EntryPointStructure->TableAddress == 0) {\r
+ PreAllocatedPages = 0;\r
+ } else {\r
+ PreAllocatedPages = EFI_SIZE_TO_PAGES (EntryPointStructure->TableLength);\r
+ }\r
\r
//\r
// Make some statistics about all the structures\r
&PhysicalAddress\r
);\r
if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "SmbiosCreateTable() could not allocate SMBIOS table < 4GB\n"));\r
+ EntryPointStructure->TableAddress = 0;\r
return EFI_OUT_OF_RESOURCES;\r
+ } else {\r
+ EntryPointStructure->TableAddress = (UINT32) PhysicalAddress;\r
}\r
- EntryPointStructure->TableAddress = (UINT32) PhysicalAddress;\r
}\r
\r
//\r
&PhysicalAddress\r
);\r
if (EFI_ERROR (Status)) {\r
- return EFI_OUT_OF_RESOURCES;\r
+ DEBUG ((EFI_D_ERROR, "SmbiosDriverEntryPoint() could not allocate EntryPointStructure < 4GB\n"));\r
+ Status = gBS->AllocatePages (\r
+ AllocateAnyPages,\r
+ EfiReservedMemoryType,\r
+ EFI_SIZE_TO_PAGES (sizeof (SMBIOS_TABLE_ENTRY_POINT)),\r
+ &PhysicalAddress\r
+ );\r
+ if (EFI_ERROR (Status)) { \r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
}\r
\r
EntryPointStructure = (SMBIOS_TABLE_ENTRY_POINT *) (UINTN) PhysicalAddress;\r
&PhysicalAddress\r
);\r
if (EFI_ERROR (Status)) {\r
- FreePages ((VOID*) EntryPointStructure, EFI_SIZE_TO_PAGES (sizeof (SMBIOS_TABLE_ENTRY_POINT)));\r
- EntryPointStructure = NULL;\r
- return EFI_OUT_OF_RESOURCES;\r
+ DEBUG ((EFI_D_ERROR, "SmbiosDriverEntryPoint() could not allocate SMBIOS table < 4GB\n"));\r
+ EntryPointStructure->TableAddress = 0;\r
+ EntryPointStructure->TableLength = 0;\r
+ } else {\r
+ EntryPointStructure->TableAddress = (UINT32) PhysicalAddress;\r
+ EntryPointStructure->TableLength = EFI_PAGES_TO_SIZE (1);\r
}\r
-\r
- EntryPointStructure->TableAddress = (UINT32) PhysicalAddress;\r
- EntryPointStructure->TableLength = EFI_PAGES_TO_SIZE (1);\r
-\r
+ \r
//\r
// Make a new handle and install the protocol\r
//\r