hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/arch/arm/include/asm/io.h
....@@ -1,11 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * arch/arm/include/asm/io.h
34 *
45 * Copyright (C) 1996-2000 Russell King
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
96 *
107 * Modifications:
118 * 16-Sep-1996 RMK Inlined the inx/outx functions & optimised for both
....@@ -28,13 +25,11 @@
2825 #include <asm/byteorder.h>
2926 #include <asm/memory.h>
3027 #include <asm-generic/pci_iomap.h>
31
-#include <xen/xen.h>
3228
3329 /*
3430 * ISA I/O bus memory addresses are 1:1 with the physical address.
3531 */
3632 #define isa_virt_to_bus virt_to_phys
37
-#define isa_page_to_bus page_to_phys
3833 #define isa_bus_to_virt phys_to_virt
3934
4035 /*
....@@ -282,8 +277,6 @@
282277 extern void _memcpy_toio(volatile void __iomem *, const void *, size_t);
283278 extern void _memset_io(volatile void __iomem *, int, size_t);
284279
285
-#define mmiowb()
286
-
287280 /*
288281 * Memory access primitives
289282 * ------------------------
....@@ -363,7 +356,6 @@
363356 *
364357 * Function Memory type Cacheability Cache hint
365358 * ioremap() Device n/a n/a
366
- * ioremap_nocache() Device n/a n/a
367359 * ioremap_cache() Normal Writeback Read allocate
368360 * ioremap_wc() Normal Non-cacheable n/a
369361 * ioremap_wt() Normal Non-cacheable n/a
....@@ -374,13 +366,6 @@
374366 * - number, order and size of accesses are maintained
375367 * - unaligned accesses are "unpredictable"
376368 * - writes may be delayed before they hit the endpoint device
377
- *
378
- * ioremap_nocache() is the same as ioremap() as there are too many device
379
- * drivers using this for device registers, and documentation which tells
380
- * people to use it for such for this to be any different. This is not a
381
- * safe fallback for memory-like mappings, or memory regions where the
382
- * compiler may generate unaligned accesses - eg, via inlining its own
383
- * memcpy.
384369 *
385370 * All normal memory mappings have the following properties:
386371 * - reads can be repeated with no side effects
....@@ -399,19 +384,12 @@
399384 */
400385 void __iomem *ioremap(resource_size_t res_cookie, size_t size);
401386 #define ioremap ioremap
402
-#define ioremap_nocache ioremap
403387
404388 /*
405389 * Do not use ioremap_cache for mapping memory. Use memremap instead.
406390 */
407391 void __iomem *ioremap_cache(resource_size_t res_cookie, size_t size);
408392 #define ioremap_cache ioremap_cache
409
-
410
-/*
411
- * Do not use ioremap_cached in new code. Provided for the benefit of
412
- * the pxa2xx-flash MTD driver only.
413
- */
414
-void __iomem *ioremap_cached(resource_size_t res_cookie, size_t size);
415393
416394 void __iomem *ioremap_wc(resource_size_t res_cookie, size_t size);
417395 #define ioremap_wc ioremap_wc
....@@ -459,25 +437,14 @@
459437
460438 #include <asm-generic/io.h>
461439
462
-/*
463
- * can the hardware map this into one segment or not, given no other
464
- * constraints.
465
- */
466
-#define BIOVEC_MERGEABLE(vec1, vec2) \
467
- ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
468
-
469
-struct bio_vec;
470
-extern bool xen_biovec_phys_mergeable(const struct bio_vec *vec1,
471
- const struct bio_vec *vec2);
472
-#define BIOVEC_PHYS_MERGEABLE(vec1, vec2) \
473
- (__BIOVEC_PHYS_MERGEABLE(vec1, vec2) && \
474
- (!xen_domain() || xen_biovec_phys_mergeable(vec1, vec2)))
475
-
476440 #ifdef CONFIG_MMU
477441 #define ARCH_HAS_VALID_PHYS_ADDR_RANGE
478442 extern int valid_phys_addr_range(phys_addr_t addr, size_t size);
479443 extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
480444 extern int devmem_is_allowed(unsigned long pfn);
445
+extern bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size,
446
+ unsigned long flags);
447
+#define arch_memremap_can_ram_remap arch_memremap_can_ram_remap
481448 #endif
482449
483450 /*