]>
Commit | Line | Data |
---|---|---|
8f07f895 | 1 | /** @file\r |
2 | CPU Exception Library provides SEC/PEIM CPU exception handler.\r | |
3 | \r | |
4 | Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials are licensed and made available under\r | |
6 | the terms and conditions of the BSD License that accompanies this distribution.\r | |
7 | The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php.\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #include <PiPei.h>\r | |
16 | #include "CpuExceptionCommon.h"\r | |
17 | \r | |
18 | //\r | |
19 | // Image Aglinment size for SEC/PEI phase\r | |
20 | //\r | |
21 | CONST UINTN mImageAlignSize = 4;\r | |
22 | \r | |
23 | /**\r | |
24 | Common exception handler.\r | |
25 | \r | |
26 | @param ExceptionType Exception type.\r | |
27 | @param SystemContext Pointer to EFI_SYSTEM_CONTEXT.\r | |
28 | **/\r | |
29 | VOID\r | |
30 | EFIAPI\r | |
31 | CommonExceptionHandler (\r | |
32 | IN EFI_EXCEPTION_TYPE ExceptionType, \r | |
33 | IN EFI_SYSTEM_CONTEXT SystemContext\r | |
34 | )\r | |
35 | {\r | |
36 | //\r | |
37 | // Display ExceptionType, CPU information and Image information\r | |
38 | // \r | |
39 | DumpCpuContent (ExceptionType, SystemContext);\r | |
40 | \r | |
41 | //\r | |
42 | // Enter a dead loop.\r | |
43 | //\r | |
44 | CpuDeadLoop ();\r | |
45 | }\r | |
46 | \r | |
47 | /**\r | |
48 | Setup CPU exception handlers.\r | |
49 | \r | |
50 | This API will setups the CPU exception handler to display CPU contents and run into\r | |
51 | CpuDeadLoop(). \r | |
a9c7ab95 | 52 | Note: Before invoking this API, caller must allocate memory for IDT table and load \r |
53 | IDTR by AsmWriteIdtr().\r | |
8f07f895 | 54 | \r |
55 | **/\r | |
56 | VOID\r | |
57 | EFIAPI\r | |
58 | SetupCpuExceptionHandlers (\r | |
59 | IN VOID\r | |
60 | )\r | |
61 | {\r | |
62 | InternalSetupCpuExceptionHandlers ();\r | |
63 | }\r |