Go to the documentation of this file.
11 #include <linux/compiler.h>
12 #include <asm/intrinsics.h>
19 #define __sn_mf_a() ia64_mfa()
23 #define __sn_inb ___sn_inb
24 #define __sn_inw ___sn_inw
25 #define __sn_inl ___sn_inl
26 #define __sn_outb ___sn_outb
27 #define __sn_outw ___sn_outw
28 #define __sn_outl ___sn_outl
29 #define __sn_readb ___sn_readb
30 #define __sn_readw ___sn_readw
31 #define __sn_readl ___sn_readl
32 #define __sn_readq ___sn_readq
33 #define __sn_readb_relaxed ___sn_readb_relaxed
34 #define __sn_readw_relaxed ___sn_readw_relaxed
35 #define __sn_readl_relaxed ___sn_readl_relaxed
36 #define __sn_readq_relaxed ___sn_readq_relaxed
42 #define __sn_setq_relaxed(addr, val) \
43 writeq((__sn_readq_relaxed(addr) | (val)), (addr))
44 #define __sn_clrq_relaxed(addr, val) \
45 writeq((__sn_readq_relaxed(addr) & ~(val)), (addr))
56 static inline unsigned int
57 ___sn_inb (
unsigned long port)
59 volatile unsigned char *
addr;
60 unsigned char ret = -1;
70 static inline unsigned int
71 ___sn_inw (
unsigned long port)
73 volatile unsigned short *
addr;
74 unsigned short ret = -1;
84 static inline unsigned int
85 ___sn_inl (
unsigned long port)
87 volatile unsigned int *
addr;
88 unsigned int ret = -1;
99 ___sn_outb (
unsigned char val,
unsigned long port)
101 volatile unsigned char *
addr;
110 ___sn_outw (
unsigned short val,
unsigned long port)
112 volatile unsigned short *
addr;
121 ___sn_outl (
unsigned int val,
unsigned long port)
123 volatile unsigned int *
addr;
140 static inline unsigned char
141 ___sn_readb (
const volatile void __iomem *addr)
145 val = *(
volatile unsigned char __force *)addr;
151 static inline unsigned short
152 ___sn_readw (
const volatile void __iomem *addr)
156 val = *(
volatile unsigned short __force *)addr;
162 static inline unsigned int
163 ___sn_readl (
const volatile void __iomem *addr)
167 val = *(
volatile unsigned int __force *)addr;
173 static inline unsigned long
174 ___sn_readq (
const volatile void __iomem *addr)
178 val = *(
volatile unsigned long __force *)addr;
193 static inline unsigned int
194 sn_inb_fast (
unsigned long port)
196 volatile unsigned char *addr = (
unsigned char *)port;
204 static inline unsigned int
205 sn_inw_fast (
unsigned long port)
207 volatile unsigned short *addr = (
unsigned short *)port;
215 static inline unsigned int
216 sn_inl_fast (
unsigned long port)
218 volatile unsigned int *addr = (
unsigned int *)port;
226 static inline unsigned char
227 ___sn_readb_relaxed (
const volatile void __iomem *addr)
229 return *(
volatile unsigned char __force *)addr;
232 static inline unsigned short
233 ___sn_readw_relaxed (
const volatile void __iomem *addr)
235 return *(
volatile unsigned short __force *)addr;
238 static inline unsigned int
239 ___sn_readl_relaxed (
const volatile void __iomem *addr)
241 return *(
volatile unsigned int __force *) addr;
244 static inline unsigned long
245 ___sn_readq_relaxed (
const volatile void __iomem *addr)
247 return *(
volatile unsigned long __force *) addr;
253 sn_pci_set_vchan(
struct pci_dev *
pci_dev,
unsigned long *addr,
int vchan)
265 *addr |= (1
UL << 57);
268 *addr &= ~(1
UL << 57);