ioremap.c (bbc180a5adb05ee8053fab7a0c0bd56c5964240e) ioremap.c (97dc2a1548ab0dc320ce3618b73b3f9dc732b6ee)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Re-map IO memory to kernel address space so that we can access it.
4 * This is needed for high PCI addresses that aren't mapped in the
5 * 640k-1MB IO memory area on PC's
6 *
7 * (C) Copyright 1995 1996 Linus Torvalds
8 */

--- 467 unchanged lines hidden (view full) ---

476
477 /* Finally remove it */
478 o = remove_vm_area((void __force *)addr);
479 BUG_ON(p != o || o == NULL);
480 kfree(p);
481}
482EXPORT_SYMBOL(iounmap);
483
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Re-map IO memory to kernel address space so that we can access it.
4 * This is needed for high PCI addresses that aren't mapped in the
5 * 640k-1MB IO memory area on PC's
6 *
7 * (C) Copyright 1995 1996 Linus Torvalds
8 */

--- 467 unchanged lines hidden (view full) ---

476
477 /* Finally remove it */
478 o = remove_vm_area((void __force *)addr);
479 BUG_ON(p != o || o == NULL);
480 kfree(p);
481}
482EXPORT_SYMBOL(iounmap);
483
484#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
485bool arch_vmap_p4d_supported(pgprot_t prot)
486{
487 return false;
488}
489
490bool arch_vmap_pud_supported(pgprot_t prot)
491{
492#ifdef CONFIG_X86_64
493 return boot_cpu_has(X86_FEATURE_GBPAGES);
494#else
495 return false;
496#endif
497}
498
499bool arch_vmap_pmd_supported(pgprot_t prot)
500{
501 return boot_cpu_has(X86_FEATURE_PSE);
502}
503#endif
504
505/*
506 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
507 * access
508 */
509void *xlate_dev_mem_ptr(phys_addr_t phys)
510{
511 unsigned long start = phys & PAGE_MASK;
512 unsigned long offset = phys & ~PAGE_MASK;

--- 379 unchanged lines hidden ---
484/*
485 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
486 * access
487 */
488void *xlate_dev_mem_ptr(phys_addr_t phys)
489{
490 unsigned long start = phys & PAGE_MASK;
491 unsigned long offset = phys & ~PAGE_MASK;

--- 379 unchanged lines hidden ---