Linux Kernel
3.7.1
|
#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] |
#define _IOR_OFFSET_WIDTH | ( | n | ) | (1 << order_base_2(n)) |
#define IOR_DMA_BITS (IOR_BPC * sizeof(dma_addr_t)) |
#define IOR_DMA_MSBITS (IOR_DMA_BITS - IOR_LSBITS) |
#define IOR_DMA_OFFSET_BITS IOR_OFFSET_WIDTH(IOR_DMA_MSBITS) |
#define IOR_DMA_SHIFT (IOR_DMA_BITS - IOR_DMA_OFFSET_BITS) |
#define IOR_NUM_DMA_TO_PHYS ((dma_addr_t) 1 << IOR_DMA_MSBITS) |
#define IOR_NUM_PHYS_TO_DMA ((phys_addr_t) 1 << IOR_PHYS_MSBITS) |
#define IOR_OFFSET_WIDTH | ( | n | ) | (_IOR_OFFSET_WIDTH(n) < 8 ? 8 : _IOR_OFFSET_WIDTH(n)) |
#define IOR_PHYS_BITS (IOR_BPC * sizeof(phys_addr_t)) |
#define IOR_PHYS_MSBITS (IOR_PHYS_BITS - IOR_LSBITS) |
#define IOR_PHYS_OFFSET_BITS IOR_OFFSET_WIDTH(IOR_PHYS_MSBITS) |
#define IOR_PHYS_SHIFT (IOR_PHYS_BITS - IOR_PHYS_OFFSET_BITS) |
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.
struct ior_dma_to_phys _ior_dma_to_phys[IOR_NUM_DMA_TO_PHYS] |
struct ior_phys_to_dma _ior_phys_to_dma[IOR_NUM_PHYS_TO_DMA] |