# cpu/uc3/include/cpu/physmem.h File Reference

UC3-specific physical memory definitions. More...

`#include <types.h>`

Include dependency graph for physmem.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Defines
#define | PHYSMEM_ALLOC_ERR ((phys_addr_t)(-1))
| Return value indicating physical memory allocation failure.
#define | PHYS_MAP_COHERENT (0)
| Create a coherent (uncached) mapping.
#define | PHYS_MAP_WRBUF (0)
| Write-buffering is allowed.
#define | PHYS_MAP_WRTHROUGH (0)
| Write-through caching is allowed.
#define | PHYS_MAP_WRBACK (0)
| Write-back caching is allowed.
## Functions
static void * | physmem_map (phys_addr_t phys, phys_size_t size, unsigned long flags)
| Map a physical address to a virtual address.
static void | physmem_unmap (void *vaddr, size_t size)
| Unmap a virtual-to-physical mapping.

## Detailed Description

UC3-specific physical memory definitions.

See also:
  physmem.h

- Compiler: IAR EWAVR32 and GNU GCC for AVR32
- Supported devices: All AVR32 UC3 devices
- AppNote:

Author:
  Atmel Corporation: http://www.atmel.com
  Support and FAQ: http://support.atmel.no/

Definition in file physmem.h.

## Define Documentation

#define PHYS_MAP_COHERENT (0)

Create a coherent (uncached) mapping.

Definition at line 52 of file physmem.h.

#define PHYS_MAP_WRBACK (0)

Write-back caching is allowed.

Definition at line 58 of file physmem.h.

Referenced by mem_pool_init_physmem().

#define PHYS_MAP_WRBUF (0)

Write-buffering is allowed.

Definition at line 54 of file physmem.h.

Referenced by mem_pool_init_physmem().

#define PHYS_MAP_WRTHROUGH (0)

Write-through caching is allowed.

Definition at line 56 of file physmem.h.

#define PHYSMEM_ALLOC_ERR ((phys_addr_t)(-1))

Return value indicating physical memory allocation failure.

Definition at line 49 of file physmem.h.

Referenced by dma_pool_init_coherent_physmem(), mem_pool_init_physmem(), physmem_alloc(), and physmem_alloc_low().

## Function Documentation

static void* physmem_map | ( | phys_addr_t | phys,
|  | phys_size_t | size,
|  | unsigned long | flags |
| ) |  |  | `[inline, static]`

Map a physical address to a virtual address.

This function returns a valid virtual address which can be used to access a given physical memory area with given access and caching properties.

Parameters:

  | phys | A valid physical address.
  | size | The size of the physical region to be mapped.
  | flags | Flags specifying cache behaviour, etc.

Returns:
  A virtual address which can be used to access phys.

Definition at line 73 of file physmem.h.

Referenced by mem_pool_init_physmem().

static void physmem_unmap | ( | void * | vaddr,
|  | size_t | size |
| ) |  |  | `[inline, static]`

Unmap a virtual-to-physical mapping.

This function cleans up any mappings set up by physmem_map(). It must be called when the virtual mapping isn't needed anymore.

Parameters:

  | vaddr | A valid virtual address returned by physmem_map().
  | size | The size of the mapped region.

Definition at line 88 of file physmem.h.