}
else
{
- /* FIXME: @TODO: Not yet supported */
+ /* Switch to real mode */
+ BlpArchSwitchContext(BlRealMode);
+
+ /* Call EFI directly */
+ if (EfiConOut != NULL)
+ {
+ EfiConOut->OutputString(EfiConOut, BlScratchBuffer);
+ }
+
+ /* Switch back to protected mode */
+ BlpArchSwitchContext(BlProtectedMode);
}
/* All done */
{
BL_ARCH_MODE OldMode;
EFI_STATUS EfiStatus;
+ PHYSICAL_ADDRESS MemoryMapSizePhysical, MemoryMapPhysical, MapKeyPhysical;
+ PHYSICAL_ADDRESS DescriptorSizePhysical, DescriptorVersionPhysical;
/* Are we in protected mode? */
OldMode = CurrentExecutionContext->Mode;
if (OldMode != BlRealMode)
{
- /* FIXME: Not yet implemented */
- return STATUS_NOT_IMPLEMENTED;
+ /* Convert all of the addresses to physical */
+ BlMmTranslateVirtualAddress(MemoryMapSize, &MemoryMapSizePhysical);
+ MemoryMapSize = (UINTN*)MemoryMapSizePhysical.LowPart;
+ BlMmTranslateVirtualAddress(MemoryMap, &MemoryMapPhysical);
+ MemoryMap = (EFI_MEMORY_DESCRIPTOR*)MemoryMapPhysical.LowPart;
+ BlMmTranslateVirtualAddress(MapKey, &MapKeyPhysical);
+ MapKey = (UINTN*)MapKeyPhysical.LowPart;
+ BlMmTranslateVirtualAddress(DescriptorSize, &DescriptorSizePhysical);
+ DescriptorSize = (UINTN*)DescriptorSizePhysical.LowPart;
+ BlMmTranslateVirtualAddress(DescriptorVersion, &DescriptorVersionPhysical);
+ DescriptorVersion = (UINTN*)DescriptorVersionPhysical.LowPart;
+
+ /* Switch to real mode */
+ BlpArchSwitchContext(BlProtectedMode);
}
/* Make the EFI call */
Status = MmMdAddDescriptorToList(MemoryMap,
Descriptor,
BL_MM_ADD_DESCRIPTOR_TRUNCATE_FLAG |
- (Flags & BL_MM_FLAG_REQUEST_COALESCING) ?
- BL_MM_ADD_DESCRIPTOR_COALESCE_FLAG : 0);
+ ((Flags & BL_MM_FLAG_REQUEST_COALESCING) ?
+ BL_MM_ADD_DESCRIPTOR_COALESCE_FLAG : 0));
if (!NT_SUCCESS(Status))
{
EfiPrintf(L"Failed to add full descriptor: %lx\r\n", Status);
/* FIXME: Not supported */
Status = STATUS_NOT_SUPPORTED;
}
- else if (FirmwareData->Version >= 2)
+ else if (FirmwareData->Version >= BL_FIRMWARE_DESCRIPTOR_VERSION)
{
/* Version 2 -- save the data */
EfiFirmwareData = *FirmwareData;
return Status;
}
+NTSTATUS
+BlFwGetParameters (
+ _In_ PBL_FIRMWARE_DESCRIPTOR Parameters
+ )
+{
+ /* Make sure we got an argument */
+ if (!Parameters)
+ {
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ /* Copy the static data */
+ *Parameters = *EfiFirmwareParameters;
+ return STATUS_SUCCESS;
+}
+
NTSTATUS
BlFwEnumerateDevice (
_In_ PBL_DEVICE_DESCRIPTOR Device