|
|
1.1 root 1: /*
2: * Copyright (c) 1998-2000 Apple Computer, 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: /*
24: * Changes to this API are expected.
25: */
26:
27: #ifndef _IOKIT_IOUSERCLIENT_H
28: #define _IOKIT_IOUSERCLIENT_H
29:
30: #include <IOKit/IOTypes.h>
31: #include <IOKit/IOService.h>
32: #include <IOKit/OSMessageNotification.h>
33:
34:
35: enum {
36: kIOUCTypeMask = 0x0000000f,
37: kIOUCScalarIScalarO = 0,
38: kIOUCScalarIStructO = 2,
39: kIOUCStructIStructO = 3,
40: kIOUCScalarIStructI = 4,
41: };
42:
43: typedef IOReturn (IOService::*IOMethod)(void * p1, void * p2, void * p3,
44: void * p4, void * p5, void * p6 );
45:
46: typedef IOReturn (IOService::*IOAsyncMethod)(OSAsyncReference asyncRef,
47: void * p1, void * p2, void * p3,
48: void * p4, void * p5, void * p6 );
49:
50: struct IOExternalMethod {
51: IOService * object;
52: IOMethod func;
53: IOOptionBits flags;
54: IOByteCount count0;
55: IOByteCount count1;
56: };
57:
58: struct IOExternalAsyncMethod {
59: IOService * object;
60: IOAsyncMethod func;
61: IOOptionBits flags;
62: IOByteCount count0;
63: IOByteCount count1;
64: };
65:
66: enum {
67: kIOUserNotifyMaxMessageSize = 64
68: };
69:
70: class IOUserClient : public IOService
71: {
72: OSDeclareAbstractStructors(IOUserClient)
73:
74: protected:
75: static IOReturn sendAsyncResult(OSAsyncReference reference,
76: IOReturn result, void *args[], UInt32 numArgs);
77:
78: public:
79:
80: static void initialize( void );
81:
82: static void destroyUserReferences( OSObject * obj );
83:
84: virtual IOReturn clientClose( void );
85: virtual IOReturn clientDied( void );
86:
87: virtual IOService * getService( void );
88:
89: virtual IOReturn registerNotificationPort(
90: mach_port_t port, UInt32 type, UInt32 refCon );
91:
92: virtual IOReturn getNotificationSemaphore( UInt32 notification_type,
93: semaphore_t * semaphore );
94:
95: virtual IOReturn connectClient( IOUserClient * client );
96:
97: // memory will be released by user client when last map is destroyed
98: virtual IOReturn clientMemoryForType( UInt32 type,
99: IOOptionBits * options,
100: IOMemoryDescriptor ** memory );
101:
102: virtual IOMemoryMap * mapClientMemory( IOOptionBits type,
103: task_t task,
104: IOOptionBits mapFlags = kIOMapAnywhere,
105: IOVirtualAddress atAddress = 0 );
106:
107: virtual IOExternalMethod * getExternalMethodForIndex( UInt32 index );
108: virtual IOExternalAsyncMethod * getExternalAsyncMethodForIndex( UInt32 index );
109:
110: };
111:
112: #endif /* ! _IOKIT_IOUSERCLIENT_H */
113:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.