]> git.saurik.com Git - apple/xnu.git/blame - iokit/IOKit/IOTimeStamp.h
xnu-6153.101.6.tar.gz
[apple/xnu.git] / iokit / IOKit / IOTimeStamp.h
CommitLineData
1c79356b 1/*
6d2010ae 2 * Copyright (c) 1998-2010 Apple Inc. All rights reserved.
1c79356b 3 *
2d21ac55 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
0a7de745 5 *
2d21ac55
A
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
0a7de745 14 *
2d21ac55
A
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
0a7de745 17 *
2d21ac55
A
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
8f6c56a5
A
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2d21ac55
A
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
0a7de745 25 *
2d21ac55 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
1c79356b
A
27 */
28#ifndef IOKIT_IOTIMESTAMP_H
29#define IOKIT_IOTIMESTAMP_H
30
1c79356b
A
31#include <sys/kdebug.h>
32
33static inline void
34IOTimeStampStartConstant(unsigned int csc,
0a7de745
A
35 uintptr_t a = 0, uintptr_t b = 0,
36 uintptr_t c = 0, uintptr_t d = 0)
1c79356b 37{
0a7de745 38 KERNEL_DEBUG_CONSTANT(((uint32_t)csc) | DBG_FUNC_START, a, b, c, d, 0);
1c79356b
A
39}
40
41static inline void
b0d623f7 42IOTimeStampEndConstant(uintptr_t csc,
0a7de745
A
43 uintptr_t a = 0, uintptr_t b = 0,
44 uintptr_t c = 0, uintptr_t d = 0)
1c79356b 45{
0a7de745 46 KERNEL_DEBUG_CONSTANT(((uint32_t)csc) | DBG_FUNC_END, a, b, c, d, 0);
1c79356b
A
47}
48
49static inline void
b0d623f7 50IOTimeStampConstant(uintptr_t csc,
0a7de745
A
51 uintptr_t a = 0, uintptr_t b = 0,
52 uintptr_t c = 0, uintptr_t d = 0)
1c79356b 53{
0a7de745 54 KERNEL_DEBUG_CONSTANT(((uint32_t)csc) | DBG_FUNC_NONE, a, b, c, d, 0);
1c79356b
A
55}
56
57#if KDEBUG
58
59static inline void
b0d623f7 60IOTimeStampStart(uintptr_t csc,
0a7de745
A
61 uintptr_t a = 0, uintptr_t b = 0,
62 uintptr_t c = 0, uintptr_t d = 0)
1c79356b 63{
0a7de745 64 KERNEL_DEBUG(((uint32_t)csc) | DBG_FUNC_START, a, b, c, d, 0);
1c79356b
A
65}
66
67static inline void
b0d623f7 68IOTimeStampEnd(uintptr_t csc,
0a7de745
A
69 uintptr_t a = 0, uintptr_t b = 0,
70 uintptr_t c = 0, uintptr_t d = 0)
1c79356b 71{
0a7de745 72 KERNEL_DEBUG(((uint32_t)csc) | DBG_FUNC_END, a, b, c, d, 0);
1c79356b
A
73}
74
75static inline void
b0d623f7 76IOTimeStamp(uintptr_t csc,
0a7de745
A
77 uintptr_t a = 0, uintptr_t b = 0,
78 uintptr_t c = 0, uintptr_t d = 0)
1c79356b 79{
0a7de745 80 KERNEL_DEBUG(((uint32_t)csc) | DBG_FUNC_NONE, a, b, c, d, 0);
1c79356b
A
81}
82
83#endif /* KDEBUG */
84
0a7de745
A
85#define IODBG_STORAGE(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSTORAGE, code))
86#define IODBG_NETWORK(code) (KDBG_CODE(DBG_IOKIT, DBG_IONETWORK, code))
87#define IODBG_KEYBOARD(code) (KDBG_CODE(DBG_IOKIT, DBG_IOKEYBOARD, code))
88#define IODBG_HID(code) (KDBG_CODE(DBG_IOKIT, DBG_IOHID, code))
89#define IODBG_AUDIO(code) (KDBG_CODE(DBG_IOKIT, DBG_IOAUDIO, code))
90#define IODBG_SERIAL(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSERIAL, code))
91#define IODBG_TTY(code) (KDBG_CODE(DBG_IOKIT, DBG_IOTTY, code))
92#define IODBG_SAM(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSAM, code))
93#define IODBG_PARALLELATA(code) (KDBG_CODE(DBG_IOKIT, DBG_IOPARALLELATA, code))
94#define IODBG_PARALLELSCSI(code) (KDBG_CODE(DBG_IOKIT, DBG_IOPARALLELSCSI, code))
95#define IODBG_SATA(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSATA, code))
96#define IODBG_SAS(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSAS, code))
97#define IODBG_FIBRECHANNEL(code) (KDBG_CODE(DBG_IOKIT, DBG_IOFIBRECHANNEL, code))
98#define IODBG_USB(code) (KDBG_CODE(DBG_IOKIT, DBG_IOUSB, code))
99#define IODBG_BLUETOOTH(code) (KDBG_CODE(DBG_IOKIT, DBG_IOBLUETOOTH, code))
100#define IODBG_FIREWIRE(code) (KDBG_CODE(DBG_IOKIT, DBG_IOFIREWIRE, code))
101#define IODBG_INFINIBAND(code) (KDBG_CODE(DBG_IOKIT, DBG_IOINFINIBAND, code))
0c530ab8
A
102
103
104/* Backwards compatibility */
0a7de745
A
105#define IODBG_DISK(code) IODBG_STORAGE(code)
106#define IODBG_POINTING(code) IODBG_HID(code)
0c530ab8 107
1c79356b
A
108
109/* IOKit infrastructure subclasses */
0a7de745
A
110#define IODBG_INTC(code) (KDBG_CODE(DBG_IOKIT, DBG_IOINTC, code))
111#define IODBG_WORKLOOP(code) (KDBG_CODE(DBG_IOKIT, DBG_IOWORKLOOP, code))
112#define IODBG_INTES(code) (KDBG_CODE(DBG_IOKIT, DBG_IOINTES, code))
113#define IODBG_TIMES(code) (KDBG_CODE(DBG_IOKIT, DBG_IOCLKES, code))
114#define IODBG_CMDQ(code) (KDBG_CODE(DBG_IOKIT, DBG_IOCMDQ, code))
115#define IODBG_MCURS(code) (KDBG_CODE(DBG_IOKIT, DBG_IOMCURS, code))
116#define IODBG_MDESC(code) (KDBG_CODE(DBG_IOKIT, DBG_IOMDESC, code))
117#define IODBG_POWER(code) (KDBG_CODE(DBG_IOKIT, DBG_IOPOWER, code))
118#define IODBG_IOSERVICE(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSERVICE, code))
119#define IODBG_IOREGISTRY(code) (KDBG_CODE(DBG_IOKIT, DBG_IOREGISTRY, code))
1c79356b
A
120
121/* IOKit specific codes - within each subclass */
122
1c79356b
A
123/* DBG_IOKIT/DBG_IODISK codes */
124
125/* DBG_IOKIT/DBG_IONETWORK codes */
126
127/* DBG_IOKIT/DBG_IOKEYBOARD codes */
128
0c530ab8 129/* DBG_IOKIT/DBG_IOHID codes */
1c79356b
A
130
131/* DBG_IOKIT/DBG_IOAUDIO codes */
132
1c79356b
A
133/* DBG_IOKIT/DBG_IOSERIAL codes */
134
135/* DBG_IOKIT/DBG_IOTTY codes */
136
060df5ea 137/* DBG_IOKIT/DBG_IOINTC codes */
0a7de745
A
138#define IOINTC_HANDLER 1 /* 0x05000004 */
139#define IOINTC_SPURIOUS 2 /* 0x05000008 */
060df5ea 140
1c79356b 141/* DBG_IOKIT/DBG_IOWORKLOOP codes */
0a7de745
A
142#define IOWL_CLIENT 1 /* 0x05010004 */
143#define IOWL_WORK 2 /* 0x05010008 */
1c79356b
A
144
145/* DBG_IOKIT/DBG_IOINTES codes */
0a7de745
A
146#define IOINTES_CLIENT 1 /* 0x05020004 */
147#define IOINTES_LAT 2 /* 0x05020008 */
148#define IOINTES_SEMA 3 /* 0x0502000c */
149#define IOINTES_INTCTXT 4 /* 0x05020010 */
150#define IOINTES_INTFLTR 5 /* 0x05020014 */
151#define IOINTES_ACTION 6 /* 0x05020018 */
152#define IOINTES_FILTER 7 /* 0x0502001c */
1c79356b
A
153
154/* DBG_IOKIT/DBG_IOTIMES codes */
0a7de745
A
155#define IOTIMES_CLIENT 1 /* 0x05030004 */
156#define IOTIMES_LAT 2 /* 0x05030008 */
157#define IOTIMES_SEMA 3 /* 0x0503000c */
158#define IOTIMES_ACTION 4 /* 0x05030010 */
1c79356b
A
159
160/* DBG_IOKIT/DBG_IOCMDQ codes */
0a7de745
A
161#define IOCMDQ_CLIENT 1 /* 0x05040004 */
162#define IOCMDQ_LAT 2 /* 0x05040008 */
163#define IOCMDQ_SEMA 3 /* 0x0504000c */
164#define IOCMDQ_PSEMA 4 /* 0x05040010 */
165#define IOCMDQ_PLOCK 5 /* 0x05040014 */
166#define IOCMDQ_ACTION 6 /* 0x05040018 */
1c79356b
A
167
168/* DBG_IOKIT/DBG_IOMCURS codes */
169
170/* DBG_IOKIT/DBG_IOMDESC codes */
171
9bccf70c 172/* DBG_IOKIT/DBG_IOPOWER codes */
91447636 173// See IOKit/pwr_mgt/IOPMlog.h for the power management codes
9bccf70c 174
b0d623f7 175/* DBG_IOKIT/DBG_IOSERVICE codes */
0a7de745
A
176#define IOSERVICE_BUSY 1 /* 0x05080004 */
177#define IOSERVICE_NONBUSY 2 /* 0x05080008 */
178#define IOSERVICE_MODULESTALL 3 /* 0x0508000C */
179#define IOSERVICE_MODULEUNSTALL 4 /* 0x05080010 */
180
181#define IOSERVICE_TERMINATE_PHASE1 5 /* 0x05080014 */
182#define IOSERVICE_TERMINATE_REQUEST_OK 6 /* 0x05080018 */
183#define IOSERVICE_TERMINATE_REQUEST_FAIL 7 /* 0x0508001C */
184#define IOSERVICE_TERMINATE_SCHEDULE_STOP 8 /* 0x05080020 */
185#define IOSERVICE_TERMINATE_SCHEDULE_FINALIZE 9 /* 0x05080024 */
186#define IOSERVICE_TERMINATE_WILL 10 /* 0x05080028 */
187#define IOSERVICE_TERMINATE_DID 11 /* 0x0508002C */
188#define IOSERVICE_TERMINATE_DID_DEFER 12 /* 0x05080030 */
189#define IOSERVICE_TERMINATE_FINALIZE 13 /* 0x05080034 */
190#define IOSERVICE_TERMINATE_STOP 14 /* 0x05080038 */
191#define IOSERVICE_TERMINATE_STOP_NOP 15 /* 0x0508003C */
192#define IOSERVICE_TERMINATE_STOP_DEFER 16 /* 0x05080040 */
193#define IOSERVICE_TERMINATE_DONE 17 /* 0x05080044 */
194
195#define IOSERVICE_KEXTD_ALIVE 18 /* 0x05080048 */
196#define IOSERVICE_KEXTD_READY 19 /* 0x0508004C */
197#define IOSERVICE_REGISTRY_QUIET 20 /* 0x05080050 */
198
199#define IOSERVICE_TERM_SET_INACTIVE 21 /* 0x05080054 */
200#define IOSERVICE_TERM_SCHED_PHASE2 22 /* 0x05080058 */
201#define IOSERVICE_TERM_START_PHASE2 23 /* 0x0508005C */
202#define IOSERVICE_TERM_TRY_PHASE2 24 /* 0x05080060 */
203#define IOSERVICE_TERM_UC_DEFER 25 /* 0x05080064 */
204#define IOSERVICE_DETACH 26 /* 0x05080068 */
3e170ce0 205
743345f9 206/* DBG_IOKIT/DBG_IOREGISTRY codes */
0a7de745
A
207#define IOREGISTRYENTRY_NAME_STRING 1 /* 0x05090004 */
208#define IOREGISTRYENTRY_NAME 2 /* 0x05090008 */
3e170ce0 209
1c79356b 210#endif /* ! IOKIT_IOTIMESTAMP_H */