summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e935092)
2) replace StrCpy() usage in Variable driver with StrnCpy().
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15770
6f19259b-4bc3-4df7-8a09-
765794883524
28 files changed:
&Supports\r
);\r
if (!EFI_ERROR (Status)) {\r
&Supports\r
);\r
if (!EFI_ERROR (Status)) {\r
- Supports &= EFI_PCI_DEVICE_ENABLE;\r
+ Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
Status = PciIo->Attributes (\r
PciIo,\r
EfiPciIoAttributeOperationEnable,\r
Status = PciIo->Attributes (\r
PciIo,\r
EfiPciIoAttributeOperationEnable,\r
&Supports\r
);\r
if (!EFI_ERROR (Status)) {\r
&Supports\r
);\r
if (!EFI_ERROR (Status)) {\r
- Supports &= EFI_PCI_DEVICE_ENABLE;\r
+ Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
PciIo->Attributes (\r
PciIo,\r
EfiPciIoAttributeOperationDisable,\r
PciIo->Attributes (\r
PciIo,\r
EfiPciIoAttributeOperationDisable,\r
and companion host controller when UHCI or OHCI gets attached earlier than EHCI and a \r
USB 2.0 device inserts.\r
\r
and companion host controller when UHCI or OHCI gets attached earlier than EHCI and a \r
USB 2.0 device inserts.\r
\r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, 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
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
&Supports\r
);\r
if (!EFI_ERROR (Status)) {\r
&Supports\r
);\r
if (!EFI_ERROR (Status)) {\r
- Supports &= EFI_PCI_DEVICE_ENABLE;\r
+ Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
Status = PciIo->Attributes (\r
PciIo,\r
EfiPciIoAttributeOperationEnable,\r
Status = PciIo->Attributes (\r
PciIo,\r
EfiPciIoAttributeOperationEnable,\r
);\r
\r
if (!EFI_ERROR (Status)) {\r
);\r
\r
if (!EFI_ERROR (Status)) {\r
- Supports &= EFI_PCI_DEVICE_ENABLE;\r
+ Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
Status = PciIo->Attributes (\r
PciIo,\r
EfiPciIoAttributeOperationEnable,\r
Status = PciIo->Attributes (\r
PciIo,\r
EfiPciIoAttributeOperationEnable,\r
/** @file\r
Supporting functions implementaion for PCI devices management.\r
\r
/** @file\r
Supporting functions implementaion for PCI devices management.\r
\r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, 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
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
- Supports &= EFI_PCI_DEVICE_ENABLE;\r
+ Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
PciIoDevice->PciIo.Attributes (\r
&(PciIoDevice->PciIo),\r
EfiPciIoAttributeOperationEnable,\r
PciIoDevice->PciIo.Attributes (\r
&(PciIoDevice->PciIo),\r
EfiPciIoAttributeOperationEnable,\r
- Supports &= EFI_PCI_DEVICE_ENABLE;\r
+ Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
PciIoDevice->PciIo.Attributes (\r
&(PciIoDevice->PciIo),\r
EfiPciIoAttributeOperationEnable,\r
PciIoDevice->PciIo.Attributes (\r
&(PciIoDevice->PciIo),\r
EfiPciIoAttributeOperationEnable,\r
\r
if (Option == EFI_SET_SUPPORTS) {\r
\r
\r
if (Option == EFI_SET_SUPPORTS) {\r
\r
- Attributes |= EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE |\r
+ Attributes |= (UINT64) (EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE |\r
EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED |\r
EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE |\r
EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE |\r
EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM |\r
EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED |\r
EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE |\r
EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE |\r
EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM |\r
- EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE;\r
+ EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE);\r
\r
if (IS_PCI_LPC (&PciIoDevice->Pci)) {\r
Attributes |= EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO;\r
\r
if (IS_PCI_LPC (&PciIoDevice->Pci)) {\r
Attributes |= EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO;\r
//\r
// Assume the PCI Root Bridge supports DAC\r
//\r
//\r
// Assume the PCI Root Bridge supports DAC\r
//\r
- PciIoDevice->Supports |= (EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE |\r
+ PciIoDevice->Supports |= (UINT64)(EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE |\r
EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM |\r
EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE);\r
\r
EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM |\r
EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE);\r
\r
//\r
if (Operation == EfiPciIoAttributeOperationEnable) {\r
PCI_DISABLE_COMMAND_REGISTER (Temp, EFI_PCI_COMMAND_VGA_PALETTE_SNOOP);\r
//\r
if (Operation == EfiPciIoAttributeOperationEnable) {\r
PCI_DISABLE_COMMAND_REGISTER (Temp, EFI_PCI_COMMAND_VGA_PALETTE_SNOOP);\r
- Temp->Attributes &= (~EFI_PCI_COMMAND_VGA_PALETTE_SNOOP);\r
+ Temp->Attributes &= (~(UINT64)EFI_PCI_COMMAND_VGA_PALETTE_SNOOP);\r
} else {\r
return EFI_UNSUPPORTED;\r
}\r
} else {\r
return EFI_UNSUPPORTED;\r
}\r
\r
The UHCI driver model and HC protocol routines.\r
\r
\r
The UHCI driver model and HC protocol routines.\r
\r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2014, 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
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
&Supports\r
);\r
if (!EFI_ERROR (Status)) {\r
&Supports\r
);\r
if (!EFI_ERROR (Status)) {\r
- Supports &= EFI_PCI_DEVICE_ENABLE;\r
+ Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
Status = PciIo->Attributes (\r
PciIo,\r
EfiPciIoAttributeOperationEnable,\r
Status = PciIo->Attributes (\r
PciIo,\r
EfiPciIoAttributeOperationEnable,\r
&Supports\r
);\r
if (!EFI_ERROR (Status)) {\r
&Supports\r
);\r
if (!EFI_ERROR (Status)) {\r
- Supports &= EFI_PCI_DEVICE_ENABLE;\r
+ Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
Status = PciIo->Attributes (\r
PciIo,\r
EfiPciIoAttributeOperationEnable,\r
Status = PciIo->Attributes (\r
PciIo,\r
EfiPciIoAttributeOperationEnable,\r
((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingSeg0,\r
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER\r
);\r
((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingSeg0,\r
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER\r
);\r
- PhyAddr &= ~(0x0F);\r
- PhyAddr |= ((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;\r
+ PhyAddr &= ~((EFI_PHYSICAL_ADDRESS)0x0F);\r
+ PhyAddr |= (EFI_PHYSICAL_ADDRESS)((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;\r
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);\r
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);\r
\r
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);\r
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);\r
\r
((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingSeg0,\r
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER\r
);\r
((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingSeg0,\r
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER\r
);\r
- PhyAddr &= ~(0x0F);\r
- PhyAddr |= ((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;\r
+ PhyAddr &= ~((EFI_PHYSICAL_ADDRESS)0x0F);\r
+ PhyAddr |= (EFI_PHYSICAL_ADDRESS)((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;\r
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);\r
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);\r
\r
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);\r
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);\r
\r
((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingSeg0,\r
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER\r
);\r
((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingSeg0,\r
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER\r
);\r
- PhyAddr &= ~(0x0F);\r
- PhyAddr |= ((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;\r
+ PhyAddr &= ~((EFI_PHYSICAL_ADDRESS)0x0F);\r
+ PhyAddr |= (EFI_PHYSICAL_ADDRESS)((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;\r
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);\r
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);\r
\r
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);\r
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);\r
\r
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER\r
);\r
\r
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER\r
);\r
\r
- PhyAddr &= ~(0x0F);\r
- PhyAddr |= ((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;\r
+ PhyAddr &= ~((EFI_PHYSICAL_ADDRESS)0x0F);\r
+ PhyAddr |= (EFI_PHYSICAL_ADDRESS)((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;\r
\r
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);\r
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);\r
\r
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);\r
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);\r
CoreAcquireEventLock ();\r
}\r
\r
CoreAcquireEventLock ();\r
}\r
\r
- gEventPending &= ~(1 << Priority);\r
+ gEventPending &= ~(UINTN)(1 << Priority);\r
CoreReleaseEventLock ();\r
}\r
\r
CoreReleaseEventLock ();\r
}\r
\r
/** @file\r
UEFI Memory page management functions.\r
\r
/** @file\r
UEFI Memory page management functions.\r
\r
-Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2014, 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
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
// Set MaxAddress to a page boundary\r
//\r
//\r
// Set MaxAddress to a page boundary\r
//\r
- MaxAddress &= ~EFI_PAGE_MASK;\r
+ MaxAddress &= ~(UINT64)EFI_PAGE_MASK;\r
\r
//\r
// Set MaxAddress to end of the page\r
\r
//\r
// Set MaxAddress to end of the page\r
/** @file\r
UEFI Memory pool management functions.\r
\r
/** @file\r
UEFI Memory pool management functions.\r
\r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, 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
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
if (Index >= MAX_POOL_LIST) {\r
NoPages = EFI_SIZE_TO_PAGES(Size) + EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1;\r
//\r
if (Index >= MAX_POOL_LIST) {\r
NoPages = EFI_SIZE_TO_PAGES(Size) + EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1;\r
- NoPages &= ~(EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1);\r
+ NoPages &= ~(UINTN)(EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1);\r
Head = CoreAllocatePoolPages (PoolType, NoPages, DEFAULT_PAGE_ALLOCATION);\r
goto Done;\r
}\r
Head = CoreAllocatePoolPages (PoolType, NoPages, DEFAULT_PAGE_ALLOCATION);\r
goto Done;\r
}\r
// Return the memory pages back to free memory\r
//\r
NoPages = EFI_SIZE_TO_PAGES(Size) + EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1;\r
// Return the memory pages back to free memory\r
//\r
NoPages = EFI_SIZE_TO_PAGES(Size) + EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1;\r
- NoPages &= ~(EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1);\r
+ NoPages &= ~(UINTN)(EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1);\r
CoreFreePoolPages ((EFI_PHYSICAL_ADDRESS) (UINTN) Head, NoPages);\r
\r
} else {\r
CoreFreePoolPages ((EFI_PHYSICAL_ADDRESS) (UINTN) Head, NoPages);\r
\r
} else {\r
// Align buffer on section boundry\r
//\r
ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;\r
// Align buffer on section boundry\r
//\r
ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;\r
- ImageContext.ImageAddress &= ~(ImageContext.SectionAlignment - 1);\r
+ ImageContext.ImageAddress &= ~((EFI_PHYSICAL_ADDRESS)(ImageContext.SectionAlignment - 1));\r
\r
//\r
// Load the image to our new buffer\r
\r
//\r
// Load the image to our new buffer\r
/** @file\r
SMM IPL that produces SMM related runtime protocols and load the SMM Core into SMRAM\r
\r
/** @file\r
SMM IPL that produces SMM related runtime protocols and load the SMM Core into SMRAM\r
\r
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available \r
under the terms and conditions of the BSD License which accompanies this \r
distribution. The full text of the license may be found at \r
This program and the accompanying materials are licensed and made available \r
under the terms and conditions of the BSD License which accompanies this \r
distribution. The full text of the license may be found at \r
}\r
\r
ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;\r
}\r
\r
ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;\r
- ImageContext.ImageAddress &= ~(ImageContext.SectionAlignment - 1);\r
+ ImageContext.ImageAddress &= ~((EFI_PHYSICAL_ADDRESS)(ImageContext.SectionAlignment - 1));\r
\r
//\r
// Print debug message showing SMM Core load address.\r
\r
//\r
// Print debug message showing SMM Core load address.\r
/** @file\r
16550 UART Serial Port library functions\r
\r
/** @file\r
16550 UART Serial Port library functions\r
\r
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2014, 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
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
SerialPortWriteRegister (R_UART_LCR, (UINT8)(SerialPortReadRegister (R_UART_LCR) | B_UART_LCR_DLAB));\r
Divisor = SerialPortReadRegister (R_UART_BAUD_HIGH) << 8;\r
}\r
SerialPortWriteRegister (R_UART_LCR, (UINT8)(SerialPortReadRegister (R_UART_LCR) | B_UART_LCR_DLAB));\r
Divisor = SerialPortReadRegister (R_UART_BAUD_HIGH) << 8;\r
- Divisor |= SerialPortReadRegister (R_UART_BAUD_LOW);\r
+ Divisor |= (UINTN)SerialPortReadRegister (R_UART_BAUD_LOW);\r
SerialPortWriteRegister (R_UART_LCR, (UINT8)(SerialPortReadRegister (R_UART_LCR) & ~B_UART_LCR_DLAB));\r
if (Divisor != 115200 / PcdGet32 (PcdSerialBaudRate)) {\r
Initialized = FALSE;\r
SerialPortWriteRegister (R_UART_LCR, (UINT8)(SerialPortReadRegister (R_UART_LCR) & ~B_UART_LCR_DLAB));\r
if (Divisor != 115200 / PcdGet32 (PcdSerialBaudRate)) {\r
Initialized = FALSE;\r
protocol related to this implementation, not in the public spec. So, this \r
library instance is only for this code base.\r
\r
protocol related to this implementation, not in the public spec. So, this \r
library instance is only for this code base.\r
\r
-Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2014, 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
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
// Clear all the flag bits except those that may have been passed in\r
//\r
//\r
// Clear all the flag bits except those that may have been passed in\r
//\r
- Flags &= (OUTPUT_UNICODE | FORMAT_UNICODE | COUNT_ONLY_NO_PRINT);\r
+ Flags &= (UINTN)(OUTPUT_UNICODE | FORMAT_UNICODE | COUNT_ONLY_NO_PRINT);\r
\r
//\r
// Set the default width to zero, and the default precision to 1\r
\r
//\r
// Set the default width to zero, and the default precision to 1\r
//\r
// Flag space, +, 0, L & l are invalid for type p.\r
//\r
//\r
// Flag space, +, 0, L & l are invalid for type p.\r
//\r
- Flags &= ~(PREFIX_BLANK | PREFIX_SIGN | PREFIX_ZERO | LONG_TYPE);\r
+ Flags &= ~(UINTN)(PREFIX_BLANK | PREFIX_SIGN | PREFIX_ZERO | LONG_TYPE);\r
if (sizeof (VOID *) > 4) {\r
Flags |= LONG_TYPE;\r
}\r
if (sizeof (VOID *) > 4) {\r
Flags |= LONG_TYPE;\r
}\r
if ((Flags & RADIX_HEX) == 0) {\r
Radix = 10;\r
if (Comma) {\r
if ((Flags & RADIX_HEX) == 0) {\r
Radix = 10;\r
if (Comma) {\r
- Flags &= (~PREFIX_ZERO);\r
+ Flags &= (~(UINTN)PREFIX_ZERO);\r
Precision = 1;\r
}\r
if (Value < 0) {\r
Precision = 1;\r
}\r
if (Value < 0) {\r
ArgumentString = BASE_ARG (BaseListMarker, CHAR8 *);\r
}\r
if (ArgumentString == NULL) {\r
ArgumentString = BASE_ARG (BaseListMarker, CHAR8 *);\r
}\r
if (ArgumentString == NULL) {\r
- Flags &= (~ARGUMENT_UNICODE);\r
+ Flags &= (~(UINTN)ARGUMENT_UNICODE);\r
ArgumentString = "<null string>";\r
}\r
//\r
ArgumentString = "<null string>";\r
}\r
//\r
/** @file\r
Interpret and execute the S3 data in S3 boot script. \r
\r
/** @file\r
Interpret and execute the S3 data in S3 boot script. \r
\r
- Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
\r
switch (ScriptHeader->Width) {\r
case S3BootScriptWidthUint8:\r
\r
switch (ScriptHeader->Width) {\r
case S3BootScriptWidthUint8:\r
- *AndMask = (UINT64) *(DataPtr + 1);\r
+ *AndMask = (UINT64) (*(UINT8*) (DataPtr + 1));\r
*OrMask = (UINT64) (*DataPtr);\r
break;\r
\r
*OrMask = (UINT64) (*DataPtr);\r
break;\r
\r
/** @file\r
ACPI Sdt Protocol Driver\r
\r
/** @file\r
ACPI Sdt Protocol Driver\r
\r
- Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved. <BR>\r
+ Copyright (c) 2010 - 2014, 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
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
break;\r
case 2:\r
RealLength = *(Buffer + 1);\r
break;\r
case 2:\r
RealLength = *(Buffer + 1);\r
- RealLength |= (*(Buffer + 2)) << 8;\r
+ RealLength |= (UINTN)((*(Buffer + 2)) << 8);\r
RealLength = (RealLength << 4) | (LeadByte & 0xF);\r
break;\r
case 3:\r
RealLength = *(Buffer + 1);\r
RealLength = (RealLength << 4) | (LeadByte & 0xF);\r
break;\r
case 3:\r
RealLength = *(Buffer + 1);\r
- RealLength |= (*(Buffer + 2)) << 8;\r
- RealLength |= (*(Buffer + 3)) << 16;\r
+ RealLength |= (UINTN)((*(Buffer + 2)) << 8);\r
+ RealLength |= (UINTN)((*(Buffer + 3)) << 16);\r
RealLength = (RealLength << 4) | (LeadByte & 0xF);\r
break;\r
default:\r
RealLength = (RealLength << 4) | (LeadByte & 0xF);\r
break;\r
default:\r
This driver is dispatched by Dxe core and the driver will reload itself to ACPI reserved memory\r
in the entry point. The functionality is to interpret and restore the S3 boot script\r
\r
This driver is dispatched by Dxe core and the driver will reload itself to ACPI reserved memory\r
in the entry point. The functionality is to interpret and restore the S3 boot script\r
\r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
// Align buffer on section boundry\r
//\r
ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;\r
// Align buffer on section boundry\r
//\r
ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;\r
- ImageContext.ImageAddress &= ~(ImageContext.SectionAlignment - 1);\r
+ ImageContext.ImageAddress &= ~((EFI_PHYSICAL_ADDRESS)(ImageContext.SectionAlignment - 1));\r
//\r
// Load the image to our new buffer\r
//\r
//\r
// Load the image to our new buffer\r
//\r
if (Flag != 0) {\r
VMFLAG_SET (VmPtr, VMFLAGS_CC);\r
} else {\r
if (Flag != 0) {\r
VMFLAG_SET (VmPtr, VMFLAGS_CC);\r
} else {\r
- VMFLAG_CLEAR (VmPtr, VMFLAGS_CC);\r
+ VMFLAG_CLEAR (VmPtr, (UINT64)VMFLAGS_CC);\r
}\r
//\r
// Advance the IP\r
}\r
//\r
// Advance the IP\r
if (Flag != 0) {\r
VMFLAG_SET (VmPtr, VMFLAGS_CC);\r
} else {\r
if (Flag != 0) {\r
VMFLAG_SET (VmPtr, VMFLAGS_CC);\r
} else {\r
- VMFLAG_CLEAR (VmPtr, VMFLAGS_CC);\r
+ VMFLAG_CLEAR (VmPtr, (UINT64)VMFLAGS_CC);\r
}\r
//\r
// Advance the IP\r
}\r
//\r
// Advance the IP\r
This module contains EBC support routines that are customized based on\r
the target ia32 processor.\r
\r
This module contains EBC support routines that are customized based on\r
the target ia32 processor.\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, 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
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
VmContext.StackTop = (UINT8*)VmContext.StackPool + (STACK_REMAIN_SIZE);\r
VmContext.Gpr[0] = (UINT64)(UINTN) ((UINT8*)VmContext.StackPool + STACK_POOL_SIZE);\r
VmContext.HighStackBottom = (UINTN)VmContext.Gpr[0];\r
VmContext.StackTop = (UINT8*)VmContext.StackPool + (STACK_REMAIN_SIZE);\r
VmContext.Gpr[0] = (UINT64)(UINTN) ((UINT8*)VmContext.StackPool + STACK_POOL_SIZE);\r
VmContext.HighStackBottom = (UINTN)VmContext.Gpr[0];\r
- VmContext.Gpr[0] &= ~(sizeof (UINTN) - 1);\r
+ VmContext.Gpr[0] &= ~((VM_REGISTER)(sizeof (UINTN) - 1));\r
VmContext.Gpr[0] -= sizeof (UINTN);\r
\r
//\r
VmContext.Gpr[0] -= sizeof (UINTN);\r
\r
//\r
This module contains EBC support routines that are customized based on\r
the target x64 processor.\r
\r
This module contains EBC support routines that are customized based on\r
the target x64 processor.\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, 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
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
// Align the stack on a natural boundary.\r
//\r
//\r
// Align the stack on a natural boundary.\r
//\r
- VmContext.Gpr[0] &= ~(sizeof (UINTN) - 1);\r
+ VmContext.Gpr[0] &= ~(VM_REGISTER)(sizeof (UINTN) - 1);\r
\r
//\r
// Put a magic value in the stack gap, then adjust down again.\r
\r
//\r
// Put a magic value in the stack gap, then adjust down again.\r
\r
//\r
// Align the stack on a natural boundary\r
\r
//\r
// Align the stack on a natural boundary\r
- VmContext.Gpr[0] &= ~(sizeof(UINTN) - 1);\r
+ VmContext.Gpr[0] &= ~(VM_REGISTER)(sizeof(UINTN) - 1);\r
//\r
VmContext.LowStackTop = (UINTN) VmContext.Gpr[0];\r
\r
//\r
VmContext.LowStackTop = (UINTN) VmContext.Gpr[0];\r
\r
break;\r
\r
case EFI_HII_GIBT_EXT1:\r
break;\r
\r
case EFI_HII_GIBT_EXT1:\r
- BlockPtr += *(BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK) + sizeof (UINT8));\r
+ BlockPtr += *(UINT8*)((UINTN)BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK) + sizeof (UINT8));\r
break;\r
case EFI_HII_GIBT_EXT2:\r
CopyMem (\r
&Length16,\r
break;\r
case EFI_HII_GIBT_EXT2:\r
CopyMem (\r
&Length16,\r
- BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK) + sizeof (UINT8),\r
+ (UINT8*)((UINTN)BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK) + sizeof (UINT8)),\r
sizeof (UINT16)\r
);\r
BlockPtr += Length16;\r
sizeof (UINT16)\r
);\r
BlockPtr += Length16;\r
case EFI_HII_GIBT_EXT4:\r
CopyMem (\r
&Length32,\r
case EFI_HII_GIBT_EXT4:\r
CopyMem (\r
&Length32,\r
- BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK) + sizeof (UINT8),\r
+ (UINT8*)((UINTN)BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK) + sizeof (UINT8)),\r
sizeof (UINT32)\r
);\r
BlockPtr += Length32;\r
sizeof (UINT32)\r
);\r
BlockPtr += Length32;\r
BufferLen = BITMAP_LEN_1_BIT (LocalCell.Width, LocalCell.Height);\r
if (CharCurrent == CharValue) {\r
return WriteOutputParam (\r
BufferLen = BITMAP_LEN_1_BIT (LocalCell.Width, LocalCell.Height);\r
if (CharCurrent == CharValue) {\r
return WriteOutputParam (\r
- BlockPtr + sizeof (EFI_HII_GIBT_GLYPH_BLOCK) - sizeof (UINT8),\r
+ (UINT8*)((UINTN)BlockPtr + sizeof (EFI_HII_GIBT_GLYPH_BLOCK) - sizeof (UINT8)),\r
BufferLen,\r
&LocalCell,\r
GlyphBuffer,\r
BufferLen,\r
&LocalCell,\r
GlyphBuffer,\r
}\r
switch (((EFI_HII_IMAGE_BLOCK *) ImageBlock)->BlockType) {\r
case EFI_HII_IIBT_EXT1:\r
}\r
switch (((EFI_HII_IMAGE_BLOCK *) ImageBlock)->BlockType) {\r
case EFI_HII_IIBT_EXT1:\r
- Length8 = *(ImageBlock + sizeof (EFI_HII_IMAGE_BLOCK) + sizeof (UINT8));\r
+ Length8 = *(UINT8*)((UINTN)ImageBlock + sizeof (EFI_HII_IMAGE_BLOCK) + sizeof (UINT8));\r
ImageBlock += Length8;\r
break;\r
case EFI_HII_IIBT_EXT2:\r
CopyMem (\r
&Length16,\r
ImageBlock += Length8;\r
break;\r
case EFI_HII_IIBT_EXT2:\r
CopyMem (\r
&Length16,\r
- ImageBlock + sizeof (EFI_HII_IMAGE_BLOCK) + sizeof (UINT8),\r
+ (UINT8*)((UINTN)ImageBlock + sizeof (EFI_HII_IMAGE_BLOCK) + sizeof (UINT8)),\r
sizeof (UINT16)\r
);\r
ImageBlock += Length16;\r
sizeof (UINT16)\r
);\r
ImageBlock += Length16;\r
case EFI_HII_IIBT_EXT4:\r
CopyMem (\r
&Length32,\r
case EFI_HII_IIBT_EXT4:\r
CopyMem (\r
&Length32,\r
- ImageBlock + sizeof (EFI_HII_IMAGE_BLOCK) + sizeof (UINT8),\r
+ (UINT8*)((UINTN)ImageBlock + sizeof (EFI_HII_IMAGE_BLOCK) + sizeof (UINT8)),\r
sizeof (UINT32)\r
);\r
ImageBlock += Length32;\r
sizeof (UINT32)\r
);\r
ImageBlock += Length32;\r
if (BlockType == EFI_HII_IIBT_IMAGE_1BIT || BlockType == EFI_HII_IIBT_IMAGE_1BIT_TRANS) {\r
Output1bitPixel (\r
Image,\r
if (BlockType == EFI_HII_IIBT_IMAGE_1BIT || BlockType == EFI_HII_IIBT_IMAGE_1BIT_TRANS) {\r
Output1bitPixel (\r
Image,\r
- (UINT8 *) (ImageBlock + sizeof (EFI_HII_IIBT_IMAGE_1BIT_BLOCK) - sizeof (UINT8)),\r
+ (UINT8 *) ((UINTN)ImageBlock + sizeof (EFI_HII_IIBT_IMAGE_1BIT_BLOCK) - sizeof (UINT8)),\r
(EFI_HII_IMAGE_PALETTE_INFO *) PaletteInfo\r
);\r
} else if (BlockType == EFI_HII_IIBT_IMAGE_4BIT || BlockType == EFI_HII_IIBT_IMAGE_4BIT_TRANS) {\r
Output4bitPixel (\r
Image,\r
(EFI_HII_IMAGE_PALETTE_INFO *) PaletteInfo\r
);\r
} else if (BlockType == EFI_HII_IIBT_IMAGE_4BIT || BlockType == EFI_HII_IIBT_IMAGE_4BIT_TRANS) {\r
Output4bitPixel (\r
Image,\r
- (UINT8 *) (ImageBlock + sizeof (EFI_HII_IIBT_IMAGE_4BIT_BLOCK) - sizeof (UINT8)),\r
+ (UINT8 *) ((UINTN)ImageBlock + sizeof (EFI_HII_IIBT_IMAGE_4BIT_BLOCK) - sizeof (UINT8)),\r
(EFI_HII_IMAGE_PALETTE_INFO *) PaletteInfo\r
);\r
} else {\r
Output8bitPixel (\r
Image,\r
(EFI_HII_IMAGE_PALETTE_INFO *) PaletteInfo\r
);\r
} else {\r
Output8bitPixel (\r
Image,\r
- (UINT8 *) (ImageBlock + sizeof (EFI_HII_IIBT_IMAGE_8BIT_BLOCK) - sizeof (UINT8)),\r
+ (UINT8 *) ((UINTN)ImageBlock + sizeof (EFI_HII_IIBT_IMAGE_8BIT_BLOCK) - sizeof (UINT8)),\r
(EFI_HII_IMAGE_PALETTE_INFO *) PaletteInfo\r
);\r
}\r
(EFI_HII_IMAGE_PALETTE_INFO *) PaletteInfo\r
);\r
}\r
Implementation for EFI_HII_STRING_PROTOCOL.\r
\r
\r
Implementation for EFI_HII_STRING_PROTOCOL.\r
\r
\r
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2014, 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
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
case EFI_HII_SIBT_STRINGS_SCSU:\r
CopyMem (&StringCount, BlockHdr + sizeof (EFI_HII_STRING_BLOCK), sizeof (UINT16));\r
\r
case EFI_HII_SIBT_STRINGS_SCSU:\r
CopyMem (&StringCount, BlockHdr + sizeof (EFI_HII_STRING_BLOCK), sizeof (UINT16));\r
- StringTextPtr = BlockHdr + sizeof (EFI_HII_SIBT_STRINGS_SCSU_BLOCK) - sizeof (UINT8);\r
+ StringTextPtr = (UINT8*)((UINTN)BlockHdr + sizeof (EFI_HII_SIBT_STRINGS_SCSU_BLOCK) - sizeof (UINT8));\r
BlockSize += StringTextPtr - BlockHdr;\r
\r
for (Index = 0; Index < StringCount; Index++) {\r
BlockSize += StringTextPtr - BlockHdr;\r
\r
for (Index = 0; Index < StringCount; Index++) {\r
case EFI_HII_SIBT_STRINGS_SCSU_FONT:\r
CopyMem (\r
&StringCount,\r
case EFI_HII_SIBT_STRINGS_SCSU_FONT:\r
CopyMem (\r
&StringCount,\r
- BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),\r
+ (UINT8*)((UINTN)BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8)),\r
- StringTextPtr = BlockHdr + sizeof (EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK) - sizeof (UINT8);\r
+ StringTextPtr = (UINT8*)((UINTN)BlockHdr + sizeof (EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK) - sizeof (UINT8));\r
BlockSize += StringTextPtr - BlockHdr;\r
\r
for (Index = 0; Index < StringCount; Index++) {\r
BlockSize += StringTextPtr - BlockHdr;\r
\r
for (Index = 0; Index < StringCount; Index++) {\r
BlockSize += Offset;\r
CopyMem (\r
&StringCount,\r
BlockSize += Offset;\r
CopyMem (\r
&StringCount,\r
- BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),\r
+ (UINT8*)((UINTN)BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8)),\r
sizeof (UINT16)\r
);\r
for (Index = 0; Index < StringCount; Index++) {\r
sizeof (UINT16)\r
);\r
for (Index = 0; Index < StringCount; Index++) {\r
break;\r
\r
case EFI_HII_SIBT_SKIP1:\r
break;\r
\r
case EFI_HII_SIBT_SKIP1:\r
- SkipCount = (UINT16) (*(BlockHdr + sizeof (EFI_HII_STRING_BLOCK)));\r
+ SkipCount = (UINT16) (*(UINT8*)((UINTN)BlockHdr + sizeof (EFI_HII_STRING_BLOCK)));\r
CurrentStringId = (UINT16) (CurrentStringId + SkipCount);\r
BlockSize += sizeof (EFI_HII_SIBT_SKIP1_BLOCK);\r
break;\r
CurrentStringId = (UINT16) (CurrentStringId + SkipCount);\r
BlockSize += sizeof (EFI_HII_SIBT_SKIP1_BLOCK);\r
break;\r
case EFI_HII_SIBT_EXT1:\r
CopyMem (\r
&Length8,\r
case EFI_HII_SIBT_EXT1:\r
CopyMem (\r
&Length8,\r
- BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),\r
+ (UINT8*)((UINTN)BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8)),\r
sizeof (UINT8)\r
);\r
BlockSize += Length8;\r
sizeof (UINT8)\r
);\r
BlockSize += Length8;\r
//\r
BlockHdr += sizeof (EFI_HII_SIBT_EXT2_BLOCK);\r
CopyMem (&FontId, BlockHdr, sizeof (UINT8));\r
//\r
BlockHdr += sizeof (EFI_HII_SIBT_EXT2_BLOCK);\r
CopyMem (&FontId, BlockHdr, sizeof (UINT8));\r
- BlockHdr += sizeof (UINT8);\r
CopyMem (&FontSize, BlockHdr, sizeof (UINT16));\r
BlockHdr += sizeof (UINT16);\r
CopyMem (&FontStyle, BlockHdr, sizeof (EFI_HII_FONT_STYLE));\r
CopyMem (&FontSize, BlockHdr, sizeof (UINT16));\r
BlockHdr += sizeof (UINT16);\r
CopyMem (&FontStyle, BlockHdr, sizeof (EFI_HII_FONT_STYLE));\r
case EFI_HII_SIBT_EXT4:\r
CopyMem (\r
&Length32,\r
case EFI_HII_SIBT_EXT4:\r
CopyMem (\r
&Length32,\r
- BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),\r
+ (UINT8*)((UINTN)BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8)),\r
sizeof (UINT32)\r
);\r
\r
sizeof (UINT32)\r
);\r
\r
BlockPtr += sizeof (EFI_HII_SIBT_EXT2_BLOCK);\r
\r
*BlockPtr = LocalFont->FontId;\r
BlockPtr += sizeof (EFI_HII_SIBT_EXT2_BLOCK);\r
\r
*BlockPtr = LocalFont->FontId;\r
- BlockPtr += sizeof (UINT8);\r
CopyMem (BlockPtr, &GlobalFont->FontInfo->FontSize, sizeof (UINT16));\r
BlockPtr += sizeof (UINT16);\r
CopyMem (BlockPtr, &GlobalFont->FontInfo->FontStyle, sizeof (UINT32));\r
CopyMem (BlockPtr, &GlobalFont->FontInfo->FontSize, sizeof (UINT16));\r
BlockPtr += sizeof (UINT16);\r
CopyMem (BlockPtr, &GlobalFont->FontInfo->FontStyle, sizeof (UINT32));\r
*BlockPtr = EFI_HII_SIBT_STRING_UCS2_FONT;\r
BlockPtr += sizeof (EFI_HII_STRING_BLOCK);\r
*BlockPtr = LocalFont->FontId;\r
*BlockPtr = EFI_HII_SIBT_STRING_UCS2_FONT;\r
BlockPtr += sizeof (EFI_HII_STRING_BLOCK);\r
*BlockPtr = LocalFont->FontId;\r
- BlockPtr += sizeof (UINT8);\r
CopyMem (BlockPtr, (EFI_STRING) String, StrSize ((EFI_STRING) String));\r
BlockPtr += StrSize ((EFI_STRING) String);\r
\r
CopyMem (BlockPtr, (EFI_STRING) String, StrSize ((EFI_STRING) String));\r
BlockPtr += StrSize ((EFI_STRING) String);\r
\r
BlockPtr += sizeof (EFI_HII_SIBT_EXT2_BLOCK);\r
\r
*BlockPtr = LocalFont->FontId;\r
BlockPtr += sizeof (EFI_HII_SIBT_EXT2_BLOCK);\r
\r
*BlockPtr = LocalFont->FontId;\r
- BlockPtr += sizeof (UINT8);\r
CopyMem (BlockPtr, &((EFI_FONT_INFO *) StringFontInfo)->FontSize, sizeof (UINT16));\r
BlockPtr += sizeof (UINT16);\r
CopyMem (BlockPtr, &((EFI_FONT_INFO *) StringFontInfo)->FontStyle, sizeof (EFI_HII_FONT_STYLE));\r
CopyMem (BlockPtr, &((EFI_FONT_INFO *) StringFontInfo)->FontSize, sizeof (UINT16));\r
BlockPtr += sizeof (UINT16);\r
CopyMem (BlockPtr, &((EFI_FONT_INFO *) StringFontInfo)->FontStyle, sizeof (EFI_HII_FONT_STYLE));\r
*BlockPtr = EFI_HII_SIBT_STRING_UCS2_FONT;\r
BlockPtr += sizeof (EFI_HII_STRING_BLOCK);\r
*BlockPtr = LocalFont->FontId;\r
*BlockPtr = EFI_HII_SIBT_STRING_UCS2_FONT;\r
BlockPtr += sizeof (EFI_HII_STRING_BLOCK);\r
*BlockPtr = LocalFont->FontId;\r
- BlockPtr += sizeof (UINT8);\r
CopyMem (BlockPtr, (EFI_STRING) String, StrSize ((EFI_STRING) String));\r
BlockPtr += StrSize ((EFI_STRING) String);\r
\r
CopyMem (BlockPtr, (EFI_STRING) String, StrSize ((EFI_STRING) String));\r
BlockPtr += StrSize ((EFI_STRING) String);\r
\r
Emulation Variable services operate on the runtime volatile memory.\r
The nonvolatile variable space doesn't exist.\r
\r
Emulation Variable services operate on the runtime volatile memory.\r
The nonvolatile variable space doesn't exist.\r
\r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, 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
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 (gVariableInfo != NULL);\r
\r
CopyGuid (&gVariableInfo->VendorGuid, VendorGuid);\r
ASSERT (gVariableInfo != NULL);\r
\r
CopyGuid (&gVariableInfo->VendorGuid, VendorGuid);\r
- gVariableInfo->Name = AllocatePool (StrSize (VariableName));\r
+ gVariableInfo->Name = AllocateZeroPool (StrSize (VariableName));\r
ASSERT (gVariableInfo->Name != NULL);\r
ASSERT (gVariableInfo->Name != NULL);\r
- StrCpy (gVariableInfo->Name, VariableName);\r
+ StrnCpy (gVariableInfo->Name, VariableName, StrLen (VariableName));\r
gVariableInfo->Volatile = Volatile;\r
\r
gBS->InstallConfigurationTable (&gEfiVariableGuid, gVariableInfo);\r
gVariableInfo->Volatile = Volatile;\r
\r
gBS->InstallConfigurationTable (&gEfiVariableGuid, gVariableInfo);\r
ASSERT (Entry->Next != NULL);\r
\r
CopyGuid (&Entry->Next->VendorGuid, VendorGuid);\r
ASSERT (Entry->Next != NULL);\r
\r
CopyGuid (&Entry->Next->VendorGuid, VendorGuid);\r
- Entry->Next->Name = AllocatePool (StrSize (VariableName));\r
+ Entry->Next->Name = AllocateZeroPool (StrSize (VariableName));\r
ASSERT (Entry->Next->Name != NULL);\r
ASSERT (Entry->Next->Name != NULL);\r
- StrCpy (Entry->Next->Name, VariableName);\r
+ StrnCpy (Entry->Next->Name, VariableName, StrLen (VariableName));\r
Entry->Next->Volatile = Volatile;\r
}\r
\r
Entry->Next->Volatile = Volatile;\r
}\r
\r
ASSERT (gVariableInfo != NULL);\r
\r
CopyGuid (&gVariableInfo->VendorGuid, VendorGuid);\r
ASSERT (gVariableInfo != NULL);\r
\r
CopyGuid (&gVariableInfo->VendorGuid, VendorGuid);\r
- gVariableInfo->Name = AllocatePool (StrSize (VariableName));\r
+ gVariableInfo->Name = AllocateZeroPool (StrSize (VariableName));\r
ASSERT (gVariableInfo->Name != NULL);\r
ASSERT (gVariableInfo->Name != NULL);\r
- StrCpy (gVariableInfo->Name, VariableName);\r
+ StrnCpy (gVariableInfo->Name, VariableName, StrLen (VariableName));\r
gVariableInfo->Volatile = Volatile;\r
}\r
\r
gVariableInfo->Volatile = Volatile;\r
}\r
\r
ASSERT (Entry->Next != NULL);\r
\r
CopyGuid (&Entry->Next->VendorGuid, VendorGuid);\r
ASSERT (Entry->Next != NULL);\r
\r
CopyGuid (&Entry->Next->VendorGuid, VendorGuid);\r
- Entry->Next->Name = AllocatePool (StrSize (VariableName));\r
+ Entry->Next->Name = AllocateZeroPool (StrSize (VariableName));\r
ASSERT (Entry->Next->Name != NULL);\r
ASSERT (Entry->Next->Name != NULL);\r
- StrCpy (Entry->Next->Name, VariableName);\r
+ StrnCpy (Entry->Next->Name, VariableName, StrLen (VariableName));\r
Entry->Next->Volatile = Volatile;\r
}\r
\r
Entry->Next->Volatile = Volatile;\r
}\r
\r
return EFI_ACCESS_DENIED;\r
}\r
\r
return EFI_ACCESS_DENIED;\r
}\r
\r
- Entry = AllocateRuntimePool (sizeof (*Entry) + StrSize (VariableName));\r
+ Entry = AllocateRuntimeZeroPool (sizeof (*Entry) + StrSize (VariableName));\r
if (Entry == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
if (Entry == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
AcquireLockOnlyAtBootTime(&mVariableModuleGlobal->VariableGlobal.VariableServicesLock);\r
\r
Entry->Name = (CHAR16 *) (Entry + 1);\r
AcquireLockOnlyAtBootTime(&mVariableModuleGlobal->VariableGlobal.VariableServicesLock);\r
\r
Entry->Name = (CHAR16 *) (Entry + 1);\r
- StrCpy (Entry->Name, VariableName);\r
+ StrnCpy (Entry->Name, VariableName, StrLen (VariableName));\r
CopyGuid (&Entry->Guid, VendorGuid);\r
InsertTailList (&mLockedVariableList, &Entry->Link);\r
\r
CopyGuid (&Entry->Guid, VendorGuid);\r
InsertTailList (&mLockedVariableList, &Entry->Link);\r
\r