IOHIDEventServiceFastPathUserClient.h [plain text]
#ifndef IOHIDEventServiceFastPathUserClient_h
#define IOHIDEventServiceFastPathUserClient_h
#define kIOHIDEventServiceFastPathUserClientType 'HIDF'
enum IOHIDEventServiceFastPathUserClientCommandCodes {
kIOHIDEventServiceFastPathUserClientOpen,
kIOHIDEventServiceFastPathUserClientClose,
kIOHIDEventServiceFastPathUserClientCopyEvent,
kIOHIDEventServiceFastPathUserClientNumCommands
};
enum IOHIDEventServiceFastPathUserClientCopySpecType {
kIOHIDEventServiceFastPathCopySpecSerializedType,
kIOHIDEventServiceFastPathCopySpecDataType
};
#ifdef KERNEL
#include <IOKit/IOUserClient.h>
#include "IOHIDEventService.h"
#include <IOKit/IOCommandGate.h>
#include <IOKit/IOBufferMemoryDescriptor.h>
class IOHIDEventServiceQueue;
class IOHIDEventServiceFastPathUserClient : public IOUserClient
{
OSDeclareDefaultStructors(IOHIDEventServiceFastPathUserClient)
private:
typedef struct ExternalMethodGatedArguments {
uint32_t selector;
IOExternalMethodArguments * arguments;
IOExternalMethodDispatch * dispatch;
OSObject * target;
void * reference;
} ExternalMethodGatedArguments;
static const IOExternalMethodDispatch sMethods[kIOHIDEventServiceFastPathUserClientNumCommands];
IOHIDEventService * _owner;
void * _clientContext;
IOBufferMemoryDescriptor * _buffer;
IOCommandGate * _commandGate;
volatile uint32_t _opened;
IOOptionBits _options;
IOLock * _lock;
bool _fastPathEntitlement;
static IOReturn _open (IOHIDEventServiceFastPathUserClient * target, void * reference, IOExternalMethodArguments * arguments);
static IOReturn _close (IOHIDEventServiceFastPathUserClient * target, void * reference, IOExternalMethodArguments * arguments);
static IOReturn _copyEvent(IOHIDEventServiceFastPathUserClient * target, void * reference, IOExternalMethodArguments * arguments);
bool serializeDebugState(void * ref, OSSerialize * serializer);
protected:
virtual IOReturn clientClose (void);
virtual void stop (IOService * provider);
virtual IOService * getService (void);
virtual IOReturn clientMemoryForType(UInt32 type, IOOptionBits * options, IOMemoryDescriptor ** memory);
IOReturn clientMemoryForTypeGated (IOOptionBits * options, IOMemoryDescriptor ** memory);
virtual IOReturn externalMethod (
uint32_t selector,
IOExternalMethodArguments * arguments,
IOExternalMethodDispatch * dispatch,
OSObject * target,
void * reference
);
IOReturn externalMethodGated(ExternalMethodGatedArguments *arguments);
IOReturn open(IOOptionBits options, OSDictionary * properties);
IOReturn copyEvent(OSObject * copySpec, IOOptionBits options = 0);
IOReturn setPropertiesGated (OSObject * properties) ;
void copyPropertyGated (const char * aKey, OSObject **result) const;
uint32_t getSharedMemorySize ();
public:
virtual bool initWithTask(task_t owningTask, void * security_id, UInt32 type);
virtual bool start( IOService * provider );
virtual bool didTerminate(IOService *provider, IOOptionBits options, bool *defer);
virtual void free();
virtual IOReturn setProperties( OSObject * properties);
virtual OSObject * copyProperty( const char * aKey) const;
virtual IOReturn close();
};
#endif
#endif