libefi: import efichar.c for ucs2 support
[unleashed.git] / usr / src / boot / sys / boot / efi / include / efidebug.h
blob5576d5f4e48cc6e73efc9bbae709291ca1697569
1 /* $FreeBSD$ */
2 #ifndef _EFI_DEBUG_H
3 #define _EFI_DEBUG_H
5 /*++
7 Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
8 This software and associated documentation (if any) is furnished
9 under a license and may only be used or copied in accordance
10 with the terms of the license. Except as permitted by such
11 license, no part of this software or documentation may be
12 reproduced, stored in a retrieval system, or transmitted in any
13 form or by any means without the express written consent of
14 Intel Corporation.
16 Module Name:
18 efidebug.h
20 Abstract:
22 EFI library debug functions
26 Revision History
28 --*/
30 extern UINTN EFIDebug;
32 #if EFI_DEBUG
34 #define DBGASSERT(a) DbgAssert(__FILE__, __LINE__, #a)
35 #define DEBUG(a) DbgPrint a
37 #else
39 #define DBGASSERT(a)
40 #define DEBUG(a)
42 #endif
44 #if EFI_DEBUG_CLEAR_MEMORY
46 #define DBGSETMEM(a,l) SetMem(a,l,(CHAR8)BAD_POINTER)
48 #else
50 #define DBGSETMEM(a,l)
52 #endif
54 #define D_INIT 0x00000001 // Initialization style messages
55 #define D_WARN 0x00000002 // Warnings
56 #define D_LOAD 0x00000004 // Load events
57 #define D_FS 0x00000008 // EFI File system
58 #define D_POOL 0x00000010 // Alloc & Free's
59 #define D_PAGE 0x00000020 // Alloc & Free's
60 #define D_INFO 0x00000040 // Verbose
61 #define D_VARIABLE 0x00000100 // Variable
62 #define D_VAR 0x00000100 // Variable
63 #define D_BM 0x00000400 // Boot Manager
64 #define D_BLKIO 0x00001000 // BlkIo Driver
65 #define D_BLKIO_ULTRA 0x00002000 // BlkIo Driver
66 #define D_NET 0x00004000 // SNI Driver
67 #define D_NET_ULTRA 0x00008000 // SNI Driver
68 #define D_UNDI 0x00010000 // UNDI Driver
69 #define D_LOADFILE 0x00020000 // UNDI Driver
70 #define D_EVENT 0x00080000 // Event messages
72 #define D_ERROR 0x80000000 // Error
74 #define D_RESERVED 0x7ff40A80 // Bits not reserved above
77 // Current Debug level of the system, value of EFIDebug
79 //#define EFI_DBUG_MASK (D_ERROR | D_WARN | D_LOAD | D_BLKIO | D_INIT)
80 #define EFI_DBUG_MASK (D_ERROR)
86 #if EFI_DEBUG
88 #define ASSERT(a) if(!(a)) DBGASSERT(a)
89 #define ASSERT_LOCKED(l) if(!(l)->Lock) DBGASSERT(l not locked)
90 #define ASSERT_STRUCT(p,t) DBGASSERT(t not structure), p
92 #else
94 #define ASSERT(a)
95 #define ASSERT_LOCKED(l)
96 #define ASSERT_STRUCT(p,t)
98 #endif
101 // Prototypes
104 INTN
105 DbgAssert (
106 CHAR8 *file,
107 INTN lineno,
108 CHAR8 *string
111 INTN
112 DbgPrint (
113 INTN mask,
114 CHAR8 *format,
118 #endif