Changeset 7115 for trunk/src/win32k/kKrnlLib/include/kLog.h
- Timestamp:
- Oct 19, 2001, 2:04:45 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/kKrnlLib/include/kLog.h
r7070 r7115 1 /* $Id: kLog.h,v 1. 2 2001-10-16 02:20:39bird Exp $1 /* $Id: kLog.h,v 1.3 2001-10-19 00:04:45 bird Exp $ 2 2 * 3 3 * kLog - Generic Logging and Trace Routines. … … 10 10 #define _kLog_h_ 11 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 12 15 13 16 /******************************************************************************* … … 17 20 * Standard log types. 18 21 */ 19 #define KLOG_INITMOD 1 /* Function entry */ 20 #define KLOG_TERMMOD 2 /* Function entry */ 21 #define KLOG_ENTRY 3 /* Function entry */ 22 #define KLOG_EXIT 4 /* Function exit */ 23 #define KLOG_ASSERT 5 /* Assertion failed / Kernel Panic. */ 24 25 #define KLOG_USER 0x1000 /* First user log type. */ 22 #define KLOG_TYPE_INITMOD 1 /* Log Module Init. */ 23 #define KLOG_TYPE_TERMMOD 2 /* Log Module Termination. */ 24 #define KLOG_TYPE_START 3 /* Start sequence and function entry. */ 25 #define KLOG_TYPE_ENTRY 4 /* Function entry. */ 26 #define KLOG_TYPE_EXIT 5 /* Function exit. */ 27 #define KLOG_TYPE_STOP 6 /* Stop sequence and function exit. */ 28 #define KLOG_TYPE_PRINTF 7 /* kprintf and printf log output. */ 29 #define KLOG_TYPE_ASSERT 8 /* Assertion failed / Kernel Panic. */ 30 #define KLOG_TYPE_LOGASSERT 9 /* Assertion failed within kLog. */ 31 32 #define KLOG_TYPE_LAST_REQ KLOG_TYPE_ASSERT /* Last required type. */ 33 34 #define KLOG_TYPE_USER 0x1000 /* First user log type. */ 26 35 27 36 … … 29 38 * Flags. 30 39 */ 31 #define KLOG_TYPEDEF_PTR 0x8000 /* flags this typedef as a pointer. */ 32 #define KLOG_TYPEDEF_SIZE 0xfff /* Mask to get the size. */ 33 34 #define KLOG_TYPE_DISABLED 0x00 35 #define KLOG_TYPE_ENABLED 0x01 36 #define KLOG_TYPE_COMOUTPUT 0x10 37 #define KLOG_TYPE_MASK 0x11 40 #define KLOG_TYPEDEF_PTR 0x8000 /* flags this typedef as a pointer. */ 41 #define KLOG_TYPEDEF_SIZE 0x0fff /* Mask to get the size. */ 42 43 #define KLOG_FLAGS_DISABLED 0x0000 44 #define KLOG_FLAGS_ENABLED 0x0001 45 #ifdef RING0 46 #define KLOG_FLAGS_COMOUTPUT 0x0010 47 #else 48 #define KLOG_FLAGS_COMOUTPUT 0x0000 49 #endif 50 #define KLOG_FLAGS_MASK 0x0011 51 #define KLOG_FLAGS_AS_ABOVE 0xffff /* Inherit options from above option level. */ 38 52 39 53 /* … … 64 78 typedef unsigned long int HKLOGMOD; /* Loghandle for a module. */ 65 79 80 #ifdef _kAVL_h_ 66 81 67 82 /** … … 82 97 typedef struct kLogTypedefInfo 83 98 { 84 const char * pszType; 99 union 100 { 101 const char * pszType; 102 AVLSTRNODECORE avlnodecore; 103 } u1; 85 104 const char * pszFormat; 86 105 const unsigned short cb; … … 113 132 114 133 134 /** 135 * Describes one file. 136 */ 137 typedef struct kLogFileInfo 138 { 139 union 140 { 141 const char * pszFile; 142 AVLSTRNODECORE avlnodecore; 143 } u1; 144 unsigned short fCurrent; 145 const unsigned short fDefault; 146 } KLOGFILEINFO, *PKLOGFILEINFO; 147 148 115 149 116 150 /** … … 120 154 { 121 155 const char * pszModuleName; /* Module name. */ 122 const char * pszModuleDescription; /* Module description. */ 123 124 int cTypedefs; /* Number of typesdef in paTypedefs. */ 125 PKLOGTYPEDEFINFO paTypedefs; /* Array of typedef descriptions. */ 126 127 int cUserTypes; /* Number of user types in paUserTypes. */ 128 PKLOGTYPEINFO paUserTypes; /* Array of user type descriptions. */ 129 130 int cDefTypes; /* Number of default types in paDefTypes. */ 131 PKLOGDEFTYPEINFO paDefTypes; /* Array of default type descriptions. */ 156 const char * pszModuleDescription;/*Module description. */ 157 158 int cTypedefs; /* Number of typesdef in paTypedefs. */ 159 PKLOGTYPEDEFINFO paTypedefs; /* Array of typedef descriptions. */ 160 161 int cUserTypes; /* Number of user types in paUserTypes. */ 162 PKLOGTYPEINFO paUserTypes;/* Array of user type descriptions. */ 163 164 int cDefTypes; /* Number of default types in paDefTypes. */ 165 PKLOGDEFTYPEINFO paDefTypes; /* Array of default type descriptions. */ 166 167 int cFiles; /* Number of files in paFiles. */ 168 PKLOGFILEINFO paFiles; /* Array of per file settings. */ 132 169 133 170 /* Module Data Used by Log System - Do NOT touch! */ 134 AVLULNODECORE avlnodecore; /* AVL Tree node with module handle as key. */ 135 unsigned long ulLastSeq; /* Last sequence number. */ 171 AVLULNODECORE avlnodecore;/* AVL Tree node with module handle as key. */ 172 PAVLSTRNODECORE pavlTypedefs;/*Tree of typedef into entries. */ 173 PAVLSTRNODECORE pavlFiles; /* Tree of file into entries. */ 174 unsigned long ulLastSeq; /* Last sequence number. */ 175 unsigned short fCurrent; 176 const unsigned short fDefault; 136 177 137 178 } KLOGMODDATA, *PKLOGMODDATA; 138 139 179 #endif /* #ifdef _kAVL_h_ */ 180 181 182 /** 183 * The sequence handle on the stack. 184 */ 140 185 typedef union kLogSeqHandle 141 186 { … … 156 201 KBOOL KLIBCALL kLogInitBuffer(unsigned long cbBufferSize); 157 202 203 #ifdef _kAVL_h_ 158 204 HKLOGMOD KLIBCALL kLogInitMod(PKLOGMODDATA pMod, KLOGPOS_DECL); 205 #endif 159 206 void KLIBCALL kLogEntry(HKLOGMOD hLogMod, KLOGPOS_DECL, const char *pszFuncProto, KBOOL fOptlink, ...); 160 207 void KLIBCALL kLogExit(HKLOGMOD hLogMod, KLOGPOS_DECL, const char *pszReturnType, unsigned uReturn); 161 208 void KLIBCALL kLog(HKLOGMOD hLogMod, KLOGPOS_DECL, int iType, ...); 209 #if defined(va_arg) || defined(va_list) || defined(va_start) || defined(va_end) 210 void KLIBCALL kLogv(HKLOGMOD hLogMod, KLOGPOS_DECL, int iType, va_list args); 211 va_list KLIBCALL kLogFixPrintf(const char *pszFormat, ...); /* a hack! */ 212 #endif 162 213 163 214 #define KLOGINITMOD(pMod) kLogInitMod(pMod, KLOGPOS_EXT) 164 #define KLOGENTRY(hLogMod, pszFuncProto) kLogEntry(hLogMod, KLOGPOS_EXT, pszFuncProto, FALSE) 165 #define KLOGEXIT(hLogMod, pszType, uValue) kLogExit(hLogMod, KLOGPOS_EXT, pszType, uValue) 166 167 168 #endif 169 215 #define KLOGENTRY(hLogMod, pszProto, parg0) kLogEntry(hLogMod, KLOGPOS_EXT, pszFuncProto, FALSE, parg0) 216 #define KLOGEXIT(hLogMod, pszType, uValue) kLogExit(hLogMod, KLOGPOS_EXT, pszType, uValue) 217 218 #ifdef __cplusplus 219 } 220 #endif 221 222 #endif 223
Note:
See TracChangeset
for help on using the changeset viewer.