}\r
\r
/**\r
- Get available system memory below 1MB by specified size.\r
+ Get available system memory below 0x88000 by specified size.\r
\r
@param[in] WakeupBufferSize Wakeup buffer size required\r
\r
EFI_STATUS Status;\r
EFI_PHYSICAL_ADDRESS StartAddress;\r
\r
- StartAddress = BASE_1MB;\r
+ //\r
+ // Try to allocate buffer below 1M for waking vector.\r
+ // LegacyBios driver only reports warning when page allocation in range\r
+ // [0x60000, 0x88000) fails.\r
+ // This library is consumed by CpuDxe driver to produce CPU Arch protocol.\r
+ // LagacyBios driver depends on CPU Arch protocol which guarantees below\r
+ // allocation runs earlier than LegacyBios driver.\r
+ //\r
+ StartAddress = 0x88000;\r
Status = gBS->AllocatePages (\r
AllocateMaxAddress,\r
EfiBootServicesData,\r
&StartAddress\r
);\r
ASSERT_EFI_ERROR (Status);\r
- if (!EFI_ERROR (Status)) {\r
- Status = gBS->FreePages(\r
- StartAddress,\r
- EFI_SIZE_TO_PAGES (WakeupBufferSize)\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
- DEBUG ((DEBUG_INFO, "WakeupBufferStart = %x, WakeupBufferSize = %x\n",\r
- (UINTN) StartAddress, WakeupBufferSize));\r
- } else {\r
+ if (EFI_ERROR (Status)) {\r
StartAddress = (EFI_PHYSICAL_ADDRESS) -1;\r
}\r
+\r
+ DEBUG ((DEBUG_INFO, "WakeupBufferStart = %x, WakeupBufferSize = %x\n",\r
+ (UINTN) StartAddress, WakeupBufferSize));\r
+\r
return (UINTN) StartAddress;\r
}\r
\r