OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [arch/] [sparc64/] [kernel/] [iommu_common.h] - Blame information for rev 1275

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/* $Id: iommu_common.h,v 1.1.1.1 2004-04-15 01:34:43 phoenix Exp $
2
 * iommu_common.h: UltraSparc SBUS/PCI common iommu declarations.
3
 *
4
 * Copyright (C) 1999 David S. Miller (davem@redhat.com)
5
 */
6
 
7
#include <linux/kernel.h>
8
#include <linux/types.h>
9
#include <linux/sched.h>
10
#include <linux/mm.h>
11
 
12
#include <asm/iommu.h>
13
#include <asm/scatterlist.h>
14
 
15
/*
16
 * These give mapping size of each iommu pte/tlb.
17
 */
18
#define IO_PAGE_SHIFT                   13
19
#define IO_PAGE_SIZE                    (1UL << IO_PAGE_SHIFT)
20
#define IO_PAGE_MASK                    (~(IO_PAGE_SIZE-1))
21
#define IO_PAGE_ALIGN(addr)             (((addr)+IO_PAGE_SIZE-1)&IO_PAGE_MASK)
22
 
23
#define IO_TSB_ENTRIES                  (128*1024)
24
#define IO_TSB_SIZE                     (IO_TSB_ENTRIES * 8)
25
 
26
/*
27
 * This is the hardwired shift in the iotlb tag/data parts.
28
 */
29
#define IOMMU_PAGE_SHIFT                13
30
 
31
/* You are _strongly_ advised to enable the following debugging code
32
 * any time you make changes to the sg code below, run it for a while
33
 * with filesystems mounted read-only before buying the farm... -DaveM
34
 */
35
#undef VERIFY_SG
36
 
37
#ifdef VERIFY_SG
38
extern void verify_sglist(struct scatterlist *sg, int nents, iopte_t *iopte, int npages);
39
#endif
40
 
41
/* Two addresses are "virtually contiguous" if and only if:
42
 * 1) They are equal, or...
43
 * 2) They are both on a page boundry
44
 */
45
#define VCONTIG(__X, __Y)       (((__X) == (__Y)) || \
46
                                 (((__X) | (__Y)) << (64UL - PAGE_SHIFT)) == 0UL)
47
 
48
extern unsigned long prepare_sg(struct scatterlist *sg, int nents);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.