Function

IOMalloc

Allocates general purpose, wired memory in the kernel map.

Declaration

void * IOMalloc(vm_size_t size);

Parameters

size

Size of the memory requested.

Return Value

Pointer to the allocated memory, or zero on failure.

Discussion

This is a general purpose utility to allocate memory in the kernel. There are no alignment guarantees given on the returned memory, and alignment may vary depending on the kernel configuration. This function may block and so should not be called from interrupt level or while a simple lock is held.

See Also

Miscellaneous

IOThreadSelf

Returns the osfmk identifier for the currently running thread.

Debugger

Enter the kernel debugger.

IOCreateThread

Deprecated function - use kernel_thread_start(). Create a kernel thread.

Deprecated
IODelay

Spin delay for a number of microseconds.

IOExitThread

Deprecated function - use thread_terminate(). Terminate execution of current thread.

Deprecated
IOFlushProcessorCache

Flushes the processor cache for mapped memory.

IOFree

Frees memory allocated with IOMalloc.

IOFreeAligned

Frees memory allocated with IOMallocAligned.

IOFreeContiguous

Deprecated - use IOBufferMemoryDescriptor. Frees memory allocated with IOMallocContiguous.

Deprecated
IOFreePageable

Frees memory allocated with IOMallocPageable.

IOLog

Log a message to console in text mode, and /var/log/system.log.

IOLogv

Log a message to console in text mode, and /var/log/system.log.

IOMallocAligned

Allocates wired memory in the kernel map, with an alignment restriction.

IOMallocContiguous

Deprecated - use IOBufferMemoryDescriptor. Allocates wired memory in the kernel map, with an alignment restriction and physically contiguous.

Deprecated
IOMallocPageable

Allocates pageable memory in the kernel map.

IOMappedRead16

Read two bytes from the desired "Physical" IOSpace address.

IOMappedRead32

Read four bytes from the desired "Physical" IOSpace address.

IOMappedRead64

Read eight bytes from the desired "Physical" IOSpace address.

IOMappedRead8

Read one byte from the desired "Physical" IOSpace address.

IOMappedWrite16

Write two bytes to the desired "Physical" IOSpace address.

IOMappedWrite32

Write four bytes to the desired "Physical" IOSpace address.

IOMappedWrite64

Write eight bytes to the desired "Physical" IOSpace address.

IOMappedWrite8

Write one byte to the desired "Physical" IOSpace address.

IOPause

Spin delay for a number of nanoseconds.

IOSleep

Sleep the calling thread for a number of milliseconds.