---
title: prepare
framework: kernel
role: pseudoSymbol
path: kernel/iomemorydescriptor/1812845-prepare
---

# prepare

Prepare the memory for an I/O transfer.

## Declaration

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

## 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. Note that the prepare call is not thread safe and it is expected that the client will more easily be able to guarantee single threading a particular memory descriptor.

## See Also

### Preparing the Buffer

- [prepare](kernel/iomemorydescriptor/1442024-prepare.md)
- [complete](kernel/iomemorydescriptor/1812740-complete.md)
- [complete](kernel/iomemorydescriptor/1442043-complete.md)
- [getPreparationID](kernel/iomemorydescriptor/1441964-getpreparationid.md)
- [setPreparationID](kernel/iomemorydescriptor/1442011-setpreparationid.md)
