Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
2.4 KiB

  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 0x80000000 /* Error */
  41. #define D_RESERVED 0x7fffC880 /* Bits not reserved above */
  42. /*
  43. * Current Debug level of the system, value of EFIDebug
  44. *
  45. * #define EFI_DBUG_MASK (D_ERROR | D_WARN | D_LOAD | D_BLKIO | D_INIT) */
  46. #define EFI_DBUG_MASK (D_ERROR)
  47. /*
  48. *
  49. */
  50. #if EFI_DEBUG
  51. #define ASSERT(a) if(!(a)) DBGASSERT(a)
  52. #define ASSERT_LOCKED(l) if(!(l)->Lock) DBGASSERT(l not locked)
  53. #define ASSERT_STRUCT(p,t) DBGASSERT(t not structure), p
  54. #else
  55. #define ASSERT(a)
  56. #define ASSERT_LOCKED(l)
  57. #define ASSERT_STRUCT(p,t)
  58. #endif
  59. /*
  60. * Prototypes
  61. */
  62. INTN
  63. DbgAssert (
  64. CHAR8 *file,
  65. INTN lineno,
  66. CHAR8 *string
  67. );
  68. INTN
  69. DbgPrint (
  70. INTN mask,
  71. CHAR8 *format,
  72. ...
  73. );
  74. #endif