]>
Commit | Line | Data |
---|---|---|
91447636 A |
1 | /* |
2 | * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
ff6e181a 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. Please obtain a copy of the License at | |
10 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
11 | * file. | |
91447636 | 12 | * |
ff6e181a A |
13 | * The Original Code and all software distributed under the License are |
14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
91447636 A |
15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
ff6e181a A |
17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
18 | * Please see the License for the specific language governing rights and | |
19 | * limitations under the License. | |
91447636 A |
20 | * |
21 | * @APPLE_LICENSE_HEADER_END@ | |
22 | */ | |
23 | ||
24 | #include <libkern/c++/OSObject.h> | |
25 | ||
26 | #define kIOPolledInterfaceSupportKey "IOPolledInterface" | |
27 | ||
28 | enum | |
29 | { | |
30 | kIOPolledPreflightState = 1, | |
31 | kIOPolledBeforeSleepState = 2, | |
32 | kIOPolledAfterSleepState = 3, | |
33 | kIOPolledPostflightState = 4 | |
34 | }; | |
35 | ||
36 | enum | |
37 | { | |
38 | kIOPolledWrite = 1, | |
39 | kIOPolledRead = 2 | |
40 | }; | |
41 | ||
42 | typedef void (*IOPolledCompletionAction)( void * target, | |
43 | void * parameter, | |
44 | IOReturn status, | |
45 | uint64_t actualByteCount); | |
46 | struct IOPolledCompletion | |
47 | { | |
48 | void * target; | |
49 | IOPolledCompletionAction action; | |
50 | void * parameter; | |
51 | }; | |
52 | ||
53 | class IOPolledInterface : public OSObject | |
54 | { | |
55 | OSDeclareAbstractStructors(IOPolledInterface); | |
56 | ||
57 | protected: | |
58 | struct ExpansionData { }; | |
59 | ExpansionData * reserved; | |
60 | ||
61 | public: | |
62 | virtual IOReturn probe(IOService * target) = 0; | |
63 | ||
64 | virtual IOReturn open( IOOptionBits state, IOMemoryDescriptor * buffer) = 0; | |
65 | virtual IOReturn close(IOOptionBits state) = 0; | |
66 | ||
67 | virtual IOReturn startIO(uint32_t operation, | |
68 | uint32_t bufferOffset, | |
69 | uint64_t deviceOffset, | |
70 | uint64_t length, | |
71 | IOPolledCompletion completion) = 0; | |
72 | ||
73 | virtual IOReturn checkForWork(void) = 0; | |
74 | ||
75 | static IOReturn checkAllForWork(void); | |
76 | ||
77 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 0); | |
78 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 1); | |
79 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 2); | |
80 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 3); | |
81 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 4); | |
82 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 5); | |
83 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 6); | |
84 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 7); | |
85 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 8); | |
86 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 9); | |
87 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 10); | |
88 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 11); | |
89 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 12); | |
90 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 13); | |
91 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 14); | |
92 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 15); | |
93 | }; | |
94 |