X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/095a899a9749b85443e546b1062026747445658c..refs/heads/feat/user_model:/lunaix-os/scripts/gdb/lunadbg/structs/page.py diff --git a/lunaix-os/scripts/gdb/lunadbg/structs/page.py b/lunaix-os/scripts/gdb/lunadbg/structs/page.py index 01c08b2..6dc5bf9 100644 --- a/lunaix-os/scripts/gdb/lunadbg/structs/page.py +++ b/lunaix-os/scripts/gdb/lunadbg/structs/page.py @@ -4,10 +4,25 @@ from . import KernelStruct class PageStruct(KernelStruct): def __init__(self, gdb_inferior: Value) -> None: super().__init__(gdb_inferior, PageStruct) - self.ref = self._kstruct["ref_counts"] - self.attr = self._kstruct["attr"] + self.ref = self._kstruct["refs"] + self.type = self._kstruct["type"] + self.flags = self._kstruct["flags"] + self.order = self._kstruct["order"] + self.pool = self._kstruct["pool"] + + def uninitialized(self): + return not (self.flags & 0b10) + + def reserved(self): + return (not self.uninitialized() + and self.type == 0b1000 + and self.ref == 0xf0f0f0f0) + + def busy(self): + return (not self.uninitialized() + and self.ref > 0) @staticmethod def get_type() -> Type: - return lookup_type("struct pp_struct").pointer() + return lookup_type("struct ppage").pointer()