]>
Commit | Line | Data |
---|---|---|
b422b62c | 1 | /** @file\r |
2 | PE/Coff Extra Action library instances, it will report image debug info.\r | |
3 | \r | |
4 | Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. 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 | #ifndef _PE_COFF_EXTRA_ACTION_LIB_H_\r | |
16 | #define _PE_COFF_EXTRA_ACTION_LIB_H_\r | |
17 | \r | |
18 | #include <Base.h>\r | |
19 | #include <Library/PeCoffExtraActionLib.h>\r | |
20 | #include <Library/DebugLib.h>\r | |
21 | #include <Library/BaseLib.h>\r | |
22 | #include <Library/IoLib.h>\r | |
23 | #include <Library/PcdLib.h>\r | |
24 | #include <Library/BaseMemoryLib.h>\r | |
25 | \r | |
26 | #include <ImageDebugSupport.h>\r | |
27 | \r | |
28 | #define DEBUG_LOAD_IMAGE_METHOD_IO_HW_BREAKPOINT 1\r | |
29 | #define DEBUG_LOAD_IMAGE_METHOD_SOFT_INT3 2\r | |
30 | \r | |
8cc26df4 JF |
31 | #define IO_HW_BREAKPOINT_VECTOR_NUM 1\r |
32 | #define SOFT_INT_VECTOR_NUM 3\r | |
33 | \r | |
b422b62c | 34 | extern UINTN AsmInterruptHandle;\r |
35 | \r | |
36 | /**\r | |
37 | Read IDT entry to check if IDT entries are setup by Debug Agent.\r | |
38 | \r | |
39 | @param[in] IdtDescriptor Pointer to IDT Descriptor.\r | |
8cc26df4 | 40 | @param[in] InterruptType Interrupt type.\r |
b422b62c | 41 | \r |
42 | @retval TRUE IDT entries were setup by Debug Agent.\r | |
43 | @retval FALSE IDT entries were not setuo by Debug Agent.\r | |
44 | \r | |
45 | **/\r | |
46 | BOOLEAN \r | |
47 | CheckDebugAgentHandler (\r | |
8cc26df4 JF |
48 | IN IA32_DESCRIPTOR *IdtDescriptor,\r |
49 | IN UINTN InterruptType\r | |
b422b62c | 50 | );\r |
51 | \r | |
52 | /**\r | |
53 | Save IDT entry for INT1 and update it. \r | |
54 | \r | |
55 | @param[in] IdtDescriptor Pointer to IDT Descriptor.\r | |
56 | @param[out] SavedIdtEntry Original IDT entry returned.\r | |
57 | \r | |
58 | **/\r | |
59 | VOID\r | |
60 | SaveAndUpdateIdtEntry1 (\r | |
61 | IN IA32_DESCRIPTOR *IdtDescriptor,\r | |
62 | OUT IA32_IDT_GATE_DESCRIPTOR *SavedIdtEntry\r | |
63 | );\r | |
64 | \r | |
65 | /**\r | |
66 | Restore IDT entry for INT1. \r | |
67 | \r | |
68 | @param[in] IdtDescriptor Pointer to IDT Descriptor.\r | |
69 | @param[in] RestoredIdtEntry IDT entry to be restored.\r | |
70 | \r | |
71 | **/\r | |
72 | VOID\r | |
73 | RestoreIdtEntry1 (\r | |
74 | IN IA32_DESCRIPTOR *IdtDescriptor,\r | |
75 | IN IA32_IDT_GATE_DESCRIPTOR *RestoredIdtEntry\r | |
76 | );\r | |
77 | \r | |
78 | #endif\r | |
79 | \r |