| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright © 2008 Keith Packard <keithp@keithp.com> |
|---|
| 3 | | - * |
|---|
| 4 | | - * This file is free software; you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of version 2 of the GNU General Public License |
|---|
| 6 | | - * as published by the Free Software Foundation. |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 9 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 10 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 11 | | - * GNU General Public License for more details. |
|---|
| 12 | | - * |
|---|
| 13 | | - * You should have received a copy of the GNU General Public License |
|---|
| 14 | | - * along with this program; if not, write to the Free Software Foundation, |
|---|
| 15 | | - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. |
|---|
| 16 | 4 | */ |
|---|
| 17 | 5 | |
|---|
| 18 | 6 | #ifndef _LINUX_IO_MAPPING_H |
|---|
| .. | .. |
|---|
| 22 | 10 | #include <linux/slab.h> |
|---|
| 23 | 11 | #include <linux/bug.h> |
|---|
| 24 | 12 | #include <linux/io.h> |
|---|
| 13 | +#include <linux/pgtable.h> |
|---|
| 25 | 14 | #include <asm/page.h> |
|---|
| 26 | 15 | |
|---|
| 27 | 16 | /* |
|---|
| 28 | 17 | * The io_mapping mechanism provides an abstraction for mapping |
|---|
| 29 | 18 | * individual pages from an io device to the CPU in an efficient fashion. |
|---|
| 30 | 19 | * |
|---|
| 31 | | - * See Documentation/io-mapping.txt |
|---|
| 20 | + * See Documentation/driver-api/io-mapping.rst |
|---|
| 32 | 21 | */ |
|---|
| 33 | 22 | |
|---|
| 34 | 23 | struct io_mapping { |
|---|
| .. | .. |
|---|
| 40 | 29 | |
|---|
| 41 | 30 | #ifdef CONFIG_HAVE_ATOMIC_IOMAP |
|---|
| 42 | 31 | |
|---|
| 32 | +#include <linux/pfn.h> |
|---|
| 43 | 33 | #include <asm/iomap.h> |
|---|
| 44 | 34 | /* |
|---|
| 45 | 35 | * For small address space machines, mapping large objects |
|---|
| .. | .. |
|---|
| 76 | 66 | unsigned long offset) |
|---|
| 77 | 67 | { |
|---|
| 78 | 68 | resource_size_t phys_addr; |
|---|
| 79 | | - unsigned long pfn; |
|---|
| 80 | 69 | |
|---|
| 81 | 70 | BUG_ON(offset >= mapping->size); |
|---|
| 82 | 71 | phys_addr = mapping->base + offset; |
|---|
| 83 | | - pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); |
|---|
| 84 | | - return iomap_atomic_prot_pfn(pfn, mapping->prot); |
|---|
| 72 | + return iomap_atomic_prot_pfn(PHYS_PFN(phys_addr), mapping->prot); |
|---|
| 85 | 73 | } |
|---|
| 86 | 74 | |
|---|
| 87 | 75 | static inline void |
|---|
| .. | .. |
|---|
| 112 | 100 | #else |
|---|
| 113 | 101 | |
|---|
| 114 | 102 | #include <linux/uaccess.h> |
|---|
| 115 | | -#include <asm/pgtable.h> |
|---|
| 116 | 103 | |
|---|
| 117 | 104 | /* Create the io_mapping object*/ |
|---|
| 118 | 105 | static inline struct io_mapping * |
|---|