19 UINT8 ExceptionStubHeader[HOOKAFTER_STUB_SIZE];
37 IA32_DESCRIPTOR IdtDescriptor;
38 IA32_IDT_GATE_DESCRIPTOR *IdtTable;
42 IdtTable = (IA32_IDT_GATE_DESCRIPTOR *)IdtDescriptor.Base;
45 return Exception0StubHeader->ExceptionHandlerData;
63 IA32_DESCRIPTOR IdtDescriptor;
64 IA32_IDT_GATE_DESCRIPTOR *IdtTable;
71 IdtTable = (IA32_IDT_GATE_DESCRIPTOR *)IdtDescriptor.Base;
73 Exception0StubHeader =
AllocatePool (
sizeof (*Exception0StubHeader));
74 if (Exception0StubHeader ==
NULL) {
75 ASSERT (Exception0StubHeader !=
NULL);
80 Exception0StubHeader->ExceptionStubHeader,
82 sizeof (Exception0StubHeader->ExceptionStubHeader)
84 Exception0StubHeader->ExceptionHandlerData = ExceptionHandlerData;
172 if (ReservedVectors ==
NULL) {
173 ASSERT (ReservedVectors !=
NULL);
174 return EFI_OUT_OF_RESOURCES;
178 if (ExceptionHandlerData ==
NULL) {
179 ASSERT (ExceptionHandlerData !=
NULL);
181 return EFI_OUT_OF_RESOURCES;
184 ExceptionHandlerData->IdtEntryCount = CPU_EXCEPTION_NUM;
185 ExceptionHandlerData->ReservedVectors = ReservedVectors;
190 if (EFI_ERROR (Status)) {
221 if ((Buffer ==
NULL) && (BufferSize ==
NULL)) {
222 return EFI_UNSUPPORTED;
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID(EFIAPI * EFI_CPU_INTERRUPT_HANDLER)(IN CONST EFI_EXCEPTION_TYPE InterruptType, IN CONST EFI_SYSTEM_CONTEXT SystemContext)
UINTN ArchGetIdtHandler(IN IA32_IDT_GATE_DESCRIPTOR *IdtEntry)
EFI_STATUS ArchSetupExceptionStack(IN VOID *Buffer, IN OUT UINTN *BufferSize)
EFI_STATUS RegisterCpuInterruptHandlerWorker(IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler, IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData)
EFI_STATUS InitializeCpuExceptionHandlersWorker(IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL, IN OUT EXCEPTION_HANDLER_DATA *ExceptionHandlerData)
VOID ArchUpdateIdtEntry(OUT IA32_IDT_GATE_DESCRIPTOR *IdtEntry, IN UINTN InterruptHandler)
VOID CommonExceptionHandlerWorker(IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext, IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS EFIAPI InitializeSeparateExceptionStacks(IN VOID *Buffer, IN OUT UINTN *BufferSize)
EFI_STATUS EFIAPI InitializeCpuExceptionHandlers(IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL)
VOID SetExceptionHandlerData(IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData)
EXCEPTION_HANDLER_DATA * GetExceptionHandlerData(VOID)
EFI_STATUS EFIAPI RegisterCpuInterruptHandler(IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler)
VOID EFIAPI CommonExceptionHandler(IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
SPIN_LOCK *EFIAPI InitializeSpinLock(OUT SPIN_LOCK *SpinLock)
VOID EFIAPI AsmReadIdtr(OUT IA32_DESCRIPTOR *Idtr)