efidebug.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. #ifndef _EFI_DEBUG_H
  2. #define _EFI_DEBUG_H
  3. /*++
  4. Copyright (c) 1998 Intel Corporation
  5. Module Name:
  6. efidebug.h
  7. Abstract:
  8. EFI library debug functions
  9. Revision History
  10. --*/
  11. extern UINTN EFIDebug;
  12. #if EFI_DEBUG
  13. #define DBGASSERT(a) DbgAssert(__FILE__, __LINE__, #a)
  14. #define DEBUG(a) DbgPrint a
  15. #else
  16. #define DBGASSERT(a)
  17. #define DEBUG(a)
  18. #endif
  19. #if EFI_DEBUG_CLEAR_MEMORY
  20. #define DBGSETMEM(a,l) SetMem(a,l,(CHAR8)BAD_POINTER)
  21. #else
  22. #define DBGSETMEM(a,l)
  23. #endif
  24. #define D_INIT 0x00000001 // Initialization style messages
  25. #define D_WARN 0x00000002 // Warnings
  26. #define D_LOAD 0x00000004 // Load events
  27. #define D_FS 0x00000008 // EFI File system
  28. #define D_POOL 0x00000010 // Alloc & Free's
  29. #define D_PAGE 0x00000020 // Alloc & Free's
  30. #define D_INFO 0x00000040 // Verbose
  31. #define D_VAR 0x00000100 // Variable
  32. #define D_PARSE 0x00000200 // Command parsing
  33. #define D_BM 0x00000400 // Boot manager
  34. #define D_BLKIO 0x00001000 // BlkIo Driver
  35. #define D_BLKIO_ULTRA 0x00002000 // BlkIo Driver
  36. #define D_NET 0x00004000 // SNI Driver
  37. #define D_NET_ULTRA 0x00008000 // SNI Driver
  38. #define D_TXTIN 0x00010000 // Simple Input Driver
  39. #define D_TXTOUT 0x00020000 // Simple Text Output Driver
  40. #define D_ERROR_ATA 0x00040000 // ATA error messages
  41. #define D_ERROR 0x80000000 // Error
  42. #define D_RESERVED 0x7fffC880 // Bits not reserved above
  43. //
  44. // Current Debug level of the system, value of EFIDebug
  45. //
  46. //#define EFI_DBUG_MASK (D_ERROR | D_WARN | D_LOAD | D_BLKIO | D_INIT)
  47. #define EFI_DBUG_MASK (D_ERROR)
  48. //
  49. //
  50. //
  51. #if EFI_DEBUG
  52. #define ASSERT(a) if(!(a)) DBGASSERT(a)
  53. #define ASSERT_LOCKED(l) if(!(l)->Lock) DBGASSERT(l not locked)
  54. #define ASSERT_STRUCT(p,t) DBGASSERT(t not structure), p
  55. #else
  56. #define ASSERT(a)
  57. #define ASSERT_LOCKED(l)
  58. #define ASSERT_STRUCT(p,t)
  59. #endif
  60. //
  61. // Prototypes
  62. //
  63. INTN
  64. DbgAssert (
  65. CONST CHAR8 *file,
  66. INTN lineno,
  67. CONST CHAR8 *string
  68. );
  69. INTN
  70. DbgPrint (
  71. INTN mask,
  72. CONST CHAR8 *format,
  73. ...
  74. );
  75. //
  76. // Instruction Set Architectures definitions for debuggers
  77. //
  78. typedef INTN EFI_EXCEPTION_TYPE;
  79. // IA32
  80. #define EXCEPT_IA32_DIVIDE_ERROR 0
  81. #define EXCEPT_IA32_DEBUG 1
  82. #define EXCEPT_IA32_NMI 2
  83. #define EXCEPT_IA32_BREAKPOINT 3
  84. #define EXCEPT_IA32_OVERFLOW 4
  85. #define EXCEPT_IA32_BOUND 5
  86. #define EXCEPT_IA32_INVALID_OPCODE 6
  87. #define EXCEPT_IA32_DOUBLE_FAULT 8
  88. #define EXCEPT_IA32_INVALID_TSS 10
  89. #define EXCEPT_IA32_SEG_NOT_PRESENT 11
  90. #define EXCEPT_IA32_STACK_FAULT 12
  91. #define EXCEPT_IA32_GP_FAULT 13
  92. #define EXCEPT_IA32_PAGE_FAULT 14
  93. #define EXCEPT_IA32_FP_ERROR 16
  94. #define EXCEPT_IA32_ALIGNMENT_CHECK 17
  95. #define EXCEPT_IA32_MACHINE_CHECK 18
  96. #define EXCEPT_IA32_SIMD 19
  97. typedef struct {
  98. UINT16 Fcw;
  99. UINT16 Fsw;
  100. UINT16 Ftw;
  101. UINT16 Opcode;
  102. UINT32 Eip;
  103. UINT16 Cs;
  104. UINT16 Reserved1;
  105. UINT32 DataOffset;
  106. UINT16 Ds;
  107. UINT8 Reserved2[10];
  108. UINT8 St0Mm0[10], Reserved3[6];
  109. UINT8 St1Mm1[10], Reserved4[6];
  110. UINT8 St2Mm2[10], Reserved5[6];
  111. UINT8 St3Mm3[10], Reserved6[6];
  112. UINT8 St4Mm4[10], Reserved7[6];
  113. UINT8 St5Mm5[10], Reserved8[6];
  114. UINT8 St6Mm6[10], Reserved9[6];
  115. UINT8 St7Mm7[10], Reserved10[6];
  116. UINT8 Xmm0[16];
  117. UINT8 Xmm1[16];
  118. UINT8 Xmm2[16];
  119. UINT8 Xmm3[16];
  120. UINT8 Xmm4[16];
  121. UINT8 Xmm5[16];
  122. UINT8 Xmm6[16];
  123. UINT8 Xmm7[16];
  124. UINT8 Reserved11[14 * 16];
  125. } EFI_FX_SAVE_STATE_IA32;
  126. typedef struct {
  127. UINT32 ExceptionData;
  128. EFI_FX_SAVE_STATE_IA32 FxSaveState;
  129. UINT32 Dr0;
  130. UINT32 Dr1;
  131. UINT32 Dr2;
  132. UINT32 Dr3;
  133. UINT32 Dr6;
  134. UINT32 Dr7;
  135. UINT32 Cr0;
  136. UINT32 Cr1;
  137. UINT32 Cr2;
  138. UINT32 Cr3;
  139. UINT32 Cr4;
  140. UINT32 Eflags;
  141. UINT32 Ldtr;
  142. UINT32 Tr;
  143. UINT32 Gdtr[2];
  144. UINT32 Idtr[2];
  145. UINT32 Eip;
  146. UINT32 Gs;
  147. UINT32 Fs;
  148. UINT32 Es;
  149. UINT32 Ds;
  150. UINT32 Cs;
  151. UINT32 Ss;
  152. UINT32 Edi;
  153. UINT32 Esi;
  154. UINT32 Ebp;
  155. UINT32 Esp;
  156. UINT32 Ebx;
  157. UINT32 Edx;
  158. UINT32 Ecx;
  159. UINT32 Eax;
  160. } EFI_SYSTEM_CONTEXT_IA32;
  161. // X64
  162. #define EXCEPT_X64_DIVIDE_ERROR 0
  163. #define EXCEPT_X64_DEBUG 1
  164. #define EXCEPT_X64_NMI 2
  165. #define EXCEPT_X64_BREAKPOINT 3
  166. #define EXCEPT_X64_OVERFLOW 4
  167. #define EXCEPT_X64_BOUND 5
  168. #define EXCEPT_X64_INVALID_OPCODE 6
  169. #define EXCEPT_X64_DOUBLE_FAULT 8
  170. #define EXCEPT_X64_INVALID_TSS 10
  171. #define EXCEPT_X64_SEG_NOT_PRESENT 11
  172. #define EXCEPT_X64_STACK_FAULT 12
  173. #define EXCEPT_X64_GP_FAULT 13
  174. #define EXCEPT_X64_PAGE_FAULT 14
  175. #define EXCEPT_X64_FP_ERROR 16
  176. #define EXCEPT_X64_ALIGNMENT_CHECK 17
  177. #define EXCEPT_X64_MACHINE_CHECK 18
  178. #define EXCEPT_X64_SIMD 19
  179. typedef struct {
  180. UINT16 Fcw;
  181. UINT16 Fsw;
  182. UINT16 Ftw;
  183. UINT16 Opcode;
  184. UINT64 Rip;
  185. UINT64 DataOffset;
  186. UINT8 Reserved1[8];
  187. UINT8 St0Mm0[10], Reserved2[6];
  188. UINT8 St1Mm1[10], Reserved3[6];
  189. UINT8 St2Mm2[10], Reserved4[6];
  190. UINT8 St3Mm3[10], Reserved5[6];
  191. UINT8 St4Mm4[10], Reserved6[6];
  192. UINT8 St5Mm5[10], Reserved7[6];
  193. UINT8 St6Mm6[10], Reserved8[6];
  194. UINT8 St7Mm7[10], Reserved9[6];
  195. UINT8 Xmm0[16];
  196. UINT8 Xmm1[16];
  197. UINT8 Xmm2[16];
  198. UINT8 Xmm3[16];
  199. UINT8 Xmm4[16];
  200. UINT8 Xmm5[16];
  201. UINT8 Xmm6[16];
  202. UINT8 Xmm7[16];
  203. UINT8 Reserved11[14 * 16];
  204. } EFI_FX_SAVE_STATE_X64;
  205. typedef struct {
  206. UINT64 ExceptionData;
  207. EFI_FX_SAVE_STATE_X64 FxSaveState;
  208. UINT64 Dr0;
  209. UINT64 Dr1;
  210. UINT64 Dr2;
  211. UINT64 Dr3;
  212. UINT64 Dr6;
  213. UINT64 Dr7;
  214. UINT64 Cr0;
  215. UINT64 Cr1;
  216. UINT64 Cr2;
  217. UINT64 Cr3;
  218. UINT64 Cr4;
  219. UINT64 Cr8;
  220. UINT64 Rflags;
  221. UINT64 Ldtr;
  222. UINT64 Tr;
  223. UINT64 Gdtr[2];
  224. UINT64 Idtr[2];
  225. UINT64 Rip;
  226. UINT64 Gs;
  227. UINT64 Fs;
  228. UINT64 Es;
  229. UINT64 Ds;
  230. UINT64 Cs;
  231. UINT64 Ss;
  232. UINT64 Rdi;
  233. UINT64 Rsi;
  234. UINT64 Rbp;
  235. UINT64 Rsp;
  236. UINT64 Rbx;
  237. UINT64 Rdx;
  238. UINT64 Rcx;
  239. UINT64 Rax;
  240. UINT64 R8;
  241. UINT64 R9;
  242. UINT64 R10;
  243. UINT64 R11;
  244. UINT64 R12;
  245. UINT64 R13;
  246. UINT64 R14;
  247. UINT64 R15;
  248. } EFI_SYSTEM_CONTEXT_X64;
  249. /// IA64
  250. #define EXCEPT_IPF_VHTP_TRANSLATION 0
  251. #define EXCEPT_IPF_INSTRUCTION_TLB 1
  252. #define EXCEPT_IPF_DATA_TLB 2
  253. #define EXCEPT_IPF_ALT_INSTRUCTION_TLB 3
  254. #define EXCEPT_IPF_ALT_DATA_TLB 4
  255. #define EXCEPT_IPF_DATA_NESTED_TLB 5
  256. #define EXCEPT_IPF_INSTRUCTION_KEY_MISSED 6
  257. #define EXCEPT_IPF_DATA_KEY_MISSED 7
  258. #define EXCEPT_IPF_DIRTY_BIT 8
  259. #define EXCEPT_IPF_INSTRUCTION_ACCESS_BIT 9
  260. #define EXCEPT_IPF_DATA_ACCESS_BIT 10
  261. #define EXCEPT_IPF_BREAKPOINT 11
  262. #define EXCEPT_IPF_EXTERNAL_INTERRUPT 12
  263. #define EXCEPT_IPF_PAGE_NOT_PRESENT 20
  264. #define EXCEPT_IPF_KEY_PERMISSION 21
  265. #define EXCEPT_IPF_INSTRUCTION_ACCESS_RIGHTS 22
  266. #define EXCEPT_IPF_DATA_ACCESS_RIGHTS 23
  267. #define EXCEPT_IPF_GENERAL_EXCEPTION 24
  268. #define EXCEPT_IPF_DISABLED_FP_REGISTER 25
  269. #define EXCEPT_IPF_NAT_CONSUMPTION 26
  270. #define EXCEPT_IPF_SPECULATION 27
  271. #define EXCEPT_IPF_DEBUG 29
  272. #define EXCEPT_IPF_UNALIGNED_REFERENCE 30
  273. #define EXCEPT_IPF_UNSUPPORTED_DATA_REFERENCE 31
  274. #define EXCEPT_IPF_FP_FAULT 32
  275. #define EXCEPT_IPF_FP_TRAP 33
  276. #define EXCEPT_IPF_LOWER_PRIVILEGE_TRANSFER_TRAP 34
  277. #define EXCEPT_IPF_TAKEN_BRANCH 35
  278. #define EXCEPT_IPF_SINGLE_STEP 36
  279. #define EXCEPT_IPF_IA32_EXCEPTION 45
  280. #define EXCEPT_IPF_IA32_INTERCEPT 46
  281. #define EXCEPT_IPF_IA32_INTERRUPT 47
  282. typedef struct {
  283. UINT64 Reserved;
  284. UINT64 R1;
  285. UINT64 R2;
  286. UINT64 R3;
  287. UINT64 R4;
  288. UINT64 R5;
  289. UINT64 R6;
  290. UINT64 R7;
  291. UINT64 R8;
  292. UINT64 R9;
  293. UINT64 R10;
  294. UINT64 R11;
  295. UINT64 R12;
  296. UINT64 R13;
  297. UINT64 R14;
  298. UINT64 R15;
  299. UINT64 R16;
  300. UINT64 R17;
  301. UINT64 R18;
  302. UINT64 R19;
  303. UINT64 R20;
  304. UINT64 R21;
  305. UINT64 R22;
  306. UINT64 R23;
  307. UINT64 R24;
  308. UINT64 R25;
  309. UINT64 R26;
  310. UINT64 R27;
  311. UINT64 R28;
  312. UINT64 R29;
  313. UINT64 R30;
  314. UINT64 R31;
  315. UINT64 F2[2];
  316. UINT64 F3[2];
  317. UINT64 F4[2];
  318. UINT64 F5[2];
  319. UINT64 F6[2];
  320. UINT64 F7[2];
  321. UINT64 F8[2];
  322. UINT64 F9[2];
  323. UINT64 F10[2];
  324. UINT64 F11[2];
  325. UINT64 F12[2];
  326. UINT64 F13[2];
  327. UINT64 F14[2];
  328. UINT64 F15[2];
  329. UINT64 F16[2];
  330. UINT64 F17[2];
  331. UINT64 F18[2];
  332. UINT64 F19[2];
  333. UINT64 F20[2];
  334. UINT64 F21[2];
  335. UINT64 F22[2];
  336. UINT64 F23[2];
  337. UINT64 F24[2];
  338. UINT64 F25[2];
  339. UINT64 F26[2];
  340. UINT64 F27[2];
  341. UINT64 F28[2];
  342. UINT64 F29[2];
  343. UINT64 F30[2];
  344. UINT64 F31[2];
  345. UINT64 Pr;
  346. UINT64 B0;
  347. UINT64 B1;
  348. UINT64 B2;
  349. UINT64 B3;
  350. UINT64 B4;
  351. UINT64 B5;
  352. UINT64 B6;
  353. UINT64 B7;
  354. UINT64 ArRsc;
  355. UINT64 ArBsp;
  356. UINT64 ArBspstore;
  357. UINT64 ArRnat;
  358. UINT64 ArFcr;
  359. UINT64 ArEflag;
  360. UINT64 ArCsd;
  361. UINT64 ArSsd;
  362. UINT64 ArCflg;
  363. UINT64 ArFsr;
  364. UINT64 ArFir;
  365. UINT64 ArFdr;
  366. UINT64 ArCcv;
  367. UINT64 ArUnat;
  368. UINT64 ArFpsr;
  369. UINT64 ArPfs;
  370. UINT64 ArLc;
  371. UINT64 ArEc;
  372. UINT64 CrDcr;
  373. UINT64 CrItm;
  374. UINT64 CrIva;
  375. UINT64 CrPta;
  376. UINT64 CrIpsr;
  377. UINT64 CrIsr;
  378. UINT64 CrIip;
  379. UINT64 CrIfa;
  380. UINT64 CrItir;
  381. UINT64 CrIipa;
  382. UINT64 CrIfs;
  383. UINT64 CrIim;
  384. UINT64 CrIha;
  385. UINT64 Dbr0;
  386. UINT64 Dbr1;
  387. UINT64 Dbr2;
  388. UINT64 Dbr3;
  389. UINT64 Dbr4;
  390. UINT64 Dbr5;
  391. UINT64 Dbr6;
  392. UINT64 Dbr7;
  393. UINT64 Ibr0;
  394. UINT64 Ibr1;
  395. UINT64 Ibr2;
  396. UINT64 Ibr3;
  397. UINT64 Ibr4;
  398. UINT64 Ibr5;
  399. UINT64 Ibr6;
  400. UINT64 Ibr7;
  401. UINT64 IntNat;
  402. } EFI_SYSTEM_CONTEXT_IPF;
  403. // EBC
  404. #define EXCEPT_EBC_UNDEFINED 0
  405. #define EXCEPT_EBC_DIVIDE_ERROR 1
  406. #define EXCEPT_EBC_DEBUG 2
  407. #define EXCEPT_EBC_BREAKPOINT 3
  408. #define EXCEPT_EBC_OVERFLOW 4
  409. #define EXCEPT_EBC_INVALID_OPCODE 5
  410. #define EXCEPT_EBC_STACK_FAULT 6
  411. #define EXCEPT_EBC_ALIGNMENT_CHECK 7
  412. #define EXCEPT_EBC_INSTRUCTION_ENCODING 8
  413. #define EXCEPT_EBC_BAD_BREAK 9
  414. #define EXCEPT_EBC_STEP 10
  415. #define MAX_EBC_EXCEPTION EXCEPT_EBC_STEP
  416. typedef struct {
  417. UINT64 R0;
  418. UINT64 R1;
  419. UINT64 R2;
  420. UINT64 R3;
  421. UINT64 R4;
  422. UINT64 R5;
  423. UINT64 R6;
  424. UINT64 R7;
  425. UINT64 Flags;
  426. UINT64 ControlFlags;
  427. UINT64 Ip;
  428. } EFI_SYSTEM_CONTEXT_EBC;
  429. // ARM
  430. #define EXCEPT_ARM_RESET 0
  431. #define EXCEPT_ARM_UNDEFINED_INSTRUCTION 1
  432. #define EXCEPT_ARM_SOFTWARE_INTERRUPT 2
  433. #define EXCEPT_ARM_PREFETCH_ABORT 3
  434. #define EXCEPT_ARM_DATA_ABORT 4
  435. #define EXCEPT_ARM_RESERVED 5
  436. #define EXCEPT_ARM_IRQ 6
  437. #define EXCEPT_ARM_FIQ 7
  438. #define MAX_ARM_EXCEPTION EXCEPT_ARM_FIQ
  439. typedef struct {
  440. UINT32 R0;
  441. UINT32 R1;
  442. UINT32 R2;
  443. UINT32 R3;
  444. UINT32 R4;
  445. UINT32 R5;
  446. UINT32 R6;
  447. UINT32 R7;
  448. UINT32 R8;
  449. UINT32 R9;
  450. UINT32 R10;
  451. UINT32 R11;
  452. UINT32 R12;
  453. UINT32 SP;
  454. UINT32 LR;
  455. UINT32 PC;
  456. UINT32 CPSR;
  457. UINT32 DFSR;
  458. UINT32 DFAR;
  459. UINT32 IFSR;
  460. UINT32 IFAR;
  461. } EFI_SYSTEM_CONTEXT_ARM;
  462. typedef union {
  463. EFI_SYSTEM_CONTEXT_EBC *SystemContextEbc;
  464. EFI_SYSTEM_CONTEXT_IA32 *SystemContextIa32;
  465. EFI_SYSTEM_CONTEXT_X64 *SystemContextX64;
  466. EFI_SYSTEM_CONTEXT_IPF *SystemContextIpf;
  467. EFI_SYSTEM_CONTEXT_ARM *SystemContextArm;
  468. } EFI_SYSTEM_CONTEXT;
  469. typedef
  470. VOID
  471. (EFIAPI *EFI_EXCEPTION_CALLBACK)(
  472. IN EFI_EXCEPTION_TYPE ExceptionType,
  473. IN OUT EFI_SYSTEM_CONTEXT SystemContext);
  474. typedef
  475. VOID
  476. (EFIAPI *EFI_PERIODIC_CALLBACK)(
  477. IN OUT EFI_SYSTEM_CONTEXT SystemContext);
  478. typedef enum {
  479. IsaIa32 = EFI_IMAGE_MACHINE_IA32,
  480. IsaX64 = EFI_IMAGE_MACHINE_X64,
  481. IsaIpf = EFI_IMAGE_MACHINE_IA64,
  482. IsaEbc = EFI_IMAGE_MACHINE_EBC,
  483. IsaArm = EFI_IMAGE_MACHINE_ARMTHUMB_MIXED,
  484. // IsaArm64 = EFI_IMAGE_MACHINE_AARCH64
  485. } EFI_INSTRUCTION_SET_ARCHITECTURE;
  486. //
  487. // DEBUG_IMAGE_INFO
  488. //
  489. #define EFI_DEBUG_IMAGE_INFO_TABLE_GUID \
  490. { 0x49152e77, 0x1ada, 0x4764, {0xb7, 0xa2, 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b} }
  491. #define EFI_DEBUG_IMAGE_INFO_UPDATE_IN_PROGRESS 0x01
  492. #define EFI_DEBUG_IMAGE_INFO_TABLE_MODIFIED 0x02
  493. #define EFI_DEBUG_IMAGE_INFO_INITIAL_SIZE (EFI_PAGE_SIZE / sizeof (UINTN))
  494. #define EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL 0x01
  495. typedef struct {
  496. UINT64 Signature;
  497. EFI_PHYSICAL_ADDRESS EfiSystemTableBase;
  498. UINT32 Crc32;
  499. } EFI_SYSTEM_TABLE_POINTER;
  500. typedef struct {
  501. UINT32 ImageInfoType;
  502. EFI_LOADED_IMAGE_PROTOCOL *LoadedImageProtocolInstance;
  503. EFI_HANDLE *ImageHandle;
  504. } EFI_DEBUG_IMAGE_INFO_NORMAL;
  505. typedef union {
  506. UINT32 *ImageInfoType;
  507. EFI_DEBUG_IMAGE_INFO_NORMAL *NormalImage;
  508. } EFI_DEBUG_IMAGE_INFO;
  509. typedef struct {
  510. volatile UINT32 UpdateStatus;
  511. UINT32 TableSize;
  512. EFI_DEBUG_IMAGE_INFO *EfiDebugImageInfoTable;
  513. } EFI_DEBUG_IMAGE_INFO_TABLE_HEADER;
  514. //
  515. // EFI_DEBUGGER_PROTOCOL
  516. //
  517. #define EFI_DEBUG_SUPPORT_PROTOCOL_GUID \
  518. { 0x2755590c, 0x6f3c, 0x42fa, {0x9e, 0xa4, 0xa3, 0xba, 0x54, 0x3c, 0xda, 0x25} }
  519. INTERFACE_DECL(_EFI_DEBUG_SUPPORT_PROTOCOL);
  520. typedef
  521. EFI_STATUS
  522. (EFIAPI *EFI_GET_MAXIMUM_PROCESSOR_INDEX)(
  523. IN struct _EFI_DEBUG_SUPPORT_PROTOCOL *This,
  524. OUT UINTN *MaxProcessorIndex);
  525. typedef
  526. EFI_STATUS
  527. (EFIAPI *EFI_REGISTER_PERIODIC_CALLBACK)(
  528. IN struct _EFI_DEBUG_SUPPORT_PROTOCOL *This,
  529. IN UINTN ProcessorIndex,
  530. IN EFI_PERIODIC_CALLBACK PeriodicCallback);
  531. typedef
  532. EFI_STATUS
  533. (EFIAPI *EFI_REGISTER_EXCEPTION_CALLBACK)(
  534. IN struct _EFI_DEBUG_SUPPORT_PROTOCOL *This,
  535. IN UINTN ProcessorIndex,
  536. IN EFI_EXCEPTION_CALLBACK ExceptionCallback,
  537. IN EFI_EXCEPTION_TYPE ExceptionType);
  538. typedef
  539. EFI_STATUS
  540. (EFIAPI *EFI_INVALIDATE_INSTRUCTION_CACHE)(
  541. IN struct _EFI_DEBUG_SUPPORT_PROTOCOL *This,
  542. IN UINTN ProcessorIndex,
  543. IN VOID *Start,
  544. IN UINT64 Length);
  545. typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL {
  546. EFI_INSTRUCTION_SET_ARCHITECTURE Isa;
  547. EFI_GET_MAXIMUM_PROCESSOR_INDEX GetMaximumProcessorIndex;
  548. EFI_REGISTER_PERIODIC_CALLBACK RegisterPeriodicCallback;
  549. EFI_REGISTER_EXCEPTION_CALLBACK RegisterExceptionCallback;
  550. EFI_INVALIDATE_INSTRUCTION_CACHE InvalidateInstructionCache;
  551. } EFI_DEBUG_SUPPORT_PROTOCOL;
  552. #endif