Function

IOCreateThread

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

Declaration

IOThread IOCreateThread(IOThreadFunc function, void *argument);

Parameters

function

A C-function pointer where the thread will begin execution.

argument

Caller specified data to be passed to the new thread.

Return Value

An IOThread identifier for the new thread, equivalent to an osfmk thread_t.

Discussion

This function creates a kernel thread, and passes the caller supplied argument to the new thread. Warning: the value returned by this function is not 100% reliable. There is a race condition where it is possible that the new thread has already terminated before this call returns. Under that circumstance the IOThread returned will be invalid. In general there is little that can be done with this value except compare it against 0. The thread itself can call IOThreadSelf() 100% reliably and that is the prefered mechanism to manipulate the IOThreads state.

See Also

Miscellaneous

IOThreadSelf

Returns the osfmk identifier for the currently running thread.

Debugger

Enter the kernel debugger.

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.

IOMalloc

Allocates general purpose, wired memory in the kernel map.

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.