add validator to restrict the flexibility of LConfig
[lunaix-os.git] / lunaix-os / hal / char / uart / LConfig
index 9ed1f09ec4d63177d8437e5b264c01477234986c..10a74f51ab2c84674d545e585bf9a0996d51dc09 100644 (file)
@@ -1,25 +1,18 @@
 
-@Collection("16x50 Serial Controller")
+@"16x50 Serial Controller"
+@(parent := char_device)
 def uart_16x50():
     """ 16x50 serial controller  """
 
-    # hal/char/LConfig::char_device
-    add_to_collection(char_device)
-
-    @Term("16x50 XT-Compat")
-    def xt_16x50():
+    @"16x50 XT-Compat"
+    def xt_16x50() -> bool:
         """ Enable the 16x50 for PC-compatible platform  """
-
-        type(bool)
-
-        is_x86 = v(arch) in ["i386", "x86_64"]
-        default(is_x86)
-
-        return is_x86
+        require(arch_x86)
+        
+        return True
     
-    @Term("16x50 PCI")
-    def pci_16x50():
+    @"16x50 PCI"
+    def pci_16x50() -> bool:
         """ Enable the support of PCI 16x50 """
-        type(bool)
 
-        default(True)
\ No newline at end of file
+        return True
\ No newline at end of file