iPXE
DebugSupport.h
Go to the documentation of this file.
1 /** @file
2  DebugSupport protocol and supporting definitions as defined in the UEFI2.4
3  specification.
4 
5  The DebugSupport protocol is used by source level debuggers to abstract the
6  processor and handle context save and restore operations.
7 
8 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
9 Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
10 Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
11 
12 SPDX-License-Identifier: BSD-2-Clause-Patent
13 
14 **/
15 
16 #ifndef __DEBUG_SUPPORT_H__
17 #define __DEBUG_SUPPORT_H__
18 
19 FILE_LICENCE ( BSD2_PATENT );
20 FILE_SECBOOT ( PERMITTED );
21 
23 
25 
26 ///
27 /// Debug Support protocol {2755590C-6F3C-42FA-9EA4-A3BA543CDA25}.
28 ///
29 #define EFI_DEBUG_SUPPORT_PROTOCOL_GUID \
30  { \
31  0x2755590C, 0x6F3C, 0x42FA, {0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 } \
32  }
33 
34 ///
35 /// Processor exception to be hooked.
36 /// All exception types for IA32, X64, Itanium and EBC processors are defined.
37 ///
39 
40 ///
41 /// IA-32 processor exception types.
42 ///
43 #define EXCEPT_IA32_DIVIDE_ERROR 0
44 #define EXCEPT_IA32_DEBUG 1
45 #define EXCEPT_IA32_NMI 2
46 #define EXCEPT_IA32_BREAKPOINT 3
47 #define EXCEPT_IA32_OVERFLOW 4
48 #define EXCEPT_IA32_BOUND 5
49 #define EXCEPT_IA32_INVALID_OPCODE 6
50 #define EXCEPT_IA32_DOUBLE_FAULT 8
51 #define EXCEPT_IA32_INVALID_TSS 10
52 #define EXCEPT_IA32_SEG_NOT_PRESENT 11
53 #define EXCEPT_IA32_STACK_FAULT 12
54 #define EXCEPT_IA32_GP_FAULT 13
55 #define EXCEPT_IA32_PAGE_FAULT 14
56 #define EXCEPT_IA32_FP_ERROR 16
57 #define EXCEPT_IA32_ALIGNMENT_CHECK 17
58 #define EXCEPT_IA32_MACHINE_CHECK 18
59 #define EXCEPT_IA32_SIMD 19
60 
61 ///
62 /// FXSAVE_STATE.
63 /// FP / MMX / XMM registers (see fxrstor instruction definition).
64 ///
65 typedef struct {
75  UINT8 Reserved2[10];
76  UINT8 St0Mm0[10], Reserved3[6];
77  UINT8 St1Mm1[10], Reserved4[6];
78  UINT8 St2Mm2[10], Reserved5[6];
79  UINT8 St3Mm3[10], Reserved6[6];
80  UINT8 St4Mm4[10], Reserved7[6];
81  UINT8 St5Mm5[10], Reserved8[6];
82  UINT8 St6Mm6[10], Reserved9[6];
83  UINT8 St7Mm7[10], Reserved10[6];
84  UINT8 Xmm0[16];
85  UINT8 Xmm1[16];
86  UINT8 Xmm2[16];
87  UINT8 Xmm3[16];
88  UINT8 Xmm4[16];
89  UINT8 Xmm5[16];
90  UINT8 Xmm6[16];
91  UINT8 Xmm7[16];
92  UINT8 Reserved11[14 * 16];
94 
95 ///
96 /// IA-32 processor context definition.
97 ///
98 typedef struct {
108  UINT32 Cr1; /* Reserved */
115  UINT32 Gdtr[2];
116  UINT32 Idtr[2];
133 
134 ///
135 /// x64 processor exception types.
136 ///
137 #define EXCEPT_X64_DIVIDE_ERROR 0
138 #define EXCEPT_X64_DEBUG 1
139 #define EXCEPT_X64_NMI 2
140 #define EXCEPT_X64_BREAKPOINT 3
141 #define EXCEPT_X64_OVERFLOW 4
142 #define EXCEPT_X64_BOUND 5
143 #define EXCEPT_X64_INVALID_OPCODE 6
144 #define EXCEPT_X64_DOUBLE_FAULT 8
145 #define EXCEPT_X64_INVALID_TSS 10
146 #define EXCEPT_X64_SEG_NOT_PRESENT 11
147 #define EXCEPT_X64_STACK_FAULT 12
148 #define EXCEPT_X64_GP_FAULT 13
149 #define EXCEPT_X64_PAGE_FAULT 14
150 #define EXCEPT_X64_FP_ERROR 16
151 #define EXCEPT_X64_ALIGNMENT_CHECK 17
152 #define EXCEPT_X64_MACHINE_CHECK 18
153 #define EXCEPT_X64_SIMD 19
154 
155 ///
156 /// FXSAVE_STATE.
157 /// FP / MMX / XMM registers (see fxrstor instruction definition).
158 ///
159 typedef struct {
166  UINT8 Reserved1[8];
167  UINT8 St0Mm0[10], Reserved2[6];
168  UINT8 St1Mm1[10], Reserved3[6];
169  UINT8 St2Mm2[10], Reserved4[6];
170  UINT8 St3Mm3[10], Reserved5[6];
171  UINT8 St4Mm4[10], Reserved6[6];
172  UINT8 St5Mm5[10], Reserved7[6];
173  UINT8 St6Mm6[10], Reserved8[6];
174  UINT8 St7Mm7[10], Reserved9[6];
175  UINT8 Xmm0[16];
176  UINT8 Xmm1[16];
177  UINT8 Xmm2[16];
178  UINT8 Xmm3[16];
179  UINT8 Xmm4[16];
180  UINT8 Xmm5[16];
181  UINT8 Xmm6[16];
182  UINT8 Xmm7[16];
183  //
184  // NOTE: UEFI 2.0 spec definition as follows.
185  //
186  UINT8 Reserved11[14 * 16];
188 
189 ///
190 /// x64 processor context definition.
191 ///
192 typedef struct {
202  UINT64 Cr1; /* Reserved */
210  UINT64 Gdtr[2];
211  UINT64 Idtr[2];
236 
237 ///
238 /// Itanium Processor Family Exception types.
239 ///
240 #define EXCEPT_IPF_VHTP_TRANSLATION 0
241 #define EXCEPT_IPF_INSTRUCTION_TLB 1
242 #define EXCEPT_IPF_DATA_TLB 2
243 #define EXCEPT_IPF_ALT_INSTRUCTION_TLB 3
244 #define EXCEPT_IPF_ALT_DATA_TLB 4
245 #define EXCEPT_IPF_DATA_NESTED_TLB 5
246 #define EXCEPT_IPF_INSTRUCTION_KEY_MISSED 6
247 #define EXCEPT_IPF_DATA_KEY_MISSED 7
248 #define EXCEPT_IPF_DIRTY_BIT 8
249 #define EXCEPT_IPF_INSTRUCTION_ACCESS_BIT 9
250 #define EXCEPT_IPF_DATA_ACCESS_BIT 10
251 #define EXCEPT_IPF_BREAKPOINT 11
252 #define EXCEPT_IPF_EXTERNAL_INTERRUPT 12
253 //
254 // 13 - 19 reserved
255 //
256 #define EXCEPT_IPF_PAGE_NOT_PRESENT 20
257 #define EXCEPT_IPF_KEY_PERMISSION 21
258 #define EXCEPT_IPF_INSTRUCTION_ACCESS_RIGHTS 22
259 #define EXCEPT_IPF_DATA_ACCESS_RIGHTS 23
260 #define EXCEPT_IPF_GENERAL_EXCEPTION 24
261 #define EXCEPT_IPF_DISABLED_FP_REGISTER 25
262 #define EXCEPT_IPF_NAT_CONSUMPTION 26
263 #define EXCEPT_IPF_SPECULATION 27
264 //
265 // 28 reserved
266 //
267 #define EXCEPT_IPF_DEBUG 29
268 #define EXCEPT_IPF_UNALIGNED_REFERENCE 30
269 #define EXCEPT_IPF_UNSUPPORTED_DATA_REFERENCE 31
270 #define EXCEPT_IPF_FP_FAULT 32
271 #define EXCEPT_IPF_FP_TRAP 33
272 #define EXCEPT_IPF_LOWER_PRIVILEGE_TRANSFER_TRAP 34
273 #define EXCEPT_IPF_TAKEN_BRANCH 35
274 #define EXCEPT_IPF_SINGLE_STEP 36
275 //
276 // 37 - 44 reserved
277 //
278 #define EXCEPT_IPF_IA32_EXCEPTION 45
279 #define EXCEPT_IPF_IA32_INTERCEPT 46
280 #define EXCEPT_IPF_IA32_INTERRUPT 47
281 
282 ///
283 /// IPF processor context definition.
284 ///
285 typedef struct {
286  //
287  // The first reserved field is necessary to preserve alignment for the correct
288  // bits in UNAT and to insure F2 is 16 byte aligned.
289  //
322 
323  UINT64 F2[2];
324  UINT64 F3[2];
325  UINT64 F4[2];
326  UINT64 F5[2];
327  UINT64 F6[2];
328  UINT64 F7[2];
329  UINT64 F8[2];
330  UINT64 F9[2];
331  UINT64 F10[2];
332  UINT64 F11[2];
333  UINT64 F12[2];
334  UINT64 F13[2];
335  UINT64 F14[2];
336  UINT64 F15[2];
337  UINT64 F16[2];
338  UINT64 F17[2];
339  UINT64 F18[2];
340  UINT64 F19[2];
341  UINT64 F20[2];
342  UINT64 F21[2];
343  UINT64 F22[2];
344  UINT64 F23[2];
345  UINT64 F24[2];
346  UINT64 F25[2];
347  UINT64 F26[2];
348  UINT64 F27[2];
349  UINT64 F28[2];
350  UINT64 F29[2];
351  UINT64 F30[2];
352  UINT64 F31[2];
353 
355 
364 
365  //
366  // application registers
367  //
372 
374 
382 
384 
386 
388 
392 
393  //
394  // control registers
395  //
409 
410  //
411  // debug registers
412  //
421 
430 
431  //
432  // virtual registers - nat bits for R1-R31
433  //
436 
437 ///
438 /// EBC processor exception types.
439 ///
440 #define EXCEPT_EBC_UNDEFINED 0
441 #define EXCEPT_EBC_DIVIDE_ERROR 1
442 #define EXCEPT_EBC_DEBUG 2
443 #define EXCEPT_EBC_BREAKPOINT 3
444 #define EXCEPT_EBC_OVERFLOW 4
445 #define EXCEPT_EBC_INVALID_OPCODE 5 ///< Opcode out of range.
446 #define EXCEPT_EBC_STACK_FAULT 6
447 #define EXCEPT_EBC_ALIGNMENT_CHECK 7
448 #define EXCEPT_EBC_INSTRUCTION_ENCODING 8 ///< Malformed instruction.
449 #define EXCEPT_EBC_BAD_BREAK 9 ///< BREAK 0 or undefined BREAK.
450 #define EXCEPT_EBC_STEP 10 ///< To support debug stepping.
451 ///
452 /// For coding convenience, define the maximum valid EBC exception.
453 ///
454 #define MAX_EBC_EXCEPTION EXCEPT_EBC_STEP
455 
456 ///
457 /// EBC processor context definition.
458 ///
459 typedef struct {
472 
473 ///
474 /// ARM processor exception types.
475 ///
476 #define EXCEPT_ARM_RESET 0
477 #define EXCEPT_ARM_UNDEFINED_INSTRUCTION 1
478 #define EXCEPT_ARM_SOFTWARE_INTERRUPT 2
479 #define EXCEPT_ARM_PREFETCH_ABORT 3
480 #define EXCEPT_ARM_DATA_ABORT 4
481 #define EXCEPT_ARM_RESERVED 5
482 #define EXCEPT_ARM_IRQ 6
483 #define EXCEPT_ARM_FIQ 7
484 
485 ///
486 /// For coding convenience, define the maximum valid ARM exception.
487 ///
488 #define MAX_ARM_EXCEPTION EXCEPT_ARM_FIQ
489 
490 ///
491 /// ARM processor context definition.
492 ///
493 typedef struct {
516 
517 ///
518 /// AARCH64 processor exception types.
519 ///
520 #define EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS 0
521 #define EXCEPT_AARCH64_IRQ 1
522 #define EXCEPT_AARCH64_FIQ 2
523 #define EXCEPT_AARCH64_SERROR 3
524 
525 ///
526 /// For coding convenience, define the maximum valid ARM exception.
527 ///
528 #define MAX_AARCH64_EXCEPTION EXCEPT_AARCH64_SERROR
529 
530 typedef struct {
531  // General Purpose Registers
561  UINT64 FP; // x29 - Frame pointer
562  UINT64 LR; // x30 - Link Register
563  UINT64 SP; // x31 - Stack pointer
564 
565  // FP/SIMD Registers
566  UINT64 V0[2];
567  UINT64 V1[2];
568  UINT64 V2[2];
569  UINT64 V3[2];
570  UINT64 V4[2];
571  UINT64 V5[2];
572  UINT64 V6[2];
573  UINT64 V7[2];
574  UINT64 V8[2];
575  UINT64 V9[2];
576  UINT64 V10[2];
577  UINT64 V11[2];
578  UINT64 V12[2];
579  UINT64 V13[2];
580  UINT64 V14[2];
581  UINT64 V15[2];
582  UINT64 V16[2];
583  UINT64 V17[2];
584  UINT64 V18[2];
585  UINT64 V19[2];
586  UINT64 V20[2];
587  UINT64 V21[2];
588  UINT64 V22[2];
589  UINT64 V23[2];
590  UINT64 V24[2];
591  UINT64 V25[2];
592  UINT64 V26[2];
593  UINT64 V27[2];
594  UINT64 V28[2];
595  UINT64 V29[2];
596  UINT64 V30[2];
597  UINT64 V31[2];
598 
599  UINT64 ELR; // Exception Link Register
600  UINT64 SPSR; // Saved Processor Status Register
601  UINT64 FPSR; // Floating Point Status Register
602  UINT64 ESR; // Exception syndrome register
603  UINT64 FAR; // Fault Address Register
605 
606 ///
607 /// RISC-V processor exception types.
608 ///
609 #define EXCEPT_RISCV_INST_MISALIGNED 0
610 #define EXCEPT_RISCV_INST_ACCESS_FAULT 1
611 #define EXCEPT_RISCV_ILLEGAL_INST 2
612 #define EXCEPT_RISCV_BREAKPOINT 3
613 #define EXCEPT_RISCV_LOAD_ADDRESS_MISALIGNED 4
614 #define EXCEPT_RISCV_LOAD_ACCESS_FAULT 5
615 #define EXCEPT_RISCV_STORE_AMO_ADDRESS_MISALIGNED 6
616 #define EXCEPT_RISCV_STORE_AMO_ACCESS_FAULT 7
617 #define EXCEPT_RISCV_ENV_CALL_FROM_UMODE 8
618 #define EXCEPT_RISCV_ENV_CALL_FROM_SMODE 9
619 #define EXCEPT_RISCV_ENV_CALL_FROM_VS_MODE 10
620 #define EXCEPT_RISCV_ENV_CALL_FROM_MMODE 11
621 #define EXCEPT_RISCV_INST_ACCESS_PAGE_FAULT 12
622 #define EXCEPT_RISCV_LOAD_ACCESS_PAGE_FAULT 13
623 #define EXCEPT_RISCV_14 14
624 #define EXCEPT_RISCV_STORE_ACCESS_PAGE_FAULT 15
625 #define EXCEPT_RISCV_16 16
626 #define EXCEPT_RISCV_17 17
627 #define EXCEPT_RISCV_18 18
628 #define EXCEPT_RISCV_19 19
629 #define EXCEPT_RISCV_INST_GUEST_PAGE_FAULT 20
630 #define EXCEPT_RISCV_LOAD_GUEST_PAGE_FAULT 21
631 #define EXCEPT_RISCV_VIRTUAL_INSTRUCTION 22
632 #define EXCEPT_RISCV_STORE_GUEST_PAGE_FAULT 23
633 #define EXCEPT_RISCV_MAX_EXCEPTIONS (EXCEPT_RISCV_STORE_GUEST_PAGE_FAULT)
634 
635 ///
636 /// RISC-V processor exception types for interrupts.
637 ///
638 #define EXCEPT_RISCV_IS_IRQ(x) ((x & 0x8000000000000000UL) != 0)
639 #define EXCEPT_RISCV_IRQ_INDEX(x) (x & 0x7FFFFFFFFFFFFFFFUL)
640 #define EXCEPT_RISCV_IRQ_0 0x8000000000000000UL
641 #define EXCEPT_RISCV_IRQ_SOFT_FROM_SMODE 0x8000000000000001UL
642 #define EXCEPT_RISCV_IRQ_SOFT_FROM_VSMODE 0x8000000000000002UL
643 #define EXCEPT_RISCV_IRQ_SOFT_FROM_MMODE 0x8000000000000003UL
644 #define EXCEPT_RISCV_IRQ_4 0x8000000000000004UL
645 #define EXCEPT_RISCV_IRQ_TIMER_FROM_SMODE 0x8000000000000005UL
646 #define EXCEPT_RISCV_MAX_IRQS (EXCEPT_RISCV_IRQ_INDEX(EXCEPT_RISCV_IRQ_TIMER_FROM_SMODE))
647 
648 typedef struct {
685 
686 ///
687 /// LoongArch processor exception types.
688 ///
689 /// The exception types is located in the CSR ESTAT
690 /// register offset 16 bits, width 6 bits.
691 ///
692 /// If you want to register an exception hook, you can
693 /// shfit the number left by 16 bits, and the exception
694 /// handler will know the types.
695 ///
696 /// For example:
697 /// mCpu->CpuRegisterInterruptHandler (
698 /// mCpu,
699 /// (EXCEPT_LOONGARCH_PPI << CSR_ESTAT_EXC_SHIFT),
700 /// PpiExceptionHandler
701 /// );
702 ///
703 #define EXCEPT_LOONGARCH_INT 0
704 #define EXCEPT_LOONGARCH_PIL 1
705 #define EXCEPT_LOONGARCH_PIS 2
706 #define EXCEPT_LOONGARCH_PIF 3
707 #define EXCEPT_LOONGARCH_PME 4
708 #define EXCEPT_LOONGARCH_PNR 5
709 #define EXCEPT_LOONGARCH_PNX 6
710 #define EXCEPT_LOONGARCH_PPI 7
711 #define EXCEPT_LOONGARCH_ADE 8
712 #define EXCEPT_LOONGARCH_ALE 9
713 #define EXCEPT_LOONGARCH_BCE 10
714 #define EXCEPT_LOONGARCH_SYS 11
715 #define EXCEPT_LOONGARCH_BRK 12
716 #define EXCEPT_LOONGARCH_INE 13
717 #define EXCEPT_LOONGARCH_IPE 14
718 #define EXCEPT_LOONGARCH_FPD 15
719 #define EXCEPT_LOONGARCH_SXD 16
720 #define EXCEPT_LOONGARCH_ASXD 17
721 #define EXCEPT_LOONGARCH_FPE 18
722 #define EXCEPT_LOONGARCH_WPE 19
723 #define EXCEPT_LOONGARCH_BTD 20
724 #define EXCEPT_LOONGARCH_BTE 21
725 #define EXCEPT_LOONGARCH_GSPR 22
726 #define EXCEPT_LOONGARCH_HVC 23
727 #define EXCEPT_LOONGARCH_GCXC 24
728 
729 ///
730 /// For coding convenience, define the maximum valid
731 /// LoongArch exception.
732 ///
733 #define MAX_LOONGARCH_EXCEPTION 64
734 
735 ///
736 /// LoongArch processor Interrupt types.
737 ///
738 #define EXCEPT_LOONGARCH_INT_SIP0 0
739 #define EXCEPT_LOONGARCH_INT_SIP1 1
740 #define EXCEPT_LOONGARCH_INT_IP0 2
741 #define EXCEPT_LOONGARCH_INT_IP1 3
742 #define EXCEPT_LOONGARCH_INT_IP2 4
743 #define EXCEPT_LOONGARCH_INT_IP3 5
744 #define EXCEPT_LOONGARCH_INT_IP4 6
745 #define EXCEPT_LOONGARCH_INT_IP5 7
746 #define EXCEPT_LOONGARCH_INT_IP6 8
747 #define EXCEPT_LOONGARCH_INT_IP7 9
748 #define EXCEPT_LOONGARCH_INT_PMC 10
749 #define EXCEPT_LOONGARCH_INT_TIMER 11
750 #define EXCEPT_LOONGARCH_INT_IPI 12
751 
752 ///
753 /// For coding convenience, define the maximum valid
754 /// LoongArch interrupt.
755 ///
756 #define MAX_LOONGARCH_INTERRUPT 16
757 
758 typedef struct {
791 
792  UINT64 CRMD; // CuRrent MoDe information
793  UINT64 PRMD; // PRe-exception MoDe information
794  UINT64 EUEN; // Extended component Unit ENable
795  UINT64 MISC; // MISCellaneous controller
796  UINT64 ECFG; // Exception ConFiGuration
797  UINT64 ESTAT; // Exception STATus
798  UINT64 ERA; // Exception Return Address
799  UINT64 BADV; // BAD Virtual address
800  UINT64 BADI; // BAD Instruction
802 
803 ///
804 /// Universal EFI_SYSTEM_CONTEXT definition.
805 ///
806 typedef union {
816 
817 //
818 // DebugSupport callback function prototypes
819 //
820 
821 /**
822  Registers and enables an exception callback function for the specified exception.
823 
824  @param ExceptionType Exception types in EBC, IA-32, x64, or IPF.
825  @param SystemContext Exception content.
826 
827 **/
828 typedef
829 VOID
831  IN EFI_EXCEPTION_TYPE ExceptionType,
832  IN OUT EFI_SYSTEM_CONTEXT SystemContext
833  );
834 
835 /**
836  Registers and enables the on-target debug agent's periodic entry point.
837 
838  @param SystemContext Exception content.
839 
840 **/
841 typedef
842 VOID
844  IN OUT EFI_SYSTEM_CONTEXT SystemContext
845  );
846 
847 ///
848 /// Machine type definition
849 ///
850 typedef enum {
857 
858 //
859 // DebugSupport member function definitions
860 //
861 
862 /**
863  Returns the maximum value that may be used for the ProcessorIndex parameter in
864  RegisterPeriodicCallback() and RegisterExceptionCallback().
865 
866  @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.
867  @param MaxProcessorIndex Pointer to a caller-allocated UINTN in which the maximum supported
868  processor index is returned.
869 
870  @retval EFI_SUCCESS The function completed successfully.
871 
872 **/
873 typedef
877  OUT UINTN *MaxProcessorIndex
878  );
879 
880 /**
881  Registers a function to be called back periodically in interrupt context.
882 
883  @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.
884  @param ProcessorIndex Specifies which processor the callback function applies to.
885  @param PeriodicCallback A pointer to a function of type PERIODIC_CALLBACK that is the main
886  periodic entry point of the debug agent.
887 
888  @retval EFI_SUCCESS The function completed successfully.
889  @retval EFI_ALREADY_STARTED Non-NULL PeriodicCallback parameter when a callback
890  function was previously registered.
891  @retval EFI_OUT_OF_RESOURCES System has insufficient memory resources to register new callback
892  function.
893 
894 **/
895 typedef
899  IN UINTN ProcessorIndex,
900  IN EFI_PERIODIC_CALLBACK PeriodicCallback
901  );
902 
903 /**
904  Registers a function to be called when a given processor exception occurs.
905 
906  @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.
907  @param ProcessorIndex Specifies which processor the callback function applies to.
908  @param ExceptionCallback A pointer to a function of type EXCEPTION_CALLBACK that is called
909  when the processor exception specified by ExceptionType occurs.
910  @param ExceptionType Specifies which processor exception to hook.
911 
912  @retval EFI_SUCCESS The function completed successfully.
913  @retval EFI_ALREADY_STARTED Non-NULL PeriodicCallback parameter when a callback
914  function was previously registered.
915  @retval EFI_OUT_OF_RESOURCES System has insufficient memory resources to register new callback
916  function.
917 
918 **/
919 typedef
923  IN UINTN ProcessorIndex,
924  IN EFI_EXCEPTION_CALLBACK ExceptionCallback,
925  IN EFI_EXCEPTION_TYPE ExceptionType
926  );
927 
928 /**
929  Invalidates processor instruction cache for a memory range. Subsequent execution in this range
930  causes a fresh memory fetch to retrieve code to be executed.
931 
932  @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.
933  @param ProcessorIndex Specifies which processor's instruction cache is to be invalidated.
934  @param Start Specifies the physical base of the memory range to be invalidated.
935  @param Length Specifies the minimum number of bytes in the processor's instruction
936  cache to invalidate.
937 
938  @retval EFI_SUCCESS The function completed successfully.
939 
940 **/
941 typedef
945  IN UINTN ProcessorIndex,
946  IN VOID *Start,
948  );
949 
950 ///
951 /// This protocol provides the services to allow the debug agent to register
952 /// callback functions that are called either periodically or when specific
953 /// processor exceptions occur.
954 ///
956  ///
957  /// Declares the processor architecture for this instance of the EFI Debug Support protocol.
958  ///
964 };
965 
967 
968 #endif
EFI_INSTRUCTION_SET_ARCHITECTURE
Machine type definition.
Definition: DebugSupport.h:850
VOID(EFIAPI * EFI_PERIODIC_CALLBACK)(IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Registers and enables the on-target debug agent's periodic entry point.
Definition: DebugSupport.h:843
EFI_SYSTEM_CONTEXT_RISCV64 * SystemContextRiscV64
Definition: DebugSupport.h:813
128 bit buffer containing a unique identifier value.
Definition: Base.h:216
EFI_INSTRUCTION_SET_ARCHITECTURE Isa
Declares the processor architecture for this instance of the EFI Debug Support protocol.
Definition: DebugSupport.h:959
EFI_SYSTEM_CONTEXT_IPF * SystemContextIpf
Definition: DebugSupport.h:810
INT64 INTN
Signed value of native width.
EFI_SYSTEM_CONTEXT_IA32 * SystemContextIa32
Definition: DebugSupport.h:808
EFI_SYSTEM_CONTEXT_AARCH64 * SystemContextAArch64
Definition: DebugSupport.h:812
EFI_SYSTEM_CONTEXT_X64 * SystemContextX64
Definition: DebugSupport.h:809
unsigned int UINT32
Definition: ProcessorBind.h:99
INTN EFI_EXCEPTION_TYPE
Processor exception to be hooked.
Definition: DebugSupport.h:38
UINT8_t Length
Length of this structure.
Definition: pxe_api.h:70
unsigned char UINT8
EFI_SYSTEM_CONTEXT_ARM * SystemContextArm
Definition: DebugSupport.h:811
FILE_LICENCE(BSD2_PATENT)
EFI_REGISTER_EXCEPTION_CALLBACK RegisterExceptionCallback
Definition: DebugSupport.h:962
EFI_FX_SAVE_STATE_X64 FxSaveState
Definition: DebugSupport.h:194
0x8664
Definition: DebugSupport.h:852
EFI_FX_SAVE_STATE_IA32 FxSaveState
Definition: DebugSupport.h:100
#define OUT
Definition: mlx_utils.h:29
EFI_STATUS(EFIAPI * EFI_REGISTER_EXCEPTION_CALLBACK)(IN EFI_DEBUG_SUPPORT_PROTOCOL *This, IN UINTN ProcessorIndex, IN EFI_EXCEPTION_CALLBACK ExceptionCallback, IN EFI_EXCEPTION_TYPE ExceptionType)
Registers a function to be called when a given processor exception occurs.
Definition: DebugSupport.h:921
Universal EFI_SYSTEM_CONTEXT definition.
Definition: DebugSupport.h:806
#define IMAGE_FILE_MACHINE_X64
Definition: PeImage.h:38
EFI_GET_MAXIMUM_PROCESSOR_INDEX GetMaximumProcessorIndex
Definition: DebugSupport.h:960
ARM processor context definition.
Definition: DebugSupport.h:493
unsigned short UINT16
#define EFIAPI
IPF processor context definition.
Definition: DebugSupport.h:285
EFI_STATUS(EFIAPI * EFI_GET_MAXIMUM_PROCESSOR_INDEX)(IN EFI_DEBUG_SUPPORT_PROTOCOL *This, OUT UINTN *MaxProcessorIndex)
Returns the maximum value that may be used for the ProcessorIndex parameter in RegisterPeriodicCallba...
Definition: DebugSupport.h:875
#define IMAGE_FILE_MACHINE_ARM64
Definition: PeImage.h:40
UINT64 UINTN
Unsigned value of native width.
EFI image format for PE32, PE32+ and TE.
#define VOID
Undeclared type.
Definition: Base.h:272
unsigned long long UINT64
Definition: ProcessorBind.h:97
0x0EBC
Definition: DebugSupport.h:854
x64 processor context definition.
Definition: DebugSupport.h:192
0x0200
Definition: DebugSupport.h:853
FILE_SECBOOT(PERMITTED)
#define IN
Definition: mlx_utils.h:28
#define IMAGE_FILE_MACHINE_IA64
Definition: PeImage.h:36
EFI_REGISTER_PERIODIC_CALLBACK RegisterPeriodicCallback
Definition: DebugSupport.h:961
EFI_SYSTEM_CONTEXT_EBC * SystemContextEbc
Definition: DebugSupport.h:807
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:32
IA-32 processor context definition.
Definition: DebugSupport.h:98
EFI_STATUS(EFIAPI * EFI_INVALIDATE_INSTRUCTION_CACHE)(IN EFI_DEBUG_SUPPORT_PROTOCOL *This, IN UINTN ProcessorIndex, IN VOID *Start, IN UINT64 Length)
Invalidates processor instruction cache for a memory range.
Definition: DebugSupport.h:943
#define IMAGE_FILE_MACHINE_I386
Definition: PeImage.h:35
EBC processor context definition.
Definition: DebugSupport.h:459
EFI_SYSTEM_CONTEXT_LOONGARCH64 * SystemContextLoongArch64
Definition: DebugSupport.h:814
#define IMAGE_FILE_MACHINE_EBC
Definition: PeImage.h:37
VOID(EFIAPI * EFI_EXCEPTION_CALLBACK)(IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Registers and enables an exception callback function for the specified exception.
Definition: DebugSupport.h:830
EFI_STATUS(EFIAPI * EFI_REGISTER_PERIODIC_CALLBACK)(IN EFI_DEBUG_SUPPORT_PROTOCOL *This, IN UINTN ProcessorIndex, IN EFI_PERIODIC_CALLBACK PeriodicCallback)
Registers a function to be called back periodically in interrupt context.
Definition: DebugSupport.h:897
EFI_GUID gEfiDebugSupportProtocolGuid
EFI_INVALIDATE_INSTRUCTION_CACHE InvalidateInstructionCache
Definition: DebugSupport.h:963
This protocol provides the services to allow the debug agent to register callback functions that are ...
Definition: DebugSupport.h:955
0x014C
Definition: DebugSupport.h:851