X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/50b4ecfb1b28e9b1dfc57b6a876fcdf938092152..2bfb909dde1241111ab5568f30c45d2644bdaf25:/lunaix-os/arch/LConfig diff --git a/lunaix-os/arch/LConfig b/lunaix-os/arch/LConfig index 7afea85..bb22a10 100644 --- a/lunaix-os/arch/LConfig +++ b/lunaix-os/arch/LConfig @@ -1,27 +1,35 @@ -include("x86/LConfig") +from . import x86 -@Collection("Platform") +@"Platform" def architecture_support(): """ Config ISA related features """ - @Term("Architecture") - def arch(): + @flag + def arch_x86_32() -> bool: + when(arch is "i386") + + @flag + def arch_x86_64() -> bool: + when(arch is "x86_64") + + @flag + def arch_x86() -> bool: + when(arch is "i386") + when(arch is "x86_64") + + @"Architecture" + def arch() -> "i386" | "x86_64": """ Config ISA support """ - # type(["i386", "x86_64", "aarch64", "rv64"]) - type(["i386", "x86_64"]) - default("x86_64") - - env_val = env("ARCH") - if env_val: - set_value(env_val) + _arch = env("ARCH") + return _arch if _arch else "x86_64" - @Term("Base operand size") - @ReadOnly - def arch_bits(): + @"Base operand size" + @readonly + def arch_bits() -> 32 | 64: """ Defines the base size of a general register of the current selected ISA. @@ -29,16 +37,15 @@ def architecture_support(): This the 'bits' part when we are talking about a CPU """ - type(["64", "32"]) - match v(arch): + match arch.val: case "i386": - default("32") + return 32 case "aarch64": - default("64") + return 64 case "rv64": - default("64") + return 64 case "x86_64": - default("64") + return 64 case _: - default("32") + return 32 \ No newline at end of file