X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=IntelFrameworkModulePkg%2FCsm%2FLegacyBiosDxe%2FThunk.c;h=d330f4870baa62608e3c6035968d16cc6df61cf1;hp=d249479c56ef6d172bf16c8b8553bb56d9e056d1;hb=2ea3576e16a2af9e21e06ef4b759833989efced2;hpb=7619eed8aa260c9527d72ccd525ce70060b64f1f diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/Thunk.c b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/Thunk.c index d249479c56..d330f4870b 100644 --- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/Thunk.c +++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/Thunk.c @@ -73,10 +73,10 @@ LegacyBiosInt86 ( // The base address of legacy interrupt vector table is 0. // We use this base address to get the legacy interrupt handler. // - DisableNullDetection (); - Segment = (UINT16)(((UINT32 *)0)[BiosInt] >> 16); - Offset = (UINT16)((UINT32 *)0)[BiosInt]; - EnableNullDetection (); + ACCESS_PAGE0_CODE ( + Segment = (UINT16)(((UINT32 *)0)[BiosInt] >> 16); + Offset = (UINT16)((UINT32 *)0)[BiosInt]; + ); return InternalLegacyBiosFarCall ( This, @@ -286,29 +286,6 @@ InternalLegacyBiosFarCall ( AsmThunk16 (&mThunkContext); - // - // OPROM may allocate EBDA range by itself and change EBDA base and EBDA size. - // Get the current EBDA base address, and compared with pre-allocate minimum - // EBDA base address, if the current EBDA base address is smaller, it indicates - // PcdEbdaReservedMemorySize should be adjusted to larger for more OPROMs. - // - DEBUG_CODE ( - { - UINTN EbdaBaseAddress; - UINTN ReservedEbdaBaseAddress; - - // - // Skip this part of debug code if NULL pointer detection is enabled - // - if ((PcdGet8 (PcdNullPointerDetectionPropertyMask) & BIT0) == 0) { - EbdaBaseAddress = (*(UINT16 *) (UINTN) 0x40E) << 4; - ReservedEbdaBaseAddress = CONVENTIONAL_MEMORY_TOP - - PcdGet32 (PcdEbdaReservedMemorySize); - ASSERT (ReservedEbdaBaseAddress <= EbdaBaseAddress); - } - } - ); - if (Stack != NULL && StackSize != 0) { // // Copy low memory stack to Stack @@ -334,6 +311,26 @@ InternalLegacyBiosFarCall ( // gBS->RestoreTPL (OriginalTpl); + // + // OPROM may allocate EBDA range by itself and change EBDA base and EBDA size. + // Get the current EBDA base address, and compared with pre-allocate minimum + // EBDA base address, if the current EBDA base address is smaller, it indicates + // PcdEbdaReservedMemorySize should be adjusted to larger for more OPROMs. + // + DEBUG_CODE ( + { + UINTN EbdaBaseAddress; + UINTN ReservedEbdaBaseAddress; + + ACCESS_PAGE0_CODE ( + EbdaBaseAddress = (*(UINT16 *) (UINTN) 0x40E) << 4; + ReservedEbdaBaseAddress = CONVENTIONAL_MEMORY_TOP + - PcdGet32 (PcdEbdaReservedMemorySize); + ASSERT (ReservedEbdaBaseAddress <= EbdaBaseAddress); + ); + } + ); + // // Restore interrupt of debug timer //