]>
Commit | Line | Data |
---|---|---|
91447636 A |
1 | /* |
2 | * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
37839358 A |
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. | |
91447636 | 11 | * |
37839358 A |
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 | |
91447636 A |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
37839358 A |
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. | |
91447636 A |
19 | * |
20 | * @APPLE_LICENSE_HEADER_END@ | |
21 | */ | |
22 | ||
23 | #include <libkern/c++/OSObject.h> | |
24 | ||
25 | #define kIOPolledInterfaceSupportKey "IOPolledInterface" | |
26 | ||
27 | enum | |
28 | { | |
29 | kIOPolledPreflightState = 1, | |
30 | kIOPolledBeforeSleepState = 2, | |
31 | kIOPolledAfterSleepState = 3, | |
32 | kIOPolledPostflightState = 4 | |
33 | }; | |
34 | ||
35 | enum | |
36 | { | |
37 | kIOPolledWrite = 1, | |
38 | kIOPolledRead = 2 | |
39 | }; | |
40 | ||
41 | typedef void (*IOPolledCompletionAction)( void * target, | |
42 | void * parameter, | |
43 | IOReturn status, | |
44 | uint64_t actualByteCount); | |
45 | struct IOPolledCompletion | |
46 | { | |
47 | void * target; | |
48 | IOPolledCompletionAction action; | |
49 | void * parameter; | |
50 | }; | |
51 | ||
52 | class IOPolledInterface : public OSObject | |
53 | { | |
54 | OSDeclareAbstractStructors(IOPolledInterface); | |
55 | ||
56 | protected: | |
57 | struct ExpansionData { }; | |
58 | ExpansionData * reserved; | |
59 | ||
60 | public: | |
61 | virtual IOReturn probe(IOService * target) = 0; | |
62 | ||
63 | virtual IOReturn open( IOOptionBits state, IOMemoryDescriptor * buffer) = 0; | |
64 | virtual IOReturn close(IOOptionBits state) = 0; | |
65 | ||
66 | virtual IOReturn startIO(uint32_t operation, | |
67 | uint32_t bufferOffset, | |
68 | uint64_t deviceOffset, | |
69 | uint64_t length, | |
70 | IOPolledCompletion completion) = 0; | |
71 | ||
72 | virtual IOReturn checkForWork(void) = 0; | |
73 | ||
74 | static IOReturn checkAllForWork(void); | |
75 | ||
76 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 0); | |
77 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 1); | |
78 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 2); | |
79 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 3); | |
80 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 4); | |
81 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 5); | |
82 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 6); | |
83 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 7); | |
84 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 8); | |
85 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 9); | |
86 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 10); | |
87 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 11); | |
88 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 12); | |
89 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 13); | |
90 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 14); | |
91 | OSMetaClassDeclareReservedUnused(IOPolledInterface, 15); | |
92 | }; | |
93 |