# Kernel Folio Calls

This chapter describes the kernel folio procedure calls in alphabetical order. The list provides a quick summary of each procedure and the page number of the first page of its description.

- `AbortIO` Aborts an I/O operation.
- `AddHead` Adds a node to the head of a list.
- `AddTail` Adds a node to the tail of a list.
- `AllocMem` Allocate a memory block of a specific type.
- `AllocMemBlocks` Transfers pages of memory from the system-wide free memory pool.
- `AllocMemFromMemList` Allocates memory from a private memory pool.
- `AllocMemFromMemLists` Allocates a memory block from a list of memory lists.
- `AllocMemList` Creates a private memory list.
- `AllocSignal` Allocates signals.
- `AvailMem` Gets information about available memory.
- `CallFolio` Invokes from the folio vector table a folio procedure that doesn't return a value.
- `CallFolioRet` Invokes from the folio vector table a folio procedure that returns a value.
- `CheckIO` Checks for I/O request completion.
- `CheckItem` Checks to see if an item exists.
- `ClearCurrentSignals` Clears some received signal bits.
- `CloseItem` Closes a system item.
- `CloseNamedDevice` Closes a device previously opened with OpenNamedDevice().
- `ControlMem` Controls memory permissions and ownership.
- `CountBits` Counts the number of bits set in a word.
- `CreateBufferedMsg` Creates a buffered message.
- `CreateIOReq` Creates an I/O request.
- `CreateItem` Creates an item.
- `CreateMemDebug` Initializes memory debugging package.
- `CreateMsg` Creates a standard message.
- `CreateMsgPort` Creates a message port.
- `CreateSemaphore` Creates a semaphore.
- `CreateSmallMsg` Creates a small message.
- `CreateThread` Creates a thread.
- `CreateUniqueMsgPort` Creates a message port with a unique name.
- `CreateUniqueSemaphore` Creates a semaphore with a unique name.
- `DeleteIOReq` Deletes an I/O request.
- `DeleteItem` Deletes an item.
- `DeleteMemDebug` Releases memory debugging resources.
- `DeleteMsg` Deletes a message.
- `DeleteMsgPort` Deletes a message port.
- `DeleteSemaphore` Deletes a semaphore.
- `DeleteThread` Deletes a thread.
- `DoIO` Performs synchronous I/O.
- `DumpMemDebug` Dumps memory allocation debugging information.
- `DumpNode` Prints contents of a node.
- `DumpTagList` Prints contents of a tag list.
- `exit` Exits from a task or thread.
- `ffs` Finds the first set bit.
- `FindAndOpenDevice` Finds a device by name and opens it.
- `FindAndOpenFolio` Finds a folio by name and opens it.
- `FindAndOpenItem` Finds an item by type and tags and opens it.
- `FindAndOpenNamedItem` Finds an item by name and opens it.
- `FindDevice` Finds a device by name.
- `FindFolio` Finds a folio by name.
- `FindItem` Finds an item by type and tags.
- `FindLSB` Finds the least-significant bit.
- `FindMSB` Finds the highest-numbered bit.
- `FindMsgPort` Finds a message port by name.
- `FindNamedItem` Finds an item by name.
- `FindNamedNode` Finds a node by name.
- `FindNodeFromHead` Returns a pointer to a node appearing at a given ordinal position from the head of the list.
- `FindNodeFromTail` Returns a pointer to a node appearing at a given ordinal position from the tail of the list.
- `FindSemaphore` Finds a semaphore by name.
- `FindTagArg` Looks through a tag list for a specific tag.
- `FindTask` Finds a task by name.
- `FindVersionedItem` Finds an item by name and version.
- `FirstNode` Gets the first node in a list.
- `free` Frees memory from malloc().
- `FreeMem` Frees memory from AllocMem().
- `FreeMemList` Frees a memory list.
- `FreeMemToMemList` Frees a private block of memory.
- `FreeMemToMemLists` Returns memory to the free pool.
- `FreeSignal` Frees signals.
- `GetBankBits` Finds out which VRAM bank contains a memory location.
- `GetCurrentSignals` Gets the currently received signal bits.
- `GetFolioFunc` Returns a pointer to a folio function.
- `GetMemAllocAlignment` Gets the memory-allocation alignment size
- `GetMemTrackSize` Get the size of a block of memory allocated with MEMTYPE_TRACKSIZE.
- `GetMemType` Gets the type of the specified memory.
- `GetMsg` Gets a message from a message port.
- `GetNodeCount` Counts the number of nodes in a list.
- `GetNodePosFromHead` Gets the ordinal position of a node within a list, counting from the head of the list.
- `GetNodePosFromTail` Gets the ordinal position of a node within a list, counting from the tail of the list.
- `GetPageSize` Gets the number of bytes in a memory page.
- `GetSysErr` Gets the error string for an error.
- `GetTagArg` Finds a TagArg in list and returns its ta_Arg field.
- `GetTaskSignals` Gets the currently received signal bits.
- `GetThisMsg` Gets a specific message.
- `InitList` Initializes a list.
- `InsertNodeAfter` Inserts a node into a list after another node already in the list.
- `InsertNodeBefore` Inserts a node into a list before another node already in the list.
- `InsertNodeFromHead` Inserts a node into a list.
- `InsertNodeFromTail` Inserts a node into a list.
- `IsEmptyList` Checks whether a list is empty.
- `IsItemOpened` Determines whether a task or thread has opened a given item.
- `IsListEmpty` Checks whether a list is empty.
- `IsMemReadable` Determines whether a region of memory is fully readable by the current task.
- `IsMemWritable` Determines whether a region of memory is fully writable by the current task.
- `IsNode` Checks that a node pointer is not the head list anchor.
- `IsNodeB` Checks that a node pointer is not the tail list anchor.
- `LastNode` Gets the last node in a list.
- `LockItem` Locks an item.
- `LockSemaphore` Locks a semaphore.
- `LookupItem` Gets a pointer to an item.
- `malloc` Allocates memory.
- `MkNodeID` Creates an item type value
- `NextNode` Gets the next node in a list.
- `NextTagArg` Finds the next TagArg in a tag list.
- `OpenItem` Opens an item.
- `OpenNamedDevice` Opens a named device.
- `PrevNode` Gets the previous node in a list.
- `PrintError` Prints the error string for an error
- `PrintfSysErr` Prints the error string for an error.
- `ReadHardwareRandomNumber` Gets a 32-bit random number.
- `RemHead` Removes the first node from a list.
- `RemNode` Removes a node from a list.
- `RemTail` Removes the last node from a list.
- `ReplyMsg` Sends a reply to a message.
- `ReplySmallMsg` Sends a reply to a small message.
- `SampleSystemTime` Samples the system time with very low overhead.
- `SampleSystemTimeTV` Samples the system time with very low overhead.
- `SanityCheckMemDebug` Checks all current memory allocations to make sure all of the allocation cookies are intact
- `ScanList` Walks through all the nodes in a list.
- `ScanListB` Walks through all the nodes in a list backwards.
- `ScavengeMem` Returns task's free memory pages to the system memory pool.
- `SendIO` Requests asynchronous I/O.
- `SendMsg` Sends a message.
- `SendSignal` Sends a signal to another task.
- `SendSmallMsg` Sends a small message.
- `SetItemOwner` Changes the owner of an item.
- `SetItemPri` Changes the priority of an item.
- `SetNodePri` Changes the priority of a list node.
- `UniversalInsertNode` Inserts a node into a list.
- `UnlockItem` Unlocks a locked item.
- `UnlockSemaphore` Unlocks a semaphore.
- `WaitIO` Waits for an I/O request to complete.
- `WaitPort` Waits for a message to arrive.
- `WaitSignal` Waits until a signal is received.
- `Yield` Give up the CPU to a task of equal priority.