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
A Total Overhaul on the Lunaix's Virtual Memory Model (#26)
[lunaix-os.git]
/
lunaix-os
/
scripts
/
gdb
/
lunadbg
/
arch
/
x86
/
pte.py
diff --git
a/lunaix-os/scripts/gdb/lunadbg/arch/x86/pte.py
b/lunaix-os/scripts/gdb/lunadbg/arch/x86/pte.py
index 57853768bf10058e7ed9860577dc34354a0e64e6..444cb3f252b8be292793961116f08b91d70b59a8 100644
(file)
--- a/
lunaix-os/scripts/gdb/lunadbg/arch/x86/pte.py
+++ b/
lunaix-os/scripts/gdb/lunadbg/arch/x86/pte.py
@@
-38,23
+38,31
@@
class PageTableHelperBase:
@staticmethod
def vaddr_width():
raise NotImplementedError()
@staticmethod
def vaddr_width():
raise NotImplementedError()
+
+ @staticmethod
+ def pte_size():
+ raise NotImplementedError()
class PageTableHelper32(PageTableHelperBase):
@staticmethod
def translation_level(level = -1):
return [0, 1][level]
class PageTableHelper32(PageTableHelperBase):
@staticmethod
def translation_level(level = -1):
return [0, 1][level]
+ @staticmethod
+ def pgtable_len():
+ return (1 << 10)
+
@staticmethod
def translation_shift_bits(level):
@staticmethod
def translation_shift_bits(level):
- return [
9
, 0][level] + 12
+ return [
10
, 0][level] + 12
@staticmethod
def mapping_present(pte):
return bool(pte & 1)
@staticmethod
@staticmethod
def mapping_present(pte):
return bool(pte & 1)
@staticmethod
- def huge_page(pte):
- return bool(pte & (1 << 7))
+ def huge_page(pte
, po
):
+ return bool(pte & (1 << 7))
and po
@staticmethod
def protections(pte):
@staticmethod
def protections(pte):
@@
-96,6
+104,10
@@
class PageTableHelper32(PageTableHelperBase):
@staticmethod
def vaddr_width():
return 32
@staticmethod
def vaddr_width():
return 32
+
+ @staticmethod
+ def pte_size():
+ return 4
class PageTableHelper64(PageTableHelperBase):
pass
\ No newline at end of file
class PageTableHelper64(PageTableHelperBase):
pass
\ No newline at end of file