xref: /kernel/linux/linux-5.10/arch/csky/mm/ioremap.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-5.10/arch/csky/mm/
18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci#include <linux/export.h>
58c2ecf20Sopenharmony_ci#include <linux/mm.h>
68c2ecf20Sopenharmony_ci#include <linux/io.h>
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_cipgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
98c2ecf20Sopenharmony_ci			      unsigned long size, pgprot_t vma_prot)
108c2ecf20Sopenharmony_ci{
118c2ecf20Sopenharmony_ci	if (!pfn_valid(pfn)) {
128c2ecf20Sopenharmony_ci		return pgprot_noncached(vma_prot);
138c2ecf20Sopenharmony_ci	} else if (file->f_flags & O_SYNC) {
148c2ecf20Sopenharmony_ci		return pgprot_writecombine(vma_prot);
158c2ecf20Sopenharmony_ci	}
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci	return vma_prot;
188c2ecf20Sopenharmony_ci}
198c2ecf20Sopenharmony_ciEXPORT_SYMBOL(phys_mem_access_prot);
20

Indexes created Thu Nov 07 10:32:03 CST 2024