linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / arch / xtensa / kernel / pci.c
index 8709f82..de19501 100644 (file)
@@ -17,6 +17,7 @@
  *
  */
 
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
@@ -70,13 +71,13 @@ static int pci_bus_count;
  * which might have be mirrored at 0x0100-0x03ff..
  */
 void
-pcibios_align_resource(void *data, struct resource *res, resource_size_t size,
-                      resource_size_t align)
+pcibios_align_resource(void *data, struct resource *res, unsigned long size,
+                      unsigned long align)
 {
        struct pci_dev *dev = data;
 
        if (res->flags & IORESOURCE_IO) {
-               resource_size_t start = res->start;
+               unsigned long start = res->start;
 
                if (size > 0x100) {
                        printk(KERN_ERR "PCI: I/O Region %s/%d too large"
@@ -348,6 +349,17 @@ __pci_mmap_make_offset(struct pci_dev *dev, struct vm_area_struct *vma,
        return -EINVAL;
 }
 
+/*
+ * Set vm_flags of VMA, as appropriate for this architecture, for a pci device
+ * mapping.
+ */
+static __inline__ void
+__pci_mmap_set_flags(struct pci_dev *dev, struct vm_area_struct *vma,
+                    enum pci_mmap_state mmap_state)
+{
+       vma->vm_flags |= VM_SHM | VM_LOCKED | VM_IO;
+}
+
 /*
  * Set vm_page_prot of VMA, as appropriate for this architecture, for a pci
  * device mapping.
@@ -387,6 +399,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
        if (ret < 0)
                return ret;
 
+       __pci_mmap_set_flags(dev, vma, mmap_state);
        __pci_mmap_set_pgprot(dev, vma, mmap_state, write_combine);
 
        ret = io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,