- 论坛徽章:
- 0
|
回复 14# arm-linux-gcc
linux 3.5
create_mapping-> .... -> alloc_init_pte()
static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr,
unsigned long end, unsigned long pfn,
const struct mem_type *type)
{
pte_t *start_pte = early_pte_alloc(pmd);
pte_t *pte = start_pte + pte_index(addr);
/* If replacing a section mapping, the whole section must be replaced */
BUG_ON(pmd_bad(*pmd) && ((addr | end) & ~PMD_MASK));
do {
set_pte_ext(pte, pfn_pte(pfn, __pgprot(type->prot_pte)), 0);
pfn++;
} while (pte++, addr += PAGE_SIZE, addr != end);
early_pte_install(pmd, start_pte, type->prot_l1);
}
看代码,set_pte_ext所设置的项是linux pt,early_pte_install设置的地址是h/w 项地址.
linux pt 0 <- start_pte
linux pt 1
pmd -> h/w 0
pmd+4 -> h/w 1
是不是create_mapping上进行二级映射上,所设置的是模拟表项,如果真的虚拟地址映射到的时候该表项还是为空,还是会引起页缺陷,
但是可以根据liunux pt 推出 h/w pt ?具体推出的代码在哪里呢?
|
|