Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
ioremap.h File Reference
#include <linux/types.h>
#include <linux/log2.h>
#include <linux/compiler.h>
#include <asm/pgtable-bits.h>
#include <asm/addrspace.h>

Go to the source code of this file.

Data Structures

struct  ior_phys_to_dma
 
struct  ior_dma_to_phys
 

Macros

#define IOR_BPC   8 /* Bits per char */
 
#define IOR_PHYS_BITS   (IOR_BPC * sizeof(phys_addr_t))
 
#define IOR_DMA_BITS   (IOR_BPC * sizeof(dma_addr_t))
 
#define IOR_LSBITS   22 /* Bits in a grain */
 
#define IOR_PHYS_MSBITS   (IOR_PHYS_BITS - IOR_LSBITS)
 
#define IOR_NUM_PHYS_TO_DMA   ((phys_addr_t) 1 << IOR_PHYS_MSBITS)
 
#define IOR_DMA_MSBITS   (IOR_DMA_BITS - IOR_LSBITS)
 
#define IOR_NUM_DMA_TO_PHYS   ((dma_addr_t) 1 << IOR_DMA_MSBITS)
 
#define _IOR_OFFSET_WIDTH(n)   (1 << order_base_2(n))
 
#define IOR_OFFSET_WIDTH(n)   (_IOR_OFFSET_WIDTH(n) < 8 ? 8 : _IOR_OFFSET_WIDTH(n))
 
#define IOR_PHYS_OFFSET_BITS   IOR_OFFSET_WIDTH(IOR_PHYS_MSBITS)
 
#define IOR_PHYS_SHIFT   (IOR_PHYS_BITS - IOR_PHYS_OFFSET_BITS)
 
#define IOR_DMA_OFFSET_BITS   IOR_OFFSET_WIDTH(IOR_DMA_MSBITS)
 
#define IOR_DMA_SHIFT   (IOR_DMA_BITS - IOR_DMA_OFFSET_BITS)
 

Functions

void ioremap_add_map (dma_addr_t phys, phys_addr_t alias, dma_addr_t size)
 

Variables

struct ior_phys_to_dma _ior_phys_to_dma [IOR_NUM_PHYS_TO_DMA]
 
struct ior_dma_to_phys _ior_dma_to_phys [IOR_NUM_DMA_TO_PHYS]
 

Macro Definition Documentation

#define _IOR_OFFSET_WIDTH (   n)    (1 << order_base_2(n))

Definition at line 57 of file ioremap.h.

#define IOR_BPC   8 /* Bits per char */

Definition at line 20 of file ioremap.h.

#define IOR_DMA_BITS   (IOR_BPC * sizeof(dma_addr_t))

Definition at line 22 of file ioremap.h.

#define IOR_DMA_MSBITS   (IOR_DMA_BITS - IOR_LSBITS)

Definition at line 42 of file ioremap.h.

#define IOR_DMA_OFFSET_BITS   IOR_OFFSET_WIDTH(IOR_DMA_MSBITS)

Definition at line 64 of file ioremap.h.

#define IOR_DMA_SHIFT   (IOR_DMA_BITS - IOR_DMA_OFFSET_BITS)

Definition at line 65 of file ioremap.h.

#define IOR_LSBITS   22 /* Bits in a grain */

Definition at line 32 of file ioremap.h.

#define IOR_NUM_DMA_TO_PHYS   ((dma_addr_t) 1 << IOR_DMA_MSBITS)

Definition at line 43 of file ioremap.h.

#define IOR_NUM_PHYS_TO_DMA   ((phys_addr_t) 1 << IOR_PHYS_MSBITS)

Definition at line 40 of file ioremap.h.

#define IOR_OFFSET_WIDTH (   n)    (_IOR_OFFSET_WIDTH(n) < 8 ? 8 : _IOR_OFFSET_WIDTH(n))

Definition at line 58 of file ioremap.h.

#define IOR_PHYS_BITS   (IOR_BPC * sizeof(phys_addr_t))

Definition at line 21 of file ioremap.h.

#define IOR_PHYS_MSBITS   (IOR_PHYS_BITS - IOR_LSBITS)

Definition at line 39 of file ioremap.h.

#define IOR_PHYS_OFFSET_BITS   IOR_OFFSET_WIDTH(IOR_PHYS_MSBITS)

Definition at line 61 of file ioremap.h.

#define IOR_PHYS_SHIFT   (IOR_PHYS_BITS - IOR_PHYS_OFFSET_BITS)

Definition at line 62 of file ioremap.h.

Function Documentation

void ioremap_add_map ( phys_addr_t  phys,
phys_addr_t  dma,
phys_addr_t  size 
)

ioremap_add_map - add to the physical and DMA address conversion arrays : Process's view of the address of the start of the memory chunk : DMA address of the start of the memory chunk : Size, in bytes, of the chunk of memory

NOTE: It might be obvious, but the assumption is that all bytes have the same offset between the physical address and the DMA address.

Definition at line 123 of file ioremap.c.

Variable Documentation

Definition at line 57 of file ioremap.c.

Definition at line 50 of file ioremap.c.