Merge from vendor branch BINUTILS:
[dragonfly.git] / sys / boot / efi / include / efidebug.h
1 /*
2  * $FreeBSD: src/sys/boot/efi/include/efidebug.h,v 1.2 2002/05/19 03:17:20 marcel Exp $
3  * $DragonFly: src/sys/boot/efi/include/efidebug.h,v 1.1 2003/11/10 06:08:32 dillon Exp $
4  */
5 #ifndef _EFI_DEBUG_H
6 #define _EFI_DEBUG_H
7
8 /*++
9
10 Copyright (c) 1998  Intel Corporation
11
12 Module Name:
13
14     efidebug.h
15
16 Abstract:
17
18     EFI library debug functions
19
20
21
22 Revision History
23
24 --*/
25
26 extern UINTN     EFIDebug;
27
28 #if EFI_DEBUG
29
30     #define DBGASSERT(a)        DbgAssert(__FILE__, __LINE__, #a)
31     #define DEBUG(a)            DbgPrint a
32     
33 #else
34
35     #define DBGASSERT(a)
36     #define DEBUG(a)
37     
38 #endif
39
40 #if EFI_DEBUG_CLEAR_MEMORY
41
42     #define DBGSETMEM(a,l)      SetMem(a,l,(CHAR8)BAD_POINTER)
43
44 #else
45
46     #define DBGSETMEM(a,l)
47
48 #endif
49
50 #define D_INIT        0x00000001          /* Initialization style messages */
51 #define D_WARN        0x00000002          /* Warnings */
52 #define D_LOAD        0x00000004          /* Load events */
53 #define D_FS          0x00000008          /* EFI File system */
54 #define D_POOL        0x00000010          /* Alloc & Free's */
55 #define D_PAGE        0x00000020          /* Alloc & Free's */
56 #define D_INFO        0x00000040          /* Verbose */
57 #define D_VAR         0x00000100          /* Variable */
58 #define D_PARSE       0x00000200          /* Command parsing */
59 #define D_BM          0x00000400          /* Boot manager */
60 #define D_BLKIO       0x00001000          /* BlkIo Driver */
61 #define D_BLKIO_ULTRA 0x00002000          /* BlkIo Driver */
62 #define D_NET         0x00004000          /* SNI Driver */
63 #define D_NET_ULTRA   0x00008000          /* SNI Driver */
64 #define D_TXTIN       0x00010000          /* Simple Input Driver */
65 #define D_TXTOUT      0x00020000          /* Simple Text Output Driver */
66 #define D_ERROR_ATA   0x00040000          /* ATA error messages */
67 #define D_ERROR       0x80000000          /* Error */
68
69 #define D_RESERVED    0x7fffC880          /* Bits not reserved above */
70
71 /*
72  * Current Debug level of the system, value of EFIDebug
73  */
74 #define EFI_DBUG_MASK   (D_ERROR)
75
76 #if EFI_DEBUG
77
78     #define ASSERT(a)               if(!(a))       DBGASSERT(a)
79     #define ASSERT_LOCKED(l)        if(!(l)->Lock) DBGASSERT(l not locked)
80     #define ASSERT_STRUCT(p,t)      DBGASSERT(t not structure), p
81
82 #else
83
84     #define ASSERT(a)               
85     #define ASSERT_LOCKED(l)        
86     #define ASSERT_STRUCT(p,t)      
87
88 #endif
89
90 /*
91  * Prototypes
92  */
93
94 INTN
95 DbgAssert (
96     CHAR8   *file,
97     INTN    lineno,
98     CHAR8   *string
99     );
100
101 INTN
102 DbgPrint (
103     INTN    mask,
104     CHAR8   *format,
105     ...
106     );
107
108 #endif