X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/1025235c72c31f7fa7b648c0e32ddcaa68a8f66a..d15268ba6eadf89a38087995ff407f50418485fb:/lunaix-os/kernel/mm/LConfig?ds=sidebyside diff --git a/lunaix-os/kernel/mm/LConfig b/lunaix-os/kernel/mm/LConfig index 7db89f5..8f8d4b9 100644 --- a/lunaix-os/kernel/mm/LConfig +++ b/lunaix-os/kernel/mm/LConfig @@ -1,92 +1,92 @@ -@Collection +@"Memory Management" +@(parent := kernel_feature) def memory_subsystem(): """ Config the memory subsystem """ - @Collection + @"Physical Memory" def physical_mm(): """ Physical memory manager """ - @Term - def pmalloc_method(): + @flag + def pmalloc_method_simple() -> bool: + return pmalloc_method.val == "simple" + + @flag + def pmalloc_method_buddy() -> bool: + return pmalloc_method.val == "buddy" + + @flag + def pmalloc_method_ncontig() -> bool: + return pmalloc_method.val == "ncontig" + + @"Allocation policy" + def pmalloc_method() -> "simple" | "buddy" | "ncontig": """ Allocation policy for phiscal memory """ - type(["simple", "buddy", "ncontig"]) - default("simple") + return "simple" - @Group + @"PMalloc Thresholds" def pmalloc_simple_po_thresholds(): + + require(pmalloc_method_simple) - @Term - def pmalloc_simple_max_po0(): + @"Maximum cached order-0 free pages" + def pmalloc_simple_max_po0() -> int: """ free list capacity for order-0 pages """ - type(int) - default(4096) + return 4096 - @Term - def pmalloc_simple_max_po1(): + @"Maximum cached order-1 free pages" + def pmalloc_simple_max_po1() -> int: """ free list capacity for order-1 pages """ - type(int) - default(2048) + return 2048 - @Term - def pmalloc_simple_max_po2(): + @"Maximum cached order-2 free pages" + def pmalloc_simple_max_po2() -> int: """ free list capacity for order-2 pages """ - type(int) - default(2048) + return 2048 - @Term - def pmalloc_simple_max_po3(): + @"Maximum cached order-3 free pages" + def pmalloc_simple_max_po3() -> int: """ free list capacity for order-3 pages """ - type(int) - default(2048) + return 2048 - @Term - def pmalloc_simple_max_po4(): + @"Maximum cached order-4 free pages" + def pmalloc_simple_max_po4() -> int: """ free list capacity for order-4 pages """ - type(int) - default(512) + return 512 - @Term - def pmalloc_simple_max_po5(): + @"Maximum cached order-5 free pages" + def pmalloc_simple_max_po5() -> int: """ free list capacity for order-5 pages """ - type(int) - default(512) + return 512 - @Term - def pmalloc_simple_max_po6(): + @"Maximum cached order-6 free pages" + def pmalloc_simple_max_po6() -> int: """ free list capacity for order-6 pages """ - type(int) - default(128) + return 128 - @Term - def pmalloc_simple_max_po7(): + @"Maximum cached order-7 free pages" + def pmalloc_simple_max_po7() -> int: """ free list capacity for order-7 pages """ - type(int) - default(128) + return 128 - @Term - def pmalloc_simple_max_po8(): + @"Maximum cached order-8 free pages" + def pmalloc_simple_max_po8() -> int: """ free list capacity for order-8 pages """ - type(int) - default(64) + return 64 - @Term - def pmalloc_simple_max_po9(): + @"Maximum cached order-9 free pages" + def pmalloc_simple_max_po9() -> int: """ free list capacity for order-9 pages """ - type(int) - default(32) - - return v(pmalloc_method) == "simple" - - add_to_collection(kernel_feature) \ No newline at end of file + return 32 \ No newline at end of file