2 /* Resource information code */
4 #ifdef HAVE_XORG_CONFIG_H
5 #include <xorg-config.h>
11 #include "xf86Privstr.h"
13 #include "xf86Resources.h"
14 #define NEED_OS_RAC_PROTOS
15 #include "xf86_OSlib.h"
17 /* Avoid Imakefile changes */
20 _X_EXPORT resRange PciAvoid
[] = {_PCI_AVOID_PC_STYLE
, _END
};
22 #ifdef INCLUDE_XF86_NO_DOMAIN
24 #if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__)
27 xf86BusAccWindowsFromOS(void)
32 RANGE(range
, 0x00000000, 0xffffffff, ResExcMemBlock
);
33 ret
= xf86AddResToList(ret
, &range
, -1);
35 RANGE(range
, 0x00000000, 0xffffffff, ResExcIoBlock
);
36 ret
= xf86AddResToList(ret
, &range
, -1);
41 xf86PciBusAccWindowsFromOS(void)
47 * Only allow the upper half of the pci memory range to be used
48 * for allocation. The lower half includes magic regions for DMA.
49 * XXX this is not right for XP1000's and similar where we use the
50 * region 0x40000000-0xbfffffff for DMA but this only matters if
51 * the bios screws up the pci region mappings.
53 RANGE(range
, 0x80000000, 0xffffffff, ResExcMemBlock
);
54 ret
= xf86AddResToList(ret
, &range
, -1);
56 RANGE(range
, 0x00000000, 0xffffffff, ResExcIoBlock
);
57 ret
= xf86AddResToList(ret
, &range
, -1);
64 xf86IsaBusAccWindowsFromOS(void)
69 RANGE(range
, 0x00000000, 0xffffffff, ResExcMemBlock
);
70 ret
= xf86AddResToList(ret
, &range
, -1);
72 RANGE(range
, 0x00000000, 0xffffffff, ResExcIoBlock
);
73 ret
= xf86AddResToList(ret
, &range
, -1);
77 #endif /* INCLUDE_UNUSED */
80 xf86AccResFromOS(resPtr ret
)
85 * Fallback is to claim the following areas:
87 * 0x000c0000 - 0x000effff location of VGA and other extensions ROMS
90 RANGE(range
, 0x000c0000, 0x000effff, ResExcMemBlock
);
91 ret
= xf86AddResToList(ret
, &range
, -1);
94 * Fallback would be to claim well known ports in the 0x0 - 0x3ff range
95 * along with their sparse I/O aliases, but that's too imprecise. Instead
96 * claim a bare minimum here.
98 RANGE(range
, 0x00000000, 0x000000ff, ResExcIoBlock
); /* For mainboard */
99 ret
= xf86AddResToList(ret
, &range
, -1);
102 * At minimum, the top and bottom resources must be claimed, so that
103 * resources that are (or appear to be) unallocated can be relocated.
105 RANGE(range
, 0x00000000, 0x00000000, ResExcMemBlock
);
106 ret
= xf86AddResToList(ret
, &range
, -1);
107 RANGE(range
, 0xffffffff, 0xffffffff, ResExcMemBlock
);
108 ret
= xf86AddResToList(ret
, &range
, -1);
109 /* RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
110 ret = xf86AddResToList(ret, &range, -1); */
111 RANGE(range
, 0xffffffff, 0xffffffff, ResExcIoBlock
);
112 ret
= xf86AddResToList(ret
, &range
, -1);
118 #elif defined(__powerpc__)
121 xf86BusAccWindowsFromOS(void)
126 RANGE(range
, 0x00000000, 0xffffffff, ResExcMemBlock
);
127 ret
= xf86AddResToList(ret
, &range
, -1);
129 RANGE(range
, 0x00000000, 0x0000ffff, ResExcIoBlock
);
130 ret
= xf86AddResToList(ret
, &range
, -1);
135 xf86PciBusAccWindowsFromOS(void)
140 RANGE(range
, 0x00000000, 0xffffffff, ResExcMemBlock
);
141 ret
= xf86AddResToList(ret
, &range
, -1);
143 RANGE(range
, 0x00000000, 0x0000ffff, ResExcIoBlock
);
144 ret
= xf86AddResToList(ret
, &range
, -1);
148 #ifdef INCLUDE_UNUSED
151 xf86IsaBusAccWindowsFromOS(void)
156 RANGE(range
, 0x00000000, 0xffffffff, ResExcMemBlock
);
157 ret
= xf86AddResToList(ret
, &range
, -1);
159 RANGE(range
, 0x00000000, 0x0000ffff, ResExcIoBlock
);
160 ret
= xf86AddResToList(ret
, &range
, -1);
164 #endif /* INCLUDE_UNUSED */
167 xf86AccResFromOS(resPtr ret
)
172 * At minimum, the top and bottom resources must be claimed, so that
173 * resources that are (or appear to be) unallocated can be relocated.
175 RANGE(range
, 0x00000000, 0x00000000, ResExcMemBlock
);
176 ret
= xf86AddResToList(ret
, &range
, -1);
177 RANGE(range
, 0xffffffff, 0xffffffff, ResExcMemBlock
);
178 ret
= xf86AddResToList(ret
, &range
, -1);
179 RANGE(range
, 0x00000000, 0x00000000, ResExcIoBlock
);
180 ret
= xf86AddResToList(ret
, &range
, -1);
181 RANGE(range
, 0x0000ffff, 0x0000ffff, ResExcIoBlock
);
182 ret
= xf86AddResToList(ret
, &range
, -1);
189 #error : Put your platform dependent code here!!
193 #endif /* INCLUDE_XF86_NO_DOMAIN */