Path: blob/master/arch/loongarch/include/asm/highmem.h
170959 views
/* SPDX-License-Identifier: GPL-2.0 */1/*2* highmem.h: virtual kernel memory mappings for high memory3*4* Used in CONFIG_HIGHMEM systems for memory pages which5* are not addressable by direct kernel virtual addresses.6*7* Copyright (C) 2025 Loongson Technology Corporation Limited8*/9#ifndef _ASM_HIGHMEM_H10#define _ASM_HIGHMEM_H1112#ifdef __KERNEL__1314#include <asm/kmap_size.h>1516#ifndef __ASSEMBLER__1718extern pte_t *pkmap_page_table;1920#define ARCH_HAS_KMAP_FLUSH_TLB21void kmap_flush_tlb(unsigned long addr);2223#endif /* !__ASSEMBLER__ */2425/*26* Right now we initialize only a single pte table. It can be extended27* easily, subsequent pte tables have to be allocated in one physical28* chunk of RAM.29*/30#define LAST_PKMAP 102431#define LAST_PKMAP_MASK (LAST_PKMAP - 1)32#define PKMAP_NR(virt) ((virt - PKMAP_BASE) >> PAGE_SHIFT)33#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))3435#define flush_cache_kmaps() do {} while (0)3637#define arch_kmap_local_post_map(vaddr, pteval) local_flush_tlb_one(vaddr)38#define arch_kmap_local_post_unmap(vaddr) local_flush_tlb_one(vaddr)3940#endif /* __KERNEL__ */4142#endif /* _ASM_HIGHMEM_H */434445