TianoCore EDK2 master
Loading...
Searching...
No Matches
SecPeiExceptionLib.c
Go to the documentation of this file.
1
10#include <Library/BaseLib.h>
11#include <Library/CpuLib.h>
13#include <Library/DebugLib.h>
17
18#include "ExceptionCommon.h"
19
36 IN EFI_EXCEPTION_TYPE InterruptType,
37 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
38 )
39{
40 return EFI_UNSUPPORTED;
41}
42
50VOID
51EFIAPI
53 IN EFI_EXCEPTION_TYPE ExceptionType,
54 IN OUT EFI_SYSTEM_CONTEXT SystemContext
55 )
56{
57 EFI_EXCEPTION_TYPE InterruptType;
58
59 if (ExceptionType == EXCEPT_LOONGARCH_INT) {
60 //
61 // Interrupt
62 //
63 InterruptType = GetInterruptType (SystemContext);
64 if (InterruptType == EXCEPT_LOONGARCH_INT_IPI) {
65 //
66 // APs may wake up via IPI IRQ during the SEC or PEI phase, clear the IPI interrupt and
67 // perform the remaining work.
68 //
69 IpiInterruptHandler (InterruptType, SystemContext);
70 return;
71 } else {
72 ExceptionType = InterruptType;
73 }
74 } else {
75 //
76 // Exception
77 //
78 ExceptionType >>= CSR_ESTAT_EXC_SHIFT;
79 }
80
81 DefaultExceptionHandler (ExceptionType, SystemContext);
82}
83
96EFIAPI
98 IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL
99 )
100{
101 return EFI_SUCCESS;
102}
VOID(EFIAPI * EFI_CPU_INTERRUPT_HANDLER)(IN CONST EFI_EXCEPTION_TYPE InterruptType, IN CONST EFI_SYSTEM_CONTEXT SystemContext)
Definition: Cpu.h:52
VOID DefaultExceptionHandler(IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
INTN EFI_EXCEPTION_TYPE
Definition: DebugSupport.h:35
EFI_STATUS EFIAPI InitializeCpuExceptionHandlers(IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL)
VOID EFIAPI CommonExceptionHandler(IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
EFI_STATUS RegisterCpuInterruptHandler(IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
VOID EFIAPI IpiInterruptHandler(IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_SYSTEM_CONTEXT SystemContext)