1 | /** @file
|
---|
2 | PE/Coff Extra Action library instances, it will report image debug info.
|
---|
3 |
|
---|
4 | Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
---|
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
6 |
|
---|
7 | **/
|
---|
8 |
|
---|
9 | #ifndef _PE_COFF_EXTRA_ACTION_LIB_H_
|
---|
10 | #define _PE_COFF_EXTRA_ACTION_LIB_H_
|
---|
11 |
|
---|
12 | #include <Base.h>
|
---|
13 | #include <Library/PeCoffExtraActionLib.h>
|
---|
14 | #include <Library/DebugLib.h>
|
---|
15 | #include <Library/BaseLib.h>
|
---|
16 | #include <Library/IoLib.h>
|
---|
17 | #include <Library/PcdLib.h>
|
---|
18 | #include <Library/BaseMemoryLib.h>
|
---|
19 |
|
---|
20 | #include <ImageDebugSupport.h>
|
---|
21 |
|
---|
22 | #define DEBUG_LOAD_IMAGE_METHOD_IO_HW_BREAKPOINT 1
|
---|
23 | #define DEBUG_LOAD_IMAGE_METHOD_SOFT_INT3 2
|
---|
24 |
|
---|
25 | #define IO_HW_BREAKPOINT_VECTOR_NUM 1
|
---|
26 | #define SOFT_INT_VECTOR_NUM 3
|
---|
27 |
|
---|
28 | extern UINTN AsmInterruptHandle;
|
---|
29 |
|
---|
30 | /**
|
---|
31 | Read IDT entry to check if IDT entries are setup by Debug Agent.
|
---|
32 |
|
---|
33 | @param[in] IdtDescriptor Pointer to IDT Descriptor.
|
---|
34 | @param[in] InterruptType Interrupt type.
|
---|
35 |
|
---|
36 | @retval TRUE IDT entries were setup by Debug Agent.
|
---|
37 | @retval FALSE IDT entries were not setuo by Debug Agent.
|
---|
38 |
|
---|
39 | **/
|
---|
40 | BOOLEAN
|
---|
41 | CheckDebugAgentHandler (
|
---|
42 | IN IA32_DESCRIPTOR *IdtDescriptor,
|
---|
43 | IN UINTN InterruptType
|
---|
44 | );
|
---|
45 |
|
---|
46 | /**
|
---|
47 | Save IDT entry for INT1 and update it.
|
---|
48 |
|
---|
49 | @param[in] IdtDescriptor Pointer to IDT Descriptor.
|
---|
50 | @param[out] SavedIdtEntry Original IDT entry returned.
|
---|
51 |
|
---|
52 | **/
|
---|
53 | VOID
|
---|
54 | SaveAndUpdateIdtEntry1 (
|
---|
55 | IN IA32_DESCRIPTOR *IdtDescriptor,
|
---|
56 | OUT IA32_IDT_GATE_DESCRIPTOR *SavedIdtEntry
|
---|
57 | );
|
---|
58 |
|
---|
59 | /**
|
---|
60 | Restore IDT entry for INT1.
|
---|
61 |
|
---|
62 | @param[in] IdtDescriptor Pointer to IDT Descriptor.
|
---|
63 | @param[in] RestoredIdtEntry IDT entry to be restored.
|
---|
64 |
|
---|
65 | **/
|
---|
66 | VOID
|
---|
67 | RestoreIdtEntry1 (
|
---|
68 | IN IA32_DESCRIPTOR *IdtDescriptor,
|
---|
69 | IN IA32_IDT_GATE_DESCRIPTOR *RestoredIdtEntry
|
---|
70 | );
|
---|
71 |
|
---|
72 | #endif
|
---|
73 |
|
---|