2 #ifdef HAVE_XORG_CONFIG_H
3 #include <xorg-config.h>
11 #include "shared/xf86Axp.h"
13 axpDevice
lnxGetAXP(void);
22 static AXP axpList
[] = {
23 { "Tsunami", NULL
, NULL
, TSUNAMI
},
24 { "Eiger", NULL
, NULL
, TSUNAMI
},
25 {"Noname", NULL
, NULL
, LCA
},
26 { "AlphaBook1", NULL
, NULL
, LCA
},
27 {"EB66", NULL
, NULL
, LCA
},
28 {"EB64+",NULL
,NULL
, APECS
},
29 {"Noritake",NULL
,"EV5",CIA
},
30 {"Noritake",NULL
,"EV56",CIA
},
31 {"Noritake",NULL
,NULL
,APECS
},
32 {"XL",NULL
,NULL
,APECS
},
33 {"Avanti",NULL
,NULL
,APECS
},
34 {"Mikasa",NULL
,"EV5",CIA
},
35 {"Mikasa",NULL
,"EV56",CIA
},
36 {"Mikasa",NULL
,NULL
,APECS
},
37 {"EB164","EB164",NULL
,CIA
},
38 {"EB164","PC164", NULL
,CIA
},
39 {"EB164","LX164",NULL
, PYXIS
},
40 {"EB164","SX164",NULL
, PYXIS
},
41 {"EB164","RX164",NULL
, POLARIS
},
42 {"Alcor",NULL
,NULL
,CIA
},
43 {"Takara",NULL
,NULL
,CIA
},
44 {"Sable",NULL
, "EV5",T2_GAMMA
},
45 {"Sable",NULL
,"EV56",T2_GAMMA
},
46 {"Sable",NULL
,NULL
,T2
},
47 {"Rawhide",NULL
,NULL
,MCPCIA
},
48 {"Jensen",NULL
,NULL
,JENSEN
},
49 {"Miata",NULL
,NULL
,PYXIS_CIA
},
50 {"Ruffian",NULL
,NULL
,PYXIS_CIA
},
51 {"Nautilus",NULL
,NULL
,IRONGATE
},
65 if (!(file
= fopen("/proc/cpuinfo","r")))
68 if (!fgets(res
,0xff,file
)) return SYS_NONE
;
71 sscanf(res
, "cpu model : %s",cpu
);
73 ErrorF("CPU %s\n",cpu
);
77 sscanf(res
, "system type : %s",systype
);
79 ErrorF("system type : %s\n",systype
);
83 sscanf(res
, "system variation : %s",sysvari
);
85 ErrorF("system variation: %s\n",sysvari
);
97 if (!axpList
[count
].sysName
|| !strcmp(axpList
[count
].sysName
,systype
)) {
98 if (axpList
[count
].sysVari
&& strcmp(axpList
[count
].sysVari
,sysvari
)) {
102 if (axpList
[count
].cpu
&& strcmp(axpList
[count
].cpu
,cpu
)) {
106 return axpList
[count
].sys
;
113 * pciconfig_iobase wrappers and dynamic i/o selection
119 /* glibc versions (single hose only) */
120 extern void _outb(char val
, unsigned long port
);
121 extern void _outw(short val
, unsigned long port
);
122 extern void _outl(int val
, unsigned long port
);
123 extern unsigned int _inb(unsigned long port
);
124 extern unsigned int _inw(unsigned long port
);
125 extern unsigned int _inl(unsigned long port
);
127 extern void _dense_outb(char, unsigned long);
128 extern void _dense_outw(short, unsigned long);
129 extern void _dense_outl(int, unsigned long);
130 extern unsigned int _dense_inb(unsigned long);
131 extern unsigned int _dense_inw(unsigned long);
132 extern unsigned int _dense_inl(unsigned long);
134 _X_EXPORT
void (*_alpha_outb
)(char, unsigned long) = _outb
;
135 _X_EXPORT
void (*_alpha_outw
)(short, unsigned long) = _outw
;
136 _X_EXPORT
void (*_alpha_outl
)(int, unsigned long) = _outl
;
137 _X_EXPORT
unsigned int (*_alpha_inb
)(unsigned long) = _inb
;
138 _X_EXPORT
unsigned int (*_alpha_inw
)(unsigned long) = _inw
;
139 _X_EXPORT
unsigned int (*_alpha_inl
)(unsigned long) = _inl
;
141 static long _alpha_iobase_query(unsigned, int, int, int);
142 long (*_iobase
)(unsigned, int, int, int) = _alpha_iobase_query
;
145 _alpha_iobase(unsigned flags
, int hose
, int bus
, int devfn
)
147 #ifdef __NR_pciconfig_iobase
150 flags
|= IOBASE_FROM_HOSE
;
153 return syscall(__NR_pciconfig_iobase
, flags
, bus
, devfn
);
160 _alpha_iobase_legacy(unsigned flags
, int hose
, int bus
, int devfn
)
162 if (hose
> 0) return -ENODEV
;
163 if (flags
& IOBASE_DENSE_MEM
) return _bus_base();
164 if (flags
& IOBASE_SPARSE_MEM
) return _bus_base_sparse();
169 _alpha_iobase_query(unsigned flags
, int hose
, int bus
, int devfn
)
172 * Only use iobase if the syscall is supported *and* it's
175 if (_alpha_iobase(IOBASE_DENSE_IO
, 0, 0, 0) > 0) {
177 * The syscall worked and it's a dense io system - take over the
180 _iobase
= _alpha_iobase
;
182 #ifndef INCLUDE_XF86_NO_DOMAIN
184 * Only take over the inx/outx functions if this is a dense I/O
185 * system *and* addressing domains are being used. The dense I/O
186 * routines expect I/O to be mapped (as done in xf86MapDomainIO)
188 _alpha_outb
= _dense_outb
;
189 _alpha_outw
= _dense_outw
;
190 _alpha_outl
= _dense_outl
;
191 _alpha_inb
= _dense_inb
;
192 _alpha_inw
= _dense_inw
;
193 _alpha_inl
= _dense_inl
;
194 #endif /* !INCLUDE_XF86_NO_DOMAIN */
195 } else _iobase
= _alpha_iobase_legacy
;
197 return _iobase(flags
, hose
, bus
, devfn
);