- 追加された行はこの色です。
- 削除された行はこの色です。
*参照元 [#uca7c170]
#backlinks
*説明 [#ce751371]
-パス: [[linux-4.4.1/]]
-FIXME: これは何?
--説明
**引数 [#f72e9cd7]
-struct mm_struct *mm
--
--[[linux-4.4.1/mm_struct]]
-pmd_t *pmd
--
--[[linux-4.4.1/pmd_t]]
-unsigned long addr
--
-unsigned long end
--
-unsigned long pfn
--
-pgprot_t prot
--
--[[linux-4.4.1/pgprot_t]]
**返り値 [#e1e70a5c]
-int
--
**参考 [#e50ce17b]
*実装 [#u4e098e5]
/*
* maps a range of physical memory into the requested pages. the old
* mappings are removed. any references to nonexistent pages results
* in null mappings (currently treated as "copy-on-access")
*/
static int remap_pte_range(struct mm_struct *mm, pmd_t *pmd,
unsigned long addr, unsigned long end,
unsigned long pfn, pgprot_t prot)
{
pte_t *pte;
spinlock_t *ptl;
-
--[[linux-4.4.1/spinlock_t]]
pte = pte_alloc_map_lock(mm, pmd, addr, &ptl);
if (!pte)
return -ENOMEM;
-
--[[linux-4.4.1/pte_alloc_map_lock()]]
arch_enter_lazy_mmu_mode();
-
--[[linux-4.4.1/arch_enter_lazy_mmu_mode()]]
do {
BUG_ON(!pte_none(*pte));
set_pte_at(mm, addr, pte, pte_mkspecial(pfn_pte(pfn, prot)));
pfn++;
-
--[[linux-4.4.1/BUG_ON()]]
--[[linux-4.4.1/pte_none()]]
--[[linux-4.4.1/set_pte_at()]]
--[[linux-4.4.1/pte_mkspecial()]]
--[[linux-4.4.1/pfn_pte()]]
} while (pte++, addr += PAGE_SIZE, addr != end);
arch_leave_lazy_mmu_mode();
-
--[[linux-4.4.1/arch_leave_lazy_mmu_mode()]]
pte_unmap_unlock(pte - 1, ptl);
-
--[[linux-4.4.1/pte_unmap_unlock()]]
return 0;
}
*コメント [#te0d845c]