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