Chameleon

Chameleon Svn Source Tree

Root/branches/Chimera/i386/include/IOKit/ata/ATATimerEventSource.h

1/*
2 * Copyright (c) 2001-2008 Apple 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
23#ifndef _ATATIMEREVENTSOURCE_H
24#define _ATATIMEREVENTSOURCE_H
25
26
27#include <IOKit/IOTypes.h>
28#include <IOKit/IOCommandGate.h>
29#include <IOKit/IOService.h>
30#include <IOKit/IOWorkLoop.h>
31#include <IOKit/IOTimerEventSource.h>
32
33
34/*!
35@class ATATimerEventSource
36
37@discussion
38Extend the timer event source to allow checking for timer expiration
39from behind the workloop.
40*/
41
42class ATATimerEventSource : public IOTimerEventSource
43{
44 OSDeclareDefaultStructors(ATATimerEventSource);
45
46public:
47
48/*!@function ataTimerEventSource
49@abstract allocate an instance of this type.
50*/
51 static ATATimerEventSource *
52ataTimerEventSource(OSObject *owner, Action action = 0);
53
54/*!@function hasTimedOut
55@abstract returns true if the timer has expired since the last enable/disable or setTimeout() or wakeAtTime() call.
56*/
57virtual bool hasTimedOut( void );
58
59// override to initialize the time out flag.
60 /*!@function
61@abstract
62*/
63virtual bool init(OSObject *owner, Action action = 0);
64
65/*!@function enable
66@abstract overrides in order to set/clear the timed out flag
67*/
68virtual void enable();
69
70/*!@function disable
71@abstract overrides in order to set/clear the timed out flag
72*/
73virtual void disable();
74
75/*!@function wakeAtTime
76@abstract overrides in order to set/clear the timed out flag
77*/
78virtual IOReturn wakeAtTime(UnsignedWide abstime);
79
80/*!@function cancelTimeout
81@abstract overrides in order to set/clear the timed out flag
82*/
83virtual void cancelTimeout();
84
85protected:
86
87enum{ kTimedOutTrue = 'true',
88kTimedOutFalse = 'fals'
89};
90
91UInt32 hasExpired;
92
93
94/*!@function myTimeout
95@abstract my timeout function which sets the timedOut flag atomically.
96*/
97static void myTimeout(void *self);
98
99/*!@function setTimeoutFunc
100@abstract override to install my timeout function instead of the super's.
101*/
102 virtual void setTimeoutFunc();
103
104/*! @struct ExpansionData
105 @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future.
106 */
107 struct ExpansionData { };
108
109/*! @var reserved
110 Reserved for future use. (Internal use only) */
111 ExpansionData *reserved;
112
113private:
114 OSMetaClassDeclareReservedUnused(ATATimerEventSource, 0);
115 OSMetaClassDeclareReservedUnused(ATATimerEventSource, 1);
116 OSMetaClassDeclareReservedUnused(ATATimerEventSource, 2);
117 OSMetaClassDeclareReservedUnused(ATATimerEventSource, 3);
118 OSMetaClassDeclareReservedUnused(ATATimerEventSource, 4);
119 OSMetaClassDeclareReservedUnused(ATATimerEventSource, 5);
120 OSMetaClassDeclareReservedUnused(ATATimerEventSource, 6);
121 OSMetaClassDeclareReservedUnused(ATATimerEventSource, 7);
122
123};
124
125
126#endif /*_ATATIMEREVENTSOURCE_H*/
127

Archive Download this file

Revision: 2225