efidebug.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. CHAR8 *file,
  66. INTN lineno,
  67. CHAR8 *string
  68. );
  69. INTN
  70. DbgPrint (
  71. INTN mask,
  72. CHAR8 *format,
  73. ...
  74. );
  75. #endif