]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/pci-common.c
[POWERPC] spufs: Fix context destroy vs /spu readdir race
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / pci-common.c
index faf5ef3e90d0e66b01d07c9ee679cfb5169d5b50..2ae3b6f778a3c4e5cff5922c10c96a705d44c2de 100644 (file)
@@ -69,10 +69,7 @@ struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
 {
        struct pci_controller *phb;
 
-       if (mem_init_done)
-               phb = kmalloc(sizeof(struct pci_controller), GFP_KERNEL);
-       else
-               phb = alloc_bootmem(sizeof (struct pci_controller));
+       phb = alloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
        if (phb == NULL)
                return NULL;
        pci_setup_pci_controller(phb);
@@ -101,6 +98,29 @@ void pcibios_free_controller(struct pci_controller *phb)
                kfree(phb);
 }
 
+int pcibios_vaddr_is_ioport(void __iomem *address)
+{
+       int ret = 0;
+       struct pci_controller *hose;
+       unsigned long size;
+
+       spin_lock(&hose_spinlock);
+       list_for_each_entry(hose, &hose_list, list_node) {
+#ifdef CONFIG_PPC64
+               size = hose->pci_io_size;
+#else
+               size = hose->io_resource.end - hose->io_resource.start + 1;
+#endif
+               if (address >= hose->io_base_virt &&
+                   address < (hose->io_base_virt + size)) {
+                       ret = 1;
+                       break;
+               }
+       }
+       spin_unlock(&hose_spinlock);
+       return ret;
+}
+
 /*
  * Return the domain number for this bus.
  */
@@ -156,14 +176,17 @@ static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL);
 #endif /* CONFIG_PPC_OF */
 
 /* Add sysfs properties */
-void pcibios_add_platform_entries(struct pci_dev *pdev)
+int pcibios_add_platform_entries(struct pci_dev *pdev)
 {
 #ifdef CONFIG_PPC_OF
-       device_create_file(&pdev->dev, &dev_attr_devspec);
+       return device_create_file(&pdev->dev, &dev_attr_devspec);
+#else
+       return 0;
 #endif /* CONFIG_PPC_OF */
+
 }
 
-char __init *pcibios_setup(char *str)
+char __devinit *pcibios_setup(char *str)
 {
        return str;
 }