40 #include <linux/pci.h>
42 #include <asm/processor.h>
74 unsigned long pio2kbase, pio4kbase;
76 pio4kbase = (dd->
piobufbase >> 32) & 0xffffffffUL;
77 if (pio2kbase < pio4kbase) {
79 pioaddr = addr + pio2kbase;
80 piolen = pio4kbase - pio2kbase +
83 pioaddr = addr + pio4kbase;
84 piolen = pio2kbase - pio4kbase +
93 for (bits = 0; !(piolen & (1ULL <<
bits)); bits++)
96 if (piolen != (1ULL << bits)) {
100 piolen = 1ULL << (bits + 1);
102 if (pioaddr & (piolen - 1)) {
104 atmp = pioaddr & ~(piolen - 1);
105 if (atmp < addr || (atmp + piolen) > (addr + len)) {
107 "No way to align address/size (%llx/%llx), no WC mtrr\n",
108 (
unsigned long long) atmp,
109 (
unsigned long long) piolen << 1);
124 "mtrr_add() WC for PIO bufs failed (%d)\n",
151 "mtrr_del(%lx, %lx, %lx) failed: %d\n",