#include <IOKit/IOBufferMemoryDescriptor.h>
IOKit/IOBufferMemoryDescriptor.h
enum(anonymous)
| kIOMemoryPhysicallyContiguous | 16 | |
| kIOMemoryPageable | 32 | |
| kIOMemoryPurgeable | 64 | |
| kIOMemoryHostPhysicallyContiguous | 128 | |
| kIOMemorySharingTypeMask | 983040 | |
| kIOMemoryUnshared | 0 | |
| kIOMemoryKernelUserShared | 65536 | |
| kIOBufferDescriptorMemoryFlags | 11536391 | shared IOMemoryDescriptor options for IOBufferMemoryDescriptor: |
macro_IOBUFFERMEMORYDESCRIPTOR_INTASKWITHOPTIONS_
#define _IOBUFFERMEMORYDESCRIPTOR_INTASKWITHOPTIONS_ 1
macro_IOBUFFERMEMORYDESCRIPTOR_HOSTPHYSICALLYCONTIGUOUS_
#define _IOBUFFERMEMORYDESCRIPTOR_HOSTPHYSICALLYCONTIGUOUS_ 1
macroIOBUFFERMEMORYDESCRIPTOR_SUPPORTS_INTASKWITHOPTIONS_TAGS
#define IOBUFFERMEMORYDESCRIPTOR_SUPPORTS_INTASKWITHOPTIONS_TAGS 1
classIOBufferMemoryDescriptor
: public IOGeneralMemoryDescriptor
| void * | _buffer | |
| vm_size_t | _capacity | |
| vm_offset_t | _alignment | |
| IOOptionBits | _options |
OSDeclareDefaultStructorsWithDispatch(IOBufferMemoryDescriptor)static protected
virtual bool initWithPhysicalMask( task_t inTask, IOOptionBits options, mach_vm_size_t capacity, mach_vm_address_t alignment, mach_vm_address_t physicalMask )virtual
APPLE_KEXT_OVERRIDE
virtual void free()virtual protectedstatic OSPtr<IOBufferMemoryDescriptor> withCopy( task_t inTask, IOOptionBits options, vm_map_t sourceMap, mach_vm_address_t source, mach_vm_size_t size )static
static OSPtr<IOBufferMemoryDescriptor> withOptions( IOOptionBits options, vm_size_t capacity, vm_offset_t alignment = 1 )static
static OSPtr<IOBufferMemoryDescriptor> inTaskWithOptions( task_t inTask, IOOptionBits options, vm_size_t capacity, vm_offset_t alignment = 1 )static
static OSPtr<IOBufferMemoryDescriptor> inTaskWithOptions( task_t inTask, IOOptionBits options, vm_size_t capacity, vm_offset_t alignment, uint32_t kernTag, uint32_t userTag )static
static OSPtr<IOBufferMemoryDescriptor> inTaskWithPhysicalMask( task_t inTask, IOOptionBits options, mach_vm_size_t capacity, mach_vm_address_t physicalMask )static
static OSPtr<IOBufferMemoryDescriptor> withCapacity( vm_size_t capacity __xnu_data_size, IODirection withDirection, bool withContiguousMemory = false )static
withCapacity:
Returns a new IOBufferMemoryDescriptor with a buffer large enough to
hold capacity bytes. The descriptor's length is initially set to the
capacity.
static OSPtr<IOBufferMemoryDescriptor> withBytes( const void * bytes, vm_size_t withLength __xnu_data_size, IODirection withDirection, bool withContiguousMemory = false )static
withBytes:
Returns a new IOBufferMemoryDescriptor preloaded with bytes (copied).
The descriptor's length and capacity are set to the input buffer's size.
virtual void setLength(vm_size_t length)virtual
setLength:
Change the buffer length of the memory descriptor. When a new buffer
is created, the initial length of the buffer is set to be the same as
the capacity. The length can be adjusted via setLength for a shorter
transfer (there is no need to create more buffer descriptors when you
can reuse an existing one, even for different transfer sizes). Note
that the specified length must not exceed the capacity of the buffer.
virtual void setDirection(IODirection direction)virtual
setDirection:
Change the direction of the transfer. This method allows one to redirect
the descriptor's transfer direction. This eliminates the need to destroy
and create new buffers when different transfer directions are needed.
virtual void *getBytesNoCopy()virtual
virtual bool appendBytes(const void *bytes, vm_size_t withLength __xnu_data_size)virtual
appendBytes:
Add some data to the end of the buffer. This method automatically
maintains the memory descriptor buffer length. Note that appendBytes
will not copy past the end of the memory descriptor's current capacity.