aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci/i386.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/pci/i386.c')
-rw-r--r--arch/x86/pci/i386.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index 6fa84d531f4f..7b4307163eac 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -406,50 +406,3 @@ void __init pcibios_resource_survey(void)
406 */ 406 */
407 ioapic_insert_resources(); 407 ioapic_insert_resources();
408} 408}
409
410static const struct vm_operations_struct pci_mmap_ops = {
411 .access = generic_access_phys,
412};
413
414int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
415 enum pci_mmap_state mmap_state, int write_combine)
416{
417 unsigned long prot;
418
419 /* I/O space cannot be accessed via normal processor loads and
420 * stores on this platform.
421 */
422 if (mmap_state == pci_mmap_io)
423 return -EINVAL;
424
425 prot = pgprot_val(vma->vm_page_prot);
426
427 /*
428 * Return error if pat is not enabled and write_combine is requested.
429 * Caller can followup with UC MINUS request and add a WC mtrr if there
430 * is a free mtrr slot.
431 */
432 if (!pat_enabled() && write_combine)
433 return -EINVAL;
434
435 if (pat_enabled() && write_combine)
436 prot |= cachemode2protval(_PAGE_CACHE_MODE_WC);
437 else if (pat_enabled() || boot_cpu_data.x86 > 3)
438 /*
439 * ioremap() and ioremap_nocache() defaults to UC MINUS for now.
440 * To avoid attribute conflicts, request UC MINUS here
441 * as well.
442 */
443 prot |= cachemode2protval(_PAGE_CACHE_MODE_UC_MINUS);
444
445 vma->vm_page_prot = __pgprot(prot);
446
447 if (io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
448 vma->vm_end - vma->vm_start,
449 vma->vm_page_prot))
450 return -EAGAIN;
451
452 vma->vm_ops = &pci_mmap_ops;
453
454 return 0;
455}