diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-10-03 05:49:32 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-10-20 14:01:46 -0400 |
commit | f19aeb1f3638b7bb4ca21eb361f004fac2bfe259 (patch) | |
tree | 2990881affb22ba426149e8d4c317fe9df9992c7 /arch/ia64/pci/pci.c | |
parent | f393d9b130423a7a47c751b26df07ceaa5dc76a9 (diff) |
PCI: Add ability to mmap legacy_io on some platforms
This adds the ability to mmap legacy IO space to the legacy_io files
in sysfs on platforms that support it. This will allow to clean up
X to use this instead of /dev/mem for legacy IO accesses such as
those performed by Int10.
While at it I moved pci_create/remove_legacy_files() to pci-sysfs.c
where I think they belong, thus making more things statis in there
and cleaned up some spurrious prototypes in the ia64 pci.h file
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch/ia64/pci/pci.c')
-rw-r--r-- | arch/ia64/pci/pci.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 7545037a8625..211fcfd115f9 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -614,12 +614,17 @@ char *ia64_pci_get_legacy_mem(struct pci_bus *bus) | |||
614 | * vector to get the base address. | 614 | * vector to get the base address. |
615 | */ | 615 | */ |
616 | int | 616 | int |
617 | pci_mmap_legacy_page_range(struct pci_bus *bus, struct vm_area_struct *vma) | 617 | pci_mmap_legacy_page_range(struct pci_bus *bus, struct vm_area_struct *vma, |
618 | enum pci_mmap_state mmap_state) | ||
618 | { | 619 | { |
619 | unsigned long size = vma->vm_end - vma->vm_start; | 620 | unsigned long size = vma->vm_end - vma->vm_start; |
620 | pgprot_t prot; | 621 | pgprot_t prot; |
621 | char *addr; | 622 | char *addr; |
622 | 623 | ||
624 | /* We only support mmap'ing of legacy memory space */ | ||
625 | if (mmap_state != pci_mmap_mem) | ||
626 | return -ENOSYS; | ||
627 | |||
623 | /* | 628 | /* |
624 | * Avoid attribute aliasing. See Documentation/ia64/aliasing.txt | 629 | * Avoid attribute aliasing. See Documentation/ia64/aliasing.txt |
625 | * for more details. | 630 | * for more details. |