mirror of https://github.com/acidanthera/audk.git
Update code to pass build on VS2008 with /Od compiler option.
Signed-off-by: lgao4 Reviewed-by: rsun3 Reviewed-by: ftian git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12792 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
a661e27f7a
commit
e0e7f80cc3
|
@ -503,12 +503,12 @@ AhciBuildCommand (
|
|||
IN UINT8 AtapiCommandLength,
|
||||
IN UINT8 CommandSlotNumber,
|
||||
IN OUT VOID *DataPhysicalAddr,
|
||||
IN UINT64 DataLength
|
||||
IN UINT32 DataLength
|
||||
)
|
||||
{
|
||||
UINT64 BaseAddr;
|
||||
UINT64 PrdtNumber;
|
||||
UINT64 PrdtIndex;
|
||||
UINT32 PrdtNumber;
|
||||
UINT32 PrdtIndex;
|
||||
UINTN RemainedData;
|
||||
UINTN MemAddr;
|
||||
DATA_64 Data64;
|
||||
|
@ -557,7 +557,7 @@ AhciBuildCommand (
|
|||
|
||||
RemainedData = (UINTN) DataLength;
|
||||
MemAddr = (UINTN) DataPhysicalAddr;
|
||||
CommandList->AhciCmdPrdtl = (UINT32)PrdtNumber;
|
||||
CommandList->AhciCmdPrdtl = PrdtNumber;
|
||||
|
||||
for (PrdtIndex = 0; PrdtIndex < PrdtNumber; PrdtIndex++) {
|
||||
if (RemainedData < EFI_AHCI_MAX_DATA_PER_PRDT) {
|
||||
|
|
|
@ -781,7 +781,7 @@ XhcFreeEventRing (
|
|||
//
|
||||
for (Index = 0; Index < ERST_NUMBER; Index++) {
|
||||
EventRingPtr = TablePtr + Index;
|
||||
RingBuf = (VOID *)(UINTN)(EventRingPtr->PtrLo | ((UINT64)EventRingPtr->PtrHi << 32));
|
||||
RingBuf = (VOID *)(UINTN)(EventRingPtr->PtrLo | LShiftU64 ((UINT64)EventRingPtr->PtrHi, 32));
|
||||
|
||||
if(RingBuf != NULL) {
|
||||
FreePages (RingBuf, EFI_SIZE_TO_PAGES (sizeof (TRB_TEMPLATE) * EVENT_RING_TRB_NUMBER));
|
||||
|
@ -922,7 +922,7 @@ XhcCheckUrbResult (
|
|||
continue;
|
||||
}
|
||||
|
||||
TRBPtr = (TRB_TEMPLATE *)(UINTN)(EvtTrb->TRBPtrLo | (UINT64) EvtTrb->TRBPtrHi << 32);
|
||||
TRBPtr = (TRB_TEMPLATE *)(UINTN)(EvtTrb->TRBPtrLo | LShiftU64 ((UINT64) EvtTrb->TRBPtrHi, 32));
|
||||
if (IsTransferRingTrb (Urb->Ring, TRBPtr)) {
|
||||
switch (EvtTrb->Completecode) {
|
||||
case TRB_COMPLETION_STALL_ERROR:
|
||||
|
@ -1537,7 +1537,7 @@ XhcSyncTrsRing (
|
|||
// Toggle PCS maintained by software
|
||||
//
|
||||
TrsRing->RingPCS = (TrsRing->RingPCS & BIT0) ? 0 : 1;
|
||||
TrsTrb = (TRB_TEMPLATE *)(UINTN)((TrsTrb->Parameter1 | ((UINT64)TrsTrb->Parameter2 << 32)) & ~0x0F);
|
||||
TrsTrb = (TRB_TEMPLATE *)(UINTN)((TrsTrb->Parameter1 | LShiftU64 ((UINT64)TrsTrb->Parameter2, 32)) & ~0x0F);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -448,7 +448,7 @@ SmmLoadImage (
|
|||
//
|
||||
// allocate the memory to load the SMM driver
|
||||
//
|
||||
PageCount = (UINTN)EFI_SIZE_TO_PAGES(ImageContext.ImageSize + ImageContext.SectionAlignment);
|
||||
PageCount = (UINTN)EFI_SIZE_TO_PAGES((UINTN)ImageContext.ImageSize + ImageContext.SectionAlignment);
|
||||
DstBuffer = (UINTN)(-1);
|
||||
|
||||
Status = SmmAllocatePages (
|
||||
|
@ -466,7 +466,7 @@ SmmLoadImage (
|
|||
ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)DstBuffer;
|
||||
}
|
||||
} else {
|
||||
PageCount = (UINTN)EFI_SIZE_TO_PAGES(ImageContext.ImageSize + ImageContext.SectionAlignment);
|
||||
PageCount = (UINTN)EFI_SIZE_TO_PAGES((UINTN)ImageContext.ImageSize + ImageContext.SectionAlignment);
|
||||
DstBuffer = (UINTN)(-1);
|
||||
|
||||
Status = SmmAllocatePages (
|
||||
|
|
|
@ -913,7 +913,7 @@ ExecuteSmmCoreFromSmram (
|
|||
// Allocate memory for the image being loaded from the EFI_SRAM_DESCRIPTOR
|
||||
// specified by SmramRange
|
||||
//
|
||||
PageCount = (UINTN)EFI_SIZE_TO_PAGES(ImageContext.ImageSize + ImageContext.SectionAlignment);
|
||||
PageCount = (UINTN)EFI_SIZE_TO_PAGES((UINTN)ImageContext.ImageSize + ImageContext.SectionAlignment);
|
||||
|
||||
ASSERT ((SmramRange->PhysicalSize & EFI_PAGE_MASK) == 0);
|
||||
ASSERT (SmramRange->PhysicalSize > EFI_PAGES_TO_SIZE (PageCount));
|
||||
|
@ -931,7 +931,7 @@ ExecuteSmmCoreFromSmram (
|
|||
// Allocate memory for the image being loaded from the EFI_SRAM_DESCRIPTOR
|
||||
// specified by SmramRange
|
||||
//
|
||||
PageCount = (UINTN)EFI_SIZE_TO_PAGES(ImageContext.ImageSize + ImageContext.SectionAlignment);
|
||||
PageCount = (UINTN)EFI_SIZE_TO_PAGES((UINTN)ImageContext.ImageSize + ImageContext.SectionAlignment);
|
||||
|
||||
ASSERT ((SmramRange->PhysicalSize & EFI_PAGE_MASK) == 0);
|
||||
ASSERT (SmramRange->PhysicalSize > EFI_PAGES_TO_SIZE (PageCount));
|
||||
|
|
|
@ -42,8 +42,11 @@
|
|||
|
||||
#define MAX_IO_ADDRESS 0xFFFF
|
||||
|
||||
//
|
||||
// Macro to convert a UEFI PCI address to a PCI Library PCI address
|
||||
//
|
||||
#define PCI_ADDRESS_ENCODE(A) (UINTN)PCI_LIB_ADDRESS( \
|
||||
(((A)& 0xff000000) >> 24), (((A) &0x00ff0000) >> 16), (((A) & 0xff00) >> 8), ((RShiftU64 ((A), 32) & 0xfff) | ((A)& 0xff)) \
|
||||
((((UINTN)(A))& 0xff000000) >> 24), ((((UINTN)(A)) &0x00ff0000) >> 16), ((((UINTN)(A)) & 0xff00) >> 8), ((RShiftU64 ((A), 32) & 0xfff) | ((A)& 0xff)) \
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue