X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/095a899a9749b85443e546b1062026747445658c..c166bd62fbb907f95f79f621e2a2fb4fdde08e01:/lunaix-os/arch/i386/includes/sys/mm/pagetable.h diff --git a/lunaix-os/arch/i386/includes/sys/mm/pagetable.h b/lunaix-os/arch/i386/includes/sys/mm/pagetable.h index 4fd9439..2b188cd 100644 --- a/lunaix-os/arch/i386/includes/sys/mm/pagetable.h +++ b/lunaix-os/arch/i386/includes/sys/mm/pagetable.h @@ -150,12 +150,24 @@ pte_setpaddr(pte_t pte, ptr_t paddr) return __mkpte_from((pte.val & _PAGE_BASE_MASK) | (paddr & ~_PAGE_BASE_MASK)); } +static inline pte_t +pte_setppfn(pte_t pte, pfn_t ppfn) +{ + return __mkpte_from((pte.val & _PAGE_BASE_MASK) | (ppfn * PAGE_SIZE)); +} + static inline ptr_t pte_paddr(pte_t pte) { return pte.val & ~_PAGE_BASE_MASK; } +static inline pfn_t +pte_ppfn(pte_t pte) +{ + return pte.val >> _PAGE_BASE_SHIFT; +} + static inline pte_t pte_setprot(pte_t pte, ptr_t prot) {