1
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnxResource.c,v 3.18 2002/01/25 21:56:19 tsi Exp $ */
3
/* Resource information code */
5
#ifdef HAVE_XORG_CONFIG_H
6
#include <xorg-config.h>
12
#include "xf86Privstr.h"
14
#include "xf86Resources.h"
15
#define NEED_OS_RAC_PROTOS
16
#include "xf86_OSlib.h"
19
/* Avoid Imakefile changes */
24
#if !defined(__sparc__) || !defined(INCLUDE_XF86_NO_DOMAIN)
30
#ifdef INCLUDE_XF86_NO_DOMAIN
35
xf86BusAccWindowsFromOS(void)
40
RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
41
ret = xf86AddResToList(ret, &range, -1);
43
RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
44
ret = xf86AddResToList(ret, &range, -1);
49
xf86PciBusAccWindowsFromOS(void)
54
* On the Alpha the first 16MB of every 128 Mb segment in
55
* sparse address space are an image of the ISA bus range
57
if (_bus_base_sparse()) {
58
RANGE(range, 0x00000000, 0x07ffffff, ResExcMemBlock);
59
ret = xf86AddResToList(ret, &range, -1);
60
RANGE(range, 0x09000000, 0x0fffffff, ResExcMemBlock);
61
ret = xf86AddResToList(ret, &range, -1);
62
RANGE(range, 0x11000000, 0x17ffffff, ResExcMemBlock);
63
ret = xf86AddResToList(ret, &range, -1);
64
RANGE(range, 0x19000000, 0x1fffffff, ResExcMemBlock);
65
ret = xf86AddResToList(ret, &range, -1);
66
RANGE(range, 0x21000000, 0x27ffffff, ResExcMemBlock);
67
ret = xf86AddResToList(ret, &range, -1);
68
RANGE(range, 0x29000000, 0x2fffffff, ResExcMemBlock);
69
ret = xf86AddResToList(ret, &range, -1);
70
RANGE(range, 0x31000000, 0x37ffffff, ResExcMemBlock);
71
ret = xf86AddResToList(ret, &range, -1);
72
RANGE(range, 0x39000000, 0x3fffffff, ResExcMemBlock);
73
ret = xf86AddResToList(ret, &range, -1);
74
RANGE(range, 0x41000000, 0x47ffffff, ResExcMemBlock);
75
ret = xf86AddResToList(ret, &range, -1);
76
RANGE(range, 0x49000000, 0x4fffffff, ResExcMemBlock);
77
ret = xf86AddResToList(ret, &range, -1);
78
RANGE(range, 0x51000000, 0x57ffffff, ResExcMemBlock);
79
ret = xf86AddResToList(ret, &range, -1);
80
RANGE(range, 0x59000000, 0x5fffffff, ResExcMemBlock);
81
ret = xf86AddResToList(ret, &range, -1);
82
RANGE(range, 0x61000000, 0x67ffffff, ResExcMemBlock);
83
ret = xf86AddResToList(ret, &range, -1);
84
RANGE(range, 0x69000000, 0x6fffffff, ResExcMemBlock);
85
ret = xf86AddResToList(ret, &range, -1);
86
RANGE(range, 0x71000000, 0x77ffffff, ResExcMemBlock);
87
ret = xf86AddResToList(ret, &range, -1);
88
RANGE(range, 0x79000000, 0x7fffffff, ResExcMemBlock);
89
ret = xf86AddResToList(ret, &range, -1);
90
RANGE(range, 0x81000000, 0x87ffffff, ResExcMemBlock);
91
ret = xf86AddResToList(ret, &range, -1);
92
RANGE(range, 0x89000000, 0x8fffffff, ResExcMemBlock);
93
ret = xf86AddResToList(ret, &range, -1);
94
RANGE(range, 0x91000000, 0x97ffffff, ResExcMemBlock);
95
ret = xf86AddResToList(ret, &range, -1);
96
RANGE(range, 0x99000000, 0x9fffffff, ResExcMemBlock);
97
ret = xf86AddResToList(ret, &range, -1);
98
RANGE(range, 0xa1000000, 0xa7ffffff, ResExcMemBlock);
99
ret = xf86AddResToList(ret, &range, -1);
100
RANGE(range, 0xa9000000, 0xafffffff, ResExcMemBlock);
101
ret = xf86AddResToList(ret, &range, -1);
102
RANGE(range, 0xb1000000, 0xb7ffffff, ResExcMemBlock);
103
ret = xf86AddResToList(ret, &range, -1);
104
RANGE(range, 0xb9000000, 0xbfffffff, ResExcMemBlock);
105
ret = xf86AddResToList(ret, &range, -1);
106
RANGE(range, 0xc1000000, 0xc7ffffff, ResExcMemBlock);
107
ret = xf86AddResToList(ret, &range, -1);
108
RANGE(range, 0xc9000000, 0xcfffffff, ResExcMemBlock);
109
ret = xf86AddResToList(ret, &range, -1);
110
RANGE(range, 0xd1000000, 0xd7ffffff, ResExcMemBlock);
111
ret = xf86AddResToList(ret, &range, -1);
112
RANGE(range, 0xd9000000, 0xdfffffff, ResExcMemBlock);
113
ret = xf86AddResToList(ret, &range, -1);
114
RANGE(range, 0xe1000000, 0xe7ffffff, ResExcMemBlock);
115
ret = xf86AddResToList(ret, &range, -1);
116
RANGE(range, 0xe9000000, 0xefffffff, ResExcMemBlock);
117
ret = xf86AddResToList(ret, &range, -1);
118
RANGE(range, 0xf1000000, 0xf7ffffff, ResExcMemBlock);
119
ret = xf86AddResToList(ret, &range, -1);
120
RANGE(range, 0xf9000000, 0xffffffff, ResExcMemBlock);
121
ret = xf86AddResToList(ret, &range, -1);
123
RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
124
ret = xf86AddResToList(ret, &range, -1);
126
RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
127
ret = xf86AddResToList(ret, &range, -1);
131
#ifdef INCLUDE_UNUSED
134
xf86IsaBusAccWindowsFromOS(void)
139
RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
140
ret = xf86AddResToList(ret, &range, -1);
142
RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
143
ret = xf86AddResToList(ret, &range, -1);
147
#endif /* INCLUDE_UNUSED */
150
xf86AccResFromOS(resPtr ret)
155
* Fallback is to claim the following areas:
157
* 0x000c0000 - 0x000effff location of VGA and other extensions ROMS
160
RANGE(range, 0x000c0000, 0x000effff, ResExcMemBlock);
161
ret = xf86AddResToList(ret, &range, -1);
164
* Fallback would be to claim well known ports in the 0x0 - 0x3ff range
165
* along with their sparse I/O aliases, but that's too imprecise. Instead
166
* claim a bare minimum here.
168
RANGE(range, 0x00000000, 0x000000ff, ResExcIoBlock); /* For mainboard */
169
ret = xf86AddResToList(ret, &range, -1);
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, 0xffffffff, 0xffffffff, ResExcIoBlock);
182
ret = xf86AddResToList(ret, &range, -1);
188
#elif defined(__powerpc__) || \
189
defined(__sparc__) || \
190
defined(__mips__) || \
192
defined(__mc68000__) || \
193
defined(__arm__) || \
194
defined(__s390__) || \
198
* XXX this isn't exactly correct but it will get the server working
199
* for now until we get something better.
203
xf86BusAccWindowsFromOS(void)
208
RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
209
ret = xf86AddResToList(ret, &range, -1);
211
#if defined(__sparc__) || defined(__powerpc__)
212
RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock);
214
RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
216
ret = xf86AddResToList(ret, &range, -1);
221
xf86PciBusAccWindowsFromOS(void)
226
RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
227
ret = xf86AddResToList(ret, &range, -1);
229
#if defined(__sparc__) || defined(__powerpc__)
230
RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock);
232
RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
234
ret = xf86AddResToList(ret, &range, -1);
238
#ifdef INCLUDE_UNUSED
241
xf86IsaBusAccWindowsFromOS(void)
246
RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
247
ret = xf86AddResToList(ret, &range, -1);
249
#if defined(__sparc__) || defined(__powerpc__)
250
RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock);
252
RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
254
ret = xf86AddResToList(ret, &range, -1);
258
#endif /* INCLUDE_UNUSED */
261
xf86AccResFromOS(resPtr ret)
266
* At minimum, the top and bottom resources must be claimed, so that
267
* resources that are (or appear to be) unallocated can be relocated.
269
RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
270
ret = xf86AddResToList(ret, &range, -1);
271
RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
272
ret = xf86AddResToList(ret, &range, -1);
273
RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
274
ret = xf86AddResToList(ret, &range, -1);
275
#if defined(__sparc__) || defined(__powerpc__)
276
RANGE(range, 0x00ffffff, 0x00ffffff, ResExcIoBlock);
278
RANGE(range, 0x0000ffff, 0x0000ffff, ResExcIoBlock);
280
ret = xf86AddResToList(ret, &range, -1);
287
#error : Put your platform dependent code here!!
291
#endif /* INCLUDE_XF86_NO_DOMAIN */