add validator to restrict the flexibility of LConfig
[lunaix-os.git] / lunaix-os / kernel / mm / LConfig
index 8f8d4b9f9c8da1308f5f8cfe7352ffacdce64749..fa7c431055201217f09511e6b60ed354f802a5f9 100644 (file)
@@ -10,15 +10,15 @@ def memory_subsystem():
 
         @flag
         def pmalloc_method_simple() -> bool:
-            return pmalloc_method.val == "simple"
+            when (pmalloc_method is "simple")
         
         @flag
         def pmalloc_method_buddy() -> bool:
-            return pmalloc_method.val == "buddy"
+            when (pmalloc_method is "buddy")
         
         @flag
         def pmalloc_method_ncontig() -> bool:
-            return pmalloc_method.val == "ncontig"
+            when (pmalloc_method is "ncontig")
 
         @"Allocation policy"
         def pmalloc_method() -> "simple" | "buddy" | "ncontig":
@@ -29,7 +29,7 @@ def memory_subsystem():
         @"PMalloc Thresholds"
         def pmalloc_simple_po_thresholds():
 
-            require(pmalloc_method_simple)
+            require (pmalloc_method_simple)
             
             @"Maximum cached order-0 free pages"
             def pmalloc_simple_max_po0() -> int: