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 
22 
24 
25 ///
26 /// Debug Support protocol {2755590C-6F3C-42FA-9EA4-A3BA543CDA25}.
27 ///
28 #define EFI_DEBUG_SUPPORT_PROTOCOL_GUID \
29  { \
30  0x2755590C, 0x6F3C, 0x42FA, {0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 } \
31  }
32 
33 ///
34 /// Processor exception to be hooked.
35 /// All exception types for IA32, X64, Itanium and EBC processors are defined.
36 ///
38 
39 ///
40 /// IA-32 processor exception types.
41 ///
42 #define EXCEPT_IA32_DIVIDE_ERROR 0
43 #define EXCEPT_IA32_DEBUG 1
44 #define EXCEPT_IA32_NMI 2
45 #define EXCEPT_IA32_BREAKPOINT 3
46 #define EXCEPT_IA32_OVERFLOW 4
47 #define EXCEPT_IA32_BOUND 5
48 #define EXCEPT_IA32_INVALID_OPCODE 6
49 #define EXCEPT_IA32_DOUBLE_FAULT 8
50 #define EXCEPT_IA32_INVALID_TSS 10
51 #define EXCEPT_IA32_SEG_NOT_PRESENT 11
52 #define EXCEPT_IA32_STACK_FAULT 12
53 #define EXCEPT_IA32_GP_FAULT 13
54 #define EXCEPT_IA32_PAGE_FAULT 14
55 #define EXCEPT_IA32_FP_ERROR 16
56 #define EXCEPT_IA32_ALIGNMENT_CHECK 17
57 #define EXCEPT_IA32_MACHINE_CHECK 18
58 #define EXCEPT_IA32_SIMD 19
59 
60 ///
61 /// FXSAVE_STATE.
62 /// FP / MMX / XMM registers (see fxrstor instruction definition).
63 ///
64 typedef struct {
74  UINT8 Reserved2[10];
75  UINT8 St0Mm0[10], Reserved3[6];
76  UINT8 St1Mm1[10], Reserved4[6];
77  UINT8 St2Mm2[10], Reserved5[6];
78  UINT8 St3Mm3[10], Reserved6[6];
79  UINT8 St4Mm4[10], Reserved7[6];
80  UINT8 St5Mm5[10], Reserved8[6];
81  UINT8 St6Mm6[10], Reserved9[6];
82  UINT8 St7Mm7[10], Reserved10[6];
83  UINT8 Xmm0[16];
84  UINT8 Xmm1[16];
85  UINT8 Xmm2[16];
86  UINT8 Xmm3[16];
87  UINT8 Xmm4[16];
88  UINT8 Xmm5[16];
89  UINT8 Xmm6[16];
90  UINT8 Xmm7[16];
91  UINT8 Reserved11[14 * 16];
93 
94 ///
95 /// IA-32 processor context definition.
96 ///
97 typedef struct {
107  UINT32 Cr1; /* Reserved */
114  UINT32 Gdtr[2];
115  UINT32 Idtr[2];
132 
133 ///
134 /// x64 processor exception types.
135 ///
136 #define EXCEPT_X64_DIVIDE_ERROR 0
137 #define EXCEPT_X64_DEBUG 1
138 #define EXCEPT_X64_NMI 2
139 #define EXCEPT_X64_BREAKPOINT 3
140 #define EXCEPT_X64_OVERFLOW 4
141 #define EXCEPT_X64_BOUND 5
142 #define EXCEPT_X64_INVALID_OPCODE 6
143 #define EXCEPT_X64_DOUBLE_FAULT 8
144 #define EXCEPT_X64_INVALID_TSS 10
145 #define EXCEPT_X64_SEG_NOT_PRESENT 11
146 #define EXCEPT_X64_STACK_FAULT 12
147 #define EXCEPT_X64_GP_FAULT 13
148 #define EXCEPT_X64_PAGE_FAULT 14
149 #define EXCEPT_X64_FP_ERROR 16
150 #define EXCEPT_X64_ALIGNMENT_CHECK 17
151 #define EXCEPT_X64_MACHINE_CHECK 18
152 #define EXCEPT_X64_SIMD 19
153 
154 ///
155 /// FXSAVE_STATE.
156 /// FP / MMX / XMM registers (see fxrstor instruction definition).
157 ///
158 typedef struct {
165  UINT8 Reserved1[8];
166  UINT8 St0Mm0[10], Reserved2[6];
167  UINT8 St1Mm1[10], Reserved3[6];
168  UINT8 St2Mm2[10], Reserved4[6];
169  UINT8 St3Mm3[10], Reserved5[6];
170  UINT8 St4Mm4[10], Reserved6[6];
171  UINT8 St5Mm5[10], Reserved7[6];
172  UINT8 St6Mm6[10], Reserved8[6];
173  UINT8 St7Mm7[10], Reserved9[6];
174  UINT8 Xmm0[16];
175  UINT8 Xmm1[16];
176  UINT8 Xmm2[16];
177  UINT8 Xmm3[16];
178  UINT8 Xmm4[16];
179  UINT8 Xmm5[16];
180  UINT8 Xmm6[16];
181  UINT8 Xmm7[16];
182  //
183  // NOTE: UEFI 2.0 spec definition as follows.
184  //
185  UINT8 Reserved11[14 * 16];
187 
188 ///
189 /// x64 processor context definition.
190 ///
191 typedef struct {
201  UINT64 Cr1; /* Reserved */
209  UINT64 Gdtr[2];
210  UINT64 Idtr[2];
235 
236 ///
237 /// Itanium Processor Family Exception types.
238 ///
239 #define EXCEPT_IPF_VHTP_TRANSLATION 0
240 #define EXCEPT_IPF_INSTRUCTION_TLB 1
241 #define EXCEPT_IPF_DATA_TLB 2
242 #define EXCEPT_IPF_ALT_INSTRUCTION_TLB 3
243 #define EXCEPT_IPF_ALT_DATA_TLB 4
244 #define EXCEPT_IPF_DATA_NESTED_TLB 5
245 #define EXCEPT_IPF_INSTRUCTION_KEY_MISSED 6
246 #define EXCEPT_IPF_DATA_KEY_MISSED 7
247 #define EXCEPT_IPF_DIRTY_BIT 8
248 #define EXCEPT_IPF_INSTRUCTION_ACCESS_BIT 9
249 #define EXCEPT_IPF_DATA_ACCESS_BIT 10
250 #define EXCEPT_IPF_BREAKPOINT 11
251 #define EXCEPT_IPF_EXTERNAL_INTERRUPT 12
252 //
253 // 13 - 19 reserved
254 //
255 #define EXCEPT_IPF_PAGE_NOT_PRESENT 20
256 #define EXCEPT_IPF_KEY_PERMISSION 21
257 #define EXCEPT_IPF_INSTRUCTION_ACCESS_RIGHTS 22
258 #define EXCEPT_IPF_DATA_ACCESS_RIGHTS 23
259 #define EXCEPT_IPF_GENERAL_EXCEPTION 24
260 #define EXCEPT_IPF_DISABLED_FP_REGISTER 25
261 #define EXCEPT_IPF_NAT_CONSUMPTION 26
262 #define EXCEPT_IPF_SPECULATION 27
263 //
264 // 28 reserved
265 //
266 #define EXCEPT_IPF_DEBUG 29
267 #define EXCEPT_IPF_UNALIGNED_REFERENCE 30
268 #define EXCEPT_IPF_UNSUPPORTED_DATA_REFERENCE 31
269 #define EXCEPT_IPF_FP_FAULT 32
270 #define EXCEPT_IPF_FP_TRAP 33
271 #define EXCEPT_IPF_LOWER_PRIVILEGE_TRANSFER_TRAP 34
272 #define EXCEPT_IPF_TAKEN_BRANCH 35
273 #define EXCEPT_IPF_SINGLE_STEP 36
274 //
275 // 37 - 44 reserved
276 //
277 #define EXCEPT_IPF_IA32_EXCEPTION 45
278 #define EXCEPT_IPF_IA32_INTERCEPT 46
279 #define EXCEPT_IPF_IA32_INTERRUPT 47
280 
281 ///
282 /// IPF processor context definition.
283 ///
284 typedef struct {
285  //
286  // The first reserved field is necessary to preserve alignment for the correct
287  // bits in UNAT and to insure F2 is 16 byte aligned.
288  //
321 
322  UINT64 F2[2];
323  UINT64 F3[2];
324  UINT64 F4[2];
325  UINT64 F5[2];
326  UINT64 F6[2];
327  UINT64 F7[2];
328  UINT64 F8[2];
329  UINT64 F9[2];
330  UINT64 F10[2];
331  UINT64 F11[2];
332  UINT64 F12[2];
333  UINT64 F13[2];
334  UINT64 F14[2];
335  UINT64 F15[2];
336  UINT64 F16[2];
337  UINT64 F17[2];
338  UINT64 F18[2];
339  UINT64 F19[2];
340  UINT64 F20[2];
341  UINT64 F21[2];
342  UINT64 F22[2];
343  UINT64 F23[2];
344  UINT64 F24[2];
345  UINT64 F25[2];
346  UINT64 F26[2];
347  UINT64 F27[2];
348  UINT64 F28[2];
349  UINT64 F29[2];
350  UINT64 F30[2];
351  UINT64 F31[2];
352 
354 
363 
364  //
365  // application registers
366  //
371 
373 
381 
383 
385 
387 
391 
392  //
393  // control registers
394  //
408 
409  //
410  // debug registers
411  //
420 
429 
430  //
431  // virtual registers - nat bits for R1-R31
432  //
435 
436 ///
437 /// EBC processor exception types.
438 ///
439 #define EXCEPT_EBC_UNDEFINED 0
440 #define EXCEPT_EBC_DIVIDE_ERROR 1
441 #define EXCEPT_EBC_DEBUG 2
442 #define EXCEPT_EBC_BREAKPOINT 3
443 #define EXCEPT_EBC_OVERFLOW 4
444 #define EXCEPT_EBC_INVALID_OPCODE 5 ///< Opcode out of range.
445 #define EXCEPT_EBC_STACK_FAULT 6
446 #define EXCEPT_EBC_ALIGNMENT_CHECK 7
447 #define EXCEPT_EBC_INSTRUCTION_ENCODING 8 ///< Malformed instruction.
448 #define EXCEPT_EBC_BAD_BREAK 9 ///< BREAK 0 or undefined BREAK.
449 #define EXCEPT_EBC_STEP 10 ///< To support debug stepping.
450 ///
451 /// For coding convenience, define the maximum valid EBC exception.
452 ///
453 #define MAX_EBC_EXCEPTION EXCEPT_EBC_STEP
454 
455 ///
456 /// EBC processor context definition.
457 ///
458 typedef struct {
471 
472 ///
473 /// ARM processor exception types.
474 ///
475 #define EXCEPT_ARM_RESET 0
476 #define EXCEPT_ARM_UNDEFINED_INSTRUCTION 1
477 #define EXCEPT_ARM_SOFTWARE_INTERRUPT 2
478 #define EXCEPT_ARM_PREFETCH_ABORT 3
479 #define EXCEPT_ARM_DATA_ABORT 4
480 #define EXCEPT_ARM_RESERVED 5
481 #define EXCEPT_ARM_IRQ 6
482 #define EXCEPT_ARM_FIQ 7
483 
484 ///
485 /// For coding convenience, define the maximum valid ARM exception.
486 ///
487 #define MAX_ARM_EXCEPTION EXCEPT_ARM_FIQ
488 
489 ///
490 /// ARM processor context definition.
491 ///
492 typedef struct {
515 
516 ///
517 /// AARCH64 processor exception types.
518 ///
519 #define EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS 0
520 #define EXCEPT_AARCH64_IRQ 1
521 #define EXCEPT_AARCH64_FIQ 2
522 #define EXCEPT_AARCH64_SERROR 3
523 
524 ///
525 /// For coding convenience, define the maximum valid ARM exception.
526 ///
527 #define MAX_AARCH64_EXCEPTION EXCEPT_AARCH64_SERROR
528 
529 typedef struct {
530  // General Purpose Registers
560  UINT64 FP; // x29 - Frame pointer
561  UINT64 LR; // x30 - Link Register
562  UINT64 SP; // x31 - Stack pointer
563 
564  // FP/SIMD Registers
565  UINT64 V0[2];
566  UINT64 V1[2];
567  UINT64 V2[2];
568  UINT64 V3[2];
569  UINT64 V4[2];
570  UINT64 V5[2];
571  UINT64 V6[2];
572  UINT64 V7[2];
573  UINT64 V8[2];
574  UINT64 V9[2];
575  UINT64 V10[2];
576  UINT64 V11[2];
577  UINT64 V12[2];
578  UINT64 V13[2];
579  UINT64 V14[2];
580  UINT64 V15[2];
581  UINT64 V16[2];
582  UINT64 V17[2];
583  UINT64 V18[2];
584  UINT64 V19[2];
585  UINT64 V20[2];
586  UINT64 V21[2];
587  UINT64 V22[2];
588  UINT64 V23[2];
589  UINT64 V24[2];
590  UINT64 V25[2];
591  UINT64 V26[2];
592  UINT64 V27[2];
593  UINT64 V28[2];
594  UINT64 V29[2];
595  UINT64 V30[2];
596  UINT64 V31[2];
597 
598  UINT64 ELR; // Exception Link Register
599  UINT64 SPSR; // Saved Processor Status Register
600  UINT64 FPSR; // Floating Point Status Register
601  UINT64 ESR; // Exception syndrome register
602  UINT64 FAR; // Fault Address Register
604 
605 ///
606 /// RISC-V processor exception types.
607 ///
608 #define EXCEPT_RISCV_INST_MISALIGNED 0
609 #define EXCEPT_RISCV_INST_ACCESS_FAULT 1
610 #define EXCEPT_RISCV_ILLEGAL_INST 2
611 #define EXCEPT_RISCV_BREAKPOINT 3
612 #define EXCEPT_RISCV_LOAD_ADDRESS_MISALIGNED 4
613 #define EXCEPT_RISCV_LOAD_ACCESS_FAULT 5
614 #define EXCEPT_RISCV_STORE_AMO_ADDRESS_MISALIGNED 6
615 #define EXCEPT_RISCV_STORE_AMO_ACCESS_FAULT 7
616 #define EXCEPT_RISCV_ENV_CALL_FROM_UMODE 8
617 #define EXCEPT_RISCV_ENV_CALL_FROM_SMODE 9
618 #define EXCEPT_RISCV_ENV_CALL_FROM_VS_MODE 10
619 #define EXCEPT_RISCV_ENV_CALL_FROM_MMODE 11
620 #define EXCEPT_RISCV_INST_ACCESS_PAGE_FAULT 12
621 #define EXCEPT_RISCV_LOAD_ACCESS_PAGE_FAULT 13
622 #define EXCEPT_RISCV_14 14
623 #define EXCEPT_RISCV_STORE_ACCESS_PAGE_FAULT 15
624 #define EXCEPT_RISCV_16 16
625 #define EXCEPT_RISCV_17 17
626 #define EXCEPT_RISCV_18 18
627 #define EXCEPT_RISCV_19 19
628 #define EXCEPT_RISCV_INST_GUEST_PAGE_FAULT 20
629 #define EXCEPT_RISCV_LOAD_GUEST_PAGE_FAULT 21
630 #define EXCEPT_RISCV_VIRTUAL_INSTRUCTION 22
631 #define EXCEPT_RISCV_STORE_GUEST_PAGE_FAULT 23
632 #define EXCEPT_RISCV_MAX_EXCEPTIONS (EXCEPT_RISCV_STORE_GUEST_PAGE_FAULT)
633 
634 ///
635 /// RISC-V processor exception types for interrupts.
636 ///
637 #define EXCEPT_RISCV_IS_IRQ(x) ((x & 0x8000000000000000UL) != 0)
638 #define EXCEPT_RISCV_IRQ_INDEX(x) (x & 0x7FFFFFFFFFFFFFFFUL)
639 #define EXCEPT_RISCV_IRQ_0 0x8000000000000000UL
640 #define EXCEPT_RISCV_IRQ_SOFT_FROM_SMODE 0x8000000000000001UL
641 #define EXCEPT_RISCV_IRQ_SOFT_FROM_VSMODE 0x8000000000000002UL
642 #define EXCEPT_RISCV_IRQ_SOFT_FROM_MMODE 0x8000000000000003UL
643 #define EXCEPT_RISCV_IRQ_4 0x8000000000000004UL
644 #define EXCEPT_RISCV_IRQ_TIMER_FROM_SMODE 0x8000000000000005UL
645 #define EXCEPT_RISCV_MAX_IRQS (EXCEPT_RISCV_IRQ_INDEX(EXCEPT_RISCV_IRQ_TIMER_FROM_SMODE))
646 
647 typedef struct {
684 
685 ///
686 /// LoongArch processor exception types.
687 ///
688 /// The exception types is located in the CSR ESTAT
689 /// register offset 16 bits, width 6 bits.
690 ///
691 /// If you want to register an exception hook, you can
692 /// shfit the number left by 16 bits, and the exception
693 /// handler will know the types.
694 ///
695 /// For example:
696 /// mCpu->CpuRegisterInterruptHandler (
697 /// mCpu,
698 /// (EXCEPT_LOONGARCH_PPI << CSR_ESTAT_EXC_SHIFT),
699 /// PpiExceptionHandler
700 /// );
701 ///
702 #define EXCEPT_LOONGARCH_INT 0
703 #define EXCEPT_LOONGARCH_PIL 1
704 #define EXCEPT_LOONGARCH_PIS 2
705 #define EXCEPT_LOONGARCH_PIF 3
706 #define EXCEPT_LOONGARCH_PME 4
707 #define EXCEPT_LOONGARCH_PNR 5
708 #define EXCEPT_LOONGARCH_PNX 6
709 #define EXCEPT_LOONGARCH_PPI 7
710 #define EXCEPT_LOONGARCH_ADE 8
711 #define EXCEPT_LOONGARCH_ALE 9
712 #define EXCEPT_LOONGARCH_BCE 10
713 #define EXCEPT_LOONGARCH_SYS 11
714 #define EXCEPT_LOONGARCH_BRK 12
715 #define EXCEPT_LOONGARCH_INE 13
716 #define EXCEPT_LOONGARCH_IPE 14
717 #define EXCEPT_LOONGARCH_FPD 15
718 #define EXCEPT_LOONGARCH_SXD 16
719 #define EXCEPT_LOONGARCH_ASXD 17
720 #define EXCEPT_LOONGARCH_FPE 18
721 #define EXCEPT_LOONGARCH_WPE 19
722 #define EXCEPT_LOONGARCH_BTD 20
723 #define EXCEPT_LOONGARCH_BTE 21
724 #define EXCEPT_LOONGARCH_GSPR 22
725 #define EXCEPT_LOONGARCH_HVC 23
726 #define EXCEPT_LOONGARCH_GCXC 24
727 
728 ///
729 /// For coding convenience, define the maximum valid
730 /// LoongArch exception.
731 ///
732 #define MAX_LOONGARCH_EXCEPTION 64
733 
734 ///
735 /// LoongArch processor Interrupt types.
736 ///
737 #define EXCEPT_LOONGARCH_INT_SIP0 0
738 #define EXCEPT_LOONGARCH_INT_SIP1 1
739 #define EXCEPT_LOONGARCH_INT_IP0 2
740 #define EXCEPT_LOONGARCH_INT_IP1 3
741 #define EXCEPT_LOONGARCH_INT_IP2 4
742 #define EXCEPT_LOONGARCH_INT_IP3 5
743 #define EXCEPT_LOONGARCH_INT_IP4 6
744 #define EXCEPT_LOONGARCH_INT_IP5 7
745 #define EXCEPT_LOONGARCH_INT_IP6 8
746 #define EXCEPT_LOONGARCH_INT_IP7 9
747 #define EXCEPT_LOONGARCH_INT_PMC 10
748 #define EXCEPT_LOONGARCH_INT_TIMER 11
749 #define EXCEPT_LOONGARCH_INT_IPI 12
750 
751 ///
752 /// For coding convenience, define the maximum valid
753 /// LoongArch interrupt.
754 ///
755 #define MAX_LOONGARCH_INTERRUPT 16
756 
757 typedef struct {
790 
791  UINT64 CRMD; // CuRrent MoDe information
792  UINT64 PRMD; // PRe-exception MoDe information
793  UINT64 EUEN; // Extended component Unit ENable
794  UINT64 MISC; // MISCellaneous controller
795  UINT64 ECFG; // Exception ConFiGuration
796  UINT64 ESTAT; // Exception STATus
797  UINT64 ERA; // Exception Return Address
798  UINT64 BADV; // BAD Virtual address
799  UINT64 BADI; // BAD Instruction
801 
802 ///
803 /// Universal EFI_SYSTEM_CONTEXT definition.
804 ///
805 typedef union {
815 
816 //
817 // DebugSupport callback function prototypes
818 //
819 
820 /**
821  Registers and enables an exception callback function for the specified exception.
822 
823  @param ExceptionType Exception types in EBC, IA-32, x64, or IPF.
824  @param SystemContext Exception content.
825 
826 **/
827 typedef
828 VOID
830  IN EFI_EXCEPTION_TYPE ExceptionType,
831  IN OUT EFI_SYSTEM_CONTEXT SystemContext
832  );
833 
834 /**
835  Registers and enables the on-target debug agent's periodic entry point.
836 
837  @param SystemContext Exception content.
838 
839 **/
840 typedef
841 VOID
843  IN OUT EFI_SYSTEM_CONTEXT SystemContext
844  );
845 
846 ///
847 /// Machine type definition
848 ///
849 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:849
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:842
EFI_SYSTEM_CONTEXT_RISCV64 * SystemContextRiscV64
Definition: DebugSupport.h:812
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
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:809
INT64 INTN
Signed value of native width.
EFI_SYSTEM_CONTEXT_IA32 * SystemContextIa32
Definition: DebugSupport.h:807
EFI_SYSTEM_CONTEXT_AARCH64 * SystemContextAArch64
Definition: DebugSupport.h:811
EFI_SYSTEM_CONTEXT_X64 * SystemContextX64
Definition: DebugSupport.h:808
unsigned int UINT32
Definition: ProcessorBind.h:98
INTN EFI_EXCEPTION_TYPE
Processor exception to be hooked.
Definition: DebugSupport.h:37
UINT8_t Length
Length of this structure.
Definition: pxe_api.h:70
unsigned char UINT8
EFI_SYSTEM_CONTEXT_ARM * SystemContextArm
Definition: DebugSupport.h:810
FILE_LICENCE(BSD2_PATENT)
EFI_REGISTER_EXCEPTION_CALLBACK RegisterExceptionCallback
Definition: DebugSupport.h:962
EFI_FX_SAVE_STATE_X64 FxSaveState
Definition: DebugSupport.h:193
0x8664
Definition: DebugSupport.h:851
EFI_FX_SAVE_STATE_IA32 FxSaveState
Definition: DebugSupport.h:99
#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:805
#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:492
unsigned short UINT16
#define EFIAPI
IPF processor context definition.
Definition: DebugSupport.h:284
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.
0x01c2
Definition: DebugSupport.h:854
#define VOID
Undeclared type.
Definition: Base.h:271
unsigned long long UINT64
Definition: ProcessorBind.h:96
0x0EBC
Definition: DebugSupport.h:853
x64 processor context definition.
Definition: DebugSupport.h:191
0x0200
Definition: DebugSupport.h:852
#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:806
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
IA-32 processor context definition.
Definition: DebugSupport.h:97
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:458
EFI_SYSTEM_CONTEXT_LOONGARCH64 * SystemContextLoongArch64
Definition: DebugSupport.h:813
#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:829
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
#define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED
Definition: PeImage.h:39
This protocol provides the services to allow the debug agent to register callback functions that are ...
Definition: DebugSupport.h:955
0x014C
Definition: DebugSupport.h:850