]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/IOTimeStamp.h
8e01e7e66b46c9fa22ab7b1d38c82212677dd2d8
[apple/xnu.git] / iokit / IOKit / IOTimeStamp.h
1 /*
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 #ifndef IOKIT_IOTIMESTAMP_H
23 #define IOKIT_IOTIMESTAMP_H
24
25 #include <sys/kdebug.h>
26
27 static inline void
28 IOTimeStampStartConstant(unsigned int csc,
29 unsigned int a = 0, unsigned int b = 0,
30 unsigned int c = 0, unsigned int d = 0)
31 {
32 KERNEL_DEBUG_CONSTANT(csc | DBG_FUNC_START, a, b, c, d, 0);
33 }
34
35 static inline void
36 IOTimeStampEndConstant(unsigned int csc,
37 unsigned int a = 0, unsigned int b = 0,
38 unsigned int c = 0, unsigned int d = 0)
39 {
40 KERNEL_DEBUG_CONSTANT(csc | DBG_FUNC_END, a, b, c, d, 0);
41 }
42
43 static inline void
44 IOTimeStampConstant(unsigned int csc,
45 unsigned int a = 0, unsigned int b = 0,
46 unsigned int c = 0, unsigned int d = 0)
47 {
48 KERNEL_DEBUG_CONSTANT(csc | DBG_FUNC_NONE, a, b, c, d, 0);
49 }
50
51 #if KDEBUG
52
53 static inline void
54 IOTimeStampStart(unsigned int csc,
55 unsigned int a = 0, unsigned int b = 0,
56 unsigned int c = 0, unsigned int d = 0)
57 {
58 KERNEL_DEBUG(csc | DBG_FUNC_START, a, b, c, d, 0);
59 }
60
61 static inline void
62 IOTimeStampEnd(unsigned int csc,
63 unsigned int a = 0, unsigned int b = 0,
64 unsigned int c = 0, unsigned int d = 0)
65 {
66 KERNEL_DEBUG(csc | DBG_FUNC_END, a, b, c, d, 0);
67 }
68
69 static inline void
70 IOTimeStamp(unsigned int csc,
71 unsigned int a = 0, unsigned int b = 0,
72 unsigned int c = 0, unsigned int d = 0)
73 {
74 KERNEL_DEBUG(csc | DBG_FUNC_NONE, a, b, c, d, 0);
75 }
76
77 #endif /* KDEBUG */
78
79 #define IODBG_STORAGE(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSTORAGE, code))
80 #define IODBG_NETWORK(code) (KDBG_CODE(DBG_IOKIT, DBG_IONETWORK, code))
81 #define IODBG_KEYBOARD(code) (KDBG_CODE(DBG_IOKIT, DBG_IOKEYBOARD, code))
82 #define IODBG_HID(code) (KDBG_CODE(DBG_IOKIT, DBG_IOHID, code))
83 #define IODBG_AUDIO(code) (KDBG_CODE(DBG_IOKIT, DBG_IOAUDIO, code))
84 #define IODBG_SERIAL(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSERIAL, code))
85 #define IODBG_TTY(code) (KDBG_CODE(DBG_IOKIT, DBG_IOTTY, code))
86 #define IODBG_SAM(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSAM, code))
87 #define IODBG_PARALLELATA(code) (KDBG_CODE(DBG_IOKIT, DBG_IOPARALLELATA, code))
88 #define IODBG_PARALLELSCSI(code) (KDBG_CODE(DBG_IOKIT, DBG_IOPARALLELSCSI, code))
89 #define IODBG_SATA(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSATA, code))
90 #define IODBG_SAS(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSAS, code))
91 #define IODBG_FIBRECHANNEL(code) (KDBG_CODE(DBG_IOKIT, DBG_IOFIBRECHANNEL, code))
92 #define IODBG_USB(code) (KDBG_CODE(DBG_IOKIT, DBG_IOUSB, code))
93 #define IODBG_BLUETOOTH(code) (KDBG_CODE(DBG_IOKIT, DBG_IOBLUETOOTH, code))
94 #define IODBG_FIREWIRE(code) (KDBG_CODE(DBG_IOKIT, DBG_IOFIREWIRE, code))
95 #define IODBG_INFINIBAND(code) (KDBG_CODE(DBG_IOKIT, DBG_IOINFINIBAND, code))
96
97
98 /* Backwards compatibility */
99 #define IODBG_DISK(code) IODBG_STORAGE(code)
100 #define IODBG_POINTING(code) IODBG_HID(code)
101
102
103 /* IOKit infrastructure subclasses */
104 #define IODBG_WORKLOOP(code) (KDBG_CODE(DBG_IOKIT, DBG_IOWORKLOOP, code))
105 #define IODBG_INTES(code) (KDBG_CODE(DBG_IOKIT, DBG_IOINTES, code))
106 #define IODBG_TIMES(code) (KDBG_CODE(DBG_IOKIT, DBG_IOCLKES, code))
107 #define IODBG_CMDQ(code) (KDBG_CODE(DBG_IOKIT, DBG_IOCMDQ, code))
108 #define IODBG_MCURS(code) (KDBG_CODE(DBG_IOKIT, DBG_IOMCURS, code))
109 #define IODBG_MDESC(code) (KDBG_CODE(DBG_IOKIT, DBG_IOMDESC, code))
110 #define IODBG_POWER(code) (KDBG_CODE(DBG_IOKIT, DBG_IOPOWER, code))
111
112 /* IOKit specific codes - within each subclass */
113
114 /* DBG_IOKIT/DBG_IODISK codes */
115
116 /* DBG_IOKIT/DBG_IONETWORK codes */
117
118 /* DBG_IOKIT/DBG_IOKEYBOARD codes */
119
120 /* DBG_IOKIT/DBG_IOHID codes */
121
122 /* DBG_IOKIT/DBG_IOAUDIO codes */
123
124 /* DBG_IOKIT/DBG_IOSERIAL codes */
125
126 /* DBG_IOKIT/DBG_IOTTY codes */
127
128 /* DBG_IOKIT/DBG_IOWORKLOOP codes */
129 #define IOWL_CLIENT 1 /* 0x05010004 */
130 #define IOWL_WORK 2 /* 0x05010008 */
131
132 /* DBG_IOKIT/DBG_IOINTES codes */
133 #define IOINTES_CLIENT 1 /* 0x05020004 */
134 #define IOINTES_LAT 2 /* 0x05020008 */
135 #define IOINTES_SEMA 3 /* 0x0502000c */
136 #define IOINTES_INTCTXT 4 /* 0x05020010 */
137 #define IOINTES_INTFLTR 5 /* 0x05020014 */
138 #define IOINTES_ACTION 6 /* 0x05020018 */
139 #define IOINTES_FILTER 7 /* 0x0502001c */
140
141 /* DBG_IOKIT/DBG_IOTIMES codes */
142 #define IOTIMES_CLIENT 1 /* 0x05030004 */
143 #define IOTIMES_LAT 2 /* 0x05030008 */
144 #define IOTIMES_SEMA 3 /* 0x0503000c */
145 #define IOTIMES_ACTION 4 /* 0x05030010 */
146
147 /* DBG_IOKIT/DBG_IOCMDQ codes */
148 #define IOCMDQ_CLIENT 1 /* 0x05040004 */
149 #define IOCMDQ_LAT 2 /* 0x05040008 */
150 #define IOCMDQ_SEMA 3 /* 0x0504000c */
151 #define IOCMDQ_PSEMA 4 /* 0x05040010 */
152 #define IOCMDQ_PLOCK 5 /* 0x05040014 */
153 #define IOCMDQ_ACTION 6 /* 0x05040018 */
154
155 /* DBG_IOKIT/DBG_IOMCURS codes */
156
157 /* DBG_IOKIT/DBG_IOMDESC codes */
158
159 /* DBG_IOKIT/DBG_IOPOWER codes */
160 // See IOKit/pwr_mgt/IOPMlog.h for the power management codes
161
162 #endif /* ! IOKIT_IOTIMESTAMP_H */