2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
23 #include <libkern/c++/OSObject.h>
25 #define kIOPolledInterfaceSupportKey "IOPolledInterface"
29 kIOPolledPreflightState
= 1,
30 kIOPolledBeforeSleepState
= 2,
31 kIOPolledAfterSleepState
= 3,
32 kIOPolledPostflightState
= 4
41 typedef void (*IOPolledCompletionAction
)( void * target
,
44 uint64_t actualByteCount
);
45 struct IOPolledCompletion
48 IOPolledCompletionAction action
;
52 class IOPolledInterface
: public OSObject
54 OSDeclareAbstractStructors(IOPolledInterface
);
57 struct ExpansionData
{ };
58 ExpansionData
* reserved
;
61 virtual IOReturn
probe(IOService
* target
) = 0;
63 virtual IOReturn
open( IOOptionBits state
, IOMemoryDescriptor
* buffer
) = 0;
64 virtual IOReturn
close(IOOptionBits state
) = 0;
66 virtual IOReturn
startIO(uint32_t operation
,
67 uint32_t bufferOffset
,
68 uint64_t deviceOffset
,
70 IOPolledCompletion completion
) = 0;
72 virtual IOReturn
checkForWork(void) = 0;
74 static IOReturn
checkAllForWork(void);
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);