Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
iommu.c File Reference
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/errno.h>
#include <linux/iommu-helper.h>
#include <linux/bitmap.h>
#include <asm/iommu.h>
#include "iommu_common.h"

Go to the source code of this file.

Macros

#define STC_CTXMATCH_ADDR(STC, CTX)   ((STC)->strbuf_ctxmatch_base + ((CTX) << 3))
 
#define STC_FLUSHFLAG_INIT(STC)   (*((STC)->strbuf_flushflag) = 0UL)
 
#define STC_FLUSHFLAG_SET(STC)   (*((STC)->strbuf_flushflag) != 0UL)
 
#define iommu_read(__reg)
 
#define iommu_write(__reg, __val)
 
#define IOPTE_CONSISTENT(CTX)
 
#define IOPTE_STREAMING(CTX)   (IOPTE_CONSISTENT(CTX) | IOPTE_STBUF)
 
#define IOPTE_IS_DUMMY(iommu, iopte)   ((iopte_val(*iopte) & IOPTE_PAGE) == (iommu)->dummy_page_pa)
 

Functions

unsigned long iommu_range_alloc (struct device *dev, struct iommu *iommu, unsigned long npages, unsigned long *handle)
 
void iommu_range_free (struct iommu *iommu, dma_addr_t dma_addr, unsigned long npages)
 
int iommu_table_init (struct iommu *iommu, int tsbsize, u32 dma_offset, u32 dma_addr_mask, int numa_node)
 
 EXPORT_SYMBOL (dma_ops)
 
int pci64_dma_supported (struct pci_dev *pdev, u64 device_mask)
 
int dma_supported (struct device *dev, u64 device_mask)
 
 EXPORT_SYMBOL (dma_supported)
 

Variables

struct dma_map_opsdma_ops = &sun4u_dma_ops
 

Macro Definition Documentation

#define iommu_read (   __reg)
Value:
({ u64 __ret; \
__asm__ __volatile__("ldxa [%1] %2, %0" \
: "=r" (__ret) \
: "r" (__reg), "i" (ASI_PHYS_BYPASS_EC_E) \
: "memory"); \
__ret; \
})

Definition at line 32 of file iommu.c.

#define iommu_write (   __reg,
  __val 
)
Value:
__asm__ __volatile__("stxa %0, [%1] %2" \
: /* no outputs */ \
: "r" (__val), "r" (__reg), \

Definition at line 40 of file iommu.c.

#define IOPTE_CONSISTENT (   CTX)
Value:
(((CTX) << 47) & IOPTE_CONTEXT))

Definition at line 66 of file iommu.c.

#define IOPTE_IS_DUMMY (   iommu,
  iopte 
)    ((iopte_val(*iopte) & IOPTE_PAGE) == (iommu)->dummy_page_pa)

Definition at line 76 of file iommu.c.

#define IOPTE_STREAMING (   CTX)    (IOPTE_CONSISTENT(CTX) | IOPTE_STBUF)

Definition at line 70 of file iommu.c.

#define STC_CTXMATCH_ADDR (   STC,
  CTX 
)    ((STC)->strbuf_ctxmatch_base + ((CTX) << 3))

Definition at line 25 of file iommu.c.

#define STC_FLUSHFLAG_INIT (   STC)    (*((STC)->strbuf_flushflag) = 0UL)

Definition at line 27 of file iommu.c.

#define STC_FLUSHFLAG_SET (   STC)    (*((STC)->strbuf_flushflag) != 0UL)

Definition at line 29 of file iommu.c.

Function Documentation

int dma_supported ( struct device dev,
u64  device_mask 
)

Definition at line 845 of file iommu.c.

EXPORT_SYMBOL ( dma_ops  )
EXPORT_SYMBOL ( dma_supported  )
unsigned long iommu_range_alloc ( struct device dev,
struct iommu iommu,
unsigned long  npages,
unsigned long handle 
)

Definition at line 96 of file iommu.c.

void iommu_range_free ( struct iommu iommu,
dma_addr_t  dma_addr,
unsigned long  npages 
)

Definition at line 167 of file iommu.c.

int iommu_table_init ( struct iommu iommu,
int  tsbsize,
u32  dma_offset,
u32  dma_addr_mask,
int  numa_node 
)

Definition at line 177 of file iommu.c.

int pci64_dma_supported ( struct pci_dev pdev,
u64  device_mask 
)

Definition at line 897 of file pci.c.

Variable Documentation

struct dma_map_ops* dma_ops = &sun4u_dma_ops

Definition at line 840 of file iommu.c.