mirror of https://github.com/acidanthera/audk.git
1) Add type cast for better coding style.
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
This commit is contained in:
parent
e935092fa7
commit
6e1e540554
|
@ -717,7 +717,7 @@ AtaAtapiPassThruStart (
|
||||||
&Supports
|
&Supports
|
||||||
);
|
);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
Supports &= EFI_PCI_DEVICE_ENABLE;
|
Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;
|
||||||
Status = PciIo->Attributes (
|
Status = PciIo->Attributes (
|
||||||
PciIo,
|
PciIo,
|
||||||
EfiPciIoAttributeOperationEnable,
|
EfiPciIoAttributeOperationEnable,
|
||||||
|
@ -951,7 +951,7 @@ AtaAtapiPassThruStop (
|
||||||
&Supports
|
&Supports
|
||||||
);
|
);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
Supports &= EFI_PCI_DEVICE_ENABLE;
|
Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;
|
||||||
PciIo->Attributes (
|
PciIo->Attributes (
|
||||||
PciIo,
|
PciIo,
|
||||||
EfiPciIoAttributeOperationDisable,
|
EfiPciIoAttributeOperationDisable,
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
and companion host controller when UHCI or OHCI gets attached earlier than EHCI and a
|
and companion host controller when UHCI or OHCI gets attached earlier than EHCI and a
|
||||||
USB 2.0 device inserts.
|
USB 2.0 device inserts.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -1754,7 +1754,7 @@ EhcDriverBindingStart (
|
||||||
&Supports
|
&Supports
|
||||||
);
|
);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
Supports &= EFI_PCI_DEVICE_ENABLE;
|
Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;
|
||||||
Status = PciIo->Attributes (
|
Status = PciIo->Attributes (
|
||||||
PciIo,
|
PciIo,
|
||||||
EfiPciIoAttributeOperationEnable,
|
EfiPciIoAttributeOperationEnable,
|
||||||
|
|
|
@ -816,7 +816,7 @@ NvmeControllerInit (
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
Supports &= EFI_PCI_DEVICE_ENABLE;
|
Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;
|
||||||
Status = PciIo->Attributes (
|
Status = PciIo->Attributes (
|
||||||
PciIo,
|
PciIo,
|
||||||
EfiPciIoAttributeOperationEnable,
|
EfiPciIoAttributeOperationEnable,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Supporting functions implementaion for PCI devices management.
|
Supporting functions implementaion for PCI devices management.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -705,7 +705,7 @@ StartPciDevicesOnBridge (
|
||||||
0,
|
0,
|
||||||
&Supports
|
&Supports
|
||||||
);
|
);
|
||||||
Supports &= EFI_PCI_DEVICE_ENABLE;
|
Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;
|
||||||
PciIoDevice->PciIo.Attributes (
|
PciIoDevice->PciIo.Attributes (
|
||||||
&(PciIoDevice->PciIo),
|
&(PciIoDevice->PciIo),
|
||||||
EfiPciIoAttributeOperationEnable,
|
EfiPciIoAttributeOperationEnable,
|
||||||
|
@ -757,7 +757,7 @@ StartPciDevicesOnBridge (
|
||||||
0,
|
0,
|
||||||
&Supports
|
&Supports
|
||||||
);
|
);
|
||||||
Supports &= EFI_PCI_DEVICE_ENABLE;
|
Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;
|
||||||
PciIoDevice->PciIo.Attributes (
|
PciIoDevice->PciIo.Attributes (
|
||||||
&(PciIoDevice->PciIo),
|
&(PciIoDevice->PciIo),
|
||||||
EfiPciIoAttributeOperationEnable,
|
EfiPciIoAttributeOperationEnable,
|
||||||
|
|
|
@ -947,12 +947,12 @@ PciSetDeviceAttribute (
|
||||||
|
|
||||||
if (Option == EFI_SET_SUPPORTS) {
|
if (Option == EFI_SET_SUPPORTS) {
|
||||||
|
|
||||||
Attributes |= EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE |
|
Attributes |= (UINT64) (EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE |
|
||||||
EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED |
|
EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED |
|
||||||
EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE |
|
EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE |
|
||||||
EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE |
|
EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE |
|
||||||
EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM |
|
EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM |
|
||||||
EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE;
|
EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE);
|
||||||
|
|
||||||
if (IS_PCI_LPC (&PciIoDevice->Pci)) {
|
if (IS_PCI_LPC (&PciIoDevice->Pci)) {
|
||||||
Attributes |= EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO;
|
Attributes |= EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO;
|
||||||
|
@ -1120,7 +1120,7 @@ DetermineDeviceAttribute (
|
||||||
//
|
//
|
||||||
// Assume the PCI Root Bridge supports DAC
|
// Assume the PCI Root Bridge supports DAC
|
||||||
//
|
//
|
||||||
PciIoDevice->Supports |= (EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE |
|
PciIoDevice->Supports |= (UINT64)(EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE |
|
||||||
EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM |
|
EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM |
|
||||||
EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE);
|
EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE);
|
||||||
|
|
||||||
|
|
|
@ -1448,7 +1448,7 @@ SupportPaletteSnoopAttributes (
|
||||||
//
|
//
|
||||||
if (Operation == EfiPciIoAttributeOperationEnable) {
|
if (Operation == EfiPciIoAttributeOperationEnable) {
|
||||||
PCI_DISABLE_COMMAND_REGISTER (Temp, EFI_PCI_COMMAND_VGA_PALETTE_SNOOP);
|
PCI_DISABLE_COMMAND_REGISTER (Temp, EFI_PCI_COMMAND_VGA_PALETTE_SNOOP);
|
||||||
Temp->Attributes &= (~EFI_PCI_COMMAND_VGA_PALETTE_SNOOP);
|
Temp->Attributes &= (~(UINT64)EFI_PCI_COMMAND_VGA_PALETTE_SNOOP);
|
||||||
} else {
|
} else {
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
The UHCI driver model and HC protocol routines.
|
The UHCI driver model and HC protocol routines.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -1704,7 +1704,7 @@ UhciDriverBindingStart (
|
||||||
&Supports
|
&Supports
|
||||||
);
|
);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
Supports &= EFI_PCI_DEVICE_ENABLE;
|
Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;
|
||||||
Status = PciIo->Attributes (
|
Status = PciIo->Attributes (
|
||||||
PciIo,
|
PciIo,
|
||||||
EfiPciIoAttributeOperationEnable,
|
EfiPciIoAttributeOperationEnable,
|
||||||
|
|
|
@ -1969,7 +1969,7 @@ XhcDriverBindingStart (
|
||||||
&Supports
|
&Supports
|
||||||
);
|
);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
Supports &= EFI_PCI_DEVICE_ENABLE;
|
Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;
|
||||||
Status = PciIo->Attributes (
|
Status = PciIo->Attributes (
|
||||||
PciIo,
|
PciIo,
|
||||||
EfiPciIoAttributeOperationEnable,
|
EfiPciIoAttributeOperationEnable,
|
||||||
|
|
|
@ -2658,8 +2658,8 @@ XhcInitializeEndpointContext (
|
||||||
((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingSeg0,
|
((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingSeg0,
|
||||||
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER
|
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER
|
||||||
);
|
);
|
||||||
PhyAddr &= ~(0x0F);
|
PhyAddr &= ~((EFI_PHYSICAL_ADDRESS)0x0F);
|
||||||
PhyAddr |= ((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;
|
PhyAddr |= (EFI_PHYSICAL_ADDRESS)((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;
|
||||||
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);
|
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);
|
||||||
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);
|
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);
|
||||||
|
|
||||||
|
@ -2811,8 +2811,8 @@ XhcInitializeEndpointContext64 (
|
||||||
((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingSeg0,
|
((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingSeg0,
|
||||||
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER
|
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER
|
||||||
);
|
);
|
||||||
PhyAddr &= ~(0x0F);
|
PhyAddr &= ~((EFI_PHYSICAL_ADDRESS)0x0F);
|
||||||
PhyAddr |= ((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;
|
PhyAddr |= (EFI_PHYSICAL_ADDRESS)((TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;
|
||||||
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);
|
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);
|
||||||
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);
|
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);
|
||||||
|
|
||||||
|
|
|
@ -1754,8 +1754,8 @@ XhcPeiSetConfigCmd (
|
||||||
((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingSeg0,
|
((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingSeg0,
|
||||||
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER
|
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER
|
||||||
);
|
);
|
||||||
PhyAddr &= ~(0x0F);
|
PhyAddr &= ~((EFI_PHYSICAL_ADDRESS)0x0F);
|
||||||
PhyAddr |= ((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;
|
PhyAddr |= (EFI_PHYSICAL_ADDRESS)((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;
|
||||||
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);
|
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);
|
||||||
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);
|
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);
|
||||||
|
|
||||||
|
@ -1948,8 +1948,8 @@ XhcPeiSetConfigCmd64 (
|
||||||
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER
|
sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER
|
||||||
);
|
);
|
||||||
|
|
||||||
PhyAddr &= ~(0x0F);
|
PhyAddr &= ~((EFI_PHYSICAL_ADDRESS)0x0F);
|
||||||
PhyAddr |= ((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;
|
PhyAddr |= (EFI_PHYSICAL_ADDRESS)((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;
|
||||||
|
|
||||||
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);
|
InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);
|
||||||
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);
|
InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);
|
||||||
|
|
|
@ -204,7 +204,7 @@ CoreDispatchEventNotifies (
|
||||||
CoreAcquireEventLock ();
|
CoreAcquireEventLock ();
|
||||||
}
|
}
|
||||||
|
|
||||||
gEventPending &= ~(1 << Priority);
|
gEventPending &= ~(UINTN)(1 << Priority);
|
||||||
CoreReleaseEventLock ();
|
CoreReleaseEventLock ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
UEFI Memory page management functions.
|
UEFI Memory page management functions.
|
||||||
|
|
||||||
Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -930,7 +930,7 @@ CoreFindFreePagesI (
|
||||||
//
|
//
|
||||||
// Set MaxAddress to a page boundary
|
// Set MaxAddress to a page boundary
|
||||||
//
|
//
|
||||||
MaxAddress &= ~EFI_PAGE_MASK;
|
MaxAddress &= ~(UINT64)EFI_PAGE_MASK;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set MaxAddress to end of the page
|
// Set MaxAddress to end of the page
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
UEFI Memory pool management functions.
|
UEFI Memory pool management functions.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -274,7 +274,7 @@ CoreAllocatePoolI (
|
||||||
//
|
//
|
||||||
if (Index >= MAX_POOL_LIST) {
|
if (Index >= MAX_POOL_LIST) {
|
||||||
NoPages = EFI_SIZE_TO_PAGES(Size) + EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1;
|
NoPages = EFI_SIZE_TO_PAGES(Size) + EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1;
|
||||||
NoPages &= ~(EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1);
|
NoPages &= ~(UINTN)(EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1);
|
||||||
Head = CoreAllocatePoolPages (PoolType, NoPages, DEFAULT_PAGE_ALLOCATION);
|
Head = CoreAllocatePoolPages (PoolType, NoPages, DEFAULT_PAGE_ALLOCATION);
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
@ -473,7 +473,7 @@ CoreFreePoolI (
|
||||||
// Return the memory pages back to free memory
|
// Return the memory pages back to free memory
|
||||||
//
|
//
|
||||||
NoPages = EFI_SIZE_TO_PAGES(Size) + EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1;
|
NoPages = EFI_SIZE_TO_PAGES(Size) + EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1;
|
||||||
NoPages &= ~(EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1);
|
NoPages &= ~(UINTN)(EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION) - 1);
|
||||||
CoreFreePoolPages ((EFI_PHYSICAL_ADDRESS) (UINTN) Head, NoPages);
|
CoreFreePoolPages ((EFI_PHYSICAL_ADDRESS) (UINTN) Head, NoPages);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -519,7 +519,7 @@ SmmLoadImage (
|
||||||
// Align buffer on section boundry
|
// Align buffer on section boundry
|
||||||
//
|
//
|
||||||
ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;
|
ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;
|
||||||
ImageContext.ImageAddress &= ~(ImageContext.SectionAlignment - 1);
|
ImageContext.ImageAddress &= ~((EFI_PHYSICAL_ADDRESS)(ImageContext.SectionAlignment - 1));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Load the image to our new buffer
|
// Load the image to our new buffer
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
SMM IPL that produces SMM related runtime protocols and load the SMM Core into SMRAM
|
SMM IPL that produces SMM related runtime protocols and load the SMM Core into SMRAM
|
||||||
|
|
||||||
Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials are licensed and made available
|
This program and the accompanying materials are licensed and made available
|
||||||
under the terms and conditions of the BSD License which accompanies this
|
under the terms and conditions of the BSD License which accompanies this
|
||||||
distribution. The full text of the license may be found at
|
distribution. The full text of the license may be found at
|
||||||
|
@ -952,7 +952,7 @@ ExecuteSmmCoreFromSmram (
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;
|
ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;
|
||||||
ImageContext.ImageAddress &= ~(ImageContext.SectionAlignment - 1);
|
ImageContext.ImageAddress &= ~((EFI_PHYSICAL_ADDRESS)(ImageContext.SectionAlignment - 1));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Print debug message showing SMM Core load address.
|
// Print debug message showing SMM Core load address.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
16550 UART Serial Port library functions
|
16550 UART Serial Port library functions
|
||||||
|
|
||||||
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -177,7 +177,7 @@ SerialPortInitialize (
|
||||||
}
|
}
|
||||||
SerialPortWriteRegister (R_UART_LCR, (UINT8)(SerialPortReadRegister (R_UART_LCR) | B_UART_LCR_DLAB));
|
SerialPortWriteRegister (R_UART_LCR, (UINT8)(SerialPortReadRegister (R_UART_LCR) | B_UART_LCR_DLAB));
|
||||||
Divisor = SerialPortReadRegister (R_UART_BAUD_HIGH) << 8;
|
Divisor = SerialPortReadRegister (R_UART_BAUD_HIGH) << 8;
|
||||||
Divisor |= SerialPortReadRegister (R_UART_BAUD_LOW);
|
Divisor |= (UINTN)SerialPortReadRegister (R_UART_BAUD_LOW);
|
||||||
SerialPortWriteRegister (R_UART_LCR, (UINT8)(SerialPortReadRegister (R_UART_LCR) & ~B_UART_LCR_DLAB));
|
SerialPortWriteRegister (R_UART_LCR, (UINT8)(SerialPortReadRegister (R_UART_LCR) & ~B_UART_LCR_DLAB));
|
||||||
if (Divisor != 115200 / PcdGet32 (PcdSerialBaudRate)) {
|
if (Divisor != 115200 / PcdGet32 (PcdSerialBaudRate)) {
|
||||||
Initialized = FALSE;
|
Initialized = FALSE;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
protocol related to this implementation, not in the public spec. So, this
|
protocol related to this implementation, not in the public spec. So, this
|
||||||
library instance is only for this code base.
|
library instance is only for this code base.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -1235,7 +1235,7 @@ InternalPrintLibSPrintMarker (
|
||||||
//
|
//
|
||||||
// Clear all the flag bits except those that may have been passed in
|
// Clear all the flag bits except those that may have been passed in
|
||||||
//
|
//
|
||||||
Flags &= (OUTPUT_UNICODE | FORMAT_UNICODE | COUNT_ONLY_NO_PRINT);
|
Flags &= (UINTN)(OUTPUT_UNICODE | FORMAT_UNICODE | COUNT_ONLY_NO_PRINT);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set the default width to zero, and the default precision to 1
|
// Set the default width to zero, and the default precision to 1
|
||||||
|
@ -1343,7 +1343,7 @@ InternalPrintLibSPrintMarker (
|
||||||
//
|
//
|
||||||
// Flag space, +, 0, L & l are invalid for type p.
|
// Flag space, +, 0, L & l are invalid for type p.
|
||||||
//
|
//
|
||||||
Flags &= ~(PREFIX_BLANK | PREFIX_SIGN | PREFIX_ZERO | LONG_TYPE);
|
Flags &= ~(UINTN)(PREFIX_BLANK | PREFIX_SIGN | PREFIX_ZERO | LONG_TYPE);
|
||||||
if (sizeof (VOID *) > 4) {
|
if (sizeof (VOID *) > 4) {
|
||||||
Flags |= LONG_TYPE;
|
Flags |= LONG_TYPE;
|
||||||
}
|
}
|
||||||
|
@ -1391,7 +1391,7 @@ InternalPrintLibSPrintMarker (
|
||||||
if ((Flags & RADIX_HEX) == 0) {
|
if ((Flags & RADIX_HEX) == 0) {
|
||||||
Radix = 10;
|
Radix = 10;
|
||||||
if (Comma) {
|
if (Comma) {
|
||||||
Flags &= (~PREFIX_ZERO);
|
Flags &= (~(UINTN)PREFIX_ZERO);
|
||||||
Precision = 1;
|
Precision = 1;
|
||||||
}
|
}
|
||||||
if (Value < 0) {
|
if (Value < 0) {
|
||||||
|
@ -1460,7 +1460,7 @@ InternalPrintLibSPrintMarker (
|
||||||
ArgumentString = BASE_ARG (BaseListMarker, CHAR8 *);
|
ArgumentString = BASE_ARG (BaseListMarker, CHAR8 *);
|
||||||
}
|
}
|
||||||
if (ArgumentString == NULL) {
|
if (ArgumentString == NULL) {
|
||||||
Flags &= (~ARGUMENT_UNICODE);
|
Flags &= (~(UINTN)ARGUMENT_UNICODE);
|
||||||
ArgumentString = "<null string>";
|
ArgumentString = "<null string>";
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Interpret and execute the S3 data in S3 boot script.
|
Interpret and execute the S3 data in S3 boot script.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
are licensed and made available under the terms and conditions
|
||||||
|
@ -1312,7 +1312,7 @@ CheckAndOrMask (
|
||||||
|
|
||||||
switch (ScriptHeader->Width) {
|
switch (ScriptHeader->Width) {
|
||||||
case S3BootScriptWidthUint8:
|
case S3BootScriptWidthUint8:
|
||||||
*AndMask = (UINT64) *(DataPtr + 1);
|
*AndMask = (UINT64) (*(UINT8*) (DataPtr + 1));
|
||||||
*OrMask = (UINT64) (*DataPtr);
|
*OrMask = (UINT64) (*DataPtr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
ACPI Sdt Protocol Driver
|
ACPI Sdt Protocol Driver
|
||||||
|
|
||||||
Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved. <BR>
|
Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved. <BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -282,13 +282,13 @@ AmlGetPkgLength (
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
RealLength = *(Buffer + 1);
|
RealLength = *(Buffer + 1);
|
||||||
RealLength |= (*(Buffer + 2)) << 8;
|
RealLength |= (UINTN)((*(Buffer + 2)) << 8);
|
||||||
RealLength = (RealLength << 4) | (LeadByte & 0xF);
|
RealLength = (RealLength << 4) | (LeadByte & 0xF);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
RealLength = *(Buffer + 1);
|
RealLength = *(Buffer + 1);
|
||||||
RealLength |= (*(Buffer + 2)) << 8;
|
RealLength |= (UINTN)((*(Buffer + 2)) << 8);
|
||||||
RealLength |= (*(Buffer + 3)) << 16;
|
RealLength |= (UINTN)((*(Buffer + 3)) << 16);
|
||||||
RealLength = (RealLength << 4) | (LeadByte & 0xF);
|
RealLength = (RealLength << 4) | (LeadByte & 0xF);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
This driver is dispatched by Dxe core and the driver will reload itself to ACPI reserved memory
|
This driver is dispatched by Dxe core and the driver will reload itself to ACPI reserved memory
|
||||||
in the entry point. The functionality is to interpret and restore the S3 boot script
|
in the entry point. The functionality is to interpret and restore the S3 boot script
|
||||||
|
|
||||||
Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -280,7 +280,7 @@ ReadyToLockEventNotify (
|
||||||
// Align buffer on section boundry
|
// Align buffer on section boundry
|
||||||
//
|
//
|
||||||
ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;
|
ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;
|
||||||
ImageContext.ImageAddress &= ~(ImageContext.SectionAlignment - 1);
|
ImageContext.ImageAddress &= ~((EFI_PHYSICAL_ADDRESS)(ImageContext.SectionAlignment - 1));
|
||||||
//
|
//
|
||||||
// Load the image to our new buffer
|
// Load the image to our new buffer
|
||||||
//
|
//
|
||||||
|
|
|
@ -3269,7 +3269,7 @@ ExecuteCMP (
|
||||||
if (Flag != 0) {
|
if (Flag != 0) {
|
||||||
VMFLAG_SET (VmPtr, VMFLAGS_CC);
|
VMFLAG_SET (VmPtr, VMFLAGS_CC);
|
||||||
} else {
|
} else {
|
||||||
VMFLAG_CLEAR (VmPtr, VMFLAGS_CC);
|
VMFLAG_CLEAR (VmPtr, (UINT64)VMFLAGS_CC);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Advance the IP
|
// Advance the IP
|
||||||
|
@ -3448,7 +3448,7 @@ ExecuteCMPI (
|
||||||
if (Flag != 0) {
|
if (Flag != 0) {
|
||||||
VMFLAG_SET (VmPtr, VMFLAGS_CC);
|
VMFLAG_SET (VmPtr, VMFLAGS_CC);
|
||||||
} else {
|
} else {
|
||||||
VMFLAG_CLEAR (VmPtr, VMFLAGS_CC);
|
VMFLAG_CLEAR (VmPtr, (UINT64)VMFLAGS_CC);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Advance the IP
|
// Advance the IP
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
This module contains EBC support routines that are customized based on
|
This module contains EBC support routines that are customized based on
|
||||||
the target ia32 processor.
|
the target ia32 processor.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -267,7 +267,7 @@ EbcInterpret (
|
||||||
VmContext.StackTop = (UINT8*)VmContext.StackPool + (STACK_REMAIN_SIZE);
|
VmContext.StackTop = (UINT8*)VmContext.StackPool + (STACK_REMAIN_SIZE);
|
||||||
VmContext.Gpr[0] = (UINT64)(UINTN) ((UINT8*)VmContext.StackPool + STACK_POOL_SIZE);
|
VmContext.Gpr[0] = (UINT64)(UINTN) ((UINT8*)VmContext.StackPool + STACK_POOL_SIZE);
|
||||||
VmContext.HighStackBottom = (UINTN)VmContext.Gpr[0];
|
VmContext.HighStackBottom = (UINTN)VmContext.Gpr[0];
|
||||||
VmContext.Gpr[0] &= ~(sizeof (UINTN) - 1);
|
VmContext.Gpr[0] &= ~((VM_REGISTER)(sizeof (UINTN) - 1));
|
||||||
VmContext.Gpr[0] -= sizeof (UINTN);
|
VmContext.Gpr[0] -= sizeof (UINTN);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
This module contains EBC support routines that are customized based on
|
This module contains EBC support routines that are customized based on
|
||||||
the target x64 processor.
|
the target x64 processor.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -215,7 +215,7 @@ EbcInterpret (
|
||||||
//
|
//
|
||||||
// Align the stack on a natural boundary.
|
// Align the stack on a natural boundary.
|
||||||
//
|
//
|
||||||
VmContext.Gpr[0] &= ~(sizeof (UINTN) - 1);
|
VmContext.Gpr[0] &= ~(VM_REGISTER)(sizeof (UINTN) - 1);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Put a magic value in the stack gap, then adjust down again.
|
// Put a magic value in the stack gap, then adjust down again.
|
||||||
|
@ -359,7 +359,7 @@ ExecuteEbcImageEntryPoint (
|
||||||
|
|
||||||
//
|
//
|
||||||
// Align the stack on a natural boundary
|
// Align the stack on a natural boundary
|
||||||
VmContext.Gpr[0] &= ~(sizeof(UINTN) - 1);
|
VmContext.Gpr[0] &= ~(VM_REGISTER)(sizeof(UINTN) - 1);
|
||||||
//
|
//
|
||||||
VmContext.LowStackTop = (UINTN) VmContext.Gpr[0];
|
VmContext.LowStackTop = (UINTN) VmContext.Gpr[0];
|
||||||
|
|
||||||
|
|
|
@ -757,12 +757,12 @@ FindGlyphBlock (
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_HII_GIBT_EXT1:
|
case EFI_HII_GIBT_EXT1:
|
||||||
BlockPtr += *(BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK) + sizeof (UINT8));
|
BlockPtr += *(UINT8*)((UINTN)BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK) + sizeof (UINT8));
|
||||||
break;
|
break;
|
||||||
case EFI_HII_GIBT_EXT2:
|
case EFI_HII_GIBT_EXT2:
|
||||||
CopyMem (
|
CopyMem (
|
||||||
&Length16,
|
&Length16,
|
||||||
BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK) + sizeof (UINT8),
|
(UINT8*)((UINTN)BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK) + sizeof (UINT8)),
|
||||||
sizeof (UINT16)
|
sizeof (UINT16)
|
||||||
);
|
);
|
||||||
BlockPtr += Length16;
|
BlockPtr += Length16;
|
||||||
|
@ -770,7 +770,7 @@ FindGlyphBlock (
|
||||||
case EFI_HII_GIBT_EXT4:
|
case EFI_HII_GIBT_EXT4:
|
||||||
CopyMem (
|
CopyMem (
|
||||||
&Length32,
|
&Length32,
|
||||||
BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK) + sizeof (UINT8),
|
(UINT8*)((UINTN)BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK) + sizeof (UINT8)),
|
||||||
sizeof (UINT32)
|
sizeof (UINT32)
|
||||||
);
|
);
|
||||||
BlockPtr += Length32;
|
BlockPtr += Length32;
|
||||||
|
@ -793,7 +793,7 @@ FindGlyphBlock (
|
||||||
BufferLen = BITMAP_LEN_1_BIT (LocalCell.Width, LocalCell.Height);
|
BufferLen = BITMAP_LEN_1_BIT (LocalCell.Width, LocalCell.Height);
|
||||||
if (CharCurrent == CharValue) {
|
if (CharCurrent == CharValue) {
|
||||||
return WriteOutputParam (
|
return WriteOutputParam (
|
||||||
BlockPtr + sizeof (EFI_HII_GIBT_GLYPH_BLOCK) - sizeof (UINT8),
|
(UINT8*)((UINTN)BlockPtr + sizeof (EFI_HII_GIBT_GLYPH_BLOCK) - sizeof (UINT8)),
|
||||||
BufferLen,
|
BufferLen,
|
||||||
&LocalCell,
|
&LocalCell,
|
||||||
GlyphBuffer,
|
GlyphBuffer,
|
||||||
|
|
|
@ -79,13 +79,13 @@ GetImageIdOrAddress (
|
||||||
}
|
}
|
||||||
switch (((EFI_HII_IMAGE_BLOCK *) ImageBlock)->BlockType) {
|
switch (((EFI_HII_IMAGE_BLOCK *) ImageBlock)->BlockType) {
|
||||||
case EFI_HII_IIBT_EXT1:
|
case EFI_HII_IIBT_EXT1:
|
||||||
Length8 = *(ImageBlock + sizeof (EFI_HII_IMAGE_BLOCK) + sizeof (UINT8));
|
Length8 = *(UINT8*)((UINTN)ImageBlock + sizeof (EFI_HII_IMAGE_BLOCK) + sizeof (UINT8));
|
||||||
ImageBlock += Length8;
|
ImageBlock += Length8;
|
||||||
break;
|
break;
|
||||||
case EFI_HII_IIBT_EXT2:
|
case EFI_HII_IIBT_EXT2:
|
||||||
CopyMem (
|
CopyMem (
|
||||||
&Length16,
|
&Length16,
|
||||||
ImageBlock + sizeof (EFI_HII_IMAGE_BLOCK) + sizeof (UINT8),
|
(UINT8*)((UINTN)ImageBlock + sizeof (EFI_HII_IMAGE_BLOCK) + sizeof (UINT8)),
|
||||||
sizeof (UINT16)
|
sizeof (UINT16)
|
||||||
);
|
);
|
||||||
ImageBlock += Length16;
|
ImageBlock += Length16;
|
||||||
|
@ -93,7 +93,7 @@ GetImageIdOrAddress (
|
||||||
case EFI_HII_IIBT_EXT4:
|
case EFI_HII_IIBT_EXT4:
|
||||||
CopyMem (
|
CopyMem (
|
||||||
&Length32,
|
&Length32,
|
||||||
ImageBlock + sizeof (EFI_HII_IMAGE_BLOCK) + sizeof (UINT8),
|
(UINT8*)((UINTN)ImageBlock + sizeof (EFI_HII_IMAGE_BLOCK) + sizeof (UINT8)),
|
||||||
sizeof (UINT32)
|
sizeof (UINT32)
|
||||||
);
|
);
|
||||||
ImageBlock += Length32;
|
ImageBlock += Length32;
|
||||||
|
@ -920,19 +920,19 @@ HiiGetImage (
|
||||||
if (BlockType == EFI_HII_IIBT_IMAGE_1BIT || BlockType == EFI_HII_IIBT_IMAGE_1BIT_TRANS) {
|
if (BlockType == EFI_HII_IIBT_IMAGE_1BIT || BlockType == EFI_HII_IIBT_IMAGE_1BIT_TRANS) {
|
||||||
Output1bitPixel (
|
Output1bitPixel (
|
||||||
Image,
|
Image,
|
||||||
(UINT8 *) (ImageBlock + sizeof (EFI_HII_IIBT_IMAGE_1BIT_BLOCK) - sizeof (UINT8)),
|
(UINT8 *) ((UINTN)ImageBlock + sizeof (EFI_HII_IIBT_IMAGE_1BIT_BLOCK) - sizeof (UINT8)),
|
||||||
(EFI_HII_IMAGE_PALETTE_INFO *) PaletteInfo
|
(EFI_HII_IMAGE_PALETTE_INFO *) PaletteInfo
|
||||||
);
|
);
|
||||||
} else if (BlockType == EFI_HII_IIBT_IMAGE_4BIT || BlockType == EFI_HII_IIBT_IMAGE_4BIT_TRANS) {
|
} else if (BlockType == EFI_HII_IIBT_IMAGE_4BIT || BlockType == EFI_HII_IIBT_IMAGE_4BIT_TRANS) {
|
||||||
Output4bitPixel (
|
Output4bitPixel (
|
||||||
Image,
|
Image,
|
||||||
(UINT8 *) (ImageBlock + sizeof (EFI_HII_IIBT_IMAGE_4BIT_BLOCK) - sizeof (UINT8)),
|
(UINT8 *) ((UINTN)ImageBlock + sizeof (EFI_HII_IIBT_IMAGE_4BIT_BLOCK) - sizeof (UINT8)),
|
||||||
(EFI_HII_IMAGE_PALETTE_INFO *) PaletteInfo
|
(EFI_HII_IMAGE_PALETTE_INFO *) PaletteInfo
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
Output8bitPixel (
|
Output8bitPixel (
|
||||||
Image,
|
Image,
|
||||||
(UINT8 *) (ImageBlock + sizeof (EFI_HII_IIBT_IMAGE_8BIT_BLOCK) - sizeof (UINT8)),
|
(UINT8 *) ((UINTN)ImageBlock + sizeof (EFI_HII_IIBT_IMAGE_8BIT_BLOCK) - sizeof (UINT8)),
|
||||||
(EFI_HII_IMAGE_PALETTE_INFO *) PaletteInfo
|
(EFI_HII_IMAGE_PALETTE_INFO *) PaletteInfo
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Implementation for EFI_HII_STRING_PROTOCOL.
|
Implementation for EFI_HII_STRING_PROTOCOL.
|
||||||
|
|
||||||
|
|
||||||
Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -335,7 +335,7 @@ FindStringBlock (
|
||||||
|
|
||||||
case EFI_HII_SIBT_STRINGS_SCSU:
|
case EFI_HII_SIBT_STRINGS_SCSU:
|
||||||
CopyMem (&StringCount, BlockHdr + sizeof (EFI_HII_STRING_BLOCK), sizeof (UINT16));
|
CopyMem (&StringCount, BlockHdr + sizeof (EFI_HII_STRING_BLOCK), sizeof (UINT16));
|
||||||
StringTextPtr = BlockHdr + sizeof (EFI_HII_SIBT_STRINGS_SCSU_BLOCK) - sizeof (UINT8);
|
StringTextPtr = (UINT8*)((UINTN)BlockHdr + sizeof (EFI_HII_SIBT_STRINGS_SCSU_BLOCK) - sizeof (UINT8));
|
||||||
BlockSize += StringTextPtr - BlockHdr;
|
BlockSize += StringTextPtr - BlockHdr;
|
||||||
|
|
||||||
for (Index = 0; Index < StringCount; Index++) {
|
for (Index = 0; Index < StringCount; Index++) {
|
||||||
|
@ -355,10 +355,10 @@ FindStringBlock (
|
||||||
case EFI_HII_SIBT_STRINGS_SCSU_FONT:
|
case EFI_HII_SIBT_STRINGS_SCSU_FONT:
|
||||||
CopyMem (
|
CopyMem (
|
||||||
&StringCount,
|
&StringCount,
|
||||||
BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),
|
(UINT8*)((UINTN)BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8)),
|
||||||
sizeof (UINT16)
|
sizeof (UINT16)
|
||||||
);
|
);
|
||||||
StringTextPtr = BlockHdr + sizeof (EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK) - sizeof (UINT8);
|
StringTextPtr = (UINT8*)((UINTN)BlockHdr + sizeof (EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK) - sizeof (UINT8));
|
||||||
BlockSize += StringTextPtr - BlockHdr;
|
BlockSize += StringTextPtr - BlockHdr;
|
||||||
|
|
||||||
for (Index = 0; Index < StringCount; Index++) {
|
for (Index = 0; Index < StringCount; Index++) {
|
||||||
|
@ -425,7 +425,7 @@ FindStringBlock (
|
||||||
BlockSize += Offset;
|
BlockSize += Offset;
|
||||||
CopyMem (
|
CopyMem (
|
||||||
&StringCount,
|
&StringCount,
|
||||||
BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),
|
(UINT8*)((UINTN)BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8)),
|
||||||
sizeof (UINT16)
|
sizeof (UINT16)
|
||||||
);
|
);
|
||||||
for (Index = 0; Index < StringCount; Index++) {
|
for (Index = 0; Index < StringCount; Index++) {
|
||||||
|
@ -465,7 +465,7 @@ FindStringBlock (
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_HII_SIBT_SKIP1:
|
case EFI_HII_SIBT_SKIP1:
|
||||||
SkipCount = (UINT16) (*(BlockHdr + sizeof (EFI_HII_STRING_BLOCK)));
|
SkipCount = (UINT16) (*(UINT8*)((UINTN)BlockHdr + sizeof (EFI_HII_STRING_BLOCK)));
|
||||||
CurrentStringId = (UINT16) (CurrentStringId + SkipCount);
|
CurrentStringId = (UINT16) (CurrentStringId + SkipCount);
|
||||||
BlockSize += sizeof (EFI_HII_SIBT_SKIP1_BLOCK);
|
BlockSize += sizeof (EFI_HII_SIBT_SKIP1_BLOCK);
|
||||||
break;
|
break;
|
||||||
|
@ -479,7 +479,7 @@ FindStringBlock (
|
||||||
case EFI_HII_SIBT_EXT1:
|
case EFI_HII_SIBT_EXT1:
|
||||||
CopyMem (
|
CopyMem (
|
||||||
&Length8,
|
&Length8,
|
||||||
BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),
|
(UINT8*)((UINTN)BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8)),
|
||||||
sizeof (UINT8)
|
sizeof (UINT8)
|
||||||
);
|
);
|
||||||
BlockSize += Length8;
|
BlockSize += Length8;
|
||||||
|
@ -494,7 +494,7 @@ FindStringBlock (
|
||||||
//
|
//
|
||||||
BlockHdr += sizeof (EFI_HII_SIBT_EXT2_BLOCK);
|
BlockHdr += sizeof (EFI_HII_SIBT_EXT2_BLOCK);
|
||||||
CopyMem (&FontId, BlockHdr, sizeof (UINT8));
|
CopyMem (&FontId, BlockHdr, sizeof (UINT8));
|
||||||
BlockHdr += sizeof (UINT8);
|
BlockHdr ++;
|
||||||
CopyMem (&FontSize, BlockHdr, sizeof (UINT16));
|
CopyMem (&FontSize, BlockHdr, sizeof (UINT16));
|
||||||
BlockHdr += sizeof (UINT16);
|
BlockHdr += sizeof (UINT16);
|
||||||
CopyMem (&FontStyle, BlockHdr, sizeof (EFI_HII_FONT_STYLE));
|
CopyMem (&FontStyle, BlockHdr, sizeof (EFI_HII_FONT_STYLE));
|
||||||
|
@ -535,7 +535,7 @@ FindStringBlock (
|
||||||
case EFI_HII_SIBT_EXT4:
|
case EFI_HII_SIBT_EXT4:
|
||||||
CopyMem (
|
CopyMem (
|
||||||
&Length32,
|
&Length32,
|
||||||
BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),
|
(UINT8*)((UINTN)BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8)),
|
||||||
sizeof (UINT32)
|
sizeof (UINT32)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1080,7 +1080,7 @@ SetStringWorker (
|
||||||
BlockPtr += sizeof (EFI_HII_SIBT_EXT2_BLOCK);
|
BlockPtr += sizeof (EFI_HII_SIBT_EXT2_BLOCK);
|
||||||
|
|
||||||
*BlockPtr = LocalFont->FontId;
|
*BlockPtr = LocalFont->FontId;
|
||||||
BlockPtr += sizeof (UINT8);
|
BlockPtr ++;
|
||||||
CopyMem (BlockPtr, &GlobalFont->FontInfo->FontSize, sizeof (UINT16));
|
CopyMem (BlockPtr, &GlobalFont->FontInfo->FontSize, sizeof (UINT16));
|
||||||
BlockPtr += sizeof (UINT16);
|
BlockPtr += sizeof (UINT16);
|
||||||
CopyMem (BlockPtr, &GlobalFont->FontInfo->FontStyle, sizeof (UINT32));
|
CopyMem (BlockPtr, &GlobalFont->FontInfo->FontStyle, sizeof (UINT32));
|
||||||
|
@ -1442,7 +1442,7 @@ HiiNewString (
|
||||||
*BlockPtr = EFI_HII_SIBT_STRING_UCS2_FONT;
|
*BlockPtr = EFI_HII_SIBT_STRING_UCS2_FONT;
|
||||||
BlockPtr += sizeof (EFI_HII_STRING_BLOCK);
|
BlockPtr += sizeof (EFI_HII_STRING_BLOCK);
|
||||||
*BlockPtr = LocalFont->FontId;
|
*BlockPtr = LocalFont->FontId;
|
||||||
BlockPtr += sizeof (UINT8);
|
BlockPtr ++;
|
||||||
CopyMem (BlockPtr, (EFI_STRING) String, StrSize ((EFI_STRING) String));
|
CopyMem (BlockPtr, (EFI_STRING) String, StrSize ((EFI_STRING) String));
|
||||||
BlockPtr += StrSize ((EFI_STRING) String);
|
BlockPtr += StrSize ((EFI_STRING) String);
|
||||||
|
|
||||||
|
@ -1486,7 +1486,7 @@ HiiNewString (
|
||||||
BlockPtr += sizeof (EFI_HII_SIBT_EXT2_BLOCK);
|
BlockPtr += sizeof (EFI_HII_SIBT_EXT2_BLOCK);
|
||||||
|
|
||||||
*BlockPtr = LocalFont->FontId;
|
*BlockPtr = LocalFont->FontId;
|
||||||
BlockPtr += sizeof (UINT8);
|
BlockPtr ++;
|
||||||
CopyMem (BlockPtr, &((EFI_FONT_INFO *) StringFontInfo)->FontSize, sizeof (UINT16));
|
CopyMem (BlockPtr, &((EFI_FONT_INFO *) StringFontInfo)->FontSize, sizeof (UINT16));
|
||||||
BlockPtr += sizeof (UINT16);
|
BlockPtr += sizeof (UINT16);
|
||||||
CopyMem (BlockPtr, &((EFI_FONT_INFO *) StringFontInfo)->FontStyle, sizeof (EFI_HII_FONT_STYLE));
|
CopyMem (BlockPtr, &((EFI_FONT_INFO *) StringFontInfo)->FontStyle, sizeof (EFI_HII_FONT_STYLE));
|
||||||
|
@ -1503,7 +1503,7 @@ HiiNewString (
|
||||||
*BlockPtr = EFI_HII_SIBT_STRING_UCS2_FONT;
|
*BlockPtr = EFI_HII_SIBT_STRING_UCS2_FONT;
|
||||||
BlockPtr += sizeof (EFI_HII_STRING_BLOCK);
|
BlockPtr += sizeof (EFI_HII_STRING_BLOCK);
|
||||||
*BlockPtr = LocalFont->FontId;
|
*BlockPtr = LocalFont->FontId;
|
||||||
BlockPtr += sizeof (UINT8);
|
BlockPtr ++;
|
||||||
CopyMem (BlockPtr, (EFI_STRING) String, StrSize ((EFI_STRING) String));
|
CopyMem (BlockPtr, (EFI_STRING) String, StrSize ((EFI_STRING) String));
|
||||||
BlockPtr += StrSize ((EFI_STRING) String);
|
BlockPtr += StrSize ((EFI_STRING) String);
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Emulation Variable services operate on the runtime volatile memory.
|
Emulation Variable services operate on the runtime volatile memory.
|
||||||
The nonvolatile variable space doesn't exist.
|
The nonvolatile variable space doesn't exist.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -320,9 +320,9 @@ UpdateVariableInfo (
|
||||||
ASSERT (gVariableInfo != NULL);
|
ASSERT (gVariableInfo != NULL);
|
||||||
|
|
||||||
CopyGuid (&gVariableInfo->VendorGuid, VendorGuid);
|
CopyGuid (&gVariableInfo->VendorGuid, VendorGuid);
|
||||||
gVariableInfo->Name = AllocatePool (StrSize (VariableName));
|
gVariableInfo->Name = AllocateZeroPool (StrSize (VariableName));
|
||||||
ASSERT (gVariableInfo->Name != NULL);
|
ASSERT (gVariableInfo->Name != NULL);
|
||||||
StrCpy (gVariableInfo->Name, VariableName);
|
StrnCpy (gVariableInfo->Name, VariableName, StrLen (VariableName));
|
||||||
gVariableInfo->Volatile = Volatile;
|
gVariableInfo->Volatile = Volatile;
|
||||||
|
|
||||||
gBS->InstallConfigurationTable (&gEfiVariableGuid, gVariableInfo);
|
gBS->InstallConfigurationTable (&gEfiVariableGuid, gVariableInfo);
|
||||||
|
@ -358,9 +358,9 @@ UpdateVariableInfo (
|
||||||
ASSERT (Entry->Next != NULL);
|
ASSERT (Entry->Next != NULL);
|
||||||
|
|
||||||
CopyGuid (&Entry->Next->VendorGuid, VendorGuid);
|
CopyGuid (&Entry->Next->VendorGuid, VendorGuid);
|
||||||
Entry->Next->Name = AllocatePool (StrSize (VariableName));
|
Entry->Next->Name = AllocateZeroPool (StrSize (VariableName));
|
||||||
ASSERT (Entry->Next->Name != NULL);
|
ASSERT (Entry->Next->Name != NULL);
|
||||||
StrCpy (Entry->Next->Name, VariableName);
|
StrnCpy (Entry->Next->Name, VariableName, StrLen (VariableName));
|
||||||
Entry->Next->Volatile = Volatile;
|
Entry->Next->Volatile = Volatile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -139,9 +139,9 @@ UpdateVariableInfo (
|
||||||
ASSERT (gVariableInfo != NULL);
|
ASSERT (gVariableInfo != NULL);
|
||||||
|
|
||||||
CopyGuid (&gVariableInfo->VendorGuid, VendorGuid);
|
CopyGuid (&gVariableInfo->VendorGuid, VendorGuid);
|
||||||
gVariableInfo->Name = AllocatePool (StrSize (VariableName));
|
gVariableInfo->Name = AllocateZeroPool (StrSize (VariableName));
|
||||||
ASSERT (gVariableInfo->Name != NULL);
|
ASSERT (gVariableInfo->Name != NULL);
|
||||||
StrCpy (gVariableInfo->Name, VariableName);
|
StrnCpy (gVariableInfo->Name, VariableName, StrLen (VariableName));
|
||||||
gVariableInfo->Volatile = Volatile;
|
gVariableInfo->Volatile = Volatile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,9 +175,9 @@ UpdateVariableInfo (
|
||||||
ASSERT (Entry->Next != NULL);
|
ASSERT (Entry->Next != NULL);
|
||||||
|
|
||||||
CopyGuid (&Entry->Next->VendorGuid, VendorGuid);
|
CopyGuid (&Entry->Next->VendorGuid, VendorGuid);
|
||||||
Entry->Next->Name = AllocatePool (StrSize (VariableName));
|
Entry->Next->Name = AllocateZeroPool (StrSize (VariableName));
|
||||||
ASSERT (Entry->Next->Name != NULL);
|
ASSERT (Entry->Next->Name != NULL);
|
||||||
StrCpy (Entry->Next->Name, VariableName);
|
StrnCpy (Entry->Next->Name, VariableName, StrLen (VariableName));
|
||||||
Entry->Next->Volatile = Volatile;
|
Entry->Next->Volatile = Volatile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2251,7 +2251,7 @@ VariableLockRequestToLock (
|
||||||
return EFI_ACCESS_DENIED;
|
return EFI_ACCESS_DENIED;
|
||||||
}
|
}
|
||||||
|
|
||||||
Entry = AllocateRuntimePool (sizeof (*Entry) + StrSize (VariableName));
|
Entry = AllocateRuntimeZeroPool (sizeof (*Entry) + StrSize (VariableName));
|
||||||
if (Entry == NULL) {
|
if (Entry == NULL) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
@ -2261,7 +2261,7 @@ VariableLockRequestToLock (
|
||||||
AcquireLockOnlyAtBootTime(&mVariableModuleGlobal->VariableGlobal.VariableServicesLock);
|
AcquireLockOnlyAtBootTime(&mVariableModuleGlobal->VariableGlobal.VariableServicesLock);
|
||||||
|
|
||||||
Entry->Name = (CHAR16 *) (Entry + 1);
|
Entry->Name = (CHAR16 *) (Entry + 1);
|
||||||
StrCpy (Entry->Name, VariableName);
|
StrnCpy (Entry->Name, VariableName, StrLen (VariableName));
|
||||||
CopyGuid (&Entry->Guid, VendorGuid);
|
CopyGuid (&Entry->Guid, VendorGuid);
|
||||||
InsertTailList (&mLockedVariableList, &Entry->Link);
|
InsertTailList (&mLockedVariableList, &Entry->Link);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue