> On Oct 29, 2014, at 7:19 PM, tiger...@via-alliance.com wrote: > > Hi, experts: > I am confused by some codes in InitInterruptDescriptorTable() function (in > UefiCpuPkg/CpuDxe/CpuDxe.c). > …… > if ((OldIdtPtr.Base != 0) && ((OldIdtPtr.Limit & 7) == 7)) { > // Based on my understanding, because DxeIpl has created IDT when switching > from P-Mode to Long-Mode. > // So, should execute below code. > OldIdt = (IA32_IDT_GATE_DESCRIPTOR*) OldIdtPtr.Base; > OldIdtSize = (OldIdtPtr.Limit + 1) / sizeof (IA32_IDT_GATE_DESCRIPTOR); > …… > } else { > OldIdt = NULL; > OldIdtSize = 0; > } > …… > // Based on my understanding, When come here, index = OldIdtSize = 32, so > CpuRegisterInterruptHandler() could not be run. > for (Index = OldIdtSize; Index < 32; Index++) { > Status = CpuRegisterInterruptHandler (&gCpu, Index, > CommonExceptionHandler); > ASSERT_EFI_ERROR (Status); > } > > My question is: > Because DxeIpl has created IDT, and OldIdtSize = 32, so > CpuRegisterInterruptHandler() could not be run, right? >
I think there is an assumption that the OldIdtSize represents vectors from the debugger. If the debugger did not grab any, or all, of the possible exception vectors, then this driver hooks in an exception handler. Thanks, Andrew Fish > > Best wishes, > ------------------------------------------------------------------------------ > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.sourceforge.net <mailto:edk2-devel@lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/edk2-devel > <https://lists.sourceforge.net/lists/listinfo/edk2-devel>
------------------------------------------------------------------------------
_______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel