arch/arm/include/asm/tlb.h

Source file repositories/reference/linux-study-clean/arch/arm/include/asm/tlb.h

File Facts

System
Linux kernel
Corpus path
arch/arm/include/asm/tlb.h
Extension
.h
Size
1307 bytes
Lines
61
Domain
Architecture Layer
Bucket
arch/arm
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef __ASMARM_TLB_H
#define __ASMARM_TLB_H

#include <asm/cacheflush.h>

#ifndef CONFIG_MMU

#include <linux/pagemap.h>

#define tlb_flush(tlb)	((void) tlb)

#include <asm-generic/tlb.h>

#else /* !CONFIG_MMU */

#include <asm/tlbflush.h>
#include <asm-generic/tlb.h>

static inline void
__pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, unsigned long addr)
{
	struct ptdesc *ptdesc = page_ptdesc(pte);

#ifndef CONFIG_ARM_LPAE
	/*
	 * With the classic ARM MMU, a pte page has two corresponding pmd
	 * entries, each covering 1MB.
	 */
	addr = (addr & PMD_MASK) + SZ_1M;
	__tlb_adjust_range(tlb, addr - PAGE_SIZE, 2 * PAGE_SIZE);
#endif

	tlb_remove_ptdesc(tlb, ptdesc);
}

static inline void
__pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp, unsigned long addr)
{
#ifdef CONFIG_ARM_LPAE
	struct ptdesc *ptdesc = virt_to_ptdesc(pmdp);

	tlb_remove_ptdesc(tlb, ptdesc);
#endif
}

#endif /* CONFIG_MMU */
#endif

Annotation

Implementation Notes