Chameleon

Chameleon Svn Source Tree

Root/branches/rewrite/i386/include/IOKit/usb/IOUSBWorkLoop.h

Source at commit 1166 created 13 years 10 days ago.
By meklort, Fixed recent Makefile changes. Please do not use /Users/evan/SourceCode/tmp/chameleon/trunk or VPATH. the *only* time you should use /Users/evan/SourceCode/tmp/chameleon/trunk is when setting the SRCROOT variable. Also note that very soon make pkg is going to be removed. The pkg build script in trunk is very out of date. Instead please use the package maker at http://forge.voodooprojects.org/p/chameleonApplications/. Once this is ready for trunk it will be merged.
1/*
2 * Copyright (c) 2001-2006 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
12 *
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
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _IOKIT_IOUSBWORKLOOP_H
25#define _IOKIT_IOUSBWORKLOOP_H
26
27#include <IOKit/IOWorkLoop.h>
28
29/*!
30 @class IOUSBWorkLoop
31 @abstract Subclass of IOWorkloop that allows the USB stack to more finely control sleep and wake.
32 */
33class IOUSBWorkLoop : public IOWorkLoop
34{
35 OSDeclareDefaultStructors(IOUSBWorkLoop)
36
37protected:
38 void *fSleepToken;
39#ifndef __OPEN_SOURCE__
40lck_grp_t *fLockGroup;
41#endif
42bool init ( const char * controllerLocation );
43void free ( void );
44
45 // Overrides to check for sleeping
46 virtual void closeGate();
47 virtual bool tryCloseGate();
48
49public:
50 // Create a workloop
51 static IOUSBWorkLoop * workLoop(const char * controllerLocation);
52
53 // Put workloop to sleep (Must have gate closed, opens gate if successful)
54 virtual IOReturn sleep(void *token);
55
56 // Wake workloop up (closes gate if successful)
57 virtual IOReturn wake(void *token);
58
59 void CloseGate(void);
60 void OpenGate(void);
61};
62
63#endif /* ! _IOKIT_IOUSBWORKLOOP_H */
64
65

Archive Download this file

Revision: 1166