/**@file\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
ASSERT (CpuVerStrLen <= SMBIOS_STRING_MAX_LENGTH);\r
\r
\r
- TotalSize = sizeof(SMBIOS_TABLE_TYPE4) + CpuVerStrLen + 1 + 1;\r
+ TotalSize = (UINT32)(sizeof(SMBIOS_TABLE_TYPE4) + CpuVerStrLen + 1 + 1);\r
SmbiosRecord = AllocatePool(TotalSize);\r
ZeroMem(SmbiosRecord, TotalSize);\r
\r
/**@file\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
}\r
\r
Width = (EFI_CPU_IO_PROTOCOL_WIDTH)(Width & 0x03);\r
- if (Address - 1 + (1 << Width) * Count > Limit) {\r
+ if (Address - 1 + ((UINTN)1 << Width) * Count > Limit) {\r
return EFI_UNSUPPORTED;\r
}\r
\r
- AlignMask = (1 << Width) - 1;\r
+ AlignMask = ((UINTN)1 << Width) - 1;\r
if ((UINTN) Buffer & AlignMask) {\r
return EFI_UNSUPPORTED;\r
}\r
//\r
// Check input parameters\r
//\r
- if (NumOfLba == 0 || (StartingLba + NumOfLba) > NumOfBlocks) {\r
+ if ((NumOfLba == 0) || ((StartingLba + NumOfLba) > NumOfBlocks)) {\r
VA_END (args);\r
return EFI_INVALID_PARAMETER;\r
}\r
/**@file\r
\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#define GUID _WINNT_DUP_GUID_____\r
#define _LIST_ENTRY _WINNT_DUP_LIST_ENTRY_FORWARD\r
#define LIST_ENTRY _WINNT_DUP_LIST_ENTRY\r
+#if defined (MDE_CPU_IA32)\r
#define InterlockedIncrement _WINNT_DUP_InterlockedIncrement\r
#define InterlockedDecrement _WINNT_DUP_InterlockedDecrement\r
#define InterlockedCompareExchange64 _WINNT_DUP_InterlockedCompareExchange64\r
+#endif\r
#undef UNALIGNED\r
#undef CONST\r
#undef VOID\r
// WQBugBug: This typedef is to make "windows.h" buildable.\r
// It should be removed after the root cause why\r
// size_t is undefined when go into the line below is found.\r
+#if defined (MDE_CPU_IA32)\r
typedef UINT32 size_t ;\r
+#endif\r
\r
#include "windows.h"\r
\r
/** @file\r
OEM hook status code library functions with no library constructor/destructor\r
\r
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
mWinNt->WriteFile (\r
mStdOut,\r
Buffer,\r
- CharCount,\r
+ (DWORD)CharCount,\r
(LPDWORD)&CharCount,\r
NULL\r
);\r
mWinNt->WriteFile (\r
mStdOut,\r
Buffer,\r
- CharCount,\r
+ (DWORD)CharCount,\r
(LPDWORD)&CharCount,\r
NULL\r
);\r
/**@file\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
SizeOfHeaders = 0;\r
}\r
\r
- return SizeOfHeaders;\r
+ return (UINT32) SizeOfHeaders;\r
}\r
\r
/** @file\r
OEM hook status code library functions with no library constructor/destructor\r
\r
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
mWinNt->WriteFile (\r
mStdOut,\r
Buffer,\r
- CharCount,\r
+ (DWORD)CharCount,\r
(LPDWORD)&CharCount,\r
NULL\r
);\r
mWinNt->WriteFile (\r
mStdOut,\r
Buffer,\r
- CharCount,\r
+ (DWORD)CharCount,\r
(LPDWORD)&CharCount,\r
NULL\r
);\r
PLATFORM_VERSION = 0.4\r
DSC_SPECIFICATION = 0x00010005\r
OUTPUT_DIRECTORY = Build/NT32\r
- SUPPORTED_ARCHITECTURES = IA32\r
+ SUPPORTED_ARCHITECTURES = IA32|X64\r
BUILD_TARGETS = DEBUG|RELEASE\r
SKUID_IDENTIFIER = DEFAULT\r
FLASH_DEFINITION = Nt32Pkg/Nt32Pkg.fdf\r
PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf\r
DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf\r
CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf\r
+ LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf\r
\r
!if $(SECURE_BOOT_ENABLE) == TRUE\r
PlatformSecureLib|Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.inf\r
[PcdsFeatureFlag]\r
gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|FALSE\r
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplBuildPageTables|FALSE\r
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst|FALSE\r
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics|TRUE\r
\r
################################################################################\r
[PcdsDynamicDefault.common.DEFAULT]\r
gEfiNt32PkgTokenSpaceGuid.PcdWinNtSerialPort|L"COM1!COM2"|VOID*|20\r
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L".!..\..\..\..\EdkShellBinPkg\Bin\Ia32\Apps"|VOID*|106\r
gEfiNt32PkgTokenSpaceGuid.PcdWinNtGop|L"UGA Window 1!UGA Window 2"|VOID*|52\r
gEfiNt32PkgTokenSpaceGuid.PcdWinNtConsole|L"Bus Driver Console Window"|VOID*|52\r
gEfiNt32PkgTokenSpaceGuid.PcdWinNtVirtualDisk|L"FW;40960;512"|VOID*|26\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0\r
\r
+[PcdsDynamicDefault.Ia32]\r
+ gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L".!..\..\..\..\EdkShellBinPkg\Bin\Ia32\Apps"|VOID*|106\r
+\r
+[PcdsDynamicDefault.x64]\r
+ gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L".!..\..\..\..\EdkShellBinPkg\Bin\X64\Apps"|VOID*|106\r
+\r
[PcdsDynamicHii.common.DEFAULT]\r
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutColumn|L"SetupConsoleConfig"|gEfiNt32PkgTokenSpaceGuid|0x0|80\r
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutRow|L"SetupConsoleConfig"|gEfiNt32PkgTokenSpaceGuid|0x4|25\r
# generated for it, but the binary will not be put into any firmware volume.\r
#\r
###################################################################################################\r
-[Components.IA32]\r
+[Components]\r
##\r
# SEC Phase modules\r
##\r
- Nt32Pkg/Sec/SecMain.inf\r
+ Nt32Pkg/Sec/SecMain.inf {\r
+ <BuildOptions>\r
+ # Add override here, because default X64_CC_FLAGS is already overriden in DSC\r
+ MSFT:*_*_X64_CC_FLAGS == /nologo /W4 /WX /Gy /c /D UNICODE /Od /FIAutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE\r
+ }\r
\r
##\r
# PEI Phase modules\r
NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf\r
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
<BuildOptions>\r
- *_*_IA32_CC_FLAGS =\r
+ *_*_*_CC_FLAGS =\r
}\r
\r
MdeModulePkg/Universal/PCD/Dxe/Pcd.inf {\r
#\r
###################################################################################################\r
[BuildOptions]\r
- DEBUG_*_IA32_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000 /ALIGN:4096 /FILEALIGN:4096 /SUBSYSTEM:CONSOLE\r
- RELEASE_*_IA32_DLINK_FLAGS = /ALIGN:4096 /FILEALIGN:4096\r
+ DEBUG_*_*_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000 /ALIGN:4096 /FILEALIGN:4096 /SUBSYSTEM:CONSOLE\r
+ RELEASE_*_*_DLINK_FLAGS = /ALIGN:4096 /FILEALIGN:4096\r
*_*_IA32_CC_FLAGS = /D EFI_SPECIFICATION_VERSION=0x0002000A /D TIANO_RELEASE_VERSION=0x00080006\r
\r
+# Add override here, because default X64_CC_FLAGS add /X\r
+ DEBUG_*_X64_CC_FLAGS == /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /D EFI_SPECIFICATION_VERSION=0x0002000A /D TIANO_RELEASE_VERSION=0x00080006\r
+RELEASE_*_X64_CC_FLAGS == /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /D EFI_SPECIFICATION_VERSION=0x0002000A /D TIANO_RELEASE_VERSION=0x00080006\r
+NOOPT_*_X64_CC_FLAGS == /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od /D EFI_SPECIFICATION_VERSION=0x0002000A /D TIANO_RELEASE_VERSION=0x00080006\r
+\r
#############################################################################################################\r
# NOTE:\r
-# The following [Libraries.IA32] section is for building EDK module under the EDKII tool chain.\r
-# If you want build EDK module for Nt32 platform, please uncomment [Libraries.IA32] section and\r
+# The following [Libraries] section is for building EDK module under the EDKII tool chain.\r
+# If you want build EDK module for Nt32 platform, please uncomment [Libraries] section and\r
# libraries used by that EDK module.\r
# Currently, Nt32 platform do not has any EDK style module\r
#\r
#\r
-#[Libraries.IA32]\r
+#[Libraries]\r
#\r
# Libraries common to PEI and DXE\r
#\r
# for binary shell, binary fat and logo module.\r
#\r
################################################################################\r
-FILE APPLICATION = PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile) {\r
- SECTION PE32 = EdkShellBinPkg/FullShell/Ia32/Shell_Full.efi\r
- }\r
+INF EdkShellBinPkg/FullShell/FullShell.inf\r
\r
-FILE DRIVER = 961578FE-B6B7-44c3-AF35-6BC705CD2B1F {\r
- SECTION PE32 = FatBinPkg/EnhancedFatDxe/Ia32/Fat.efi\r
- }\r
+INF FatBinPkg/EnhancedFatDxe/Fat.inf\r
\r
FILE FREEFORM = PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile) {\r
SECTION RAW = MdeModulePkg/Logo/Logo.bmp\r
}\r
}\r
}\r
+\r
+[Rule.Common.UEFI_APPLICATION.BINARY]\r
+ FILE APPLICATION = $(NAMED_GUID) {\r
+ COMPRESS PI_STD {\r
+ GUIDED {\r
+ PE32 PE32 |.efi\r
+ UI STRING="$(MODULE_NAME)" Optional\r
+ VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
+ }\r
+ }\r
+ }\r
+\r
+[Rule.Common.UEFI_DRIVER.BINARY]\r
+ FILE DRIVER = $(NAMED_GUID) {\r
+ DXE_DEPEX DXE_DEPEX Optional |.depex\r
+ COMPRESS PI_STD {\r
+ GUIDED {\r
+ PE32 PE32 |.efi\r
+ UI STRING="$(MODULE_NAME)" Optional\r
+ VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
+ }\r
+ }\r
+ }\r
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext\r
);\r
\r
+VOID\r
+EFIAPI\r
+PeiSwitchStacks (\r
+ IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r
+ IN VOID *Context1, OPTIONAL\r
+ IN VOID *Context2, OPTIONAL\r
+ IN VOID *Context3, OPTIONAL\r
+ IN VOID *NewStack\r
+ );\r
+\r
VOID\r
SecPrint (\r
CHAR8 *Format,\r
WriteFile (\r
GetStdHandle (STD_OUTPUT_HANDLE), \r
Buffer,\r
- CharCount,\r
+ (DWORD)CharCount,\r
(LPDWORD)&CharCount,\r
NULL\r
);\r
return EFI_SUCCESS;\r
}\r
\r
+#if defined (MDE_CPU_IA32)\r
/**\r
Transfers control to a function starting with a new stack.\r
\r
//\r
ASSERT (FALSE); \r
}\r
+#endif\r
\r
VOID\r
SecLoadFromCore (\r
WinNtThunk.c\r
FwVol.c\r
SecMain.c\r
+\r
+[Sources.ia32]\r
Stack.asm\r
\r
+[Sources.x64]\r
+ StackX64.asm\r
+\r
[Packages]\r
MdePkg/MdePkg.dec\r
MdeModulePkg/MdeModulePkg.dec\r
MSFT:*_*_IA32_ASM_FLAGS == /nologo /W3 /WX /c /coff /Cx /Zd /W0 /Zi\r
MSFT:*_*_IA32_ASMLINK_FLAGS == /link /nologo /tiny\r
\r
+ MSFT:*_*_X64_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib\AMD64" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib\AMD64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib\r
+ MSFT:*_*_X64_CC_FLAGS == /nologo /W4 /WX /Gy /c /D UNICODE /Od /FIAutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE\r
+ MSFT:*_*_X64_PP_FLAGS == /nologo /E /TC /FIAutoGen.h\r
+ MSFT:*_*_X64_ASM_FLAGS == /nologo /W3 /WX /c /Cx /Zd /W0 /Zi\r
+ MSFT:*_*_X64_ASMLINK_FLAGS == /link /nologo\r
+\r
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\r
INTEL:*_*_IA32_CC_FLAGS == /nologo /W4 /WX /Gy /c /D UNICODE /Od /FIAutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE\r
INTEL:*_*_IA32_PP_FLAGS == /nologo /E /TC /FIAutoGen.h\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r
+; This program and the accompanying materials\r
+; are licensed and made available under the terms and conditions of the BSD License\r
+; which accompanies this distribution. The full text of the license may be found at\r
+; http://opensource.org/licenses/bsd-license.php\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+; Module Name:\r
+;\r
+; Stack.asm\r
+;\r
+; Abstract:\r
+;\r
+; Switch the stack from temporary memory to permenent memory.\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+ \r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; SecSwitchStack (\r
+; UINT32 TemporaryMemoryBase,\r
+; UINT32 PermenentMemoryBase\r
+; );\r
+;------------------------------------------------------------------------------ \r
+SecSwitchStack PROC\r
+ mov [rsp + 08h], rcx\r
+ mov [rsp + 10h], rdx\r
+\r
+ ;\r
+ ; Save three register: eax, ebx, ecx\r
+ ;\r
+ push rax\r
+ push rbx\r
+ push rcx\r
+ push rdx\r
+ \r
+ ;\r
+ ; !!CAUTION!! this function address's is pushed into stack after\r
+ ; migration of whole temporary memory, so need save it to permenent\r
+ ; memory at first!\r
+ ;\r
+ \r
+ mov rbx, [rsp + 28h] ; Save the first parameter\r
+ mov rcx, [rsp + 30h] ; Save the second parameter\r
+ \r
+ ;\r
+ ; Save this function's return address into permenent memory at first.\r
+ ; Then, Fixup the esp point to permenent memory\r
+ ;\r
+ mov rax, rsp\r
+ sub rax, rbx\r
+ add rax, rcx\r
+ mov rdx, qword ptr [rsp] ; copy pushed register's value to permenent memory\r
+ mov qword ptr [rax], rdx \r
+ mov rdx, qword ptr [rsp + 8]\r
+ mov qword ptr [rax + 8], rdx \r
+ mov rdx, qword ptr [rsp + 10h]\r
+ mov qword ptr [rax + 10h], rdx \r
+ mov rdx, qword ptr [rsp + 18h]\r
+ mov qword ptr [rax + 18h], rdx \r
+ mov rdx, qword ptr [rsp + 20h] ; Update this function's return address into permenent memory\r
+ mov qword ptr [rax + 20h], rdx \r
+ mov rsp, rax ; From now, esp is pointed to permenent memory\r
+ \r
+ ;\r
+ ; Fixup the ebp point to permenent memory\r
+ ;\r
+ mov rax, rbp\r
+ sub rax, rbx\r
+ add rax, rcx\r
+ mov rbp, rax ; From now, ebp is pointed to permenent memory\r
+ \r
+ pop rdx\r
+ pop rcx\r
+ pop rbx\r
+ pop rax\r
+ ret\r
+SecSwitchStack ENDP\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; PeiSwitchStacks (\r
+; IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r
+; IN VOID *Context1, OPTIONAL\r
+; IN VOID *Context2, OPTIONAL\r
+; IN VOID *Context3, OPTIONAL\r
+; IN VOID *NewStack\r
+; )\r
+;------------------------------------------------------------------------------\r
+PeiSwitchStacks PROC\r
+ mov rax, rcx\r
+ mov rcx, rdx\r
+ mov rdx, r8\r
+ mov r8, r9\r
+ mov rsp, [rsp + 28h]\r
+ sub rsp, 20h\r
+ call rax\r
+ jmp $\r
+ ret\r
+PeiSwitchStacks ENDP\r
+\r
+ END\r
/** @file\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
ReturnValue = GlobalData->NtNetUtilityTable.SetReceiveFilter (\r
Instance->InterfaceInfo.InterfaceIndex,\r
EnableBits,\r
- McastFilterCount,\r
+ (UINT32)McastFilterCount,\r
McastFilter\r
);\r
\r
{\r
\r
if (TxBuffer != NULL) {\r
- *((UINT8 **) TxBuffer) = (UINT8 *) 1;\r
+ *((UINT8 **) TxBuffer) = (UINT8 *)(UINTN) 1;\r
}\r
\r
if (InterruptStatus != NULL) {\r
\r
ReturnValue = GlobalData->NtNetUtilityTable.Transmit (\r
Instance->InterfaceInfo.InterfaceIndex,\r
- HeaderSize,\r
- BufferSize,\r
+ (UINT32)HeaderSize,\r
+ (UINT32)BufferSize,\r
Buffer,\r
SrcAddr,\r
DestAddr,\r
//\r
// Set the interface information.\r
//\r
- Instance->InterfaceInfo = NetInterfaceInfoBuffer[Index];\r
+ CopyMem (&Instance->InterfaceInfo, &NetInterfaceInfoBuffer[Index], sizeof(Instance->InterfaceInfo));\r
//\r
// Initialize this instance\r
//\r
//\r
// Copy Current/PermanentAddress MAC address\r
//\r
- Instance->Mode.CurrentAddress = Instance->InterfaceInfo.MacAddr;\r
- Instance->Mode.PermanentAddress = Instance->InterfaceInfo.MacAddr;\r
+ CopyMem (&Instance->Mode.CurrentAddress, &Instance->InterfaceInfo.MacAddr, sizeof(Instance->Mode.CurrentAddress));\r
+ CopyMem (&Instance->Mode.PermanentAddress, &Instance->InterfaceInfo.MacAddr, sizeof(Instance->Mode.PermanentAddress));\r
\r
//\r
// Since the fake SNP is based on a real NIC, to avoid conflict with the host\r
/**@file\r
EFI_PEI_STALL implementation for NT32 simulation environment.\r
\r
-Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
// so micro second units need be divided by 1000 to convert to ms\r
//\r
NtThunk = (EFI_WIN_NT_THUNK_PROTOCOL*) PeiNtService->NtThunk();\r
- NtThunk->Sleep ((Microseconds + 999) / 1000); \r
+ NtThunk->Sleep ((DWORD)((Microseconds + 999) / 1000)); \r
\r
return EFI_SUCCESS;\r
}\r
BlockIo = &Private->BlockIo;\r
BlockIo->Revision = EFI_BLOCK_IO_PROTOCOL_REVISION;\r
BlockIo->Media = &Private->Media;\r
- BlockIo->Media->BlockSize = Private->BlockSize;\r
+ BlockIo->Media->BlockSize = (UINT32)Private->BlockSize;\r
BlockIo->Media->LastBlock = Private->NumberOfBlocks - 1;\r
BlockIo->Media->MediaId = 0;;\r
\r
//\r
Private->NtHandle = Private->WinNtThunk->CreateFile (\r
Private->Filename,\r
- Private->ReadMode,\r
- Private->ShareMode,\r
+ (DWORD)Private->ReadMode,\r
+ (DWORD)Private->ShareMode,\r
NULL,\r
- Private->OpenMode,\r
+ (DWORD)Private->OpenMode,\r
0,\r
NULL\r
);\r
Status = SetFilePointer64 (Private, 0, &FileSize, FILE_END);\r
\r
if (EFI_ERROR (Status)) {\r
- FileSize = MultU64x32 (Private->NumberOfBlocks, Private->BlockSize);\r
+ FileSize = MultU64x32 (Private->NumberOfBlocks, (UINT32)Private->BlockSize);\r
if (Private->DeviceType == EfiWinNtVirtualDisks) {\r
DEBUG ((EFI_D_ERROR, "PlOpenBlock: Could not get filesize of %s\n", Private->Filename));\r
Status = EFI_UNSUPPORTED;\r
}\r
\r
if (Private->NumberOfBlocks == 0) {\r
- Private->NumberOfBlocks = DivU64x32 (FileSize, Private->BlockSize);\r
+ Private->NumberOfBlocks = DivU64x32 (FileSize, (UINT32)Private->BlockSize);\r
}\r
\r
- EndOfFile = MultU64x32 (Private->NumberOfBlocks, Private->BlockSize);\r
+ EndOfFile = MultU64x32 (Private->NumberOfBlocks, (UINT32)Private->BlockSize);\r
\r
if (FileSize != EndOfFile) {\r
//\r
return EFI_MEDIA_CHANGED;\r
}\r
\r
- if ((UINT32) Buffer % Private->Media.IoAlign != 0) {\r
+ if ((UINTN) Buffer % Private->Media.IoAlign != 0) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
//\r
// Seek to End of File\r
//\r
- DistanceToMove = MultU64x32 (Lba, BlockSize);\r
+ DistanceToMove = MultU64x32 (Lba, (UINT32)BlockSize);\r
Status = SetFilePointer64 (Private, DistanceToMove, &DistanceMoved, FILE_BEGIN);\r
\r
if (EFI_ERROR (Status)) {\r
/** @file\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
//\r
// Adjust the window size\r
//\r
- Private->WinNtThunk->MoveWindow (Private->WindowHandle, Rect.left, Rect.top, Width, Height, TRUE);\r
+ Private->WinNtThunk->MoveWindow (Private->WindowHandle, Rect.left, Rect.top, (INT32)Width, (INT32)Height, TRUE);\r
\r
}\r
\r
//\r
// Mark the area we just blted as Invalid so WM_PAINT will update.\r
//\r
- Rect.left = DestinationX;\r
- Rect.top = DestinationY;\r
- Rect.right = DestinationX + Width;\r
- Rect.bottom = DestinationY + Height;\r
+ Rect.left = (LONG)DestinationX;\r
+ Rect.top = (LONG)DestinationY;\r
+ Rect.right = (LONG)(DestinationX + Width);\r
+ Rect.bottom = (LONG)(DestinationY + Height);\r
Private->WinNtThunk->InvalidateRect (Private->WindowHandle, &Rect, FALSE);\r
\r
//\r
Private->WindowsClass.hInstance = NULL;\r
Private->WindowsClass.hIcon = Private->WinNtThunk->LoadIcon (NULL, IDI_APPLICATION);\r
Private->WindowsClass.hCursor = Private->WinNtThunk->LoadCursor (NULL, IDC_ARROW);\r
- Private->WindowsClass.hbrBackground = (HBRUSH) COLOR_WINDOW;\r
+ Private->WindowsClass.hbrBackground = (HBRUSH)(UINTN)COLOR_WINDOW;\r
Private->WindowsClass.lpszMenuName = NULL;\r
Private->WindowsClass.lpszClassName = WIN_NT_GOP_CLASS_NAME;\r
Private->WindowsClass.hIconSm = Private->WinNtThunk->LoadIcon (NULL, IDI_APPLICATION);\r
Private->WinNtThunk->DispatchMessage (&Message);\r
}\r
\r
- return Message.wParam;\r
+ return (DWORD)Message.wParam;\r
}\r
\r
\r
/**@file\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
Status = PrivateFile->WinNtThunk->ReadFile (\r
PrivateFile->LHandle,\r
Buffer,\r
- *BufferSize,\r
+ (DWORD)*BufferSize,\r
(LPDWORD)BufferSize,\r
NULL\r
) ? EFI_SUCCESS : EFI_DEVICE_ERROR;\r
Status = PrivateFile->WinNtThunk->WriteFile (\r
PrivateFile->LHandle,\r
Buffer,\r
- *BufferSize,\r
+ (DWORD)*BufferSize,\r
(LPDWORD)BufferSize,\r
NULL\r
) ? EFI_SUCCESS : EFI_DEVICE_ERROR;\r