cleanup
[linux-2.4.21-pre4.git] / include / asm-x86_64 / pci-direct.h
1 #ifndef ASM_PCI_DIRECT_H
2 #define ASM_PCI_DIRECT_H 1
3
4 #include <linux/types.h>
5 #include <asm/io.h>
6
7 /* Direct PCI access. This is used for PCI accesses in early boot before
8    the PCI subsystem works. */ 
9
10 #define PDprintk(x...)
11
12 static inline u32 read_pci_config(u8 bus, u8 slot, u8 func, u8 offset)
13 {
14         u32 v; 
15         outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8);
16         v = inl(0xcfc); 
17         PDprintk("%x reading from %x: %x\n", slot, offset, v);
18         return v;
19 }
20
21 static inline void write_pci_config(u8 bus, u8 slot, u8 func, u8 offset,
22                                     u32 val)
23 {
24         PDprintk("%x writing to %x: %x\n", slot, offset, val); 
25         outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8);
26         outl(val, 0xcfc); 
27 }
28
29 #endif