---
title: prepare
framework: kernel
role: pseudoSymbol
path: kernel/iomultimemorydescriptor/1812660-prepare
---

# prepare

Prepare the memory for an I/O transfer.

## Declaration

```occ
virtual IOReturn prepare(
 IODirection forDirection = forDirection); 
```

## Parameters

- `forDirection`: The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor.

## Return Value

Return Value An IOReturn code.

## Overview

Overview This involves paging in the memory, if necessary, and wiring it down for the duration of the transfer. The complete() method completes the processing of the memory after the I/O transfer finishes. This method needn't called for non-pageable memory.

## See Also

### Miscellaneous

- [complete](kernel/iomultimemorydescriptor/1812588-complete.md)
- [getPhysicalSegment](kernel/iomultimemorydescriptor/1812610-getphysicalsegment.md)
- [initWithDescriptors](kernel/iomultimemorydescriptor/1812635-initwithdescriptors.md)
- [withDescriptors(IOMemoryDescriptor **, UInt32, IODirection, bool)](kernel/iomultimemorydescriptor/1812685-withdescriptors.md)
- [withDescriptors(IOMemoryDescriptor **, UInt32, IODirection, bool)](kernel/iomultimemorydescriptor/1812714-withdescriptors.md)
