blob: c3f14d02c9874b81734b51915c3caa4381f5a398 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
/** @file DxeExceptionLib.h
Common header file for CPU Exception Handler Library.
Copyright (c) 2024, Loongson Technology Corporation Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef EXCEPTION_COMMON_H_
#define EXCEPTION_COMMON_H_
#include <Base.h>
#define MAX_DEBUG_MESSAGE_LENGTH 0x100
#define SMP_BOOT_CPU BIT0
#define SMP_RESCHEDULE BIT1
#define SMP_CALL_FUNCTION BIT2
extern INTN mExceptionKnownNameNum;
extern INTN mInterruptKnownNameNum;
/**
Get ASCII format string exception name by exception type.
@param[in] ExceptionType Exception type.
@return ASCII format string exception name.
**/
CONST CHAR8 *
GetExceptionNameStr (
IN EFI_EXCEPTION_TYPE ExceptionType
);
/**
Get ASCII format string interrupt name by exception type.
@param InterruptType Interrupt type.
@return ASCII format string interrupt name.
**/
CONST CHAR8 *
GetInterruptNameStr (
IN EFI_EXCEPTION_TYPE InterruptType
);
/**
Prints a message to the serial port.
@param[in] Format Format string for the message to print.
@param[in] ... Variable argument list whose contents are accessed
based on the format string specified by Format.
**/
VOID
EFIAPI
InternalPrintMessage (
IN CONST CHAR8 *Format,
...
);
/**
Find and display image base address and return image base and its entry point.
@param[in] CurrentEip Current instruction pointer.
**/
VOID
DumpModuleImageInfo (
IN UINTN CurrentEip
);
/**
IPI Interrupt Handler.
@param InterruptType The type of interrupt that occurred
@param SystemContext A pointer to the system context when the interrupt occurred
**/
VOID
EFIAPI
IpiInterruptHandler (
IN EFI_EXCEPTION_TYPE InterruptType,
IN EFI_SYSTEM_CONTEXT SystemContext
);
/**
Default exception handler.
@param[in] ExceptionType Exception type.
@param[in] SystemContext Pointer to EFI_SYSTEM_CONTEXT.
**/
VOID
EFIAPI
DefaultExceptionHandler (
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
);
/**
Display CPU information.
@param[in] ExceptionType Exception type.
@param[in] SystemContext Pointer to EFI_SYSTEM_CONTEXT.
**/
VOID
DumpImageAndCpuContent (
IN EFI_EXCEPTION_TYPE ExceptionType,
IN EFI_SYSTEM_CONTEXT SystemContext
);
/**
Get exception types
@param[in] SystemContext Pointer to EFI_SYSTEM_CONTEXT.
@return Exception type.
**/
EFI_EXCEPTION_TYPE
EFIAPI
GetExceptionType (
IN EFI_SYSTEM_CONTEXT SystemContext
);
/**
Get Common interrupt types
@param[in] SystemContext Pointer to EFI_SYSTEM_CONTEXT.
@return Interrupt type.
**/
EFI_EXCEPTION_TYPE
EFIAPI
GetInterruptType (
IN EFI_SYSTEM_CONTEXT SystemContext
);
#endif
|