Unnamed: 0
int64 0
0
| repo_id
stringlengths 5
186
| file_path
stringlengths 15
223
| content
stringlengths 1
32.8M
⌀ |
---|---|---|---|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOBDBlockStorageDriver.h | /*
* Copyright (c) 2006-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* @header IOBDBlockStorageDriver
* @abstract
* This header contains the IOBDBlockStorageDriver class definition.
* @discussion
* This class implements BD functionality, independent of
* the physical connection protocol (e.g. SCSI, ATA, USB).
*
* A protocol-specific provider implements the functionality using an appropriate
* protocol and commands.
*/
#ifndef _IOBDBLOCKSTORAGEDRIVER_H
#define _IOBDBLOCKSTORAGEDRIVER_H
#include <IOKit/storage/IOBDBlockStorageDevice.h>
#include <IOKit/storage/IODVDBlockStorageDriver.h>
/*
* @defined kIOBDBlockStorageDriverClass
* @abstract
* kIOBDBlockStorageDriverClass is the name of the IOBDBlockStorageDriver class.
* @discussion
* kIOBDBlockStorageDriverClass is the name of the IOBDBlockStorageDriver class.
*/
#define kIOBDBlockStorageDriverClass "IOBDBlockStorageDriver"
/*
* @class
* IOBDBlockStorageDriver
* @abstract
* Generic BD Driver.
* @discussion
* Storage drivers are split into two parts: the Generic Driver handles
* all generic device issues, independent of the lower-level transport
* mechanism (e.g. SCSI, ATA, USB, FireWire). All storage operations
* at the Generic Driver level are translated into a series of generic
* device operations. These operations are passed via the Device Nub
* to a Transport Driver, which implements the appropriate
* transport-dependent protocol to execute these operations.
*
* To determine the write-protect state of a device (or media), for
* example, the generic driver would issue a call to the
* Transport Driver's reportWriteProtection method. If this were a SCSI
* device, its Transport Driver would issue a Mode Sense command to
* extract the write-protection status bit. The Transport Driver then
* reports true or false to the generic driver.
*
* The generic driver therefore has no knowledge of, or involvement
* with, the actual commands and mechanisms used to communicate with
* the device. It is expected that the generic driver will rarely, if
* ever, need to be subclassed to handle device idiosyncrasies; rather,
* the Transport Driver should be changed via overrides.
*
* A generic driver could be subclassed to create a different type of
* generic device. The generic driver IOBDBlockStorageDriver class is a subclass
* of IODVDBlockStorageDriver, adding BD functions. Similarly, the Transport Driver
* IOBDBlockStorageDevice is a subclass of IODVDBlockStorageDevice, adding BD
* functions.
*/
class __exported IOBDBlockStorageDriver : public IODVDBlockStorageDriver
{
OSDeclareDefaultStructors(IOBDBlockStorageDriver)
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
/* Overrides of IODVDBlockStorageDriver. */
virtual IOReturn acceptNewMedia(void);
/* End of IODVDBlockStorageDriver overrides. */
public:
/*
* Obtain this object's provider. We override the superclass's method to
* return a more specific subclass of IOService -- IOBDBlockStorageDevice.
* This method serves simply as a convenience to subclass developers.
*/
virtual IOBDBlockStorageDevice * getProvider() const;
/* Overrides of IODVDBlockStorageDriver: */
virtual const char * getDeviceTypeName(void);
virtual IOMedia * instantiateDesiredMediaObject(void);
virtual IOMedia * instantiateMediaObject(UInt64 base,UInt64 byteSize,
UInt32 blockSize,char *mediaName);
virtual IOReturn readStructure(IOMemoryDescriptor *buffer,const DVDStructureFormat format,
const UInt32 address,const UInt8 layer,const UInt8 agid);
/* End of IODVDBlockStorageDriver overrides. */
/*
* @function splitTrack
* @discussion
* Issue an MMC RESERVE TRACK command with the ARSV bit.
* @param address
* As documented by MMC.
* @result
* Returns the status of the operation.
*/
virtual IOReturn splitTrack(UInt32 address);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 0);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 1);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 2);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 3);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 4);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 5);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 6);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 7);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 8);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 9);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 10);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 11);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 12);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 13);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 14);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 15);
};
#endif /* !_IOBDBLOCKSTORAGEDRIVER_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOPartitionScheme.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
* @header IOPartitionScheme
* @abstract
* This header contains the IOPartitionScheme class definition.
*/
#ifndef _IOPARTITIONSCHEME_H
#define _IOPARTITIONSCHEME_H
/*!
* @defined kIOPartitionSchemeClass
* @abstract
* The name of the IOPartitionScheme class.
* @discussion
* kIOPartitionSchemeClass is the name of the IOPartitionScheme class.
*/
#define kIOPartitionSchemeClass "IOPartitionScheme"
/*!
* @defined kIOMediaBaseKey
* @abstract
* A property of IOMedia objects.
* @discussion
* The kIOMediaBaseKey property has an OSNumber value and is placed into an
* IOMedia instance created via the partition scheme. It describes the byte
* offset of the partition relative to the provider media.
*/
#define kIOMediaBaseKey "Base"
/*!
* @defined kIOMediaLiveKey
* @abstract
* A property of IOMedia objects.
* @discussion
* The kIOMediaLiveKey property has an OSBoolean
* value and is placed into an IOMedia instance
* created via the partition scheme. It describes whether the
* partition is live, that is, it is up-to-date with respect
* to the on-disk partition table.
*/
#define kIOMediaLiveKey "Live"
/*!
* @defined kIOMediaPartitionIDKey
* @abstract
* A property of IOMedia objects.
* @discussion
* The kIOMediaPartitionIDKey property has an OSNumber
* value and is placed into an IOMedia instance
* created via the partition scheme. It is an ID that differentiates one
* partition from the other (within a given scheme). It is typically an index
* into the on-disk partition table.
*/
#define kIOMediaPartitionIDKey "Partition ID"
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/storage/IOMedia.h>
#include <IOKit/storage/IOStorage.h>
/*!
* @class IOPartitionScheme
* @abstract
* The common base class for all partition scheme
* objects.
* @discussion
* The IOPartitionScheme class is the common base class for all partition scheme
* objects. It extends the IOStorage class by implementing the appropriate open
* and close semantics for partition objects (standard semantics are to act as a
* multiplexor for incoming opens, producing one outgoing open with the correct
* access). It also implements the default read and write semantics, which pass
* all reads and writes through to the provider media unprocessed. For simple
* schemes, the default behavior is sufficient. More complex partition schemes
* such as RAID will want to do extra processing for reads and writes.
*/
class __exported IOPartitionScheme : public IOStorage
{
OSDeclareDefaultStructors(IOPartitionScheme);
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
IOStorageAccess _openLevel;
OSSet * _openReaders;
OSSet * _openReaderWriters;
/*
* Free all of this object's outstanding resources.
*/
virtual void free() APPLE_KEXT_OVERRIDE;
/*!
* @function handleOpen
* @discussion
* The handleOpen method grants or denies permission to access this object
* to an interested client. The argument is an IOStorageAccess value that
* specifies the level of access desired -- reader or reader-writer.
*
* This method can be invoked to upgrade or downgrade the access level for
* an existing client as well. The previous access level will prevail for
* upgrades that fail, of course. A downgrade should never fail. If the
* new access level should be the same as the old for a given client, this
* method will do nothing and return success. In all cases, one, singular
* close-per-client is expected for all opens-per-client received.
*
* This implementation replaces the IOService definition of handleOpen().
* @param client
* Client requesting the open.
* @param options
* Options for the open. Set to zero.
* @param access
* Access level for the open. Set to kIOStorageAccessReader or
* kIOStorageAccessReaderWriter.
* @result
* Returns true if the open was successful, false otherwise.
*/
virtual bool handleOpen(IOService * client,
IOOptionBits options,
void * access) APPLE_KEXT_OVERRIDE;
/*!
* @function handleIsOpen
* @discussion
* The handleIsOpen method determines whether the specified client, or any
* client if none is specified, presently has an open on this object.
*
* This implementation replaces the IOService definition of handleIsOpen().
* @param client
* Client to check the open state of. Set to zero to check the open state
* of all clients.
* @result
* Returns true if the client was (or clients were) open, false otherwise.
*/
virtual bool handleIsOpen(const IOService * client) const APPLE_KEXT_OVERRIDE;
/*!
* @function handleClose
* @discussion
* The handleClose method closes the client's access to this object.
*
* This implementation replaces the IOService definition of handleClose().
* @param client
* Client requesting the close.
* @param options
* Options for the close. Set to zero.
*/
virtual void handleClose(IOService * client, IOOptionBits options) APPLE_KEXT_OVERRIDE;
/*
* Attach the given media object to the device tree plane.
*/
virtual bool attachMediaObjectToDeviceTree(IOMedia * media);
/*
* Detach the given media object from the device tree plane.
*/
virtual void detachMediaObjectFromDeviceTree(IOMedia * media);
/*
* Updates a set of existing partitions, represented by partitionsOld,
* with possible updates from a rescan of the disk, represented by
* partitionsNew. It returns a new set of partitions with the results,
* removing partitions from partitionsOld where applicable, adding
* partitions from partitionsNew where applicable, and folding in property
* changes to partitions from partitionsNew into partitionsOld where
* applicable.
*/
virtual OSSet * juxtaposeMediaObjects(OSSet * partitionsOld,
OSSet * partitionsNew);
public:
using IOStorage::read;
using IOStorage::write;
/*
* Initialize this object's minimal state.
*/
virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE;
/*!
* @function read
* @discussion
* Read data from the storage object at the specified byte offset into the
* specified buffer, asynchronously. When the read completes, the caller
* will be notified via the specified completion action.
*
* The buffer will be retained for the duration of the read.
*
* For simple partition schemes, the default behavior is to simply pass the
* read through to the provider media. More complex partition schemes such
* as RAID will need to do extra processing here.
* @param client
* Client requesting the read.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
*/
virtual void read(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE;
/*!
* @function write
* @discussion
* Write data into the storage object at the specified byte offset from the
* specified buffer, asynchronously. When the write completes, the caller
* will be notified via the specified completion action.
*
* The buffer will be retained for the duration of the write.
*
* For simple partition schemes, the default behavior is to simply pass the
* write through to the provider media. More complex partition schemes such
* as RAID will need to do extra processing here.
* @param client
* Client requesting the write.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
*/
virtual void write(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE;
/*!
* @function synchronize
* @discussion
* Flush the cached data in the storage object, if any.
* @param client
* Client requesting the synchronization.
* @param byteStart
* Starting byte offset for the synchronization.
* @param byteCount
* Size of the synchronization. Set to zero to specify the end-of-media.
* @param options
* Options for the synchronization. See IOStorageSynchronizeOptions.
* @result
* Returns the status of the synchronization.
*/
virtual IOReturn synchronize(IOService * client,
UInt64 byteStart,
UInt64 byteCount,
IOStorageSynchronizeOptions options = 0) APPLE_KEXT_OVERRIDE;
/*!
* @function unmap
* @discussion
* Delete unused data from the storage object at the specified byte offsets.
* @param client
* Client requesting the operation.
* @param extents
* List of extents. See IOStorageExtent. It is legal for the callee to
* overwrite the contents of this buffer in order to satisfy the request.
* @param extentsCount
* Number of extents.
* @param options
* Options for the unmap. See IOStorageUnmapOptions.
* @result
* Returns the status of the operation.
*/
virtual IOReturn unmap(IOService * client,
IOStorageExtent * extents,
UInt32 extentsCount,
IOStorageUnmapOptions options = 0) APPLE_KEXT_OVERRIDE;
/*!
* @function getProvisionStatus
* @discussion
* Get device block provision status
* @param client
* Client requesting the synchronization.
* @param byteStart
* Byte offset of logical extent on the device.
* @param byteCount
* Byte length of logical extent on the device, 0 mean the entire remaining space.
* @param extentsCount
* Number of extents allocated in extents. On return, this parameter indicate number
* of provision extents returned.
* @param extents
* List of provision extents. See IOStorageProvisionExtents.
* @result
* Returns the status of the getProvisionStatus.
*/
virtual IOReturn getProvisionStatus(IOService * client,
UInt64 byteStart,
UInt64 byteCount,
UInt32 * extentsCount,
IOStorageProvisionExtent * extents,
IOStorageGetProvisionStatusOptions options = 0) APPLE_KEXT_OVERRIDE;
/*!
* @function lockPhysicalExtents
* @discussion
* Lock the contents of the storage object against relocation temporarily,
* for the purpose of getting physical extents.
* @param client
* Client requesting the operation.
* @result
* Returns true if the lock was successful, false otherwise.
*/
virtual bool lockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE;
/*!
* @function copyPhysicalExtent
* @discussion
* Convert the specified byte offset into a physical byte offset, relative
* to a physical storage object. This call should only be made within the
* context of lockPhysicalExtents().
* @param client
* Client requesting the operation.
* @param byteStart
* Starting byte offset for the operation. Returns a physical byte offset,
* relative to the physical storage object, on success.
* @param byteCount
* Size of the operation. Returns the actual number of bytes which can be
* transferred, relative to the physical storage object, on success.
* @result
* A reference to the physical storage object, which should be released by
* the caller, or a null on error.
*/
virtual IOStorage * copyPhysicalExtent(IOService * client,
UInt64 * byteStart,
UInt64 * byteCount) APPLE_KEXT_OVERRIDE;
/*!
* @function unlockPhysicalExtents
* @discussion
* Unlock the contents of the storage object for relocation again. This
* call must balance a successful call to lockPhysicalExtents().
* @param client
* Client requesting the operation.
*/
virtual void unlockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE;
/*!
* @function setPriority
* @discussion
* Reprioritize read or write requests at the specified byte offsets.
* @param client
* Client requesting the operation.
* @param extents
* List of extents. See IOStorageExtent. It is legal for the callee to
* overwrite the contents of this buffer in order to satisfy the request.
* @param extentsCount
* Number of extents.
* @param priority
* New priority. See IOStoragePriority.
* @result
* Returns the status of the operation.
*/
virtual IOReturn setPriority(IOService * client,
IOStorageExtent * extents,
UInt32 extentsCount,
IOStoragePriority priority) APPLE_KEXT_OVERRIDE;
/*
* Obtain this object's provider. We override the superclass's method
* to return a more specific subclass of OSObject -- an IOMedia. This
* method serves simply as a convenience to subclass developers.
*/
virtual IOMedia * getProvider() const APPLE_KEXT_OVERRIDE;
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 0);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 1);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 2);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 3);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 4);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 5);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 6);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 7);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 8);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 9);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 10);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 11);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 12);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 13);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 14);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 15);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 16);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 17);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 18);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 19);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 20);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 21);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 22);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 23);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 24);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 25);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 26);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 27);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 28);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 29);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 30);
OSMetaClassDeclareReservedUnused(IOPartitionScheme, 31);
};
#ifdef KERNEL_PRIVATE
#define kIOPartitionScheme_partition_valid ( ( intptr_t ) 1 )
#define _partitionSchemeState ( *( intptr_t *) &( IOPartitionScheme::_expansionData ) )
#endif /* KERNEL_PRIVATE */
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOPARTITIONSCHEME_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOBDMedia.h | /*
* Copyright (c) 2006-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
* @header IOBDMedia
* @abstract
* This header contains the IOBDMedia class definition.
*/
#ifndef _IOBDMEDIA_H
#define _IOBDMEDIA_H
/*!
* @defined kIOBDMediaClass
* @abstract
* kIOBDMediaClass is the name of the IOBDMedia class.
* @discussion
* kIOBDMediaClass is the name of the IOBDMedia class.
*/
#define kIOBDMediaClass "IOBDMedia"
/*!
* @defined kIOBDMediaTypeKey
* @abstract
* kIOBDMediaTypeKey is a property of IOBDMedia objects. It has an OSString
* value.
* @discussion
* The kIOBDMediaTypeKey property identifies the BD media type (BD-ROM, BD-R,
* BD-RE, etc). See the kIOBDMediaType contants for possible values.
*/
#define kIOBDMediaTypeKey "Type"
/*!
* @defined kIOBDMediaTypeROM
* The kIOBDMediaTypeKey constant for BD-ROM media.
*/
#define kIOBDMediaTypeROM "BD-ROM"
/*!
* @defined kIOBDMediaTypeR
* The kIOBDMediaTypeKey constant for BD-R media.
*/
#define kIOBDMediaTypeR "BD-R"
/*!
* @defined kIOBDMediaTypeRE
* The kIOBDMediaTypeKey constant for BD-RE media.
*/
#define kIOBDMediaTypeRE "BD-RE"
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/storage/IOBDBlockStorageDriver.h>
#include <IOKit/storage/IOMedia.h>
/*!
* @class IOBDMedia
* @abstract
* The IOBDMedia class is a random-access disk device abstraction for BDs.
* @discussion
* The IOBDMedia class is a random-access disk device abstraction for BDs.
*/
class __exported IOBDMedia : public IOMedia
{
OSDeclareDefaultStructors(IOBDMedia)
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
public:
/*
* Obtain this object's provider. We override the superclass's method to
* return a more specific subclass of IOService -- IOBDBlockStorageDriver.
* This method serves simply as a convenience to subclass developers.
*/
virtual IOBDBlockStorageDriver * getProvider() const;
/*
* Compare the properties in the supplied table to this object's properties.
*/
virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score);
/*
* Issue an MMC REPORT KEY command.
* Obsoleted, replaced by this interface.
* virtual IOReturn reportKey( IOMemoryDescriptor * buffer,
* UInt8 keyClass,
* UInt32 address,
* UInt8 blockCount,
* UInt8 grantID,
* UInt8 format );
*/
virtual IOReturn reportKey( IOMemoryDescriptor * buffer,
UInt8 keyClass,
UInt32 address,
UInt8 grantID,
UInt8 format ) __attribute__ ((deprecated));
/*!
* @function sendKey
* @discussion
* Issue an MMC SEND KEY command.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param keyClass
* As documented by MMC.
* @param grantID
* As documented by MMC.
* @param format
* As documented by MMC.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn sendKey( IOMemoryDescriptor * buffer,
UInt8 keyClass,
UInt8 grantID,
UInt8 format );
/*!
* @function readStructure
* @discussion
* Issue an MMC READ DISC STRUCTURE command.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param format
* As documented by MMC.
* @param address
* As documented by MMC.
* @param layer
* As documented by MMC.
* @param grantID
* As documented by MMC.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn readStructure( IOMemoryDescriptor * buffer,
UInt8 format,
UInt32 address,
UInt8 layer,
UInt8 grantID );
/*!
* @function getSpeed
* @discussion
* Get the current speed used for data transfers.
* @param kilobytesPerSecond
* Returns the current speed used for data transfers, in kB/s.
*
* kBDSpeedMin specifies the minimum speed for all BD media (1X).
* kBDSpeedMax specifies the maximum speed supported in hardware.
* @result
* Returns the status of the operation.
*/
virtual IOReturn getSpeed(UInt16 * kilobytesPerSecond);
/*!
* @function setSpeed
* @discussion
* Set the speed to be used for data transfers.
* @param kilobytesPerSecond
* Speed to be used for data transfers, in kB/s.
*
* kBDSpeedMin specifies the minimum speed for all BD media (1X).
* kBDSpeedMax specifies the maximum speed supported in hardware.
* @result
* Returns the status of the operation.
*/
virtual IOReturn setSpeed(UInt16 kilobytesPerSecond);
/*!
* @function readDiscInfo
* @discussion
* Issue an MMC READ DISC INFORMATION command.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param type
* Reserved for future use. Set to zero.
* @param actualByteCount
* Returns the actual number of bytes transferred in the data transfer.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn readDiscInfo( IOMemoryDescriptor * buffer,
UInt8 type,
UInt16 * actualByteCount );
/*!
* @function readTrackInfo
* @discussion
* Issue an MMC READ TRACK INFORMATION command.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param address
* As documented by MMC.
* @param addressType
* As documented by MMC.
* @param open
* Reserved for future use. Set to zero.
* @param actualByteCount
* Returns the actual number of bytes transferred in the data transfer.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn readTrackInfo( IOMemoryDescriptor * buffer,
UInt32 address,
UInt8 addressType,
UInt8 open,
UInt16 * actualByteCount );
/*!
* @function splitTrack
* @discussion
* Issue an MMC RESERVE TRACK command with the ARSV bit.
* @param address
* As documented by MMC.
* @result
* Returns the status of the operation.
*/
virtual IOReturn splitTrack(UInt32 address);
/*!
* @function reportKey
* @discussion
* Issue an MMC REPORT KEY command.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param keyClass
* As documented by MMC.
* @param address
* As documented by MMC.
* @param blockCount
* As documented by MMC.
* @param grantID
* As documented by MMC.
* @param format
* As documented by MMC.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn reportKey( IOMemoryDescriptor * buffer,
UInt8 keyClass,
UInt32 address,
UInt8 blockCount,
UInt8 grantID,
UInt8 format );
OSMetaClassDeclareReservedUsed(IOBDMedia, 0); /* reportKey */
OSMetaClassDeclareReservedUnused(IOBDMedia, 1);
OSMetaClassDeclareReservedUnused(IOBDMedia, 2);
OSMetaClassDeclareReservedUnused(IOBDMedia, 3);
OSMetaClassDeclareReservedUnused(IOBDMedia, 4);
OSMetaClassDeclareReservedUnused(IOBDMedia, 5);
OSMetaClassDeclareReservedUnused(IOBDMedia, 6);
OSMetaClassDeclareReservedUnused(IOBDMedia, 7);
OSMetaClassDeclareReservedUnused(IOBDMedia, 8);
OSMetaClassDeclareReservedUnused(IOBDMedia, 9);
OSMetaClassDeclareReservedUnused(IOBDMedia, 10);
OSMetaClassDeclareReservedUnused(IOBDMedia, 11);
OSMetaClassDeclareReservedUnused(IOBDMedia, 12);
OSMetaClassDeclareReservedUnused(IOBDMedia, 13);
OSMetaClassDeclareReservedUnused(IOBDMedia, 14);
OSMetaClassDeclareReservedUnused(IOBDMedia, 15);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOBDMEDIA_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOFilterScheme.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
* @header IOFilterScheme
* @abstract
* This header contains the IOFilterScheme class definition.
*/
#ifndef _IOFILTERSCHEME_H
#define _IOFILTERSCHEME_H
/*!
* @defined kIOFilterSchemeClass
* @abstract
* The name of the IOFilterScheme class.
* @discussion
* kIOFilterSchemeClass is the name of the IOFilterScheme class.
*/
#define kIOFilterSchemeClass "IOFilterScheme"
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/storage/IOMedia.h>
#include <IOKit/storage/IOStorage.h>
/*!
* @class IOFilterScheme
* @abstract
* The common base class for all filter scheme
* objects.
* @discussion
* The IOFilterScheme class is the common base class for all filter scheme
* objects. It extends the IOStorage class by implementing the appropriate
* open and close semantics for filter objects (standard semantics are act
* as a relay for incoming opens, producing one outgoing open for each
* incoming open). It also implements the default read and write semantics,
* which pass all reads and writes through to the provider media unprocessed.
* For simple schemes, the default behavior is sufficient. More complex
* filter schemes such as RAID will want to do extra processing for reads
* and writes.
*/
class __exported IOFilterScheme : public IOStorage
{
OSDeclareDefaultStructors(IOFilterScheme);
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
/*!
* @function handleOpen
* @discussion
* The handleOpen method grants or denies permission to access this object
* to an interested client. The argument is an IOStorageAccess value that
* specifies the level of access desired -- reader or reader-writer.
*
* This method can be invoked to upgrade or downgrade the access level for
* an existing client as well. The previous access level will prevail for
* upgrades that fail, of course. A downgrade should never fail. If the
* new access level should be the same as the old for a given client, this
* method will do nothing and return success. In all cases, one, singular
* close-per-client is expected for all opens-per-client received.
*
* This implementation replaces the IOService definition of handleOpen().
* @param client
* Client requesting the open.
* @param options
* Options for the open. Set to zero.
* @param access
* Access level for the open. Set to kIOStorageAccessReader or
* kIOStorageAccessReaderWriter.
* @result
* Returns true if the open was successful, false otherwise.
*/
virtual bool handleOpen(IOService * client,
IOOptionBits options,
void * access) APPLE_KEXT_OVERRIDE;
/*!
* @function handleIsOpen
* @discussion
* The handleIsOpen method determines whether the specified client, or any
* client if none is specified, presently has an open on this object.
*
* This implementation replaces the IOService definition of handleIsOpen().
* @param client
* Client to check the open state of. Set to zero to check the open state
* of all clients.
* @result
* Returns true if the client was (or clients were) open, false otherwise.
*/
virtual bool handleIsOpen(const IOService * client) const APPLE_KEXT_OVERRIDE;
/*!
* @function handleClose
* @discussion
* The handleClose method closes the client's access to this object.
*
* This implementation replaces the IOService definition of handleClose().
* @param client
* Client requesting the close.
* @param options
* Options for the close. Set to zero.
*/
virtual void handleClose(IOService * client, IOOptionBits options) APPLE_KEXT_OVERRIDE;
public:
using IOStorage::read;
using IOStorage::write;
/*!
* @function read
* @discussion
* Read data from the storage object at the specified byte offset into the
* specified buffer, asynchronously. When the read completes, the caller
* will be notified via the specified completion action.
*
* The buffer will be retained for the duration of the read.
*
* For simple filter schemes, the default behavior is to simply pass the
* read through to the provider media. More complex filter schemes such
* as RAID will need to do extra processing here.
* @param client
* Client requesting the read.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
*/
virtual void read(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE;
/*!
* @function write
* @discussion
* Write data into the storage object at the specified byte offset from the
* specified buffer, asynchronously. When the write completes, the caller
* will be notified via the specified completion action.
*
* The buffer will be retained for the duration of the write.
*
* For simple filter schemes, the default behavior is to simply pass the
* write through to the provider media. More complex filter schemes such
* as RAID will need to do extra processing here.
* @param client
* Client requesting the write.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
*/
virtual void write(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE;
/*!
* @function synchronize
* @discussion
* Flush the cached data in the storage object, if any.
* @param client
* Client requesting the synchronization.
* @param byteStart
* Starting byte offset for the synchronization.
* @param byteCount
* Size of the synchronization. Set to zero to specify the end-of-media.
* @param options
* Options for the synchronization. See IOStorageSynchronizeOptions.
* @result
* Returns the status of the synchronization.
*/
virtual IOReturn synchronize(IOService * client,
UInt64 byteStart,
UInt64 byteCount,
IOStorageSynchronizeOptions options = 0) APPLE_KEXT_OVERRIDE;
/*!
* @function unmap
* @discussion
* Delete unused data from the storage object at the specified byte offsets.
* @param client
* Client requesting the operation.
* @param extents
* List of extents. See IOStorageExtent. It is legal for the callee to
* overwrite the contents of this buffer in order to satisfy the request.
* @param extentsCount
* Number of extents.
* @param options
* Options for the unmap. See IOStorageUnmapOptions.
* @result
* Returns the status of the operation.
*/
virtual IOReturn unmap(IOService * client,
IOStorageExtent * extents,
UInt32 extentsCount,
IOStorageUnmapOptions options = 0) APPLE_KEXT_OVERRIDE;
/*!
* @function getProvisionStatus
* @discussion
* Get device block provision status
* @param client
* Client requesting the synchronization.
* @param byteStart
* Byte offset of logical extent on the device.
* @param byteCount
* Byte length of logical extent on the device, 0 mean the entire remaining space.
* @param extentsCount
* Number of extents allocated in extents. On return, this parameter indicate number
* of provision extents returned.
* @param extents
* List of provision extents. See IOStorageProvisionExtents.
* @result
* Returns the status of the getProvisionStatus.
*/
virtual IOReturn getProvisionStatus(IOService * client,
UInt64 byteStart,
UInt64 byteCount,
UInt32 * extentsCount,
IOStorageProvisionExtent * extents,
IOStorageGetProvisionStatusOptions options = 0) APPLE_KEXT_OVERRIDE;
/*!
* @function lockPhysicalExtents
* @discussion
* Lock the contents of the storage object against relocation temporarily,
* for the purpose of getting physical extents.
* @param client
* Client requesting the operation.
* @result
* Returns true if the lock was successful, false otherwise.
*/
virtual bool lockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE;
/*!
* @function copyPhysicalExtent
* @discussion
* Convert the specified byte offset into a physical byte offset, relative
* to a physical storage object. This call should only be made within the
* context of lockPhysicalExtents().
* @param client
* Client requesting the operation.
* @param byteStart
* Starting byte offset for the operation. Returns a physical byte offset,
* relative to the physical storage object, on success.
* @param byteCount
* Size of the operation. Returns the actual number of bytes which can be
* transferred, relative to the physical storage object, on success.
* @result
* A reference to the physical storage object, which should be released by
* the caller, or a null on error.
*/
virtual IOStorage * copyPhysicalExtent(IOService * client,
UInt64 * byteStart,
UInt64 * byteCount) APPLE_KEXT_OVERRIDE;
/*!
* @function unlockPhysicalExtents
* @discussion
* Unlock the contents of the storage object for relocation again. This
* call must balance a successful call to lockPhysicalExtents().
* @param client
* Client requesting the operation.
*/
virtual void unlockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE;
/*!
* @function setPriority
* @discussion
* Reprioritize read or write requests at the specified byte offsets.
* @param client
* Client requesting the operation.
* @param extents
* List of extents. See IOStorageExtent. It is legal for the callee to
* overwrite the contents of this buffer in order to satisfy the request.
* @param extentsCount
* Number of extents.
* @param priority
* New priority. See IOStoragePriority.
* @result
* Returns the status of the operation.
*/
virtual IOReturn setPriority(IOService * client,
IOStorageExtent * extents,
UInt32 extentsCount,
IOStoragePriority priority) APPLE_KEXT_OVERRIDE;
/*
* Obtain this object's provider. We override the superclass's method
* to return a more specific subclass of OSObject -- an IOMedia. This
* method serves simply as a convenience to subclass developers.
*/
virtual IOMedia * getProvider() const APPLE_KEXT_OVERRIDE;
OSMetaClassDeclareReservedUnused(IOFilterScheme, 0);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 1);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 2);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 3);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 4);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 5);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 6);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 7);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 8);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 9);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 10);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 11);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 12);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 13);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 14);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 15);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 16);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 17);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 18);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 19);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 20);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 21);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 22);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 23);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 24);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 25);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 26);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 27);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 28);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 29);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 30);
OSMetaClassDeclareReservedUnused(IOFilterScheme, 31);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOFILTERSCHEME_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOAppleLabelScheme.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* This header contains the IOAppleLabelScheme class definition.
*/
#ifndef _IOAPPLELABELSCHEME_H
#define _IOAPPLELABELSCHEME_H
#include <IOKit/IOTypes.h>
/*
* kIOAppleLabelSchemeClass is the name of the IOAppleLabelScheme class.
*/
#define kIOAppleLabelSchemeClass "IOAppleLabelScheme"
/*
* Apple Label Scheme Definitions
*/
#pragma pack(push, 1) /* (enable 8-bit struct packing) */
/* Label scheme. */
struct applelabel
{
uint8_t al_boot0[416]; /* (reserved for boot area) */
uint16_t al_magic; /* (the magic number) */
uint16_t al_type; /* (label type) */
uint32_t al_flags; /* (generic flags) */
uint64_t al_offset; /* (offset of property area, bytes) */
uint32_t al_size; /* (size of property area, bytes) */
uint32_t al_checksum; /* (checksum of property area) */
uint8_t al_boot1[72]; /* (reserved for boot area) */
};
/* Label scheme signature (al_magic). */
#define AL_MAGIC 0x414C
/* Label scheme version (al_type). */
#define AL_TYPE_DEFAULT 0x0000
/* Label scheme flags (al_flags). */
#define AL_FLAG_DEFAULT 0x00000000
#pragma pack(pop) /* (reset to default struct packing) */
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/storage/IOFilterScheme.h>
/*
* Class
*/
class __exported IOAppleLabelScheme : public IOFilterScheme
{
OSDeclareDefaultStructors(IOAppleLabelScheme);
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
IOMedia * _content;
/*
* Free all of this object's outstanding resources.
*/
virtual void free(void) APPLE_KEXT_OVERRIDE;
/*
* Scan the provider media for an Apple label scheme.
*/
virtual IOMedia * scan(SInt32 * score);
/*
* Ask whether the given content appears to be corrupt.
*/
virtual bool isContentCorrupt(OSDictionary * properties);
/*
* Ask whether the given content appears to be invalid.
*/
virtual bool isContentInvalid(OSDictionary * properties);
/*
* Instantiate a new media object to represent the given content.
*/
virtual IOMedia * instantiateMediaObject(OSDictionary * properties);
/*
* Allocate a new media object (called from instantiateMediaObject).
*/
virtual IOMedia * instantiateDesiredMediaObject(OSDictionary * properties);
/*
* Attach the given media object to the device tree plane.
*/
virtual bool attachMediaObjectToDeviceTree(IOMedia * media);
/*
* Detach the given media object from the device tree plane.
*/
virtual void detachMediaObjectFromDeviceTree(IOMedia * media);
public:
/*
* Initialize this object's minimal state.
*/
virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE;
/*
* Determine whether the provider media contains an Apple label scheme.
*/
virtual IOService * probe(IOService * provider, SInt32 * score) APPLE_KEXT_OVERRIDE;
/*
* Publish the new media object which represents our content.
*/
virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE;
/*
* Clean up after the media object we published before terminating.
*/
virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE;
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 0);
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 1);
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 2);
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 3);
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 4);
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 5);
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 6);
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 7);
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 8);
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 9);
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 10);
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 11);
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 12);
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 13);
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 14);
OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 15);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOAPPLELABELSCHEME_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOBlockStorageDevice.h | /*
* Copyright (c) 1998-2015 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
* @header IOBlockStorageDevice
* @abstract
* This header contains the IOBlockStorageDevice class definition.
*/
#ifndef _IOBLOCKSTORAGEDEVICE_H
#define _IOBLOCKSTORAGEDEVICE_H
#include <IOKit/IOTypes.h>
#include <IOKit/storage/IOStorageDeviceCharacteristics.h>
/*!
* @defined kIOBlockStorageDeviceClass
* @abstract
* The name of the IOBlockStorageDevice class.
*/
#define kIOBlockStorageDeviceClass "IOBlockStorageDevice"
/*!
* @defined kIOBlockStorageDeviceWriteCacheStateKey
* @abstract
* The name of the property used to get or set the write cache state of the
* block storage device.
*/
#define kIOBlockStorageDeviceWriteCacheStateKey "WriteCacheState"
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/IOMemoryDescriptor.h>
#include <IOKit/IOMessage.h>
#include <IOKit/IOService.h>
#include <IOKit/storage/IOMedia.h>
/*!
* @defined kIOMessageMediaParametersHaveChanged
* @abstract
* The message ID which indicates that the media parameters, such as the highest valid block
* for the device, have changed.
* @discussion
* The message is passed to all clients of the IOBlockStorageDevice via the message() method.
*/
#define kIOMessageMediaParametersHaveChanged iokit_family_msg(sub_iokit_block_storage, 2)
/*!
* @defined kIOMessageMediaStateHasChanged
* @abstract
* The message ID which indicates that the media state has changed.
* @discussion
* The message is passed to all clients of the IOBlockStorageDevice via the message() method.
* The argument that is passed along with this message is an IOMediaState value.
*/
#define kIOMessageMediaStateHasChanged iokit_family_msg(sub_iokit_block_storage, 1)
/* Property used for matching, so the generic driver gets the nub it wants. */
/*!
* @defined kIOBlockStorageDeviceTypeKey
* @abstract The name of the property tested for nub type matching by the generic block
* storage driver.
*/
#define kIOBlockStorageDeviceTypeKey "device-type"
/*!
* @defined kIOBlockStorageDeviceTypeGeneric
* @abstract A character string used for nub matching.
*/
#define kIOBlockStorageDeviceTypeGeneric "Generic"
/*!
* @defined kIOBlockStorageDeviceTDMLocked
* @abstract A boolean property to tell if device is connected through TDM, and not
* authenticated yet
*/
#define kIOBlockStorageDeviceTDMLocked "AppleTDMLocked"
/*!
* @struct IOBlockStorageDeviceExtent
* @abstract
* Extent for unmap storage requests.
* @field blockStart
* The starting block number of the operation.
* @field blockCount
* The integral number of blocks to be deleted.
*/
struct IOBlockStorageDeviceExtent
{
UInt64 blockStart;
UInt64 blockCount;
};
/*!
* @struct IOBlockStorageProvisionDeviceExtent
* @discussion
* Extent for provision status.
* @field blockStart
* Starting block offset for the operation.
* @field blockCount
* Size of the operation.
* @field provisionType
* Block provision type, such as mapped, deallocated, or anchared. See
* IOStorageProvisionTypes
*/
struct IOBlockStorageProvisionDeviceExtent
{
UInt64 blockStart;
UInt64 blockCount;
UInt8 provisionType;
UInt8 reserved[7];
};
/*!
* @class
* IOBlockStorageDevice
* @abstract
* A generic block storage device abstraction.
* @discussion
* The IOBlockStorageDevice class exports the generic block storage protocol,
* independent of the physical connection protocol (e.g. SCSI, ATA, USB),
* forwarding all requests to its provider (the Transport Driver).
* Though the nub does no actual processing of requests, it is necessary
* in a C++ environment. The Transport Driver can be of any type, as
* long as it inherits from IOService. Because Transport Drivers needn't
* derive from a type known to IOBlockStorageDriver, it isn't possible for
* IOBlockStorageDriver to include the appropriate header file to allow direct
* communication with the Transport Driver. Thus we achieve polymorphism by
* having the Transport Driver instantiate a subclass of IOBlockStorageDevice.
* A typical implementation for a concrete subclass of IOBlockStorageDevice
* simply relays all methods to its provider (the Transport Driver), which
* implements the protocol- and device-specific behavior.
*
* All pure-virtual functions must be implemented by the Transport Driver, which
* is responsible for instantiating the Nub.
*/
class __exported IOBlockStorageDevice : public IOService {
OSDeclareAbstractStructors(IOBlockStorageDevice)
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
public:
/* Overrides from IORegistryEntry */
using IORegistryEntry::getProperty;
/*!
* @function init
* @discussion
* This function is overridden so that IOBlockStorageDevice can set a
* property, used by IOBlockStorageDriver for matching. Since the concrete
* subclass of IOBlockStorageDevice can be of any class type, the property
* is used for matching.
*
* This function is usually not overridden by developers.
*/
virtual bool init(OSDictionary * properties) APPLE_KEXT_OVERRIDE;
virtual OSObject * getProperty(const OSSymbol * key) const APPLE_KEXT_OVERRIDE;
virtual IOReturn setProperties(OSObject * properties) APPLE_KEXT_OVERRIDE;
/* --- A subclass must implement the the following methods: --- */
/*!
* @function doEjectMedia
* @abstract
* Eject the media.
*/
virtual IOReturn doEjectMedia(void) = 0;
/*!
* @function doFormatMedia
* @abstract
* Format the media to the specified byte capacity.
* @discussion
* The specified byte capacity must be one supported by the device.
* Supported capacities can be obtained by calling doGetFormatCapacities.
* @param byteCapacity
* The byte capacity to which the device is to be formatted, if possible.
*/
virtual IOReturn doFormatMedia(UInt64 byteCapacity) = 0;
/*!
* @function doGetFormatCapacities
* @abstract
* Return the allowable formatting byte capacities.
* @discussion
* This function returns the supported byte capacities for the device.
* @param capacities
* Pointer for returning the list of capacities.
* @param capacitiesMaxCount
* The number of capacity values returned in "capacities," or if no buffer
* is given, the total number of capacity values available.
*/
virtual UInt32 doGetFormatCapacities(UInt64 * capacities,
UInt32 capacitiesMaxCount) const = 0;
#if TARGET_OS_OSX
virtual IOReturn doLockUnlockMedia(bool doLock) __attribute__ ((deprecated));
#endif /* TARGET_OS_OSX */
virtual IOReturn doSynchronizeCache(void) __attribute__ ((deprecated));
/*!
* @function getVendorString
* @abstract
* Return Vendor Name string for the device.
* @result
* A pointer to a static character string.
*/
virtual char * getVendorString(void) = 0;
/*!
* @function getProductString
* @abstract
* Return Product Name string for the device.
* @result
* A pointer to a static character string.
*/
virtual char * getProductString(void) = 0;
/*!
* @function getRevisionString
* @abstract
* Return Product Revision string for the device.
* @result
* A pointer to a static character string.
*/
virtual char * getRevisionString(void) = 0;
/*!
* @function getAdditionalDeviceInfoString
* @abstract
* Return additional informational string for the device.
* @result
* A pointer to a static character string.
*/
virtual char * getAdditionalDeviceInfoString(void) = 0;
/*!
* @function reportBlockSize
* @abstract
* Report the block size for the device, in bytes.
* @param blockSize
* Pointer to returned block size value.
*/
virtual IOReturn reportBlockSize(UInt64 *blockSize) = 0;
/*!
* @function reportEjectability
* @abstract
* Report if the media is ejectable under software control.
* @discussion
* This method should only be called if the media is known to be removable.
* @param isEjectable
* Pointer to returned result. True indicates the media is ejectable, False indicates
* the media cannot be ejected under software control.
*/
virtual IOReturn reportEjectability(bool *isEjectable) = 0;
#if TARGET_OS_OSX
virtual IOReturn reportLockability(bool *isLockable) __attribute__ ((deprecated));
#endif /* TARGET_OS_OSX */
/*!
* @function reportMaxValidBlock
* @abstract
* Report the highest valid block for the device.
* @param maxBlock
* Pointer to returned result
*/
virtual IOReturn reportMaxValidBlock(UInt64 *maxBlock) = 0;
/*!
* @function reportMediaState
* @abstract
* Report the device's media state.
* @discussion
* This method reports whether we have media in the drive or not, and
* whether the state has changed from the previously reported state.
*
* A result of kIOReturnSuccess is always returned if the test for media is successful,
* regardless of media presence. The mediaPresent result should be used to determine
* whether media is present or not. A return other than kIOReturnSuccess indicates that
* the Transport Driver was unable to interrogate the device. In this error case, the
* outputs mediaState and changedState will *not* be stored.
* @param mediaPresent Pointer to returned media state. True indicates media is present
* in the device; False indicates no media is present.
*/
virtual IOReturn reportMediaState(bool *mediaPresent,bool *changedState = 0) = 0;
#if TARGET_OS_OSX
virtual IOReturn reportPollRequirements(bool *pollRequired,
bool *pollIsExpensive) __attribute__ ((deprecated));
#endif /* TARGET_OS_OSX */
/*!
* @function reportRemovability
* @abstract
* Report whether the media is removable or not.
* @discussion
* This method reports whether the media is removable, but it does not
* provide detailed information regarding software eject or lock/unlock capability.
* @param isRemovable
* Pointer to returned result. True indicates that the media is removable; False
* indicates the media is not removable.
*/
virtual IOReturn reportRemovability(bool *isRemovable) = 0;
/*!
* @function reportWriteProtection
* @abstract
* Report whether the media is write-protected or not.
* @param isWriteProtected
* Pointer to returned result. True indicates that the media is write-protected (it
* cannot be written); False indicates that the media is not write-protected (it
* is permissible to write).
*/
virtual IOReturn reportWriteProtection(bool *isWriteProtected) = 0;
/*!
* @function getWriteCacheState
* @abstract
* Reports the current write cache state of the device.
* @discussion
* Reports the current write cache state of the device. The write cache
* state is not guaranteed to persist across reboots and detaches.
* @param enabled
* Pointer to returned result. True indicates the write cache is enabled;
* False indicates the write cache is disabled.
*/
virtual IOReturn getWriteCacheState(bool *enabled);
/*!
* @function setWriteCacheState
* @abstract
* Sets the write cache state of the device.
* @discussion
* Sets the write cache state of the device. The write cache state
* is not guaranteed to persist across reboots and detaches.
* @param enabled
* True to enable the write cache; False to disable the write cache.
*/
virtual IOReturn setWriteCacheState(bool enabled);
/*!
* @function doAsyncReadWrite
* @abstract
* Start an asynchronous read or write operation.
* @param buffer
* An IOMemoryDescriptor describing the data-transfer buffer. The data direction
* is contained in the IOMemoryDescriptor. Responsibility for releasing the descriptor
* rests with the caller.
* @param block
* The starting block number of the data transfer.
* @param nblks
* The integral number of blocks to be transferred.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes.
* @param completion
* The completion routine to call once the data transfer is complete.
*/
virtual IOReturn doAsyncReadWrite(IOMemoryDescriptor *buffer,
UInt64 block, UInt64 nblks,
IOStorageAttributes *attributes,
IOStorageCompletion *completion) = 0;
/*!
* @function requestIdle
* @abstract
* Request that the device enter an idle state.
* @discussion
* Request that the device enter an idle state. The device will exit this state on the
* next read or write request, or as it sees necessary. One example is for a DVD drive
* to spin down when it enters such an idle state, and spin up on the next read request
* from the system.
*/
virtual IOReturn requestIdle(void);
#if TARGET_OS_OSX
virtual IOReturn doDiscard(UInt64 block, UInt64 nblks) __attribute__ ((deprecated));
#endif /* TARGET_OS_OSX */
/*!
* @function doUnmap
* @abstract
* Delete unused data blocks from the media.
* @param extents
* List of extents. See IOBlockStorageDeviceExtent. It is legal for the callee to
* overwrite the contents of this buffer in order to satisfy the request.
* @param extentsCount
* Number of extents.
* @param options
* Options for the unmap. See IOStorageUnmapOptions.
*/
virtual IOReturn doUnmap(IOBlockStorageDeviceExtent * extents,
UInt32 extentsCount,
IOStorageUnmapOptions options = 0); /* 10.6.6 */
/*!
* @function doSetPriority
* @abstract
* Reprioritize read or write operations.
* @param extents
* List of extents. See IOBlockStorageDeviceExtent. It is legal for the callee to
* overwrite the contents of this buffer in order to satisfy the request.
* @param extentsCount
* Number of extents.
* @param priority
* New priority. See IOStoragePriority.
*/
virtual IOReturn doSetPriority(IOBlockStorageDeviceExtent * extents,
UInt32 extentsCount,
IOStoragePriority priority); /* 10.10.0 */
/*!
* @function doSynchronize
* @abstract
* Force data blocks in the hardware's buffer to be flushed to the media.
* @discussion
* This method should only be called if the media is writable.
* @param block
* The starting block number of the synchronization.
* @param nblks
* The integral number of blocks to be synchronized. Set to zero to specify the
* end-of-media.
* @param options
* Options for the synchronization. See IOStorageSynchronizeOptions.
*/
virtual IOReturn doSynchronize(UInt64 block,
UInt64 nblks,
IOStorageSynchronizeOptions options = 0); /* 10.11.0 */
/*!
* @function doGetProvisionStatus
* @discussion
* Get device block provision status
* @param block
* Block offset of logical extent on the device.
* @param nblks
* Blocks count of logical extent on the device.
* @param extentsCount
* Number of extents allocated in extents. On return, this parameter indicate number
* of provision extents returned.
* @param extents
* List of provision extents, block based. See IOStorageProvisionDeviceExtents.
* @param options
* Options for get provision status. See IOStorageGetProvisionStatusOptions.
* @result
* Returns the status of the getProvisionStatus.
*/
virtual IOReturn doGetProvisionStatus(UInt64 block,
UInt64 nblks,
UInt32 * extentsCount,
IOBlockStorageProvisionDeviceExtent * extents,
IOStorageGetProvisionStatusOptions options = 0); /* 10.12.0 */
OSMetaClassDeclareReservedUsed(IOBlockStorageDevice, 0);
OSMetaClassDeclareReservedUsed(IOBlockStorageDevice, 1);
OSMetaClassDeclareReservedUsed(IOBlockStorageDevice, 2);
OSMetaClassDeclareReservedUsed(IOBlockStorageDevice, 3);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 4);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 5);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 6);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 7);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 8);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 9);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 10);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 11);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 12);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 13);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 14);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 15);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 16);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 17);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 18);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 19);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 20);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 21);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 22);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 23);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 24);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 25);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 26);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 27);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 28);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 29);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 30);
OSMetaClassDeclareReservedUnused(IOBlockStorageDevice, 31);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOBLOCKSTORAGEDEVICE_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOStorageCardCharacteristics.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IO_STORAGE_CARD_CHARACTERISTICS_H_
#define _IOKIT_IO_STORAGE_CARD_CHARACTERISTICS_H_
/*
* Card Characteristics - Characteristics defined for cards.
*/
/*!
@defined kIOPropertyCardCharacteristicsKey
@discussion This key is used to define Card Characteristics for a particular
piece of MMC/SD media and it has an associated dictionary which lists the
card characteristics.
Requirement: Mandatory
Example:
<pre>
@textblock
<dict>
<key>Card Characteristics</key>
<dict>
<key>Product Name</key>
<string>SD32G</string>
<key>Product Revision Level</key>
<string>1.0</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyCardCharacteristicsKey "Card Characteristics"
/*!
@defined kIOPropertySlotKey
@discussion This key is used to define the slot number for the device
Requirement: Mandatory
Example:
<pre>
@textblock
<dict>
<key>Slot</key>
<integer>1<integer>
</dict>
@/textblock
</pre>
*/
#define kIOPropertySlotKey "Slot"
/*!
@defined kIOProperty64BitKey
@discussion This key defines wether the device supports 64-bit.
Requirement: Mandatory
Example:
<pre>
@textblock
<dict>
<key>64-bit</key>
<true/>
</dict>
@/textblock
</pre>
*/
#define kIOProperty64BitKey "64-bit"
/*!
@defined kIOPropertyClockDivisorKey
@discussion This key defines the current clock divisor for the device.
Requirement: Mandatory.
Example:
<pre>
@textblock
<dict>
<key>Clock Divisor</key>
<integer>128</integer>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyClockDivisorKey "Clock Divisor"
/*!
@defined kIOPropertyBaseFrequencyKey
@discussion This key defines the current base frequency for the device.
Requirement: Mandatory.
Example:
<pre>
@textblock
<dict>
<key>Base Frequency</key>
<integer>50</integer>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyBaseFrequencyKey "Base Frequency"
/*!
@defined kIOPropertyBusVoltageKey
@discussion This key defines the current bus voltage for the device in mV
Requirement: Mandatory.
Example:
<pre>
@textblock
<dict>
<key>Bus Voltage</key>
<integer>3300</integer>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyBusVoltageKey "Bus Voltage"
/*!
@defined kIOPropertyBusWidthKey
@discussion This key defines the current bus width for the device.
Requirement: Mandatory.
Example:
<pre>
@textblock
<dict>
<key>Bus Width</key>
<integer>4</integer>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyBusWidthKey "Bus Width"
/*!
@defined kIOPropertyCardPresentKey
@discussion This key defines wether a MMC or SD card is physically present.
Requirement: Mandatory
Example:
<pre>
@textblock
<dict>
<key>Card Present</key>
<true/>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyCardPresentKey "Card Present"
/*!
@defined kIOPropertyProductSerialNumberKey
@discussion This key is used to indicate the card serial number ID.
Requirement: Mandatory
Example:
<pre>
@textblock
<dict>
<key>Card Characteristics</key>
<dict>
<key>Product Name</key>
<string>SD32G</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Card Type</key>
<string>SDHC</string>
<key>Serial Number</key>
<data>0045ff</data>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyProductSerialNumberKey "Serial Number"
/*!
@defined kIOPropertyManufacturerIDKey
@discussion This key is used to indicate the card manufacturer ID.
Requirement: Optional
Example:
<pre>
@textblock
<dict>
<key>Card Characteristics</key>
<dict>
<key>Product Name</key>
<string>SD32G</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Card Type</key>
<string>SDHC</string>
<key>Manufacturer ID</key>
<data>03</data>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyManufacturerIDKey "Manufacturer ID"
/*!
@defined kIOPropertyApplicationIDKey
@discussion This key is used to indicate the card application ID.
Requirement: Optional
Example:
<pre>
@textblock
<dict>
<key>Card Characteristics</key>
<dict>
<key>Product Name</key>
<string>SD32G</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Card Type</key>
<string>SDHC</string>
<key>Application ID</key>
<data>ffff</data>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyApplicationIDKey "Application ID"
/*!
@defined kIOPropertyManufacturingDateKey
@discussion This key is used to indicate the card manufacturing date.
Requirement: Mandatory.
Example:
<pre>
@textblock
<dict>
<key>Card Characteristics</key>
<dict>
<key>Product Name</key>
<string>SD32G</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Card Type</key>
<string>SDHC</string>
<key>Manufacturing Date</key>
<string>2009-12</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyManufacturingDateKey "Manufacturing Date"
/*!
@defined kIOPropertySpeedClassKey
@discussion This key is used to indicate SD card speed class.
Requirement: Mandatory.
Example:
<pre>
@textblock
<dict>
<key>Card Characteristics</key>
<dict>
<key>Product Name</key>
<string>SD32G</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Card Type</key>
<string>SDHC</string>
<key>Speed Class</key>
<data>02</data>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertySpeedClassKey "Speed Class"
/*!
@defined kIOPropertySpecificationVersionKey
@discussion This key is used to indicate the card specification version.
Requirement: Mandatory.
Example:
<pre>
@textblock
<dict>
<key>Card Characteristics</key>
<dict>
<key>Product Name</key>
<string>SD32G</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Card Type</key>
<string>SDHC</string>
<key>Specification Version</key>
<string>3.0</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertySpecificationVersionKey "Specification Version"
/*!
@defined kIOPropertyCardTypeKey
@discussion This key is used to indicate the card type is MMC.
Requirement: Optional.
Example:
<pre>
@textblock
<dict>
<key>Card Characteristics</key>
<dict>
<key>Product Name</key>
<string>SD32G</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Card Type</key>
<string>MMC</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyCardTypeKey "Card Type"
/*!
@defined kIOPropertyCardTypeMMCKey
@discussion This key is used to indicate the card type is MMC.
Requirement: Optional.
Example:
<pre>
@textblock
<dict>
<key>Card Characteristics</key>
<dict>
<key>Product Name</key>
<string>SD32G</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Card Type</key>
<string>MMC</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyCardTypeMMCKey "MMC"
/*!
@defined kIOPropertyCardTypeSDSCKey
@discussion This key is used to indicate the card type is SDSC.
Requirement: Optional.
Example:
<pre>
@textblock
<dict>
<key>Card Characteristics</key>
<dict>
<key>Product Name</key>
<string>SD32G</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Card Type</key>
<string>SDSC</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyCardTypeSDSCKey "SDSC"
/*!
@defined kIOPropertyCardTypeSDHCKey
@discussion This key is used to indicate the card type is SDHC.
Requirement: Optional.
Example:
<pre>
@textblock
<dict>
<key>Card Characteristics</key>
<dict>
<key>Product Name</key>
<string>SD32G</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Card Type</key>
<string>SDHC</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyCardTypeSDHCKey "SDHC"
/*!
@defined kIOPropertyCardTypeSDXCKey
@discussion This key is used to indicate the card type is SDXC.
Requirement: Optional.
Example:
<pre>
@textblock
<dict>
<key>Card Characteristics</key>
<dict>
<key>Product Name</key>
<string>SD32G</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Card Type</key>
<string>SDXC</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyCardTypeSDXCKey "SDXC"
#endif /* _IOKIT_IO_STORAGE_CARD_CHARACTERISTICS_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IODVDMedia.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
* @header IODVDMedia
* @abstract
* This header contains the IODVDMedia class definition.
*/
#ifndef _IODVDMEDIA_H
#define _IODVDMEDIA_H
/*!
* @defined kIODVDMediaClass
* @abstract
* kIODVDMediaClass is the name of the IODVDMedia class.
* @discussion
* kIODVDMediaClass is the name of the IODVDMedia class.
*/
#define kIODVDMediaClass "IODVDMedia"
/*!
* @defined kIODVDMediaTypeKey
* @abstract
* kIODVDMediaTypeKey is a property of IODVDMedia objects. It has an OSString
* value.
* @discussion
* The kIODVDMediaTypeKey property identifies the DVD media type (DVD-ROM,
* DVD-R, DVD-RW, DVD+RW, DVD-RAM, etc). See the kIODVDMediaType contants
* for possible values.
*/
#define kIODVDMediaTypeKey "Type"
/*!
* @defined kIODVDMediaTypeROM
* The kIODVDMediaTypeKey constant for DVD-ROM media.
*/
#define kIODVDMediaTypeROM "DVD-ROM"
/*!
* @defined kIODVDMediaTypeR
* The kIODVDMediaTypeKey constant for DVD Recordable (DVD-R) media.
*/
#define kIODVDMediaTypeR "DVD-R"
/*!
* @defined kIODVDMediaTypeRW
* The kIODVDMediaTypeKey constant for DVD ReWritable (DVD-RW) media.
*/
#define kIODVDMediaTypeRW "DVD-RW"
/*!
* @defined kIODVDMediaTypePlusR
* The kIODVDMediaTypeKey constant for DVD "Plus" Recordable (DVD+R) media.
*/
#define kIODVDMediaTypePlusR "DVD+R"
/*!
* @defined kIODVDMediaTypePlusRW
* The kIODVDMediaTypeKey constant for DVD "Plus" ReWritable (DVD+RW) media.
*/
#define kIODVDMediaTypePlusRW "DVD+RW"
/*!
* @defined kIODVDMediaTypeRAM
* The kIODVDMediaTypeKey constant for DVD-RAM media.
*/
#define kIODVDMediaTypeRAM "DVD-RAM"
/*!
* @defined kIODVDMediaTypeHDROM
* The kIODVDMediaTypeKey constant for HD DVD-ROM media.
*/
#define kIODVDMediaTypeHDROM "HD DVD-ROM"
/*!
* @defined kIODVDMediaTypeHDR
* The kIODVDMediaTypeKey constant for HD DVD Recordable (HD DVD-R) media.
*/
#define kIODVDMediaTypeHDR "HD DVD-R"
/*!
* @defined kIODVDMediaTypeHDRW
* The kIODVDMediaTypeKey constant for HD DVD ReWritable (HD DVD-RW) media.
*/
#define kIODVDMediaTypeHDRW "HD DVD-RW"
/*!
* @defined kIODVDMediaTypeHDRAM
* The kIODVDMediaTypeKey constant for HD DVD-RAM media.
*/
#define kIODVDMediaTypeHDRAM "HD DVD-RAM"
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/storage/IODVDBlockStorageDriver.h>
#include <IOKit/storage/IOMedia.h>
/*!
* @class IODVDMedia
* @abstract
* The IODVDMedia class is a random-access disk device abstraction for DVDs.
* @discussion
* The IODVDMedia class is a random-access disk device abstraction for DVDs.
*/
class IODVDMedia : public IOMedia
{
OSDeclareDefaultStructors(IODVDMedia)
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
public:
/*
* Obtain this object's provider. We override the superclass's method to
* return a more specific subclass of IOService -- IODVDBlockStorageDriver.
* This method serves simply as a convenience to subclass developers.
*/
virtual IODVDBlockStorageDriver * getProvider() const;
/*
* Compare the properties in the supplied table to this object's properties.
*/
virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score);
/*
* Issue an MMC REPORT KEY command.
* Obsoleted, replaced by this interface:
* virtual IOReturn reportKey( IOMemoryDescriptor * buffer,
* UInt8 keyClass,
* UInt32 address,
* UInt8 blockCount,
* UInt8 grantID,
* UInt8 format );
*/
virtual IOReturn reportKey( IOMemoryDescriptor * buffer,
const DVDKeyClass keyClass,
const UInt32 address,
const UInt8 grantID,
const DVDKeyFormat format ) __attribute__ ((deprecated));
/*!
* @function sendKey
* @discussion
* Issue an MMC SEND KEY command.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer. Pass null for the kDVDKeyFormatAGID_Invalidate format
* case.
* @param keyClass
* As documented by MMC.
* @param grantID
* As documented by MMC.
* @param format
* As documented by MMC.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn sendKey( IOMemoryDescriptor * buffer,
const DVDKeyClass keyClass,
const UInt8 grantID,
const DVDKeyFormat format );
/*!
* @function readStructure
* @discussion
* Issue an MMC READ DVD STRUCTURE command.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param format
* As documented by MMC.
* @param address
* As documented by MMC.
* @param layer
* As documented by MMC.
* @param grantID
* As documented by MMC.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn readStructure( IOMemoryDescriptor * buffer,
const DVDStructureFormat format,
const UInt32 address,
const UInt8 layer,
const UInt8 grantID );
/*!
* @function getSpeed
* @discussion
* Get the current speed used for data transfers.
* @param kilobytesPerSecond
* Returns the current speed used for data transfers, in kB/s.
*
* kDVDSpeedMin specifies the minimum speed for all DVD media (1X).
* kDVDSpeedMax specifies the maximum speed supported in hardware.
* @result
* Returns the status of the operation.
*/
virtual IOReturn getSpeed(UInt16 * kilobytesPerSecond);
/*!
* @function setSpeed
* @discussion
* Set the speed to be used for data transfers.
* @param kilobytesPerSecond
* Speed to be used for data transfers, in kB/s.
*
* kDVDSpeedMin specifies the minimum speed for all DVD media (1X).
* kDVDSpeedMax specifies the maximum speed supported in hardware.
* @result
* Returns the status of the operation.
*/
virtual IOReturn setSpeed(UInt16 kilobytesPerSecond);
/*!
* @function readDiscInfo
* @discussion
* Issue an MMC READ DISC INFORMATION command.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param actualByteCount
* Returns the actual number of bytes transferred in the data transfer.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn readDiscInfo( IOMemoryDescriptor * buffer,
UInt16 * actualByteCount );
/*!
* @function readRZoneInfo
* @discussion
* Issue an MMC READ RZONE INFORMATION (READ TRACK INFORMATION) command.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param address
* As documented by MMC.
* @param addressType
* As documented by MMC.
* @param actualByteCount
* Returns the actual number of bytes transferred in the data transfer.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn readRZoneInfo( IOMemoryDescriptor * buffer,
UInt32 address,
DVDRZoneInfoAddressType addressType,
UInt16 * actualByteCount );
/*!
* @function reportKey
* @discussion
* Issue an MMC REPORT KEY command.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param keyClass
* As documented by MMC.
* @param address
* As documented by MMC.
* @param blockCount
* As documented by MMC.
* @param grantID
* As documented by MMC.
* @param format
* As documented by MMC.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn reportKey( IOMemoryDescriptor * buffer,
UInt8 keyClass,
UInt32 address,
UInt8 blockCount,
UInt8 grantID,
UInt8 format );
OSMetaClassDeclareReservedUsed(IODVDMedia, 0); /* reportKey */
OSMetaClassDeclareReservedUnused(IODVDMedia, 1);
OSMetaClassDeclareReservedUnused(IODVDMedia, 2);
OSMetaClassDeclareReservedUnused(IODVDMedia, 3);
OSMetaClassDeclareReservedUnused(IODVDMedia, 4);
OSMetaClassDeclareReservedUnused(IODVDMedia, 5);
OSMetaClassDeclareReservedUnused(IODVDMedia, 6);
OSMetaClassDeclareReservedUnused(IODVDMedia, 7);
OSMetaClassDeclareReservedUnused(IODVDMedia, 8);
OSMetaClassDeclareReservedUnused(IODVDMedia, 9);
OSMetaClassDeclareReservedUnused(IODVDMedia, 10);
OSMetaClassDeclareReservedUnused(IODVDMedia, 11);
OSMetaClassDeclareReservedUnused(IODVDMedia, 12);
OSMetaClassDeclareReservedUnused(IODVDMedia, 13);
OSMetaClassDeclareReservedUnused(IODVDMedia, 14);
OSMetaClassDeclareReservedUnused(IODVDMedia, 15);
OSMetaClassDeclareReservedUnused(IODVDMedia, 16);
OSMetaClassDeclareReservedUnused(IODVDMedia, 17);
OSMetaClassDeclareReservedUnused(IODVDMedia, 18);
OSMetaClassDeclareReservedUnused(IODVDMedia, 19);
OSMetaClassDeclareReservedUnused(IODVDMedia, 20);
OSMetaClassDeclareReservedUnused(IODVDMedia, 21);
OSMetaClassDeclareReservedUnused(IODVDMedia, 22);
OSMetaClassDeclareReservedUnused(IODVDMedia, 23);
OSMetaClassDeclareReservedUnused(IODVDMedia, 24);
OSMetaClassDeclareReservedUnused(IODVDMedia, 25);
OSMetaClassDeclareReservedUnused(IODVDMedia, 26);
OSMetaClassDeclareReservedUnused(IODVDMedia, 27);
OSMetaClassDeclareReservedUnused(IODVDMedia, 28);
OSMetaClassDeclareReservedUnused(IODVDMedia, 29);
OSMetaClassDeclareReservedUnused(IODVDMedia, 30);
OSMetaClassDeclareReservedUnused(IODVDMedia, 31);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IODVDMEDIA_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOBlockStorageDriver.h | /*
* Copyright (c) 1998-2019 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
* @header IOBlockStorageDriver
* @abstract
* This header contains the IOBlockStorageDriver class definition.
*/
#ifndef _IOBLOCKSTORAGEDRIVER_H
#define _IOBLOCKSTORAGEDRIVER_H
#include <IOKit/IOTypes.h>
/*!
* @defined kIOBlockStorageDriverClass
* @abstract
* The name of the IOBlockStorageDriver class.
*/
#define kIOBlockStorageDriverClass "IOBlockStorageDriver"
/*!
* @defined kIOBlockStorageDriverStatisticsKey
* @abstract
* Holds a table of numeric values describing the driver's
* operating statistics.
* @discussion
* This property holds a table of numeric values describing the driver's
* operating statistics. The table is an OSDictionary, where each entry
* describes one given statistic.
*/
#define kIOBlockStorageDriverStatisticsKey "Statistics"
/*!
* @defined kIOBlockStorageDriverStatisticsBytesReadKey
* @abstract
* Describes the number of bytes read since the block storage
* driver was instantiated.
* @discussion
* This property describes the number of bytes read since the block storage
* driver was instantiated. It is one of the statistic entries listed under
* the top-level kIOBlockStorageDriverStatisticsKey property table. It has
* an OSNumber value.
*/
#define kIOBlockStorageDriverStatisticsBytesReadKey "Bytes (Read)"
/*!
* @defined kIOBlockStorageDriverStatisticsBytesWrittenKey
* @abstract
* Describes the number of bytes written since the block storage
* driver was instantiated.
* @discussion
* This property describes the number of bytes written since the block storage
* driver was instantiated. It is one of the statistic entries listed under the
* top-level kIOBlockStorageDriverStatisticsKey property table. It has an
* OSNumber value.
*/
#define kIOBlockStorageDriverStatisticsBytesWrittenKey "Bytes (Write)"
/*!
* @defined kIOBlockStorageDriverStatisticsReadErrorsKey
* @abstract
* Describes the number of read errors encountered since the block
* storage driver was instantiated.
* @discussion
* This property describes the number of read errors encountered since the block
* storage driver was instantiated. It is one of the statistic entries listed
* under the top-level kIOBlockStorageDriverStatisticsKey property table. It
* has an OSNumber value.
*/
#define kIOBlockStorageDriverStatisticsReadErrorsKey "Errors (Read)"
/*!
* @defined kIOBlockStorageDriverStatisticsWriteErrorsKey
* @abstract
* Describes the number of write errors encountered since the
* block storage driver was instantiated.
* @discussion
* This property describes the number of write errors encountered since the
* block storage driver was instantiated. It is one of the statistic entries
* listed under the top-level kIOBlockStorageDriverStatisticsKey property table.
* It has an OSNumber value.
*/
#define kIOBlockStorageDriverStatisticsWriteErrorsKey "Errors (Write)"
/*!
* @defined kIOBlockStorageDriverStatisticsLatentReadTimeKey
* @abstract
* Describes the number of nanoseconds of latency during reads
* since the block storage driver was instantiated.
* @discussion
* This property describes the number of nanoseconds of latency during reads
* since the block storage driver was instantiated. It is one of the statistic
* entries listed under the top-level kIOBlockStorageDriverStatisticsKey
* property table. It has an OSNumber value.
*/
#define kIOBlockStorageDriverStatisticsLatentReadTimeKey "Latency Time (Read)"
/*!
* @defined kIOBlockStorageDriverStatisticsLatentWriteTimeKey
* @abstract
* Describes the number of nanoseconds of latency during writes
* since the block storage driver was instantiated.
* @discussion
* This property describes the number of nanoseconds of latency during writes
* since the block storage driver was instantiated. It is one of the statistic
* entries listed under the top-level kIOBlockStorageDriverStatisticsKey
* property table. It has an OSNumber value.
*/
#define kIOBlockStorageDriverStatisticsLatentWriteTimeKey "Latency Time (Write)"
/*!
* @defined kIOBlockStorageDriverStatisticsReadsKey
* @abstract
* Describes the number of read operations processed since the
* block storage driver was instantiated.
* @discussion
* This property describes the number of read operations processed since the
* block storage driver was instantiated. It is one of the statistic entries
* listed under the top-level kIOBlockStorageDriverStatisticsKey property table.
* It has an OSNumber value.
*/
#define kIOBlockStorageDriverStatisticsReadsKey "Operations (Read)"
/*!
* @defined kIOBlockStorageDriverStatisticsWritesKey
* @abstract
* Describes the number of write operations processed since the
* block storage driver was instantiated.
* @discussion
* This property describes the number of write operations processed since the
* block storage driver was instantiated. It is one of the statistic entries
* listed under the top-level kIOBlockStorageDriverStatisticsKey property table.
* It has an OSNumber value.
*/
#define kIOBlockStorageDriverStatisticsWritesKey "Operations (Write)"
/*!
* @defined kIOBlockStorageDriverStatisticsReadRetriesKey
* @abstract
* Describes the number of read retries required since the block
* storage driver was instantiated.
* @discussion
* This property describes the number of read retries required since the block
* storage driver was instantiated. It is one of the statistic entries listed
* under the top-level kIOBlockStorageDriverStatisticsKey property table. It
* has an OSNumber value.
*/
#define kIOBlockStorageDriverStatisticsReadRetriesKey "Retries (Read)"
/*!
* @defined kIOBlockStorageDriverStatisticsWriteRetriesKey
* @abstract
* Describes the number of write retries required since the block
* storage driver was instantiated.
* @discussion
* This property describes the number of write retries required since the block
* storage driver was instantiated. It is one of the statistic entries listed
* under the top-level kIOBlockStorageDriverStatisticsKey property table. It
* has an OSNumber value.
*/
#define kIOBlockStorageDriverStatisticsWriteRetriesKey "Retries (Write)"
/*!
* @defined kIOBlockStorageDriverStatisticsTotalReadTimeKey
* @abstract
* Describes the number of nanoseconds spent performing reads
* since the block storage driver was instantiated.
* @discussion
* This property describes the number of nanoseconds spent performing reads
* since the block storage driver was instantiated. It is one of the statistic
* entries listed under the top-level kIOBlockStorageDriverStatisticsKey
* property table. It has an OSNumber value.
*/
#define kIOBlockStorageDriverStatisticsTotalReadTimeKey "Total Time (Read)"
/*!
* @defined kIOBlockStorageDriverStatisticsTotalWriteTimeKey
* @abstract
* Describes the number of nanoseconds spent performing writes
* since the block storage driver was instantiated.
* @discussion
* This property describes the number of nanoseconds spent performing writes
* since the block storage driver was instantiated. It is one of the statistic
* entries listed under the top-level kIOBlockStorageDriverStatisticsKey
* property table. It has an OSNumber value.
*/
#define kIOBlockStorageDriverStatisticsTotalWriteTimeKey "Total Time (Write)"
/*!
* @enum IOMediaState
* @abstract
* The different states that getMediaState() can report.
* @constant kIOMediaStateOffline
* Media is not available.
* @constant kIOMediaStateOnline
* Media is available and ready for operations.
* @constant kIOMediaStateBusy
* Media is available, but not ready for operations.
*/
enum
{
kIOMediaStateOffline = 0,
kIOMediaStateOnline = 1,
kIOMediaStateBusy = 2
};
typedef UInt32 IOMediaState;
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
class IOPerfControlClient;
class IOUserBlockStorageDevice;
#include <IOKit/storage/IOBlockStorageDevice.h>
#include <IOKit/storage/IOMedia.h>
#include <IOKit/storage/IOStorage.h>
/*!
* @class IOBlockStorageDriver
* @abstract
* The common base class for generic block storage drivers.
* @discussion
* The IOBlockStorageDriver class is the common base class for generic block
* storage drivers. It matches and communicates via an IOBlockStorageDevice
* interface, and connects to the remainder of the storage framework via the
* IOStorage protocol. It extends the IOStorage protocol by implementing the
* appropriate open and close semantics, deblocking for unaligned transfers,
* polling for ejectable media, locking and ejection policies, media object
* creation and tear-down, and statistics gathering and reporting.
*
* Block storage drivers are split into two parts: the generic driver handles
* all generic device issues, independent of the lower-level transport
* mechanism (e.g. SCSI, ATA, USB, FireWire). All storage operations
* at the generic driver level are translated into a series of generic
* device operations. These operations are passed via the IOBlockStorageDevice
* nub to a transport driver, which implements the appropriate
* transport-dependent protocol to execute these operations.
*
* To determine the write-protect state of a device (or media), for
* example, the generic driver would issue a call to the
* Transport Driver's reportWriteProtection method. If this were a SCSI
* device, its transport driver would issue a Mode Sense command to
* extract the write-protection status bit. The transport driver then
* reports true or false to the generic driver.
*
* The generic driver therefore has no knowledge of, or involvement
* with, the actual commands and mechanisms used to communicate with
* the device. It is expected that the generic driver will rarely, if
* ever, need to be subclassed to handle device idiosyncrasies; rather,
* the transport driver should be changed via overrides.
*
* A generic driver could be subclassed to create a different type of
* generic device. The generic driver IOCDBlockStorageDriver class is
* a subclass of IOBlockStorageDriver, adding CD functions.
*/
class __exported IOBlockStorageDriver : public IOStorage
{
OSDeclareDefaultStructors(IOBlockStorageDriver);
public:
/*!
* @enum Statistics
* @abstract
* Indices for the different statistics that getStatistics() can report.
* @constant kStatisticsReads Number of read operations thus far.
* @constant kStatisticsBytesRead Number of bytes read thus far.
* @constant kStatisticsTotalReadTime Nanoseconds spent performing reads thus far.
* @constant kStatisticsLatentReadTime Nanoseconds of latency during reads thus far.
* @constant kStatisticsReadRetries Number of read retries thus far.
* @constant kStatisticsReadErrors Number of read errors thus far.
* @constant kStatisticsWrites Number of write operations thus far.
* @constant kStatisticsSingleBlockWrites Number of write operations for a single block thus far.
* @constant kStatisticsBytesWritten Number of bytes written thus far.
* @constant kStatisticsTotalWriteTime Nanoseconds spent performing writes thus far.
* @constant kStatisticsLatentWriteTime Nanoseconds of latency during writes thus far.
* @constant kStatisticsWriteRetries Number of write retries thus far.
* @constant kStatisticsWriteErrors Number of write errors thus far.
*/
enum Statistics
{
kStatisticsReads,
kStatisticsBytesRead,
kStatisticsTotalReadTime,
kStatisticsLatentReadTime,
kStatisticsReadRetries,
kStatisticsReadErrors,
kStatisticsWrites,
kStatisticsSingleBlockWrites,
kStatisticsBytesWritten,
kStatisticsTotalWriteTime,
kStatisticsLatentWriteTime,
kStatisticsWriteRetries,
kStatisticsWriteErrors
};
static const UInt32 kStatisticsCount = kStatisticsWriteErrors + 1;
protected:
struct Context;
struct ExpansionData
{
UInt64 reserved0000;
UInt64 maxReadBlockTransfer;
UInt64 maxWriteBlockTransfer;
IONotifier * powerEventNotifier;
UInt32 deblockRequestWriteLockCount;
UInt64 maxReadSegmentTransfer;
UInt64 maxWriteSegmentTransfer;
UInt64 maxReadSegmentByteTransfer;
UInt64 maxWriteSegmentByteTransfer;
UInt64 minSegmentAlignmentByteTransfer;
UInt64 maxSegmentWidthByteTransfer;
Context * contexts;
IOSimpleLock * contextsLock;
UInt32 contextsCount;
UInt32 contextsMaxCount;
IOPerfControlClient * perfControlClient;
IOUserBlockStorageDevice * userBlockStorageDevice;
};
ExpansionData * _expansionData;
#define _maxReadBlockTransfer \
IOBlockStorageDriver::_expansionData->maxReadBlockTransfer
#define _maxWriteBlockTransfer \
IOBlockStorageDriver::_expansionData->maxWriteBlockTransfer
#define _powerEventNotifier \
IOBlockStorageDriver::_expansionData->powerEventNotifier
#define _deblockRequestWriteLockCount \
IOBlockStorageDriver::_expansionData->deblockRequestWriteLockCount
#define _maxReadSegmentTransfer \
IOBlockStorageDriver::_expansionData->maxReadSegmentTransfer
#define _maxWriteSegmentTransfer \
IOBlockStorageDriver::_expansionData->maxWriteSegmentTransfer
#define _maxReadSegmentByteTransfer \
IOBlockStorageDriver::_expansionData->maxReadSegmentByteTransfer
#define _maxWriteSegmentByteTransfer \
IOBlockStorageDriver::_expansionData->maxWriteSegmentByteTransfer
#define _minSegmentAlignmentByteTransfer \
IOBlockStorageDriver::_expansionData->minSegmentAlignmentByteTransfer
#define _maxSegmentWidthByteTransfer \
IOBlockStorageDriver::_expansionData->maxSegmentWidthByteTransfer
#define _contexts \
IOBlockStorageDriver::_expansionData->contexts
#define _contextsLock \
IOBlockStorageDriver::_expansionData->contextsLock
#define _contextsCount \
IOBlockStorageDriver::_expansionData->contextsCount
#define _contextsMaxCount \
IOBlockStorageDriver::_expansionData->contextsMaxCount
#define _perfControlClient \
IOBlockStorageDriver::_expansionData->perfControlClient
#define _userBlockStorageDevice \
IOBlockStorageDriver::_expansionData->userBlockStorageDevice
OSSet * _openClients;
OSNumber * _statistics[kStatisticsCount];
/*
* @struct Context
* @discussion
* Context structure for a read/write operation. It describes the block size,
* and where applicable, a block type and block sub-type, for a data transfer,
* as well as the completion information for the original request. Note that
* the block type field is unused in the IOBlockStorageDriver class.
* @field block.size
* Block size for the operation.
* @field block.type
* Block type for the operation. Unused in IOBlockStorageDriver. The default
* value for this field is IOBlockStorageDriver::kBlockTypeStandard.
* @field block.typeSub
* Block sub-type for the operation. It's definition depends on block.type.
* Unused in IOBlockStorageDriver.
* @field request.byteStart
* Starting byte offset for the data transfer.
* @param request.buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param request.attributes
* Attributes of the data transfer. See IOStorageAttributes.
* @param request.completion
* Completion routine to call once the data transfer is complete.
*/
struct Context
{
struct
{
UInt64 byteStart;
IOMemoryDescriptor * buffer;
IOStorageAttributes attributes;
IOStorageCompletion completion;
} request;
struct
{
UInt32 size;
UInt8 type;
UInt8 typeSub[3];
} block;
AbsoluteTime timeStart;
OSObject * perfControlContext;
UInt64 reserved0768;
UInt64 reserved0832;
UInt64 reserved0896;
Context * next;
};
static const UInt8 kBlockTypeStandard = 0x00;
using IOService::open;
/*
* Free all of this object's outstanding resources.
*
* This method's implementation is not typically overridden.
*/
void free() APPLE_KEXT_OVERRIDE;
/*!
* @function handleOpen
* @discussion
* The handleOpen method grants or denies permission to access this object
* to an interested client. The argument is an IOStorageAccess value that
* specifies the level of access desired -- reader or reader-writer.
*
* This method can be invoked to upgrade or downgrade the access level for
* an existing client as well. The previous access level will prevail for
* upgrades that fail, of course. A downgrade should never fail. If the
* new access level should be the same as the old for a given client, this
* method will do nothing and return success. In all cases, one, singular
* close-per-client is expected for all opens-per-client received.
*
* This implementation replaces the IOService definition of handleIsOpen().
* @param client
* Client requesting the open.
* @param options
* Options for the open. Set to zero.
* @param access
* Access level for the open. Set to kIOStorageAccessReader or
* kIOStorageAccessReaderWriter.
* @result
* Returns true if the open was successful, false otherwise.
*/
virtual bool handleOpen(IOService * client,
IOOptionBits options,
void * access) APPLE_KEXT_OVERRIDE;
/*!
* @function handleIsOpen
* @discussion
* The handleIsOpen method determines whether the specified client, or any
* client if none is specified, presently has an open on this object.
*
* This implementation replaces the IOService definition of handleIsOpen().
* @param client
* Client to check the open state of. Set to zero to check the open state
* of all clients.
* @result
* Returns true if the client was (or clients were) open, false otherwise.
*/
virtual bool handleIsOpen(const IOService * client) const APPLE_KEXT_OVERRIDE;
/*!
* @function handleClose
* @discussion
* The handleClose method closes the client's access to this object.
*
* This implementation replaces the IOService definition of handleIsOpen().
* @param client
* Client requesting the close.
* @param options
* Options for the close. Set to zero.
*/
virtual void handleClose(IOService * client, IOOptionBits options) APPLE_KEXT_OVERRIDE;
/*!
* @function addToBytesTransferred
* @discussion
* Update the total number of bytes transferred, the total transfer time,
* and the total latency time -- used for statistics.
*
* This method's implementation is not typically overridden.
* @param bytesTransferred
* Number of bytes transferred in this operation.
* @param totalTime
* Nanoseconds spent performing this operation.
* @param latentTime
* Nanoseconds of latency during this operation.
* @param isWrite
* Indicates whether this operation was a write, otherwise is was a read.
*/
virtual void addToBytesTransferred(UInt64 bytesTransferred,
UInt64 totalTime,
UInt64 latentTime,
bool isWrite);
/*!
* @function incrementErrors
* @discussion
* Update the total error count -- used for statistics.
*
* This method's implementation is not typically overridden.
* @param isWrite
* Indicates whether this operation was a write, otherwise is was a read.
*/
virtual void incrementErrors(bool isWrite);
/*!
* @function incrementRetries
* @discussion
* Update the total retry count -- used for statistics.
*
* This method's implementation is not typically overridden.
* @param isWrite
* Indicates whether this operation was a write, otherwise is was a read.
*/
virtual void incrementRetries(bool isWrite);
/*!
* @function allocateContext
* @discussion
* Allocate a context structure for a read/write operation.
* @result
* Context structure.
*/
virtual Context * allocateContext();
/*!
* @function deleteContext
* @discussion
* Delete a context structure from a read/write operation.
* @param context
* Context structure to be deleted.
*/
virtual void deleteContext(Context * context);
/*!
* @function deblockRequest
* @discussion
* The deblockRequest method checks to see if the incoming request rests
* on the media's block boundaries, and if not, deblocks it. Deblocking
* involves rounding out the request to the nearest block boundaries and
* transferring the excess bytes into a scratch buffer.
*
* This method is part of a sequence of methods invoked for each read/write
* request. The first is prepareRequest, which allocates and prepares some
* context for the transfer; the second is deblockRequest, which aligns the
* transfer at the media's block boundaries; third is breakUpRequest, which
* breaks up the transfer into multiple sub-transfers when certain hardware
* constraints are exceeded; fourth is executeRequest, which implements the
* actual transfer from the block storage device.
*
* This method's implementation is not typically overridden.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param context
* Additional context information for the data transfer (e.g. block size).
*/
virtual void deblockRequest(UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion,
Context * context);
/*!
* @function executeRequest
* @discussion
* Execute an asynchronous storage request. The request is guaranteed to be
* block-aligned.
*
* This method is part of a sequence of methods invoked for each read/write
* request. The first is prepareRequest, which allocates and prepares some
* context for the transfer; the second is deblockRequest, which aligns the
* transfer at the media's block boundaries; third is breakUpRequest, which
* breaks up the transfer into multiple sub-transfers when certain hardware
* constraints are exceeded; fourth is executeRequest, which implements the
* actual transfer from the block storage device.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param context
* Additional context information for the data transfer (e.g. block size).
*/
virtual void executeRequest(UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion,
Context * context);
/*!
* @function handleStart
* @discussion
* Prepare the block storage driver for operation.
*
* This is where a media object needs to be created for fixed media, and
* optionally for removable media.
*
* Note that this method is called from within the start() routine;
* if this method returns successfully, it should be prepared to accept
* any of IOBlockStorageDriver's APIs.
* @param provider
* This object's provider.
* @result
* Returns true on success, false otherwise.
*/
virtual bool handleStart(IOService * provider);
#if TARGET_OS_OSX
virtual bool handleYield(IOService * provider,
IOOptionBits options = 0,
void * argument = 0) __attribute__ ((deprecated));
#endif /* TARGET_OS_OSX */
/*!
* @function getMediaBlockSize
* @discussion
* Ask the driver about the media's natural block size.
* @result
* Natural block size, in bytes.
*/
virtual UInt64 getMediaBlockSize() const;
public:
using IOStorage::open;
using IOStorage::read;
using IOStorage::write;
/*
* Initialize this object's minimal state.
*
* This method's implementation is not typically overridden.
*/
virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE;
/*
* This method is called once we have been attached to the provider object.
*
* This method's implementation is not typically overridden.
*/
virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE;
/*
* This method is called before we are detached from the provider object.
*
* This method's implementation is not typically overridden.
*/
virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE;
virtual bool didTerminate(IOService * provider,
IOOptionBits options,
bool * defer) APPLE_KEXT_OVERRIDE;
#if TARGET_OS_OSX
virtual bool yield(IOService * provider,
IOOptionBits options = 0,
void * argument = 0) __attribute__ ((deprecated));
#endif /* TARGET_OS_OSX */
/*!
* @function read
* @discussion
* The read method is the receiving end for all read requests from the
* storage framework (through the media object created by this driver).
*
* This method initiates a sequence of methods (stages) for each read/write
* request. The first is prepareRequest, which allocates and prepares some
* context for the transfer; the second is deblockRequest, which aligns the
* transfer at the media's block boundaries; third is breakUpRequest, which
* breaks up the transfer into multiple sub-transfers when certain hardware
* constraints are exceeded; fourth is executeRequest, which implements the
* actual transfer from the block storage device.
*
* This method's implementation is not typically overridden.
* @param client
* Client requesting the read.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
*/
virtual void read(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE;
/*!
* @function write
* @discussion
* The write method is the receiving end for all write requests from the
* storage framework (through the media object created by this driver).
*
* This method initiates a sequence of methods (stages) for each read/write
* request. The first is prepareRequest, which allocates and prepares some
* context for the transfer; the second is deblockRequest, which aligns the
* transfer at the media's block boundaries; third is breakUpRequest, which
* breaks up the transfer into multiple sub-transfers when certain hardware
* constraints are exceeded; fourth is executeRequest, which implements the
* actual transfer from the block storage device.
*
* This method's implementation is not typically overridden.
* @param client
* Client requesting the write.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
*/
virtual void write(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE;
/*!
* @function synchronize
* @discussion
* Flush the cached data in the storage object, if any.
* @param client
* Client requesting the synchronization.
* @param byteStart
* Starting byte offset for the synchronization.
* @param byteCount
* Size of the synchronization. Set to zero to specify the end-of-media.
* @param options
* Options for the synchronization. See IOStorageSynchronizeOptions.
* @result
* Returns the status of the synchronization.
*/
virtual IOReturn synchronize(IOService * client,
UInt64 byteStart,
UInt64 byteCount,
IOStorageSynchronizeOptions options = 0) APPLE_KEXT_OVERRIDE;
/*!
* @function unmap
* @discussion
* Delete unused data from the storage object at the specified byte offsets.
* @param client
* Client requesting the operation.
* @param extents
* List of extents. See IOStorageExtent. It is legal for the callee to
* overwrite the contents of this buffer in order to satisfy the request.
* @param extentsCount
* Number of extents.
* @param options
* Options for the unmap. See IOStorageUnmapOptions.
* @result
* Returns the status of the operation.
*/
virtual IOReturn unmap(IOService * client,
IOStorageExtent * extents,
UInt32 extentsCount,
IOStorageUnmapOptions options = 0) APPLE_KEXT_OVERRIDE;
/*!
* @function getProvisionStatus
* @discussion
* Get device block provision status
* @param client
* Client requesting the synchronization.
* @param byteStart
* Byte offset of logical extent on the device.
* @param byteCount
* Byte length of logical extent on the device, 0 mean the entire remaining space.
* @param extentsCount
* Number of extents allocated in extents. On return, this parameter indicate number
* of provision extents returned.
* @param extents
* List of provision extents. See IOStorageProvisionExtents.
* @result
* Returns the status of the getProvisionStatus.
*/
virtual IOReturn getProvisionStatus(IOService * client,
UInt64 byteStart,
UInt64 byteCount,
UInt32 * extentsCount,
IOStorageProvisionExtent * extents,
IOStorageGetProvisionStatusOptions options = 0) APPLE_KEXT_OVERRIDE;
/*!
* @function lockPhysicalExtents
* @discussion
* Lock the contents of the storage object against relocation temporarily,
* for the purpose of getting physical extents.
* @param client
* Client requesting the operation.
* @result
* Returns true if the lock was successful, false otherwise.
*/
virtual bool lockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE;
/*!
* @function copyPhysicalExtent
* @discussion
* Convert the specified byte offset into a physical byte offset, relative
* to a physical storage object. This call should only be made within the
* context of lockPhysicalExtents().
* @param client
* Client requesting the operation.
* @param byteStart
* Starting byte offset for the operation. Returns a physical byte offset,
* relative to the physical storage object, on success.
* @param byteCount
* Size of the operation. Returns the actual number of bytes which can be
* transferred, relative to the physical storage object, on success.
* @result
* A reference to the physical storage object, which should be released by
* the caller, or a null on error.
*/
virtual IOStorage * copyPhysicalExtent(IOService * client,
UInt64 * byteStart,
UInt64 * byteCount) APPLE_KEXT_OVERRIDE;
/*!
* @function unlockPhysicalExtents
* @discussion
* Unlock the contents of the storage object for relocation again. This
* call must balance a successful call to lockPhysicalExtents().
* @param client
* Client requesting the operation.
*/
virtual void unlockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE;
/*!
* @function setPriority
* @discussion
* Reprioritize read or write requests at the specified byte offsets.
* @param client
* Client requesting the operation.
* @param extents
* List of extents. See IOStorageExtent. It is legal for the callee to
* overwrite the contents of this buffer in order to satisfy the request.
* @param extentsCount
* Number of extents.
* @param priority
* New priority. See IOStoragePriority.
* @result
* Returns the status of the operation.
*/
virtual IOReturn setPriority(IOService * client,
IOStorageExtent * extents,
UInt32 extentsCount,
IOStoragePriority priority) APPLE_KEXT_OVERRIDE;
/*!
* @function ejectMedia
* @discussion
* Eject the media from the device. The driver is responsible for tearing
* down the media object it created before proceeding with the eject. If
* the tear-down fails, an error should be returned.
* @result
* An IOReturn code.
*/
virtual IOReturn ejectMedia();
/*!
* @function formatMedia
* @discussion
* Format the media with the specified byte capacity. The driver is
* responsible for tearing down the media object and recreating it.
* @param byteCapacity
* Number of bytes to format media to.
* @result
* An IOReturn code.
*/
virtual IOReturn formatMedia(UInt64 byteCapacity);
#if TARGET_OS_OSX
virtual IOReturn lockMedia(bool lock) __attribute__ ((deprecated));
virtual IOReturn pollMedia() __attribute__ ((deprecated));
#endif /* TARGET_OS_OSX */
/*!
* @function isMediaEjectable
* @discussion
* Ask the driver whether the media is ejectable.
* @result
* Returns true if the media is ejectable, false otherwise.
*/
virtual bool isMediaEjectable() const;
/*!
* @function isMediaRemovable
* @discussion
* Ask the driver whether the media is ejectable.
* @result
* Returns true if the media is ejectable, false otherwise.
*/
virtual bool isMediaRemovable() const;
#if TARGET_OS_OSX
virtual bool isMediaPollExpensive() const __attribute__ ((deprecated));
virtual bool isMediaPollRequired() const __attribute__ ((deprecated));
#endif /* TARGET_OS_OSX */
/*!
* @function isMediaWritable
* @discussion
* Ask the driver whether the media is writable.
* @result
* Returns true if the media is writable, false otherwise.
*/
virtual bool isMediaWritable() const;
/*!
* @function getMediaState
* @discussion
* Ask the driver about the media's current state.
* @result
* An IOMediaState value.
*/
virtual IOMediaState getMediaState() const;
/*!
* @function getFormatCapacities
* @discussion
* Ask the driver to report the feasible formatting capacities for the
* inserted media (in bytes). This routine fills the caller's buffer,
* up to the maximum count specified if the real number of capacities
* would overflow the buffer. The return value indicates the actual
* number of capacities copied to the buffer.
*
* If the capacities buffer is not supplied or if the maximum count is
* zero, the routine returns the proposed count of capacities instead.
* @param capacities
* Buffer that will receive the UInt64 capacity values.
* @param capacitiesMaxCount
* Maximum number of capacity values that can be held in the buffer.
* @result
* Actual number of capacity values copied to the buffer, or if no buffer
* is given, the total number of capacity values available.
*/
virtual UInt32 getFormatCapacities(UInt64 * capacities,
UInt32 capacitiesMaxCount) const;
/*!
* @function getStatistics
* @discussion
* Ask the driver to report its operating statistics.
*
* The statistics are each indexed by IOBlockStorageDriver::Statistics
* indices. This routine fills the caller's buffer, up to the maximum
* count specified if the real number of statistics would overflow the
* buffer. The return value indicates the actual number of statistics
* copied to the buffer.
*
* If the statistics buffer is not supplied or if the maximum count is
* zero, the routine returns the proposed count of statistics instead.
* @param statistics
* Buffer that will receive the UInt64 statistic values.
* @param statisticsMaxCount
* Maximum number of statistic values that can be held in the buffer.
* @result
* Actual number of statistic values copied to the buffer, or if no buffer
* is given, the total number of statistic values available.
*/
virtual UInt32 getStatistics(UInt64 * statistics,
UInt32 statisticsMaxCount) const;
/*!
* @function getStatistic
* @discussion
* Ask the driver to report one of its operating statistics.
* @param statistic
* Statistic index (an IOBlockStorageDriver::Statistics index).
* @result
* Statistic value.
*/
virtual UInt64 getStatistic(Statistics statistic) const;
/*
* Generic entry point for calls from the provider. A return value of
* kIOReturnSuccess indicates that the message was received, and where
* applicable, that it was successful.
*/
virtual IOReturn message(UInt32 type, IOService * provider, void * argument) APPLE_KEXT_OVERRIDE;
/*
* Obtain this object's provider. We override the superclass's method to
* return a more specific subclass of IOService -- IOBlockStorageDevice.
* This method serves simply as a convenience to subclass developers.
*/
virtual IOBlockStorageDevice * getProvider() const APPLE_KEXT_OVERRIDE;
protected:
IOLock * _deblockRequestWriteLock;
UInt64 _reserved1024;
static void breakUpRequestExecute(void * parameter, void * target);
static void deblockRequestExecute(void * parameter, void * target);
/*
* This is the completion routine for the broken up breaker sub-requests.
* It verifies the success of the just-completed stage, transitions to
* the next stage, then builds and issues a transfer for the next stage.
*/
static void breakUpRequestCompletion(void * target,
void * parameter,
IOReturn status,
UInt64 actualByteCount);
/*
* This is the completion routine for the aligned deblocker sub-requests.
* It verifies the success of the just-completed stage, transitions to
* the next stage, then builds and issues a transfer for the next stage.
*/
static void deblockRequestCompletion(void * target,
void * parameter,
IOReturn status,
UInt64 actualByteCount);
/*
* This is the completion routine for the prepared request. It updates
* the driver's statistics, performs some clean up work, then calls the
* original request's completion routine.
*/
static void prepareRequestCompletion(void * target,
void * parameter,
IOReturn status,
UInt64 actualByteCount);
#if TARGET_OS_OSX
virtual void schedulePoller() __attribute__ ((deprecated));
virtual void unschedulePoller() __attribute__ ((deprecated));
#endif /* TARGET_OS_OSX */
/*
* This method is the power event handler for restarts and shutdowns.
*/
static IOReturn handlePowerEvent(void * target,
void * parameter,
UInt32 messageType,
IOService * provider,
void * messageArgument,
vm_size_t messageArgumentSize);
protected:
/* Device info: */
/*!
* @var _removable
* True if the media is removable; False if it is fixed (not removable).
*/
bool _removable;
/*!
* @var _ejectable
* True if the media is ejectable under software control.
*/
bool _ejectable; /* software-ejectable */
UInt16 _reserved1104;
UInt32 _openAssertions;
/* Media info and states: */
/*!
* @var _mediaObject
* A pointer to the media object we have instantiated (if any).
*/
IOMedia * _mediaObject;
/*!
* @var _mediaType
* Type of the media (can be used to differentiate between the
* different types of CD media, DVD media, etc).
*/
UInt32 _mediaType;
bool _solidState;
/*!
* @var _writeProtected
* True if the media is write-protected; False if not.
*/
bool _writeProtected;
UInt16 _reserved1264;
UInt64 _reserved1280;
/*!
* @var _mediaBlockSize
* The block size of the media, in bytes.
*/
UInt64 _mediaBlockSize;
/*!
* @var _maxBlockNumber
* The maximum allowable block number for the media, zero-based.
*/
UInt64 _maxBlockNumber;
/*!
* @var _maxReadByteTransfer
* The maximum byte transfer allowed for read operations.
*/
UInt64 _maxReadByteTransfer;
/*!
* @var _maxWriteByteTransfer
* The maximum byte transfer allowed for write operations.
*/
UInt64 _maxWriteByteTransfer;
/*!
* @function acceptNewMedia
* @abstract
* React to new media insertion.
* @discussion
* This method logs the media block size and block count, then calls
* instantiateMediaObject to get a media object instantiated. The
* media object is then attached above us and registered.
*
* This method can be overridden to control what happens when new media
* is inserted. The default implementation deals with one IOMedia object.
*/
virtual IOReturn acceptNewMedia(void);
#if TARGET_OS_OSX
virtual UInt64 constrainByteCount(UInt64 requestedCount,bool isWrite) __attribute__ ((deprecated));
#endif /* TARGET_OS_OSX */
/*!
* @function decommissionMedia
* @abstract
* Decommission an existing piece of media that has gone away.
* @discussion
* This method wraps a call to terminate, to tear down the stack and
* the IOMedia object for the media. If "forcible" is true, the media
* object will be forgotten, and initMediaState will be called. A
* forcible decommission would occur when an unrecoverable error
* happens during tear-down (e.g. perhaps a client is still open), but
* we must still forget about the media.
* @param forcible
* True to force forgetting of the media object even if terminate reports
* that there was an active client.
*/
virtual IOReturn decommissionMedia(bool forcible);
/*!
* @function instantiateDesiredMediaObject
* @abstract
* Create an IOMedia object for media.
* @discussion
* This method creates the exact type of IOMedia object desired. It is called by
* instantiateMediaObject. A subclass may override this one-line method to change
* the type of media object actually instantiated.
*/
virtual IOMedia * instantiateDesiredMediaObject(void);
/*!
* @function instantiateMediaObject
* @abstract
* Create an IOMedia object for media.
* @discussion
* This method creates an IOMedia object from the supplied parameters. It is a
* convenience method to wrap the handful of steps to do the job.
* @param base
* Byte number of beginning of active data area of the media. Usually zero.
* @param byteSize
* Size of the data area of the media, in bytes.
* @param blockSize
* Block size of the media, in bytes.
* @param mediaName
* Name of the IOMedia object.
* @result
* A pointer to the created IOMedia object, or a null on error.
*/
virtual IOMedia * instantiateMediaObject(UInt64 base,UInt64 byteSize,
UInt32 blockSize,char *mediaName);
/*!
* @function recordMediaParameters
* @abstract
* Obtain media-related parameters on media insertion.
* @discussion
* This method obtains media-related parameters via calls to the
* Transport Driver's reportBlockSize, reportMaxValidBlock,
* and reportWriteProtection methods.
*/
virtual IOReturn recordMediaParameters(void);
/*!
* @function rejectMedia
* @abstract
* Reject new media.
* @discussion
* This method will be called if validateNewMedia returns False (thus rejecting
* the new media. A vendor may choose to override this method to control behavior
* when media is rejected.
*
* The default implementation simply calls ejectMedia.
*/
virtual void rejectMedia(void); /* default ejects */
/*!
* @function validateNewMedia
* @abstract
* Verify that new media is acceptable.
* @discussion
* This method will be called whenever new media is detected. Return true to accept
* the media, or false to reject it (and call rejectMedia). Vendors might override
* this method to handle password-protection for new media.
*
* The default implementation always returns True, indicating media is accepted.
*/
virtual bool validateNewMedia(void);
/* --- Internally used methods. --- */
/*
* @group
* Internally Used Methods
* @discussion
* These methods are used internally, and will not generally be modified.
*/
/*!
* @function checkForMedia
* @abstract
* Check if media has newly arrived or disappeared.
* @discussion
* This method does most of the work in polling for media, first
* calling the block storage device's reportMediaState method. If
* reportMediaState reports no change in the media state, kIOReturnSuccess
* is returned. If the media state has indeed changed, a call is made to
* mediaStateHasChanged to act on the event.
*/
virtual IOReturn checkForMedia(void);
/*!
* @function getDeviceTypeName
* @abstract
* Return the desired device name.
* @discussion
* This method returns a string, used to compare the
* kIOBlockStorageDeviceTypeKey of our provider. This method is called from
* probe.
*
* The default implementation of this method returns
* kIOBlockStorageDeviceTypeGeneric.
*/
virtual const char * getDeviceTypeName(void);
/*!
* @function initMediaState
* @abstract
* Initialize media-related instance variables.
* @discussion
* Called when media is not present, this method marks the device state
* as not having media present, not spun up, and write-enabled.
*/
virtual void initMediaState(void);
/*!
* @function mediaStateHasChanged
* @abstract
* React to a new media insertion or a media removal.
* @discussion
* This method is called on a media state change, that is, an arrival
* or removal. If media has just become available, calls are made to
* recordMediaParameters and acceptNewMedia. If media has just gone
* away, a call is made to decommissionMedia, with the forcible
* parameter set to true. The forcible tear-down is needed to enforce
* the disappearance of media, regardless of interested clients.
*/
virtual IOReturn mediaStateHasChanged(IOMediaState state);
/*
* @endgroup
*/
protected:
/*!
* @function breakUpRequest
* @discussion
* The breakUpRequest method checks to see if the incoming request exceeds
* our transfer constraints, and if so, breaks up the request into smaller
* sub-requests.
*
* This method is part of a sequence of methods invoked for each read/write
* request. The first is prepareRequest, which allocates and prepares some
* context for the transfer; the second is deblockRequest, which aligns the
* transfer at the media's block boundaries; third is breakUpRequest, which
* breaks up the transfer into multiple sub-transfers when certain hardware
* constraints are exceeded; fourth is executeRequest, which implements the
* actual transfer from the block storage device.
*
* This method's implementation is not typically overridden.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param context
* Additional context information for the data transfer (e.g. block size).
*/
virtual void breakUpRequest(UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion,
Context * context);
/*!
* @function prepareRequest
* @discussion
* The prepareRequest method allocates and prepares state for the transfer.
*
* This method is part of a sequence of methods invoked for each read/write
* request. The first is prepareRequest, which allocates and prepares some
* context for the transfer; the second is deblockRequest, which aligns the
* transfer at the media's block boundaries; third is breakUpRequest, which
* breaks up the transfer into multiple sub-transfers when certain hardware
* constraints are exceeded; fourth is executeRequest, which implements the
* actual transfer from the block storage device.
*
* This method's implementation is not typically overridden.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
*/
virtual void prepareRequest(UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion);
public:
/*!
* @function requestIdle
* @abstract
* Request that the device enter an idle state.
* @discussion
* Request that the device enter an idle state. The device will exit this state on the
* next read or write request, or as it sees necessary. One example is for a DVD drive
* to spin down when it enters such an idle state, and spin up on the next read request
* from the system.
*/
virtual IOReturn requestIdle(void);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 0);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 1);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 2);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 3);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 4);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 5);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 6);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 7);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 8);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 9);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 10);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 11);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 12);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 13);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 14);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 15);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 16);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 17);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 18);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 19);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 20);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 21);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 22);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 23);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 24);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 25);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 26);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 27);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 28);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 29);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 30);
OSMetaClassDeclareReservedUnused(IOBlockStorageDriver, 31);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOBLOCKSTORAGEDRIVER_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IODVDTypes.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IODVDTYPES_H
#define _IODVDTYPES_H
#include <IOKit/IOTypes.h>
#pragma pack(push, 1) /* (enable 8-bit struct packing) */
/*
* Media Types
*/
enum
{
kDVDMediaTypeUnknown = 0x0200,
kDVDMediaTypeROM = 0x0202, /* DVD-ROM */
kDVDMediaTypeRAM = 0x0203, /* DVD-RAM */
kDVDMediaTypeR = 0x0204, /* DVD-R */
kDVDMediaTypeRW = 0x0205, /* DVD-RW */
kDVDMediaTypePlusRW = 0x0206, /* DVD+RW */
kDVDMediaTypePlusR = 0x0207, /* DVD+R */
kDVDMediaTypeHDROM = 0x0212, /* HD DVD-ROM */
kDVDMediaTypeHDRAM = 0x0213, /* HD DVD-RAM */
kDVDMediaTypeHDR = 0x0214, /* HD DVD-R */
kDVDMediaTypeHDRW = 0x0215, /* HD DVD-RW */
kDVDMediaTypeMin = 0x0200,
kDVDMediaTypeMax = 0x02FF
};
typedef UInt32 DVDMediaType;
/*
* Media Speed (kB/s)
*/
#define kDVDSpeedMin 0x0546
#define kDVDSpeedMax 0xFFFF
/*
* MMC Formats
*/
typedef UInt8 DVDCPRMRegionCode;
enum
{
kDVDCPRMRegion1 = 0xFE,
kDVDCPRMRegion2 = 0xFD,
kDVDCPRMRegion3 = 0xFB,
kDVDCPRMRegion4 = 0xF7,
kDVDCPRMRegion5 = 0xEF,
kDVDCPRMRegion6 = 0xDF
};
typedef UInt8 DVDRegionalPlaybackControlScheme;
enum
{
kDVDRegionalPlaybackControlSchemePhase1 = 0x00,
kDVDRegionalPlaybackControlSchemePhase2 = 0x01
};
typedef UInt8 DVDBookType;
enum
{
kDVDBookTypeROM = 0x0,
kDVDBookTypeRAM = 0x1,
kDVDBookTypeR = 0x2,
kDVDBookTypeRW = 0x3,
kDVDBookTypeHDROM = 0x4,
kDVDBookTypeHDRAM = 0x5,
kDVDBookTypeHDR = 0x6,
kDVDBookTypeHDRW = 0x7,
kDVDBookTypePlusRW = 0x9,
kDVDBookTypePlusR = 0xA,
kDVDBookTypePlusRWDoubleLayer = 0xD,
kDVDBookTypePlusRDoubleLayer = 0xE
};
typedef UInt8 DVDKeyClass;
enum
{
kDVDKeyClassCSS_CPPM_CPRM = 0x00,
kDVDKeyClassRSSA = 0x01
};
typedef UInt8 DVDKeyFormat;
enum
{
kDVDKeyFormatAGID_CSS = 0x00,
kDVDKeyFormatChallengeKey = 0x01,
kDVDKeyFormatKey1 = 0x02,
kDVDKeyFormatKey2 = 0x03,
kDVDKeyFormatTitleKey = 0x04,
kDVDKeyFormatASF = 0x05,
kDVDKeyFormatSetRegion = 0x06,
kDVDKeyFormatRegionState = 0x08,
kDVDKeyFormatAGID_CSS2 = 0x10,
kDVDKeyFormatAGID_CPRM = 0x11,
kDVDKeyFormatAGID_Invalidate = 0x3F
};
typedef UInt8 DVDStructureFormat;
enum
{
kDVDStructureFormatPhysicalFormatInfo = 0x00,
kDVDStructureFormatCopyrightInfo = 0x01,
kDVDStructureFormatDiscKeyInfo = 0x02,
// skip BCA
kDVDStructureFormatManufacturingInfo = 0x04
};
// Read DVD Structures Format 0x00
struct DVDPhysicalFormatInfo
{
UInt8 dataLength[2];
UInt8 reserved[2];
#ifdef __LITTLE_ENDIAN__
// Byte 0
UInt8 partVersion:4;
UInt8 bookType:4;
// Byte 1
UInt8 minimumRate:4;
UInt8 discSize:4;
// Byte 2
UInt8 layerType:4;
UInt8 trackPath:1;
UInt8 numberOfLayers:2;
UInt8 reserved2:1;
// Byte 3
UInt8 trackDensity:4;
UInt8 linearDensity:4;
#else /* !__LITTLE_ENDIAN__ */
// Byte 0
UInt8 bookType:4;
UInt8 partVersion:4;
// Byte 1
UInt8 discSize:4;
UInt8 minimumRate:4;
// Byte 2
UInt8 reserved2:1;
UInt8 numberOfLayers:2;
UInt8 trackPath:1;
UInt8 layerType:4;
// Byte 3
UInt8 linearDensity:4;
UInt8 trackDensity:4;
#endif /* !__LITTLE_ENDIAN__ */
// Bytes 4-15
UInt8 zero1; // always 0x00
UInt8 startingPhysicalSectorNumberOfDataArea[3];
UInt8 zero2; // always 0x00
UInt8 endPhysicalSectorNumberOfDataArea[3];
UInt8 zero3; // always 0x00
UInt8 endSectorNumberInLayerZero[3];
// Byte 16
#ifdef __LITTLE_ENDIAN__
UInt8 reserved1:7;
UInt8 bcaFlag:1;
#else /* !__LITTLE_ENDIAN__ */
UInt8 bcaFlag:1;
UInt8 reserved1:7;
#endif /* !__LITTLE_ENDIAN__ */
// Bytes 17-2047
UInt8 mediaSpecific[2031];
};
typedef struct DVDPhysicalFormatInfo DVDPhysicalFormatInfo;
// Read DVD Structures Format 0x01
struct DVDCopyrightInfo
{
UInt8 dataLength[2];
UInt8 reserved[2];
UInt8 copyrightProtectionSystemType;
DVDCPRMRegionCode regionMask;
UInt8 reserved2[2];
};
typedef struct DVDCopyrightInfo DVDCopyrightInfo;
// Read DVD Structures Format 0x02
struct DVDDiscKeyInfo
{
UInt8 dataLength[2];
UInt8 reserved[2];
UInt8 discKeyStructures[2048];
};
typedef struct DVDDiscKeyInfo DVDDiscKeyInfo;
// Read DVD Structures Format 0x04
struct DVDManufacturingInfo
{
UInt8 dataLength[2];
UInt8 reserved[2];
UInt8 discManufacturingInfo[2048];
};
typedef struct DVDManufacturingInfo DVDManufacturingInfo;
// ReportKey Format 0x00
struct DVDAuthenticationGrantIDInfo
{
UInt8 dataLength[2];
UInt8 reserved[2];
UInt8 reserved2[3];
#ifdef __LITTLE_ENDIAN__
UInt8 reservedBits:6;
UInt8 grantID:2;
#else /* !__LITTLE_ENDIAN__ */
UInt8 grantID:2;
UInt8 reservedBits:6;
#endif /* !__LITTLE_ENDIAN__ */
};
typedef struct DVDAuthenticationGrantIDInfo DVDAuthenticationGrantIDInfo;
// ReportKey and SendKey Format 0x01
struct DVDChallengeKeyInfo
{
UInt8 dataLength[2];
UInt8 reserved[2];
UInt8 challengeKeyValue[10];
UInt8 reserved2[2];
};
typedef struct DVDChallengeKeyInfo DVDChallengeKeyInfo;
// ReportKey Format 0x02
struct DVDKey1Info
{
UInt8 dataLength[2];
UInt8 reserved[2];
UInt8 key1Value[5];
UInt8 reserved2[3];
};
typedef struct DVDKey1Info DVDKey1Info;
// SendKey Format 0x03
struct DVDKey2Info
{
UInt8 dataLength[2];
UInt8 reserved[2];
UInt8 key2Value[5];
UInt8 reserved2[3];
};
typedef struct DVDKey2Info DVDKey2Info;
// ReportKey Format 0x04
struct DVDTitleKeyInfo
{
UInt8 dataLength[2];
UInt8 reserved[2];
#ifdef __LITTLE_ENDIAN__
UInt8 CP_MOD:4;
UInt8 CGMS:2;
UInt8 CP_SEC:1;
UInt8 CPM:1;
#else /* !__LITTLE_ENDIAN__ */
UInt8 CPM:1;
UInt8 CP_SEC:1;
UInt8 CGMS:2;
UInt8 CP_MOD:4;
#endif /* !__LITTLE_ENDIAN__ */
UInt8 titleKeyValue[5];
UInt8 reserved2[2];
};
typedef struct DVDTitleKeyInfo DVDTitleKeyInfo;
// ReportKey Format 0x05
struct DVDAuthenticationSuccessFlagInfo
{
UInt8 dataLength[2];
UInt8 reserved[2];
UInt8 reserved2[3];
#ifdef __LITTLE_ENDIAN__
UInt8 successFlag:1;
UInt8 reservedBits:7;
#else /* !__LITTLE_ENDIAN__ */
UInt8 reservedBits:7;
UInt8 successFlag:1;
#endif /* !__LITTLE_ENDIAN__ */
};
typedef struct DVDAuthenticationSuccessFlagInfo DVDAuthenticationSuccessFlagInfo;
// ReportKey Format 0x08
struct DVDRegionPlaybackControlInfo
{
UInt8 dataLength[2];
UInt8 reserved[2];
#ifdef __LITTLE_ENDIAN__
UInt8 numberUserResets:3;
UInt8 numberVendorResets:3;
UInt8 typeCode:2;
#else /* !__LITTLE_ENDIAN__ */
UInt8 typeCode:2;
UInt8 numberVendorResets:3;
UInt8 numberUserResets:3;
#endif /* !__LITTLE_ENDIAN__ */
DVDCPRMRegionCode driveRegion;
DVDRegionalPlaybackControlScheme rpcScheme;
UInt8 reserved2;
};
typedef struct DVDRegionPlaybackControlInfo DVDRegionPlaybackControlInfo;
// Read Disc Information Format
struct DVDDiscInfo
{
UInt16 dataLength;
#ifdef __LITTLE_ENDIAN__
UInt8 discStatus:2;
UInt8 stateOfLastBorder:2;
UInt8 erasable:1;
UInt8 reserved:3;
#else /* !__LITTLE_ENDIAN__ */
UInt8 reserved:3;
UInt8 erasable:1;
UInt8 stateOfLastBorder:2;
UInt8 discStatus:2;
#endif /* !__LITTLE_ENDIAN__ */
UInt8 reserved2;
UInt8 numberOfBordersLSB;
UInt8 firstRZoneNumberInLastBorderLSB;
UInt8 lastRZoneNumberInLastBorderLSB;
#ifdef __LITTLE_ENDIAN__
UInt8 reserved3:5;
UInt8 unrestrictedUse:1;
UInt8 discBarCodeValid:1;
UInt8 reserved4:1;
#else /* !__LITTLE_ENDIAN__ */
UInt8 reserved4:1;
UInt8 discBarCodeValid:1;
UInt8 unrestrictedUse:1;
UInt8 reserved3:5;
#endif /* !__LITTLE_ENDIAN__ */
UInt8 reserved5;
UInt8 numberOfBordersMSB;
UInt8 firstRZoneNumberInLastBorderMSB;
UInt8 lastRZoneNumberInLastBorderMSB;
UInt8 reserved6[4];
UInt8 reserved7[4];
UInt8 reserved8[4];
UInt8 discBarCode[8];
UInt8 reserved9;
UInt8 numberOfOPCTableEntries;
UInt8 opcTableEntries[0];
};
typedef struct DVDDiscInfo DVDDiscInfo;
// Read RZone Information Address Types
typedef UInt8 DVDRZoneInfoAddressType;
enum
{
kDVDRZoneInfoAddressTypeLBA = 0x00,
kDVDRZoneInfoAddressTypeRZoneNumber = 0x01,
kDVDRZoneInfoAddressTypeBorderNumber = 0x02,
};
// Read RZone Information Format
struct DVDRZoneInfo
{
UInt16 dataLength;
UInt8 rzoneNumberLSB;
UInt8 borderNumberLSB;
UInt8 reserved;
#ifdef __LITTLE_ENDIAN__
UInt8 reserved2:4;
UInt8 copy:1;
UInt8 damage:1;
UInt8 reserved3:2;
UInt8 reserved4:4;
UInt8 restrictedOverwrite:1;
UInt8 incremental:1;
UInt8 blank:1;
UInt8 reservedRZone:1;
UInt8 nextWritableAddressValid:1;
UInt8 lastRecordedAddressValid:1;
UInt8 reserved5:6;
#else /* !__LITTLE_ENDIAN__ */
UInt8 reserved3:2;
UInt8 damage:1;
UInt8 copy:1;
UInt8 reserved2:4;
UInt8 reservedRZone:1;
UInt8 blank:1;
UInt8 incremental:1;
UInt8 restrictedOverwrite:1;
UInt8 reserved4:4;
UInt8 reserved5:6;
UInt8 lastRecordedAddressValid:1;
UInt8 nextWritableAddressValid:1;
#endif /* !__LITTLE_ENDIAN__ */
UInt32 rzoneStartAddress;
UInt32 nextWritableAddress;
UInt32 freeBlocks;
UInt32 blockingFactor;
UInt32 rzoneSize;
UInt32 lastRecordedAddress;
UInt8 rzoneNumberMSB;
UInt8 borderNumberMSB;
UInt8 reserved6;
UInt8 reserved7;
};
typedef struct DVDRZoneInfo DVDRZoneInfo;
#pragma pack(pop) /* (reset to default struct packing) */
#endif /* _IODVDTYPES_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOStorage.h | /*
* Copyright (c) 1998-2015 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
* @header IOStorage
* @abstract
* This header contains the IOStorage class definition.
*/
#ifndef _IOSTORAGE_H
#define _IOSTORAGE_H
#include <sys/kernel_types.h>
#include <IOKit/IOTypes.h>
/*!
* @defined kIOStorageClass
* @abstract
* The name of the IOStorage class.
*/
#define kIOStorageClass "IOStorage"
/*!
* @defined kIOStorageCategory
* @abstract
* kIOStorageCategory is a value for IOService's kIOMatchCategoryKey property.
* @discussion
* The kIOStorageCategory value is the standard value for the IOService property
* kIOMatchCategoryKey ("IOMatchCategory") for all storage drivers. All storage
* objects that expect to drive new content (that is, produce new media objects)
* are expected to compete within the kIOStorageCategory namespace.
*
* See the IOService documentation for more information on match categories.
*/
#define kIOStorageCategory "IOStorage" /* (as IOMatchCategory) */
/*!
* @defined kIOStorageFeaturesKey
* @abstract
* A property of any object in the storage stack.
* @discussion
* kIOStorageFeaturesKey is a property of any object in the storage stack that
* wishes to express support of additional features, such as Force Unit Access.
* It is typically defined in the device object below the block storage driver
* object. It has an OSDictionary value, where each entry describes one given
* feature.
*/
#define kIOStorageFeaturesKey "IOStorageFeatures"
/*!
* @defined kIOStorageFeatureBarrier
* @abstract
* Describes the presence of the Barrier feature.
* @discussion
* This property describes the ability of the storage stack to honor a write
* barrier, guaranteeing that on power loss, writes after the barrier will not
* be visible until all writes before the barrier are visible. It is one of the
* feature entries listed under the top-level kIOStorageFeaturesKey property
* table. It has an OSBoolean value.
*/
#define kIOStorageFeatureBarrier "Barrier"
/*!
* @defined kIOStorageFeatureForceUnitAccess
* @abstract
* Describes the presence of the Force Unit Access feature.
* @discussion
* This property describes the ability of the storage stack to force a request
* to access the media. It is one of the feature entries listed under the top-
* level kIOStorageFeaturesKey property table. It has an OSBoolean value.
*/
#define kIOStorageFeatureForceUnitAccess "Force Unit Access"
/*!
* @defined kIOStorageFeaturePriority
* @abstract
* Describes the presence of the Priority feature.
* @discussion
* This property describes the ability of the storage stack to enforce the
* priority of a request. It is one of the feature entries listed under the
* top-level kIOStorageFeaturesKey property table. It has an OSBoolean value.
*/
#define kIOStorageFeaturePriority "Priority"
/*!
* @defined kIOStorageFeatureUnmap
* @abstract
* Describes the presence of the Unmap feature.
* @discussion
* This property describes the ability of the storage stack to delete unused
* data from the media. It is one of the feature entries listed under the top-
* level kIOStorageFeaturesKey property table. It has an OSBoolean value.
*/
#define kIOStorageFeatureUnmap "Unmap"
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/assert.h>
#include <IOKit/IOMemoryDescriptor.h>
#include <IOKit/IOService.h>
/*!
* @enum IOStorageAccess
* @discussion
* The IOStorageAccess enumeration describes the possible access levels for open
* requests.
* @constant kIOStorageAccessNone
* No access is requested; should not be passed to open().
* @constant kIOStorageAccessReader
* Read-only access is requested.
* @constant kIOStorageAccessWriter
* write-only access is requested.
* @constant kIOStorageAccessReaderWriter
* Read and write access is requested.
* @constant kIOStorageAccessSharedLock
* Shared access is requested.
* @constant kIOStorageAccessExclusiveLock
* Exclusive access is requested.
* @constant kIOStorageAccessInvalid
* Invalid access is requested.
* @constant kIOStorageAccessReserved
* Reserved Access.
*/
enum
{
kIOStorageAccessNone = 0x00,
kIOStorageAccessReader = 0x01,
kIOStorageAccessWriter = 0x02,
kIOStorageAccessReaderWriter = 0x03,
kIOStorageAccessSharedLock = 0x04,
kIOStorageAccessExclusiveLock = 0x08,
kIOStorageAccessInvalid = 0x0D,
kIOStorageAccessReserved = 0xFFFFFFF0
};
typedef UInt32 IOStorageAccess;
/*!
* @enum IOStorageOptions
* @discussion
* Options for read and write storage requests.
* @constant kIOStorageOptionForceUnitAccess
* Force the request to access the media.
* @constant kIOStorageOptionIsEncrypted
* The data is already encrypted.
* @constant kIOStorageOptionIsStatic
* The data is likely to remain unaltered.
*/
enum
{
kIOStorageOptionNone = 0x0000,
kIOStorageOptionForceUnitAccess = 0x0001,
kIOStorageOptionIsEncrypted = 0x0010,
kIOStorageOptionIsStatic = 0x0020,
kIOStorageOptionReserved = 0xFFCE
};
typedef UInt16 IOStorageOptions;
/*!
* @enum IOStoragePriority
* @discussion
* Priority of read and write storage requests. The lower the value, the
* higher the priority.
* @constant kIOStoragePriorityHigh
* This priority should only be used for I/O that is critical to system
* responsiveness.
* @constant kIOStoragePriorityDefault
* This priority is for work requested by the user, but that is not the user's
* current focus.
* @constant kIOStoragePriorityLow
* This priority is for short-running background work.
* @constant kIOStoragePriorityBackground
* This priority is for long-running, I/O intensive background work, such as
* backups, search indexing, or file synchronization.
*/
enum
{
kIOStoragePriorityHigh = 63, /* 0 to 63 */
kIOStoragePriorityDefault = 127, /* 64 to 127 */
kIOStoragePriorityLow = 191, /* 128 to 191 */
kIOStoragePriorityBackground = 255 /* 192 to 255 */
};
typedef UInt8 IOStoragePriority;
/*!
* @enum IOStorageSynchronizeOptions
* @discussion
* Options for synchronize storage requests.
* @constant kIOStorageSynchronizeOptionBarrier
* Issue a write barrier only.
*/
enum
{
kIOStorageSynchronizeOptionNone = 0x00000000,
kIOStorageSynchronizeOptionBarrier = 0x00000002,
kIOStorageSynchronizeOptionReserved = 0xFFFFFFFD
};
typedef UInt32 IOStorageSynchronizeOptions;
/*!
* @enum IOStorageUnmapOptions
* @discussion
* Options for unmap storage requests.
*/
enum
{
kIOStorageUnmapOptionReserved = 0xFFFFFFFF
};
typedef UInt32 IOStorageUnmapOptions;
/*!
* @struct IOStorageAttributes
* @discussion
* Attributes of read and write storage requests.
* @field options
* Options for the request. See IOStorageOptions.
* @field priority
* Priority of the request. See IOStoragePriority.
* @field bufattr
* Reserved for future use. Set to zero.
*/
struct IOStorageAttributes
{
IOStorageOptions options;
IOStoragePriority priority;
UInt8 reserved0024;
UInt32 reserved0032;
UInt64 reserved0064;
UInt64 adjustedOffset;
bufattr_t bufattr;
};
/*!
* @struct IOStorageExtent
* @discussion
* Extent for unmap storage requests.
* @field byteStart
* Starting byte offset for the operation.
* @field byteCount
* Size of the operation.
*/
struct IOStorageExtent
{
UInt64 byteStart;
UInt64 byteCount;
};
/*!
* @enum IOStorageProvisionTypes
* @discussion
* Device block provision types, such as mapped, deallocated, or anchored. See SCSI
* SBC4 specifiction, LBA status descriptor for definitions.
*/
enum
{
kIOStorageProvisionTypeMapped = 0x00,
kIOStorageProvisionTypeDeallocated = 0x01,
kIOStorageProvisionTypeAnchored = 0x02
};
typedef UInt64 IOStorageGetProvisionStatusOptions;
/*!
* @struct IOStorageProvisionExtent
* @discussion
* Extent for provision status.
* @field byteStart
* Starting byte offset for the operation.
* @field byteCount
* Size of the operation.
* @field provisionType
* Block provision type. See IOStorageProvisionTypes.
*/
struct IOStorageProvisionExtent
{
UInt64 byteStart;
UInt64 byteCount;
UInt8 provisionType;
UInt8 reserved[7];
};
/*!
* @typedef IOStorageCompletionAction
* @discussion
* The IOStorageCompletionAction declaration describes the C (or C++) completion
* routine that is called once an asynchronous storage operation completes.
* @param target
* Opaque client-supplied pointer (or an instance pointer for a C++ callback).
* @param parameter
* Opaque client-supplied pointer.
* @param status
* Status of the data transfer.
* @param actualByteCount
* Actual number of bytes transferred in the data transfer.
*/
typedef void (*IOStorageCompletionAction)(void * target,
void * parameter,
IOReturn status,
UInt64 actualByteCount);
/*!
* @struct IOStorageCompletion
* @discussion
* The IOStorageCompletion structure describes the C (or C++) completion routine
* that is called once an asynchronous storage operation completes. The values
* passed for the target and parameter fields will be passed to the routine when
* it is called.
* @field target
* Opaque client-supplied pointer (or an instance pointer for a C++ callback).
* @field action
* Completion routine to call on completion of the data transfer.
* @field parameter
* Opaque client-supplied pointer.
*/
struct IOStorageCompletion
{
void * target;
IOStorageCompletionAction action;
void * parameter;
};
/*!
* @class IOStorage
* @abstract
* The common base class for mass storage objects.
* @discussion
* The IOStorage class is the common base class for mass storage objects. It is
* an abstract class that defines the open/close/read/write APIs that need to be
* implemented in a given subclass. Synchronous versions of the read/write APIs
* are provided here -- they are coded in such a way as to wrap the asynchronous
* versions implemented in the subclass.
*/
class __exported IOStorage : public IOService
{
OSDeclareAbstractStructors(IOStorage);
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
/*!
* @function handleOpen
* @discussion
* The handleOpen method grants or denies permission to access this object
* to an interested client. The argument is an IOStorageAccess value that
* specifies the level of access desired -- reader or reader-writer.
*
* This method can be invoked to upgrade or downgrade the access level for
* an existing client as well. The previous access level will prevail for
* upgrades that fail, of course. A downgrade should never fail. If the
* new access level should be the same as the old for a given client, this
* method will do nothing and return success. In all cases, one, singular
* close-per-client is expected for all opens-per-client received.
* @param client
* Client requesting the open.
* @param options
* Options for the open. Set to zero.
* @param access
* Access level for the open. Set to kIOStorageAccessReader or
* kIOStorageAccessReaderWriter.
* @result
* Returns true if the open was successful, false otherwise.
*/
virtual bool handleOpen(IOService * client,
IOOptionBits options,
void * access) APPLE_KEXT_OVERRIDE = 0;
/*!
* @function handleIsOpen
* @discussion
* The handleIsOpen method determines whether the specified client, or any
* client if none is specified, presently has an open on this object.
* @param client
* Client to check the open state of. Set to zero to check the open state
* of all clients.
* @result
* Returns true if the client was (or clients were) open, false otherwise.
*/
virtual bool handleIsOpen(const IOService * client) const APPLE_KEXT_OVERRIDE = 0;
/*!
* @function handleClose
* @discussion
* The handleClose method closes the client's access to this object.
* @param client
* Client requesting the close.
* @param options
* Options for the close. Set to zero.
*/
virtual void handleClose(IOService * client, IOOptionBits options) APPLE_KEXT_OVERRIDE = 0;
public:
#if TARGET_OS_OSX
virtual bool attach(IOService * provider) APPLE_KEXT_OVERRIDE;
#endif /* TARGET_OS_OSX */
/*!
* @function complete
* @discussion
* Invokes the specified completion action of the read/write request. If
* the completion action is unspecified, no action is taken. This method
* serves simply as a convenience to storage subclass developers.
* @param completion
* Completion information for the data transfer.
* @param status
* Status of the data transfer.
* @param actualByteCount
* Actual number of bytes transferred in the data transfer.
*/
static void complete(IOStorageCompletion * completion,
IOReturn status,
UInt64 actualByteCount = 0);
/*!
* @function open
* @discussion
* Ask the storage object for permission to access its contents; the method
* is equivalent to IOService::open(), but with the correct parameter types.
*
* This method may also be invoked to upgrade or downgrade the access of an
* existing open (if it fails, the existing open prevails).
* @param client
* Client requesting the open.
* @param options
* Options for the open. Set to zero.
* @param access
* Access level for the open. Set to kIOStorageAccessReader or
* kIOStorageAccessReaderWriter.
* @result
* Returns true if the open was successful, false otherwise.
*/
virtual bool open(IOService * client,
IOOptionBits options,
IOStorageAccess access);
/*!
* @function read
* @discussion
* Read data from the storage object at the specified byte offset into the
* specified buffer, synchronously. When the read completes, this method
* will return to the caller. The actual byte count field is optional.
* @param client
* Client requesting the read.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes.
* @param actualByteCount
* Returns the actual number of bytes transferred in the data transfer.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn read(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes = 0,
UInt64 * actualByteCount = 0);
/*!
* @function write
* @discussion
* Write data into the storage object at the specified byte offset from the
* specified buffer, synchronously. When the write completes, this method
* will return to the caller. The actual byte count field is optional.
* @param client
* Client requesting the write.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes.
* @param actualByteCount
* Returns the actual number of bytes transferred in the data transfer.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn write(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes = 0,
UInt64 * actualByteCount = 0);
#if TARGET_OS_OSX
virtual IOReturn synchronizeCache(IOService * client) __attribute__ ((deprecated));
#endif /* TARGET_OS_OSX */
/*!
* @function read
* @discussion
* Read data from the storage object at the specified byte offset into the
* specified buffer, asynchronously. When the read completes, the caller
* will be notified via the specified completion action.
*
* The buffer will be retained for the duration of the read.
* @param client
* Client requesting the read.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
*/
virtual void read(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion) = 0;
/*!
* @function write
* @discussion
* Write data into the storage object at the specified byte offset from the
* specified buffer, asynchronously. When the write completes, the caller
* will be notified via the specified completion action.
*
* The buffer will be retained for the duration of the write.
* @param client
* Client requesting the write.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
*/
virtual void write(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion) = 0;
#if TARGET_OS_OSX
virtual IOReturn discard(IOService * client,
UInt64 byteStart,
UInt64 byteCount) __attribute__ ((deprecated));
#endif /* TARGET_OS_OSX */
/*!
* @function unmap
* @discussion
* Delete unused data from the storage object at the specified byte offsets.
* @param client
* Client requesting the operation.
* @param extents
* List of extents. See IOStorageExtent. It is legal for the callee to
* overwrite the contents of this buffer in order to satisfy the request.
* @param extentsCount
* Number of extents.
* @param options
* Options for the unmap. See IOStorageUnmapOptions.
* @result
* Returns the status of the operation.
*/
#if TARGET_OS_OSX
virtual IOReturn unmap(IOService * client,
IOStorageExtent * extents,
UInt32 extentsCount,
IOStorageUnmapOptions options = 0); /* 10.6.6 */
#else /* !TARGET_OS_OSX */
virtual IOReturn unmap(IOService * client,
IOStorageExtent * extents,
UInt32 extentsCount,
IOStorageUnmapOptions options = 0) = 0;
#endif /* !TARGET_OS_OSX */
/*!
* @function lockPhysicalExtents
* @discussion
* Lock the contents of the storage object against relocation temporarily,
* for the purpose of getting physical extents.
* @param client
* Client requesting the operation.
* @result
* Returns true if the lock was successful, false otherwise.
*/
virtual bool lockPhysicalExtents(IOService * client); /* 10.7.0 */
/*!
* @function copyPhysicalExtent
* @discussion
* Convert the specified byte offset into a physical byte offset, relative
* to a physical storage object. This call should only be made within the
* context of lockPhysicalExtents().
* @param client
* Client requesting the operation.
* @param byteStart
* Starting byte offset for the operation. Returns a physical byte offset,
* relative to the physical storage object, on success.
* @param byteCount
* Size of the operation. Returns the actual number of bytes which can be
* transferred, relative to the physical storage object, on success.
* @result
* A reference to the physical storage object, which should be released by
* the caller, or a null on error.
*/
virtual IOStorage * copyPhysicalExtent(IOService * client,
UInt64 * byteStart,
UInt64 * byteCount); /* 10.7.0 */
/*!
* @function unlockPhysicalExtents
* @discussion
* Unlock the contents of the storage object for relocation again. This
* call must balance a successful call to lockPhysicalExtents().
* @param client
* Client requesting the operation.
*/
virtual void unlockPhysicalExtents(IOService * client); /* 10.7.0 */
/*!
* @function setPriority
* @discussion
* Reprioritize read or write requests at the specified byte offsets.
* @param client
* Client requesting the operation.
* @param extents
* List of extents. See IOStorageExtent. It is legal for the callee to
* overwrite the contents of this buffer in order to satisfy the request.
* @param extentsCount
* Number of extents.
* @param priority
* New priority. See IOStoragePriority.
* @result
* Returns the status of the operation.
*/
virtual IOReturn setPriority(IOService * client,
IOStorageExtent * extents,
UInt32 extentsCount,
IOStoragePriority priority); /* 10.10.0 */
/*!
* @function synchronize
* @discussion
* Flush the cached data in the storage object, if any.
* @param client
* Client requesting the synchronization.
* @param byteStart
* Starting byte offset for the synchronization.
* @param byteCount
* Size of the synchronization. Set to zero to specify the end-of-media.
* @param options
* Options for the synchronization. See IOStorageSynchronizeOptions.
* @result
* Returns the status of the synchronization.
*/
#if TARGET_OS_OSX
virtual IOReturn synchronize(IOService * client,
UInt64 byteStart,
UInt64 byteCount,
IOStorageSynchronizeOptions options = 0); /* 10.11.0 */
#else /* !TARGET_OS_OSX */
virtual IOReturn synchronize(IOService * client,
UInt64 byteStart,
UInt64 byteCount,
IOStorageSynchronizeOptions options = 0) = 0;
#endif /* !TARGET_OS_OSX */
/*!
* @function getProvisionStatus
* @discussion
* Get device block provision status
* @param client
* Client requesting the synchronization.
* @param byteStart
* Byte offset of logical extent on the device.
* @param byteCount
* Byte length of logical extent on the device, 0 mean the entire remaining space.
* @param extentsCount
* Number of extents allocated in extents. On return, this parameter indicate number
* of provision extents returned.
* @param extents
* List of provision extents. See IOStorageProvisionExtents.
* @param options
* Options for get provision status. See IOStorageGetProvisionStatusOptions.
* @result
* Returns the status of the getProvisionStatus.
*/
virtual IOReturn getProvisionStatus(IOService * client,
UInt64 byteStart,
UInt64 byteCount,
UInt32 * extentsCount,
IOStorageProvisionExtent * extents,
IOStorageGetProvisionStatusOptions options = 0 ); /* 10.12.0 */
OSMetaClassDeclareReservedUsed(IOStorage, 0);
OSMetaClassDeclareReservedUsed(IOStorage, 1);
OSMetaClassDeclareReservedUsed(IOStorage, 2);
OSMetaClassDeclareReservedUsed(IOStorage, 3);
OSMetaClassDeclareReservedUsed(IOStorage, 4);
OSMetaClassDeclareReservedUsed(IOStorage, 5);
OSMetaClassDeclareReservedUsed(IOStorage, 6);
OSMetaClassDeclareReservedUnused(IOStorage, 7);
OSMetaClassDeclareReservedUnused(IOStorage, 8);
OSMetaClassDeclareReservedUnused(IOStorage, 9);
OSMetaClassDeclareReservedUnused(IOStorage, 10);
OSMetaClassDeclareReservedUnused(IOStorage, 11);
OSMetaClassDeclareReservedUnused(IOStorage, 12);
OSMetaClassDeclareReservedUnused(IOStorage, 13);
OSMetaClassDeclareReservedUnused(IOStorage, 14);
OSMetaClassDeclareReservedUnused(IOStorage, 15);
};
#if TARGET_OS_OSX
#ifdef KERNEL_PRIVATE
#define _kIOStorageSynchronizeOption_super__synchronizeCache 0xFFFFFFFF
#define _respondsTo_synchronizeCache ( IOStorage::_expansionData )
#endif /* KERNEL_PRIVATE */
#endif /* TARGET_OS_OSX */
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOSTORAGE_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IODVDBlockStorageDriver.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* IODVDBlockStorageDriver.h
*
* This class implements DVD functionality, independent of
* the physical connection protocol (e.g. SCSI, ATA, USB).
*
* A protocol-specific provider implements the functionality using an appropriate
* protocol and commands.
*/
#ifndef _IODVDBLOCKSTORAGEDRIVER_H
#define _IODVDBLOCKSTORAGEDRIVER_H
#include <IOKit/IOTypes.h>
#include <IOKit/storage/IOCDBlockStorageDriver.h>
#include <IOKit/storage/IODVDBlockStorageDevice.h>
#include <IOKit/storage/IODVDTypes.h>
/*
* @defined kIODVDBlockStorageDriverClass
* @abstract
* kIODVDBlockStorageDriverClass is the name of the IODVDBlockStorageDriver class.
* @discussion
* kIODVDBlockStorageDriverClass is the name of the IODVDBlockStorageDriver class.
*/
#define kIODVDBlockStorageDriverClass "IODVDBlockStorageDriver"
class IODVDBlockStorageDevice;
/*
* @class
* IODVDBlockStorageDriver : public IOCDBlockStorageDriver
* @abstract
* Generic DVD Driver.
* @discussion
* Storage drivers are split into two parts: the Generic Driver handles
* all generic device issues, independent of the lower-level transport
* mechanism (e.g. SCSI, ATA, USB, FireWire). All storage operations
* at the Generic Driver level are translated into a series of generic
* device operations. These operations are passed via the Device Nub
* to a Transport Driver, which implements the appropriate
* transport-dependent protocol to execute these operations.
*
* To determine the write-protect state of a device (or media), for
* example, the generic driver would issue a call to the
* Transport Driver's reportWriteProtection method. If this were a SCSI
* device, its Transport Driver would issue a Mode Sense command to
* extract the write-protection status bit. The Transport Driver then
* reports true or false to the generic driver.
*
* The generic driver therefore has no knowledge of, or involvement
* with, the actual commands and mechanisms used to communicate with
* the device. It is expected that the generic driver will rarely, if
* ever, need to be subclassed to handle device idiosyncrasies; rather,
* the Transport Driver should be changed via overrides.
*
* A generic driver could be subclassed to create a different type of
* generic device. The generic driver IODVDBlockStorageDriver class is a subclass
* of IOCDBlockStorageDriver, adding DVD functions. Similarly, the Transport Driver
* IODVDBlockStorageDevice is a subclass of IOCDBlockStorageDevice, adding DVD
* functions.
*/
class IODVDBlockStorageDriver : public IOCDBlockStorageDriver {
OSDeclareDefaultStructors(IODVDBlockStorageDriver)
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
/* Overrides of IOCDBlockStorageDriver. */
virtual IOReturn acceptNewMedia(void);
/* End of IOCDBlockStorageDriver overrides. */
public:
/*
* Obtain this object's provider. We override the superclass's method to
* return a more specific subclass of IOService -- IODVDBlockStorageDevice.
* This method serves simply as a convenience to subclass developers.
*/
virtual IODVDBlockStorageDevice * getProvider() const;
/* Overrides of IOCDBlockStorageDriver: */
virtual const char * getDeviceTypeName(void);
virtual IOMedia * instantiateDesiredMediaObject(void);
virtual IOMedia * instantiateMediaObject(UInt64 base,UInt64 byteSize,
UInt32 blockSize,char *mediaName);
/* End of IOCDBlockStorageDriver overrides. */
/*
* @function reportKey
* @abstract
* Get key info from the DVD drive.
* @discussion
* This function handles the getting of key- and encryption-related data for the drive.
* @param buffer
* A buffer containing information, as documented in the specification
* "MtFuji Commands For Multimedia Devices."
* @param keyClass
* As documented by MtFuji. See DVDKeyClass.
* @param lba
* As documented by MtFuji.
* @param agid
* As documented by MtFuji.
* @param keyFormat
* As documented by MtFuji. See DVDKeyFormat.
*/
virtual IOReturn reportKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass,
const UInt32 lba,const UInt8 agid,const DVDKeyFormat keyFormat) __attribute__ ((deprecated));
/*
* @function sendKey
* @abstract
* Send key info to the DVD drive.
* @discussion
* This function handles the setting of key- and encryption-related data for the drive.
* @param buffer
* A buffer containing information, as documented in the specification
* "MtFuji Commands For Multimedia Devices."
* @param keyClass
* As documented by MtFuji. See DVDKeyClass.
* @param agid
* As documented by MtFuji.
* @param keyFormat
* As documented by MtFuji. See DVDKeyFormat.
*/
virtual IOReturn sendKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass,
const UInt8 agid,const DVDKeyFormat keyFormat);
/*
* @function readStructure
* @abstract
* Get control structures from the DVD media.
* @discussion
* This function handles the getting of control structure data for the media.
* @param buffer
* A buffer containing information, as documented in the specification
* "MtFuji Commands For Multimedia Devices."
* @param format
* As documented by MtFuji. See DVDStructureFormat.
* @param address
* As documented by MtFuji.
* @param layer
* As documented by MtFuji.
* @param agid
* As documented by MtFuji.
*/
virtual IOReturn readStructure(IOMemoryDescriptor *buffer,const DVDStructureFormat format,
const UInt32 address,const UInt8 layer,const UInt8 agid);
/*
* @function reportKey
* @abstract
* Get key info from the DVD drive.
* @discussion
* This function handles the getting of key- and encryption-related data for the drive.
* @param buffer
* A buffer containing information, as documented in the specification
* "MtFuji Commands For Multimedia Devices."
* @param keyClass
* As documented by MtFuji. See DVDKeyClass.
* @param lba
* As documented by MtFuji.
* @param blockCount
* As documented by MMC
* @param agid
* As documented by MtFuji.
* @param keyFormat
* As documented by MtFuji. See DVDKeyFormat.
*/
virtual IOReturn reportKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass,
const UInt32 lba,const UInt8 blockCount,
const UInt8 agid,const DVDKeyFormat keyFormat);
OSMetaClassDeclareReservedUsed(IODVDBlockStorageDriver, 0); /* reportKey */
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 1);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 2);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 3);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 4);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 5);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 6);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 7);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 8);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 9);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 10);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 11);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 12);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 13);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 14);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 15);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 16);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 17);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 18);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 19);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 20);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 21);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 22);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 23);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 24);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 25);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 26);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 27);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 28);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 29);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 30);
OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 31);
};
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOBDTypes.h | /*
* Copyright (c) 2006-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _BDTYPES_H
#define _BDTYPES_H
#include <IOKit/IOTypes.h>
#pragma pack(push, 1) /* (enable 8-bit struct packing) */
/*
* Media Types
*/
enum
{
kBDMediaTypeUnknown = 0x0300,
kBDMediaTypeROM = 0x0302, /* BD-ROM */
kBDMediaTypeRE = 0x0303, /* BD-RE */
kBDMediaTypeR = 0x0304, /* BD-R */
kBDMediaTypeMin = 0x0300,
kBDMediaTypeMax = 0x03FF
};
typedef UInt32 BDMediaType;
/*
* Media Speed (kB/s)
*/
#define kBDSpeedMin 0x1126
#define kBDSpeedMax 0xFFFF
/*
* MMC Formats
*/
// Read Disc Information Format
struct BDDiscInfo
{
UInt16 dataLength;
#ifdef __LITTLE_ENDIAN__
UInt8 discStatus:2;
UInt8 stateOfLastSession:2;
UInt8 erasable:1;
UInt8 dataType:3;
#else /* !__LITTLE_ENDIAN__ */
UInt8 dataType:3;
UInt8 erasable:1;
UInt8 stateOfLastSession:2;
UInt8 discStatus:2;
#endif /* !__LITTLE_ENDIAN__ */
UInt8 reserved2;
UInt8 numberOfSessionsLSB;
UInt8 firstTrackNumberInLastSessionLSB;
UInt8 lastTrackNumberInLastSessionLSB;
UInt8 reserved4[2];
UInt8 numberOfSessionsMSB;
UInt8 firstTrackNumberInLastSessionMSB;
UInt8 lastTrackNumberInLastSessionMSB;
UInt8 reserved6[22];
};
typedef struct BDDiscInfo BDDiscInfo;
// Read Track Information Format
struct BDTrackInfo
{
UInt16 dataLength;
UInt8 trackNumberLSB;
UInt8 sessionNumberLSB;
UInt8 reserved;
#ifdef __LITTLE_ENDIAN__
UInt8 reserved2:5;
UInt8 damage:1;
UInt8 reserved3:2;
UInt8 reserved4:6;
UInt8 blank:1;
UInt8 reservedTrack:1;
UInt8 nextWritableAddressValid:1;
UInt8 lastRecordedAddressValid:1;
UInt8 reserved5:6;
#else /* !__LITTLE_ENDIAN__ */
UInt8 reserved3:2;
UInt8 damage:1;
UInt8 reserved2:5;
UInt8 reservedTrack:1;
UInt8 blank:1;
UInt8 reserved4:6;
UInt8 reserved5:6;
UInt8 lastRecordedAddressValid:1;
UInt8 nextWritableAddressValid:1;
#endif /* !__LITTLE_ENDIAN__ */
UInt32 trackStartAddress;
UInt32 nextWritableAddress;
UInt32 freeBlocks;
UInt32 clusterSize;
UInt32 trackSize;
UInt32 lastRecordedAddress;
UInt8 trackNumberMSB;
UInt8 sessionNumberMSB;
UInt8 reserved6;
UInt8 reserved7;
};
typedef struct BDTrackInfo BDTrackInfo;
#pragma pack(pop) /* (reset to default struct packing) */
#endif /* _BDTYPES_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IODVDMediaBSDClient.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IODVDMEDIABSDCLIENT_H
#define _IODVDMEDIABSDCLIENT_H
#include <sys/ioctl.h>
#include <IOKit/storage/IODVDTypes.h>
/*
* Definitions
*
* ioctl description
* ---------------------------- ------------------------------------------------
* DKIOCDVDREADSTRUCTURE see IODVDMedia::readStructure() in IODVDMedia.h
*
* DKIOCDVDREADDISCINFO see IODVDMedia::readDiscInfo() in IODVDMedia.h
* DKIOCDVDREADRZONEINFO see IODVDMedia::readRZoneInfo() in IODVDMedia.h
*
* DKIOCDVDREPORTKEY see IODVDMedia::reportKey() in IODVDMedia.h
* DKIOCDVDSENDKEY see IODVDMedia::sendKey() in IODVDMedia.h
*
* DKIOCDVDGETSPEED see IODVDMedia::getSpeed() in IODVDMedia.h
* DKIOCDVDSETSPEED see IODVDMedia::setSpeed() in IODVDMedia.h
*
* in /System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/
*/
typedef struct
{
uint8_t format;
uint8_t reserved0008[3]; /* reserved, clear to zero */
uint32_t address;
uint8_t grantID;
uint8_t layer;
#ifdef __LP64__
uint8_t reserved0080[4]; /* reserved, clear to zero */
#endif /* __LP64__ */
uint16_t bufferLength;
void * buffer;
} dk_dvd_read_structure_t;
typedef struct
{
uint8_t format;
uint8_t keyClass;
uint8_t blockCount;
uint8_t reserved0024[1]; /* reserved, clear to zero */
uint32_t address;
uint8_t grantID;
#ifdef __LP64__
uint8_t reserved0072[5]; /* reserved, clear to zero */
#else /* !__LP64__ */
uint8_t reserved0072[1]; /* reserved, clear to zero */
#endif /* !__LP64__ */
uint16_t bufferLength;
void * buffer;
} dk_dvd_report_key_t;
typedef struct
{
uint8_t format;
uint8_t keyClass;
uint8_t reserved0016[6]; /* reserved, clear to zero */
uint8_t grantID;
#ifdef __LP64__
uint8_t reserved0072[5]; /* reserved, clear to zero */
#else /* !__LP64__ */
uint8_t reserved0072[1]; /* reserved, clear to zero */
#endif /* !__LP64__ */
uint16_t bufferLength;
void * buffer;
} dk_dvd_send_key_t;
typedef struct
{
#ifdef __LP64__
uint8_t reserved0000[14]; /* reserved, clear to zero */
#else /* !__LP64__ */
uint8_t reserved0000[10]; /* reserved, clear to zero */
#endif /* !__LP64__ */
uint16_t bufferLength; /* actual length on return */
void * buffer;
} dk_dvd_read_disc_info_t;
typedef struct
{
uint8_t reserved0000[4]; /* reserved, clear to zero */
uint32_t address;
uint8_t addressType;
#ifdef __LP64__
uint8_t reserved0072[5]; /* reserved, clear to zero */
#else /* !__LP64__ */
uint8_t reserved0072[1]; /* reserved, clear to zero */
#endif /* !__LP64__ */
uint16_t bufferLength; /* actual length on return */
void * buffer;
} dk_dvd_read_rzone_info_t;
#define DKIOCDVDREADSTRUCTURE _IOW('d', 128, dk_dvd_read_structure_t)
#define DKIOCDVDREPORTKEY _IOW('d', 129, dk_dvd_report_key_t)
#define DKIOCDVDSENDKEY _IOW('d', 130, dk_dvd_send_key_t)
#define DKIOCDVDGETSPEED _IOR('d', 131, uint16_t)
#define DKIOCDVDSETSPEED _IOW('d', 131, uint16_t)
#define DKIOCDVDREADDISCINFO _IOWR('d', 132, dk_dvd_read_disc_info_t)
#define DKIOCDVDREADRZONEINFO _IOWR('d', 133, dk_dvd_read_rzone_info_t)
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/storage/IODVDMedia.h>
#include <IOKit/storage/IOMediaBSDClient.h>
/*
* Class
*/
class IODVDMediaBSDClient : public IOMediaBSDClient
{
OSDeclareDefaultStructors(IODVDMediaBSDClient)
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
public:
/*
* Obtain this object's provider. We override the superclass's method
* to return a more specific subclass of IOService -- IODVDMedia. This
* method serves simply as a convenience to subclass developers.
*/
virtual IODVDMedia * getProvider() const;
/*
* Process a DVD-specific ioctl.
*/
virtual int ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, proc_t proc);
OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 0);
OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 1);
OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 2);
OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 3);
OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 4);
OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 5);
OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 6);
OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 7);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IODVDMEDIABSDCLIENT_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOStorageDeviceCharacteristics.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IO_STORAGE_DEVICE_CHARACTERISTICS_H_
#define _IOKIT_IO_STORAGE_DEVICE_CHARACTERISTICS_H_
#include <TargetConditionals.h>
#if TARGET_OS_DRIVERKIT
#include <DriverKit/storage/IOStorageProtocolCharacteristics.h>
#else
#include <IOKit/storage/IOStorageProtocolCharacteristics.h>
#endif
/*
* Device Characteristics - Characteristics defined for devices.
*/
/*!
@defined kIOPropertyDeviceCharacteristicsKey
@discussion This key is used to define Device Characteristics for a particular
device and it has an associated dictionary which lists the
device characteristics. The device characteristics are Command Set specific
and are listed in the header files for each command set.
Requirement: Mandatory
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>Apple</string>
<key>Product Name</key>
<string>iPod</string>
<key>Product Revision Level</key>
<string>1.0</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyDeviceCharacteristicsKey "Device Characteristics"
/*!
@defined kIOPropertyVendorNameKey
@discussion This key is used to define the Vendor Name for a particular device
and it has an associated string.
Requirement: Mandatory
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>Apple</string>
<key>Product Name</key>
<string>iPod</string>
<key>Product Revision Level</key>
<string>1.0</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyVendorNameKey "Vendor Name"
/*!
@defined kIOPropertyProductNameKey
@discussion This key is used to define the Product Name for a particular device
and it has an associated string.
Requirement: Mandatory
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>Apple</string>
<key>Product Name</key>
<string>iPod</string>
<key>Product Revision Level</key>
<string>1.0</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyProductNameKey "Product Name"
/*!
@defined kIOPropertyProductRevisionLevelKey
@discussion This key is used to define the Product Revision Level for a
particular device and it has an associated string.
Requirement: Mandatory
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>Apple</string>
<key>Product Name</key>
<string>iPod</string>
<key>Product Revision Level</key>
<string>1.0</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyProductRevisionLevelKey "Product Revision Level"
/*!
@defined kIOPropertyProductSerialNumberKey
@discussion This key is used to define the Product Serial Number for a
particular device and it has an associated data.
Requirement: Mandatory
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>Apple</string>
<key>Product Name</key>
<string>iPod</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Serial Number</key>
<string>123456789</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyProductSerialNumberKey "Serial Number"
/*!
@defined kIOPropertySupportedCDFeaturesKey
@discussion This key is used to define the supported CD Features for a
particular optical device and it has an associated bitfield. See
<IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> for definitions of the
bits and associated bitmasks.
Requirement: Mandatory for optical devices (Peripheral Device Type 05h).
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>Apple</string>
<key>Product Name</key>
<string>SuperDrive</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>CD Features</key>
<integer>1663</integer>
<key>DVD Features</key>
<integer>103</integer>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertySupportedCDFeaturesKey "CD Features"
/*!
@defined kIOPropertySupportedDVDFeaturesKey
@discussion This key is used to define the supported DVD Features for a
particular optical device and it has an associated bitfield. See
<IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> for definitions of the
bits and associated bitmasks.
Requirement: Mandatory for optical devices (Peripheral Device Type 05h).
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>Apple</string>
<key>Product Name</key>
<string>SuperDrive</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>CD Features</key>
<integer>1663</integer>
<key>DVD Features</key>
<integer>103</integer>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertySupportedDVDFeaturesKey "DVD Features"
/*!
@defined kIOPropertySupportedBDFeaturesKey
@discussion This key is used to define the supported BD Features for a
particular optical device and it has an associated bitfield. See
<IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> for definitions of the
bits and associated bitmasks.
Requirement: Mandatory for optical devices (Peripheral Device Type 05h).
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>Apple</string>
<key>Product Name</key>
<string>SuperDrive</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>CD Features</key>
<integer>1663</integer>
<key>DVD Features</key>
<integer>103</integer>
<key>BD Features</key>
<integer>21</integer>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertySupportedBDFeaturesKey "BD Features"
/*!
@defined kIOPropertyRigidDiskGeometryKey
@discussion This key is used to define a dictionary containing
rigid disk geometry information.
Requirement: Optional. If a device publishes this dictionary, it
must publish all key/value pairs which are deemed Mandatory.
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>Apple</string>
<key>Product Name</key>
<string>iPod</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Rigid Disk Geometry</key>
<dict>
<key>Sector Count per Track</key>
<integer>12345</integer>
<key>Head Count</key>
<integer>12</integer>
<key>Cylinder Count</key>
<integer>12345</integer>
<key>Bytes per Physical Sector</key>
<integer>512</integer>
</dict>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyRigidDiskGeometryKey "Rigid Disk Geometry"
/*!
@defined kIOPropertySectorCountPerTrackKey
@discussion This key is used to define the number of sectors per
each track for a particular medium.
Requirement: Mandatory element of the Rigid Disk Geometry dictionary.
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>Apple</string>
<key>Product Name</key>
<string>iPod</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Rigid Disk Geometry</key>
<dict>
<key>Sector Count per Track</key>
<integer>12345</integer>
</dict>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertySectorCountPerTrackKey "Sector Count per Track"
/*!
@defined kIOPropertyHeadCountKey
@discussion This key is used to define the number of heads for
a particular medium.
Requirement: Mandatory element of the Rigid Disk Geometry dictionary.
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>Apple</string>
<key>Product Name</key>
<string>iPod</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Rigid Disk Geometry</key>
<dict>
<key>Sector Count per Track</key>
<integer>12345</integer>
<key>Head Count</key>
<integer>12</integer>
<key>Cylinder Count</key>
<integer>12345</integer>
<key>Bytes per Physical Sector</key>
<integer>512</integer>
</dict>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyHeadCountKey "Head Count"
/*!
@defined kIOPropertyCylinderCountKey
@discussion This key is used to define the number of heads for
a particular medium.
Requirement: Mandatory element of the Rigid Disk Geometry dictionary.
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>Apple</string>
<key>Product Name</key>
<string>iPod</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Rigid Disk Geometry</key>
<dict>
<key>Sector Count per Track</key>
<integer>12345</integer>
<key>Head Count</key>
<integer>12</integer>
<key>Cylinder Count</key>
<integer>12345</integer>
<key>Bytes per Physical Sector</key>
<integer>512</integer>
</dict>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyCylinderCountKey "Cylinder Count"
/*!
@defined kIOPropertyBytesPerPhysicalSectorKey
@discussion This key is used to define the number of heads for
a particular medium.
Requirement: Mandatory element of the Rigid Disk Geometry dictionary.
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>Apple</string>
<key>Product Name</key>
<string>iPod</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Rigid Disk Geometry</key>
<dict>
<key>Sector Count per Track</key>
<integer>12345</integer>
<key>Head Count</key>
<integer>12</integer>
<key>Cylinder Count</key>
<integer>12345</integer>
<key>Bytes per Physical Sector</key>
<integer>512</integer>
</dict>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyBytesPerPhysicalSectorKey "Bytes per Physical Sector"
/*!
@defined kIOPropertyPhysicalBlockSizeKey
@discussion This key is used to define the physical block size of a hard disk drive.
Requirement: Mandatory for hard disk drives with physical block size other than 512 bytes.
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>Apple</string>
<key>Product Name</key>
<string>iPod</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Physical Block Size</key>
<integer>4096</integer>
<key>Logical Block Size</key>
<integer>512</integer>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalBlockSizeKey "Physical Block Size"
/*!
@defined kIOPropertyLogicalBlockSizeKey
@discussion This key is used to define the logical block size of a hard disk drive.
Requirement: Mandatory for hard disk drives with logical block size other than 512 bytes
or that does not match its physical block size.
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>Apple</string>
<key>Product Name</key>
<string>iPod</string>
<key>Product Revision Level</key>
<string>1.0</string>
<key>Physical Block Size</key>
<integer>4096</integer>
<key>Logical Block Size</key>
<integer>512</integer>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyLogicalBlockSizeKey "Logical Block Size"
/*!
@defined kIOPropertyTargetDiskModeKey
@discussion This key is used to indicate the device is another computer in Target Disk Mode.
Requirement: Optional.
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>AAPL</string>
<key>Product Name</key>
<string>FireWire Target</string>
<key>Product Revision Level</key>
<string>0000</string>
<key>Target Disk Mode</key>
<true/>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyTargetDiskModeKey "Target Disk Mode"
/*!
@defined kIOPropertyInvalidStartupDiskKey
@discussion This key is used to denote devices when cannot be used as a startup disk.
Requirement: Optional.
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>APPLE</string>
<key>Product Name</key>
<string>Target Disk Mode</string>
<key>Product Revision Level</key>
<string>0000</string>
<key>Invalid Startup Disk</key>
<true/>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyInvalidStartupDiskKey "Invalid Startup Disk"
/*!
@defined kIOPropertyMediumTypeKey
@discussion This key is used to indicate the medium type of the device.
Requirement: Optional.
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>AAPL</string>
<key>Product Name</key>
<string>FireWire Target</string>
<key>Product Revision Level</key>
<string>0000</string>
<key>Medium Type</key>
<string>Rotational</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyMediumTypeKey "Medium Type"
/*!
@defined kIOPropertyMediumTypeRotationalKey
@discussion This key is used to indicate the medium type of the device is rotational.
Requirement: Optional.
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>AAPL</string>
<key>Product Name</key>
<string>FireWire Target</string>
<key>Product Revision Level</key>
<string>0000</string>
<key>Medium Type</key>
<string>Rotational</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyMediumTypeRotationalKey "Rotational"
/*!
@defined kIOPropertyMediumTypeSolidStateKey
@discussion This key is used to indicate the medium type of the device is solid state.
Requirement: Optional.
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>AAPL</string>
<key>Product Name</key>
<string>FireWire Target</string>
<key>Product Revision Level</key>
<string>0000</string>
<key>Medium Type</key>
<string>Solid State</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyMediumTypeSolidStateKey "Solid State"
/*!
@defined kIOPropertyMediumRotationRateKey
@discussion This key is used to indicate the medium rotation rate in RPM of the device.
Requirement: Optional.
Example:
<pre>
@textblock
<dict>
<key>Device Characteristics</key>
<dict>
<key>Vendor Name</key>
<string>AAPL</string>
<key>Product Name</key>
<string>FireWire Target</string>
<key>Product Revision Level</key>
<string>0000</string>
<key>Rotation Rate</key>
<integer>7200</integer>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyMediumRotationRateKey "Rotation Rate"
#endif /* _IOKIT_IO_STORAGE_DEVICE_CHARACTERISTICS_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOFDiskPartitionScheme.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* This header contains the IOFDiskPartitionScheme class definition.
*/
#ifndef _IOFDISKPARTITIONSCHEME_H
#define _IOFDISKPARTITIONSCHEME_H
#include <IOKit/IOTypes.h>
/*
* kIOFDiskPartitionSchemeClass is the name of the IOFDiskPartitionScheme class.
*/
#define kIOFDiskPartitionSchemeClass "IOFDiskPartitionScheme"
/*
* FDisk Partition Map Definitions
*/
#pragma pack(push, 1) /* (enable 8-bit struct packing) */
/* Structure constants. */
#define DISK_BLK0SZ sizeof(struct disk_blk0) /* (size of partition map) */
#define DISK_BOOTSZ 446 /* (size of boot code in map) */
#define DISK_NPART 4 /* (number of entries in map) */
/* Partition map entry. */
struct fdisk_part
{
UInt8 bootid; /* (is active boot partition?) */
UInt8 beghead; /* (beginning head) */
UInt8 begsect; /* (beginning sector; beginning cylinder, high 2 bits) */
UInt8 begcyl; /* (beginning cylinder, low 8 bits) */
UInt8 systid; /* (type) */
UInt8 endhead; /* (ending head) */
UInt8 endsect; /* (ending sector; ending cylinder, high 2 bits) */
UInt8 endcyl; /* (ending cylinder, low 8 bits) */
UInt32 relsect; /* (block start) */
UInt32 numsect; /* (block count) */
};
/* Partition map, as found in block zero of the disk (or extended partition). */
struct disk_blk0
{
UInt8 bootcode[DISK_BOOTSZ]; /* (boot code) */
struct fdisk_part parts[DISK_NPART]; /* (partition entries) */
UInt16 signature; /* (unique signature for map) */
};
/* Partition map signature (signature). */
#define DISK_SIGNATURE 0xAA55
/* Partition map entry types (systid). */
#define FDISK_PARTITION_TYPE_01 "DOS_FAT_12"
#define FDISK_PARTITION_TYPE_04 "DOS_FAT_16_S"
#define FDISK_PARTITION_TYPE_06 "DOS_FAT_16"
#define FDISK_PARTITION_TYPE_07 "Windows_NTFS"
#define FDISK_PARTITION_TYPE_0B "DOS_FAT_32"
#define FDISK_PARTITION_TYPE_0C "Windows_FAT_32"
#define FDISK_PARTITION_TYPE_0E "Windows_FAT_16"
#define FDISK_PARTITION_TYPE_42 "Windows_LDM"
#define FDISK_PARTITION_TYPE_82 "Linux_Swap"
#define FDISK_PARTITION_TYPE_83 "Linux"
#define FDISK_PARTITION_TYPE_8E "Linux_LVM"
#define FDISK_PARTITION_TYPE_A5 "FreeBSD"
#define FDISK_PARTITION_TYPE_A6 "OpenBSD"
#define FDISK_PARTITION_TYPE_A7 "Apple_Rhapsody_UFS"
#define FDISK_PARTITION_TYPE_A8 "Apple_UFS"
#define FDISK_PARTITION_TYPE_A9 "NetBSD"
#define FDISK_PARTITION_TYPE_AB "Apple_Boot"
#define FDISK_PARTITION_TYPE_AE "Apple_Encrypted"
#define FDISK_PARTITION_TYPE_AF "Apple_HFS"
#define FDISK_PARTITION_TYPE_FD "Linux_RAID"
#pragma pack(pop) /* (reset to default struct packing) */
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/storage/IOPartitionScheme.h>
/*
* Class
*/
class __exported IOFDiskPartitionScheme : public IOPartitionScheme
{
OSDeclareDefaultStructors(IOFDiskPartitionScheme);
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
OSSet * _partitions; /* (set of media objects representing partitions) */
/*
* Free all of this object's outstanding resources.
*/
virtual void free(void) APPLE_KEXT_OVERRIDE;
/*
* Scan the provider media for an FDisk partition map. Returns the set
* of media objects representing each of the partitions (the retain for
* the set is passed to the caller), or null should no partition map be
* found. The default probe score can be adjusted up or down, based on
* the confidence of the scan.
*/
virtual OSSet * scan(SInt32 * score);
/*
* Ask whether the given partition is extended.
*/
virtual bool isPartitionExtended(fdisk_part * partition);
/*
* Ask whether the given partition is used.
*/
virtual bool isPartitionUsed(fdisk_part * partition);
/*
* Ask whether the given partition appears to be corrupt. A partition that
* is corrupt will cause the failure of the FDisk partition map recognition
* altogether.
*/
virtual bool isPartitionCorrupt( fdisk_part * partition,
UInt32 partitionID,
UInt32 fdiskBlock );
/*
* Ask whether the given partition appears to be invalid. A partition that
* is invalid will cause it to be skipped in the scan, but will not cause a
* failure of the FDisk partition map recognition.
*/
virtual bool isPartitionInvalid( fdisk_part * partition,
UInt32 partitionID,
UInt32 fdiskBlock );
/*
* Instantiate a new media object to represent the given partition.
*/
virtual IOMedia * instantiateMediaObject( fdisk_part * partition,
UInt32 partitionID,
UInt32 fdiskBlock );
/*
* Allocate a new media object (called from instantiateMediaObject).
*/
virtual IOMedia * instantiateDesiredMediaObject( fdisk_part * partition,
UInt32 partitionID,
UInt32 fdiskBlock );
public:
/*
* Initialize this object's minimal state.
*/
virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE;
/*
* Determine whether the provider media contains an FDisk partition map.
*/
virtual IOService * probe(IOService * provider, SInt32 * score) APPLE_KEXT_OVERRIDE;
/*
* Publish the new media objects which represent our partitions.
*/
virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE;
/*
* Clean up after the media objects we published before terminating.
*/
virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE;
/*
* Request that the provider media be re-scanned for partitions.
*/
virtual IOReturn requestProbe(IOOptionBits options) APPLE_KEXT_OVERRIDE;
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 0);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 1);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 2);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 3);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 4);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 5);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 6);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 7);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 8);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 9);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 10);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 11);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 12);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 13);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 14);
OSMetaClassDeclareReservedUnused(IOFDiskPartitionScheme, 15);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOFDISKPARTITIONSCHEME_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOMedia.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
* @header IOMedia
* @abstract
* This header contains the IOMedia class definition.
*/
#ifndef _IOMEDIA_H
#define _IOMEDIA_H
#include <IOKit/IOTypes.h>
/*!
* @defined kIOMediaClass
* @abstract
* The name of the IOMedia class.
*/
#define kIOMediaClass "IOMedia"
/*!
* @defined kIOMediaContentKey
* @abstract
* A property of IOMedia objects.
* @discussion
* The kIOMediaContentKey property has an OSString
* value and contains a description of the media's
* contents. The description is the same as the hint at the time of the
* object's creation, but it is possible that the description has been overridden
* by a client (which has probed the media and identified the content correctly)
* of the media object. It is more accurate than the hint for this reason. The
* string is formed in the likeness of Apple's "Apple_HFS" strings or in the
* likeness of a UUID.
*/
#define kIOMediaContentKey "Content"
/*!
* @defined kIOMediaContentHintKey
* @abstract
* A property of IOMedia objects.
* @discussion
* The kIOMediaContentHintKey property has an OSString
* value and contains a hint of the media's contents.
* The hint is set at the time of the object's creation, should the creator have
* a clue as to what it may contain. The hint string does not change for the
* lifetime of the object and is formed in the likeness of Apple's "Apple_HFS"
* strings or in the likeness of a UUID.
*/
#define kIOMediaContentHintKey "Content Hint"
/*!
* @defined kIOMediaEjectableKey
* @abstract
* A property of IOMedia objects.
* @discussion
* The kIOMediaEjectableKey property has an OSBoolean
* value and describes whether the media is ejectable
* from the drive mechanism under software control. Implies IOMediaRemovable
* is also true.
*/
#define kIOMediaEjectableKey "Ejectable"
/*!
* @defined kIOMediaLeafKey
* @abstract
* A property of IOMedia objects.
* @discussion
* The kIOMediaLeafKey property has an OSBoolean value and describes whether the media is a leaf, that is,
* it is the deepest media object in this branch of the I/O Registry.
*/
#define kIOMediaLeafKey "Leaf"
/*!
* @defined kIOMediaOpenKey
* @abstract
* A property of IOMedia objects.
* @discussion
* The kIOMediaOpenKey property has an OSBoolean value and describes whether
* a client presently has an open on this media.
*/
#define kIOMediaOpenKey "Open"
/*!
* @defined kIOMediaPreferredBlockSizeKey
* @abstract
* A property of IOMedia objects.
* @discussion
* The kIOMediaPreferredBlockSizeKey property has an
* OSNumber value and describes the media's natural
* block size in bytes. This information is useful to clients that want to
* optimize access to the media.
*/
#define kIOMediaPreferredBlockSizeKey "Preferred Block Size"
/*!
* @defined kIOMediaRemovableKey
* @abstract
* A property of IOMedia objects.
* @discussion
* The kIOMediaRemovableKey property has an OSBoolean
* value and describes whether the media is removable
* from the drive mechanism.
*/
#define kIOMediaRemovableKey "Removable"
/*!
* @defined kIOMediaSizeKey
* @abstract
* A property of IOMedia objects.
* @discussion
* The kIOMediaSizeKey property has an OSNumber value and describes the total length of the media in
* bytes.
*/
#define kIOMediaSizeKey "Size"
/*!
* @defined kIOMediaUUIDKey
* @abstract
* A property of IOMedia objects.
* @discussion
* The kIOMediaUUIDKey property has an OSString value and contains a persistent
* Universal Unique Identifier for the media if such an identifier is available.
*/
#define kIOMediaUUIDKey "UUID"
/*!
* @defined kIOMediaWholeKey
* @abstract
* A property of IOMedia objects.
* @discussion
* The kIOMediaWholeKey property has an OSBoolean
* value and describes whether the media is whole, that is,
* it represents the whole disk (the physical disk, or a virtual replica
* thereof).
*/
#define kIOMediaWholeKey "Whole"
/*!
* @defined kIOMediaWritableKey
* @abstract
* A property of IOMedia objects.
* @discussion
* The kIOMediaWritableKey property has an OSBoolean
* value and describes whether the media is writable.
*/
#define kIOMediaWritableKey "Writable"
/*!
* @defined kIOMediaContentMaskKey
* @abstract
* A property of IOMedia clients.
* @discussion
* The kIOMediaContentMaskKey property has an OSString
* value and must exist in all IOMedia clients that
* drive new content (that is, produce new media objects). When the client
* matches against the provider media, the value of the client's
* kIOMediaContentMaskKey property is used to replace the provider's
* kIOMediaContentKey property.
*/
#define kIOMediaContentMaskKey "Content Mask"
/*!
* @defined kIOMediaIconKey
* @abstract
* A property of any object in the media stack.
* @discussion
* kIOMediaIconKey is a property of any object in the media stack that wishes
* to override the default icon shown for the media objects in the stack. It
* is usually defined in a provider object below the media object. It has an
* OSDictionary value, with properties identical to the kIOIconKey definition,
* that is, kCFBundleIdentifierKey and kIOBundleResourceFileKey.
*/
#define kIOMediaIconKey "IOMediaIcon"
/*!
* @defined kIOMediaInvalidStartupDiskKey
* @abstract
* A property of IOMedia objects.
* @discussion
* The kIOMediaInvalidStartupDiskKey property has an OSBoolean
* value and describes whether the media cannot be used as a startup disk
*/
#define kIOMediaInvalidStartupDiskKey "Invalid Startup Disk"
/*!
* @enum IOMediaAttributeMask
* @discussion
* The IOMediaAttributeMask bit mask describes various attributes of
* the media object, such as its ejectability and its removability.
* @constant kIOMediaAttributeEjectableMask
* Indicates whether the media is ejectable from the drive mechanism
* under software control. Implies kIOMediaAttributeRemovableMask.
* @constant kIOMediaAttributeRemovableMask
* Indicates whether the media is removable from the drive mechanism.
*/
enum
{
kIOMediaAttributeEjectableMask = 0x00000001,
kIOMediaAttributeRemovableMask = 0x00000002,
kIOMediaAttributeReservedMask = 0xFFFFFFFC
};
typedef UInt32 IOMediaAttributeMask;
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/storage/IOStorage.h>
/*!
* @class IOMedia
* @abstract
* A random-access disk device abstraction.
* @discussion
* The IOMedia class is a random-access disk device abstraction. It provides a
* consistent interface for both real and virtual disk devices, for subdivisions
* of disks such as partitions, for supersets of disks such as RAID volumes, and
* so on. It extends the IOStorage class by implementing the appropriate open,
* close, read, write, and matching semantics for media objects. The properties
* it has reflect the properties of real disk devices, such as ejectability and
* writability.
*
* The read and write interfaces support byte-level access to the storage space,
* with the appropriate deblocking handled by the block storage driver, however,
* a typical client will want to get the natural block size in order to optimize
* access to the real disk device. A read or write is accepted so long as the
* client's access is valid, the media is formatted and the transfer is within
* the bounds of the media. An optional non-zero base (offset) is then applied
* before the read or write is passed to the provider object.
*/
class __exported IOMedia : public IOStorage
{
OSDeclareDefaultStructors(IOMedia)
protected:
#ifdef KERNEL_PRIVATE
struct ExpansionData {
IOLock * _lock;
OSArray * _probeList;
bool _needRegisterService;
};
#define mediaManagementLock ( IOMedia::_expansionData->_lock )
#define mediaProbeList ( IOMedia::_expansionData->_probeList )
#define mediaNeedRegisterService ( IOMedia::_expansionData->_needRegisterService )
#else /* KERNEL_PRIVATE */
struct ExpansionData { /* */ };
#endif /* KERNEL_PRIVATE */
ExpansionData * _expansionData;
UInt32 _attributes;
bool _isWhole;
bool _isWritable;
UInt64 _mediaBase; /* (relative to the storage object below us) */
UInt64 _mediaSize;
IOStorageAccess _openLevel;
OSDictionary * _openClients;
UInt32 _reserved0320;
UInt64 _preferredBlockSize;
/*
* Free all of this object's outstanding resources.
*/
virtual void free() APPLE_KEXT_OVERRIDE;
/*!
* @function handleOpen
* @discussion
* The handleOpen method grants or denies permission to access this object
* to an interested client. The argument is an IOStorageAccess value that
* specifies the level of access desired -- reader or reader-writer.
*
* This method can be invoked to upgrade or downgrade the access level for
* an existing client as well. The previous access level will prevail for
* upgrades that fail, of course. A downgrade should never fail. If the
* new access level should be the same as the old for a given client, this
* method will do nothing and return success. In all cases, one, singular
* close-per-client is expected for all opens-per-client received.
*
* This implementation replaces the IOService definition of handleOpen().
* @param client
* Client requesting the open.
* @param options
* Options for the open. Set to zero.
* @param access
* Access level for the open. Set to kIOStorageAccessReader or
* kIOStorageAccessReaderWriter.
* @result
* Returns true if the open was successful, false otherwise.
*/
virtual bool handleOpen(IOService * client,
IOOptionBits options,
void * access) APPLE_KEXT_OVERRIDE;
/*!
* @function handleIsOpen
* @discussion
* The handleIsOpen method determines whether the specified client, or any
* client if none is specified, presently has an open on this object.
*
* This implementation replaces the IOService definition of handleIsOpen().
* @param client
* Client to check the open state of. Set to zero to check the open state
* of all clients.
* @result
* Returns true if the client was (or clients were) open, false otherwise.
*/
virtual bool handleIsOpen(const IOService * client) const APPLE_KEXT_OVERRIDE;
/*!
* @function handleClose
* @discussion
* The handleClose method closes the client's access to this object.
*
* This implementation replaces the IOService definition of handleClose().
* @param client
* Client requesting the close.
* @param options
* Options for the close. Set to zero.
*/
virtual void handleClose(IOService * client, IOOptionBits options) APPLE_KEXT_OVERRIDE;
#ifdef KERNEL_PRIVATE
private:
void scheduleProbe ( IOService * driver );
void scheduleRegisterService( void );
public:
/*!
* @function close
* @abstract Releases active access to a provider.
* @discussion IOService provides generic open and close semantics to track
* clients of a provider that have established an active datapath. The use
* of open and close, and rules regarding * ownership are family defined,
* and defined by the handleOpen and handleClose methods in the provider.
* @param client Designates the client of the provider requesting the
* close.
* @param options Options available for the close. The provider family may
* implement options for close; IOService defines none.
*/
virtual void close( IOService * client,
IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE;
#endif /* KERNEL_PRIVATE */
public:
using IOStorage::read;
using IOStorage::write;
/*
* This method is called for each client interested in the services we
* provide. The superclass links us as a parent to this client in the
* I/O Kit registry on success.
*/
virtual bool attachToChild(IORegistryEntry * client,
const IORegistryPlane * plane) APPLE_KEXT_OVERRIDE;
/*
* This method is called for each client that loses interest in the
* services we provide. The superclass unlinks us from this client
* in the I/O Kit registry on success.
*/
virtual void detachFromChild(IORegistryEntry * client,
const IORegistryPlane * plane) APPLE_KEXT_OVERRIDE;
/*
* Obtain this object's provider. We override the superclass's method to
* return a more specific subclass of OSObject -- IOStorage. This method
* serves simply as a convenience to subclass developers.
*/
virtual IOStorage * getProvider() const APPLE_KEXT_OVERRIDE;
/*
* Compare the properties in the supplied table to this object's properties.
*/
virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score) APPLE_KEXT_OVERRIDE;
/*!
* @function read
* @discussion
* Read data from the storage object at the specified byte offset into the
* specified buffer, asynchronously. When the read completes, the caller
* will be notified via the specified completion action.
*
* The buffer will be retained for the duration of the read.
* @param client
* Client requesting the read.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
*/
virtual void read(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE;
/*!
* @function write
* @discussion
* Write data into the storage object at the specified byte offset from the
* specified buffer, asynchronously. When the write completes, the caller
* will be notified via the specified completion action.
*
* The buffer will be retained for the duration of the write.
* @param client
* Client requesting the write.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
*/
virtual void write(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion) APPLE_KEXT_OVERRIDE;
/*!
* @function synchronize
* @discussion
* Flush the cached data in the storage object, if any.
* @param client
* Client requesting the synchronization.
* @param byteStart
* Starting byte offset for the synchronization.
* @param byteCount
* Size of the synchronization. Set to zero to specify the end-of-media.
* @param options
* Options for the synchronization. See IOStorageSynchronizeOptions.
* @result
* Returns the status of the synchronization.
*/
virtual IOReturn synchronize(IOService * client,
UInt64 byteStart,
UInt64 byteCount,
IOStorageSynchronizeOptions options = 0) APPLE_KEXT_OVERRIDE;
/*!
* @function unmap
* @discussion
* Delete unused data from the storage object at the specified byte offsets.
* @param client
* Client requesting the operation.
* @param extents
* List of extents. See IOStorageExtent. It is legal for the callee to
* overwrite the contents of this buffer in order to satisfy the request.
* @param extentsCount
* Number of extents.
* @param options
* Options for the unmap. See IOStorageUnmapOptions.
* @result
* Returns the status of the operation.
*/
virtual IOReturn unmap(IOService * client,
IOStorageExtent * extents,
UInt32 extentsCount,
IOStorageUnmapOptions options = 0) APPLE_KEXT_OVERRIDE;
/*!
* @function getProvisionStatus
* @discussion
* Get device block provision status
* @param client
* Client requesting the synchronization.
* @param byteStart
* Byte offset of logical extent on the device.
* @param byteCount
* Byte length of logical extent on the device, 0 mean the entire remaining space.
* @param extentsCount
* Number of extents allocated in extents. On return, this parameter indicate number
* of provision extents returned.
* @param extents
* List of provision extents. See IOStorageProvisionExtents.
* @result
* Returns the status of the getProvisionStatus.
*/
virtual IOReturn getProvisionStatus(IOService * client,
UInt64 byteStart,
UInt64 byteCount,
UInt32 * extentsCount,
IOStorageProvisionExtent * extents,
IOStorageGetProvisionStatusOptions options = 0) APPLE_KEXT_OVERRIDE;
/*!
* @function lockPhysicalExtents
* @discussion
* Lock the contents of the storage object against relocation temporarily,
* for the purpose of getting physical extents.
* @param client
* Client requesting the operation.
* @result
* Returns true if the lock was successful, false otherwise.
*/
virtual bool lockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE;
/*!
* @function copyPhysicalExtent
* @discussion
* Convert the specified byte offset into a physical byte offset, relative
* to a physical storage object. This call should only be made within the
* context of lockPhysicalExtents().
* @param client
* Client requesting the operation.
* @param byteStart
* Starting byte offset for the operation. Returns a physical byte offset,
* relative to the physical storage object, on success.
* @param byteCount
* Size of the operation. Returns the actual number of bytes which can be
* transferred, relative to the physical storage object, on success.
* @result
* A reference to the physical storage object, which should be released by
* the caller, or a null on error.
*/
virtual IOStorage * copyPhysicalExtent(IOService * client,
UInt64 * byteStart,
UInt64 * byteCount) APPLE_KEXT_OVERRIDE;
/*!
* @function unlockPhysicalExtents
* @discussion
* Unlock the contents of the storage object for relocation again. This
* call must balance a successful call to lockPhysicalExtents().
* @param client
* Client requesting the operation.
*/
virtual void unlockPhysicalExtents(IOService * client) APPLE_KEXT_OVERRIDE;
/*!
* @function setPriority
* @discussion
* Reprioritize read or write requests at the specified byte offsets.
* @param client
* Client requesting the operation.
* @param extents
* List of extents. See IOStorageExtent. It is legal for the callee to
* overwrite the contents of this buffer in order to satisfy the request.
* @param extentsCount
* Number of extents.
* @param priority
* New priority. See IOStoragePriority.
* @result
* Returns the status of the operation.
*/
virtual IOReturn setPriority(IOService * client,
IOStorageExtent * extents,
UInt32 extentsCount,
IOStoragePriority priority) APPLE_KEXT_OVERRIDE;
/*!
* @function getPreferredBlockSize
* @discussion
* Ask the media object for its natural block size. This information
* is useful to clients that want to optimize access to the media.
* @result
* Natural block size, in bytes.
*/
virtual UInt64 getPreferredBlockSize() const;
/*!
* @function getSize
* @discussion
* Ask the media object for its total length in bytes.
* @result
* Media size, in bytes.
*/
virtual UInt64 getSize() const;
/*!
* @function getBase
* @discussion
* Ask the media object for its byte offset relative to the provider media.
* @result
* Media offset, in bytes.
*/
virtual UInt64 getBase() const;
/*!
* @function isEjectable
* @discussion
* Ask the media object whether it is ejectable.
* @result
* Returns true if the media is ejectable, false otherwise.
*/
virtual bool isEjectable() const;
/*!
* @function isFormatted
* @discussion
* Ask the media object whether it is formatted.
* @result
* Returns true if the media is formatted, false otherwise.
*/
virtual bool isFormatted() const;
/*!
* @function isWhole
* @discussion
* Ask the media object whether it represents the whole disk.
* @result
* Returns true if the media represents the whole disk, false otherwise.
*/
virtual bool isWhole() const;
/*!
* @function isWritable
* @discussion
* Ask the media object whether it is writable.
* @result
* Returns true if the media is writable, false otherwise.
*/
virtual bool isWritable() const;
/*!
* @function getContent
* @discussion
* Ask the media object for a description of its contents. The description
* is the same as the hint at the time of the object's creation, but it is
* possible that the description has been overridden by a client (which has probed
* the media and identified the content correctly) of the media object. It
* is more accurate than the hint for this reason. The string is formed in
* the likeness of Apple's "Apple_HFS" strings or in the likeness of a UUID.
*
* The content description can be overridden by any client that matches onto
* this media object with a match category of kIOStorageCategory. The media
* object checks for a kIOMediaContentMaskKey property in the client, and if
* it finds one, it copies it into kIOMediaContentKey property.
* @result
* Description of media's contents.
*/
virtual const char * getContent() const;
/*!
* @function getContentHint
* @discussion
* Ask the media object for a hint of its contents. The hint is set at the
* time of the object's creation, should the creator have a clue as to what
* it may contain. The hint string does not change for the lifetime of the
* object and is also formed in the likeness of Apple's "Apple_HFS" strings
* or in the likeness of a UUID.
* @result
* Hint of media's contents.
*/
virtual const char * getContentHint() const;
/*!
* @function init
* @discussion
* Initialize this object's minimal state.
* @param base
* Media offset, in bytes.
* @param size
* Media size, in bytes.
* @param preferredBlockSize
* Natural block size, in bytes.
* @param attributes
* Media attributes, such as ejectability and removability. See
* IOMediaAttributeMask.
* @param isWhole
* Indicates whether the media represents the whole disk.
* @param isWritable
* Indicates whether the media is writable.
* @param contentHint
* Hint of media's contents (optional). See getContentHint().
* @param properties
* Substitute property table for this object (optional).
* @result
* Returns true on success, false otherwise.
*/
virtual bool init(UInt64 base,
UInt64 size,
UInt64 preferredBlockSize,
IOMediaAttributeMask attributes,
bool isWhole,
bool isWritable,
const char * contentHint = 0,
OSDictionary * properties = 0);
/*!
* @function getAttributes
* @discussion
* Ask the media object for its attributes.
* @result
* Media attributes, such as ejectability and removability. See
* IOMediaAttributeMask.
*/
virtual IOMediaAttributeMask getAttributes() const;
OSMetaClassDeclareReservedUnused(IOMedia, 0);
OSMetaClassDeclareReservedUnused(IOMedia, 1);
OSMetaClassDeclareReservedUnused(IOMedia, 2);
OSMetaClassDeclareReservedUnused(IOMedia, 3);
OSMetaClassDeclareReservedUnused(IOMedia, 4);
OSMetaClassDeclareReservedUnused(IOMedia, 5);
OSMetaClassDeclareReservedUnused(IOMedia, 6);
OSMetaClassDeclareReservedUnused(IOMedia, 7);
OSMetaClassDeclareReservedUnused(IOMedia, 8);
OSMetaClassDeclareReservedUnused(IOMedia, 9);
OSMetaClassDeclareReservedUnused(IOMedia, 10);
OSMetaClassDeclareReservedUnused(IOMedia, 11);
OSMetaClassDeclareReservedUnused(IOMedia, 12);
OSMetaClassDeclareReservedUnused(IOMedia, 13);
OSMetaClassDeclareReservedUnused(IOMedia, 14);
OSMetaClassDeclareReservedUnused(IOMedia, 15);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOMEDIA_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOMediaBSDClient.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOMEDIABSDCLIENT_H
#define _IOMEDIABSDCLIENT_H
#include <sys/disk.h>
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <sys/conf.h>
#include <IOKit/storage/IOMedia.h>
class AnchorTable;
class MinorTable;
struct MinorSlot;
__exported UInt64 _IOMediaBSDClientGetThrottleMask(IOMedia * media);
/*
* Class
*/
class __exported IOMediaBSDClient : public IOService
{
OSDeclareDefaultStructors(IOMediaBSDClient)
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
private:
AnchorTable * _anchors;
UInt32 _reserved0064 __attribute__ ((unused));
UInt32 _reserved0096 __attribute__ ((unused));
MinorTable * _minors;
UInt32 _reserved0160 __attribute__ ((unused));
protected:
/*
* Find the whole media that roots the given media tree.
*/
virtual IOMedia * getWholeMedia( IOMedia * media,
UInt32 * slicePathSize = 0,
char * slicePath = 0 );
/*
* Create bdevsw and cdevsw nodes for the given media object.
*/
virtual bool createNodes(IOMedia * media);
/*
* Free all of this object's outstanding resources.
*/
virtual void free() APPLE_KEXT_OVERRIDE;
public:
/*
* Obtain this object's provider. We override the superclass's method to
* return a more specific subclass of IOService -- IOMedia. This method
* method serves simply as a convenience to subclass developers.
*/
virtual IOMedia * getProvider() const APPLE_KEXT_OVERRIDE;
/*
* Initialize this object's minimal state.
*/
virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE;
/*
* This method is called once we have been attached to the provider object.
*/
virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE;
/*
* This method is called when we are to terminate from the provider object.
*/
virtual bool terminate(IOOptionBits options) APPLE_KEXT_OVERRIDE;
/*
* Process a foreign ioctl.
*/
virtual int ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, proc_t proc);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 0);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 1);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 2);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 3);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 4);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 5);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 6);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 7);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 8);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 9);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 10);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 11);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 12);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 13);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 14);
OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 15);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOMEDIABSDCLIENT_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOApplePartitionScheme.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* This header contains the IOApplePartitionScheme class definition.
*/
#ifndef _IOAPPLEPARTITIONSCHEME_H
#define _IOAPPLEPARTITIONSCHEME_H
#include <IOKit/IOTypes.h>
/*
* kIOApplePartitionSchemeClass is the name of the IOApplePartitionScheme class.
*/
#define kIOApplePartitionSchemeClass "IOApplePartitionScheme"
/*
* Apple Partition Map Definitions
*/
#pragma pack(push, 1) /* (enable 8-bit struct packing) */
/* Structure constants. */
#define DPISTRLEN 32
/* Partition map entry, as found in blocks 1 to dpme_map_entries of the disk. */
typedef struct dpme
{
UInt16 dpme_signature; /* (unique value for partition entry, 'PM') */
UInt16 dpme_reserved_1; /* (reserved for future use) */
UInt32 dpme_map_entries; /* (number of partition entries) */
UInt32 dpme_pblock_start; /* (physical block start of partition) */
UInt32 dpme_pblocks; /* (physical block count of partition) */
char dpme_name[DPISTRLEN]; /* (name of partition) */
char dpme_type[DPISTRLEN]; /* (type of partition, eg. Apple_HFS) */
UInt32 dpme_lblock_start; /* (logical block start of partition) */
UInt32 dpme_lblocks; /* (logical block count of partition) */
UInt32 dpme_flags; /* (partition flags, see defines below) */
UInt32 dpme_boot_block; /* (logical block start of boot code) */
UInt32 dpme_boot_bytes; /* (byte count of boot code) */
UInt32 dpme_load_addr; /* (load address in memory of boot code) */
UInt32 dpme_load_addr_2; /* (reserved for future use) */
UInt32 dpme_goto_addr; /* (jump address in memory of boot code) */
UInt32 dpme_goto_addr_2; /* (reserved for future use) */
UInt32 dpme_checksum; /* (checksum of boot code) */
UInt8 dpme_process_id[16]; /* (processor type) */
UInt32 dpme_reserved_2[32]; /* (reserved for future use) */
UInt32 dpme_reserved_3[62]; /* (reserved for future use) */
} DPME;
/* Driver descriptor map entry. */
typedef struct DDMap
{
UInt32 ddBlock; /* (driver's block start, sbBlkSize-blocks) */
UInt16 ddSize; /* (driver's block count, 512-blocks) */
UInt16 ddType; /* (driver's system type) */
} DDMap;
/* Driver descriptor map, as found in block zero of the disk. */
typedef struct Block0
{
UInt16 sbSig; /* (unique value for block zero, 'ER') */
UInt16 sbBlkSize; /* (block size for this device) */
UInt32 sbBlkCount; /* (block count for this device) */
UInt16 sbDevType; /* (device type) */
UInt16 sbDevId; /* (device id) */
UInt32 sbDrvrData; /* (driver data) */
UInt16 sbDrvrCount; /* (driver descriptor count) */
DDMap sbDrvrMap[8]; /* (driver descriptor table) */
UInt8 sbReserved[430]; /* (reserved for future use) */
} Block0;
/* Partition map signature (sbSig). */
#define BLOCK0_SIGNATURE 0x4552
/* Partition map entry signature (dpme_signature). */
#define DPME_SIGNATURE 0x504D
/* Partition map entry flags (dpme_flags). */
#define DPME_FLAGS_VALID 0x00000001 /* (bit 0) */
#define DPME_FLAGS_ALLOCATED 0x00000002 /* (bit 1) */
#define DPME_FLAGS_IN_USE 0x00000004 /* (bit 2) */
#define DPME_FLAGS_BOOTABLE 0x00000008 /* (bit 3) */
#define DPME_FLAGS_READABLE 0x00000010 /* (bit 4) */
#define DPME_FLAGS_WRITABLE 0x00000020 /* (bit 5) */
#define DPME_FLAGS_OS_PIC_CODE 0x00000040 /* (bit 6) */
#define DPME_FLAGS_OS_SPECIFIC_2 0x00000080 /* (bit 7) */
#define DPME_FLAGS_OS_SPECIFIC_1 0x00000100 /* (bit 8) */
#define DPME_FLAGS_RESERVED_2 0xFFFFFE00 /* (bit 9..31) */
#pragma pack(pop) /* (reset to default struct packing) */
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/storage/IOPartitionScheme.h>
/*
* Class
*/
class __exported IOApplePartitionScheme : public IOPartitionScheme
{
OSDeclareDefaultStructors(IOApplePartitionScheme);
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
OSSet * _partitions; /* (set of media objects representing partitions) */
/*
* Free all of this object's outstanding resources.
*/
virtual void free(void) APPLE_KEXT_OVERRIDE;
/*
* Scan the provider media for an Apple partition map. Returns the set
* of media objects representing each of the partitions (the retain for
* the set is passed to the caller), or null should no partition map be
* found. The default probe score can be adjusted up or down, based on
* the confidence of the scan.
*/
virtual OSSet * scan(SInt32 * score);
/*
* Ask whether the given partition appears to be corrupt. A partition that
* is corrupt will cause the failure of the Apple partition map recognition
* altogether.
*/
virtual bool isPartitionCorrupt( dpme * partition,
UInt32 partitionID,
UInt32 partitionBlockSize );
/*
* Ask whether the given partition appears to be invalid. A partition that
* is invalid will cause it to be skipped in the scan, but will not cause a
* failure of the Apple partition map recognition.
*/
virtual bool isPartitionInvalid( dpme * partition,
UInt32 partitionID,
UInt32 partitionBlockSize );
/*
* Instantiate a new media object to represent the given partition.
*/
virtual IOMedia * instantiateMediaObject( dpme * partition,
UInt32 partitionID,
UInt32 partitionBlockSize );
/*
* Allocate a new media object (called from instantiateMediaObject).
*/
virtual IOMedia * instantiateDesiredMediaObject(
dpme * partition,
UInt32 partitionID,
UInt32 partitionBlockSize );
public:
/*
* Initialize this object's minimal state.
*/
virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE;
/*
* Determine whether the provider media contains an Apple partition map.
*/
virtual IOService * probe(IOService * provider, SInt32 * score) APPLE_KEXT_OVERRIDE;
/*
* Publish the new media objects which represent our partitions.
*/
virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE;
/*
* Clean up after the media objects we published before terminating.
*/
virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE;
/*
* Request that the provider media be re-scanned for partitions.
*/
virtual IOReturn requestProbe(IOOptionBits options) APPLE_KEXT_OVERRIDE;
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 0);
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 1);
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 2);
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 3);
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 4);
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 5);
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 6);
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 7);
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 8);
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 9);
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 10);
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 11);
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 12);
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 13);
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 14);
OSMetaClassDeclareReservedUnused(IOApplePartitionScheme, 15);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOAPPLEPARTITIONSCHEME_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOCDTypes.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOCDTYPES_H
#define _IOCDTYPES_H
#include <IOKit/IOTypes.h>
#include <libkern/OSByteOrder.h>
#pragma pack(push, 1) /* (enable 8-bit struct packing) */
/*
* Minutes, Seconds, Frames (M:S:F)
*
* All M:S:F values passed across I/O Kit APIs are guaranteed to be
* binary-encoded numbers (no BCD-encoded numbers are ever passed).
*/
typedef struct
{
UInt8 minute;
UInt8 second;
UInt8 frame;
} CDMSF;
/*
* Media Catalogue Numbers (MCN), International Standard Recording Codes (ISRC)
*
* All MCN and ISRC values passed across I/O Kit APIs are guaranteed
* to have a zero-terminating byte, for convenient use as C strings.
*/
#define kCDMCNMaxLength 13
#define kCDISRCMaxLength 12
typedef char CDMCN [kCDMCNMaxLength + 1];
typedef char CDISRC[kCDISRCMaxLength + 1];
/*
* Audio Status
*
* All CDAudioStatus fields passed across I/O Kit APIs are guaranteed to
* be binary-encoded numbers (no BCD-encoded numbers are ever passed).
*/
#define kCDAudioStatusUnsupported 0x00
#define kCDAudioStatusActive 0x11
#define kCDAudioStatusPaused 0x12
#define kCDAudioStatusSuccess 0x13
#define kCDAudioStatusFailure 0x14
#define kCDAudioStatusNone 0x15
typedef struct
{
UInt8 status;
struct
{
CDMSF time;
struct
{
UInt8 index;
UInt8 number;
CDMSF time;
} track;
} position;
} CDAudioStatus;
/*
* Table Of Contents
*
* All CDTOC fields passed across I/O Kit APIs are guaranteed to be
* binary-encoded numbers (no BCD-encoded numbers are ever passed).
*/
typedef struct
{
UInt8 session;
#ifdef __LITTLE_ENDIAN__
UInt8 control:4, adr:4;
#else /* !__LITTLE_ENDIAN__ */
UInt8 adr:4, control:4;
#endif /* !__LITTLE_ENDIAN__ */
UInt8 tno;
UInt8 point;
CDMSF address;
UInt8 zero;
CDMSF p;
} CDTOCDescriptor;
typedef struct
{
UInt16 length;
UInt8 sessionFirst;
UInt8 sessionLast;
CDTOCDescriptor descriptors[0];
} CDTOC;
/*
* Table Of Contents Descriptor Count Convenience Function
*/
static inline UInt32 CDTOCGetDescriptorCount(CDTOC * toc)
{
UInt32 tocSize = OSSwapBigToHostInt16(toc->length) + (UInt32) sizeof(toc->length);
return (tocSize < (UInt32) sizeof(CDTOC)) ? 0 :
(tocSize - (UInt32) sizeof(CDTOC)) / (UInt32) sizeof(CDTOCDescriptor);
}
/*
* M:S:F To LBA Convenience Function
*/
static inline UInt32 CDConvertMSFToLBA(CDMSF msf)
{
return (((msf.minute * 60U) + msf.second) * 75U) + msf.frame - 150U;
}
/*
* M:S:F To Clipped LBA Convenience Function
*/
static inline UInt32 CDConvertMSFToClippedLBA(CDMSF msf)
{
return (msf.minute == 0 && msf.second <= 1) ? 0 : CDConvertMSFToLBA(msf);
}
/*
* LBA To M:S:F Convenience Function
*/
static inline CDMSF CDConvertLBAToMSF(UInt32 lba)
{
CDMSF msf;
lba += 150;
msf.minute = (lba / (75 * 60));
msf.second = (lba % (75 * 60)) / 75;
msf.frame = (lba % (75 ));
return msf;
}
/*
* Track Number To M:S:F Convenience Function
*
* The CDTOC structure is assumed to be complete, that is, none of
* the descriptors are missing or clipped due to an insufficiently
* sized buffer holding the CDTOC contents.
*/
static inline CDMSF CDConvertTrackNumberToMSF(UInt8 track, CDTOC * toc)
{
UInt32 count = CDTOCGetDescriptorCount(toc);
UInt32 i;
CDMSF msf = { 0xFF, 0xFF, 0xFF };
for (i = 0; i < count; i++)
{
if (toc->descriptors[i].point == track && toc->descriptors[i].adr == 1)
{
msf = toc->descriptors[i].p;
break;
}
}
return msf;
}
/*
* Sector Areas, Sector Types
*
* Bytes Per Type CDDA Mode1 Mode2 Mode2Form1 Mode2Form2
* Per Area +----------+----------+----------+----------+----------+
* Sync | 0 | 12 | 12 | 12 | 12 |
* Header | 0 | 4 | 4 | 4 | 4 |
* SubHeader | 0 | 0 | 0 | 8 | 8 |
* User | 2352 | 2048 | 2336 | 2048 | 2328 |
* Auxiliary | 0 | 288 | 0 | 280 | 0 |
* ErrorFlags | 294 | 294 | 294 | 294 | 294 |
* SubChannel | 96 | 96 | 96 | 96 | 96 |
* SubChannelQ | 16 | 16 | 16 | 16 | 16 |
* +----------+----------+----------+----------+----------+
*/
typedef enum
{
kCDSectorAreaSync = 0x80,
kCDSectorAreaHeader = 0x20,
kCDSectorAreaSubHeader = 0x40,
kCDSectorAreaUser = 0x10,
kCDSectorAreaAuxiliary = 0x08,
kCDSectorAreaErrorFlags = 0x02,
kCDSectorAreaSubChannel = 0x01,
kCDSectorAreaSubChannelQ = 0x04
} CDSectorArea;
typedef enum
{
kCDSectorTypeUnknown = 0x00,
kCDSectorTypeCDDA = 0x01,
kCDSectorTypeMode1 = 0x02,
kCDSectorTypeMode2 = 0x03,
kCDSectorTypeMode2Form1 = 0x04,
kCDSectorTypeMode2Form2 = 0x05,
kCDSectorTypeCount = 0x06
} CDSectorType;
typedef enum
{
kCDSectorSizeCDDA = 2352,
kCDSectorSizeMode1 = 2048,
kCDSectorSizeMode2 = 2336,
kCDSectorSizeMode2Form1 = 2048,
kCDSectorSizeMode2Form2 = 2328,
kCDSectorSizeWhole = 2352
} CDSectorSize;
/*
* Media Types
*/
enum
{
kCDMediaTypeUnknown = 0x0100,
kCDMediaTypeROM = 0x0102, /* CD-ROM */
kCDMediaTypeR = 0x0104, /* CD-R */
kCDMediaTypeRW = 0x0105, /* CD-RW */
kCDMediaTypeMin = 0x0100,
kCDMediaTypeMax = 0x01FF
};
typedef UInt32 CDMediaType;
/*
* Media Speed (kB/s)
*/
#define kCDSpeedMin 0x00B0
#define kCDSpeedMax 0xFFFF
/*
* MMC Formats
*/
// Read Table Of Contents Format Types
typedef UInt8 CDTOCFormat;
enum
{
kCDTOCFormatTOC = 0x02, // CDTOC
kCDTOCFormatPMA = 0x03, // CDPMA
kCDTOCFormatATIP = 0x04, // CDATIP
kCDTOCFormatTEXT = 0x05 // CDTEXT
};
// Read Table Of Contents Format 0x03
struct CDPMADescriptor
{
UInt8 reserved;
#ifdef __LITTLE_ENDIAN__
UInt8 control:4, adr:4;
#else /* !__LITTLE_ENDIAN__ */
UInt8 adr:4, control:4;
#endif /* !__LITTLE_ENDIAN__ */
UInt8 tno;
UInt8 point;
CDMSF address;
UInt8 zero;
CDMSF p;
};
typedef struct CDPMADescriptor CDPMADescriptor;
struct CDPMA
{
UInt16 dataLength;
UInt8 reserved;
UInt8 reserved2;
CDPMADescriptor descriptors[0];
};
typedef struct CDPMA CDPMA;
// Read Table Of Contents Format 0x04
struct CDATIP
{
UInt16 dataLength;
UInt8 reserved[2];
#ifdef __LITTLE_ENDIAN__
UInt8 referenceSpeed:3;
UInt8 reserved3:1;
UInt8 indicativeTargetWritingPower:3;
UInt8 reserved2:1;
UInt8 reserved5:6;
UInt8 unrestrictedUse:1;
UInt8 reserved4:1;
UInt8 a3Valid:1;
UInt8 a2Valid:1;
UInt8 a1Valid:1;
UInt8 discSubType:3;
UInt8 discType:1;
UInt8 reserved6:1;
#else /* !__LITTLE_ENDIAN__ */
UInt8 reserved2:1;
UInt8 indicativeTargetWritingPower:3;
UInt8 reserved3:1;
UInt8 referenceSpeed:3;
UInt8 reserved4:1;
UInt8 unrestrictedUse:1;
UInt8 reserved5:6;
UInt8 reserved6:1;
UInt8 discType:1;
UInt8 discSubType:3;
UInt8 a1Valid:1;
UInt8 a2Valid:1;
UInt8 a3Valid:1;
#endif /* !__LITTLE_ENDIAN__ */
UInt8 reserved7;
CDMSF startTimeOfLeadIn;
UInt8 reserved8;
CDMSF lastPossibleStartTimeOfLeadOut;
UInt8 reserved9;
UInt8 a1[3];
UInt8 reserved10;
UInt8 a2[3];
UInt8 reserved11;
UInt8 a3[3];
UInt8 reserved12;
};
typedef struct CDATIP CDATIP;
// Read Table Of Contents Format 0x05
struct CDTEXTDescriptor
{
UInt8 packType;
UInt8 trackNumber;
UInt8 sequenceNumber;
#ifdef __LITTLE_ENDIAN__
UInt8 characterPosition:4;
UInt8 blockNumber:3;
UInt8 doubleByteCharacterCode:1;
#else /* !__LITTLE_ENDIAN__ */
UInt8 doubleByteCharacterCode:1;
UInt8 blockNumber:3;
UInt8 characterPosition:4;
#endif /* !__LITTLE_ENDIAN__ */
UInt8 textData[12];
UInt8 reserved[2];
};
typedef struct CDTEXTDescriptor CDTEXTDescriptor;
struct CDTEXT
{
UInt16 dataLength;
UInt8 reserved;
UInt8 reserved2;
CDTEXTDescriptor descriptors[0];
};
typedef struct CDTEXT CDTEXT;
// Read Disc Information Format
struct CDDiscInfo
{
UInt16 dataLength;
#ifdef __LITTLE_ENDIAN__
UInt8 discStatus:2;
UInt8 stateOfLastSession:2;
UInt8 erasable:1;
UInt8 reserved:3;
#else /* !__LITTLE_ENDIAN__ */
UInt8 reserved:3;
UInt8 erasable:1;
UInt8 stateOfLastSession:2;
UInt8 discStatus:2;
#endif /* !__LITTLE_ENDIAN__ */
UInt8 numberOfFirstTrack;
UInt8 numberOfSessionsLSB;
UInt8 firstTrackNumberInLastSessionLSB;
UInt8 lastTrackNumberInLastSessionLSB;
#ifdef __LITTLE_ENDIAN__
UInt8 reserved3:5;
UInt8 unrestrictedUse:1;
UInt8 discBarCodeValid:1;
UInt8 discIdentificationValid:1;
#else /* !__LITTLE_ENDIAN__ */
UInt8 discIdentificationValid:1;
UInt8 discBarCodeValid:1;
UInt8 unrestrictedUse:1;
UInt8 reserved3:5;
#endif /* !__LITTLE_ENDIAN__ */
UInt8 discType;
UInt8 numberOfSessionsMSB;
UInt8 firstTrackNumberInLastSessionMSB;
UInt8 lastTrackNumberInLastSessionMSB;
UInt32 discIdentification;
UInt8 reserved7;
CDMSF lastSessionLeadInStartTime;
UInt8 reserved8;
CDMSF lastPossibleStartTimeOfLeadOut;
UInt8 discBarCode[8];
UInt8 reserved9;
UInt8 numberOfOPCTableEntries;
UInt8 opcTableEntries[0];
};
typedef struct CDDiscInfo CDDiscInfo;
// Read Track Information Address Types
typedef UInt8 CDTrackInfoAddressType;
enum
{
kCDTrackInfoAddressTypeLBA = 0x00,
kCDTrackInfoAddressTypeTrackNumber = 0x01,
kCDTrackInfoAddressTypeSessionNumber = 0x02,
};
// Read Track Information Format
struct CDTrackInfo
{
UInt16 dataLength;
UInt8 trackNumberLSB;
UInt8 sessionNumberLSB;
UInt8 reserved;
#ifdef __LITTLE_ENDIAN__
UInt8 trackMode:4;
UInt8 copy:1;
UInt8 damage:1;
UInt8 reserved3:2;
UInt8 dataMode:4;
UInt8 fixedPacket:1;
UInt8 packet:1;
UInt8 blank:1;
UInt8 reservedTrack:1;
UInt8 nextWritableAddressValid:1;
UInt8 lastRecordedAddressValid:1;
UInt8 reserved5:6;
#else /* !__LITTLE_ENDIAN__ */
UInt8 reserved3:2;
UInt8 damage:1;
UInt8 copy:1;
UInt8 trackMode:4;
UInt8 reservedTrack:1;
UInt8 blank:1;
UInt8 packet:1;
UInt8 fixedPacket:1;
UInt8 dataMode:4;
UInt8 reserved5:6;
UInt8 lastRecordedAddressValid:1;
UInt8 nextWritableAddressValid:1;
#endif /* !__LITTLE_ENDIAN__ */
UInt32 trackStartAddress;
UInt32 nextWritableAddress;
UInt32 freeBlocks;
UInt32 fixedPacketSize;
UInt32 trackSize;
UInt32 lastRecordedAddress;
UInt8 trackNumberMSB;
UInt8 sessionNumberMSB;
UInt8 reserved6;
UInt8 reserved7;
};
typedef struct CDTrackInfo CDTrackInfo;
#pragma pack(pop) /* (reset to default struct packing) */
#endif /* _IOCDTYPES_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOStorageProtocolCharacteristics.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IO_STORAGE_PROTOCOL_CHARACTERISTICS_H_
#define _IOKIT_IO_STORAGE_PROTOCOL_CHARACTERISTICS_H_
#include <TargetConditionals.h>
#if TARGET_OS_DRIVERKIT
#include <DriverKit/storage/IOStorageControllerCharacteristics.h>
#else
#include <IOKit/storage/IOStorageControllerCharacteristics.h>
#endif
/*
* Protocol Characteristics - Characteristics defined for protocols.
*/
/*!
@defined kIOPropertyProtocolCharacteristicsKey
@discussion This key is used to define Protocol Characteristics for a particular
protocol and it has an associated dictionary which lists the
protocol characteristics.
Requirement: Mandatory
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>ATAPI</string>
<key>Physical Interconnect Location</key>
<string>Internal</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyProtocolCharacteristicsKey "Protocol Characteristics"
/*!
@defined kIOPropertySCSIInitiatorIdentifierKey
@discussion An identifier that will uniquely identify this SCSI Initiator for the
SCSI Domain.
Requirement: Mandatory for SCSI Parallel Interface, SAS,
and Fibre Channel Interface.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>SCSI Parallel Interface</string>
<key>Physical Interconnect Location</key>
<string>Internal</string>
<key>SCSI Initiator Identifier</key>
<integer>7</integer>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertySCSIInitiatorIdentifierKey "SCSI Initiator Identifier"
/*!
@defined kIOPropertySCSIDomainIdentifierKey
@discussion An identifier that will uniquely identify this SCSI Domain for the
Physical Interconnect type. This identifier is only guaranteed to be unique for
any given Physical Interconnect and is not guaranteed to be the same across
restarts or shutdowns.
Requirement: Mandatory for SCSI Parallel Interface and Fibre Channel Interface.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>SCSI Parallel Interface</string>
<key>Physical Interconnect Location</key>
<string>Internal</string>
<key>SCSI Domain Identifier</key>
<integer>0</integer>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertySCSIDomainIdentifierKey "SCSI Domain Identifier"
/*!
@defined kIOPropertySCSITargetIdentifierKey
@discussion This is the SCSI Target Identifier for a given SCSI Target Device.
Requirement: Mandatory for SCSI Parallel Interface and Fibre Channel Interface.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>SCSI Parallel Interface</string>
<key>Physical Interconnect Location</key>
<string>Internal</string>
<key>SCSI Target Identifier</key>
<integer>3</integer>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertySCSITargetIdentifierKey "SCSI Target Identifier"
/*!
@defined kIOPropertySCSILogicalUnitNumberKey
@discussion This key is the SCSI Logical Unit Number for the device server
controlled by the driver.
Requirement: Mandatory for SCSI Parallel Interface, SAS, and Fibre Channel Interface.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>SCSI Parallel Interface</string>
<key>Physical Interconnect Location</key>
<string>Internal</string>
<key>SCSI Logical Unit Number</key>
<integer>2</integer>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertySCSILogicalUnitNumberKey "SCSI Logical Unit Number"
/*!
@defined kIOPropertyPhysicalInterconnectTypeKey
@discussion This key is used to define the Physical Interconnect to which
a device is attached.
Requirement: Mandatory.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>SCSI Parallel Interface</string>
<key>Physical Interconnect Location</key>
<string>Internal</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalInterconnectTypeKey "Physical Interconnect"
/*!
@defined kIOPropertyPhysicalInterconnectLocationKey
@discussion This key is used to define the Physical Interconnect
Location.
Requirement: Mandatory.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>SCSI Parallel Interface</string>
<key>Physical Interconnect Location</key>
<string>Internal</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalInterconnectLocationKey "Physical Interconnect Location"
/*!
@defined kIOPropertySCSIProtocolMultiInitKey
@discussion This protocol characteristics key is used to inform the system
that the protocol supports having multiple devices that act as initiators.
Requirement: Optional.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>Fibre Channel Interface</string>
<key>Physical Interconnect Location</key>
<string>External</string>
<key>Multiple Initiators</key>
<string>True</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertySCSIProtocolMultiInitKey "Multiple Initiators"
/*
* Values - Values for the characteristics defined above.
*/
/*!
@defined kIOPropertyInternalKey
@discussion This key defines the value of Internal for the key
kIOPropertyPhysicalInterconnectLocationKey. If the device is
connected to an internal bus, this key should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>ATA</string>
<key>Physical Interconnect Location</key>
<string>Internal</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyInternalKey "Internal"
/*!
@defined kIOPropertyExternalKey
@discussion This key defines the value of External for the key
kIOPropertyPhysicalInterconnectLocationKey. If the device is
connected to an external bus, this key should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>Fibre Channel Interface</string>
<key>Physical Interconnect Location</key>
<string>External</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyExternalKey "External"
/*!
@defined kIOPropertyInternalExternalKey
@discussion This key defines the value of Internal/External for the key
kIOPropertyPhysicalInterconnectLocationKey. If the device is connected
to a bus and it is indeterminate whether it is internal or external,
this key should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>SCSI Parallel Interface</string>
<key>Physical Interconnect Location</key>
<string>Internal/External</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyInternalExternalKey "Internal/External"
/*!
@defined kIOPropertyInterconnectFileKey
@discussion This key defines the value of File for the key
kIOPropertyPhysicalInterconnectLocationKey. If the device is a file
that is being represented as a storage device, this key should be set.
NOTE: This key should only be used when the Physical Interconnect is set to
Virtual Interface.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>Virtual Interface</string>
<key>Physical Interconnect Location</key>
<string>File</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyInterconnectFileKey "File"
/*!
@defined kIOPropertyInterconnectRAMKey
@discussion This key defines the value of RAM for the key
kIOPropertyPhysicalInterconnectLocationKey. If the device is system memory
that is being represented as a storage device, this key should be set.
NOTE: This key should only be used when the Physical Interconnect is set to
Virtual Interface.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>Virtual Interface</string>
<key>Physical Interconnect Location</key>
<string>RAM</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyInterconnectRAMKey "RAM"
/*!
@defined kIOPropertyPhysicalInterconnectTypeATA
@discussion This key defines the value of ATA for the key
kIOPropertyPhysicalInterconnectTypeKey. If the device is connected
to an ATA bus, this key should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>ATA</string>
<key>Physical Interconnect Location</key>
<string>Internal</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalInterconnectTypeATA "ATA"
/*!
@defined kIOPropertyPhysicalInterconnectTypeSerialATA
@discussion This key defines the value of SATA for the key
kIOPropertyPhysicalInterconnectTypeKey. If the device is connected
to a SATA bus, this key should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>SATA</string>
<key>Physical Interconnect Location</key>
<string>Internal</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalInterconnectTypeSerialATA "SATA"
/*!
@defined kIOPropertyPhysicalInterconnectTypeSerialAttachedSCSI
@discussion This key defines the value of SAS for the key
kIOPropertyPhysicalInterconnectTypeKey. If the device is connected
to a SAS bus, this key should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>SAS</string>
<key>Physical Interconnect Location</key>
<string>External</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalInterconnectTypeSerialAttachedSCSI "SAS"
/*!
@defined kIOPropertyPhysicalInterconnectTypeATAPI
@discussion This key defines the value of ATAPI for the key
kIOPropertyPhysicalInterconnectTypeKey. If the device is connected
to an ATA bus and follows the ATAPI command specification, this key
should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>ATAPI</string>
<key>Physical Interconnect Location</key>
<string>Internal</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalInterconnectTypeATAPI "ATAPI"
/*!
@defined kIOPropertyPhysicalInterconnectTypeUSB
@discussion This key defines the value of USB for the key
kIOPropertyPhysicalInterconnectTypeKey. If the device is connected
to a USB port, this key should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>USB</string>
<key>Physical Interconnect Location</key>
<string>External</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalInterconnectTypeUSB "USB"
/*!
@defined kIOPropertyPhysicalInterconnectTypeFireWire
@discussion This key defines the value of USB for the key
kIOPropertyPhysicalInterconnectTypeKey. If the device is connected
to a FireWire port, this key should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>FireWire</string>
<key>Physical Interconnect Location</key>
<string>External</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalInterconnectTypeFireWire "FireWire"
/*!
@defined kIOPropertyPhysicalInterconnectTypeSecureDigital
@discussion This key defines the value of Secure Digital for the key
kIOPropertyPhysicalInterconnectTypeSecureDigital. If the device is
connected to a Secure Digital port and follows the Secure Digital
specification, this key should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>Secure Digital</string>
<key>Physical Interconnect Location</key>
<string>Internal</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalInterconnectTypeSecureDigital "Secure Digital"
/*!
@defined kIOPropertyPhysicalInterconnectTypeSCSIParallel
@discussion This key defines the value of SCSI Parallel Interface for the key
kIOPropertyPhysicalInterconnectTypeKey. If the device is connected
to a SCSI Parallel port, this key should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>SCSI Parallel Interface</string>
<key>Physical Interconnect Location</key>
<string>External</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalInterconnectTypeSCSIParallel "SCSI Parallel Interface"
/*!
@defined kIOPropertyPhysicalInterconnectTypeFibreChannel
@discussion This key defines the value of Fibre Channel Interface for the key
kIOPropertyPhysicalInterconnectTypeKey. If the device is connected
to a Fibre Channel port, this key should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>Fibre Channel Interface</string>
<key>Physical Interconnect Location</key>
<string>External</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalInterconnectTypeFibreChannel "Fibre Channel Interface"
/*!
@defined kIOPropertyPhysicalInterconnectTypeVirtual
@discussion This key defines the value of Virtual Interface for the key
kIOPropertyPhysicalInterconnectTypeVirtual. If the device is being made to look
like a storage device, but is not such in actuality, such as a File or RAM, this
key should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>Virtual Interface</string>
<key>Physical Interconnect Location</key>
<string>File</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalInterconnectTypeVirtual "Virtual Interface"
/*!
@defined kIOPropertyPhysicalInterconnectTypePCI
@discussion This key defines the value of PCI for the key
kIOPropertyPhysicalInterconnectTypePCI. If the device is connected
via PCI, this key should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>PCI</string>
<key>Physical Interconnect Location</key>
<string>Internal</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalInterconnectTypePCI "PCI"
/*!
@defined kIOPropertyPhysicalInterconnectTypePCIExpress
@discussion This key defines the value of PCI-Express for the key
kIOPropertyPhysicalInterconnectTypePCIExpress. If the device is connected
via PCI-Express, this key should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>PCI-Express</string>
<key>Physical Interconnect Location</key>
<string>Internal</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalInterconnectTypePCIExpress "PCI-Express"
/*!
@defined kIOPropertyPhysicalInterconnectTypeAppleFabric
@discussion This key defines the value of Apple Fabric for the key
kIOPropertyPhysicalInterconnectTypeAppleFabric. If the device is connected
via Apple Fabric, this key should be set.
Example:
<pre>
@textblock
<dict>
<key>Protocol Characteristics</key>
<dict>
<key>Physical Interconnect</key>
<string>Apple Fabric</string>
<key>Physical Interconnect Location</key>
<string>Internal</string>
</dict>
</dict>
@/textblock
</pre>
*/
#define kIOPropertyPhysicalInterconnectTypeAppleFabric "Apple Fabric"
#endif /* _IOKIT_IO_STORAGE_PROTOCOL_CHARACTERISTICS_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOCDMedia.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
* @header IOCDMedia
* @abstract
* This header contains the IOCDMedia class definition.
*/
#ifndef _IOCDMEDIA_H
#define _IOCDMEDIA_H
/*!
* @defined kIOCDMediaClass
* @abstract
* kIOCDMediaClass is the name of the IOCDMedia class.
* @discussion
* kIOCDMediaClass is the name of the IOCDMedia class.
*/
#define kIOCDMediaClass "IOCDMedia"
/*!
* @defined kIOCDMediaTOCKey
* @abstract
* kIOCDMediaTOCKey is a property of IOCDMedia objects. It has an OSData value
* and a CDTOC structure.
* @discussion
* The kIOCDMediaTOCKey property contains the CD's full table of contents,
* formatted as a CDTOC structure. The CDTOC structure is same as what is
* returned by a READ TOC command, format 0x02. All fields in the TOC are
* guaranteed to be binary-encoded (no BCD-encoded numbers are ever passed).
*/
#define kIOCDMediaTOCKey "TOC"
/*!
* @defined kIOCDMediaTypeKey
* @abstract
* kIOCDMediaTypeKey is a property of IOCDMedia objects. It has an OSString
* value.
* @discussion
* The kIOCDMediaTypeKey property identifies the CD media type (CD-ROM, CD-R,
* CD-RW, etc). See the kIOCDMediaType contants for possible values.
*/
#define kIOCDMediaTypeKey "Type"
/*!
* @defined kIOCDMediaTypeROM
* The kIOCDMediaTypeKey constant for CD-ROM media (inclusive of the CD-I,
* CD-ROM XA, and CD Audio standards, and mixed mode combinations thereof).
*/
#define kIOCDMediaTypeROM "CD-ROM"
/*!
* @defined kIOCDMediaTypeR
* The kIOCDMediaTypeKey constant for CD Recordable (CD-R) media.
*/
#define kIOCDMediaTypeR "CD-R"
/*!
* @defined kIOCDMediaTypeRW
* The kIOCDMediaTypeKey constant for CD ReWritable (CD-RW) media.
*/
#define kIOCDMediaTypeRW "CD-RW"
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/storage/IOCDBlockStorageDriver.h>
#include <IOKit/storage/IOMedia.h>
/*!
* @class IOCDMedia
* @abstract
* The IOCDMedia class is a random-access disk device abstraction for CDs.
* @discussion
* The IOCDMedia class is a random-access disk device abstraction for CDs. It
* extends the IOMedia class by implementing special CD APIs, such as readCD,
* and publishing the TOC as a property of the IOCDMedia object.
*/
class IOCDMedia : public IOMedia
{
OSDeclareDefaultStructors(IOCDMedia)
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
public:
using IOStorage::read;
using IOStorage::write;
/*
* Obtain this object's provider. We override the superclass's method to
* return a more specific subclass of IOService -- IOCDBlockStorageDriver.
* This method serves simply as a convenience to subclass developers.
*/
virtual IOCDBlockStorageDriver * getProvider() const;
/*
* Compare the properties in the supplied table to this object's properties.
*/
virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score);
/*!
* @function read
* @discussion
* Read data from the storage object at the specified byte offset into the
* specified buffer, asynchronously. When the read completes, the caller
* will be notified via the specified completion action.
*
* The buffer will be retained for the duration of the read.
* @param client
* Client requesting the read.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
*/
virtual void read(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion);
/*
* @function write
* @discussion
* Write data into the storage object at the specified byte offset from the
* specified buffer, asynchronously. When the write completes, the caller
* will be notified via the specified completion action.
*
* The buffer will be retained for the duration of the write.
* @param client
* Client requesting the write.
* @param byteStart
* Starting byte offset for the data transfer.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
*/
virtual void write(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion);
/*!
* @function readCD
* @discussion
* Read data from the CD media object at the specified byte offset into the
* specified buffer, asynchronously. Special areas of the CD sector can be
* read via this method, such as the header and subchannel data. When the
* read completes, the caller will be notified via the specified completion
* action.
*
* The buffer will be retained for the duration of the read.
* @param client
* Client requesting the read.
* @param byteStart
* Starting byte offset for the data transfer (see sectorArea parameter).
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param sectorArea
* Sector area(s) to read. The sum of each area's size defines the natural
* block size of the media for the call. This should be taken into account
* when computing the address of byteStart. See IOCDTypes.h.
* @param sectorType
* Sector type that is expected. The data transfer is terminated as soon as
* data is encountered that does not match the expected type.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
*/
virtual void readCD(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
CDSectorArea sectorArea,
CDSectorType sectorType,
IOStorageAttributes * attributes,
IOStorageCompletion * completion);
/*!
* @function readCD
* @discussion
* Read data from the CD media object at the specified byte offset into the
* specified buffer, synchronously. Special areas of the CD sector can be
* read via this method, such as the header and subchannel data. When the
* read completes, this method will return to the caller. The actual byte
* count field is optional.
* @param client
* Client requesting the read.
* @param byteStart
* Starting byte offset for the data transfer (see sectorArea parameter).
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param sectorArea
* Sector area(s) to read. The sum of each area's size defines the natural
* block size of the media for the call. This should be taken into account
* when computing the address of byteStart. See IOCDTypes.h.
* @param sectorType
* Sector type that is expected. The data transfer is terminated as soon as
* data is encountered that does not match the expected type.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes.
* @param actualByteCount
* Returns the actual number of bytes transferred in the data transfer.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn readCD(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
CDSectorArea sectorArea,
CDSectorType sectorType,
IOStorageAttributes * attributes = 0,
UInt64 * actualByteCount = 0);
/*!
* @function readISRC
* @discussion
* Read the International Standard Recording Code for the specified track.
* @param track
* Track number from which to read the ISRC.
* @param isrc
* Buffer for the ISRC data. Buffer contents will be zero-terminated.
* @result
* Returns the status of the operation.
*/
virtual IOReturn readISRC(UInt8 track, CDISRC isrc);
/*!
* @function readMCN
* @discussion
* Read the Media Catalog Number (also known as the Universal Product Code).
* @param mcn
* Buffer for the MCN data. Buffer contents will be zero-terminated.
* @result
* Returns the status of the operation.
*/
virtual IOReturn readMCN(CDMCN mcn);
/*!
* @function getTOC
* @discussion
* Get the full Table Of Contents.
*
* All CDTOC fields passed across I/O Kit APIs are guaranteed to be
* binary-encoded (no BCD-encoded numbers are ever passed).
* @result
* Returns a pointer to the TOC buffer (do not deallocate).
*/
virtual CDTOC * getTOC();
/*!
* @function getSpeed
* @discussion
* Get the current speed used for data transfers.
* @param kilobytesPerSecond
* Returns the current speed used for data transfers, in kB/s.
*
* kCDSpeedMin specifies the minimum speed for all CD media (1X).
* kCDSpeedMax specifies the maximum speed supported in hardware.
* @result
* Returns the status of the operation.
*/
virtual IOReturn getSpeed(UInt16 * kilobytesPerSecond);
/*!
* @function setSpeed
* @discussion
* Set the speed to be used for data transfers.
* @param kilobytesPerSecond
* Speed to be used for data transfers, in kB/s.
*
* kCDSpeedMin specifies the minimum speed for all CD media (1X).
* kCDSpeedMax specifies the maximum speed supported in hardware.
* @result
* Returns the status of the operation.
*/
virtual IOReturn setSpeed(UInt16 kilobytesPerSecond);
/*!
* @function readTOC
* @discussion
* Issue an MMC READ TOC/PMA/ATIP command.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param format
* As documented by MMC.
* @param formatAsTime
* As documented by MMC.
* @param trackOrSessionNumber
* As documented by MMC.
* @param actualByteCount
* Returns the actual number of bytes transferred in the data transfer.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn readTOC(IOMemoryDescriptor * buffer,
CDTOCFormat format,
UInt8 formatAsTime,
UInt8 trackOrSessionNumber,
UInt16 * actualByteCount);
/*!
* @function readDiscInfo
* @discussion
* Issue an MMC READ DISC INFORMATION command.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param actualByteCount
* Returns the actual number of bytes transferred in the data transfer.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn readDiscInfo(IOMemoryDescriptor * buffer,
UInt16 * actualByteCount);
/*!
* @function readTrackInfo
* @discussion
* Issue an MMC READ TRACK INFORMATION command.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param address
* As documented by MMC.
* @param addressType
* As documented by MMC.
* @param actualByteCount
* Returns the actual number of bytes transferred in the data transfer.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn readTrackInfo(IOMemoryDescriptor * buffer,
UInt32 address,
CDTrackInfoAddressType addressType,
UInt16 * actualByteCount);
/*
* @function writeCD
* @discussion
* Write data into the CD media object at the specified byte offset from the
* specified buffer, asynchronously. When the write completes, the caller
* will be notified via the specified completion action.
*
* The buffer will be retained for the duration of the write.
* @param client
* Client requesting the write.
* @param byteStart
* Starting byte offset for the data transfer (see sectorArea parameter).
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param sectorArea
* Sector area(s) to write. The sum of each area's size defines the natural
* block size of the media for the call. This should be taken into account
* when computing the address of byteStart. See IOCDTypes.h.
* @param sectorType
* Sector type that is expected.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
* @param completion
* Completion routine to call once the data transfer is complete. It is the
* responsibility of the callee to maintain the information for the duration
* of the data transfer, as necessary.
*/
virtual void writeCD(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
CDSectorArea sectorArea,
CDSectorType sectorType,
IOStorageAttributes * attributes,
IOStorageCompletion * completion);
/*
* @function writeCD
* @discussion
* Write data into the CD media object at the specified byte offset from the
* specified buffer, synchronously. When the write completes, this method
* will return to the caller. The actual byte count field is optional.
* @param client
* Client requesting the write.
* @param byteStart
* Starting byte offset for the data transfer (see sectorArea parameter).
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param sectorArea
* Sector area(s) to write. The sum of each area's size defines the natural
* block size of the media for the call. This should be taken into account
* when computing the address of byteStart. See IOCDTypes.h.
* @param sectorType
* Sector type that is expected.
* @param attributes
* Attributes of the data transfer. See IOStorageAttributes.
* @param actualByteCount
* Returns the actual number of bytes transferred in the data transfer.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn writeCD(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
CDSectorArea sectorArea,
CDSectorType sectorType,
IOStorageAttributes * attributes = 0,
UInt64 * actualByteCount = 0);
OSMetaClassDeclareReservedUnused(IOCDMedia, 0);
OSMetaClassDeclareReservedUnused(IOCDMedia, 1);
OSMetaClassDeclareReservedUnused(IOCDMedia, 2);
OSMetaClassDeclareReservedUnused(IOCDMedia, 3);
OSMetaClassDeclareReservedUnused(IOCDMedia, 4);
OSMetaClassDeclareReservedUnused(IOCDMedia, 5);
OSMetaClassDeclareReservedUnused(IOCDMedia, 6);
OSMetaClassDeclareReservedUnused(IOCDMedia, 7);
OSMetaClassDeclareReservedUnused(IOCDMedia, 8);
OSMetaClassDeclareReservedUnused(IOCDMedia, 9);
OSMetaClassDeclareReservedUnused(IOCDMedia, 10);
OSMetaClassDeclareReservedUnused(IOCDMedia, 11);
OSMetaClassDeclareReservedUnused(IOCDMedia, 12);
OSMetaClassDeclareReservedUnused(IOCDMedia, 13);
OSMetaClassDeclareReservedUnused(IOCDMedia, 14);
OSMetaClassDeclareReservedUnused(IOCDMedia, 15);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOCDMEDIA_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOGUIDPartitionScheme.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* This header contains the IOGUIDPartitionScheme class definition.
*/
#ifndef _IOGUIDPARTITIONSCHEME_H
#define _IOGUIDPARTITIONSCHEME_H
#include <IOKit/IOTypes.h>
/*
* kIOGUIDPartitionSchemeClass is the name of the IOGUIDPartitionScheme class.
*/
#define kIOGUIDPartitionSchemeClass "IOGUIDPartitionScheme"
/*
* GUID Partition Map Definitions
*/
#include <uuid/uuid.h>
#pragma pack(push, 1) /* (enable 8-bit struct packing) */
/* Partition map. */
struct gpt_hdr
{
uint8_t hdr_sig[8];
uint32_t hdr_revision;
uint32_t hdr_size;
uint32_t hdr_crc_self;
uint32_t __reserved;
uint64_t hdr_lba_self;
uint64_t hdr_lba_alt;
uint64_t hdr_lba_start;
uint64_t hdr_lba_end;
uuid_t hdr_uuid;
uint64_t hdr_lba_table;
uint32_t hdr_entries;
uint32_t hdr_entsz;
uint32_t hdr_crc_table;
uint32_t padding;
};
/* Partition map entry. */
struct gpt_ent
{
uuid_t ent_type;
uuid_t ent_uuid;
uint64_t ent_lba_start;
uint64_t ent_lba_end;
uint64_t ent_attr;
uint16_t ent_name[36];
};
/* Partition map signature (hdr_sig). */
#define GPT_HDR_SIG "EFI PART"
/* Partition map version (hdr_revision). */
#define GPT_HDR_REVISION 0x00010000
/* Partition map entry flags (ent_attr). */
#define GPT_ENT_ATTR_PLATFORM 0x00000001
/*!
* @defined kIOGUIDPartitionSchemeUUIDKey
* @abstract
* A property of IOGUIDPartitionSchemeGUID objects
* @discussion
* The kIOGUIDPartitionSchemeUUIDKey property has an OSString value and contains
* a persistent GUID for the disk define in GPT header
*/
#define kIOGUIDPartitionSchemeUUIDKey "UUID"
/*!
* @defined kIOMediaGPTPartitionAttributesKey
* @abstrat
* A property of IOMedia objects for GPT partitions
* @discussion
* The kIOMediaGPTPartitionAttributesKey property has an OSNumber value of 64bit
* GPT partition attributes
*/
#define kIOMediaGPTPartitionAttributesKey "GPT Attributes"
#pragma pack(pop) /* (reset to default struct packing) */
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/storage/IOPartitionScheme.h>
/*
* Class
*/
class __exported IOGUIDPartitionScheme : public IOPartitionScheme
{
OSDeclareDefaultStructors(IOGUIDPartitionScheme);
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
OSSet * _partitions; /* (set of media objects representing partitions) */
/*
* Free all of this object's outstanding resources.
*/
virtual void free(void) APPLE_KEXT_OVERRIDE;
/*!
* @function handleClose
* @discussion
* The handleClose method closes the client's access to this object.
*
* This implementation replaces the IOService definition of handleClose().
* @param client
* Client requesting the close.
* @param options
* Options for the close. Set to zero.
*/
virtual void handleClose(IOService * client, IOOptionBits options) APPLE_KEXT_OVERRIDE;
/*
* Scan the provider media for a GUID partition map. Returns the set
* of media objects representing each of the partitions (the retain for
* the set is passed to the caller), or null should no partition map be
* found. The default probe score can be adjusted up or down, based on
* the confidence of the scan.
*/
virtual OSSet * scan(SInt32 * score);
/*
* Ask whether the given partition is used.
*/
virtual bool isPartitionUsed(gpt_ent * partition);
/*
* Ask whether the given partition appears to be corrupt. A partition that
* is corrupt will cause the failure of the GUID partition map recognition
* altogether.
*/
virtual bool isPartitionCorrupt( gpt_ent * partition,
UInt32 partitionID );
/*
* Ask whether the given partition appears to be invalid. A partition that
* is invalid will cause it to be skipped in the scan, but will not cause a
* failure of the GUID partition map recognition.
*/
virtual bool isPartitionInvalid( gpt_ent * partition,
UInt32 partitionID );
/*
* Instantiate a new media object to represent the given partition.
*/
virtual IOMedia * instantiateMediaObject( gpt_ent * partition,
UInt32 partitionID );
/*
* Allocate a new media object (called from instantiateMediaObject).
*/
virtual IOMedia * instantiateDesiredMediaObject( gpt_ent * partition,
UInt32 partitionID );
public:
/*
* Initialize this object's minimal state.
*/
virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE;
/*
* Determine whether the provider media contains a GUID partition map.
*/
virtual IOService * probe(IOService * provider, SInt32 * score) APPLE_KEXT_OVERRIDE;
/*
* Publish the new media objects which represent our partitions.
*/
virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE;
/*
* Clean up after the media objects we published before terminating.
*/
virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE;
/*
* Request that the provider media be re-scanned for partitions.
*/
virtual IOReturn requestProbe(IOOptionBits options) APPLE_KEXT_OVERRIDE;
/*
* Generic entry point for calls from the provider. A return value of
* kIOReturnSuccess indicates that the message was received, and where
* applicable, that it was successful.
*/
virtual IOReturn message(UInt32 type, IOService * provider, void * argument) APPLE_KEXT_OVERRIDE;
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 0);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 1);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 2);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 3);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 4);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 5);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 6);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 7);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 8);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 9);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 10);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 11);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 12);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 13);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 14);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 15);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOGUIDPARTITIONSCHEME_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOCDPartitionScheme.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* @header IOCDPartitionScheme
* @abstract
* This header contains the IOCDPartitionScheme class definition.
*/
#ifndef _IOCDPARTITIONSCHEME_H
#define _IOCDPARTITIONSCHEME_H
#include <IOKit/storage/IOCDTypes.h>
/*
* @defined kIOCDPartitionSchemeClass
* @abstract
* kIOCDPartitionSchemeClass is the name of the IOCDPartitionScheme class.
* @discussion
* kIOCDPartitionSchemeClass is the name of the IOCDPartitionScheme class.
*/
#define kIOCDPartitionSchemeClass "IOCDPartitionScheme"
/*
* @defined kIOMediaSessionIDKey
* @abstract
* kIOMediaSessionIDKey is property of IOMedia objects. It has an OSNumber
* value.
* @discussion
* The kIOMediaSessionIDKey property is placed into each IOMedia instance
* created by the CD partition scheme. It identifies the session number
* the track was recorded on.
*/
#define kIOMediaSessionIDKey "Session ID"
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/storage/IOCDMedia.h>
#include <IOKit/storage/IOPartitionScheme.h>
/*
* Class
*/
class IOCDPartitionScheme : public IOPartitionScheme
{
OSDeclareDefaultStructors(IOCDPartitionScheme);
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
OSSet * _partitions; /* (set of media objects representing partitions) */
/*
* Free all of this object's outstanding resources.
*/
virtual void free(void);
/*
* Scan the provider media for CD partitions (in TOC). Returns the set
* of media objects representing each of the partitions (the retain for
* the set is passed to the caller), or null should no CD partitions be
* found. The default probe score can be adjusted up or down, based on
* the confidence of the scan.
*/
virtual OSSet * scan(SInt32 * score);
/*
* Ask whether the given partition appears to be corrupt. A partition that
* is corrupt will cause the failure of the CD partition scheme altogether.
*/
virtual bool isPartitionCorrupt( CDTOCDescriptor * partition,
UInt64 partitionSize,
UInt32 partitionBlockSize,
CDSectorType partitionBlockType,
CDTOC * toc );
/*
* Ask whether the given partition appears to be invalid. A partition that
* is invalid will cause it to be skipped in the scan, but will not cause a
* failure of the CD partition scheme.
*/
virtual bool isPartitionInvalid( CDTOCDescriptor * partition,
UInt64 partitionSize,
UInt32 partitionBlockSize,
CDSectorType partitionBlockType,
CDTOC * toc );
/*
* Instantiate a new media object to represent the given partition.
*/
virtual IOMedia * instantiateMediaObject(
CDTOCDescriptor * partition,
UInt64 partitionSize,
UInt32 partitionBlockSize,
CDSectorType partitionBlockType,
CDTOC * toc );
/*
* Allocate a new media object (called from instantiateMediaObject).
*/
virtual IOMedia * instantiateDesiredMediaObject(
CDTOCDescriptor * partition,
UInt64 partitionSize,
UInt32 partitionBlockSize,
CDSectorType partitionBlockType,
CDTOC * toc );
public:
/*
* Initialize this object's minimal state.
*/
virtual bool init(OSDictionary * properties = 0);
/*
* Scan the provider media for CD partitions.
*/
virtual IOService * probe(IOService * provider, SInt32 * score);
/*
* Determine whether the provider media contains CD partitions.
*/
virtual bool start(IOService * provider);
/*
* Read data from the storage object at the specified byte offset into the
* specified buffer, asynchronously. When the read completes, the caller
* will be notified via the specified completion action.
*
* The buffer will be retained for the duration of the read.
*
* For the CD partition scheme, we convert the read from a partition
* object into the appropriate readCD command to our provider media.
*/
virtual void read(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion);
/*
* Write data into the storage object at the specified byte offset from the
* specified buffer, asynchronously. When the write completes, the caller
* will be notified via the specified completion action.
*
* The buffer will be retained for the duration of the write.
*
* For the CD partition scheme, we convert the write from a partition
* object into the appropriate writeCD command to our provider media.
*/
virtual void write(IOService * client,
UInt64 byteStart,
IOMemoryDescriptor * buffer,
IOStorageAttributes * attributes,
IOStorageCompletion * completion);
/*
* Obtain this object's provider. We override the superclass's method
* to return a more specific subclass of OSObject -- IOCDMedia. This
* method serves simply as a convenience to subclass developers.
*/
virtual IOCDMedia * getProvider() const;
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 0);
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 1);
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 2);
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 3);
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 4);
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 5);
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 6);
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 7);
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 8);
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 9);
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 10);
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 11);
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 12);
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 13);
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 14);
OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 15);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOCDPARTITIONSCHEME_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOBDBlockStorageDevice.h | /*
* Copyright (c) 2006-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
* @header IOBDBlockStorageDevice
* @abstract
* This header contains the IOBDBlockStorageDevice class definition.
*/
#ifndef _IOBDBLOCKSTORAGEDEVICE_H
#define _IOBDBLOCKSTORAGEDEVICE_H
#include <IOKit/storage/IOBDTypes.h>
/*!
* @defined kIOBDBlockStorageDeviceClass
* @abstract
* kIOBDBlockStorageDeviceClass is the name of the IOBDBlockStorageDevice class.
* @discussion
* kIOBDBlockStorageDeviceClass is the name of the IOBDBlockStorageDevice class.
*/
#define kIOBDBlockStorageDeviceClass "IOBDBlockStorageDevice"
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/storage/IODVDBlockStorageDevice.h>
/* Property used for matching, so the generic driver gets the nub it wants. */
#define kIOBlockStorageDeviceTypeBD "BD"
/*!
* @class
* IOBDBlockStorageDevice
* @abstract
* The IOBDBlockStorageDevice class is a generic BD block storage device
* abstraction.
* @discussion
* This class is the protocol for generic BD functionality, independent of
* the physical connection protocol (e.g. SCSI, ATA, USB).
*
* The APIs are the union of CD APIs, DVD APIs, and all
* necessary new low-level BD APIs.
*
* A subclass implements relay methods that translate our requests into
* calls to a protocol- and device-specific provider.
*/
class __exported IOBDBlockStorageDevice : public IODVDBlockStorageDevice
{
OSDeclareAbstractStructors(IOBDBlockStorageDevice)
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
public:
/*!
* @function init
* @discussion
* Initialize this object's minimal state.
* @param properties
* Substitute property table for this object (optional).
* @result
* Returns true on success, false otherwise.
*/
virtual bool init(OSDictionary * properties);
/*!
* @function readDiscStructure
* @discussion
* Issue an MMC READ DISC STRUCTURE command.
* @param buffer
* Buffer for the data transfer. The size of the buffer implies the size of
* the data transfer.
* @param format
* As documented by MMC.
* @param address
* As documented by MMC.
* @param layer
* As documented by MMC.
* @param grantID
* As documented by MMC.
* @param type
* As documented by MMC.
* @result
* Returns the status of the data transfer.
*/
virtual IOReturn readDiscStructure( IOMemoryDescriptor * buffer,
UInt8 format,
UInt32 address,
UInt8 layer,
UInt8 grantID,
UInt8 type ) = 0;
/*!
* @function splitTrack
* @discussion
* Issue an MMC RESERVE TRACK command with the ARSV bit.
* @param address
* As documented by MMC.
* @result
* Returns the status of the operation.
*/
virtual IOReturn splitTrack(UInt32 address) = 0;
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 0);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 1);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 2);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 3);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 4);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 5);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 6);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 7);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 8);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 9);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 10);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 11);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 12);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 13);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 14);
OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 15);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOBDBLOCKSTORAGEDEVICE_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/IOCDMediaBSDClient.h | /*
* Copyright (c) 1998-2014 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOCDMEDIABSDCLIENT_H
#define _IOCDMEDIABSDCLIENT_H
#include <sys/ioctl.h>
#include <IOKit/storage/IOCDTypes.h>
/*
* Definitions
*
* ioctl description
* ---------------------------- ------------------------------------------------
* DKIOCCDREAD see IOCDMedia::readCD() in IOCDMedia.h
* DKIOCCDREADTOC see IOCDMedia::readTOC() in IOCDMedia.h
*
* DKIOCCDREADDISCINFO see IOCDMedia::readDiscInfo() in IOCDMedia.h
* DKIOCCDREADTRACKINFO see IOCDMedia::readTrackInfo() in IOCDMedia.h
*
* DKIOCCDREADISRC see IOCDMedia::readISRC() in IOCDMedia.h
* DKIOCCDREADMCN see IOCDMedia::readMCN() in IOCDMedia.h
*
* DKIOCCDGETSPEED see IOCDMedia::getSpeed() in IOCDMedia.h
* DKIOCCDSETSPEED see IOCDMedia::setSpeed() in IOCDMedia.h
*
* in /System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/
*/
typedef struct
{
uint64_t offset;
uint8_t sectorArea;
uint8_t sectorType;
#ifdef __LP64__
uint8_t reserved0080[10]; /* reserved, clear to zero */
#else /* !__LP64__ */
uint8_t reserved0080[6]; /* reserved, clear to zero */
#endif /* !__LP64__ */
uint32_t bufferLength; /* actual length on return */
void * buffer;
} dk_cd_read_t;
typedef struct
{
CDISRC isrc;
uint8_t track;
uint8_t reserved0112[2]; /* reserved, clear to zero */
} dk_cd_read_isrc_t;
typedef struct
{
CDMCN mcn;
uint8_t reserved0112[2]; /* reserved, clear to zero */
} dk_cd_read_mcn_t;
typedef struct
{
uint8_t format;
uint8_t formatAsTime;
uint8_t reserved0016[5]; /* reserved, clear to zero */
union
{
uint8_t session;
uint8_t track;
} address;
#ifdef __LP64__
uint8_t reserved0064[6]; /* reserved, clear to zero */
#else /* !__LP64__ */
uint8_t reserved0064[2]; /* reserved, clear to zero */
#endif /* !__LP64__ */
uint16_t bufferLength; /* actual length on return */
void * buffer;
} dk_cd_read_toc_t;
typedef struct
{
#ifdef __LP64__
uint8_t reserved0000[14]; /* reserved, clear to zero */
#else /* !__LP64__ */
uint8_t reserved0000[10]; /* reserved, clear to zero */
#endif /* !__LP64__ */
uint16_t bufferLength; /* actual length on return */
void * buffer;
} dk_cd_read_disc_info_t;
typedef struct
{
uint8_t reserved0000[4]; /* reserved, clear to zero */
uint32_t address;
uint8_t addressType;
#ifdef __LP64__
uint8_t reserved0072[5]; /* reserved, clear to zero */
#else /* !__LP64__ */
uint8_t reserved0072[1]; /* reserved, clear to zero */
#endif /* !__LP64__ */
uint16_t bufferLength; /* actual length on return */
void * buffer;
} dk_cd_read_track_info_t;
#define DKIOCCDREAD _IOWR('d', 96, dk_cd_read_t)
#define DKIOCCDREADISRC _IOWR('d', 97, dk_cd_read_isrc_t)
#define DKIOCCDREADMCN _IOWR('d', 98, dk_cd_read_mcn_t)
#define DKIOCCDGETSPEED _IOR('d', 99, uint16_t)
#define DKIOCCDSETSPEED _IOW('d', 99, uint16_t)
#define DKIOCCDREADTOC _IOWR('d', 100, dk_cd_read_toc_t)
#define DKIOCCDREADDISCINFO _IOWR('d', 101, dk_cd_read_disc_info_t)
#define DKIOCCDREADTRACKINFO _IOWR('d', 102, dk_cd_read_track_info_t)
#ifdef KERNEL
#ifdef __cplusplus
/*
* Kernel
*/
#include <IOKit/storage/IOCDMedia.h>
#include <IOKit/storage/IOMediaBSDClient.h>
/*
* Class
*/
class IOCDMediaBSDClient : public IOMediaBSDClient
{
OSDeclareDefaultStructors(IOCDMediaBSDClient)
protected:
struct ExpansionData { /* */ };
ExpansionData * _expansionData;
public:
/*
* Obtain this object's provider. We override the superclass's method
* to return a more specific subclass of IOService -- IOCDMedia. This
* method serves simply as a convenience to subclass developers.
*/
virtual IOCDMedia * getProvider() const;
/*
* Process a CD-specific ioctl.
*/
virtual int ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, proc_t proc);
OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 0);
OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 1);
OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 2);
OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 3);
OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 4);
OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 5);
OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 6);
OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 7);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif /* !_IOCDMEDIABSDCLIENT_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/ata/IOATAStorageDefines.h | /*
* Copyright (c) 1998-2007 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IO_ATA_STORAGE_DEFINES_H_
#define _IOKIT_IO_ATA_STORAGE_DEFINES_H_
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Important word offsets in device identify data as
* defined in ATA-5 standard
*/
enum
{
kATAIdentifyConfiguration = 0,
kATAIdentifyLogicalCylinderCount = 1,
kATAIdentifyLogicalHeadCount = 3,
kATAIdentifySectorsPerTrack = 6,
kATAIdentifySerialNumber = 10,
kATAIdentifyFirmwareRevision = 23,
kATAIdentifyModelNumber = 27,
kATAIdentifyMultipleSectorCount = 47,
kATAIdentifyDriveCapabilities = 49,
kATAIdentifyDriveCapabilitiesExtended = 50,
kATAIdentifyPIOTiming = 51,
kATAIdentifyExtendedInfoSupport = 53,
kATAIdentifyCurrentCylinders = 54,
kATAIdentifyCurrentHeads = 55,
kATAIdentifyCurrentSectors = 56,
kATAIdentifyCurrentCapacity = 57,
kATAIdentifyCurrentMultipleSectors = 59,
kATAIdentifyLBACapacity = 60,
kATAIdentifySingleWordDMA = 62,
kATAIdentifyMultiWordDMA = 63,
kATAIdentifyAdvancedPIOModes = 64,
kATAIdentifyMinMultiWordDMATime = 65,
kATAIdentifyRecommendedMultiWordDMATime = 66,
kATAIdentifyMinPIOTime = 67,
kATAIdentifyMinPIOTimeWithIORDY = 68,
kATAIdentifyQueueDepth = 75,
kATAIdentifyMajorVersion = 80,
kATAIdentifyMinorVersion = 81,
kATAIdentifyCommandSetSupported = 82,
kATAIdentifyCommandSetSupported2 = 83,
kATAIdentifyCommandExtension1 = 84,
kATAIdentifyCommandExtension2 = 85,
kATAIdentifyCommandsEnabled = 86,
kATAIdentifyCommandsDefault = 87,
kATAIdentifyUltraDMASupported = 88,
kATAIdentifyPhysicalLogicalSectorSize = 106,
kATAIdentifyWordsPerLogicalSector1 = 117,
kATAIdentifyWordsPerLogicalSector2 = 118,
kATAIdentifyLogicalSectorAlignment = 209,
kATAIdentifyIntegrity = 255
};
/*
* Important bits in device identify data
* as defined in ATA-5 standard
*/
enum
{
// Configuration field (word 0)
kFixedDeviceBit = 6, // Fixed disk indicator bit
kRemoveableMediaBit = 7, // Removable media indicator bit
kNonMagneticDriveBit = 15, // Non-magnetic drive indicator bit
kFixedDeviceMask = (1 << kFixedDeviceBit), // Mask for fixed disk indicator
kRemoveableMediaMask = (1 << kRemoveableMediaBit), // Mask for removable media indicator
kNonMagneticDriveMask = (1 << kNonMagneticDriveBit), // Mask for non-magnetic drive indicator
// Capabilities field (word 49)
kDMABit = 8, // DMA supported bit
kLBABit = 9, // LBA supported bit
kIORDYDisableBit = 10, // IORDY can be disabled bit
kIORDYBit = 11, // IORDY supported bit
kStandbyTimerBit = 13, // Standby timer supported bit
kDMASupportedMask = (1 << kDMABit), // Mask for DMA supported
kLBASupportedMask = (1 << kLBABit), // Mask for LBA supported
kDMADisableMask = (1 << kIORDYDisableBit), // Mask for DMA supported
kIORDYSupportedMask = (1 << kIORDYBit), // Mask for IORDY supported
kStandbySupportedMask = (1 << kStandbyTimerBit), // Mask for Standby Timer supported
// Extensions field (word 53)
kCurFieldsValidBit = 0, // Bit to show words 54-58 are valid
kExtFieldsValidBit = 1, // Bit to show words 64-70 are valid
kCurFieldsValidMask = (1 << kCurFieldsValidBit), // Mask for current fields valid
kExtFieldsValidMask = (1 << kExtFieldsValidBit), // Extension word valid
// Advanced PIO Transfer Modes field (word 64)
kMode3Bit = 0, // Bit to indicate mode 3 is supported
kMode3Mask = (1 << kMode3Bit), // Mask for mode 3 support
// Integrity of Identify data (word 255)
kChecksumValidCookie = 0xA5 // Bits 7:0 if device supports feature
};
/* String size constants */
enum
{
kSizeOfATAModelString = 40,
kSizeOfATARevisionString = 8
};
/* ATA Command timeout constants ( in milliseconds ) */
enum
{
kATATimeout10Seconds = 10000,
kATATimeout30Seconds = 30000,
kATATimeout45Seconds = 45000,
kATATimeout1Minute = 60000,
kATADefaultTimeout = kATATimeout30Seconds
};
/* Retry constants */
enum
{
kATAZeroRetries = 0,
kATADefaultRetries = 4
};
/* max number of blocks supported in ATA transaction */
enum
{
kIOATASectorCount8Bit = 8,
kIOATASectorCount16Bit = 16
};
enum
{
kIOATAMaximumBlockCount8Bit = (1 << kIOATASectorCount8Bit),
kIOATAMaximumBlockCount16Bit = (1 << kIOATASectorCount16Bit),
// For backwards compatibility
kIOATAMaxBlocksPerXfer = kIOATAMaximumBlockCount8Bit
};
/* Power Management time constants (in seconds) */
enum
{
kSecondsInAMinute = 60,
k5Minutes = 5 * kSecondsInAMinute
};
/* Bits for features published in Word 82 of device identify data */
enum
{
kATASupportsSMARTBit = 0,
kATASupportsPowerManagementBit = 3,
kATASupportsWriteCacheBit = 5
};
/* Masks for features published in Word 82 of device identify data */
enum
{
kATASupportsSMARTMask = (1 << kATASupportsSMARTBit),
kATASupportsPowerManagementMask = (1 << kATASupportsPowerManagementBit),
kATASupportsWriteCacheMask = (1 << kATASupportsWriteCacheBit)
};
/* Bits for features published in Word 83 of device identify data */
enum
{
kATASupportsCompactFlashBit = 2,
kATASupportsAdvancedPowerManagementBit = 3,
kATASupports48BitAddressingBit = 10,
kATASupportsFlushCacheBit = 12,
kATASupportsFlushCacheExtendedBit = 13
};
/* Masks for features published in Word 83 of device identify data */
enum
{
kATASupportsCompactFlashMask = (1 << kATASupportsCompactFlashBit),
kATASupportsAdvancedPowerManagementMask = (1 << kATASupportsAdvancedPowerManagementBit),
kATASupports48BitAddressingMask = (1 << kATASupports48BitAddressingBit),
kATASupportsFlushCacheMask = (1 << kATASupportsFlushCacheBit),
kATASupportsFlushCacheExtendedMask = (1 << kATASupportsFlushCacheExtendedBit),
// Mask to ensure data is valid
kIdentifyWordValidationMask = 0xC000,
kIdentifyWordValid = 0x4000
};
/* Bits for features published in Word 84 of device identify data */
enum
{
kATAForceUnitAccessFeatureBit = 6,
};
/* Masks for features published in Word 84 of device identify data */
enum
{
kATAForceUnitAccessFeatureMask = (1 << kATAForceUnitAccessFeatureBit),
};
/* Bits for features published in Word 85 of device identify data */
enum
{
kATAWriteCacheEnabledBit = 5
};
/* Masks for features published in Word 85 of device identify data */
enum
{
kATAWriteCacheEnabledMask = (1 << kATAWriteCacheEnabledBit)
};
/* Bits for features published in Word 106 of device identify data */
enum
{
kATAPhysicalLogicalEnabledBit0 = 15,
kATAPhysicalLogicalEnabledBit1 = 14,
kATAMultipleLogicalSectorsBit = 13,
kATAValidLogicalSectorSizeBit = 12
};
/* Masks for features published in Word 106 of device identify data */
enum
{
kATAPhysicalLogicalEnabledMask = (1 << kATAPhysicalLogicalEnabledBit0) | (1 << kATAPhysicalLogicalEnabledBit1),
kATAPhysicalLogicalEnabledValue = (0 << kATAPhysicalLogicalEnabledBit0) | (1 << kATAPhysicalLogicalEnabledBit1),
kATAMultipleLogicalSectorsMask = (1 << kATAMultipleLogicalSectorsBit),
kATAValidLogicalSectorSizeMask = (1 << kATAValidLogicalSectorSizeBit),
kATAPhysicalSectorSizeMask = 0xF,
kATALogicalSectorAlignmentMask = 0x3FFF
};
// Property table keys
#define kIOATASupportedFeaturesKey "ATA Features"
/* ATA supported features */
enum
{
kIOATAFeaturePowerManagement = 0x01, /* OBSOLETE */
kIOATAFeatureWriteCache = 0x02, /* OBSOLETE */
kIOATAFeatureAdvancedPowerManagement = 0x04,
kIOATAFeatureCompactFlash = 0x08,
kIOATAFeature48BitLBA = 0x10,
kIOATAFeatureSMART = 0x20
};
/* ATA Advanced Power Management settings (valid settings range from 1-254),
the settings below are the more common settings */
enum
{
kIOATAMaxPerformance = 0xFE,
kIOATADefaultPerformance = 0x80,
kIOATAMaxPowerSavings = 0x01
};
/* ATA Transfer Mode bit masks */
enum
{
kATAEnableUltraDMAModeMask = 0x40,
kATAEnableMultiWordDMAModeMask = 0x20,
kATAEnablePIOModeMask = 0x08
};
typedef uint32_t ATAOperationType;
enum
{
kATAOperationTypeRead = 0,
kATAOperationTypeWrite = 1,
kATAOperationTypeFlushCache = 2,
kATAOperationTypeSMART = 3,
kATAOperationTypeConfiguration = 4,
kATAOperationTypePowerManagement = 5,
kATAOperationTypeSMS = 6
};
#if defined(KERNEL)
typedef struct __ATAIORequest * ATARequestIdentifier;
#endif // defined(KERNEL)
#ifdef __cplusplus
}
#endif
#endif /* _IOKIT_IO_ATA_STORAGE_DEFINES_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/ata/IOATAPIProtocolTransport.h | /*
* Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header IOATAPIProtocolTransport
Contains the class definition for IOATAPIProtocolTransport.
*/
#ifndef _IOKIT_IO_ATAPI_PROTOCOL_TRANSPORT_H_
#define _IOKIT_IO_ATAPI_PROTOCOL_TRANSPORT_H_
#define kIOPropertyATAPIMassStorageCharacteristics "ATAPI Mass Storage Characteristics"
#if defined(KERNEL) && defined(__cplusplus)
/* General IOKit includes */
#include <IOKit/IOLib.h>
#include <IOKit/IOMessage.h>
#include <IOKit/IOService.h>
#include <IOKit/IOCommandPool.h>
/* IOKit ATA Family includes */
#include <IOKit/ata/IOATADevice.h>
#include <IOKit/ata/IOATATypes.h>
/* IOKit ATA Storage includes */
#include <IOKit/storage/ata/IOATAStorageDefines.h>
/* SCSI Architecture Model Family includes */
#include <IOKit/scsi/IOSCSIProtocolServices.h>
// Forward class declaration
class IOATAPIProtocolTransport;
/*!
@typedef ATAPIClientData
@param cmd IOATACommand for request.
@param self Pointer to the object.
@param scsiTask SCSITaskIdentifier of request.
@discussion This structure is stuffed into the refcon so we can associate which
IOATACommand and SCSITaskIdentifier is completing.
*/
struct ATAPIClientData
{
IOATACommand * cmd;
IOATAPIProtocolTransport * self;
SCSITaskIdentifier scsiTask;
};
typedef struct ATAPIClientData ATAPIClientData;
/*!
@class IOATAPIProtocolTransport
@abstract SCSI Protocol Driver Family for ATAPI Devices.
@discussion IOATAPIProtocolTransport contains all the bus specific support for ATAPI compliant devices.
To add vendor specific features or workarounds you will sub-class the appropriate
methods of this family.
*/
class IOATAPIProtocolTransport : public IOSCSIProtocolServices
{
OSDeclareDefaultStructors ( IOATAPIProtocolTransport )
public:
// ---- IOService methods overridden ----
bool init ( OSDictionary * propTable );
// The start method is called to start our services. If the device
// can be controlled by this object, then we return true, else we
// return false. start() is usually used to allocate resources once
// it is determined that the device can be controlled by this object.
virtual bool start ( IOService * provider );
// The stop method is called to stop our services. It is primarily
// called for deallocation of resources.
virtual void stop ( IOService * provider );
// This method is our last chance to free all resources allocated.
virtual void free ( void );
protected:
// ---- member variables ----
IOATADevice * fATADevice;
ataUnitID fATAUnitID;
ataDeviceType fATADeviceType;
ataSocketType fATASocketType;
atapiConfig fATAPIPacketConfig;
UInt8 fPIOMode;
UInt8 fDMAMode;
UInt8 fUltraDMAMode;
IOCommandGate * fCommandGate;
IOCommandPool * fCommandPool;
IOATACommand * fResetCommand;
IOATACommand * fConfigCommand;
IOATACommand * fIdentifyCommand;
char fRevision[kSizeOfATARevisionString + 1];
char fModel[kSizeOfATAModelString + 1];
bool fWakeUpResetOccurred;
bool fPhysicallyConnected;
// Used for low-power polling support
thread_call_t fPollingThread;
UInt16 fDeviceIdentifyData[256];
IOMemoryDescriptor * fDeviceIdentifyBuffer;
bool fResetInProgress;
// Binary Compatibility instance variable expansion
struct ExpansionData
{
UInt32 fSemaphore;
UInt32 fMediaNotifyValue;
};
ExpansionData * reserved;
// ---- IOService methods overridden ----
// The message method is used to listen to messages from our provider, the ATA controller.
// It sends messages for bus reset notifications and for device removal (such as MediaBay,
// PC card, etc.)
virtual IOReturn message ( UInt32 type, IOService * provider, void * argument = 0 );
// ---- Protocol transport methods overridden ----
// Send a SCSI Command to the device. If the command was sent to the
// device and is pending completion, the subclass should return true and
// return back the kSCSIServiceResponse_Request_In_Process response.
// If the command completes immediately with an error, the subclass will
// return true and return back the appropriate status.
// if the subclass is currently processing all the commands it can, the
// subclass will return false and the command will be resent next time
// CommandCompleted is called.
virtual bool SendSCSICommand ( SCSITaskIdentifier request,
SCSIServiceResponse * serviceResponse,
SCSITaskStatus * taskStatus );
// This is a stub - not implemented in upper layer yet. Eventually, there
// will be a way to abort a task or task set and this method will be called.
// It will abort any commands which have not been executed by the ATA controller
virtual SCSIServiceResponse AbortSCSICommand ( SCSITaskIdentifier request );
// The IsProtocolServiceSupported method will return true if the protocol
// layer supports the specified feature.
virtual bool IsProtocolServiceSupported ( SCSIProtocolFeature feature, void * serviceValue );
// The HandleProtocolServiceFeature method will return true if the protocol
// layer properly handled the specified feature.
virtual bool HandleProtocolServiceFeature ( SCSIProtocolFeature feature, void * serviceValue );
// ------ Power Management Support ------
// The HandlePowerOff method is called to do any bus specific activity
// necessary before shutting down and going to sleep.
virtual IOReturn HandlePowerOff ( void );
// The HandlePowerOn method is called to do any bus specific activity
// necessary to recover from power-on/wake from sleep (e.g. device reset on ATAPI)
virtual IOReturn HandlePowerOn ( void );
// ---- Methods defined by this class ----
// Static callback proc for all SCSITask objects, it calls through to
// SCSITaskCallbackFunction.
static void sSCSITaskCallbackProc ( IOATACommand * cmd );
// Callback proc for synchronous ATA only type commands.
static void sATACallbackSync ( IOATACommand * cmd );
// Callback proc for asynchronous ATAPI resets.
static void sATAPIResetCallback ( IOATACommand * cmd );
// Callback proc that does nothing.
static void sATAPIVoidCallback ( IOATACommand * cmd );
// State machine for device configuration.
static void sATAPIConfigStateMachine ( IOATACommand * cmd );
// Used for low-power polling.
static void sPollStatusRegister ( void * xptDriver, void * refCon );
// Static callback for low-power polling.
static void sPollStatusRegisterCallback ( IOATACommand * cmd );
// This method is called by the SCSITaskCallbackFunction and it calls the
// inherited CommandCompleted message with the results of the task.
virtual void CompleteSCSITask ( SCSITaskIdentifier scsiTask,
SCSIServiceResponse serviceResponse,
SCSITaskStatus taskStatus );
// The SCSITaskCallbackFunction method is called by the static callback procedure
// to complete SCSITask operations. This method may be subclassed if a device
// workaround is necessary.
virtual void SCSITaskCallbackFunction ( IOATACommand * cmd,
SCSITaskIdentifier scsiTask );
// The ReportATAPIDeviceType method returns the ataDeviceType for ATAPI
virtual ataDeviceType ReportATAPIDeviceType ( void ) const;
// The InspectDevice method is called to inspect the ATA device and verify
// that it is a device which can be controlled by this object
virtual bool InspectDevice ( IOATADevice * ataDevice );
// The AllocateATACommandObjects method is called to allocate a pool of
// IOATACommands for general purpose I/O usage.
virtual void AllocateATACommandObjects ( void );
// The DeallocateATACommandObjects method is called to deallocate a pool of
// IOATACommands for general purpose I/O usage.
virtual void DeallocateATACommandObjects ( void );
// The GetATACommandObject method is called to retrieve a command from
// the pool. Pass true to allow the method to sleep waiting for a command,
// else pass false. If false is passed, there is NO guarantee that a valid
// command will be returned. If true is passed, it IS guaranteed that a
// valid command will be returned, but the thread may be slept waiting for
// those resources.
virtual IOATACommand * GetATACommandObject ( bool okToSleep = true );
// The ReturnATACommandObject method is called to return a command to
// the pool.
virtual void ReturnATACommandObject ( IOATACommand * cmd );
// The sSwapBytes16 method is used to word-swap the Device Identify data
// on big endian systems. Since all identify data is returned in little endian
// values, it must be word-swapped before inspected.
static void sSwapBytes16 ( UInt8 * buffer, IOByteCount numBytesToSwap );
// The sConvertHighestBitToNumber method is used to find the highest bit in a
// word and return a numeric value. This is used to find the highest possible
// values for PIO, DMA, and UltraDMA transfer modes.
static UInt8 sConvertHighestBitToNumber ( UInt16 bitField );
// The sSetWakeupResetOccurred method is used to safely set member variables
// behind the command gate.
static void sSetWakeupResetOccurred ( IOATAPIProtocolTransport * driver,
bool resetOccurred );
// The sCheckWakeupResetOccur method is used to safely check member variables
// behind the command gate.
static void sCheckWakeupResetOccurred ( IOATAPIProtocolTransport * driver,
bool * resetOccurred );
// The DidWakeupResetOccur method is used to safely find out if a reset
// occurred while we were asleep.
virtual bool CheckWakeupResetOccurred ( void );
// The WakeupResetOccurred method is used to safely set/clear the reset flag.
virtual void SetWakeupResetOccurred ( bool resetOccurred );
// The SetPIOTransferMode method is used to set the programmed input-output (PIO)
// transfer mode. The highest value reported by the device is used.
virtual IOReturn SetPIOTransferMode ( IOATACommand * cmd, bool forceSync );
// The SetDMATransferMode method is used to set the direct memory access (DMA)
// transfer mode. The highest value reported by the device is used.
virtual IOReturn SetDMATransferMode ( IOATACommand * cmd, bool forceSync );
// The IdentifyAndConfigureATAPIDevice method is called to correctly identify
// and configure an ATAPI device.
virtual IOReturn IdentifyAndConfigureATAPIDevice ( void );
// The ConfigureATAPIDevice method is called to correctly configure the ATAPI
// device. It currently configures any PIO/DMA/UDMA transfer modes but may be
// expanded in the future.
virtual IOReturn ConfigureATAPIDevice ( void );
// The ReconfigureATAPIDevice method is called to correctly reconfigure the ATAPI
// device after a reset event has occurred (bus reset or device reset). It
// currently reconfigures any PIO/DMA/UDMA transfer modes but may be expanded in
// the future.
virtual IOReturn ReconfigureATAPIDevice ( void );
// The IdentifyATAPIDevice method is called to correctly identify the ATAPI
// device. It currently issues the Identify ATAPI Device packet command and
// uses the data to correctly configure the device.
virtual IOReturn IdentifyATAPIDevice ( void );
// The ResetATAPIDevice method is called to issue a Device Reset (also known
// as a SOFT RESET). This method will only reset the specified device on the
// bus.
virtual IOReturn ResetATAPIDevice ( void );
// The SendATASleepCommand method is called to put an ATAPI drive in sleep
// mode.
virtual IOReturn SendATASleepCommand ( void );
// The EnablePollingOfStatusRegister method is called to set up a timer for
// the call to PollStatusRegister. It is called when the SCSI Application Layer
// driver wants to enable low-power polling and after a poll which does not
// see a change in the register status.
virtual void EnablePollingOfStatusRegister ( void );
// The DisablePollingOfStatusRegister method is called to cancel any thread
// call which is doing a poll and drop the retain count on the object.
virtual void DisablePollingOfStatusRegister ( void );
// The PollStatusRegister method is used to do low-power polling on drives which
// support it. This feature is enabled by the SCSI Application Layer driver.
virtual void PollStatusRegister ( void * refCon );
// Callback method for the polling of the status register.
virtual void PollStatusRegisterCallback ( IOATACommand * cmd );
// The TurnDrivePowerOff method is called to turn power to the drive OFF
IOReturn TurnDrivePowerOff ( void );
IOReturn SendCommand ( IOATACommand * cmd );
IOReturn GatedWaitForRequest ( void * data );
private:
// Binary Compatibility reserved method space
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 1 );
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 2 );
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 3 );
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 4 );
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 5 );
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 6 );
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 7 );
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 8 );
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 9 );
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 10 );
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 11 );
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 12 );
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 13 );
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 14 );
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 15 );
OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 16 );
};
#endif /* defined(KERNEL) && defined(__cplusplus) */
#endif /* _IOKIT_IO_ATAPI_PROTOCOL_TRANSPORT_H_ */ |
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/graphics/IOFramebufferShared.h | /*
* Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOFRAMEBUFFERSHARED_H
#define _IOKIT_IOFRAMEBUFFERSHARED_H
#include <IOKit/hidsystem/IOHIDTypes.h>
#include <IOKit/graphics/IOGraphicsTypes.h>
#include <libkern/OSAtomic.h>
#ifdef __cplusplus
extern "C" {
#endif
/*! @header IOFramebufferShared
The IOFramebufferShared.h header contains definitions of objects and types shared between a kernel level IOFrameBuffer service and a non-kernel window server. In Mac OS X this structure is used by the CoreGraphics server and IOGraphics Family, and is not available to other clients. IOFramebuffer subclasses and IOFramebuffer clients within the kernel should also not rely on this structure definition and constants. It is public only for use on Darwin based window servers. Cursor and window server state data is exchanged by kernel and non-kernel tasks through a slice of shared memory containing a StdFBShmem_t structure.<br>
For a non-kernel task to get access to this slice of shared memory, a connection to an IOFramebuffer service must be made. A connection is made with the IOServiceOpen() function described in IOKitLib.h. A connection type of kIOFBServerConnectType or kIOFBSharedConnectType (for read-only access) should be specified. An io_connect_t handle is returned by IOServiceOpen(). This handle must be passed to IOFBCreateSharedCursor() to create the slice of shared memory. Then IOConnectMapMemory() may be called with a memory type of kIOFBCursorMemory to map the shared memory into the non-kernel task.
*/
#ifdef KERNEL
// CGS use optional
/*! @defined IOFB_ARBITRARY_SIZE_CURSOR
@discussion When IOFB_ARBITRARY_SIZE_CURSOR is not defined, the maximum cursor size is assumed to be CURSORWIDTH x CURSORHEIGHT and this header file will define a number of structures for storing cursor images accordingly. A non-kernel task may define IOFB_ARBITRARY_SIZE_CURSOR and use cursors up to the size specified when IOFBCreateSharedCursor() was called. In this case appropriate structures for storing cursor images must be defined elsewhere. In the kernel, IOFB_ARBITRARY_SIZE_CURSOR is always defined.
*/
#define IOFB_ARBITRARY_SIZE_CURSOR
#define IOFB_ARBITRARY_FRAMES_CURSOR 1
#endif
#define IOFB_SUPPORTS_XOR_CURSOR
#define IOFB_SUPPORTS_HW_SHIELD
#define IOFB_SUPPORTS_ARBITRARY_FRAMES_CURSOR
//
// Cursor and Window Server state data, occupying a slice of shared memory
// between the kernel and WindowServer.
//
/*! @enum CursorParameters
@constant kIOFBNumCursorFrames The number of cursor images stored in the StdFBShmem_t structure.
@constant kIOFBNumCursorFramesShift Used with waiting cursors.
@constant kIOFBMaxCursorDepth The maximum cursor pixel depth.
*/
enum {
#if IOFB_ARBITRARY_FRAMES_CURSOR
kIOFBMainCursorIndex = 0,
kIOFBWaitCursorIndex = 1,
kIOFBNumCursorIndex = 4,
#else
kIOFBNumCursorFrames = 4,
kIOFBNumCursorFramesShift = 2,
#endif
kIOFBMaxCursorDepth = 32,
kIOFBMaxCursorWidth = 256,
kIOFBMaxCursorFrames = 32,
};
#ifndef IOFB_ARBITRARY_SIZE_CURSOR
/*! @defined CURSORWIDTH
@discussion The maximum width of the cursor image in pixels. This is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined.
*/
#define CURSORWIDTH 16 /* width in pixels */
/*! @defined CURSORHEIGHT
@discussion The maximum height of the cursor image in pixels. This is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined.
*/
#define CURSORHEIGHT 16 /* height in pixels */
/*! @struct bm12Cursor
@abstract Cursor image for 1-bit cursor.
@discussion This structure stores 16 pixel x 16 pixel cursors to be used with 1-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined.
@field image This array contains the cursor images.
@field mask This array contains the cursor mask.
@field save This array stores the pixel values of the region underneath the cursor in its last drawn position.
*/
struct bm12Cursor {
unsigned int image[4][16];
unsigned int mask[4][16];
unsigned int save[16];
};
/*! @struct bm18Cursor
@abstract Cursor image for 8-bit cursor.
@discussion This structure stores 16 pixel x 16 pixel cursors to be used with 8-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined.
@field image This array contains cursor color values, which are converted to displayed colors through the color table. The array is two dimensional and its first index is the cursor frame and the second index is the cursor pixel.
@field mask This array contains the cursor alpha mask. The array is two dimensional with the same indexing as the image. If an alpha mask pixel is 0 and the corresponding image pixel is set to white for the display, then this cursor pixel will invert pixels on the display.
@field save This array stores the color values of the region underneath the cursor in its last drawn position.
*/
struct bm18Cursor {
unsigned char image[4][256];
unsigned char mask[4][256];
unsigned char save[256];
};
/*! @struct bm34Cursor
@abstract Cursor image for 15-bit cursor.
@discussion This structure stores 16 pixel x 16 pixel cursors to be used with 15-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined.
@field image This array defines the cursor color values and transparency. The array is two dimensional and its first index is the cursor frame and the second index is the cursor pixel. A value of 0 means the pixel is transparent. Non-zero values are stored with the red, green, blue, and alpha values encoded with the following masks:<BR>
red mask = 0xF000<br>
blue mask 0x0F00<br>
green mask 0x00F0<br>
alpha mask = 0x000F<br>
Note, only 4 bits are allocated for each color component.
@field save This array stores the color values of the region underneath the cursor in its last drawn position.
*/
struct bm34Cursor {
unsigned short image[4][256];
unsigned short save[256];
};
/*! @struct bm38Cursor
@abstract Cursor image for 24-bit cursor.
@discussion This structure stores 16 pixel x 16 pixel cursors to be used with 24-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined.
@field image This array defines the cursor color values and transparency. The array is two dimensional and its first index is the cursor frame and the second index is the cursor pixel. The lower 24 bits of a pixel's value contain the RGB color, while the upper 8 bits contain the alpha value.
@field save This array stores the color values of the region underneath the cursor in its last drawn position.
*/
struct bm38Cursor {
unsigned int image[4][256];
unsigned int save[256];
};
#endif /* IOFB_ARBITRARY_SIZE_CURSOR */
enum {
kIOFBCursorImageNew = 0x01,
kIOFBCursorHWCapable = 0x02
};
enum {
kIOFBHardwareCursorActive = 0x01,
kIOFBHardwareCursorInVRAM = 0x02
};
/*! @struct StdFBShmem_t
@discussion This structure contains cursor and window server state data and occupies a slice of shared memory between the kernel and window server. Several elements of this structure are only used in software cursor mode. Unless otherwise indicated, the coordinates in this structure are given in display space. Display space is the coordinate space that encompasses all the screens. The positions of the screens within display space indicate their location relative to each other as the cursor moves between them. If there is only one screen, the screen coordinates and display space coordinates will be the same.
@field cursorSema Semaphore lock for write access to the shared data in this structure.
@field frame The current cursor frame index.
@field cursorShow The cursor is displayed when cursorShow is 0.
@field cursorObscured If this is true, the cursor has been obscured and cursorShow should not be 0. The cursor will be shown again the next time it is moved.
@field shieldFlag When this is set to true the cursor will not be displayed in the region specified by shieldRect.
@field shielded True if the cursor has been hidden because it entered the shielded region.
@field saveRect The region that is saved underneath the cursor in software cursor mode.
@field shieldRect The region that the cursor will not be displayed in if shieldFlag is true.
@field cursorLoc The location of the cursor hot spot.
@field cursorRect The region that the cursor image currently occupies in software cursor mode.
@field oldCursorRect The region that the cursor image occupied the last time the cursor was drawn in software cursor mode.
@field screenBounds The region that the current screen occupies.
@field version Contains kIOFBCurrentShmemVersion so that a user client can ensure it is using the same version of this structure as the kernel.
@field structSize Contains the size of this structure.
@field vblTime The time of the most recent vertical blanking.
@field vblDelta The interval between the two most recent vertical blankings.
@field vblCount A running count of vertical blank interrupts.
@field reservedC Reserved for future use.
@field hardwareCursorCapable True if the hardware is capable of using hardware cursor mode.
@field hardwareCursorActive True if currently using the hardware cursor mode.
@field reservedB Reserved for future use.
@field cursorSize This array contains the cursor sizes indexed by frame.
@field hotSpot This array contains the location of the cursor hot spots indexed by frame. The hot spots coordinates are given relative to the top left corner of the cursor image.
@field cursor A union of structures that define the cursor images. The structure used depends on the framebuffer's bit depth. These structures are defined above.
*/
struct StdFBShmem_t {
OSSpinLock cursorSema;
int frame;
char cursorShow;
char cursorObscured;
char shieldFlag;
char shielded;
IOGBounds saveRect;
IOGBounds shieldRect;
IOGPoint cursorLoc;
IOGBounds cursorRect;
IOGBounds oldCursorRect;
IOGBounds screenBounds;
int version;
int structSize;
AbsoluteTime vblTime;
AbsoluteTime vblDelta;
unsigned long long int vblCount;
#if IOFB_ARBITRARY_FRAMES_CURSOR
unsigned long long int vblDrift;
unsigned long long int vblDeltaMeasured;
AbsoluteTime vblDeltaReal;
unsigned int reservedC[22];
#else
unsigned int reservedC[27];
unsigned char hardwareCursorFlags[kIOFBNumCursorFrames];
#endif
unsigned char hardwareCursorCapable;
unsigned char hardwareCursorActive;
unsigned char hardwareCursorShields;
unsigned char reservedB[1];
#if IOFB_ARBITRARY_FRAMES_CURSOR
IOGSize cursorSize[kIOFBNumCursorIndex];
IOGPoint hotSpot[kIOFBNumCursorIndex];
#else
IOGSize cursorSize[kIOFBNumCursorFrames];
IOGPoint hotSpot[kIOFBNumCursorFrames];
#endif
#ifndef IOFB_ARBITRARY_SIZE_CURSOR
union {
struct bm12Cursor bw;
struct bm18Cursor bw8;
struct bm34Cursor rgb;
struct bm38Cursor rgb24;
} cursor;
#else /* IOFB_ARBITRARY_SIZE_CURSOR */
unsigned char cursor[0];
#endif /* IOFB_ARBITRARY_SIZE_CURSOR */
};
#ifndef __cplusplus
typedef volatile struct StdFBShmem_t StdFBShmem_t;
#endif
/*! @enum FramebufferConstants
@constant kIOFBCurrentShmemVersion The current version of the slice of shared memory that contains the cursor and window server state data in the StdFBShmem_t structure.
@constant kIOFBCursorMemory The memory type for IOConnectMapMemory() to get a slice of shared memory that contains the StdFBShmem_t structure.
*/
enum {
// version for IOFBCreateSharedCursor
kIOFBShmemVersionMask = 0x000000ff,
kIOFBTenPtOneShmemVersion = 2,
kIOFBTenPtTwoShmemVersion = 3,
kIOFBCurrentShmemVersion = 2,
// number of frames in animating cursor (if > kIOFBTenPtTwoShmemVersion)
kIOFBShmemCursorNumFramesMask = 0x00ff0000,
kIOFBShmemCursorNumFramesShift = 16,
// memory types for IOConnectMapMemory.
kIOFBCursorMemory = 100
};
/*! @defined IOFRAMEBUFFER_CONFORMSTO
@discussion The class name of the framebuffer service.
*/
#define IOFRAMEBUFFER_CONFORMSTO "IOFramebuffer"
#ifdef __cplusplus
}
#endif
#endif /* ! _IOKIT_IOFRAMEBUFFERSHARED_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/graphics/IOAccelerator.h | /*
* Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IO_ACCELERATOR_H
#define _IO_ACCELERATOR_H
#include <IOKit/IOService.h>
#include <IOKit/graphics/IOAccelTypes.h>
class IOAccelerator : public IOService
{
OSDeclareDefaultStructors(IOAccelerator)
public:
static IOReturn createAccelID(IOOptionBits options, IOAccelID * identifier);
static IOReturn retainAccelID(IOOptionBits options, IOAccelID identifier);
static IOReturn releaseAccelID(IOOptionBits options, IOAccelID identifier);
};
#endif /* _IO_ACCELERATOR_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/graphics/IOAccelSurfaceConnect.h | /*
* Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOACCEL_SURFACE_CONNECT_H
#define _IOACCEL_SURFACE_CONNECT_H
#include <IOKit/graphics/IOAccelTypes.h>
#include <IOKit/graphics/IOAccelClientConnect.h>
/*
** Surface visible region in device coordinates.
**
** num_rects: The number of rectangles in the rect array. If num_rects
** is zero the bounds rectangle is used for the visible rectangle.
** If num_rects is zero the surface must be completely contained
** by the device.
**
** bounds: The unclipped surface rectangle in device coords. Extends
** beyond the device bounds if the surface is not totally on
** the device.
**
** rect[]: An array of visible rectangles in device coords. If num_rects
** is non-zero only the region described by these rectangles is
** copied to the frame buffer during a flush operation.
*/
typedef struct
{
UInt32 num_rects;
IOAccelBounds bounds;
IOAccelBounds rect[0];
} IOAccelDeviceRegion;
/*
** Determine the size of a region.
*/
#define IOACCEL_SIZEOF_DEVICE_REGION(_rgn_) (sizeof(IOAccelDeviceRegion) + (_rgn_)->num_rects * sizeof(IOAccelBounds))
/*
** Surface client public memory types. Private memory types start with
** kIOAccelNumSurfaceMemoryTypes.
*/
enum eIOAccelSurfaceMemoryTypes {
kIOAccelNumSurfaceMemoryTypes
};
/*
** Surface client public methods. Private methods start with
** kIOAccelNumSurfaceMethods.
*/
enum eIOAccelSurfaceMethods {
kIOAccelSurfaceReadLockOptions,
kIOAccelSurfaceReadUnlockOptions,
kIOAccelSurfaceGetState,
kIOAccelSurfaceWriteLockOptions,
kIOAccelSurfaceWriteUnlockOptions,
kIOAccelSurfaceRead,
kIOAccelSurfaceSetShapeBacking,
kIOAccelSurfaceSetIDMode,
kIOAccelSurfaceSetScale,
kIOAccelSurfaceSetShape,
kIOAccelSurfaceFlush,
kIOAccelSurfaceQueryLock,
kIOAccelSurfaceReadLock,
kIOAccelSurfaceReadUnlock,
kIOAccelSurfaceWriteLock,
kIOAccelSurfaceWriteUnlock,
kIOAccelSurfaceControl,
kIOAccelSurfaceSetShapeBackingAndLength,
kIOAccelNumSurfaceMethods
};
/*
** Option bits for IOAccelCreateSurface and the kIOAccelSurfaceSetIDMode method.
** The color depth field can take any value of the _CGSDepth enumeration.
*/
typedef enum {
kIOAccelSurfaceModeColorDepth1555 = 0x00000003,
kIOAccelSurfaceModeColorDepth8888 = 0x00000004,
// kIOAccelSurfaceModeColorDepthRGB565 = 0x00000005,
kIOAccelSurfaceModeColorDepthYUV = 0x00000006,
kIOAccelSurfaceModeColorDepthYUV9 = 0x00000007,
kIOAccelSurfaceModeColorDepthYUV12 = 0x00000008,
kIOAccelSurfaceModeColorDepthYUV2 = 0x00000009,
kIOAccelSurfaceModeColorDepthBGRA32 = 0x0000000A,
// kIOAccelSurfaceModeColorDepthRGBA64 = 0x0000000B,
// kIOAccelSurfaceModeColorDepthRGBAFloat64 = 0x0000000C,
// kIOAccelSurfaceModeColorDepthRGBAFloat128 = 0x0000000D,
// kIOAccelSurfaceModeColorDepthYUV420 = 0x0000000E,
kIOAccelSurfaceModeColorDepth2101010 = 0x0000000F,
kIOAccelSurfaceModeColorDepthBits = 0x0000000F,
kIOAccelSurfaceModeStereoBit = 0x00000010,
kIOAccelSurfaceModeWindowedBit = 0x00000020,
#ifndef _OPEN_SOURCE_
kIOAccelSurfaceModeSurface2 = 0x00004000,
#endif /* _OPEN_SOURCE_ */
kIOAccelSurfaceModeBeamSync = 0x00008000
} eIOAccelSurfaceModeBits;
/*
** Options bits for IOAccelSetSurfaceShape and the kIOAccelSurfaceSetShape method.
*/
typedef enum {
kIOAccelSurfaceShapeNone = 0x00000000,
kIOAccelSurfaceShapeNonBlockingBit = 0x00000001,
kIOAccelSurfaceShapeNonSimpleBit = 0x00000002,
kIOAccelSurfaceShapeIdentityScaleBit = 0x00000004,
kIOAccelSurfaceShapeFrameSyncBit = 0x00000008,
kIOAccelSurfaceShapeBeamSyncBit = 0x00000010,
kIOAccelSurfaceShapeStaleBackingBit = 0x00000020,
kIOAccelSurfaceShapeAssemblyBit = 0x00000040,
kIOAccelSurfaceShapeWaitEnabledBit = 0x00000080,
/* wrong name, use kIOAccelSurfaceShapeNonBlockingBit */
kIOAccelSurfaceShapeBlockingBit = kIOAccelSurfaceShapeNonBlockingBit
} eIOAccelSurfaceShapeBits;
/*
** Return bits for the kIOAccelSurfaceGetState method.
*/
typedef enum {
kIOAccelSurfaceStateNone = 0x00000000,
kIOAccelSurfaceStateIdleBit = 0x00000001
} eIOAccelSurfaceStateBits;
/*
** Option bits for the kIOAccelSurfaceSetScale method.
*/
typedef enum {
kIOAccelSurfaceBeamSyncSwaps = 0x00000001,
kIOAccelSurfaceFixedSource = 0x00000002,
kIOAccelSurfaceFiltering = 0x000000f0,
kIOAccelSurfaceFilterDefault = 0x00000000,
kIOAccelSurfaceFilterNone = 0x00000010,
kIOAccelSurfaceFilterLinear = 0x00000020
} eIOAccelSurfaceScaleBits;
/*
** Option bits for the kIOAccelSurfaceLock methods.
*/
typedef enum {
kIOAccelSurfaceLockInBacking = 0,
kIOAccelSurfaceLockInAccel = 1,
kIOAccelSurfaceLockInDontCare = 2,
kIOAccelSurfaceLockInMask = 0x00000003
} eIOAccelSurfaceLockBits;
#endif /* _IOACCEL_SURFACE_CONNECT_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/graphics/IOGraphicsEngine.h | /*
* Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
*
* HISTORY
*
* 10 Mar 99 sdouglas created.
*/
struct IOGraphicsEngineContext {
OSSpinLock contextLock;
IOOptionBits state;
void * owner;
UInt32 version;
IOByteCount structSize;
UInt32 reserved[ 8 ];
};
#ifndef __cplusplus
typedef volatile struct IOGraphicsEngineContext IOGraphicsEngineContext;
#endif
enum {
// memory type for IOMapMemory
kIOGraphicsEngineContext = 100
};
enum {
// version
kIOGraphicsEngineContextVersion = 1
};
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/graphics/IOAccelTypes.h | /*
* Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOACCEL_TYPES_H
#define _IOACCEL_TYPES_H
#include <IOKit/IOTypes.h>
#include <IOKit/IOKitKeys.h>
#define IOACCEL_TYPES_REV 12
#if !defined(OSTYPES_K64_REV) && !defined(MAC_OS_X_VERSION_10_6)
#define IOACCELTYPES_10_5 1
#endif
/* Integer rectangle in device coordinates */
typedef struct
{
SInt16 x;
SInt16 y;
SInt16 w;
SInt16 h;
} IOAccelBounds;
typedef struct
{
SInt16 w;
SInt16 h;
} IOAccelSize;
/* Surface information */
enum {
kIOAccelVolatileSurface = 0x00000001
};
typedef struct
{
#if IOACCELTYPES_10_5
vm_address_t address[4];
#else
mach_vm_address_t address[4];
#endif /* IOACCELTYPES_10_5 */
UInt32 rowBytes;
UInt32 width;
UInt32 height;
UInt32 pixelFormat;
IOOptionBits flags;
IOFixed colorTemperature[4];
UInt32 typeDependent[4];
} IOAccelSurfaceInformation;
typedef struct
{
#if IOACCELTYPES_10_5
long x, y, w, h;
void *client_addr;
unsigned long client_row_bytes;
#else
SInt32 x, y, w, h;
mach_vm_address_t client_addr;
UInt32 client_row_bytes;
#endif /* IOACCELTYPES_10_5 */
} IOAccelSurfaceReadData;
typedef struct {
IOAccelBounds buffer;
IOAccelSize source;
UInt32 reserved[8];
} IOAccelSurfaceScaling;
typedef SInt32 IOAccelID;
enum {
kIOAccelPrivateID = 0x00000001
};
#endif /* _IOACCEL_TYPES_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/graphics/IODisplay.h | /*
* Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IODISPLAY_H
#define _IOKIT_IODISPLAY_H
#include <sys/kdebug.h>
#include <sys/proc.h>
#include <IOKit/IOService.h>
#include <IOKit/graphics/IOFramebuffer.h>
extern const OSSymbol * gIODisplayParametersKey;
extern const OSSymbol * gIODisplayGUIDKey;
extern const OSSymbol * gIODisplayValueKey;
extern const OSSymbol * gIODisplayMinValueKey;
extern const OSSymbol * gIODisplayMaxValueKey;
extern const OSSymbol * gIODisplayBrightnessProbeKey;
extern const OSSymbol * gIODisplayLinearBrightnessProbeKey;
extern const OSSymbol * gIODisplayContrastKey;
extern const OSSymbol * gIODisplayBrightnessKey;
extern const OSSymbol * gIODisplayLinearBrightnessKey;
extern const OSSymbol * gIODisplayUsableLinearBrightnessKey;
extern const OSSymbol * gIODisplayBrightnessFadeKey;
extern const OSSymbol * gIODisplayHorizontalPositionKey;
extern const OSSymbol * gIODisplayHorizontalSizeKey;
extern const OSSymbol * gIODisplayVerticalPositionKey;
extern const OSSymbol * gIODisplayVerticalSizeKey;
extern const OSSymbol * gIODisplayTrapezoidKey;
extern const OSSymbol * gIODisplayPincushionKey;
extern const OSSymbol * gIODisplayParallelogramKey;
extern const OSSymbol * gIODisplayRotationKey;
extern const OSSymbol * gIODisplayOverscanKey;
extern const OSSymbol * gIODisplayVideoBestKey;
extern const OSSymbol * gIODisplaySelectedColorModeKey;
extern const OSSymbol * gIODisplayRedGammaScaleKey;
extern const OSSymbol * gIODisplayGreenGammaScaleKey;
extern const OSSymbol * gIODisplayBlueGammaScaleKey;
extern const OSSymbol * gIODisplayGammaScaleKey;
extern const OSSymbol * gIODisplayParametersTheatreModeKey;
extern const OSSymbol * gIODisplayParametersTheatreModeWindowKey;
extern const OSSymbol * gIODisplayMCCSVersionKey;
extern const OSSymbol * gIODisplayTechnologyTypeKey;
extern const OSSymbol * gIODisplayUsageTimeKey;
extern const OSSymbol * gIODisplayFirmwareLevelKey;
extern const OSSymbol * gIODisplaySpeakerVolumeKey;
extern const OSSymbol * gIODisplaySpeakerSelectKey;
extern const OSSymbol * gIODisplayMicrophoneVolumeKey;
extern const OSSymbol * gIODisplayAmbientLightSensorKey;
extern const OSSymbol * gIODisplayAudioMuteAndScreenBlankKey;
extern const OSSymbol * gIODisplayAudioTrebleKey;
extern const OSSymbol * gIODisplayAudioBassKey;
extern const OSSymbol * gIODisplayAudioBalanceLRKey;
extern const OSSymbol * gIODisplayAudioProcessorModeKey;
extern const OSSymbol * gIODisplayPowerModeKey;
extern const OSSymbol * gIODisplayManufacturerSpecificKey;
extern const OSSymbol * gIODisplayPowerStateKey;
extern const OSSymbol * gIODisplayControllerIDKey;
extern const OSSymbol * gIODisplayCapabilityStringKey;
extern const OSSymbol * gIODisplayParametersCommitKey;
extern const OSSymbol * gIODisplayParametersDefaultKey;
extern const OSSymbol * gIODisplayParametersFlushKey;
extern const OSSymbol * gIODisplayFadeTime1Key;
extern const OSSymbol * gIODisplayFadeTime2Key;
extern const OSSymbol * gIODisplayFadeTime3Key;
extern const OSSymbol * gIODisplayFadeStyleKey;
extern UInt32 gIODisplayFadeTime1;
extern UInt32 gIODisplayFadeTime2;
extern UInt32 gIODisplayFadeTime3;
extern UInt32 gIODisplayFadeStyle;
enum {
kIODisplayNumPowerStates = 4,
kIODisplayMaxPowerState = kIODisplayNumPowerStates - 1
};
class IODisplayWrangler;
class IODisplayConnect : public IOService
{
OSDeclareDefaultStructors(IODisplayConnect)
friend class IODisplayWrangler;
private:
IOIndex fConnectIndex;
uint64_t fFBRegID;
protected:
/* Reserved for future use. (Internal use only) */
struct ExpansionData { };
/* Reserved for future use. (Internal use only) */
ExpansionData * reserved;
// Support for IODisplayWrangler
virtual bool initWithConnection(const uint64_t fbRegID,
const IOIndex connection);
public:
// IODisplayConnect interface
virtual IOFramebuffer * getFramebuffer( void );
virtual IOIndex getConnection( void );
virtual IOReturn getAttributeForConnection( IOSelect selector, uintptr_t * value );
virtual IOReturn setAttributeForConnection( IOSelect selector, uintptr_t value );
virtual void joinPMtree ( IOService * driver ) APPLE_KEXT_OVERRIDE;
#ifndef _OPEN_SOURCE_
// Support for IODisplay
static void recordGTraceToken(
const uint16_t line,
const uint16_t tag0, const uint64_t fbRegID,
const uint16_t tag1, const uint64_t arg1,
const uint16_t tag2, const uint64_t arg2,
const uint16_t tag3, const uint64_t arg3);
void recordGTraceToken(const uint16_t line,
const uint16_t fnID, const uint8_t fnType,
const uint16_t tag1, const uint64_t arg1,
const uint16_t tag2, const uint64_t arg2,
const uint16_t tag3, const uint64_t arg3);
inline uint64_t getFBRegistryID() { return fFBRegID; }
#endif // !_OPEN_SOURCE_
};
class IODisplay : public IOService
{
OSDeclareAbstractStructors(IODisplay)
public:
static void initialize( void );
protected:
// used to query the framebuffer controller
IODisplayConnect * fConnection;
class IODisplayParameterHandler * fParameterHandler;
void * __resv;
IONotifier * fNotifier;
// pointer to protected instance variables for power management
struct IODisplayPMVars * fDisplayPMVars;
public:
uintptr_t fWSAADeferState;
protected:
// reserved for future expansion
void * _IODisplay_reserved[31];
public:
virtual IOService * probe( IOService * provider,
SInt32 * score ) APPLE_KEXT_OVERRIDE;
virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE;
virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE;
virtual void free() APPLE_KEXT_OVERRIDE;
virtual IODisplayConnect * getConnection( void );
virtual IOReturn getConnectFlagsForDisplayMode(
IODisplayModeID mode, UInt32 * flags );
virtual IOReturn getGammaTableByIndex(
UInt32 * channelCount, UInt32 * dataCount,
UInt32 * dataWidth, void ** data );
virtual IOReturn readFramebufferEDID( void );
virtual IOReturn framebufferEvent( IOFramebuffer * framebuffer,
IOIndex event, void * info );
// parameter setting
virtual bool setProperty(const OSSymbol* aKey, OSObject* anObject) APPLE_KEXT_OVERRIDE;
virtual bool setProperty(const OSString* aKey, OSObject* anObject) APPLE_KEXT_OVERRIDE;
virtual bool setProperty(const char* aKey, OSObject* anObject) APPLE_KEXT_OVERRIDE;
virtual bool setProperty(const char* aKey, const char* aString) APPLE_KEXT_OVERRIDE;
virtual bool setProperty(const char* aKey, bool aBoolean) APPLE_KEXT_OVERRIDE;
virtual bool setProperty(const char* aKey, unsigned long long aValue,
unsigned int aNumberOfBits) APPLE_KEXT_OVERRIDE;
virtual bool setProperty(const char* aKey, void *bytes, unsigned int length) APPLE_KEXT_OVERRIDE;
virtual IOReturn setProperties( OSObject * properties ) APPLE_KEXT_OVERRIDE;
virtual bool setForKey( OSDictionary * params, const OSSymbol * key,
SInt32 value, SInt32 min, SInt32 max );
static bool addParameter( OSDictionary * params, const OSSymbol * paramName, SInt32 min, SInt32 max );
static bool setParameter( OSDictionary * params, const OSSymbol * paramName, SInt32 value );
static OSDictionary * getIntegerRange( OSDictionary * params, const OSSymbol * sym,
SInt32 * value, SInt32 * min, SInt32 * max );
void loadPrefs( uint64_t edidHash, uint32_t vendor, uint32_t product, uint32_t serial );
// low level set/get
virtual bool doIntegerSet( OSDictionary * params,
const OSSymbol * paramName, UInt32 value );
virtual bool doDataSet( const OSSymbol * paramName, OSData * value );
virtual bool doUpdate( void );
// power management methods
virtual IOReturn setPowerState( unsigned long, IOService * ) APPLE_KEXT_OVERRIDE;
virtual unsigned long maxCapabilityForDomainState( IOPMPowerFlags ) APPLE_KEXT_OVERRIDE;
virtual unsigned long initialPowerStateForDomainState( IOPMPowerFlags ) APPLE_KEXT_OVERRIDE;
virtual unsigned long powerStateForDomainState( IOPMPowerFlags ) APPLE_KEXT_OVERRIDE;
//
virtual void initPowerManagement( IOService * provider);
virtual void dropOneLevel( void );
virtual void makeDisplayUsable( void );
void setDisplayPowerState(unsigned long state);
#ifndef _OPEN_SOURCE_
// GTrace V2 support for IOBacklightDisplay tracing
#define HAS_IBDGTRACETOKEN 1
void recordGTraceToken(const uint16_t line,
const uint16_t fnID, const uint8_t fnType,
const uint16_t tag1, const uint64_t arg1,
const uint16_t tag2, const uint64_t arg2,
const uint16_t tag3, const uint64_t arg3);
#endif // !_OPEN_SOURCE_
private:
OSMetaClassDeclareReservedUnused(IODisplay, 0);
OSMetaClassDeclareReservedUnused(IODisplay, 1);
OSMetaClassDeclareReservedUnused(IODisplay, 2);
OSMetaClassDeclareReservedUnused(IODisplay, 3);
OSMetaClassDeclareReservedUnused(IODisplay, 4);
OSMetaClassDeclareReservedUnused(IODisplay, 5);
OSMetaClassDeclareReservedUnused(IODisplay, 6);
OSMetaClassDeclareReservedUnused(IODisplay, 7);
OSMetaClassDeclareReservedUnused(IODisplay, 8);
OSMetaClassDeclareReservedUnused(IODisplay, 9);
OSMetaClassDeclareReservedUnused(IODisplay, 10);
OSMetaClassDeclareReservedUnused(IODisplay, 11);
OSMetaClassDeclareReservedUnused(IODisplay, 12);
OSMetaClassDeclareReservedUnused(IODisplay, 13);
OSMetaClassDeclareReservedUnused(IODisplay, 14);
OSMetaClassDeclareReservedUnused(IODisplay, 15);
OSMetaClassDeclareReservedUnused(IODisplay, 16);
OSMetaClassDeclareReservedUnused(IODisplay, 17);
OSMetaClassDeclareReservedUnused(IODisplay, 18);
OSMetaClassDeclareReservedUnused(IODisplay, 19);
private:
static IOReturn _framebufferEvent( OSObject * osobj, void * ref,
IOFramebuffer *framebuffer, IOIndex event, void * info );
void searchParameterHandlers(IORegistryEntry * entry);
bool addParameterHandler( IODisplayParameterHandler * parameterHandler );
bool removeParameterHandler( IODisplayParameterHandler * parameterHandler );
static bool updateNumber( OSDictionary * params, const OSSymbol * key, SInt32 value );
};
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
class IOBacklightDisplay : public IODisplay
{
OSDeclareDefaultStructors(IOBacklightDisplay)
OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 0);
OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 1);
OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 2);
OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 3);
OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 4);
OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 5);
OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 6);
OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 7);
OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 8);
OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 9);
};
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
class IODisplayParameterHandler : public IOService
{
OSDeclareDefaultStructors(IODisplayParameterHandler)
public:
virtual bool setDisplay( IODisplay * display ) = 0;
virtual bool doIntegerSet( OSDictionary * params,
const OSSymbol * paramName, UInt32 value ) = 0;
virtual bool doDataSet( const OSSymbol * paramName, OSData * value ) = 0;
virtual bool doUpdate( void ) = 0;
private:
OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 0);
OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 1);
OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 2);
OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 3);
OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 4);
OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 5);
OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 6);
OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 7);
OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 8);
OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 9);
};
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#endif /* ! _IOKIT_IODISPLAY_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/graphics/IOGraphicsDevice.h | /*
* Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOGRAPHICSDEVICE_H
#define _IOKIT_IOGRAPHICSDEVICE_H
#include <IOKit/IOService.h>
#include <IOKit/graphics/IOGraphicsTypes.h>
class IOGraphicsDevice : public IOService
{
OSDeclareAbstractStructors(IOGraphicsDevice)
public:
virtual void hideCursor( void ) = 0;
virtual void showCursor( IOGPoint * cursorLoc, int frame ) = 0;
virtual void moveCursor( IOGPoint * cursorLoc, int frame ) = 0;
virtual void getVBLTime( AbsoluteTime * time, AbsoluteTime * delta ) = 0;
virtual void getBoundingRect ( IOGBounds ** bounds ) = 0;
};
#endif /* ! _IOKIT_IOGRAPHICSDEVICE_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/graphics/IOFramebuffer.h | /*
* Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOFRAMEBUFFER_H
#define _IOKIT_IOFRAMEBUFFER_H
#include <IOKit/IOService.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#include <IOKit/IOInterruptEventSource.h>
#pragma clang diagnostic pop
#include <IOKit/IOLib.h>
#include <IOKit/graphics/IOGraphicsDevice.h>
#include <IOKit/graphics/IOFramebufferShared.h>
#define IOFRAMEBUFFER_REV 8
class IOFramebuffer;
class IOBufferMemoryDescriptor;
struct IOFBController;
typedef void (*CursorBlitProc)(
IOFramebuffer * inst,
void * shmem,
volatile unsigned char *vramPtr,
unsigned int cursStart,
unsigned int vramRow,
unsigned int cursRow,
int width,
int height );
typedef void (*CursorRemoveProc)(
IOFramebuffer * inst,
void * shmem,
volatile unsigned char *vramPtr,
unsigned int vramRow,
int width,
int height );
typedef void * IOFBCursorRef;
struct IOFBCursorControlCallouts {
IOReturn (*setCursorImage) (void * target, void * ref,
IOHardwareCursorDescriptor * description, IOFBCursorRef cursorImage);
IOReturn (*setCursorState) (void * target, void * ref,
SInt32 x, SInt32 y, bool visible);
UInt32 reserved[30];
};
typedef struct IOFBCursorControlCallouts IOFBCursorControlCallouts;
struct IOFBCursorControlAttribute {
void * inst;
void * ref;
const IOFBCursorControlCallouts * callouts;
UInt32 reserved[29];
};
typedef struct IOFBCursorControlAttribute IOFBCursorControlAttribute;
// clock & data values
enum {
kIODDCLow = 0,
kIODDCHigh = 1,
kIODDCTristate = 2
};
// ddcBlockType constants
enum {
// EDID block type.
kIODDCBlockTypeEDID = 0
};
// ddcFlags constants
enum {
// Force a new read of the EDID.
kIODDCForceRead = 0x00000001
};
enum {
kDisabledInterruptState = 0,
kEnabledInterruptState = 1
};
typedef void (*IOFBInterruptProc)( OSObject * target, void * ref );
typedef IOReturn (*IOFramebufferNotificationHandler)
(OSObject * obj, void * ref,
IOFramebuffer * framebuffer, IOIndex event,
void * info);
// IOFramebufferNotificationHandler events
enum {
kIOFBNotifyDisplayModeWillChange = 1,
kIOFBNotifyDisplayModeDidChange = 2,
kIOFBNotifyWillSleep = 3,
kIOFBNotifyDidWake = 4,
kIOFBNotifyDidPowerOff = 5,
kIOFBNotifyWillPowerOn = 6,
kIOFBNotifyDidSleep = kIOFBNotifyDidPowerOff,
kIOFBNotifyWillWake = kIOFBNotifyWillPowerOn,
kIOFBNotifyWillPowerOff = 7,
kIOFBNotifyDidPowerOn = 8,
kIOFBNotifyWillChangeSpeed = 9,
kIOFBNotifyDidChangeSpeed = 10,
kIOFBNotifyHDACodecWillPowerOn = 11, // since IOGRAPHICSTYPES_REV 68
kIOFBNotifyHDACodecDidPowerOn = 12, // since IOGRAPHICSTYPES_REV 68
kIOFBNotifyHDACodecWillPowerOff = 13, // since IOGRAPHICSTYPES_REV 68
kIOFBNotifyHDACodecDidPowerOff = 14, // since IOGRAPHICSTYPES_REV 68
kIOFBNotifyClamshellChange = 20,
kIOFBNotifyCaptureChange = 30,
kIOFBNotifyOnlineChange = 40,
kIOFBNotifyDisplayDimsChange = 50,
kIOFBNotifyProbed = 60,
kIOFBNotifyVRAMReady = 70,
kIOFBNotifyWillNotify = 80,
kIOFBNotifyDidNotify = 81,
// <rdar://problem/32063590> IOGraphics needs to send WSAAWillExitDefer and WSAADidExitDefer instead of single message
kIOFBNotifyWSAAWillEnterDefer = 90, // since IOGRAPHICSTYPES_REV 53
kIOFBNotifyWSAAWillExitDefer = 91, // since IOGRAPHICSTYPES_REV 53
kIOFBNotifyWSAADidEnterDefer = 92, // since IOGRAPHICSTYPES_REV 53
kIOFBNotifyWSAADidExitDefer = 93, // since IOGRAPHICSTYPES_REV 53
kIOFBNotifyWSAAEnterDefer = kIOFBNotifyWSAAWillEnterDefer,
kIOFBNotifyWSAAExitDefer = kIOFBNotifyWSAAWillExitDefer,
kIOFBNotifyTerminated = 100, // since IOGRAPHICSTYPES_REV 49
};
/*
Discussion: addFramebufferNotificationWithOptions
Clients that want to take advantage of the fine grain IOFramebuffer event notifications must register their framebuffer notification handler with addFramebufferNotificationWithOptions and provide a single kIOFBNotifyGroup ID, one or more kIOFBNotifyEvents and optionally a desired kIOFBNotifyPriority value. If no priority is required, clients must set groupPriority to 0. Clients must not register with any predefined kIOFBNotifyGroup that they do not belong to. kIOFBNotifyGroup values within the range of 0x8000 to 0xFFFF are available for general and third party software use. Where multiple independent software components end up using the same kIOFBNotifyGroup identification numbers, the callout order is determined first by priority and then by registration order. Clients that request a priority that is outside of the range specified by kIOFBNotifyPriority_Min/kIOFBNotifyPriority_Max will be clamped to the range limits.
Handler invocation by IOGraphics:
Clients are only called for the kIOFBNotifyEvents that they requested at time of registration.
Multiple clients with the same kIOFBNotifyGroup are called in the order based on the requested priority.
Multiple clients with the same kIOFBNotifyGroup and the same priority are called in a "first registered, first served" order.
IOGraphics will invoke the handlers based on group, then priority, the registration order. The ordering of the group callouts is private and will change as required/desired by Apple. Clients must NOT rely on group callout order to determine system or intercomponent behavior. If there is a strong need to be called before a specific component, please file a radar with the Component of "IOGraphics" and the Version of "all".
Discussion: addFramebufferNotification
Legacy and existing software that relies upon addFramebufferNotification() will behave as if they had called with the following options: addFramebufferNotificationWithOptions(..., kIOFBNotifyGroupID_Legacy, 0, kIOFBNotifyEvent_All);
Legacy clients are called after kIOFBNotifyGroup IDs within the range of 0x0 to 0x7FFF have been called, but before IDs in the range of 0x8000 to 0xFFFF.
*/
// addFramebufferNotificationWithOptions event types
enum {
kIOFBNotifyEvent_None = (0ULL << 0),
kIOFBNotifyEvent_DisplayModeChange = (1ULL << 0),
kIOFBNotifyEvent_SleepWake = (1ULL << 1), // Only for events: kIOFBNotifyWillSleep & kIOFBNotifyDidWake
kIOFBNotifyEvent_PowerOnOff = (1ULL << 2),
kIOFBNotifyEvent_ChangeSpeed = (1ULL << 3),
kIOFBNotifyEvent_ClamshellChange = (1ULL << 4),
kIOFBNotifyEvent_CaptureChange = (1ULL << 5),
kIOFBNotifyEvent_OnlineChange = (1ULL << 6),
kIOFBNotifyEvent_DisplayDimsChange = (1ULL << 7),
kIOFBNotifyEvent_Probed = (1ULL << 8),
kIOFBNotifyEvent_VRAMReady = (1ULL << 9),
kIOFBNotifyEvent_Notify = (1ULL << 10), // kIOFBNotifyWillNotify & kIOFBNotifyDidNotify
kIOFBNotifyEvent_WSAADefer = (1ULL << 11),
kIOFBNotifyEvent_Terminated = (1ULL << 12),
kIOFBNotifyEvent_HDACodecPowerOnOff = (1ULL << 13), // since IOFRAMEBUFFER_REV 7
kIOFBNotifyEvent_Last = (1ULL << 14),
kIOFBNotifyEvent_All = (kIOFBNotifyEvent_Last - 1)
};
enum {
// 0x0 - 0xFF - Private: Reserved for IOGraphics.
kIOFBNotifyGroupID_Legacy = 0x001,
kIOFBNotifyGroupID_IODisplay = 0x010,
// 0x100 - 0x1FF - Reserved for Apple kernel extensions
kIOFBNotifyGroupID_AppleGraphicsDevicePolicy = 0x100,
kIOFBNotifyGroupID_AppleGraphicsMGPUPowerControl = 0x110,
kIOFBNotifyGroupID_AppleGraphicsMUXControl = 0x120,
kIOFBNotifyGroupID_AppleGraphicsControl = 0x130,
kIOFBNotifyGroupID_AppleGraphicsDisplayPolicy = 0x140,
kIOFBNotifyGroupID_AppleGraphicsPowerManagement = 0x150,
kIOFBNotifyGroupID_AppleHDAController = 0x160,
kIOFBNotifyGroupID_AppleIOAccelDisplayPipe = 0x170,
kIOFBNotifyGroupID_AppleMCCSControl = 0x180,
// 0x200 - 0x2FF - Reserved for vendor kernel extensions
kIOFBNotifyGroupID_VendorIntel = 0x200,
// 0x300 - 0x3FF - Reserved for vendor kernel extensions
kIOFBNotifyGroupID_VendorNVIDIA = 0x300,
// 0x400 - 0x4FF - Reserved for vendor kernel extensions
kIOFBNotifyGroupID_VendorAMD = 0x400,
// 0x500 - 0x7FFF - Reserved for future use
// 0x8000+ - Reserved for third party software
kIOFBNotifyGroupID_ThirdParty = 0x8000,
kIOFBNotifyGroupID_Count = 15
};
// addFramebufferNotificationWithOptions group priority range
enum {
kIOFBNotifyPriority_Min = -32768,
kIOFBNotifyPriority_Max = 32767,
};
struct IOFramebufferNotificationNotify
{
IOIndex event;
void * info;
};
enum {
kFBDisplayUsablePowerState = 0x80000000,
kFBDisplayPowerStateMask = 0x0000ffff
};
#define kIOFBDependentIDKey "IOFBDependentID"
#define kIOFBDependentIndexKey "IOFBDependentIndex"
#ifndef _OPEN_SOURCE_
// GTrace V2 support for AGDC markers
#define HAS_AGDCGTRACETOKEN 1
extern void agdcGTraceToken(
const IOFramebuffer* fb, const uint16_t line, const bool useController,
const uint16_t fnID, const uint8_t fnType,
const uint16_t tag1, const uint64_t arg1,
const uint16_t tag2, const uint64_t arg2,
const uint16_t tag3, const uint64_t arg3);
#endif // !_OPEN_SOURCE_
struct StdFBShmem_t;
class IOFramebufferUserClient;
class IODisplay;
/*! @class IOFramebuffer : public IOGraphicsDevice
@abstract The base class for graphics devices to be made available as part of the desktop.
@discussion The IOFramebuffer base class defines APIs used to publish a linear framebuffer device. Device driver writers should subclass this class to provide a X native driver. Mac OS X will also utilize 'ndrv' drivers via a subclass of IOFramebuffer IONDRVFramebuffer that does not require device driver writers to provide a X native driver.
There are no in kernel clients of IOFramebuffer aside from rudimentary console and panic UI supported by the IOFramebuffer class. The IOFramebuffer class provides the IOUserClient implementation to allow the CoreGraphics server to provide the user accessible interface to all displays on a Mac OS X system, and this is further layered underneath application frameworks. Device driver writers should not need any knowledge of this part of the interfaces. Similarly the instance variables of IOFramebuffer are mostly used for cursor rendering which is handled by the IOFramebuffer class, and should be avoided by subclass implementors. Only IOFramebuffer methods with header documentation in this header are designed for subclasses to implement.
IOFramebuffer provides simple dumb framebuffer operation - accceleration for 2D, 3D and video may be provided by a separate implementation of the IOAccelerator class.
*/
class IOFramebuffer : public IOGraphicsDevice
{
friend class IOFramebufferUserClient;
friend class IOFramebufferSharedUserClient;
friend class IOFramebufferDiagnosticUserClient;
friend class IOFramebufferParameterHandler;
friend class IODisplay;
#ifndef _OPEN_SOURCE_
friend void agdcGTraceToken(
const IOFramebuffer*, const uint16_t, const bool, const uint16_t,
const uint8_t, const uint16_t, const uint64_t, const uint16_t,
const uint64_t, const uint16_t, const uint64_t);
#endif // !_OPEN_SOURCE_
OSDeclareDefaultStructors(IOFramebuffer);
protected:
/*! @struct ExpansionData
@discussion This structure will be used to expand the capablilties of this class in the future.
*/
struct ExpansionData { };
/*! @var reserved
Reserved for future use. (Internal use only) */
ExpansionData * reserved;
private:
protected:
StdFBShmem_t * priv;
int shmemClientVersion;
IOBufferMemoryDescriptor * sharedCursor;
union {
struct {
/* Mapping tables used in cursor drawing to 5-5-5 displays. */
unsigned char * _bm34To35SampleTable;
unsigned char * _bm35To34SampleTable;
/* Mapping tables used in cursor drawing to 8-bit RGB displays. */
unsigned int * _bm256To38SampleTable;
unsigned char * _bm38To256SampleTable;
} t;
UInt8 * tables[ 4 ];
} colorConvert;
/* cursor blitting vars */
CursorBlitProc cursorBlitProc;
CursorRemoveProc cursorRemoveProc;
IOGSize maxCursorSize;
void * _IOFramebuffer_reservedE[6];
uint32_t _IOFramebuffer_reservedF;
uint32_t thisNameLen;
const char * thisName;
volatile unsigned char * cursorSave;
unsigned int white;
IOGPoint nextCursorLoc;
int nextCursorFrame;
SInt32 connectChange;
semaphore_t vblSemaphore;
/* memory ranges */
volatile unsigned char * fFrameBuffer;
unsigned int fTotalWidth;
unsigned int rowBytes;
unsigned int bytesPerPixel;
IOMemoryMap * fVramMap;
IOByteCount fVramMapOffset;
OSArray * userAccessRanges;
unsigned int suspended:1;
unsigned int captured:1;
unsigned int sleepConnectCheck:1;
unsigned int messaged:1;
unsigned int cursorEnable:1;
unsigned int _IOFramebuffer_reservedC:27;
IOFramebuffer * nextDependent;
OSArray * fFBNotifications;
class IOFramebufferUserClient * fServerConnect;
class IOFramebufferSharedUserClient * fSharedConnect;
unsigned int opened:1;
unsigned int dead:1;
unsigned int configPending:1;
unsigned int doNotUseServerNotified:1; // Deprecated
unsigned int doNotUseServerState:1; // Deprecated
unsigned int doNotUseServerPendingAck:1;// Deprecated
unsigned int isUsable:1;
unsigned int mirrored:1;
unsigned int pendingPowerState:4;
unsigned int pendingPowerChange:1;
unsigned int pagingState:1;
unsigned int mirrorPrimary:1;
unsigned int mirrorSWCursor:1;
bool clutValid;
bool currentMono;
bool needCursorService;
bool haveVBLService;
bool haveHWCursor;
bool hwCursorLoaded;
void * serverMsg;
IOInterruptEventSource * deferredEvents;
/* Reserved for future expansion. */
int _IOFramebuffer_reserved[5];
private:
struct IOFramebufferPrivate * __private;
public:
/*! @function doI2CRequest
@abstract Carry out an I2C request.
@discussion IOFramebuffer subclasses may optionally implement this method to perform I2C bus requests on one of the buses they support. Alternatively they may implement the setDDCClock(), setDDCData(), readDDCClock(), readDDCData() methods and respond from getAttributeForConnection() to the kConnectionSupportsLLDDCSense attribute with success, in which case IOFramebuffer::doI2CRequest() will carry out a software implementation of I2C using the low level routines and conforming to the timing constraints passed in the timing parameter. Subclasses may pass timing parameters tuned for the specific bus, otherwise VESA DDC defaults will apply.
@timing event Subclasses may pass timing parameters tuned for the specific bus, otherwise if NULL, VESA DDC defaults will apply.
@param request An IOI2CRequest structure. The request should be carried out synchronously if the completion routine is NULL, otherwise it may optionally be carried out asynchronously. The completion routine should be called if supplied.
@result an IOReturn code. If kIOReturnSuccess, the result of the transaction is returned in the requests result field.
*/
virtual IOReturn doI2CRequest( UInt32 bus, struct IOI2CBusTiming * timing, struct IOI2CRequest * request );
OSMetaClassDeclareReservedUsed(IOFramebuffer, 0);
/*! @function diagnoseReport
@abstract Provide private diagnostic information.
@discussion Allow vendor implementations to provide diagnostic information when a catastrophic failure has been encounterd.
*/
virtual IOReturn diagnoseReport( void * param1, void * param2, void * param3, void * param4 );
OSMetaClassDeclareReservedUsed(IOFramebuffer, 1);
/*! @function setGammaTable
@abstract Set the gamma table to be used by the framebuffer.
@discussion IOFramebuffer subclasses should implement this method to allow a gamma table to be set.
@param channelCount Defines the number of channels in the supplied data. OS X will pass three for separate R, G, B data, or one if the same data should apply to all channels.
@param dataCount The number of data entries per channel.
@param dataWidth The number of bits in each entry. 8 for Mac OS X 10.1 and earlier, 16 for later releases.
@param data The packed array of correction data. Data is passed for the R (or single) channel followed by the G & B channels. Each entry is one or two bytes (if dataWidth > 8).
@param syncToVBL 0 don't sync to VBL, else sync.
@result an IOReturn code.
*/
virtual IOReturn setGammaTable( UInt32 channelCount, UInt32 dataCount,
UInt32 dataWidth, void * data, bool syncToVBL );
OSMetaClassDeclareReservedUsed(IOFramebuffer, 2);
private:
OSMetaClassDeclareReservedUnused(IOFramebuffer, 3);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 4);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 5);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 6);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 7);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 8);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 9);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 10);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 11);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 12);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 13);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 14);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 15);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 16);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 17);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 18);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 19);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 20);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 21);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 22);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 23);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 24);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 25);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 26);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 27);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 28);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 29);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 30);
OSMetaClassDeclareReservedUnused(IOFramebuffer, 31);
public:
// IOKit overrides
static void initialize();
virtual bool attach( IOService * provider ) APPLE_KEXT_OVERRIDE;
virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE;
virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE;
virtual bool requestTerminate( IOService * provider, IOOptionBits options ) APPLE_KEXT_OVERRIDE;
virtual bool terminate( IOOptionBits options ) APPLE_KEXT_OVERRIDE;
virtual bool willTerminate( IOService * provider, IOOptionBits options ) APPLE_KEXT_OVERRIDE;
virtual bool didTerminate( IOService * provider, IOOptionBits options, bool * defer ) APPLE_KEXT_OVERRIDE;
virtual void free() APPLE_KEXT_OVERRIDE;
virtual IOWorkLoop * getWorkLoop() const APPLE_KEXT_OVERRIDE;
#ifndef _OPEN_SOURCE_
virtual IOReturn setProperties(OSObject* properties) APPLE_KEXT_OVERRIDE;
#endif
IOWorkLoop * getGraphicsSystemWorkLoop() const;
IOWorkLoop * getControllerWorkLoop() const;
virtual IOReturn requestProbe( IOOptionBits options ) APPLE_KEXT_OVERRIDE;
virtual IOReturn powerStateWillChangeTo ( IOPMPowerFlags, unsigned long, IOService* ) APPLE_KEXT_OVERRIDE;
virtual IOReturn powerStateDidChangeTo ( IOPMPowerFlags, unsigned long, IOService* ) APPLE_KEXT_OVERRIDE;
virtual IOReturn setPowerState( unsigned long powerStateOrdinal, IOService * device) APPLE_KEXT_OVERRIDE;
virtual IOReturn setAggressiveness( unsigned long type, unsigned long newLevel ) APPLE_KEXT_OVERRIDE;
virtual IOReturn getAggressiveness( unsigned long type, unsigned long * currentLevel ) APPLE_KEXT_OVERRIDE;
virtual IOReturn newUserClient( task_t owningTask,
void * security_id,
UInt32 type,
IOUserClient ** clientH ) APPLE_KEXT_OVERRIDE;
virtual IOReturn callPlatformFunction( const OSSymbol * functionName,
bool waitForFunction,
void *p1, void *p2,
void *p3, void *p4 ) APPLE_KEXT_OVERRIDE;
virtual IOReturn message(UInt32 type, IOService *provider, void *argument = 0) APPLE_KEXT_OVERRIDE;
virtual void hideCursor( void ) APPLE_KEXT_OVERRIDE;
virtual void showCursor( IOGPoint * cursorLoc, int frame ) APPLE_KEXT_OVERRIDE;
virtual void moveCursor( IOGPoint * cursorLoc, int frame ) APPLE_KEXT_OVERRIDE;
// virtual
void resetCursor( void );
virtual void getVBLTime( AbsoluteTime * time, AbsoluteTime * delta ) APPLE_KEXT_OVERRIDE;
virtual void getBoundingRect ( IOGBounds ** bounds ) APPLE_KEXT_OVERRIDE;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
virtual IOReturn open( void );
virtual void close( void );
#pragma clang diagnostic pop
virtual bool isConsoleDevice( void );
virtual IOReturn setupForCurrentConfig( void );
virtual bool serializeInfo( OSSerialize * s );
virtual bool setNumber( OSDictionary * dict, const char * key,
UInt32 number );
IONotifier * addFramebufferNotification(
IOFramebufferNotificationHandler handler,
OSObject * obj, void * ref);
/*! @function getApertureRange
@abstract Return reference to IODeviceMemory object representing memory range of framebuffer.
@discussion IOFramebuffer subclasses must implement this method to describe the memory used by the framebuffer in the current mode. The OS will map this memory range into user space for client access - the range should only include vram memory not hardware registers.
@param aperture The system will only access the aperture kIOFBSystemAperture.
@result an IODeviceMemory instance. A reference will be consumed by the caller for each call of this method - the implementatation should create a new instance of IODeviceMemory for each call, or return one instance with a retain for each call.
*/
virtual IODeviceMemory * getApertureRange( IOPixelAperture aperture ) = 0;
/*! @function getVRAMRange
@abstract Return reference to IODeviceMemory object representing memory range of all the cards vram.
@discussion IOFramebuffer subclasses should implement this method to describe all the vram memory available on the card. The OS will map this memory range into user space for client access - the range should only include vram memory not hardware registers.
@result an IODeviceMemory instance. A reference will be consumed by the caller for each call of this method - the implementatation should create a new instance of IODeviceMemory for each call, or return one instance with a retain for each call.
*/
virtual IODeviceMemory * getVRAMRange( void );
protected:
/*! @function handleEvent
@abstract Notify IOFramebuffer superclass code of events.
@discussion IOFramebuffer subclasses should call this IOFramebuffer method on certain power state changes.
@param event The event that has occurred:<br>
kIOFBNotifyWillPowerOff call before entering a state other than the maximum.<br>
kIOFBNotifyDidPowerOn call after entering the maximum power state.<br>
kIOFBNotifyWillPowerOff call before entering a state other than the maximum.<br>
kIOFBNotifyDidPowerOn call after entering a state other than the maximum.<br>
@param info None of the above events require additional info, pass zero.
@result an IOReturn code, safely ignored.
*/
IOReturn handleEvent( IOIndex event, void * info = 0 );
IOReturn deliverFramebufferNotification(
IOIndex event, void * info = 0 );
static void handleVBL(IOFramebuffer * inst, void * unused);
#ifdef IOFRAMEBUFFER_PRIVATE
#include <IOKit/graphics/IOFramebufferPrivate.h>
#endif
public:
/*! @function enableController
@abstract Perform first time setup of the framebuffer.
@discussion IOFramebuffer subclasses should perform their initialization of the hardware here. The IOService start() method is not called at a time appropriate for this initialization.
@result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device.
*/
virtual IOReturn enableController( void );
/*! @function getPixelFormats
@abstract List the pixel formats the framebuffer supports.
@discussion IOFramebuffer subclasses must implement this method to return an array of strings representing the possible pixel formats available in the framebuffer.
@result A const char * pointer. The string consists of a concatenation of each pixel format string separated by the NULL character. The commonly supported pixel formats for Mac OS X are defined as IO8BitIndexedPixels, IO16BitDirectPixels, IO32BitDirectPixels.
*/
virtual const char * getPixelFormats( void ) = 0;
/*! @function getDisplayModeCount
@abstract Return the number of display modes the framebuffer supports.
@discussion IOFramebuffer subclasses must implement this method to return a count of the display modes available. This count should change unless a connection change is posted for the device indicated the framebuffer and/or display configuration has changed.
@result A count of the display modes available.
*/
virtual IOItemCount getDisplayModeCount( void ) = 0;
/*! @function getDisplayModes
@abstract Return the number of display modes the framebuffer supports.
@discussion IOFramebuffer subclasses must implement this method to return an array of display mode IDs available for the framebuffer. The IDs are defined by the driver in the range 0x00000001 - 0x7fffffff, and should be constant for a given display mode.
@param allDisplayModes A caller allocated buffer with the size given by the result of getDisplayModeCount().
@result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device.
*/
virtual IOReturn getDisplayModes( IODisplayModeID * allDisplayModes ) = 0;
/*! @function getInformationForDisplayMode
@abstract Return information about a given display mode.
@discussion IOFramebuffer subclasses must implement this method to return information in the IODisplayModeInformation structure for the display mode with the passed ID.
@param displayMode A display mode ID previously returned by getDisplayModes().
@param info Pointer to a structure of type IODisplayModeInformation to be filled out by the driver. IODisplayModeInformation is documented in IOGraphicsTypes.h.
@result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device.
*/
virtual IOReturn getInformationForDisplayMode( IODisplayModeID displayMode,
IODisplayModeInformation * info ) = 0;
/*! @function getPixelFormatsForDisplayMode
@abstract Obsolete.
@discussion IOFramebuffer subclasses must implement this method to return zero.
@param displayMode Ignored.
@param depth Ignored.
@result Return zero.
*/
virtual UInt64 getPixelFormatsForDisplayMode( IODisplayModeID displayMode,
IOIndex depth ) = 0;
/*! @function getPixelInformation
@abstract Return information about the framebuffer format for a given display mode and depth.
@discussion IOFramebuffer subclasses must implement this method to return information in the IOPixelInformation structure for the display mode with the passed ID, depth index and aperture. The aperture utilized by the system is always kIOFBSystemAperture. Drivers may define alternative apertures, being a view of the framebuffer in a different pixel format from the default.
@param displayMode A display mode ID previously returned by getDisplayModes().
@param depth An index from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure (inclusive).
@param info Pointer to a structure of type IOPixelInformation to be filled out by the driver. IOPixelInformation is documented in IOGraphicsTypes.h.
@result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device.
*/
virtual IOReturn getPixelInformation(
IODisplayModeID displayMode, IOIndex depth,
IOPixelAperture aperture, IOPixelInformation * pixelInfo ) = 0;
/*! @function getCurrentDisplayMode
@abstract Return the framebuffers current display mode and depth.
@discussion IOFramebuffer subclasses must implement this method to return the current mode and depth.
@param displayMode A display mode ID representing the current mode.
@param depth An index indicating the depth configuration of the framebuffer. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode.
@result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device.
*/
virtual IOReturn getCurrentDisplayMode( IODisplayModeID * displayMode,
IOIndex * depth ) = 0;
/*! @function setCurrentDisplayMode
@abstract Set the framebuffers current display mode and depth.
@discussion IOFramebuffer subclasses should implement this method to set the current mode and depth. Other than at enableController() time, this is the only method that should change the framebuffer format and is synchronized with clients and attached accelerators to make sure access to the device is disallowed during the change.
@param displayMode A display mode ID representing the new mode.
@param depth An index indicating the new depth configuration of the framebuffer. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode.
@result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device.
*/
virtual IOReturn setDisplayMode( IODisplayModeID displayMode,
IOIndex depth );
/*! @function setApertureEnable
@abstract Enable an aperture on the framebuffer (usually unimplemented, no OS usage).
@discussion IOFramebuffer subclasses may implement this method to set enable a non standard aperture. The system does not call this method.
@param aperture A device specific aperture index.
@param enable Device specific mask of options.
@result an IOReturn code.
*/
virtual IOReturn setApertureEnable( IOPixelAperture aperture,
IOOptionBits enable );
/*! @function setStartupDisplayMode
@abstract Set the framebuffers display mode and depth to be used during boot and at startup.
@discussion IOFramebuffer subclasses should implement this method to set the mode and depth to be used during boot and at startup, to reduce needed mode changes during boot when the display connection type is the same. If possible this mode should also be used by the OpenFirmware driver for the card.
@param displayMode A display mode ID representing the new startup mode.
@param depth An index indicating the new startup depth configuration of the framebuffer. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode.
@result an IOReturn code.
*/
virtual IOReturn setStartupDisplayMode( IODisplayModeID displayMode,
IOIndex depth );
/*! @function getCurrentDisplayMode
@abstract Return the framebuffers display mode and depth to be used during boot and at startup.
@discussion IOFramebuffer subclasses should implement this method to return the current mode and depth.
@param displayMode A display mode ID representing the mode used during startup.
@param depth An index indicating the depth configuration of the framebuffer used during startup. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode.
@result an IOReturn code.
*/
virtual IOReturn getStartupDisplayMode( IODisplayModeID * displayMode,
IOIndex * depth );
/*! @function setCLUTWithEntries
@abstract Set the color lookup table to be used by the framebuffer in indexed modes.
@discussion IOFramebuffer subclasses may implement this method to allow a palette to be set for indexed display modes. It will not be called on framebuffers in direct display modes.
@param colors A pointer to an array of numEntries RGB color entries.
@param index The index of the first entry to set.
@param numEntries The number of entries in the table.
@param options Options controlling the operation. <br>
kSetCLUTByValue is set if the index field of each entry should be used to set the table sparsely, otherwise consecutive entries from the index parameter should be set.<br>
kSetCLUTImmediately is set if the CLUT set should not be synchronized with the vertical blank, otherwise it should.<br>
kSetCLUTWithLuminance is set if the CLUT should be set to a gray value equivalent in luminance to the passed color entry.<br>
@result an IOReturn code.
*/
virtual IOReturn setCLUTWithEntries( IOColorEntry * colors, UInt32 index,
UInt32 numEntries, IOOptionBits options );
/*! @function setGammaTable
@abstract Set the gamma table to be used by the framebuffer.
@discussion IOFramebuffer subclasses should implement this method to allow a gamma table to be set.
@param channelCount Defines the number of channels in the supplied data. OS X will pass three for separate R, G, B data, or one if the same data should apply to all channels.
@param dataCount The number of data entries per channel.
@param dataWidth The number of bits in each entry. 8 for Mac OS X 10.1 and earlier, 16 for later releases.
@param data The packed array of correction data. Data is passed for the R (or single) channel followed by the G & B channels. Each entry is one or two bytes (if dataWidth > 8).
@result an IOReturn code.
*/
virtual IOReturn setGammaTable( UInt32 channelCount, UInt32 dataCount,
UInt32 dataWidth, void * data );
/*! @function setAttribute
@abstract Generic method to set some attribute of the framebuffer device.
@discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be set.
@param attribute Defines the attribute to be set. Some defined attributes are:<br>
kIOPowerAttribute The IOFramebuffer class implements most power management (IOService) methods. It calls the subclass to carry out the power management state change with this attribute. When carrying out power state changes, the subclass should call IOFramebuffer::handleEvent for certain changes - set that method for more information.
@param value The new value for the attribute.
@result an IOReturn code.
*/
virtual IOReturn setAttribute( IOSelect attribute, uintptr_t value );
/*! @function getAttribute
@abstract Generic method to retrieve some attribute of the framebuffer device.
@discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be returned.
@param attribute Defines the attribute to be set. Some defined attributes are:<br>
kIOHardwareCursorAttribute If the device supports a hardware cursor and implements the setCursorImage() and setCursorState() calls it should return true for this attribute.
@param value Returns the value for the attribute.
@result an IOReturn code.
*/
virtual IOReturn getAttribute( IOSelect attribute, uintptr_t * value );
/*! @function getTimingInfoForDisplayMode
@abstract Returns a timing description for a display mode.
@discussion IOFramebuffer subclasses should implement this method to return timing information for a display mode. This allows the OS to enable display modes based on its knowledge of the connected display type. Two types of timing information are defined, by Apple defined constant, or by a detailed description of the timing parameters of the mode.
@param displayMode A display mode ID representing the mode to examine.
@param info The driver returns the information for the display mode in this structure.<br>
If the mode has an Apple defined constant, such as timingVESA_1024x768_75hz, it should be returned in the appleTimingID field. Otherwise the field should be set to timingInvalid.<br>
If the driver is able to supply detailed timing information, it should return it in the detailedInfo.v2 field of the structure, otherwise the driver should clear the kIODetailedTimingValid flag from the flags field.<br>
The IODetailedTimingInformationV2 structure is documented in IOGraphicsTypes.h
@result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device.
*/
virtual IOReturn getTimingInfoForDisplayMode(
IODisplayModeID displayMode, IOTimingInformation * info );
/*! @function validateDetailedTiming
@abstract Reports whether a detailed timing is able to be programmed with the device.
@discussion IOFramebuffer subclasses may implement programmable mode functionality where the OS is able to install modes described by a detailed timing into the driver.
@param description A pointer to a IODetailedTimingInformationV2 structure. The driver should examine this description and change any fields that it cannot implement to reflect its closest possible implementation.
@param descripSize sizeof(IODetailedTimingInformationV2)
@result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from installing the programmable mode.
*/
virtual IOReturn validateDetailedTiming(
void * description, IOByteCount descripSize );
/*! @function setDetailedTimings
@abstract Installs an array of OS programmed detailed timings to be made available by the driver.
@discussion IOFramebuffer subclasses may implement programmable mode functionality where the OS is able to install modes described by a detailed timing into the driver. The driver needs to add these modes to its internal mode list if it provides this functionality.
@param array An OSArray of OSData objects. Each OSData contains one IODetailedTimingInformationV2 structure. All the data described by the array should be copied or retained by this call until the next invocation of this method.
@result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from installing the programmable modes.
*/
virtual IOReturn setDetailedTimings( OSArray * array );
/*! @function getConnectionCount
@abstract Reports the number of display connections the device supports, driven from one framebuffer.
@discussion IOFramebuffer subclasses may implement functionality where a single framebuffer drives multiple displays. This is not recommended or fully supported and instead multihead cards should implement multiple instances of IOFramebuffer objects to provide full functionality.
@result A count of the number of display connections reported by the framebuffer. Current versions of OS X only support one connection completely.
*/
virtual IOItemCount getConnectionCount( void );
/*! @function setAttributeForConnection
@abstract Generic method to set some attribute of the framebuffer device, specific to one display connection.
@discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be set, specific to one display connection.
@param attribute Defines the attribute to be set. Some defined attributes are:<br>
kIOCapturedAttribute If the device supports hotplugging displays, it should disable the generation of hot plug interrupts when the attribute kIOCapturedAttribute is set to true.
@param value The new value for the attribute.
@result an IOReturn code.
*/
virtual IOReturn setAttributeForConnection( IOIndex connectIndex,
IOSelect attribute, uintptr_t value );
/*! @function getAttributeForConnection
@abstract Generic method to retrieve some attribute of the framebuffer device, specific to one display connection.
@discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be returned, specific to one display connection.
@param attribute Defines the attribute to be returned. Some defined attributes are:<br>
kConnectionSupportsHLDDCSense If the framebuffer supports the DDC methods hasDDCConnect() and getDDCBlock() it should return success (and no value) for this attribute.<br>
kConnectionSupportsLLDDCSense If the framebuffer wishes to make use of IOFramebuffer::doI2CRequest software implementation of I2C it should implement the I2C methods setDDCClock(), setDDCData(), readDDCClock(), readDDCData(), and it should return success (and no value) for this attribute.<br>
@param value Returns the value for the attribute.
@result an IOReturn code.
*/
virtual IOReturn getAttributeForConnection( IOIndex connectIndex,
IOSelect attribute, uintptr_t * value );
/*! @function convertCursorImage
@abstract Utility method of IOFramebuffer to convert cursor image to a hardware cursor format.
@discussion IOFramebuffer subclasses may implement hardware cursor functionality, if so they should pass the cursor image given by the setCursorImage() method, with a description of their hardware cursor format, to this helper function to this routine to convert the image to one suitable for the hardware.
@param cursorImage Opaque cursor parameter from the setCursorImage() call.
@param description Describes the cursor format supported by the driver.
@param cursor Structure describing the drivers allocated buffer to receive the converted image.
@result a bool indicating the conversion was successful.
*/
virtual bool convertCursorImage( void * cursorImage,
IOHardwareCursorDescriptor * description,
IOHardwareCursorInfo * cursor );
/*! @function setCursorImage
@abstract Set a new image for the hardware cursor.
@discussion IOFramebuffer subclasses may implement hardware cursor functionality, if so they should implement this method to change the hardware cursor image. The image should be passed to the convertCursorImage() method with each type of cursor format the hardware supports until success, if all fail the hardware cursor should be hidden and kIOReturnUnsupported returned.
@param cursorImage Opaque cursor description. This should be passed to the convertCursorImage() method to convert to a format specific to the hardware.
@result An IOReturn code.
*/
virtual IOReturn setCursorImage( void * cursorImage );
/*! @function setCursorState
@abstract Set a new position and visibility for the hardware cursor.
@discussion IOFramebuffer subclasses may implement hardware cursor functionality, if so they should implement this method to change the position and visibility of the cursor.
@param x Left coordinate of the cursor image. A signed value, will be negative if the cursor's hot spot and position place it partly offscreen.
@param y Top coordinate of the cursor image. A signed value, will be negative if the cursor's hot spot and position place it partly offscreen.
@param visible Visible state of the cursor.
@result An IOReturn code.
*/
virtual IOReturn setCursorState( SInt32 x, SInt32 y, bool visible );
/*! @function flushCursor
@abstract Perform any needed cache flushing after software cursor rendering.
@discussion IOFramebuffer implements software cursor functionality when a hardware cursor is unavailable. Some hardware may need to flush a cache after the processor has finished lifting and dropping the software cursor.
*/
virtual void flushCursor( void );
/*! @function getAppleSense
@abstract Return display sense information for legacy Apple sensing.
@discussion Hardware that supports simple display sensing, or the classic 3 pin Apple sensing described in Designing Cards and Drivers, should implement this method to return sense information.
@param connectIndex Index of the display connection, from zero to the value of getConnectionCount().
@param senseType Return zero to indicate legacy Apple sensing.
@param primary Return the value of the primary Apple sense code.
@param extended Return the value of the secondary Apple sense code.
@param displayType Return an Apple defined constant for the type of display sensed. For example, kVGAConnect, kNTSCConnect, kPALConnect etc.
@result An IOReturn code.
*/
virtual IOReturn getAppleSense( IOIndex connectIndex,
UInt32 * senseType,
UInt32 * primary,
UInt32 * extended,
UInt32 * displayType );
/*! @function connectFlags
@abstract Return display sense information for legacy Apple sensing.
@discussion Hardware that supports simple display sensing, or the classic 3 pin Apple sensing described in Designing Cards and Drivers, should implement this method to return mode flags relative to the sensed display. If this method is unimplemented, all modes have are given the flags kDisplayModeValidFlag | kDisplayModeSafeFlag.
@param connectIndex Index of the display connection, from zero to the value of getConnectionCount().
@param displayMode A display mode ID.
@param flags Return the flags value for the given mode with the connected display. Flags are:<br>
kDisplayModeValidFlag - mode is considered valid for the connected display by the driver.
kDisplayModeSafeFlag - mode is considered safe (not requiring mode change confirmation) for the connected display by the driver.
kDisplayModeDefaultFlag - mode is considered default for the connected display by the driver.
@result An IOReturn code.
*/
virtual IOReturn connectFlags( IOIndex connectIndex,
IODisplayModeID displayMode, IOOptionBits * flags );
//// IOLowLevelDDCSense
/*! @function setDDCClock
@abstract Sets the state of the I2C clock line on a bus.
@discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to set the state of the I2C clock line on the given bus. Otherwise may be unimplemented.
@param bus Index of the bus.
@param value One of kIODDCLow, kIODDCHigh, kIODDCTristate.
*/
virtual void setDDCClock( IOIndex bus, UInt32 value );
/*! @function setDDCData
@abstract Sets the state of the I2C data line on a bus.
@discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to set the state of the I2C data line on the given bus. Otherwise may be unimplemented.
@param bus Index of the bus.
@param value One of kIODDCLow, kIODDCHigh, kIODDCTristate.
*/
virtual void setDDCData( IOIndex bus, UInt32 value );
/*! @function readDDCClock
@abstract Reads the input state of the I2C clock line on a bus.
@discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to return the input state of the I2C clock line on the given bus. Otherwise may be unimplemented.
@param bus Index of the bus.
@result A boolean reflecting the current state of the clock line on the given bus.
*/
virtual bool readDDCClock( IOIndex bus );
/*! @function readDDCData
@abstract Reads the input state of the I2C data line on a bus.
@discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to return the input state of the I2C data line on the given bus. Otherwise may be unimplemented.
@param bus Index of the bus.
@result A boolean reflecting the current state of the data line on the given bus.
*/
virtual bool readDDCData( IOIndex bus );
virtual IOReturn enableDDCRaster( bool enable );
/*! @function hasDDCConnect
@abstract Return display DDC connect state.
@discussion Hardware that supports DDC/EDID display sensing should implement this method to return true if a DDC display is detected. They should also return success for the connection attribute kConnectionSupportsHLDDCSense (from getAttributeForConnection()).
@param connectIndex Index of the display connection, from zero to the value of getConnectionCount().
@result True if a DDC display is detected.
*/
virtual bool hasDDCConnect( IOIndex connectIndex );
/*! @function getDDCBlock
@abstract Return display EDID data.
@discussion Hardware that supports DDC/EDID display sensing should implement this method to return EDID data in 128 byte blocks.
@param connectIndex Index of the display connection, from zero to the value of getConnectionCount().
@param blockNumber Block number, ranging from one to the number of blocks return by the display.
@param blockType kIODDCBlockTypeEDID will be passed.
@param options No options are currently defined.
@param data Caller allocated buffer to receive the blocks data.
@param length In/out parameter - callers allocated buffer size, driver returns actual size.
@result An IOReturn code.
*/
virtual IOReturn getDDCBlock( IOIndex connectIndex, UInt32 blockNumber,
IOSelect blockType, IOOptionBits options,
UInt8 * data, IOByteCount * length );
/*! @function registerForInterruptType
@abstract Set callbacks for driver to call on interrupt events.
@discussion The IOFramebuffer class will call its subclasses to set callbacks to be called on interrupt events generated by hardware events. Only two are currently in use - vertical blank interrupts and connection changed interrupts.
@param interruptType One of these constants:<br>
kIOFBVBLInterruptType Specifying a vertical blanking interrupt.
kIOFBConnectInterruptType Specify the display connection should be resensed.
@param proc C callback to be called by the driver when the specified event occurs.
@param target Target parameter for the callback proc.
@param ref Ref parameter for the callback proc.
@param interruptRef The subclass should return an opaque reference to the installed interrupt handler, for use with unregisterInterrupt() and setInterruptState().
@result An IOReturn code.
*/
virtual IOReturn registerForInterruptType( IOSelect interruptType,
IOFBInterruptProc proc, OSObject * target, void * ref,
void ** interruptRef );
/*! @function unregisterInterrupt
@abstract Remove a callback previously installed by registerForInterruptType().
@discussion Remove a callback previously installed by registerForInterruptType().
@param interruptRef The interruptRef returned from the registerForInterruptType call that installed the interrupt.
@result An IOReturn code.
*/
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
virtual IOReturn unregisterInterrupt( void * interruptRef );
#pragma clang diagnostic pop
/*! @function unregisterInterrupt
@abstract Enable or disable a callback previously installed by registerForInterruptType().
@discussion Enable or disable a callback previously installed by registerForInterruptType().
@param state True or false to enable the callback.
@result An IOReturn code.
*/
virtual IOReturn setInterruptState( void * interruptRef, UInt32 state );
virtual IOReturn getNotificationSemaphore( IOSelect interruptType,
semaphore_t * semaphore );
IOReturn setBackingFramebuffer(const IOPixelInformation * info,
uint32_t bufferCount,
void * mappedAddress[]);
IOReturn switchBackingFramebuffer(uint32_t bufferIndex);
/* non WL clients apis
*/
IOReturn setAttributeExt( IOSelect attribute, uintptr_t value );
IOReturn getAttributeExt( IOSelect attribute, uintptr_t * value );
IOReturn setAttributeForConnectionExt( IOIndex connectIndex,
IOSelect attribute, uintptr_t value );
IOReturn getAttributeForConnectionExt( IOIndex connectIndex,
IOSelect attribute, uintptr_t * value );
/* New */
IONotifier * addFramebufferNotificationWithOptions(IOFramebufferNotificationHandler handler,
OSObject * target, void * ref,
IOSelect groupID, IOIndex groupPriority, IOSelect events);
void resetLimitState(void);
void sendLimitState(const uint32_t line);
};
#endif /* ! _IOKIT_IOFRAMEBUFFER_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/graphics/IOAccelClientConnect.h | /*
* Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOACCEL_CLIENT_CONNECT_H
#define _IOACCEL_CLIENT_CONNECT_H
/*
** The IOAccelerator service name
*/
#define kIOAcceleratorClassName "IOAccelerator"
/*
** IOAccelerator public client types. Private client types start with
** kIOAccelNumClientTypes.
*/
enum eIOAcceleratorClientTypes {
kIOAccelSurfaceClientType,
kIOAccelNumClientTypes,
#ifndef _OPEN_SOURCE_
kIOAccelSurface2ClientType = 0x20
#endif /* _OPEN_SOURCE_ */
};
#endif /* _IOACCEL_CLIENT_CONNECT_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/graphics/IOGraphicsTypes.h | /*
* Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOGRAPHICSTYPES_H
#define _IOKIT_IOGRAPHICSTYPES_H
#include <IOKit/IOTypes.h>
#include <IOKit/IOKitKeys.h>
#ifdef __cplusplus
extern "C" {
#endif
#define IOGRAPHICSTYPES_REV 76
typedef SInt32 IOIndex;
typedef UInt32 IOSelect;
typedef UInt32 IOFixed1616;
typedef UInt32 IODisplayVendorID;
typedef UInt32 IODisplayProductID;
typedef SInt32 IODisplayModeID;
enum {
// This is the ID given to a programmable timing used at boot time
kIODisplayModeIDBootProgrammable = (IODisplayModeID)0xFFFFFFFB,
// Lowest (unsigned) DisplayModeID reserved by Apple
kIODisplayModeIDReservedBase = (IODisplayModeID)0x80000000
};
enum {
kIOMaxPixelBits = 64
};
typedef char IOPixelEncoding[ kIOMaxPixelBits ];
// Common Apple pixel formats
#define IO1BitIndexedPixels "P"
#define IO2BitIndexedPixels "PP"
#define IO4BitIndexedPixels "PPPP"
#define IO8BitIndexedPixels "PPPPPPPP"
#define IO16BitDirectPixels "-RRRRRGGGGGBBBBB"
#define IO32BitDirectPixels "--------RRRRRRRRGGGGGGGGBBBBBBBB"
#define kIO30BitDirectPixels "--RRRRRRRRRRGGGGGGGGGGBBBBBBBBBB"
#define kIO64BitDirectPixels "-16R16G16B16"
#define kIO16BitFloatPixels "-16FR16FG16FB16"
#define kIO32BitFloatPixels "-32FR32FG32FB32"
// other possible pixel formats
#define IOYUV422Pixels "Y4U2V2"
#define IO8BitOverlayPixels "O8"
// page flipping
#define IOPagedPixels "Page1"
#define IO_SampleTypeAlpha 'A'
#define IO_SampleTypeSkip '-'
// Info about a pixel format
enum {
kIOCLUTPixels = 0,
kIOFixedCLUTPixels = 1,
kIORGBDirectPixels = 2,
kIOMonoDirectPixels = 3,
kIOMonoInverseDirectPixels = 4,
kIORGBSignedDirectPixels = 5,
kIORGBSignedFloatingPointPixels = 6
};
/*!
* @struct IOPixelInformation
* @abstract A structure defining the format of a framebuffer.
* @discussion This structure is used by IOFramebuffer to define the format of the pixels.
* @field bytesPerRow The number of bytes per row.
* @field bytesPerPlane Not used.
* @field bitsPerPixel The number of bits per pixel, including unused bits and alpha.
* @field pixelType One of kIOCLUTPixels (indexed pixels with changeable CLUT), kIORGBDirectPixels (direct pixels).
* @field componentCount One for indexed pixels, three for direct pixel formats.
* @field bitsPerComponent Number of bits per component in each pixel.
* @field componentMasks Mask of the bits valid for each component of the pixel - in R, G, B order for direct pixels.
* @field pixelFormat String description of the pixel format - IO32BitDirectPixels, IO16BitDirectPixels etc.
* @field flags None defined - set to zero.
* @field activeWidth Number of pixels visible per row.
* @field activeHeight Number of visible pixel rows.
* @field reserved Set to zero.
*/
struct IOPixelInformation {
UInt32 bytesPerRow;
UInt32 bytesPerPlane;
UInt32 bitsPerPixel;
UInt32 pixelType;
UInt32 componentCount;
UInt32 bitsPerComponent;
UInt32 componentMasks[ 8 * 2 ];
IOPixelEncoding pixelFormat;
UInt32 flags;
UInt32 activeWidth;
UInt32 activeHeight;
UInt32 reserved[ 2 ];
};
typedef struct IOPixelInformation IOPixelInformation;
// ID for industry standard display timings
typedef UInt32 IOAppleTimingID;
/*!
* @struct IODisplayModeInformation
* @abstract A structure defining the format of a framebuffer.
* @discussion This structure is used by IOFramebuffer to define the format of the pixels.
* @field nominalWidth Number of pixels visible per row.
* @field nominalHeight Number of visible pixel rows.
* @field refreshRate Refresh rate in fixed point 16.16.
* @field maxDepthIndex Highest depth index available in this display mode.
* @field flags Flags for the mode, including: <br>
* kDisplayModeInterlacedFlag mode is interlaced. <br>
* kDisplayModeSimulscanFlag mode is available on multiple display connections. <br>
* kDisplayModeNotPresetFlag mode is not a factory preset for the display (geometry may need correction). <br>
* kDisplayModeStretchedFlag mode is stretched/distorted to match the display aspect ratio. <br>
* @field imageWidth Physical width of active image if known, in millimeters, otherwise zero. <br>
* @field imageHeight Physical height of active image if known, in millimeters, otherwise zero. <br>
* @field reserved Set to zero.
*/
struct IODisplayModeInformation {
UInt32 nominalWidth;
UInt32 nominalHeight;
IOFixed1616 refreshRate;
IOIndex maxDepthIndex;
UInt32 flags;
UInt16 imageWidth;
UInt16 imageHeight;
UInt32 reserved[ 3 ];
};
typedef struct IODisplayModeInformation IODisplayModeInformation;
// flags
enum {
kDisplayModeSafetyFlags = 0x00000007,
kDisplayModeAlwaysShowFlag = 0x00000008,
kDisplayModeNeverShowFlag = 0x00000080,
kDisplayModeNotResizeFlag = 0x00000010,
kDisplayModeRequiresPanFlag = 0x00000020,
kDisplayModeInterlacedFlag = 0x00000040,
kDisplayModeSimulscanFlag = 0x00000100,
kDisplayModeBuiltInFlag = 0x00000400,
kDisplayModeNotPresetFlag = 0x00000200,
kDisplayModeStretchedFlag = 0x00000800,
kDisplayModeNotGraphicsQualityFlag = 0x00001000,
kDisplayModeValidateAgainstDisplay = 0x00002000,
kDisplayModeTelevisionFlag = 0x00100000,
kDisplayModeValidForMirroringFlag = 0x00200000,
kDisplayModeAcceleratorBackedFlag = 0x00400000,
kDisplayModeValidForHiResFlag = 0x00800000,
kDisplayModeValidForAirPlayFlag = 0x01000000,
kDisplayModeNativeFlag = 0x02000000
};
enum {
kDisplayModeValidFlag = 0x00000001,
kDisplayModeSafeFlag = 0x00000002,
kDisplayModeDefaultFlag = 0x00000004
};
#ifndef KERNEL
// Framebuffer info - obsolete
struct IOFramebufferInformation {
IOPhysicalAddress baseAddress;
UInt32 activeWidth;
UInt32 activeHeight;
IOByteCount bytesPerRow;
IOByteCount bytesPerPlane;
UInt32 bitsPerPixel;
UInt32 pixelType;
UInt32 flags;
UInt32 reserved[ 4 ];
};
typedef struct IOFramebufferInformation IOFramebufferInformation;
#endif
// flags
enum {
kFramebufferSupportsCopybackCache = 0x00010000,
kFramebufferSupportsWritethruCache = 0x00020000,
kFramebufferSupportsGammaCorrection = 0x00040000,
kFramebufferDisableAltivecAccess = 0x00080000
};
// Aperture is an index into supported pixel formats for a mode & depth
typedef IOIndex IOPixelAperture;
enum {
kIOFBSystemAperture = 0
};
//// CLUTs
// IOFBSetGamma Sync Types
#define kIOFBSetGammaSyncNotSpecified -1
#define kIOFBSetGammaSyncNoSync 0
#define kIOFBSetGammaSyncVerticalBlankSync 1
typedef UInt16 IOColorComponent;
/*!
* @struct IOColorEntry
* @abstract A structure defining one entry of a color lookup table.
* @discussion This structure is used by IOFramebuffer to define an entry of a color lookup table.
* @field index Number of pixels visible per row.
* @field red Value of red component 0-65535.
* @field green Value of green component 0-65535.
* @field blue Value of blue component 0-65535.
*/
struct IOColorEntry {
UInt16 index;
IOColorComponent red;
IOColorComponent green;
IOColorComponent blue;
};
typedef struct IOColorEntry IOColorEntry;
// options (masks)
enum {
kSetCLUTByValue = 0x00000001, // else at index
kSetCLUTImmediately = 0x00000002, // else at VBL
kSetCLUTWithLuminance = 0x00000004 // else RGB
};
//// Controller attributes
enum {
kIOPowerStateAttribute = 'pwrs',
kIOPowerAttribute = 'powr',
kIODriverPowerAttribute = 'dpow',
kIOHardwareCursorAttribute = 'crsr',
kIOMirrorAttribute = 'mirr',
kIOMirrorDefaultAttribute = 'mrdf',
kIOCapturedAttribute = 'capd',
kIOCursorControlAttribute = 'crsc',
kIOSystemPowerAttribute = 'spwr',
kIOWindowServerActiveAttribute = 'wsrv',
kIOVRAMSaveAttribute = 'vrsv',
kIODeferCLUTSetAttribute = 'vclt',
kIOClamshellStateAttribute = 'clam',
kIOFBDisplayPortTrainingAttribute = 'dpta',
kIOFBDisplayState = 'dstt',
kIOFBVariableRefreshRate = 'vrr?',
kIOFBLimitHDCPAttribute = 'hdcp',
kIOFBLimitHDCPStateAttribute = 'sHDC',
kIOFBStop = 'stop',
kIOFBRedGammaScaleAttribute = 'gslr', // as of IOGRAPHICSTYPES_REV 54
kIOFBGreenGammaScaleAttribute = 'gslg', // as of IOGRAPHICSTYPES_REV 54
kIOFBBlueGammaScaleAttribute = 'gslb', // as of IOGRAPHICSTYPES_REV 54
kIOFBHDRMetaDataAttribute = 'hdrm', // as of IOGRAPHICSTYPES_REV 64
kIOBuiltinPanelPowerAttribute = 'pnlp', // as of IOGRAPHICSTYPES_REV 71
};
enum {
kIOFBHDCPLimit_AllowAll = 0,
kIOFBHDCPLimit_NoHDCP1x = 1 << 0,
kIOFBHDCPLimit_NoHDCP20Type0 = 1 << 1,
kIOFBHDCPLimit_NoHDCP20Type1 = 1 << 2, // Default case
};
// <rdar://problem/34574357> kIOFBHDRMetaDataAttribute
struct IOFBHDRMetaDataV1
{
uint16_t displayPrimary_X0; // X coordinate of red primary
uint16_t displayPrimary_Y0; // Y coordinate of red primary
uint16_t displayPrimary_X1; // X coordinate of green primary
uint16_t displayPrimary_Y1; // Y coordinate of green primary
uint16_t displayPrimary_X2; // X coordinate of blue primary
uint16_t displayPrimary_Y2; // Y coordinate of blue primary
uint16_t displayPrimary_X; // X coordinate of white primary
uint16_t displayPrimary_Y; // Y coordinate of white primary
uint16_t desiredLuminance_Max; // Desired max display luminance
uint16_t desiredLuminance_Min; // Desired min display luminance
uint16_t desiredLightLevel_Avg; // Desired max frame-average light level
uint16_t desiredLightLevel_Max; // Desired max light level
uint64_t __reservedA[5]; // Reserved - set to zero
};
typedef struct IOFBHDRMetaDataV1 IOFBHDRMetaDataV1;
typedef union {
IOFBHDRMetaDataV1 v1;
} IOFBHDRMetaData;
// <rdar://problem/29184178> IOGraphics: Implement display state attribute for deteriming display state post wake
// kIOFBDisplayState
enum {
kIOFBDisplayState_AlreadyActive = (1 << 0),
kIOFBDisplayState_RestoredProfile = (1 << 1),
kIOFBDisplayState_PipelineBlack = (1 << 2),
kIOFBDisplayState_Mask = (kIOFBDisplayState_AlreadyActive |
kIOFBDisplayState_RestoredProfile |
kIOFBDisplayState_PipelineBlack)
};
// values for kIOWindowServerActiveAttribute
enum {
// States
kIOWSAA_Unaccelerated = 0, // CPU rendering/access only, no GPU access
kIOWSAA_Accelerated = 1, // GPU rendering/access only, no CPU mappings
kIOWSAA_From_Accelerated = 2, // Transitioning from GPU to CPU
kIOWSAA_To_Accelerated = 3, // Transitioning from CPU to GPU
kIOWSAA_Sleep = 4,
kIOWSAA_Hibernate = kIOWSAA_Sleep,
kIOWSAA_DriverOpen = 5, // Reserved
kIOWSAA_StateMask = 0xF,
// Bits
kIOWSAA_Transactional = 0x10, // If this bit is present, transition is to/from transactional operation model.
// These attributes are internal
kIOWSAA_DeferStart = 0x100,
kIOWSAA_DeferEnd = 0x200,
kIOWSAA_NonConsoleDevice = 0x400, // If present, associated FB is non-console. See ERS for further details.
kIOWSAA_Reserved = 0xF0000000
};
// IOFBNS prefix is IOFramebuffer notifyServer
enum {
kIOFBNS_Rendezvous = 0x87654321, // Note sign-bit is 1 here.
kIOFBNS_MessageMask = 0x0000000f,
kIOFBNS_Sleep = 0x00,
kIOFBNS_Wake = 0x01,
kIOFBNS_Doze = 0x02,
#ifndef _OPEN_SOURCE_
// <rdar://problem/39199290> IOGraphics: Add 10 second timeout to IODW DIM
// policy.
// Enum of Bitfields for Windows server notification msgh_id, which is a
// integer_t signed type.
kIOFBNS_Dim = 0x03,
kIOFBNS_UnDim = 0x04,
#endif // !_OPEN_SOURCE_
// For Wake messages this field contains the current kIOFBDisplayState as
// returned by attribute 'kIOFBDisplayState'
kIOFBNS_DisplayStateMask = 0x00000f00,
kIOFBNS_DisplayStateShift = 8,
// Message Generation Count, top-bit i.e. sign-bit is always 0 for normal
// messages, see kIOFBNS_Rendezvous is the only exception and it doesn't
// encode a generation count.
kIOFBNS_GenerationMask = 0x7fff0000,
kIOFBNS_GenerationShift = 16,
};
// values for kIOMirrorAttribute
enum {
kIOMirrorIsPrimary = 0x80000000,
kIOMirrorHWClipped = 0x40000000,
kIOMirrorIsMirrored = 0x20000000
};
// values for kIOMirrorDefaultAttribute
enum {
kIOMirrorDefault = 0x00000001,
kIOMirrorForced = 0x00000002
};
//// Display mode timing information
struct IODetailedTimingInformationV1 {
// from EDID defn
UInt32 pixelClock; // Hertz
UInt32 horizontalActive; // pixels
UInt32 horizontalBlanking; // pixels
UInt32 horizontalBorder; // pixels
UInt32 horizontalSyncOffset; // pixels
UInt32 horizontalSyncWidth; // pixels
UInt32 verticalActive; // lines
UInt32 verticalBlanking; // lines
UInt32 verticalBorder; // lines
UInt32 verticalSyncOffset; // lines
UInt32 verticalSyncWidth; // lines
};
typedef struct IODetailedTimingInformationV1 IODetailedTimingInformationV1;
/*!
* @struct IODetailedTimingInformationV2
* @abstract A structure defining the detailed timing information of a display mode.
* @discussion This structure is used by IOFramebuffer to define detailed timing information for a display mode. The VESA EDID document has more information.
* @field __reservedA Set to zero.
* @field horizontalScaledInset If the mode is scaled, sets the number of active pixels to remove the left and right edges in order to display an underscanned image.
* @field verticalScaledInset If the mode is scaled, sets the number of active lines to remove the top and bottom edges in order to display an underscanned image.
* @field scalerFlags If the mode is scaled,
* kIOScaleStretchToFit may be set to allow stretching.
* kIOScaleRotateFlags is mask which may have the value given by kIOScaleRotate90, kIOScaleRotate180, kIOScaleRotate270 to display a rotated framebuffer.
* @field horizontalScaled If the mode is scaled, sets the size of the image before scaling or rotation.
* @field verticalScaled If the mode is scaled, sets the size of the image before scaling or rotation.
* @field signalConfig
* kIOAnalogSetupExpected set if display expects a blank-to-black setup or pedestal. See VESA signal standards. <br>
* kIOInterlacedCEATiming set for a CEA style interlaced timing:<br>
* Field 1 vertical blanking = half specified vertical blanking lines. <br>
* Field 2 vertical blanking = (half vertical blanking lines) + 1 line. <br>
* Field 1 vertical offset = half specified vertical sync offset. <br>
* Field 2 vertical offset = (half specified vertical sync offset) + 0.5 lines. <br>
* @field signalLevels One of:<br>
* kIOAnalogSignalLevel_0700_0300 0.700 - 0.300 V p-p.<br>
* kIOAnalogSignalLevel_0714_0286 0.714 - 0.286 V p-p.<br>
* kIOAnalogSignalLevel_1000_0400 1.000 - 0.400 V p-p.<br>
* kIOAnalogSignalLevel_0700_0000 0.700 - 0.000 V p-p.<br>
* @field pixelClock Pixel clock frequency in Hz.
* @field minPixelClock Minimum pixel clock frequency in Hz, with error.
* @field maxPixelClock Maximum pixel clock frequency in Hz, with error.
* @field horizontalActive Pixel clocks per line.
* @field horizontalBlanking Blanking clocks per line.
* @field horizontalSyncOffset First clock of horizontal sync.
* @field horizontalSyncPulseWidth Width of horizontal sync.
* @field verticalActive Number of lines per frame.
* @field verticalBlanking Blanking lines per frame.
* @field verticalSyncOffset First line of vertical sync.
* @field verticalSyncPulseWidth Height of vertical sync.
* @field horizontalBorderLeft Number of pixels in left horizontal border.
* @field horizontalBorderRight Number of pixels in right horizontal border.
* @field verticalBorderTop Number of lines in top vertical border.
* @field verticalBorderBottom Number of lines in bottom vertical border.
* @field horizontalSyncConfig kIOSyncPositivePolarity for positive polarity horizontal sync (0 for negative).
* @field horizontalSyncLevel Zero.
* @field verticalSyncConfig kIOSyncPositivePolarity for positive polarity vertical sync (0 for negative).
* @field verticalSyncLevel Zero.
* @field numLinks number of links to be used by a dual link timing, if zero, assume one link.
* @field verticalBlankingExtension maximum number of blanking extension lines that is available. (0 for none).
* @field pixelEncoding 2017 Timing Features - ERS 2-58 (6.3.1)
* @field bitsPerColorComponent 2017 Timing Features - ERS 2-58 (6.3.1)
* @field colorimetry 2017 Timing Features - ERS 2-58 (6.3.1)
* @field dynamicRange 2017 Timing Features - ERS 2-58 (6.3.1)
* @field dscCompressedBitsPerPixel 2018 Timing Features - ERS 2-63 (6.3.1)
* @field dscSliceHeight 2018 Timing Features - ERS 2-63 (6.3.1)
* @field dscSliceWidth 2018 Timing Features - ERS 2-63 (6.3.1)
* @field verticalBlankingMaxStretchPerFrame Max stretch time used for VRR refresh rate ramps
* @field verticalBlankingMaxShrinkPerFrame Max shrink time used for VRR refresh rate ramps
* @field __reservedB Reserved set to zero.
*/
struct IODetailedTimingInformationV2 {
UInt32 __reservedA[3]; // Init to 0
UInt32 horizontalScaledInset; // pixels
UInt32 verticalScaledInset; // lines
UInt32 scalerFlags;
UInt32 horizontalScaled;
UInt32 verticalScaled;
UInt32 signalConfig;
UInt32 signalLevels;
UInt64 pixelClock; // Hz
UInt64 minPixelClock; // Hz - With error what is slowest actual clock
UInt64 maxPixelClock; // Hz - With error what is fasted actual clock
UInt32 horizontalActive; // pixels
UInt32 horizontalBlanking; // pixels
UInt32 horizontalSyncOffset; // pixels
UInt32 horizontalSyncPulseWidth; // pixels
UInt32 verticalActive; // lines
UInt32 verticalBlanking; // lines
UInt32 verticalSyncOffset; // lines
UInt32 verticalSyncPulseWidth; // lines
UInt32 horizontalBorderLeft; // pixels
UInt32 horizontalBorderRight; // pixels
UInt32 verticalBorderTop; // lines
UInt32 verticalBorderBottom; // lines
UInt32 horizontalSyncConfig;
UInt32 horizontalSyncLevel; // Future use (init to 0)
UInt32 verticalSyncConfig;
UInt32 verticalSyncLevel; // Future use (init to 0)
UInt32 numLinks;
UInt32 verticalBlankingExtension; // lines (AdaptiveSync: 0 for non-AdaptiveSync support)
UInt16 pixelEncoding;
UInt16 bitsPerColorComponent;
UInt16 colorimetry;
UInt16 dynamicRange;
UInt16 dscCompressedBitsPerPixel;
UInt16 dscSliceHeight;
UInt16 dscSliceWidth;
UInt16 verticalBlankingMaxStretchPerFrame;
UInt16 verticalBlankingMaxShrinkPerFrame;
UInt16 __reservedB[3]; // Init to 0
};
typedef struct IODetailedTimingInformationV2 IODetailedTimingInformationV2;
typedef struct IODetailedTimingInformationV2 IODetailedTimingInformation;
struct IOTimingInformation {
IOAppleTimingID appleTimingID; // kIOTimingIDXXX const
UInt32 flags;
union {
IODetailedTimingInformationV1 v1;
IODetailedTimingInformationV2 v2;
} detailedInfo;
};
typedef struct IOTimingInformation IOTimingInformation;
enum {
// IOTimingInformation flags
kIODetailedTimingValid = 0x80000000,
kIOScalingInfoValid = 0x40000000
};
enum {
// scalerFlags
kIOScaleStretchToFit = 0x00000001,
kIOScaleRotateFlags = 0x000000f0,
kIOScaleSwapAxes = 0x00000010,
kIOScaleInvertX = 0x00000020,
kIOScaleInvertY = 0x00000040,
kIOScaleRotate0 = 0x00000000,
kIOScaleRotate90 = kIOScaleSwapAxes | kIOScaleInvertX,
kIOScaleRotate180 = kIOScaleInvertX | kIOScaleInvertY,
kIOScaleRotate270 = kIOScaleSwapAxes | kIOScaleInvertY
};
enum {
kIOPixelEncodingNotSupported = 0x0000,
kIOPixelEncodingRGB444 = 0x0001,
kIOPixelEncodingYCbCr444 = 0x0002,
kIOPixelEncodingYCbCr422 = 0x0004,
kIOPixelEncodingYCbCr420 = 0x0008
};
enum {
kIOBitsPerColorComponentNotSupported = 0x0000,
kIOBitsPerColorComponent6 = 0x0001,
kIOBitsPerColorComponent8 = 0x0002,
kIOBitsPerColorComponent10 = 0x0004,
kIOBitsPerColorComponent12 = 0x0008,
kIOBitsPerColorComponent16 = 0x0010
};
enum {
kIOColorimetryNotSupported = 0x0000,
kIOColorimetryNativeRGB = 0x0001,
kIOColorimetrysRGB = 0x0002,
kIOColorimetryDCIP3 = 0x0004,
kIOColorimetryAdobeRGB = 0x0008,
kIOColorimetryxvYCC = 0x0010,
kIOColorimetryWGRGB = 0x0020,
kIOColorimetryBT601 = 0x0040,
kIOColorimetryBT709 = 0x0080,
kIOColorimetryBT2020 = 0x0100,
kIOColorimetryBT2100 = 0x0200
};
enum {
// dynamicRange - should be in sync with "supportedDynamicRangeModes" enum below
kIODynamicRangeNotSupported = 0x0000,
kIODynamicRangeSDR = 0x0001,
kIODynamicRangeHDR10 = 0x0002,
kIODynamicRangeDolbyNormalMode = 0x0004,
kIODynamicRangeDolbyTunnelMode = 0x0008,
kIODynamicRangeTraditionalGammaHDR = 0x0010,
kIODynamicRangeTraditionalGammaSDR = 0x0020, // as of IOGRAPHICSTYPES_REV 72
};
#pragma pack(push, 4)
struct IOFBDisplayModeDescription {
IODisplayModeInformation info;
IOTimingInformation timingInfo;
};
typedef struct IOFBDisplayModeDescription IOFBDisplayModeDescription;
#pragma pack(pop)
/*!
* @struct IODisplayTimingRangeV1
* @abstract A structure defining the limits and attributes of a display or framebuffer.
* @discussion This structure is used to define the limits for modes programmed as detailed timings by the OS. The VESA EDID is useful background information for many of these fields. A data property with this structure under the key kIOFBTimingRangeKey in a framebuffer will allow the OS to program detailed timings that fall within its range.
* @field __reservedA Set to zero.
* @field version Set to zero.
* @field __reservedB Set to zero.
* @field minPixelClock minimum pixel clock frequency in range, in Hz.
* @field minPixelClock maximum pixel clock frequency in range, in Hz.
* @field maxPixelError largest variation between specified and actual pixel clock frequency, in Hz.
* @field supportedSyncFlags mask of supported sync attributes. The following are defined:<br>
* kIORangeSupportsSeparateSyncs - digital separate syncs.<br>
* kIORangeSupportsSyncOnGreen - sync on green.<br>
* kIORangeSupportsCompositeSync - composite sync.<br>
* kIORangeSupportsVSyncSerration - vertical sync has serration and equalization pulses.<br>
* kIORangeSupportsVRR - variable refresh rate. <br>
* @field supportedSignalLevels mask of possible signal levels. The following are defined:<br>
* kIORangeSupportsSignal_0700_0300 0.700 - 0.300 V p-p.<br>
* kIORangeSupportsSignal_0714_0286 0.714 - 0.286 V p-p.<br>
* kIORangeSupportsSignal_1000_0400 1.000 - 0.400 V p-p.<br>
* kIORangeSupportsSignal_0700_0000 0.700 - 0.000 V p-p.<br>
* @field supportedSignalConfigs mask of possible signal configurations. The following are defined:<br>
* kIORangeSupportsInterlacedCEATiming Supports CEA style interlaced timing:<br>
* Field 1 vertical blanking = specified vertical blanking lines. <br>
* Field 2 vertical blanking = vertical blanking lines + 1 line. <br>
* Field 1 vertical offset = specified vertical sync offset. <br>
* Field 2 vertical offset = specified vertical sync offset + 0.5 lines. <br>
* kIORangeSupportsInterlacedCEATimingWithConfirm Supports CEA style interlaced timing, but require a confirm.
* @field minFrameRate minimum frame rate (vertical refresh frequency) in range, in Hz.
* @field maxFrameRate maximum frame rate (vertical refresh frequency) in range, in Hz.
* @field minLineRate minimum line rate (horizontal refresh frequency) in range, in Hz.
* @field maxLineRate maximum line rate (horizontal refresh frequency) in range, in Hz.
* @field maxHorizontalTotal maximum clocks in horizontal line (active + blanking).
* @field maxVerticalTotal maximum lines in vertical frame (active + blanking).
* @field __reservedD Set to zero.
* @field charSizeHorizontalActive horizontalActive must be a multiple of charSizeHorizontalActive.
* @field charSizeHorizontalBlanking horizontalBlanking must be a multiple of charSizeHorizontalBlanking.
* @field charSizeHorizontalSyncOffset horizontalSyncOffset must be a multiple of charSizeHorizontalSyncOffset.
* @field charSizeHorizontalSyncPulse horizontalSyncPulse must be a multiple of charSizeHorizontalSyncPulse.
* @field charSizeVerticalActive verticalActive must be a multiple of charSizeVerticalActive.
* @field charSizeVerticalBlanking verticalBlanking must be a multiple of charSizeVerticalBlanking.
* @field charSizeVerticalSyncOffset verticalSyncOffset must be a multiple of charSizeVerticalSyncOffset.
* @field charSizeVerticalSyncPulse verticalSyncPulse must be a multiple of charSizeVerticalSyncPulse.
* @field charSizeHorizontalBorderLeft horizontalBorderLeft must be a multiple of charSizeHorizontalBorderLeft.
* @field charSizeHorizontalBorderRight horizontalBorderRight must be a multiple of charSizeHorizontalBorderRight.
* @field charSizeVerticalBorderTop verticalBorderTop must be a multiple of charSizeVerticalBorderTop.
* @field charSizeVerticalBorderBottom verticalBorderBottom must be a multiple of charSizeVerticalBorderBottom.
* @field charSizeHorizontalTotal (horizontalActive + horizontalBlanking) must be a multiple of charSizeHorizontalTotal.
* @field charSizeVerticalTotal (verticalActive + verticalBlanking) must be a multiple of charSizeVerticalTotal.
* @field __reservedE Set to zero.
* @field minHorizontalActiveClocks minimum value of horizontalActive.
* @field maxHorizontalActiveClocks maximum value of horizontalActive.
* @field minHorizontalBlankingClocks minimum value of horizontalBlanking.
* @field maxHorizontalBlankingClocks maximum value of horizontalBlanking.
* @field minHorizontalSyncOffsetClocks minimum value of horizontalSyncOffset.
* @field maxHorizontalSyncOffsetClocks maximum value of horizontalSyncOffset.
* @field minHorizontalPulseWidthClocks minimum value of horizontalPulseWidth.
* @field maxHorizontalPulseWidthClocks maximum value of horizontalPulseWidth.
* @field minVerticalActiveClocks minimum value of verticalActive.
* @field maxVerticalActiveClocks maximum value of verticalActive.
* @field minVerticalBlankingClocks minimum value of verticalBlanking.
* @field maxVerticalBlankingClocks maximum value of verticalBlanking.
* @field minVerticalSyncOffsetClocks minimum value of verticalSyncOffset.
* @field maxVerticalSyncOffsetClocks maximum value of verticalSyncOffset.
* @field minVerticalPulseWidthClocks minimum value of verticalPulseWidth.
* @field maxVerticalPulseWidthClocks maximum value of verticalPulseWidth.
* @field minHorizontalBorderLeft minimum value of horizontalBorderLeft.
* @field maxHorizontalBorderLeft maximum value of horizontalBorderLeft.
* @field minHorizontalBorderRight minimum value of horizontalBorderRight.
* @field maxHorizontalBorderRight maximum value of horizontalBorderRight.
* @field minVerticalBorderTop minimum value of verticalBorderTop.
* @field maxVerticalBorderTop maximum value of verticalBorderTop.
* @field minVerticalBorderBottom minimum value of verticalBorderBottom.
* @field maxVerticalBorderBottom maximum value of verticalBorderBottom.
* @field maxNumLinks number of links supported, if zero, 1 link is assumed.
* @field minLink0PixelClock minimum pixel clock for link 0 (kHz).
* @field maxLink0PixelClock maximum pixel clock for link 0 (kHz).
* @field minLink1PixelClock minimum pixel clock for link 1 (kHz).
* @field maxLink1PixelClock maximum pixel clock for link 1 (kHz).
* @field supportedPixelEncoding 2017 Timing Features - ERS 2-58 (6.3.1)
* @field supportedBitsPerColorComponent 2017 Timing Features - ERS 2-58 (6.3.1)
* @field supportedColorimetry 2017 Timing Features - ERS 2-58 (6.3.1)
* @field supportedDynamicRange 2017 Timing Features - ERS 2-58 (6.3.1)
* @field __reservedF Set to zero.
*/
struct IODisplayTimingRangeV1
{
UInt32 __reservedA[2]; // Init to 0
UInt32 version; // Init to 0
UInt32 __reservedB[5]; // Init to 0
UInt64 minPixelClock; // Min dot clock in Hz
UInt64 maxPixelClock; // Max dot clock in Hz
UInt32 maxPixelError; // Max dot clock error
UInt32 supportedSyncFlags;
UInt32 supportedSignalLevels;
UInt32 supportedSignalConfigs;
UInt32 minFrameRate; // Hz
UInt32 maxFrameRate; // Hz
UInt32 minLineRate; // Hz
UInt32 maxLineRate; // Hz
UInt32 maxHorizontalTotal; // Clocks - Maximum total (active + blanking)
UInt32 maxVerticalTotal; // Clocks - Maximum total (active + blanking)
UInt32 __reservedD[2]; // Init to 0
UInt8 charSizeHorizontalActive;
UInt8 charSizeHorizontalBlanking;
UInt8 charSizeHorizontalSyncOffset;
UInt8 charSizeHorizontalSyncPulse;
UInt8 charSizeVerticalActive;
UInt8 charSizeVerticalBlanking;
UInt8 charSizeVerticalSyncOffset;
UInt8 charSizeVerticalSyncPulse;
UInt8 charSizeHorizontalBorderLeft;
UInt8 charSizeHorizontalBorderRight;
UInt8 charSizeVerticalBorderTop;
UInt8 charSizeVerticalBorderBottom;
UInt8 charSizeHorizontalTotal; // Character size for active + blanking
UInt8 charSizeVerticalTotal; // Character size for active + blanking
UInt16 __reservedE; // Reserved (Init to 0)
UInt32 minHorizontalActiveClocks;
UInt32 maxHorizontalActiveClocks;
UInt32 minHorizontalBlankingClocks;
UInt32 maxHorizontalBlankingClocks;
UInt32 minHorizontalSyncOffsetClocks;
UInt32 maxHorizontalSyncOffsetClocks;
UInt32 minHorizontalPulseWidthClocks;
UInt32 maxHorizontalPulseWidthClocks;
UInt32 minVerticalActiveClocks;
UInt32 maxVerticalActiveClocks;
UInt32 minVerticalBlankingClocks;
UInt32 maxVerticalBlankingClocks;
UInt32 minVerticalSyncOffsetClocks;
UInt32 maxVerticalSyncOffsetClocks;
UInt32 minVerticalPulseWidthClocks;
UInt32 maxVerticalPulseWidthClocks;
UInt32 minHorizontalBorderLeft;
UInt32 maxHorizontalBorderLeft;
UInt32 minHorizontalBorderRight;
UInt32 maxHorizontalBorderRight;
UInt32 minVerticalBorderTop;
UInt32 maxVerticalBorderTop;
UInt32 minVerticalBorderBottom;
UInt32 maxVerticalBorderBottom;
UInt32 maxNumLinks; // number of links, if zero, assume link 1
UInt32 minLink0PixelClock; // min pixel clock for link 0 (kHz)
UInt32 maxLink0PixelClock; // max pixel clock for link 0 (kHz)
UInt32 minLink1PixelClock; // min pixel clock for link 1 (kHz)
UInt32 maxLink1PixelClock; // max pixel clock for link 1 (kHz)
UInt16 supportedPixelEncoding;
UInt16 supportedBitsPerColorComponent;
UInt16 supportedColorimetryModes;
UInt16 supportedDynamicRangeModes;
UInt32 __reservedF[1]; // Init to 0
};
typedef struct IODisplayTimingRangeV1 IODisplayTimingRangeV1;
/*!
* @struct IODisplayTimingRangeV2
* @abstract A structure defining the limits and attributes of DSC capabilities in a framebuffer.
* @discussion This structure is used to define the limits for DSC enabled modes programmed as detailed timings by the OS. The VESA DSC spec is useful background information for many of these fields.
* @field maxBandwidth Maximum permitted bandwidth of the given topology in bits per second.
* @field dscMinSliceHeight Minimum slice Height, in units of line.
* @field dscMaxSliceHeight Maximum slice Height, in units of line.
* @field dscMinSliceWidth Minimum slice width, in units of line.
* @field dscMaxSliceWidth Maximum slice width, in units of line.
* @field dscMinSlicePerLine Minimum slice per Line.
* @field dscMaxSlicePerLine Maximum slice per Line.
* @field dscMinBPC Minimum Bits per component, in units of bits.
* @field dscMaxBPC Maximum Bits per component, in units of bits.
* @field dscMinBPP Minimum target bits/pixel, in bpp.
* @field dscMaxBPP Maximum target bits/pixel, in bpp.
* @field dscVBR VBR mode, 0:disabled 1:enabled.
* @field dscBlockPredEnable DSC BP is user or not, 0: not used, 1: used.
* @field __reservedF Set to zero.
*/
struct IODisplayTimingRangeV2
{
UInt32 __reservedA[2]; // Init to 0
UInt32 version; // Init to 0
UInt32 __reservedB[5]; // Init to 0
UInt64 minPixelClock; // Min dot clock in Hz
UInt64 maxPixelClock; // Max dot clock in Hz
UInt32 maxPixelError; // Max dot clock error
UInt32 supportedSyncFlags;
UInt32 supportedSignalLevels;
UInt32 supportedSignalConfigs;
UInt32 minFrameRate; // Hz
UInt32 maxFrameRate; // Hz
UInt32 minLineRate; // Hz
UInt32 maxLineRate; // Hz
UInt32 maxHorizontalTotal; // Clocks - Maximum total (active + blanking)
UInt32 maxVerticalTotal; // Clocks - Maximum total (active + blanking)
UInt32 __reservedD[2]; // Init to 0
UInt8 charSizeHorizontalActive;
UInt8 charSizeHorizontalBlanking;
UInt8 charSizeHorizontalSyncOffset;
UInt8 charSizeHorizontalSyncPulse;
UInt8 charSizeVerticalActive;
UInt8 charSizeVerticalBlanking;
UInt8 charSizeVerticalSyncOffset;
UInt8 charSizeVerticalSyncPulse;
UInt8 charSizeHorizontalBorderLeft;
UInt8 charSizeHorizontalBorderRight;
UInt8 charSizeVerticalBorderTop;
UInt8 charSizeVerticalBorderBottom;
UInt8 charSizeHorizontalTotal; // Character size for active + blanking
UInt8 charSizeVerticalTotal; // Character size for active + blanking
UInt16 __reservedE; // Reserved (Init to 0)
UInt32 minHorizontalActiveClocks;
UInt32 maxHorizontalActiveClocks;
UInt32 minHorizontalBlankingClocks;
UInt32 maxHorizontalBlankingClocks;
UInt32 minHorizontalSyncOffsetClocks;
UInt32 maxHorizontalSyncOffsetClocks;
UInt32 minHorizontalPulseWidthClocks;
UInt32 maxHorizontalPulseWidthClocks;
UInt32 minVerticalActiveClocks;
UInt32 maxVerticalActiveClocks;
UInt32 minVerticalBlankingClocks;
UInt32 maxVerticalBlankingClocks;
UInt32 minVerticalSyncOffsetClocks;
UInt32 maxVerticalSyncOffsetClocks;
UInt32 minVerticalPulseWidthClocks;
UInt32 maxVerticalPulseWidthClocks;
UInt32 minHorizontalBorderLeft;
UInt32 maxHorizontalBorderLeft;
UInt32 minHorizontalBorderRight;
UInt32 maxHorizontalBorderRight;
UInt32 minVerticalBorderTop;
UInt32 maxVerticalBorderTop;
UInt32 minVerticalBorderBottom;
UInt32 maxVerticalBorderBottom;
UInt32 maxNumLinks; // number of links, if zero, assume link 1
UInt32 minLink0PixelClock; // min pixel clock for link 0 (kHz)
UInt32 maxLink0PixelClock; // max pixel clock for link 0 (kHz)
UInt32 minLink1PixelClock; // min pixel clock for link 1 (kHz)
UInt32 maxLink1PixelClock; // max pixel clock for link 1 (kHz)
UInt16 supportedPixelEncoding;
UInt16 supportedBitsPerColorComponent;
UInt16 supportedColorimetryModes;
UInt16 supportedDynamicRangeModes;
UInt32 __reservedF[1]; // Init to 0
UInt64 maxBandwidth;
UInt32 dscMinSliceHeight;
UInt32 dscMaxSliceHeight;
UInt32 dscMinSliceWidth;
UInt32 dscMaxSliceWidth;
UInt32 dscMinSlicePerLine;
UInt32 dscMaxSlicePerLine;
UInt16 dscMinBPC;
UInt16 dscMaxBPC;
UInt16 dscMinBPP;
UInt16 dscMaxBPP;
UInt8 dscVBR;
UInt8 dscBlockPredEnable;
UInt32 __reservedC[6];
};
typedef struct IODisplayTimingRangeV2 IODisplayTimingRangeV2;
typedef struct IODisplayTimingRangeV2 IODisplayTimingRange;
enum {
// IOTimingRange version
kIOTimingRangeV2 = 0x00000002,
kIOTimingRangeV1 = 0x00000000
};
enum {
// supportedPixelEncoding
kIORangePixelEncodingNotSupported = 0x0000,
kIORangePixelEncodingRGB444 = 0x0001,
kIORangePixelEncodingYCbCr444 = 0x0002,
kIORangePixelEncodingYCbCr422 = 0x0004,
kIORangePixelEncodingYCbCr420 = 0x0008,
};
enum {
// supportedBitsPerColorComponent
kIORangeBitsPerColorComponentNotSupported = 0x0000,
kIORangeBitsPerColorComponent6 = 0x0001,
kIORangeBitsPerColorComponent8 = 0x0002,
kIORangeBitsPerColorComponent10 = 0x0004,
kIORangeBitsPerColorComponent12 = 0x0008,
kIORangeBitsPerColorComponent16 = 0x0010,
};
enum {
// supportedColorimetry
kIORangeColorimetryNotSupported = 0x0000,
kIORangeColorimetryNativeRGB = 0x0001,
kIORangeColorimetrysRGB = 0x0002,
kIORangeColorimetryDCIP3 = 0x0004,
kIORangeColorimetryAdobeRGB = 0x0008,
kIORangeColorimetryxvYCC = 0x0010,
kIORangeColorimetryWGRGB = 0x0020,
kIORangeColorimetryBT601 = 0x0040,
kIORangeColorimetryBT709 = 0x0080,
kIORangeColorimetryBT2020 = 0x0100,
kIORangeColorimetryBT2100 = 0x0200,
};
enum {
// supportedDynamicRangeModes - should be in sync with "dynamicRange" enum above
kIORangeDynamicRangeNotSupported = 0x0000,
kIORangeDynamicRangeSDR = 0x0001,
kIORangeDynamicRangeHDR10 = 0x0002,
kIORangeDynamicRangeDolbyNormalMode = 0x0004,
kIORangeDynamicRangeDolbyTunnelMode = 0x0008,
kIORangeDynamicRangeTraditionalGammaHDR = 0x0010,
kIORangeDynamicRangeTraditionalGammaSDR = 0x0020, // as of IOGRAPHICSTYPES_REV 72
};
enum {
// supportedSignalLevels
kIORangeSupportsSignal_0700_0300 = 0x00000001,
kIORangeSupportsSignal_0714_0286 = 0x00000002,
kIORangeSupportsSignal_1000_0400 = 0x00000004,
kIORangeSupportsSignal_0700_0000 = 0x00000008
};
enum {
// supportedSyncFlags
kIORangeSupportsSeparateSyncs = 0x00000001,
kIORangeSupportsSyncOnGreen = 0x00000002,
kIORangeSupportsCompositeSync = 0x00000004,
kIORangeSupportsVSyncSerration = 0x00000008,
kIORangeSupportsVRR = 0x00000010 // since IOGRAPHICSTYPES_REV 76
};
enum {
// supportedSignalConfigs
kIORangeSupportsInterlacedCEATiming = 0x00000004,
kIORangeSupportsInterlacedCEATimingWithConfirm = 0x00000008,
kIORangeSupportsMultiAlignedTiming = 0x00000040 // since IOGRAPHICSTYPES_REV 75
};
enum {
// signalConfig
kIODigitalSignal = 0x00000001,
kIOAnalogSetupExpected = 0x00000002,
kIOInterlacedCEATiming = 0x00000004,
kIONTSCTiming = 0x00000008,
kIOPALTiming = 0x00000010,
kIODSCBlockPredEnable = 0x00000020,
kIOMultiAlignedTiming = 0x00000040, // since IOGRAPHICSTYPES_REV 73
};
enum {
// signalLevels for analog
kIOAnalogSignalLevel_0700_0300 = 0,
kIOAnalogSignalLevel_0714_0286 = 1,
kIOAnalogSignalLevel_1000_0400 = 2,
kIOAnalogSignalLevel_0700_0000 = 3
};
enum {
// horizontalSyncConfig and verticalSyncConfig
kIOSyncPositivePolarity = 0x00000001
};
/*!
* @struct IODisplayScalerInformation
* @abstract A structure defining the scaling capabilities of a framebuffer.
* @discussion This structure is used to define the limits for modes programmed as detailed timings by the OS. A data property with this structure under the key kIOFBScalerInfoKey in a framebuffer will allow the OS to program detailed timings that are scaled to a displays native resolution.
* @field __reservedA Set to zero.
* @field version Set to zero.
* @field __reservedB Set to zero.
* @field scalerFeatures Mask of scaling features. The following are defined:<br>
* kIOScaleStretchOnly If set the framebuffer can only provide stretched scaling with non-square pixels, without borders.<br>
* kIOScaleCanUpSamplePixels If set framebuffer can scale up from a smaller number of source pixels to a larger native timing (eg. 640x480 pixels on a 1600x1200 timing).<br>
* kIOScaleCanDownSamplePixels If set framebuffer can scale down from a larger number of source pixels to a smaller native timing (eg. 1600x1200 pixels on a 640x480 timing).<br>
* kIOScaleCanScaleInterlaced If set framebuffer can scale an interlaced detailed timing.<br>
* kIOScaleCanSupportInset If set framebuffer can support scaled modes with non-zero horizontalScaledInset, verticalScaledInset fields.<br>
* kIOScaleCanRotate If set framebuffer can support some of the flags in the kIOScaleRotateFlags mask.<br>
* kIOScaleCanBorderInsetOnly If set framebuffer can support scaled modes with non-zero horizontalScaledInset, verticalScaledInset fields, but requires the active pixels to be equal in size to the inset area, ie. can do insets with a border versus scaling an image.<br>
* @field maxHorizontalPixels Maximum number of horizontal source pixels (horizontalScaled).<br>
* @field maxVerticalPixels Maximum number of vertical source pixels (verticalScaled).<br>
* @field __reservedC Set to zero.
*/
struct IODisplayScalerInformation {
UInt32 __reservedA[1]; // Init to 0
UInt32 version; // Init to 0
UInt32 __reservedB[2]; // Init to 0
IOOptionBits scalerFeatures;
UInt32 maxHorizontalPixels;
UInt32 maxVerticalPixels;
UInt32 __reservedC[5]; // Init to 0
};
typedef struct IODisplayScalerInformation IODisplayScalerInformation;
enum {
/* scalerFeatures */
kIOScaleStretchOnly = 0x00000001,
kIOScaleCanUpSamplePixels = 0x00000002,
kIOScaleCanDownSamplePixels = 0x00000004,
kIOScaleCanScaleInterlaced = 0x00000008,
kIOScaleCanSupportInset = 0x00000010,
kIOScaleCanRotate = 0x00000020,
kIOScaleCanBorderInsetOnly = 0x00000040
};
//// Connections
enum {
kOrConnections = 0xffffffe,
kAndConnections = 0xffffffd
};
enum {
kConnectionFlags = 'flgs',
kConnectionSyncEnable = 'sync',
kConnectionSyncFlags = 'sycf',
kConnectionSupportsAppleSense = 'asns',
kConnectionSupportsLLDDCSense = 'lddc',
kConnectionSupportsHLDDCSense = 'hddc',
kConnectionEnable = 'enab',
kConnectionCheckEnable = 'cena',
kConnectionProbe = 'prob',
kConnectionIgnore = '\0igr',
kConnectionChanged = 'chng',
kConnectionPower = 'powr',
kConnectionPostWake = 'pwak',
kConnectionDisplayParameterCount = 'pcnt',
kConnectionDisplayParameters = 'parm',
kConnectionOverscan = 'oscn',
kConnectionVideoBest = 'vbst',
kConnectionRedGammaScale = 'rgsc',
kConnectionGreenGammaScale = 'ggsc',
kConnectionBlueGammaScale = 'bgsc',
kConnectionGammaScale = 'gsc ',
kConnectionFlushParameters = 'flus',
kConnectionVBLMultiplier = 'vblm',
kConnectionHandleDisplayPortEvent = 'dpir',
kConnectionPanelTimingDisable = 'pnlt',
kConnectionColorMode = 'cyuv',
kConnectionColorModesSupported = 'colr',
kConnectionColorDepthsSupported = ' bpc',
kConnectionControllerDepthsSupported = '\0grd',
kConnectionControllerColorDepth = '\0dpd',
kConnectionControllerDitherControl = '\0gdc',
kConnectionDisplayFlags = 'dflg',
kConnectionEnableAudio = 'aud ',
kConnectionAudioStreaming = 'auds',
kConnectionStartOfFrameTime = 'soft', // as of IOGRAPHICSTYPES_REV 65
};
// kConnectionFlags values
enum {
kIOConnectionBuiltIn = 0x00000800,
kIOConnectionStereoSync = 0x00008000
};
// kConnectionSyncControl values
enum {
kIOHSyncDisable = 0x00000001,
kIOVSyncDisable = 0x00000002,
kIOCSyncDisable = 0x00000004,
kIONoSeparateSyncControl = 0x00000040,
kIOTriStateSyncs = 0x00000080,
kIOSyncOnBlue = 0x00000008,
kIOSyncOnGreen = 0x00000010,
kIOSyncOnRed = 0x00000020
};
// kConnectionHandleDisplayPortEvent values
enum {
kIODPEventStart = 1,
kIODPEventIdle = 2,
kIODPEventForceRetrain = 3,
kIODPEventRemoteControlCommandPending = 256,
kIODPEventAutomatedTestRequest = 257,
kIODPEventContentProtection = 258,
kIODPEventMCCS = 259,
kIODPEventSinkSpecific = 260
};
#define kIODisplayAttributesKey "IODisplayAttributes"
#define kIODisplaySupportsUnderscanKey "IODisplaySupportsUnderscan"
#define kIODisplaySupportsBasicAudioKey "IODisplaySupportsBasicAudio"
#define kIODisplaySupportsYCbCr444Key "IODisplaySupportsYCbCr444"
#define kIODisplaySupportsYCbCr422Key "IODisplaySupportsYCbCr422"
#define kIODisplaySelectedColorModeKey "cmod"
enum
{
kIODisplayColorMode = kConnectionColorMode,
};
#if 0
enum
{
// kConnectionColorMode attribute
kIODisplayColorModeReserved = 0x00000000,
kIODisplayColorModeRGB = 0x00000001,
kIODisplayColorModeYCbCr422 = 0x00000010,
kIODisplayColorModeYCbCr444 = 0x00000100,
kIODisplayColorModeRGBLimited = 0x00001000,
kIODisplayColorModeAuto = 0x10000000,
};
#endif
enum
{
// kConnectionColorDepthsSupported attribute
kIODisplayRGBColorComponentBitsUnknown = 0x00000000,
kIODisplayRGBColorComponentBits6 = 0x00000001,
kIODisplayRGBColorComponentBits8 = 0x00000002,
kIODisplayRGBColorComponentBits10 = 0x00000004,
kIODisplayRGBColorComponentBits12 = 0x00000008,
kIODisplayRGBColorComponentBits14 = 0x00000010,
kIODisplayRGBColorComponentBits16 = 0x00000020,
kIODisplayYCbCr444ColorComponentBitsUnknown = 0x00000000,
kIODisplayYCbCr444ColorComponentBits6 = 0x00000100,
kIODisplayYCbCr444ColorComponentBits8 = 0x00000200,
kIODisplayYCbCr444ColorComponentBits10 = 0x00000400,
kIODisplayYCbCr444ColorComponentBits12 = 0x00000800,
kIODisplayYCbCr444ColorComponentBits14 = 0x00001000,
kIODisplayYCbCr444ColorComponentBits16 = 0x00002000,
kIODisplayYCbCr422ColorComponentBitsUnknown = 0x00000000,
kIODisplayYCbCr422ColorComponentBits6 = 0x00010000,
kIODisplayYCbCr422ColorComponentBits8 = 0x00020000,
kIODisplayYCbCr422ColorComponentBits10 = 0x00040000,
kIODisplayYCbCr422ColorComponentBits12 = 0x00080000,
kIODisplayYCbCr422ColorComponentBits14 = 0x00100000,
kIODisplayYCbCr422ColorComponentBits16 = 0x00200000,
};
enum
{
// kConnectionDitherControl attribute
kIODisplayDitherDisable = 0x00000000,
kIODisplayDitherSpatial = 0x00000001,
kIODisplayDitherTemporal = 0x00000002,
kIODisplayDitherFrameRateControl = 0x00000004,
kIODisplayDitherDefault = 0x00000080,
kIODisplayDitherAll = 0x000000FF,
kIODisplayDitherRGBShift = 0,
kIODisplayDitherYCbCr444Shift = 8,
kIODisplayDitherYCbCr422Shift = 16,
};
enum
{
// kConnectionDisplayFlags attribute
kIODisplayNeedsCEAUnderscan = 0x00000001,
};
enum
{
kIODisplayPowerStateOff = 0,
kIODisplayPowerStateMinUsable = 1,
kIODisplayPowerStateOn = 2,
};
#define IO_DISPLAY_CAN_FILL 0x00000040
#define IO_DISPLAY_CAN_BLIT 0x00000020
#define IO_24BPP_TRANSFER_TABLE_SIZE 256
#define IO_15BPP_TRANSFER_TABLE_SIZE 256
#define IO_8BPP_TRANSFER_TABLE_SIZE 256
#define IO_12BPP_TRANSFER_TABLE_SIZE 256
#define IO_2BPP_TRANSFER_TABLE_SIZE 256
#define STDFB_BM256_TO_BM38_MAP_SIZE 256
#define STDFB_BM38_TO_BM256_MAP_SIZE 256
#define STDFB_BM38_TO_256_WITH_LOGICAL_SIZE \
(STDFB_BM38_TO_BM256_MAP_SIZE + (256/sizeof(int)))
#define STDFB_4BPS_TO_5BPS_MAP_SIZE 16
#define STDFB_5BPS_TO_4BPS_MAP_SIZE 32
enum {
// connection types for IOServiceOpen
kIOFBServerConnectType = 0,
kIOFBSharedConnectType = 1,
kIOGDiagnoseGTraceType = 11452, // On Display Wrangler
kIOGDiagnoseConnectType = 38744,
#ifndef _OPEN_SOURCE_
kIODisplayAssertionConnectType = 61074,
#endif // !_OPEN_SOURCE_
};
enum {
// options for IOServiceRequestProbe()
kIOFBUserRequestProbe = 0x00000001
};
struct IOGPoint {
SInt16 x;
SInt16 y;
};
typedef struct IOGPoint IOGPoint;
struct IOGSize {
SInt16 width;
SInt16 height;
};
typedef struct IOGSize IOGSize;
struct IOGBounds {
SInt16 minx;
SInt16 maxx;
SInt16 miny;
SInt16 maxy;
};
typedef struct IOGBounds IOGBounds;
#ifndef kIODescriptionKey
#if !defined(__Point__) && !defined(BINTREE_H) && !defined(__MACTYPES__)
#define __Point__
typedef IOGPoint Point;
#endif
#if !defined(__Bounds__) && !defined(BINTREE_H) && !defined(__MACTYPES__)
#define __Bounds__
typedef IOGBounds Bounds;
#endif
#endif /* !kIODescriptionKey */
// cursor description
enum {
kTransparentEncoding = 0,
kInvertingEncoding
};
enum {
kTransparentEncodingShift = (kTransparentEncoding << 1),
kTransparentEncodedPixel = (0x01 << kTransparentEncodingShift),
kInvertingEncodingShift = (kInvertingEncoding << 1),
kInvertingEncodedPixel = (0x01 << kInvertingEncodingShift)
};
enum {
kHardwareCursorDescriptorMajorVersion = 0x0001,
kHardwareCursorDescriptorMinorVersion = 0x0000
};
/*!
* @struct IOHardwareCursorDescriptor
* @abstract A structure defining the format of a hardware cursor.
* @discussion This structure is used by IOFramebuffer to define the format of a hardware cursor.
* @field majorVersion Set to kHardwareCursorDescriptorMajorVersion.
* @field minorVersion Set to kHardwareCursorDescriptorMinorVersion.
* @field height Maximum size of the cursor.
* @field width Maximum size of the cursor.
* @field bitDepth Number bits per pixel, or a QD/QT pixel type, for example kIO8IndexedPixelFormat, kIO32ARGBPixelFormat.
* @field maskBitDepth Unused.
* @field numColors Number of colors for indexed pixel types.
* @field colorEncodings An array pointer specifying the pixel values corresponding to the indices into the color table, for indexed pixel types.
* @field flags None defined, set to zero.
* @field supportedSpecialEncodings Mask of supported special pixel values, eg. kTransparentEncodedPixel, kInvertingEncodedPixel.
* @field specialEncodings Array of pixel values for each supported special encoding.
*/
struct IOHardwareCursorDescriptor {
UInt16 majorVersion;
UInt16 minorVersion;
UInt32 height;
UInt32 width;
UInt32 bitDepth; // bits per pixel, or a QD/QT pixel type
UInt32 maskBitDepth; // unused
UInt32 numColors; // number of colors in the colorMap. ie.
UInt32 * colorEncodings;
UInt32 flags;
UInt32 supportedSpecialEncodings;
UInt32 specialEncodings[16];
};
typedef struct IOHardwareCursorDescriptor IOHardwareCursorDescriptor;
enum {
kHardwareCursorInfoMajorVersion = 0x0001,
kHardwareCursorInfoMinorVersion = 0x0000
};
/*!
* @struct IOHardwareCursorInfo
* @abstract A structure defining the converted data of a hardware cursor.
* @discussion This structure is used by IOFramebuffer to return the data of a hardware cursor by convertCursorImage() after conversion based on the IOHardwareCursorDescriptor passed to that routine.
* @field majorVersion Set to kHardwareCursorInfoMajorVersion.
* @field minorVersion Set to kHardwareCursorInfoMinorVersion.
* @field cursorHeight The actual size of the cursor is returned.
* @field cursorWidth The actual size of the cursor is returned.
* @field colorMap Pointer to array of IOColorEntry structures, with the number of elements set by the numColors field of the IOHardwareCursorDescriptor. Zero should be passed for direct pixel formats.
* @field hardwareCursorData Buffer to receive the converted cursor data.
* @field cursorHotSpotX Cursor's hotspot.
* @field cursorHotSpotY Cursor's hotspot.
* @field reserved Reserved, set to zero.
*/
struct IOHardwareCursorInfo {
UInt16 majorVersion;
UInt16 minorVersion;
UInt32 cursorHeight;
UInt32 cursorWidth;
// nil or big enough for hardware's max colors
IOColorEntry * colorMap;
UInt8 * hardwareCursorData;
UInt16 cursorHotSpotX;
UInt16 cursorHotSpotY;
UInt32 reserved[5];
};
typedef struct IOHardwareCursorInfo IOHardwareCursorInfo;
// interrupt types
enum {
kIOFBVBLInterruptType = 'vbl ',
kIOFBHBLInterruptType = 'hbl ',
kIOFBFrameInterruptType = 'fram',
// Demand to check configuration (Hardware unchanged)
kIOFBConnectInterruptType = 'dci ',
// Demand to rebuild (Hardware has reinitialized on dependent change)
kIOFBChangedInterruptType = 'chng',
// Demand to remove framebuffer (Hardware not available on dependent change -- but must not buserror)
kIOFBOfflineInterruptType = 'remv',
// Notice that hardware is available (after being removed)
kIOFBOnlineInterruptType = 'add ',
// DisplayPort short pulse
kIOFBDisplayPortInterruptType = 'dpir',
// DisplayPort link event
kIOFBDisplayPortLinkChangeInterruptType = 'dplk',
// MCCS
kIOFBMCCSInterruptType = 'mccs',
// early vram notification
kIOFBWakeInterruptType = 'vwak',
};
// IOAppleTimingID's
enum {
kIOTimingIDInvalid = 0, /* Not a standard timing */
kIOTimingIDApple_FixedRateLCD = 42, /* Lump all fixed-rate LCDs into one category.*/
kIOTimingIDApple_512x384_60hz = 130, /* 512x384 (60 Hz) Rubik timing. */
kIOTimingIDApple_560x384_60hz = 135, /* 560x384 (60 Hz) Rubik-560 timing. */
kIOTimingIDApple_640x480_67hz = 140, /* 640x480 (67 Hz) HR timing. */
kIOTimingIDApple_640x400_67hz = 145, /* 640x400 (67 Hz) HR-400 timing. */
kIOTimingIDVESA_640x480_60hz = 150, /* 640x480 (60 Hz) VGA timing. */
kIOTimingIDVESA_640x480_72hz = 152, /* 640x480 (72 Hz) VGA timing. */
kIOTimingIDVESA_640x480_75hz = 154, /* 640x480 (75 Hz) VGA timing. */
kIOTimingIDVESA_640x480_85hz = 158, /* 640x480 (85 Hz) VGA timing. */
kIOTimingIDGTF_640x480_120hz = 159, /* 640x480 (120 Hz) VESA Generalized Timing Formula */
kIOTimingIDApple_640x870_75hz = 160, /* 640x870 (75 Hz) FPD timing.*/
kIOTimingIDApple_640x818_75hz = 165, /* 640x818 (75 Hz) FPD-818 timing.*/
kIOTimingIDApple_832x624_75hz = 170, /* 832x624 (75 Hz) GoldFish timing.*/
kIOTimingIDVESA_800x600_56hz = 180, /* 800x600 (56 Hz) SVGA timing. */
kIOTimingIDVESA_800x600_60hz = 182, /* 800x600 (60 Hz) SVGA timing. */
kIOTimingIDVESA_800x600_72hz = 184, /* 800x600 (72 Hz) SVGA timing. */
kIOTimingIDVESA_800x600_75hz = 186, /* 800x600 (75 Hz) SVGA timing. */
kIOTimingIDVESA_800x600_85hz = 188, /* 800x600 (85 Hz) SVGA timing. */
kIOTimingIDVESA_1024x768_60hz = 190, /* 1024x768 (60 Hz) VESA 1K-60Hz timing. */
kIOTimingIDVESA_1024x768_70hz = 200, /* 1024x768 (70 Hz) VESA 1K-70Hz timing. */
kIOTimingIDVESA_1024x768_75hz = 204, /* 1024x768 (75 Hz) VESA 1K-75Hz timing (very similar to kIOTimingIDApple_1024x768_75hz). */
kIOTimingIDVESA_1024x768_85hz = 208, /* 1024x768 (85 Hz) VESA timing. */
kIOTimingIDApple_1024x768_75hz = 210, /* 1024x768 (75 Hz) Apple 19" RGB. */
kIOTimingIDVESA_1152x864_75hz = 215, /* 1152x864 (75 Hz) VESA timing. */
kIOTimingIDApple_1152x870_75hz = 220, /* 1152x870 (75 Hz) Apple 21" RGB. */
kIOTimingIDAppleNTSC_ST = 230, /* 512x384 (60 Hz, interlaced, non-convolved). */
kIOTimingIDAppleNTSC_FF = 232, /* 640x480 (60 Hz, interlaced, non-convolved). */
kIOTimingIDAppleNTSC_STconv = 234, /* 512x384 (60 Hz, interlaced, convolved). */
kIOTimingIDAppleNTSC_FFconv = 236, /* 640x480 (60 Hz, interlaced, convolved). */
kIOTimingIDApplePAL_ST = 238, /* 640x480 (50 Hz, interlaced, non-convolved). */
kIOTimingIDApplePAL_FF = 240, /* 768x576 (50 Hz, interlaced, non-convolved). */
kIOTimingIDApplePAL_STconv = 242, /* 640x480 (50 Hz, interlaced, convolved). */
kIOTimingIDApplePAL_FFconv = 244, /* 768x576 (50 Hz, interlaced, convolved). */
kIOTimingIDVESA_1280x960_75hz = 250, /* 1280x960 (75 Hz) */
kIOTimingIDVESA_1280x960_60hz = 252, /* 1280x960 (60 Hz) */
kIOTimingIDVESA_1280x960_85hz = 254, /* 1280x960 (85 Hz) */
kIOTimingIDVESA_1280x1024_60hz = 260, /* 1280x1024 (60 Hz) */
kIOTimingIDVESA_1280x1024_75hz = 262, /* 1280x1024 (75 Hz) */
kIOTimingIDVESA_1280x1024_85hz = 268, /* 1280x1024 (85 Hz) */
kIOTimingIDVESA_1600x1200_60hz = 280, /* 1600x1200 (60 Hz) VESA timing. */
kIOTimingIDVESA_1600x1200_65hz = 282, /* 1600x1200 (65 Hz) VESA timing. */
kIOTimingIDVESA_1600x1200_70hz = 284, /* 1600x1200 (70 Hz) VESA timing. */
kIOTimingIDVESA_1600x1200_75hz = 286, /* 1600x1200 (75 Hz) VESA timing (pixel clock is 189.2 Mhz dot clock). */
kIOTimingIDVESA_1600x1200_80hz = 288, /* 1600x1200 (80 Hz) VESA timing (pixel clock is 216>? Mhz dot clock) - proposed only. */
kIOTimingIDVESA_1600x1200_85hz = 289, /* 1600x1200 (85 Hz) VESA timing (pixel clock is 229.5 Mhz dot clock). */
kIOTimingIDVESA_1792x1344_60hz = 296, /* 1792x1344 (60 Hz) VESA timing (204.75 Mhz dot clock). */
kIOTimingIDVESA_1792x1344_75hz = 298, /* 1792x1344 (75 Hz) VESA timing (261.75 Mhz dot clock). */
kIOTimingIDVESA_1856x1392_60hz = 300, /* 1856x1392 (60 Hz) VESA timing (218.25 Mhz dot clock). */
kIOTimingIDVESA_1856x1392_75hz = 302, /* 1856x1392 (75 Hz) VESA timing (288 Mhz dot clock). */
kIOTimingIDVESA_1920x1440_60hz = 304, /* 1920x1440 (60 Hz) VESA timing (234 Mhz dot clock). */
kIOTimingIDVESA_1920x1440_75hz = 306, /* 1920x1440 (75 Hz) VESA timing (297 Mhz dot clock). */
kIOTimingIDSMPTE240M_60hz = 400, /* 60Hz V, 33.75KHz H, interlaced timing, 16:9 aspect, typical resolution of 1920x1035. */
kIOTimingIDFilmRate_48hz = 410, /* 48Hz V, 25.20KHz H, non-interlaced timing, typical resolution of 640x480. */
kIOTimingIDSony_1600x1024_76hz = 500, /* 1600x1024 (76 Hz) Sony timing (pixel clock is 170.447 Mhz dot clock). */
kIOTimingIDSony_1920x1080_60hz = 510, /* 1920x1080 (60 Hz) Sony timing (pixel clock is 159.84 Mhz dot clock). */
kIOTimingIDSony_1920x1080_72hz = 520, /* 1920x1080 (72 Hz) Sony timing (pixel clock is 216.023 Mhz dot clock). */
kIOTimingIDSony_1920x1200_76hz = 540, /* 1900x1200 (76 Hz) Sony timing (pixel clock is 243.20 Mhz dot clock). */
kIOTimingIDApple_0x0_0hz_Offline = 550, /* Indicates that this timing will take the display off-line and remove it from the system. */
kIOTimingIDVESA_848x480_60hz = 570, /* 848x480 (60 Hz) VESA timing. */
kIOTimingIDVESA_1360x768_60hz = 590 /* 1360x768 (60 Hz) VESA timing. */
};
// framebuffer property keys
#define kIOFramebufferInfoKey "IOFramebufferInformation"
#define kIOFBWidthKey "IOFBWidth"
#define kIOFBHeightKey "IOFBHeight"
#define kIOFBRefreshRateKey "IOFBRefreshRate"
#define kIOFBFlagsKey "IOFBFlags"
#define kIOFBBytesPerRowKey "IOFBBytesPerRow"
#define kIOFBBytesPerPlaneKey "IOFBBytesPerPlane"
#define kIOFBBitsPerPixelKey "IOFBBitsPerPixel"
#define kIOFBComponentCountKey "IOFBComponentCount"
#define kIOFBBitsPerComponentKey "IOFBBitsPerComponent"
#define kIOFBDetailedTimingsKey "IOFBDetailedTimings"
#define kIOFBTimingRangeKey "IOFBTimingRange"
#define kIOFBScalerInfoKey "IOFBScalerInfo"
#define kIOFBCursorInfoKey "IOFBCursorInfo"
#define kIOFBHDMIDongleROMKey "IOFBHDMIDongleROM"
#define kIOFBHostAccessFlagsKey "IOFBHostAccessFlags"
#define kIOFBMemorySizeKey "IOFBMemorySize"
#define kIOFBNeedsRefreshKey "IOFBNeedsRefresh"
#define kIOFBProbeOptionsKey "IOFBProbeOptions"
#define kIOFBGammaWidthKey "IOFBGammaWidth"
#define kIOFBGammaCountKey "IOFBGammaCount"
#define kIOFBCLUTDeferKey "IOFBCLUTDefer"
#define kIOFBDisplayPortConfigurationDataKey "dpcd-registers"
// exists on the hibernate progress display device
#ifndef kIOHibernatePreviewActiveKey
#define kIOHibernatePreviewActiveKey "IOHibernatePreviewActive"
// values for kIOHibernatePreviewActiveKey set by driver
enum {
kIOHibernatePreviewActive = 0x00000001,
kIOHibernatePreviewUpdates = 0x00000002
};
#endif
#define kIOHibernateEFIGfxStatusKey "IOHibernateEFIGfxStatus"
// CFNumber/CFData
#define kIOFBAVSignalTypeKey "av-signal-type"
enum {
kIOFBAVSignalTypeUnknown = 0x00000000,
kIOFBAVSignalTypeVGA = 0x00000001,
kIOFBAVSignalTypeDVI = 0x00000002,
kIOFBAVSignalTypeHDMI = 0x00000008,
kIOFBAVSignalTypeDP = 0x00000010,
};
// kIOFBDisplayPortTrainingAttribute data
struct IOFBDPLinkConfig
{
uint16_t version; // 8 bit high (major); 8 bit low (minor)
uint8_t bitRate; // same encoding as the spec
uint8_t __reservedA[1]; // reserved set to zero
uint16_t t1Time; // minimum duration of the t1 pattern (microseconds)
uint16_t t2Time; // minimum duration of the t2 pattern
uint16_t t3Time; // minimum duration of the t3 pattern
uint8_t idlePatterns; // minimum number of idle patterns
uint8_t laneCount; // number of lanes in the link
uint8_t voltage;
uint8_t preEmphasis;
uint8_t downspread;
uint8_t scrambler;
uint8_t maxBitRate; // same encoding as the bitRate field
uint8_t maxLaneCount; // an integer
uint8_t maxDownspread; // 0 = Off. 1 = 0.5
uint8_t __reservedB[9]; // reserved set to zero - fix align and provide 8 bytes of padding.
};
typedef struct IOFBDPLinkConfig IOFBDPLinkConfig;
enum
{
kIOFBBitRateRBR = 0x06, // 1.62 Gbps per lane
kIOFBBitRateHBR = 0x0A, // 2.70 Gbps per lane
kIOFBBitRateHBR2 = 0x14, // 5.40 Gbps per lane
};
enum {
kIOFBLinkVoltageLevel0 = 0x00,
kIOFBLinkVoltageLevel1 = 0x01,
kIOFBLinkVoltageLevel2 = 0x02,
kIOFBLinkVoltageLevel3 = 0x03
};
enum
{
kIOFBLinkPreEmphasisLevel0 = 0x00,
kIOFBLinkPreEmphasisLevel1 = 0x01,
kIOFBLinkPreEmphasisLevel2 = 0x02,
kIOFBLinkPreEmphasisLevel3 = 0x03
};
enum
{
kIOFBLinkDownspreadNone = 0x0,
kIOFBLinkDownspreadMax = 0x1
};
enum
{
kIOFBLinkScramblerNormal = 0x0, // for external displays
kIOFBLinkScramblerAlternate = 0x1 // used for eDP
};
// diagnostic keys
#define kIOFBConfigKey "IOFBConfig"
#define kIOFBModesKey "IOFBModes"
#define kIOFBModeIDKey "ID"
#define kIOFBModeDMKey "DM"
#define kIOFBModeTMKey "TM"
#define kIOFBModeAIDKey "AID"
#define kIOFBModeDFKey "DF"
#define kIOFBModePIKey "PI"
// display property keys
#define kIODisplayEDIDKey "IODisplayEDID"
#define kIODisplayEDIDOriginalKey "IODisplayEDIDOriginal"
#define kIODisplayLocationKey "IODisplayLocation" // CFString
#define kIODisplayConnectFlagsKey "IODisplayConnectFlags" // CFNumber
#define kIODisplayHasBacklightKey "IODisplayHasBacklight" // CFBoolean
#define kIODisplayIsDigitalKey "IODisplayIsDigital" // CFBoolean
#define kDisplayBundleKey "DisplayBundle"
#define kAppleDisplayTypeKey "AppleDisplayType"
#define kAppleSenseKey "AppleSense"
#define kIODisplayMCCSVersionKey "IODisplayMCCSVersion"
#define kIODisplayTechnologyTypeKey "IODisplayTechnologyType"
#define kIODisplayUsageTimeKey "IODisplayUsageTime"
#define kIODisplayFirmwareLevelKey "IODisplayFirmwareLevel"
enum {
kDisplayVendorIDUnknown = 'unkn',
kDisplayProductIDGeneric = 0x717
};
#define kDisplayVendorID "DisplayVendorID" // CFNumber
#define kDisplayProductID "DisplayProductID" // CFNumber
#define kDisplaySerialNumber "DisplaySerialNumber" // CFNumber
#define kDisplaySerialString "DisplaySerialString" // CFString
#define kDisplayWeekOfManufacture "DisplayWeekManufacture" // CFNumber
#define kDisplayYearOfManufacture "DisplayYearManufacture" // CFNumber
// CFDictionary of language-locale keys, name values
// eg. "en"="Color LCD", "en-GB"="Colour LCD"
#define kDisplayProductName "DisplayProductName"
// all CFNumber or CFArray of CFNumber (floats)
#define kDisplayWhitePointX "DisplayWhitePointX"
#define kDisplayWhitePointY "DisplayWhitePointY"
#define kDisplayRedPointX "DisplayRedPointX"
#define kDisplayRedPointY "DisplayRedPointY"
#define kDisplayGreenPointX "DisplayGreenPointX"
#define kDisplayGreenPointY "DisplayGreenPointY"
#define kDisplayBluePointX "DisplayBluePointX"
#define kDisplayBluePointY "DisplayBluePointY"
#define kDisplayWhiteGamma "DisplayWhiteGamma"
#define kDisplayRedGamma "DisplayRedGamma"
#define kDisplayGreenGamma "DisplayGreenGamma"
#define kDisplayBlueGamma "DisplayBlueGamma"
// Display gamma
#define kDisplayGammaChannels "DisplayGammaChannels" // CFNumber 1 or 3 channel count
#define kDisplayGammaEntryCount "DisplayGammaEntryCount" // CFNumber 1-based count of entries per channel
#define kDisplayGammaEntrySize "DisplayGammaEntrySize" // CFNumber size in bytes of each table entry
#define kDisplayGammaTable "DisplayGammaTable" // CFData
// CFBoolean
#define kDisplayBrightnessAffectsGamma "DisplayBrightnessAffectsGamma"
#define kDisplayViewAngleAffectsGamma "DisplayViewAngleAffectsGamma"
// CFData
#define kDisplayCSProfile "DisplayCSProfile"
// CFNumber
#define kDisplayHorizontalImageSize "DisplayHorizontalImageSize"
#define kDisplayVerticalImageSize "DisplayVerticalImageSize"
// Pixel description
// CFBoolean
#define kDisplayFixedPixelFormat "DisplayFixedPixelFormat"
enum {
kDisplaySubPixelLayoutUndefined = 0x00000000,
kDisplaySubPixelLayoutRGB = 0x00000001,
kDisplaySubPixelLayoutBGR = 0x00000002,
kDisplaySubPixelLayoutQuadGBL = 0x00000003,
kDisplaySubPixelLayoutQuadGBR = 0x00000004,
kDisplaySubPixelConfigurationUndefined = 0x00000000,
kDisplaySubPixelConfigurationDelta = 0x00000001,
kDisplaySubPixelConfigurationStripe = 0x00000002,
kDisplaySubPixelConfigurationStripeOffset = 0x00000003,
kDisplaySubPixelConfigurationQuad = 0x00000004,
kDisplaySubPixelShapeUndefined = 0x00000000,
kDisplaySubPixelShapeRound = 0x00000001,
kDisplaySubPixelShapeSquare = 0x00000002,
kDisplaySubPixelShapeRectangular = 0x00000003,
kDisplaySubPixelShapeOval = 0x00000004,
kDisplaySubPixelShapeElliptical = 0x00000005
};
// CFNumbers
#define kDisplaySubPixelLayout "DisplaySubPixelLayout"
#define kDisplaySubPixelConfiguration "DisplaySubPixelConfiguration"
#define kDisplaySubPixelShape "DisplaySubPixelShape"
#define kIODisplayOverrideMatchingKey "IODisplayOverrideMatching"
// Display parameters
#define kIODisplayParametersKey "IODisplayParameters"
#define kIODisplayGUIDKey "IODisplayGUID"
#define kIODisplayValueKey "value"
#define kIODisplayMinValueKey "min"
#define kIODisplayMaxValueKey "max"
#define kIODisplayBrightnessProbeKey "brightness-probe"
#define kIODisplayLinearBrightnessProbeKey "linear-brightness-probe"
#define kIODisplayBrightnessKey "brightness"
#define kIODisplayLinearBrightnessKey "linear-brightness"
#define kIODisplayUsableLinearBrightnessKey "usable-linear-brightness"
#define kIODisplayBrightnessFadeKey "brightness-fade"
#define kIODisplayContrastKey "contrast"
#define kIODisplayHorizontalPositionKey "horizontal-position"
#define kIODisplayHorizontalSizeKey "horizontal-size"
#define kIODisplayVerticalPositionKey "vertical-position"
#define kIODisplayVerticalSizeKey "vertical-size"
#define kIODisplayTrapezoidKey "trapezoid"
#define kIODisplayPincushionKey "pincushion"
#define kIODisplayParallelogramKey "parallelogram"
#define kIODisplayRotationKey "rotation"
#define kIODisplayTheatreModeKey "theatre-mode"
#define kIODisplayTheatreModeWindowKey "theatre-mode-window"
#define kIODisplayOverscanKey "oscn"
#define kIODisplayVideoBestKey "vbst"
#define kIODisplaySpeakerVolumeKey "speaker-volume"
#define kIODisplaySpeakerSelectKey "speaker-select"
#define kIODisplayMicrophoneVolumeKey "microphone-volume"
#define kIODisplayAmbientLightSensorKey "ambient-light-sensor"
#define kIODisplayAudioMuteAndScreenBlankKey "audio-mute-and-screen-blank"
#define kIODisplayAudioTrebleKey "audio-treble"
#define kIODisplayAudioBassKey "audio-bass"
#define kIODisplayAudioBalanceLRKey "audio-balance-LR"
#define kIODisplayAudioProcessorModeKey "audio-processor-mode"
#define kIODisplayPowerModeKey "power-mode"
#define kIODisplayManufacturerSpecificKey "manufacturer-specific"
#define kIODisplayPowerStateKey "dsyp"
#define kIODisplayControllerIDKey "IODisplayControllerID"
#define kIODisplayCapabilityStringKey "IODisplayCapabilityString"
#define kIODisplayRedGammaScaleKey "rgsc"
#define kIODisplayGreenGammaScaleKey "ggsc"
#define kIODisplayBlueGammaScaleKey "bgsc"
#define kIODisplayGammaScaleKey "gsc "
#define kIODisplayParametersCommitKey "commit"
#define kIODisplayParametersDefaultKey "defaults"
#define kIODisplayParametersFlushKey "flush"
#ifdef __cplusplus
}
#endif
#endif /* ! _IOKIT_IOGRAPHICSTYPES_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/graphics/GTrace.hpp | //
// GTrace.hpp
//
// Created by bparke on 3/17/17.
//
#ifndef GTrace_hpp
#define GTrace_hpp
#include <stdatomic.h>
#include <libkern/c++/OSObject.h>
#include <IOKit/IOLib.h>
#include <IOKit/IOReturn.h>
#include "IOKit/graphics/GTraceTypes.hpp"
// Kernel clients that haven't enabled C++11 yet
#if !GTRACE_ARCHAIC_CPP
#include <osmemory>
#endif
// TODO: Provide example of GTRACE() macro use.
// ----------------------------------------------------------------------------
// Main tracing Macros
// ----------------------------------------------------------------------------
// Use this to encode t0, for automatic decoding and start/end pairing
// Function has been moved and renamed, define old macro in terms of new
#define GTFuncTag(i, t, tag) GPACKFUNCTAG(i, t, tag)
#define GTRACERAW(tracer, t0, a0, t1, a1, t2, a2, t3, a3) do{ \
if (static_cast<bool>(tracer)){ \
(tracer)->recordToken(__LINE__, \
MAKEGTRACETAG(t0), MAKEGTRACEARG(a0), \
MAKEGTRACETAG(t1), MAKEGTRACEARG(a1), \
MAKEGTRACETAG(t2), MAKEGTRACEARG(a2), \
MAKEGTRACETAG(t3), MAKEGTRACEARG(a3)); \
} \
}while(0)
// Convenience macro, used when all args are ordinary hex data fields.
#define GTRACERAWNT(tracer, a0, a1, a2, a3) \
GTRACERAW(tracer, 0, a0, 0, a1, 0, a2, 0, a3)
#define GTRACE(tracer, fid, ft, t0, a0, t1, a1, t2, a2, t3, a3) \
GTRACERAW(tracer, GTFuncTag(fid, ft, t0), a0, t1, a1, t2, a2, t3, a3)
// Convenience macro, used when all as are ordinary hex data fields.
#define GTRACE_NT(tracer, fid, ft, a0, a1, a2, a3) \
GTRACERAW(tracer, GTFuncTag(fid, ft, 0), a0, 0, a1, 0, a2, 0, a3)
// GTrace for calls that are slow. The GTRACE_IFSLOW_START records the current
// time, then GTRACE_IFSLOW_END will record an entry if the duration between
// start and end is > the threshold. Note `delayat` is in absolute time units.
#define GTRACE_IFSLOW_START(tracer, fid) do { \
const uint64_t _gtrace_ ## fid ## _start_ \
= ((static_cast<bool>(tracer)) ? mach_continuous_time() : 0)
// Matches the do{ from GTRACE_IFSLOW_START, must be in same scope
#define GTRACE_IFSLOW_END(tracer, fid, ft, t0, a0, t1, a1, t2, a2, delayat) \
if(static_cast<bool>(tracer)) { \
const uint64_t _gtrace_ifslow_now_ = mach_continuous_time(); \
const uint64_t _gtrace_delta_ \
= _gtrace_ifslow_now_ - _gtrace_ ## fid ## _start_; \
if(_gtrace_delta_ > (delayat)) \
(tracer)->recordToken(__LINE__, GTFuncTag(fid, ft, 0), \
_gtrace_delta_, t0, a0, t1, a1, t2, a2, \
_gtrace_ifslow_now_); \
} \
}while(0)
// Create a pair of GTrace records but only record them if the time duration
// was > than the absolute time threshold given in GTRACE_DEFER_END
#define GTRACE_DEFER_START(tracer, t0, a0, t1, a1, t2, a2, t3, a3) \
do{ \
const GTraceEntry _gtrace_start_ = (static_cast<bool>(tracer)) \
? (tracer)->formatToken(__LINE__, t0, a0, t1, a1, t2, a2, t3, a3) \
: GTraceEntry()
// Matches the do{ from GTRACE_DEFER_START, must be in same block scope
#define GTRACE_DEFER_END(tracer, t0, a0, t1, a1, t2, a2, t3, a3, delayat) \
if (static_cast<bool>(tracer)) { \
const uint64_t _gtrace_defer_now_ = mach_continuous_time(); \
const uint64_t _gtrace_delta_ \
= _gtrace_defer_now_ - _gtrace_start_.timestamp(); \
if(_gtrace_delta_ > (delayat)) { \
(tracer)->recordToken(_gtrace_start_); \
(tracer)->recordToken(__LINE__, t0, a0, t1, a1, \
t2, a2, t3, a3, _gtrace_defer_now_); \
} \
} \
}while(0)
#if GTRACE_IMPL
// Macro used by IOGraphicsFamily internally, not required for third party use.
#define GTRACE_LOG_SYNCH(tracer, t0) do { \
if (static_cast<bool>(tracer)) { \
const uint32_t __gtrace_log_sync_ind__ = tracer->synchIndex(); \
tracer->recordToken(__LINE__, \
MAKEGTRACETAG(t0),static_cast<uint64_t>(__gtrace_log_sync_ind__), \
0, 0, 0, 0, 0, 0); \
IOLog("GTrace synchronization point %x\n", __gtrace_log_sync_ind__); \
} \
}while(0)
#endif
class IOMemoryDescriptor;
class IOMemoryMap;
class GTraceBuffer final : public OSObject
{
OSDeclareFinalStructors(GTraceBuffer);
using super = OSObject;
public:
// sizeP is an in/out variable, size will be <= 16KiB
// The Breadcrumb function callout is a clean context that does not hold a
// lock.
using breadcrumb_func
= IOReturn (*)(void* context, void* buffer, uint16_t* sizeP);
#if !GTRACE_ARCHAIC_CPP
using shared_type = iog::OSSharedObject<GTraceBuffer>;
/*!
@function make
@abstract Make a shared object of a new GTrace buffer.
@discussion Creates an optimised lockfree algorithm for storing 64byte
records into a ring buffer. This buffer can be dumped by
`iogdiagnose` and then decoded using
/AppleInternal/AppleGraphicsControl/IOGDiagnoseDecode.
In addition to the ring buffer the client can also provide a
function that will copy up to 16KiB of additional data used by
the client's decode module. It is much better if this func is
LOCKFREE. If the function does not return within 1 second we
may abort the thread reading the data and discard the buffer.
Thus it is a data-looser to stall the fetch thread for too
long.
The breadcrumb_func is not called with GTraceBuffer locks
held.
@param bufferName: Max 32 byte C string copied into fetch header.
@param decoderName: Max 32 byte C string copied into fetch header, used by
IOGDiagnoseDecode to find a decode module in
/AppleInternal/AppleGraphicsControl/IOGDiagnose_modules directory.
@param lineCount: Number of lines to store in ring buffer. Line count will
be rounded up to a power of two and is bounded by
kGTraceMinimumLineCount and kGTraceMaximumLineCount.
@param bcf: breadcrumb_func. May be null. Function to call when the buffer
is being fetched, to be used by your decode module. See discussion.
@param context: Context to pass to the bcf function.
@result OSSharedObject<GTraceBuffer> with the new created buffer. An empty
buffer on failure.
*/
static shared_type make(
const char* decoderName, const char* bufferName,
const uint32_t lineCount, breadcrumb_func bcf, void* context);
/*! @function destroy
@abstract Destroy a buffer shared object created with make.
@discussion When a client is done with the gtrace buffer use
destroy(iog::move(<your buffer>)) to destroy your shared object and
stop further calls to the breadcrumb func. This will destroy your
reference to the buffer. Before completing destruction the breadcrumb
function if any will be called only once and then never called again
after on return. The breadcrumb function is never called with any
internal buffer locks held. The GTraceBuffer guarantees that no
further calls to the breadcrumb function will occur once this call
completes.
Note it is not necessary to destroy every copy of the shared_type
(OSSharedObject<GTraceBuffer>), rather only call destroy when you no
longer wish any further breadcrumb callouts during teardown of your
master objects, essentially it is symetric with make() calls.
@param bso An rvalue reference to the buffer shared object.
*/
static void destroy(shared_type&& bso);
#endif // !GTRACE_ARCHAIC_CPP
#if GTRACE_ARCHAIC_CPP || GTRACE_IMPL
/*! @function makeArchaicCpp
@abstract Equivalent to make for archaic pre-C++11 projects. See make
for more details.
*/
static GTraceBuffer* makeArchaicCpp(
const char* decoderName, const char* bufferName,
const uint32_t lineCount, breadcrumb_func bcf, void* context)
__attribute__((deprecated ("Use C++11 and GTraceBuffer::make.")));
/*! @function destroyArchaicCpp
@abstract Equivalent to destroy for archaic pre-C++11 projects. See
destroy for more details.
@discussion Similar to destroy, destroyArchaicCpp releases one reference
on the buffer. Clients must use destroyArchaicCpp once
(mirroring the call to makeArchaicCpp).
*/
static void destroyArchaicCpp(GTraceBuffer *buffer)
__attribute__((deprecated ("Use C++11 and GTraceBuffer::destroy.")));
#endif
/*! @function formatToken
@abstract Format a token suitable for recording.
@discussion GTrace supports tokenized tracing. formatToken is used to
create a tokenized KTrace style entry suitable for inserting into the
ring buffer. Carefully written for C++ return value optimisation.
@param line The line number associated with the token
@param tag1 An implementation specific tag associated with arg1
@param tag2 An implementation specific tag associated with arg2
@param tag3 An implementation specific tag associated with arg3
@param tag4 An implementation specific tag associated with arg4
@param arg1 Component/implementation specific value.
@param arg2 Component/implementation specific value.
@param arg3 Component/implementation specific value.
@param arg4 Component/implementation specific value.
@param timestamp Supplied timestamp or current MCT
@result GTraceEntry structure filled in with given data.
*/
GTraceEntry formatToken(const uint16_t line,
const uint64_t tag1, const uint64_t arg1,
const uint64_t tag2, const uint64_t arg2,
const uint64_t tag3, const uint64_t arg3,
const uint64_t tag4, const uint64_t arg4,
const uint64_t timestamp = mach_continuous_time());
/*! @function recordToken
@abstract Add token data to token stream.
@discussion recordToken() takes a formatted GTraceEntry and writes it to
the ring buffer.
@param entry a const GTraceEntry reference to be atomically added to token
stream.
*/
void recordToken(const GTraceEntry& entry);
/*! @function recordToken
@abstract Add the token data to the token stream
@discussion GTrace supports tokenized tracing. recordToken is used to
insert a tokenized KTrace style trace into the trace buffer.
@param line The line number associated with the token
@param tag1 An implementation specific tag associated with arg1
@param tag2 An implementation specific tag associated with arg2
@param tag3 An implementation specific tag associated with arg3
@param tag4 An implementation specific tag associated with arg4
@param arg1 Component/implementation specific value.
@param arg2 Component/implementation specific value.
@param arg3 Component/implementation specific value.
@param arg4 Component/implementation specific value.
@param timestamp Supplied timestamp or current MCT
*/
void recordToken(const uint16_t line,
const uint64_t tag1, const uint64_t arg1,
const uint64_t tag2, const uint64_t arg2,
const uint64_t tag3, const uint64_t arg3,
const uint64_t tag4, const uint64_t arg4,
const uint64_t timestamp = mach_continuous_time())
{
recordToken(formatToken(
line, tag1, arg1, tag2, arg2, tag3, arg3, tag4, arg4, timestamp));
}
#if GTRACE_IMPL
/*! @function synchIndex
@abstract Publishes the current gtrace token index.
@discussion Used by Decode to synchronize between os_log and GTrace. I
have chosen to share the atomic next index operation though
it may cause decode ambiguity. It is very light weight.
*/
inline uint32_t synchIndex() const { return nextLine(); }
/*! @function fetch
@abstract
Copies token buffer into provided memory descriptor.
@discussion
Copies the tokens data from the internal buffers into the provided
IOMemoryDescriptor, which must be prepared. Data is copied up to the
buffer size or the internal buffer size (which ever is less). Once the
data is copied a post processing step that obfuscates pointers is run.
@param bso OSSharedObject<GTraceBuffer> (i.e. shared_type) of GTraceBuffer
@param outDesc pointer to a prepared memory descriptor.
@result kIOReturnSuccess if the copy was successful, else an error.
*/
static IOReturn fetch(shared_type bso, IOMemoryDescriptor* outDesc);
#ifndef _OPEN_SOURCE_
/*!
@function makeUser
@abstract Record a user land gtrace buffer.
@discussion The block of memory provided by the client process will be
copied out in sysdiagnose by the iogdiagnose CLI tool. User buffers do
NOT support breadcrumb functions. However, a client process can
designate a block of the buffer as breadcrumb space, but note no
inter-locking will be provided between recording data into it and
fetch. Destroy buffers in the usual way.
@param bufMD: Block of memory provided by client process.
@param errP: Pointer to a IOReturn return code, only written on failure.
@result OSSharedObject<GTraceBuffer> with the new created buffer. An empty
buffer on failure.
*/
static shared_type makeUser(IOMemoryDescriptor *bufMD, IOReturn* errP);
protected:
IOReturn copyOutUser(iog::OSUniqueObject<IOMemoryMap> map) const;
public:
#endif // !_OPEN_SOURCE_
/* Getters for constant header information */
size_t decoderName(char *name, const int len) const; // truncates
size_t bufferName(char *name, const int len) const; // truncates
uint32_t lineMask() const { return fLineMask; }
uint32_t lineCount() const { return fLineCount; }
uint32_t bufferID() const { return fHeader.fBufferID; }
protected:
// OSObject overrides
bool init() APPLE_KEXT_OVERRIDE;
void free() APPLE_KEXT_OVERRIDE;
// Internal functions
// See make() for details on arguments
IOReturn init(
const GTraceHeader& header, IOMemoryDescriptor* userBufferMD,
breadcrumb_func bcf, const void* context);
static shared_type makeFromHeader(
const GTraceHeader& header, IOMemoryDescriptor* userBufferMD,
breadcrumb_func bcf, void* context, IOReturn* errP);
static GTraceHeader buildHeader(
const char* decoderName, const char* bufferName,
const uint32_t count);
inline uint32_t getNextLine(void)
{ return atomic_fetch_add(&fNextLine, 1) & fLineMask; }
// Complicated const casting because atomic_load will not take a const
// pointer, problem mixing C and C++, but C++ <atomic> doesn't exist
// in the kernel yet and probably never will as it is deep STL.
inline uint32_t nextLine() const
{ return atomic_load(&(const_cast<GTraceBuffer*>(this)->fNextLine)); }
IOReturn copyOut(
iog::OSUniqueObject<IOMemoryMap> map, OSData* bcData) const;
// APIs for IODisplayWranglerUserClients.cpp, also used by unit tests
friend class IOGDiagnosticGTraceClient;
/*! @function fetch
@abstract
Copies the token buffer into the provided memory descriptor.
IOGDiagnosticUserClient interface
@discussion
Copies the tokens data from the internal buffers into the provided
IOMemoryDescriptor, which must be prepared. Data is copied up to the
buffer size or the internal buffer size (which ever is less). Once the
data is copied a post processing step that obfuscates pointers is run.
Releases buffer if the globally cached OSSharedObject is unique,
that is it has only one outstanding reference AND the complete buffer
was sucessfully copied into outDesc.
@param index Index of buffer in buffer pool cache
@param outDesc pointer to a prepared memory descriptor.
@result kIOReturnSuccess if the copy was successful, else an error.
*/
static IOReturn fetch(const uint32_t index, IOMemoryDescriptor* outDesc);
private:
// Header that is copied out on demand
GTraceHeader fHeader;
atomic_uint_fast32_t fNextLine;
GTraceEntry* fBuffer;
#ifndef _OPEN_SOURCE_
IOMemoryDescriptor* fUserBufferMD;
#endif // !_OPEN_SOURCE_
breadcrumb_func fBreadcrumbFunc;
const void* fBCFContext; // Context to be passed to fBreadcrumbFunc
OSData* fBCData;
uint32_t fBCActiveCount;
uint32_t fLineMask;
uint32_t fLineCount;
bool fWrapped;
// Workaround for pre-C++11 clients, which can't see OSSharedObject.
shared_type fArchaicCPPSharedObjectHack;
#endif // GTRACE_IMPL
};
#endif /* GTrace_h */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/graphics/IOGraphicsInterfaceTypes.h | /*
* Copyright (c) 1999-2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOGRAPHICSINTERFACETYPES_H
#define _IOKIT_IOGRAPHICSINTERFACETYPES_H
#include <IOKit/graphics/IOAccelSurfaceConnect.h>
#define IO_FOUR_CHAR_CODE(x) (x)
typedef UInt32 IOFourCharCode;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#define kCurrentGraphicsInterfaceVersion 1
#define kCurrentGraphicsInterfaceRevision 2
#ifdef IOGA_COMPAT
typedef SInt32 IOBlitCompletionToken;
#endif
typedef UInt32 IOBlitType;
enum {
kIOBlitTypeVerbMask = 0x000000ff,
kIOBlitTypeRects = 0,
kIOBlitTypeCopyRects,
kIOBlitTypeLines,
kIOBlitTypeScanlines,
kIOBlitTypeCopyRegion,
kIOBlitTypeMoveCursor,
kIOBlitTypeShowCursor,
kIOBlitTypeHideCursor,
kIOBlitTypeMonoExpand = 0x00000100,
kIOBlitTypeColorSpaceConvert = 0x00000200,
kIOBlitTypeScale = 0x00000400,
kIOBlitTypeSourceKeyColorModeMask = 0x00003000,
kIOBlitTypeDestKeyColorModeMask = 0x0000c000,
kIOBlitTypeSourceKeyColorEqual = 0x00001000,
kIOBlitTypeSourceKeyColorNotEqual = 0x00002000,
kIOBlitTypeDestKeyColorEqual = 0x00004000,
kIOBlitTypeDestKeyColorNotEqual = 0x00008000,
kIOBlitTypeOperationMask = 0x0fff0000,
kIOBlitTypeOperationShift = 16,
kIOBlitTypeOperationTypeMask = 0x0f000000,
kIOBlitTypeOperationType0 = 0x00000000,
kIOBlitCopyOperation = 0x00000000 | kIOBlitTypeOperationType0,
kIOBlitOrOperation = 0x00010000 | kIOBlitTypeOperationType0,
kIOBlitXorOperation = 0x00020000 | kIOBlitTypeOperationType0,
kIOBlitBlendOperation = 0x00030000 | kIOBlitTypeOperationType0,
kIOBlitHighlightOperation = 0x00040000 | kIOBlitTypeOperationType0
};
typedef UInt32 IOBlitSourceType;
enum {
kIOBlitSourceDefault = 0x00000000,
kIOBlitSourceFramebuffer = 0x00001000,
kIOBlitSourceMemory = 0x00002000,
kIOBlitSourceOOLMemory = 0x00003000,
kIOBlitSourcePattern = 0x00004000,
kIOBlitSourceOOLPattern = 0x00005000,
kIOBlitSourceSolid = 0x00006000,
kIOBlitSourceCGSSurface = 0x00007000,
kIOBlitSourceIsSame = 0x80000000
};
#ifdef IOGA_COMPAT
typedef IOBlitSourceType IOBlitSourceDestType;
enum {
kIOBlitDestFramebuffer = 0x00000001
};
#endif
typedef struct IOBlitOperationStruct {
UInt32 color0;
UInt32 color1;
SInt32 offsetX;
SInt32 offsetY;
UInt32 sourceKeyColor;
UInt32 destKeyColor;
UInt32 specific[16];
} IOBlitOperation;
typedef struct IOBlitRectangleStruct {
SInt32 x;
SInt32 y;
SInt32 width;
SInt32 height;
} IOBlitRectangle;
typedef struct IOBlitRectanglesStruct {
IOBlitOperation operation;
IOItemCount count;
IOBlitRectangle rects[1];
} IOBlitRectangles;
typedef struct IOBlitCopyRectangleStruct {
SInt32 sourceX;
SInt32 sourceY;
SInt32 x;
SInt32 y;
SInt32 width;
SInt32 height;
} IOBlitCopyRectangle;
typedef struct IOBlitCopyRectanglesStruct {
IOBlitOperation operation;
IOItemCount count;
IOBlitCopyRectangle rects[1];
} IOBlitCopyRectangles;
typedef struct IOBlitCopyRegionStruct {
IOBlitOperation operation;
SInt32 deltaX;
SInt32 deltaY;
IOAccelDeviceRegion * region;
} IOBlitCopyRegion;
typedef struct IOBlitVertexStruct {
SInt32 x;
SInt32 y;
} IOBlitVertex;
typedef struct IOBlitVerticesStruct {
IOBlitOperation operation;
IOItemCount count;
IOBlitVertex vertices[2];
} IOBlitVertices;
typedef struct IOBlitScanlinesStruct {
IOBlitOperation operation;
IOItemCount count;
SInt32 y;
SInt32 height;
SInt32 x[2];
} IOBlitScanlines;
typedef struct IOBlitCursorStruct {
IOBlitOperation operation;
IOBlitRectangle rect;
} IOBlitCursor;
typedef struct _IOBlitMemory * IOBlitMemoryRef;
/* Quickdraw.h pixel formats*/
enum {
kIO1MonochromePixelFormat = 0x00000001, /* 1 bit indexed*/
kIO2IndexedPixelFormat = 0x00000002, /* 2 bit indexed*/
kIO4IndexedPixelFormat = 0x00000004, /* 4 bit indexed*/
kIO8IndexedPixelFormat = 0x00000008, /* 8 bit indexed*/
kIO16BE555PixelFormat = 0x00000010, /* 16 bit BE rgb 555 (Mac)*/
kIO24RGBPixelFormat = 0x00000018, /* 24 bit rgb */
kIO32ARGBPixelFormat = 0x00000020, /* 32 bit argb (Mac)*/
kIO1IndexedGrayPixelFormat = 0x00000021, /* 1 bit indexed gray*/
kIO2IndexedGrayPixelFormat = 0x00000022, /* 2 bit indexed gray*/
kIO4IndexedGrayPixelFormat = 0x00000024, /* 4 bit indexed gray*/
kIO8IndexedGrayPixelFormat = 0x00000028 /* 8 bit indexed gray*/
};
enum {
kIO16LE555PixelFormat = IO_FOUR_CHAR_CODE('L555'), /* 16 bit LE rgb 555 (PC)*/
kIO16LE5551PixelFormat = IO_FOUR_CHAR_CODE('5551'), /* 16 bit LE rgb 5551*/
kIO16BE565PixelFormat = IO_FOUR_CHAR_CODE('B565'), /* 16 bit BE rgb 565*/
kIO16LE565PixelFormat = IO_FOUR_CHAR_CODE('L565'), /* 16 bit LE rgb 565*/
kIO24BGRPixelFormat = IO_FOUR_CHAR_CODE('24BG'), /* 24 bit bgr */
kIO32BGRAPixelFormat = IO_FOUR_CHAR_CODE('BGRA'), /* 32 bit bgra (Matrox)*/
kIO32ABGRPixelFormat = IO_FOUR_CHAR_CODE('ABGR'), /* 32 bit abgr */
kIO32RGBAPixelFormat = IO_FOUR_CHAR_CODE('RGBA'), /* 32 bit rgba */
kIOYUVSPixelFormat = IO_FOUR_CHAR_CODE('yuvs'), /* YUV 4:2:2 byte ordering 16-unsigned = 'YUY2'*/
kIOYUVUPixelFormat = IO_FOUR_CHAR_CODE('yuvu'), /* YUV 4:2:2 byte ordering 16-signed*/
kIOYVU9PixelFormat = IO_FOUR_CHAR_CODE('YVU9'), /* YVU9 Planar 9*/
kIOYUV411PixelFormat = IO_FOUR_CHAR_CODE('Y411'), /* YUV 4:1:1 Interleaved 16*/
kIOYVYU422PixelFormat = IO_FOUR_CHAR_CODE('YVYU'), /* YVYU 4:2:2 byte ordering 16*/
kIOUYVY422PixelFormat = IO_FOUR_CHAR_CODE('UYVY'), /* UYVY 4:2:2 byte ordering 16*/
kIOYUV211PixelFormat = IO_FOUR_CHAR_CODE('Y211'), /* YUV 2:1:1 Packed 8*/
kIO2vuyPixelFormat = IO_FOUR_CHAR_CODE('2vuy') /* UYVY 4:2:2 byte ordering 16*/
};
/* Non Quickdraw.h pixel formats*/
enum {
kIO16LE4444PixelFormat = IO_FOUR_CHAR_CODE('L444'), /* 16 bit LE argb 4444*/
kIO16BE4444PixelFormat = IO_FOUR_CHAR_CODE('B444'), /* 16 bit BE argb 4444*/
kIO64BGRAPixelFormat = IO_FOUR_CHAR_CODE('B16I'), /* 64 bit bgra */
kIO64RGBAFloatPixelFormat = IO_FOUR_CHAR_CODE('B16F'), /* 64 bit rgba */
kIO128RGBAFloatPixelFormat = IO_FOUR_CHAR_CODE('B32F') /* 128 bit rgba float */
};
enum {
kIOBlitMemoryRequiresHostFlush = 0x00000001
};
typedef struct IOBlitSurfaceStruct {
union {
UInt8 * bytes;
IOBlitMemoryRef ref;
} memory;
IOFourCharCode pixelFormat;
IOBlitRectangle size;
UInt32 rowBytes;
UInt32 byteOffset;
UInt32 * palette;
IOOptionBits accessFlags;
IOBlitMemoryRef interfaceRef;
UInt32 more[14];
} IOBlitSurface;
typedef IOBlitSurface IOBlitMemory;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
enum {
// options for Synchronize
kIOBlitSynchronizeWaitBeamExit = 0x00000001,
kIOBlitSynchronizeFlushHostWrites = 0x00000002
};
enum {
// options for WaitComplete & Flush
kIOBlitWaitContext = 0x00000000,
kIOBlitWaitAll2D = 0x00000001,
kIOBlitWaitGlobal = 0x00000001,
kIOBlitWaitAll = 0x00000002,
kIOBlitWaitCheck = 0x00000080,
kIOBlitFlushWithSwap = 0x00010000
};
enum {
// options for AllocateSurface
kIOBlitHasCGSSurface = 0x00000001,
kIOBlitFixedSource = 0x00000002,
kIOBlitBeamSyncSwaps = 0x00000004,
kIOBlitReferenceSource = 0x00000008
};
enum {
// options for UnlockSurface
kIOBlitUnlockWithSwap = 0x80000000
};
enum {
// options for SetDestination
kIOBlitFramebufferDestination = 0x00000000,
kIOBlitSurfaceDestination = 0x00000001
};
enum {
// options for blit procs
kIOBlitBeamSync = 0x00000001,
kIOBlitBeamSyncAlways = 0x00000002,
kIOBlitBeamSyncSpin = 0x00000004,
kIOBlitAllOptions = 0xffffffff
};
enum {
// capabilities
kIOBlitColorSpaceTypes = IO_FOUR_CHAR_CODE('cspc')
};
// keys for IOAccelFindAccelerator()
#define kIOAccelTypesKey "IOAccelTypes"
#define kIOAccelIndexKey "IOAccelIndex"
#define kIOAccelRevisionKey "IOAccelRevision"
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#endif /* !_IOKIT_IOGRAPHICSINTERFACETYPES_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/ata/ATADeviceNub.h | /*
* Copyright (c) 1998-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header ATADeviceNub.h
@abstract A concrete implementation of IOATADevice.
*/
#ifndef _ATADEVICENUB_H
#define _ATADEVICENUB_H
#include <IOKit/IOTypes.h>
#include "IOATATypes.h"
#include "IOATADevice.h"
#include "IOATAController.h"
#include "IOATABusCommand.h"
/*!
@class ATADeviceNub
@abstract ATADeviceNub is a concrete implementation of IOATADevice.
@discussion clients of IOATA (disk drivers) should use the interface presented
by IOATADevice. Concrete nubs are private to the IOATA family and
specific subclasses of IOATADevice are instantiated by controller
drivers to provide the abstract interface to clients.
*/
class ATADeviceNub : public IOATADevice
{
OSDeclareDefaultStructors(ATADeviceNub);
public:
/*!@function ataDeviceNub
@abstract static creator function - used by IOATAControllers to create nubs.
*/
static ATADeviceNub* ataDeviceNub( IOATAController* provider, ataUnitID unit, ataDeviceType devType);
/*!@function attach
@abstract override of IOService method.
*/
virtual bool attach(IOService* provider );
// overrides from IOATADevice to provide actual client interface
/*!@function executeCommand
@abstract Submit IO requests
*/
virtual IOReturn executeCommand(IOATACommand* command);
// create and destroy IOATACommands
/*!@function allocCommand
@abstract create command objects for clients.
*/
virtual IOATACommand* allocCommand( void );
/*!@function freeCommand
@abstract Clients use this method to dispose of command objects.
*/
virtual void freeCommand( IOATACommand* inCommand);
protected:
/*!@function init
@abstract used after creating the nub.
*/
virtual bool init(IOATAController* provider, ataUnitID unit, ataDeviceType devType);
/*!@function publishProperties
@abstract publish the nub's properties in the device tree.
*/
virtual void publishProperties( void );
/*!@function publishBusProperties
@abstract puts info about this device's bus capability in the device tree.
*/
virtual void publishBusProperties(void);
/*!@function publishVendorProperties
@abstract will be deprecated.
*/
virtual void publishVendorProperties( void );
/*!@function getDeviceID
@abstract get the unit id of this drive (0 or 1)
*/
virtual IOReturn getDeviceID(void);
/*!@function MyATACallback
@abstract to be deprecated.
*/
static void MyATACallback(IOATACommand* command );
/*!@function processCallback
@abstract to be deprecated.
*/
void processCallback(IOATACommand* command );
/*!@function swapBytes16
@abstract to be deprecated.
*/
void swapBytes16( UInt8* dataBuffer, IOByteCount length);
UInt8* buffer;
protected:
/*! @struct ExpansionData
@discussion This structure will be used to expand the capablilties of the ATADeviceNub in the future.
*/
struct ExpansionData { };
/*! @var reserved
Reserved for future use. (Internal use only) */
ExpansionData *reserved;
private:
OSMetaClassDeclareReservedUnused(ATADeviceNub, 0);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 1);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 2);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 3);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 4);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 5);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 6);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 7);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 8);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 9);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 10);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 11);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 12);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 13);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 14);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 15);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 16);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 17);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 18);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 19);
OSMetaClassDeclareReservedUnused(ATADeviceNub, 20);
};
#endif /* !_IOATABUSNUB_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/ata/IOATABusCommand.h | /*
* Copyright (c) 1998-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
*
* IOATABusCommand.h
*
*/
#ifndef _IOATABUSCOMMAND_H
#define _IOATABUSCOMMAND_H
#include <IOKit/IOTypes.h>
#include "IOATATypes.h"
#include "IOATACommand.h"
class IOSyncer;
/*!
@class IOATABusCommand
@discussion ATA Device (disk) drivers should use the superclass, IOATACommand
and may not derive or use any subclass of IOATACommand.
IOATABusCommand is the subclass of IOATACommand used by
IOATAControllers. Controller classes may override this class to
provide additional fields as their needs dictate or may use this
as a concrete class if it is sufficient.
IOATAControllers are always paired with specific IOATADevices
and each specific subclass of IOATADevice is in turn the factory method
for IOATACommands for use by disk drivers.
In this manner, mass-storage device drivers (disk drivers, clients of
ATA bus controllers) see only the generalized interface of IOATADevice
and the generalized interface of IOATACommand. This provides isolation
from specific bus details for disk drivers and offers flexibility to
controllers to add per-command fields and state variables for their own
internal use.
*/
class IOATABusCommand : public IOATACommand {
OSDeclareDefaultStructors( IOATABusCommand );
public:
// data items for use by IOATAController
/*! @var queueChain queue header for use by IOATAController. */
queue_chain_t queueChain;
/*! @var state state-semaphore for use by IOATAController */
UInt32 state;
/*! @var syncer IOSyncer for use by IOATAController */
IOSyncer* syncer;
/*!@function allocateCmd
@abstract factory method to create an instance of this class used by subclasses of IOATADevice
*/
static IOATABusCommand* allocateCmd(void);
/*!@function zeroCommand
@abstract set to blank state, call prior to re-use of this object
*/
virtual void zeroCommand(void);
/*!@function getOpcode
@abstract return the command opcode
*/
virtual ataOpcode getOpcode( void );
/*!@function getFlags
@abstract return the flags for this command.
*/
virtual ataFlags getFlags ( void );
/*!@function getRegMask
@abstract get the register mask for desired regs
*/
virtual ataRegMask getRegMask( void );
/*!@function getUnit
@abstract return the unit id (0 master, 1 slave)
*/
virtual ataUnitID getUnit( void );
/*!@function getTimeoutMS
@abstract return the timeout value for this command
*/
virtual UInt32 getTimeoutMS (void );
/*!@function setResult
@abstract set the result code
*/
virtual void setResult( IOReturn );
/*!@function getCallbackPtr
@abstract return the callback pointer
*/
virtual IOATACompletionFunction* getCallbackPtr (void );
/*!@function executeCallback
@abstract call the completion callback function
*/
virtual void executeCallback(void);
/*!@function getTaskFilePtr
@abstract return the taskfile structure pointer.
*/
virtual ataTaskFile* getTaskFilePtr(void);
/*!@function getPacketSize
@abstract return the size of atapi packet if any.
*/
virtual UInt16 getPacketSize(void);
/*!@function getPacketData
@abstract return pointer to the array of packet data.
*/
virtual UInt16* getPacketData(void);
/*!@function getTransferChunkSize
@abstract number of bytes between interrupts.
*/
virtual IOByteCount getTransferChunkSize(void);
/*!@function setActualTransfer
@abstract set the byte count of bytes actually transferred.
*/
virtual void setActualTransfer ( IOByteCount bytesTransferred );
/*!@function getBuffer
@abstract get pointer to the memory descriptor for this transaction
*/
virtual IOMemoryDescriptor* getBuffer ( void);
/*!@function getPosition
@abstract the position within the memory buffer for the transaction.
*/
virtual IOByteCount getPosition (void);
/*!@function getByteCount
@abstract return the byte count for this transaction to transfer.
*/
virtual IOByteCount getByteCount (void);
/*!@function setCommandInUse
@abstract mark the command as being in progress.
*/
virtual void setCommandInUse( bool inUse = true);
protected:
//
/*!@function init
@abstract Zeroes all data, returns false if allocation fails. protected.
*/
virtual bool init();
/*! @struct ExpansionData
@discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future.
*/
struct ExpansionData { };
/*! @var reserved
Reserved for future use. (Internal use only) */
ExpansionData *reserved;
private:
OSMetaClassDeclareReservedUnused(IOATABusCommand, 0);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 1);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 2);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 3);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 4);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 5);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 6);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 7);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 8);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 9);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 10);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 11);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 12);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 13);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 14);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 15);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 16);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 17);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 18);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 19);
OSMetaClassDeclareReservedUnused(IOATABusCommand, 20);
};
#include <IOKit/IODMACommand.h>
class IOATABusCommand64 : public IOATABusCommand
{
OSDeclareDefaultStructors( IOATABusCommand64 );
public:
// new features
static IOATABusCommand64* allocateCmd32(void);
virtual IODMACommand* GetDMACommand( void );
// overrides for IODMACommand setup
virtual void zeroCommand(void);
virtual void setBuffer ( IOMemoryDescriptor* inDesc);
virtual void setCommandInUse( bool inUse = true);
virtual void executeCallback(void);
protected:
IODMACommand* _dmaCmd;
virtual bool init();
virtual void free();
};
#endif /*_IOATABUSCOMMAND_H*/
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/ata/IOATATypes.h | /*
* Copyright (c) 2000-2008 Apple, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOATATYPES_H
#define _IOATATYPES_H
#include <IOKit/IOTypes.h>
/*!
@header IOATAtypes.h
@discussion contains various definitions and constants for use in the IOATAFamily and clients. Header Doc is incomplete at this point, but file is heavily commented.
*/
// property strings
#define kATADevPropertyKey "ata device type"
#define kATATypeATAString "ata"
#define kATATypeATAPIString "atapi"
#define kATATypeUnknownString "unknown"
#define kATAVendorPropertyKey "device model"
#define kATARevisionPropertyKey "device revision"
#define kATASerialNumPropertyKey "device serial"
#define kATAUnitNumberKey "unit number"
#define kATASocketKey "socket type"
#define kATAInternalSocketString "internal"
#define kATAMediaBaySocketString "media-bay"
#define kATAPCCardSocketString "pccard"
#define kATAInternalSATAString "serial-ata"
#define kATASATABayString "sata-bay"
#define kATAInternalSATA2 "serial-ata-2"
#define kATASATA2BayString "sata-2-bay"
#define kATAUnkownSocketString "unknown"
#define kATANotifyOnChangeKey "media-notify"
// allows for porting to non-memory-mapped IO systems, such as x86.
// for such a platform, create a class and overload the assignment operators
// so that the correct IO operation is performed and define the type for that architecture port.
#if defined( __i386__ ) || defined( __x86_64__ )
#include <IOKit/ata/IOATARegI386.h>
#else
#define IOATARegPtr8 volatile UInt8*
#define IOATARegPtr16 volatile UInt16*
#define IOATARegPtr32 volatile UInt32*
#define IOATARegPtr8Cast(x) ((IOATARegPtr8)(x))
#endif
enum ataSocketType{
kUnknownSocket = 0,
kInternalATASocket,
kMediaBaySocket ,
kPCCardSocket,
kInternalSATA,
kSATABay,
kInternalSATA2,
kSATA2Bay
} ;
enum ataDeviceType {
kUnknownATADeviceType = 0,
kATADeviceType,
kATAPIDeviceType
} ;
// enum for bits 5 and 6 of word zero of
// the identify packet device info data.
// shift word-0 5-bits left, mask 0x03 and these enums apply.
enum atapiConfig {
kATAPIDRQSlow = 0x00,
kATAPIIRQPacket = 0x01,
kATAPIDRQFast = 0x10,
kATAPIUnknown = 0x11
};
enum ataUnitID {
kATAInvalidDeviceID = -1,
kATADevice0DeviceID = 0, /* aka, Master. Device 0 is the correct terminology */
kATADevice1DeviceID = 1 /* aka, Slave. Device 1 is the correct terminology */
} ;
enum {
kATADefaultSectorSize = 512
};
/* Task file definition *** Error Register *** */
enum {
bATABadBlock = 7, /* bit number of bad block error bit*/
bATAUncorrectable = 6, /* bit number of uncorrectable error bit*/
bATAMediaChanged = 5, /* bit number of media changed indicator*/
bATAIDNotFound = 4, /* bit number of ID not found error bit*/
bATAMediaChangeReq = 3, /* bit number of media changed request*/
bATACommandAborted = 2, /* bit number of command abort bit*/
bATATrack0NotFound = 1, /* bit number of track not found*/
bATAAddressNotFound = 0, /* bit number of address mark not found*/
mATABadBlock = 1 << bATABadBlock, /* Bad Block Detected*/
mATAUncorrectable = 1 << bATAUncorrectable, /* Uncorrectable Data Error*/
mATAMediaChanged = 1 << bATAMediaChanged, /* Media Changed Indicator (for removable)*/
mATAIDNotFound = 1 << bATAIDNotFound, /* ID Not Found*/
mATAMediaChangeReq = 1 << bATAMediaChangeReq, /* Media Change Requested (NOT IMPLEMENTED)*/
mATACommandAborted = 1 << bATACommandAborted, /* Aborted Command*/
mATATrack0NotFound = 1 << bATATrack0NotFound, /* Track 0 Not Found*/
mATAAddressNotFound = 1 << bATAAddressNotFound /* Address Mark Not Found*/
};
/* Task file definition *** Features register *** */
enum {
bATAPIuseDMA = 0, /* bit number of useDMA bit (ATAPI)*/
mATAPIuseDMA = 1 << bATAPIuseDMA
};
/* Task file definition *** ataTFSDH Register *** */
enum {
mATAHeadNumber = 0x0F, /* Head Number (bits 0-3) */
mATASectorSize = 0xA0, /* bit 7=1; bit 5 = 01 (512 sector size) <DP4>*/
mATADriveSelect = 0x10, /* Drive (0 = master, 1 = slave) */
mATALBASelect = 0x40 /* LBA mode bit (0 = chs, 1 = LBA)*/
};
/* Task file definition *** Status Register *** */
enum {
bATABusy = 7, /* bit number of BSY bit*/
bATADriveReady = 6, /* bit number of drive ready bit*/
bATAWriteFault = 5, /* bit number of write fault bit*/
bATASeekComplete = 4, /* bit number of seek complete bit*/
bATADataRequest = 3, /* bit number of data request bit*/
bATADataCorrected = 2, /* bit number of data corrected bit*/
bATAIndex = 1, /* bit number of index mark*/
bATAError = 0, /* bit number of error bit*/
mATABusy = 1 << bATABusy, /* Unit is busy*/
mATADriveReady = 1 << bATADriveReady, /* Unit is ready*/
mATAWriteFault = 1 << bATAWriteFault, /* Unit has a write fault condition*/
mATASeekComplete = 1 << bATASeekComplete, /* Unit seek complete*/
mATADataRequest = 1 << bATADataRequest, /* Unit data request*/
mATADataCorrected = 1 << bATADataCorrected, /* Data corrected*/
mATAIndex = 1 << bATAIndex, /* Index mark - NOT USED*/
mATAError = 1 << bATAError /* Error condition - see error register*/
};
/* Task file definition *** Device Control Register *** */
enum {
bATADCROne = 3, /* bit number of always one bit*/
bATADCRReset = 2, /* bit number of reset bit*/
bATADCRnIntEnable = 1, /* bit number of interrupt disable*/
mATADCROne = 1 << bATADCROne, /* always one bit*/
mATADCRReset = 1 << bATADCRReset, /* Reset (1 = reset)*/
mATADCRnIntEnable = 1 << bATADCRnIntEnable /* Interrupt Disable(0 = enabled)*/
};
/* 'ataRegMask' field of the ataRegAccess definition*/
enum ataRegMask{
bATAAltSDevCValid = 14, /* bit number of alternate status/device cntrl valid bit*/
bATAStatusCmdValid = 7, /* bit number of status/command valid bit*/
bATASDHValid = 6, /* bit number of ataTFSDH valid bit*/
bATACylinderHiValid = 5, /* bit number of cylinder high valid bit*/
bATACylinderLoValid = 4, /* bit number of cylinder low valid bit*/
bATASectorNumValid = 3, /* bit number of sector number valid bit*/
bATASectorCntValid = 2, /* bit number of sector count valid bit*/
bATAErrFeaturesValid = 1, /* bit number of error/features valid bit*/
bATADataValid = 0, /* bit number of data valid bit*/
mATAAltSDevCValid = 1 << bATAAltSDevCValid, /* alternate status/device control valid*/
mATAStatusCmdValid = 1 << bATAStatusCmdValid, /* status/command valid*/
mATASDHValid = 1 << bATASDHValid, /* ataTFSDH valid*/
mATACylinderHiValid = 1 << bATACylinderHiValid, /* cylinder high valid*/
mATACylinderLoValid = 1 << bATACylinderLoValid, /* cylinder low valid*/
mATASectorNumValid = 1 << bATASectorNumValid, /* sector number valid*/
mATASectorCntValid = 1 << bATASectorCntValid, /* sector count valid*/
mATAErrFeaturesValid = 1 << bATAErrFeaturesValid, /* error/features valid*/
mATADataValid = 1 << bATADataValid /* data valid*/
} ;
enum ataFlags{
bATAFlagQuiesce = 20,
bATAFlagNoIRQ = 19, /* bit Number of no IRQ protocol flag*/
bATAFlag48BitLBA = 18,
bATAFlagDMAQueued = 17,
bATAFlagOverlapped = 16,
bATAFlagUseConfigSpeed = 15, /* bit number of use configured speed flag*/
bATAFlagByteSwap = 14, /* bit number of byte swap flag*/
bATAFlagIORead = 13, /* bit number of I/O read flag*/
bATAFlagIOWrite = 12, /* bit number of I/O write flag*/
bATAFlagTFAccessResult = 8, /* bit number of get register results on command completion.*/
bATAFlagUseDMA = 7, /* bit number of use DMA flag*/
bATAFlagProtocolATAPI = 5, /* bit number of ATAPI protocol*/
bATAFlagImmediate = 1, /* bit number of immediate flag */
bATAFlagTFAccess = 0, /* bit number of TF access */
mATAFlagQuiesce = 1 << bATAFlagQuiesce,
mATAFlagUseNoIRQ = 1 << bATAFlagNoIRQ, /* Special purpose! Avoid using! No-IRQ, polled synchronous protocol valid only for PIO commands*/
mATAFlag48BitLBA = 1 << bATAFlag48BitLBA, /* Use 48 bit extended LBA protocol on this command. Requires support from the controller.*/
mATAFlagDMAQueued = 1 << bATAFlagDMAQueued, /* Use tagged dma queuing protocol on this command. Requires support from the controller.*/
mATAFlagOverlapped = 1 << bATAFlagOverlapped, /* Use overllaped protocol on this command. Requires support from the controller.*/
mATAFlagUseConfigSpeed = 1 << bATAFlagUseConfigSpeed, /* Use the configured interface speed = true. False = use default PIO (slow) speed. valid only for PIO commands*/
mATAFlagByteSwap = 1 << bATAFlagByteSwap, /* Swap data bytes (read - after; write - before)*/
mATAFlagIORead = 1 << bATAFlagIORead, /* Read (in) operation*/
mATAFlagIOWrite = 1 << bATAFlagIOWrite, /* Write (out) operation*/
mATAFlagTFAccessResult = 1 << bATAFlagTFAccessResult, /* get contents of TaskFile registers indicated in TFMask on command completion, even if no error*/
mATAFlagUseDMA = 1 << bATAFlagUseDMA,
mATAFlagProtocolATAPI = 1 << bATAFlagProtocolATAPI, /* ATAPI protocol indicator*/
mATAFlagImmediate = 1 << bATAFlagImmediate, /* Put command at head of queue */
mATAFlagTFAccess = 1 << bATAFlagTFAccess, /* Return Taskfile on error status*/
} ;
/* The Function codes sent to controllers*/
enum ataOpcode {
kATANoOp = 0,
kATAFnExecIO , /* Execute ATA I/O */
kATAPIFnExecIO, /* ATAPI I/O */
kATAFnRegAccess , /* Register Access */
kATAFnQFlush , /* I/O Queue flush requests for your unit number */
kATAFnBusReset /* Reset ATA bus */
} ;
/* The ATA Event codes */
/* sent when calling the device driver's event handler*/
enum ataEventCode {
kATANullEvent = 0x00, /* Just kidding -- nothing happened*/
kATAOnlineEvent = 0x01, /* An ATA device has come online*/
kATAOfflineEvent = 0x02, /* An ATA device has gone offline*/
kATARemovedEvent = 0x03, /* An ATA device has been removed from the bus*/
kATAResetEvent = 0x04, /* Someone gave a hard reset to the drive*/
kATAOfflineRequest = 0x05, /* Someone requesting to offline the drive*/
kATAEjectRequest = 0x06, /* Someone requesting to eject the drive*/
kATAPIResetEvent = 0x07, /* Someone gave a ATAPI reset to the drive*/
kATAReservedEvent = 0x80 /* RESERVED*/
};
// These need to be combined with a new enumeration of the current ATA/ATAPI command set.
// Some opcodes are of interest to ATA controllers, since they imply special protocols
// or handling. Device Reset, Execute Device Diagnostics have subtle side effects that
// controllers need to be aware of, so we snoop for those commands being issued.
// the rest are here for informational purposes.
// BUG make new enum for all current ATA commands.
enum {
kSOFTRESET = 0x008, // ATAPI Soft Reset command
kPACKET = 0x0A0, // ATAPI Packet command
kID_DRIVE = 0x0A1 // ATAPI Identify drive command
};
/* ATA Command Opcode definition*/
enum {
kATAcmdWORetry = 0x01, /* Without I/O retry option*/
kATAcmdNOP = 0x0000, /* NOP operation - media detect*/
kATAcmdRecal = 0x0010, /* Recalibrate command */
kATAcmdRead = 0x0020, /* Read command */
kATAcmdReadLong = 0x0022, /* Read Long command*/
kATAcmdReadExtended = 0x0024, /* Read Extended (with retries)*/
kATAcmdReadDMAExtended = 0x0025, /* Read DMA Extended (with retries)*/
kATAcmdWrite = 0x0030, /* Write command */
kATAcmdWriteLong = 0x0032, /* Write Long*/
kATAcmdWriteExtended = 0x0034, /* Write Extended (with retries)*/
kATAcmdWriteDMAExtended = 0x0035, /* Write DMA Extended (with retries)*/
kATAcmdWriteVerify = 0x003C, /* Write verify*/
kATAcmdReadVerify = 0x0040, /* Read Verify command */
kATAcmdFormatTrack = 0x0050, /* Format Track command */
kATAcmdSeek = 0x0070, /* Seek command */
kATAcmdDiagnostic = 0x0090, /* Drive Diagnostic command */
kATAcmdInitDrive = 0x0091, /* Init drive parameters command */
kATAcmdReadMultiple = 0x00C4, /* Read multiple*/
kATAcmdWriteMultiple = 0x00C5, /* Write multiple*/
kATAcmdSetRWMultiple = 0x00C6, /* Set Multiple for Read/Write Multiple*/
kATAcmdReadDMA = 0x00C8, /* Read DMA (with retries)*/
kATAcmdWriteDMA = 0x00CA, /* Write DMA (with retries)*/
kATAcmdMCAcknowledge = 0x00DB, /* Acknowledge media change - removable*/
kATAcmdDoorLock = 0x00DE, /* Door lock*/
kATAcmdDoorUnlock = 0x00DF, /* Door unlock*/
kATAcmdStandbyImmed = 0x00E0, /* Standby Immediate*/
kATAcmdIdleImmed = 0x00E1, /* Idle Immediate*/
kATAcmdStandby = 0x00E2, /* Standby*/
kATAcmdIdle = 0x00E3, /* Idle*/
kATAcmdReadBuffer = 0x00E4, /* Read sector buffer command */
kATAcmdCheckPowerMode = 0x00E5, /* Check power mode command <04/04/94>*/
kATAcmdSleep = 0x00E6, /* Sleep*/
kATAcmdFlushCache = 0x00E7, /* Flush Cache */
kATAcmdWriteBuffer = 0x00E8, /* Write sector buffer command */
kATAcmdWriteSame = 0x00E9, /* Write same data to multiple sectors*/
kATAcmdFlushCacheExtended = 0x00EA, /* Flush Cache Extended */
kATAcmdDriveIdentify = 0x00EC, /* Identify Drive command */
kATAcmdMediaEject = 0x00ED, /* Media Eject*/
kATAcmdSetFeatures = 0x00EF /* Set Features*/
};
/* Set feature command opcodes*/
enum {
kATAEnableWriteCache = 0x02, /* Enable write cache*/
kATASetTransferMode = 0x03, /* Set transfer mode*/
kATAEnableAPM = 0x05, /* Enable Advanced Power Management*/
kATASetPIOMode = 0x08, /* PIO Flow Control Tx Mode bit*/
kATADisableWriteCache = 0x82, /* disable write cache*/
kATAEnableReadAhead = 0xAA /* Read look-ahead enable*/
};
// revisit the opcode enumerations.
//////////////////////
/* task file for ata */
typedef struct ataTaskFile {
UInt8 ataTFFeatures; /* <-> Error(R) or ataTFFeatures(W) register image */
UInt8 ataTFCount; /* <-> Sector count/remaining */
UInt8 ataTFSector; /* <-> Sector start/finish */
UInt8 ataTFCylLo; /* <-> ataTFCylLo */
UInt8 ataTFCylHigh; /* <-> ataTFCylHigh */
UInt8 ataTFSDH; /* <-> ataTFSDH register image*/
UInt8 ataTFCommand; /* <-> Status(R) or Command(W) register image */
} ataTaskFile;
typedef struct ataRegisterImage {
ataTaskFile taskFile;
UInt16 ataDataRegister; /* <-> Data register. */
UInt8 ataAltSDevCReg; /* <->: Alternate status(R) or Device Control(W) register image*/
} ataRegisterImage ;
typedef struct ATAPICmdPacket{
UInt16 atapiPacketSize; /* Size of command packet in bytes */
UInt16 atapiCommandByte[8]; /* The command packet itself*/
}ATAPICmdPacket;
// Error and result codes: TBD
enum {
kATAErrUnknownType = -1,
kATANoErr = 0,
kATAQueueEmpty = 1,
kATAUnknownOpcode,
kATATimeoutErr,
kATAInvalidDevID,
kATAErrDevBusy,
kATAModeNotSupported,
kATADevIntNoCmd,
kATADeviceError,
kATADMAErr
};
#endif /* !_IOATATYPES_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/ata/IOATADevConfig.h | /*
* Copyright (c) 2000-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOATADEVCONFIG_H
#define _IOATADEVCONFIG_H
#include <libkern/c++/OSObject.h>
#include <IOKit/IOTypes.h>
#include "IOATATypes.h"
#include "IOATABusInfo.h"
/*!
@class IOATADevConfig
@abstract used for configuring and communicating the desired transfer modes of a device.
A disk driver would typically use this object in conjunction with the 512-bytes of identification
data from the drive and the IOATABusInfo object for the bus it is connected to.
This object will determine the best matching transfer speeds available.
the device driver will then send a series of Set Features commands to configure the drive
and this object to the bus through the IOATADevice nub in order to configure the optimum transfer mode.
The driver for the disk drive may choose to populate this object with whatever transfer mode
desired, in the event that a different mode is required.
@discussion usually use the initWithBestSelection to make a best mode match.
The Mode accessors use bit significance to indicate a selected mode or supported modes(s)
ie, 00000001b indicates Mode-0, 00000010b indicates mode 1, etc.
Selected mode is indicated by a single set bit. No bit set indicates no mode in that class is selected.
ie, a bus will support multiple possible modes, but will only have one mode selected at that time.
*/
class IOATADevConfig : public OSObject {
OSDeclareDefaultStructors( IOATADevConfig );
public:
/*!@function atadevconfig
@abstract static creator function.
*/
static IOATADevConfig* atadevconfig(void);
/*!@function initWithBestSelection
@abstract Handy initializer: pass the 512-byte result of the Identify Device or
Identify Packet Device in endian-order for your platform (byte-swapped on PPC)
and the IOATABusInfo object for the bus. The object will initialize all fields
and select the best transfer modes that match on bus and device.
If the return value was 0 (success or noErr), then a matching mode is supported.
Examine the PIO and UDMA/DMA fields and to generate the apropriate SET FEATURES
parameters for your drive and send this initialised object to the IOATAController
when requesting a speed configuration.
failure means no supported transfer modes matched between bus and device info.
@param identifyData 512 bytes of data obtained from the device via IDENTIFY DEVICE or IDENTIFY PACKET DEVICE command.
@param busInfo pointer to an IOATAbusInfo object obtained from a previous atanub->provideBusInfo() call.
@result kIOSuccess (0) when a matching transfer mode is available between the device and controller.
*/
IOReturn initWithBestSelection( const UInt16* identifyData, IOATABusInfo* busInfo);
// intitialize with the 512 byte data from an ATA device identify command
IOReturn assignFromData( const UInt16* identifyData );
/*!@function setPacketConfig
@param packetConfig
@abstract For ATAPI devices, if the device asserts interrupt after the Packet Command when it is ready to accept the packet, set this value to true (mostly older devices). If the device accepts the packet only by asserting DRQ bit in status, then set this value false. Tells the bus controller whether to wait for packet acceptance or set pending interrupt.
*/
void setPacketConfig ( atapiConfig packetConfig);
/*!@function getPacketConfig
@result atapiConfig as defined in IOATATypes.h
*/
atapiConfig getPacketConfig( void );
// The following Mode accessors use bit significance to indicate a selected mode or supported modes(s)
// ie, 00000001b indicates Mode-0, 00000010b indicates mode 1, etc.
// Selected mode is indicated by a single set bit. No bit set indicates no mode in that class is selected.
// ie, a bus will support multiple possible modes, but will only have one mode selected at that time.
/*!@function setPIOMode
@param inModeBitMap bit-significant map of PIO mode
*/
void setPIOMode( UInt8 inModeBitMap); // bit-significant map of PIO mode(s)
/*!@function getPIOMode
@result bit-significant map of PIO mode
*/
UInt8 getPIOMode( void );
/*!@function setDMAMode
@param inModeBitMap bit-significant map of DMA mode
*/
void setDMAMode( UInt8 inModeBitMap ); // bit-significant map of DMA mode(s)
/*!@function getDMAMode
@result bit-significant map of DMA mode
*/
UInt8 getDMAMode( void );
/*!@function setUltraMode
@param inModeBitMap bit-significant map of Ultra mode
*/
void setUltraMode( UInt8 inModeBitMap ); // bit-significant map of Ultra mode(s)
/*!@function getUltraMode
@result bit-significant map of Ultra mode
*/
UInt8 getUltraMode( void );
// The following cycle time accessors report cycle times in nanoseconds.
// A device requesting a mode should also request a cycle time as reported in the device's identification page.
// A bus controller will configure the bus not to exceed (go faster than) the minimum time requested.
// When a bus controller reports a mode configuration, the cycle time indicates the busses contract not to go
// faster than. However an actual cycle time may be slower than the indicated time.
/*!@function setPIOCycleTime
@param inNS PIO cycle time in nanoseconds.
*/
void setPIOCycleTime( UInt16 inNS );
/*!@function getPIOCycleTime
@result reported PIO CycleTime in nanoseconds.
*/
UInt16 getPIOCycleTime( void );
/*!@function setDMACycleTime
@param inNS reported multiword DMA Cycle time in nanoseconds.
*/
void setDMACycleTime( UInt16 inNS );
/*!@function getDMACycleTime
@result Reported multiword DMA cycle time in nanoseconds.
*/
UInt16 getDMACycleTime( void );
// Ultra ATA defines cycle times a device must meet to comply with standards.
// No cycle time field is needed.
// convert bit-significant to numeric value
/*!@function bitSigToNumeric
@abstract converts a bit-significant field to a numerical value. Note that a bit field of 0x00 has no defined result.
@param binary the bit significant field.
@result the numerical value of the highest bit set in the field.
*/
virtual UInt8 bitSigToNumeric( UInt16 binary);
protected:
atapiConfig _atapiIRQForPacket; // enum for bits 5 and 6 of word zero of
// the identify packet device info data for PACKET devices ONLY.
// shift word-0 5-bits left, mask 0x03 and these enums apply.
// values are:
// kATAPIDRQSlow = 0x00 - wait up to 3MS for packet on DRQ
// kATAPIIRQPacket = 0x01, - device asserts IRQ for packet
// kATAPIDRQFast = 0x10, - packet on DRQ within 50us
// kATAPIUnknown = 0x11 - reserved as of ATA/ATAPI-5
UInt8 _ataPIOMode; /* <->: PIO Mode Timing class bit-significant */
UInt16 _ataPIOCycleTime; /* <->: Cycle time in ns for PIO mode */
UInt8 _ataMultiDMAMode; /* <->: Multiple Word DMA Timing Class bit-significant*/
UInt16 _ataMultiCycleTime; /* <->: Cycle time in ns for Multiword DMA mode */
UInt8 _ataUltraDMAMode; /* <->: Ultra DMA timing class bit-significant */
IOReturn _AssignPIOData( const UInt16* identifyData);
IOReturn _AssignDMAData(const UInt16* identifyData);
IOReturn _AssignUltraData(const UInt16* identifyData);
UInt8 _MostSignificantBit( UInt8 inByte);
virtual bool init();
protected:
/*! @struct ExpansionData
@discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future.
*/
struct ExpansionData { };
/*! @var reserved
Reserved for future use. (Internal use only) */
ExpansionData *reserved;
private:
OSMetaClassDeclareReservedUnused(IOATADevConfig, 0);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 1);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 2);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 3);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 4);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 5);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 6);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 7);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 8);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 9);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 10);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 11);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 12);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 13);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 14);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 15);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 16);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 17);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 18);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 19);
OSMetaClassDeclareReservedUnused(IOATADevConfig, 20);
public:
//some static utility functions to parse the identify data for feature support
static bool sDriveSupports48BitLBA( const UInt16* identifyData );
static UInt32 sDriveExtendedLBASize( UInt32* lbaHi, UInt32* lbaLo, const UInt16* identifyData); // result returned is same as lbaLo.
};
// header doc info goes here. I find putting it within the delcarations more confusing than putting it all in the bottom of the header.
#endif /* !_IOATADEVCONFIG_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/ata/IOATADevice.h | /*
* Copyright (c) 1998-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* IOATADevice.h
*
* This object implements a relay to an ATA Bus where a drive is attached.
*/
#ifndef _IOATADEVICE_H
#define _IOATADEVICE_H
#include <IOKit/IOService.h>
#include <IOKit/IOTypes.h>
#include "IOATATypes.h"
#include "IOATACommand.h"
#include "IOATABusInfo.h"
#include "IOATADevConfig.h"
class IOATAController;
/*!
@class IOATADevice
@abstract This object implements a relay to an ATA Bus where a drive is attached.
@discussion IOATADevice is the superclass which represents a particular device attached to a particular IOATAController (bus). IOATADevice is the provider for ATA mass-storage device drivers.IOATADevice is the factory for all IOATACommand objects and is responsible for creating and freeing IOATACommands. IOATAControllers will create an instance of IOATADevice for each device physically connected to the ata bus. IOATADevice is virtual and specific subclass should be implemented for particular types of IOATAController. In this manner, controller-specifc IOATACommands may be paired with the proper type of controller.
*/
class IOATADevice : public IOService
{
OSDeclareDefaultStructors(IOATADevice);
public:
//
/*!@function getUnitID
@abstract Determine whether this device is number 0 or 1 (ie, master/slave)
@result ataUnitID - 0 or 1.
*/
virtual ataUnitID getUnitID( void );
//
/*!@function getDeviceType
@abstract Find out what kind of device this nub is (ata or atapi)
@result ataDeviceType as defined in IOATATypes.h
*/
virtual ataDeviceType getDeviceType( void );
//
/*!@function provideBusInfo
@abstract Find out the bus capability so the client can choose the features to set and commands to run.
@param getInfo a pointer to a valid IOATABusInfo object.
@result kIOSuccess (0) and the getInfo object will be filled out by the bus controller with information about the bus.
*/
virtual IOReturn provideBusInfo( IOATABusInfo* getInfo);
//
/*!@function selectConfig
@abstract Tell the bus what speed to use for your device.
@param configRequest pointer to a valid and initialized IOATADevConfig object.
@result kIOSuccess (0) if the configuration was succesfully selected.
@discussion This should only be called once during a disk drivers start method before registering its availability, and must be called prior to issuing any data IO transactions.
*/
virtual IOReturn selectConfig( IOATADevConfig* configRequest);
//
/*!@function provideConfig
@abstract Find out what speed the bus has configured for this unit.
@param configRequest pointer to a valid IOATADevConfig object.
@result kIOSuccess (0) on successful completion and configRequest will contain the configuration information.
*/
virtual IOReturn provideConfig( IOATADevConfig* configRequest);
// Submit IO requests
/*!
@function executeCommand
@abstract Submit IO requests
@param command pointer to a valid IOATACommand with the command to be executed.
@result kIOSuccess (0) if the command was successfully queued in the controller.
*/
virtual IOReturn executeCommand(IOATACommand* command);
// create and destroy IOATACommands
/*!
@function allocCommand
@abstract create IOATACommands. Device drivers should allocate command objects only through this method.
@result null if allocation failed. Retain count is one.
*/
virtual IOATACommand* allocCommand( void );
/*!
@function freeCommand
@abstract release a command object that is no longer needed. Do not free an object in use and do not release the object anymore times than you have retained it.
@param inCommand the command to be released.
*/
virtual void freeCommand( IOATACommand* inCommand);
// matching stuff for IOBSDInit and so on.
/*!@function matchPropertyTable
@abstract matching stuff for IOBSDInit and so on.
*/
virtual bool matchPropertyTable(OSDictionary * table);
/*!@function matchLocation
@abstract matching stuff for IOBSDInit and so on.
*/
virtual IOService* matchLocation(IOService * client);
/*!@function matchPropertyTable
@abstract matching stuff for IOBSDInit and so on.
*/
virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score);
// called by controllers when they need to send a message to client drivers.
/*!
@function notifyEvent
@abstract called by controllers when they need to send a message to client (disk) drivers.
*/
virtual void notifyEvent( UInt32 event );
protected:
IOATAController* _provider;
ataUnitID _unitNumber; // 0 - master, 1 - slave, -1 = not Valid
ataDeviceType _deviceType; // ata, atapi, unknown
protected:
/*! @struct ExpansionData
@discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future.
*/
struct ExpansionData { };
/*! @var reserved
Reserved for future use. (Internal use only) */
ExpansionData *reserved;
private:
OSMetaClassDeclareReservedUnused(IOATADevice, 0);
OSMetaClassDeclareReservedUnused(IOATADevice, 1);
OSMetaClassDeclareReservedUnused(IOATADevice, 2);
OSMetaClassDeclareReservedUnused(IOATADevice, 3);
OSMetaClassDeclareReservedUnused(IOATADevice, 4);
OSMetaClassDeclareReservedUnused(IOATADevice, 5);
OSMetaClassDeclareReservedUnused(IOATADevice, 6);
OSMetaClassDeclareReservedUnused(IOATADevice, 7);
OSMetaClassDeclareReservedUnused(IOATADevice, 8);
OSMetaClassDeclareReservedUnused(IOATADevice, 9);
OSMetaClassDeclareReservedUnused(IOATADevice, 10);
OSMetaClassDeclareReservedUnused(IOATADevice, 11);
OSMetaClassDeclareReservedUnused(IOATADevice, 12);
OSMetaClassDeclareReservedUnused(IOATADevice, 13);
OSMetaClassDeclareReservedUnused(IOATADevice, 14);
OSMetaClassDeclareReservedUnused(IOATADevice, 15);
OSMetaClassDeclareReservedUnused(IOATADevice, 16);
OSMetaClassDeclareReservedUnused(IOATADevice, 17);
OSMetaClassDeclareReservedUnused(IOATADevice, 18);
OSMetaClassDeclareReservedUnused(IOATADevice, 19);
OSMetaClassDeclareReservedUnused(IOATADevice, 20);
};
#endif /* !_IOATABUSNUB_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/ata/ATATimerEventSource.h | /*
* Copyright (c) 2001-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _ATATIMEREVENTSOURCE_H
#define _ATATIMEREVENTSOURCE_H
#include <IOKit/IOTypes.h>
#include <IOKit/IOCommandGate.h>
#include <IOKit/IOService.h>
#include <IOKit/IOWorkLoop.h>
#include <IOKit/IOTimerEventSource.h>
#include <IOKit/ndrvsupport/IOMacOSTypes.h>
/*!
@class ATATimerEventSource
@discussion
Extend the timer event source to allow checking for timer expiration
from behind the workloop.
*/
class ATATimerEventSource : public IOTimerEventSource
{
OSDeclareDefaultStructors(ATATimerEventSource);
public:
/*!@function ataTimerEventSource
@abstract allocate an instance of this type.
*/
static ATATimerEventSource *
ataTimerEventSource(OSObject *owner, Action action = 0);
/*!@function hasTimedOut
@abstract returns true if the timer has expired since the last enable/disable or setTimeout() or wakeAtTime() call.
*/
virtual bool hasTimedOut( void );
// override to initialize the time out flag.
/*!@function
@abstract
*/
virtual bool init(OSObject *owner, Action action = 0);
/*!@function enable
@abstract overrides in order to set/clear the timed out flag
*/
virtual void enable();
/*!@function disable
@abstract overrides in order to set/clear the timed out flag
*/
virtual void disable();
/*!@function wakeAtTime
@abstract overrides in order to set/clear the timed out flag
*/
virtual IOReturn wakeAtTime(UnsignedWide abstime);
/*!@function cancelTimeout
@abstract overrides in order to set/clear the timed out flag
*/
virtual void cancelTimeout();
protected:
enum{ kTimedOutTrue = 'true',
kTimedOutFalse = 'fals'
};
UInt32 hasExpired;
/*!@function myTimeout
@abstract my timeout function which sets the timedOut flag atomically.
*/
static void myTimeout(void *self);
/*!@function setTimeoutFunc
@abstract override to install my timeout function instead of the super's.
*/
virtual void setTimeoutFunc();
/*! @struct ExpansionData
@discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future.
*/
struct ExpansionData { };
/*! @var reserved
Reserved for future use. (Internal use only) */
ExpansionData *reserved;
private:
OSMetaClassDeclareReservedUnused(ATATimerEventSource, 0);
OSMetaClassDeclareReservedUnused(ATATimerEventSource, 1);
OSMetaClassDeclareReservedUnused(ATATimerEventSource, 2);
OSMetaClassDeclareReservedUnused(ATATimerEventSource, 3);
OSMetaClassDeclareReservedUnused(ATATimerEventSource, 4);
OSMetaClassDeclareReservedUnused(ATATimerEventSource, 5);
OSMetaClassDeclareReservedUnused(ATATimerEventSource, 6);
OSMetaClassDeclareReservedUnused(ATATimerEventSource, 7);
};
#endif /*_ATATIMEREVENTSOURCE_H*/
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/ata/IOATACommand.h | /*
* Copyright (c) 1998-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
*
* IOATACommand.h
*
*/
#ifndef _IOATACOMMAND_H
#define _IOATACOMMAND_H
#include <libkern/c++/OSObject.h>
#include <IOKit/IOTypes.h>
#include <IOKit/IOMemoryDescriptor.h>
#include <IOKit/IOCommand.h>
#include "IOATATypes.h"
class IOExtendedLBA;
class IOATACommand;
/*! @typedef IOATACompletionFunction callback function for ATA disk devices.
*/
typedef void (IOATACompletionFunction)(IOATACommand* command );
/*!
@class IOATACommand
@discussion
Command structure superclass, created and freed only by IOATADevice objects
populated by disk device drivers with command parameters
then submitted for operation to their IOATADevice provider for execution.
IOATACommand is a virtual class, a concrete subclass contains the methods and fields needed
by IOATAControllers. Subclasses may be specific to particular controller hardware.
Disk device drivers will only have visibility to this interface and may not subclass this object.
Disk device drivers should instead make use of the void* refcon field which the controllers will not
touch
*/
class IOATACommand : public IOCommand {
OSDeclareAbstractStructors( IOATACommand );
public:
/*!@function zeroCommand
@abstract set to blank state, MUST call prior to re-use of this object
*/
virtual void zeroCommand(void);
/*!@function setOpcode
@abstract command opcode as defined in IOATATypes.
*/
virtual void setOpcode( ataOpcode inCode);
/*!@function setFlags
@abstract set the flags for this command, as defined in IOATATypes.
*/
virtual void setFlags( UInt32 inFlags);
/*!@function setUnit
@abstract set the unit number for this command.
*/
virtual void setUnit( ataUnitID inUnit);
/*!@function setTimeoutMS
@abstract how long to allow this command to complete, in milliseconds, once issued to
the hardware. if the time period expires, this command will return with a timeout error.
*/
virtual void setTimeoutMS( UInt32 inMs);
/*!@function setCallbackPtr
@abstract set the function pointer to call when this command completes.
*/
virtual void setCallbackPtr (IOATACompletionFunction* inCompletion);
/*!@function setRegMask
@abstract used when accessing registers or reading registers on an error result. Mask is defined
in IOATATypes.h
*/
virtual void setRegMask( ataRegMask mask);
// memory information
// Since ATA hardware is limited in the amount of bytes
// that can be transfered in a command, the disk driver shall supply
// a seperate offset and byte count per transfer.
// the offset may be any amount. The byte count must be a multiple of the
// sector size of the device, ie, N * 512 bytes for ata hard drives.
/*!@function setBuffer
@abstract set the IIOMemoryDescriptor for this transaction.
*/
virtual void setBuffer ( IOMemoryDescriptor* inDesc);
/*!@function setPosition
@abstract used to set an offset into the memory descriptor for this transfer.
*/
virtual void setPosition (IOByteCount fromPosition);
/*!@function setByteCount
@abstract set the byte count for this transaction. Should agree with the device command and the
memory descriptor in use.
*/
virtual void setByteCount (IOByteCount numBytes);
/*!@function setTransferChunkSize
@abstract set the size of transfer between intervening interrupts. necessary when doing PIO Read/Write Multiple, etc. so the controller knows when to expect an interrupt during multi-sector data transfers.
*/
virtual void setTransferChunkSize( IOByteCount chunk = kATADefaultSectorSize);
/*!@function setFeatures
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual void setFeatures( UInt8 in);
/*!@function getErrorReg
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual UInt8 getErrorReg (void );
/*!@function setSectorCount
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual void setSectorCount( UInt8 in);
/*!@function getSectorCount
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual UInt8 getSectorCount (void );
/*!@function setSectorNumber
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual void setSectorNumber( UInt8 in);
/*!@function getSectorNumber
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual UInt8 getSectorNumber (void );
/*!@function setCylLo
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual void setCylLo ( UInt8 in);
/*!@function getCylLo
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual UInt8 getCylLo (void );
/*!@function setCylHi
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual void setCylHi( UInt8 in);
/*!@function getCylHi
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual UInt8 getCylHi (void );
/*!@function setDevice_Head
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual void setDevice_Head( UInt8 in);
/*!@function getDevice_Head
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual UInt8 getDevice_Head (void );
/*!@function setCommand
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual void setCommand ( UInt8 in);
/*!@function getStatus
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual UInt8 getStatus (void );
/*!@function setLBA28
@abstract convenience method that sets the taskfile registers into a 28-bit LBA address, with unit selected and LBA bit set. return err if param out of range, return kIOSuccess (kATANoErr) = 0 on return if successful
*/
virtual IOReturn setLBA28( UInt32 lba, ataUnitID inUnit);
/*!@function setPacketCommand
@abstract ATAPI command packet max size is 16 bytes. Makes deep copy of data.
*/
virtual IOReturn setPacketCommand( UInt16 packetSizeBytes, UInt8* command);
// the following registers are only accessed by register access
// commands. Not by normal command dispatch where they are handled
// by the controller.
// not part of task file params. not written to device when sending commands.
virtual void setDataReg ( UInt16 in);
virtual UInt16 getDataReg (void );
// not part of taskfile. Not usually used except by controller.
virtual void setControl ( UInt8 in);
virtual UInt8 getAltStatus (void );
// return values
/*!@function getResult
@abstract IOReturn value of the result of this command. ATA family errors are defined in IOATATypes.h
*/
virtual IOReturn getResult (void);
/*!@function getBuffer
@abstract the IOMemoryDescriptor used in this transaction.
*/
virtual IOMemoryDescriptor* getBuffer ( void );
/*!@function getActualTransfer
@abstract The byte count on the ending result, as best as can be determined by the controller. May be zero, but partial transfer may have occurred on error in some cases.
*/
virtual IOByteCount getActualTransfer ( void );
/*!@function getEndStatusReg
@abstract the value of the status register on the end of the command.
*/
virtual UInt8 getEndStatusReg (void); // always returned
/*!@function getEndErrorReg
@abstract If the error bit was set in the status register, the value of the error register is returned at the end of a command.
*/
virtual UInt8 getEndErrorReg( void );
/*!@function getCommandInUse
@abstract returns true if IOATAController is still in control of the command.
*/
virtual bool getCommandInUse( void ); // returns true if IOATAController is using the command.
// for use by disk drivers, clients of IOATADevice only.
// IOATADevice and IOATAControllers shall not use this field in any manner
/*!@var refCon
@abstract for use by disk drivers, clients of IOATADevice only. IOATADevice and IOATAControllers shall not use this field in any manner.
*/
void* refCon;
/*!@var refCon2
@abstract for use by disk drivers, clients of IOATADevice only. IOATADevice and IOATAControllers shall not use this field in any manner.
*/
void* refCon2;
protected:
// < return from ATA controllers to disk drivers
// > sent to ATA controllers from disk drivers
ataOpcode _opCode; // > Command code for the controller.
UInt32 _flags; // > Flags for this command
ataRegisterImage _taskFile; // <> Taskfile + data and control registers.
ATAPICmdPacket _packet; // > ATAPI packet
ataUnitID _unit; // > Unit number
UInt32 _timeoutMS; // > timeout command in ms.
IOMemoryDescriptor* _desc; // > Buffer for data may be nil if command transfer no data
IOByteCount _position; // > Position within the descriptor for this command
IOByteCount _byteCount; // > How many bytes to transfer.
IOByteCount _logicalChunkSize; // > How many bytes between intervening interrupts (R/W Multiple)
ataRegMask _regMask; // > Which registers to write or read for reg access commands
IOATACompletionFunction* _callback; // > if nil, command is synchronous
IOReturn _result; // < result
IOByteCount _actualByteCount; // < actual bytes transfered.
UInt8 _status; // < Status register at end of command
UInt8 _errReg; // < Error register at end of command if error bit set.
bool _inUse; // < true while IOATAController has possesion of the command
virtual bool init();
protected:
/*! @struct ExpansionData
@discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future.
*/
struct ExpansionData {IOExtendedLBA* extLBA; };
/*! @var reserved
Reserved for future use. (Internal use only) */
ExpansionData *fExpansionData;
// overrides
virtual void free();
private:
OSMetaClassDeclareReservedUsed(IOATACommand, 0); // set end result
OSMetaClassDeclareReservedUsed(IOATACommand, 1); // get extendedLBAPtr
OSMetaClassDeclareReservedUnused(IOATACommand, 2);
OSMetaClassDeclareReservedUnused(IOATACommand, 3);
OSMetaClassDeclareReservedUnused(IOATACommand, 4);
OSMetaClassDeclareReservedUnused(IOATACommand, 5);
OSMetaClassDeclareReservedUnused(IOATACommand, 6);
OSMetaClassDeclareReservedUnused(IOATACommand, 7);
OSMetaClassDeclareReservedUnused(IOATACommand, 8);
OSMetaClassDeclareReservedUnused(IOATACommand, 9);
OSMetaClassDeclareReservedUnused(IOATACommand, 10);
OSMetaClassDeclareReservedUnused(IOATACommand, 11);
OSMetaClassDeclareReservedUnused(IOATACommand, 12);
OSMetaClassDeclareReservedUnused(IOATACommand, 13);
OSMetaClassDeclareReservedUnused(IOATACommand, 14);
OSMetaClassDeclareReservedUnused(IOATACommand, 15);
OSMetaClassDeclareReservedUnused(IOATACommand, 16);
OSMetaClassDeclareReservedUnused(IOATACommand, 17);
OSMetaClassDeclareReservedUnused(IOATACommand, 18);
OSMetaClassDeclareReservedUnused(IOATACommand, 19);
OSMetaClassDeclareReservedUnused(IOATACommand, 20);
public:
virtual void setEndResult(UInt8 inStatus, UInt8 endError );
virtual IOExtendedLBA* getExtendedLBA(void);
};
/*!
@class IOExtendedLBA
@discussion
If 48-bit LBAs are supported, IOExtendedLBA is used to represent a 48-bit LBA.
The driver examines the ATA identify data to determine if 48-bit addressing is
supported.
*/
class IOExtendedLBA : public OSObject
{
OSDeclareDefaultStructors( IOExtendedLBA );
public:
static IOExtendedLBA* createIOExtendedLBA(IOATACommand* owner);
// terminology as established in ATA/ATAPI-6.
// for the extended LBA address
/*!@function setLBALow16
@abstract convenience method that sets the lower 16 bits of a 48-bit LBA
*/
virtual void setLBALow16( UInt16 lbaLow);
/*!@function getLBALow16
@abstract convenience method that gets the lower 16 bits of a 48-bit LBA
*/
virtual UInt16 getLBALow16 (void);
/*!@function setLBAMid16
@abstract convenience method that sets the middle 16 bits of a 48-bit LBA
*/
virtual void setLBAMid16 (UInt16 lbaMid);
/*!@function getLBAMid16
@abstract convenience method that gets the middle 16 bits of a 48-bit LBA
*/
virtual UInt16 getLBAMid16( void );
/*!@function setLBAHigh16
@abstract convenience method that sets the high 16 bits of a 48-bit LBA
*/
virtual void setLBAHigh16( UInt16 lbaHigh );
/*!@function getLBAHigh16
@abstract convenience method that gets the high 16 bits of a 48-bit LBA
*/
virtual UInt16 getLBAHigh16( void );
/*!@function setSectorCount16
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual void setSectorCount16( UInt16 sectorCount );
/*!@function getSectorCount16
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual UInt16 getSectorCount16( void );
/*!@function setFeatures16
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual void setFeatures16( UInt16 features );
/*!@function getFeatures16
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual UInt16 getFeatures16( void );
/*!@function setDevice
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual void setDevice( UInt8 inDevice );
/*!@function getDevice
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual UInt8 getDevice( void );
/*!@function setCommand
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual void setCommand( UInt8 inCommand );
/*!@function getCommand
@abstract Taskfile access. Registers are named in accordance with ATA Standards conventions
*/
virtual UInt8 getCommand( void );
/*!@function setExtendedLBA
@abstract convenience method that sets the taskfile registers into a 48-bit LBA address, along with sector count, and unit selected and LBA bit set
*/
virtual void setExtendedLBA( UInt32 inLBAHi, UInt32 inLBALo, ataUnitID inUnit, UInt16 extendedCount, UInt8 extendedCommand);
/*!@function getExtendedLBA
@abstract convenience method that gets a 48-bit LBA
*/
virtual void getExtendedLBA( UInt32* outLBAHi, UInt32* outLBALo );
/*!@function zeroData
@abstract convenience method that zeros out the lba, sector count, features, device, and command member variables
*/
virtual void zeroData(void);
/*! @struct ExpansionData
@discussion This structure will be used to expand the capablilties in the future.
*/
struct ExpansionData { };
/*! @var reserved
Reserved for future use. (Internal use only) */
ExpansionData *reserved;
protected:
IOATACommand* owner;
UInt16 lbaLow;
UInt16 lbaMid;
UInt16 lbaHigh;
UInt16 sectorCount;
UInt16 features;
UInt16 device;
UInt16 command;
private:
OSMetaClassDeclareReservedUnused(IOExtendedLBA, 0);
OSMetaClassDeclareReservedUnused(IOExtendedLBA, 1);
OSMetaClassDeclareReservedUnused(IOExtendedLBA, 2);
OSMetaClassDeclareReservedUnused(IOExtendedLBA, 3);
OSMetaClassDeclareReservedUnused(IOExtendedLBA, 4);
OSMetaClassDeclareReservedUnused(IOExtendedLBA, 5);
OSMetaClassDeclareReservedUnused(IOExtendedLBA, 6);
OSMetaClassDeclareReservedUnused(IOExtendedLBA, 7);
OSMetaClassDeclareReservedUnused(IOExtendedLBA, 8);
OSMetaClassDeclareReservedUnused(IOExtendedLBA, 9);
OSMetaClassDeclareReservedUnused(IOExtendedLBA, 10);
};
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/ata/IOATARegI386.h | /*
* Copyright (c) 2000-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOATAREGI386_H
#define _IOATAREGI386_H
#include <libkern/c++/OSObject.h>
/*
* IOATAReg: ATA register abstract base class.
*/
#define DefineIOATAReg(w) \
class IOATAReg##w : public OSObject \
{ \
OSDeclareAbstractStructors( IOATAReg##w ) \
\
public: \
virtual void operator = (UInt##w rhs) = 0; \
virtual operator UInt##w() const = 0; \
}
DefineIOATAReg( 8 );
DefineIOATAReg( 16 );
DefineIOATAReg( 32 );
typedef IOATAReg8 * IOATARegPtr8;
typedef IOATAReg16 * IOATARegPtr16;
typedef IOATAReg32 * IOATARegPtr32;
#define IOATARegPtr8Cast(x) (x)
/*
* IOATAIOReg: I/O mapped ATA registers.
*/
#define DefineIOATAIOReg(w) \
class IOATAIOReg##w : public IOATAReg##w \
{ \
OSDeclareDefaultStructors( IOATAIOReg##w ) \
\
protected: \
UInt16 _address; \
\
public: \
static IOATAIOReg##w * withAddress( UInt16 address ); \
\
virtual bool initWithAddress( UInt16 address ); \
virtual UInt16 getAddress() const; \
\
virtual void operator = (UInt##w rhs); \
virtual operator UInt##w() const; \
}
DefineIOATAIOReg( 8 );
DefineIOATAIOReg( 16 );
DefineIOATAIOReg( 32 );
#endif /* !_IOATAREGI386_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/ata/IOATAController.h | /*
* Copyright (c) 1998-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOATACONTROLLER_H
#define _IOATACONTROLLER_H
#include <IOKit/IOTypes.h>
#include <IOKit/IOBufferMemoryDescriptor.h>
#include <IOKit/IOCommandGate.h>
#include <IOKit/IOService.h>
#include <IOKit/IOWorkLoop.h>
#include "ATATimerEventSource.h"
class IOATADevice;
class IOATABusCommand;
class IOATABusInfo;
class IOATADevConfig;
/*! @class IOATAController
@abstract The base class for ata controller family. Provides the interface common to all ata bus controllers.
@discussion Subclasses of IOATAController implement drivers for specific bus hardware. Disk devices are clients of
IOATAController and communicate via the IOATABusNub instantiated for each device discovered by the specific IOATAController
subclass when it probes hardware. Via the nub, the ATA Controller provides standard information about bus capability, accepts
requests for transfer mode configuration (timing), accepts requests for IO and bus operations, notifies the device driver about
bus events which may affect the device, such as soft-resets or device removal (ie, media-bay and PC-card) and removal of queued
IO requests which have not been dispatched into the hardware.
@discussion The header doc for this class is incomplete. The source however is heavily commented and should be consulted until
such time as complete header doc is available.
*/
class IOATAController : public IOService
{
OSDeclareDefaultStructors(IOATAController);
public:
/*--- Common ATA Controller Interface ---*/
// find out bus capability
virtual IOReturn provideBusInfo( IOATABusInfo* infoOut);
// set and get bus timing configuration for a specific unit
virtual IOReturn selectConfig( IOATADevConfig* configRequest, UInt32 unitNumber);
virtual IOReturn getConfig( IOATADevConfig* configRequest, UInt32 unitNumber);
// The main call puts something on the work loop
virtual IOReturn executeCommand( IOATADevice* nub, IOATABusCommand* cmd);
/*-- Power Management ---*/
// TBD
/*--- Overrides from IOService ---*/
virtual bool init(OSDictionary * properties);
virtual IOService* probe( IOService* provider, SInt32* score );
virtual bool start( IOService* provider );
protected:
enum {
kBusFree = 'free', // bus is available
kBusBusy = 'busy', // bus is busy with request
kQueueOpen = '!lck', // queue is not locked
kQueueLocked = 'LOCK', // queue is frozen and not
kImmediateLocked = '!Imd', // immediate commands may not be processed
kImmediateOK = 'Immd' // immediate commands allowed.
};
/* Transaction State indicator definition - indicates what action is next*/
enum transState {
kATAInitial = 0x00, // in queue
kATAStarted = 0x01, // issue taskfile
kATAPICmd = 0x02, // issue packet
kATADataTx = 0x03, // data transfer phase
kATAStatus = 0x04, // read status
kATAComplete = 0x05, // io complete
kATADone = 0x06 // completion callout called
};
struct ataDevInfo {
ataDeviceType type; // ata, atapi, unknown
atapiConfig packetSend; // slow DRQ, IRQ, or fast DRQ for packet
};
struct ataDoubleBuffer
{
IOPhysicalAddress physicalBuffer;
IOLogicalAddress logicalBuffer;
IOByteCount bufferSize;
};
IOService* _provider;
IOWorkLoop* _workLoop;
IOCommandGate* _cmdGate;
ATATimerEventSource* _timer;
queue_head_t _commandQueue;
IOATABusCommand* _currentCommand;
UInt32 _busState;
UInt32 _queueState;
UInt32 _immediateGate;
ataUnitID _selectedUnit;
ataDevInfo _devInfo[2];
IOATADevice* _nub[2];
ataDoubleBuffer _doubleBuffer;
IOATARegPtr8 _tfFeatureReg;
IOATARegPtr8 _tfSCountReg;
IOATARegPtr8 _tfSectorNReg;
IOATARegPtr8 _tfCylLoReg;
IOATARegPtr8 _tfCylHiReg;
IOATARegPtr8 _tfSDHReg;
IOATARegPtr8 _tfStatusCmdReg;
IOATARegPtr16 _tfDataReg;
IOATARegPtr8 _tfAltSDevCReg;
// false if couldn't allocate the per-bus double buffer.
// controllers should provide implementation where needed
// for DMA hardware compatibility. The default method provides
// a 4K buffer for PIO since MemoryDescriptors do not by default have
// logical addresses in the kernel space.
virtual bool allocateDoubleBuffer( void );
// perform 2-byte endian swap. Only useful on PIO transfers and identify data
virtual void swapBytes16( UInt8* dataBuffer, IOByteCount length);
/*! @function handleCommand
@abstract Called by executeCommand() to handle the client command
from the workloop context.
@param command The command code.
@param param1 Command parameter.
@param param2 Command parameter.
@param param3 Command parameter.
@result kIOReturnSuccess on success, or an error code otherwise. */
virtual IOReturn handleCommand( void * command,
void * param1 = 0,
void * param2 = 0,
void * param3 = 0);
/*! @function busCanDispatch
@abstract answers whether the bus is in state such that the next command
can be dispatched.
@result true - bus is free to issue commands. false - bus cannot issue
commands at this time. */
virtual bool busCanDispatch( void );
/*! @function dispatchNext
@abstract Causes the command at the front of the queue to dequeue, made the
current command and begin execution.
@result noErr indicates successful dispatch. */
virtual IOReturn dispatchNext( void );
// sets the result code, free's the bus state, dispatch next command and execute completion
virtual void completeIO( IOReturn commandResult );
// Command queue handlers.
virtual IOReturn enqueueCommand( IOATABusCommand* command);
virtual IOATABusCommand* dequeueFirstCommand( void );
// event notifier for clients
virtual void executeEventCallouts( ataEventCode event, ataUnitID unit);
// default handler for device interrupts.
virtual IOReturn handleDeviceInterrupt( void );
// timer functions
// starts the timeout on the current command
virtual IOReturn startTimer( UInt32 inMS);
//disable and clear a running timer.
virtual void stopTimer( void );
// called when a timeout occurs.
virtual void handleTimeout( void );
// true if the timer has expired
virtual bool checkTimeout( void );
// handle IO opcodes
virtual IOReturn handleExecIO( void );
virtual IOReturn handleRegAccess( void );
virtual IOReturn handleBusReset(void);
virtual IOReturn handleQueueFlush( void );
// various protocol phases
virtual IOReturn asyncData(void);
virtual IOReturn asyncStatus(void);
virtual IOReturn asyncIO(void);
virtual IOReturn asyncCommand(void);
virtual IOReturn synchronousIO(void);
// hardware access
virtual IOReturn selectDevice( ataUnitID unit );
virtual IOReturn issueCommand( void );
virtual IOReturn writePacket( void );
virtual IOReturn softResetBus( bool doATAPI = false );
virtual IOReturn startDMA( void );
virtual IOReturn stopDMA( void );
virtual bool ATAPISlaveExists( void );
virtual UInt32 scanForDrives( void );
virtual bool waitForU8Status (UInt8 mask, UInt8 value);
virtual IOByteCount readATAPIByteCount( void );
virtual void handleOverrun( IOByteCount length);
virtual IOReturn registerAccess(bool isWrite);
// PIO data transfers
virtual IOReturn txDataIn (IOLogicalAddress buf, IOByteCount length);
virtual IOReturn txDataOut (IOLogicalAddress buf, IOByteCount length);
virtual IOATAController::transState determineATAPIState(void);
// device should set the controller to the config for this device
virtual void selectIOTiming( ataUnitID unit );
// subclasses MUST implement this function in order to initialize
// the pointers to the ATA task file registers during start() time.
virtual bool configureTFPointers(void);
// convert a bit-significant indicator to a numeric value.
virtual UInt16 bitSigToNumeric( UInt16 binary);
// for 48 bit register reading and writing
UInt16 readExtRegister( IOATARegPtr8 inRegister );
void writeExtRegister( IOATARegPtr8 inRegister, UInt16 inValue );
// overrides
virtual void free();
private:
// used called by the commandgate in executeCommand.
static void executeCommandAction(OSObject * owner,
void * arg0,
void * arg1,
void * arg2,
void * arg3);
// callout used by the timer to indicate the timeout failure.
static void timeoutOccured( OSObject *owner,
IOTimerEventSource *sender);
protected:
/*! @struct ExpansionData
@discussion This structure will be used to expand the capablilties of the IOATAController in the future.
*/
typedef struct ExpansionData
{
IOBufferMemoryDescriptor* _doubleBufferDesc;
} ExpansionData;
/*! @var reserved
Reserved for future use. (Internal use only) */
ExpansionData *reserved;
private:
OSMetaClassDeclareReservedUnused(IOATAController, 0);
OSMetaClassDeclareReservedUnused(IOATAController, 1);
OSMetaClassDeclareReservedUnused(IOATAController, 2);
OSMetaClassDeclareReservedUnused(IOATAController, 3);
OSMetaClassDeclareReservedUnused(IOATAController, 4);
OSMetaClassDeclareReservedUnused(IOATAController, 5);
OSMetaClassDeclareReservedUnused(IOATAController, 6);
OSMetaClassDeclareReservedUnused(IOATAController, 7);
OSMetaClassDeclareReservedUnused(IOATAController, 8);
OSMetaClassDeclareReservedUnused(IOATAController, 9);
OSMetaClassDeclareReservedUnused(IOATAController, 10);
OSMetaClassDeclareReservedUnused(IOATAController, 11);
OSMetaClassDeclareReservedUnused(IOATAController, 12);
OSMetaClassDeclareReservedUnused(IOATAController, 13);
OSMetaClassDeclareReservedUnused(IOATAController, 14);
OSMetaClassDeclareReservedUnused(IOATAController, 15);
OSMetaClassDeclareReservedUnused(IOATAController, 16);
OSMetaClassDeclareReservedUnused(IOATAController, 17);
OSMetaClassDeclareReservedUnused(IOATAController, 18);
OSMetaClassDeclareReservedUnused(IOATAController, 19);
OSMetaClassDeclareReservedUnused(IOATAController, 20);
};
#endif /* !_IOATACONTROLLER_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/ata/IOPCIATA.h | /*
* Copyright (c) 1998-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _DRV_PCI_ATA_H
#define _DRV_PCI_ATA_H
#include <libkern/c++/OSObject.h>
#include <IOKit/IOTypes.h>
#include "IOATAController.h"
#include <IOKit/IOMemoryCursor.h>
#include <IOKit/IOBufferMemoryDescriptor.h>
#include <IOKit/IOInterruptEventSource.h>
/*! @class IOPCIATA
@abstract The base class for PCI-IDE ata controller family.
@discussion class defining the common elements of bus-mastering PCI ATA controllers which meet or at least loosely follow the pci bus mastering pci-ide controller spec. Header doc is incomplete, but source is heavily commented.
*/
class IOPCIATA : public IOATAController
{
OSDeclareDefaultStructors(IOPCIATA);
public:
/*--- Overrides from IOATAController ---*/
virtual bool init(OSDictionary * properties);
virtual bool start( IOService* provider );
protected:
// The DMA states: not in use, in use and running with additional passes needed,
// in use on final pass, transfer complete, and failure
enum ATADMAState
{
// DMA state flags
kATADMAInactive,
kATADMAStarting,
kATADMAActive,
kATADMAStatus,
kATADMAComplete,
kATADMAError,
};
enum {
// PRD flags
kLast_PRD = 0x8000,
kContinue_PRD = 0,
};
enum {
mBMCmdStartOutput = 0x01, // start engine to transfer from memory to device.
mBMCmdStartInput = (1 << 3 ) | 0x01, // start engine to transfer from device to memory
mBMCmdStop = 0x00, // halt engine.
};
enum {
// bus master status register definitions.
bBMStatusSimplex = 7, // 0 = simultaneous transactions allowed. 1 = primary and secondary busses may not be active at same time.
bBMStatusDrv1 = 6, // 1 = device 1 and bus are already configured by some other software/firmware
bBMStatusDrv0 = 5, // 1 = device 0 and bus are already configured by some other software/firmware
bBMStatusInt = 2, // 1 = device has asserted INTRQ and all data is flushed to/from memory.
bBMStatusError = 1, // 1 = an error in the DMA has occured. Software clears by writing 1 to this bit.
bBMStatusActive = 0, // 1 = DMA engine is active.
};
enum{
mBMStatusSimplex = 1 << 7,
mBMStatusDrv1 = 1 << 6,
mBMStatusDrv0 = 1 << 5,
mBMStatusInt = 1 << 2,
mBMStatusError = 1 << 1,
mBMStatusActive = 1
};
// the physical region descriptor used for the dma engine.
struct PRD
{
UInt32 bufferPtr; // address
UInt16 byteCount; // 16 bit byte count where 0x0000 = 64K
UInt16 flags; // 0 in flags means contine, 0x80 means stop
};
// descendants of this class MUST initialize these values
// prior to activating any DMA command.
IOATARegPtr8 _bmCommandReg;
IOATARegPtr8 _bmStatusReg;
IOATARegPtr32 _bmPRDAddresReg;
// semaphore for DMA state
UInt32 _dmaState;
// table of PRD descriptors
PRD* _prdTable;
IOPhysicalAddress _prdTablePhysical;
IONaturalMemoryCursor* _DMACursor;
// override from IOATAController
// activate the DMA engine as per the current command
virtual IOReturn startDMA( void );
// override from IOATAController
// safely halt the DMA engine regardless of state
virtual IOReturn stopDMA( void );
// allocate memory for the PRD descriptors.
virtual bool allocDMAChannel(void);
// fill CC with stop commands.
virtual void initATADMAChains (PRD* descPtr);
// fill out a PRD, respecting endianess
virtual void setPRD(UInt8 *bffr, UInt16 count, PRD *tableElement, UInt16 end);
// setup the CC with IO commands
virtual IOReturn createChannelCommands(void);
// deallocate memory for the DMA engine
virtual bool freeDMAChannel(void);
// clean up on device interrupt
virtual IOReturn handleDeviceInterrupt(void);
// activate the DMA engine
virtual void activateDMAEngine(void);
// shutdown the DMA engine
virtual void stopDMAEngine(void);
// safely suspend the DMA engine
virtual void shutDownATADMA (void);
// overrides
virtual void free();
protected:
/*! @struct ExpansionData
@discussion This structure will be used to expand the capablilties of the IOPCIATA class in the future.
*/
typedef struct ExpansionData
{
IOBufferMemoryDescriptor* _prdBuffer;
} ExpansionData;
/*! @var reserved
Reserved for future use. (Internal use only) */
ExpansionData *reserved;
private:
OSMetaClassDeclareReservedUnused(IOPCIATA, 0);
OSMetaClassDeclareReservedUnused(IOPCIATA, 1);
OSMetaClassDeclareReservedUnused(IOPCIATA, 2);
OSMetaClassDeclareReservedUnused(IOPCIATA, 3);
OSMetaClassDeclareReservedUnused(IOPCIATA, 4);
OSMetaClassDeclareReservedUnused(IOPCIATA, 5);
OSMetaClassDeclareReservedUnused(IOPCIATA, 6);
OSMetaClassDeclareReservedUnused(IOPCIATA, 7);
OSMetaClassDeclareReservedUnused(IOPCIATA, 8);
OSMetaClassDeclareReservedUnused(IOPCIATA, 9);
OSMetaClassDeclareReservedUnused(IOPCIATA, 10);
OSMetaClassDeclareReservedUnused(IOPCIATA, 11);
OSMetaClassDeclareReservedUnused(IOPCIATA, 12);
OSMetaClassDeclareReservedUnused(IOPCIATA, 13);
OSMetaClassDeclareReservedUnused(IOPCIATA, 14);
OSMetaClassDeclareReservedUnused(IOPCIATA, 15);
OSMetaClassDeclareReservedUnused(IOPCIATA, 16);
OSMetaClassDeclareReservedUnused(IOPCIATA, 17);
OSMetaClassDeclareReservedUnused(IOPCIATA, 18);
OSMetaClassDeclareReservedUnused(IOPCIATA, 19);
OSMetaClassDeclareReservedUnused(IOPCIATA, 20);
};
#endif // _DRV_PCI_ATA_H
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/ata/IOATABusInfo.h | /*
* Copyright (c) 2000-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOATABUSINFO_H
#define _IOATABUSINFO_H
#include <libkern/c++/OSObject.h>
#include <IOKit/IOTypes.h>
#include "IOATATypes.h"
/*!
@class IOATABusInfo
@discussion used to indicate the capabilities of the bus the device is connected to, PIO and DMA modes supported, etc.
*/
class IOATABusInfo : public OSObject
{
OSDeclareDefaultStructors( IOATABusInfo );
public:
/*!@function atabusinfo
@abstract factory method
*/
static IOATABusInfo* atabusinfo(void);
/*!@function zeroData
@abstract set this object to a blank state.
*/
virtual void zeroData(void);
// Used by clients of ATAControllers to find out about the bus
// capability.
/*!@function getSocketType
@abstract returns the socket type, internal fixed, media-bay, PC-Card
Used by clients of ATAControllers to find out about the bus
*/
ataSocketType getSocketType( void );
/*!@function getPIOModes
@abstract returns the bit-significant map of PIO mode(s) supported on the bus.
Used by clients of ATAControllers to find out about the bus.
*/
UInt8 getPIOModes( void );
/*!@function getDMAModes
@abstract bit-significant map of DMA mode(s) supported on the bus.
Used by clients of ATAControllers to find out about the bus.
*/
UInt8 getDMAModes( void );
/*!@function getUltraModes
@abstract bit-significant map of Ultra mode(s) supported on the bus.
Used by clients of ATAControllers to find out about the bus.
*/
UInt8 getUltraModes( void );
/*!@function getUnits
@abstract How many devices are present on bus.
Used by clients of ATAControllers to find out about the bus.
*/
UInt8 getUnits( void );
/*!@function supportsDMA
@abstract True = DMA supported on bus - inferred by looking at the DMA mode bits.
Used by clients of ATAControllers to find out about the bus.
*/
bool supportsDMA( void );
/*!@function supportsExtendedLBA
@abstract Supports 48-bit LBA if true.
Used by clients of ATAControllers to find out about the bus.
*/
bool supportsExtendedLBA( void );
/*!@function maxBlocksExtended
@abstract The maximum number of 512-byte blocks this controller supports
in a single Extended LBA transfer. Some controllers may be limited to less than
the maximum sector count allowed under extended LBA protocol.
*/
UInt16 maxBlocksExtended(void);
/*!@function supportsOverlapped
@abstract Supports overlapped packet feature set if true.
Used by clients of ATAControllers to find out about the bus.
*/
bool supportsOverlapped( void );
/*!@function supportsDMAQueued
@abstract Supports DMA Queued Feature set if true.
Used by clients of ATAControllers to find out about the bus.
*/
bool supportsDMAQueued( void );
// Used by ATAControllers to generate an information object.
// Would not be used by disk device drivers normally.
// Bus controllers should set these items everytime.
/*!@function setSocketType
@abstract internal fixed, media-bay, PC-Card. Set by ATAControllers.
*/
void setSocketType( ataSocketType inSocketType );
/*!@function setPIOModes
@abstract Bit significant map of supported transfer modes. Set by ATAControllers.
*/
void setPIOModes( UInt8 inModeBitMap);
/*!@function setDMAModes
@abstract Bit significant map of supported transfer modes. Set by ATAControllers.
*/
void setDMAModes( UInt8 inModeBitMap );
/*!@function setUltraModes
@abstract Bit significant map of supported transfer modes. Set by ATAControllers.
*/
void setUltraModes( UInt8 inModeBitMap );
/*!@function setUnits
@abstract set to indicate how many devices are on this bus. Set by ATAControllers.
*/
void setUnits( UInt8 inNumUnits );
// Optional bus protocols some busses may support
/*!@function setExtendedLBA
@abstract Set true for supports 48-bit LBA. Set by ATAControllers.
*/
void setExtendedLBA( bool inState );
/*!function setMaxBlocksExtended
@abstract value set by controllers to indicate the maximum number of blocks
allowed in a single transfer of data. Some dma engines may not be capable of supporting the full
16-bit worth of sector count allowed under 48 bit extended LBA. Default is 256 blocks, same as
standard ATA.
*/
void setMaxBlocksExtended( UInt16 inMaxBlocks);
/*!@function setOverlapped
@abstract Set true for supports overlapped packet feature set. Set by ATAControllers.
*/
void setOverlapped( bool inState);
/*!@function setDMAQueued
@abstract Set true if supports DMA Queued Feature. Set by ATAControllers.
*/
void setDMAQueued( bool inState); //
protected:
UInt8 _PIOModes; /* PIO modes supported (bit-significant) */
UInt8 _MultiDMAModes; /* <--: Multiword DMA modes supported (b-sig) */
UInt8 _UltraDMAModes; /* <--: Ultra DMA modes supported (b-sig) */
bool _ExtendedLBA; /* <--: Suppports 48-bit LBA protocol */
bool _Overlapped; /* <--: Supports overlapped packet feature set */
bool _DMAQueued; /* <--: Supports DMA Queued Feature set */
ataSocketType _SocketType; /* <--: Indicates bus is fixed internal, removable media-bay, removable PC-Card or unknown type */
UInt8 _numUnits; /* <--: How many devices on this bus */
UInt16 _maxBlocksExtended;
protected:
/*! @struct ExpansionData
@discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future.
*/
struct ExpansionData { };
/*! @var reserved
Reserved for future use. (Internal use only) */
ExpansionData *reserved;
virtual bool init();
private:
OSMetaClassDeclareReservedUnused(IOATABusInfo, 0);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 1);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 2);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 3);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 4);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 5);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 6);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 7);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 8);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 9);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 10);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 11);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 12);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 13);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 14);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 15);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 16);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 17);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 18);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 19);
OSMetaClassDeclareReservedUnused(IOATABusInfo, 20);
};
#endif /* !_IOATABUSINFO_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hidsystem/IOHIKeyboard.h | /*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved.
*
* EventSrcPCKeyboard.h - PC Keyboard EventSrc subclass definition
*
* HISTORY
* 28 Aug 1992 Joe Pasqua
* Created.
*/
#ifndef _IOHIKEYBOARD_H
#define _IOHIKEYBOARD_H
#include <IOKit/hidsystem/IOHIDevice.h>
#include <IOKit/hidsystem/IOHIKeyboardMapper.h>
/* Start Action Definitions */
/*
* HISTORICAL NOTE:
* The following entry points were part of the IOHIKeyboardEvents
* protocol.
*/
typedef void (*KeyboardEventAction)( OSObject * target,
/* eventFlags */ unsigned eventType,
/* flags */ unsigned flags,
/* keyCode */ unsigned key,
/* charCode */ unsigned charCode,
/* charSet */ unsigned charSet,
/* originalCharCode */ unsigned origCharCode,
/* originalCharSet */ unsigned origCharSet,
/* keyboardType */ unsigned keyboardType,
/* repeat */ bool repeat,
/* atTime */ AbsoluteTime ts);
typedef void (*KeyboardSpecialEventAction)(OSObject * target,
/* eventType */ unsigned eventType,
/* flags */ unsigned flags,
/* keyCode */ unsigned key,
/* specialty */ unsigned flavor,
/* source id */ UInt64 guid,
/* repeat */ bool repeat,
/* atTime */ AbsoluteTime ts);
typedef void (*UpdateEventFlagsAction)( OSObject * target,
/* flags */ unsigned flags);
/* Event Callback Definitions */
typedef void (*KeyboardEventCallback)(
/* target */ OSObject * target,
/* eventFlags */ unsigned eventType,
/* flags */ unsigned flags,
/* keyCode */ unsigned key,
/* charCode */ unsigned charCode,
/* charSet */ unsigned charSet,
/* originalCharCode */ unsigned origCharCode,
/* originalCharSet */ unsigned origCharSet,
/* keyboardType */ unsigned keyboardType,
/* repeat */ bool repeat,
/* atTime */ AbsoluteTime ts,
/* sender */ OSObject * sender,
/* refcon */ void * refcon);
typedef void (*KeyboardSpecialEventCallback)(
/* target */ OSObject * target,
/* eventType */ unsigned eventType,
/* flags */ unsigned flags,
/* keyCode */ unsigned key,
/* specialty */ unsigned flavor,
/* source id */ UInt64 guid,
/* repeat */ bool repeat,
/* atTime */ AbsoluteTime ts,
/* sender */ OSObject * sender,
/* refcon */ void * refcon);
typedef void (*UpdateEventFlagsCallback)(
/* target */ OSObject * target,
/* flags */ unsigned flags,
/* sender */ OSObject * sender,
/* refcon */ void * refcon);
/* End Action Definitions */
/* Default key repeat parameters */
#define EV_DEFAULTINITIALREPEAT 500000000ULL // 1/2 sec in nanoseconds
#define EV_DEFAULTKEYREPEAT 83333333ULL // 1/12 sec in nanoseconds
#define EV_MINKEYREPEAT 16700000ULL // 1/60 sec
#if defined(KERNEL) && !defined(KERNEL_PRIVATE)
class __deprecated_msg("Use DriverKit") IOHIKeyboard : public IOHIDevice
#else
class IOHIKeyboard : public IOHIDevice
#endif
{
OSDeclareDefaultStructors(IOHIKeyboard);
friend class IOHIDKeyboardDevice;
friend class IOHIDKeyboardEventDevice;
friend class IOHIDKeyboard;
friend class IOHIDConsumer;
protected:
IOLock * _deviceLock; // Lock for all device access
IOHIKeyboardMapper * _keyMap; // KeyMap instance
// The following fields describe the kind of keyboard
UInt32 _interfaceType;
UInt32 _deviceType;
// The following fields describe the state of the keyboard
UInt32 * _keyState; // kbdBitVector
IOByteCount _keyStateSize; // kbdBitVector allocated size
unsigned _eventFlags; // Current eventFlags
bool _alphaLock; // true means alpha lock is on
bool _numLock; // true means num lock is on
bool _charKeyActive; // true means char gen. key active
// The following fields are used in performing key repeats
bool _isRepeat; // true means we're generating repeat
unsigned _codeToRepeat; // What we are repeating
bool _calloutPending; // true means we've sched. a callout
AbsoluteTime _lastEventTime; // Time last event was dispatched
AbsoluteTime _downRepeatTime; // Time when we should next repeat
AbsoluteTime _keyRepeat; // Delay between key repeats
AbsoluteTime _initialKeyRepeat; // Delay before initial key repeat
UInt64 _guid;
OSObject * _keyboardEventTarget;
KeyboardEventAction _keyboardEventAction;
OSObject * _keyboardSpecialEventTarget;
KeyboardSpecialEventAction _keyboardSpecialEventAction;
OSObject * _updateEventFlagsTarget;
UpdateEventFlagsAction _updateEventFlagsAction;
UInt16 _lastUsagePage;
UInt16 _lastUsage;
protected:
virtual void dispatchKeyboardEvent(unsigned int keyCode,
/* direction */ bool goingDown,
/* timeStamp */ AbsoluteTime time);
void setLastPageAndUsage(UInt16 usagePage, UInt16 usage);
void getLastPageAndUsage(UInt16 &usagePage, UInt16 &usage);
void clearLastPageAndUsage();
public:
virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE;
virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE;
virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE;
virtual void free(void) APPLE_KEXT_OVERRIDE;
virtual bool open(IOService * client,
IOOptionBits options,
KeyboardEventAction keAction,
KeyboardSpecialEventAction kseAction,
UpdateEventFlagsAction uefAction);
bool open( IOService * client,
IOOptionBits options,
void *,
KeyboardEventCallback keCallback,
KeyboardSpecialEventCallback kseCallback,
UpdateEventFlagsCallback uefCallback);
virtual void close(IOService * client, IOOptionBits ) APPLE_KEXT_OVERRIDE;
virtual IOReturn message( UInt32 type, IOService * provider,
void * argument = 0 ) APPLE_KEXT_OVERRIDE;
virtual IOHIDKind hidKind( void ) APPLE_KEXT_OVERRIDE;
virtual bool updateProperties( void ) APPLE_KEXT_OVERRIDE;
virtual IOReturn setParamProperties(OSDictionary * dict) APPLE_KEXT_OVERRIDE;
virtual IOReturn setProperties( OSObject * properties ) APPLE_KEXT_OVERRIDE;
inline bool isRepeat() {return _isRepeat;}
protected: // for subclasses to implement
virtual const unsigned char * defaultKeymapOfLength(UInt32 * length);
virtual void setAlphaLockFeedback(bool val);
virtual void setNumLockFeedback(bool val);
virtual UInt32 maxKeyCodes();
private:
virtual bool resetKeyboard();
virtual void scheduleAutoRepeat();
static void _autoRepeat(void * arg, void *);
virtual void autoRepeat();
virtual void setRepeat(unsigned eventType, unsigned keyCode);
void setRepeatMode(bool repeat);
static void _createKeyboardNub(thread_call_param_t param0, thread_call_param_t param1);
/*
* HISTORICAL NOTE:
* The following methods were part of the KeyMapDelegate protocol;
* the declarations have now been merged directly into this class.
*/
public:
virtual void keyboardEvent(unsigned eventType,
/* flags */ unsigned flags,
/* keyCode */ unsigned keyCode,
/* charCode */ unsigned charCode,
/* charSet */ unsigned charSet,
/* originalCharCode */ unsigned origCharCode,
/* originalCharSet */ unsigned origCharSet);
virtual void keyboardSpecialEvent(unsigned eventType,
/* flags */ unsigned flags,
/* keyCode */ unsigned keyCode,
/* specialty */ unsigned flavor);
virtual void updateEventFlags(unsigned flags); // Does not generate events
virtual unsigned eventFlags(); // Global event flags
virtual unsigned deviceFlags(); // per-device event flags
virtual void setDeviceFlags(unsigned flags); // Set device event flags
virtual bool alphaLock(); // current alpha-lock state
virtual void setAlphaLock(bool val); // Set current alpha-lock state
virtual bool numLock();
virtual void setNumLock(bool val);
virtual bool charKeyActive(); // Is a character gen. key down?
virtual void setCharKeyActive(bool val); // Note that a char gen key is down.
virtual bool doesKeyLock(unsigned key); //does key lock physically
virtual unsigned getLEDStatus(); //check hardware for LED status
private:
static void _keyboardEvent( IOHIKeyboard * self,
unsigned eventType,
/* flags */ unsigned flags,
/* keyCode */ unsigned key,
/* charCode */ unsigned charCode,
/* charSet */ unsigned charSet,
/* originalCharCode */ unsigned origCharCode,
/* originalCharSet */ unsigned origCharSet,
/* keyboardType */ unsigned keyboardType,
/* repeat */ bool repeat,
/* atTime */ AbsoluteTime ts);
static void _keyboardSpecialEvent(
IOHIKeyboard * self,
unsigned eventType,
/* flags */ unsigned flags,
/* keyCode */ unsigned key,
/* specialty */ unsigned flavor,
/* guid */ UInt64 guid,
/* repeat */ bool repeat,
/* atTime */ AbsoluteTime ts);
static void _updateEventFlags( IOHIKeyboard * self,
unsigned flags); /* Does not generate events */
};
#endif /* !_IOHIKEYBOARD_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hidsystem/IOHIKeyboardMapper.h | /*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOHIKEYBOARDMAPPER_H
#define _IOHIKEYBOARDMAPPER_H
#include <IOKit/hidsystem/ev_keymap.h>
#include <IOKit/hidsystem/IOLLEvent.h>
#include <IOKit/IOTimerEventSource.h>
#include <IOKit/IOInterruptEventSource.h>
class IOHIKeyboard;
class IOHIDSystem;
/*
* Key ip/down state is tracked in a bit list. Bits are set
* for key-down, and cleared for key-up. The bit vector and macros
* for it's manipulation are defined here.
*/
typedef UInt32 * kbdBitVector;
#define EVK_BITS_PER_UNIT 32
#define EVK_BITS_MASK 31
#define EVK_BITS_SHIFT 5 // 1<<5 == 32, for cheap divide
#define EVK_KEYDOWN(n, bits) \
(bits)[((n)>>EVK_BITS_SHIFT)] |= (1 << ((n) & EVK_BITS_MASK))
#define EVK_KEYUP(n, bits) \
(bits)[((n)>>EVK_BITS_SHIFT)] &= ~(1 << ((n) & EVK_BITS_MASK))
#define EVK_IS_KEYDOWN(n, bits) \
(((bits)[((n)>>EVK_BITS_SHIFT)] & (1 << ((n) & EVK_BITS_MASK))) != 0)
/* the maximum number of modifier keys sticky keys can hold at once */
#define kMAX_MODIFIERS 5
/* the number of shift keys in a row that must be depressed to toggle state */
#define kNUM_SHIFTS_TO_ACTIVATE 5
/* the number of milliseconds all the shifts must be pressed in - 30 seconds (30000 mS)*/
#define kDEFAULT_SHIFTEXPIREINTERVAL 30000
// sticky keys state flags
enum
{
kState_Disabled_Flag = 0x0001, // disabled and will do nothing until this is changed
kState_ShiftActivates_Flag = 0x0002, // the 'on' gesture (5 shifts) will activate
kState_On = 0x0004, // currently on, will hold down modifiers when pressed
kState_On_ModifiersDown = 0x0008, // one or more modifiers being held down
kState_Mask = 0x00FF, // mask for all states
};
typedef struct _stickyKeys_ToggleInfo
{
// size of this allocation
IOByteCount size;
// which modifier key we are tracking (using NX_WHICHMODMASK)
unsigned toggleModifier;
// the number of times the modifier must be pressed to toggle
unsigned repetitionsToToggle;
// how long the user has to press the modifier repetitionsToToggle times
// the default is 30 seconds
AbsoluteTime expireInterval;
// the number of times the modifier used within the alloted time
unsigned currentCount;
// the times that the last shift must occer for this one to be used
// this array will actually be of size repetitionsToToggle
AbsoluteTime deadlines[1];
} StickyKeys_ToggleInfo;
// Flags for each sticky key modifier
// This will allow for chording of keys
// and for key locking
enum
{
kModifier_DidPerformModifiy = 0x01,
kModifier_DidKeyUp = 0x02,
kModifier_Locked = 0x04,
};
typedef struct _stickyKeys_ModifierInfo
{
UInt8 key; // Key code of the sticky modifier
UInt8 state; // The state of the sticky modifier
UInt8 leftModBit; // System Mod bit of the sticky modifier
} StickyKeys_ModifierInfo;
class IOHIDKeyboardDevice;
class __kpi_deprecated ("Use DriverKit") IOHIKeyboardMapper : public OSObject
{
OSDeclareDefaultStructors(IOHIKeyboardMapper);
private:
IOHIKeyboard * _delegate; // KeyMap delegate
bool _mappingShouldBeFreed; // true if map can be IOFree'd
NXParsedKeyMapping _parsedMapping; // current system-wide keymap
// binary compatibility padding
struct ExpansionData {
// This is for sticky keys
kbdBitVector cached_KeyBits;
UInt32 specialKeyModifierFlags;
SInt32 modifierSwap_Modifiers[NX_NUMMODIFIERS];
unsigned char * cachedAlphaLockModDefs;
};
ExpansionData * _reserved; // Reserved for future use. (Internal use only)
public:
static IOHIKeyboardMapper * keyboardMapper(
IOHIKeyboard * delegate,
const UInt8 * mapping,
UInt32 mappingLength,
bool mappingShouldBeFreed );
virtual bool init(IOHIKeyboard * delegate,
const UInt8 * mapping,
UInt32 mappingLength,
bool mappingShouldBeFreed);
virtual void free(void) APPLE_KEXT_OVERRIDE;
virtual const UInt8 * mapping();
virtual UInt32 mappingLength();
virtual bool serialize(OSSerialize *s) const APPLE_KEXT_OVERRIDE;
virtual void translateKeyCode(UInt8 key, bool keyDown, kbdBitVector keyBits);
virtual UInt8 getParsedSpecialKey(UInt8 logical); //retrieve a key from _parsedMapping
virtual void setKeyboardTarget (IOService * keyboardTarget);
virtual bool updateProperties (void);
virtual IOReturn setParamProperties (OSDictionary * dict);
// keyEventPostProcess is called while a lock is not held, so a recursive
// call back into HIKeyboard is possible
virtual void keyEventPostProcess (void);
private:
static void makeNumberParamProperty( OSDictionary * dict, const char * key,
unsigned long long number, unsigned int bits );
virtual bool parseKeyMapping(const UInt8 * mapping,
UInt32 mappingLength,
NXParsedKeyMapping * parsedMapping) const;
virtual void calcModBit(int bit, kbdBitVector keyBits);
virtual void doModCalc(int key, kbdBitVector keyBits);
virtual void doCharGen(int keyCode, bool down);
/* sticky keys functionality */
private:
// original translateKeyCode
void rawTranslateKeyCode (UInt8 key, bool keyDown, kbdBitVector keyBits);
// post special keyboard events thru the event system
void postKeyboardSpecialEvent (unsigned subtype, unsigned eventType=NX_SYSDEFINED);
private:
private:
public:
OSMetaClassDeclareReservedUsed(IOHIKeyboardMapper, 0);
virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 );
// binary compatibility padding
OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 1);
OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 2);
OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 3);
OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 4);
OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 5);
OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 6);
OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 7);
OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 8);
OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 9);
OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 10);
OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 11);
OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 12);
OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 13);
OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 14);
OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 15);
};
#endif // _IOHIKEYBOARDMAPPER_H
/*
* HISTORICAL NOTE:
* The "delegate" object had to respond to the following protocol;
* this protocol has since been merged into the IOHIKeyboard class.
*
* @protocol KeyMapDelegate
*
* - keyboardEvent :(unsigned)eventType
* flags :(unsigned)flags
* keyCode :(unsigned)keyCode
* charCode:(unsigned)charCode
* charSet :(unsigned)charSet
* originalCharCode:(unsigned)origCharCode
* originalCharSet:(unsigned)origCharSet;
*
* - keyboardSpecialEvent:(unsigned)eventType
* flags :(unsigned)flags
* keyCode :(unsigned)keyCode
* specialty:(unsigned)flavor;
*
* - updateEventFlags:(unsigned)flags; // Does not generate events
*
* - (unsigned)eventFlags; // Global event flags
* - (unsigned)deviceFlags; // per-device event flags
* - setDeviceFlags:(unsigned)flags; // Set device event flags
* - (bool)alphaLock; // current alpha-lock state
* - setAlphaLock:(bool)val; // Set current alpha-lock state
* - (bool)charKeyActive; // Is a character gen. key down?
* - setCharKeyActive:(bool)val; // Note that a char gen key is down.
*
* @end
*/
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hidsystem/IOHIDSystem.h | /*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved.
*
* EventDriver.h - Exported Interface Event Driver object.
*
* The EventDriver is a pseudo-device driver.
*
* HISTORY
* 19 Mar 1992 Mike Paquette at NeXT
* Created.
* 4 Aug 1993 Erik Kay at NeXT
* API cleanup
*/
#ifndef _IOHIDSYSTEM_H
#define _IOHIDSYSTEM_H
#include <TargetConditionals.h>
#include <IOKit/IOTimerEventSource.h>
#include <IOKit/IOInterruptEventSource.h>
#include <IOKit/IOService.h>
#include <IOKit/IOMessage.h>
#include <IOKit/IOUserClient.h>
#include <IOKit/IOCommandGate.h>
#include <IOKit/IOBufferMemoryDescriptor.h>
#include <IOKit/pwr_mgt/IOPM.h>
#include "IOHIDWorkLoop.h"
#if TARGET_OS_IPHONE
class IOGraphicsDevice;
#else
#include <IOKit/graphics/IOGraphicsDevice.h>
#endif
#include <IOKit/hidsystem/IOHIDevice.h>
#include <IOKit/hidsystem/IOHIDShared.h>
#include <IOKit/hidsystem/IOHIDTypes.h>
#include <IOKit/hidsystem/IOLLEvent.h>
#include <IOKit/IOSharedDataQueue.h>
#include <IOKit/hidsystem/ev_keymap.h> /* For NX_NUM_SCANNED_SPECIALKEYS */
// The following messages should be unique across the entire system
#ifndef sub_iokit_hidsystem
#define sub_iokit_hidsystem err_sub(14)
#endif
#define kIOHIDSystem508MouseClickMessage iokit_family_msg(sub_iokit_hidsystem, 1)
#define kIOHIDSystemDeviceSeizeRequestMessage iokit_family_msg(sub_iokit_hidsystem, 2)
#define kIOHIDSystem508SpecialKeyDownMessage iokit_family_msg(sub_iokit_hidsystem, 3)
// 4 is used by IOHIDSecurePrompt
#define kIOHIDSystemActivityTickle iokit_family_msg(sub_iokit_hidsystem, 5)
#define kIOHIDSystemUserHidActivity iokit_family_msg(sub_iokit_hidsystem, 6)
class IOHistogramReporter;
class IOHIDKeyboardDevice;
class IOHIDPointingDevice;
class IOHIDEvent;
class IOFixedPoint64;
struct _evScreen;
typedef volatile _evScreen EVScreen;
#if defined(KERNEL) && !defined(KERNEL_PRIVATE)
class __deprecated_msg("Use DriverKit") IOHIDSystem : public IOService
#else
class IOHIDSystem : public IOService
#endif
{
OSDeclareDefaultStructors(IOHIDSystem);
friend class IOHIDUserClient;
friend class IOHIDParamUserClient;
friend class IOHIDEventSystemUserClient;
private:
IOHIDWorkLoop *workLoop;
IOInterruptEventSource *keyboardEQES;
IOCommandGate *cmdGate;
IONotifier *publishNotify;
void *eventMsg; // Msg to be sent to Window Server.
void *stackShotMsg; // Msg to be sent to Stack Shot.
// Shared memory area information
IOBufferMemoryDescriptor * globalMemory;
uintptr_t shmem_addr; // kernel address of shared memory
vm_size_t shmem_size; // size of shared memory
// Pointers to structures which occupy the shared memory area.
volatile EvGlobals *evg; // Pointer to EvGlobals (shmem)
// Internal variables related to the shared memory area
int lleqSize; // # of entries in low-level queue
// FIXME: why is this ivar lleqSize an ivar? {Dan]
// Screens list
EVScreen * evScreen; // array of screens known to driver
int screens; // running total of allocated screens
UInt32 cursorScreens; // bit mask of screens with cursor present
UInt32 cursorPinScreen;// a screen to pin against
IOGBounds cursorPin; // Range to which cursor is pinned
// while on this screen.
IOGBounds workSpace; // IOGBounds of full workspace.
// Event Status state - This includes things like event timestamps,
// time til screen dim, and related things manipulated through the
// Event Status API.
//
struct ExpansionData;
ExpansionData *_privateData;
IOGPoint clickLoc; // location of last mouse click
IOGPoint clickSpaceThresh;// max mouse delta to be a doubleclick
// int clickState; // Current click state
bool evOpenCalled; // Has the driver been opened?
bool evInitialized; // Has the first-open-only initialization run?
bool eventsOpen; // Boolean: has evmmap been called yet?
bool cursorStarted; // periodic events running?
bool cursorEnabled; // cursor positioning ok?
bool cursorCoupled; // cursor positioning on pointer moves ok?
bool cursorPinned; // cursor positioning on pointer moves ok?
uint64_t lastUndimEvent;
struct SetFixedMouseLocData {
uint64_t origTs;
uint64_t callTs;
int32_t x;
int32_t y;
int32_t pid;
} __attribute__((packed));
struct Diags {
/* Cursor actions slower than this are tracked for diagnostics */
static const uint32_t SLOW_CURSOR_MS = 20;
typedef enum {
kCursorActionShow = 0,
kCursorActionHide,
kCursorActionMove,
kCursorActionCount
} CursorAction;
static const char * cursorStrings[kCursorActionCount];
uint64_t cursorWorkloopTime;
uint64_t lastActionTimes[kCursorActionCount];
uint8_t lastCursorActionsMask;
IOHistogramReporter * cursorTotalHistReporter;
IOHistogramReporter * cursorGraphicsHistReporter;
} _diags;
IOPMrootDomain * rootDomain;
UInt32 powerState;
OSDictionary * savedParameters; // keep user settings
UInt32 maxWaitCursorFrame; // animation frames
UInt32 firstWaitCursorFrame; //
IOHIDPointingDevice * _hidPointingDevice;
IOHIDKeyboardDevice * _hidKeyboardDevice;
OSObject * lastSender;
bool setParamPropertiesInProgress;
OSSet * dataQueueSet;
private:
static IOReturn powerStateHandler( void *target, void *refCon,
UInt32 messageType, IOService *service, void *messageArgument, vm_size_t argSize );
void updatePowerState(UInt32 messageType);
/* Resets */
void _setScrollCountParameters(OSDictionary *newSettings = NULL);
/* Initialize the shared memory area */
void initShmem(bool clean);
/* Dispatch low level events through shared memory to the WindowServer */
void postEvent( int what,
/* at */ IOFixedPoint64 * location,
/* atTime */ AbsoluteTime ts,
/* withData */NXEventData * myData,
/* sender */ OSObject * sender = 0,
/* pid */ UInt32 extPID = 0,
/* processKEQ*/bool processKEQ = true,
/* options*/ UInt32 options = 0
);
/* Dispatch mechanisms for screen state changes */
void evDispatch(
/* command */ EvCmd evcmd);
OSDictionary * createFilteredParamPropertiesForService(IOService * service, OSDictionary * dict);
static void _periodicEvents(IOHIDSystem * self,
IOTimerEventSource *timer);
static void doProcessKeyboardEQ(IOHIDSystem * self);
static void processKeyboardEQ(IOHIDSystem * self, AbsoluteTime * deadline = 0);
void doProcessNotifications();
bool genericNotificationHandler(void * ref, IOService * newService, IONotifier * notifier );
static bool handlePublishNotification( void * target, IOService * newService );
static bool handleTerminationNotification( void * target, IOService * newService );
static void makeNumberParamProperty( OSDictionary * dict, const char * key,
unsigned long long number, unsigned int bits );
static void makeInt32ArrayParamProperty( OSDictionary * dict, const char * key,
UInt32 * array, unsigned int count );
/*
* HISTORICAL NOTE:
* The following methods were part of the IOHIDSystem(Input) category;
* the declarations have now been merged directly into this class.
*
* Exported Interface Event Driver object input services.
*/
private:
// Schedule next periodic run based on current event system state.
void scheduleNextPeriodicEvent();
// Message invoked to run periodic events. This method runs in the workloop.
void periodicEvents(IOTimerEventSource *timer);
// Start the cursor running.
bool startCursor();
// Repin cursor location.
bool resetCursor();
// Wait Cursor machinery.
void showWaitCursor();
void hideWaitCursor();
void animateWaitCursor();
void changeCursor(int frame);
// Return screen number a point lies on.
int pointToScreen(IOGPoint * p);
inline void showCursor();
inline void hideCursor();
inline void moveCursor();
void enableContinuousCursor();
void disableContinuousCursor();
void _onScreenCursorPin();
bool registerEventSource(IOService * source);
// Set abs cursor position.
void setCursorPosition(IOGPoint * newLoc, bool external, OSObject * sender=0);
void _setCursorPosition(bool external = false, bool proximityChange = false, OSObject * sender=0);
static bool _idleTimeSerializerCallback(void * target, void * ref, OSSerialize *s);
static bool _cursorStateSerializerCallback(void * target, void * ref, OSSerialize *s);
static bool _displaySerializerCallback(void * target, void * ref, OSSerialize *s);
IOReturn _recordCursorAction(uint64_t origTS, uint64_t entryTS);
virtual IOReturn configureReport(IOReportChannelList *channels,
IOReportConfigureAction action,
void *result,
void *destination) APPLE_KEXT_OVERRIDE;
virtual IOReturn updateReport(IOReportChannelList *channels,
IOReportUpdateAction action,
void *result,
void *destination) APPLE_KEXT_OVERRIDE;
void createParameters( void );
/* END HISTORICAL NOTE */
// void updateUnificationFlags ();
public:
static IOHIDSystem * instance(); /* Return the current instance of the */
/* EventDriver, or 0 if none. */
virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE;
virtual IOHIDSystem * probe(IOService * provider,
SInt32 * score) APPLE_KEXT_OVERRIDE;
virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE;
virtual IOReturn message(UInt32 type, IOService * provider,
void * argument) APPLE_KEXT_OVERRIDE;
virtual void free(void) APPLE_KEXT_OVERRIDE;
virtual bool attach( IOService * provider ) APPLE_KEXT_OVERRIDE;
virtual void detach( IOService * provider ) APPLE_KEXT_OVERRIDE;
virtual IOWorkLoop *getWorkLoop(void) const APPLE_KEXT_OVERRIDE;
virtual IOReturn evOpen(void);
virtual IOReturn evClose(void);
virtual IOReturn setProperties( OSObject * properties ) APPLE_KEXT_OVERRIDE;
virtual IOReturn setParamProperties(OSDictionary * dict);
/* Create the shared memory area */
virtual IOReturn createShmem(void*,void*,void*,void*,void*,void*);
/* register the IOSharedDataQueue for the new user events */
virtual IOReturn registerEventQueue(IOSharedDataQueue * queue);
/* Unregister the IOSharedDataQueue for the new user events */
virtual IOReturn unregisterEventQueue(IOSharedDataQueue * queue);
public:
virtual IOReturn newUserClient(task_t owningTask,
/* withToken */ void * security_id,
/* ofType */ UInt32 type,
/* withProps*/ OSDictionary * properties,
/* client */ IOUserClient ** handler) APPLE_KEXT_OVERRIDE;
/*
* HISTORICAL NOTE:
* The following methods were part of the IOHIPointingEvents protocol;
* the declarations have now been merged directly into this class.
*/
public:
/*
* HISTORICAL NOTE:
* The following methods were part of the IOHIKeyboardEvents protocol;
* the declarations have now been merged directly into this class.
*/
public:
virtual void keyboardEvent(unsigned eventType,
/* flags */ unsigned flags,
/* keyCode */ unsigned key,
/* charCode */ unsigned charCode,
/* charSet */ unsigned charSet,
/* originalCharCode */ unsigned origCharCode,
/* originalCharSet */ unsigned origCharSet,
/* keyboardType */ unsigned keyboardType,
/* repeat */ bool repeat,
/* atTime */ AbsoluteTime ts);
virtual void keyboardSpecialEvent( unsigned eventType,
/* flags */ unsigned flags,
/* keyCode */ unsigned key,
/* specialty */ unsigned flavor,
/* guid */ UInt64 guid,
/* repeat */ bool repeat,
/* atTime */ AbsoluteTime ts);
virtual void updateEventFlags(unsigned flags); /* Does not generate events */
private:
static void _keyboardEvent( IOHIDSystem * self,
unsigned eventType,
/* flags */ unsigned flags,
/* keyCode */ unsigned key,
/* charCode */ unsigned charCode,
/* charSet */ unsigned charSet,
/* originalCharCode */ unsigned origCharCode,
/* originalCharSet */ unsigned origCharSet,
/* keyboardType */ unsigned keyboardType,
/* repeat */ bool repeat,
/* atTime */ AbsoluteTime ts,
OSObject * sender,
void * refcon);
static void _keyboardSpecialEvent(IOHIDSystem * self,
unsigned eventType,
/* flags */ unsigned flags,
/* keyCode */ unsigned key,
/* specialty */ unsigned flavor,
/* guid */ UInt64 guid,
/* repeat */ bool repeat,
/* atTime */ AbsoluteTime ts,
OSObject * sender,
void * refcon);
static void _updateEventFlags( IOHIDSystem * self,
unsigned flags,
OSObject * sender,
void * refcon); /* Does not generate events */
/*
* HISTORICAL NOTE:
* The following methods were part of the IOUserClient protocol;
* the declarations have now been merged directly into this class.
*/
public:
virtual IOReturn setEventsEnable(void*,void*,void*,void*,void*,void*);
virtual IOReturn setCursorEnable(void*,void*,void*,void*,void*,void*);
virtual IOReturn extPostEvent(void*,void*,void*,void*,void*,void*);
virtual IOReturn extSetMouseLocation(void*,void*,void*,void*,void*,void*);
virtual IOReturn extGetButtonEventNum(void*,void*,void*,void*,void*,void*);
IOReturn extSetBounds(void*,void*,void*,void*,void*,void*);
IOReturn extSetOnScreenBounds(void*,void*,void*,void*,void*,void*);
IOReturn setBounds(IOGBounds * bounds, IOGPoint * screenPoint, bool onScreen);
IOReturn extGetStateForSelector(void*,void*,void*,void*,void*,void*);
IOReturn extSetStateForSelector(void*,void*,void*,void*,void*,void*);
IOReturn extRegisterVirtualDisplay(void*,void*,void*,void*,void*,void*);
IOReturn extUnregisterVirtualDisplay(void*,void*,void*,void*,void*,void*);
IOReturn extSetVirtualDisplayBounds(void*,void*,void*,void*,void*,void*);
IOReturn extGetUserHidActivityState(void*,void*,void*,void*,void*,void*);
IOReturn setContinuousCursorEnable(void*,void*,void*,void*,void*,void*);
/*
* HISTORICAL NOTE:
* The following methods were part of the IOScreenRegistration protocol;
* the declarations have now been merged directly into this class.
*
* Methods exported by the EventDriver for display systems.
*
* The screenRegister protocol is used by frame buffer drivers to register
* themselves with the Event Driver. These methods are called in response
* to an _IOGetParameterInIntArray() call with "IO_Framebuffer_Register" or
* "IO_Framebuffer_Unregister".
*/
public:
virtual int registerScreen(IOGraphicsDevice * instance,
/* bounds */ IOGBounds * bp,
/* virtual bounds */ IOGBounds * vbp);
private:
static IOReturn doRegisterScreen(IOHIDSystem *self, IOGraphicsDevice *io_gd, IOGBounds *bp, IOGBounds * vbp, void *arg3);
IOReturn registerScreenGated(IOGraphicsDevice *io_gd, IOGBounds *bp, IOGBounds * vbp, SInt32 *index);
public:
virtual void unregisterScreen(int index);
/*
* HISTORICAL NOTE:
* The following methods were part of the IOWorkspaceBounds protocol;
* the declarations have now been merged directly into this class.
*
* Absolute position input devices and some specialized output devices
* may need to know the bounding rectangle for all attached displays.
* The following method returns a IOGBounds* for the workspace. Please note
* that the bounds are kept as signed values, and that on a multi-display
* system the minx and miny values may very well be negative.
*/
public:
virtual IOGBounds * workspaceBounds();
/* END HISTORICAL NOTES */
private:
void keyboardEvent(unsigned eventType,
/* flags */ unsigned flags,
/* keyCode */ unsigned key,
/* charCode */ unsigned charCode,
/* charSet */ unsigned charSet,
/* originalCharCode */ unsigned origCharCode,
/* originalCharSet */ unsigned origCharSet,
/* keyboardType */ unsigned keyboardType,
/* repeat */ bool repeat,
/* atTime */ AbsoluteTime ts,
/* sender */ OSObject * sender);
void keyboardSpecialEvent( unsigned eventType,
/* flags */ unsigned flags,
/* keyCode */ unsigned key,
/* specialty */ unsigned flavor,
/* guid */ UInt64 guid,
/* repeat */ bool repeat,
/* atTime */ AbsoluteTime ts,
/* sender */ OSObject * sender);
void updateEventFlags(unsigned flags, OSObject * sender);
/*
* COMMAND GATE COMPATIBILITY:
* The following method is part of the work needed to make IOHIDSystem
* compatible with IOCommandGate. The use of IOCommandQueue has been
* deprecated, thus requiring this move. This should allow for less
* context switching as all actions formerly run on the I/O Workloop
* thread, will now be run on the caller thread. The static methods
* will be called from cmdGate->runAction and returns the appropriate
* non-static helper method. Arguments are stored in the void* array,
* args, and are passed through. Since we are returning in the static
* function, gcc3 should translate that to one instruction, thus
* minimizing cost.
*/
static IOReturn doEvClose (IOHIDSystem *self);
IOReturn evCloseGated (void);
static IOReturn doUnregisterScreen (IOHIDSystem *self, void * arg0);
IOReturn unregisterScreenGated (int index);
static IOReturn doSetDisplayBounds (IOHIDSystem *self, void * arg0, void * arg1);
IOReturn setDisplayBoundsGated (UInt32 index, IOGBounds *bounds);
static IOReturn doCreateShmem (IOHIDSystem *self, void * arg0);
IOReturn createShmemGated (void * p1);
static IOReturn doRegisterEventQueue (IOHIDSystem *self, void * arg0);
IOReturn registerEventQueueGated (void * p1);
static IOReturn doUnregisterEventQueue (IOHIDSystem *self, void * arg0);
IOReturn unregisterEventQueueGated (void * p1);
static IOReturn doKeyboardEvent (IOHIDSystem *self, void * args);
void keyboardEventGated (unsigned eventType,
unsigned flags,
unsigned key,
unsigned charCode,
unsigned charSet,
unsigned origCharCode,
unsigned origCharSet,
unsigned keyboardType,
bool repeat,
AbsoluteTime ts,
OSObject * sender);
static IOReturn doKeyboardSpecialEvent (IOHIDSystem *self, void * args);
void keyboardSpecialEventGated (
unsigned eventType,
unsigned flags,
unsigned key,
unsigned flavor,
UInt64 guid,
bool repeat,
AbsoluteTime ts,
OSObject * sender);
static IOReturn doUpdateEventFlags (IOHIDSystem *self, void * args);
void updateEventFlagsGated (unsigned flags, OSObject * sender);
static IOReturn doNewUserClient (IOHIDSystem *self, void * args);
IOReturn newUserClientGated (task_t owningTask,
void * security_id,
UInt32 type,
OSDictionary * properties,
IOUserClient ** handler);
static IOReturn doSetCursorEnable (IOHIDSystem *self, void * arg0);
IOReturn setCursorEnableGated (void * p1);
static IOReturn doSetContinuousCursorEnable (IOHIDSystem *self, void * arg0);
IOReturn setContinuousCursorEnableGated (void * p1);
static IOReturn doExtPostEvent(IOHIDSystem *self, void * arg0, void * arg1, void * arg2, void * arg3);
IOReturn extPostEventGated (void * p1, void * p2, void * p3);
static IOReturn doExtSetMouseLocation (IOHIDSystem *self, void * args);
IOReturn extSetMouseLocationGated (void * args);
static IOReturn doExtGetButtonEventNum (IOHIDSystem *self, void * arg0, void * arg1);
IOReturn extGetButtonEventNumGated (void * p1, void * p2);
static IOReturn doSetParamPropertiesPre (IOHIDSystem *self, void * arg0, void * arg1);
IOReturn setParamPropertiesPreGated (OSDictionary * dict, OSIterator ** pOpenIter);
static IOReturn doSetParamPropertiesPost (IOHIDSystem *self, void * arg0);
IOReturn setParamPropertiesPostGated (OSDictionary * dict);
IOReturn updateParamPropertiesGated(IOService * source);
static IOReturn doExtGetStateForSelector (IOHIDSystem *self, void *p1, void *p2);
static IOReturn doExtSetStateForSelector (IOHIDSystem *self, void *p1, void *p2);
/* END COMMAND GATE COMPATIBILITY */
public:
virtual UInt32 eventFlags();
virtual void sleepDisplayTickle(IOService * requester);
virtual void dispatchEvent(IOHIDEvent *event, IOOptionBits options=0);
void updateHidActivity();
void hidActivityChecker();
static void reportUserHidActivity(IOHIDSystem *self, void *args );
void reportUserHidActivityGated(void *args );
static IOReturn getUserHidActivityState(IOHIDSystem *self, void *arg0);
IOReturn getUserHidActivityStateGated(void *state);
};
#endif /* !_IOHIDSYSTEM_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hidsystem/IOLLEvent.h | /*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/******************************************************************************
event.h (PostScript side version)
CONFIDENTIAL
Copyright (c) 1988 NeXT, Inc. as an unpublished work.
All Rights Reserved.
Created Leo 01Mar88
Modified:
04May88 Leo Final event types and record
22Aug88 Leo Change short -> int for window, add reserved
26May90 Ted Added NX_UNDIMMASK to correct triggering of UndoAutoDim
12Dec91 Mike Brought into sync with dpsclient/event.h, and fixed
the #ifndef interlock with dpsclient/event.h that was
broken during the Great Header Revision.
The PostScript version of this file differs from the
Window Kit version in that the coordinates here are
ints instead of floats.
******************************************************************************/
#ifndef _DEV_EVENT_H
#define _DEV_EVENT_H
#include <libkern/OSTypes.h>
#include <IOKit/hidsystem/IOHIDTypes.h>
#include <mach/mach_types.h>
#ifdef EVENT_H /* Interlock with dpsclient/event.h */
#if !defined(_NXSIZE_) /* Work around patch for old event.h in Phase 3 projs*/
#define _NXSIZE_ 1 /* NXCoord, NXPoint, NXSize decl seen */
#define _NXSize_ NXSize
#endif /* _NXSIZE_ */
#else /* EVENT_H */ /* Haven't seen dpsclient/event.h, so define away */
#define EVENT_H
#ifdef KERNEL
#else /* KERNEL */
#if !defined(_NXSIZE_) /* Work around patch for old event.h in Phase 3 projs*/
#define _NXSIZE_ 1 /* NXCoord, NXPoint, NXSize decl seen */
typedef float NXCoord;
typedef struct _NXPoint { /* point */
NXCoord x, y;
} NXPoint;
typedef struct _NXSize { /* size */
NXCoord width, height;
} NXSize;
#define _NXSize_ NXSize /* Correct usage in event_status_driver.h */
#endif /* _NXSIZE_ */
#endif /* KERNEL */
/* Event types */
#define NX_NULLEVENT 0 /* internal use */
/* mouse events */
#define NX_LMOUSEDOWN 1 /* left mouse-down event */
#define NX_LMOUSEUP 2 /* left mouse-up event */
#define NX_RMOUSEDOWN 3 /* right mouse-down event */
#define NX_RMOUSEUP 4 /* right mouse-up event */
#define NX_MOUSEMOVED 5 /* mouse-moved event */
#define NX_LMOUSEDRAGGED 6 /* left mouse-dragged event */
#define NX_RMOUSEDRAGGED 7 /* right mouse-dragged event */
#define NX_MOUSEENTERED 8 /* mouse-entered event */
#define NX_MOUSEEXITED 9 /* mouse-exited event */
/* other mouse events
*
* event.data.mouse.buttonNumber should contain the
* button number (2-31) changing state.
*/
#define NX_OMOUSEDOWN 25 /* other mouse-down event */
#define NX_OMOUSEUP 26 /* other mouse-up event */
#define NX_OMOUSEDRAGGED 27 /* other mouse-dragged event */
/* keyboard events */
#define NX_KEYDOWN 10 /* key-down event */
#define NX_KEYUP 11 /* key-up event */
#define NX_FLAGSCHANGED 12 /* flags-changed event */
/* composite events */
#define NX_KITDEFINED 13 /* application-kit-defined event */
#define NX_SYSDEFINED 14 /* system-defined event */
#define NX_APPDEFINED 15 /* application-defined event */
/* There are additional DPS client defined events past this point. */
/* Scroll wheel events */
#define NX_SCROLLWHEELMOVED 22
/* Zoom events */
#define NX_ZOOM 28
/* tablet events */
#define NX_TABLETPOINTER 23 /* for non-mousing transducers */
#define NX_TABLETPROXIMITY 24 /* for non-mousing transducers */
/* event range */
#define NX_FIRSTEVENT 0
#define NX_LASTEVENT 28
#define NX_NUMPROCS (NX_LASTEVENT-NX_FIRSTEVENT+1)
/* Event masks */
#define NX_NULLEVENTMASK (1 << NX_NULLEVENT) /* NULL event */
#define NX_LMOUSEDOWNMASK (1 << NX_LMOUSEDOWN) /* left mouse-down */
#define NX_LMOUSEUPMASK (1 << NX_LMOUSEUP) /* left mouse-up */
#define NX_RMOUSEDOWNMASK (1 << NX_RMOUSEDOWN) /* right mouse-down */
#define NX_RMOUSEUPMASK (1 << NX_RMOUSEUP) /* right mouse-up */
#define NX_OMOUSEDOWNMASK (1 << NX_OMOUSEDOWN) /* other mouse-down */
#define NX_OMOUSEUPMASK (1 << NX_OMOUSEUP) /* other mouse-up */
#define NX_MOUSEMOVEDMASK (1 << NX_MOUSEMOVED) /* mouse-moved */
#define NX_LMOUSEDRAGGEDMASK (1 << NX_LMOUSEDRAGGED) /* left-dragged */
#define NX_RMOUSEDRAGGEDMASK (1 << NX_RMOUSEDRAGGED) /* right-dragged */
#define NX_OMOUSEDRAGGEDMASK (1 << NX_OMOUSEDRAGGED) /* other-dragged */
#define NX_MOUSEENTEREDMASK (1 << NX_MOUSEENTERED) /* mouse-entered */
#define NX_MOUSEEXITEDMASK (1 << NX_MOUSEEXITED) /* mouse-exited */
#define NX_KEYDOWNMASK (1 << NX_KEYDOWN) /* key-down */
#define NX_KEYUPMASK (1 << NX_KEYUP) /* key-up */
#define NX_FLAGSCHANGEDMASK (1 << NX_FLAGSCHANGED) /* flags-changed */
#define NX_KITDEFINEDMASK (1 << NX_KITDEFINED) /* kit-defined */
#define NX_SYSDEFINEDMASK (1 << NX_SYSDEFINED) /* system-defined */
#define NX_APPDEFINEDMASK (1 << NX_APPDEFINED) /* app-defined */
#define NX_SCROLLWHEELMOVEDMASK (1 << NX_SCROLLWHEELMOVED) /* scroll wheel moved */
#define NX_ZOOMMASK (1 << NX_ZOOM) /* Zoom */
#define NX_TABLETPOINTERMASK (1 << NX_TABLETPOINTER) /* tablet pointer moved */
#define NX_TABLETPROXIMITYMASK (1 << NX_TABLETPROXIMITY) /* tablet pointer proximity */
#define EventCodeMask(type) (1 << (type))
#define NX_ALLEVENTS -1 /* Check for all events */
/* sub types for mouse and move events */
#define NX_SUBTYPE_DEFAULT 0
#define NX_SUBTYPE_TABLET_POINT 1
#define NX_SUBTYPE_TABLET_PROXIMITY 2
#define NX_SUBTYPE_MOUSE_TOUCH 3
/* sub types for system defined events */
#define NX_SUBTYPE_POWER_KEY 1
#define NX_SUBTYPE_AUX_MOUSE_BUTTONS 7
/*
* NX_SUBTYPE_AUX_CONTROL_BUTTONS usage
*
* The incoming NXEvent for other mouse button down/up has event.type
* NX_SYSDEFINED and event.data.compound.subtype NX_SUBTYPE_AUX_MOUSE_BUTTONS.
* Within the event.data.compound.misc.L[0] contains bits for all the buttons
* that have changed state, and event.data.compound.misc.L[1] contains the
* current button state as a bitmask, with 1 representing down, and 0
* representing up. Bit 0 is the left button, bit one is the right button,
* bit 2 is the center button and so forth.
*/
#define NX_SUBTYPE_AUX_CONTROL_BUTTONS 8
#define NX_SUBTYPE_EJECT_KEY 10
#define NX_SUBTYPE_SLEEP_EVENT 11
#define NX_SUBTYPE_RESTART_EVENT 12
#define NX_SUBTYPE_SHUTDOWN_EVENT 13
#define NX_SUBTYPE_MENU 16
#define NX_SUBTYPE_ACCESSIBILITY 17
#define NX_SUBTYPE_STICKYKEYS_ON 100
#define NX_SUBTYPE_STICKYKEYS_OFF 101
#define NX_SUBTYPE_STICKYKEYS_SHIFT 102
#define NX_SUBTYPE_STICKYKEYS_CONTROL 103
#define NX_SUBTYPE_STICKYKEYS_ALTERNATE 104
#define NX_SUBTYPE_STICKYKEYS_COMMAND 105
#define NX_SUBTYPE_STICKYKEYS_RELEASE 106
#define NX_SUBTYPE_STICKYKEYS_TOGGLEMOUSEDRIVING 107
// New stickykeys key events
// These were created to send an event describing the
// different state of the modifiers
#define NX_SUBTYPE_STICKYKEYS_SHIFT_DOWN 110
#define NX_SUBTYPE_STICKYKEYS_CONTROL_DOWN 111
#define NX_SUBTYPE_STICKYKEYS_ALTERNATE_DOWN 112
#define NX_SUBTYPE_STICKYKEYS_COMMAND_DOWN 113
#define NX_SUBTYPE_STICKYKEYS_FN_DOWN 114
#define NX_SUBTYPE_STICKYKEYS_SHIFT_LOCK 120
#define NX_SUBTYPE_STICKYKEYS_CONTROL_LOCK 121
#define NX_SUBTYPE_STICKYKEYS_ALTERNATE_LOCK 122
#define NX_SUBTYPE_STICKYKEYS_COMMAND_LOCK 123
#define NX_SUBTYPE_STICKYKEYS_FN_LOCK 124
#define NX_SUBTYPE_STICKYKEYS_SHIFT_UP 130
#define NX_SUBTYPE_STICKYKEYS_CONTROL_UP 131
#define NX_SUBTYPE_STICKYKEYS_ALTERNATE_UP 132
#define NX_SUBTYPE_STICKYKEYS_COMMAND_UP 133
#define NX_SUBTYPE_STICKYKEYS_FN_UP 134
// SlowKeys
#define NX_SUBTYPE_SLOWKEYS_START 200
#define NX_SUBTYPE_SLOWKEYS_ABORT 201
#define NX_SUBTYPE_SLOWKEYS_END 202
// HID Parameter Property Modified
#define NX_SUBTYPE_HIDPARAMETER_MODIFIED 210
/* Masks for the bits in event.flags */
/* device-independent */
#define NX_ALPHASHIFTMASK 0x00010000
#define NX_SHIFTMASK 0x00020000
#define NX_CONTROLMASK 0x00040000
#define NX_ALTERNATEMASK 0x00080000
#define NX_COMMANDMASK 0x00100000
#define NX_NUMERICPADMASK 0x00200000
#define NX_HELPMASK 0x00400000
#define NX_SECONDARYFNMASK 0x00800000
#define NX_ALPHASHIFT_STATELESS_MASK 0x01000000
/* device-dependent (really?) */
#define NX_DEVICELCTLKEYMASK 0x00000001
#define NX_DEVICELSHIFTKEYMASK 0x00000002
#define NX_DEVICERSHIFTKEYMASK 0x00000004
#define NX_DEVICELCMDKEYMASK 0x00000008
#define NX_DEVICERCMDKEYMASK 0x00000010
#define NX_DEVICELALTKEYMASK 0x00000020
#define NX_DEVICERALTKEYMASK 0x00000040
#define NX_DEVICE_ALPHASHIFT_STATELESS_MASK 0x00000080
#define NX_DEVICERCTLKEYMASK 0x00002000
/*
* Additional reserved bits in event.flags
*/
#define NX_STYLUSPROXIMITYMASK 0x00000080 /* deprecated */
#define NX_NONCOALSESCEDMASK 0x00000100
/* click state values
* If you have the following events in close succession, the click
* field has the indicated value:
*
* Event Click Value Comments
* mouse-down 1 Not part of any click yet
* mouse-up 1 Aha! A click!
* mouse-down 2 Doing a double-click
* mouse-up 2 It's finished
* mouse-down 3 A triple
* mouse-up 3
*/
/* Values for the character set in event.data.key.charSet */
#define NX_ASCIISET 0
#define NX_SYMBOLSET 1
#define NX_DINGBATSSET 2
/* tablet button masks
* Mask bits for the tablet barrel buttons placed in tablet.buttons.
* The buttons field uses adopts the following convention:
*
* Bit Comments
* 0 Left Mouse Button ( kHIDUsage_Button_1 )
* 1 Right Mouse Button ( kHIDUsage_Button_2 )
* 2 Middle Mouse Button ( kHIDUsage_Button_3 )
* 3 4th Mouse Button ( kHIDUsage_Button_4 )
* ...
* 15 15th Mouse Button
*
* For your convenience, the following mask bits have been defined
* for tablet specific application:
*/
#define NX_TABLET_BUTTON_PENTIPMASK 0x0001
#define NX_TABLET_BUTTON_PENLOWERSIDEMASK 0x0002
#define NX_TABLET_BUTTON_PENUPPERSIDEMASK 0x0004
/* tablet capability masks
* Mask bits for the tablet capabilities field. Use these
* masks with the capabilities field of a proximity event to
* determine what fields in a Tablet Event are valid for this
* device.
*/
#define NX_TABLET_CAPABILITY_DEVICEIDMASK 0x0001
#define NX_TABLET_CAPABILITY_ABSXMASK 0x0002
#define NX_TABLET_CAPABILITY_ABSYMASK 0x0004
#define NX_TABLET_CAPABILITY_VENDOR1MASK 0x0008
#define NX_TABLET_CAPABILITY_VENDOR2MASK 0x0010
#define NX_TABLET_CAPABILITY_VENDOR3MASK 0x0020
#define NX_TABLET_CAPABILITY_BUTTONSMASK 0x0040
#define NX_TABLET_CAPABILITY_TILTXMASK 0x0080
#define NX_TABLET_CAPABILITY_TILTYMASK 0x0100
#define NX_TABLET_CAPABILITY_ABSZMASK 0x0200
#define NX_TABLET_CAPABILITY_PRESSUREMASK 0x0400
#define NX_TABLET_CAPABILITY_TANGENTIALPRESSUREMASK 0x0800
#define NX_TABLET_CAPABILITY_ORIENTINFOMASK 0x1000
#define NX_TABLET_CAPABILITY_ROTATIONMASK 0x2000
/* proximity pointer types
* Value that describes the type of pointing device placed in
* proximity.pointerType.
*/
#define NX_TABLET_POINTER_UNKNOWN 0
#define NX_TABLET_POINTER_PEN 1
#define NX_TABLET_POINTER_CURSOR 2
#define NX_TABLET_POINTER_ERASER 3
/* TabletPointData type: defines the tablet data for points included
* in mouse events created by a tablet driver.
*/
typedef struct _NXTabletPointData {
SInt32 x; /* absolute x coordinate in tablet space at full tablet resolution */
SInt32 y; /* absolute y coordinate in tablet space at full tablet resolution */
SInt32 z; /* absolute z coordinate in tablet space at full tablet resolution */
UInt16 buttons; /* one bit per button - bit 0 is first button - 1 = closed */
UInt16 pressure; /* scaled pressure value; MAX=(2^16)-1, MIN=0 */
struct { /* tilt range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) */
SInt16 x; /* scaled tilt x value */
SInt16 y; /* scaled tilt y value */
} tilt;
UInt16 rotation; /* Fixed-point representation of device rotation in a 10.6 format */
SInt16 tangentialPressure; /* tangential pressure on the device; same range as tilt */
UInt16 deviceID; /* system-assigned unique device ID */
SInt16 vendor1; /* vendor-defined signed 16-bit integer */
SInt16 vendor2; /* vendor-defined signed 16-bit integer */
SInt16 vendor3; /* vendor-defined signed 16-bit integer */
} NXTabletPointData, *NXTabletPointDataPtr;
/* TabletProximityData type: defines the tablet data for proximity
* events included in mouse events created by a tablet driver.
*/
typedef struct _NXTabletProximityData {
UInt16 vendorID; /* vendor-defined ID - typically the USB vendor ID */
UInt16 tabletID; /* vendor-defined tablet ID - typically the USB product ID */
UInt16 pointerID; /* vendor-defined ID of the specific pointing device */
UInt16 deviceID; /* system-assigned unique device ID */
UInt16 systemTabletID; /* system-assigned unique tablet ID */
UInt16 vendorPointerType; /* vendor-defined pointer type */
UInt32 pointerSerialNumber; /* vendor-defined serial number */
UInt64 uniqueID __attribute__ ((packed)); /* vendor-defined unique ID */
UInt32 capabilityMask; /* capabilities mask of the device */
UInt8 pointerType; /* type of pointing device */
UInt8 enterProximity; /* non-zero = entering; zero = leaving */
SInt16 reserved1;
} NXTabletProximityData, *NXTabletProximityDataPtr;
/* EventData type: defines the data field of an event */
typedef union {
struct { /* For mouse-down and mouse-up events */
UInt8 subx; /* sub-pixel position for x */
UInt8 suby; /* sub-pixel position for y */
SInt16 eventNum; /* unique identifier for this button */
SInt32 click; /* click state of this event */
UInt8 pressure; /* pressure value: 0=none, 255=full */
UInt8 buttonNumber;/* button generating other button event (0-31) */
UInt8 subType;
UInt8 reserved2;
SInt32 reserved3;
union {
NXTabletPointData point; /* tablet point data */
NXTabletProximityData proximity; /* tablet proximity data */
} tablet;
} mouse;
struct {
SInt32 dx;
SInt32 dy;
UInt8 subx;
UInt8 suby;
UInt8 subType;
UInt8 reserved1;
SInt32 reserved2;
union {
NXTabletPointData point; /* tablet point data */
NXTabletProximityData proximity; /* tablet proximity data */
} tablet;
} mouseMove;
struct { /* For key-down and key-up events */
UInt16 origCharSet; /* unmodified character set code */
SInt16 repeat; /* for key-down: nonzero if really a repeat */
UInt16 charSet; /* character set code */
UInt16 charCode; /* character code in that set */
UInt16 keyCode; /* device-dependent key number */
UInt16 origCharCode; /* unmodified character code */
SInt32 reserved1;
UInt32 keyboardType;
SInt32 reserved2;
SInt32 reserved3;
SInt32 reserved4;
SInt32 reserved5[4];
} key;
struct { /* For mouse-entered and mouse-exited events */
SInt16 reserved;
SInt16 eventNum; /* unique identifier from mouse down event */
SInt32 trackingNum; /* unique identifier from settrackingrect */
SInt32 userData; /* uninterpreted integer from settrackingrect */
SInt32 reserved1;
SInt32 reserved2;
SInt32 reserved3;
SInt32 reserved4;
SInt32 reserved5;
SInt32 reserved6[4];
} tracking;
struct {
SInt16 deltaAxis1;
SInt16 deltaAxis2;
SInt16 deltaAxis3;
SInt16 reserved1;
SInt32 fixedDeltaAxis1;
SInt32 fixedDeltaAxis2;
SInt32 fixedDeltaAxis3;
SInt32 pointDeltaAxis1;
SInt32 pointDeltaAxis2;
SInt32 pointDeltaAxis3;
SInt32 reserved8[4];
} scrollWheel, zoom;
struct { /* For window-changed, sys-defined, and app-defined events */
SInt16 reserved;
SInt16 subType; /* event subtype for compound events */
union {
float F[11]; /* for use in compound events */
SInt32 L[11]; /* for use in compound events */
SInt16 S[22]; /* for use in compound events */
char C[44]; /* for use in compound events */
} misc;
} compound;
struct {
SInt32 x; /* absolute x coordinate in tablet space at full tablet resolution */
SInt32 y; /* absolute y coordinate in tablet space at full tablet resolution */
SInt32 z; /* absolute z coordinate in tablet space at full tablet resolution */
UInt16 buttons; /* one bit per button - bit 0 is first button - 1 = closed */
UInt16 pressure; /* scaled pressure value; MAX=(2^16)-1, MIN=0 */
struct { /* tilt range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) */
SInt16 x; /* scaled tilt x value */
SInt16 y; /* scaled tilt y value */
} tilt;
UInt16 rotation; /* Fixed-point representation of device rotation in a 10.6 format */
SInt16 tangentialPressure; /* tangential pressure on the device; same range as tilt */
UInt16 deviceID; /* system-assigned unique device ID */
SInt16 vendor1; /* vendor-defined signed 16-bit integer */
SInt16 vendor2; /* vendor-defined signed 16-bit integer */
SInt16 vendor3; /* vendor-defined signed 16-bit integer */
SInt32 reserved[4];
} tablet;
struct {
UInt16 vendorID; /* vendor-defined ID - typically the USB vendor ID */
UInt16 tabletID; /* vendor-defined tablet ID - typically the USB product ID */
UInt16 pointerID; /* vendor-defined ID of the specific pointing device */
UInt16 deviceID; /* system-assigned unique device ID */
UInt16 systemTabletID; /* system-assigned unique tablet ID */
UInt16 vendorPointerType; /* vendor-defined pointer type */
UInt32 pointerSerialNumber; /* vendor-defined serial number */
UInt64 uniqueID __attribute__ ((packed)); /* vendor-defined unique ID */
UInt32 capabilityMask; /* capabilities mask of the device */
UInt8 pointerType; /* type of pointing device */
UInt8 enterProximity; /* non-zero = entering; zero = leaving */
SInt16 reserved1;
SInt32 reserved2[4];
} proximity;
} NXEventData;
/* The current version number of the NXEventData structure. */
#define kNXEventDataVersion 2
/* Finally! The event record! */
#ifndef __ppc__
typedef struct _NXEvent {
SInt32 type; /* An event type from above */
struct {
SInt32 x, y; /* Base coordinates in window, */
} location; /* from bottom left */
UInt64 time __attribute__ ((packed)); /* time since launch */
SInt32 flags; /* key state flags */
UInt32 window; /* window number of assigned window */
UInt64 service_id __attribute__ ((packed)); /* service id */
SInt32 ext_pid; /* external pid */
NXEventData data; /* type-dependent data */
} NXEvent, *NXEventPtr;
#else
typedef struct _NXEvent {
SInt32 type; /* An event type from above */
struct {
SInt32 x, y; /* Base coordinates in window, */
} location; /* from bottom left */
UInt64 time __attribute__ ((packed)); /* time since launch */
SInt32 flags; /* key state flags */
UInt32 window; /* window number of assigned window */
NXEventData data; /* type-dependent data */
UInt64 service_id __attribute__ ((packed)); /* service id */
SInt32 ext_pid; /* external pid */
} NXEvent, *NXEventPtr;
#endif
/* The current version number of the NXEvent structure. */
#define kNXEventVersion 2
/* How to pick window(s) for event (for PostEvent) */
#define NX_NOWINDOW -1
#define NX_BYTYPE 0
#define NX_BROADCAST 1
#define NX_TOPWINDOW 2
#define NX_FIRSTWINDOW 3
#define NX_MOUSEWINDOW 4
#define NX_NEXTWINDOW 5
#define NX_LASTLEFT 6
#define NX_LASTRIGHT 7
#define NX_LASTKEY 8
#define NX_EXPLICIT 9
#define NX_TRANSMIT 10
#define NX_BYPSCONTEXT 11
#endif /* EVENT_H */ /* End of defs common with dpsclient/event.h */
/* Mask of events that cause the screen to wake up */
#define NX_WAKEMASK ( NX_KEYDOWNMASK | NX_FLAGSCHANGEDMASK | \
NX_LMOUSEDOWNMASK | NX_LMOUSEUPMASK | \
NX_RMOUSEDOWNMASK | NX_RMOUSEUPMASK | \
NX_OMOUSEDOWNMASK | NX_OMOUSEUPMASK \
)
/* Mask of events that cause screen to undim */
#define NX_UNDIMMASK ( NX_WAKEMASK | NX_KEYUPMASK | NX_SCROLLWHEELMOVEDMASK | \
NX_LMOUSEDRAGGEDMASK | NX_RMOUSEDRAGGEDMASK | NX_OMOUSEDRAGGEDMASK | \
NX_MOUSEMOVEDMASK | NX_MOUSEENTEREDMASK | NX_MOUSEEXITEDMASK | \
NX_TABLETPOINTERMASK | NX_TABLETPROXIMITYMASK \
)
#define NX_EVENT_EXTENSION_LOCATION_INVALID 0x1
#define NX_EVENT_EXTENSION_LOCATION_TYPE_FLOAT 0x2
#define NX_EVENT_EXTENSION_LOCATION_DEVICE_SCALED 0x4
#define NX_EVENT_EXTENSION_MOUSE_DELTA_TYPE_FLOAT 0x8
#define NX_EVENT_EXTENSION_AUDIT_TOKEN 0x10
typedef struct _NXEventExtension {
UInt32 flags;
audit_token_t audit;
} NXEventExtension;
typedef struct _NXEventExt {
NXEvent payload;
NXEventExtension extension;
} NXEventExt;
#endif /* !_DEV_EVENT_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hidsystem/IOHIDTypes.h | /*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/******************************************************************************
ev_types.h
Data types for the events status driver.
This file contains public API.
mpaque 11Oct91
Copyright 1991 NeXT Computer, Inc.
Copyright 1997-2011 Apple, Inc.
Modified:
******************************************************************************/
#ifndef _DEV_EV_TYPES_H
#define _DEV_EV_TYPES_H
#include <mach/boolean.h>
#include <libkern/OSAtomic.h>
#include <IOKit/graphics/IOGraphicsTypes.h>
// This should be removed, but is being used by others
// <rdar://problem/8917741> IOHIDFamily-355 causes projects to fail to build with 'ev_lock_data_t' does not name a type
#include <IOKit/IOSharedLock.h>
/* Shared memory versions */
#define EVENT_SYSTEM_VERSION 2
/* Maximum length of SetMouseScaling arrays */
#define NX_MAXMOUSESCALINGS 20
typedef struct evsioKeymapping /* Match old struct names in kernel */
{
int size;
char *mapping;
} NXKeyMapping;
typedef struct evsioMouseScaling /* Match old struct names in kernel */
{
int numScaleLevels;
short scaleThresholds[NX_MAXMOUSESCALINGS];
short scaleFactors[NX_MAXMOUSESCALINGS];
} NXMouseScaling;
typedef enum {
NX_OneButton,
NX_LeftButton,
NX_RightButton
} NXMouseButton;
// IOFixedPoint32 is a 24.8 format
typedef struct __IOFixedPoint32 {
int32_t x;
int32_t y;
} IOFixedPoint32;
/*
* NXEventSystemInfo() information structures. These are designed to
* allow for expansion.
*
* The current implementation of NXEventSystemInfo() uses an ioctl call.
* THIS WILL CHANGE.
*/
/*
* Generic query max size and typedefs.
*
* The maximum size is selected to support anticipated future extensions
* of request flavors. Certain flavors planned for future releases may
* require roughtly 800 ints to represent. We allow a little extra, in
* case further growth is needed.
*/
typedef int *NXEventSystemInfoType;
#define NX_EVS_INFO_MAX (1024) /* Max array size */
typedef int NXEventSystemInfoData[NX_EVS_INFO_MAX];
/* Event System Devices query */
#define NX_EVS_DEVICE_MAX 16
/* Interface types */
#define NX_EVS_DEVICE_INTERFACE_OTHER 0
#define NX_EVS_DEVICE_INTERFACE_NeXT 1 // NeXT custom, in older sys
#define NX_EVS_DEVICE_INTERFACE_ADB 2 // NeXT/fruit keybds/mice
#define NX_EVS_DEVICE_INTERFACE_ACE 3 // For x86 PC keyboards
#define NX_EVS_DEVICE_INTERFACE_SERIAL_ACE 4 // For PC serial mice
#define NX_EVS_DEVICE_INTERFACE_BUS_ACE 5 // For PC bus mice
#define NX_EVS_DEVICE_INTERFACE_HIL 6 // For HIL hp keyboard
#define NX_EVS_DEVICE_INTERFACE_TYPE5 7 // For Sun Type5 keyboard
/*
* Note! if any new interface types are added above, the following
* definition of the number of interfaces supported must reflect this.
* This is used in the libkeymap project (storemap.c module) which needs
* to be cognizant of the number of new devices coming online
* via support for heterogeneous architecture platforms.
* e.g., PCs, HP's HIL, Sun's Type5 keyboard,...
*/
#define NUM_SUPPORTED_INTERFACES (NX_EVS_DEVICE_INTERFACE_TYPE5 + 1)
// Other, NeXT, ADB, ACE,...
/* Device types */
#define NX_EVS_DEVICE_TYPE_OTHER 0
#define NX_EVS_DEVICE_TYPE_KEYBOARD 1
#define NX_EVS_DEVICE_TYPE_MOUSE 2 // Relative position devices
#define NX_EVS_DEVICE_TYPE_TABLET 3 // Absolute position devices
typedef struct {
int interface; /* NeXT, ADB, other */
int interface_addr; /* Device address on the interface */
int dev_type; /* Keyboard, mouse, tablet, other */
int id; /* manufacturer's device handler ID */
} NXEventSystemDevice;
typedef struct {
NXEventSystemDevice dev[NX_EVS_DEVICE_MAX];
} NXEventSystemDeviceList;
#define __OLD_NX_EVS_DEVICE_INFO 1
#define NX_EVS_DEVICE_INFO "Evs_EventDeviceInfo"
#define NX_EVS_DEVICE_INFO_COUNT \
(sizeof (NXEventSystemDeviceList) / sizeof (int))
/*
* Types used in evScreen protocol compliant operations.
*/
typedef enum {EVNOP, EVHIDE, EVSHOW, EVMOVE, EVLEVEL} EvCmd; /* Cursor state */
#define EV_SCREEN_MIN_BRIGHTNESS 0
#define EV_SCREEN_MAX_BRIGHTNESS 64
/* Scale should lie between MIN_BRIGHTNESS and MAX_BRIGHTNESS */
#define EV_SCALE_BRIGHTNESS( scale, datum ) \
((((UInt32)(datum))*((UInt32)scale)) >> 6)
/*
* Definition of a tick, as a time in milliseconds. This controls how
* often the event system periodic jobs are run. All actual tick times
* are derived from the nanosecond timer. These values are typically used
* as part of computing mouse velocity for acceleration purposes.
*/
#define EV_TICK_TIME 16 /* 16 milliseconds */
#define EV_TICKS_PER_SEC (1000/EV_TICK_TIME) /* ~ 62 Hz */
/* Mouse Button bits, as passed from an EventSrc to the Event Driver */
#define EV_RB (0x01)
#define EV_LB (0x04)
#define EV_MOUSEBUTTONMASK (EV_LB | EV_RB)
/* Tablet Pressure Constants, as passed from an EventSrc to the Event Driver */
#define EV_MINPRESSURE 0
#define EV_MAXPRESSURE 255
/* Cursor size in pixels */
#define EV_CURSOR_WIDTH 16
#define EV_CURSOR_HEIGHT 16
#define kAppleOnboardGUID 0x0610000000000000ULL
#endif /* !_DEV_EV_TYPES_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hidsystem/IOHIDWorkLoop.h |
#ifndef _IOKIT_IOHIDWORKLOOP_H
#define _IOKIT_IOHIDWORKLOOP_H
#include <IOKit/IOWorkLoop.h>
class __kpi_deprecated ("Use DriverKit") IOHIDWorkLoop : public IOWorkLoop
{
OSDeclareDefaultStructors(IOHIDWorkLoop)
protected:
lck_grp_t * fLockGroup;
bool init ( void ) APPLE_KEXT_OVERRIDE;
void free ( void ) APPLE_KEXT_OVERRIDE;
public:
// Create a workloop
static IOHIDWorkLoop * workLoop();
};
#endif /* ! _IOKIT_IOHIDWORKLOOP_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hidsystem/ev_keymap.h | /*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved.
*
* ev_keymap.h
* Defines the structure used for parsing keymappings. These structures
* and definitions are used by event sources in the kernel and by
* applications and utilities which manipulate keymaps.
*
* HISTORY
* 02-Jun-1992 Mike Paquette at NeXT
* Created.
*/
#ifndef _DEV_EV_KEYMAP_H
#define _DEV_EV_KEYMAP_H
#define NX_NUMKEYCODES 256 /* Highest key code is 0xff. ADB used to use 0x80 for keydown state, but who the heck uses adb anymore. */
#define NX_NUMSEQUENCES 128 /* Maximum possible number of sequences */
#define NX_NUMMODIFIERS 16 /* Maximum number of modifier bits */
#define NX_BYTE_CODES 0 /* If first short 0, all are bytes (else shorts) */
#define NX_WHICHMODMASK 0x0f /* bits out of keyBits for bucky bits */
#define NX_MODMASK 0x10 /* Bit out of keyBits indicates modifier bit */
#define NX_CHARGENMASK 0x20 /* bit out of keyBits for char gen */
#define NX_SPECIALKEYMASK 0x40 /* bit out of keyBits for specialty key */
#define NX_KEYSTATEMASK 0x80 /* OBSOLETE - DO NOT USE IN NEW DESIGNS */
/*
* Special keys currently known to and understood by the system.
* If new specialty keys are invented, extend this list as appropriate.
* The presence of these keys in a particular implementation is not
* guaranteed.
*/
#define NX_NOSPECIALKEY 0xFFFF
#define NX_KEYTYPE_SOUND_UP 0
#define NX_KEYTYPE_SOUND_DOWN 1
#define NX_KEYTYPE_BRIGHTNESS_UP 2
#define NX_KEYTYPE_BRIGHTNESS_DOWN 3
#define NX_KEYTYPE_CAPS_LOCK 4
#define NX_KEYTYPE_HELP 5
#define NX_POWER_KEY 6
#define NX_KEYTYPE_MUTE 7
#define NX_UP_ARROW_KEY 8
#define NX_DOWN_ARROW_KEY 9
#define NX_KEYTYPE_NUM_LOCK 10
#define NX_KEYTYPE_CONTRAST_UP 11
#define NX_KEYTYPE_CONTRAST_DOWN 12
#define NX_KEYTYPE_LAUNCH_PANEL 13
#define NX_KEYTYPE_EJECT 14
#define NX_KEYTYPE_VIDMIRROR 15
#define NX_KEYTYPE_PLAY 16
#define NX_KEYTYPE_NEXT 17
#define NX_KEYTYPE_PREVIOUS 18
#define NX_KEYTYPE_FAST 19
#define NX_KEYTYPE_REWIND 20
#define NX_KEYTYPE_ILLUMINATION_UP 21
#define NX_KEYTYPE_ILLUMINATION_DOWN 22
#define NX_KEYTYPE_ILLUMINATION_TOGGLE 23
#define NX_NUMSPECIALKEYS 24 /* Maximum number of special keys */
#define NX_NUM_SCANNED_SPECIALKEYS 24 /* First 24 special keys are */
/* actively scanned in kernel */
#define NX_KEYTYPE_MENU 25
/* Mask of special keys that are posted as events */
#define NX_SPECIALKEY_POST_MASK \
((1 << NX_KEYTYPE_SOUND_UP) | (1 << NX_KEYTYPE_SOUND_DOWN) | \
(1 << NX_POWER_KEY) | (1 << NX_KEYTYPE_MUTE) | \
(1 << NX_KEYTYPE_BRIGHTNESS_UP) | (1 << NX_KEYTYPE_BRIGHTNESS_DOWN) | \
(1 << NX_KEYTYPE_CONTRAST_UP) | (1 << NX_KEYTYPE_CONTRAST_UP) | \
(1 << NX_KEYTYPE_LAUNCH_PANEL) | (1 << NX_KEYTYPE_EJECT) | \
(1 << NX_KEYTYPE_VIDMIRROR) | (1 << NX_KEYTYPE_PLAY) | \
(1 << NX_KEYTYPE_NEXT) | (1 << NX_KEYTYPE_PREVIOUS) | \
(1 << NX_KEYTYPE_FAST) | (1 << NX_KEYTYPE_REWIND) | \
(1 << NX_KEYTYPE_ILLUMINATION_UP) | \
(1 << NX_KEYTYPE_ILLUMINATION_DOWN) | \
(1 << NX_KEYTYPE_ILLUMINATION_TOGGLE) | 0)
/* Modifier key indices into modDefs[] */
#define NX_MODIFIERKEY_ALPHALOCK 0
#define NX_MODIFIERKEY_SHIFT 1
#define NX_MODIFIERKEY_CONTROL 2
#define NX_MODIFIERKEY_ALTERNATE 3
#define NX_MODIFIERKEY_COMMAND 4
#define NX_MODIFIERKEY_NUMERICPAD 5
#define NX_MODIFIERKEY_HELP 6
#define NX_MODIFIERKEY_SECONDARYFN 7
#define NX_MODIFIERKEY_NUMLOCK 8
/* support for right hand modifier */
#define NX_MODIFIERKEY_RSHIFT 9
#define NX_MODIFIERKEY_RCONTROL 10
#define NX_MODIFIERKEY_RALTERNATE 11
#define NX_MODIFIERKEY_RCOMMAND 12
#define NX_MODIFIERKEY_ALPHALOCK_STATELESS 13
#define NX_MODIFIERKEY_LAST_KEY 13
typedef struct _NXParsedKeyMapping_ {
/* If nonzero, all numbers are shorts; if zero, all numbers are bytes*/
short shorts;
/*
* For each keycode, low order bit says if the key
* generates characters.
* High order bit says if the key is assigned to a modifier bit.
* The second to low order bit gives the current state of the key.
*/
char keyBits[NX_NUMKEYCODES];
/* Bit number of highest numbered modifier bit */
int maxMod;
/* Pointers to where the list of keys for each modifiers bit begins,
* or NULL.
*/
unsigned char *modDefs[NX_NUMMODIFIERS];
/* Key code of highest key deinfed to generate characters */
int numDefs;
/* Pointer into the keyMapping where this key's definitions begin */
unsigned char *keyDefs[NX_NUMKEYCODES];
/* number of sequence definitions */
int numSeqs;
/* pointers to sequences */
unsigned char *seqDefs[NX_NUMSEQUENCES];
/* Special key definitions */
int numSpecialKeys;
/* Special key values, or 0xFFFF if none */
unsigned short specialKeys[NX_NUMSPECIALKEYS];
/* Pointer to the original keymapping string */
const unsigned char *mapping;
/* Length of the original string */
int mappingLen;
} NXParsedKeyMapping;
#endif /* !_DEV_EV_KEYMAP_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hidsystem/IOHIPointing.h | /*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOHIPOINTING_H
#define _IOHIPOINTING_H
#include <IOKit/hidsystem/IOHIPointing.h>
#include <IOKit/hidsystem/IOHIDevice.h>
#include <IOKit/hidsystem/IOHIDTypes.h>
/* Start Action Definitions */
/*
* HISTORICAL NOTE:
* The following entry points were part of the IOHIPointingEvents
* protocol.
*/
typedef void (*RelativePointerEventAction)(OSObject * target,
/* buttons */ int buttons,
/* deltaX */ int dx,
/* deltaY */ int dy,
/* atTime */ AbsoluteTime ts);
typedef void (*AbsolutePointerEventAction)(OSObject * target,
/* buttons */ int buttons,
/* at */ IOGPoint * newLoc,
/* withBounds */ IOGBounds *bounds,
/* inProximity */ bool proximity,
/* withPressure */ int pressure,
/* withAngle */ int stylusAngle,
/* atTime */ AbsoluteTime ts);
typedef void (*ScrollWheelEventAction)(OSObject * target,
short deltaAxis1,
short deltaAxis2,
short deltaAxis3,
AbsoluteTime ts);
/* Event Callback Definitions */
typedef void (*RelativePointerEventCallback)(
/* target */ OSObject * target,
/* buttons */ int buttons,
/* deltaX */ int dx,
/* deltaY */ int dy,
/* atTime */ AbsoluteTime ts,
/* sender */ OSObject * sender,
/* refcon */ void * refcon);
typedef void (*AbsolutePointerEventCallback)(
/* target */ OSObject * target,
/* buttons */ int buttons,
/* at */ IOGPoint * newLoc,
/* withBounds */ IOGBounds *bounds,
/* inProximity */ bool proximity,
/* withPressure */ int pressure,
/* withAngle */ int stylusAngle,
/* atTime */ AbsoluteTime ts,
/* sender */ OSObject * sender,
/* refcon */ void * refcon);
typedef void (*ScrollWheelEventCallback)(
/* target */ OSObject * target,
/* delta1 */ short deltaAxis1,
/* delta2 */ short deltaAxis2,
/* delta3 */ short deltaAxis3,
/* fixedDelta1 */ IOFixed fixedDelta1,
/* fixedDelta2 */ IOFixed fixedDelta2,
/* fixedDelta3 */ IOFixed fixedDelta3,
/* pointDelta1 */ SInt32 pointDelta1,
/* pointDelta2 */ SInt32 pointDelta2,
/* pointDelta3 */ SInt32 pointDelta3,
/* reserved */ SInt32 options,
/* atTime */ AbsoluteTime ts,
/* sender */ OSObject * sender,
/* refcon */ void * refcon);
/* End Action Definitions */
/* Default accel level parameters */
#define EV_DEFAULTPOINTERACCELLEVEL 0x0000b000
#define EV_DEFAULTSCROLLACCELLEVEL 0x00005000
class IOHIDPointingDevice;
struct ScrollAccelInfo;
#if defined(KERNEL) && !defined(KERNEL_PRIVATE)
class __deprecated_msg("Use DriverKit") IOHIPointing : public IOHIDevice
#else
class IOHIPointing : public IOHIDevice
#endif
{
OSDeclareDefaultStructors(IOHIPointing);
friend class IOHITablet;
friend class IOHIDPointing;
private:
IOLock * _deviceLock; // Lock for all device access
int _buttonMode; // The "handedness" of the pointer
IOFixed _acceleration;
bool _convertAbsoluteToRelative;
bool _contactToMove;
bool _hadContact;
IOGPoint _previousLocation;
UInt8 _pressureThresholdToClick; // A scale factor of 0 to 255 to determine how much pressure is necessary to generate a primary mouse click - a value of 255 means no click will be generated
void * _scaleSegments;
IOItemCount _scaleSegCount;
IOFixed _fractX;
IOFixed _fractY;
OSObject * _relativePointerEventTarget;
RelativePointerEventAction _relativePointerEventAction;
OSObject * _absolutePointerEventTarget;
AbsolutePointerEventAction _absolutePointerEventAction;
OSObject * _scrollWheelEventTarget;
ScrollWheelEventAction _scrollWheelEventAction;
struct ExpansionData;
ExpansionData * _reserved;
void setPointingMode(UInt32 accelerateMode);
UInt32 getPointingMode ();
void setScrollType(UInt32 scrollType);
UInt32 getScrollType();
void dispatchScrollWheelEventWithAccelInfo(
SInt32 deltaAxis1,
SInt32 deltaAxis2,
SInt32 deltaAxis3,
ScrollAccelInfo * info,
AbsoluteTime ts);
protected:
virtual void dispatchRelativePointerEvent(int dx,
int dy,
UInt32 buttonState,
AbsoluteTime ts);
virtual void dispatchAbsolutePointerEvent(IOGPoint * newLoc,
IOGBounds * bounds,
UInt32 buttonState,
bool proximity,
int pressure,
int pressureMin,
int pressureMax,
int stylusAngle,
AbsoluteTime ts);
virtual void dispatchScrollWheelEvent(short deltaAxis1,
short deltaAxis2,
short deltaAxis3,
AbsoluteTime ts);
public:
virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE;
virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE;
virtual void free(void) APPLE_KEXT_OVERRIDE;
virtual bool open(IOService * client,
IOOptionBits options,
RelativePointerEventAction rpeAction,
AbsolutePointerEventAction apeAction,
ScrollWheelEventAction sweAction);
bool open( IOService * client,
IOOptionBits options,
void *,
RelativePointerEventCallback rpeCallback,
AbsolutePointerEventCallback apeCallback,
ScrollWheelEventCallback sweCallback);
virtual void close(IOService * client, IOOptionBits ) APPLE_KEXT_OVERRIDE;
virtual IOReturn message( UInt32 type, IOService * provider,
void * argument = 0 ) APPLE_KEXT_OVERRIDE;
virtual IOHIDKind hidKind(void) APPLE_KEXT_OVERRIDE;
virtual bool updateProperties( void ) APPLE_KEXT_OVERRIDE;
virtual IOReturn setParamProperties( OSDictionary * dict ) APPLE_KEXT_OVERRIDE;
virtual IOReturn powerStateWillChangeTo( IOPMPowerFlags powerFlags,
unsigned long newState, IOService * device) APPLE_KEXT_OVERRIDE;
virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags powerFlags,
unsigned long newState, IOService * device) APPLE_KEXT_OVERRIDE;
protected: // for subclasses to implement
virtual OSData * copyAccelerationTable();
virtual IOItemCount buttonCount();
virtual IOFixed resolution();
// RY: Adding method to copy scroll wheel accel table.
// Unfortunately, we don't have any padding, so this
// is going to be non-virtual.
/*virtual*/ OSData * copyScrollAccelerationTable();
private:
virtual bool resetPointer();
virtual void scalePointer(int * dxp, int * dyp);
virtual void setupForAcceleration(IOFixed accl);
// RY: Adding methods to support scroll wheel accel.
// Unfortunately, we don't have any padding, so these
// are going to be non-virtual.
/*virtual*/ bool resetScroll();
/*virtual*/ void setupScrollForAcceleration(IOFixed accl);
// RY: We have to make sure that subclasses that will
// take advantage of this have their defined resolution
// in their property table.
/*virtual*/ IOFixed scrollResolutionForType(SInt32 type=-1);
/*virtual*/ IOFixed scrollReportRate();
/*virtual*/ OSData * copyScrollAccelerationTableForType(SInt32 type=-1);
private:
static void _relativePointerEvent( IOHIPointing * self,
int buttons,
/* deltaX */ int dx,
/* deltaY */ int dy,
/* atTime */ AbsoluteTime ts);
/* Tablet event reporting */
static void _absolutePointerEvent(IOHIPointing * self,
int buttons,
/* at */ IOGPoint * newLoc,
/* withBounds */ IOGBounds *bounds,
/* inProximity */ bool proximity,
/* withPressure */ int pressure,
/* withAngle */ int stylusAngle,
/* atTime */ AbsoluteTime ts);
/* Mouse scroll wheel event reporting */
static void _scrollWheelEvent(IOHIPointing *self,
short deltaAxis1,
short deltaAxis2,
short deltaAxis3,
AbsoluteTime ts);
};
#endif /* !_IOHIPOINTING_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hidsystem/IOHIDShared.h | /*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2011 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _DEV_EVIO_H
#define _DEV_EVIO_H
#include <sys/cdefs.h>
__BEGIN_DECLS
#if KERNEL
#include <IOKit/system.h>
#else /* !KERNEL */
#include <mach/message.h>
#include <IOKit/IOKitLib.h>
#endif /* KERNEL */
#include <IOKit/IOReturn.h>
#include <IOKit/graphics/IOGraphicsTypes.h>
#include <IOKit/hidsystem/IOHIDTypes.h>
#include <IOKit/hidsystem/IOLLEvent.h>
/*
* Identify this driver as one that uses the new driverkit and messaging API
*/
#ifndef _NeXT_MACH_EVENT_DRIVER_
#define _NeXT_MACH_EVENT_DRIVER_ (1)
#endif /* _NeXT_MACH_EVENT_DRIVER_ */
/* Pressure Constants */
#define MINPRESSURE EV_MINPRESSURE
#define MAXPRESSURE EV_MAXPRESSURE
#define LLEQSIZE 240 /* Entries in low-level event queue */
typedef struct _NXEQElStruct {
int next; /* Slot of lleq for next event */
OSSpinLock sema; /* Is high-level code reading this event now? */
NXEvent event; /* The event itself */
} NXEQElement;
/******************************************************************************
SHARED MEMORY OVERVIEW
PERSPECTIVE
The ev driver and PostScript share at least one page of wired memory.
This memory contains the low-level event queue which ev deposits events
into and PostScript reads events from. Also, this memory contains other
important data such as wait cursor state and some general cursor state.
This memory is critical for speed. That is, we avoid having to make
system calls for common operations.
SHARED MEMORY REGIONS
There are currently three "regions" or "zones" delineated within this
shared memory. The first zone is the EvOffsets structure. This structure
contains two offsets from the beginning of shared memory. The first offset
is to the second zone, EvGlobals. The second offset is to the third
zone, private shmem for drivers.
INITIALIZATION OF SHARED MEMORY
When the WindowServer starts up, it finds all screens that will be active.
It then opens the ev driver and calls the EVIOSSCR ioctl repeatedly for
each screen in use. This lets the ev driver set up the evScreen array
and fill in each element. This ioctl also returns to PostScript a running
total shared memory size with which to allocate. PostScript then allocates
a region of memory this size and calls evmmap to "map in" this shared
region. Evmmap initializes and fills in the EvOffsets and EvGlobals.
Next the WindowServer calls each screen in turn to register itself with
the ev driver in the same sequence as presented to EVIOSSCR. Each screen
driver calls ev_register_screen() which among other things allocates a
part of the private shmem (of the third shared memory zone) for the driver.
DEBUGGING NOTES
You can easily display and set this shared memory from kgdb, but usually
cannot do so from within PostScript. Gdb (or some weird interaction
between gdb and the os) chokes on this shmem. So if you read or write
this area of memory, copy-on-write will occur and you'll get a completely
new page for PostScript. This will render the shared memory scheme
useless and you will have to restart PostScript. It was my understanding
that before, we were able to "read" this area from PS, but not write to
it (the idea behind copy-on-WRITE). However, this seems to be broken
in 2.0. We think this is a kernel bug.
******************************************************************************/
typedef volatile struct _evOffsets {
int evGlobalsOffset; /* Offset to EvGlobals structure */
int evShmemOffset; /* Offset to private shmem regions */
} EvOffsets;
/******************************************************************************
EvGlobals
This structures defines the portion of the events driver data structure
that is exported to the PostScript server. It contains the event queue
which is in memory shared between the driver and the PostScript server.
All the variables necessary to read and process events from the queue are
contained here.
******************************************************************************/
typedef volatile struct _evGlobals {
OSSpinLock cursorSema; /* set to disable periodic code */
int eNum; /* Unique id for mouse events */
int buttons; /* State of the mouse buttons 1==down, 0==up */
int eventFlags; /* The current value of event.flags */
int VertRetraceClock; /* The current value of event.time */
IOGPoint cursorLoc; /* The current location of the cursor, in desktop coordinates */
int frame; /* current cursor frame */
IOGBounds workBounds; /* bounding box of all screens */
IOGBounds mouseRect; /* Rect for mouse-exited events */
int version; /* for run time checks */
int structSize; /* for run time checks */
int lastFrame;
/* The current location of the cursor, 24.8 bit fixed point format */
IOFixedPoint32 screenCursorFixed; /* in Screen coordinates */
IOFixedPoint32 desktopCursorFixed;/* in Desktop coordinates */
unsigned int reservedA[27];
unsigned reserved:25;
unsigned updateCursorPositionFromFixed:1; /* if this is set, IOHIDSystem will take any cursor position updates from desktopCursorFixed instead of cursorLoc */
unsigned logCursorUpdates:1; /* log cursor updates */
unsigned wantPressure:1; /* pressure in current mouseRect? */
unsigned wantPrecision:1; /* precise coordinates in current mouseRect? */
unsigned dontWantCoalesce:1; /* coalesce within the current mouseRect? */
unsigned dontCoalesce:1; /* actual flag which determines coalescing */
unsigned mouseRectValid:1; /* If nonzero, post a mouse-exited whenever mouse outside mouseRect. */
int movedMask; /* This contains an event mask for the three events MOUSEMOVED,
LMOUSEDRAGGED, and RMOUSEDRAGGED. It says whether driver should
generate those events. */
OSSpinLock waitCursorSema; /* protects wait cursor fields */
int AALastEventSent; /* timestamp for wait cursor */
int AALastEventConsumed; /* timestamp for wait cursor */
int waitCursorUp; /* Is wait cursor up? */
char ctxtTimedOut; /* Has wait cursor timer expired? */
char waitCursorEnabled; /* Play wait cursor game (per ctxt)? */
char globalWaitCursorEnabled; /* Play wait cursor game (global)? */
int waitThreshold; /* time before wait cursor appears */
int LLEHead; /* The next event to be read */
int LLETail; /* Where the next event will go */
int LLELast; /* The last event entered */
NXEQElement lleq[LLEQSIZE]; /* The event queue itself */
} EvGlobals;
/* These evio structs are used in various calls supported by the ev driver. */
struct evioLLEvent {
int setCursor;
int type;
IOGPoint location;
NXEventData data;
int setFlags;
int flags;
};
typedef struct evioLLEvent _NXLLEvent;
#ifdef mach3xxx
/*
* On a keypress of a VOL UP or VOL DOWN key, we send a message to the
* sound server to notify it of the volume change. The message includes
* a flag to indicate which key was pressed, and the machine independant
* flag bits to indicate which modifier keys were pressed.
*/
struct evioSpecialKeyMsg
{
msg_header_t Head;
msg_type_t keyType;
int key; // special key number, from bsd/dev/ev_keymap.h
msg_type_t directionType;
int direction; // NX_KEYDOWN, NX_KEYUP from event.h
msg_type_t flagsType;
int flags; // device independant flags from event.h
msg_type_t levelType;
int level; // EV_AUDIO_MIN_VOLUME to EV_AUDIO_MAX_VOLUME
};
#else
struct evioSpecialKeyMsg
{
mach_msg_header_t Head;
int key; // special key number, from bsd/dev/ev_keymap.h
int direction; // NX_KEYDOWN, NX_KEYUP from event.h
int flags; // device independant flags from event.h
int level; // EV_AUDIO_MIN_VOLUME to EV_AUDIO_MAX_VOLUME
};
#endif
#define EV_SPECIAL_KEY_MSG_ID (('S'<<24) | ('k'<<16) | ('e'<<8) | ('y'))
typedef struct evioSpecialKeyMsg *evioSpecialKeyMsg_t;
/*
* Volume ranges
*/
#define EV_AUDIO_MIN_VOLUME 0
#define EV_AUDIO_MAX_VOLUME 64
#define kIOHIDSystemClass "IOHIDSystem"
#define kIOHIKeyboardClass "IOHIKeyboard"
#define kIOHIPointingClass "IOHIPointing"
#define IOHIDSYSTEM_CONFORMSTO kIOHIDSystemClass
enum {
kIOHIDEventNotification = 0,
};
#define kIOHIDCurrentShmemVersion 4
#define kIOHIDLastCompatibleShmemVersion 3
enum {
kIOHIDServerConnectType = 0,
kIOHIDParamConnectType = 1,
kIOHIDEventSystemConnectType = 3,
};
enum {
kIOHIDGlobalMemory = 0
};
enum {
kIOHIDEventQueueTypeKernel = 0,
kIOHIDEventQueueTypeUser = 1
};
#ifdef KERNEL
typedef UInt16 (*MasterVolumeUpdate)(void);
typedef bool (*MasterMuteUpdate)(void);
typedef struct {
MasterVolumeUpdate incrementMasterVolume;
MasterVolumeUpdate decrementMasterVolume;
MasterMuteUpdate toggleMasterMute;
} MasterAudioFunctions;
extern MasterAudioFunctions *masterAudioFunctions;
#endif
#ifndef KERNEL
#ifndef _IOKIT_IOHIDLIB_H
#include <IOKit/hidsystem/IOHIDLib.h>
#endif
#endif /* !KERNEL */
enum {
/*!
@defined kIOHIDOpenedByEventSystem
@abstract option passed to open for IOHIDInterface if opened by IOHIDEventDriver
*/
kIOHIDOpenedByEventSystem = 0x10000,
/*!
@defined kIOHIDOpenedByFastPathClient
@abstract option passed to open for IOHIDEventService if opened by fast path client
*/
kIOHIDOpenedByFastPathClient = 0x20000
};
// iokit_vendor_specific_msg(1) unused
/*!
@defined kIOHIDMessageRelayServiceInterfaceActive
@abstract message from IOHIDDevice to indicate that the IOHIDRelayService's USB interface is active.
*/
#define kIOHIDMessageRelayServiceInterfaceActive iokit_vendor_specific_msg(2)
__END_DECLS
#endif /* !_DEV_EVIO_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hidsystem/IOHIDevice.h | /*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved.
*
* IOHIDevice.h - Common Event Source object class.
*
* HISTORY
* 22 May 1992 Mike Paquette at NeXT
* Created.
* 4 Aug 1993 Erik Kay at NeXT
* API cleanup
* 5 Aug 1993 Erik Kay at NeXT
* added ivar space for future expansion
*/
#ifndef _IOHIDEVICE_H
#define _IOHIDEVICE_H
#include <IOKit/IOService.h>
#include <IOKit/IOLocks.h>
typedef enum {
kHIUnknownDevice = 0,
kHIKeyboardDevice = 1,
kHIRelativePointingDevice = 2
} IOHIDKind;
#if defined(KERNEL) && !defined(KERNEL_PRIVATE)
class __deprecated_msg("Use DriverKit") IOHIDevice : public IOService
#else
class IOHIDevice : public IOService
#endif
{
OSDeclareDefaultStructors(IOHIDevice);
public:
virtual bool init(OSDictionary * properties = 0) APPLE_KEXT_OVERRIDE;
virtual void free(void) APPLE_KEXT_OVERRIDE;
virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE;
virtual bool open( IOService * forClient,
IOOptionBits options = 0,
void * arg = 0 ) APPLE_KEXT_OVERRIDE;
virtual UInt32 deviceType();
virtual IOHIDKind hidKind();
virtual UInt32 interfaceID();
virtual bool updateProperties(void);
virtual IOReturn setProperties( OSObject * properties ) APPLE_KEXT_OVERRIDE;
virtual IOReturn setParamProperties(OSDictionary * dict);
virtual UInt64 getGUID();
static SInt32 GenerateKey(OSObject *object);
};
#endif /* !_IOHIDEVICE_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hidsystem/IOHIDParameter.h | /*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved.
*
* evsio.h - Get/Set parameter calls for Event Status Driver.
*
* CAUTION: Developers should stick to the API exported in
* <drivers/event_status_driver.h> to guarantee
* binary compatability of their applications in future
* releases.
*
* HISTORY
* 22 May 1992 Mike Paquette at NeXT
* Created.
*/
#ifndef _DEV_EVSIO_H
#define _DEV_EVSIO_H
/* Public type definitions. */
#include <IOKit/hidsystem/IOHIDTypes.h>
#include <IOKit/hidsystem/IOLLEvent.h>
#include <IOKit/hid/IOHIDProperties.h>
/*
* Identify this driver as one that uses the new driverkit and messaging API
*/
#ifndef _NeXT_MACH_EVENT_DRIVER_
#define _NeXT_MACH_EVENT_DRIVER_ (1)
#endif /* !_NeXT_MACH_EVENT_DRIVER_ */
/* * */
#define kIOHIDKindKey "HIDKind"
#define kIOHIDInterfaceIDKey "HIDInterfaceID"
#define kIOHIDSubinterfaceIDKey "HIDSubinterfaceID"
#define kIOHIDOriginalSubinterfaceIDKey "HIDOriginalSubinterfaceID"
#define kIOHIDParametersKey "HIDParameters"
#define kIOHIDVirtualHIDevice "HIDVirtualDevice"
#define kIOHIDKeyRepeatKey "HIDKeyRepeat"
#define kIOHIDInitialKeyRepeatKey "HIDInitialKeyRepeat"
#define kIOHIDKeyMappingKey "HIDKeyMapping"
#define kIOHIDResetKeyboardKey "HIDResetKeyboard"
#define kIOHIDKeyboardModifierMappingPairsKey "HIDKeyboardModifierMappingPairs"
#define kIOHIDKeyboardModifierMappingSrcKey "HIDKeyboardModifierMappingSrc"
#define kIOHIDKeyboardModifierMappingDstKey "HIDKeyboardModifierMappingDst"
#define kIOHIDKeyboardCapsLockDoesLockKey "HIDKeyboardCapsLockDoesLock"
#define kIOHIDKeyboardSupportsF12EjectKey "HIDKeyboardSupportsF12Eject"
#define kIOHIDKeyboardSupportedModifiersKey "HIDKeyboardSupportedModifiers"
#define kIOHIDKeyboardGlobalModifiersKey "HIDKeyboardGlobalModifiers"
//read only property that specify usage of clobal modifiers
// Bit[0] - Report modifiers to the service by setting kIOHIDKeyboardGlobalModifiersKey with global modifiers
// Bit[1] - Update/translate events from service taking global modifiers state in consideration
#define kIOHIDServiceGlobalModifiersUsageKey "HIDServiceGlobalModifiersUsage"
#define kIOHIDPointerResolutionKey "HIDPointerResolution"
#define kIOHIDResetPointerKey "HIDResetPointer"
#define kIOHIDPointerConvertAbsoluteKey "HIDPointerConvertAbsolute"
#define kIOHIDPointerContactToMoveKey "HIDPointerContactToMove"
#define kIOHIDPointerPressureToClickKey "HIDPointerPressureToClick"
#define kIOHIDPointerButtonCountKey "HIDPointerButtonCount"
#define kIOHIDPointerAccelerationSettingsKey "HIDPointerAccelerationSettings"
#define kIOHIDPointerAccelerationTableKey "HIDPointerAccelerationTable"
// velocity for pointer acceleration
#define kIOHIDPointerAccelerationMultiplierKey "HIDPointerAccelerationMultiplier"
#define kIOHIDScrollResetKey "HIDScrollReset"
#define kIOHIDScrollResolutionKey "HIDScrollResolution"
#define kIOHIDScrollReportRateKey "HIDScrollReportRate"
#define kIOHIDScrollAccelerationTableKey "HIDScrollAccelerationTable"
#define kIOHIDScrollResolutionXKey "HIDScrollResolutionX"
#define kIOHIDScrollResolutionYKey "HIDScrollResolutionY"
#define kIOHIDScrollResolutionZKey "HIDScrollResolutionZ"
#define kIOHIDScrollAccelerationTableXKey "HIDScrollAccelerationTableX"
#define kIOHIDScrollAccelerationTableYKey "HIDScrollAccelerationTableY"
#define kIOHIDScrollAccelerationTableZKey "HIDScrollAccelerationTableZ"
#define kIOHIDScrollMouseButtonKey "HIDScrollMouseButton"
#define kIOHIDScrollZoomModifierMaskKey "HIDScrollZoomModifierMask"
#define kIOHIDTrackpadScrollAccelerationKey "HIDTrackpadScrollAcceleration"
#define kIOHIDTrackpadAccelerationType "HIDTrackpadAcceleration"
#define kIOHIDClickTimeKey "HIDClickTime"
#define kIOHIDClickSpaceKey "HIDClickSpace"
#define kIOHIDWaitCursorFrameIntervalKey "HIDWaitCursorFrameInterval"
#define kIOHIDAutoDimThresholdKey "HIDAutoDimThreshold"
#define kIOHIDAutoDimStateKey "HIDAutoDimState"
#define kIOHIDAutoDimTimeKey "HIDAutoDimTime"
#define kIOHIDIdleTimeKey "HIDIdleTime"
#define kIOHIDBrightnessKey "HIDBrightness"
#define kIOHIDAutoDimBrightnessKey "HIDAutoDimBrightness"
#define kIOHIDFKeyModeKey "HIDFKeyMode"
// if kIOHIDStickyKeysDisabledKey is 1, then all sticky keys functionality
// is completely turned off. Multiple shifts will have no effect.
#define kIOHIDStickyKeysDisabledKey "HIDStickyKeysDisabled"
// if kIOHIDStickyKeysOnKey is 1 then a depressed modifier will stay down
// until a non-modifer key is pressed (or sticky keys is turned off)
#define kIOHIDStickyKeysOnKey "HIDStickyKeysOn"
// if kIOHIDStickyKeysShiftTogglesKey is 1, then a sequence of five
// shift keys in sequence will toggle sticky keys on or off
#define kIOHIDStickyKeysShiftTogglesKey "HIDStickyKeysShiftToggles"
//
//
#define kIOHIDResetStickyKeyNotification "HIDResetStickyKeyNotification"
// if kIOHIDMouseKeysOptionTogglesKey is 1, then a sequence of five
// option keys in sequence will toggle mouse keys on or off
#define kIOHIDMouseKeysOptionTogglesKey "HIDMouseKeysOptionToggles"
// kIOHIDSlowKeysDelayKey represents the delay used for slow keys.
// if kIOHIDSlowKeysDelayKey is 0, then slow keys off
#define kIOHIDSlowKeysDelayKey "HIDSlowKeysDelay"
#define kIOHIDF12EjectDelayKey "HIDF12EjectDelay"
#define kIOHIDMouseKeysOnKey "HIDMouseKeysOn"
#define kIOHIDUseKeyswitchKey "HIDUseKeyswitch"
#define kIOHIDDisallowRemappingOfPrimaryClickKey "HIDDisallowRemappingOfPrimaryClick"
#define kIOHIDMouseKeysEnablesVirtualNumPadKey "HIDMouseKeysEnablesVirtualNumPad"
#define kIOHIDResetLEDsKey "HIDResetLEDs"
// Parametric Acceleration Keys
#define kHIDAccelParametricCurvesKey "HIDAccelCurves"
#define kHIDPointerReportRateKey "HIDPointerReportRate"
#define kHIDTrackingAccelParametricCurvesKey "HIDTrackingAccelCurves"
#define kHIDScrollAccelParametricCurvesKey "HIDScrollAccelCurves"
#define kHIDAccelParametricCurvesDebugKey "HIDAccelCurvesDebug"
#define kHIDScrollAccelParametricCurvesDebugKey "HIDScrollAccelCurvesDebug"
#define kHIDAccelGainLinearKey "HIDAccelGainLinear"
#define kHIDAccelGainParabolicKey "HIDAccelGainParabolic"
#define kHIDAccelGainCubicKey "HIDAccelGainCubic"
#define kHIDAccelGainQuarticKey "HIDAccelGainQuartic"
#define kHIDAccelTangentSpeedLinearKey "HIDAccelTangentSpeedLinear"
#define kHIDAccelTangentSpeedParabolicRootKey "HIDAccelTangentSpeedParabolicRoot"
#define kHIDAccelTangentSpeedCubicRootKey "HIDAccelTangentSpeedCubicRoot"
#define kHIDAccelTangentSpeedQuarticRootKey "HIDAccelTangentSpeedQuarticRoot"
#define kHIDAccelIndexKey "HIDAccelIndex"
// Scroll Count Keys
#define kIOHIDScrollCountMaxTimeDeltaBetweenKey "HIDScrollCountMaxTimeDeltaBetween"
#define kIOHIDScrollCountMaxTimeDeltaToSustainKey "HIDScrollCountMaxTimeDeltaToSustain"
#define kIOHIDScrollCountMinDeltaToStartKey "HIDScrollCountMinDeltaToStart"
#define kIOHIDScrollCountMinDeltaToSustainKey "HIDScrollCountMinDeltaToSustain"
#define kIOHIDScrollCountIgnoreMomentumScrollsKey "HIDScrollCountIgnoreMomentumScrolls"
#define kIOHIDScrollCountMouseCanResetKey "HIDScrollCountMouseCanReset"
#define kIOHIDScrollCountMaxKey "HIDScrollCountMax"
#define kIOHIDScrollCountAccelerationFactorKey "HIDScrollCountAccelerationFactor"
#define kIOHIDScrollCountZeroKey "HIDScrollCountZero"
#define kIOHIDScrollCountBootDefaultKey "HIDScrollCountBootDefault"
#define kIOHIDScrollCountResetKey "HIDScrollCountReset"
// HIDSystem Property Key
// Mark user activity state on HID System
#define kIOHIDActivityUserIdleKey "IOHIDActivityUserIdle"
// the following values are used in kIOHIDPointerButtonMode
typedef enum {
kIOHIDButtonMode_BothLeftClicks = 0,
kIOHIDButtonMode_ReverseLeftRightClicks = 1,
kIOHIDButtonMode_EnableRightClick = 2
} IOHIDButtonModes;
#ifdef _undef
#define EVS_PREFIX "Evs_" /* All EVS calls start with this string */
/* WaitCursor-related ioctls */
#define EVSIOSWT "Evs_SetWaitThreshold"
#define EVSIOSWT_SIZE EVS_PACKED_TIME_SIZE
#define EVSIOSWS "Evs_SetWaitSustain"
#define EVSIOSWS_SIZE EVS_PACKED_TIME_SIZE
#define EVSIOSWFI "Evs_SetWaitFrameInterval"
#define EVSIOSWFI_SIZE EVS_PACKED_TIME_SIZE
#define EVSIOCWINFO "Evs_CurrentWaitCursorInfo"
#define EVSIOCWINFO_THRESH 0
#define EVSIOCWINFO_SUSTAIN (EVSIOCWINFO_THRESH + EVS_PACKED_TIME_SIZE)
#define EVSIOCWINFO_FINTERVAL (EVSIOCWINFO_SUSTAIN + EVS_PACKED_TIME_SIZE)
#define EVSIOCWINFO_SIZE (EVSIOCWINFO_FINTERVAL + EVS_PACKED_TIME_SIZE)
#endif
#define EVS_PACKED_TIME_SIZE (sizeof(UInt64) / sizeof( unsigned int))
/* Device control ioctls. Levels specified may be in the range 0 - 64. */
#define EVSIOSB kIOHIDBrightnessKey
#define EVSIOSB_SIZE 1
#define EVSIOSADB kIOHIDAutoDimBrightnessKey
#define EVSIOSADB_SIZE 1
#ifdef _undef
#define EVSIOSA "Evs_SetAttenuation"
#define EVIOSA_SIZE 1
#define EVSIO_DCTLINFO "Evs_DeviceControlInfo"
typedef enum {
EVSIO_DCTLINFO_BRIGHT,
EVSIO_DCTLINFO_ATTEN,
EVSIO_DCTLINFO_AUTODIMBRIGHT
} evsio_DCTLINFOIndices;
#define EVSIO_DCTLINFO_SIZE (EVSIO_DCTLINFO_AUTODIMBRIGHT + 1)
#endif
/*
* Device status request
*/
#define EVSIOINFO NX_EVS_DEVICE_INFO
/* Keyboard-related ioctls - implemented within Event Sources */
#define EVSIOSKR kIOHIDKeyRepeatKey
#define EVSIOSKR_SIZE EVS_PACKED_TIME_SIZE
#define EVSIOSIKR kIOHIDInitialKeyRepeatKey
#define EVSIOSIKR_SIZE EVS_PACKED_TIME_SIZE
#define EVSIORKBD kIOHIDResetKeyboardKey
#define EVSIORKBD_SIZE 1
#define EVSIOCKR_SIZE EVS_PACKED_TIME_SIZE
#define EVSIOCKML kIOHIDKeyMappingKey
#define EVSIOCKML_SIZE 1
/* The following two tokens are for use with the get/set character routines. */
#define EVSIOSKM kIOHIDKeyMappingKey
#define EVSIOSKM_SIZE 4096
#define EVSIOCKM kIOHIDKeyMappingKey
#define EVSIOCKM_SIZE 4096
/* Mouse-related ioctls - implemented within Event Sources */
#define EVSIOSMS kIOHIDPointerAccelerationKey
#define EVSIOSMS_SIZE (1)
#define EVSIOCMS kIOHIDPointerAccelerationKey
#define EVSIOCMS_SIZE (1)
#ifdef _undef
#define EVSIOSMH "Evs_SetMouseHandedness"
#define EVSIOSMH_SIZE 1 // value from NXMouseButton enum
#define EVSIOCMH "Evs_CurrentMouseHandedness"
#define EVSIOCMH_SIZE 1
#endif
/* Generic pointer device controls, implemented by the Event Driver. */
#define EVSIOSCT kIOHIDClickTimeKey
#define EVSIOSCT_SIZE EVS_PACKED_TIME_SIZE
#define EVSIOSCS kIOHIDClickSpaceKey
typedef enum {
EVSIOSCS_X,
EVSIOSCS_Y
} evsioEVSIOSCSIndices;
#define EVSIOSCS_SIZE (EVSIOSCS_Y + 1)
#define EVSIOSADT kIOHIDAutoDimThresholdKey
#define EVSIOSADT_SIZE EVS_PACKED_TIME_SIZE
#define EVSIOSADS kIOHIDAutoDimStateKey
#define EVSIOSADS_SIZE 1
#define EVSIORMS kIOHIDResetPointerKey
#define EVSIORMS_SIZE 1
#define EVSIOCCT kIOHIDClickTimeKey
#define EVSIOCCT_SIZE EVS_PACKED_TIME_SIZE
#define EVSIOCADT kIOHIDAutoDimThresholdKey
#define EVSIOCADT_SIZE EVS_PACKED_TIME_SIZE
#define EVSIOGDADT kIOHIDAutoDimTimeKey
#define EVSIOGDADT_SIZE EVS_PACKED_TIME_SIZE
#define EVSIOIDLE kIOHIDIdleTimeKey
#define EVSIOIDLE_SIZE EVS_PACKED_TIME_SIZE
#define EVSIOCCS kIOHIDClickSpaceKey
typedef enum {
EVSIOCCS_X,
EVSIOCCS_Y
} evsioEVSIOCCSIndices;
#define EVSIOCCS_SIZE (EVSIOCCS_Y + 1)
#define EVSIOCADS kIOHIDAutoDimStateKey
#define EVSIOCADS_SIZE 1
enum {
// Selectors for IOHIDGetModifierLockState and IOHIDSetModifierLockState
kIOHIDCapsLockState = 0x00000001,
kIOHIDNumLockState = 0x00000002,
kIOHIDActivityUserIdle = 0x00000003,
// We no longer report display state through HIDSystem. This will not return the current state.
kIOHIDActivityDisplayOn = 0x00000004,
};
#endif /* !_DEV_EVSIO_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hidsystem/IOHIDDescriptorParser.h | /*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2012 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef __IOHIDDescriptorParser__
#define __IOHIDDescriptorParser__
#if defined(KERNEL) && !defined(KERNEL_PRIVATE)
#define __iohid_deprecated(_msg) __deprecated_msg(_msg)
#else /* !defined(KERNEL) || defined(KERNEL_PRIVATE) */
#define __iohid_deprecated(_msg)
#endif /* !defined(KERNEL) || defined(KERNEL_PRIVATE) */
#if RTKIT
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
typedef uint8_t UInt8;
typedef int8_t Int8;
typedef uint32_t UInt32;
typedef int32_t SInt32;
typedef uint32_t IOByteCount;
typedef bool Boolean;
typedef SInt32 OSStatus;
typedef size_t vm_size_t;
#else
#include <TargetConditionals.h>
#if TARGET_OS_DRIVERKIT
#include <DriverKit/IOTypes.h>
#include <stdint.h>
#include <stddef.h>
typedef uint8_t UInt8;
typedef int8_t Int8;
typedef uint32_t UInt32;
typedef int32_t SInt32;
typedef unsigned char Boolean;
typedef SInt32 OSStatus;
typedef size_t vm_size_t;
#else
#include <IOKit/IOTypes.h>
#endif
#if __has_include(<MacTypes.h>)
#include <MacTypes.h>
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* End missing types and enums */
#if __has_include(<MacErrors.h>)
#include <MacErrors.h>
#elif __has_include(<CoreServices/../Frameworks/CarbonCore.framework/Headers/MacErrors.h>)
#include <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacErrors.h>
#else
enum
{
kHIDSuccess = 0,
/* HID assigned error numbers are -13949 .. -13900 */
kHIDBaseError = -13950,
kHIDNullStateErr,
kHIDBufferTooSmallErr,
kHIDValueOutOfRangeErr,
kHIDUsageNotFoundErr,
kHIDNotValueArrayErr,
kHIDInvalidPreparsedDataErr,
kHIDIncompatibleReportErr,
kHIDBadLogPhysValuesErr,
kHIDInvalidReportTypeErr,
kHIDInvalidReportLengthErr,
kHIDNullPointerErr,
kHIDBadParameterErr,
kHIDNotEnoughMemoryErr,
kHIDEndOfDescriptorErr,
kHIDUsagePageZeroErr,
kHIDBadLogicalMinimumErr,
kHIDBadLogicalMaximumErr,
kHIDInvertedLogicalRangeErr,
kHIDInvertedPhysicalRangeErr,
kHIDUnmatchedUsageRangeErr,
kHIDInvertedUsageRangeErr,
kHIDUnmatchedStringRangeErr,
kHIDUnmatchedDesignatorRangeErr,
kHIDReportSizeZeroErr,
kHIDReportCountZeroErr,
kHIDReportIDZeroErr,
kHIDInvalidRangePageErr,
//
// HID device driver errors
//
kHIDDeviceNotReady = -13910, // The device is still initializing, try again later
kHIDVersionIncompatibleErr,
};
#endif
// types of HID reports (input, output, feature)
enum
{
kHIDInputReport = 1,
kHIDOutputReport,
kHIDFeatureReport,
kHIDUnknownReport = 255
};
// flags passed to HIDOpenReportDescriptor
enum
{
kHIDFlag_StrictErrorChecking = 0x00000001
};
typedef UInt32 HIDReportType;
typedef UInt32 HIDUsage;
typedef void *HIDPreparsedDataRef;
/*!
@typedef HIDUsageAndPage
@abstract The HIDUsageAndPage data structure is used by HID clients when obtaining status of buttons to hold the usage page and usage of a button that is down.
@discussion Clients use the HIDUSageAndPage structure with the HIDGetButtonsEx function to obtain both the usage page and usage identifiers of each button that is down.
@field usage Specifies the usage identifier within the usage page specified by usagePage of a button that is down.
@field usagePage Specifies the usage page identifier of a button that is down.
*/
struct HIDUsageAndPage
{
HIDUsage usage;
HIDUsage usagePage;
};
typedef struct HIDUsageAndPage HIDUsageAndPage, *HIDUsageAndPagePtr;
/*!
@typedef HIDCaps
@abstract The HIDCaps data structure is used by HID clients to hold the capabilities of a HID device.
@discussion This structure holds the parsed capabilities and data maximums returned for a device by the HIDGetCaps function.
@field usage Specifies the specific class of functionality that this device provides. This value is dependent and specific to the value provided in the usagePage field. For example, a keyboard could have a usagePage of kHIDUsagePage_Generic and a usage of kHIDUsage_Generic_Keyboard.
@field usagePage Specifies the usage page identifier for this top level collection.
@field inputReportByteLength Specifies the maximum length, in bytes, of an input report for this device, including the report ID which is unilaterally prepended to the device data.
@field outputReportByteLength Specifies the maximum length, in bytes, of an output report for this device, including the report ID which is unilaterally prepended to the device data.
@field featureReportByteLength Specifies the maximum length, in bytes, of a feature report for this device, including the report ID which is unilaterally prepended to the device data.
@field numberCollectionNodes Specifies the number of HIDCollectionNode structures that are returned for this top level collection by the HIDGetConnectionNodes function.
@field numberInputButtonCaps Specifies the number of input buttons.
@field numberInputValueCaps Specifies the number of input values.
@field numberOutputButtonCaps Specifies the number of output buttons.
@field numberOutputValueCaps Specifies the number of output values
@field numberFeatureButtonCaps Specifies the number of feature buttons.
@field numberFeatureValueCaps Specifies the number of feature values.
*/
struct HIDCaps
{
HIDUsage usage;
HIDUsage usagePage;
IOByteCount inputReportByteLength;
IOByteCount outputReportByteLength;
IOByteCount featureReportByteLength;
UInt32 numberCollectionNodes;
UInt32 numberInputButtonCaps;
UInt32 numberInputValueCaps;
UInt32 numberOutputButtonCaps;
UInt32 numberOutputValueCaps;
UInt32 numberFeatureButtonCaps;
UInt32 numberFeatureValueCaps;
};
typedef struct HIDCaps HIDCaps, * HIDCapsPtr;
struct HIDCapabilities {
HIDUsage usage;
HIDUsage usagePage;
IOByteCount inputReportByteLength;
IOByteCount outputReportByteLength;
IOByteCount featureReportByteLength;
UInt32 numberCollectionNodes;
UInt32 numberInputButtonCaps;
UInt32 numberInputValueCaps;
UInt32 numberOutputButtonCaps;
UInt32 numberOutputValueCaps;
UInt32 numberFeatureButtonCaps;
UInt32 numberFeatureValueCaps;
};
typedef struct HIDCapabilities HIDCapabilities, * HIDCapabilitiesPtr;
struct HIDCollectionNode
{
HIDUsage collectionUsage;
HIDUsage collectionUsagePage;
UInt32 parent;
UInt32 numberOfChildren;
UInt32 nextSibling;
UInt32 firstChild;
};
typedef struct HIDCollectionNode HIDCollectionNode, * HIDCollectionNodePtr;
struct HIDButtonCaps
{
HIDUsage usagePage;
UInt32 reportID;
UInt32 bitField;
UInt32 collection;
HIDUsage collectionUsage;
HIDUsage collectionUsagePage;
Boolean isRange;
Boolean isStringRange;
Boolean isDesignatorRange;
Boolean isAbsolute;
SInt32 startBit; // Added esb 9-29-99
union
{
struct
{
HIDUsage usageMin;
HIDUsage usageMax;
UInt32 stringMin;
UInt32 stringMax;
UInt32 designatorMin;
UInt32 designatorMax;
} range;
struct
{
HIDUsage usage;
HIDUsage reserved1;
UInt32 stringIndex;
UInt32 reserved2;
UInt32 designatorIndex;
UInt32 reserved3;
} notRange;
} u;
};
typedef struct HIDButtonCaps HIDButtonCaps, * HIDButtonCapsPtr;
struct HIDButtonCapabilities
{
HIDUsage usagePage;
UInt32 reportID;
UInt32 bitField;
UInt32 collection;
HIDUsage collectionUsage;
HIDUsage collectionUsagePage;
Boolean isRange;
Boolean isStringRange;
Boolean isDesignatorRange;
Boolean isAbsolute;
SInt32 unitExponent; // Added KH 1/25/01
SInt32 units; // Added KH 1/25/01
// UInt32 reserved; // Not added KH 1/25/01
SInt32 startBit; // Added esb 9-29-99
UInt32 pbVersion; // Added KH 1/25/01
union
{
struct
{
HIDUsage usageMin;
HIDUsage usageMax;
UInt32 stringMin;
UInt32 stringMax;
UInt32 designatorMin;
UInt32 designatorMax;
} range;
struct
{
HIDUsage usage;
HIDUsage reserved1;
UInt32 stringIndex;
UInt32 reserved2;
UInt32 designatorIndex;
UInt32 reserved3;
} notRange;
} u;
};
typedef struct HIDButtonCapabilities HIDButtonCapabilities, * HIDButtonCapabilitiesPtr;
struct HIDValueCaps
{
HIDUsage usagePage;
UInt32 reportID;
UInt32 bitField;
UInt32 collection;
HIDUsage collectionUsage;
HIDUsage collectionUsagePage;
Boolean isRange;
Boolean isStringRange;
Boolean isDesignatorRange;
Boolean isAbsolute;
UInt32 startBit; // Added by esb 9-28-99
UInt32 bitSize;
UInt32 reportCount;
SInt32 logicalMin;
SInt32 logicalMax;
SInt32 physicalMin;
SInt32 physicalMax;
union
{
struct
{
HIDUsage usageMin;
HIDUsage usageMax;
UInt32 stringMin;
UInt32 stringMax;
UInt32 designatorMin;
UInt32 designatorMax;
} range;
struct
{
HIDUsage usage;
HIDUsage reserved1;
UInt32 stringIndex;
UInt32 reserved2;
UInt32 designatorIndex;
UInt32 reserved3;
} notRange;
} u;
};
typedef struct HIDValueCaps HIDValueCaps, * HIDValueCapsPtr;
struct HIDValueCapabilities
{
HIDUsage usagePage;
UInt32 reportID;
UInt32 bitField;
UInt32 collection;
HIDUsage collectionUsage;
HIDUsage collectionUsagePage;
Boolean isRange;
Boolean isStringRange;
Boolean isDesignatorRange;
Boolean isAbsolute;
UInt32 bitSize;
UInt32 reportCount;
SInt32 logicalMin;
SInt32 logicalMax;
SInt32 physicalMin;
SInt32 physicalMax;
SInt32 unitExponent; // Added KH 1/25/01
SInt32 units; // Added KH 1/25/01
// UInt32 reserved; // Not added KH 1/25/01
SInt32 startBit; // Added esb 9-29-99 // Moved here KH 1/25/01
UInt32 pbVersion; // Added KH 1/25/01
union
{
struct
{
HIDUsage usageMin;
HIDUsage usageMax;
UInt32 stringMin;
UInt32 stringMax;
UInt32 designatorMin;
UInt32 designatorMax;
} range;
struct
{
HIDUsage usage;
HIDUsage reserved1;
UInt32 stringIndex;
UInt32 reserved2;
UInt32 designatorIndex;
UInt32 reserved3;
} notRange;
} u;
};
typedef struct HIDValueCapabilities HIDValueCapabilities, * HIDValueCapabilitiesPtr;
/*!
@function HIDOpenReportDescriptor
@abstract The HIDOpenReportDescriptor function allocates the memory the parser needs to handle the given report descriptor, and then parses the report descriptor.
@discussion When the parsed information is no longer needed, clients should call the HIDCloseReportDescriptor function.
@param hidReportDescriptor Contains a pointer to the actual HID report descriptor from the USB device's firmware
@param descriptorLength The length of the HID report descriptor
@param preparsedDataRef Preparsed data reference to be used for subsequent function calls
@param flags Flags for this runction are kHIDFlag_StrictErrorChecking = 0x00000001
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDOpenReportDescriptor (void * hidReportDescriptor,
IOByteCount descriptorLength,
HIDPreparsedDataRef * preparsedDataRef,
UInt32 flags);
/*!
@function HIDCloseReportDescriptor
@abstract Disposes of the memory the parser allocated for the HIDOpenReportDescriptor function.
@param preparsedDataRef Preparsed data reference for the report that is returned by the HIDOpenReportDescriptor function. After making a call to the HIDCloseReportDescriptor function, the preparsedDataRef is invalid and should not be used.
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDCloseReportDescriptor (HIDPreparsedDataRef preparsedDataRef);
/*!
@function HIDGetButtonCaps
@abstract Returns the button capabilities structures for a HID device based on the given preparsed data.
@param reportType Specifies the type of report for which to retrieve the scaled value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport
@param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCaps structures. The structures contain information for all buttons that meet the search criteria
@param buttonCapsSize Contains the size of the buttonCaps array passed in to the function and is set to the number of elements actually placed in the array after the call completes.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetButtonCaps (HIDReportType reportType,
HIDButtonCapsPtr buttonCaps,
UInt32 * buttonCapsSize,
HIDPreparsedDataRef preparsedDataRef);
/*!
@function HIDGetButtonCapabilities
@abstract Returns the button capabilities structures for a HID device based on the given preparsed data.
@param reportType Specifies the type of report for which to retrieve the scaled value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport
@param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCapabilities structures. The structures contain information for all buttons that meet the search criteria
@param buttonCapsSize Contains the size of the buttonCaps array passed in to the function and is set to the number of elements actually placed in the array after the call completes.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetButtonCapabilities (HIDReportType reportType,
HIDButtonCapabilitiesPtr buttonCaps,
UInt32 * buttonCapsSize,
HIDPreparsedDataRef preparsedDataRef);
/*!
@function HIDGetCaps
@abstract Returns the capabilities of a HID device based on the given preparsed data.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@param capabilities Points to a caller allocated buffer, that upon return contains the parsed capability information for this HID device.
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetCaps (HIDPreparsedDataRef preparsedDataRef,
HIDCapsPtr capabilities);
/*!
@function HIDGetCapabilities
@abstract Returns the capabilities of a HID device based on the given preparsed data.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@param capabilities Points to a caller allocated buffer, that upon return contains the parsed capability information for this HID device.
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetCapabilities (HIDPreparsedDataRef preparsedDataRef,
HIDCapabilitiesPtr capabilities);
/*!
@function HIDGetCollectionNodes
@abstract Returns an array of HIDCollectionNode structures that describe the relationships and layout of the link collections within this top level collection.
@discussion The length of the buffer required, in array elements, for an entire collection node array is found in the HIDCaps structure member numberCollectionNodes. You obtain the HIDCaps information by calling the HIDGetCaps function. For information on the relationships of link collections described by the data returned from this routine, see the descripton of the HIDCollectionNode structure.
@param collectionNodes Points to a caller-allocated array of HIDCollectionNode structures in which this routine returns an entry for each collection within the top level collection. A collection is a group of corresponding HID descriptors containing input, output, and feature items that have some common relationship to one another. For example, a pointer collection contains items for x and y position data, and button data.
@param collectionNodesSize On input, specifies the length in array elements of the buffer provided at collectionNodes. On output, this parameter is set to the number of entries in the collectionNodes array that were initialized.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetCollectionNodes (HIDCollectionNodePtr collectionNodes,
UInt32 * collectionNodesSize,
HIDPreparsedDataRef preparsedDataRef);
/*!
@function HIDGetScaledUsageValue
@abstract The HIDGetScaledUsageValue function returns the capabilities for all buttons for a given top level collection.
@discussion Clients who which to obtain all capabilities for a usage that contains multiple data items for a single usage that corresponds to a HID byte array, must call the HIDGetUsageValueArray function.
@param reportType Specifies the type of report for which to retrieve the scaled value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport.
@param usagePage Specifies the usage page of the value to be retrieved.
@param collection Optionally specifies the link collection identifier of the value to be retrieved.
@param usage Specifies the usage of the scaled value to be retrieved.
@param usageValue Points to a variable, that on return from this routine holds the scaled value retrieved from the device report.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@param report Points to the caller-allocated buffer that contains the device report data
@param reportLength Specifies the length, in bytes, of the report data provided at report
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetScaledUsageValue (HIDReportType reportType,
HIDUsage usagePage,
UInt32 collection,
HIDUsage usage,
SInt32 * usageValue,
HIDPreparsedDataRef preparsedDataRef,
void * report,
IOByteCount reportLength);
/*!
@function HIDGetSpecificButtonCaps
@abstract Retrieves the capabilities for all buttons in a specific type of report that meet the search criteria.
@discussion The HIDGetSpecificButtonCaps function retrieves capability data for buttons that meet a given search criteria, as opposed to the HIDGetButtonCaps function which returns the capability data for all buttons on the device. Calling this routine specifying zero for usagePage, usage and collection is equivalent to calling the HIDGetButtonCaps function.
@param reportType Specifies the type of report for which to retrieve the button capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport.
@param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only buttons that specify this usage page will be retrieved.
@param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only buttons that are part of the specified link collection are retrieved.
@param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only buttons that match the value specified are retrieved.
@param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCaps structures. The structures contain information for all buttons that meet the search criteria.
@param buttonCapsSize On input, specifies the length, in array elements, of the buffer provided in the buttonCaps parameter. On output, this parameter is set to the actual number of elements that were returned by the function call, in the buffer provided in the buttonCaps parameter, if the routine completed without error. The correct length necessary to retrieve the button capabilities can be found in the capability data returned for the device by the HIDGetCaps function.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetSpecificButtonCaps (HIDReportType reportType,
HIDUsage usagePage,
UInt32 collection,
HIDUsage usage,
HIDButtonCapsPtr buttonCaps,
UInt32 * buttonCapsSize,
HIDPreparsedDataRef preparsedDataRef);
/*!
@function HIDGetSpecificButtonCapabilities
@abstract Retrieves the capabilities for all buttons in a specific type of report that meet the search criteria.
@discussion The HIDGetSpecificButtonCapabilities function retrieves capability data for buttons that meet a given search criteria, as opposed to the HIDGetButtonCapabilities function which returns the capability data for all buttons on the device. Calling this routine specifying zero for usagePage, usage and collection is equivalent to calling the HIDGetButtonCapabilities function.
@param reportType Specifies the type of report for which to retrieve the button capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport.
@param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only buttons that specify this usage page will be retrieved.
@param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only buttons that are part of the specified link collection are retrieved.
@param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only buttons that match the value specified are retrieved.
@param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCapabilities structures. The structures contain information for all buttons that meet the search criteria.
@param buttonCapsSize On input, specifies the length, in array elements, of the buffer provided in the buttonCaps parameter. On output, this parameter is set to the actual number of elements that were returned by the function call, in the buffer provided in the buttonCaps parameter, if the routine completed without error. The correct length necessary to retrieve the button capabilities can be found in the capability data returned for the device by the HIDGetCaps function.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetSpecificButtonCapabilities (HIDReportType reportType,
HIDUsage usagePage,
UInt32 collection,
HIDUsage usage,
HIDButtonCapabilitiesPtr buttonCaps,
UInt32 * buttonCapsSize,
HIDPreparsedDataRef preparsedDataRef);
/*!
@function HIDGetSpecificValueCaps
@abstract Retrieves the capabilities for all values in a specific type of report that meet the search criteria.
@discussion The HIDGetSpecificValueCaps function retrieves capability data for values that meet given search criteria, as opposed to the HIDGetValueCaps function, which returns the capability data for all values on the device. Calling this routine with a value of zero for usagePage, usage and collection parameters is equivalent to calling the HIDGetValueCaps function.
@param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport.
@param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage page will be retrieved.
@param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only values that are part of this link collection will be retrieved.
@param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage will be retrieved.
@param valueCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDValueCaps structures that contain information for all values that meet the search criteria.
@param valueCapsSize Specifies the length on input, in array elements, of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned by this function call, in the buffer provided in the valueCaps parameter, if the routine completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device from the HIDGetCaps function.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetSpecificValueCaps (HIDReportType reportType,
HIDUsage usagePage,
UInt32 collection,
HIDUsage usage,
HIDValueCapsPtr valueCaps,
UInt32 * valueCapsSize,
HIDPreparsedDataRef preparsedDataRef);
/*!
@function HIDGetSpecificValueCapabilities
@abstract Retrieves the capabilities for all values in a specific type of report that meet the search criteria.
@discussion The HIDGetSpecificValueCapabilities function retrieves capability data for values that meet given search criteria, as opposed to the HIDGetValueCapabilities function, which returns the capability data for all values on the device. Calling this routine with a value of zero for usagePage, usage and collection parameters is equivalent to calling the HIDGetValueCapabilities function.
@param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport.
@param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage page will be retrieved.
@param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only values that are part of this link collection will be retrieved.
@param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage will be retrieved.
@param valueCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDValueCapabilities structures that contain information for all values that meet the search criteria.
@param valueCapsSize Specifies the length on input, in array elements, of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned by this function call, in the buffer provided in the valueCaps parameter, if the routine completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device from the HIDGetCaps function.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetSpecificValueCapabilities (HIDReportType reportType,
HIDUsage usagePage,
UInt32 collection,
HIDUsage usage,
HIDValueCapabilitiesPtr valueCaps,
UInt32 * valueCapsSize,
HIDPreparsedDataRef preparsedDataRef);
/*!
@function HIDGetButtonsOnPage
@abstract Retrieves the button stat information for buttons on a specified usage page.
@param reportType Specifies the type of report, provided in the report parameter, from which to retrieve the buttons. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport.
@param usagePage Specifies the usage page of the buttons for which to retrieve the current state.
@param collection Optionally specifies the link collection identifier used to retrieve only specific button states. If this value is non-zero, only the buttons that are part of the given collection are returned.
@param usageList On return, points to a caller-allocated buffer that contains the usages of all the buttons that are perssed and belong to the usage page specified in the usagePage parameter.
@param usageListSize Is the size, in array elements, of the buffer provided in the usageList parameter. On return, this parameter contains the number of button states that were set by this routine. If the error kHIDBufferTooSmallErr was returned, this parameter contains the number of array elements required to hold all button data requested. The maximum number of buttons that can ever be returned for a given type of report can be obtained by calling the HIDMaxUsageListLength function.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@param report Points to the caller-allocated buffer that contains the device report data
@param reportLength Specifies the size, in bytes, of the report data provided in the report parameter
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetButtonsOnPage (HIDReportType reportType,
HIDUsage usagePage,
UInt32 collection,
HIDUsage * usageList,
UInt32 * usageListSize,
HIDPreparsedDataRef preparsedDataRef,
void * report,
IOByteCount reportLength);
/*!
@function HIDGetButtons
@abstract The HIDGetButtons function takes a report from a HID device and gets the current state of the buttons in that report.
@param reportType Specifies the type of report, provided in the report parameter, from which to retrieve the buttons. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport
@param collection Optionally specifies the link collection identifier used to retrieve only specific button states. If this value is non-zero, only the buttons that are part of the given collection are returned.
@param usageList On return, points to a caller-allocated buffer that contains the usages of all the buttons that are pressed.
@param usageListSize Is the size, in array elements, of the buffer provided in the usageList parameter. On return, this parameter contains the number of button states that were set by this routine. If the error kHIDBufferToSmallErr was returned, this parameter contains the number of array elements required to hold all button data requested. The maximum number of buttons that can ever be returned for a given type of report can be obtained by calling the HIDMaxUsageListLength function.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@param report Points to the caller-allocated buffer that contains the device report data.
@param reportLength Specifies the length, in bytes, of the report data provided in the report parameter.
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetButtons (HIDReportType reportType,
UInt32 collection,
HIDUsageAndPagePtr usageList,
UInt32 * usageListSize,
HIDPreparsedDataRef preparsedDataRef,
void * report,
IOByteCount reportLength);
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetNextButtonInfo (HIDReportType reportType,
HIDUsage usagePage,
HIDUsage usage,
UInt32 * collection,
UInt8 * reportID,
HIDPreparsedDataRef preparsedDataRef);
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetNextUsageValueInfo (HIDReportType reportType,
HIDUsage usagePage,
HIDUsage usage,
UInt32 * collection,
UInt8 * reportID,
HIDPreparsedDataRef preparsedDataRef);
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetReportLength (HIDReportType reportType,
UInt8 reportID,
IOByteCount *reportLength,
HIDPreparsedDataRef preparsedDataRef);
/*!
@function HIDGetUsageValue
@abstract The HIDGetUsageValue function returns a value from a device data report given a selected search criteria.
@discussion The HIDGetUsageValue function does not sign the value. To have the sign bit automatically applied, use the HIDGetScaledUsageValue function instead. For manually assigning the sign bit, the position of the sign bit can be found in the HIDValueCaps structure for this value. Clients who wish to obtain all data for a usage that contains multiple data items for a single usage, corresponding to a HID byte array, must call the HIDGetUsageValueArray function instead.
@param reportType Specifies the type of report, provided in report, from which to retrieve the value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport.
@param usagePage Specifies the usage page of the value to retrieve.
@param collection Optionally specifies the link collection identifier of the value to be retrieved.
@param usage Specifies the usage of the value to be retrieved.
@param usageValue Points to a variable, that on return from this routine holds the value retrieved from the device report.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@param report Points to the caller-allocated buffer that contains the device report data.
@param reportLength Specifies the size, in bytes, of the report data provided in the report parameter.
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetUsageValue (HIDReportType reportType,
HIDUsage usagePage,
UInt32 collection,
HIDUsage usage,
SInt32 * usageValue,
HIDPreparsedDataRef preparsedDataRef,
void * report,
IOByteCount reportLength);
/*!
@function HIDGetUsageValueArray
@abstract The HIDGetUsageValueArray function returns a value from a device data report given a selected search criteria.
@discussion When the HIDGetUsageValueArray function retrieves the data, it fills in the buffer in little-endian order beginning with the least significant bit of the data for this usage. The data is filled in without regard to byte alignment and is shifted such that the least significant bit is placed as the 1st bit of the given buffer.
@param reportType Specifies the type of report, provided in report, from which to retrieve the value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport.
@param usagePage Specifies the usage page of the data to be retrieved.
@param collection Optionally specifies the link collection identifier of the data to be retrieved.
@param usage Specifies the usage identifier of the value to be retrieved.
@param usageValueBuffer Points to a caller-allocated buffer that contains, on output, the data from the device. The correct length for this buffer can be found by multiplying the reportCount and bitSize fields of the HIDValueCaps structure for the value and rounding the resulting value up to the nearest byte.
@param usageValueBufferSize Specifies the size, in bytes, of the buffer in the usageValueBuffer parameter.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@param report Points to the caller-allocated buffer that contains the device report data.
@param reportLength Specifies the size, in bytes, of the report data provided in report.
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetUsageValueArray (HIDReportType reportType,
HIDUsage usagePage,
UInt32 collection,
HIDUsage usage,
UInt8 * usageValueBuffer,
IOByteCount usageValueBufferSize,
HIDPreparsedDataRef preparsedDataRef,
void * report,
IOByteCount reportLength);
/*!
@function HIDGetValueCaps
@abstract The HIDGetValueCaps function retrieves the capabilities for all values for a specified top level collection.
@discussion The HIDGetValueCaps function retrieves the capability data for all values in a top level collection without regard for the usage, usage page or collection of the value. To retrieve value capabilities for a specific usage, usage page or collection, use the HIDGetSpecificValueCaps function.
@param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport.
@param valueCaps On return, points to a caller-allocated buffer that contains an array of HIDValueCaps structures containing information for all values in the top level collection.
@param valueCapsSize On input, specifies the size in array elements of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned in the buffer provided in the valueCaps parameter, if the function completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device by the HIDGetCaps function.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetValueCaps (HIDReportType reportType,
HIDValueCapsPtr valueCaps,
UInt32 * valueCapsSize,
HIDPreparsedDataRef preparsedDataRef);
/*!
@function HIDGetValueCapabilities
@abstract The HIDGetValueCapabilities function retrieves the capabilities for all values for a specified top level collection.
@discussion The HIDGetValueCapabilities function retrieves the capability data for all values in a top level collection without regard for the usage, usage page or collection of the value. To retrieve value capabilities for a specific usage, usage page or collection, use the HIDGetSpecificValueCapabilities function.
@param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport.
@param valueCaps On return, points to a caller-allocated buffer that contains an array of HIDValueCapabilities structures containing information for all values in the top level collection.
@param valueCapsSize On input, specifies the size in array elements of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned in the buffer provided in the valueCaps parameter, if the function completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device by the HIDGetCapabilities function.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDGetValueCapabilities (HIDReportType reportType,
HIDValueCapabilitiesPtr valueCaps,
UInt32 * valueCapsSize,
HIDPreparsedDataRef preparsedDataRef);
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDInitReport (HIDReportType reportType,
UInt8 reportID,
HIDPreparsedDataRef preparsedDataRef,
void * report,
IOByteCount reportLength);
/*!
@function HIDMaxUsageListLength
@abstract The HIDMaxUsageListLength function returns the maximum number of buttons that can be returned from a given report type for the top level collection.
@param reportType Specifies the type of report for which to get a maximum usage count. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport.
@param usagePage Optionally specifies the usage page identifier to use as a search criteria. If this parameter is zero, the function returns the number of buttons for the entire top-level collection regardless of the actual value of the usage page.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
UInt32
HIDMaxUsageListLength (HIDReportType reportType,
HIDUsage usagePage,
HIDPreparsedDataRef preparsedDataRef);
/*!
@function HIDSetScaledUsageValue
@abstract The HIDSetScaledUsageValue function takes a signed physical (scaled) number and converts it to the logical, or device representation and inserts it in a given report.
@discussion The HIDSetScaledUsageValue function automatically handles the setting of the signed bit in the data to be sent to the device.
@param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport.
@param usagePage Specifies the usage page identifier of the value to be set in the report.
@param collection Optionally specifies the link collection identifier to distinguish between values that have the same usage page and usage identifiers. If this parameter is zero, it will be ignored.
@param usage Specifies the usage identifier of the value to be set in the report.
@param usageValue Specifies the physical, or scaled, value to be set in the value for the given report.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@param report Points to the caller-allocated buffer that contains the device report data.
@param reportLength Specifies the length, in bytes of the report data specified in the report parameter.
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDSetScaledUsageValue (HIDReportType reportType,
HIDUsage usagePage,
UInt32 collection,
HIDUsage usage,
SInt32 usageValue,
HIDPreparsedDataRef preparsedDataRef,
void * report,
IOByteCount reportLength);
/*!
@function HIDSetButtons
@abstract The HIDSetButtons function takes a report from a HID device and returns the current state of the buttons in that report.
@param reportType Specifies the type of repor. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport.
@param usagePage Specifies the usage page identifier of the value to be set in the report.
@param collection Optionally specifies the link collection identifier to distinguish between buttons. If this parameter is zero, it is ignored.
@param usageList Points to a caller-allocated buffer that contains an array of button data to be set in the report in the report parameter.
@param usageListSize Specifies the size, in array elements, of the buffer provided in the usageList parameter. If an error is returned by a call to this function, the usageListLength parameter contains the location in the array provided in the usageList parameter where the error was encountered. All array entries encountered prior to the error location were successfully set in the report provided in the report parameter.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@param report Points to the caller-allocated buffer that contains the device report data.
@param reportLength Specifies the size, in bytes, of the report data provided in the report parameter.
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDSetButtons (HIDReportType reportType,
HIDUsage usagePage,
UInt32 collection,
HIDUsage * usageList,
UInt32 * usageListSize,
HIDPreparsedDataRef preparsedDataRef,
void * report,
IOByteCount reportLength);
/*!
@function HIDSetUsageValue
@abstract The HIDSetUsageValue function sets a value in a give report.
@discussion The HIDSetUsageVlaue function does not automatically handle the sign bit. Clients must either manually set the sign bit, at the position provided in the HIDValueCaps structure for this value, or call the HIDSetScaledUsageValue function.
@param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport.
@param usagePage Specifies the usage page identifier of the value to be set in the report.
@param collection Optionally specifies the link collection identifier to distinguish between values that have the same usage page and usage identifiers. If this parameter is zero, it is ignored.
@param usage Specifies the usage identifier of the value to be set in the report.
@param usageValue Specifies the data that is to be set in the value for the given report.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@param report Points to the caller-allocated buffer that contains the device report data.
@param reportLength Specifies the size, in bytes, of the report data provided in the report parameter.
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDSetUsageValue (HIDReportType reportType,
HIDUsage usagePage,
UInt32 collection,
HIDUsage usage,
SInt32 usageValue,
HIDPreparsedDataRef preparsedDataRef,
void * report,
IOByteCount reportLength);
/*!
@function HIDSetUsageValueArray
@abstract The HIDSetUsageValueArray function sets an array of values in a given report.
@discussion The HIDSetUsageValue function does not automatically handle the sign bit. Clients must either manually set the sign bit, at the position provided in the HIDValueCaps structure for this value, or call the HIDSetScaledUsageValue function.
@param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport.
@param usagePage Specifies the usage page identifier of the value to be set in the report.
@param collection Optionally specifies the link collection identifier to distinguish between values that have the same usage page and usage identifiers. If this parameter is zero, it is ignored.
@param usage Specifies the usage identifier of the value to be set in the report.
@param usageValueBuffer Points to a caller-allocated buffer that contains, on output, the data from the device. The correct length for this buffer can be found by multiplying the reportCount and bitSize fields of the HIDValueCaps structure for this value and rounding the resulting value up to the nearest byte.
@param usageValueBufferLength Specifies the size, in bytes, of the buffer in the usageValueBuffer parameter.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@param report Points to the caller-allocated buffer that contains the device report data.
@param reportLength Specifies the size, in bytes, of the report data provided in the report parameter.
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDSetUsageValueArray (HIDReportType reportType,
HIDUsage usagePage,
UInt32 collection,
HIDUsage usage,
UInt8 * usageValueBuffer,
IOByteCount usageValueBufferLength,
HIDPreparsedDataRef preparsedDataRef,
void * report,
IOByteCount reportLength);
/*!
@function HIDUsageListDifference
@abstract The HIDUsageListDifference function compares and provides the differences between two lists of buttons.
@param previousUsageList Points to the older button list to be used for comparison.
@param currentUsageList Points to the newer button list to be used for comparison.
@param breakUsageList On return, points to a caller-allocated buffer that contains the buttons set in the older list, specified in the previousUsageList parameter, but not set in the new list, specified in the currentUsageList parameter.
@param makeUsageList On return, points to a caller-allocated buffer that contains the buttons set in the new list, specified in the currentUsageList parameter, but not set in the old list, specified in the previousUsageList parameter.
@param usageListsSize Specifies the length, in array elements, of the buffers provided in the currentUsageList and previousUssageList parameters.
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDUsageListDifference (HIDUsage * previousUsageList,
HIDUsage * currentUsageList,
HIDUsage * breakUsageList,
HIDUsage * makeUsageList,
UInt32 usageListsSize);
/*!
@function HIDSetButton
@abstract The HIDSetButton function takes a report from a HID device and sets the current state of the specified button in that report.
@param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport.
@param usagePage Specifies the usage page identifier of the value to be set in the report.
@param collection Optionally specifies the link collection identifier to distinguish between buttons. If this parameter is zero, it is ignored.
@param usage Points to a caller-allocated buffer that contains the button data to be set in the report in the report parameter.
@param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function
@param report Points to the caller-allocated buffer that contains the device report data.
@param reportLength Specifies the size, in bytes, of the report data provided in the report parameter.
@result OSStatus Returns an error code if an error was encountered or noErr on success.
*/
__iohid_deprecated("Use DriverKit")
extern
OSStatus
HIDSetButton (HIDReportType reportType,
HIDUsage usagePage,
UInt32 collection,
HIDUsage usage,
HIDPreparsedDataRef preparsedDataRef,
void * report,
IOByteCount reportLength);
#ifdef __cplusplus
}
#endif
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hid/IOHIDInterface.h | /*
*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_HID_IOHIDINTERFACE_H
#define _IOKIT_HID_IOHIDINTERFACE_H
#include <IOKit/IOService.h>
#include <IOKit/hid/IOHIDKeys.h>
#include <HIDDriverKit/IOHIDInterface.h>
#include <IOKit/IOWorkLoop.h>
#include <IOKit/IOCommandGate.h>
class IOHIDDevice;
class IOBufferMemoryDescriptor;
class OSAction;
/*! @class IOHIDInterface : public IOService
@abstract In kernel interface to a HID device.
*/
#if defined(KERNEL) && !defined(KERNEL_PRIVATE)
class __deprecated_msg("Use DriverKit") IOHIDInterface : public IOService
#else
class IOHIDInterface : public IOService
#endif
{
OSDeclareDefaultStructorsWithDispatch( IOHIDInterface )
public:
/*! @typedef IOHIDInterface::InterruptReportAction
@abstract Callback to handle an asynchronous report received from
the HID device.
@discussion This callback is set when calling IOHIDInterface::open.
@param target Pointer to your data object.
@param timestamp Time when the report was delivered.
@param report A memory descriptor that describes the report.
@param type The type of report.
@param reportID The ID of the report.
@param refcon void * pointer to more data.
*/
typedef void (*InterruptReportAction)(
OSObject * target,
AbsoluteTime timestamp,
IOMemoryDescriptor * report,
IOHIDReportType type,
UInt32 reportID,
void * refcon);
/*!
@typedef IOHIDInterface::CompletionAction
@discussion Function called when HID I/O completes.
@param target Pointer to your data object.
@param refcon void * pointer to more data.
@param status Completion status.
@param bufferSizeRemaining Bytes left to be transferred.
*/
typedef void (*CompletionAction)(
OSObject * target,
void * refcon,
IOReturn status,
UInt32 bufferSizeRemaining);
private:
IOHIDDevice * _owner;
OSArray * _elementArray;
InterruptReportAction _interruptAction;
void * _interruptRefCon;
OSObject * _interruptTarget;
OSString * _transportString;
OSString * _manufacturerString;
OSString * _productString;
OSString * _serialNumberString;
UInt32 _locationID;
UInt32 _vendorID;
UInt32 _vendorIDSource;
UInt32 _productID;
UInt32 _version;
UInt32 _countryCode;
IOByteCount _maxReportSize[kIOHIDReportTypeCount];
struct ExpansionData {
UInt32 reportInterval;
OSAction *reportAction;
IOWorkLoop *workLoop;
IOCommandGate *commandGate;
OSArray *deviceElements;
OSArray *reportPool;
bool opened;
bool terminated;
IOMemoryMap *debugStats;
};
/*! @var reserved
Reserved for future use. (Internal use only) */
ExpansionData * _reserved;
bool openGated(IOService *forClient, IOOptionBits options, OSAction *action);
void handleReportGated(AbsoluteTime timestamp,
IOMemoryDescriptor *report,
IOHIDReportType type,
UInt32 reportID,
void *ctx);
IOReturn addReportToPoolGated(IOMemoryDescriptor *report);
bool serializeDebugState(void *ref, OSSerialize *serializer);
protected:
void HandleReportPrivate(AbsoluteTime timestamp,
IOMemoryDescriptor * report,
IOHIDReportType type,
UInt32 reportID,
void * ctx);
/*!
@function free
@abstract Free the IOHIDInterface object.
@discussion Release all resources that were previously allocated,
then call super::free() to propagate the call to our superclass.
*/
virtual void free() APPLE_KEXT_OVERRIDE;
public:
static IOHIDInterface * withElements ( OSArray * elements );
/*!
@function init
@abstract Initialize an IOHIDInterface object.
@discussion Prime the IOHIDInterface object and prepare it to support
a probe() or a start() call. This implementation will simply call
super::init().
@param dictionary A dictionary associated with this IOHIDInterface
instance.
@result True on sucess, or false otherwise.
*/
virtual bool init( OSDictionary * dictionary = 0 ) APPLE_KEXT_OVERRIDE;
/*!
@function start
@abstract Start up the driver using the given provider.
@discussion IOHIDInterface will allocate resources. Before returning true
to indicate success, registerService() is called to trigger client matching.
@param provider The provider that the driver was matched to, and selected
to run with.
@result True on success, or false otherwise.
*/
virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE;
virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE;
/*!
@function matchPropertyTable
@abstract Called by the provider during a match
@discussion Compare the properties in the supplied table to this
object's properties.
@param table The property table that this device will match against
*/
virtual bool matchPropertyTable(
OSDictionary * table,
SInt32 * score) APPLE_KEXT_OVERRIDE;
virtual bool open (
IOService * client,
IOOptionBits options,
InterruptReportAction action,
void * refCon);
virtual void close(
IOService * client,
IOOptionBits options = 0 ) APPLE_KEXT_OVERRIDE;
using IOService::setProperty;
virtual bool setProperty( const OSSymbol * aKey, OSObject * anObject) APPLE_KEXT_OVERRIDE;
virtual OSString * getTransport ();
virtual UInt32 getLocationID ();
virtual UInt32 getVendorID ();
virtual UInt32 getVendorIDSource ();
virtual UInt32 getProductID ();
virtual UInt32 getVersion ();
virtual UInt32 getCountryCode ();
virtual OSString * getManufacturer ();
virtual OSString * getProduct ();
virtual OSString * getSerialNumber ();
virtual IOByteCount getMaxReportSize (IOHIDReportType type);
virtual OSArray * createMatchingElements (
OSDictionary * matching = 0,
IOOptionBits options = 0);
virtual void handleReport (
AbsoluteTime timeStamp,
IOMemoryDescriptor * report,
IOHIDReportType reportType,
UInt32 reportID,
IOOptionBits options = 0);
virtual IOReturn setReport (
IOMemoryDescriptor * report,
IOHIDReportType reportType,
UInt32 reportID = 0,
IOOptionBits options = 0);
virtual IOReturn getReport (
IOMemoryDescriptor * report,
IOHIDReportType reportType,
UInt32 reportID = 0,
IOOptionBits options = 0);
virtual IOReturn setReport (
IOMemoryDescriptor * report,
IOHIDReportType reportType,
UInt32 reportID,
IOOptionBits options,
UInt32 completionTimeout,
CompletionAction * completion = 0);
virtual IOReturn getReport (
IOMemoryDescriptor * report,
IOHIDReportType reportType,
UInt32 reportID,
IOOptionBits options,
UInt32 completionTimeout,
CompletionAction * completion = 0);
virtual IOReturn message(
UInt32 type,
IOService * provider,
void * argument = NULL) APPLE_KEXT_OVERRIDE;
OSMetaClassDeclareReservedUsed(IOHIDInterface, 0);
virtual UInt32 getReportInterval ();
OSMetaClassDeclareReservedUnused(IOHIDInterface, 1);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 2);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 3);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 4);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 5);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 6);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 7);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 8);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 9);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 10);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 11);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 12);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 13);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 14);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 15);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 16);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 17);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 18);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 19);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 20);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 21);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 22);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 23);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 24);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 25);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 26);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 27);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 28);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 29);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 30);
OSMetaClassDeclareReservedUnused(IOHIDInterface, 31);
};
#endif /* !_IOKIT_HID_IOHIDINTERFACE_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hid/IOHIDDeviceKeys.h | /*
*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 2019 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef IOHIDDeviceKeys_h
#define IOHIDDeviceKeys_h
/*!
* @define kIOHIDTransportKey
*
* @abstract
* Number property that describes the transport of the device.
*/
#define kIOHIDTransportKey "Transport"
/*!
* @define kIOHIDVendorIDKey
*
* @abstract
* Number property that describes the vendor ID of the device.
*/
#define kIOHIDVendorIDKey "VendorID"
/*!
* @define kIOHIDProductIDKey
*
* @abstract
* Number property that describes the product ID of the device.
*/
#define kIOHIDProductIDKey "ProductID"
/*!
* @define kIOHIDVersionNumberKey
*
* @abstract
* Number property that describes the version number of the device.
*/
#define kIOHIDVersionNumberKey "VersionNumber"
/*!
* @define kIOHIDManufacturerKey
*
* @abstract
* String property that describes the manufacturer of the device.
*/
#define kIOHIDManufacturerKey "Manufacturer"
/*!
* @define kIOHIDProductKey
*
* @abstract
* String property that describes the product of the device.
*/
#define kIOHIDProductKey "Product"
/*!
* @define kIOHIDSerialNumberKey
*
* @abstract
* String property that describes the serial number of the device.
*/
#define kIOHIDSerialNumberKey "SerialNumber"
/*!
* @define kIOHIDCountryCodeKey
*
* @abstract
* Number property that describes the country code of the device.
*/
#define kIOHIDCountryCodeKey "CountryCode"
/*!
* @define kIOHIDLocationIDKey
*
* @abstract
* Number property that describes the location ID of the device.
*/
#define kIOHIDLocationIDKey "LocationID"
/*!
* @define kIOHIDDeviceUsagePairsKey
*
* @abstract
* Array property that describes the top level usages of the device. The array
* will have dictionaries of usage pages/usages of each top level collection
* that exists on the device.
*/
#define kIOHIDDeviceUsagePairsKey "DeviceUsagePairs"
/*!
* @define kIOHIDDeviceUsageKey
*
* @abstract
* Number property used in the device usage pairs array above. Describes a
* usage of the device.
*/
#define kIOHIDDeviceUsageKey "DeviceUsage"
/*!
* @define kIOHIDDeviceUsagePageKey
*
* @abstract
* Number property used in the device usage pairs array above. Describes a
* usage page of the device.
*/
#define kIOHIDDeviceUsagePageKey "DeviceUsagePage"
/*!
* @define kIOHIDPrimaryUsageKey
*
* @abstract
* Number property that describes the primary usage page of the device.
*/
#define kIOHIDPrimaryUsageKey "PrimaryUsage"
/*!
* @define kIOHIDPrimaryUsagePageKey
*
* @abstract
* Number property that describes the primary usage of the device.
*/
#define kIOHIDPrimaryUsagePageKey "PrimaryUsagePage"
/*!
* @define kIOHIDMaxInputReportSizeKey
*
* @abstract
* Number property that describes the max input report size of the device. This
* is derived from the report descriptor data provided in the
* kIOHIDReportDescriptorKey key.
*/
#define kIOHIDMaxInputReportSizeKey "MaxInputReportSize"
/*!
* @define kIOHIDMaxOutputReportSizeKey
*
* @abstract
* Number property that describes the max output report size of the device. This
* is derived from the report descriptor data provided in the
* kIOHIDReportDescriptorKey key.
*/
#define kIOHIDMaxOutputReportSizeKey "MaxOutputReportSize"
/*!
* @define kIOHIDMaxFeatureReportSizeKey
*
* @abstract
* Number property that describes the max feature report size of the device.
* This is derived from the report descriptor data provided in the
* kIOHIDReportDescriptorKey key.
*/
#define kIOHIDMaxFeatureReportSizeKey "MaxFeatureReportSize"
/*!
* @define kIOHIDReportIntervalKey
*
* @abstract
* Number property set on the device from a client that describes the interval in us
* at which the client wishes to receive reports. It is up to the device to
* determine how to handle this key, if it chooses to do so.
*/
#define kIOHIDReportIntervalKey "ReportInterval"
/*!
* @define kIOHIDBatchIntervalKey
*
* @abstract
* Number property set on the device from a client that describes the interval
* at which the client wishes to receive batched reports. It is up to the device
* to determine how to handle this key, if it chooses to do so.
*/
#define kIOHIDBatchIntervalKey "BatchInterval"
/*!
* @define kIOHIDRequestTimeoutKey
*
* @abstract
* Number property that describes the request timeout in us for get/setReport calls.
* It is up to the device to determine how to handle this key, if it chooses to
* do so.
*/
#define kIOHIDRequestTimeoutKey "RequestTimeout"
/*!
* @define kIOHIDReportDescriptorKey
*
* @abstract
* Data property that describes the report descriptor of the device.
*/
#define kIOHIDReportDescriptorKey "ReportDescriptor"
/*!
* @define kIOHIDBuiltInKey
*
* @abstract
* Number property that describes if the device is built in.
*/
#define kIOHIDBuiltInKey "Built-In"
/*!
* @define kIOHIDPhysicalDeviceUniqueIDKey
*
* @abstract
* String property that describes a unique identifier of the device.
*/
#define kIOHIDPhysicalDeviceUniqueIDKey "PhysicalDeviceUniqueID"
#endif /* IOHIDDeviceKeys_h */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hid/IOHIDDevice.h | /*
*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_HID_IOHIDDEVICE_H
#define _IOKIT_HID_IOHIDDEVICE_H
#include <TargetConditionals.h>
#include <IOKit/IOService.h>
#include <IOKit/IOMessage.h>
#include <IOKit/IOBufferMemoryDescriptor.h>
#include <IOKit/hidsystem/IOHIDDescriptorParser.h>
#include <IOKit/hid/IOHIDKeys.h>
#include <IOKit/hid/IOHIDUsageTables.h>
#include <IOKit/IOEventSource.h>
#include <IOKit/hid/IOHIDDeviceTypes.h>
#include <HIDDriverKit/IOHIDDevice.h>
class IOHIDSystem;
class IOHIDPointing;
class IOHIDKeyboard;
class IOHIDConsumer;
class IOHIDElementPrivate;
class IOHIDEventQueue;
class IOHIDInterface;
class IOHIDDeviceShim;
struct IOHIDReportHandler;
class IOHIDAsyncReportQueue;
class IOHIDDeviceElementContainer;
/*! @class IOHIDDevice : public IOService
@abstract IOHIDDevice defines a Human Interface Device (HID) object,
which will interact with the HID Manager by publishing static properties
in the registry, and also by reporting HID events through shared memory.
IOHIDDevice is an abstract class that must be subclassed to support a
specific type of HID devices, such as USB HID class devices.
<br>
Since most HID devices are expected to be USB devices, IOHIDDevice
uses the USB HID specification to define the format of the report
descriptor, and also reports that are used to communicate with the
hardware via some intervening transport layer. However, there is no
mandate that the transport layer must be restricted to USB. A subclass
may be created to support legacy ADB joysticks, and issue packets on
the ADB bus and translate those packets to USB reports, and vice versa.
IOHIDDevice does not care how those reports are generated or consumed
by the physical device, as long as the reports abide to the USB
specification. */
#if defined(KERNEL) && !defined(KERNEL_PRIVATE)
class __deprecated_msg("Use DriverKit") IOHIDDevice : public IOService
#else
class IOHIDDevice : public IOService
#endif
{
OSDeclareDefaultStructorsWithDispatch ( IOHIDDevice )
friend class IOHIDLibUserClient;
friend class IOHIDDeviceShim;
friend class IOHIDInterface;
private:
OSArray * _elementArray;
UInt32 _dataElementIndex;
IORecursiveLock * _elementLock;
IOHIDReportHandler * _reportHandlers; // unused
IOBufferMemoryDescriptor * _elementValuesDescriptor; // unused
bool _readyForInputReports;
UInt32 _reportCount;
UInt32 _maxInputReportSize;
UInt32 _maxOutputReportSize;
UInt32 _maxFeatureReportSize;
struct ExpansionData {
OSSet * clientSet;
IOService * seizedClient;
AbsoluteTime eventDeadline;
bool performTickle;
bool performWakeTickle;
OSArray * interfaceNubs;
OSArray * hierarchElements;
OSArray * interfaceElementArrays;
IOHIDAsyncReportQueue * asyncReportQueue;
IOWorkLoop * workLoop;
IOEventSource * eventSource;
IONotifier * deviceNotify;
IOHIDDeviceElementContainer *elementContainer;
};
/*! @var reserved
Reserved for future use. (Internal use only) */
ExpansionData * _reserved;
void setupResolution();
// HID report descriptor parsing support.
bool linkToParent( const OSArray * array,
UInt32 parentIndex,
UInt32 childIndex );
bool createCollectionElements( HIDPreparsedDataRef parseData,
OSArray * array,
UInt32 maxCount );
bool createValueElements( HIDPreparsedDataRef parseData,
OSArray * array,
UInt32 hidReportType,
IOHIDElementType elementType,
UInt32 maxCount );
bool createButtonElements( HIDPreparsedDataRef parseData,
OSArray * array,
UInt32 hidReportType,
IOHIDElementType elementType,
UInt32 maxCount );
bool createReportHandlerElements( HIDPreparsedDataRef parseData);
bool getReportCountAndSizes( HIDPreparsedDataRef parseData );
bool setReportSize( UInt8 reportID,
IOHIDReportType reportType,
UInt32 bits );
IOReturn createElementHierarchy( HIDPreparsedDataRef parseData );
IOReturn parseReportDescriptor( IOMemoryDescriptor * report,
IOOptionBits options = 0 );
IOBufferMemoryDescriptor * createMemoryForElementValues();
bool validateMatchingTable(OSDictionary * table);
OSBoolean * newIsAccessProtected();
OSNumber * newPrimaryUsageNumber(UInt32 interfaceIdx) const;
OSNumber * newPrimaryUsagePageNumber(UInt32 interfaceIdx) const;
OSArray * newDeviceUsagePairs(OSArray * elements, UInt32 start);
IOReturn postElementTransaction(const void* elementData, UInt32 dataSize);
static bool _publishDeviceNotificationHandler(void * target,
void * refCon,
IOService * newService,
IONotifier * notifier );
protected:
/*! @function free
@abstract Free the IOHIDDevice object.
@discussion Release all resources that were previously allocated,
then call super::free() to propagate the call to our superclass. */
virtual void free() APPLE_KEXT_OVERRIDE;
/*! @function handleOpen
@abstract Handle a client open on the interface.
@discussion This method is called by IOService::open() with the
arbitration lock held, and must return true to accept the client open.
This method will in turn call handleClientOpen() to qualify the client
requesting the open.
@param client The client object that requested the open.
@param options Options passed to IOService::open().
@param argument Argument passed to IOService::open().
@result true to accept the client open, false otherwise. */
virtual bool handleOpen(IOService * client,
IOOptionBits options,
void * argument) APPLE_KEXT_OVERRIDE;
/*! @function handleClose
@abstract Handle a client close on the interface.
@discussion This method is called by IOService::close() with the
arbitration lock held. This method will in turn call handleClientClose()
to notify interested subclasses about the client close. If this represents
the last close, then the interface will also close the controller before
this method returns. The controllerWillClose() method will be called before
closing the controller. Subclasses should not override this method.
@param client The client object that requested the close.
@param options Options passed to IOService::close(). */
virtual void handleClose(IOService * client, IOOptionBits options) APPLE_KEXT_OVERRIDE;
/*! @function handleIsOpen
@abstract Query whether a client has an open on the interface.
@discussion This method is always called by IOService with the
arbitration lock held. Subclasses should not override this method.
@result true if the specified client, or any client if none (0) is
specified, presently has an open on this object. */
virtual bool handleIsOpen(const IOService * client) const APPLE_KEXT_OVERRIDE;
/*! @function handleStart
@abstract Prepare the hardware and driver to support I/O operations.
@discussion IOHIDDevice will call this method from start() before
any I/O operations are issued to the concrete subclass. Methods
such as newReportDescriptor() are only called after handleStart()
has returned true. A subclass that overrides this method should
begin its implementation by calling the version in super, and
then check the return value.
@param provider The provider argument passed to start().
@result True on success, or false otherwise. Returning false will
cause start() to fail and return false. */
virtual bool handleStart( IOService * provider );
/*! @function handleStop
@abstract Quiesce the hardware and stop the driver.
@discussion IOHIDDevice will call this method from stop() to
signal that the hardware should be quiesced and the driver stopped.
A subclass that overrides this method should end its implementation
by calling the version in super.
@param provider The provider argument passed to stop(). */
virtual void handleStop( IOService * provider );
/*! @function newUserClient
@abstract Handle a request to create a connection for a non kernel
client.
@discussion Create a new IOUserClient, or a subclass of IOUserClient,
to service a connection to a non kernel client. This implementation
will simply call the implementation in IOService to handle the call.
@param owningTask The mach task requesting the connection.
@param security_id A token representing the access level for the task.
@param type A constant specifying the type of connection to be created.
@param properties A dictionary of additional properties for the connection.
@param handler The IOUserClient object returned.
@result The return from IOService::newUserClient() is returned. */
virtual IOReturn newUserClient( task_t owningTask,
void * security_id,
UInt32 type,
OSDictionary * properties,
IOUserClient ** handler ) APPLE_KEXT_OVERRIDE;
IOReturn newUserClientInternal(task_t owningTask,
void * security_id,
OSDictionary * properties,
IOUserClient ** handler );
/*! @function publishProperties
@abstract Publish HID properties to the I/O Kit registry.
@discussion Called by the start() method to fetch and publish all
HID properties to the I/O Kit registry. These properties will allow
the HID Manager to identify all HID device(s) in the system, by
iterating through objects that are subclasses of IOHIDDevice, and
then fetch their published property values. The implementation in
IOHIDDevice will call methods to get each individual HID property,
and subclasses will not normally need to override this method.
@param provider The provider argument passed to start().
@result True to indicate that all properties were discovered and
published to the registry, false otherwise. Returning false will
cause start() to fail and return false. */
virtual bool publishProperties( IOService * provider );
public:
/*! @function init
@abstract Initialize an IOHIDDevice object.
@discussion Prime the IOHIDDevice object and prepare it to support
a probe() or a start() call. This implementation will simply call
super::init().
@param dictionary A dictionary associated with this IOHIDDevice
instance.
@result True on sucess, or false otherwise. */
virtual bool init( OSDictionary * dictionary = 0 ) APPLE_KEXT_OVERRIDE;
/*! @function start
@abstract Start up the driver using the given provider.
@discussion IOHIDDevice will allocate resources, then call handleStart()
before fetching the report descriptor through newReportDescriptor(), and
publishing HID properties to the registry. Before returning true to
indicate success, registerService() is called to trigger client matching.
Subclasses are recommended to override handleStart().
@param provider The provider that the driver was matched to, and selected
to run with.
@result True on success, or false otherwise. */
virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE;
/*! @function stop
@abstract Called by a provider (during its termination) before detaching
all its clients.
@discussion IOHIDDevice will call handleStop(), then release allocated
resources. Subclasses are recommended to override handleStop().
@param provider The provider that the driver was started on. */
virtual void stop( IOService * provider ) APPLE_KEXT_OVERRIDE;
/*! @function matchPropertyTable
@abstract Called by the provider during a match
@discussion Compare the properties in the supplied table to this
object's properties.
@param table The property table that this device will match against
*/
virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score) APPLE_KEXT_OVERRIDE;
/*! @function message
@abstract Receives messages delivered from an attached provider.
@discussion Handles the <code>kIOMessageDeviceSignaledWakeup</code> message
from a provider identifying the IOHIDDevice as the wakeup source.
@param type A type defined in <code>IOMessage.h</code>.
@param provider The provider from which the message originates.
@param argument An argument defined by the message type.
@result An IOReturn code defined by the message type.
*/
virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ) APPLE_KEXT_OVERRIDE;
using IOService::setProperty;
/*! @function setProperty
@abstract Synchronized method to add a property to an IOHIDDevice's property table.
@discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table.
@param aKey The properties name as an OSSymbol.
@param anObject The property value.
@result true on success or false on a resource failure. */
virtual bool setProperty( const OSSymbol * aKey, OSObject * anObject) APPLE_KEXT_OVERRIDE;
/*! @function newTransportString
@abstract Returns a string object that describes the transport
layer used by the HID device.
@result A string object. The caller must decrement the retain count
on the object returned. */
virtual OSString * newTransportString() const;
/*! @function newManufacturerString
@abstract Returns a string object that describes the manufacturer
of the HID device.
@result A string object. The caller must decrement the retain count
on the object returned. */
virtual OSString * newManufacturerString() const;
/*! @function newProductString
@abstract Returns a string object that describes the product
of the HID device.
@result A string object. The caller must decrement the retain count
on the object returned. */
virtual OSString * newProductString() const;
/*! @function newVendorIDNumber
@abstract Returns a number object that describes the vendor ID
of the HID device.
@result A number object. The caller must decrement the retain count
on the object returned. */
virtual OSNumber * newVendorIDNumber() const;
/*! @function newProductIDNumber
@abstract Returns a number object that describes the product ID
of the HID device.
@result A number object. The caller must decrement the retain count
on the object returned. */
virtual OSNumber * newProductIDNumber() const;
/*! @function newVersionNumber
@abstract Returns a number object that describes the version number
of the HID device.
@result A number object. The caller must decrement the retain count
on the object returned. */
virtual OSNumber * newVersionNumber() const;
// *** THIS HAS BEEN DEPRECATED. PLEASE USE newSerialNumberString ***
/*! @function newSerialNumber
@abstract THIS HAS BEEN DEPRECATED. PLEASE USE newSerialNumberString.
@result A number object. The caller must decrement the retain count
on the object returned. */
virtual OSNumber * newSerialNumber() const;
/*! @function newPrimaryUsageNumber
@abstract Returns a number object that describes the primary usage
of the HID device.
@result A number object. The caller must decrement the retain count
on the object returned. */
virtual OSNumber * newPrimaryUsageNumber() const;
/*! @function newPrimaryUsagePageNumber
@abstract Returns a number object that describes the primary usage
page of the HID device.
@result A number object. The caller must decrement the retain count
on the object returned. */
virtual OSNumber * newPrimaryUsagePageNumber() const;
/*! @function newReportDescriptor
@abstract Create and return a new memory descriptor that describes the
report descriptor for the HID device.
@discussion A subclass must override this pure virtual function, and
return a memory descriptor that describes the HID report descriptor as
defined by the USB Device Class Definition for Human Interface Devices
Version 1.1 specification.
@param descriptor Pointer to the memory descriptor returned. This
memory descriptor will be released by the caller.
@result kIOReturnSuccess on success, or an error return otherwise. */
virtual IOReturn newReportDescriptor(
IOMemoryDescriptor ** descriptor ) const = 0;
/*! @function handleReport
@abstract Handle an asynchronous report received from the HID device.
@param report A memory descriptor that describes the report.
@param reportType The type of report.
@param options Options to specify the request. No options are
currently defined, and the default value is 0.
@result kIOReturnSuccess on success, or an error return otherwise. */
virtual IOReturn handleReport(
IOMemoryDescriptor * report,
IOHIDReportType reportType = kIOHIDReportTypeInput,
IOOptionBits options = 0 );
/*! @function getReport
@abstract Get a report from the HID device.
@param report A memory descriptor that describes the memory to store
the report read from the HID device.
@param reportType The report type.
@param options The lower 8 bits will represent the Report ID. The
other 24 bits are options to specify the request.
@result kIOReturnSuccess on success, or an error return otherwise. */
virtual IOReturn getReport( IOMemoryDescriptor * report,
IOHIDReportType reportType,
IOOptionBits options );
/*! @function setReport
@abstract Send a report to the HID device.
@param report A memory descriptor that describes the report to send
to the HID device.
@param reportType The report type.
@param options The lower 8 bits will represent the Report ID. The
other 24 bits are options to specify the request.
@result kIOReturnSuccess on success, or an error return otherwise. */
virtual IOReturn setReport( IOMemoryDescriptor * report,
IOHIDReportType reportType,
IOOptionBits options = 0 );
/*! @function getMemoryWithCurrentElementValues
@abstract Get a reference to a memory descriptor that describes the
memory block containing the current HID element values.
@discussion Each HID element that can contribute to an input, output,
or feature report, is assigned an area of memory from a common memory
block allocated by IOHIDDevice. Each element will use its assigned
memory area to store its current value, defined by an IOHIDElementValue
structure. The memory described by the memory descriptor may be mapped
to user space to allow the HID Manager to poll the current element
value without the cost of a user-kernel transition. Subclasses should
not override this method.
@result A reference to a memory descriptor that describes the current
element values, or 0 to indicate a resource shortage. */
virtual IOMemoryDescriptor * getMemoryWithCurrentElementValues() const;
/*! @function registerElement
@abstract A registration function called by a HID element to register
itself, and also to obtain an unique cookie identifier
(unique per device, not unique system-wide).
@discussion An internal data type, an IOHIDElementPrivate, is created to
represent each HID element discovered by parsing the HID report
descriptor. Each element created will call this method to register
itself with its owner (IOHIDDevice), and also to obtain an element
cookie that is used by HID Manager to specify and identify the element.
Subclasses should not override this method.
@param element The element that is requesting registration with its
owner.
@param cookie Pointer to the returned cookie assigned to this element.
@result True on success, or false otherwise. */
virtual bool registerElement( IOHIDElementPrivate * element,
IOHIDElementCookie * cookie );
/*! @function startEventDelivery
@abstract Start delivering events from a HID element to the event
queue specified.
@discussion Clients of IOHIDDevice may create an IOHIDEventQueue, and
then call this method to register for delivery of events generated by
one or more HID elements to that event queue. Subclasses should not
override this method.
@param queue The event queue that is interested in receiving events
generated by the HID element specified. The retain count on the queue
will be incremented by one.
@param cookie The cookie for a HID element published by the HID device.
@param options Options to specify the request. No options are currently
defined, and the default value is zero.
@result kIOReturnSuccess on success, or kIOReturnBadArgument if the
queue or the cookie argument specified is invalid, or kIOReturnNoMemory
if a resource shortage was encountered. */
virtual IOReturn startEventDelivery( IOHIDEventQueue * queue,
IOHIDElementCookie cookie,
IOOptionBits options = 0 );
/*! @function stopEventDelivery
@abstract Stop delivering events from one or more HID elements to the
event queue specified.
@discussion Clients that called startEventDelivery() must eventually
call this method to stop event delivery to its queue from one or more
HID elements.
@param queue The event queue that no longer wishes to receive events
generated by the HID element specified.
@param cookie The cookie for a HID element published by the HID device.
The default value of zero indicates that the queue should be removed from
the event dispatch list of all HID elements published by the HID device.
Subclasses should not override this method.
@result kIOReturnSuccess if the queue was removed from the event dispatch
list for one or more HID elements, or kIOReturnBadArgument if the queue
or the cookie argument specified is invalid, or kIOReturnNotFound if the
queue was not found. */
virtual IOReturn stopEventDelivery( IOHIDEventQueue * queue,
IOHIDElementCookie cookie = 0 );
/*! @function checkEventDelivery
@abstract Check whether events from a HID element will be delivered to
the event queue specified.
@param queue The event queue.
@param cookie The cookie for a HID element published by the HID device.
@param isActive Pointer to the return value that is set to true if events
generated by the HID element will be delivered to the queue, or false
otherwise. This return value is set only if kIOReturnSuccess is
returned.
@result kIOReturnSuccess on success, or kIOReturnBadArgument if one or
more of the arguments provided are invalid. */
virtual IOReturn checkEventDelivery( IOHIDEventQueue * queue,
IOHIDElementCookie cookie,
bool * isActive );
/*! @function updateElementValues
@abstract Updates element values from a HID device via getReport.
@param cookies A list of element cookies who's values need to be
set on the device.
@param cookieCount The number of element cookies.
@result kIOReturnSuccess on success, or an error return otherwise. */
OSMetaClassDeclareReservedUsed(IOHIDDevice, 0);
virtual IOReturn updateElementValues(IOHIDElementCookie * cookies, UInt32 cookieCount = 1);
/*! @function postElementValues
@abstract Posts element values to a HID device via setReport.
@param cookies A list of element cookies who's values need to be
set on the device.
@param cookieCount The number of element cookies.
@result kIOReturnSuccess on success, or an error return otherwise. */
OSMetaClassDeclareReservedUsed(IOHIDDevice, 1);
virtual IOReturn postElementValues(IOHIDElementCookie * cookies, UInt32 cookieCount = 1);
/*! @function newSerialNumberString
@abstract Returns a string object that describes the serial number
of the HID device.
@result A number object. The caller must decrement the retain count
on the object returned. */
OSMetaClassDeclareReservedUsed(IOHIDDevice, 2);
virtual OSString * newSerialNumberString() const;
/*! @function newLocationIDNumber
@abstract Returns a number object that describes the location ID
of the HID device.
@result A number object. The caller must decrement the retain count
on the object returned. */
OSMetaClassDeclareReservedUsed(IOHIDDevice, 3);
virtual OSNumber * newLocationIDNumber() const;
/*! @function getReport
@abstract Get a report from the HID device.
@param report A memory descriptor that describes the memory to store
the report read from the HID device.
@param reportType The report type.
@param options The lower 8 bits will represent the Report ID. The
other 24 bits are options to specify the request.
@param completionTimeout Specifies an amount of time (in ms) after which
the command will be aborted if the entire command has not been completed.
@param completion Function to call when request completes. If omitted then
getReport() executes synchronously, blocking until the request is complete.
@result kIOReturnSuccess on success, or an error return otherwise. */
OSMetaClassDeclareReservedUsed(IOHIDDevice, 4);
virtual IOReturn getReport( IOMemoryDescriptor * report,
IOHIDReportType reportType,
IOOptionBits options,
UInt32 completionTimeout,
IOHIDCompletion * completion = 0);
/*! @function setReport
@abstract Send a report to the HID device.
@param report A memory descriptor that describes the report to send
to the HID device.
@param reportType The report type.
@param options The lower 8 bits will represent the Report ID. The
other 24 bits are options to specify the request.
@param completionTimeout Specifies an amount of time (in ms) after which
the command will be aborted if the entire command has not been completed.
@param completion Function to call when request completes. If omitted then
setReport() executes synchronously, blocking until the request is complete.
@result kIOReturnSuccess on success, or an error return otherwise. */
OSMetaClassDeclareReservedUsed(IOHIDDevice, 5);
virtual IOReturn setReport( IOMemoryDescriptor * report,
IOHIDReportType reportType,
IOOptionBits options,
UInt32 completionTimeout,
IOHIDCompletion * completion = 0);
/*! @function newVendorIDSourceNumber
@abstract Returns a number object that describes the vendor ID
source of the HID device.
@result A number object. The caller must decrement the retain count
on the object returned. */
OSMetaClassDeclareReservedUsed(IOHIDDevice, 6);
virtual OSNumber * newVendorIDSourceNumber() const;
/*! @function newCountryCodeNumber
@abstract Returns a number object that describes the country code
of the HID device.
@result A number object. The caller must decrement the retain count
on the object returned. */
OSMetaClassDeclareReservedUsed(IOHIDDevice, 7);
virtual OSNumber * newCountryCodeNumber() const;
/*! @function handleReportWithTime
@abstract Handle an asynchronous report received from the HID device.
@param timeStamp The timestamp of report.
@param report A memory descriptor that describes the report.
@param reportType The type of report. Currently, only
kIOHIDReportTypeInput report type is handled.
@param options Options to specify the request. No options are
currently defined, and the default value is 0.
@result kIOReturnSuccess on success, or an error return otherwise. */
OSMetaClassDeclareReservedUsed(IOHIDDevice, 8);
virtual IOReturn handleReportWithTime(
AbsoluteTime timeStamp,
IOMemoryDescriptor * report,
IOHIDReportType reportType = kIOHIDReportTypeInput,
IOOptionBits options = 0);
/*! @function newReportInterval
@abstract Returns a number object that describes the actual polling
interval of the HID device in microseconds.
@result A number object. The caller must decrement the retain count
on the object returned. */
OSMetaClassDeclareReservedUsed(IOHIDDevice, 9);
virtual OSNumber * newReportIntervalNumber() const;
OSMetaClassDeclareReservedUsed(IOHIDDevice, 10);
virtual IOReturn handleReportWithTimeAsync(
AbsoluteTime timeStamp,
IOMemoryDescriptor * report,
IOHIDReportType reportType,
IOOptionBits options,
UInt32 completionTimeout,
IOHIDCompletion * completion);
/*! @function newDeviceUsagePairs
@abstract Returns an array of usage dictionaries. IOHIDDevice creates
create this from the actual report descriptor, and that should be the base
for any subclass override.
@result A number object. The caller must decrement the retain count
on the object returned. */
OSMetaClassDeclareReservedUsed(IOHIDDevice, 11);
virtual OSArray * newDeviceUsagePairs();
protected:
/*! @function createInterface
@abstract Creates an IOHIDInterface nub for the device to attach to.
@discussion Will create multiple interfaces, if applicable and support is
enabled.
@result true on success, false otherwise. */
OSMetaClassDeclareReservedUsed(IOHIDDevice, 12);
virtual bool createInterface(IOOptionBits options = 0);
/*! @function destroyInterface
@abstract Destroys the IOHIDInterface nub attached to the device.
@discussion This method will destroy all interfaces if multiple were
created. */
OSMetaClassDeclareReservedUsed(IOHIDDevice, 13);
virtual void destroyInterface(IOOptionBits options = 0);
/*! @function conformsTo
@abstract Checks if a device conforms to a certain usage page/usage.
@discussion Iterates through the usages returned from newDeviceUsagePairs
function and checks for matching usages.
@result true if the device conforms to the specified usage page/usage. */
OSMetaClassDeclareReservedUsed(IOHIDDevice, 14);
virtual bool conformsTo(UInt32 usagePage, UInt32 usage);
/*! @function completeReport
@abstract complete reports for DriverKit drivers
@discussion This method only used by DriverKit driver
created. */
OSMetaClassDeclareReservedUsed(IOHIDDevice, 15);
virtual void completeReport(OSAction * action, IOReturn status, uint32_t actualByteCount);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 16);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 17);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 18);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 19);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 20);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 21);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 22);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 23);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 24);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 25);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 26);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 27);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 28);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 29);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 30);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 31);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 32);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 33);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 34);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 35);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 36);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 37);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 38);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 39);
OSMetaClassDeclareReservedUnused(IOHIDDevice, 40);
};
#endif /* !_IOKIT_HID_IOHIDDEVICE_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hid/IOHIDKeys.h | /*
*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2020 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_HID_IOHIDKEYS_H_
#define _IOKIT_HID_IOHIDKEYS_H_
#include <sys/cdefs.h>
#include <IOKit/hidsystem/IOHIDParameter.h>
#include <IOKit/IOReturn.h>
#include <IOKit/IOMessage.h>
#include <IOKit/hid/IOHIDProperties.h>
#include <IOKit/hid/IOHIDDeviceTypes.h>
#include <IOKit/hid/IOHIDDeviceKeys.h>
__BEGIN_DECLS
/* The following keys are used to search the IORegistry for HID related services
*/
/* This is used to find HID Devices in the IORegistry */
#define kIOHIDDeviceKey "IOHIDDevice"
/*!
@defined HID Device Property Keys
@abstract Keys that represent properties of a paticular device.
@discussion Keys that represent properties of a paticular device. Can be added
to your matching dictionary when refining searches for HID devices.
<br><br>
<b>Please note:</b><br>
kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer
rich enough to describe a device's capabilities. Take, for example, a
device that describes both a keyboard and a mouse in the same descriptor.
The previous behavior was to only describe the keyboard behavior with the
primary usage and usage page. Needless to say, this would sometimes cause
a program interested in mice to skip this device when matching.
<br>
Thus we have added 3
additional keys:
<ul>
<li>kIOHIDDeviceUsageKey</li>
<li>kIOHIDDeviceUsagePageKey</li>
<li>kIOHIDDeviceUsagePairsKey</li>
</ul>
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing
key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey.
These usage pairs describe all application type collections (behaviors) defined
by the device.
<br><br>
An application intersted in only matching on one criteria would only add the
kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary.
If it is interested in a device that has multiple behaviors, the application would
instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his
matching dictionary.
*/
#define kIOHIDVendorIDSourceKey "VendorIDSource"
#define kIOHIDStandardTypeKey "StandardType"
#define kIOHIDSampleIntervalKey "SampleInterval"
#define kIOHIDResetKey "Reset"
#define kIOHIDKeyboardLanguageKey "KeyboardLanguage"
#define kIOHIDAltHandlerIdKey "alt_handler_id"
#define kIOHIDDisplayIntegratedKey "DisplayIntegrated"
#define kIOHIDProductIDMaskKey "ProductIDMask"
#define kIOHIDProductIDArrayKey "ProductIDArray"
#define kIOHIDPowerOnDelayNSKey "HIDPowerOnDelayNS"
#define kIOHIDCategoryKey "Category"
#define kIOHIDMaxResponseLatencyKey "MaxResponseLatency"
#define kIOHIDUniqueIDKey "UniqueID"
#define kIOHIDModelNumberKey "ModelNumber"
#define kIOHIDTransportUSBValue "USB"
#define kIOHIDTransportBluetoothValue "Bluetooth"
#define kIOHIDTransportBluetoothLowEnergyValue "BluetoothLowEnergy"
#define kIOHIDTransportAIDBValue "AID"
#define kIOHIDTransportI2CValue "I2C"
#define kIOHIDTransportSPIValue "SPI"
#define kIOHIDTransportSerialValue "Serial"
#define kIOHIDTransportIAPValue "iAP"
#define kIOHIDTransportAirPlayValue "AirPlay"
#define kIOHIDTransportSPUValue "SPU"
#define kIOHIDTransportBTAACPValue "BT-AACP"
#define kIOHIDCategoryAutomotiveValue "Automotive"
/*!
@define kIOHIDElementKey
@abstract Keys that represents an element property.
@discussion Property for a HID Device or element dictionary.
Elements can be heirarchical, so they can contain other elements.
*/
#define kIOHIDElementKey "Elements"
/*!
@defined HID Element Dictionary Keys
@abstract Keys that represent properties of a particular elements.
@discussion These keys can also be added to a matching dictionary
when searching for elements via copyMatchingElements.
*/
#define kIOHIDElementCookieKey "ElementCookie"
#define kIOHIDElementTypeKey "Type"
#define kIOHIDElementCollectionTypeKey "CollectionType"
#define kIOHIDElementUsageKey "Usage"
#define kIOHIDElementUsagePageKey "UsagePage"
#define kIOHIDElementMinKey "Min"
#define kIOHIDElementMaxKey "Max"
#define kIOHIDElementScaledMinKey "ScaledMin"
#define kIOHIDElementScaledMaxKey "ScaledMax"
#define kIOHIDElementSizeKey "Size"
#define kIOHIDElementReportSizeKey "ReportSize"
#define kIOHIDElementReportCountKey "ReportCount"
#define kIOHIDElementReportIDKey "ReportID"
#define kIOHIDElementIsArrayKey "IsArray"
#define kIOHIDElementIsRelativeKey "IsRelative"
#define kIOHIDElementIsWrappingKey "IsWrapping"
#define kIOHIDElementIsNonLinearKey "IsNonLinear"
#define kIOHIDElementHasPreferredStateKey "HasPreferredState"
#define kIOHIDElementHasNullStateKey "HasNullState"
#define kIOHIDElementFlagsKey "Flags"
#define kIOHIDElementUnitKey "Unit"
#define kIOHIDElementUnitExponentKey "UnitExponent"
#define kIOHIDElementNameKey "Name"
#define kIOHIDElementValueLocationKey "ValueLocation"
#define kIOHIDElementDuplicateIndexKey "DuplicateIndex"
#define kIOHIDElementParentCollectionKey "ParentCollection"
#define kIOHIDElementVariableSizeKey "VariableSize"
#ifndef __ppc__
#define kIOHIDElementVendorSpecificKey "VendorSpecific"
#else
#define kIOHIDElementVendorSpecificKey "VendorSpecifc"
#endif
/*!
@defined HID Element Match Keys
@abstract Keys used for matching particular elements.
@discussion These keys should only be used with a matching
dictionary when searching for elements via copyMatchingElements.
*/
#define kIOHIDElementCookieMinKey "ElementCookieMin"
#define kIOHIDElementCookieMaxKey "ElementCookieMax"
#define kIOHIDElementUsageMinKey "UsageMin"
#define kIOHIDElementUsageMaxKey "UsageMax"
/*!
@defined kIOHIDElementCalibrationMinKey
@abstract The minimum bounds for a calibrated value.
*/
#define kIOHIDElementCalibrationMinKey "CalibrationMin"
/*!
@defined kIOHIDElementCalibrationMaxKey
@abstract The maximum bounds for a calibrated value.
*/
#define kIOHIDElementCalibrationMaxKey "CalibrationMax"
/*!
@defined kIOHIDElementCalibrationSaturationMinKey
@abstract The mininum tolerance to be used when calibrating a logical element value.
@discussion The saturation property is used to allow for slight differences in the minimum and maximum value returned by an element.
*/
#define kIOHIDElementCalibrationSaturationMinKey "CalibrationSaturationMin"
/*!
@defined kIOHIDElementCalibrationSaturationMaxKey
@abstract The maximum tolerance to be used when calibrating a logical element value.
@discussion The saturation property is used to allow for slight differences in the minimum and maximum value returned by an element.
*/
#define kIOHIDElementCalibrationSaturationMaxKey "CalibrationSaturationMax"
/*!
@defined kIOHIDElementCalibrationDeadZoneMinKey
@abstract The minimum bounds near the midpoint of a logical value in which the value is ignored.
@discussion The dead zone property is used to allow for slight differences in the idle value returned by an element.
*/
#define kIOHIDElementCalibrationDeadZoneMinKey "CalibrationDeadZoneMin"
/*!
@defined kIOHIDElementCalibrationDeadZoneMinKey
@abstract The maximum bounds near the midpoint of a logical value in which the value is ignored.
@discussion The dead zone property is used to allow for slight differences in the idle value returned by an element.
*/
#define kIOHIDElementCalibrationDeadZoneMaxKey "CalibrationDeadZoneMax"
/*!
@defined kIOHIDElementCalibrationGranularityKey
@abstract The scale or level of detail returned in a calibrated element value.
@discussion Values are rounded off such that if granularity=0.1, values after calibration are 0, 0.1, 0.2, 0.3, etc.
*/
#define kIOHIDElementCalibrationGranularityKey "CalibrationGranularity"
/*!
@defined kIOHIDKeyboardSupportsEscKey
@abstract Describe if keyboard device supports esc key.
@discussion Keyboard devices having full HID keyboard descriptor can specify if esc key is actually supported or not. For new macs with TouchBar this is ideal scenario where keyboard descriptor by defaultspecifies presence of esc key but through given property client can check if key is present or not
*/
#define kIOHIDKeyboardSupportsEscKey "HIDKeyboardSupportsEscKey"
/*!
@typedef IOHIDOptionsType
@abstract Options for opening a device via IOHIDLib.
@constant kIOHIDOptionsTypeNone Default option.
@constant kIOHIDOptionsTypeSeizeDevice Used to open exclusive
communication with the device. This will prevent the system
and other clients from receiving events from the device.
*/
enum {
kIOHIDOptionsTypeNone = 0x00,
kIOHIDOptionsTypeSeizeDevice = 0x01
};
typedef uint32_t IOHIDOptionsType;
/*!
@typedef IOHIDQueueOptionsType
@abstract Options for creating a queue via IOHIDLib.
@constant kIOHIDQueueOptionsTypeNone Default option.
@constant kIOHIDQueueOptionsTypeEnqueueAll Force the IOHIDQueue
to enqueue all events, relative or absolute, regardless of change.
*/
enum {
kIOHIDQueueOptionsTypeNone = 0x00,
kIOHIDQueueOptionsTypeEnqueueAll = 0x01
};
typedef uint32_t IOHIDQueueOptionsType;
/*!
@typedef IOHIDStandardType
@abstract Type to define what industrial standard the device is referencing.
@constant kIOHIDStandardTypeANSI ANSI.
@constant kIOHIDStandardTypeISO ISO.
@constant kIOHIDStandardTypeJIS JIS.
@constant kIOHIDStandardTypeUnspecified.
*/
enum {
kIOHIDStandardTypeANSI = 0x0,
kIOHIDStandardTypeISO = 0x1,
kIOHIDStandardTypeJIS = 0x2,
kIOHIDStandardTypeUnspecified = 0xFFFFFFFF,
};
typedef uint32_t IOHIDStandardType;
#define kIOHIDDigitizerGestureCharacterStateKey "DigitizerCharacterGestureState"
/*
* kIOHIDSystemButtonPressedDuringDarkBoot - Used to message that a wake button was pressed during dark boot
*/
#define kIOHIDSystemButtonPressedDuringDarkBoot iokit_family_msg(sub_iokit_hidsystem, 7)
/*!
@defined IOHIDKeyboard Keys
@abstract Keys that represent parameters of keyboards.
@discussion Legacy IOHIDKeyboard keys, formerly in IOHIDPrivateKeys. See IOHIDServiceKeys.h for the new keys.
*/
#define kIOHIDKeyboardCapsLockDelay "CapsLockDelay"
#define kIOHIDKeyboardEjectDelay "EjectDelay"
/*!
@defined kFnFunctionUsageMapKey
@abstract top row key remapping for consumer usages
@discussion string of comma separated uint64_t value representing (usagePage<<32) | usage pairs
*/
#define kFnFunctionUsageMapKey "FnFunctionUsageMap"
/*!
@defined kFnKeyboardUsageMapKey
@abstract top row key reampping for consumer usages
@discussion string of comma separated uint64_t value representing (usagePage<<32) | usage pairs
*/
#define kFnKeyboardUsageMapKey "FnKeyboardUsageMap"
#define kNumLockKeyboardUsageMapKey "NumLockKeyboardUsageMap"
#define kKeyboardUsageMapKey "KeyboardUsageMap"
/*!
@defined kIOHIDDeviceOpenedByEventSystemKey
@abstract Property set when corresponding event service object opened by HID event system
@discussion boolean value
*/
#define kIOHIDDeviceOpenedByEventSystemKey "DeviceOpenedByEventSystem"
/*!
* @define kIOHIDDeviceSuspendKey
*
* @abstract
* Boolean property set on a user space IOHIDDeviceRef to suspend report delivery
* to registered callbacks.
*
* @discussion
* When set to true, the callbacks registered via the following API will not be invoked:
* IOHIDDeviceRegisterInputReportCallback
* IOHIDDeviceRegisterInputReportWithTimeStampCallback
* IOHIDDeviceRegisterInputValueCallback
* To resume report delivery, this property should be set to false.
*/
#define kIOHIDDeviceSuspendKey "IOHIDDeviceSuspend"
/*!
* @define kIOHIDMaxReportBufferCountKey
* @abstract Number property published for an IOHIDDevice that contains the
* report buffer count.
* @discussion IOHIDLibUserClient connections to an IOHIDDevice created
* using IOKit/hid/IOHIDDevice.h/IOHIDDeviceCreate have a report
* buffer, where reports can be enqueued and dispatched in quick succession.
* A report buffer count can be published to help determine the
* correct queue size that will be able to handle incoming report
* rates. The queue size is determined by report buffer count
* multiplied by the report buffer's entry size, this total size is
* limited to 131072 bytes. This property can be set in the
* IOHIDDevice's IOKit property table, or on the individual
* IOHIDLibUserClient connection using IOHIDDeviceSetProperty.
* (See kIOHIDReportBufferEntrySizeKey).
*/
#define kIOHIDMaxReportBufferCountKey "MaxReportBufferCount"
/*!
* @define kIOHIDReportBufferEntrySizeKey
* @abstract Number property published on an IOHIDDevice that contains
* the report buffer's entry size.
* @discussion This key describes the entry size of the reports (in bytes)
* in the report buffer between an IOHIDLibUserClient and its
* associated IOHIDDevice. The queue size is determined by the
* report buffer's report count multiplied by the entry size. The
* buffer entry size is currently limited to 8167 bytes, exceeding
* this value will result in a minimum queue size. This property
* can be set in the IOHIDDevice's IOKit property table, or on the individual
* IOHIDLibUserClient connection using IOHIDDeviceSetProperty.
* (See kIOHIDMaxReportBufferCountKey).
*/
#define kIOHIDReportBufferEntrySizeKey "ReportBufferEntrySize"
/*!
@defined kIOHIDSensorPropertyReportIntervalKey
@abstract Property to get or set the Report Interval in us of supported sensor devices
@discussion Corresponds to kHIDUsage_Snsr_Property_ReportInterval in a sensor device's
descriptor.
*/
#define kIOHIDSensorPropertyReportIntervalKey kIOHIDReportIntervalKey
/*!
@defined kIOHIDSensorPropertySampleIntervalKey
@abstract Property to get or set the Sample Interval in us of supported sensor devices
@discussion Corresponds to kHIDUsage_Snsr_Property_SamplingRate in a sensor device's
descriptor.
*/
#define kIOHIDSensorPropertySampleIntervalKey kIOHIDSampleIntervalKey
/*!
@defined kIOHIDSensorPropertyBatchIntervalKey
@abstract Property to get or set the Batch Interval / Report Latency in us of supported sensor devices
@discussion Corresponds to kHIDUsage_Snsr_Property_ReportLatency in a sensor device's
descriptor.
*/
#define kIOHIDSensorPropertyBatchIntervalKey kIOHIDBatchIntervalKey
/*!
@defined kIOHIDSensorPropertyReportLatencyKey
@abstract Alias of kIOHIDSensorPropertyBatchIntervalKey
*/
#define kIOHIDSensorPropertyReportLatencyKey kIOHIDSensorPropertyBatchIntervalKey
/*!
@defined kIOHIDSensorPropertyMaxFIFOEventsKey
@abstract Property to get or set the maximum FIFO event queue size of supported sensor devices
@discussion Corresponds to kHIDUsage_Snsr_Property_MaxFIFOEvents in a sensor device's
descriptor.
*/
#define kIOHIDSensorPropertyMaxFIFOEventsKey "MaxFIFOEvents"
/*!
@defined kIOHIDDigitizerSurfaceSwitchKey
@abstract Property to turn on / of surface digitizer contact reporting
@discussion To allow for better power management, a host may wish to indicate what it would like a touchpad digitizer to not report surface digitizer contacts by clearing this
flag. By default, upon cold‐boot/power cycle, touchpads that support reporting surface
contacts shall do so by default.
*/
#define kIOHIDDigitizerSurfaceSwitchKey "DigitizerSurfaceSwitch"
/*!
@defined kIOHIDPointerAccelerationSupportKey
@abstract Property to turn enable/disable acceleration of relative pointer events
@discussion A boolean value to enable devices that report movement precisely but using relative positions,
if false the events from the device will not have acceleration applied to the event value calculation.
If the key is not set then the device will have acceleration applied to it's events by default.
*/
#define kIOHIDPointerAccelerationSupportKey "HIDSupportsPointerAcceleration"
/*!
@defined kIOHIDScrollAccelerationSupportKey
@abstract Property to turn enable/disable acceleration of scroll events
@discussion A boolean value to enable devices that report scroll precisely but using relative positions,
if false the events from the device will not have acceleration applied to the event value calculation.
If the key is not set then the device will have acceleration applied to it's events by default.
*/
#define kIOHIDScrollAccelerationSupportKey "HIDSupportsScrollAcceleration"
__END_DECLS
#endif /* !_IOKIT_HID_IOHIDKEYS_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hid/IOHIDProperties.h | /*
* Copyright (c) 2016 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef IOHIDProperties_h
#define IOHIDProperties_h
#include <IOKit/hid/IOHIDEventServiceKeys.h>
/*!
* @define kIOHIDMouseAccelerationType
*
* @abstract CFNumber that contains the mouse acceleration value.
*/
#define kIOHIDMouseAccelerationType "HIDMouseAcceleration"
/*!
* @define kIOHIDPointerButtonMode
*
* @abstract CFNumber containing the current pointer button mode.
* See IOHIDButtonModes enumerator for possible modes.
*/
#define kIOHIDPointerButtonMode "HIDPointerButtonMode"
#define kIOHIDPointerButtonModeKey kIOHIDPointerButtonMode
/*!
* @define kIOHIDUserUsageMapKey
*
* @abstract CFArray of dictionaries that contain user defined key mappings.
*/
#define kIOHIDUserKeyUsageMapKey "UserKeyMapping"
/*!
* @define kIOHIDKeyboardCapsLockDelayOverride
*
* @abstract CFNumber containing the delay (in ms) before the caps lock key is activated.
*/
#define kIOHIDKeyboardCapsLockDelayOverride "CapsLockDelayOverride"
#define kIOHIDKeyboardCapsLockDelayOverrideKey kIOHIDKeyboardCapsLockDelayOverride
/*!
* @define kIOHIDServiceEjectDelayKey
*
* @abstract CFNumber containing the delay (in ms) before the eject key is activated.
*/
#define kIOHIDServiceEjectDelayKey "EjectDelay"
/*!
* @define kIOHIDServiceLockKeyDelayKey
*
* @abstract CFNumber containing the delay (in ms) before the lock key is activated.
*/
#define kIOHIDServiceLockKeyDelayKey "LockKeyDelay"
/*!
* @define kIOHIDServiceInitialKeyRepeatDelayKey
*
* @abstract CFNumber containing the delay (in ns) before the initial key repeat.
* If value is 0, there are no repeats.
*/
#define kIOHIDServiceInitialKeyRepeatDelayKey "HIDInitialKeyRepeat"
/*!
* @define kIOHIDServiceKeyRepeatDelayKey
*
* @abstract CFNumber containing the delay (in ns) for subsequent key repeats.
* If value is 0, there are no repeats (including initial).
*/
#define kIOHIDServiceKeyRepeatDelayKey "HIDKeyRepeat"
/*!
* @define kIOHIDIdleTimeMicrosecondsKey
*
* @abstract CFNumber containing the HID idle time in microseconds.
*/
#define kIOHIDIdleTimeMicrosecondsKey "HIDIdleTimeMicroseconds"
/*!
* @define kIOHIDServiceCapsLockStateKey
*
* @abstract CFBoolean for setting/getting the caps lock state of the
* service. The caps lock LED will be updated to reflect the state.
*/
#define kIOHIDServiceCapsLockStateKey "HIDCapsLockState"
#endif /* IOHIDProperties_h */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hid/IOHIDDeviceTypes.h | /*
*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 2019 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef IOHIDDeviceTypes_h
#define IOHIDDeviceTypes_h
#include <TargetConditionals.h>
#if TARGET_OS_DRIVERKIT
#include <DriverKit/IOTypes.h>
#include <DriverKit/IOReturn.h>
#else
#include <IOKit/IOReturn.h>
#include <IOKit/IOTypes.h>
#endif // TARGET_OS_DRIVERKIT
/*!
* @typedef IOHIDReportType
*
* @abstract
* Describes different type of HID reports.
*/
enum IOHIDReportType {
kIOHIDReportTypeInput = 0,
kIOHIDReportTypeOutput,
kIOHIDReportTypeFeature,
kIOHIDReportTypeCount
};
typedef enum IOHIDReportType IOHIDReportType;
/*!
* @typedef IOHIDElementCommitDirection
*
* @abstract
* Commit direction passed in to the commit() function of an IOHIDElement.
*
* @field kIOHIDElementCommitDirectionIn
* Passing in kIOHIDElementCommitDirectionIn will issue a getReport call to the
* device, and the element will be updated with the value retrieved by the
* device. The value can be accessed via the getValue() or getDataValue()
* functions.
*
* @field kIOHIDElementCommitDirectionOut
* Passing in kIOHIDElementCommitDirectionOut will issue a setReport call to the
* device. Before issuing this call, the desired value should be set on the
* element with the setValue() or setDataValue() functions.
*/
typedef enum {
kIOHIDElementCommitDirectionIn,
kIOHIDElementCommitDirectionOut
} IOHIDElementCommitDirection;
/*!
* @typedef IOHIDElementCookie
*
* @abstract
* Abstract data type used as a unique identifier for an element.
*/
#if TARGET_OS_DRIVERKIT || defined(__LP64__)
typedef uint32_t IOHIDElementCookie;
#else
typedef void * IOHIDElementCookie;
#endif
/*!
* @typedef IOHIDElementType
*
* @abstract
* Describes different types of HID elements.
*
* @discussion
* Used by the IOHIDFamily to identify the type of element processed.
* Represented by the key kIOHIDElementTypeKey in the dictionary describing the
* element.
*
* @field kIOHIDElementTypeInput_Misc
* Misc input data field or varying size.
*
* @field kIOHIDElementTypeInput_Button
* One bit input data field.
*
* @field kIOHIDElementTypeInput_Axis
* Input data field used to represent an axis.
*
* @field kIOHIDElementTypeInput_ScanCodes
* Input data field used to represent a scan code or usage selector.
*
* @field kIOHIDElementTypeInput_NULL
* Input data field used to represent the end of an input report when receiving
* input elements.
*
* @field kIOHIDElementTypeOutput
* Used to represent an output data field in a report.
*
* @field kIOHIDElementTypeFeature
* Describes input and output elements not intended for consumption by the end
* user.
*
* @field kIOHIDElementTypeCollection
* Element used to identify a relationship between two or more elements.
*/
enum IOHIDElementType {
kIOHIDElementTypeInput_Misc = 1,
kIOHIDElementTypeInput_Button = 2,
kIOHIDElementTypeInput_Axis = 3,
kIOHIDElementTypeInput_ScanCodes = 4,
kIOHIDElementTypeInput_NULL = 5,
kIOHIDElementTypeOutput = 129,
kIOHIDElementTypeFeature = 257,
kIOHIDElementTypeCollection = 513
};
typedef enum IOHIDElementType IOHIDElementType;
enum {
kIOHIDElementFlagsConstantMask = 0x0001,
kIOHIDElementFlagsVariableMask = 0x0002,
kIOHIDElementFlagsRelativeMask = 0x0004,
kIOHIDElementFlagsWrapMask = 0x0008,
kIOHIDElementFlagsNonLinearMask = 0x0010,
kIOHIDElementFlagsNoPreferredMask = 0x0020,
kIOHIDElementFlagsNullStateMask = 0x0040,
kIOHIDElementFlagsVolativeMask = 0x0080,
kIOHIDElementFlagsBufferedByteMask = 0x0100
};
typedef uint32_t IOHIDElementFlags;
/*!
* @typedef IOHIDElementCollectionType
*
* @abstract
* Describes different types of HID collections.
*
* @discussion
* Collections identify a relationship between two or more elements.
*
* @field kIOHIDElementCollectionTypePhysical
* Used for a set of data items that represent data points collected at one
* geometric point.
*
* @field kIOHIDElementCollectionTypeApplication
* Identifies item groups serving different purposes in a single device.
*
* @field kIOHIDElementCollectionTypeLogical
* Used when a set of data items form a composite data structure.
*
* @field kIOHIDElementCollectionTypeReport
* Wraps all the fields in a report.
*
* @field kIOHIDElementCollectionTypeNamedArray
* Contains an array of selector usages.
*
* @field kIOHIDElementCollectionTypeUsageSwitch
* Modifies the meaning of the usage it contains.
*
* @field kIOHIDElementCollectionTypeUsageModifier
* Modifies the meaning of the usage attached to the encompassing collection.
*/
enum IOHIDElementCollectionType{
kIOHIDElementCollectionTypePhysical = 0x00,
kIOHIDElementCollectionTypeApplication,
kIOHIDElementCollectionTypeLogical,
kIOHIDElementCollectionTypeReport,
kIOHIDElementCollectionTypeNamedArray,
kIOHIDElementCollectionTypeUsageSwitch,
kIOHIDElementCollectionTypeUsageModifier
};
typedef enum IOHIDElementCollectionType IOHIDElementCollectionType;
/*!
* @typedef IOHIDValueScaleType
*
* @abstract
* Describes different types of scaling that can be performed on element values.
*
* @field kIOHIDValueScaleTypeCalibrated
* Type for value that is scaled with respect to the calibration properties.
*
* @field kIOHIDValueScaleTypePhysical
* Type for value that is scaled with respect to the physical min and physical
* max of the element.
*
* @field kIOHIDValueScaleTypeExponent
* Type for value that is scaled with respect to the element's unit exponent.
*/
enum {
kIOHIDValueScaleTypeCalibrated,
kIOHIDValueScaleTypePhysical,
kIOHIDValueScaleTypeExponent
};
typedef uint32_t IOHIDValueScaleType;
/*!
* @typedef IOHIDValueOptions
*
* @abstract
* Describes options for gathering element values.
*
* @field kIOHIDValueOptionsFlagRelativeSimple
* Compares against previous value
*
* @field kIOHIDValueOptionsUpdateElementValues
* Generates a get report before reading the element value when getting an element.
* Generates a set report with the passed value, even if it did not change, to the device when setting a value.
*/
enum {
kIOHIDValueOptionsFlagRelativeSimple = (1<<0),
kIOHIDValueOptionsFlagPrevious = (1<<1),
kIOHIDValueOptionsUpdateElementValues = (1<<2)
};
typedef uint32_t IOHIDValueOptions;
/*!
* @typedef IOHIDCompletionAction
*
* @abstract Function called when set/get report completes
*
* @param target
* The target specified in the IOHIDCompletion struct.
*
* @param parameter
* The parameter specified in the IOHIDCompletion struct.
*
* @param status
* Completion status
*/
typedef void (*IOHIDCompletionAction)(void *target,
void *parameter,
IOReturn status,
uint32_t bufferSizeRemaining);
/*!
* @typedef IOHIDCompletion
*
* @abstract
* Struct spefifying action to perform when set/get report completes.
*
* @var target
* The target to pass to the action function.
*
* @var action
* The function to call.
*
* @var parameter
* The parameter to pass to the action function.
*/
typedef struct IOHIDCompletion {
void *target;
IOHIDCompletionAction action;
void *parameter;
} IOHIDCompletion;
/*!
* @abstract
* Option bits for IOHIDDevice::handleReport, IOHIDDevice::getReport, and
* IOHIDDevice::setReport
*
* @field kIOHIDReportOptionNotInterrupt
* Tells method that the report passed was not interrupt driven.
*/
enum
{
kIOHIDReportOptionNotInterrupt = 0x100,
kIOHIDReportOptionVariableSize = 0x200
};
/*!
* @typedef HIDReportCommandType
*
* @abstract
* Type of the report command for DriverKit driver
*/
typedef enum {
kIOHIDReportCommandSetReport,
kIOHIDReportCommandGetReport
} HIDReportCommandType;
#endif /* IOHIDDeviceTypes_h */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hid/IOHIDEventServiceTypes.h | /*
*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 2019 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef IOHIDEventServiceTypes_h
#define IOHIDEventServiceTypes_h
/*!
* @typedef IOHIDKeyboardEventOptions
*
* @abstract
* Keyboard event options passed in to dispatchKeyboardEvent function in
* IOHIDEventService.
*
* @field kIOHIDKeyboardEventOptionsNoKeyRepeat
* Default behavior for keyboard events is to repeat keys if the key has been
* held down for a certain amount of time defined in system preferences. Pass
* in this option to not apply key repeat logic to this event.
*/
typedef enum {
kIOHIDKeyboardEventOptionsNoKeyRepeat = (1 << 8),
} IOHIDKeyboardEventOptions;
/*!
* @typedef IOHIDPointerEventOptions
*
* @abstract
* Pointer event options passed in to dispatch(Relative/Absolute)PointerEvent
* function in IOHIDEventService.
*
* @field kIOHIDPointerEventOptionsNoAcceleration
* Pointer events are subject to an acceleration algorithm. Pass in this option
* if you do not wish to have acceleration logic applied to the pointer event.
*/
typedef enum {
kIOHIDPointerEventOptionsNoAcceleration = (1 << 8),
} IOHIDPointerEventOptions;
/*!
* @typedef IOHIDScrollEventOptions
*
* @abstract
* Scroll event options passed in to dispatchScrollEvent function in
* IOHIDEventService.
*
* @field kIOHIDScrollEventOptionsNoAcceleration
* Scroll events are subject to an acceleration algorithm. Pass in this option
* if you do not wish to have acceleration logic applied to the scroll event.
*/
typedef enum {
kIOHIDScrollEventOptionsNoAcceleration = (1 << 8),
} IOHIDScrollEventOptions;
#endif /* IOHIDEventServiceTypes_h */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hid/IOHIDEventServiceKeys.h | /*
*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 2019 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef IOHIDEventServiceKeys_h
#define IOHIDEventServiceKeys_h
/*!
* @define kIOHIDPointerAccelerationKey
*
* @abstract
* Number property that contains the pointer acceleration value.
*/
#define kIOHIDPointerAccelerationKey "HIDPointerAcceleration"
/*!
* @define kIOHIDPointerAccelerationTypeKey
*
* @abstract
* String property containing the type of acceleration for pointer.
* Supported types are:
* <code>kIOHIDPointerAccelerationKey</code>
* <code>kIOHIDMouseScrollAccelerationKey</code>
* <code>kIOHIDTrackpadAccelerationType</code>
*/
#define kIOHIDPointerAccelerationTypeKey "HIDPointerAccelerationType"
/*!
* @define kIOHIDMouseScrollAccelerationKey
*
* @abstract
* Number property that contains the mouse scroll acceleration value.
*/
#define kIOHIDMouseScrollAccelerationKey "HIDMouseScrollAcceleration"
/*!
* @define kIOHIDMouseAccelerationTypeKey
*
* @abstract
* Number property that contains the mouse acceleration value.
*/
#define kIOHIDMouseAccelerationTypeKey "HIDMouseAcceleration"
/*!
* @define kIOHIDScrollAccelerationKey
*
* @abstract
* Number property that contains the scroll acceleration value.
*/
#define kIOHIDScrollAccelerationKey "HIDScrollAcceleration"
/*!
* @define kIOHIDScrollAccelerationTypeKey
*
* @abstract
* Number property containing the type of acceleration for scroll.
* Supported types are:
* <code>kIOHIDMouseScrollAccelerationKey</code>
* <code>kIOHIDTrackpadScrollAccelerationKey</code>
*/
#define kIOHIDScrollAccelerationTypeKey "HIDScrollAccelerationType"
/*!
* @define kIOHIDDigitizerTipThresholdKey
*
* @abstract
* Number property that describes the threshold percentage for when the tip
* pressure of a digitizer stylus should change from hovering to dragging.
*
* @discussion
* If a digitizer stylus supports the kHIDUsage_Dig_TipPressure (0x30) usage,
* the service may optionally publish this key to describe the value at which
* the pressure should change the pointer behavior from hovering to dragging.
* The value is a percentage from 0 to 100, where 100 percent is equal to the
* logical max that the stylus dispatches. If no value is provided, the default
* value of 75 will be used.
*/
#define kIOHIDDigitizerTipThresholdKey "DigitizerTipThreshold"
/*!
* @define kIOHIDSurfaceDimensionsKey
*
* @abstract
* Dictionary property published on a service that describes the surface
* dimensions for services that publish absolute X/Y values, such as digitizer
* and pointer devices. The dictionary will contain the kIOHIDWidthKey and
* kIOHIDHeightKey keys described below. Value is in millimeter represented
* as IOFixed.
*/
#define kIOHIDSurfaceDimensionsKey "SurfaceDimensions"
/*!
* @define kIOHIDWidthKey
*
* @abstract
* Number property used in the surface dimensions dictionary described above.
* Default value represents the physical max - physical min of the absolute
* X value.
*/
#define kIOHIDWidthKey "Width"
/*!
* @define kIOHIDHeightKey
*
* @abstract
* Number property used in the surface dimensions dictionary described above.
* Default value represents the physical max - physical min of the absolute
* Y value.
*/
#define kIOHIDHeightKey "Height"
/*!
* @define kIOHIDEventDriverHandlesReport
*
* @abstract
* Boolean property used to let handleReport in an IOUserHIDEventDriver get the
* report before any other processing is done in IOUserHIDEventService.
* If this property is enabled the IOUserHIDEventService subclass should update
* the elements with IOHIDInterface::processReport to update the IOHIDElements as
* IOUserHIDEventService will not do this like when this property is not set.
*/
#define kIOHIDEventDriverHandlesReport "IOHIDEventDriverHandlesReport"
#endif /* IOHIDDeviceTypes_h */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hid/IOHIDElement.h | /*
*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_HID_IOHIDELEMENT_H
#define _IOKIT_HID_IOHIDELEMENT_H
#include <libkern/c++/OSArray.h>
#include <libkern/c++/OSData.h>
#include <IOKit/hid/IOHIDKeys.h>
//===========================================================================
// An object that describes a single HID element.
#if defined(KERNEL) && !defined(KERNEL_PRIVATE)
class __deprecated_msg("Use DriverKit") IOHIDElement : public OSCollection
#else
class IOHIDElement : public OSCollection
#endif
{
OSDeclareAbstractStructors( IOHIDElement )
/* Internal use only */
struct ExpansionData {
};
ExpansionData * _reserved;
public:
virtual IOHIDElementCookie getCookie() = 0;
virtual IOHIDElement * getParentElement() = 0;
virtual OSArray * getChildElements() = 0;
virtual IOHIDElementType getType() = 0;
virtual IOHIDElementCollectionType getCollectionType() = 0;
virtual UInt32 getUsagePage() = 0;
virtual UInt32 getUsage() = 0;
virtual UInt32 getLogicalMin() = 0;
virtual UInt32 getLogicalMax() = 0;
virtual UInt32 getPhysicalMin() = 0;
virtual UInt32 getPhysicalMax() = 0;
virtual UInt32 getUnitExponent() = 0;
virtual UInt32 getUnit() = 0;
virtual UInt32 getReportSize() = 0;
virtual UInt32 getReportCount() = 0;
virtual UInt32 getReportID() = 0;
virtual UInt32 getFlags() = 0;
virtual AbsoluteTime getTimeStamp() = 0;
virtual UInt32 getValue() = 0;
virtual OSData * getDataValue() = 0;
virtual void setValue(UInt32 value) = 0;
virtual void setDataValue(OSData * value) = 0;
OSMetaClassDeclareReservedUsed(IOHIDElement, 0);
virtual bool conformsTo(UInt32 usagePage, UInt32 usage=0) = 0;
OSMetaClassDeclareReservedUsed(IOHIDElement, 1);
virtual void setCalibration(UInt32 min=0, UInt32 max=0, UInt32 saturationMin=0, UInt32 saturationMax=0, UInt32 deadZoneMin=0, UInt32 deadZoneMax=0, IOFixed granularity=0) = 0;
OSMetaClassDeclareReservedUsed(IOHIDElement, 2);
virtual UInt32 getScaledValue(IOHIDValueScaleType type=kIOHIDValueScaleTypePhysical) = 0;
OSMetaClassDeclareReservedUsed(IOHIDElement, 3);
virtual IOFixed getScaledFixedValue(IOHIDValueScaleType type=kIOHIDValueScaleTypePhysical) = 0;
OSMetaClassDeclareReservedUsed(IOHIDElement, 4);
virtual UInt32 getValue(IOOptionBits options) = 0;
OSMetaClassDeclareReservedUsed(IOHIDElement, 5);
virtual OSData * getDataValue(IOOptionBits options) = 0;
OSMetaClassDeclareReservedUsed(IOHIDElement, 6);
virtual boolean_t isVariableSize() = 0;
OSMetaClassDeclareReservedUsed(IOHIDElement, 7);
virtual IOFixed getScaledFixedValue(IOHIDValueScaleType type, IOOptionBits options) = 0;
OSMetaClassDeclareReservedUsed(IOHIDElement, 8);
virtual void setValue(UInt32 value, IOOptionBits options) = 0;
OSMetaClassDeclareReservedUnused(IOHIDElement, 9);
OSMetaClassDeclareReservedUnused(IOHIDElement, 10);
OSMetaClassDeclareReservedUnused(IOHIDElement, 11);
OSMetaClassDeclareReservedUnused(IOHIDElement, 12);
OSMetaClassDeclareReservedUnused(IOHIDElement, 13);
OSMetaClassDeclareReservedUnused(IOHIDElement, 14);
OSMetaClassDeclareReservedUnused(IOHIDElement, 15);
OSMetaClassDeclareReservedUnused(IOHIDElement, 16);
OSMetaClassDeclareReservedUnused(IOHIDElement, 17);
OSMetaClassDeclareReservedUnused(IOHIDElement, 18);
OSMetaClassDeclareReservedUnused(IOHIDElement, 19);
OSMetaClassDeclareReservedUnused(IOHIDElement, 20);
OSMetaClassDeclareReservedUnused(IOHIDElement, 21);
OSMetaClassDeclareReservedUnused(IOHIDElement, 22);
OSMetaClassDeclareReservedUnused(IOHIDElement, 23);
OSMetaClassDeclareReservedUnused(IOHIDElement, 24);
OSMetaClassDeclareReservedUnused(IOHIDElement, 25);
OSMetaClassDeclareReservedUnused(IOHIDElement, 26);
OSMetaClassDeclareReservedUnused(IOHIDElement, 27);
OSMetaClassDeclareReservedUnused(IOHIDElement, 28);
OSMetaClassDeclareReservedUnused(IOHIDElement, 29);
OSMetaClassDeclareReservedUnused(IOHIDElement, 30);
OSMetaClassDeclareReservedUnused(IOHIDElement, 31);
};
#endif /* !_IOKIT_HID_IOHIDELEMENT_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/acpi/IOACPIPlatformExpert.h | /*
* Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOACPIPLATFORMEXPERT_H
#define _IOKIT_IOACPIPLATFORMEXPERT_H
#include <IOKit/IOPlatformExpert.h> // superclass
#include <IOKit/acpi/IOACPIPlatformDevice.h> // children
class __exported IOACPIPlatformExpert : public IODTPlatformExpert
{
OSDeclareAbstractStructors( IOACPIPlatformExpert )
friend class IOACPIPlatformDevice;
protected:
/*! @struct ExpansionData
@discussion This structure will be used to expand the capablilties
of the class in the future.
*/
struct ExpansionData { };
/*! @var reserved
Reserved for future use. (Internal use only)
*/
ExpansionData * reserved;
public:
virtual bool start( IOService * provider ) APPLE_KEXT_OVERRIDE;
protected:
// Map ACPI event to interrupt event source index
virtual SInt32 installDeviceInterruptForFixedEvent(
IOService * device,
UInt32 fixedEvent ) = 0;
virtual SInt32 installDeviceInterruptForGPE(
IOService * device,
UInt32 gpeNumber,
void * gpeBlockDevice,
IOOptionBits options ) = 0;
// ACPI global lock acquisition
virtual IOReturn acquireGlobalLock( IOService * client,
UInt32 * lockToken,
const mach_timespec_t * timeout ) = 0;
virtual void releaseGlobalLock( IOService * client,
UInt32 lockToken ) = 0;
// ACPI method and object evaluation
virtual IOReturn validateObject( IOACPIPlatformDevice * device,
const OSSymbol * objectName ) = 0;
virtual IOReturn validateObject( IOACPIPlatformDevice * device,
const char * objectName );
virtual IOReturn evaluateObject( IOACPIPlatformDevice * device,
const OSSymbol * objectName,
OSObject ** result,
OSObject * params[],
IOItemCount paramCount,
IOOptionBits options ) = 0;
virtual IOReturn evaluateObject( IOACPIPlatformDevice * device,
const char * objectName,
OSObject ** result,
OSObject * params[],
IOItemCount paramCount,
IOOptionBits options );
// ACPI table
virtual const OSData * getACPITableData(
const char * tableName,
UInt32 tableInstance ) = 0;
// Address space handler
virtual IOReturn registerAddressSpaceHandler(
IOACPIPlatformDevice * device,
IOACPIAddressSpaceID spaceID,
IOACPIAddressSpaceHandler handler,
void * context,
IOOptionBits options ) = 0;
virtual void unregisterAddressSpaceHandler(
IOACPIPlatformDevice * device,
IOACPIAddressSpaceID spaceID,
IOACPIAddressSpaceHandler handler,
IOOptionBits options ) = 0;
// Address space read/write
virtual IOReturn readAddressSpace( UInt64 * value,
IOACPIAddressSpaceID spaceID,
IOACPIAddress address,
UInt32 bitWidth,
UInt32 bitOffset,
IOOptionBits options ) = 0;
virtual IOReturn writeAddressSpace( UInt64 value,
IOACPIAddressSpaceID spaceID,
IOACPIAddress address,
UInt32 bitWidth,
UInt32 bitOffset,
IOOptionBits options ) = 0;
// Device power management
virtual IOReturn setDevicePowerState( IOACPIPlatformDevice * device,
UInt32 powerState ) = 0;
virtual IOReturn getDevicePowerState( IOACPIPlatformDevice * device,
UInt32 * powerState ) = 0;
virtual IOReturn setDeviceWakeEnable( IOACPIPlatformDevice * device,
bool enable ) = 0;
// vtable padding
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 0 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 1 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 2 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 3 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 4 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 5 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 6 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 7 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 8 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 9 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 10 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 11 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 12 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 13 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 14 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 15 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 16 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 17 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 18 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 19 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 20 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 21 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 22 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 23 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 24 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 25 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 26 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 27 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 28 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 29 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 30 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 31 );
};
#endif /* !_IOKIT_IOACPIPLATFORMEXPERT_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/acpi/IOACPIPlatformDevice.h | /*
* Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOACPIPLATFORMDEVICE_H
#define _IOKIT_IOACPIPLATFORMDEVICE_H
#include <libkern/c++/OSContainers.h>
#include <IOKit/IOPlatformExpert.h>
#include <IOKit/acpi/IOACPITypes.h>
class IOACPIPlatformExpert;
class __exported IOACPIPlatformDevice : public IOPlatformDevice
{
OSDeclareDefaultStructors( IOACPIPlatformDevice )
protected:
void * _deviceHandle;
UInt32 _deviceType;
UInt32 _powerFlags;
UInt32 * _powerStateFlags;
UInt32 _sleepPowerState;
IOService * _acpiParent;
IOACPIPlatformExpert * _platform;
/*
* This structure will be used to expand the capablilties
* of the class in the future.
*/
struct ExpansionData { };
/*
* Reserved for future use. (Internal use only)
*/
ExpansionData * reserved;
virtual bool initACPIPowerManagement( IOService * powerParent );
virtual void stopACPIPowerManagement( IOService * powerParent );
public:
virtual bool init( IOService * platform,
void * handle,
OSDictionary * properties );
virtual void free( void ) APPLE_KEXT_OVERRIDE;
virtual bool attachToParent( IORegistryEntry * parent,
const IORegistryPlane * plane ) APPLE_KEXT_OVERRIDE;
virtual void detachFromParent( IORegistryEntry * parent,
const IORegistryPlane * plane ) APPLE_KEXT_OVERRIDE;
virtual bool getPathComponent( char * path, int * length,
const IORegistryPlane * plane ) const APPLE_KEXT_OVERRIDE;
virtual bool compareName( OSString * name,
OSString ** matched ) const APPLE_KEXT_OVERRIDE;
virtual IOReturn getResources( void ) APPLE_KEXT_OVERRIDE;
virtual void * getDeviceHandle( void ) const;
virtual UInt32 getDeviceStatus( void ) const;
enum {
kTypeDevice = 0,
kTypeProcessor = 1,
kTypePowerResource = 2
};
virtual UInt32 getDeviceType( void ) const;
virtual void setDeviceType( UInt32 deviceType );
// Method (object) evaluation
virtual IOReturn validateObject( const OSSymbol * objectName );
virtual IOReturn validateObject( const char * objectName );
virtual IOReturn evaluateObject( const OSSymbol * objectName,
OSObject ** result = 0,
OSObject * params[] = 0,
IOItemCount paramCount = 0,
IOOptionBits options = 0 );
virtual IOReturn evaluateObject( const char * objectName,
OSObject ** result = 0,
OSObject * params[] = 0,
IOItemCount paramCount = 0,
IOOptionBits options = 0 );
virtual IOReturn evaluateInteger( const OSSymbol * objectName,
UInt32 * resultInt32,
OSObject * params[] = 0,
IOItemCount paramCount = 0,
IOOptionBits options = 0 );
virtual IOReturn evaluateInteger( const char * objectName,
UInt32 * resultInt32,
OSObject * params[] = 0,
IOItemCount paramCount = 0,
IOOptionBits options = 0 );
virtual IOReturn evaluateInteger( const OSSymbol * objectName,
UInt64 * resultInt64,
OSObject * params[] = 0,
IOItemCount paramCount = 0,
IOOptionBits options = 0 );
virtual IOReturn evaluateInteger( const char * objectName,
UInt64 * resultInt64,
OSObject * params[] = 0,
IOItemCount paramCount = 0,
IOOptionBits options = 0 );
// ACPI table access
virtual const OSData * getACPITableData( const char * tableName,
UInt32 tableInstance = 0 ) const;
// Map ACPI event to interrupt event source index
virtual SInt32 installInterruptForFixedEvent( UInt32 fixedEvent );
virtual SInt32 installInterruptForGPE( UInt32 gpeNumber,
void * gpeBlockDevice = 0,
IOOptionBits options = 0 );
// ACPI global lock acquire/release
virtual IOReturn acquireGlobalLock( UInt32 * lockToken,
const mach_timespec_t * timeout = 0 );
virtual void releaseGlobalLock( UInt32 lockToken );
// Address space handler registration
virtual IOReturn registerAddressSpaceHandler(
IOACPIAddressSpaceID spaceID,
IOACPIAddressSpaceHandler handler,
void * context,
IOOptionBits options = 0 );
virtual void unregisterAddressSpaceHandler(
IOACPIAddressSpaceID spaceID,
IOACPIAddressSpaceHandler handler,
IOOptionBits options = 0 );
// Address space access
virtual IOReturn readAddressSpace( UInt64 * value,
IOACPIAddressSpaceID spaceID,
IOACPIAddress address,
UInt32 bitWidth,
UInt32 bitOffset = 0,
IOOptionBits options = 0 );
virtual IOReturn writeAddressSpace( UInt64 value,
IOACPIAddressSpaceID spaceID,
IOACPIAddress address,
UInt32 bitWidth,
UInt32 bitOffset = 0,
IOOptionBits options = 0 );
// Power management
virtual bool hasSystemWakeCapability( void ) const;
virtual IOReturn setSystemWakeCapabilityEnable( bool enable );
virtual bool hasACPIPowerStateSupport( UInt32 powerState ) const;
virtual IOReturn setACPIPowerManagementEnable(
bool enable,
UInt32 powerState = kIOACPIDevicePowerStateD3,
IOOptionBits options = 0 );
virtual IOReturn setPowerState( unsigned long powerState,
IOService * whatDevice ) APPLE_KEXT_OVERRIDE;
// I/O space helpers
virtual void ioWrite32( UInt16 offset, UInt32 value,
IOMemoryMap * map = 0 );
virtual void ioWrite16( UInt16 offset, UInt16 value,
IOMemoryMap * map = 0 );
virtual void ioWrite8( UInt16 offset, UInt8 value,
IOMemoryMap * map = 0 );
virtual UInt32 ioRead32( UInt16 offset, IOMemoryMap * map = 0 );
virtual UInt16 ioRead16( UInt16 offset, IOMemoryMap * map = 0 );
virtual UInt8 ioRead8( UInt16 offset, IOMemoryMap * map = 0 );
// vtable padding
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 0 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 1 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 2 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 3 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 4 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 5 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 6 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 7 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 8 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 9 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 10 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 11 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 12 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 13 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 14 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 15 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 16 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 17 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 18 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 19 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 20 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 21 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 22 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 23 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 24 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 25 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 26 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 27 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 28 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 29 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 30 );
OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 31 );
};
#endif /* !_IOKIT_IOACPIPLATFORMDEVICE_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/acpi/IOACPITypes.h | /*
* Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef __IOKIT_IOACPITYPES_H
#define __IOKIT_IOACPITYPES_H
#include <IOKit/IOMessage.h>
extern const IORegistryPlane * gIOACPIPlane;
extern const OSSymbol * gIOACPIHardwareIDKey;
extern const OSSymbol * gIOACPIUniqueIDKey;
extern const OSSymbol * gIOACPIAddressKey;
extern const OSSymbol * gIOACPIDeviceStatusKey;
#define kIOACPIInterruptTypeValid (1 << 1)
#pragma pack(1)
struct IOACPIAddressSpaceDescriptor {
UInt32 resourceType;
UInt32 generalFlags;
UInt32 typeSpecificFlags;
UInt32 reserved1;
UInt64 granularity;
UInt64 minAddressRange;
UInt64 maxAddressRange;
UInt64 translationOffset;
UInt64 addressLength;
UInt64 reserved2;
UInt64 reserved3;
UInt64 reserved4;
};
enum {
kIOACPIMemoryRange = 0,
kIOACPIIORange = 1,
kIOACPIBusNumberRange = 2
};
typedef UInt32 IOACPIAddressSpaceID;
enum {
kIOACPIAddressSpaceIDSystemMemory = 0,
kIOACPIAddressSpaceIDSystemIO = 1,
kIOACPIAddressSpaceIDPCIConfiguration = 2,
kIOACPIAddressSpaceIDEmbeddedController = 3,
kIOACPIAddressSpaceIDSMBus = 4
};
/*
* Address space operation
*/
enum {
kIOACPIAddressSpaceOpRead = 0,
kIOACPIAddressSpaceOpWrite = 1
};
/*
* 64-bit ACPI address
*/
union IOACPIAddress {
UInt64 addr64;
struct {
unsigned int offset :16;
unsigned int function :3;
unsigned int device :5;
unsigned int bus :8;
unsigned int segment :16;
unsigned int reserved :16;
} pci;
};
/*
* Address space handler
*/
typedef IOReturn (*IOACPIAddressSpaceHandler)( UInt32 operation,
IOACPIAddress address,
UInt64 * value,
UInt32 bitWidth,
UInt32 bitOffset,
void * context );
/*
* ACPI fixed event types
*/
enum {
kIOACPIFixedEventPMTimer = 0,
kIOACPIFixedEventPowerButton = 2,
kIOACPIFixedEventSleepButton = 3,
kIOACPIFixedEventRealTimeClock = 4
};
#pragma pack()
/*
* FIXME: Move to xnu/iokit to reserve the ACPI family code.
*/
#ifndef sub_iokit_acpi
#define sub_iokit_acpi err_sub(10)
#endif
/*
* ACPI notify message sent to all clients and interested parties.
* The notify code can be read from the argument as an UInt32.
*/
#define kIOACPIMessageDeviceNotification iokit_family_msg(sub_iokit_acpi, 0x10)
/*
* ACPI device power states
*/
enum {
kIOACPIDevicePowerStateD0 = 0,
kIOACPIDevicePowerStateD1 = 1,
kIOACPIDevicePowerStateD2 = 2,
kIOACPIDevicePowerStateD3 = 3,
kIOACPIDevicePowerStateCount = 4
};
#endif /* !__IOKIT_IOACPITYPES_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/power/IOPwrController.h | /*
* Copyright (c) 1998-2019 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
/*
* 24 Nov 1998 suurballe Created.
*/
#include <IOKit/IOService.h>
class IOPwrController : public IOService
{
OSDeclareAbstractStructors(IOPwrController);
public:
};
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/system_management/IOWatchDogTimer.h | /*
* Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#ifndef _IOWATCHDOGTIMER_H
#define _IOWATCHDOGTIMER_H
#include <IOKit/IOService.h>
class IOWatchDogTimer : public IOService
{
OSDeclareAbstractStructors(IOWatchDogTimer);
protected:
IONotifier *notifier;
struct ExpansionData { };
APPLE_KEXT_WSHADOW_PUSH;
ExpansionData *reserved;
APPLE_KEXT_WSHADOW_POP;
public:
virtual bool start(IOService *provider) APPLE_KEXT_OVERRIDE;
virtual void stop(IOService *provider) APPLE_KEXT_OVERRIDE;
virtual IOReturn setProperties(OSObject *properties) APPLE_KEXT_OVERRIDE;
virtual void setWatchDogTimer(UInt32 timeOut) = 0;
OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 0);
OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 1);
OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 2);
OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 3);
};
#endif /* !_IOWATCHDOGTIMER_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/video/IOVideoDeviceLib.h | /*
File: IOVideoDeviceLib.h
Contains: IOCFPlugin library for using IOVideoDevice objects.
The IOVideoDevice plugin provides a convenient set of functions for accessing and manipulating IOVideoDevice objects from user programs.
Copyright: © 2006-2012 by Apple Inc., all rights reserved.
*/
#if !defined(__IOKIT_IOVIDEODEVICELIB_H)
#define __IOKIT_IOVIDEODEVICELIB_H
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/IOCFPlugIn.h>
#include <IOKit/stream/IOStreamLib.h>
#include <IOKit/stream/IOStreamShared.h>
#include <IOKit/video/IOVideoDeviceShared.h>
#include <IOKit/video/IOVideoTypes.h>
__BEGIN_DECLS
#pragma mark IOVideo UUIDs
/*!
@defined kIOVideoDeviceLibTypeID
@discussion This is the UUID of the plug-in type (5339633C-F903-4212-9C90-9B18AF01862D).
*/
#define kIOVideoDeviceLibTypeID CFUUIDGetConstantUUIDWithBytes(kCFAllocatorDefault, 0x53, 0x39, 0x63, 0x3C, 0xF9, 0x03, 0x42, 0x12, 0x9C, 0x90, 0x9B, 0x18, 0xAF, 0x01, 0x86, 0x2D)
/*!
@defined kIOVideoDeviceInterfaceID_v1
@discussion This is the UUID of version 1 of the plug-in interface (080E3-5106-4D16-B70C-B3216F13CDB9A).
*/
#define kIOVideoDeviceInterfaceID_v1 CFUUIDGetConstantUUIDWithBytes(kCFAllocatorDefault, 0x0D, 0xE0, 0x80, 0xE3, 0x51, 0x06, 0x4D, 0x16, 0xB7, 0x0C, 0xB3, 0x21, 0x6F, 0x13, 0xCD, 0xB9)
#define kIOVideoDeviceInterfaceID kIOVideoDeviceInterfaceID_v1
typedef struct IOVideoDeviceInterface_v1_t IOVideoDeviceInterface_v1_t;
/*!
@typedef IOVideoDeviceRef
*/
typedef IOVideoDeviceInterface_v1_t** IOVideoDeviceRef;
/*!
@typedef IOVideoDeviceOutputCallback
*/
typedef void (*IOVideoDeviceOutputCallback)( IOVideoDeviceRef stream,
void* context);
/*!
@typedef IOVideoDeviceNotificationCallback
*/
typedef void (*IOVideoDeviceNotificationCallback)( IOVideoDeviceRef device,
void* context,
void* message);
/*!
@interface IOVideoDeviceInterface
@abstract Interface for accessing kernel-space video drivers from user space.
*/
typedef struct IOVideoDeviceInterface_v1_t
{
IUNKNOWN_C_GUTS;
UInt32 Version;
UInt32 Revision;
/*!
@functiongroup Opening and closing VideoDevices
*/
/*!
@function Open
@abstract Open an IOVideoDevice from user space.
@discussion The Open function opens the device.
@param device
The IOVideoDeviceRef to the device returned by QueryInterface.
@param options
Open options. Currently unused.
@result If the device could not be opened an error will be returned.
*/
IOReturn
(*Open)(IOVideoDeviceRef device, IOOptionBits options);
/*!
@function Close
@abstract Closes an IOVideoDevice.
@discussion Calling Close frees all streams belonging to the device and frees all user resources used by the device.
@param device
The IOVideoDeviceRef of the device to close.
@result Returns kIOReturnSuccess if the device was successfully closed.
*/
IOReturn
(*Close)(IOVideoDeviceRef device);
/*!
@function GetNotificationPort
@abstract Get the notification port for device state changes sent to user space.
@param device
The IOVideoDeviceRef of the stream to operate on.
@result A CFMachPortRef of the output notification port.
*/
CFMachPortRef
(*GetNotificationPort)(IOVideoDeviceRef device);
/*!
@function SetNotificationCallback
@abstract Set the callback function to be called when certain device state changes happen.
@param device
The IOVideoDeviceRef of the device to operate on. Pass NULL to remove the callback.
@result Returns kIOReturnSuccess if the callback was successfully set or removed.
*/
IOReturn
(*SetNotificationCallback)( IOVideoDeviceRef device,
IOVideoDeviceNotificationCallback callback,
void* context);
/*!
@function SetControlValue
@param device
@param controlID
@param newValue
@result Returns kIOReturnSuccess if the call was successfully.
*/
IOReturn
(*SetControlValue)( IOVideoDeviceRef device,
UInt32 controlID,
UInt32 value,
UInt32* newValue);
/*!
@function SetStreamFormat
@param device
@param streamID
@param streamFormat
@result Returns kIOReturnSuccess if the call was successfully.
*/
IOReturn
(*SetStreamFormat)( IOVideoDeviceRef device,
UInt32 streamID,
IOVideoStreamDescription* streamFormat);
/*!
@function GetRunLoopSource
@abstract Gets a CFRunLoopSource for the CFMachPort used for notifications from the kernel that data is ready.
@param device
The IOVideoDeviceRef of the stream to operate on.
@result The CFRunLoopSourceRef for the run loop source, or NULL if there was an error creating the source.
*/
CFRunLoopSourceRef
(*GetRunLoopSource)(IOVideoDeviceRef device);
/*!
@function AddToRunLoop
@abstract Add the CFRunLoopSource for the notification port to a run loop.
@param device
The IOVideoDeviceRef of the device to operate on.
@param runLoop
The run loop to which to add the notification source.
@result Returns kIOReturnSuccess if the source was successfully added to the run loop.
*/
IOReturn
(*AddToRunLoop)( IOVideoDeviceRef device,
CFRunLoopRef runLoop);
/*!
@function RemoveFromRunLoop
@abstract Remove the CFRunLoopSource for the notification port from a run loop.
@param device
The IOVideoDeviceRef of the device to operate on.
@param runLoop
The run loop from which to remove the notification source.
@result Returns kIOReturnSuccess if the source was successfully removed from the run loop.
*/
IOReturn
(*RemoveFromRunLoop)( IOVideoDeviceRef device,
CFRunLoopRef runLoop);
/*!
@function CreateStreamInterface
@param device
The IOVideoDeviceRef of the device to operate on.
@param streamDictionary
@param streamIndex
@param isInput
@result Returns kIOReturnSuccess if the stream was successfully created.
*/
IOReturn
(*CreateStreamInterface)( IOVideoDeviceRef device,
CFDictionaryRef streamDictionary,
UInt32 streamIndex,
bool isInput,
IOStreamRef* streamRef);
/*!
@function ReleaseStreamInterface
@param device
The IOVideoDeviceRef of the device to operate on.
@param isInput
@param streamRef
@result Returns kIOReturnSuccess if the stream was successfully released.
*/
IOReturn
(*ReleaseStreamInterface)( IOVideoDeviceRef device,
bool isInput,
IOStreamRef* streamRef);
} IOVideoDeviceInterface;
__END_DECLS
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/video/IOVideoStreamFormatDictionary.h | /*
File: IOVideoStreamFormat.h
Contains:
Copyright: © 2006-2012 by Apple Inc., all rights reserved.
*/
#if !defined(__IOVideoStreamFormat_h__)
#define __IOVideoStreamFormat_h__
// System Includes
#include <IOKit/video/IOVideoTypes.h>
class OSDictionary;
class IOVideoStreamFormatDictionary
{
public:
static OSDictionary* create(UInt32 codecType, UInt32 codecFlags, UInt32 width, UInt32 height);
static OSDictionary* createWithDescription(const IOVideoStreamDescription& format);
// Attributes
public:
static UInt32 getCodecType(const OSDictionary* dictionary);
static void setCodecType(OSDictionary* dictionary, UInt32 codecType);
static UInt32 getCodecFlags(const OSDictionary* dictionary);
static void setCodecFlags(OSDictionary* dictionary, UInt32 codecFlags);
static UInt32 getWidth(const OSDictionary* dictionary);
static void setWidth(OSDictionary* dictionary, UInt32 width);
static UInt32 getHeight(const OSDictionary* dictionary);
static void setHeight(OSDictionary* dictionary, UInt32 height);
static void getDescription(const OSDictionary* dictionary, IOVideoStreamDescription& format);
static void printDescription(const IOVideoStreamDescription& format);
static void printDictionary(const OSDictionary* dictionary);
static bool isSameSampleFormat(const IOVideoStreamDescription& format1, const IOVideoStreamDescription& format2);
};
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/video/IOVideoDevice.h | /*
File: IOVideoDevice.h
Contains:
Copyright: © 2006-2013 by Apple Inc., all rights reserved.
*/
#if !defined(__IOKIT_IOVIDEODEVICE_H)
#define __IOKIT_IOVIDEODEVICE_H
#include <IOKit/IOService.h>
#include <IOKit/video/IOVideoTypes.h>
#include <IOKit/stream/IOStreamShared.h>
class IOVideoStream;
/*!
@class IOVideoDevice
@abstract A class representing a video device.
@discussion The IOVideoDevice class defines a mechanism for accessing the IOVideoStreams that a device presents.
Although it is expected that the client of an IOVideoDevice will be in user space, this is not required.
*/
class IOVideoDevice : public IOService
{
// Construction/Destruction
OSDeclareDefaultStructors(IOVideoDevice);
public:
virtual bool init(OSDictionary* properties);
virtual void free(void);
/*!
@function newUserClient
@abstract See the documentation for the IOService method newUserClient.
*/
virtual IOReturn newUserClient(task_t owningTask, void* securityID, UInt32 type, OSDictionary* properties, IOUserClient** handler);
/*!
@function getStreamCount
@result Returns the number of streams of the device.
*/
virtual int getStreamCount(void);
/*!
@function getStream
@param streamIndex
The index for which the underlying stream is desired.
@result Returns the number of streams of the device.
*/
virtual IOVideoStream* getStream(UInt32 streamIndex);
/*!
@function startStream
@abstract Start sending data on a stream.
@result Returns kIOReturnSuccess if the stream was successfully started.
@discussion This must be implemented by a subclass.
*/
virtual IOReturn startStream(IOVideoStream* stream);
/*!
@function stopStream
@abstract Stop sending data on a stream.
@result Returns kIOReturnSuccess if the stream was successfully started.
@discussion This must be implemented by a subclass.
*/
virtual IOReturn stopStream(IOVideoStream* stream);
/*!
@function suspendStream
@abstract Temporarily suspend data flow on the stream.
@result Returns kIOReturnSuccess if the stream was successfully suspended.
@discussion This must be implemented by a subclass.
*/
virtual IOReturn suspendStream(IOVideoStream* stream);
/*!
@function setStreamMode
@abstract Sets the mode of the stream, either input or output.
@discussion This must be implemented by a subclass.
*/
virtual IOReturn setStreamMode(IOVideoStream* stream, IOStreamMode mode);
virtual IOReturn openStream(UInt32 streamIndex);
virtual IOReturn closeStream(UInt32 streamIndex);
virtual IOReturn startStream(UInt32 streamIndex);
virtual IOReturn stopStream(UInt32 streamIndex);
virtual IOReturn suspendStream(UInt32 streamIndex);
virtual IOReturn releaseStreams(void);
virtual void inputCallback(UInt32 token);
virtual void inputSyncCallback(UInt32 token);
virtual IOReturn registerNotificationPort(mach_port_t port, UInt32 type, UInt32 clientData);
virtual void sendSingleNotification(UInt32 notificationID, UInt32 objectID, UInt32 notificationArgument1, UInt32 notificationArgument2, UInt64 notificationArgument3, UInt64 notificationArgument4);
virtual void sendMultiNotification(UInt32 numberNotifications, const IOVideoDeviceNotification* notifications);
virtual IOReturn setStreamFormat(UInt32 streamID, const IOVideoStreamDescription* newStreamFormat);
// Control methods
virtual IOReturn setControlValue(UInt32 controlID, UInt32 value, UInt32* newValue);
protected:
virtual IOReturn addStream(IOVideoStream* stream);
virtual IOReturn removeStream(UInt32 streamIndex);
OSArray* mStreams;
IOVideoDeviceNotificationMessage* mNotificationMessage;
UInt32 mMaxNumberNotifications;
UInt32 mOutstandingConfigChangeRequests;
// Future Expansion
public:
OSMetaClassDeclareReservedUnused(IOVideoDevice, 0);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 1);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 2);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 3);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 4);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 5);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 6);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 7);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 8);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 9);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 10);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 11);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 12);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 13);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 14);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 15);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 16);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 17);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 18);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 19);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 20);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 21);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 22);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 23);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 24);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 25);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 26);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 27);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 28);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 29);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 30);
OSMetaClassDeclareReservedUnused(IOVideoDevice, 31);
protected:
struct ExpansionData {};
ExpansionData *mReserved;
};
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/video/IOVideoStreamDictionary.h | /*
File: IOVideoStreamDictionary.h
Contains:
Copyright: © 2006-2012 by Apple Inc., all rights reserved.
*/
#if !defined(__IOVideoStreamDictionary_h__)
#define __IOVideoStreamDictionary_h__
// System Includes
#include <IOKit/video/IOVideoTypes.h>
class OSArray;
class OSDictionary;
class IOVideoStreamDictionary
{
// Construction/Destruction
public:
static OSDictionary* create(UInt32 streamID, UInt32 startingDeviceChannelNumber, const OSDictionary* currentFormat, OSArray* availableFormats = NULL);
// Attributes
public:
static UInt32 getStreamID(const OSDictionary* dictionary);
static void setStreamID(OSDictionary* dictionary, UInt32 streamID);
static UInt32 getStartingDeviceChannelNumber(const OSDictionary* dictionary);
static void setStartingDeviceChannelNumber(OSDictionary* dictionary, UInt32 startingDeviceChannelNumber);
static IOOptionBits getBufferMappingOptions(const OSDictionary* dictionary);
static void setBufferMappingOptions(OSDictionary* dictionary, IOOptionBits bufferMappingOptions);
static bool getCurrentFormat(const OSDictionary* dictionary, IOVideoStreamDescription& format);
static void setCurrentFormat(OSDictionary* dictionary, const IOVideoStreamDescription& format);
static OSDictionary* copyCurrentFormatDictionary(const OSDictionary* dictionary);
static void setCurrentFormatDictionary(OSDictionary* dictionary, const OSDictionary* format);
static OSArray* copyAvailableFormats(const OSDictionary* dictionary);
static void setAvailableFormats(OSDictionary* dictionary, OSArray* availableFormats);
static void printDictionary(const OSDictionary* dictionary);
};
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/video/IOVideoDeviceUserClient.h | /*
File: IOVideoDeviceUserClient.h
Contains:
Copyright: © 2006-2012 by Apple Inc., all rights reserved.
*/
#if !defined(__IOKIT_IOVIDEODEVICEUSERCLIENT_H)
#define __IOKIT_IOVIDEODEVICEUSERCLIENT_H
/*!
@enum User client methods
@constant kIOVideoDeviceMethodOpen
@constant kIOVideoDeviceMethodClose
@constant kIOVideoDeviceMethodGetMode
@constant kIOVideoDeviceMethodSetControlValue
@constant kIOVideoDeviceMethodOpenStream
@constant kIOVideoDeviceMethodCloseStream
@constant kIOVideoDeviceMethodSetStreamFormat
@constant kIOVideoDeviceMethodStartStream
@constant kIOVideoDeviceMethodStopStream
@constant kIOVideoDeviceMethodSuspendStream
@abstract Client method numbers used with IOConnectMethod...() functions.
*/
enum
{
kIOVideoDeviceMethodOpen = 0,
kIOVideoDeviceMethodClose,
kIOVideoDeviceMethodGetMode,
kIOVideoDeviceMethodSetMode,
kIOVideoDeviceMethodSetControlValue,
kIOVideoDeviceMethodOpenStream,
kIOVideoDeviceMethodCloseStream,
kIOVideoDeviceMethodSetStreamFormat,
kIOVideoDeviceMethodStartStream,
kIOVideoDeviceMethodStopStream,
kIOVideoDeviceMethodSuspendStream,
kIOVideoDeviceMethodCount
};
#ifdef KERNEL
#ifdef __cplusplus
#include <IOKit/IOUserClient.h>
#include <IOKit/stream/IOStreamShared.h>
#include <IOKit/video/IOVideoTypes.h>
class IOVideoDevice;
class IOVideoDeviceUserClient : public IOUserClient
{
// Construction/Destruction
OSDeclareDefaultStructors(IOVideoDeviceUserClient)
// Static versions of external methods
private:
static IOReturn sOpen(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sClose(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sGetMode(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sSetMode(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sSetControlValue(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sOpenStream(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sCloseStream(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sSetStreamFormat(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sStartStream(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sStopStream(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sSuspendStream(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
protected:
const IOExternalMethodDispatch* mExternalMethods;
IOVideoDevice* mDevice;
task_t mTask;
// IOUserClient overriden methods
public:
virtual bool initWithTask(task_t owningTask, void* securityToken, UInt32 type);
virtual bool initWithTask(task_t owningTask, void* securityToken, UInt32 type, OSDictionary* properties);
virtual IOReturn clientClose(void);
virtual IOReturn clientDied(void);
virtual IOService* getService(void);
virtual IOReturn registerNotificationPort(mach_port_t port, UInt32 portType, UInt32 refCon);
virtual IOReturn connectClient(IOUserClient* client);
virtual IOReturn externalMethod(uint32_t selector, IOExternalMethodArguments* arguments, IOExternalMethodDispatch* dispatch, OSObject* target, void* reference);
// IOService overriden methods
virtual bool start(IOService* provider);
// external methods
public:
virtual IOReturn open(IOOptionBits options);
virtual IOReturn close(void);
virtual IOReturn getMode(UInt32 streamIndex, IOStreamMode* mode);
virtual IOReturn setMode(UInt32 streamIndex, IOStreamMode mode);
virtual IOReturn setControlValue(UInt32 controlID, UInt32 value, UInt32* newValue);
virtual IOReturn setStreamFormat(UInt32 streamID, const IOVideoStreamDescription* newStreamFormat);
virtual IOReturn openStream(UInt32 streamIndex);
virtual IOReturn closeStream(UInt32 streamIndex);
virtual IOReturn startStream(UInt32 streamIndex);
virtual IOReturn stopStream(UInt32 streamIndex);
virtual IOReturn suspendStream(UInt32 streamIndex);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/video/IOVideoDeviceShared.h | /*
File: IOVideoDeviceShared.h
Contains:
Copyright: © 2006-2012 by Apple Inc., all rights reserved.
*/
#if !defined(__IOKIT_IOVIDEODEVICESHARED_H)
#define __IOKIT_IOVIDEODEVICESHARED_H
#include <sys/cdefs.h>
#include <IOKit/IOTypes.h>
/*!
@header IOVideoDeviceShared.h
IOVideoDevice definitions shared between kernel and user space.
*/
__BEGIN_DECLS
/*!
@enum Mach port types
@constant kIOVideoDevicePortTypeNotification
@constant kIOVideoDevicePortTypeOutput
@constant kIOVideoDevicePortTypeInput
@abstract Port types used with IOConnectSetNotificationPort().
*/
enum
{
kIOVideoDevicePortTypeNotification,
kIOVideoDevicePortTypeOutput,
kIOVideoDevicePortTypeInput
};
__END_DECLS
#endif /* ! __IOKIT_IOVIDEODEVICESHARED_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/video/IOVideoTypes.h | /*
File: IOVideoTypes.h
Contains:
Copyright: © 2006-2014 by Apple Inc., all rights reserved.
*/
#if !defined(__IOVideoTypes_h__)
#define __IOVideoTypes_h__
// System Includes
#include <IOKit/IOTypes.h>
#include <mach/message.h>
#if defined(__cplusplus)
extern "C"
{
#endif
/*!
@struct IOVideoDeviceNotification
@abstract This structure contains an individual notification from the driver.
@field mObjectID
The ID of the object to which the notification pertains.
@field mNotificationID
A UInt32 that identifies the kind of the notification.
@field mNotificationArgument1
A UInt32 whose usage depends on the the specific kind of notification.
@field mNotificationArgument2
A UInt32 whose usage depends on the the specific kind of notification.
@field mNotificationArgument3
A UInt64 whose usage depends on the the specific kind of notification.
@field mNotificationArgument4
A UInt64 whose usage depends on the the specific kind of notification.
*/
struct IOVideoDeviceNotification
{
UInt32 mObjectID;
UInt32 mNotificationID;
UInt32 mNotificationArgument1;
UInt32 mNotificationArgument2;
UInt64 mNotificationArgument3;
UInt64 mNotificationArgument4;
};
typedef struct IOVideoDeviceNotification IOVideoDeviceNotification;
/*!
@struct IOVideoDeviceNotificationMessage
@abstract This structure describes a notification from the driver. Note that the message can contain multiple notifications.
@field mMessageHeader
The mach message header.
@field mClientData
The client data that was registered with the mach port.
@field mNumberNotifications
The number of IOVideoDeviceNotifications in the mNotifications array.
@field mNotifications
A variable length array of IOVideoDeviceNotification structures that carry the actual notification data. The number of elements in this array is denoted by
mNumberNotifications, but can also be inferred from the message size in the mach message header.
*/
struct IOVideoDeviceNotificationMessage
{
mach_msg_header_t mMessageHeader;
UInt32 mClientData;
UInt32 mNumberNotifications;
IOVideoDeviceNotification mNotifications[1];
};
typedef struct IOVideoDeviceNotificationMessage IOVideoDeviceNotificationMessage;
#define CalculateIOVideoDeviceNotificationMessageSize(numberNotifications) (sizeof(IOVideoDeviceNotificationMessage) + (((numberNotifications) - 1) * sizeof(IOVideoDeviceNotification)))
#pragma mark Notification IDs
/*!
@enum Notification IDs
@discussion
@abstract The four char codes used to identify the kind of the notification.
@discussion All device-level notifications will have an object ID of 0.
@constant kIOVideoDeviceNotificationID_ControlValueChanged
Indicates that the value of the control with the given ID has changed. The first argument is the new value.
@constant kIOVideoDeviceNotificationID_ControlRangeChanged
Indicates that the range of the control with the given ID has changed.
*/
enum
{
kIOVideoDeviceNotificationID_ControlValueChanged = 'cval',
kIOVideoDeviceNotificationID_ControlRangeChanged = 'crng'
};
struct IOVideoStreamDescription
{
UInt32 mVideoCodecType;
UInt32 mVideoCodecFlags;
UInt32 mWidth;
UInt32 mHeight;
UInt32 mReserved1;
UInt32 mReserved2;
};
typedef struct IOVideoStreamDescription IOVideoStreamDescription;
//==================================================================================================
#pragma mark Control Constants
/*!
@enum Control Constants
@discussion
@abstract Various constants related to controls.
@constant kIOVideoControlScopeGlobal
The scope for controls that apply to the device as a whole.
@constant kIOVideoControlScopeInput
The scope for controls that apply to the input section of the device.
@constant kIOVideoControlScopeOutput
The scope for controls that apply to the output section of the device.
@constant kIOVideoControlScopePlayThrough
The scope for controls that apply to the play through section of the device.
@constant kIOVideoControlElementMaster
The element value for controls that apply to the master element or to the entire scope. Note that other elements are numbered consecutively starting from 1.
*/
enum
{
kIOVideoControlScopeGlobal = 'glob',
kIOVideoControlScopeInput = 'inpt',
kIOVideoControlScopeOutput = 'outp',
kIOVideoControlScopePlayThrough = 'ptru',
kIOVideoControlElementMaster = 0
};
/*!
@enum Control Base Class IDs
@discussion
@abstract The class IDs that identify the various control base classes.
@constant kIOVideoControlBaseClassIDBoolean
The class ID that identifies the boolean control class which is a subclass of the base control class. Boolean controls manipulate on/off switches in the hardware.
@constant kIOVideoControlBaseClassIDSelector
The class ID that identifies the selector control class which is a subclass of the base control class. Selector controls manipulate controls that have
multiple, but discreet values.
@constant kIOVideoControlBaseClassIDFeature
The class ID that identifies the feature control class which is a subclass of the base control class. Feature controls manipulate various features that might be
present on a device, such as hue, saturation, zoom, etc.
*/
enum
{
kIOVideoControlBaseClassIDBoolean = 'togl',
kIOVideoControlBaseClassIDSelector = 'slct',
kIOVideoControlBaseClassIDFeature = 'ftct'
};
/*!
@enum IOVideoBooleanControl Subclass IDs
@discussion
@abstract The four char codes that identify the various standard subclasses of IOVideoBooleanControl.
@constant kIOVideoBooleanControlClassIDJack
A IOVideoBooleanControl where a true value means something is plugged into that element.
@constant kIOVideoBooleanControlClassIDDirection
A IOVideoBooleanControl where a true value means the element is operating in input mode, and false means the element is operating in output mode.
This control is only needed for devices which can do input and output, but not at the same time.
*/
enum
{
kIOVideoBooleanControlClassIDJack = 'jack',
kIOVideoBooleanControlClassIDDirection = 'dire'
};
/*!
@enum IOVideoSelectorControl Subclass IDs
@discussion
@abstract The four char codes that identify the various standard subclasses of IOVideoSelectorControl.
@constant kIOVideoSelectorControlClassIDDataSource
A IOVideoSelectorControl that identifies where the data for the element is coming from.
@constant kIOVideoSelectorControlClassIDDataDestination
A IOVideoSelectorControl that identifies where the data for the element is going.
*/
enum
{
kIOVideoSelectorControlClassIDDataSource = 'dsrc',
kIOVideoSelectorControlClassIDDataDestination = 'dest'
};
/*!
@enum IOVideoFeatureControl Subclass IDs
@discussion
@abstract The four char codes that identify the various standard subclasses of IOVideoFeatureControl.
@constant kIOVideoFeatureControlClassIDBlackLevel
A IOVideoFeatureControl that controls the black level offset. The units for the control's absolute value are percetage (%).
@constant kIOVideoFeatureControlClassIDWhiteLevel
A IOVideoFeatureControl that controls the white level offset. The units for the control's absolute value are percentage (%).
@constant kIOVideoFeatureControlClassIDHue
A IOVideoFeatureControl that controls the hue offset. Positive values mean counterclockwise, negative values means clockwise on a vector scope. The units for the
control's absolute value are degrees (°).
@constant kIOVideoFeatureControlClassIDSaturation
A IOVideoFeatureControl that controls color intensity. For example, at high saturation levels, red appears to be red; at low saturation, red appears as pink. The
unit for the control's absolute value is a percentage (%).
@constant kIOVideoFeatureControlClassIDContrast
A IOVideoFeatureControl that controls a the distance bewtween the whitest whites and blackest blacks. The units for the control's absolute value are percentage (%).
@constant kIOVideoFeatureControlClassIDSharpness
A IOVideoFeatureControl that controls the sharpness of the picture. The units for the control's absolute value are undefined.
@constant kIOVideoFeatureControlClassIDBrightness
A IOVideoFeatureControl that controls the intensity of the video level. The units for the control's absolute value are percetage (%).
@constant kIOVideoFeatureControlClassIDGain
A IOVideoFeatureControl that controls the amplification of the signal. The units for the control's absolute value are decibels (dB).
@constant kIOVideoFeatureControlClassIDIris
A IOVideoFeatureControl that controls a mechanical lens iris. The units for the control's absolute value are an F number (F).
@constant kIOVideoFeatureControlClassIDShutter
A IOVideoFeatureControl that controls the integration time of the incoming light. The units for the control's absolute value are seconds (s).
@constant kIOVideoFeatureControlClassIDExposure
A IOVideoFeatureControl that controls a the total amount of light accumulated. The units for the control's absolute value are exposure value (EV).
@constant kIOVideoFeatureControlClassIDWhiteBalanceU
A IOVideoFeatureControl that controls the adjustment of the white color of the picture. The units for the control's absolute value are kelvin (K).
@constant kIOVideoFeatureControlClassIDWhiteBalanceV
A IOVideoFeatureControl that controls a adjustment of the white color of the picture. The units for the control's absolute value are kelvin (K).
@constant kIOVideoFeatureControlClassIDGamma
A IOVideoFeatureControl that defines the function between incoming light level and output picture level. The units for the control's absolute value are undefined.
@constant kIOVideoFeatureControlClassIDTemperature
A IOVideoFeatureControl that controls the temperature inside of the device and/or controlling temperature. The units for the control's absolute value are undefined.
@constant kIOVideoFeatureControlClassIDZoom
A IOVideoFeatureControl that controls the zoom. The units for the control's absolute value are power where 1 is the wide end.
@constant kIOVideoFeatureControlClassIDFocus
A IOVideoFeatureControl that controls a focus mechanism. The units for the control's absolute value are meters (m).
@constant kIOVideoFeatureControlClassIDPan
A IOVideoFeatureControl that controls a panning mechanism. Positive values mean clockwise, negative values means counterclockwise. The units for the control's
absolute value are degrees (°).
@constant kIOVideoFeatureControlClassIDTilt
A IOVideoFeatureControl that controls a tilt mechanism. Positive values mean upwards, negative values means downwards. The units for the control's absolute value are
degrees (°).
@constant kIOVideoFeatureControlClassIDOpticalFilter
A IOVideoFeatureControl that controls changing the optical filter of camera lens function. The units for the control's absolute value are are undefined.
@constant kIOVideoFeatureControlClassIDBacklightCompensation
A IOVideoFeatureControl that controls the amount of backlight compensation to apply. A low number indicates the least amount of backlight compensation. The units for the
control's absolute value are are undefined.
@constant kIOVideoFeatureControlClassIDPowerLineFrequency
A IOVideoFeatureControl to specify the power line frequency to properly implement anti-flicker processing. The units for the contorl's absolute value are hertz (Hz).
*/
enum
{
kIOVideoFeatureControlClassIDBlackLevel = 'bklv',
kIOVideoFeatureControlClassIDWhiteLevel = 'whlv',
kIOVideoFeatureControlClassIDHue = 'hue ',
kIOVideoFeatureControlClassIDSaturation = 'satu',
kIOVideoFeatureControlClassIDContrast = 'ctst',
kIOVideoFeatureControlClassIDSharpness = 'shrp',
kIOVideoFeatureControlClassIDBrightness = 'brit',
kIOVideoFeatureControlClassIDGain = 'gain',
kIOVideoFeatureControlClassIDIris = 'iris',
kIOVideoFeatureControlClassIDShutter = 'shtr',
kIOVideoFeatureControlClassIDExposure = 'xpsr',
kIOVideoFeatureControlClassIDWhiteBalanceU = 'whbu',
kIOVideoFeatureControlClassIDWhiteBalanceV = 'whbv',
kIOVideoFeatureControlClassIDGamma = 'gmma',
kIOVideoFeatureControlClassIDTemperature = 'temp',
kIOVideoFeatureControlClassIDZoom = 'zoom',
kIOVideoFeatureControlClassIDFocus = 'fcus',
kIOVideoFeatureControlClassIDPan = 'pan ',
kIOVideoFeatureControlClassIDTilt = 'tilt',
kIOVideoFeatureControlClassIDOpticalFilter = 'opft',
kIOVideoFeatureControlClassIDBacklightCompensation = 'bklt',
kIOVideoFeatureControlClassIDPowerLineFrequency = 'pwfq'
};
//==================================================================================================
#pragma mark IORegistry Keys
// IOVideo Class Names
#define kIOVideoDevice_ClassName "IOVideoDevice"
// IOVideoDevice IORegistry Keys
#pragma mark IOVideoDevice IORegistry Keys
#define kIOVideoDeviceKey_DeviceName "device name"
#define kIOVideoDeviceKey_DeviceManufacturer "device manufacturer"
#define kIOVideoDeviceKey_DeviceUID "device UID"
#define kIOVideoDeviceKey_IOEngineIsRunning "is running"
#define kIOVideoDeviceKey_InputLatency "input latency"
#define kIOVideoDeviceKey_OutputLatency "output latency"
#define kIOVideoDeviceKey_InputStreamList "input streams"
#define kIOVideoDeviceKey_OutputStreamList "output streams"
#define kIOVideoDeviceKey_ControlList "controls"
// IOVideoDevice Stream Dictionary Keys
#pragma mark IOVideoDevice Stream Dictionary Keys
#define kIOVideoStreamKey_StreamID "stream ID"
#define kIOVideoStreamKey_StartingDeviceChannelNumber "starting channel"
#define kIOVideoStreamKey_BufferMappingOptions "buffer mapping options"
#define kIOVideoStreamKey_CurrentFormat "current format"
#define kIOVideoStreamKey_AvailableFormats "available formats"
// IOVideoDevice Control Dictionary Keys
#pragma mark IOVideoDevice Control Dictionary Keys
#define kIOVideoControlKey_ControlID "control ID"
#define kIOVideoControlKey_BaseClass "base class"
#define kIOVideoControlKey_Class "class"
#define kIOVideoControlKey_Scope "scope"
#define kIOVideoControlKey_Element "element"
#define kIOVideoControlKey_IsReadOnly "read only"
#define kIOVideoControlKey_Variant "variant"
#define kIOVideoControlKey_Name "name"
#define kIOVideoControlKey_Value "value"
// IOVideoDevice Selector Control Dictionary Keys
#pragma mark IOVideoDevice Selector Control Dictionary Keys
#define kIOVideoSelectorControlKey_SelectorMap "selectors"
// IOVideoDevice Selector Control Selector Map Item Dictionary Keys
#pragma mark IOVideoDevice Selector Control Selector Map Item Dictionary Keys
#define kIOVideoSelectorControlSelectorMapItemKey_Value "value"
#define kIOVideoSelectorControlSelectorMapItemKey_Name "name"
#define kIOVideoSelectorControlSelectorMapItemKey_Kind "kind"
// Stream Format Dictionary Keys
#pragma mark Stream Format Dictionary Keys
#define kIOVideoStreamFormatKey_CodecType "codec type"
#define kIOVideoStreamFormatKey_CodecFlags "codec flags"
#define kIOVideoStreamFormatKey_Width "width"
#define kIOVideoStreamFormatKey_Height "height"
//==================================================================================================
#if defined(__cplusplus)
}
#endif
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/video/IOVideoStream.h | /*
File: IOVideoStream.h
Contains:
Copyright: © 2006-2012 by Apple Inc., all rights reserved.
*/
#ifndef __IOKIT_IOVIDEOSTREAM_H
#define __IOKIT_IOVIDEOSTREAM_H
#include <IOKit/stream/IOStream.h>
class IOVideoDevice;
/*!
@class IOVideoStream
@abstract A class representing a stream of video data buffers passed from kernel to user space and back again.
@discussion The IOVideoStream class defines a mechanism for moving buffers of data from kernel space to user space or vice-versa. The policy for which direction the data flows and the
nature of the data is left up the the implementer of the driver which uses IOStream.
Although it is expected that the client of an IOVideoStream will be in user space, this is not required.
References to "output" mean "from the IOVideoStream to the user client", and "input" means "from the user client to the IOVideoStream."
*/
class IOVideoStream : public IOStream
{
// Construction/Destruction
OSDeclareDefaultStructors(IOVideoStream);
protected:
IOStreamMode mStreamMode;
public:
/*!
@function withBuffers
@param buffers
An array of IOStreamBuffer objects which will be the buffers for this stream.
@param mode
The initial mode of the video stream, either output, input, or input/output.
@param queueLength
The nuber of queue entries to reserve in the input and output queue. Zero means to make the queues big enough to accommodate all the buffers at once.
@param properties
A dictionary of properties which will be set on the video stream.
*/
static IOVideoStream* withBuffers(OSArray* buffers, IOStreamMode mode = kIOStreamModeOutput, IOItemCount queueLength = 0, OSDictionary* properties = 0);
/*!
@function initWithBuffers
@param buffers
An array of IOStreamBuffer objects which will be the buffers for this stream.
@param mode
The initial mode of the video stream, either output, input, or input/output.
@param queueLength
The nuber of queue entries to reserve in the input and output queue. Zero means to make the queues big enough to accommodate all the buffers at once.
@param properties
A dictionary of properties which will be set on the video stream.
*/
virtual bool initWithBuffers(OSArray* buffers, IOStreamMode mode = kIOStreamModeOutput, IOItemCount queueLength = 0, OSDictionary* properties = 0);
virtual IOVideoDevice* getDevice(void); // Returns provider cast to an IOVideoDevice
/*!
@function getStreamMode
@abstract Returns the mode of the stream, either input or output.
@result The mode of the stream, either kIOStreamModeInput (from user space to kernel space) or the default kIOStreamModeOutput (from kernel space to user space).
*/
virtual IOStreamMode getStreamMode(void);
/*!
@function setStreamMode
@abstract Sets the mode of the stream, either input or output.
*/
virtual IOReturn setStreamMode(IOStreamMode mode);
/*!
@function startStream
@abstract Start sending data on a stream.
@result Returns kIOReturnSuccess if the stream was successfully started.
*/
virtual IOReturn startStream(void);
/*!
@function stopStream
@abstract Stop sending data on a stream.
@result Returns kIOReturnSuccess if the stream was successfully started.
*/
virtual IOReturn stopStream(void);
/*!
@function suspendStream
@abstract Temporarily suspend data flow on the stream.
@result Returns kIOReturnSuccess if the stream was successfully suspended.
*/
virtual IOReturn suspendStream(void);
// Future Expansion
public:
OSMetaClassDeclareReservedUnused(IOVideoStream, 0);
OSMetaClassDeclareReservedUnused(IOVideoStream, 1);
OSMetaClassDeclareReservedUnused(IOVideoStream, 2);
OSMetaClassDeclareReservedUnused(IOVideoStream, 3);
OSMetaClassDeclareReservedUnused(IOVideoStream, 4);
OSMetaClassDeclareReservedUnused(IOVideoStream, 5);
OSMetaClassDeclareReservedUnused(IOVideoStream, 6);
OSMetaClassDeclareReservedUnused(IOVideoStream, 7);
OSMetaClassDeclareReservedUnused(IOVideoStream, 8);
OSMetaClassDeclareReservedUnused(IOVideoStream, 9);
OSMetaClassDeclareReservedUnused(IOVideoStream, 10);
OSMetaClassDeclareReservedUnused(IOVideoStream, 11);
OSMetaClassDeclareReservedUnused(IOVideoStream, 12);
OSMetaClassDeclareReservedUnused(IOVideoStream, 13);
OSMetaClassDeclareReservedUnused(IOVideoStream, 14);
OSMetaClassDeclareReservedUnused(IOVideoStream, 15);
OSMetaClassDeclareReservedUnused(IOVideoStream, 16);
OSMetaClassDeclareReservedUnused(IOVideoStream, 17);
OSMetaClassDeclareReservedUnused(IOVideoStream, 18);
OSMetaClassDeclareReservedUnused(IOVideoStream, 19);
OSMetaClassDeclareReservedUnused(IOVideoStream, 20);
OSMetaClassDeclareReservedUnused(IOVideoStream, 21);
OSMetaClassDeclareReservedUnused(IOVideoStream, 22);
OSMetaClassDeclareReservedUnused(IOVideoStream, 23);
OSMetaClassDeclareReservedUnused(IOVideoStream, 24);
OSMetaClassDeclareReservedUnused(IOVideoStream, 25);
OSMetaClassDeclareReservedUnused(IOVideoStream, 26);
OSMetaClassDeclareReservedUnused(IOVideoStream, 27);
OSMetaClassDeclareReservedUnused(IOVideoStream, 28);
OSMetaClassDeclareReservedUnused(IOVideoStream, 29);
OSMetaClassDeclareReservedUnused(IOVideoStream, 30);
OSMetaClassDeclareReservedUnused(IOVideoStream, 31);
protected:
struct ExpansionData {};
ExpansionData *mReserved;
};
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/video/IOVideoControlDictionary.h | /*
File: IOVideoControlDictionary.h
Contains:
Copyright: © 2006-2012 by Apple Inc., all rights reserved.
*/
#if !defined(__IOVideoControlDictionary_h__)
#define __IOVideoControlDictionary_h__
// System Includes
#include <IOKit/video/IOVideoTypes.h>
class OSArray;
class OSDictionary;
class OSString;
class IOVideoControlDictionary
{
// Construction/Destruction
public:
static OSDictionary* create(UInt32 controlID, UInt32 baseClass, UInt32 derivedClass, UInt32 scope, UInt32 element, bool isReadOnly = false, UInt32 variant = 0, OSString* name = NULL);
static OSDictionary* createBooleanControl(UInt32 controlID, UInt32 baseClass, UInt32 derivedClass, UInt32 scope, UInt32 element, bool value, bool isReadOnly = false, UInt32 variant = 0, OSString* name = NULL);
static OSDictionary* createSelectorControl(UInt32 controlID, UInt32 baseClass, UInt32 derivedClass, UInt32 scope, UInt32 element, UInt32 value, OSArray* selectorMap, bool isReadOnly = false, UInt32 variant = 0, OSString* name = NULL);
// General Attributes
public:
static OSDictionary* getControlByID(OSArray* controlList, UInt32 controlID);
static UInt32 getControlID(const OSDictionary* dictionary);
static void setControlID(OSDictionary* dictionary, UInt32 controlID);
static UInt32 getBaseClass(const OSDictionary* dictionary);
static void setBaseClass(OSDictionary* dictionary, UInt32 baseClass);
static UInt32 getClass(const OSDictionary* dictionary);
static void setClass(OSDictionary* dictionary, UInt32 derivedClass);
static UInt32 getScope(const OSDictionary* dictionary);
static void setScope(OSDictionary* dictionary, UInt32 scope);
static UInt32 getElement(const OSDictionary* dictionary);
static void setElement(OSDictionary* dictionary, UInt32 element);
static bool isReadOnly(const OSDictionary* dictionary);
static void setIsReadOnly(OSDictionary* dictionary, bool isReadOnly);
static UInt32 getVariant(const OSDictionary* dictionary);
static void setVariant(OSDictionary* dictionary, UInt32 variant);
static OSString* copyName(const OSDictionary* dictionary);
static void setName(OSDictionary* dictionary, const OSString* name);
// Boolean Control Attributes
public:
static bool getBooleanControlValue(const OSDictionary* dictionary);
static void setBooleanControlValue(OSDictionary* dictionary, bool value);
// Selector Control Attributes
public:
static UInt32 getSelectorControlValue(const OSDictionary* dictionary);
static void setSelectorControlValue(OSDictionary* dictionary, UInt32 value);
static OSArray* copySelectorControlSelectorMap(const OSDictionary* dictionary);
static void setSelectorControlSelectorMap(OSDictionary* dictionary, const OSArray* selectorMap);
// Selector Control Selector Map Item Support
public:
static OSDictionary* createSelectorControlSelectorMapItem(UInt32 value, const OSString* name);
static OSDictionary* createSelectorControlSelectorMapItem(UInt32 value, const OSString* name, UInt32 kind);
};
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/video/IOVideoDeviceClientInit.h | /*
File: IOVideoDeviceClientInit.h
Contains: This class is used to add an IOProviderMergeProperties dictionary entry to a provider's property list, thus providing a tie between hardware and a CFBundle at hardware
load time. This property usually contains the user client class name and the CFPlugInTypes UUID's but it can contain other properties.
Copyright: © 2006-2012 by Apple Inc., all rights reserved.
*/
#ifndef __IOVIDEODEVICECLIENTINIT_H
#define __IOVIDEODEVICECLIENTINIT_H
#include <IOKit/IOService.h>
class IOVideoDeviceUserClientInit : public IOService
{
OSDeclareDefaultStructors(IOVideoDeviceUserClientInit);
public:
virtual bool start(IOService* provider) ;
virtual bool MergeDictionaryIntoProvider(IOService* provider, OSDictionary* mergeDicttionary);
virtual bool MergeDictionaryIntoDictionary(OSDictionary* sourceDictionary, OSDictionary* targetDictionary);
};
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/audio/IOAudioToggleControl.h | /*
* Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOAUDIOTOGGLECONTROL_H
#define _IOKIT_IOAUDIOTOGGLECONTROL_H
#include <AvailabilityMacros.h>
#ifndef IOAUDIOFAMILY_SELF_BUILD
#include <IOKit/audio/IOAudioControl.h>
#else
#include "IOAudioControl.h"
#endif
/*!
* @class IOAudioToggleControl
*/
class IOAudioToggleControl : public IOAudioControl
{
OSDeclareDefaultStructors(IOAudioToggleControl)
protected:
struct ExpansionData { };
ExpansionData *reserved;
// New code added here
public:
/*!
* @function createPassThruMuteControl
* @abstract Allocates a new pass through mute control with the given attributes
* @param initialValue The initial value of the control
* @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h.
* @param channelName An optional name for the channel. Common names are located in IOAudioPort.h.
* @param cntrlID An optional ID for the control that can be used to uniquely identify controls
* @result Returns a newly allocated and initialized mute IOAudioControl
*/
static IOAudioToggleControl *createPassThruMuteControl (bool initialValue,
UInt32 channelID,
const char *channelName,
UInt32 cntrlID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
private:
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 0);
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 1);
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 2);
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 3);
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 4);
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 5);
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 6);
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 7);
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 8);
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 9);
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 10);
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 11);
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 12);
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 13);
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 14);
OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 15);
public:
/*!
* @function create
* @abstract Allocates a new mute control with the given attributes
* @param initialValue The initial value of the control
* @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h.
* @param channelName An optional name for the channel. Common names are located in IOAudioPort.h.
* @param cntrlID An optional ID for the control that can be used to uniquely identify controls
* @result Returns a newly allocated and initialized mute IOAudioControl
*/
static IOAudioToggleControl *create(bool initialValue,
UInt32 channelID,
const char *channelName = 0,
UInt32 cntrlID = 0,
UInt32 subType = 0,
UInt32 usage = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOAudioToggleControl *createMuteControl(bool initialValue,
UInt32 channelID,
const char *channelName = 0,
UInt32 cntrlID = 0,
UInt32 usage = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function init
* @abstract Initializes a newly allocated IOAudioToggleControl with the given attributes
* @param initialValue The initial value of the control
* @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h.
* @param channelName An optional name for the channel. Common names are located in IOAudioPort.h.
* @param cntrlID An optional ID for the control that can be used to uniquely identify controls
* @result Returns truen on success
*/
virtual bool init(bool initialValue,
UInt32 channelID,
const char *channelName = 0,
UInt32 cntrlID = 0,
UInt32 subType = 0,
UInt32 usage = 0,
OSDictionary *properties = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
};
#endif /* _IOKIT_IOAUDIOTOGGLECONTROL_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/audio/IOAudioTimeIntervalFilter.h | /*
* Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOAUDIOTIMEINTERVALFILTER_H
#define _IOAUDIOTIMEINTERVALFILTER_H
#include "BigNum128.h"
/*!
@class IOAudioTimeIntervalFilter
@abstract An abstract class that provides a filtered timeline based on snapshots from jittery time captures
*/
class IOAudioTimeIntervalFilter : public OSObject
{
OSDeclareAbstractStructors(IOAudioTimeIntervalFilter)
public:
/*!
@function reInitialiseFilter
@abstract Restart a new timeline sequence, with a new expected interval spacing
@param expectedInterval Expected interval of time captures. Pass zero to use the results from previous runs.
@param multiIntervalCount Count of multiple intervals to return from getMultiIntervalTime.
*/
virtual IOReturn reInitialiseFilter(uint32_t expectedInterval = 0, uint32_t multiIntervalCount = 1 );
/*!
* @function free
* @abstract Frees all of the resources allocated by the IOAudioTimeIntervalFilter.
* @discussion Do not call this directly. This is called automatically by the system when the instance's
* refcount goes to 0. To decrement the refcount, call release() on the object.
*/
virtual void free();
/*!
@function newTimePosition
@abstract Pass in the raw measured time position
@param rawSnapshot The raw time position. These should be approximately occurring every ExpectedInterval
@result A filtered time position
*/
virtual AbsoluteTime newTimePosition(AbsoluteTime rawSnapshot);
/*!
@function getMultiIntervalTime
@abstract Return the time between the last MultiIntervalCount intervals of the filtered timeline
@result Return the time between the last MultiIntervalCount intervals of the filtered timeline
*/
virtual uint64_t getMultiIntervalTime(void);
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 0 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 1 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 2 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 3 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 4 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 5 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 6 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 7 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 8 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 9 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 10 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 11 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 12 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 13 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 14 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilter, 15 );
protected:
/* <rdar://12136103> */
struct ExpansionData
{
};
ExpansionData *reserved;
/*!
@function initFilter
@abstract Construct a new instance of the TimeFilter class
@param ExpectedInterval Expected interval of time captures
@param MultiIntervalCount Optionally calculate the count between ExpectedInterval
*/
virtual bool initFilter(uint32_t expectedInterval, uint32_t multiIntervalCount = 1);
/*!
@function calculateNewTimePosition
@abstract abstract method to calculate the new time position based on the raw snapshot
@param rawSnapshot Raw filter value
@result filtered time value
*/
virtual uint64_t calculateNewTimePosition(uint64_t rawSnapshot) = 0;
inline int decCircularBufferPosition(int n, int dec = 1) { return (n + mMultiIntervalCount - dec) % mMultiIntervalCount; }
inline int incCircularBufferPosition(int n, int inc = 1) { return (n + mMultiIntervalCount + inc) % mMultiIntervalCount; }
uint32_t mExpectedInterval;
uint32_t mMultiIntervalCount;
uint64_t* mIntervalTimeHistory;
/*!
* @var mIntervalTimeHistoryPointer
* Points to the next time interval to be updated
*/
int mIntervalTimeHistoryPointer;
/*!
* @var mFilterCount
* How many times the filter has been called since re-init
*/
uint64_t mFilterCount;
IOLock* timeIntervalLock;
};
/*!
@class IOAudioTimeIntervalFilterIIR
@abstract A concrete IOAudioTimeIntervalFilter class that provides an IIR-based filtered timeline based on snapshots from jittery time captures
*/
class IOAudioTimeIntervalFilterIIR : public IOAudioTimeIntervalFilter
{
OSDeclareDefaultStructors(IOAudioTimeIntervalFilterIIR)
public:
/*!
@function initFilter
@abstract Construct a new instance of the IIR TimeFilter class
@param ExpectedInterval Expected interval of time captures
@param MultiIntervalCount Optionally calculate the count between ExpectedInterval
@param filterCoef IIR filter coefficient. Increase this number for more aggressive smoothing
*/
virtual bool initFilter(uint32_t expectedInterval, uint32_t multiIntervalCount = 1, uint16_t filterCoef = 4);
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 0 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 1 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 2 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 3 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 4 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 5 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 6 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 7 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 8 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 9 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 10 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 11 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 12 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 13 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 14 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterIIR, 15 );
protected:
virtual void IIR(U128* filterVal, U128 input, int shiftAmount);
virtual uint64_t calculateNewTimePosition(uint64_t rawSnapshot);
U128 mFilteredSnapshot;
U128 mFilteredOffset;
uint16_t mIIRCoef;
};
/*!
@class IOAudioTimeIntervalFilterFIR
@abstract A concrete IOAudioTimeIntervalFilter class that provides an FIR-based filtered timeline based on snapshots from jittery time captures
*/
class IOAudioTimeIntervalFilterFIR : public IOAudioTimeIntervalFilter
{
OSDeclareDefaultStructors(IOAudioTimeIntervalFilterFIR)
public:
/*!
@function initFilter
@abstract Construct a new instance of the IIR TimeFilter class
@param ExpectedInterval Expected interval of time captures
@param MultiIntervalCount Optionally calculate the count between ExpectedInterval
*/
virtual bool initFilter(uint32_t expectedInterval, uint32_t multiIntervalCount = 1);
/*!
* @function free
* @abstract Frees all of the resources allocated by the IOAudioTimeIntervalFilter.
* @discussion Do not call this directly. This is called automatically by the system when the instance's
* refcount goes to 0. To decrement the refcount, call release() on the object.
*/
virtual void free();
IOReturn reInitialiseFilter(uint32_t expectedInterval = 0, uint32_t multiIntervalCount = 1 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 0 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 1 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 2 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 3 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 4 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 5 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 6 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 7 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 8 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 9 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 10 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 11 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 12 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 13 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 14 );
OSMetaClassDeclareReservedUnused (IOAudioTimeIntervalFilterFIR, 15 );
protected:
virtual uint64_t calculateNewTimePosition(uint64_t rawSnapshot);
virtual IOReturn setNewFilter(uint32_t numCoeffs, const uint64_t* filterCoefficients, uint32_t scale);
U128 FIR(uint64_t *history, uint64_t input);
uint64_t* mCoeffs;
uint64_t* mDataOffsetHistory;
uint64_t* mDataHistory;
uint32_t mNumCoeffs;
uint32_t mFilterScale;
uint32_t mFilterWritePointer;
};
#endif // _IOAUDIOTIMEINTERVALFILTER_H
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/audio/IOAudioEngine.h | /*
* Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
* @header IOAudioEngine
*/
#ifndef _IOKIT_IOAUDIOENGINE_H
#define _IOKIT_IOAUDIOENGINE_H
#include <IOKit/IOService.h>
#include <AvailabilityMacros.h>
#ifndef IOAUDIOFAMILY_SELF_BUILD
#include <IOKit/audio/IOAudioTypes.h>
#else
#include "IOAudioTypes.h"
#endif
#include <IOKit/IOBufferMemoryDescriptor.h>
class OSDictionary;
class OSCollection;
class OSOrderedSet;
class IOAudioEngineUserClient;
class IOAudioDevice;
class IOAudioStream;
class IOAudioControl;
class IOCommandGate;
#define IOAUDIOENGINE_DEFAULT_NUM_ERASES_PER_BUFFER 4
/*!
* @typedef IOAudioEnginePosition
* @abstract Represents a position in an audio audio engine.
* @discussion This position is based on the sample frame within a
* loop around the sample buffer, and the loop count which starts at 0 when the audio engine
* begins playback.
* @field fSampleFrame The sample frame within the buffer - starts at 0.
* @field fLoopCount The number of times the ring buffer has looped.
*/
typedef struct {
UInt32 fSampleFrame;
UInt32 fLoopCount;
} IOAudioEnginePosition;
#define CMP_IOAUDIOENGINEPOSITION(p1, p2) \
(((p1)->fLoopCount > (p2)->fLoopCount) ? 1 : \
((p1)->fLoopCount == (p2)->fLoopCount) && ((p1)->fSampleFrame > (p2)->fSampleFrame) ? 1 : \
((p1)->fLoopCount == (p2)->fLoopCount) && ((p1)->fSampleFrame == (p2)->fSampleFrame) ? 0 : -1)
#define IOAUDIOENGINEPOSITION_IS_ZERO(p1) (((p1)->fLoopCount == 0) && ((p1)->fSampleFrame == 0))
/*!
* @class IOAudioEngine
* @abstract Abstract base class for a single audio audio / I/O engine.
* @discussion An IOAudioEngine is defined by a single I/O engine to transfer data to
* or from one or more sample buffers. Each sample buffer is represented by a single IOAudioStream
* instance. A single IOAudioEngine must contain at least one IOAudioStream, but has no upper
* limit on the number of IOAudioStreams it may contain. An IOAudioEngine instance may contain
* both input and output IOAudioStreams.
*
* An audio driver must subclass IOAudioEngine in order to provide certain services. An
* IOAudioEngine subclass must start and stop the I/O engine when requested. The I/O
* engine should be continuously running and loop around from end to beginning. While the audio
* engine is running, it must take a timestamp as the sample buffer(s) wrap around and start at
* the beginning. The CoreAudio.framework uses the timestamp to calculate the exact position of
* the audio engine. An IOAudioEngine subclass must implement getCurrentSampleFrame() to provide
* a sample position on demand. Finally, an IOAudioEngine subclass must provide clipping and
* format conversion routines to go to/from the CoreAudio.framework's native float format.
*
* If multiple stream formats or sample rates are allowed, the IOAudioEngine
* subclass must provide support for changing the hardware when a format or sample rate is
* changed.
*
* There are several attributes associated with a single IOAudioEngine:
*
* The IOAudioEngine superclass provides a shared status buffer that contains all of the dynamic pieces
* of information about the audio engine (type IOAudioEngineStatus). It runs an erase process on
* all of the output streams. The erase head is used to zero out the mix and sample buffers after
* the samples have been played. Additionally, the IOAudioEngine superclass handles the
* communication with the CoreAudio.framework and makes the decision to start and stop the
* audio engine when it detects it is in use.
*
* In order for an audio device to play back or record sound, an IOAudioEngine subclass must be created.
* The subclass must initialize all of the necessary hardware resources to prepare for starting the
* audio I/O engine. It typically will perform these tasks in the initHardware() method. A subclass
* may also implement a stop() method which is called as the driver is being torn down. This is
* typically called in preparation of removing the device from the system for removable devices.
*
* In addition to initializing the necessary hardware, there are a number of other tasks an
* IOAudioEngine must do during initHardware(). It must create the necessary IOAudioStream objects
* to match the device capabilities. Each IOAudioStream must be added using addAudioStream(). It
* also should create the IOAudioControls needed to control the various attributes of the audio engine:
* output volume, mute, input gain, input selection, analog passthru. To do that, addDefaultAudioControl()
* should be called with each IOAudioControl to be attached to the IOAudioEngine. In order to provide
* for proper synchronization, the latency of the audio engine should be specified with setSampleLatency().
* This value represents the latency between the timestamp taken at the beginning of the buffer and
* when the audio is actually played (or recorded) by the device. If a device is block based or if
* there is a need to keep the CoreAudio.framework a certain number of samples ahead of (or behind for
* input) the I/O head, that value should be specified using setSampleOffset(). If this is not specified
* the CoreAudio.framework may attempt to get as close to the I/O head as possible.
*
* The following fields in the shared IOAudioEngineStatus struct must be maintained by the subclass
* implementation:
* <pre>
* <t> fCurrentLoopCount - the number of times the sample buffer has wrapped around to the beginning
* <t> fLastLoopTime - timestamp of the most recent time that the I/O engine looped back to the
* beginning of the sample buffer
* </pre>
* It is critically important that the fLastLoopTime field be as accurate as possible. It is
* the basis for the entire timer and synchronization mechanism used by the audio system.
*
* At init time, the IOAudioEngine subclass must call setNumSampleFramesPerBuffer() to indicate how large
* each of the sample buffers are (measured in sample frames). Within a single IOAudioEngine, all sample
* buffers must be the same size and be running at the same sample rate. If different buffers/streams can
* be run at different rates, separate IOAudioEngines should be used. The IOAudioEngine subclass must
* also call setSampleRate() at init time to indicate the starting sample rate of the device.
*
*/
#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
#warning IOAudioEngine is deprecated use <CoreAudio/AudioServerPlugIn.h> instead.
#endif
#endif
class IOAudioEngine : public IOService
{
OSDeclareAbstractStructors(IOAudioEngine)
friend class IOAudioEngineUserClient;
friend class IOAudioDevice;
friend class IOAudioStream;
public:
/*! @var gSampleRateWholeNumberKey */
static const OSSymbol *gSampleRateWholeNumberKey;
/*! @var gSampleRateFractionKey */
static const OSSymbol *gSampleRateFractionKey;
/*! @var numSampleFramesPerBuffer */
UInt32 numSampleFramesPerBuffer;
/*! @var sampleRate
* The current sample rate of the audio engine in samples per second. */
IOAudioSampleRate sampleRate;
/*! @var numErasesPerBuffer
* The number of times the erase head get scheduled to run for each
* cycle of the audio engine. */
UInt32 numErasesPerBuffer;
/*! @var runEraseHead
* Set to true if the erase head is to run when the audio engine is running. This is the case if there are any output streams. */
bool runEraseHead;
/*! @var audioEngineStopPosition
* When all clients have disconnected, this is set to one buffer length past the
* current audio engine position at the time. Then when the stop position is reached, the audio engine
* is stopped */
IOAudioEnginePosition audioEngineStopPosition;
/*! @var isRegistered
* Internal state variable to keep track or whether registerService() has been called. */
bool isRegistered;
/*! @var configurationChangeInProgress
* Set to true after beginConfigurationChange() and false upon a
* subsequent call to completeConfigurationChange() or cancelConfigurationChange(). */
bool configurationChangeInProgress;
/*! @var state
* The current state of the IOAudioEngine - running, stopped, paused. */
IOAudioEngineState state;
/*! @var status
* Status struct shared with the CoreAudio.framework. */
IOAudioEngineStatus * status;
/*! @var audioDevice
* The IOAudioDevice instance to which the IOAudioEngine belongs. */
IOAudioDevice * audioDevice;
/*! @var workLoop
* The IOWorkLoop for the audio driver - shared with the IOAudioDevice. */
IOWorkLoop *workLoop;
/*! @var commandGate
* The IOCommandGate for this audio engine - attached to the driver's IOWorkLoop. */
IOCommandGate *commandGate;
/*! @var inputStreams
* An OSSet of all of the input IOAudioStreams attached to this IOAudioEngine. */
OSOrderedSet *inputStreams;
UInt32 maxNumInputChannels;
/*! @var outputStreams
* An OSSet of all of the output IOAudioStreams attached to this IOAudioEngine. */
OSOrderedSet *outputStreams;
UInt32 maxNumOutputChannels;
/*! @var userClients
* An OSSet of all of the currently connected user clients. */
OSSet *userClients;
/*! @var defaultAudioControls
* All of the IOAudioControls that affect this audio engine. */
OSSet *defaultAudioControls;
/*! @var numActiveUserClients
* A total of the active user clients - those that are currently playing or
* recording audio. */
UInt32 numActiveUserClients;
UInt32 sampleOffset; // used for input and output if inputSampleOffset is not set, if inputSampleOffset is set used as output only
UInt32 index;
bool duringStartup;
protected:
/*!
* @var deviceStartedAudioEngine
* Used by the IOAudioDevice to determine responsibility for shutting
* the audio engine down when it is no longer needed.
*/
bool deviceStartedAudioEngine;
protected:
struct ExpansionData {
UInt32 pauseCount;
IOBufferMemoryDescriptor *statusDescriptor;
IOBufferMemoryDescriptor *bytesInInputBufferArrayDescriptor;
IOBufferMemoryDescriptor *bytesInOutputBufferArrayDescriptor;
UInt32 mixClipOverhead;
OSArray *streams;
UInt32 inputSampleOffset;
UInt32 commandGateStatus; // <rdar://8518215>
SInt32 commandGateUsage; // <rdar://8518215>
bool useHiResSampleInterval;
};
ExpansionData *reserved;
// static UInt32 sInstanceCount;
public:
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 0 );
virtual IOReturn performFormatChange(IOAudioStream *audioStream, const IOAudioStreamFormat *newFormat, const IOAudioStreamFormatExtension *formatExtension, const IOAudioSampleRate *newSampleRate ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 1 );
virtual IOBufferMemoryDescriptor * getStatusDescriptor( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 2 );
virtual IOReturn getNearestStartTime(IOAudioStream *audioStream, IOAudioTimeStamp *ioTimeStamp, bool isInput ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 3);
virtual IOBufferMemoryDescriptor * getBytesInInputBufferArrayDescriptor( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 4);
virtual IOBufferMemoryDescriptor * getBytesInOutputBufferArrayDescriptor( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 5);
/*!
* @function eraseOutputSamples
* @abstract This function allows for the actual erasing of the mix and sample buffer to be overridden by
* a child class.
* @param mixBuf Pointer to the IOAudioFamily allocated mix buffer.
* @param sampleBuf Pointer to the child class' sample buffer.
* @param firstSampleFrame Index to the first sample frame to erase.
* @param numSampleFrames Number of sample frames to erase.
* @param streamFormat Format of the data to be erased.
* @param audioStream Pointer to stream object that corresponds to the sample buffer being erased.
* @result Must return kIOReturnSuccess if the samples have been erased.
*/
virtual IOReturn eraseOutputSamples(const void *mixBuf, void *sampleBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 6);
/*!
* @function setClockIsStable
* @abstract This function sets a flag that CoreAudio uses to select its sample rate tracking algorithm. Set
* this to TRUE unless that results in dropped audio. If the driver is experiencing unexplained dropouts
* setting this FALSE might help.
* @param clockIsStable TRUE tells CoreAudio to use an agressive PLL to quickly lock to the engine's sample rate
* while FALSE tells CoreAudio to adjust more slowly to perceived sample rate changes that might just be the
* result of an unstable clock.
*/
virtual void setClockIsStable(bool clockIsStable ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 7);
/*!
* @function setMixClipOverhead
* @abstract Used to tell IOAudioFamily when the watchdog timer must fire by.
* @discussion setMixClipOverhead allows an audio engine to tell IOAudioFamily how much time
* an engine will take to mix and clip its samples, in percent.
* The default value is 10, meaning 10%. This will cause IOAudioFamily to make
* the watchdog timer fire when there is just over 10% of the time to complete
* a buffer set left (e.g. 51 samples when the HAL is using a buffer size of 512
* samples).
* @param newMixClipOverhead How much time per buffer should be made available for the
* mix and clip routines to run. Valid values are 1 through 99, inclusive.
* @result return no error
*/
virtual void setMixClipOverhead(UInt32 newMixClipOverhead ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 8);
/*!
* @function setClockDomain
* @abstract Sets a property that CoreAudio uses to determine how devices are synchronized. If an audio device can tell that it is
* synchronized to another engine, it should set this value to that engine's clock domain. If an audio device can be a clock master, it may publish
* its own clock domain for other devices to use.
* @param clockDomain is the unique ID of another engine that this engine realizes it is synchronized to, use the default value kIOAudioNewClockDomain
* to have IOAudioEngine create a unique clock domain.
*/
virtual void setClockDomain(UInt32 clockDomain = kIOAudioNewClockDomain ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 9);
/*!
* @function convertInputSamplesVBR
* @abstract Override this method if you want to return a different number of sample frames than was requested.
*/
virtual IOReturn convertInputSamplesVBR(const void *sampleBuf, void *destBuf, UInt32 firstSampleFrame, UInt32 &numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 10);
/*!
* @function setInputSampleOffset
* @abstract set the offset CoreAudio will read from off the current read pointer
* @param numSamples size of offset in sample
*/
virtual void setInputSampleOffset(UInt32 numSamples ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 11);
/*!
* @function setOutputSampleOffset
* @abstract set the offset CoreAudio will write at off the current write pointer
* @param numSamples size of offset in sample
*/
virtual void setOutputSampleOffset(UInt32 numSamples ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
protected:
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 12);
virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 type, IOAudioEngineUserClient **newUserClient, OSDictionary *properties ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
public:
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 13);
/*!
* @function setAttributeForConnection
* @abstract Generic method to set some attribute of the audio engine, specific to one connection.
* @discussion IOAudioEngine subclasses may implement this method to allow arbitrary attribute/value pairs to be set, specific to one connection.
* @param attribute Defines the attribute to be set.
* @param value The new value for the attribute.
* @result an IOReturn code.
*/
virtual IOReturn setAttributeForConnection( SInt32 connectIndex, UInt32 attribute, uintptr_t value ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 14);
/*! @function getAttributeForConnection
* @abstract Generic method to retrieve some attribute of the audio engine, specific to one connection.
* @discussion IOAudioEngine subclasses may implement this method to allow arbitrary attribute/value pairs to be returned, specific to one connection.
* @param attribute Defines the attribute to be returned. Some defined attributes are:<br>
* @param value Returns the value for the attribute.
* @result an IOReturn code.
*/
virtual IOReturn getAttributeForConnection( SInt32 connectIndex, UInt32 attribute, uintptr_t * value ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 15);
/*! @function calculateSampleTimeoutHiRes
* @abstract Calculate the timeout value for the write mixing engine.
* @discussion This method is called from the IOAudioEngineUserClient and used to calculate a time in the future at which a watchdog timer will expire and prevent further mixing in the audio buffer. A subclassing driver will not typically
* need to override this method. See also calculateSampleTimeout. This High Resolution varient of the function is enabled by a call to useHiResSampleInterval.
* @param sampleInterval the number of ticks of the system clock between two consecutive samples at the scaled sample rate. This value is calculated by the HAL based on the clock provided through
* Zero Time Stamps and passed down from the HAL through the performClientIO trap. This value is a Fixed Point number with the integer value in the top 32 bits and a fractional value in the lower 32 bits.
* @param numSampleFrames The number of sample frames being sent by this call to performClientIO. Informs the timeout value by giving a hint on when this audio application is expected to send another IO.
* @param startingPosition A sample frame position. Includes the position of the frame within the sample buffer as well as the loop count for the ZTS which matches the beginning of the sample buffer.
* @param wakeupTime A pointer to the AbsoluteTime which represents the calculated timeout value.
* @result an IOReturn code.
*/
virtual IOReturn calculateSampleTimeoutHiRes(uint64_t sampleIntervalHiRes, UInt32 numSampleFrames, IOAudioEnginePosition *startingPosition, AbsoluteTime *wakeupTime);
// OSMetaClassDeclareReservedUsed(IOAudioEngine, 16);
/*! @function useHiResSampleInterval
* @abstract This method is called from an IOAudioEngine subclass in order to enable the use of calculateSampleTimeoutHiRes for calculating the write mix buffer timeout value.
* @discussion The historic IOAudioEngine method calculateSampleTimeout uses an integer value representing the number of ticks between two samples at the current perceived sample rate
* which is scaled by the audio HAL based on the time base calculated using the Zero Time Stamps provided by the driver. There is some amount of error in this value due to the fact that it is
* rounded to an integer value. This value is used to multiply by a particular sample offset in the sample buffer which results in a multiplication of that error value. This aggregate error can be especially pronounced
* if the the sample rate is particularly high (thus reducing the amount of time between samples) or if the sample buffer is particularly large (thus extending the possible value for the multiplication). If useHiResSampleInterval
* is called, the HAL will pass down a Fixed Point sample interval, with a fractional part included. When the multiplcation occurs, this fractional value will be taken into account, which greatly reduces the amount of the error.
* NOTE: this is a one way function. Once enabled, this feature may not be disabled. This method is not called by default. If a subclassing driver needs this functionality, it should call this in its IOAudioEngine subclass init() method.
* @result an IOReturn code.
*/
virtual IOReturn useHiResSampleInterval(void);
private:
OSMetaClassDeclareReservedUsed(IOAudioEngine, 0);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 1);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 2);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 3);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 4);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 5);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 6);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 7);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 8);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 9);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 10);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 11);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 12);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 13);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 14);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 15);
OSMetaClassDeclareReservedUsed(IOAudioEngine, 16);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 17);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 18);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 19);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 20);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 21);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 22);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 23);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 24);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 25);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 26);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 27);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 28);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 29);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 30);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 31);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 32);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 33);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 34);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 35);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 36);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 37);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 38);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 39);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 40);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 41);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 42);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 43);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 44);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 45);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 46);
OSMetaClassDeclareReservedUnused(IOAudioEngine, 47);
public:
/*!
* @function createDictionaryFromSampleRate
* @abstract Generates a dictionary matching the given sample rate.
* @discussion This is an internal routine used to generate a dictionary matching the given sample rate. It is used to generate a sample rate dictionary for the I/O Registry - used by the
* CoreAudio.framework.
* @result Returns the newly create OSDictionary.
*/
static OSDictionary *createDictionaryFromSampleRate(const IOAudioSampleRate *sampleRate, OSDictionary *rateDict = 0 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function createSampleRateFromDictionary
* @abstract Generates a sample rate from an OSDictionary.
* @discussion This is an internal routine used to generate a sample rate from an OSDictionary. It is used to generate a sample rate give a new OSDictionary from the IORegistry - coming
* from the CoreAudio.framework.
* @result Returns the sample rate.
*/
static IOAudioSampleRate *createSampleRateFromDictionary(const OSDictionary *rateDict, IOAudioSampleRate *sampleRate = 0 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function init
* @abstract Performs initialization of a newly allocated IOAudioEngine.
* @discussion This function is responsible for initialization of all of the general attributes of
* a new IOAudioEngine. It initializes instance variables to their default
* values and allocates the shared status buffer. Subclasses will likely want to override this method
* and do all of their common initialization in their implementation. They do need to be sure to call
* IOAudioEngine's implementation of init and pay attention to the return value.
* @param properties The default properties for the IOAudioEngine.
* @result Returns true if initialization was successful.
*/
virtual bool init(OSDictionary *properties ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function free
* @abstract Frees all of the resources allocated by the IOAudioEngine.
* @discussion Do not call this directly. This is called automatically by the system when the instance's
* refcount goes to 0. To decrement the refcount, call release() on the object.
*/
virtual void free( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getWorkLoop
* @abstract Returns the IOWorkLoop for the driver.
*/
virtual IOWorkLoop *getWorkLoop() const;
/*!
* @function getCommandGate
* @abstract Returns the IOCommandGate for this IOAudioEngine.
*/
virtual IOCommandGate *getCommandGate() const;
/*!
* @function start
* @abstract A simple cover function for start(IOService *, IOAudioDevice *) that assumes the provider
* is the IOAudioDevice.
* @discussion Subclasses will want to override start(IOService *, IOAudioDevice *) rather than this
* one.
* @param provider The service provider for the IOAudioEngine (the IOAudioDevice in this case).
* @result Returns true if the IOAudioEngine was successfully started.
*/
virtual bool start(IOService *provider ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function start
* @abstract Standard IOKit start() routine called to start an IOService.
* @discussion This function is called in order to prepare the IOAudioEngine for use. It does NOT
* mean that the audio I/O engine itself should be started. This implementation gets the IOWorkLoop
* from the IOAudioDevice and allocates an IOCommandGate. Finally it calls initHardware() in which
* all of the subclass-specific device initialization should be done. Upon return from initHardware()
* all IOAudioStreams should be created and added to the audio engine. Also, all IOAudioControls
* for this IOAudioEngine should be created and attached.
* @param provider The service provider for the IOAudioEngine.
* @param device The IOAudioDevice to which this IOAudioEngine belongs.
* @result Returns true if the service was successfully started.
*/
virtual bool start(IOService *provider, IOAudioDevice *device ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function initHardware
* @abstract This function is called by start() to provide a convenient place for the subclass to
* perform its hardware initialization.
* @discussion Upon return from this function, all IOAudioStreams and IOAudioControls should be created
* and the audio engine should be ready to be started when a client requests that playback begin.
* @function provider The service provider numb for this audio engine - typically the IOAudioDevice.
* @result Returns true if the hardware was successfully initialized.
*/
virtual bool initHardware(IOService *provider ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function stop
* @abstract Stops the service and prepares for the driver to be terminated.
* @discussion This function is called before the driver is terminated and usually means that the device
* has been removed from the system.
* @param provider The service provider for the IOAudioEngine.
*/
virtual void stop(IOService *provider ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function registerService
* @abstract Called when this audio engine is ready to begin vending services.
* @discussion This function is called by IOAudioDevice::activateAudioEngine() once the audio engine
* has been fully initialized and is ready to begin audio playback.
* @param options
*/
virtual void registerService(IOOptionBits options = 0 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setAudioDevice(IOAudioDevice *device ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setIndex(UInt32 index ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setDescription(const char *description ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function newUserClient
* @abstract Requests a new user client object for this service.
* @discussion This function is called automatically by I/O Kit when a user process attempts
* to connect to this service. It allocates a new IOAudioEngineUserClient object and increments
* the number of connections for this audio engine. If this is the first user client for this IOAudioEngine,
* it calls startAudioEngine(). There is no need to call this function directly.
* A derived class that requires overriding of newUserClient should override the version with the properties
* parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive
* can be used to select between the two behaviors.
* @param task The task requesting the new user client.
* @param securityID Optional security paramater passed in by the client - ignored.
* @param type Optional user client type passed in by the client - ignored.
* @param handler The new IOUserClient * must be stored in this param on a successful completion.
* @param properties A dictionary of additional properties for the connection.
* @result Returns kIOReturnSuccess on success. May also result kIOReturnError or kIOReturnNoMemory.
*/
virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, IOUserClient **handler ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, OSDictionary *properties, IOUserClient **handler ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function addAudioStream
* @abstract Adds an IOAudioStream to the audio engine.
* @discussion This function is called by the driver to add an IOAudioStream to the audio engine. This must be called at least once to make sure the audio engine has at least one IOAudioStream.
* @param stream The IOAudioStream to be added.
* @result Returns kIOReturnSuccess if the stream was successfully added.
*/
virtual IOReturn addAudioStream(IOAudioStream *stream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOAudioStream *getAudioStream(IOAudioStreamDirection direction, UInt32 channelID ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void lockAllStreams( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void unlockAllStreams( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void updateChannelNumbers( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function resetStatusBuffer
* @abstract Resets the status buffer to its default values.
* @discussion This is called during startAudioEngine() and resumeAudioEngine() to clear out the status buffer
* in preparation of starting up the I/O engine. There is no need to call this directly.
*/
virtual void resetStatusBuffer( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function clearAllSampleBuffers
* @abstract Zeros out all of the sample and mix buffers associated with the IOAudioEngine
* @discussion This is called during resumeAudioEngine() since the audio engine gets started back at the
* beginning of the sample buffer.
*/
virtual void clearAllSampleBuffers( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getCurrentSampleFrame
* @abstract Gets the current sample frame from the IOAudioEngine subclass.
* @result
*/
virtual UInt32 getCurrentSampleFrame() = 0;
/*!
* @function startAudioEngine
* @abstract Starts the audio I/O engine.
* @discussion This method is called automatically when the audio engine is placed into use the first time.
* This must be overridden by the subclass. No call to the superclass's implementation is
* necessary. The subclass's implementation must start up the audio I/O engine. This includes any audio
* engine that needs to be started as well as any interrupts that need to be enabled. Upon successfully
* starting the engine, the subclass's implementation must call setState(kIOAudioEngineRunning). If
* it has also checked the state using getState() earlier in the implementation, the stateLock must be
* acquired for the entire initialization process (using IORecursiveLockLock(stateLock) and
* IORecursiveLockUnlock(stateLock)) to ensure that the state remains consistent. See the general class
* comments for an example.
* @result Must return kIOReturnSuccess on a successful start of the engine.
*/
virtual IOReturn startAudioEngine( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function stopAudioEngine
* @abstract Stops the audio I/O engine.
* @discussion This method is called automatically when the last client disconnects from this audio engine.
* It must be overridden by the subclass. No call to the superclass's implementation is necessary.
* The subclass's implementation must stop the audio I/O engine. The audio engine (if it exists) should
* be stopped and any interrupts disabled. Upon successfully stopping the engine, the subclass must call
* setState(kAudioEngineStopped). If it has also checked the state using getState() earlier in the
* implementation, the stateLock must be acquired for the entire initialization process (using
* IORecursiveLockLock(stateLock) and IORecursiveLockUnlock(stateLock)) to ensure that the state remains
* consistent.
* @result Must return kIOReturnSuccess on a successful stop of the engine.
*/
virtual IOReturn stopAudioEngine( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn pauseAudioEngine( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn resumeAudioEngine( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function performAudioEngineStart
* @abstract Called to start the audio I/O engine
* @discussion This method is called by startAudioEngine(). This must be overridden by the subclass.
* No call to the superclass' implementation is necessary. The subclass' implementation must start up the
* audio I/O engine. This includes any audio engine that needs to be started as well as any interrupts
* that need to be enabled.
* @result Must return kIOReturnSuccess on a successful start of the engine.
*/
virtual IOReturn performAudioEngineStart( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function performAudioEngineStop
* @abstract Called to stop the audio I/O engine
* @discussion This method is called by stopAudioEngine() and pauseAudioEngine.
* This must be overridden by the subclass. No call to the superclass' implementation is
* necessary. The subclass' implementation must stop the audio I/O engine. This includes any audio
* engine that needs to be stopped as well as any interrupts that need to be disabled.
* @result Must return kIOReturnSuccess on a successful stop of the engine.
*/
virtual IOReturn performAudioEngineStop( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getState
* @abstract Returns the current state of the IOAudioEngine.
* @discussion If this method is called in preparation for calling setState(), the stateLock must
* be acquired before the first call to getState() and held until after the last call to setState().
* Be careful not to return from the code acquiring the lock while the lock is being held. That
* will cause a deadlock situation.
* @result The current state of the IOAudioEngine: kIOAudioEngineRunning, kIOAudioEngineStopped.
*/
virtual IOAudioEngineState getState( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getSampleRate
* @abstract Returns the sample rate of the IOAudioEngine in samples per second.
*/
virtual const IOAudioSampleRate *getSampleRate( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn hardwareSampleRateChanged(const IOAudioSampleRate *sampleRate ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getRunEraseHead
* @abstract Returns true if the audio engine will run the erase head when the audio engine is running.
*/
virtual bool getRunEraseHead( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getStatus
* @abstract Returns a pointer to the shared status buffer.
*/
virtual const IOAudioEngineStatus *getStatus( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function timerCallback
* @abstract A static method used as a callback for the IOAudioDevice timer services.
* @discussion This method implements the IOAudioDevice::TimerEvent type.
* @param arg1 The IOAudioEngine that is the target of the event.
* @param device The IOAudioDevice that sent the timer event.
*/
static void timerCallback(OSObject *arg1, IOAudioDevice *device ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function timerFired
* @abstract Indicates the timer has fired.
* @discussion This method is called by timerCallback to indicate the timer has fired. This method calls performErase() and performFlush() to do erase head processing and
* audio engine flushing each time the timer event fires.
*/
virtual void timerFired( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getTimerInterval
* @abstract Gets the timer interval for use by the timer event.
* @discussion This method is called each time the timer event is enabled through addTimer(). The default
* implementation is set to return a value such that the timer event runs n times each cycle of the audio
* engine through the sample buffer. The value n is stored as the instance variable: numErasesPerBuffer.
* The default value of numErasesPerBuffer is set to IOAUDIOENGINE_DEFAULT_NUM_ERASES_PER_BUFFER which is 4.
* A subclass may change the value of numErasesPerBuffer or override getTimerInterval. If it is overridden,
* the subclass should call the superclass's implementation, compare its interval with the superclass's and
* return the smaller of the two.
* @result Returns the interval for the timer event.
*/
virtual AbsoluteTime getTimerInterval( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function performErase
* @abstract Performs erase head processing.
* @discussion This method is called automatically each time the timer event fires and erases the sample
* buffer and mix buffer from the previous location up to the current location of the audio engine.
*/
virtual void performErase( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function performFlush
* @abstract Performs the flush operation.
* @discussion This method is called automatically each time the timer event fires. It stops the audio engine
* if there are no more clients and the audio engine is passed the latest flush ending position.
*/
virtual void performFlush( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void stopEngineAtPosition(IOAudioEnginePosition *endingPosition ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn mixOutputSamples(const void *sourceBuf, void *mixBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn clipOutputSamples(const void *mixBuf, void *sampleBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void resetClipPosition(IOAudioStream *audioStream, UInt32 clipSampleFrame ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn convertInputSamples(const void *sampleBuf, void *destBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void takeTimeStamp(bool incrementLoopCount = true, AbsoluteTime *timestamp = NULL ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn getLoopCountAndTimeStamp(UInt32 *loopCount, AbsoluteTime *timestamp ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*! @function calculateSampleTimeout
* @abstract Calculate the timeout value for the write mixing engine.
* @discussion This method is called from the IOAudioEngineUserClient and used to calculate a time in the future at which a watchdog timer will expire and prevent further mixing in the audio buffer. A subclassing driver will not typically
* need to override this method.
* @param sampleInterval the number of ticks of the system clock between two consecutive samples at the scaled sample rate. This value is calculated by the HAL based on the clock provided through
* Zero Time Stamps and passed down from the HAL through the performClientIO trap. This value is an integer representing the integer part of the number of system ticks between two samples. (see also calculateSampleTimeoutHiRes)
* Note: if useHiResSampleInterval has been called, then this method is called with a different value in sampleInterval. It is the value which is documented in that call (this just becomes a call through to that method)
* @param numSampleFrames The number of sample frames being sent by this call to performClientIO. Informs the timeout value by giving a hint on when this audio application is expected to send another IO.
* @param startingPosition A sample frame position. Includes the position of the frame within the sample buffer as well as the loop count for the ZTS which matches the beginning of the sample buffer.
* @param wakeupTime A pointer to the AbsoluteTime which represents the calculated timeout value.
* @result an IOReturn code.
*/
virtual IOReturn calculateSampleTimeout(AbsoluteTime *sampleInterval, UInt32 numSampleFrames, IOAudioEnginePosition *startingPosition, AbsoluteTime *wakeupTime ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn performFormatChange(IOAudioStream *audioStream, const IOAudioStreamFormat *newFormat, const IOAudioSampleRate *newSampleRate ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void beginConfigurationChange( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void completeConfigurationChange( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void cancelConfigurationChange( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn addDefaultAudioControl(IOAudioControl *defaultAudioControl ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn removeDefaultAudioControl(IOAudioControl *defaultAudioControl ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void removeAllDefaultAudioControls( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual OSString *getGlobalUniqueID( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual OSString *getLocalUniqueID( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
protected:
/*!
* @function initKeys
* @abstract Generates the OSSymbols with the keys.
* @discussion Do not call this directly. This is an internal initialization routine.
*/
static void initKeys( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setNumSampleFramesPerBuffer(UInt32 numSampleFrames ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual UInt32 getNumSampleFramesPerBuffer( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setState
* @abstract Indicates that the audio engine is in the specified state.
* @discussion This method simply sets the internal state of the audio engine to the specified state. It does not
* affect a change to the state. It does however keep other internal state-related attributes consistent.
* For example, it enables or disables the timer as needed when the state changes to running or stopped.
* @param newState The state the audio engine is in.
* @result Returns the old state.
*/
virtual IOAudioEngineState setState(IOAudioEngineState newState ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setSampleRate
* @abstract Records the sample rate of the audio engine.
* @discussion This method must be called during initialization of a new audio engine to record the audio engine's
* initial sample rate. It also is intended to be used to record changes to the sample rate during use.
* Currently changing sample rates after the audio engine has been started is not supported.
* It may require that the sample buffers be re-sized. This will be available in an upcoming release.
* @param newSampleRate The sample rate of the audio engine in samples per second.
*/
virtual void setSampleRate(const IOAudioSampleRate *newSampleRate ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setSampleLatency
* @abstract Sets the sample latency for the audio engine.
* @discussion The sample latency represents the number of samples ahead of the playback head
* that it is safe to write into the sample buffer. The audio device API will never write
* closer to the playback head than the number of samples specified. For input audio engines
* the number of samples is behind the record head.
*/
virtual void setSampleLatency(UInt32 numSamples ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setOutputSampleLatency(UInt32 numSamples ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setInputSampleLatency(UInt32 numSamples ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setSampleOffset(UInt32 numSamples ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setRunEraseHead
* @abstract Tells the audio engine whether or not to run the erase head.
* @discussion By default, output audio engines run the erase head and input audio engines do not. This method can
* be called after setDirection() is called in order to change the default behavior.
* @param runEraseHead The audio engine will run the erase head if this value is true.
*/
virtual void setRunEraseHead(bool runEraseHead ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function clientClosed
* @abstract Called automatically when a user client closes its connection to the audio engine.
* @discussion This method decrements the number of connections to the audio engine and if they reach
* zero, the audio engine is called with a call to stopAudioEngine(). This method should not be called directly.
* @param client The user client that has disconnected.
*/
virtual void clientClosed(IOAudioEngineUserClient *client ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function addTimer
* @abstract Enables the timer event for the audio engine.
* @discussion There is a timer event needed by the IOAudioEngine for processing the erase head
* and performing flushing operations. When the timer fires, the method timerFired() is ultimately
* called which in turn calls performErase() and performFlush(). This is called automatically
* to enable the timer event for this audio engine. It is called by setState() when the audio engine state
* is set to kIOAudioEngineRunning. When the timer is no longer needed, removeTimer() is called.
* There is no need to call this directly.
*/
virtual void addTimer( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function removeTimer
* @abstract Disables the timer event for the audio engine.
* @discussion This method is called automatically to disable the timer event for this audio engine.
* There is need to call it directly. This method is called by setState() when the audio engine state
* is changed from kIOAudioEngineRunning to one of the stopped states.
*/
virtual void removeTimer( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void sendFormatChangeNotification(IOAudioStream *audioStream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void sendNotification(UInt32 notificationType ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 type, IOAudioEngineUserClient **newUserClient ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn _addUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://7529580>
static IOReturn addUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn _removeUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://7529580>
static IOReturn removeUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn detachUserClientsAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn addUserClient(IOAudioEngineUserClient *newUserClient ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn removeUserClient(IOAudioEngineUserClient *userClient ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn detachUserClients( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn startClient(IOAudioEngineUserClient *userClient ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn stopClient(IOAudioEngineUserClient *userClient ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn incrementActiveUserClients( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn decrementActiveUserClients( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void detachAudioStreams( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
void setWorkLoopOnAllAudioControls(IOWorkLoop *wl ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static inline void lockStreamForIO(IOAudioStream *stream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static inline void unlockStreamForIO(IOAudioStream *stream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// These aren't virtual by design
UInt32 getNextStreamID(IOAudioStream * newStream ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
IOAudioStream * getStreamForID(UInt32 streamID ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
IOReturn waitForEngineResume ( void ); // <rdar://15485249>
static void setCommandGateUsage(IOAudioEngine *engine, bool increment ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://8518215>
#if TARGET_OS_OSX && TARGET_CPU_ARM64
/*!
* @function driverDesiresHiResSampleIntervals
* @abstract Queries a subclassing driver to determine whether that driver desires IOAudioEngine to use Hi Resolution sample intervals from the HAL .
* @discussion (see useHiResSampleInterval and calculateSampleTimeoutHiRes for a discussion of these Hi Resolution sample intervals)
* this is a new, pure virtual method which only exists on ARM platforms and which therefore breaks binary compatibility if this is compiled
* on Intel platforms. That is intentional, and that is why it does not use a padding slot.
* A driver subclass which runs on ARM must implement this method
* • the driver subclass should return TRUE if it would like the IOAudioEngine to call useHiResSampleInterval(), thus telling the HAL to use fixed point sample intervals
* • the driver subclass should return FALSE if it would like the IOAudioEngine to use the integer sample intervals (which means more error on ARM machines)
* The driver subclass need not call useHiResSampleInterval() itself, although it may do so if desired
* Because this call does not exist on x86 architectures, a driver which desires to use the fixed point sample intervals on those platforms must call useHiResSampleInterval()
*/
virtual bool driverDesiresHiResSampleIntervals(void) = 0;
#endif
};
#endif /* _IOKIT_IOAUDIOENGINE_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/audio/IOAudioSelectorControl.h | /*
* Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOAUDIOSELECTORCONTROL_H
#define _IOKIT_IOAUDIOSELECTORCONTROL_H
#include <AvailabilityMacros.h>
#ifndef IOAUDIOFAMILY_SELF_BUILD
#include <IOKit/audio/IOAudioControl.h>
#else
#include "IOAudioControl.h"
#endif
class OSString;
class OSArray;
class IOAudioSelectorControl : public IOAudioControl
{
OSDeclareDefaultStructors(IOAudioSelectorControl)
protected:
OSArray *availableSelections;
protected:
struct ExpansionData { };
ExpansionData *reserved;
public:
static IOAudioSelectorControl *createOutputSelector(SInt32 initialValue,
UInt32 channelID,
const char *channelName = 0,
UInt32 cntrlID = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOAudioSelectorControl *createOutputClockSelector(SInt32 initialValue,
UInt32 channelID,
UInt32 clockSource,
const char *channelName = 0,
UInt32 cntrlID = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOAudioSelectorControl *createInputClockSelector(SInt32 initialValue,
UInt32 channelID,
UInt32 clockSource,
const char *channelName = 0,
UInt32 cntrlID = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 0);
virtual IOReturn removeAvailableSelection(SInt32 selectionValue) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 1);
virtual IOReturn replaceAvailableSelection(SInt32 selectionValue, const char *selectionDescription) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 2);
virtual IOReturn replaceAvailableSelection(SInt32 selectionValue, OSString *selectionDescription) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 3);
virtual IOReturn addAvailableSelection(SInt32 selectionValue, OSString *selectionDescription, const char* pszName, OSObject* tag) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://8202424>
private:
OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 0);
OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 1);
OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 2);
OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 3); // <rdar://8202424>
OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 4); // <rdar://8202424>
OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 5); // <rdar://8202424>
OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 6);
OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 7);
OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 8);
OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 9);
OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 10);
OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 11);
OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 12);
OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 13);
OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 14);
OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 15);
public:
static IOAudioSelectorControl *create(SInt32 initialValue,
UInt32 channelID,
const char *channelName = 0,
UInt32 cntrlID = 0,
UInt32 subType = 0,
UInt32 usage = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOAudioSelectorControl *createInputSelector(SInt32 initialValue,
UInt32 channelID,
const char *channelName = 0,
UInt32 cntrlID = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual bool init(SInt32 initialValue,
UInt32 channelID,
const char *channelName = 0,
UInt32 cntrlID = 0,
UInt32 subType = 0,
UInt32 usage = 0,
OSDictionary *properties = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void free() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn addAvailableSelection(SInt32 selectionValue, const char *selectionDescription) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn addAvailableSelection(SInt32 selectionValue, OSString *selectionDescription) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual bool valueExists(SInt32 selectorValue) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn validateValue(OSObject *newValue) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
};
#endif /* _IOKIT_IOAUDIOSELECTORCONTROL_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/audio/IOAudioStream.h | /*
* Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOAUDIOSTREAM_H
#define _IOKIT_IOAUDIOSTREAM_H
#include <IOKit/IOService.h>
#include <AvailabilityMacros.h>
#ifndef IOAUDIOFAMILY_SELF_BUILD
#include <IOKit/audio/IOAudioEngine.h>
#include <IOKit/audio/IOAudioTypes.h>
#else
#include "IOAudioEngine.h"
#include "IOAudioTypes.h"
#endif
class OSSymbol;
class OSArray;
class OSDictionary;
class OSSet;
class IOCommandGate;
class IOAudioControl;
struct IOAudioClientBuffer;
struct IOAudioStreamFormatDesc;
/*!
* @class IOAudioStream
* @abstract This class wraps a single sample buffer in an audio driver.
* @discussion An IOAudioStream represents one hardware sample buffer as well as the direction
* of that buffer, the mix buffer that multiple clients mix into as well as a list of
* all of the formats to which this buffer can be set.
*
* When an IOAudioEngine is created during init time in the driver, an IOAudioStream must be
* created for each sample buffer in the device. Typically, the sample buffer will be interleaved
* (or single channel), as a non-interleaved buffer should be divided into multiple single-channel
* buffers (and multiple IOAudioStreams).
*
* Additionally, when an IOAudioStream is created it must have all of the possible formats (and
* allowed sample rates for each format) set and must have the currently set format specified
* (addAvailableFormat() and setFormat()).
*/
class IOAudioStream : public IOService
{
OSDeclareDefaultStructors(IOAudioStream)
friend class IOAudioEngine;
friend class IOAudioEngineUserClient;
public:
typedef IOReturn (*AudioIOFunction)(const void *mixBuf, void *sampleBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static const OSSymbol *gDirectionKey;
static const OSSymbol *gNumChannelsKey;
static const OSSymbol *gSampleFormatKey;
static const OSSymbol *gNumericRepresentationKey;
static const OSSymbol *gBitDepthKey;
static const OSSymbol *gBitWidthKey;
static const OSSymbol *gAlignmentKey;
static const OSSymbol *gByteOrderKey;
static const OSSymbol *gIsMixableKey;
static const OSSymbol *gDriverTagKey;
static const OSSymbol *gMinimumSampleRateKey;
static const OSSymbol *gMaximumSampleRateKey;
static void initKeys() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static OSDictionary *createDictionaryFromFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, OSDictionary *formatDict = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOAudioStreamFormat *createFormatFromDictionary(const OSDictionary *formatDict, IOAudioStreamFormat *streamFormat = 0, IOAudioStreamFormatExtension *formatExtension = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
IOAudioEngine *audioEngine;
IOWorkLoop *workLoop;
IOCommandGate *commandGate;
IORecursiveLock *streamIOLock;
UInt32 numClients;
IOAudioStreamDirection direction;
IOAudioStreamFormat format;
IOAudioStreamFormatDesc *availableFormats;
OSArray *availableFormatDictionaries;
UInt32 numAvailableFormats;
UInt32 startingChannelID;
UInt32 maxNumChannels;
void *sampleBuffer;
UInt32 sampleBufferSize;
void *mixBuffer;
UInt32 mixBufferSize;
bool streamAllocatedMixBuffer;
AudioIOFunction *audioIOFunctions;
UInt32 numIOFunctions;
bool streamAvailable;
OSSet *defaultAudioControls;
IOAudioEnginePosition startingPosition;
IOAudioEnginePosition clippedPosition;
IOAudioClientBuffer *clientBufferListStart;
IOAudioClientBuffer *clientBufferListEnd;
IOAudioClientBuffer *userClientList;
protected:
enum {
kErrorLogClipMoreThanOneBufferAhead = 0,
kErrorLogClipMoreThanOneBufferAheadPart2,
kErrorLogClipPositionIsOff,
kErrorLogAlreadyClipped,
kErrorLogClipBuffersAreNULL,
kErrorLogClipReturnsAnError,
kErrorLogNumberOfCounters, // needs to be after the last counter
kErrorLogDumpCounters = 0xFFFF
};
struct ExpansionData {
IOAudioStreamFormatExtension streamFormatExtension;
UInt32 mSampleFramesReadByEngine;
IOReturn mClipOutputStatus;
unsigned int mStreamErrorCounts[kErrorLogNumberOfCounters];
bool mStreamErrorCountsUpdated;
};
ExpansionData *reserved;
public:
// New code added here:
// OSMetaClassDeclareReservedUsed(IOAudioStream, 0);
virtual const IOAudioStreamFormatExtension *getFormatExtension() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioStream, 1);
virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, bool callDriver = true) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioStream, 2);
virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, OSDictionary *formatDict, bool callDriver = true) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioStream, 3);
virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, const AudioIOFunction *ioFunctionList = NULL, UInt32 numFunctions = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioStream, 4);
virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, AudioIOFunction ioFunction) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioStream, 5);
virtual bool validateFormat(IOAudioStreamFormat *streamFormat, IOAudioStreamFormatExtension *formatExtension, IOAudioStreamFormatDesc *formatDesc) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioStream, 6);
virtual void setTerminalType(const UInt32 terminalType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioStream, 7);
virtual IOReturn mixOutputSamples(const void *sourceBuf, void *mixBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioStream, 8);
virtual void setSampleLatency(UInt32 numSamples) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioStream, 9);
virtual bool validateFormat(IOAudioStreamFormat *streamFormat, IOAudioStreamFormatExtension *formatExtension, IOAudioStreamFormatDesc *formatDesc, const IOAudioSampleRate *sampleRate) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioStream, 10);
virtual UInt32 getNumSampleFramesRead() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioStream, 11);
virtual void setDefaultNumSampleFramesRead(UInt32) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
private:
OSMetaClassDeclareReservedUsed(IOAudioStream, 0);
OSMetaClassDeclareReservedUsed(IOAudioStream, 1);
OSMetaClassDeclareReservedUsed(IOAudioStream, 2);
OSMetaClassDeclareReservedUsed(IOAudioStream, 3);
OSMetaClassDeclareReservedUsed(IOAudioStream, 4);
OSMetaClassDeclareReservedUsed(IOAudioStream, 5);
OSMetaClassDeclareReservedUsed(IOAudioStream, 6);
OSMetaClassDeclareReservedUsed(IOAudioStream, 7);
OSMetaClassDeclareReservedUsed(IOAudioStream, 8);
OSMetaClassDeclareReservedUsed(IOAudioStream, 9);
OSMetaClassDeclareReservedUsed(IOAudioStream, 10);
OSMetaClassDeclareReservedUsed(IOAudioStream, 11);
OSMetaClassDeclareReservedUnused(IOAudioStream, 12);
OSMetaClassDeclareReservedUnused(IOAudioStream, 13);
OSMetaClassDeclareReservedUnused(IOAudioStream, 14);
OSMetaClassDeclareReservedUnused(IOAudioStream, 15);
OSMetaClassDeclareReservedUnused(IOAudioStream, 16);
OSMetaClassDeclareReservedUnused(IOAudioStream, 17);
OSMetaClassDeclareReservedUnused(IOAudioStream, 18);
OSMetaClassDeclareReservedUnused(IOAudioStream, 19);
OSMetaClassDeclareReservedUnused(IOAudioStream, 20);
OSMetaClassDeclareReservedUnused(IOAudioStream, 21);
OSMetaClassDeclareReservedUnused(IOAudioStream, 22);
OSMetaClassDeclareReservedUnused(IOAudioStream, 23);
OSMetaClassDeclareReservedUnused(IOAudioStream, 24);
OSMetaClassDeclareReservedUnused(IOAudioStream, 25);
OSMetaClassDeclareReservedUnused(IOAudioStream, 26);
OSMetaClassDeclareReservedUnused(IOAudioStream, 27);
OSMetaClassDeclareReservedUnused(IOAudioStream, 28);
OSMetaClassDeclareReservedUnused(IOAudioStream, 29);
OSMetaClassDeclareReservedUnused(IOAudioStream, 30);
OSMetaClassDeclareReservedUnused(IOAudioStream, 31);
OSMetaClassDeclareReservedUnused(IOAudioStream, 32);
OSMetaClassDeclareReservedUnused(IOAudioStream, 33);
OSMetaClassDeclareReservedUnused(IOAudioStream, 34);
OSMetaClassDeclareReservedUnused(IOAudioStream, 35);
OSMetaClassDeclareReservedUnused(IOAudioStream, 36);
OSMetaClassDeclareReservedUnused(IOAudioStream, 37);
OSMetaClassDeclareReservedUnused(IOAudioStream, 38);
OSMetaClassDeclareReservedUnused(IOAudioStream, 39);
OSMetaClassDeclareReservedUnused(IOAudioStream, 40);
OSMetaClassDeclareReservedUnused(IOAudioStream, 41);
OSMetaClassDeclareReservedUnused(IOAudioStream, 42);
OSMetaClassDeclareReservedUnused(IOAudioStream, 43);
OSMetaClassDeclareReservedUnused(IOAudioStream, 44);
OSMetaClassDeclareReservedUnused(IOAudioStream, 45);
OSMetaClassDeclareReservedUnused(IOAudioStream, 46);
OSMetaClassDeclareReservedUnused(IOAudioStream, 47);
public:
virtual bool initWithAudioEngine(IOAudioEngine *engine, IOAudioStreamDirection dir, UInt32 startChannelID, const char *streamDescription = NULL, OSDictionary *properties = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void free() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void stop(IOService *provider) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOWorkLoop *getWorkLoop() const;
virtual IOReturn setProperties(OSObject *properties) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOAudioStreamDirection getDirection() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setSampleBuffer(void *buffer, UInt32 size) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void *getSampleBuffer() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual UInt32 getSampleBufferSize() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setMixBuffer(void *buffer, UInt32 size) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void *getMixBuffer() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual UInt32 getMixBufferSize() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void numSampleFramesPerBufferChanged() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void clearSampleBuffer() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setIOFunction(AudioIOFunction ioFunction) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setIOFunctionList(const AudioIOFunction *ioFunctionList, UInt32 numFunctions) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual const IOAudioStreamFormat *getFormat() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn setFormatAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn _setFormatAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://8568040,8691669>
virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, bool callDriver = true) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn setFormat(OSDictionary *formatDict) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, OSDictionary *formatDict, bool callDriver = true) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn hardwareFormatChanged(const IOAudioStreamFormat *streamFormat) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, const AudioIOFunction *ioFunctionList = NULL, UInt32 numFunctions = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, AudioIOFunction ioFunction) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void clearAvailableFormats() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual bool validateFormat(IOAudioStreamFormat *streamFormat, IOAudioStreamFormatDesc *formatDesc) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual UInt32 getStartingChannelID() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual UInt32 getMaxNumChannels() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setStreamAvailable(bool available) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual bool getStreamAvailable() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn addDefaultAudioControl(IOAudioControl *defaultAudioControl) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void removeDefaultAudioControls() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
protected:
virtual void lockStreamForIO() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void unlockStreamForIO() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void updateNumClients() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn addClient(IOAudioClientBuffer *clientBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void removeClient(IOAudioClientBuffer *clientBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual UInt32 getNumClients() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn processOutputSamples(IOAudioClientBuffer *clientBuffer, UInt32 firstSampleFrame, UInt32 loopCount, bool samplesAvailable) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn readInputSamples(IOAudioClientBuffer *clientBuffer, UInt32 firstSampleFrame) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void resetClipInfo() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void clipIfNecessary() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void clipOutputSamples(UInt32 startingSampleFrame, UInt32 numSampleFrames) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setStartingChannelNumber(UInt32 channelNumber) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
private:
virtual void setDirection(IOAudioStreamDirection dir) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
void safeLogError(int error , long unsigned int arg1 , long unsigned int arg2 , long unsigned int arg3 , long unsigned int arg4 , void* arg5, void* arg6) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
};
#endif /* _IOKIT_IOAUDIOSTREAM_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/audio/IOAudioEngineUserClient.h | /*
* Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOAUDIOENGINEUSERCLIENT_H
#define _IOKIT_IOAUDIOENGINEUSERCLIENT_H
#include <IOKit/IOUserClient.h>
#include <AvailabilityMacros.h>
#ifndef IOAUDIOFAMILY_SELF_BUILD
#include <IOKit/audio/IOAudioEngine.h>
#include <IOKit/audio/IOAudioTypes.h>
#else
#include "IOAudioEngine.h"
#include "IOAudioTypes.h"
#endif
#include <IOKit/IOBufferMemoryDescriptor.h>
class IOAudioEngine;
class IOAudioStream;
class IOMemoryDescriptor;
class IOCommandGate;
class IOWorkLoop;
class IOAudioEngineUserClient;
class IOAudioClientBufferSet;
struct IOAudioFormatNotification;
#define kDriverHelper_DriverHostEntitlement "com.apple.private.audio.driver-host" // XXX copied from AudioHAL/DriverHelper/DriverHelper.h
typedef struct IOAudioClientBuffer
{
IOAudioEngineUserClient *userClient;
IOAudioStream *audioStream;
void *sourceBuffer;
IOMemoryDescriptor *sourceBufferDescriptor;
IOMemoryMap *sourceBufferMap;
void *unmappedSourceBuffer;
UInt32 numSampleFrames;
UInt32 numChannels;
IOAudioEnginePosition mixedPosition;
struct IOAudioClientBuffer *mNextBuffer32;
struct IOAudioClientBuffer *nextClip;
struct IOAudioClientBuffer *previousClip;
struct IOAudioClientBuffer *nextClient;
IOAudioBufferDataDescriptor *bufferDataDescriptor;
} IOAudioClientBuffer;
/* IOAudioClientBuffer64 added for binary compatibility with old PPC drivers covered by <rdar://problem/4651809> */
typedef struct IOAudioClientBuffer64
{
IOAudioClientBuffer mAudioClientBuffer32;
mach_vm_address_t mUnmappedSourceBuffer64;
struct IOAudioClientBuffer64 *mNextBuffer64;
} IOAudioClientBuffer64;
typedef struct IOAudioClientBufferExtendedInfo
{
// Added stuff for registerClientParameterBuffer
UInt32 bufferSetID;
void *paramBuffer;
IOMemoryDescriptor *paramBufferDescriptor;
IOMemoryMap *paramBufferMap;
void *unmappedParamBuffer;
struct IOAudioClientBufferExtendedInfo *mNextExtended;
} IOAudioClientBufferExtendedInfo;
/* IOAudioClientBufferExtendedInfo64 added for binary compatibility with old PPC drivers covered by <rdar://problem/4651809> */
typedef struct IOAudioClientBufferExtendedInfo64
{
IOAudioClientBufferExtendedInfo mAudioClientBufferExtended32;
mach_vm_address_t mUnmappedParamBuffer64;
struct IOAudioClientBufferExtendedInfo64 *mNextExtended64;
} IOAudioClientBufferExtendedInfo64;
class IOAudioEngineUserClient : public IOUserClient
{
OSDeclareDefaultStructors(IOAudioEngineUserClient)
friend class IOAudioEngine;
friend class IOAudioClientBufferSet;
friend class IOAudioStream;
protected:
IOAudioEngine *audioEngine;
IOWorkLoop *workLoop;
IOCommandGate *commandGate;
IOExternalMethod old_methods[5]; // It's size can't be changed for binary compatibility reasons, no longer used.
IOExternalTrap trap;
task_t clientTask;
UInt32 numSampleFrames; // Never used...
IOAudioClientBufferSet *clientBufferSetList;
IORecursiveLock *clientBufferLock;
IOAudioNotificationMessage *notificationMessage;
bool online;
protected:
struct ExpansionData {
IOAudioClientBufferExtendedInfo64 *extendedInfo;
UInt32 classicMode; // System 9! - no longer need
UInt32 commandGateStatus; // <rdar://8518215>
SInt32 commandGateUsage; // <rdar://8518215>
UInt32 connectionID;
};
// <rdar://101000004> START
ExpansionData *reserved;
public:
virtual IOReturn externalMethod( uint32_t selector, IOExternalMethodArguments * arguments, IOExternalMethodDispatch * dispatch,
OSObject * target, void * reference) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// New code added here...
// OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 0);
virtual IOReturn registerClientParameterBuffer (void * parameterBuffer, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // unused function
// OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 1);
virtual IOAudioClientBufferExtendedInfo * findExtendedInfo(UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 2);
virtual IOReturn getNearestStartTime(IOAudioStream *audioStream, IOAudioTimeStamp *ioTimeStamp, UInt32 isInput) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 3);
virtual IOReturn getClientNearestStartTime(IOAudioStream *audioStream, IOAudioTimeStamp *ioTimeStamp, UInt32 isInput) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 4);
virtual IOReturn safeRegisterClientBuffer(UInt32 audioStreamIndex, void * sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 5);
virtual bool initWithAudioEngine(IOAudioEngine *engine, task_t task, void *securityToken, UInt32 type, OSDictionary *properties) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 6); <rdar://problems/5321701>
virtual IOReturn safeRegisterClientBuffer64(UInt32 audioStreamIndex, mach_vm_address_t * sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 7); <rdar://problems/5321701>
virtual IOReturn registerClientBuffer64(IOAudioStream *audioStream, mach_vm_address_t sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 8); <rdar://problems/5321701>
virtual IOReturn registerBuffer64(IOAudioStream *audioStream, mach_vm_address_t sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 9); <rdar://problems/5321701>
virtual IOReturn unregisterBuffer64(mach_vm_address_t sourceBuffer, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 10); <rdar://problems/5321701>
virtual IOReturn unregisterClientBuffer64(mach_vm_address_t * sourceBuffer, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 11); <rdar://problems/5321701>
virtual IOAudioClientBufferExtendedInfo64 * findExtendedInfo64(UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
private:
OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 0);
OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 1);
OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 2);
OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 3);
OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 4);
OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 5);
OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 6);
OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 7);
OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 8);
OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 9);
OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 10);
OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 11);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 12);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 13);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 14);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 15);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 16);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 17);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 18);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 19);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 20);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 21);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 22);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 23);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 24);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 25);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 26);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 27);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 28);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 29);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 30);
OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 31);
protected:
virtual IOReturn clientClose() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn clientDied() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn _closeClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://7529580>
static IOReturn closeClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn closeClient() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn clientMemoryForType(UInt32 type, UInt32 *flags, IOMemoryDescriptor **memory) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOExternalMethod *getExternalMethodForIndex(UInt32 index) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOExternalTrap *getExternalTrapForIndex(UInt32 index) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn registerNotificationPort(mach_port_t port, UInt32 type, UInt32 refCon) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn _registerNotificationAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://7529580>
static IOReturn registerNotificationAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn registerNotification(mach_port_t port, UInt32 refCon) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setOnline(bool newOnline) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn performClientOutput(UInt32 firstSampleFrame, UInt32 loopCount, IOAudioClientBufferSet *bufferSet, UInt32 sampleIntervalHi, UInt32 sampleIntervalLo) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn performClientInput(UInt32 firstSampleFrame, IOAudioClientBufferSet *bufferSet) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void performWatchdogOutput(IOAudioClientBufferSet *clientBufferSet, UInt32 generationCount) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void lockBuffers() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void unlockBuffers() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static void setCommandGateUsage(IOAudioEngineUserClient *userClient, bool increment) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://8518215>
public:
static IOAudioEngineUserClient *withAudioEngine(IOAudioEngine *engine, task_t clientTask, void *securityToken, UInt32 type) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOAudioEngineUserClient *withAudioEngine(IOAudioEngine *engine, task_t clientTask, void *securityToken, UInt32 type, OSDictionary *properties) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual bool initWithAudioEngine(IOAudioEngine *engine, task_t task, void *securityToken, UInt32 type) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void free() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void freeClientBufferSetList() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void freeClientBuffer(IOAudioClientBuffer64 *clientBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void stop(IOService *provider) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual bool isOnline() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn registerBuffer(IOAudioStream *audioStream, void* sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn unregisterBuffer( void * sourceBuffer, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn _registerBufferAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://7529580>
static IOReturn registerBufferAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn _unregisterBufferAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://7529580>
static IOReturn unregisterBufferAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn registerClientBuffer(IOAudioStream *audioStream, void * sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn unregisterClientBuffer(void * sourceBuffer, UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn _getNearestStartTimeAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://7529580>
static IOReturn getNearestStartTimeAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOAudioClientBufferSet *findBufferSet(UInt32 bufferSetID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void removeBufferSet(IOAudioClientBufferSet *bufferSet) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn getConnectionID(UInt32 *connectionID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn clientStart() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn clientStop() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn _startClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://7529580>
static IOReturn startClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn _stopClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://7529580>
static IOReturn stopClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn startClient() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn stopClient() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn performClientIO(UInt32 firstSampleFrame, UInt32 loopCount, bool inputIO, UInt32 bufferSetID, UInt32 sampleIntervalHi, UInt32 sampleIntervalLo) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void sendFormatChangeNotification(IOAudioStream *audioStream) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn sendNotification(UInt32 notificationType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
};
// <rdar://101000004> END
#endif /* _IOKIT_IOAUDIOENGINEUSERCLIENT_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/audio/IOAudioControlUserClient.h | /*
* Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOAUDIOCONTROLUSERCLIENT_H
#define _IOKIT_IOAUDIOCONTROLUSERCLIENT_H
#include <AvailabilityMacros.h>
#include <IOKit/IOUserClient.h>
#ifndef IOAUDIOFAMILY_SELF_BUILD
#include <IOKit/audio/IOAudioTypes.h>
#else
#include "IOAudioTypes.h"
#endif
class IOAudioControl;
class IOAudioControlUserClient : public IOUserClient
{
OSDeclareDefaultStructors(IOAudioControlUserClient)
protected:
task_t clientTask;
IOAudioControl * audioControl;
IOAudioNotificationMessage * notificationMessage;
virtual IOReturn clientClose( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn clientDied( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
protected:
struct ExpansionData { };
ExpansionData *reserved;
public:
virtual void sendChangeNotification(UInt32 notificationType ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioControlUserClient, 1);
virtual bool initWithAudioControl(IOAudioControl *control, task_t owningTask, void *securityID, UInt32 type, OSDictionary *properties ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
private:
OSMetaClassDeclareReservedUsed(IOAudioControlUserClient, 0);
OSMetaClassDeclareReservedUsed(IOAudioControlUserClient, 1);
OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 2);
OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 3);
OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 4);
OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 5);
OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 6);
OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 7);
OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 8);
OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 9);
OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 10);
OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 11);
OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 12);
OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 13);
OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 14);
OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 15);
public:
static IOAudioControlUserClient *withAudioControl(IOAudioControl *control, task_t clientTask, void *securityID, UInt32 type ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOAudioControlUserClient *withAudioControl(IOAudioControl *control, task_t clientTask, void *securityID, UInt32 type, OSDictionary *properties ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual bool initWithAudioControl(IOAudioControl *control, task_t owningTask, void *securityID, UInt32 type ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void free( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn registerNotificationPort(mach_port_t port, UInt32 type, UInt32 refCon ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void sendValueChangeNotification( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
};
#endif /* _IOKIT_IOAUDIOCONTROLUSERCLIENT_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/audio/IOAudioTypes.h | /*
* Copyright (c) 1998-2013 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOAUDIOTYPES_H
#define _IOKIT_IOAUDIOTYPES_H
#include <libkern/OSTypes.h>
#include <mach/message.h>
/*!
* @enum IOAudioEngineMemory
* @abstract Used to identify the type of memory requested by a client process to be mapped into its process space
* @discussion This is the parameter to the type field of IOMapMemory when called on an IOAudioEngine. This is
* only intended for use by the Audio Device API library.
* @constant kIOAudioSampleBuffer This requests the IOAudioEngine's sample buffer
* @constant kIOAudioStatusBuffer This requests the IOAudioEngine's status buffer. It's type is IOAudioEngineStatus.
* @constant kIOAudioMixBuffer This requests the IOAudioEngine's mix buffer
*/
typedef enum _IOAudioEngineMemory {
kIOAudioStatusBuffer = 0,
kIOAudioSampleBuffer = 1,
kIOAudioMixBuffer = 2,
kIOAudioBytesInInputBuffer = 3,
kIOAudioBytesInOutputBuffer = 4
} IOAudioEngineMemory;
/*!
* @enum IOAudioEngineCalls
* @abstract The set of constants passed to IOAudioEngineUserClient::getExternalMethodForIndex() when making calls
* from the IOAudioFamily user client code.
*/
typedef enum _IOAudioEngineCalls {
kIOAudioEngineCallRegisterClientBuffer = 0,
kIOAudioEngineCallUnregisterClientBuffer = 1,
kIOAudioEngineCallGetConnectionID = 2,
kIOAudioEngineCallStart = 3,
kIOAudioEngineCallStop = 4,
kIOAudioEngineCallGetNearestStartTime = 5
} IOAudioEngineCalls;
/*! @defined kIOAudioEngineNumCalls The number of elements in the IOAudioEngineCalls enum. */
#define kIOAudioEngineNumCalls 6
typedef enum _IOAudioEngineTraps {
kIOAudioEngineTrapPerformClientIO = 0
} IOAudioEngineTraps;
typedef enum _IOAudioEngineNotifications {
kIOAudioEngineAllNotifications = 0,
kIOAudioEngineStreamFormatChangeNotification = 1,
kIOAudioEngineChangeNotification = 2,
kIOAudioEngineStartedNotification = 3,
kIOAudioEngineStoppedNotification = 4,
kIOAudioEnginePausedNotification = 5,
kIOAudioEngineResumedNotification = 6
} IOAudioEngineNotifications;
/*!
* @enum IOAudioEngineState
* @abstract Represents the state of an IOAudioEngine
* @constant kIOAudioEngineRunning The IOAudioEngine is currently running - it is transferring data to or
* from the device.
* @constant kIOAudioEngineStopped The IOAudioEngine is currently stopped - no activity is occurring.
*/
typedef enum _IOAudioEngineState {
kIOAudioEngineStopped = 0,
kIOAudioEngineRunning = 1,
kIOAudioEnginePaused = 2,
kIOAudioEngineResumed = 3
} IOAudioEngineState;
/*!
* @typedef IOAudioEngineStatus
* @abstract Shared-memory structure giving audio engine status
* @discussion
* @field fVersion Indicates version of this structure
* @field fCurrentLoopCount Number of times around the ring buffer since the audio engine started
* @field fLastLoopTime Timestamp of the last time the ring buffer wrapped
* @field fEraseHeadSampleFrame Location of the erase head in sample frames - erased up to but not
* including the given sample frame
*/
typedef struct _IOAudioEngineStatus {
UInt32 fVersion;
volatile UInt32 fCurrentLoopCount;
volatile AbsoluteTime fLastLoopTime;
volatile UInt32 fEraseHeadSampleFrame;
} IOAudioEngineStatus;
#define kIOAudioEngineCurrentStatusStructVersion 2
typedef struct _IOAudioStreamFormat {
UInt32 fNumChannels;
UInt32 fSampleFormat;
UInt32 fNumericRepresentation;
UInt8 fBitDepth;
UInt8 fBitWidth;
UInt8 fAlignment;
UInt8 fByteOrder;
UInt8 fIsMixable;
UInt32 fDriverTag;
} IOAudioStreamFormat;
#define kFormatExtensionInvalidVersion 0
#define kFormatExtensionCurrentVersion 1
typedef struct _IOAudioStreamFormatExtension {
UInt32 fVersion;
UInt32 fFlags;
UInt32 fFramesPerPacket;
UInt32 fBytesPerPacket;
} IOAudioStreamFormatExtension;
typedef struct _IOAudioBufferDataDescriptor {
UInt32 fActualDataByteSize;
UInt32 fActualNumSampleFrames;
UInt32 fTotalDataByteSize;
UInt32 fNominalDataByteSize;
UInt8 fData[1];
} IOAudioBufferDataDescriptor;
#define kStreamDataDescriptorInvalidVersion 0
#define kStreamDataDescriptorCurrentVersion 1
typedef struct _IOAudioStreamDataDescriptor {
UInt32 fVersion;
UInt32 fNumberOfStreams;
UInt32 fStreamLength[1]; // Array with fNumberOfStreams number of entries
} IOAudioStreamDataDescriptor;
typedef struct _IOAudioSampleIntervalDescriptor {
UInt32 sampleIntervalHi;
UInt32 sampleIntervalLo;
} IOAudioSampleIntervalDescriptor;
/*!
@struct SMPTETime
@abstract A structure for holding a SMPTE time.
@field fSubframes
The number of subframes in the full message.
@field fSubframeDivisor
The number of subframes per frame (typically 80).
@field fCounter
The total number of messages received.
@field fType
The kind of SMPTE time using the SMPTE time type constants.
@field fFlags
A set of flags that indicate the SMPTE state.
@field fHours
The number of hourse in the full message.
@field fMinutes
The number of minutes in the full message.
@field fSeconds
The number of seconds in the full message.
@field fFrames
The number of frames in the full message.
*/
typedef struct _IOAudioSMPTETime
{
SInt16 fSubframes;
SInt16 fSubframeDivisor;
UInt32 fCounter;
UInt32 fType;
UInt32 fFlags;
SInt16 fHours;
SInt16 fMinutes;
SInt16 fSeconds;
SInt16 fFrames;
} IOAudioSMPTETime;
// constants describing SMPTE types (taken from the MTC spec), <rdar://11955717>
enum
{
kIOAudioSMPTETimeType24 = 0,
kIOAudioSMPTETimeType25 = 1,
kIOAudioSMPTETimeType30Drop = 2,
kIOAudioSMPTETimeType30 = 3,
kIOAudioSMPTETimeType2997 = 4,
kIOAudioSMPTETimeType2997Drop = 5,
kIOAudioSMPTETimeType60 = 6,
kIOAudioSMPTETimeType5994 = 7,
kIOAudioSMPTETimeType60Drop = 8,
kIOAudioSMPTETimeType5994Drop = 9,
kIOAudioSMPTETimeType50 = 10,
kIOAudioSMPTETimeType2398 = 11
};
// flags describing a SMPTE time stamp
enum
{
kIOAudioSMPTETimeValid = (1L << 0), // the full time is valid
kIOAudioSMPTETimeRunning = (1L << 1) // time is running
};
// A struct for encapsulating the parts of a time stamp. The flags
// say which fields are valid.
typedef struct _IOAudioTimeStamp
{
UInt64 fSampleTime; // the absolute sample time, was a Float64
UInt64 fHostTime; // the host's root timebase's time
UInt64 fRateScalar; // the system rate scalar, was a Float64
UInt64 fWordClockTime; // the word clock time
IOAudioSMPTETime fSMPTETime; // the SMPTE time
UInt32 fFlags; // the flags indicate which fields are valid
UInt32 fReserved; // reserved, pads the structure out to force 8 byte alignment
} IOAudioTimeStamp;
// flags for the AudioTimeStamp sturcture
enum
{
kIOAudioTimeStampSampleTimeValid = (1L << 0),
kIOAudioTimeStampHostTimeValid = (1L << 1),
kIOAudioTimeStampRateScalarValid = (1L << 2),
kIOAudioTimeStampWordClockTimeValid = (1L << 3),
kIOAudioTimeStampSMPTETimeValid = (1L << 4)
};
// Some commonly used combinations of timestamp flags
enum
{
kIOAudioTimeStampSampleHostTimeValid = (kIOAudioTimeStampSampleTimeValid | kIOAudioTimeStampHostTimeValid)
};
/*!
* @enum IOAudioStreamDirection
* @abstract Represents the direction of an IOAudioStream
* @constant kIOAudioStreamDirectionOutput Output buffer
* @constant kIOAudioStreamDirectionInput Input buffer
*/
typedef enum _IOAudioStreamDirection {
kIOAudioStreamDirectionOutput = 0,
kIOAudioStreamDirectionInput = 1
} IOAudioStreamDirection;
enum {
kIOAudioDeviceCanBeDefaultNothing = 0,
kIOAudioDeviceCanBeDefaultInput = (1L << 0),
kIOAudioDeviceCanBeDefaultOutput = (1L << 1),
kIOAudioDeviceCanBeSystemOutput = (1L << 2)
};
/*!
* @defined kIOAudioEngineDefaultMixBufferSampleSize
*/
#define kIOAudioEngineDefaultMixBufferSampleSize sizeof(float)
/* The following are for use only by the IOKit.framework audio family code */
/*!
* @enum IOAudioControlCalls
* @abstract The set of constants passed to IOAudioControlUserClient::getExternalMethodForIndex() when making calls
* from the IOAudioFamily user client code.
* @constant kIOAudioControlCallSetValue Used to set the value of an IOAudioControl.
* @constant kIOAudioControlCallGetValue Used to get the value of an IOAudioControl.
*/
typedef enum _IOAudioControlCalls {
kIOAudioControlCallSetValue = 0,
kIOAudioControlCallGetValue = 1
} IOAudioControlCalls;
/*! @defined kIOAudioControlNumCalls The number of elements in the IOAudioControlCalls enum. */
#define kIOAudioControlNumCalls 2
/*!
* @enum IOAudioControlNotifications
* @abstract The set of constants passed in the type field of IOAudioControlUserClient::registerNotificaitonPort().
* @constant kIOAudioControlValueChangeNotification Used to request value change notifications.
* @constant kIOAudioControlRangeChangeNotification Used to request range change notifications.
*/
typedef enum _IOAudioControlNotifications {
kIOAudioControlValueChangeNotification = 0,
kIOAudioControlRangeChangeNotification = 1
} IOAudioControlNotifications;
/*!
* @struct IOAudioNotificationMessage
* @abstract Used in the mach message for IOAudio notifications.
* @field messageHeader Standard mach message header
* @field ref The param passed to registerNotificationPort() in refCon.
*/
typedef struct _IOAudioNotificationMessage {
mach_msg_header_t messageHeader;
UInt32 type;
UInt32 ref;
void * sender;
} IOAudioNotificationMessage;
typedef struct _IOAudioSampleRate {
UInt32 whole;
UInt32 fraction;
} IOAudioSampleRate;
#define kNoIdleAudioPowerDown 0xffffffffffffffffULL
enum {
kIOAudioPortTypeOutput = 'outp',
kIOAudioPortTypeInput = 'inpt',
kIOAudioPortTypeMixer = 'mixr',
kIOAudioPortTypePassThru = 'pass',
kIOAudioPortTypeProcessing = 'proc'
};
enum {
kIOAudioOutputPortSubTypeInternalSpeaker = 'ispk',
kIOAudioOutputPortSubTypeExternalSpeaker = 'espk',
kIOAudioOutputPortSubTypeHeadphones = 'hdpn',
kIOAudioOutputPortSubTypeLine = 'line',
kIOAudioOutputPortSubTypeSPDIF = 'spdf',
kIOAudioInputPortSubTypeInternalMicrophone = 'imic',
kIOAudioInputPortSubTypeExternalMicrophone = 'emic',
kIOAudioInputPortSubTypeCD = 'cd ',
kIOAudioInputPortSubTypeLine = 'line',
kIOAudioInputPortSubTypeSPDIF = 'spdf'
};
enum {
kIOAudioControlTypeLevel = 'levl',
kIOAudioControlTypeToggle = 'togl',
kIOAudioControlTypeJack = 'jack',
kIOAudioControlTypeSelector = 'slct'
};
// <rdar://8325563> Added kIOAudioToggleControlSubTypePhantomPower, kIOAudioToggleControlSubTypePhaseInvert &
// kIOAudioSelectorControlSubTypeChannelHighPassFilter
enum {
kIOAudioLevelControlSubTypeVolume = 'vlme',
kIOAudioLevelControlSubTypeLFEVolume = 'subv',
kIOAudioLevelControlSubTypePRAMVolume = 'pram',
kIOAudioToggleControlSubTypeMute = 'mute',
kIOAudioToggleControlSubTypeSolo = 'solo',
kIOAudioToggleControlSubTypeLFEMute = 'subm',
kIOAudioToggleControlSubTypeiSubAttach = 'atch',
kIOAudioToggleControlSubTypePhantomPower = 'phan',
kIOAudioToggleControlSubTypePhaseInvert = 'phsi',
kIOAudioSelectorControlSubTypeOutput = 'outp',
kIOAudioSelectorControlSubTypeInput = 'inpt',
kIOAudioSelectorControlSubTypeClockSource = 'clck',
kIOAudioSelectorControlSubTypeDestination = 'dest',
kIOAudioSelectorControlSubTypeChannelNominalLineLevel = 'nlev',
kIOAudioSelectorControlSubTypeChannelLevelPlus4dBu = '4dbu',
kIOAudioSelectorControlSubTypeChannelLevelMinus10dBV = '10db',
kIOAudioSelectorControlSubTypeChannelLevelMinus20dBV = '20db',
kIOAudioSelectorControlSubTypeChannelLevelMicLevel = 'micl',
kIOAudioSelectorControlSubTypeChannelLevelInstrumentLevel = 'istl',
kIOAudioSelectorControlSubTypeChannelHighPassFilter = 'hipf'
};
enum {
kIOAudioControlUsageOutput = 'outp',
kIOAudioControlUsageInput = 'inpt',
kIOAudioControlUsagePassThru = 'pass',
kIOAudioControlUsageCoreAudioProperty = 'prop'
};
enum {
kIOAudioControlChannelNumberInactive = -1,
kIOAudioControlChannelIDAll = 0,
kIOAudioControlChannelIDDefaultLeft = 1,
kIOAudioControlChannelIDDefaultRight = 2,
kIOAudioControlChannelIDDefaultCenter = 3,
kIOAudioControlChannelIDDefaultLeftRear = 4,
kIOAudioControlChannelIDDefaultRightRear = 5,
kIOAudioControlChannelIDDefaultSub = 6,
kIOAudioControlChannelIDDefaultFrontLeftCenter = 7,
kIOAudioControlChannelIDDefaultFrontRightCenter = 8,
kIOAudioControlChannelIDDefaultRearCenter = 9,
kIOAudioControlChannelIDDefaultSurroundLeft = 10,
kIOAudioControlChannelIDDefaultSurroundRight = 11
};
enum {
kIOAudioSelectorControlSelectionValueNone = 'none',
// Output-specific selection IDs
kIOAudioSelectorControlSelectionValueInternalSpeaker = 'ispk',
kIOAudioSelectorControlSelectionValueExternalSpeaker = 'espk',
kIOAudioSelectorControlSelectionValueHeadphones = 'hdpn',
// Input-specific selection IDs
kIOAudioSelectorControlSelectionValueInternalMicrophone = 'imic',
kIOAudioSelectorControlSelectionValueExternalMicrophone = 'emic',
kIOAudioSelectorControlSelectionValueCD = 'cd ',
// Common selection IDs
kIOAudioSelectorControlSelectionValueLine = 'line',
kIOAudioSelectorControlSelectionValueSPDIF = 'spdf'
};
enum {
kIOAudioStreamSampleFormatLinearPCM = 'lpcm',
kIOAudioStreamSampleFormatIEEEFloat = 'ieee',
kIOAudioStreamSampleFormatALaw = 'alaw',
kIOAudioStreamSampleFormatMuLaw = 'ulaw',
kIOAudioStreamSampleFormatMPEG = 'mpeg',
kIOAudioStreamSampleFormatAC3 = 'ac-3',
kIOAudioStreamSampleFormat1937AC3 = 'cac3',
kIOAudioStreamSampleFormat1937MPEG1 = 'mpg1',
kIOAudioStreamSampleFormat1937MPEG2 = 'mpg2',
kIOAudioStreamSampleFormatTimeCode = 'time' // a stream of IOAudioTimeStamp structures that capture any incoming time code information
};
enum {
kIOAudioStreamNumericRepresentationSignedInt = 'sint',
kIOAudioStreamNumericRepresentationUnsignedInt = 'uint',
kIOAudioStreamNumericRepresentationIEEE754Float = 'flot'
};
enum {
kIOAudioClockSelectorTypeInternal = 'int ',
kIOAudioClockSelectorTypeExternal = 'ext ',
kIOAudioClockSelectorTypeAESEBU = 'asbu',
kIOAudioClockSelectorTypeTOSLink = 'tosl',
kIOAudioClockSelectorTypeSPDIF = 'spdf',
kIOAudioClockSelectorTypeADATOptical = 'adto',
kIOAudioClockSelectorTypeADAT9Pin = 'adt9',
kIOAudioClockSelectorTypeSMPTE = 'smpt',
kIOAudioClockSelectorTypeVideo = 'vdeo',
kIOAudioClockSelectorTypeControl = 'cnrl',
kIOAudioClockSelectorTypeOther = 'othr',
};
enum {
kIOAudioStreamAlignmentLowByte = 0,
kIOAudioStreamAlignmentHighByte = 1
};
enum {
kIOAudioStreamByteOrderBigEndian = 0,
kIOAudioStreamByteOrderLittleEndian = 1
};
enum {
kIOAudioLevelControlNegativeInfinity = 0xffffffff
};
enum {
#ifndef __OPEN_SOURCE__
kIOAudioBuiltInSystemClockDomain = 0x737973,
#endif
kIOAudioNewClockDomain = 0xffffffff
};
// Device connection types
#ifndef __OPEN_SOURCE__
// <rdar://7130813> Added kIOAudioDeviceTransportTypeDisplayPort
#endif
enum {
kIOAudioDeviceTransportTypeBuiltIn = 'bltn',
kIOAudioDeviceTransportTypePCI = 'pci ',
kIOAudioDeviceTransportTypeUSB = 'usb ',
kIOAudioDeviceTransportTypeFireWire = '1394',
kIOAudioDeviceTransportTypeNetwork = 'ntwk',
kIOAudioDeviceTransportTypeWireless = 'wrls',
kIOAudioDeviceTransportTypeOther = 'othr',
kIOAudioDeviceTransportTypeBluetooth = 'blue',
kIOAudioDeviceTransportTypeVirtual = 'virt',
kIOAudioDeviceTransportTypeDisplayPort = 'dprt',
kIOAudioDeviceTransportTypeHdmi = 'hdmi',
kIOAudioDeviceTransportTypeAVB = 'eavb', //<rdar://10874672>
kIOAudioDeviceTransportTypeThunderbolt = 'thun' //<rdar://10874672>
};
// types that go nowhere
enum {
OUTPUT_NULL = 0x0100,
INPUT_NULL = 0x0101
};
// Input terminal types
enum {
INPUT_UNDEFINED = 0x0200,
INPUT_MICROPHONE = 0x0201,
INPUT_DESKTOP_MICROPHONE = 0x0202,
INPUT_PERSONAL_MICROPHONE = 0x0203,
INPUT_OMNIDIRECTIONAL_MICROPHONE = 0x0204,
INPUT_MICROPHONE_ARRAY = 0x0205,
INPUT_PROCESSING_MICROPHONE_ARRAY = 0x0206,
INPUT_MODEM_AUDIO = 0x207
};
// Output terminal types
enum {
OUTPUT_UNDEFINED = 0x0300,
OUTPUT_SPEAKER = 0x0301,
OUTPUT_HEADPHONES = 0x0302,
OUTPUT_HEAD_MOUNTED_DISPLAY_AUDIO = 0x0303,
OUTPUT_DESKTOP_SPEAKER = 0x0304,
OUTPUT_ROOM_SPEAKER = 0x0305,
OUTPUT_COMMUNICATION_SPEAKER = 0x0306,
OUTPUT_LOW_FREQUENCY_EFFECTS_SPEAKER = 0x0307
};
// Bi-directional terminal types
enum {
BIDIRECTIONAL_UNDEFINED = 0x0400,
BIDIRECTIONAL_HANDSET = 0x0401,
BIDIRECTIONAL_HEADSET = 0x0402,
BIDIRECTIONAL_SPEAKERPHONE_NO_ECHO_REDX = 0x0403,
BIDIRECTIONAL_ECHO_SUPPRESSING_SPEAKERPHONE = 0x0404,
BIDIRECTIONAL_ECHO_CANCELING_SPEAKERPHONE = 0x0405
};
// Telephony terminal types
enum {
TELEPHONY_UNDEFINED = 0x0500,
TELEPHONY_PHONE_LINE = 0x0501,
TELEPHONY_TELEPHONE = 0x0502,
TELEPHONY_DOWN_LINE_PHONE = 0x0503
};
// External terminal types
enum {
EXTERNAL_UNDEFINED = 0x0600,
EXTERNAL_ANALOG_CONNECTOR = 0x0601,
EXTERNAL_DIGITAL_AUDIO_INTERFACE = 0x0602,
EXTERNAL_LINE_CONNECTOR = 0x0603,
EXTERNAL_LEGACY_AUDIO_CONNECTOR = 0x0604,
EXTERNAL_SPDIF_INTERFACE = 0x0605,
EXTERNAL_1394_DA_STREAM = 0x0606,
EXTERNAL_1394_DV_STREAM_SOUNDTRACK = 0x0607,
EXTERNAL_ADAT = 0x0608,
EXTERNAL_TDIF = 0x0609,
EXTERNAL_MADI = 0x060A
};
// Embedded terminal types
enum {
EMBEDDED_UNDEFINED = 0x0700,
EMBEDDED_LEVEL_CALIBRATION_NOISE_SOURCE = 0x0701,
EMBEDDED_EQUALIZATION_NOISE = 0x0702,
EMBEDDED_CD_PLAYER = 0x0703,
EMBEDDED_DAT = 0x0704,
EMBEDDED_DCC = 0x0705,
EMBEDDED_MINIDISK = 0x0706,
EMBEDDED_ANALOG_TAPE = 0x0707,
EMBEDDED_PHONOGRAPH = 0x0708,
EMBEDDED_VCR_AUDIO = 0x0709,
EMBEDDED_VIDEO_DISC_AUDIO = 0x070A,
EMBEDDED_DVD_AUDIO = 0x070B,
EMBEDDED_TV_TUNER_AUDIO = 0x070C,
EMBEDDED_SATELLITE_RECEIVER_AUDIO = 0x070D,
EMBEDDED_CABLE_TUNER_AUDIO = 0x070E,
EMBEDDED_DSS_AUDIO = 0x070F,
EMBEDDED_RADIO_RECEIVER = 0x0710,
EMBEDDED_RADIO_TRANSMITTER = 0x0711,
EMBEDDED_MULTITRACK_RECORDER = 0x0712,
EMBEDDED_SYNTHESIZER = 0x0713
};
// Processing terminal types
enum {
PROCESSOR_UNDEFINED = 0x0800,
PROCESSOR_GENERAL = 0x0801
};
// Channel spatial position types
#ifndef __OPEN_SOURCE__
// <rdar://6868206> NOTE: the following are derived from CoreAudioTypes.h
#endif
#define kIOAudioChannelLabel_Discrete_field_ba 16
enum {
kIOAudioChannelLabel_Unknown = 0xFFFFFFFF, // unknown or unspecified other use
kIOAudioChannelLabel_Unused = 0, // channel is present, but has no intended use or destination
kIOAudioChannelLabel_UseCoordinates = 100, // channel is described by the mCoordinates fields.
kIOAudioChannelLabel_Left = 1,
kIOAudioChannelLabel_Right = 2,
kIOAudioChannelLabel_Center = 3,
kIOAudioChannelLabel_LFEScreen = 4,
kIOAudioChannelLabel_LeftSurround = 5, // WAVE: "Back Left"
kIOAudioChannelLabel_RightSurround = 6, // WAVE: "Back Right"
kIOAudioChannelLabel_LeftCenter = 7,
kIOAudioChannelLabel_RightCenter = 8,
kIOAudioChannelLabel_CenterSurround = 9, // WAVE: "Back Center" or plain "Rear Surround"
kIOAudioChannelLabel_LeftSurroundDirect = 10, // WAVE: "Side Left"
kIOAudioChannelLabel_RightSurroundDirect = 11, // WAVE: "Side Right"
kIOAudioChannelLabel_TopCenterSurround = 12,
kIOAudioChannelLabel_VerticalHeightLeft = 13, // WAVE: "Top Front Left"
kIOAudioChannelLabel_VerticalHeightCenter = 14, // WAVE: "Top Front Center"
kIOAudioChannelLabel_VerticalHeightRight = 15, // WAVE: "Top Front Right"
kIOAudioChannelLabel_TopBackLeft = 16,
kIOAudioChannelLabel_TopBackCenter = 17,
kIOAudioChannelLabel_TopBackRight = 18,
kIOAudioChannelLabel_RearSurroundLeft = 33,
kIOAudioChannelLabel_RearSurroundRight = 34,
kIOAudioChannelLabel_LeftWide = 35,
kIOAudioChannelLabel_RightWide = 36,
kIOAudioChannelLabel_LFE2 = 37,
kIOAudioChannelLabel_LeftTotal = 38, // matrix encoded 4 channels
kIOAudioChannelLabel_RightTotal = 39, // matrix encoded 4 channels
kIOAudioChannelLabel_HearingImpaired = 40,
kIOAudioChannelLabel_Narration = 41,
kIOAudioChannelLabel_Mono = 42,
kIOAudioChannelLabel_DialogCentricMix = 43,
kIOAudioChannelLabel_CenterSurroundDirect = 44, // back center, non diffuse
kIOAudioChannelLabel_Haptic = 45,
kIOAudioChannelLabel_LeftTopFront = kIOAudioChannelLabel_VerticalHeightLeft,
kIOAudioChannelLabel_CenterTopFront = kIOAudioChannelLabel_VerticalHeightCenter,
kIOAudioChannelLabel_RightTopFront = kIOAudioChannelLabel_VerticalHeightRight,
kIOAudioChannelLabel_LeftTopMiddle = 49,
kIOAudioChannelLabel_CenterTopMiddle = kIOAudioChannelLabel_TopCenterSurround,
kIOAudioChannelLabel_RightTopMiddle = 51,
kIOAudioChannelLabel_LeftTopRear = 52,
kIOAudioChannelLabel_CenterTopRear = 53,
kIOAudioChannelLabel_RightTopRear = 54,
// first order ambisonic channels
kIOAudioChannelLabel_Ambisonic_W = 200,
kIOAudioChannelLabel_Ambisonic_X = 201,
kIOAudioChannelLabel_Ambisonic_Y = 202,
kIOAudioChannelLabel_Ambisonic_Z = 203,
// Mid/Side Recording
kIOAudioChannelLabel_MS_Mid = 204,
kIOAudioChannelLabel_MS_Side = 205,
// X-Y Recording
kIOAudioChannelLabel_XY_X = 206,
kIOAudioChannelLabel_XY_Y = 207,
// other
kIOAudioChannelLabel_HeadphonesLeft = 301,
kIOAudioChannelLabel_HeadphonesRight = 302,
kIOAudioChannelLabel_ClickTrack = 304,
kIOAudioChannelLabel_ForeignLanguage = 305,
// generic discrete channel
kIOAudioChannelLabel_Discrete = 400,
// numbered discrete channel
kIOAudioChannelLabel_Discrete_0 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 0,
kIOAudioChannelLabel_Discrete_1 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 1,
kIOAudioChannelLabel_Discrete_2 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 2,
kIOAudioChannelLabel_Discrete_3 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 3,
kIOAudioChannelLabel_Discrete_4 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 4,
kIOAudioChannelLabel_Discrete_5 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 5,
kIOAudioChannelLabel_Discrete_6 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 6,
kIOAudioChannelLabel_Discrete_7 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 7,
kIOAudioChannelLabel_Discrete_8 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 8,
kIOAudioChannelLabel_Discrete_9 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 9,
kIOAudioChannelLabel_Discrete_10 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 10,
kIOAudioChannelLabel_Discrete_11 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 11,
kIOAudioChannelLabel_Discrete_12 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 12,
kIOAudioChannelLabel_Discrete_13 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 13,
kIOAudioChannelLabel_Discrete_14 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 14,
kIOAudioChannelLabel_Discrete_15 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 15,
kIOAudioChannelLabel_Discrete_65535 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 65535
};
#endif /* _IOKIT_IOAUDIOTYPES_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/audio/IOAudioLevelControl.h | /*
* Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOAUDIOLEVELCONTROL_H
#define _IOKIT_IOAUDIOLEVELCONTROL_H
#include <AvailabilityMacros.h>
#ifndef IOAUDIOFAMILY_SELF_BUILD
#include <IOKit/audio/IOAudioControl.h>
#else
#include "IOAudioControl.h"
#endif
class OSArray;
/*!
* @class IOAudioLevelControl
* @abstract
* @discussion
*/
class IOAudioLevelControl : public IOAudioControl
{
OSDeclareDefaultStructors(IOAudioLevelControl)
protected:
SInt32 minValue;
SInt32 maxValue;
IOFixed minDB;
IOFixed maxDB;
OSArray *ranges;
protected:
struct ExpansionData { };
ExpansionData *reserved;
public:
static IOAudioLevelControl *createPassThruVolumeControl (SInt32 initialValue,
SInt32 minValue,
SInt32 maxValue,
IOFixed minDB,
IOFixed maxDB,
UInt32 channelID,
const char *channelName,
UInt32 cntrlID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDefineReservedUnused(IOAudioLevelControl, 0);
/*!
* @function setLinearScale
* @abstract This function tells CoreAudio if it should apply a curve to the scaler representation of the volume.
* @param useLinearScale TRUE instructs CoreAudio to not apply a curve to the scaler representation of the volume,
* FALSE instructs CoreAudio to apply a curve, which is CoreAudio's default behavior.
*/
virtual void setLinearScale(bool useLinearScale) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
private:
OSMetaClassDeclareReservedUsed(IOAudioLevelControl, 0);
OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 1);
OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 2);
OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 3);
OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 4);
OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 5);
OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 6);
OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 7);
OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 8);
OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 9);
OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 10);
OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 11);
OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 12);
OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 13);
OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 14);
OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 15);
public:
/*!
* @function create
* @abstract Allocates a new level control with the given attributes
* @param initialValue The initial value of the control
* @param minValue The lowest possible value the control may have
* @param maxValue The highest possible value the control may have
* @param minDB A fixed point representation of the db value matching minValue
* @param maxDB A fixed point representation of the db value matching maxValue
* @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h.
* @param channelName An optional name for the channel. Common names are located in IOAudioTypes.h.
* @param cntrlID An optional ID for the control that can be used to uniquely identify controls.
* @result Returns a newly allocted and initialized level IOAudioControl
*/
static IOAudioLevelControl *create(SInt32 initialValue,
SInt32 minValue,
SInt32 maxValue,
IOFixed minDB,
IOFixed maxDB,
UInt32 channelID,
const char *channelName = 0,
UInt32 cntrlID = 0,
UInt32 subType = 0,
UInt32 usage = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOAudioLevelControl *createVolumeControl(SInt32 initialValue,
SInt32 minValue,
SInt32 maxValue,
IOFixed minDB,
IOFixed maxDB,
UInt32 channelID,
const char *channelName = 0,
UInt32 cntrlID = 0,
UInt32 usage = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function init
* @abstract Initializes a newly allocated IOAudioLevelControl with the given attributes
* @param initialValue The initial value of the control
* @param minValue The lowest possible value the control may have
* @param maxValue The highest possible value the control may have
* @param minDB A fixed point representation of the db value matching minValue
* @param maxDB A fixed point representation of the db value matching maxValue
* @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h.
* @param channelName An optional name for the channel. Common names are located in IOAudioTypes.h.
* @param cntrlID An optional ID for the control that can be used to uniquely identify controls.
* @param properties Standard property list passed to the init() function of any new IOService. This dictionary
* gets stored in the registry entry for this service.
* @result Returns true on success
*/
virtual bool init(SInt32 initialValue,
SInt32 minValue,
SInt32 maxValue,
IOFixed minDB,
IOFixed maxDB,
UInt32 channelID,
const char *channelName = 0,
UInt32 cntrlID = 0,
UInt32 subType = 0,
UInt32 usage = 0,
OSDictionary *properties = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void free() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setMinValue
* @abstract Sets the minimum value the control may have
* @param minValue The minimum value for the control
*/
virtual void setMinValue(SInt32 minValue) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual SInt32 getMinValue() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setMaxValue
* @abstract Sets the maximum value the control may have
* @param maxValue The maximum value for the control
*/
virtual void setMaxValue(SInt32 maxValue) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual SInt32 getMaxValue() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setMinDB
* @abstract Sets the minimum value in db that the control may have
* @discussion This value is represented as an IOFixed value which is a fixed point number. The IOFixed
* type is a 16.16 fixed point value.
* @param minDB The minimum value in db for the control
*/
virtual void setMinDB(IOFixed minDB) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOFixed getMinDB() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setMaxDB
* @abstract Sets the maximum value in db that the control may have
* @discussion This value is represented as an IOFixed value which is a fixed point number. The IOFixed
* type is a 16.16 fixed point value.
* @param maxDB The maximum value in db for the control
*/
virtual void setMaxDB(IOFixed maxDB) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOFixed getMaxDB() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn addRange(SInt32 minValue, SInt32 maxValue, IOFixed minDB, IOFixed maxDB) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn addNegativeInfinity(SInt32 negativeInfinityValue) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn validateValue(OSObject *newValue) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
};
#endif /* _IOKIT_IOAUDIOLEVELCONTROL_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/audio/IOAudioPort.h | /*
* Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOAUDIOPORT_H
#define _IOKIT_IOAUDIOPORT_H
#include <IOKit/IOService.h>
#include <AvailabilityMacros.h>
class IOAudioDevice;
class IOAudioControl;
class OSDictionary;
/*!
* @class IOAudioPort
* @abstract Represents a logical or physical port or functional unit in an audio device.
* @discussion An IOAudioPort represents an element in the signal chain in the audio device. It may contain
* one or more controls (represented by IOAudioControl) by which different attributes of the port may be
* represented and adjusted.
*
* IOAudioPort objects are connected up in the IORegistry in the IOAudioPlane to represent the signal chain of
* the device. They may be connected to other IOAudioPorts as well as IOAudioEngines to indicate they either
* feed into or are fed by one of the audio engines (i.e. they provide input to or take output from the computer).
*/
class IOAudioPort : public IOService
{
friend class IOAudioDevice;
OSDeclareDefaultStructors(IOAudioPort)
public:
/* @var audioDevice The IOAudioDevice that this IOAudioPort belongs to. */
IOAudioDevice * audioDevice;
/* @var audioControls A set containg all of the IOAudioControl instances that belong to the port. */
OSSet * audioControls;
bool isRegistered;
protected:
struct ExpansionData { };
ExpansionData *reserved;
private:
OSMetaClassDeclareReservedUnused(IOAudioPort, 0);
OSMetaClassDeclareReservedUnused(IOAudioPort, 1);
OSMetaClassDeclareReservedUnused(IOAudioPort, 2);
OSMetaClassDeclareReservedUnused(IOAudioPort, 3);
OSMetaClassDeclareReservedUnused(IOAudioPort, 4);
OSMetaClassDeclareReservedUnused(IOAudioPort, 5);
OSMetaClassDeclareReservedUnused(IOAudioPort, 6);
OSMetaClassDeclareReservedUnused(IOAudioPort, 7);
OSMetaClassDeclareReservedUnused(IOAudioPort, 8);
OSMetaClassDeclareReservedUnused(IOAudioPort, 9);
OSMetaClassDeclareReservedUnused(IOAudioPort, 10);
OSMetaClassDeclareReservedUnused(IOAudioPort, 11);
OSMetaClassDeclareReservedUnused(IOAudioPort, 12);
OSMetaClassDeclareReservedUnused(IOAudioPort, 13);
OSMetaClassDeclareReservedUnused(IOAudioPort, 14);
OSMetaClassDeclareReservedUnused(IOAudioPort, 15);
OSMetaClassDeclareReservedUnused(IOAudioPort, 16);
OSMetaClassDeclareReservedUnused(IOAudioPort, 17);
OSMetaClassDeclareReservedUnused(IOAudioPort, 18);
OSMetaClassDeclareReservedUnused(IOAudioPort, 19);
OSMetaClassDeclareReservedUnused(IOAudioPort, 20);
OSMetaClassDeclareReservedUnused(IOAudioPort, 21);
OSMetaClassDeclareReservedUnused(IOAudioPort, 22);
OSMetaClassDeclareReservedUnused(IOAudioPort, 23);
OSMetaClassDeclareReservedUnused(IOAudioPort, 24);
OSMetaClassDeclareReservedUnused(IOAudioPort, 25);
OSMetaClassDeclareReservedUnused(IOAudioPort, 26);
OSMetaClassDeclareReservedUnused(IOAudioPort, 27);
OSMetaClassDeclareReservedUnused(IOAudioPort, 28);
OSMetaClassDeclareReservedUnused(IOAudioPort, 29);
OSMetaClassDeclareReservedUnused(IOAudioPort, 30);
OSMetaClassDeclareReservedUnused(IOAudioPort, 31);
public:
/*!
* @function withAttributes
* @abstract Allocates a new IOAudioPort instance with the given attributes
* @discussion This static method allocates a new IOAudioPort and calls initWithAttributes() on it with
* the parameters passed in to it.
* @param portType A readable string representing the type of port. Common port types are defined in
* IOAudioTypes.h and are prefixed with 'kIOAudioPortType'. Please provide feedback if there are
* other common port types that should be included.
* @param portName A readable string representing the name of the port. For example: 'Internal Speaker',
* 'Line Out'. This field is optional, but useful for providing information to the application/user.
* @param subType Developer defined readable string representing a subtype for the port. (optional)
* @param properties Standard property list passed to the init of any new IOService. This dictionary
* gets stored in the registry for this instance. (optional)
* @result Returns the newly allocated and initialized IOAudioPort instance.
*/
static IOAudioPort *withAttributes(UInt32 portType, const char *portName = 0, UInt32 subType = 0, OSDictionary *properties = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function initWithAttributes
* @abstract Initializes a newly allocated IOAudioPort instance with the given attributes
* @discussion The properties parameter is passed on the superclass' init(). The portType, subType
* and properties parameters are optional, however portType is recommended.
* @param portType A readable string representing the type of port. Common port types are defined in
* IOAudioTypes.h and are prefixed with 'kIOAudioPortType'. Please provide feedback if there are
* other common port types that should be included.
* @param portName A readable string representing the name of the port. For example: 'Internal Speaker',
* 'Line Out'. This field is optional, but useful for providing information to the application/user.
* @param subType Developer defined readable string representing a subtype for the port. (optional)
* @param properties Standard property list passed to the init of any new IOService. This dictionary
* gets stored in the registry for this instance. (optional)
* @result Returns true on success.
*/
virtual bool initWithAttributes(UInt32 portType, const char *portName = 0, UInt32 subType = 0, OSDictionary *properties = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function free
* @abstract Frees all of the resources allocated by the IOAudioPort.
* @discussion Do not call this directly. This is called automatically by the system when the instance's
* refcount goes to 0. To decrement the refcount, call release() on the object.
*/
virtual void free() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function start
* @abstract Called to start a newly created IOAudioPort.
* @discussion This is called automatically by IOAudioDevice when attachAudioPort() is called.
* @param provider The IOAudioDevice that owns this port
* @result Returns true on success
*/
virtual bool start(IOService *provider) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function stop
* @abstract Called when the IOAudioDevice is stopping when it is no longer available.
* @discussion This method calls deactivateAudioControls() to shut down all of the controls associated with
* this port.
* @param provider The IOAudioDevice that owns this port
*/
virtual void stop(IOService *provider) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void registerService(IOOptionBits options = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOAudioDevice *getAudioDevice() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function addAudioControl
* @abstract Adds a newly created IOAudioControl instance to the port.
* @discussion This method is responsible for starting the new IOAudioControl and adding it to the internal
* audioControls array.
* @param control A newly created IOAudioControl instance that should belong to this port.
* @result Returns true on successfully staring the IOAudioControl.
*/
virtual IOReturn addAudioControl(IOAudioControl *control) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function deactivateAudioControls
* @abstract Called to shut down all of the audio controls for this port.
* @discussion This will stop all of the audio controls and release them so that the instances may be
* freed. This is called from the free() method.
*/
virtual void deactivateAudioControls() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
protected:
virtual void setType(UInt32 portType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setSubType(UInt32 subType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setName(const char *name) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
};
#endif /* _IOKIT_IOAUDIOPORT_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/audio/BigNum128.h | /*
* Copyright (c) 1998-2012 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef __BIGNUM128_H__
#define __BIGNUM128_H__
#include <libkern/OSTypes.h>
#include <stdint.h>
class U128
{
public:
U128(uint64_t _lo = 0) : lo(_lo), hi(0) { };
U128(uint64_t _hi, uint64_t _lo) : lo(_lo), hi(_hi) { };
inline bool operator==( const U128 &A ) const { return ( A.hi == hi ) && ( A.lo == lo ); }
inline bool operator>( const U128 &A ) const { return ( ( A.hi > hi ) || ( ( A.hi == hi ) && ( A.lo > lo ) ) ); }
inline bool operator<( const U128 &A ) const { return !( ( A.hi > hi ) || ( ( A.hi == hi ) && ( A.lo > lo ) ) ); }
U128 operator++( int )
{
if ( ++lo==0 )
hi++;
return *this;
}
U128 operator--( int )
{
if ( 0 == lo-- )
{
hi--;
}
return *this;
}
U128& operator=( const U128 &A )
{
hi = A.hi;
lo = A.lo;
return *this;
}
U128 operator+( const U128 &A ) const
{
U128 result(A.hi + hi, A.lo + lo);
if ( ( result.lo < A.lo ) || ( result.lo < lo ) )
{
result.hi++;
}
return result;
}
U128& operator+=( const U128 &A )
{
U128 result(A.hi + hi, A.lo + lo);
if ( ( result.lo < A.lo ) || ( result.lo < lo ) )
{
result.hi++;
}
*this = result;
return *this;
}
friend U128 operator-( const U128 &A, const U128 &B ) // assumes A >= B
{
U128 C = A;
C.hi -= B.hi;
C.lo -= B.lo;
if ( C.lo > A.lo ) // borrow ?
{
C.hi--;
}
return C;
}
friend U128 operator<<( const U128& A, int n )
{
U128 res = A;
while ( n-- )
{
res.hi <<= 1;
res.hi |= ( ( res.lo & MSB64 ) ? 1 : 0 );
res.lo <<= 1;
}
return res;
}
friend U128 operator>>( const U128& A, int n )
{
U128 res = A;
while ( n-- )
{
res.lo >>= 1;
res.lo |= ( ( res.hi & 0x1 ) ? MSB64 : 0 );
res.hi >>= 1;
}
return res;
}
public:
#ifdef __BIG_ENDIAN__
uint64_t hi;
uint64_t lo;
#else
uint64_t lo;
uint64_t hi;
#endif
private:
enum { MSB64 = 0x8000000000000000ULL };
};
extern U128 UInt64mult(const uint64_t A, const uint64_t B);
#endif //__BIGNUM128_H__
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/audio/IOAudioDevice.h | /*
* Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
* @header IOAudioDevice
*/
#ifndef _IOKIT_IOAUDIODEVICE_H
#define _IOKIT_IOAUDIODEVICE_H
#include <IOKit/IOService.h>
#include <AvailabilityMacros.h>
#ifndef IOAUDIOFAMILY_SELF_BUILD
#include <IOKit/audio/IOAudioTypes.h>
#include <IOKit/audio/IOAudioStream.h>
#else
#include "IOAudioTypes.h"
#include "IOAudioStream.h"
#endif
class IOAudioEngine;
class IOAudioStream;
class IOAudioPort;
class IOAudioControl;
class OSDictionary;
class OSSet;
class OSArray;
class IOTimerEventSource;
class IOCommandGate;
/*!
* @enum IOAudioDevicePowerState
* @abstract Identifies the power state of the audio device
* @discussion A newly created IOAudioDevices defaults to the idle state.
* @constant kIOAudioDeviceSleep State set when the system is going to sleep
* @constant kIOAudioDeviceIdle State when the system is awake but none of the IOAudioEngines are in use
* @constant kIOAudioDeviceActive State when one ore more IOAudioEngines are in use. This state transition must complete before the system will begin playing audio.
*/
typedef enum _IOAudioDevicePowerState {
kIOAudioDeviceSleep = 0, // When sleeping
kIOAudioDeviceIdle = 1, // When no audio engines running
kIOAudioDeviceActive = 2 // audio engines running
} IOAudioDevicePowerState;
/*!
* @class IOAudioDevice
* @abstract Abstract base class for a single piece of audio hardware. The IOAudioDevice provides
* the central coordination point for an audio driver.
* @discussion An audio driver is required to subclass IOAudioDevice in order to provide
* working audio to the system. A single driver instance will contain a single instance of the
* driver's IOAudioDevice subclass. The subclass is responsible for mapping all hardware device
* resources from the service provider nub. It must control access to the hardware so that the
* hardware doesn't get into an inconsistent state. It is possible that different threads may make
* requests of the hardware at the same time. The IOAudioDevice superclass provides an IOWorkLoop
* and IOCommandGate on the IOWorkLoop through which all hardware accesses may be synchronized.
* All entry points to all parts of the driver controlled by the IOAudioFamily will be synchronized
* through this one IOWorkLoop.
*
* The IOAudioDevice subclass is responsible for creating the rest of the pieces of the driver.
* It must identify and create all IOAudioEngines that are not automatically created by the system
* (i.e. those that are not matched and instantiated by IOKit directly).
*
* The IOAudioDevice subclass must enumerate and create all IOAudioControls to match
* the device capabilities.
*
* It must also execute control value chages when requested by the system (i.e. volume adjustments).
*
* In order to allow sleep and wake to work on the system, the IOAudioDevice subclass is responsible
* for performing the necessary actions to sleep and wake its hardware (and restore necessary state
* on wake).
*
* The IOAudioDevice class provides timer services that allow different elements in the audio driver
* to receive timer notifications as needed. These services were designed with the idea that most
* timed events in a typical audio driver need to be done at least as often as a certain interval.
* Further, it is designed with the idea that being called more often than the specified interval
* doesn't hurt anything - and in fact may help. With this in mind, the timer services provided
* by the IOAudioDevice class allow different targets to register for timer callbacks at least as
* often as the specified interval. The actual interval will be the smallest of the intervals of
* all of the callbacks. This way, we avoid the overhead of having many timers in a single audio
* device. As an example, each output IOAudioEngine has a timer to run the erase head. It doesn't hurt
* to have the erase head run more often. Also, a typical IOAudioDevice subclass may need to run a timer
* to check for device state changes (e.g. jack insertions).
*
* There are a number of strings passed from the driver to the CoreAudio.framework and then into
* applications. All of those strings should be localized by the driver. In order to do that
* the kext bundle should have localized string files following the Mac OS X localization
* instructions. The IOAudioDevice should contain a property with the name of the bundle/kext
* that contains the localized string resources. To do that, the driver's personality in
* the bundle resources could have a property named 'IOAudioDeviceLocalizedBundle' with the path
* of the bundle/kext relative to '/System/Library/Extensions'. It could also be set by the
* IOAudioDevice subclass in its initHardware() function. To do so, call
* setProperty(kIOAudioDeviceLocalizedBundleKey, "Driver.kext").
*
* In a typical driver, the IOAudioDevice subclass will implement initHardware() to perform the
* hardware initialization and driver construction. Within that initialization it must create at
* least one IOAudioEngine instance and activate it. In order to activate a new IOAudioEngine
* activateAudioEngine() should be called for each one. It must create the IOAudioControls
* matching the hardware capabilities to allow the system to set volume, mute and input selection.
* To add those controls to the driver, each control should be attached to the IOAudioEngine to
* which it applies by calling addDefaultAudioControl() on the IOAudioEngine.
* During initialization it should also call setDeviceName(), setDeviceShortName() and
* setManufacturerName() with localized strings representing each of the attributes.
*
* If the driver is to work properly after sleep/wake, it must implement performPowerStateChange()
* and deal with the sleep and wake transitions. It may also deal with the idle state transitions
* to turn off device power when it isn't in use (especially useful for devices attached to a
* portable running on battery power).
*/
#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
#warning IOAudioDevice is deprecated use <CoreAudio/AudioServerPlugIn.h> instead.
#endif
#endif
class IOAudioDevice : public IOService
{
friend class IOAudioEngine;
OSDeclareDefaultStructors(IOAudioDevice)
protected:
/*! @var workLoop The IOWorkLoop for the driver - this is shared with the other objects in the driver */
IOWorkLoop *workLoop;
/*! @var commandGate The IOCommandGate for this IOAudioDevice. It is attached to workLoop */
IOCommandGate *commandGate;
/*! @var timerEventSource An IOTimerEventSource attached to workLoop used for the timer services */
IOTimerEventSource *timerEventSource;
/*! @var duringStartup State variable set to true while the driver is starting up and false all other times */
bool duringStartup;
/*! @var familyManagePower Set to true if the family is supposed to manage power - this is the default state. It can be changed early in the initialization process with a call to setFamilyManagePower(). */
bool familyManagePower;
/*! @var asyncPowerStateChangeInProgress Set to true while an asynchronous power change is pending and false all other times. */
bool asyncPowerStateChangeInProgress;
/*! @var numRunningAudioEngines The number of running IOAudioEngines. This is used to maintain idle vs active power state. */
UInt32 numRunningAudioEngines;
/*! @var currentPowerState Used to track the existing power state - can be fetched by calling getPowerState() */
IOAudioDevicePowerState currentPowerState;
/*! @var pendingPowerState If a power state change is in progress, this represents the pending power state. All other times this is the same as the currentPowerState. */
IOAudioDevicePowerState pendingPowerState;
/*! @var audioEngines The set of IOAudioEngine objects vended by the IOAudioDevice. */
OSArray * audioEngines;
/*! @var timerEvents
* @abstract The set of timer events in use by the device.
* @discussion The key for the dictionary is the target of the event. This means that a single target may
* have only a single event associated with it.
*/
OSDictionary * timerEvents;
/*! @var audioPorts The set of IOAudioPort objects associated with the IOAudioDevice */
OSSet * audioPorts;
/*! @var minimumInterval The smallest timer interval requested by all timer event targets. */
AbsoluteTime minimumInterval;
/*! @var previousTimerFire The time of the last timer event.
* @discussion This is used to schedule the next timer event.
*/
AbsoluteTime previousTimerFire;
public:
/*! @var gIOAudioPlane
* A static IORegistryPlane representing the new IOAudioPlane that the IOAudioFamily uses
* to represent the signal chain of the device.
*/
static const IORegistryPlane *gIOAudioPlane;
protected:
struct ExpansionData {
unsigned long long idleSleepDelayTime;
IOTimerEventSource * idleTimer;
};
ExpansionData *reserved;
public:
static void idleAudioSleepHandlerTimer(OSObject *owner, IOTimerEventSource *sender ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn setAggressiveness(unsigned long type, unsigned long newLevel ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioDevice, 0);
virtual void setDeviceTransportType(const UInt32 transportType ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioDevice, 1);
/*!
* @function setIdleAudioSleepTime
* @abstract This function is to be called by a driver that doesn't want to be told about the audio
* going idle immediately, but at some point in the future.
* @discussion This is useful if the device will want to power down its hardware into an idle sleep
* state, but doesn't want to do that unless audio hasn't been used for a while. Calling this function
* immediately changes the idle sleep timer and queues it up if the idle is different from the previous
* idle time. The idle time defaults to 0, which means be called immediately (backwards compatible with
* previous versions of IOAudioFamily). A value of 0xffffffffffffffffULL means don't ever tell the
* driver about going idle.
* @param sleepDelay The amount of time, in nanoseconds, before the hardware should be told to go idle.
*/
virtual void setIdleAudioSleepTime(unsigned long long sleepDelay ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioDevice, 2);
virtual void scheduleIdleAudioSleep(void ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioDevice, 3);
/*!
* @function setConfigurationApplicationBundle
* @abstract This function is to be called if an external configuration application is available to set
* which application to launch.
* @discussion This is useful for device drivers that are too complex to be represented by the Sound Preferences
* panel. The bundle ID is a more flexible way of specifying where the application is than a hard coded path.
* @param bundleID The bundle ID of the application to be launched by the HAL for configuration of the device and its engine(s).
*/
virtual void setConfigurationApplicationBundle(const char *bundleID ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioDevice, 4);
/*!
* @function setDeviceCanBeDefault
* @abstract This function is to be called to tell CoreAudio if this device shouldn't be a default device.
* @discussion This is useful for device drivers that don't want to be a default device. Can be called with
* kIOAudioDeviceCanBeDefaultNothing to prevent CoreAudio from allowing this device to be any default device, or it
* can be called with any combination of kIOAudioDeviceCanBeDefaultInput, kIOAudioDeviceCanBeDefaultOutput, or
* kIOAudioDeviceCanBeSystemOutput. The default is
* (kIOAudioDeviceCanBeDefaultInput | kIOAudioDeviceCanBeDefaultOutput | kIOAudioDeviceCanBeSystemOutput).
* @param defaultsFlags The flags to instruct CoreAudio to allow this device to be only the indicated default devices.
*/
virtual void setDeviceCanBeDefault(UInt32 defaultsFlags ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioDevice, 5);
virtual void setDeviceModelName(const char * modelName ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
private:
OSMetaClassDeclareReservedUsed(IOAudioDevice, 0);
OSMetaClassDeclareReservedUsed(IOAudioDevice, 1);
OSMetaClassDeclareReservedUsed(IOAudioDevice, 2);
OSMetaClassDeclareReservedUsed(IOAudioDevice, 3);
OSMetaClassDeclareReservedUsed(IOAudioDevice, 4);
OSMetaClassDeclareReservedUsed(IOAudioDevice, 5);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 6);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 7);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 8);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 9);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 10);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 11);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 12);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 13);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 14);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 15);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 16);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 17);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 18);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 19);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 20);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 21);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 22);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 23);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 24);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 25);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 26);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 27);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 28);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 29);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 30);
OSMetaClassDeclareReservedUnused(IOAudioDevice, 31);
public:
// Initialization
/*!
* @function init
* @abstract Initialize a newly created instance of IOAudioDevice.
* @discussion This implementation initializes all of the data structures and variables used by the
* IOAudioDevice. The currentPowerState and pendingPowerState variables are set to kIOAudioDeviceIdle.
* A subclass that overrides this method must call the superclass' implementation.
* @param properties
* An OSDictionary of the device properties that gets passed to super::init and set
* in the IORegistry.
* @result true if initialization was successful
*/
virtual bool init(OSDictionary *properties ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function free
* @abstract Frees resources used by the IOAudioDevice instance
* @discussion This method will deactivate all audio audio engines and release the audioEngines OSSet.
* It will also deactivate all of the audio ports and release the audioPorts OSSet. It will release
* the timerEvents OSDictionary as well as cancel any outstanding timer callbacks. It will clean up
* all of the event sources and the workLoop.
*
* Do not call this directly. This is called automatically by the system when the instance's
* refcount goes to 0. To decrement the refcount, call release() on the object.
*/
virtual void free( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function start
* @abstract This function is called automatically by the system to tell the driver to start vending
* services to the rest of the system.
* @discussion The start() implementation in IOAudioDevice starts by calling start() on its superclass.
* It then calls initHardware() which the subclass should override to properly initialize itself and
* the hardware. If that call succeeds, it sets up power management if the family is supposed to
* manage power (checking the familyManagePower variable). Then finally it calls registerService()
* to make the IOAudioDevice visible in the IORegistry.
* @param provider
* This is the service provider nub that provides access to the hardware resources.
* @result Returns true on success
*/
virtual bool start(IOService *provider ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function stop
* @abstract This is responsible for stopping the device after the system is done with it (or
* if the device is removed from the system).
* @discussion The IOAudioDevice implentation of stop() disables the timer services, deactivates
* all of the audio audio engines and audio ports and stops power management of the device.
* The audio engine and port deactivation causes all of the audio engines to get stopped and
* all of the audio engine and port resources and objects to be released. A subclass' implementation
* may could shut down hardware here if necessary. If this function is overridden by a subclass,
* the superclass' implementation must be called.
* @param provider
* The service provider nub for the device.
*/
virtual void stop(IOService *provider ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual bool willTerminate(IOService *provider, IOOptionBits options ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function initHardware
* @abstract This function is called by start() to provide a convenient place for the subclass to
* perform its initialization.
* @discussion In a typical implementation, a driver would implementation this function and perform
* a number of tasks. Those include mapping hardware resources, initializing the hardware to a known
* state, creating the IOAudioEngines, IOAudioControls and IOAudioStreams. Additionally it
* should also call setDeviceName(), setDeviceShortName(), setManufacturerName(). Upon return of
* this function, the device should be ready to begin vending services to the system.
* @param provider
* The service provider nub for the device.
* @result This function should return true on a successful initialization.
*/
virtual bool initHardware(IOService *provider ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setDeviceName
* @abstract Sets the name of the device
* @discussion This method should be called during initialization or startup. It should
* be set by the time initHardware() completes. The device name is used by the
* CoreAudio.framework to identify the particular piece of hardware. This string should
* should be localized by the driver.
*/
virtual void setDeviceName(const char *deviceName ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setDeviceShortName
* @abstract Sets the short name of the device
* @discussion The short name is a shorter representation of the device name. It may be used
* by applications when the device name is too long. It should be set by the time initHardware()
* completes. The string should be localized by the driver.
*/
virtual void setDeviceShortName(const char *shortName ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setManufacturerName
* @abstract Sets the manufacturer name of the device
* @discussion This method should be called during initialization or startup. This should be
* called by the time initHardware() completes. The string should be localized by the driver.
*/
virtual void setManufacturerName(const char *manufacturerName ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// IOWorkLoop, IOCommandGate management
/*!
* @function getWorkLoop
* @abstract Returns the IOWorkLoop for the driver
* @discussion The IOWorkLoop is used to synchronized all critical aspects of the driver. This
* includes all entry points to the driver as well as power management.
*/
virtual IOWorkLoop *getWorkLoop() const AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getCommandGate
* @abstract Returns the IOCommandGate for this IOAudioDevice
* @discussion This IOCommandGate allows calls into this IOAudioDevice to be synchronized on
* the IOWorkLoop.
*/
virtual IOCommandGate *getCommandGate() const AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// IOAudioEngine management
/*!
* @function activateAudioEngine
* @abstract This simply calls activateAudioEngine(IOAudioEngine *audioEngine,
* bool shouldStartAudioEngine) with a value of true for shouldStartAudioEngine.
* @param audioEngine
* The IOAudioEngine instance to be activated. It is treated as a newly
* allocated instance.
* @result Returns true if the audio engine was successfully activated.
*/
virtual IOReturn activateAudioEngine(IOAudioEngine *audioEngine ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function activateAudioEngine
* @abstract This is called to add a new IOAudioEngine object to the IOAudioDevice.
* @discussion Once the IOAudioEngine has been activated by this function, it is ready
* to begin moving audio data. This should be called either during the subclass' initHardware()
* implementation for each IOAudioEngine the device creates. Or it should be called by
* the IOAudioEngine itself if the audio engine was automatically created by IOKit's matching
* process. The system won't be able to properly track and control IOAudioEngines if
* they are not activated though this function.
* This implementation will retain the IOAudioEngine while it maintains control of it.
* When the audio engine is deactivated, the IOAudioEngine will be released. If the
* IOAudioDevice subclass is passing a newly instantiated IOAudioEngine, it will need to release
* the audio engine after it has been activated. This will insure that the refCount on the audio engine
* is correct when it gets deactivated when the driver is stopped. That allows the audio engine to be
* freed when it is no longer needed.
* @param audioEngine
* The IOAudioEngine instance to be activated.
* @param shouldStartAudioEngine
* If true, the audio engine is treated as a newly allocated IOAudioEngine
* instance and is appropriately attached and started according to IOKit convention. If it is false
* it is assumed that some other process (possibly the IOKit matching process) has started the
* IOAudioEngine and will skip that step.
* @result Returns true if the audio engine was successfully activated.
*/
virtual IOReturn activateAudioEngine(IOAudioEngine *audioEngine, bool shouldStartAudioEngine ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function deactivateAllAudioEngines
* @abstract Deactivates all of the audio engines in the device.
* @discussion This is called by the stop() and free() methods in IOAudioDevice to completely
* shut down all audio engines as the driver is being shut down.
*/
virtual void deactivateAllAudioEngines( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// Power management
/*!
* @function setFamilyManagePower
* @abstract Called set whether or not the family should manage the device power throught the
* IOService power management APIs.
* @discussion The default behavior is for the family to manage power. It is only necessary to
* call this function if the driver does not want the family to manage power. It is not
* recommended that this function be called because it makes power management much more
* difficult for the driver. If this function is to be called, it must be called before
* initHardware() completes. Immediately after initHardware() is called by start(),
* the power management system is initialized if the family is to manage power.
* @param manage Set to false if it is not desired that the family does the power management
*/
virtual void setFamilyManagePower(bool manage ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setPowerState
* @abstract Called by the power management system in IOService when the power state of this
* service needs to change.
* @discussion The default implementation of IOAudioDevice sets up two power states for IOService
* to use. State 0 is sleep and state 1 is wake. This function should not be called directly.
* It is only supposed to be used by the IOService power management services.
* @param powerStateOrdinal
* The number of the power state as defined by the IOAudioDevice -
* 0 for sleep, 1 for wake.
* @param device The power management policy maker.
* @result Returns kIOPMAckImplied (0) when the power state change is complete. Otherwise the an
* upper bound on the number of microseconds until the state change is complete is returned.
*/
virtual IOReturn setPowerState(unsigned long powerStateOrdinal, IOService *device ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setPowerStateAction
* @abstract IOCommandGate Action which calls protectedSetPowerState() while holding the IOCommandGate
* @discussion This is needed to allow protectedSetPowerState() to be called on the IOWorkLoop
* @param owner The owner of the IOCommandGate (the IOAudioDevice in this case)
* @param arg1 The powerStateOrdinal to be passed to protectedSetPowerState()
* @param arg2 The device to be passed to protectedSetPowerState()
* @result Returns the result of protectedSetPowerState()
*/
static IOReturn setPowerStateAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn _setPowerStateAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://8508064>
/*!
* @function protectedSetPowerState
* @abstract Called by setPowerStateAction() to deal with a power state change from the IOService
* power management facility.
* @discussion This function is responsible for performing the necessary sleep and wake tasks
* when the system is sleeping or waking. If an outstanding power state change is in progress,
* it will wait until the state changes has completed. While sleeping, all audio engines are
* stopped before calling initiatePowerStateChange() to call performPowerStateChange() to let
* the driver deal with the sleep request. When waking, it determines if the device should be
* idle or active and continues to call initiatePowerStateChange(). If initiatePowerStateChange()
* indicates that the power state change is occuring asynchronously, it returns the number of
* microseconds. This function must be called on the IOWorkLoop, but should not be called
* directly.
* @param powerStateOrdinal Param passed to setPowerState() - 0 for sleep, 1 for wake
* @param device Param passed to setPowerState - the device initiating the power state change
* @result Returns 0 if the power state change is complete - the number of microseconds until
* complete if its asynchronous.
*/
virtual IOReturn protectedSetPowerState(unsigned long powerStateOrdinal, IOService *device ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function performPowerStateChange
* @abstract This function is called by the IOAudioDevice when a power state change is needed.
* @discussion In order to deal with power state changes, a subclass must override this function.
* Any combination of old and new power states may be passed to this function. If work is to
* be performed while transitioning to sleep, check for a newPowerState of kIOAudioDeviceSleep.
* If work is to be performed while transitioning from sleep, check for an oldPowerState of
* kIOAudioDeviceSleep. A power state of kIOAudioDeviceIdle means the system is awake, but
* no clients are currently playing or recording audio (i.e. no IOAudioEngines are active).
* A power state of kIOAudioDeviceActive means that at least one IOAudioEngine is active.
* It is possible for a power state change to be performed synchronously or asynchronously.
* In the case of a synchronous power state change, simple leave microsecondsUntilComplete
* alone and return kIOReturnSuccess. If an asynchronous power state change is needed the
* driver should do whatever needed to schedule another thread to finish the state change
* and set the microsecondsUntilComplete to an upper bound on the amount of time it will
* take to complete the power state change. Then when the power state change is complete,
* a call must be made to completePowerStateChange(). During an asynchronous power state
* change, the current power state will remain the same as before the transition began,
* and the pendingPowerState is set to the new power state that will be set when the
* change is complete.
* @param oldPowerState The power state before the power state change
* @param newPowerState The power state being transitioned to
* @param microsecondsUntilComplete
* A pointer to a value representing an upper bound on
* the number of microseconds to complete an asynchronous power state change. It points
* to a value of zero at the start and if it remains zero, the state change is complete
* upon a successful return from the function.
* @result Returns kIOReturnSuccess on a successful completion
*/
virtual IOReturn performPowerStateChange(IOAudioDevicePowerState oldPowerState,
IOAudioDevicePowerState newPowerState,
UInt32 *microsecondsUntilComplete ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function completePowerStateChange
* @abstract Called when a power state change is complete
* @discussion In the case of an asynchronous power state change, a subclass is responsible
* for calling this function. It is safe to call this function if not on the IOWorkLoop.
* This function calls protectedCompletePowerStateChange() through the IOCommandGate and
* completePowerStateChangeAction(). If the call is already on the IOWorkLoop, it is safe
* to call protectedCompletePowerStateChange() directly.
* @result Returns kIOReturnSuccess on a successful completion
*/
virtual IOReturn completePowerStateChange( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function completePowerStateChangeAction
* @abstract IOCommandGate Action which calls protectedCompletePowerStateChange() while holding the
* IOCommandGate.
* @discussion This is needed to allow protectedCompletePowerStateChange() to be called on the IOWorkLoop.
* @param owner The owner of the IOCommandGate (the IOAudioDevice in this case)
* @result Returns the result of protectedCompletePowerStateChange()
*/
static IOReturn completePowerStateChangeAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function protectedCompletePowerStateChange
* @abstract Called on the IOWorkLoop when a power state change is complete.
* @discussion This function does the work to complete a power state change (both synchronous and
* asynchronous). If the system is waking from sleep, the timer system is restarted and the
* audio engines are resumed. If this was called as a result of an asynchronous power state changed
* it makes the IOService power management call acknowledgePowerChange() and resets the
* asyncPowerStateChangeInProgress variable. Finally it sets the currentPowerState to the
* pendingPowerState. This function must be called on the IOWorkLoop. If a subclass is not
* on the IOWorkLoop (e.g. holding the IOCommandGate), call completePowerStateChange() instead.
* @result Returns kIOReturnSuccess on success
*/
virtual IOReturn protectedCompletePowerStateChange( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getPowerState
* @abstract Returns the current power state (the old power state if a change is in progress).
* @result The current power state
*/
virtual IOAudioDevicePowerState getPowerState( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getPendingPowerState
* @abstract Returns the pending power state if a state change is in progress. Otherwise it
* returns the current power state change.
* @result The pending power state
*/
virtual IOAudioDevicePowerState getPendingPowerState( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function waitForPendingPowerStateChange
* @abstract Called internally to wait until a pending power state change is complete.
* @discussion This is only used by internal functions to wait during pending power
* state changes. It is used to prevent multiple power state changes at the same time.
* This function must be called while holding the IOCommandGate. If an asynchronous
* power state change is in progress this function will block until the state change
* if complete. Once complete, it will return while still holding the IOCommandGate.
*/
virtual void waitForPendingPowerStateChange( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function initiatePowerStateChange
* @abstract Called internally to execute a power state change
* @discussion This function must be called on the IOWorkLoop. It calls performPowerStateChange()
* to let the driver process the state change. If the state change is completed synchronously
* by the driver (subclass) it calls protectedCompletePowerStateChange(). If done asynchronously
* it returns the microsecondsUntilComplete that was set by performPowerStateChange(). This
* function should not be called directly.
* @param microsecondsUntilComplete
* Pointer to the microsecondsUntilComplete that should be set
* by performPowerStateChange if an asynchronous power state change was started.
* @result Returns kIOReturnSuccess on success
*/
virtual IOReturn initiatePowerStateChange(UInt32 *microsecondsUntilComplete = NULL ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// IOAudioControl management
/*!
* @function flushAudioControls
* @abstract Forces each IOAudioControl in the driver to have its value flushed out to the hardware.
* That will cause either the IOAudioControl's ValueChangeHandler to be called.
* @discussion This can be used to force the hardware to get updated with the current value
* of each control. It may be useful during wake for example.
*/
virtual void flushAudioControls( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// Timer services
/*!
* @typedef TimerEvent
* @abstract Generic timer event callback for IOAudioDevice timer targets
* @discussion TimerEvent callback function takes two arguments; the target of
* the timer event and the IOAudioDevice sending the event.
* @param target The target of the timer event - passed in when the timer event was registered
* @param audioDevice The IOAudioDevice sending the event
*/
typedef void (*TimerEvent)(OSObject *target, IOAudioDevice *audioDevice ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function addTimerEvent
* @abstract Adds a TimerEvent callback for the given target called at least as often
* as specified in interval.
* @discussion The frequency of the timer event callbacks will be the smallest interval
* specified by all targets. Only one interval and callback may be specified per target.
* If a addTimerEvent is called twice with the same target, the second one overrides the
* first. There is currently a bug triggered if the first call had the smallest interval.
* In that case, that smallest interval would still be used.
* @param target This parameter is the target object of the TimerEvent.
* @param event The callback function called each time the timer fires.
* @param interval The callback will be called at least this often.
* @result Returns kIOReturnSuccess if the timer event was successfully added.
*/
virtual IOReturn addTimerEvent(OSObject *target, TimerEvent event, AbsoluteTime interval ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function removeTimerEvent
* @abstract Removes the timer event for the given target.
* @discussion If the interval for the target to be removed is the smallest interval,
* the timer interval is recalculated based on the remaining targets. The next fire
* time is readjusted based on the new interval compared to the last fire time.
* @param target The target whose timer event will be removed.
*/
virtual void removeTimerEvent(OSObject *target ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function removeAllTimerEvents
* @abstract Removes all timer events and stops the timer
* @discussion Called during teardown of the driver
*/
virtual void removeAllTimerEvents( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// IOAudioPort management
/*!
* @function attachAudioPort
* @abstract Adds the port to the IOAudioDevice's list of ports and attaches the port to its parent
* and attaches the child to the port.
* @discussion This function provides the functionality to represent the device's signal chain in the
* IOAudioPlane in the IORegistry. An IOAudioPort's parent(s) are before it in the signal chain
* and its children are after it. This method may be called multiple times for a single IOAudioPort.
* This is necessary when there are many children or parents. Once a relationship is made, it is not
* necessary to make the reverse relationship. A NULL value may be passed in for either the parent
* or child or both.
* The IOAudioPort passed in should be a newly allocated IOAudioPort instance. This function will
* appropriately attach and start the port object. NOTE: It is not necessary to use IOAudioPorts
* in a fully functional audio driver.
* @param port The newly created IOAudioPort instance to be activated.
* @param parent A parent IOAudioPort or IOAudioEngine of the given port.
* @param child A child IOAudioPort or IOAudioEngine of the given port.
* @result Returns true when the port has been successfully added and attached.
*/
virtual IOReturn attachAudioPort(IOAudioPort *port, IORegistryEntry *parent, IORegistryEntry *child ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function detachAllAudioPorts
* @abstract Deactivates all of the ports in the device.
* @discussion This is called by the stop() and free() methods in IOAudioDevice to completely
* shut down all ports as the driver is being shut down.
*/
virtual void detachAllAudioPorts( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
protected:
/*!
* @function timerFired
* @abstract Internal static function called when the timer fires.
* @discussion This function simply calls dispatchTimerEvents() on the IOAudioDevice to do just that.
* @param target The IOAudioDevice instance that initiated the timer callback.
* @param sender The IOTimerEventSources calling this callback
*/
static void timerFired(OSObject *target, IOTimerEventSource *sender ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function dispatchTimerEvents
* @abstract Called by timerFired() to cause the timer event callbacks to be called.
* @discussion This method iterates through all of the timer event targets and calls
* the callback on each. Unless the force flag is set to true, the timer events will
* only be dispatched if the power state is not kIOAudioDeviceSleep. This prevents
* unexpected timer firings while making wake->sleep->wake transitions. This function must
* be called on the IOWorkLoop.
* @param force
* A bool param to allow the timer events to be dispatched even if the
* device is in the kIOAudioDeviceSleep power state.
*/
virtual void dispatchTimerEvents(bool force ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function audioEngineStarting
* @abstract Called by IOAudioEngine when it is starting up
* @discussion This should only be called while on the IOWorkLoop. It is not intended to be called
* directly. It is called when an IOAudioEngine is starting up to allow the IOAudioDevice
* to keep track of running audio engines and change the power state from kIOAudioDeviceIdle to
* kIOAudioDeviceActive when the first audio engine starts up. If the state change is done
* asynchronously, it waits for the state change to complete. This is to ensure that the
* system doesn't start playing audio until the IOAudioDevice has completed its transition
* to kIOAudioDeviceActive.
*/
virtual void audioEngineStarting( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function audioEngineStopped
* @abstract Called by IOAudioEngine when it has stopped
* @discussion This should only be called while on the IOWorkLoop. It is not intended to be called
* directly. It is called when an IOAudioEngine has stopped to allow the IOAudioDevice
* to keep track of running audio engines and change the power state from kIOAudioDeviceActive
* to kIOAudioDeviceIdle when the last audio engine stops. If the state change is done
* asynchronously, it waits for the state change to complete.
*/
virtual void audioEngineStopped( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
};
#endif /* _IOKIT_IOAUDIODEVICE_H */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Kernel.framework/Headers/IOKit/audio/IOAudioControl.h | /*
* Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _IOKIT_IOAUDIOCONTROL_H
#define _IOKIT_IOAUDIOCONTROL_H
#include <IOKit/IOService.h>
#include <AvailabilityMacros.h>
#ifndef IOAUDIOFAMILY_SELF_BUILD
#include <IOKit/audio/IOAudioEngine.h>
#else
#include "IOAudioEngine.h"
#endif
class IOAudioPort;
class OSDictionary;
class OSSet;
class IOAudioUserClient;
class IOAudioControlUserClient;
class IOWorkLoop;
class IOCommandGate;
/*!
* @class IOAudioControl
* @abstract Represents any controllable attribute of an IOAudioDevice.
* @discussion An IOAudioControl instance may belong to one IOAudioPort. Additionally, it may associated
* with an IOAudioEngine as a default control for that IOAudioEngine.
*
* When its value changes, it sends a notification to the CoreAudio.framework (HAL). It also makes a call
* to the ValueChangeHandler.
*
* The base IOAudioControl class contains a type, a value and a channel ID representing the channel(s) which
* the control acts on. It may also contain a readable format for the name of the channel as well as a
* control ID that can be used to identify unique controls. Additionally it may contain a subType and a usage.
* Each type has its own set of possible subTypes. There currently four different control types defined:
* kIOAudioControlTypeLevel, kIOAudioControlTypeToggle, kIOAudioControlTypeSelector.
* Each one is represented by a subclass of IOAudioControl: IOAudioLevelControl, IOAudioToggleControl,
* IOAudioSelectorControl. The level control defines a range of allowed values and has
* a defined subtype of kIOAudioLevelControlSubTypeVolume used to define a volume control. The toggle control
* allows for a boolean value and has a defined subtype kIOAudioToggleControlSubTypeMute for a mute control. The
* selector control has a list of allowed selections with a value and description for each allowed selection and
* has the following sub types: kIOAudioSelectorControlSubTypeOutput for an output selector and
* kIOAudioSelectorControlSubTypeInput for an input selector. See the subclass documentation for a more
* complete description of each
*
* There are enums for default channel ID values and common channel names in IOAudioTypes.h. The channel ID
* values are prefixed with 'kIOAudioControlChannelID' and the common channel names are prefixed with
* 'kIOAudioControlChannelName'. All of the attributes of the IOAudioControl are stored in the registry.
* The key used for each attribute is defined in IOAudioTypes.h with the define matching the following
* pattern: 'kIOAudioControl<attribute name>Key'. For example: kIOAudioControlChannelIDKey.
*
* In addition to the existing defined control types, drivers can define their own as well for other purposes.
*
* Changes to the IOAudioControl's value made by the CoreAudio.framework are done through the IORegistry.
* When the CoreAudio.framework initiates a value change, the control receives a setProperties() message.
* The setProperties() implementation looks for the property 'IOAudioControlValue' and if present, calls
* setValue() on the driver's IOWorkLoop with the new value. The setValue() function first checks to see
* if the new value is different. If so, it calls performValueChange() to call through to the driver
* to make the change in the hardware. If that call succeeds the value is changed and the new value is set
* in the registry. Additionally notifications are sent to all clients that have registered for them.
*/
class IOAudioControl : public IOService
{
friend class IOAudioPort;
friend class IOAudioDevice;
friend class IOAudioEngine;
OSDeclareDefaultStructors(IOAudioControl)
public:
/*!
* @typedef IntValueChangeHandler
* @abstract Handler function used to make a notification when a value is to be changed.
* @param target Reference supplied when the handler was registered.
* @param audioControl The IOAudioControl that is changing.
* @param oldValue The old value of the control.
* @param newValue The new value the control is being changed to.
* @result Must return kIOReturnSuccess when the hardware is successfully updated.
*/
typedef IOReturn (*IntValueChangeHandler)(OSObject *target, IOAudioControl *audioControl, SInt32 oldValue, SInt32 newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
typedef IOReturn (*DataValueChangeHandler)(OSObject *target, IOAudioControl *audioControl, const void *oldData, UInt32 oldDataSize, const void *newData, UInt32 newDataSize ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
typedef IOReturn (*ObjectValueChangeHandler)(OSObject *target, IOAudioControl *audioControl, OSObject *oldValue, OSObject *newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
protected:
/*! @var workLoop
The IOWorkLoop for the audio driver - shared from the IOAudioDevice.
*/
IOWorkLoop *workLoop;
/*! @var commandGate
The IOCommandGate for this control - attached to the driver's IOWorkLoop.
*/
IOCommandGate *commandGate;
/*! @var isStarted
Internal state keeping track of when the IOAudioControl has been started.
*/
bool isStarted;
/*! @var controlID
An optional identifier that can be used to identify the control.
*/
UInt32 controlID;
/*! @var channelID
The ID of the channel this control affects - may be kIOAudioControlChannelIDAll if it represents all channels.
*/
UInt32 channelID;
UInt32 type;
UInt32 subType;
UInt32 usage;
OSObject *value;
typedef enum {
kIntValueChangeHandler,
kDataValueChangeHandler,
kObjectValueChangeHandler
} ValueChangeHandlerType;
ValueChangeHandlerType valueChangeHandlerType;
union {
IntValueChangeHandler intHandler;
DataValueChangeHandler dataHandler;
ObjectValueChangeHandler objectHandler;
} valueChangeHandler;
OSObject *valueChangeTarget;
/*! @var clients
A list of user clients that have requested value change notifications.
*/
OSSet *userClients;
protected:
struct ExpansionData {
IOAudioEngine * providerEngine;
OSArray * notificationQueue;
UInt32 commandGateStatus; // <rdar://8518215>
SInt32 commandGateUsage; // <rdar://8518215>
};
ExpansionData *reserved;
public:
// OSMetaClassDeclareReservedUsed(IOAudioControl, 0);
virtual void sendChangeNotification(UInt32 notificationType ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioControl, 1);
/*!
* @function setReadOnlyFlag
* @abstract Call this function to say that a control is read only.
* This call cannot be undone, so if a control is only temporarily unsetable,
* do not use this call but instead return an error from the control handler.
*/
virtual void setReadOnlyFlag( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioControl, 2);
virtual void sendQueuedNotifications(void ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
// OSMetaClassDeclareReservedUsed(IOAudioControl, 3);
/*!
* @function createUserClient
* @abstract Creates a new IOAudioControlUserClient instance.
* @discussion This function is called by newUserClient() to create a new IOAudioControlUserClient instance. This function may be overridden by subclasses that need to add functionality
* to the IOAudioControlUserClient. In that case, they must subclass IOAudioControlUserClient
* and return a new, initialized instance of that subclass.
* A derived class that requires overriding of createUserClient should override the version with the properties
* parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive
* can be used to select between the two behaviors.
* @param task The task requesting the new user client.
* @param securityID Optional security paramater passed in by the client - ignored.
* @param type Optional user client type passed in by the client.
* @param newUserClient The IOAudioControlUserClient * must be stored in this param on a successful
* completion.
* @param properties A dictionary of additional properties for the connection.
* @result Returns kIOReturnSuccess on success.
*/
virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 taskType, IOAudioControlUserClient **newUserClient, OSDictionary *properties) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
private:
OSMetaClassDeclareReservedUsed(IOAudioControl, 0);
OSMetaClassDeclareReservedUsed(IOAudioControl, 1);
OSMetaClassDeclareReservedUsed(IOAudioControl, 2);
OSMetaClassDeclareReservedUsed(IOAudioControl, 3);
OSMetaClassDeclareReservedUnused(IOAudioControl, 4);
OSMetaClassDeclareReservedUnused(IOAudioControl, 5);
OSMetaClassDeclareReservedUnused(IOAudioControl, 6);
OSMetaClassDeclareReservedUnused(IOAudioControl, 7);
OSMetaClassDeclareReservedUnused(IOAudioControl, 8);
OSMetaClassDeclareReservedUnused(IOAudioControl, 9);
OSMetaClassDeclareReservedUnused(IOAudioControl, 10);
OSMetaClassDeclareReservedUnused(IOAudioControl, 11);
OSMetaClassDeclareReservedUnused(IOAudioControl, 12);
OSMetaClassDeclareReservedUnused(IOAudioControl, 13);
OSMetaClassDeclareReservedUnused(IOAudioControl, 14);
OSMetaClassDeclareReservedUnused(IOAudioControl, 15);
OSMetaClassDeclareReservedUnused(IOAudioControl, 16);
OSMetaClassDeclareReservedUnused(IOAudioControl, 17);
OSMetaClassDeclareReservedUnused(IOAudioControl, 18);
OSMetaClassDeclareReservedUnused(IOAudioControl, 19);
OSMetaClassDeclareReservedUnused(IOAudioControl, 20);
OSMetaClassDeclareReservedUnused(IOAudioControl, 21);
OSMetaClassDeclareReservedUnused(IOAudioControl, 22);
OSMetaClassDeclareReservedUnused(IOAudioControl, 23);
public:
/*!
* @function withAttributes
* @abstract Static function that allocates a new IOAudioControl with the given attributes.
* @param type The type of the control. Common, known types are defined in IOAudioTypes.h. They currently
* consist of kIOAudioControlTypeLevel, kIOAudioControlTypeToggle, kIOAudioControlTypeSelector.
* @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h.
* @param channelName An optional name for the channel. Common names are located in IOAudioDefines.h. Any name not
* defined in IOAudioDefines.h must be localized in order to be properly displayed in multiple languages.
* @param cntrlID An optional ID for the control that can be used to uniquely identify controls
* @param subType An optional subType specific to the given type
* @param usage An optional value specifying how the control will be used. Currently defined usages are kIOAudioControlUsageInput,
* kIOAudioControlUsageOutput and kIOAudioControlUsagePassThru. This value is used when a control is set as a default control
* on an IOAudioEngine.
* @result Returns a newly allocated and initialized IOAudioControl.
*/
static IOAudioControl *withAttributes(UInt32 type,
OSObject *initialValue,
UInt32 channelID,
const char *channelName = 0,
UInt32 cntrlID = 0,
UInt32 subType = 0,
UInt32 usage = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 ;
/*!
* @function init
* @abstract Initializes a newly allocated IOAudioControl with the given attributes.
* @param type The type of the control. Common, known types are defined in IOAudioTypes.h. They currently
* consist of kIOAudioControlTypeLevel, kIOAudioControlTypeToggle, kIOAudioControlTypeSelector.
* @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h.
* @param channelName An optional name for the channel. Common names are located in IOAudioDefines.h. Any name not
* defined in IOAudioDefines.h must be localized in order to be properly displayed in multiple languages.
* @param cntrlID An optional ID for the control that can be used to uniquely identify controls
* @param subType An optional subType specific to the given type
* @param usage An optional value specifying how the control will be used. Currently defined usages are kIOAudioControlUsageInput,
* kIOAudioControlUsageOutput and kIOAudioControlUsagePassThru. This value is used when a control is set as a default control
* on an IOAudioEngine.
* @param properties Standard property list passed to the init() function of any new IOService. This dictionary
* gets stored in the registry entry for this instance.
* @result Returns true on success.
*/
virtual bool init(UInt32 type,
OSObject *initialValue,
UInt32 channelID,
const char *channelName = 0,
UInt32 cntrlID = 0,
UInt32 subType = 0,
UInt32 usage = 0,
OSDictionary *properties = 0) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 ;
/*!
* @function free
* @abstract Frees all of the resources allocated by the IOAudioControl.
* @discussion Do not call this directly. This is called automatically by the system when the instance's
* refcount goes to 0. To decrement the refcount, call release() on the object.
*/
virtual void free( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function start
* @abstract Starts a newly created IOAudioControl.
* @discussion This is called automatically by IOAudioPort when addAudioControl() is called or by IOAudioEngine
* when addDefaultAudioControl() is called. It will only be called by the first call to either addAudioControl() or
* addDefaultAudioControl().
* @param provider The IOAudioPort or IOAudioEngine that owns this control.
* @result Returns true on success.
*/
virtual bool start(IOService *provider) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual bool attachAndStart(IOService *provider) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getIsStarted
* @abstract Returns true after start() has been called.
* @discussion Used by IOAudioPort and IOAudioEngine to decide if the control needs to be started.
*/
virtual bool getIsStarted() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function stop
* @abstract Stops the control when the provider is going away.
* @param provider The IOAudioPort or IOAudioEngine that owns this control.
*/
virtual void stop(IOService *provider) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getWorkLoop
* @abstract Returns the IOWorkLoop for the whole audio driver.
*/
virtual IOWorkLoop *getWorkLoop() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getCommandGate
* @abstract Returns the IOCommandGate for this IOAudioControl.
*/
virtual IOCommandGate *getCommandGate() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 ;
/*!
* @function newUserClient
* @abstract Creates a new user client object for this IOAudioControl instance.
* @discussion This is called automatically by I/O Kit when a user process opens a connection to this
* IOAudioControl. This is typically done when the user process needs to register for value change
* notifications. This implementation allocates a new IOAudioControlUserClient object. There is no
* need to call this directly.
* A derived class that requires overriding of newUserClient should override the version with the properties
* parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive
* can be used to select between the two behaviors.
* @param task The task requesting the new user client.
* @param securityID Optional security paramater passed in by the client - ignored.
* @param type Optional user client type passed in by the client - 0 for the default user client type.
* @param handler The new IOUserClient * must be stored in this param on a successful completion.
* @param properties A dictionary of additional properties for the connection.
* @result Returns kIOReturnSuccess on success. May also result kIOReturnError or kIOReturnNoMemory.
*/
virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, IOUserClient **handler) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, OSDictionary *properties, IOUserClient **handler) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function createUserClient
* @abstract Creates a new IOAudioControlUserClient instance.
* @discussion This function is called by newUserClient() to create a new IOAudioControlUserClient instance. This function may be overridden by subclasses that need to add functionality
* to the IOAudioControlUserClient. In that case, they must subclass IOAudioControlUserClient
* and return a new, initialized instance of that subclass.
* A derived class that requires overriding of createUserClient should override the version with the properties
* parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive
* can be used to select between the two behaviors.
* @param task The task requesting the new user client.
* @param securityID Optional security paramater passed in by the client - ignored.
* @param type Optional user client type passed in by the client.
* @param newUserClient The IOAudioControlUserClient * must be stored in this param on a successful
* completion.
* @result Returns kIOReturnSuccess on success.
*/
virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 type, IOAudioControlUserClient **newUserClient) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 ;
/*!
* @function clientClosed
* @abstract Called automatically by the IOAudioControlUserClient when a user client closes its
* connection to the control.
* @param client The user client object that has disconnected.
*/
virtual void clientClosed(IOAudioControlUserClient *client) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setProperties
* @abstract Changes a property of this IOService.
* @discussion This is called when the user client changes a property of this
* IOAudioControl. In this case it is used to change the value. This function
* looks for that property and then calls setValue() through the IOCommandGate and
* setValueAction().
* @param properties An OSDictionary containing the properties to change.
* @result Returns kIOReturnSuccess on success.
*/
virtual IOReturn setProperties(OSObject *properties) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setValueChangeHandler(IntValueChangeHandler intValueChangeHandler, OSObject *target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setValueChangeHandler(DataValueChangeHandler dataValueChangeHandler, OSObject *target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setValueChangeHandler(ObjectValueChangeHandler objectValueChangeHandler, OSObject *target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setValueChangeTarget(OSObject *target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function flushValue
* @abstract Forces the control to be flushed out to the hardware.
* @discussion This function calls performValueChange() directly with the current value of the IOAudioControl.
* @result Returns the result of performValueChange() - kIOReturnSuccess on success.
*/
virtual IOReturn flushValue() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setValueAction
* @abstract IOCommandGate Action which calls setValue() while holding the IOCommandGate.
* @discussion This is needed to allow setValue() to be called on the IOWorkLoop.
* @param owner The owner of the IOCommandGate (the IOAudioControl in this case).
* @param arg1 The new value for the IOAudioControl.
* @result Returns the result of setValue() - kIOReturnSuccess on success.
*/
static IOReturn setValueAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn _setValueAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://7529580>
/*!
* @function setValue
* @abstract Sets the value for this control.
* @discussion When the control's value is changed, a call is made to performValueChange(). If that call
* succeeds, the value is set and sendValueChangeNotification() is called to send a notification to the
* user clients. This function must be called on the IOWorkLoop.
* @param newValue The new value for this control.
* @result Returns kIOReturnSuccess if the value is successfully set.
*/
virtual IOReturn setValue(OSObject *newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn setValue(SInt32 intValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function hardwareValueChanged
* @abstract Updates the value for this control and sends out the value changed notification.
* @discussion This is designed to be called by the driver when it detects that the hardware's value has
* changed without driver intervention (e.g. when an external event causes the change). The difference between
* hardwareValueChanged() and setValue() is that hardwareValueChanged() doesn't call performValueChange() which
* sends a message back to the driver to cause it to change the hardware with the new value. This function must
* be called on the IOWorkLoop.
* @param newValue The new value for this control.
* @result Returns kIOReturnSuccess if the value is successfully updated.
*/
virtual IOReturn hardwareValueChanged(OSObject *newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getValue
* @abstract Returns the current value of the control.
*/
virtual OSObject *getValue( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual SInt32 getIntValue( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual const void *getDataBytes( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual UInt32 getDataLength( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getControlID
* @abstract Returns the control ID for the control.
*/
virtual UInt32 getControlID( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function getChannelID
* @abstract Returns the channel ID for the control.
*/
virtual UInt32 getChannelID( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual UInt32 getType( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual UInt32 getSubType( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual UInt32 getUsage( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setCoreAudioPropertyID(UInt32 propertyID ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
void setWorkLoop(IOWorkLoop *wl ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
protected:
/*!
* @function sendValueChangeNotification
* @abstract Called when the value has changed for the control.
* @discussion This function sends out the value change notification to the user clients.
*/
virtual void sendValueChangeNotification( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setChannelName
* @abstract Called at init time to set the channel name for this IOAudioControl.
*/
virtual void setChannelName(const char *channelName ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setChannelID
* @abstract Called at init time to set the channel ID for this IOAudioControl.
*/
virtual void setChannelID(UInt32 newChannelID ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual void setChannelNumber(SInt32 channelNumber ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setSubType
* @abstract Called at init time to set the control subType.
*/
virtual void setType(UInt32 type ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setType
* @abstract Called at init time to set the control type.
*/
virtual void setSubType(UInt32 subType ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setUsage
* @abstract Called at init time to set the control usage.
*/
virtual void setUsage(UInt32 usage ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function setControlID
* @abstract Sets the controlID for this control.
* @discussion The control ID is an optional attribute that can be used to track IOAudioControls. A typical
* use is for the IOAudioDevice to assign a unique controlID to each control that it creates and then
* do a switch statement on the id of the control when it gets an audioControlValueChanged() notification.
* Typically the control ID is set when the object is created and doesn't need to be called again.
* @param cntrlID The control ID for the control.
*/
virtual void setControlID(UInt32 cntrlID ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function validateValue
* @abstract Called by setValue() to verify that the value is valid.
* @param newValue The new value to be verified.
* @result Returns kIOReturnSuccess if the value is valid.
*/
virtual IOReturn validateValue(OSObject *newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function updateValue
* @abstract Called by setValue() in order to update the value and the registry.
* @discussion It also calls
* sendValueChangedNotification() to send notifications to the user clients.
* @param newValue The new value to b updated.
* @result Returns kIOReturnSuccess if the value is successfully updated.
*/
virtual IOReturn updateValue(OSObject *newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn _setValue(OSObject *newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function performValueChange
* @abstract Called by setValue() to make the call to the valueChangeHandler
* to update the hardware.
* @result Returns the result of the handler call (or kIOReturnError on an error).
*/
virtual IOReturn performValueChange(OSObject *newValue ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function addUserClientAction
* @abstract IOCommandGate Action which calls addUserClient() while holding the IOCommandGate.
* @discussion This is needed to allow addUserClient() to be called on the IOWorkLoop.
* @param owner The owner of the IOCommandGate (the IOAudioControl in this case).
* @param arg1 The IOAudioControlUserClient to be added.
* @result Returns the result of addUserClient() - kIOReturnSuccess on success.
*/
static IOReturn addUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn _addUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://7529580>
/*!
* @function removeUserClientAction
* @abstract IOCommandGate Action which calls removeUserClient() while holding the IOCommandGate.
* @discussion This is needed to allow removeUserClient() to be called on the IOWorkLoop.
* @param owner The owner of the IOCommandGate (the IOAudioControl in this case).
* @param arg1 The IOAudioControlUserClient to be removed.
* @result Returns the result of removeUserClient() - kIOReturnSuccess on success.
*/
static IOReturn removeUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static IOReturn _removeUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://7529580>
/*!
* @function detachUserClientsAction
*/
static IOReturn detachUserClientsAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function addUserClient
* @abstract Called on the IOWorkLoop to add a new IOAudioControlUserClient.
* @discussion There is no need to call this directly. It is called on the workLoop
* by newUserClient() through addUserClientAction().
* @param newUserClient The IOAudioControlUserClientto be added.
* @result Returns kIOReturnSuccess on success.
*/
virtual IOReturn addUserClient(IOAudioControlUserClient *newUserClient ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
/*!
* @function removeUserClient
* @abstract Called on the IOWorkLoop to remove an IOAudioControlUserClient.
* @discussion This is called on the IOWorkLoop by clientClosed() through
* removeUserClientAction() when the user client is going away. It should
* not be called directly.
* @param userClient The IOAudioControlUserClient to be removed.
* @result Returns kIOReturnSuccess on success.
*/
virtual IOReturn removeUserClient(IOAudioControlUserClient *userClient ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
virtual IOReturn detachUserClients( ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10;
static void setCommandGateUsage(IOAudioControl *control, bool increment ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10; // <rdar://8518215>
};
#endif /* _IOKIT_IOAUDIOCONTROL_H */
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.