Update ia64 patch to 2.5.72-030619
[linux-flexiantxendom0-3.2.10.git] / include / asm-ia64 / sn / dmamap.h
1 /* $Id$
2  *
3  * This file is subject to the terms and conditions of the GNU General Public
4  * License.  See the file "COPYING" in the main directory of this archive
5  * for more details.
6  *
7  * Copyright (C) 1992-1997,2000-2003 Silicon Graphics, Inc. All rights reserved.
8  */
9 #ifndef _ASM_IA64_SN_DMAMAP_H
10 #define _ASM_IA64_SN_DMAMAP_H
11
12 #include <asm/sn/sv.h>
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17
18 /*
19  * Definitions for allocating, freeing, and using DMA maps
20  */
21
22 /*
23  * DMA map types
24  */
25 #define DMA_SCSI        0
26 #define DMA_A24VME      1               /* Challenge/Onyx only  */
27 #define DMA_A32VME      2               /* Challenge/Onyx only  */
28 #define DMA_A64VME      3               /* SN0/Racer */
29
30 #define DMA_EISA        4
31
32 #define DMA_PCI32       5               /* SN0/Racer    */
33 #define DMA_PCI64       6               /* SN0/Racer    */
34
35 /*
36  * DMA map structure as returned by dma_mapalloc()
37  */
38 typedef struct dmamap {
39         int             dma_type;       /* Map type (see above) */
40         int             dma_adap;       /* I/O adapter */
41         int             dma_index;      /* Beginning map register to use */
42         int             dma_size;       /* Number of map registers to use */
43         paddr_t         dma_addr;       /* Corresponding bus addr for A24/A32 */
44         caddr_t         dma_virtaddr;   /* Beginning virtual address that is mapped */
45 } dmamap_t;
46
47 struct alenlist_s;
48
49 /*
50  * Prototypes of exported functions
51  */
52 extern dmamap_t *dma_mapalloc(int, int, int, int);
53 extern void     dma_mapfree(dmamap_t *);
54 extern int      dma_map(dmamap_t *, caddr_t, int);
55 extern int      dma_map2(dmamap_t *, caddr_t, caddr_t, int);
56 extern paddr_t  dma_mapaddr(dmamap_t *, caddr_t);
57 extern int      dma_map_alenlist(dmamap_t *, struct alenlist_s *, size_t);
58 extern uint     ev_kvtoiopnum(caddr_t);
59
60 /*
61  * These variables are defined in master.d/kernel
62  */
63 extern struct map *a24map[];
64 extern struct map *a32map[];
65
66 extern int a24_mapsize;
67 extern int a32_mapsize;
68
69 extern sv_t dmamapout;
70
71 #ifdef __cplusplus
72 }
73 #endif
74
75 /* standard flags values for pio_map routines,
76  * including {xtalk,pciio}_dmamap calls.
77  * NOTE: try to keep these in step with PIOMAP flags.
78  */
79 #define DMAMAP_FIXED    0x1
80 #define DMAMAP_NOSLEEP  0x2
81 #define DMAMAP_INPLACE  0x4
82
83 #define DMAMAP_FLAGS    0x7
84
85 #endif /* _ASM_IA64_SN_DMAMAP_H */