From d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Mon, 11 Dec 2023 02:45:28 +0000 Subject: [PATCH] add boot partition size --- kernel/include/linux/io-mapping.h | 49 ++++++++++++++----------------------------------- 1 files changed, 14 insertions(+), 35 deletions(-) diff --git a/kernel/include/linux/io-mapping.h b/kernel/include/linux/io-mapping.h index fa46183..4bb8223 100644 --- a/kernel/include/linux/io-mapping.h +++ b/kernel/include/linux/io-mapping.h @@ -1,18 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright © 2008 Keith Packard <keithp@keithp.com> - * - * This file is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LINUX_IO_MAPPING_H @@ -22,13 +10,14 @@ #include <linux/slab.h> #include <linux/bug.h> #include <linux/io.h> +#include <linux/pgtable.h> #include <asm/page.h> /* * The io_mapping mechanism provides an abstraction for mapping * individual pages from an io device to the CPU in an efficient fashion. * - * See Documentation/io-mapping.txt + * See Documentation/driver-api/io-mapping.rst */ struct io_mapping { @@ -40,6 +29,7 @@ #ifdef CONFIG_HAVE_ATOMIC_IOMAP +#include <linux/pfn.h> #include <asm/iomap.h> /* * For small address space machines, mapping large objects @@ -70,24 +60,20 @@ iomap_free(mapping->base, mapping->size); } -/* Atomic map/unmap */ +/* Temporary mappings which are only valid in the current context */ static inline void __iomem * -io_mapping_map_atomic_wc(struct io_mapping *mapping, - unsigned long offset) +io_mapping_map_local_wc(struct io_mapping *mapping, unsigned long offset) { resource_size_t phys_addr; - unsigned long pfn; BUG_ON(offset >= mapping->size); phys_addr = mapping->base + offset; - pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); - return iomap_atomic_prot_pfn(pfn, mapping->prot); + return __iomap_local_pfn_prot(PHYS_PFN(phys_addr), mapping->prot); } -static inline void -io_mapping_unmap_atomic(void __iomem *vaddr) +static inline void io_mapping_unmap_local(void __iomem *vaddr) { - iounmap_atomic(vaddr); + kunmap_local_indexed((void __force *)vaddr); } static inline void __iomem * @@ -109,10 +95,9 @@ iounmap(vaddr); } -#else +#else /* HAVE_ATOMIC_IOMAP */ #include <linux/uaccess.h> -#include <asm/pgtable.h> /* Create the io_mapping object*/ static inline struct io_mapping * @@ -157,25 +142,19 @@ { } -/* Atomic map/unmap */ +/* Temporary mappings which are only valid in the current context */ static inline void __iomem * -io_mapping_map_atomic_wc(struct io_mapping *mapping, - unsigned long offset) +io_mapping_map_local_wc(struct io_mapping *mapping, unsigned long offset) { - preempt_disable(); - pagefault_disable(); return io_mapping_map_wc(mapping, offset, PAGE_SIZE); } -static inline void -io_mapping_unmap_atomic(void __iomem *vaddr) +static inline void io_mapping_unmap_local(void __iomem *vaddr) { io_mapping_unmap(vaddr); - pagefault_enable(); - preempt_enable(); } -#endif /* HAVE_ATOMIC_IOMAP */ +#endif /* !HAVE_ATOMIC_IOMAP */ static inline struct io_mapping * io_mapping_create_wc(resource_size_t base, -- Gitblit v1.6.2