ioremap.c 457 B

1234567891011121314151617181920
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. #include <linux/export.h>
  3. #include <linux/mm.h>
  4. #include <linux/io.h>
  5. #include <asm/pgtable.h>
  6. pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
  7. unsigned long size, pgprot_t vma_prot)
  8. {
  9. if (!pfn_valid(pfn)) {
  10. return pgprot_noncached(vma_prot);
  11. } else if (file->f_flags & O_SYNC) {
  12. return pgprot_writecombine(vma_prot);
  13. }
  14. return vma_prot;
  15. }
  16. EXPORT_SYMBOL(phys_mem_access_prot);