TianoCore EDK2 master
CpuExceptionHandlerLib.h
Go to the documentation of this file.
1
10#ifndef __CPU_EXCEPTION_HANDLER_LIB_H__
11#define __CPU_EXCEPTION_HANDLER_LIB_H__
12
14#include <Protocol/Cpu.h>
15
16#define CPU_EXCEPTION_INIT_DATA_REV 1
17
18typedef union {
19 struct {
20 //
21 // Revision number of this structure.
22 //
23 UINT32 Revision;
24 //
25 // The address of top of known good stack reserved for *ALL* exceptions
26 // listed in field StackSwitchExceptions.
27 //
28 UINTN KnownGoodStackTop;
29 //
30 // The size of known good stack for *ONE* exception only.
31 //
32 UINTN KnownGoodStackSize;
33 //
34 // Buffer of exception vector list for stack switch.
35 //
36 UINT8 *StackSwitchExceptions;
37 //
38 // Number of exception vectors in StackSwitchExceptions.
39 //
40 UINTN StackSwitchExceptionNumber;
41 //
42 // Buffer of IDT table. It must be type of IA32_IDT_GATE_DESCRIPTOR.
43 // Normally there's no need to change IDT table size.
44 //
45 VOID *IdtTable;
46 //
47 // Size of buffer for IdtTable.
48 //
49 UINTN IdtTableSize;
50 //
51 // Buffer of GDT table. It must be type of IA32_SEGMENT_DESCRIPTOR.
52 //
53 VOID *GdtTable;
54 //
55 // Size of buffer for GdtTable.
56 //
57 UINTN GdtTableSize;
58 //
59 // Pointer to start address of descriptor of exception task gate in the
60 // GDT table. It must be type of IA32_TSS_DESCRIPTOR.
61 //
62 VOID *ExceptionTssDesc;
63 //
64 // Size of buffer for ExceptionTssDesc.
65 //
66 UINTN ExceptionTssDescSize;
67 //
68 // Buffer of task-state segment for exceptions. It must be type of
69 // IA32_TASK_STATE_SEGMENT.
70 //
71 VOID *ExceptionTss;
72 //
73 // Size of buffer for ExceptionTss.
74 //
75 UINTN ExceptionTssSize;
76 //
77 // Flag to indicate if default handlers should be initialized or not.
78 //
79 BOOLEAN InitDefaultHandlers;
80 } Ia32, X64;
82
100EFIAPI
102 IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL
103 );
104
118EFIAPI
120 IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL
121 );
122
147EFIAPI
149 IN EFI_EXCEPTION_TYPE InterruptType,
150 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
151 );
152
159VOID
160EFIAPI
162 IN EFI_EXCEPTION_TYPE ExceptionType,
163 IN EFI_SYSTEM_CONTEXT SystemContext
164 );
165
166#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
VOID(EFIAPI * EFI_CPU_INTERRUPT_HANDLER)(IN CONST EFI_EXCEPTION_TYPE InterruptType, IN CONST EFI_SYSTEM_CONTEXT SystemContext)
Definition: Cpu.h:52
EFI_STATUS EFIAPI InitializeCpuExceptionHandlers(IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL)
VOID EFIAPI DumpCpuContext(IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_SYSTEM_CONTEXT SystemContext)
EFI_STATUS EFIAPI RegisterCpuInterruptHandler(IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler)
EFI_STATUS EFIAPI InitializeSeparateExceptionStacks(IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL)
INTN EFI_EXCEPTION_TYPE
Definition: DebugSupport.h:35
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:28