diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-16 04:46:18 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-16 04:46:18 +0000 |
commit | 6c8e40caa950432587b77291a167610d0284d224 (patch) | |
tree | 2a2f15a3e4c5b6f84bb7e2522b25f43e633a2b51 /DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c | |
parent | 0cb4d53d7779364a7be3ba7ab1caee829670eba0 (diff) | |
download | edk2-platforms-6c8e40caa950432587b77291a167610d0284d224.tar.xz |
Fix BiosVideo thunk bug about invalid legacy region area.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8099 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c')
-rw-r--r-- | DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c b/DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c index e21ab362ef..0f02659b6b 100644 --- a/DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c +++ b/DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c @@ -30,26 +30,25 @@ InitializeBiosIntCaller ( UINT32 RealModeBufferSize;
UINT32 ExtraStackSize;
EFI_PHYSICAL_ADDRESS LegacyRegionBase;
-
+ UINT32 LegacyRegionSize;
//
// Get LegacyRegion
//
AsmGetThunk16Properties (&RealModeBufferSize, &ExtraStackSize);
-
+ LegacyRegionSize = (((RealModeBufferSize + ExtraStackSize) / EFI_PAGE_SIZE) + 1) * EFI_PAGE_SIZE;
LegacyRegionBase = 0x100000;
Status = gBS->AllocatePages (
AllocateMaxAddress,
EfiACPIMemoryNVS,
- EFI_SIZE_TO_PAGES(RealModeBufferSize + ExtraStackSize + 200),
+ EFI_SIZE_TO_PAGES(LegacyRegionSize),
&LegacyRegionBase
);
ASSERT_EFI_ERROR (Status);
ThunkContext->RealModeBuffer = (VOID*)(UINTN)LegacyRegionBase;
- ThunkContext->RealModeBufferSize = EFI_PAGES_TO_SIZE (RealModeBufferSize);
- ThunkContext->ThunkAttributes = 3;
+ ThunkContext->RealModeBufferSize = LegacyRegionSize;
+ ThunkContext->ThunkAttributes = THUNK_ATTRIBUTE_BIG_REAL_MODE|THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15;
AsmPrepareThunk16(ThunkContext);
-
}
/**
|