Author: ion
Date: Mon Sep 7 23:31:08 2015
New Revision: 69103
URL:
http://svn.reactos.org/svn/reactos?rev=69103&view=rev
Log:
[BOOTMGFW]
- EarlyPrint -> EfiPrintf, as it seems BL actually has this after all :) Change all
callers to conform to it.
- Add common exit/failure path in BmMain. Now the fun begins.
Modified:
trunk/reactos/boot/environ/lib/bootlib.c
trunk/reactos/boot/environ/lib/firmware/efi/firmware.c
trunk/reactos/boot/environ/lib/io/display/display.c
trunk/reactos/boot/environ/lib/io/display/efi/gop.c
trunk/reactos/boot/environ/lib/io/display/efi/guicons.c
trunk/reactos/boot/environ/lib/io/display/efi/textcons.c
trunk/reactos/boot/environ/lib/io/display/efi/uga.c
trunk/reactos/boot/environ/lib/io/display/guicons.c
trunk/reactos/boot/environ/lib/io/display/textcons.c
trunk/reactos/boot/environ/lib/misc/util.c
trunk/reactos/boot/environ/lib/mm/descriptor.c
trunk/reactos/boot/environ/lib/mm/heapalloc.c
trunk/reactos/boot/environ/lib/mm/i386/mmx86.c
trunk/reactos/boot/environ/lib/mm/mm.c
trunk/reactos/boot/environ/lib/mm/pagealloc.c
trunk/reactos/boot/environ/lib/platform/time.c
Modified: trunk/reactos/boot/environ/lib/bootlib.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/bootlib.c…
==============================================================================
--- trunk/reactos/boot/environ/lib/bootlib.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/bootlib.c [iso-8859-1] Mon Sep 7 23:31:08 2015
@@ -23,28 +23,6 @@
LIST_ENTRY BlBadpListHead;
/* FUNCTIONS *****************************************************************/
-
-/* HACKKKYYY */
-EFI_SYSTEM_TABLE* g_SystemTable;
-
-VOID
-EarlyPrint(_In_ PWCHAR Format, ...)
-{
- WCHAR buffer[1024];
- va_list args;
-
- va_start(args, Format);
-
- vswprintf(buffer, Format, args);
-
- g_SystemTable->ConOut->OutputString(g_SystemTable->ConOut,
L"\r");
- g_SystemTable->ConOut->OutputString(g_SystemTable->ConOut, buffer);
-
- g_SystemTable->BootServices->Stall(200000);
-
- va_end(args);
-}
-/* END HACKKKYYY */
/*++
* @name InitializeLibrary
@@ -131,7 +109,7 @@
LibraryParameters);
if (!NT_SUCCESS(Status))
{
- EarlyPrint(L"MM init failed!\n");
+ EfiPrintf(L"MM init failed!\r\n");
goto Quickie;
}
@@ -141,7 +119,7 @@
{
/* Destroy memory manager in phase 1 */
//BlpMmDestroy(1);
- EarlyPrint(L"Firmware2 init failed!\n");
+ EfiPrintf(L"Firmware2 init failed!\r\n");
return Status;
}
@@ -163,7 +141,7 @@
if (!NT_SUCCESS(Status))
{
/* Destroy memory manager in phase 1 */
- EarlyPrint(L"TSC calibration failed\n");
+ EfiPrintf(L"TSC calibration failed\r\n");
//BlpMmDestroy(1);
return Status;
}
@@ -174,7 +152,7 @@
if (!NT_SUCCESS(Status))
{
/* Destroy memory manager in phase 1 */
- EarlyPrint(L"Arch2 init failed\n");
+ EfiPrintf(L"Arch2 init failed\r\n");
//BlpMmDestroy(1);
return Status;
}
@@ -195,7 +173,7 @@
if (!NT_SUCCESS(Status))
{
/* Destroy memory manager in phase 1 and the event manager */
- EarlyPrint(L"IO init failed\n");
+ EfiPrintf(L"IO init failed\r\n");
#ifdef BL_TPM_SUPPORT
if (EnSubsystemInitialized)
{
@@ -240,7 +218,7 @@
}
#endif
//BlpMmDestroy(1);
- EarlyPrint(L"Util init failed\n");
+ EfiPrintf(L"Util init failed\r\n");
return Status;
}
@@ -407,3 +385,11 @@
return Status;
}
+VOID
+BlDestroyLibrary (
+ VOID
+ )
+{
+ EfiPrintf(L"Destroy not yet implemented\r\n");
+ return;
+}
Modified: trunk/reactos/boot/environ/lib/firmware/efi/firmware.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/firmware/…
==============================================================================
--- trunk/reactos/boot/environ/lib/firmware/efi/firmware.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/firmware/efi/firmware.c [iso-8859-1] Mon Sep 7
23:31:08 2015
@@ -30,7 +30,37 @@
EFI_GUID EfiDevicePathProtocol = EFI_DEVICE_PATH_PROTOCOL_GUID;
EFI_GUID EfiSimpleTextInputExProtocol = EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID;
+WCHAR BlScratchBuffer[8192];
+
/* FUNCTIONS *****************************************************************/
+
+VOID
+EfiPrintf (
+ _In_ PWCHAR Format,
+ ...
+ )
+{
+ va_list args;
+ va_start(args, Format);
+
+ /* Capture the buffer in our scratch pad, and NULL-terminate */
+ vsnwprintf(BlScratchBuffer, RTL_NUMBER_OF(BlScratchBuffer) - 1, Format, args);
+ BlScratchBuffer[RTL_NUMBER_OF(BlScratchBuffer) - 1] = UNICODE_NULL;
+
+ /* Check which mode we're in */
+ if (CurrentExecutionContext->Mode == BlRealMode)
+ {
+ /* Call EFI directly */
+ EfiConOut->OutputString(EfiConOut, BlScratchBuffer);
+ }
+ else
+ {
+ /* FIXME: @TODO: Not yet supported */
+ }
+
+ /* All done */
+ va_end(args);
+}
NTSTATUS
EfiOpenProtocol (
@@ -589,7 +619,7 @@
if ((ModeChanged) && (NT_SUCCESS(Status)))
{
/* FIXME @TODO: Should be BlStatusPrint */
- EarlyPrint(L"Console video mode set to 0x%x\r\n", Mode);
+ EfiPrintf(L"Console video mode set to 0x%x\r\r\n", Mode);
}
/* Convert the error to an NTSTATUS */
@@ -668,6 +698,25 @@
/* Convert the error to an NTSTATUS */
return EfiGetNtStatusCode(EfiStatus);
+}
+
+VOID
+EfiResetSystem (
+ _In_ EFI_RESET_TYPE ResetType
+ )
+{
+ BL_ARCH_MODE OldMode;
+
+ /* Are we in protected mode? */
+ OldMode = CurrentExecutionContext->Mode;
+ if (OldMode != BlRealMode)
+ {
+ /* FIXME: Not yet implemented */
+ return;
+ }
+
+ /* Call the EFI runtime */
+ EfiRT->ResetSystem(ResetType, EFI_SUCCESS, 0, NULL);
}
NTSTATUS
@@ -868,7 +917,7 @@
if (Status != STATUS_BUFFER_TOO_SMALL)
{
/* This should've failed because our buffer was too small, nothing else */
- EarlyPrint(L"Got strange EFI status for memory map: %lx\n", Status);
+ EfiPrintf(L"Got strange EFI status for memory map: %lx\r\n", Status);
if (NT_SUCCESS(Status))
{
Status = STATUS_UNSUCCESSFUL;
@@ -879,7 +928,7 @@
/* Add 4 more descriptors just in case things changed */
EfiMemoryMapSize += (4 * DescriptorSize);
Pages = BYTES_TO_PAGES(EfiMemoryMapSize);
- EarlyPrint(L"Memory map size: %lx bytes, %d pages\n", EfiMemoryMapSize,
Pages);
+ EfiPrintf(L"Memory map size: %lx bytes, %d pages\r\n", EfiMemoryMapSize,
Pages);
/* Should we use EFI to grab memory? */
if (UseEfiBuffer)
@@ -893,7 +942,7 @@
&EfiBuffer);
if (!NT_SUCCESS(Status))
{
- EarlyPrint(L"EFI allocation failed: %lx\n", Status);
+ EfiPrintf(L"EFI allocation failed: %lx\r\n", Status);
goto Quickie;
}
@@ -953,7 +1002,7 @@
/* So far so good? */
if (!NT_SUCCESS(Status))
{
- EarlyPrint(L"Failed to get EFI memory map: %lx\n", Status);
+ EfiPrintf(L"Failed to get EFI memory map: %lx\r\n", Status);
goto Quickie;
}
@@ -961,7 +1010,7 @@
if (((EfiMemoryMapSize % DescriptorSize)) ||
(DescriptorSize < sizeof(EFI_MEMORY_DESCRIPTOR)))
{
- EarlyPrint(L"Incorrect descriptor size\n");
+ EfiPrintf(L"Incorrect descriptor size\r\n");
Status = STATUS_UNSUCCESSFUL;
goto Quickie;
}
@@ -971,7 +1020,7 @@
(BlpBootDevice->Local.Type == RamDiskDevice))
{
/* We don't handle this yet */
- EarlyPrint(L"RAM boot not supported\n");
+ EfiPrintf(L"RAM boot not supported\r\n");
Status = STATUS_NOT_IMPLEMENTED;
goto Quickie;
}
@@ -983,9 +1032,9 @@
/* Loop the EFI memory map */
#if 0
- EarlyPrint(L"UEFI MEMORY MAP\n\n");
- EarlyPrint(L"TYPE START END
ATTRIBUTES\n");
-
EarlyPrint(L"===============================================================\n");
+ EfiPrintf(L"UEFI MEMORY MAP\n\r\n");
+ EfiPrintf(L"TYPE START END
ATTRIBUTES\r\n");
+
EfiPrintf(L"===============================================================\r\n");
#endif
while (EfiMemoryMapSize != 0)
{
@@ -1026,7 +1075,7 @@
goto LoopAgain;
}
#if 0
- EarlyPrint(L"%08X 0x%016I64X-0x%016I64X 0x%I64X\n",
+ EfiPrintf(L"%08X 0x%016I64X-0x%016I64X 0x%I64X\r\n",
MemoryType,
StartPage << PAGE_SHIFT,
EndPage << PAGE_SHIFT,
@@ -1057,7 +1106,7 @@
BL_MM_ADD_DESCRIPTOR_TRUNCATE_FLAG);
if (!NT_SUCCESS(Status))
{
- EarlyPrint(L"Failed to add zero page descriptor: %lx\n",
Status);
+ EfiPrintf(L"Failed to add zero page descriptor: %lx\r\n",
Status);
break;
}
@@ -1098,7 +1147,7 @@
BL_MM_ADD_DESCRIPTOR_TRUNCATE_FLAG);
if (!NT_SUCCESS(Status))
{
- EarlyPrint(L"Failed to add 1MB descriptor: %lx\n",
Status);
+ EfiPrintf(L"Failed to add 1MB descriptor: %lx\r\n",
Status);
break;
}
@@ -1111,7 +1160,7 @@
if (HaveRamDisk)
{
/* We don't handle this yet */
- EarlyPrint(L"RAM boot not supported\n");
+ EfiPrintf(L"RAM boot not supported\r\n");
Status = STATUS_NOT_IMPLEMENTED;
goto Quickie;
}
@@ -1144,7 +1193,7 @@
BL_MM_ADD_DESCRIPTOR_COALESCE_FLAG : 0);
if (!NT_SUCCESS(Status))
{
- EarlyPrint(L"Failed to add full descriptor: %lx\n", Status);
+ EfiPrintf(L"Failed to add full descriptor: %lx\r\n", Status);
break;
}
Modified: trunk/reactos/boot/environ/lib/io/display/display.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/displa…
==============================================================================
--- trunk/reactos/boot/environ/lib/io/display/display.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/io/display/display.c [iso-8859-1] Mon Sep 7 23:31:08
2015
@@ -43,7 +43,7 @@
VOID
)
{
- //EarlyPrint(L"Disabling graphics\n");
+ //EarlyPrint(L"Disabling graphics\r\n");
return FALSE;
}
@@ -75,7 +75,7 @@
/* Display re-initialization not yet handled */
if (LibraryParameters.LibraryFlags & BL_LIBRARY_FLAG_REINITIALIZE_ALL)
{
- EarlyPrint(L"Display path not handled\n");
+ EfiPrintf(L"Display path not handled\r\n");
return STATUS_NOT_SUPPORTED;
}
@@ -111,7 +111,7 @@
if (NT_SUCCESS(Status))
{
ConsoleGraphicalResolutionListFlags |=
BL_DISPLAY_GRAPHICS_FORCED_VIDEO_MODE_FLAG;
- EarlyPrint(L"Display selection not yet handled\n");
+ EfiPrintf(L"Display selection not yet handled\r\n");
return STATUS_NOT_IMPLEMENTED;
}
@@ -127,7 +127,7 @@
if (NT_SUCCESS(Status))
{
ConsoleGraphicalResolutionListFlags |=
BL_DISPLAY_GRAPHICS_FORCED_HIGH_RES_MODE_FLAG;
- EarlyPrint(L"High res mode not yet handled\n");
+ EfiPrintf(L"High res mode not yet handled\r\n");
return STATUS_NOT_IMPLEMENTED;
}
@@ -142,7 +142,7 @@
Status = ConsoleGraphicalConstruct(GraphicsConsole);
if (!NT_SUCCESS(Status))
{
- EarlyPrint(L"GFX FAILED: %lx\n", Status);
+ EfiPrintf(L"GFX FAILED: %lx\r\n", Status);
BlMmFreeHeap(GraphicsConsole);
GraphicsConsole = NULL;
}
@@ -157,7 +157,7 @@
/* Are we using something else than the default mode? */
if (DisplayMode != &ConsoleGraphicalResolutionList[0])
{
- EarlyPrint(L"Display path not handled\n");
+ EfiPrintf(L"Display path not handled\r\n");
return STATUS_NOT_SUPPORTED;
}
@@ -217,7 +217,7 @@
}
/* We have a remote console -- have to figure out how to use it*/
- EarlyPrint(L"Display path not handled\n");
+ EfiPrintf(L"Display path not handled\r\n");
return STATUS_NOT_SUPPORTED;
}
@@ -273,7 +273,7 @@
if (DspGraphicalConsole)
{
/* Yep -- query it */
- EarlyPrint(L"Not supported\n");
+ EfiPrintf(L"Not supported\r\n");
Status = STATUS_NOT_IMPLEMENTED;
}
}
Modified: trunk/reactos/boot/environ/lib/io/display/efi/gop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/displa…
==============================================================================
--- trunk/reactos/boot/environ/lib/io/display/efi/gop.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/io/display/efi/gop.c [iso-8859-1] Mon Sep 7 23:31:08
2015
@@ -212,7 +212,7 @@
(PVOID*)&GopProtocol);
if (!NT_SUCCESS(Status))
{
- EarlyPrint(L"GOP OPEN failed: %lx\n", Status);
+ EfiPrintf(L"GOP OPEN failed: %lx\r\n", Status);
return STATUS_NOT_SUPPORTED;
}
@@ -220,7 +220,7 @@
Status = EfiGopGetCurrentMode(GopProtocol, &CurrentMode, &ModeInformation);
if (!NT_SUCCESS(Status))
{
- EarlyPrint(L"GOP mode failed: %lx\n", Status);
+ EfiPrintf(L"GOP mode failed: %lx\r\n", Status);
goto Quickie;
}
@@ -273,7 +273,7 @@
Quickie:
/* We failed, close the protocol and return the failure code */
- EarlyPrint(L"Get format failed: %lx\n", Status);
+ EfiPrintf(L"Get format failed: %lx\r\n", Status);
EfiCloseProtocol(GraphicsConsole->Handle, &EfiGraphicsOutputProtocol);
return Status;
}
Modified: trunk/reactos/boot/environ/lib/io/display/efi/guicons.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/displa…
==============================================================================
--- trunk/reactos/boot/environ/lib/io/display/efi/guicons.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/io/display/efi/guicons.c [iso-8859-1] Mon Sep 7
23:31:08 2015
@@ -54,7 +54,7 @@
if (!NT_SUCCESS(Status))
{
/* Nothing supports this (no video card?) */
- EarlyPrint(L"Status: %lx Count: %d\n", Status, HandleCount);
+ EfiPrintf(L"Status: %lx Count: %d\r\n", Status, HandleCount);
return STATUS_UNSUCCESSFUL;
}
Modified: trunk/reactos/boot/environ/lib/io/display/efi/textcons.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/displa…
==============================================================================
--- trunk/reactos/boot/environ/lib/io/display/efi/textcons.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/io/display/efi/textcons.c [iso-8859-1] Mon Sep 7
23:31:08 2015
@@ -348,7 +348,7 @@
}
/* Scan all the EFI modes */
- EarlyPrint(L"Scanning through %d modes\n", MaxMode);
+ EfiPrintf(L"Scanning through %d modes\r\n", MaxMode);
for (MaxQueriedMode = 0, Mode = 0; Mode < MaxMode; Mode++)
{
/* Query information on this mode */
@@ -359,7 +359,7 @@
&VRes)))
{
/* This mode was succesfully queried. Save the data */
- EarlyPrint(L"EFI Firmware Supported Mode %d is H: %d V: %d\n",
Mode, HRes, VRes);
+ EfiPrintf(L"EFI Firmware Supported Mode %d is H: %d V: %d\r\n",
Mode, HRes, VRes);
ModeEntry->HRes = HRes;
ModeEntry->VRes = VRes;
ModeEntry->HRes2 = HRes;
@@ -376,7 +376,7 @@
{
/* Check if the UEFI mode is compatible with our supported mode */
ModeEntry = &ModeList[MatchingMode];
- EarlyPrint(L"H1: %d V1: %d - H2: %d - V2: %d\n",
ModeEntry->HRes, ModeEntry->VRes, SupportedModeEntry->HRes,
SupportedModeEntry->VRes);
+ EfiPrintf(L"H1: %d V1: %d - H2: %d - V2: %d\r\n",
ModeEntry->HRes, ModeEntry->VRes, SupportedModeEntry->HRes,
SupportedModeEntry->VRes);
if ((ModeEntry->HRes == SupportedModeEntry->HRes) &&
(ModeEntry->VRes == SupportedModeEntry->VRes))
{
@@ -446,19 +446,19 @@
if (!ConsolepFindResolution(&DisplayMode, ConsoleTextResolutionList, 1))
{
/* It isn't -- find a matching EFI mode for what we need */
- EarlyPrint(L"In incorrect mode, scanning for right one\n");
+ EfiPrintf(L"In incorrect mode, scanning for right one\r\n");
Status = ConsoleEfiTextFindModeFromAllowed(EfiConOut,
ConsoleTextResolutionList,
1,
&Mode);
if (!NT_SUCCESS(Status))
{
- EarlyPrint(L"Failed to find mode: %lx\n", Status);
+ EfiPrintf(L"Failed to find mode: %lx\r\n", Status);
return Status;
}
/* Set the new EFI mode */
- EarlyPrint(L"Setting new mode: %d\n", Mode);
+ EfiPrintf(L"Setting new mode: %d\r\n", Mode);
Status = EfiConOutSetMode(EfiConOut, Mode);
if (!NT_SUCCESS(Status))
{
Modified: trunk/reactos/boot/environ/lib/io/display/efi/uga.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/displa…
==============================================================================
--- trunk/reactos/boot/environ/lib/io/display/efi/uga.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/io/display/efi/uga.c [iso-8859-1] Mon Sep 7 23:31:08
2015
@@ -19,7 +19,7 @@
_In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
)
{
- EarlyPrint(L"UGA not implemented\n");
+ EfiPrintf(L"UGA not implemented\r\n");
return STATUS_NOT_IMPLEMENTED;
}
Modified: trunk/reactos/boot/environ/lib/io/display/guicons.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/displa…
==============================================================================
--- trunk/reactos/boot/environ/lib/io/display/guicons.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/io/display/guicons.c [iso-8859-1] Mon Sep 7 23:31:08
2015
@@ -30,7 +30,7 @@
Status = ConsoleTextLocalConstruct(&GraphicsConsole->TextConsole, FALSE);
if (!NT_SUCCESS(Status))
{
- EarlyPrint(L"Text failed: %lx\n", Status);
+ EfiPrintf(L"Text failed: %lx\r\n", Status);
return Status;
}
@@ -42,12 +42,12 @@
if (!NT_SUCCESS(Status))
{
/* That failed, try an older EFI 1.02 UGA console */
- EarlyPrint(L"GOP open failed!\n", Status);
+ EfiPrintf(L"GOP open failed!\r\n", Status);
Status = ConsoleEfiGraphicalOpenProtocol(GraphicsConsole, BlUgaConsole);
if (!NT_SUCCESS(Status))
{
/* That failed too, give up */
- EarlyPrint(L"UGA failed!\n", Status);
+ EfiPrintf(L"UGA failed!\r\n", Status);
ConsoleTextLocalDestruct(&GraphicsConsole->TextConsole);
return STATUS_UNSUCCESSFUL;
}
@@ -58,7 +58,7 @@
if (!NT_SUCCESS(Status))
{
/* Failed to enable it, undo everything */
- EarlyPrint(L"Enable failed\n");
+ EfiPrintf(L"Enable failed\r\n");
ConsoleFirmwareGraphicalClose(GraphicsConsole);
ConsoleTextLocalDestruct(&GraphicsConsole->TextConsole);
return STATUS_UNSUCCESSFUL;
Modified: trunk/reactos/boot/environ/lib/io/display/textcons.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/displa…
==============================================================================
--- trunk/reactos/boot/environ/lib/io/display/textcons.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/io/display/textcons.c [iso-8859-1] Mon Sep 7 23:31:08
2015
@@ -118,7 +118,7 @@
Status = ConsoleFirmwareTextOpen(TextConsole);
if (!NT_SUCCESS(Status))
{
- EarlyPrint(L"Failed to activate console: %lx\n", Status);
+ EfiPrintf(L"Failed to activate console: %lx\r\n", Status);
return Status;
}
}
@@ -138,7 +138,7 @@
if (!NT_SUCCESS(Status))
{
/* We failed, back down */
- EarlyPrint(L"Failed to set console state: %lx\n", Status);
+ EfiPrintf(L"Failed to set console state: %lx\r\n", Status);
ConsoleFirmwareTextClose(TextConsole);
return Status;
}
Modified: trunk/reactos/boot/environ/lib/misc/util.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/misc/util…
==============================================================================
--- trunk/reactos/boot/environ/lib/misc/util.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/misc/util.c [iso-8859-1] Mon Sep 7 23:31:08 2015
@@ -186,4 +186,18 @@
UtlProgressInfo = 0;
return STATUS_SUCCESS;
-}
+}
+
+VOID
+BlFwReboot (
+ VOID
+ )
+{
+#ifdef BL_KD_SUPPORTED
+ /* Stop the boot debugger*/
+ BlBdStop();
+#endif
+
+ /* Reset the machine */
+ EfiResetSystem(EfiResetCold);
+}
Modified: trunk/reactos/boot/environ/lib/mm/descriptor.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/mm/descri…
==============================================================================
--- trunk/reactos/boot/environ/lib/mm/descriptor.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/mm/descriptor.c [iso-8859-1] Mon Sep 7 23:31:08 2015
@@ -149,7 +149,7 @@
_In_ ULONG Count
)
{
- EarlyPrint(L"NOT SUPPORTED!!!\n");
+ EfiPrintf(L"NOT SUPPORTED!!!\r\n");
while (1);
}
@@ -173,7 +173,7 @@
else
{
/* It's a dynamic descriptor, so free it */
- EarlyPrint(L"Dynamic descriptors not yet supported\n");
+ EfiPrintf(L"Dynamic descriptors not yet supported\r\n");
Status = STATUS_NOT_IMPLEMENTED;
}
@@ -250,7 +250,7 @@
/* If we're out of descriptors, bail out */
if (MmGlobalMemoryDescriptorsUsed >= MmGlobalMemoryDescriptorCount)
{
- EarlyPrint(L"Out of descriptors!\n");
+ EfiPrintf(L"Out of descriptors!\r\n");
return NULL;
}
@@ -295,13 +295,13 @@
/* Check for backward overlap */
if ((PreviousEntry != MdList->First) && (MemoryDescriptor->BasePage
< PreviousEndPage))
{
- EarlyPrint(L"Overlap detected -- this is unexpected on x86/x64
platforms\n");
+ EfiPrintf(L"Overlap detected -- this is unexpected on x86/x64
platforms\r\n");
}
/* Check for forward overlap */
if ((NextEntry != MdList->First) && (NextDescriptor->BasePage <
EndPage))
{
- EarlyPrint(L"Overlap detected -- this is unexpected on x86/x64
platforms\n");
+ EfiPrintf(L"Overlap detected -- this is unexpected on x86/x64
platforms\r\n");
}
/* Nothing to do */
@@ -343,7 +343,7 @@
((MemoryDescriptor->VirtualPage) &&
(PreviousDescriptor->VirtualPage) &&
(PreviousMappedEndPage == MemoryDescriptor->VirtualPage))))
{
- EarlyPrint(L"Previous descriptor coalescible!\n");
+ EfiPrintf(L"Previous descriptor coalescible!\r\n");
}
/* CHeck if the current entry touches the next entry, and is compatible */
@@ -355,7 +355,7 @@
((MemoryDescriptor->VirtualPage) &&
(PreviousDescriptor->VirtualPage) &&
(MappedEndPage == NextDescriptor->VirtualPage))))
{
- EarlyPrint(L"Next descriptor coalescible!\n");
+ EfiPrintf(L"Next descriptor coalescible!\r\n");
}
/* Nothing to do */
@@ -547,7 +547,7 @@
FoundPageCount = Descriptor->PageCount;
FoundEndPage = FoundBasePage + FoundPageCount;
EndPage = PageCount + BasePage;
- //EarlyPrint(L"Looking for Region 0x%08I64X-0x%08I64X in
0x%08I64X-0x%08I64X\n", BasePage, EndPage, FoundBasePage, FoundEndPage);
+ //EarlyPrint(L"Looking for Region 0x%08I64X-0x%08I64X in
0x%08I64X-0x%08I64X\r\n", BasePage, EndPage, FoundBasePage, FoundEndPage);
/* Make a copy of the original descriptor */
RtlCopyMemory(&NewDescriptor, NextEntry, sizeof(NewDescriptor));
@@ -562,18 +562,18 @@
if ((FoundBasePage >= BasePage) || (EndPage >= FoundEndPage))
{
/* This descriptor doesn't cover any part of the range */
- //EarlyPrint(L"No part of this descriptor contains the
region\n");
+ //EarlyPrint(L"No part of this descriptor contains the
region\r\n");
}
else
{
/* This descriptor covers the head of the allocation */
- //EarlyPrint(L"Descriptor covers the head of the
region\n");
+ //EarlyPrint(L"Descriptor covers the head of the
region\r\n");
}
}
else
{
/* This descriptor contains the entire allocation */
- //EarlyPrint(L"Descriptor contains the entire region\n");
+ //EarlyPrint(L"Descriptor contains the entire region\r\n");
}
/* Keep going */
@@ -614,14 +614,14 @@
if (!Descriptor->PageCount)
{
/* Remove it */
- //EarlyPrint(L"Entire descriptor consumed\n");
+ //EarlyPrint(L"Entire descriptor consumed\r\n");
MmMdRemoveDescriptorFromList(MdList, Descriptor);
MmMdFreeDescriptor(Descriptor);
/* Check if we're supposed to insert it into a new list */
if (HaveNewList)
{
- EarlyPrint(L"Not yet implemented\n");
+ EfiPrintf(L"Not yet implemented\r\n");
Status = STATUS_NOT_IMPLEMENTED;
goto Quickie;
}
@@ -681,7 +681,7 @@
/* Check for start overflow */
if (BaseMin > BaseMax)
{
- EarlyPrint(L"Descriptor overflow\n");
+ EfiPrintf(L"Descriptor overflow\r\n");
return FALSE;
}
@@ -724,7 +724,7 @@
/* Any mapped page already? */
if (Descriptor->VirtualPage)
{
- EarlyPrint(L"Virtual memory not yet supported\n");
+ EfiPrintf(L"Virtual memory not yet supported\r\n");
return FALSE;
}
else
@@ -737,21 +737,21 @@
if ((((Flags & 0xFF) & (Descriptor->Flags & 0xFF)) != (Flags &
0xFF)) ||
(((Flags & 0xFF00) & (Descriptor->Flags & 0xFF00)) != (Flags &
0xFF00)))
{
- EarlyPrint(L"Incorrect memory attributes\n");
+ EfiPrintf(L"Incorrect memory attributes\r\n");
return FALSE;
}
/* Bail out if the allocation flags don't match */
if (((Flags ^ Descriptor->Flags) & 0x190000))
{
- EarlyPrint(L"Incorrect memory allocation flags\n");
+ EfiPrintf(L"Incorrect memory allocation flags\r\n");
return FALSE;
}
/* Bail out if the type doesn't match */
if (Descriptor->Type != MemoryType)
{
- //EarlyPrint(L"Incorrect descriptor type\n");
+ //EarlyPrint(L"Incorrect descriptor type\r\n");
return FALSE;
}
@@ -761,7 +761,7 @@
NewDescriptor->Type = Descriptor->Type;
NewDescriptor->VirtualPage = VirtualPage;
NewDescriptor->Flags = Descriptor->Flags;
- //EarlyPrint(L"Found a matching descriptor: %08I64X with %08I64X pages\n",
BasePage, Pages);
+ //EarlyPrint(L"Found a matching descriptor: %08I64X with %08I64X
pages\r\n", BasePage, Pages);
return TRUE;
}
@@ -775,14 +775,12 @@
PLIST_ENTRY OldFlink, OldBlink;
/* Make sure we're not int middle of a call using a descriptor */
- EarlyPrint(L"Call depth is %d\n", MmDescriptorCallTreeCount);
if (MmDescriptorCallTreeCount != 1)
{
return;
}
/* Loop every current global descriptor */
- EarlyPrint(L"MmGlobalMemoryDescriptorsUsed: %d\n",
MmGlobalMemoryDescriptorsUsed);
while (Index < MmGlobalMemoryDescriptorsUsed)
{
/* Does it have any valid pageS? */
Modified: trunk/reactos/boot/environ/lib/mm/heapalloc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/mm/heapal…
==============================================================================
--- trunk/reactos/boot/environ/lib/mm/heapalloc.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/mm/heapalloc.c [iso-8859-1] Mon Sep 7 23:31:08 2015
@@ -140,7 +140,7 @@
HeapLimit = Heap->HeapLimit + PAGE_SIZE;
if (HeapLimit <= Heap->HeapEnd)
{
- EarlyPrint(L"Heap extension TODO\n");
+ EfiPrintf(L"Heap extension TODO\r\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
}
@@ -224,16 +224,16 @@
#if 0
BOOLEAN DebuggerEnabled;
- BlStatusPrint(L"Heap corruption in the links surrounding %p!\n",
BufferEntry);
+ BlStatusPrint(L"Heap corruption in the links surrounding %p!\r\n",
BufferEntry);
DebuggerEnabled = BlBdDebuggerEnabled();
if (DebuggerEnabled)
{
- BlStatusPrint(L"\n*** Fatal Error 0x%08x :\n (0x%p, 0x%p,
0x%p, 0x%p)\n\n", 2, BufferEntry, NULL, NULL, NULL);
+ BlStatusPrint(L"\n*** Fatal Error 0x%08x :\n (0x%p, 0x%p,
0x%p, 0x%p)\n\r\n", 2, BufferEntry, NULL, NULL, NULL);
__debugbreak();
}
#else
- EarlyPrint(L"Heap corruption in the links surrounding %p!\n",
BufferEntry);
+ EfiPrintf(L"Heap corruption in the links surrounding %p!\r\n",
BufferEntry);
#endif
}
@@ -642,18 +642,18 @@
/* We have no heaps or space on any heap -- extend the heap and retry */
if (!NT_SUCCESS(MmHapHeapAllocatorExtend(BufferSize)))
{
- EarlyPrint(L"Heap extension failed!\n");
+ EfiPrintf(L"Heap extension failed!\r\n");
return NULL;
}
- EarlyPrint(L"Heap extended -- trying again\n");
+ EfiPrintf(L"Heap extended -- trying again\r\n");
}
/* Clear all the bits, marking this entry as allocated */
BusyEntry->BufferNext.P = MmHapDecodeLink(BusyEntry->BufferNext);
/* Return the entry's data buffer */
- EarlyPrint(L"Returning buffer at 0x%p\n", &BusyEntry->Buffer);
+ EfiPrintf(L"Returning buffer at 0x%p\r\n", &BusyEntry->Buffer);
return &BusyEntry->Buffer;
}
Modified: trunk/reactos/boot/environ/lib/mm/i386/mmx86.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/mm/i386/m…
==============================================================================
--- trunk/reactos/boot/environ/lib/mm/i386/mmx86.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/mm/i386/mmx86.c [iso-8859-1] Mon Sep 7 23:31:08 2015
@@ -71,10 +71,10 @@
if (DoDeferred)
{
- EarlyPrint(L"Deferred todo\n");
+ EfiPrintf(L"Deferred todo\r\n");
}
- EarlyPrint(L"Phase 1 TODO\n");
+ EfiPrintf(L"Phase 1 TODO\r\n");
return STATUS_NOT_IMPLEMENTED;
}
Modified: trunk/reactos/boot/environ/lib/mm/mm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/mm/mm.c?r…
==============================================================================
--- trunk/reactos/boot/environ/lib/mm/mm.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/mm/mm.c [iso-8859-1] Mon Sep 7 23:31:08 2015
@@ -29,7 +29,7 @@
}
/* TODO */
- EarlyPrint(L"Required for protected mode\n");
+ EfiPrintf(L"Required for protected mode\r\n");
return STATUS_NOT_IMPLEMENTED;
}
@@ -60,7 +60,7 @@
}
/* Have to allocate physical pages */
- EarlyPrint(L"VM Todo\n");
+ EfiPrintf(L"VM Todo\r\n");
return STATUS_NOT_IMPLEMENTED;
}
@@ -99,7 +99,7 @@
return STATUS_UNSUCCESSFUL;
}
- EarlyPrint(L"VM todo\n");
+ EfiPrintf(L"VM todo\r\n");
return STATUS_NOT_IMPLEMENTED;
}
@@ -188,7 +188,7 @@
if (MmTranslationType != BlNone)
{
/* For virtual memory, there's more to do */
- EarlyPrint(L"VM not supported for mapping\n");
+ EfiPrintf(L"VM not supported for mapping\r\n");
Status = STATUS_NOT_IMPLEMENTED;
goto Quickie;
}
@@ -220,7 +220,7 @@
if ((TranslationType > BlPae) || (LibraryParameters->TranslationType >
BlPae))
{
/* Bail out */
- EarlyPrint(L"Invalid translation types present\n");
+ EfiPrintf(L"Invalid translation types present\r\n");
Status = STATUS_INVALID_PARAMETER;
goto Quickie;
}
@@ -278,7 +278,7 @@
if (LibraryParameters->DescriptorCount > 512)
{
/* Switch to using a dynamic buffer instead */
- EarlyPrint(L"Warning: too many descriptors\n");
+ EfiPrintf(L"Warning: too many descriptors\r\n");
Status = STATUS_NOT_IMPLEMENTED;
goto Quickie;
//MmMdpSwitchToDynamicDescriptors(LibraryParameters->DescriptorCount);
Modified: trunk/reactos/boot/environ/lib/mm/pagealloc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/mm/pageal…
==============================================================================
--- trunk/reactos/boot/environ/lib/mm/pagealloc.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/mm/pagealloc.c [iso-8859-1] Mon Sep 7 23:31:08 2015
@@ -131,7 +131,7 @@
/* Check if we exhausted the list */
if (NextEntry == ListHead)
{
- EarlyPrint(L"No matching memory found\n");
+ EfiPrintf(L"No matching memory found\r\n");
return Status;
}
@@ -151,7 +151,7 @@
&EfiAddress);
if (!NT_SUCCESS(Status))
{
- EarlyPrint(L"EFI memory allocation failure\n");
+ EfiPrintf(L"EFI memory allocation failure\r\n");
return Status;
}
@@ -165,14 +165,14 @@
/* Are we allocating from the virtual memory list? */
if (CurrentList == &MmMdlMappedUnallocated)
{
- EarlyPrint(L"Virtual memory not yet supported\n");
+ EfiPrintf(L"Virtual memory not yet supported\r\n");
return STATUS_NOT_IMPLEMENTED;
}
/* Does the memory we received not exactly fall onto the beginning of its descriptor?
*/
if (LocalDescriptor.BasePage != FoundDescriptor->BasePage)
{
- EarlyPrint(L"Local Page: %08I64X Found Page: %08I64X\n",
LocalDescriptor.BasePage, FoundDescriptor->BasePage);
+ EfiPrintf(L"Local Page: %08I64X Found Page: %08I64X\r\n",
LocalDescriptor.BasePage, FoundDescriptor->BasePage);
TempDescriptor = MmMdInitByteGranularDescriptor(FoundDescriptor->Flags,
FoundDescriptor->Type,
FoundDescriptor->BasePage,
@@ -193,7 +193,7 @@
LocalDescriptor.VirtualPage + LocalDescriptor.PageCount : 0;
if (LocalEndPage != FoundEndPage)
{
- EarlyPrint(L"Local Page: %08I64X Found Page: %08I64X\n", LocalEndPage,
FoundEndPage);
+ EfiPrintf(L"Local Page: %08I64X Found Page: %08I64X\r\n", LocalEndPage,
FoundEndPage);
TempDescriptor = MmMdInitByteGranularDescriptor(FoundDescriptor->Flags,
FoundDescriptor->Type,
LocalEndPage,
@@ -266,7 +266,7 @@
if (Status == STATUS_NOT_FOUND)
{
/* Need to re-synchronize the memory map and check other lists */
- EarlyPrint(L"No RAM found -- backup plan not yet implemented\n");
+ EfiPrintf(L"No RAM found -- backup plan not yet implemented\r\n");
}
/* Did we get the region we wanted? */
@@ -277,7 +277,7 @@
}
/* Nope, we have to hunt for it elsewhere */
- EarlyPrint(L"TODO\n");
+ EfiPrintf(L"TODO\r\n");
return Status;
}
@@ -488,14 +488,14 @@
PLIST_ENTRY listHead, nextEntry;
/* Loop the NT firmware memory list */
- EarlyPrint(L"NT MEMORY MAP\n\n");
+ EfiPrintf(L"NT MEMORY MAP\n\r\n");
listHead = &MmMdlUnmappedUnallocated.ListHead;
nextEntry = listHead->Flink;
while (listHead != nextEntry)
{
Descriptor = CONTAINING_RECORD(nextEntry, BL_MEMORY_DESCRIPTOR, ListEntry);
- EarlyPrint(L"Type: %08lX Flags: %08lX Base: 0x%016I64X End:
0x%016I64X\n",
+ EfiPrintf(L"Type: %08lX Flags: %08lX Base: 0x%016I64X End:
0x%016I64X\r\n",
Descriptor->Type,
Descriptor->Flags,
Descriptor->BasePage << PAGE_SHIFT,
Modified: trunk/reactos/boot/environ/lib/platform/time.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/platform/…
==============================================================================
--- trunk/reactos/boot/environ/lib/platform/time.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/platform/time.c [iso-8859-1] Mon Sep 7 23:31:08 2015
@@ -50,7 +50,6 @@
/* Set the frequency based on the two measurements we took */
BlpTimePerformanceFrequency = 125 * (Delta - (TimeStamp2 - TimeStamp1)) &
0x1FFFFFFFFFFFFFF;
- EarlyPrint(L"Computed frequency as: %I64d\n",
BlpTimePerformanceFrequency);
return STATUS_SUCCESS;
}
@@ -79,7 +78,7 @@
{
/* Read the TSC frequency from the MSR */
BlpTimePerformanceFrequency = __readmsr(0x40000022);
- EarlyPrint(L"Using frequency as: %I64d\n",
BlpTimePerformanceFrequency);
+ EfiPrintf(L"Using Hyper-V frequency as: %I64d\r\n",
BlpTimePerformanceFrequency);
return STATUS_SUCCESS;
}
}