---
title: setMapping
framework: kernel
role: pseudoSymbol
path: kernel/iomemorydescriptor/1812859-setmapping
---

# setMapping

Establishes an already existing mapping.

## Declaration

```occ
virtual IOMemoryMap * setMapping( 
 task_t task, 
 IOVirtualAddress mapAddress, 
 IOOptionBits options = 0 ); 
```

## Parameters

- `task`: Address space in which the mapping exists.
- `mapAddress`: Virtual address of the mapping.
- `options`: Caching and read-only attributes of the mapping.

## Return Value

Return Value A IOMemoryMap object created to represent the mapping.

## Overview

Overview This method tells the IOMemoryDescriptor about a mapping that exists, but was created elsewhere. It allows later callers of the map method to share this externally created mapping. The IOMemoryMap object returned is created to represent it. This method is not commonly needed.

## See Also

### Mapping to the Other Address Spaces

- [createMappingInTask](kernel/iomemorydescriptor/1812752-createmappingintask.md)
- [createMappingInTask](kernel/iomemorydescriptor/1441859-createmappingintask.md)
- [map](kernel/iomemorydescriptor/1812830-map.md)
- [map](kernel/iomemorydescriptor/1441908-map.md)
- [setMapping](kernel/iomemorydescriptor/1441948-setmapping.md)
