git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Unifying the Lunaix's Physical Memory Model (#28)
[lunaix-os.git]
/
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 4fd9439aacd59f8cc98d101892749b32fc9a9878..2b188cd8d43ae42a3c42cd0bf07cf1b0c1886368 100644
(file)
--- 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));
}
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 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)
{
static inline pte_t
pte_setprot(pte_t pte, ptr_t prot)
{