Changeset 99404 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h
- Timestamp:
- Apr 14, 2023 3:17:44 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156854
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew ¶
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-145445 /vendor/edk2/current 103735-103757,103769-103776,129194-156846
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
TabularUnified trunk/src/VBox/Devices/EFI/FirmwareNew/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h ¶
r89983 r99404 2 2 Common header file for CPU Exception Handler Library. 3 3 4 Copyright (c) 2012 - 20 19, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.<BR> 5 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 6 … … 21 21 #include <Library/CpuExceptionHandlerLib.h> 22 22 23 #define CPU_EXCEPTION_NUM 24 #define CPU_INTERRUPT_NUM 25 #define HOOKAFTER_STUB_SIZE 1623 #define CPU_EXCEPTION_NUM 32 24 #define CPU_INTERRUPT_NUM 256 25 #define HOOKAFTER_STUB_SIZE 18 26 26 27 27 // 28 28 // Exception Error Code of Page-Fault Exception 29 29 // 30 #define IA32_PF_EC_P 31 #define IA32_PF_EC_WR 32 #define IA32_PF_EC_US 33 #define IA32_PF_EC_RSVD 34 #define IA32_PF_EC_ID 35 #define IA32_PF_EC_PK 36 #define IA32_PF_EC_SS 37 #define IA32_PF_EC_SGX 30 #define IA32_PF_EC_P BIT0 31 #define IA32_PF_EC_WR BIT1 32 #define IA32_PF_EC_US BIT2 33 #define IA32_PF_EC_RSVD BIT3 34 #define IA32_PF_EC_ID BIT4 35 #define IA32_PF_EC_PK BIT5 36 #define IA32_PF_EC_SS BIT6 37 #define IA32_PF_EC_SGX BIT15 38 38 39 39 #include "ArchInterruptDefs.h" … … 48 48 FixedPcdGet32 (PcdCpuKnownGoodStackSize) 49 49 50 #define CPU_TSS_GDT_SIZE (SIZE_2KB + CPU_TSS_DESC_SIZE + CPU_TSS_SIZE)50 #define CPU_TSS_GDT_SIZE (SIZE_2KB + CPU_TSS_DESC_SIZE + CPU_TSS_SIZE) 51 51 52 52 // … … 54 54 // 55 55 typedef struct { 56 UINTN ExceptionStart;57 UINTN ExceptionStubHeaderSize;58 UINTN HookAfterStubHeaderStart;56 UINTN ExceptionStart; 57 UINTN ExceptionStubHeaderSize; 58 UINTN HookAfterStubHeaderStart; 59 59 } EXCEPTION_HANDLER_TEMPLATE_MAP; 60 60 61 61 typedef struct { 62 UINTN IdtEntryCount;63 SPIN_LOCK DisplayMessageSpinLock;64 RESERVED_VECTORS_DATA *ReservedVectors;65 EFI_CPU_INTERRUPT_HANDLER *ExternalInterruptHandler;62 UINTN IdtEntryCount; 63 SPIN_LOCK DisplayMessageSpinLock; 64 RESERVED_VECTORS_DATA *ReservedVectors; 65 EFI_CPU_INTERRUPT_HANDLER *ExternalInterruptHandler; 66 66 } EXCEPTION_HANDLER_DATA; 67 67 68 extern CONST UINT32 69 extern CONST UINTN 68 extern CONST UINT32 mErrorCodeFlag; 69 extern CONST UINTN mDoFarReturnFlag; 70 70 71 71 /** … … 78 78 EFIAPI 79 79 AsmGetTemplateAddressMap ( 80 OUT EXCEPTION_HANDLER_TEMPLATE_MAP *AddressMap80 OUT EXCEPTION_HANDLER_TEMPLATE_MAP *AddressMap 81 81 ); 82 82 … … 91 91 VOID 92 92 ArchUpdateIdtEntry ( 93 OUT IA32_IDT_GATE_DESCRIPTOR 94 IN UINTN 93 OUT IA32_IDT_GATE_DESCRIPTOR *IdtEntry, 94 IN UINTN InterruptHandler 95 95 ); 96 96 … … 103 103 UINTN 104 104 ArchGetIdtHandler ( 105 IN IA32_IDT_GATE_DESCRIPTOR 105 IN IA32_IDT_GATE_DESCRIPTOR *IdtEntry 106 106 ); 107 107 … … 129 129 VOID 130 130 DumpModuleImageInfo ( 131 IN UINTN 131 IN UINTN CurrentEip 132 132 ); 133 133 … … 140 140 VOID 141 141 DumpImageAndCpuContent ( 142 IN EFI_EXCEPTION_TYPE 143 IN EFI_SYSTEM_CONTEXT 142 IN EFI_EXCEPTION_TYPE ExceptionType, 143 IN EFI_SYSTEM_CONTEXT SystemContext 144 144 ); 145 145 … … 158 158 EFI_STATUS 159 159 InitializeCpuExceptionHandlersWorker ( 160 IN EFI_VECTOR_HANDOFF_INFO 161 IN OUT EXCEPTION_HANDLER_DATA 160 IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL, 161 IN OUT EXCEPTION_HANDLER_DATA *ExceptionHandlerData 162 162 ); 163 163 … … 181 181 EFI_STATUS 182 182 RegisterCpuInterruptHandlerWorker ( 183 IN EFI_EXCEPTION_TYPE 184 IN EFI_CPU_INTERRUPT_HANDLER 185 IN EXCEPTION_HANDLER_DATA 183 IN EFI_EXCEPTION_TYPE InterruptType, 184 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler, 185 IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData 186 186 ); 187 187 … … 211 211 VOID 212 212 ArchSaveExceptionContext ( 213 IN UINTN 214 IN EFI_SYSTEM_CONTEXT 215 IN EXCEPTION_HANDLER_DATA 213 IN UINTN ExceptionType, 214 IN EFI_SYSTEM_CONTEXT SystemContext, 215 IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData 216 216 ); 217 217 … … 225 225 VOID 226 226 ArchRestoreExceptionContext ( 227 IN UINTN 228 IN EFI_SYSTEM_CONTEXT 229 IN EXCEPTION_HANDLER_DATA 227 IN UINTN ExceptionType, 228 IN EFI_SYSTEM_CONTEXT SystemContext, 229 IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData 230 230 ); 231 231 … … 241 241 EFIAPI 242 242 AsmVectorNumFixup ( 243 IN VOID 244 IN UINT8 245 IN VOID 243 IN VOID *NewVectorAddr, 244 IN UINT8 VectorNum, 245 IN VOID *OldVectorAddr 246 246 ); 247 247 … … 259 259 EFI_STATUS 260 260 ReadAndVerifyVectorInfo ( 261 IN EFI_VECTOR_HANDOFF_INFO 262 OUT RESERVED_VECTORS_DATA 263 IN UINTN 261 IN EFI_VECTOR_HANDOFF_INFO *VectorInfo, 262 OUT RESERVED_VECTORS_DATA *ReservedVector, 263 IN UINTN VectorCount 264 264 ); 265 265 … … 273 273 CONST CHAR8 * 274 274 GetExceptionNameStr ( 275 IN EFI_EXCEPTION_TYPE 275 IN EFI_EXCEPTION_TYPE ExceptionType 276 276 ); 277 277 … … 285 285 VOID 286 286 CommonExceptionHandlerWorker ( 287 IN EFI_EXCEPTION_TYPE ExceptionType, 288 IN EFI_SYSTEM_CONTEXT SystemContext, 289 IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData 290 ); 291 292 /** 293 Setup separate stack for specific exceptions. 294 295 @param[in] StackSwitchData Pointer to data required for setuping up 296 stack switch. 297 298 @retval EFI_SUCCESS The exceptions have been successfully 299 initialized with new stack. 300 @retval EFI_INVALID_PARAMETER StackSwitchData contains invalid content. 287 IN EFI_EXCEPTION_TYPE ExceptionType, 288 IN EFI_SYSTEM_CONTEXT SystemContext, 289 IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData 290 ); 291 292 /** 293 Setup separate stacks for certain exception handlers. 294 295 @param[in] Buffer Point to buffer used to separate exception stack. 296 @param[in, out] BufferSize On input, it indicates the byte size of Buffer. 297 If the size is not enough, the return status will 298 be EFI_BUFFER_TOO_SMALL, and output BufferSize 299 will be the size it needs. 300 301 @retval EFI_SUCCESS The stacks are assigned successfully. 302 @retval EFI_BUFFER_TOO_SMALL This BufferSize is too small. 303 @retval EFI_UNSUPPORTED This function is not supported. 301 304 **/ 302 305 EFI_STATUS 303 306 ArchSetupExceptionStack ( 304 IN CPU_EXCEPTION_INIT_DATA *StackSwitchData 307 IN VOID *Buffer, 308 IN OUT UINTN *BufferSize 305 309 ); 306 310 … … 319 323 320 324 #endif 321
Note:
See TracChangeset
for help on using the changeset viewer.