aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci/pcbios.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/pci/pcbios.c')
-rw-r--r--arch/x86/pci/pcbios.c72
1 files changed, 0 insertions, 72 deletions
diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c
index 2f7109ac4c15..37472fc6f729 100644
--- a/arch/x86/pci/pcbios.c
+++ b/arch/x86/pci/pcbios.c
@@ -152,28 +152,6 @@ static int __devinit check_pcibios(void)
152 return 0; 152 return 0;
153} 153}
154 154
155static int __devinit pci_bios_find_device (unsigned short vendor, unsigned short device_id,
156 unsigned short index, unsigned char *bus, unsigned char *device_fn)
157{
158 unsigned short bx;
159 unsigned short ret;
160
161 __asm__("lcall *(%%edi); cld\n\t"
162 "jc 1f\n\t"
163 "xor %%ah, %%ah\n"
164 "1:"
165 : "=b" (bx),
166 "=a" (ret)
167 : "1" (PCIBIOS_FIND_PCI_DEVICE),
168 "c" (device_id),
169 "d" (vendor),
170 "S" ((int) index),
171 "D" (&pci_indirect));
172 *bus = (bx >> 8) & 0xff;
173 *device_fn = bx & 0xff;
174 return (int) (ret & 0xff00) >> 8;
175}
176
177static int pci_bios_read(unsigned int seg, unsigned int bus, 155static int pci_bios_read(unsigned int seg, unsigned int bus,
178 unsigned int devfn, int reg, int len, u32 *value) 156 unsigned int devfn, int reg, int len, u32 *value)
179{ 157{
@@ -364,55 +342,6 @@ static struct pci_raw_ops * __devinit pci_find_bios(void)
364} 342}
365 343
366/* 344/*
367 * Sort the device list according to PCI BIOS. Nasty hack, but since some
368 * fool forgot to define the `correct' device order in the PCI BIOS specs
369 * and we want to be (possibly bug-to-bug ;-]) compatible with older kernels
370 * which used BIOS ordering, we are bound to do this...
371 */
372
373void __devinit pcibios_sort(void)
374{
375 LIST_HEAD(sorted_devices);
376 struct list_head *ln;
377 struct pci_dev *dev, *d;
378 int idx, found;
379 unsigned char bus, devfn;
380
381 DBG("PCI: Sorting device list...\n");
382 while (!list_empty(&pci_devices)) {
383 ln = pci_devices.next;
384 dev = pci_dev_g(ln);
385 idx = found = 0;
386 while (pci_bios_find_device(dev->vendor, dev->device, idx, &bus, &devfn) == PCIBIOS_SUCCESSFUL) {
387 idx++;
388 list_for_each(ln, &pci_devices) {
389 d = pci_dev_g(ln);
390 if (d->bus->number == bus && d->devfn == devfn) {
391 list_move_tail(&d->global_list, &sorted_devices);
392 if (d == dev)
393 found = 1;
394 break;
395 }
396 }
397 if (ln == &pci_devices) {
398 printk(KERN_WARNING "PCI: BIOS reporting unknown device %02x:%02x\n", bus, devfn);
399 /*
400 * We must not continue scanning as several buggy BIOSes
401 * return garbage after the last device. Grr.
402 */
403 break;
404 }
405 }
406 if (!found) {
407 printk(KERN_WARNING "PCI: Device %s not found by BIOS\n",
408 pci_name(dev));
409 list_move_tail(&dev->global_list, &sorted_devices);
410 }
411 }
412 list_splice(&sorted_devices, &pci_devices);
413}
414
415/*
416 * BIOS Functions for IRQ Routing 345 * BIOS Functions for IRQ Routing
417 */ 346 */
418 347
@@ -495,7 +424,6 @@ void __init pci_pcbios_init(void)
495{ 424{
496 if ((pci_probe & PCI_PROBE_BIOS) 425 if ((pci_probe & PCI_PROBE_BIOS)
497 && ((raw_pci_ops = pci_find_bios()))) { 426 && ((raw_pci_ops = pci_find_bios()))) {
498 pci_probe |= PCI_BIOS_SORT;
499 pci_bios_present = 1; 427 pci_bios_present = 1;
500 } 428 }
501} 429}