X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EmulatorPkg%2FWin%2FHost%2FWinHost.c;h=cfee156b27b40d971abfdcedb5a1deb3234d4a3c;hp=9c6acac2795265d1834234d49b6f19e973e8f0a2;hb=3d6b7fd303b0081935e69aa16b01c285d6563f64;hpb=10ccc27c9548ab2550689e68f6f45dc48120bc79 diff --git a/EmulatorPkg/Win/Host/WinHost.c b/EmulatorPkg/Win/Host/WinHost.c index 9c6acac279..cfee156b27 100644 --- a/EmulatorPkg/Win/Host/WinHost.c +++ b/EmulatorPkg/Win/Host/WinHost.c @@ -48,7 +48,7 @@ UINTN gFdInfoCount = 0; NT_FD_INFO *gFdInfo; // -// Array that supports seperate memory rantes. +// Array that supports separate memory ranges. // The memory ranges are set by PcdWinNtMemorySizeForSecMain. // The number of array elements is allocated base on parsing // PcdWinNtMemorySizeForSecMain value and the memory is never freed. @@ -105,7 +105,7 @@ WinPeiAutoScan ( Routine Description: Return the FD Size and base address. Since the FD is loaded from a - file into host memory only the SEC will know it's address. + file into host memory only the SEC will know its address. Arguments: Index - Which FD, starts at zero. @@ -273,7 +273,7 @@ Arguments: Returns: EFI_SUCCESS - The file was opened and mapped. EFI_NOT_FOUND - FileName was not found in the current directory - EFI_DEVICE_ERROR - An error occured attempting to map the opened file + EFI_DEVICE_ERROR - An error occurred attempting to map the opened file --*/ { @@ -356,7 +356,7 @@ Returns: INTN EFIAPI main ( - IN INTN Argc, + IN INT Argc, IN CHAR8 **Argv, IN CHAR8 **Envp ) @@ -391,8 +391,8 @@ Returns: VOID *SecFile; CHAR16 *MemorySizeStr; CHAR16 *FirmwareVolumesStr; - UINT32 ProcessAffinityMask; - UINT32 SystemAffinityMask; + UINTN ProcessAffinityMask; + UINTN SystemAffinityMask; INT32 LowBit; // @@ -408,13 +408,13 @@ Returns: MemorySizeStr = (CHAR16 *) PcdGetPtr (PcdEmuMemorySize); FirmwareVolumesStr = (CHAR16 *) PcdGetPtr (PcdEmuFirmwareVolume); - SecPrint ("\nEDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/\n"); + SecPrint ("\n\rEDK II WIN Host Emulation Environment from http://www.tianocore.org/edk2/\n\r"); // // Determine the first thread available to this process. // if (GetProcessAffinityMask (GetCurrentProcess (), &ProcessAffinityMask, &SystemAffinityMask)) { - LowBit = (INT32)LowBitSet32 (ProcessAffinityMask); + LowBit = (INT32)LowBitSet32 ((UINT32)ProcessAffinityMask); if (LowBit != -1) { // // Force the system to bind the process to a single thread to work @@ -450,7 +450,7 @@ Returns: gSystemMemoryCount = CountSeparatorsInString (MemorySizeStr, '!') + 1; gSystemMemory = calloc (gSystemMemoryCount, sizeof (NT_SYSTEM_MEMORY)); if (gSystemMemory == NULL) { - SecPrint ("ERROR : Can not allocate memory for %S. Exiting.\n", MemorySizeStr); + SecPrint ("ERROR : Can not allocate memory for %S. Exiting.\n\r", MemorySizeStr); exit (1); } @@ -460,13 +460,13 @@ Returns: gFdInfoCount = CountSeparatorsInString (FirmwareVolumesStr, '!') + 1; gFdInfo = calloc (gFdInfoCount, sizeof (NT_FD_INFO)); if (gFdInfo == NULL) { - SecPrint ("ERROR : Can not allocate memory for %S. Exiting.\n", FirmwareVolumesStr); + SecPrint ("ERROR : Can not allocate memory for %S. Exiting.\n\r", FirmwareVolumesStr); exit (1); } // // Setup Boot Mode. // - SecPrint (" BootMode 0x%02x\n", PcdGet32 (PcdEmuBootMode)); + SecPrint (" BootMode 0x%02x\n\r", PcdGet32 (PcdEmuBootMode)); // // Allocate 128K memory to emulate temp memory for PEI. @@ -476,12 +476,12 @@ Returns: TemporaryRamSize = TEMPORARY_RAM_SIZE; TemporaryRam = VirtualAlloc (NULL, (SIZE_T) (TemporaryRamSize), MEM_COMMIT, PAGE_EXECUTE_READWRITE); if (TemporaryRam == NULL) { - SecPrint ("ERROR : Can not allocate enough space for SecStack\n"); + SecPrint ("ERROR : Can not allocate enough space for SecStack\n\r"); exit (1); } SetMem32 (TemporaryRam, TemporaryRamSize, PcdGet32 (PcdInitValueInTempStack)); - SecPrint (" OS Emulator passing in %u KB of temp RAM at 0x%08lx to SEC\n", + SecPrint (" OS Emulator passing in %u KB of temp RAM at 0x%08lx to SEC\n\r", TemporaryRamSize / SIZE_1KB, TemporaryRam ); @@ -503,7 +503,7 @@ Returns: &Size ); if (EFI_ERROR (Status)) { - SecPrint ("ERROR : Could not allocate PeiServicesTablePage @ %p\n", EmuMagicPage); + SecPrint ("ERROR : Could not allocate PeiServicesTablePage @ %p\n\r", EmuMagicPage); return EFI_DEVICE_ERROR; } } @@ -514,7 +514,7 @@ Returns: // FileNamePtr = AllocateCopyPool (StrSize (FirmwareVolumesStr), FirmwareVolumesStr); if (FileNamePtr == NULL) { - SecPrint ("ERROR : Can not allocate memory for firmware volume string\n"); + SecPrint ("ERROR : Can not allocate memory for firmware volume string\n\r"); exit (1); } @@ -540,11 +540,11 @@ Returns: &gFdInfo[Index].Size ); if (EFI_ERROR (Status)) { - SecPrint ("ERROR : Can not open Firmware Device File %S (0x%X). Exiting.\n", FileName, Status); + SecPrint ("ERROR : Can not open Firmware Device File %S (0x%X). Exiting.\n\r", FileName, Status); exit (1); } - SecPrint (" FD loaded from %S\n", FileName); + SecPrint (" FD loaded from %S", FileName); if (SecFile == NULL) { // @@ -565,7 +565,7 @@ Returns: } } - SecPrint ("\n"); + SecPrint ("\n\r"); } // // Calculate memory regions and store the information in the gSystemMemory @@ -590,7 +590,7 @@ Returns: MemorySizeStr = MemorySizeStr + Index1 + 1; } - SecPrint ("\n"); + SecPrint ("\n\r"); // // Hand off to SEC Core @@ -601,7 +601,7 @@ Returns: // If we get here, then the SEC Core returned. This is an error as SEC should // always hand off to PEI Core and then on to DXE Core. // - SecPrint ("ERROR : SEC returned\n"); + SecPrint ("ERROR : SEC returned\n\r"); exit (1); } @@ -625,7 +625,7 @@ Arguments: SecCorePe32File - SEC Core PE32 Returns: - Success means control is transfered and thus we should never return + Success means control is transferred and thus we should never return --*/ { @@ -993,7 +993,7 @@ PeCoffLoaderRelocateImageExtraAction ( // the *.dll file as a library using Windows* APIs. This allows // source level debug. The image is still loaded and relocated // in the Framework memory space like on a real system (by the code above), - // but the entry point points into the DLL loaded by the code bellow. + // but the entry point points into the DLL loaded by the code below. // DllEntryPoint = NULL;