#ifndef _IOKIT_IOUSERCLIENT_H
#define _IOKIT_IOUSERCLIENT_H
#include <IOKit/IOTypes.h>
#include <IOKit/IOService.h>
#include <IOKit/OSMessageNotification.h>
enum {
kIOUCTypeMask = 0x0000000f,
kIOUCScalarIScalarO = 0,
kIOUCScalarIStructO = 2,
kIOUCStructIStructO = 3,
kIOUCScalarIStructI = 4
};
typedef IOReturn (IOService::*IOMethod)(void * p1, void * p2, void * p3,
void * p4, void * p5, void * p6 );
typedef IOReturn (IOService::*IOAsyncMethod)(OSAsyncReference asyncRef,
void * p1, void * p2, void * p3,
void * p4, void * p5, void * p6 );
typedef IOReturn (IOService::*IOTrap)(void * p1, void * p2, void * p3,
void * p4, void * p5, void * p6 );
struct IOExternalMethod {
IOService * object;
IOMethod func;
IOOptionBits flags;
IOByteCount count0;
IOByteCount count1;
};
struct IOExternalAsyncMethod {
IOService * object;
IOAsyncMethod func;
IOOptionBits flags;
IOByteCount count0;
IOByteCount count1;
};
struct IOExternalTrap {
IOService * object;
IOTrap func;
};
enum {
kIOUserNotifyMaxMessageSize = 64
};
#define kIOClientPrivilegeAdministrator "root"
#define kIOClientPrivilegeLocalUser "local"
class IOUserClient : public IOService
{
OSDeclareAbstractStructors(IOUserClient)
protected:
struct ExpansionData { };
ExpansionData * reserved;
public:
OSSet * mappings;
void * __reserved[8];
private:
OSMetaClassDeclareReservedUnused(IOUserClient, 0);
OSMetaClassDeclareReservedUnused(IOUserClient, 1);
OSMetaClassDeclareReservedUnused(IOUserClient, 2);
OSMetaClassDeclareReservedUnused(IOUserClient, 3);
OSMetaClassDeclareReservedUnused(IOUserClient, 4);
OSMetaClassDeclareReservedUnused(IOUserClient, 5);
OSMetaClassDeclareReservedUnused(IOUserClient, 6);
OSMetaClassDeclareReservedUnused(IOUserClient, 7);
OSMetaClassDeclareReservedUnused(IOUserClient, 8);
OSMetaClassDeclareReservedUnused(IOUserClient, 9);
OSMetaClassDeclareReservedUnused(IOUserClient, 10);
OSMetaClassDeclareReservedUnused(IOUserClient, 11);
OSMetaClassDeclareReservedUnused(IOUserClient, 12);
OSMetaClassDeclareReservedUnused(IOUserClient, 13);
OSMetaClassDeclareReservedUnused(IOUserClient, 14);
OSMetaClassDeclareReservedUnused(IOUserClient, 15);
protected:
static IOReturn sendAsyncResult(OSAsyncReference reference,
IOReturn result, void *args[], UInt32 numArgs);
static void setAsyncReference(OSAsyncReference asyncRef,
mach_port_t wakePort,
void *callback, void *refcon);
public:
static void initialize( void );
static void destroyUserReferences( OSObject * obj );
static IOReturn clientHasPrivilege( void * securityToken,
const char * privilegeName );
virtual bool initWithTask(
task_t owningTask, void * securityToken, UInt32 type,
OSDictionary * properties);
virtual bool initWithTask(
task_t owningTask, void * securityToken, UInt32 type);
virtual void free();
virtual IOReturn clientClose( void );
virtual IOReturn clientDied( void );
virtual IOService * getService( void );
virtual IOReturn registerNotificationPort(
mach_port_t port, UInt32 type, UInt32 refCon );
virtual IOReturn getNotificationSemaphore( UInt32 notification_type,
semaphore_t * semaphore );
virtual IOReturn connectClient( IOUserClient * client );
virtual IOReturn clientMemoryForType( UInt32 type,
IOOptionBits * options,
IOMemoryDescriptor ** memory );
virtual IOMemoryMap * mapClientMemory( IOOptionBits type,
task_t task,
IOOptionBits mapFlags = kIOMapAnywhere,
IOVirtualAddress atAddress = 0 );
IOMemoryMap * removeMappingForDescriptor(IOMemoryDescriptor * memory);
virtual IOReturn exportObjectToClient(task_t task,
OSObject *obj, io_object_t *clientObj);
virtual IOExternalMethod *
getExternalMethodForIndex( UInt32 index );
virtual IOExternalAsyncMethod *
getExternalAsyncMethodForIndex( UInt32 index );
virtual IOExternalMethod *
getTargetAndMethodForIndex( IOService ** targetP, UInt32 index );
virtual IOExternalAsyncMethod *
getAsyncTargetAndMethodForIndex( IOService ** targetP, UInt32 index );
virtual IOExternalTrap *
getExternalTrapForIndex( UInt32 index );
virtual IOExternalTrap *
getTargetAndTrapForIndex( IOService **targetP, UInt32 index );
};
#endif