^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * highmem.h: virtual kernel memory mappings for high memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Used in CONFIG_HIGHMEM systems for memory pages which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * are not addressable by direct kernel virtual addresses.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Copyright (C) 1999 Gerhard Wichert, Siemens AG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * Gerhard.Wichert@pdb.siemens.de
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * Redesigned the x86 32-bit VM architecture to deal with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * up to 16 Terabyte physical memory. With current x86 CPUs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * we now support up to 64 Gigabytes physical RAM.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #ifndef _ASM_X86_HIGHMEM_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define _ASM_X86_HIGHMEM_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #ifdef __KERNEL__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #include <linux/threads.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #include <asm/kmap_types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #include <asm/tlbflush.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #include <asm/paravirt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #include <asm/fixmap.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) /* declarations for highmem.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) extern unsigned long highstart_pfn, highend_pfn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * Right now we initialize only a single pte table. It can be extended
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * easily, subsequent pte tables have to be allocated in one physical
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * chunk of RAM.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) * Ordering is:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) * high memory on: high_memory off:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) * FIXADDR_TOP FIXADDR_TOP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) * fixed addresses fixed addresses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * FIXADDR_START FIXADDR_START
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) * temp fixed addresses/persistent kmap area VMALLOC_END
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) * PKMAP_BASE temp fixed addresses/vmalloc area
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) * VMALLOC_END VMALLOC_START
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) * vmalloc area high_memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) * VMALLOC_START
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) * high_memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) * The temp fixed area is only used during boot for early_ioremap(), and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) * it is unused when the ioremap() is functional. vmalloc/pkmap area become
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) * available after early boot so the temp fixed area is available for re-use.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define LAST_PKMAP_MASK (LAST_PKMAP-1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) #define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) void *kmap_atomic_pfn(unsigned long pfn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #define flush_cache_kmaps() do { } while (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) extern void add_highpages_with_active_regions(int nid, unsigned long start_pfn,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) unsigned long end_pfn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) #endif /* __KERNEL__ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) #endif /* _ASM_X86_HIGHMEM_H */