UINTN Function;\r
EFI_IA32_REGISTER_SET Regs;\r
UINT8 VideoMode;\r
+ UINT8 OldVideoMode;\r
EFI_TIME BootTime;\r
UINT32 *BdaPtr;\r
UINT32 LocalTime;\r
Device = 0;\r
Function = 0;\r
VideoMode = 0;\r
+ OldVideoMode = 0;\r
PhysicalAddress = 0;\r
MaxRomAddr = PcdGet32 (PcdEndOpromShadowAddress);\r
\r
// 2. BBS compliants drives will not change 40:75 until boot time.\r
// 3. Onboard IDE controllers will change 40:75\r
//\r
+ DisableNullDetection ();\r
+\r
LocalDiskStart = (UINT8) ((*(UINT8 *) ((UINTN) 0x475)) + 0x80);\r
if ((Private->Disk4075 + 0x80) < LocalDiskStart) {\r
//\r
//\r
VideoMode = *(UINT8 *) ((UINTN) (0x400 + BDA_VIDEO_MODE));\r
}\r
+\r
+ EnableNullDetection ();\r
+\r
//\r
// Notify the platform that we are about to scan the ROM\r
//\r
// Multiply result by 18.2 for number of ticks since midnight.\r
// Use 182/10 to avoid floating point math.\r
//\r
+ DisableNullDetection ();\r
LocalTime = (LocalTime * 182) / 10;\r
BdaPtr = (UINT32 *) ((UINTN) 0x46C);\r
*BdaPtr = LocalTime;\r
+ EnableNullDetection ();\r
\r
//\r
// Pass in handoff data\r
//\r
// Set mode settings since PrepareToScanRom may change mode\r
//\r
- if (VideoMode != *(UINT8 *) ((UINTN) (0x400 + BDA_VIDEO_MODE))) {\r
+ DisableNullDetection ();\r
+ OldVideoMode = *(UINT8 *) ((UINTN) (0x400 + BDA_VIDEO_MODE));\r
+ EnableNullDetection ();\r
+\r
+ if (VideoMode != OldVideoMode) {\r
//\r
// The active video mode is changed, restore it to original mode.\r
//\r
}\r
}\r
\r
+ DisableNullDetection ();\r
LocalDiskEnd = (UINT8) ((*(UINT8 *) ((UINTN) 0x475)) + 0x80);\r
+ EnableNullDetection ();\r
\r
//\r
// Allow platform to perform any required actions after the\r