arch/sh/mm/hugetlbpage.c

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

File Facts

System
Linux kernel
Corpus path
arch/sh/mm/hugetlbpage.c
Extension
.c
Size
1317 bytes
Lines
73
Domain
Architecture Layer
Bucket
arch/sh
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) {
			pud = pud_alloc(mm, p4d, addr);
			if (pud) {
				pmd = pmd_alloc(mm, pud, addr);
				if (pmd)
					pte = pte_alloc_huge(mm, pmd, addr);
			}
		}
	}

	return pte;
}

pte_t *huge_pte_offset(struct mm_struct *mm,
		       unsigned long addr, unsigned long sz)
{
	pgd_t *pgd;
	p4d_t *p4d;
	pud_t *pud;
	pmd_t *pmd;
	pte_t *pte = NULL;

	pgd = pgd_offset(mm, addr);
	if (pgd) {
		p4d = p4d_offset(pgd, addr);
		if (p4d) {
			pud = pud_offset(p4d, addr);
			if (pud) {
				pmd = pmd_offset(pud, addr);
				if (pmd)
					pte = pte_offset_huge(pmd, addr);
			}
		}
	}

	return pte;
}

Annotation

Implementation Notes