diff options
author | Jeff Fan <jeff.fan@intel.com> | 2016-05-24 21:09:22 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-07-14 15:50:54 +0800 |
commit | a42818739fa5c46789a972f42907f4a1afb1698c (patch) | |
tree | f96a9de02928330df1b68f94e238b015de6909bd /UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c | |
parent | b5304bef3bdf7a42f45aad5db1d815296cc8ef5d (diff) | |
download | edk2-platforms-a42818739fa5c46789a972f42907f4a1afb1698c.tar.xz |
UefiCpuPkg/ExceptionLib: Update UpdateIdtTable()
Add parameter CpuExceptionData for UpdateIdtTable().
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
(cherry picked from commit 9db15f8148081688a0679b76a7258e9fc66107bc)
Diffstat (limited to 'UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c')
-rw-r--r-- | UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c index 92de04ce08..cffb13aea9 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c @@ -83,20 +83,22 @@ InitializeCpuInterruptHandlers ( UINTN Index;
UINTN InterruptEntry;
UINT8 *InterruptEntryCode;
+ RESERVED_VECTORS_DATA *ReservedVectors;
+ EFI_CPU_INTERRUPT_HANDLER *ExternalInterruptHandler;
- mReservedVectors = AllocatePool (sizeof (RESERVED_VECTORS_DATA) * CPU_INTERRUPT_NUM);
- ASSERT (mReservedVectors != NULL);
- SetMem ((VOID *) mReservedVectors, sizeof (RESERVED_VECTORS_DATA) * CPU_INTERRUPT_NUM, 0xff);
+ ReservedVectors = AllocatePool (sizeof (RESERVED_VECTORS_DATA) * CPU_INTERRUPT_NUM);
+ ASSERT (ReservedVectors != NULL);
+ SetMem ((VOID *) ReservedVectors, sizeof (RESERVED_VECTORS_DATA) * CPU_INTERRUPT_NUM, 0xff);
if (VectorInfo != NULL) {
- Status = ReadAndVerifyVectorInfo (VectorInfo, mReservedVectors, CPU_INTERRUPT_NUM);
+ Status = ReadAndVerifyVectorInfo (VectorInfo, ReservedVectors, CPU_INTERRUPT_NUM);
if (EFI_ERROR (Status)) {
- FreePool (mReservedVectors);
+ FreePool (ReservedVectors);
return EFI_INVALID_PARAMETER;
}
}
InitializeSpinLock (&mDisplayMessageSpinLock);
- mExternalInterruptHandler = AllocateZeroPool (sizeof (EFI_CPU_INTERRUPT_HANDLER) * CPU_INTERRUPT_NUM);
- ASSERT (mExternalInterruptHandler != NULL);
+ ExternalInterruptHandler = AllocateZeroPool (sizeof (EFI_CPU_INTERRUPT_HANDLER) * CPU_INTERRUPT_NUM);
+ ASSERT (ExternalInterruptHandler != NULL);
//
// Read IDT descriptor and calculate IDT size
@@ -130,7 +132,12 @@ InitializeCpuInterruptHandlers ( }
TemplateMap.ExceptionStart = (UINTN) InterruptEntryCode;
- UpdateIdtTable (IdtTable, &TemplateMap, CPU_INTERRUPT_NUM);
+ mExceptionHandlerData.IdtEntryCount = CPU_INTERRUPT_NUM;
+ mExceptionHandlerData.ReservedVectors = ReservedVectors;
+ mExceptionHandlerData.ExternalInterruptHandler = ExternalInterruptHandler;
+ InitializeSpinLock (&mExceptionHandlerData.DisplayMessageSpinLock);
+
+ UpdateIdtTable (IdtTable, &TemplateMap, &mExceptionHandlerData);
//
// Load Interrupt Descriptor Table
|