2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
8 #ifndef _ASM_IA64_SN_PIO_H
9 #define _ASM_IA64_SN_PIO_H
11 #include <asm/sn/types.h>
14 * pioaddr_t - The kernel virtual address that a PIO can be done upon.
15 * Should probably be (volatile void*) but EVEREST would do PIO
16 * to long mostly, just cast for other sizes.
19 typedef volatile unsigned long* pioaddr_t
;
22 * iopaddr_t - the physical io space relative address (e.g. VME A16S 0x0800).
23 * iosapce_t - specifies the io address space to be mapped/accessed.
24 * piomap_t - the handle returned by pio_alloc() and used with all the pio
29 typedef struct piomap
{
31 unsigned int pio_adap
;
34 char pio_name
[7]; /* to identify the mapped device */
35 struct piomap
*pio_next
; /* dlist to link active piomap's */
36 struct piomap
*pio_prev
; /* for debug and error reporting */
37 iopaddr_t pio_iopmask
; /* valid iop address bit mask */
38 iobush_t pio_bushandle
; /* bus-level handle */
41 #define pio_type pio_iospace.ios_type
42 #define pio_iopaddr pio_iospace.ios_iopaddr
43 #define pio_size pio_iospace.ios_size
44 #define pio_vaddr pio_iospace.ios_vaddr
46 /* Macro to get/set PIO error function */
47 #define pio_seterrf(p,f) (p)->pio_errfunc = (f)
48 #define pio_geterrf(p) (p)->pio_errfunc
52 * piomap_t type defines
55 #define PIOMAP_NTYPES 7
57 #define PIOMAP_A16N VME_A16NP
58 #define PIOMAP_A16S VME_A16S
59 #define PIOMAP_A24N VME_A24NP
60 #define PIOMAP_A24S VME_A24S
61 #define PIOMAP_A32N VME_A32NP
62 #define PIOMAP_A32S VME_A32S
65 #define PIOMAP_EISA_IO 0
66 #define PIOMAP_EISA_MEM 1
68 #define PIOMAP_PCI_IO 0
69 #define PIOMAP_PCI_MEM 1
70 #define PIOMAP_PCI_CFG 2
71 #define PIOMAP_PCI_ID 3
73 /* IBUS piomap types */
76 /* dang gio piomap types */
78 #define PIOMAP_GIO32 0
79 #define PIOMAP_GIO64 1
86 #define PIOREG_NULL (-1)
88 /* standard flags values for pio_map routines,
89 * including {xtalk,pciio}_piomap calls.
90 * NOTE: try to keep these in step with DMAMAP flags.
92 #define PIOMAP_UNFIXED 0x0
93 #define PIOMAP_FIXED 0x1
94 #define PIOMAP_NOSLEEP 0x2
95 #define PIOMAP_INPLACE 0x4
97 #define PIOMAP_FLAGS 0x7
99 #endif /* _ASM_IA64_SN_PIO_H */