X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/6f65553ca5d2740738f399d88b3a4eb298255427..e2994a5332194a132c60db35c55a006bdd1f6566:/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 6dc5bf9..cbb17f5 100644 --- a/lunaix-os/scripts/gdb/lunadbg/structs/page.py +++ b/lunaix-os/scripts/gdb/lunadbg/structs/page.py @@ -9,6 +9,7 @@ class PageStruct(KernelStruct): self.flags = self._kstruct["flags"] self.order = self._kstruct["order"] self.pool = self._kstruct["pool"] + self.companion = self._kstruct["companion"] def uninitialized(self): return not (self.flags & 0b10) @@ -20,8 +21,12 @@ class PageStruct(KernelStruct): def busy(self): return (not self.uninitialized() + and self.type != 0b1000 and self.ref > 0) + def lead_page(self): + return self.companion == 0 and not self.uninitialized() + @staticmethod def get_type() -> Type: return lookup_type("struct ppage").pointer()