From 0b94e31981fde83116598dc7a2c8a346d46fd3cf Mon Sep 17 00:00:00 2001 From: klu2 Date: Tue, 14 Oct 2008 08:59:32 +0000 Subject: [PATCH] Fix ICC building issue for Nt32 platform. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6110 6f19259b-4bc3-4df7-8a09-765794883524 --- Nt32Pkg/BootModePei/BootModePei.c | 6 +++--- Nt32Pkg/CpuRuntimeDxe/Cpu.c | 10 +--------- Nt32Pkg/CpuRuntimeDxe/CpuIo.c | 2 +- Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c | 12 ++++++------ Nt32Pkg/FvbServicesRuntimeDxe/FwBlockService.h | 8 ++++---- Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c | 4 ++-- .../MiscSubclassDriverEntryPoint.c | 2 +- Nt32Pkg/ResetRuntimeDxe/reset.c | 6 +++--- Nt32Pkg/Sec/SecMain.c | 17 ++++++----------- Nt32Pkg/Sec/SecMain.inf | 6 ++++++ Nt32Pkg/Sec/WinNtThunk.c | 4 ++++ Nt32Pkg/TimerDxe/Timer.c | 15 ++++++++++----- Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c | 10 +++++----- Nt32Pkg/WinNtFirmwareVolumePei/WinntFwh.c | 4 ++-- Nt32Pkg/WinNtFlashMapPei/FlashMap.c | 2 +- Nt32Pkg/WinNtThunkDxe/WinNtThunk.h | 2 +- .../WinNtThunkPPIToProtocol.c | 4 ++-- 17 files changed, 58 insertions(+), 56 deletions(-) diff --git a/Nt32Pkg/BootModePei/BootModePei.c b/Nt32Pkg/BootModePei/BootModePei.c index e224b97571..d68f1d94d8 100644 --- a/Nt32Pkg/BootModePei/BootModePei.c +++ b/Nt32Pkg/BootModePei/BootModePei.c @@ -86,14 +86,14 @@ Returns: // BootMode = BOOT_WITH_FULL_CONFIGURATION; - Status = (**PeiServices).SetBootMode (PeiServices, (UINT8) BootMode); + Status = (**PeiServices).SetBootMode ((const EFI_PEI_SERVICES **)PeiServices, (UINT8) BootMode); ASSERT_EFI_ERROR (Status); - Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListBootMode); + Status = (**PeiServices).InstallPpi ((const EFI_PEI_SERVICES **)PeiServices, &mPpiListBootMode); ASSERT_EFI_ERROR (Status); if (BootMode == BOOT_IN_RECOVERY_MODE) { - Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListRecoveryBootMode); + Status = (**PeiServices).InstallPpi ((const EFI_PEI_SERVICES **)PeiServices, &mPpiListRecoveryBootMode); ASSERT_EFI_ERROR (Status); } diff --git a/Nt32Pkg/CpuRuntimeDxe/Cpu.c b/Nt32Pkg/CpuRuntimeDxe/Cpu.c index f01df2ed38..9cc2aea86b 100644 --- a/Nt32Pkg/CpuRuntimeDxe/Cpu.c +++ b/Nt32Pkg/CpuRuntimeDxe/Cpu.c @@ -254,9 +254,6 @@ Returns: // TODO: This - add argument and description to function comment // TODO: InitType - add argument and description to function comment { - CPU_ARCH_PROTOCOL_PRIVATE *Private; - - Private = CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS (This); return EFI_UNSUPPORTED; } @@ -291,7 +288,6 @@ Returns: // TODO: InterruptType - add argument and description to function comment // TODO: InterruptHandler - add argument and description to function comment { - CPU_ARCH_PROTOCOL_PRIVATE *Private; // // Do parameter checking for EFI spec conformance @@ -302,7 +298,6 @@ Returns: // // Do nothing for Nt32 emulation // - Private = CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS (This); return EFI_UNSUPPORTED; } @@ -381,8 +376,6 @@ Returns: // TODO: Attributes - add argument and description to function comment // TODO: EFI_INVALID_PARAMETER - add return value to function comment { - CPU_ARCH_PROTOCOL_PRIVATE *Private; - // // Check for invalid parameter for Spec conformance // @@ -393,7 +386,6 @@ Returns: // // Do nothing for Nt32 emulation // - Private = CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS (This); return EFI_UNSUPPORTED; } @@ -426,7 +418,7 @@ Returns: // // Locate DataHub protocol. // - Status = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, &DataHub); + Status = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, (VOID**)&DataHub); if (EFI_ERROR (Status)) { return; } diff --git a/Nt32Pkg/CpuRuntimeDxe/CpuIo.c b/Nt32Pkg/CpuRuntimeDxe/CpuIo.c index aa474db48a..b513c7242d 100644 --- a/Nt32Pkg/CpuRuntimeDxe/CpuIo.c +++ b/Nt32Pkg/CpuRuntimeDxe/CpuIo.c @@ -319,7 +319,7 @@ Returns: Count = 1; } - Width = Width & 0x03; + Width = (EFI_CPU_IO_PROTOCOL_WIDTH)(Width & 0x03); if (Address - 1 + (1 << Width) * Count > Limit) { return EFI_UNSUPPORTED; } diff --git a/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c b/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c index b6f3e1500c..beafb46fb0 100644 --- a/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c +++ b/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c @@ -1080,10 +1080,10 @@ EFI_STATUS EFIAPI FvbProtocolWrite ( IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This, - IN CONST EFI_LBA Lba, - IN CONST UINTN Offset, - IN OUT UINTN *NumBytes, - IN CONST UINT8 *Buffer + IN EFI_LBA Lba, + IN UINTN Offset, + IN OUT UINTN *NumBytes, + IN UINT8 *Buffer ) /*++ @@ -1263,7 +1263,7 @@ Returns: Ptr = (UINT16 *) FwVolHeader; Checksum = 0; while (HeaderLength > 0) { - Checksum = Checksum + (*Ptr); + Checksum = (UINT16)(Checksum + (*Ptr)); HeaderLength--; Ptr++; } @@ -1492,7 +1492,7 @@ Returns: Status = gBS->HandleProtocol ( FwbHandle, &gEfiFirmwareVolumeBlockProtocolGuid, - &OldFwbInterface + (VOID**)&OldFwbInterface ); ASSERT_EFI_ERROR (Status); diff --git a/Nt32Pkg/FvbServicesRuntimeDxe/FwBlockService.h b/Nt32Pkg/FvbServicesRuntimeDxe/FwBlockService.h index 5ff7a89763..7934547c0f 100644 --- a/Nt32Pkg/FvbServicesRuntimeDxe/FwBlockService.h +++ b/Nt32Pkg/FvbServicesRuntimeDxe/FwBlockService.h @@ -194,10 +194,10 @@ EFI_STATUS EFIAPI FvbProtocolWrite ( IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This, - IN CONST EFI_LBA Lba, - IN CONST UINTN Offset, - IN OUT UINTN *NumBytes, - IN CONST UINT8 *Buffer + IN EFI_LBA Lba, + IN UINTN Offset, + IN OUT UINTN *NumBytes, + IN UINT8 *Buffer ); EFI_STATUS diff --git a/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c b/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c index 24322088c4..814f71a41b 100644 --- a/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c +++ b/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c @@ -320,7 +320,7 @@ Returns: // console directly. // BdsLibConnectAllDefaultConsoles (); - PlatformBdsDiagnostics (IGNORE, TRUE); + PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE); // // Perform some platform specific connect sequence @@ -379,7 +379,7 @@ Returns: PlatformBdsNoConsoleAction (); } - PlatformBdsDiagnostics (IGNORE, TRUE); + PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE); // // Perform some platform specific connect sequence diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c index 35ebfdc063..4384697757 100644 --- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c +++ b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c @@ -168,7 +168,7 @@ Returns: // // Locate data hub protocol. // - Status = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, &DataHub); + Status = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, (VOID**)&DataHub); if (EFI_ERROR (Status)) { DEBUG ((EFI_D_ERROR, "Could not locate DataHub protocol. %r\n", Status)); diff --git a/Nt32Pkg/ResetRuntimeDxe/reset.c b/Nt32Pkg/ResetRuntimeDxe/reset.c index 9a19b5664c..d5c6cc04ea 100644 --- a/Nt32Pkg/ResetRuntimeDxe/reset.c +++ b/Nt32Pkg/ResetRuntimeDxe/reset.c @@ -36,7 +36,7 @@ InitializeNtReset ( ); STATIC -EFI_STATUS +VOID EFIAPI WinNtResetSystem ( IN EFI_RESET_TYPE ResetType, @@ -86,7 +86,7 @@ Returns: } STATIC -EFI_STATUS +VOID EFIAPI WinNtResetSystem ( IN EFI_RESET_TYPE ResetType, @@ -124,5 +124,5 @@ Returns: // // Should never go here // - return EFI_SUCCESS; + ASSERT (FALSE); } diff --git a/Nt32Pkg/Sec/SecMain.c b/Nt32Pkg/Sec/SecMain.c index 54fcaa1225..345f1915e6 100644 --- a/Nt32Pkg/Sec/SecMain.c +++ b/Nt32Pkg/Sec/SecMain.c @@ -158,7 +158,6 @@ Returns: UINTN Index; UINTN Index1; UINTN Index2; - UINTN PeiIndex; CHAR16 *FileName; CHAR16 *FileNamePtr; BOOLEAN Done; @@ -185,7 +184,7 @@ Returns: gSystemMemoryCount = CountSeperatorsInString (MemorySizeStr, '!') + 1; gSystemMemory = calloc (gSystemMemoryCount, sizeof (NT_SYSTEM_MEMORY)); if (gSystemMemory == NULL) { - printf ("ERROR : Can not allocate memory for %s. Exiting.\n", MemorySizeStr); + wprintf (L"ERROR : Can not allocate memory for %s. Exiting.\n", MemorySizeStr); exit (1); } // @@ -194,7 +193,7 @@ Returns: gFdInfoCount = CountSeperatorsInString (FirmwareVolumesStr, '!') + 1; gFdInfo = calloc (gFdInfoCount, sizeof (NT_FD_INFO)); if (gFdInfo == NULL) { - printf ("ERROR : Can not allocate memory for %s. Exiting.\n", FirmwareVolumesStr); + wprintf (L"ERROR : Can not allocate memory for %s. Exiting.\n", FirmwareVolumesStr); exit (1); } // @@ -220,7 +219,7 @@ Returns: *StackPointer = 0x5AA55AA5; } - printf (" SEC passing in %d bytes of temp RAM to PEI\n", InitialStackMemorySize); + wprintf (L" SEC passing in %d bytes of temp RAM to PEI\n", InitialStackMemorySize); // // Open All the firmware volumes and remember the info in the gFdInfo global @@ -233,7 +232,7 @@ Returns: StrCpy (FileNamePtr, (CHAR16*)FirmwareVolumesStr); - for (Done = FALSE, Index = 0, PeiIndex = 0, PeiCoreFile = NULL; !Done; Index++) { + for (Done = FALSE, Index = 0, PeiCoreFile = NULL; !Done; Index++) { FileName = FileNamePtr; for (Index1 = 0; (FileNamePtr[Index1] != '!') && (FileNamePtr[Index1] != 0); Index1++) ; @@ -255,7 +254,7 @@ Returns: &gFdInfo[Index].Size ); if (EFI_ERROR (Status)) { - printf ("ERROR : Can not open Firmware Device File %S (%r). Exiting.\n", FileName, Status); + printf ("ERROR : Can not open Firmware Device File %S (0x%X). Exiting.\n", FileName, Status); exit (1); } @@ -275,7 +274,6 @@ Returns: // Status = SecFfsFindPeiCore ((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) gFdInfo[Index].Address, &PeiCoreFile); if (!EFI_ERROR (Status)) { - PeiIndex = Index; printf (" contains SEC Core"); } } @@ -476,7 +474,7 @@ Returns: // // Processes ASSERT () // - printf ("ASSERT %s(%d): %s\n", Filename, LineNumber, Description); + printf ("ASSERT %s(%d): %s\n", Filename, (int)LineNumber, Description); } else if (ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) { // @@ -571,7 +569,6 @@ Returns: --*/ { EFI_STATUS Status; - EFI_PHYSICAL_ADDRESS TopOfMemory; VOID *TopOfStack; UINT64 PeiCoreSize; EFI_PHYSICAL_ADDRESS PeiCoreEntryPoint; @@ -582,7 +579,6 @@ Returns: // // Compute Top Of Memory for Stack and PEI Core Allocations // - TopOfMemory = LargestRegion + LargestRegionSize; PeiStackSize = (UINTN)RShiftU64((UINT64)STACK_SIZE,1); // @@ -595,7 +591,6 @@ Returns: // |-----------| <---- TemporaryRamBase // TopOfStack = (VOID *)(LargestRegion + PeiStackSize); - TopOfMemory = LargestRegion + PeiStackSize; // // Reservet space for storing PeiCore's parament in stack. diff --git a/Nt32Pkg/Sec/SecMain.inf b/Nt32Pkg/Sec/SecMain.inf index 95cd30e2ea..406e174466 100644 --- a/Nt32Pkg/Sec/SecMain.inf +++ b/Nt32Pkg/Sec/SecMain.inf @@ -74,3 +74,9 @@ MSFT:*_*_IA32_PP_FLAGS = /nologo /E /TC /FI$(DEST_DIR_DEBUG)/AutoGen.h MSFT:*_*_IA32_ASM_FLAGS = /nologo /W3 /WX /c /coff /Cx /Zd /W0 /Zi MSFT:*_*_IA32_ASMLINK_FLAGS = /link /nologo /tiny + + INTEL:*_*_IA32_DLINK_FLAGS = /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"C:\Program Files\Intel\Compiler\C++\9.1\IA32\Lib" /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib + INTEL:*_*_IA32_CC_FLAGS = /nologo /W4 /WX /Gy /c /D UNICODE /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE + INTEL:*_*_IA32_PP_FLAGS = /nologo /E /TC /FI$(DEST_DIR_DEBUG)/AutoGen.h + INTEL:*_*_IA32_ASM_FLAGS = /nologo /W3 /WX /c /coff /Cx /Zd /W0 /Zi + INTEL:*_*_IA32_ASMLINK_FLAGS = /link /nologo /tiny diff --git a/Nt32Pkg/Sec/WinNtThunk.c b/Nt32Pkg/Sec/WinNtThunk.c index 7e2be38ddd..ef1dcb464d 100644 --- a/Nt32Pkg/Sec/WinNtThunk.c +++ b/Nt32Pkg/Sec/WinNtThunk.c @@ -47,6 +47,10 @@ Abstract: #pragma warning(disable : 4232) #pragma warning(disable : 4996) +#if __INTEL_COMPILER +#pragma warning ( disable : 144 ) +#endif + EFI_WIN_NT_THUNK_PROTOCOL mWinNtThunkTable = { EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE, GetProcAddress, diff --git a/Nt32Pkg/TimerDxe/Timer.c b/Nt32Pkg/TimerDxe/Timer.c index fd75c160c4..8eb4865a83 100644 --- a/Nt32Pkg/TimerDxe/Timer.c +++ b/Nt32Pkg/TimerDxe/Timer.c @@ -536,7 +536,9 @@ Returns: EFI_STATUS Status; UINTN Result; EFI_HANDLE Handle; - + EFI_HANDLE hSourceProcessHandle; + EFI_HANDLE hSourceHandle; + EFI_HANDLE hTargetProcessHandle; // // Make sure the Timer Architectural Protocol is not already installed in the system // @@ -545,16 +547,19 @@ Returns: // // Get the CPU Architectural Protocol instance // - Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, &mCpu); + Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID**)&mCpu); ASSERT_EFI_ERROR (Status); // // Get our handle so the timer tick thread can suspend // + hSourceProcessHandle = gWinNt->GetCurrentProcess (); + hSourceHandle = gWinNt->GetCurrentThread (); + hTargetProcessHandle = gWinNt->GetCurrentProcess (); Result = gWinNt->DuplicateHandle ( - gWinNt->GetCurrentProcess (), - gWinNt->GetCurrentThread (), - gWinNt->GetCurrentProcess (), + hSourceProcessHandle, + hSourceHandle, + hTargetProcessHandle, &mNtMainThreadHandle, 0, FALSE, diff --git a/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c b/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c index 0a262da5f2..2c2b3025b0 100644 --- a/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c +++ b/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c @@ -73,11 +73,11 @@ Returns: // Get the PEI NT Autoscan PPI // Status = (**PeiServices).LocatePpi ( - PeiServices, + (const EFI_PEI_SERVICES **)PeiServices, &gPeiNtAutoScanPpiGuid, // GUID 0, // INSTANCE &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR - &PeiNtService // PPI + (VOID**)&PeiNtService // PPI ); ASSERT_EFI_ERROR (Status); @@ -85,11 +85,11 @@ Returns: // Get the Memory Test PPI // Status = (**PeiServices).LocatePpi ( - PeiServices, + (const EFI_PEI_SERVICES **)PeiServices, &gPeiBaseMemoryTestPpiGuid, 0, NULL, - &MemoryTestPpi + (VOID**)&MemoryTestPpi ); ASSERT_EFI_ERROR (Status); @@ -124,7 +124,7 @@ Returns: // // Register the "tested" memory with the PEI Core // - Status = (**PeiServices).InstallPeiMemory (PeiServices, MemoryBase, MemorySize); + Status = (**PeiServices).InstallPeiMemory ((const EFI_PEI_SERVICES **)PeiServices, MemoryBase, MemorySize); ASSERT_EFI_ERROR (Status); Attributes |= EFI_RESOURCE_ATTRIBUTE_TESTED; diff --git a/Nt32Pkg/WinNtFirmwareVolumePei/WinntFwh.c b/Nt32Pkg/WinNtFirmwareVolumePei/WinntFwh.c index e1c06f9462..fe7b23dd28 100644 --- a/Nt32Pkg/WinNtFirmwareVolumePei/WinntFwh.c +++ b/Nt32Pkg/WinNtFirmwareVolumePei/WinntFwh.c @@ -70,11 +70,11 @@ Returns: // Get the Fwh Information PPI // Status = (**PeiServices).LocatePpi ( - PeiServices, + (const EFI_PEI_SERVICES **)PeiServices, &gNtFwhPpiGuid, // GUID 0, // INSTANCE &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR - &FwhPpi // PPI + (VOID**)&FwhPpi // PPI ); ASSERT_EFI_ERROR (Status); diff --git a/Nt32Pkg/WinNtFlashMapPei/FlashMap.c b/Nt32Pkg/WinNtFlashMapPei/FlashMap.c index 111514f21b..3d83516fcc 100644 --- a/Nt32Pkg/WinNtFlashMapPei/FlashMap.c +++ b/Nt32Pkg/WinNtFlashMapPei/FlashMap.c @@ -70,7 +70,7 @@ Returns: &gNtFwhPpiGuid, // GUID 0, // INSTANCE &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR - &NtFwhPpi // PPI + (VOID**)&NtFwhPpi // PPI ); ASSERT_EFI_ERROR (Status); diff --git a/Nt32Pkg/WinNtThunkDxe/WinNtThunk.h b/Nt32Pkg/WinNtThunkDxe/WinNtThunk.h index 50022076e9..355d5723cc 100644 --- a/Nt32Pkg/WinNtThunkDxe/WinNtThunk.h +++ b/Nt32Pkg/WinNtThunkDxe/WinNtThunk.h @@ -31,4 +31,4 @@ typedef struct { EFI_DEVICE_PATH_PROTOCOL EndDevicePath; } WIN_NT_THUNK_DEVICE_PATH; -#endif \ No newline at end of file +#endif diff --git a/Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocol.c b/Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocol.c index f9ef724bea..4b044b6661 100644 --- a/Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocol.c +++ b/Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocol.c @@ -69,11 +69,11 @@ Returns: DEBUG ((EFI_D_ERROR, "NT 32 WinNT Stuff PEIM Loaded\n")); Status = (**PeiServices).LocatePpi ( - PeiServices, + (const EFI_PEI_SERVICES **)PeiServices, &gPeiNtThunkPpiGuid, // GUID 0, // INSTANCE &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR - &PeiNtService // PPI + (VOID**)&PeiNtService // PPI ); ASSERT_EFI_ERROR (Status); -- 2.39.2