linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / arch / ia64 / pci / pci.c
index 60b45e7..9ba32b2 100644 (file)
@@ -10,6 +10,7 @@
  *
  * Note: Above list of copyright holders is incomplete...
  */
+#include <linux/config.h>
 
 #include <linux/acpi.h>
 #include <linux/types.h>
@@ -30,6 +31,7 @@
 #include <asm/irq.h>
 #include <asm/hw_irq.h>
 
+
 /*
  * Low-level SAL-based PCI configuration access functions. Note that SAL
  * calls are already serialized (via sal_lock), so we don't need another
@@ -351,7 +353,7 @@ pci_acpi_scan_root(struct acpi_device *device, int domain, int bus)
        pxm = acpi_get_pxm(controller->acpi_handle);
 #ifdef CONFIG_NUMA
        if (pxm >= 0)
-               controller->node = pxm_to_node(pxm);
+               controller->node = pxm_to_nid_map[pxm];
 #endif
 
        acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window,
@@ -567,7 +569,7 @@ pcibios_disable_device (struct pci_dev *dev)
 
 void
 pcibios_align_resource (void *data, struct resource *res,
-                       resource_size_t size, resource_size_t align)
+                       unsigned long size, unsigned long align)
 {
 }
 
@@ -601,6 +603,8 @@ pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma,
         * Leave vm_pgoff as-is, the PCI space address is the physical
         * address on this platform.
         */
+       vma->vm_flags |= (VM_SHM | VM_RESERVED | VM_IO);
+
        if (write_combine && efi_range_is_wc(vma->vm_start,
                                             vma->vm_end - vma->vm_start))
                vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
@@ -642,30 +646,18 @@ char *ia64_pci_get_legacy_mem(struct pci_bus *bus)
 int
 pci_mmap_legacy_page_range(struct pci_bus *bus, struct vm_area_struct *vma)
 {
-       unsigned long size = vma->vm_end - vma->vm_start;
-       pgprot_t prot;
        char *addr;
 
-       /*
-        * Avoid attribute aliasing.  See Documentation/ia64/aliasing.txt
-        * for more details.
-        */
-       if (!valid_mmap_phys_addr_range(vma->vm_pgoff, size))
-               return -EINVAL;
-       prot = phys_mem_access_prot(NULL, vma->vm_pgoff, size,
-                                   vma->vm_page_prot);
-       if (pgprot_val(prot) != pgprot_val(pgprot_noncached(vma->vm_page_prot)))
-               return -EINVAL;
-
        addr = pci_get_legacy_mem(bus);
        if (IS_ERR(addr))
                return PTR_ERR(addr);
 
        vma->vm_pgoff += (unsigned long)addr >> PAGE_SHIFT;
-       vma->vm_page_prot = prot;
+       vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+       vma->vm_flags |= (VM_SHM | VM_RESERVED | VM_IO);
 
        if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
-                           size, vma->vm_page_prot))
+                           vma->vm_end - vma->vm_start, vma->vm_page_prot))
                return -EAGAIN;
 
        return 0;
@@ -715,7 +707,7 @@ int ia64_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size)
  *
  * Simply writes @size bytes of @val to @port.
  */
-int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size)
+int ia64_pci_legacy_write(struct pci_dev *bus, u16 port, u32 val, u8 size)
 {
        int ret = size;