arch/loongarch/mm/hugetlbpage.c

Source file repositories/reference/linux-study-clean/arch/loongarch/mm/hugetlbpage.c

File Facts

System
Linux kernel
Corpus path
arch/loongarch/mm/hugetlbpage.c
Extension
.c
Size
1420 bytes
Lines
67
Domain
Architecture Layer
Bucket
arch/loongarch
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

if (p4d_present(p4dp_get(p4d))) {
			pud = pud_offset(p4d, addr);
			if (pud_present(pudp_get(pud)))
				pmd = pmd_offset(pud, addr);
		}
	}

	return (!pmd || pmd_none(pmdp_get(pmd))) ? NULL : (pte_t *) pmd;
}

uint64_t pmd_to_entrylo(unsigned long pmd_val)
{
	uint64_t val;
	/* PMD as PTE. Must be huge page */
	if (!pmd_leaf(__pmd(pmd_val)))
		panic("%s", __func__);

	val = pmd_val ^ _PAGE_HUGE;
	val |= ((val & _PAGE_HGLOBAL) >>
		(_PAGE_HGLOBAL_SHIFT - _PAGE_GLOBAL_SHIFT));

	return val;
}

Annotation

Implementation Notes